CN110099439B - Time synchronization method and device - Google Patents

Time synchronization method and device Download PDF

Info

Publication number
CN110099439B
CN110099439B CN201910305845.4A CN201910305845A CN110099439B CN 110099439 B CN110099439 B CN 110099439B CN 201910305845 A CN201910305845 A CN 201910305845A CN 110099439 B CN110099439 B CN 110099439B
Authority
CN
China
Prior art keywords
time
network
sub
sending
edge
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201910305845.4A
Other languages
Chinese (zh)
Other versions
CN110099439A (en
Inventor
李华
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hangzhou H3C Technologies Co Ltd
Original Assignee
Hangzhou H3C Technologies 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 H3C Technologies Co Ltd filed Critical Hangzhou H3C Technologies Co Ltd
Priority to CN201910305845.4A priority Critical patent/CN110099439B/en
Publication of CN110099439A publication Critical patent/CN110099439A/en
Application granted granted Critical
Publication of CN110099439B publication Critical patent/CN110099439B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W56/00Synchronisation arrangements
    • H04W56/001Synchronization between nodes
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W56/00Synchronisation arrangements
    • H04W56/001Synchronization between nodes
    • H04W56/0015Synchronization between nodes one node acting as a reference for the others

Landscapes

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

Abstract

The application provides a time synchronization method and a time synchronization device, and relates to the technical field of communication. The method comprises the following steps: sending a first time synchronization instruction to each reference AP, wherein the first time synchronization instruction is used for instructing the reference AP to send a second time synchronization instruction to each member AP included in the located sub-network; receiving a sending time stamp and a first receiving time stamp of a second time synchronization instruction returned by each member AP in each sub-network; determining time adjustment information of a first type of AP according to the network attribution relation, the sending time stamp and the first receiving time stamp of the edge AP, wherein the first type of AP is an AP of which the time is to be adjusted; and sending a third time synchronization instruction to the first-class AP according to the time adjustment information, and indicating the first-class AP to perform time synchronization operation. According to the method, time synchronization in a large-scale whole network range is realized on the premise of not increasing the total cost of equipment, and the problems of high complexity and high cost in the existing method are solved.

Description

Time synchronization method and device
Technical Field
The present application relates to the field of communications technologies, and in particular, to a time synchronization method and apparatus.
Background
For example, in the field of mobile communication, in order to maintain the communication time slots to be consistent between different base stations, a high-precision time synchronization operation is often required. As another example, in the field Of wireless location, a Time Difference Of Arrival (TDOA) location may be performed if multiple different devices remain Time synchronized. As another example, in the multimedia field, accurate time synchronization is required between different speakers in order to recover information of different channels in the original scene.
In recent years, Wireless Local Area Networks (WLAN) technology has developed rapidly, and WLAN terminals and Wireless Access Points (AP) have become popular rapidly; therefore, it becomes more convenient to achieve time synchronization between devices based on the WLAN network. In order to meet the requirement of high-precision clock synchronization in a wireless local area network, a timestamp function is provided, namely, the WLAN equipment can accurately record the time of receiving a message. However, for a slightly large-scale WLAN network, due to the limitation of the coverage of wireless signals, it is impossible to directly communicate with all other APs in the WLAN through a certain AP, and therefore, for a slightly large-scale network, it is impossible to simultaneously perform time synchronization between APs at different locations. In contrast, a time synchronization method based on a Picture Transfer Protocol (PTP) is proposed, but the complexity and cost are high, and a special physical layer clock chip needs to be added, thereby limiting the large-scale use of the method.
Disclosure of Invention
In view of the above, the present application provides a time synchronization method and apparatus, which are intended to solve at least one of the above technical problems to a first extent.
In order to achieve the above object, a first aspect of the present application provides a time synchronization method applied to a server, where the server divides a wireless local area network into a plurality of sub-networks, each sub-network includes a reference AP and a plurality of member APs, and different sub-networks maintain communication connection through an edge AP, and the method includes:
sending a first time synchronization instruction to each reference AP, wherein the first time synchronization instruction is used for instructing the reference AP to send a second time synchronization instruction to each member AP included in the sub-network;
receiving time information returned by each member AP in each sub-network, wherein the time information comprises a sending time stamp and a first receiving time stamp of the second time synchronization instruction;
determining time adjustment information of a first type of AP according to the network attribution relation of the edge AP, the sending time stamp and the first receiving time stamp, wherein the first type of AP is an AP of which the time is to be adjusted;
and sending a third time synchronization instruction to the first-class AP according to the time adjustment information, wherein the third time synchronization instruction is used for indicating the first-class AP to perform time synchronization operation.
In order to achieve the above object, a second aspect of the present application provides a time synchronization method applied to an access point AP, in which a server partitions a wireless local area network into a plurality of sub-networks, each sub-network includes a reference AP and a plurality of member APs, and different sub-networks maintain communication connection through an edge AP, the method includes:
when the access point AP is a reference AP, receiving a first time synchronization instruction sent by a server;
and sending a second time synchronization instruction to each member AP included in the sub-network according to the first time synchronization instruction, wherein the second time synchronization instruction is used for indicating the member AP to send a sending time stamp and a first receiving time stamp of the second time synchronization instruction to the server, so that the server determines time adjustment information of the first type of AP according to the network attribution relation, the sending time stamp and the first receiving time stamp corresponding to the edge AP, and the first type of AP is an AP with time to be adjusted.
In order to achieve the above object, a third aspect of the present application provides a time synchronization apparatus applied to a server, the apparatus including:
a first sending unit, configured to send a first time synchronization instruction to each reference AP, where the first time synchronization instruction is used to instruct the reference AP to send a second time synchronization instruction to each member AP included in a sub-network where the reference AP is located;
a receiving unit, configured to receive time information returned by each member AP in each subnet, where the time information includes a sending timestamp and a first receiving timestamp of the second time synchronization instruction;
a determining unit, configured to determine time adjustment information of a first type of AP according to a network affiliation relationship corresponding to an edge AP, the sending timestamp, and the first receiving timestamp, where the first type of AP is an AP whose time is to be adjusted;
a second sending unit, configured to send a third time synchronization instruction to the first class AP according to the time adjustment information, where the third time synchronization instruction is used to instruct the first class AP to perform a time synchronization operation.
In order to achieve the above object, a fourth aspect of the present invention provides a time synchronization apparatus, applied to an access point AP, the apparatus including:
a receiving unit, configured to receive a first time synchronization instruction sent by a server when the AP is a reference AP;
and the sending unit is used for sending a second time synchronization instruction to each member AP included in the sub-network according to the first time synchronization instruction, wherein the second time synchronization instruction is used for indicating the member AP to send a sending time stamp and a first receiving time stamp of the second time synchronization instruction to the server, so that the server determines the time adjustment information of the first type of AP according to the network attribution relationship corresponding to the edge AP, the sending time stamp and the first receiving time stamp, and the first type of AP is an AP with time to be adjusted.
According to the technical scheme, the large-scale wireless local area network is divided into a plurality of sub-networks, different sub-networks are kept in communication connection through the edge AP, so that only a first time synchronization instruction is sent to a reference access point AP of each sub-network, time information returned by each member AP in the wireless local area network can be obtained, and time synchronization operation can be simultaneously carried out on each AP to be adjusted in the large-scale wireless local area network according to the time information and the attribution relationship of the edge AP; in the mode, the time synchronization of the whole network range is realized by depending on the hardware resources of the existing equipment of the wireless local area network, and the problems of high complexity and high cost of the existing time synchronization method are solved.
Drawings
Various other advantages and benefits will become apparent to those of ordinary skill in the art upon reading the following detailed description of the preferred embodiments. The drawings are only for purposes of illustrating the preferred embodiments and are not to be construed as limiting the application. Also, like reference numerals are used to refer to like parts throughout the drawings. In the drawings:
FIG. 1 is a schematic diagram of a time synchronization system according to some embodiments of the present application;
fig. 2 is a schematic structural diagram of a wireless lan divided into a plurality of sub-networks according to some embodiments of the present application;
fig. 3 is a flowchart of a time synchronization method applied to a server according to some embodiments of the present application;
FIG. 4 is a detailed diagram of step 103 provided by some embodiments of the present application;
fig. 5 is a flowchart of a time synchronization method applied to an AP according to some embodiments of the present application;
fig. 6 is a schematic structural diagram of a time synchronization apparatus applied to a server according to some embodiments of the present application;
fig. 7 is a schematic structural diagram of a time synchronization apparatus applied to an access point AP according to some embodiments of the present application.
Detailed Description
Exemplary embodiments of the present application will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the present application are shown in the drawings, it should be understood that the present application may be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
Furthermore, the terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. As used in this application and the claims, the singular forms "a", "an", and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should also be understood that the term "and/or" as used herein is meant to encompass any and all possible combinations of one or more of the associated listed items. It is to be understood that although the terms first, second, third, etc. may be used herein to describe various information, such information should not be limited to these terms. These terms are only used to distinguish one type of information from another. For example, first information may also be referred to as second information, and similarly, second information may also be referred to as first information, without departing from the scope of the present application. Depending on the context, moreover, the word "if" is used may be interpreted as "at … …," or "when … …," or "in response to a determination.
Fig. 1 is a schematic structural diagram of a time synchronization system provided in an embodiment of the present application, and as shown in fig. 1, the time synchronization system includes: a server and a plurality of Access Points (APs) in a wireless local area network; the server divides the wireless local area network into a plurality of sub-networks, each sub-network comprises a reference AP and a plurality of member APs, different sub-networks are in communication connection through the edge APs, and time synchronization operation of the whole network is carried out based on the divided wireless local area network. Therefore, the edge AP can be used as a medium for time synchronization among different sub-networks, and the problem that APs at different places in a slightly large-scale network cannot simultaneously perform time synchronization due to the limitation of the coverage range of wireless signals is avoided.
Specifically, the server firstly imports topology information of each AP in the wireless local area network, wherein the topology information comprises position information, identification information and the like, divides the wireless local area network into a plurality of sub-networks with preset shapes according to the imported position information and preset measurement information, and determines a reference AP and a member AP which are included in each sub-network and an edge AP between different sub-networks. The location information is, for example, coordinates, and the identification information is, for example, a MAC address, a device identification, and the like; the preset measurement information and the preset shape can be set automatically as required in practical application; as an example, if the preset measurement information is a radius length and the preset shape is a circle, selecting a certain position as a circle center, and making a circle according to the preset radius length to obtain a plurality of circular sub-networks; as another example, the preset metric information is length and width, and the preset shape is a rectangle, then the preset length and width are respectively made into a rectangle, so as to obtain a plurality of rectangular sub-networks. In the embodiment of the present application, a schematic diagram of dividing a wireless local area network into a plurality of subnets is shown in fig. 2, in which predetermined metric information is taken as a radius length and a predetermined shape is a circle, and the subnets are numbered for convenience of distinction, so as to obtain subnetwork 1, subnetwork 2, subnetwork 3, subnetwork 4, and subnetwork 5.
Further, determining the reference AP and the member AP included in each sub-network, and the edge AP between different sub-networks includes: taking the APs belonging to different sub-networks as edge APs of the different sub-networks, and selecting one AP except the edge AP as a current AP in each sub-network in sequence; according to the imported position information, calculating the total distance between the current AP and other APs included in the sub-network where the current AP is located, and obtaining the total distance corresponding to each AP except the edge AP in the sub-network; comparing the total distance corresponding to each AP except the edge AP in the sub-network to obtain the minimum total distance; taking the AP corresponding to the minimum total distance as a reference AP of the sub-network, and taking other APs in the sub-network as member APs of the sub-network; that is, the member APs include the edge AP, and the edge AP does not include the reference AP.
For the sake of convenience of distinction, the APs in the wireless lan are denoted as AP1, AP2, AP3 … APn, where n is the total number of APs in the wireless lan, for example, in the schematic diagram shown in fig. 2, AP13 is the reference AP of subnet 1, AP10, AP12, AP13, AP14, AP15 are member APs of subnet 1, where AP14 is the edge AP of subnet 1 and subnet 4, AP14 and AP15 are the edge APs of subnet 1 and subnet 3, and AP15 is the edge AP of subnet 1 and subnet 2.
Based on the above system and the divided wireless local area network, an embodiment of the time synchronization method provided in the present application is given below with reference to the accompanying drawings.
Fig. 3 is a schematic flowchart of a time synchronization method provided in some embodiments of the present application, applied to a server, where the time synchronization method includes the following steps:
step 101: sending a first time synchronization instruction to each reference AP, wherein the first time synchronization instruction is used for instructing the reference AP to send a second time synchronization instruction to each member AP included in the located sub-network;
the first time synchronization instruction comprises identification information of each member AP included in a sub-network where the reference AP is located; correspondingly, when the reference AP receives the first time synchronization instruction, a second time synchronization instruction is sent to the member AP corresponding to each identification information according to the identification information contained in the first time synchronization instruction.
Further, the second time synchronization instruction includes identification information of the reference AP and a transmission timestamp for the reference AP to transmit the second time synchronization instruction; it should be noted that the transmission timestamp is measured by the wireless chip in the reference AP, and software is not needed, so that high accuracy of the transmission timestamp is ensured, and high accuracy of subsequent time synchronization is ensured.
Further, when the member AP receives the second time synchronization command, the member AP reads a transmission time stamp included in the second time synchronization command, and transmits the time information to the server by using the transmission time stamp and a first reception time stamp of the second time synchronization command received by the member AP as time information. It should be noted that the first receiving timestamp is measured by a wireless chip in the member AP, and software is not needed, so that high accuracy of the first receiving timestamp is ensured, and high accuracy of subsequent time synchronization is ensured.
Step 102: receiving time information returned by each member AP in each sub-network, wherein the time information comprises a sending time stamp and a first receiving time stamp of a second time synchronization instruction;
specifically, the time information returned by each member AP and the identification information of the member AP are received, the member AP to which the time information belongs is determined according to the identification information, and the time adjustment information is determined according to the time information returned by each member AP in the following.
Step 103: determining time adjustment information of a first type of AP according to the network attribution relation of the edge AP, the received sending time stamp and a first receiving time stamp, wherein the first type of AP is an AP of which the time is to be adjusted;
step 104: and sending a third time synchronization instruction to the first-class AP according to the determined time adjustment information, wherein the third time synchronization instruction is used for indicating the first-class AP to perform time synchronization operation.
Therefore, the large-scale wireless local area network is divided into a plurality of sub-networks, different sub-networks are in communication connection through the edge AP, and only the first time synchronization instruction is sent to the reference AP of each sub-network, so that the time information returned by each member AP in the wireless local area network can be obtained, and the time synchronization operation of each AP to be adjusted in the large-scale wireless local area network can be realized according to the time information and the network attribution relation of the edge AP; in the mode, the time synchronization of the whole network range is realized by depending on the hardware resources of the existing equipment of the wireless local area network, and the problems of high complexity and high cost of the existing time synchronization method are solved.
Optionally, in some embodiments of the present application, as shown in fig. 4, step 103 includes:
step 103-1: calculating the transmission time delay in each sub network according to the imported position information;
specifically, the distance between each member AP and a reference AP of the sub-network where the member AP is located is calculated according to the imported location information; obtaining the transmission time delay between each member AP and a reference AP of the sub-network according to the calculated distance and the preset light speed; wherein, the transmission delay is distance/preset light speed.
Step 103-2: selecting a target AP from a plurality of reference APs of a wireless local area network;
specifically, one reference AP is randomly selected as a target AP from a plurality of reference APs included in the wireless local area network, so that the time of the target AP is used as the reference time of the wireless local area network, and the time adjustment information of the AP whose time is to be adjusted in the wireless local area network relative to the reference time is determined.
Step 103-3: determining a target communication path between a reference AP and a target AP of each sub-network to which the edge AP belongs according to the network attribution relationship of the edge AP;
optionally, in some embodiments of the present application, step 103-3 comprises:
step A1: taking a reference AP of one sub-network to which the edge AP belongs as a current reference AP;
step A2: taking the current reference AP as a starting point and the target AP as an end point, and searching all communication paths between the current reference AP and the target AP;
step A3: screening a first communication path consisting of a reference AP and a target AP from all searched communication paths;
step A4: counting the number of the first communication paths;
step A5: and determining a target communication path between the current reference AP and the target AP according to the number of the first communication paths and the number of the APs included in each first communication path.
All communication paths between the current reference AP and the target AP comprise a communication path consisting of the current reference AP, other reference APs, the member AP and the target AP, a communication path consisting of the current reference AP, the member AP and the target AP, and a communication path consisting of the current reference AP, the other reference APs and the target AP; a communication path composed only of the reference AP and the target AP is screened out of all the communication paths, and is used as a first communication path. Since the number of the first communication paths may be one or more, in order to reduce the calculation amount of the subsequent determination of the time synchronization information, a target communication path is selected from the first communication paths according to the number of the first communication paths and the number of APs included in each first communication path.
Optionally, in some embodiments of the present application, step a5 includes:
judging whether the number of the first communication paths is unique or not, and if so, taking the first communication paths as target communication paths between the current reference AP and the target AP; and if the number of the first communication paths is not unique, determining the number of the APs included in each first communication path, and selecting the first communication path with the least number of the APs from the plurality of first communication paths as a target communication path between the current reference AP and the target AP.
The first communication path with the least number of APs is the shortest communication path between the current reference AP and the target AP, and the first communication path is used as the target communication path between the current reference AP and the target AP, so that the calculation amount of the subsequent determination of the time synchronization information can be reduced, and the efficiency is improved. Further, when there are a plurality of first communication paths including the smallest number of APs, one first communication path is randomly selected as the target communication path among the plurality of first communication paths including the smallest number of APs.
Step 103-4: determining a first time difference between every two adjacent APs in the target communication path according to the determined transmission delay, the sending time stamp and the first receiving time stamp returned by the edge AP;
optionally, in some embodiments of the present application, step 103-4 comprises:
step B1: subtracting the transmission time delay between the first receiving time stamp returned by each member AP and the reference AP of the sub-network where each member AP is located to obtain a second receiving time stamp of each member AP;
considering that for the same sub-network, the distances between each member AP included in the sub-network and the reference AP of the sub-network are often unequal, and the transmission delay of the member APs far away from the sub-network is larger; in order to avoid a time error caused by transmission delay, in this embodiment, the first timestamp returned by the member AP is corrected by using the transmission delay, that is, the first receiving timestamp returned by each member AP subtracts the transmission delay between each member AP and the reference AP of the sub-network where the member AP is located, so as to obtain a corrected second receiving timestamp, and subsequently, time adjustment information is determined according to the second receiving timestamp, so that the accuracy of the time adjustment information is ensured.
Step B2: respectively taking two adjacent APs in the target communication path as a first AP and a second AP, and taking an edge AP which belongs to a sub-network where the first AP is located and a sub-network where the second AP is located at the same time as a current edge AP;
step B3: subtracting a second receiving time stamp and a sending time stamp of the current edge AP in the sub-network where the first AP is located to obtain a second time difference between the current edge AP and the first AP;
step B4: subtracting a second receiving time stamp and a sending time stamp of the current edge AP in the sub-network where the second AP is located to obtain a third time difference between the current edge AP and the second AP;
the execution sequence of step B3 and step B4 can be interchanged, and can also be executed simultaneously.
Step B5: calculating a first average value of the second time difference and a second average value of the third time difference;
step B6: and subtracting the first average value from the second average value to obtain a first time difference between the first AP and the second AP.
Because the current edge AP belongs to both the sub-network where the first AP is located and the sub-network where the second AP is located, the current edge AP can receive the second time synchronization instruction sent by the first AP and also can receive the time synchronization instruction sent by the second AP and send two corresponding pieces of time information to the server. The server respectively calculates a second time difference between the current edge AP and the first AP and a third time difference between the current edge AP and the second AP according to the two pieces of time information returned by the current edge AP, and subtracts a first average value of the second time difference from a second average value of the third time difference to obtain a first time difference between the first AP and the second AP; note that the first time difference may be any one of zero, a positive number, and a negative number, and when the first time difference is zero, it indicates that the first AP and the second AP are the same in time; when the first time difference is a positive number, the time of the first AP is faster than that of the second AP; when the first time difference is negative, it indicates that the first AP is slower than the second AP.
Further, taking the identification information of each AP as an MAC address for example, a second time difference between the current edge AP and the first AP is recorded as Tdiff _ net1_mac1、Tdiff_net1_mac2…Tdiff_net1_macmRecording the third time difference between the current edge AP and the second AP as Tdiff _ net2_mac1、Tdiff_net2_mac2…Tdiff_net2_macmWherein m is the number of current edge APs; the first average and the second average may be expressed as follows:
the first mean is expressed as:
F1=(Tdiff_net1_mac1+Tdiff_net1_mac2+…+Tdiff_net1_macm)/m;
the second mean is expressed as:
F2=(Tdiff_net2_mac1+Tdiff_net2_mac2+…+Tdiff_net2_macm)/m。
step 103-5: and determining the time adjustment information of the first type AP relative to the target AP according to the first time difference, the sending time stamp and the first receiving time stamp returned by each member AP.
Optionally, in some embodiments of the present application, step 103-5 comprises:
step C1: acquiring a fourth time difference of each member AP included in a sub-network where the target AP is located, and taking the non-zero fourth time difference as time adjustment information of the member AP relative to the target AP, wherein the fourth time difference is a difference value of a second receiving timestamp and a sending timestamp of the member AP;
in some embodiments of the present application, obtaining the fourth time difference of each member AP included in the subnet in which the target AP is located includes: and searching the second receiving time stamp and the sending time stamp of the member AP included in the sub-network where the target AP is located in the second receiving time stamps and the sending time stamps of all the member APs, and subtracting the searched second receiving time stamp and the sending time stamp of the member AP to obtain a fourth time difference.
In other embodiments of the present application, obtaining the fourth time difference of each member AP included in the subnet in which the target AP is located includes: and subtracting the second receiving time stamp and the sending time stamp of each member AP to obtain an eighth time difference between each member AP and the reference AP of the sub-network, screening the eighth time difference of each member AP included in the sub-network where the target AP is located in the eighth time difference, and taking the screened eighth time difference as a fourth time difference.
It is noted that step C1 may also be performed after C6.
Step C2: accumulating the first time difference between every two adjacent APs in the target communication path to obtain a fifth time difference;
wherein the fifth time difference is the time difference of the reference AP as the starting point in the target communication path with respect to the target AP.
Step C3: when the fifth time difference is not zero, acquiring a sixth time difference of each member AP included in a sub-network where the reference AP serving as a starting point is located in the target communication path, wherein the sixth time difference is a difference value between a second receiving time stamp and a sending time stamp of the member AP;
specifically, when the fifth time difference is not zero, it is determined that the reference AP as the starting point in the target communication path has a time difference with respect to the target AP, and then a sixth time difference is calculated for each member AP included in the subnet where the reference AP as the starting point in the target communication path is located with respect to the reference AP as the starting point, so that the time difference between the member AP and the target AP, that is, the time adjustment information of the member AP with respect to the target AP is calculated based on the sixth time difference and the fifth time difference.
Further, the sixth time difference may be obtained in the manner of obtaining the fourth time difference, which is not described herein again.
Step C4: adding the sixth time difference and the fifth time difference to obtain a seventh time difference, and using the seventh time difference as time adjustment information of the member AP relative to the target AP;
specifically, the sixth time difference of each member AP included in the subnet where the reference AP as the starting point in the target communication path is located with respect to the reference AP as the starting point is added to the fifth time difference between the reference AP as the starting point and the target AP, so as to obtain the time adjustment information of each member AP included in the subnet where the reference AP as the starting point is located with respect to the target AP.
Step C5: time adjustment information of a reference AP serving as a starting point in the target communication path relative to the target AP is set by the fifth time difference;
step C6: and when the fifth time difference is zero, acquiring a sixth time difference of each member AP included in the sub-network where the reference AP serving as the starting point is located in the target communication path, and taking the non-zero sixth time difference as time adjustment information of the member AP relative to the target AP.
Specifically, when the fifth time difference is zero, it is determined that the reference AP as the starting point in the target communication path does not have a time difference with respect to the target AP, a sixth time difference of each member AP included in the subnet where the reference AP as the starting point is located is acquired, when the sixth time difference is zero, it is determined that the corresponding member AP does not have a time difference with respect to the target AP, and when the sixth time difference is not zero, the sixth time difference is used as time adjustment information of the member AP with respect to the target AP. For the acquisition manner of the sixth time difference, reference may be made to the acquisition manner of the fourth time difference, which is not described herein again.
It should be noted that, since the edge AP belongs to multiple subnetworks simultaneously, the time synchronization information may be calculated only once for the edge AP whose time is to be adjusted, for example, after the AP27 shown in fig. 2 is the target AP, and the AP15 is the edge AP of the subnetwork 1 and the subnetwork 2, and the time adjustment information of the AP15 relative to the AP27 is calculated according to the fifth time difference between the AP13 and the AP17 and the sixth time difference of the AP15, the time adjustment information of the AP15 relative to the AP27 does not need to be calculated again according to the fifth time difference between the AP16 and the AP27 and the sixth time difference of the AP 15. Therefore, excessive repeated calculation can be avoided, and the calculation efficiency is improved.
Based on any one of the foregoing embodiments, in some embodiments of the present application, step 101 further includes, before: a notification message is sent to each AP, the notification message including type information for each AP to determine the identity attribute.
Specifically, after a server determines a reference AP and member APs of each sub-network, a notification message is sent to each reference AP, the notification message comprises type information of the APs as the reference AP, the notification message comprises the type information of the APs as the member APs, so that the reference AP determines the identity attribute of the reference AP as the reference AP according to the type information, and when a first time synchronization instruction sent by the server is received, a second time synchronization instruction is sent to each member AP included in the sub-network; and enabling the member AP to determine the identity attribute of the member AP as the member AP according to the type information, and sending a sending time stamp and a first receiving time stamp of a second time synchronization instruction to the server when receiving the second time synchronization instruction sent by the reference AP.
Optionally, in some embodiments of the present application, step 101 further includes, before:
and sending the identification information of the reference AP of the sub-network where the member AP is located to each member AP, so that the member AP compares the received identification information with the identification information in the second time synchronization instruction, and determines the reference AP for sending the second time synchronization instruction.
Specifically, after the server determines the reference AP and the member AP of each sub-network, the server sends the identification information of the reference AP of the sub-network where the member AP is located to each member AP, the member AP stores the received identification information, and when receiving the second time synchronization instruction, compares the identification information contained in the second time synchronization instruction with the stored identification information to verify that the received second time synchronization instruction is from the reference AP of the sub-network where the member AP is located.
Therefore, in the technical scheme of the application, a large-scale wireless local area network is divided into a plurality of sub-networks, and different sub-networks are kept in communication connection through the edge AP, so that only a first time synchronization instruction is sent to a reference AP of each sub-network, the time information returned by each member AP in the wireless local area network can be obtained, and the time synchronization operation of each AP to be adjusted in time in the large-scale wireless local area network can be realized simultaneously according to the time information and the attribution relationship of the edge AP; in the mode, the time synchronization of the whole network range is realized by depending on the hardware resources of the existing equipment of the wireless local area network, and the problems of high complexity and high cost of the existing time synchronization method are solved.
Fig. 5 is a schematic flowchart of a time synchronization method according to some embodiments of the present application, applied to an access point AP, as shown in fig. 5, where the time synchronization method includes:
step 201: when the AP is a reference AP, receiving a first time synchronization instruction sent by a server;
step 202: and sending a second time synchronization instruction to each member AP included in the sub-network according to the first time synchronization instruction, wherein the second time synchronization instruction is used for indicating the member AP to send a sending time stamp and a first receiving time stamp of the second time synchronization instruction to the server, so that the server determines the time adjustment information of the first type of AP according to the network attribution relation, the sending time stamp and the first receiving time stamp corresponding to the edge AP, and the first type of AP is the AP with the time to be adjusted.
The first time synchronization instruction carries identification information of each member AP included in a sub-network where the reference AP is located, and the reference AP sends a second time synchronization instruction to the member AP corresponding to the identification information; the second time synchronization instruction carries a sending time stamp of sending the second time synchronization instruction by the reference AP, so that the member AP sends a first receiving time stamp of receiving the second time synchronization instruction by the member AP and a sending time stamp of sending the second time synchronization instruction by the reference AP to the server.
Optionally, the method further comprises:
step 301: when the access point AP is a member AP, receiving a second time synchronization instruction sent by a reference AP in the same sub-network;
step 302: acquiring a sending time stamp for sending the second time synchronization instruction and a first receiving time stamp for receiving the second time synchronization instruction according to the second time synchronization instruction;
specifically, the second time synchronization instruction is analyzed to obtain a sending time stamp carried by the second time synchronization instruction, and a first receiving time stamp measured by the wireless chip of the wireless chip is read.
Step 303: and sending the obtained sending time stamp and the first receiving time stamp to a server so that the server determines the time adjustment information of the first type of AP according to the network attribution relation, the sending time stamp and the first receiving time stamp corresponding to the edge AP, wherein the first type of AP is the AP with the time to be adjusted.
Specifically, the acquired sending timestamp and first receiving timestamp, and the identification information of the server are sent to the server, so that the server determines the member AP to which the sending timestamp and the first receiving timestamp belong.
Optionally, in some embodiments of the present application, step 301 further includes, before: receiving identification information of a reference AP which is in the same sub-network with the member AP and is sent by a server, and storing the identification information;
correspondingly, step 302 is preceded by: and comparing the stored identification information with the identification information in the second time synchronization instruction, and determining a reference AP for sending the second time synchronization instruction.
Specifically, it is determined whether the stored identification information is the same as the identification information in the second time synchronization command, and if the determination result is yes, it is determined that the reference AP that transmitted the second time synchronization command is the reference AP of the subnet in which the member AP is located, and step 302 is executed.
Optionally, in some embodiments of the present application, step 201 further includes:
receiving a notification message sent by a server, wherein the notification message comprises type information;
and determining the identity attribute according to the received type information.
Specifically, the AP receives the notification message sent by the server, determines the identity attribute of the AP as a reference AP when the type information included in the notification message is the reference AP, and determines the identity attribute of the AP as a member AP when the type information included in the notification message is the member AP.
Therefore, each AP executes corresponding operation according to the identity of the AP and the received instruction so as to send the time information to the server, so that the server can realize time synchronization operation on each AP with time to be adjusted in a larger-scale wireless local area network based on the divided network according to the time information and the attribution relation of the edge AP; in the mode, the time synchronization of the whole network range is realized by depending on the hardware resources of the existing equipment of the wireless local area network, and the problems of high complexity and high cost of the existing time synchronization method are solved.
The time synchronization method is described in detail below with reference to a specific embodiment;
step 401: the method comprises the steps that a server imports topology information of each AP device in a wireless local area network, wherein the topology information comprises position information and identification information;
step 402: the server divides the wireless local area network into a plurality of sub-networks according to the imported position information, and different sub-networks are kept in communication connection through the edge AP;
step 403: the server determines a reference AP and a plurality of member APs included in each sub-network according to the imported position information;
step 404: the server sends type information to each AP, so that each AP determines the identity according to the type information;
step 405: the server sends the identification information of the reference AP of the sub-network where the member AP is located to each member AP, and the member AP stores the received identification information;
step 404 and step 405 may also be performed simultaneously, that is, sending type information to each reference AP, and sending the type information and the identification information of the reference AP of the sub-network where the member AP is located to each member AP.
Step 406: the server sends a first time synchronization instruction to each reference AP;
step 407: the reference AP sends a second time synchronization instruction to the member AP corresponding to the identification information included in the first time synchronization instruction, wherein the second time synchronization instruction includes the identification information of the reference AP and a sending time stamp of the second time synchronization instruction;
step 408: the member AP receives the second time synchronization instruction, compares the stored identification information with the identification information in the second time synchronization instruction, and executes the step 409 when the reference AP which sends the second time synchronization instruction is determined to be the reference AP of the sub-network in which the member AP is positioned, otherwise, the step is finished;
step 409: the member AP takes a sending time stamp contained in the second time synchronization instruction and a first receiving time stamp of the member AP for receiving the second time synchronization instruction as time information and sends the time information to the server;
step 410: the server receives the time information returned by each member AP;
step 411: the server calculates the transmission time delay in each sub-network according to the imported position information;
step 412: the server randomly selects a target AP from a plurality of reference APs of the wireless local area network;
step 413: the server takes the reference AP of one sub-network to which the edge AP belongs as the current reference AP;
step 414: the server takes the current reference AP as a starting point and the target AP as an end point, and searches all communication paths between the current reference AP and the target AP;
step 415: the server screens a first communication path consisting of a reference AP and a target AP from all searched communication paths;
step 416: the server counts the number of the first communication paths, judges whether the number of the first communication paths is unique, if the number of the first communication paths is unique, executes step 417, and if the number of the first communication paths is not unique, executes step 418;
step 417: the server takes the first communication path as a target communication path between the current reference AP and the target AP, and executes step 419;
step 418: determining the number of APs included in each first communication path, selecting the first communication path with the least number of APs included from the plurality of first communication paths as a target communication path between the current reference AP and the target AP, and executing step 419;
step 419: the server determines a first time difference between every two adjacent APs in the target communication path according to the calculated transmission delay, the sending time stamp and the first receiving time stamp returned by the edge AP;
step 420: the server determines time adjustment information of the first type of AP relative to the target AP according to the determined first time difference, the sending time stamp and the first receiving time stamp returned by each member AP;
step 421: the server sends a third time synchronization instruction to the first-class AP according to the determined time adjustment information;
step 422: and the first-class AP executes time synchronization operation according to the third time synchronization instruction.
The specific implementation method of each step may refer to the related description in the foregoing embodiments, and is not described herein again. Further, to better understand the technical solution of the present application, a specific example of the present application is given, and referring to fig. 2, the server divides the wireless local area network into a sub-network 1, a sub-network 2, a sub-network 3, a sub-network 4, and a sub-network 5.
Wherein the triangle represents the reference AP and the quadrilateral represents the member AP, and the member AP includes the edge AP, for example, the reference AP of subnet 1 is AP13, and the member AP includes AP10, AP11, AP12, AP14, and AP15, where AP14 is the edge AP of subnet 1 and subnet 4, AP15 is the edge AP of subnet 1 and subnet 2, and AP14 and AP15 are the edge APs of subnet 1 and subnet 3.
After the server calculates the transmission delay in each sub-network according to the time information fed back by each member AP, the AP27 is selected as the target AP, and the reference AP13 of the sub-network 1 to which the edge AP14 belongs is used as the current reference AP.
The server searches communication paths between the AP13 and the AP27, and the communication paths comprise AP13-AP10-AP25-AP26-AP27, AP13-AP10-AP24-AP26-AP27, AP13-AP24-AP27, AP13-AP20-AP27, AP13-AP16-AP20-AP27, AP13-AP16-AP20-AP21-AP27 and the like. The server screens first communication paths consisting of the reference AP and the target AP from the first communication paths, wherein the first communication paths are AP13-AP24-AP27, AP13-AP20-AP27 and AP13-AP16-AP20-AP27, the total number of the first communication paths is 3, and the number of the APs included in each first communication path is counted by the server and is respectively 3, 3 and 4. If the number of the first communication paths including the AP is two, the server arbitrarily selects one of the first communication paths as the target communication path. For example, AP13-AP24-AP27 are selected as target communication paths.
The server calculates a first time difference between AP13 and AP24, for example, to +0.01 seconds, from the time information returned by AP14, with AP13 in the target communication path as the first AP and AP24 as the second AP. The server calculates a first time difference between AP24 and AP27, for example, to +0.02 seconds, from the time information returned by AP22 and AP26, using AP24 as the first AP and AP27 as the second AP. The server calculates the fourth time difference for the members AP21, AP22, AP26, AP28, AP29 included in the subnet 5 where the target AP27 is located, e.g., +0.01 second, 0 second, -0.001 second, -0.02 second, +0.03 second, respectively. The server takes +0.01 second as the time adjustment information of the AP21 relative to the AP27, the AP22 does not need to adjust the time, the server takes-0.001 second as the time adjustment information of the AP26 relative to the AP27, takes-0.02 second as the time adjustment information of the AP28 relative to the AP27, and takes +0.03 second as the time adjustment information of the AP29 relative to the AP 27.
Further, the server adds the first time difference between the AP13 and the AP24 and the first time difference between the AP24 and the AP27 to obtain a fifth time difference of +0.03 second, and determines that the time adjustment information of the AP13 relative to the AP27 is +0.03 second; and continuing to calculate the sixth time difference of the members AP10, AP11, AP12, AP10, AP14 and AP15 included in the subnet 1 where the AP13 is located. For example, if the time difference is +0.01, -0.04 seconds, +0.002 seconds, +0.004 seconds, +0.2 seconds, or 0 seconds, the server adds the sixth time difference to the fifth time difference, and obtains seventh time differences of +0.04 seconds, -0.01 seconds, 0.032 seconds, 0.034 seconds, 0.23 seconds, or 0.03 seconds. The server takes +0.04 seconds as the time adjustment information of AP10 with respect to AP27, -0.01 seconds as the time adjustment information of AP11 with respect to AP27, 0.032 seconds as the time adjustment information of AP12 with respect to AP27, 0.034 seconds as the time adjustment information of AP10 with respect to AP27, 0.23 seconds as the time adjustment information of AP14 with respect to AP27, and 0.03 seconds as the time adjustment information of AP15 with respect to AP 27.
According to the mode, after the server calculates the time adjustment information of each AP with time to be adjusted relative to the target AP in sequence, the server sends a third time synchronization instruction to the AP with time to be adjusted. The AP receiving the third time synchronization instruction performs the time adjustment operation according to the time adjustment information included in the third time synchronization instruction, for example, the AP11 adjusts its clock faster by 0.01 second according to-0.01 second included in the third time synchronization instruction, and the AP12 adjusts its clock slower by 0.032 second according to 0.032 second included in the third time synchronization instruction.
The above is a time synchronization method provided in the embodiments of the present application, and corresponding to the above method, the present application also provides a time synchronization apparatus, and since an implementation scheme for solving the problem of the apparatus is similar to the above method, corresponding contents to the method part may refer to the detailed description of the above method embodiments, and are not repeated in the following. It is understood that the apparatus provided in the present application may include a unit or a module capable of performing each step in the above method examples, and the unit or the module may be implemented by hardware, software, or a combination of hardware and software, and the present application is not limited thereto. The following description is made in conjunction with fig. 6 and 7.
Fig. 6 is a schematic diagram of a time synchronizer according to an embodiment of the present application, which is applied to a server, and as shown in fig. 6, the time synchronizer 10 includes:
a first sending unit 11, configured to send a first time synchronization instruction to each reference AP, where the first time synchronization instruction is used to instruct the reference AP to send a second time synchronization instruction to each member AP included in the sub-network where the reference AP is located;
a receiving unit 12, configured to receive time information returned by each member AP in each sub-network, where the time information includes a sending time stamp and a first receiving time stamp of the second time synchronization instruction;
a determining unit 13, configured to determine time adjustment information of a first type of AP according to a network affiliation relationship, a sending timestamp, and a first receiving timestamp corresponding to an edge AP, where the first type of AP is an AP whose time is to be adjusted;
a second sending unit 14, configured to send a third time synchronization instruction to the first-class AP according to the time adjustment information, where the third time synchronization instruction is used to instruct the first-class AP to perform a time synchronization operation.
Optionally, in some embodiments of the present application, the time synchronizer 10 further includes:
the device comprises an importing unit, a judging unit and a judging unit, wherein the importing unit is used for importing the position information of each AP in the wireless local area network;
accordingly, the first determination unit 13 includes:
the calculating subunit is used for calculating the transmission time delay in each sub-network according to the imported position information;
a selecting subunit, configured to select a target AP from a plurality of reference APs of a wireless local area network;
the first determining subunit is used for determining a target communicating path between the reference AP and the target AP of each sub-network to which the edge AP belongs according to the network attribution relationship of the edge AP;
the second determining subunit is used for determining a first time difference between every two adjacent APs in the target communication path according to the transmission delay, the sending time stamp and the first receiving time stamp returned by the edge AP;
and the third determining subunit is used for determining the time adjustment information of the first-class AP relative to the target AP according to the first time difference, the sending time stamp and the first receiving time stamp returned by each member AP.
Optionally, in some embodiments of the present application, the calculating subunit is specifically configured to:
calculating the distance between each member AP and a reference AP of the sub-network where the member AP is positioned according to the imported position information;
and obtaining the transmission time delay between each member AP and the reference AP of the sub-network according to the calculated distance and the preset light speed.
Optionally, in some embodiments of the present application, the first determining subunit is specifically configured to determine the first determination sub-unit
Taking a reference AP of one sub-network to which the edge AP belongs as a current reference AP;
taking the current reference AP as a starting point and the target AP as an end point, and searching all communication paths between the current reference AP and the target AP;
screening a first communication path consisting of a reference AP and a target AP from all communication paths;
counting the number of the first communication paths;
and determining a target communication path between the current reference AP and the target AP according to the number of the first communication paths and the number of the APs included in each first communication path.
Optionally, in some embodiments of the present application, the first determining subunit is further configured to:
judging whether the number of the first communication paths is unique or not;
if the number of the first communication paths is unique, taking the first communication paths as target communication paths between the current reference AP and the target AP;
and if the number of the first communication paths is not unique, determining the number of the APs included in each first communication path, and selecting the first communication path with the least number of the APs from the plurality of first communication paths as a target communication path between the current reference AP and the target AP.
Optionally, in some embodiments of the present application, the second determining subunit is specifically configured to:
subtracting the transmission time delay between the first receiving time stamp returned by each member AP and the reference AP of the sub-network where each member AP is located to obtain a second receiving time stamp of each member AP;
respectively taking two adjacent APs in the target communication path as a first AP and a second AP, and taking an edge AP which belongs to a sub-network where the first AP is located and a sub-network where the second AP is located at the same time as a current edge AP;
subtracting a second receiving time stamp and a sending time stamp of the current edge AP in the sub-network where the first AP is located to obtain a second time difference between the current edge AP and the first AP;
subtracting a second receiving time stamp and a sending time stamp of the current edge AP in the sub-network where the second AP is located to obtain a third time difference between the current edge AP and the second AP;
calculating a first average value of the second time difference and a second average value of the third time difference;
and subtracting the first average value from the second average value to obtain a first time difference between the first AP and the second AP.
Optionally, in some embodiments of the present application, the third determining subunit is specifically configured to:
acquiring a fourth time difference of each member AP included in a sub-network where the target AP is located, taking the non-zero fourth time difference as time adjustment information of the member AP relative to the target AP, wherein the fourth time difference is a difference value of a second receiving time stamp and a sending time stamp of the member AP;
accumulating the first time difference between every two adjacent APs in the target communication path to obtain a fifth time difference;
when the fifth time difference is not zero, acquiring a sixth time difference of each member AP included in a sub-network where the reference AP serving as a starting point is located in the target communication path, wherein the sixth time difference is a difference value between a second receiving time stamp and a sending time stamp of the member AP;
adding the sixth time difference and the fifth time difference to obtain a seventh time difference, and using the seventh time difference as time adjustment information of the member AP relative to the target AP;
time adjustment information of a reference AP serving as a starting point in the target communication path relative to the target AP is set by the fifth time difference;
and when the fifth time difference is zero, acquiring a sixth time difference of each member AP included in the sub-network where the reference AP serving as the starting point is located in the target communication path, and taking the non-zero sixth time difference as time adjustment information of the member AP relative to the target AP.
Optionally, in some embodiments of the present application, the first sending unit is configured to send, to each reference access point AP, a notification message before sending the first time synchronization instruction to each AP, where the notification message includes type information, and the type information is used for enabling each AP to determine the identity attribute.
Optionally, in some embodiments of the present application, the importing unit is further configured to import identification information of each AP in the wireless local area network;
the first sending unit is further configured to send, to each member AP, identification information of the reference AP of the subnet in which the member AP is located before sending the first time synchronization instruction to each reference access point AP, so that the member AP compares the identification information with identification information in the second time synchronization instruction to determine the reference AP that sends the second time synchronization instruction.
Fig. 7 is a schematic structural diagram of a time synchronization apparatus according to some embodiments of the present application, applied to an access point AP, as shown in fig. 7, where the time synchronization apparatus 20 includes:
a first receiving unit 21, configured to receive a first time synchronization instruction sent by a server when an access point AP is a reference AP;
and the first sending unit 22 is configured to send a second time synchronization instruction to each member AP included in the sub-network according to the first time synchronization instruction, where the second time synchronization instruction is used to instruct the member AP to send a sending timestamp and a first receiving timestamp of the second time synchronization instruction to the server, so that the server determines time adjustment information of the first type of AP according to the network attribution relationship, the sending timestamp, and the first receiving timestamp corresponding to the edge AP, where the first type of AP is an AP whose time is to be adjusted.
Optionally, in some embodiments of the present application, the time synchronizer 20 further includes:
a second receiving unit 23, configured to receive, when the access point AP is a member AP, a second time synchronization instruction sent by a reference AP in the same sub-network;
an obtaining unit 24, configured to obtain, according to the second time synchronization instruction, a sending timestamp for sending the second time synchronization instruction and a receiving timestamp for receiving the second time synchronization instruction;
and a second sending unit 25, configured to send the sending timestamp and the receiving timestamp acquired by the acquiring unit 24 to the server, so that the server determines the time adjustment information of the first-class AP according to the network attribution relationship, the sending timestamp, and the receiving timestamp corresponding to the edge AP, where the first-class AP is an AP whose time is to be adjusted.
Optionally, in some embodiments of the present application, the time synchronizer 20 further includes:
a third receiving unit, configured to receive, before the first receiving unit 21 receives the first time synchronization instruction sent by the server, the identification information of the reference AP in the same sub-network sent by the server, and store the identification information;
the comparison unit is used for comparing the stored identification information with the identification information in the second time synchronization instruction and determining a reference AP for sending the second time synchronization instruction;
the obtaining unit 24 is specifically configured to, when the comparing unit determines that the reference AP sending the second time synchronization instruction is the reference AP of the subnet where the comparing unit is located, obtain, according to the second time synchronization instruction, a sending timestamp for sending the second time synchronization instruction and a receiving timestamp for receiving the second time synchronization instruction.
Optionally, in some embodiments of the present application, the time synchronizer 20 further includes:
a fourth receiving unit, configured to receive a notification message sent by the server before the first receiving unit 21 receives the first time synchronization instruction sent by the server, where the notification message includes the type information;
and the determining unit is used for determining the identity attribute according to the type information.
The time synchronization device provided by the embodiment of the application and the time synchronization method provided by the foregoing embodiment have the same effects from the same inventive concept.
In order to implement the foregoing embodiments, an embodiment of the present application further provides a server, and from a hardware level, the server 1000 includes: a memory 1001 and a processor 1002;
a memory 1001 in which an executable program is stored;
the processor 1002, communicating with the memory 1001, reads and executes the executable program stored in the memory 1001, and implements the time synchronization method applied to the server according to any of the foregoing embodiments.
In order to implement the foregoing embodiments, an embodiment of the present application further provides an access point AP, where, from a hardware level, the access point AP2000 includes: memory 2001 and processor 2002;
a memory 2001 in which an executable program is stored;
the processor 2002, which is in communication with the memory 2001, reads and executes the executable program stored in the memory 2001, and implements the time synchronization method applied to the access point AP according to any of the foregoing embodiments.
In order to implement the foregoing embodiments, this application further provides a machine-readable storage medium, where a computer program is stored, and when the computer program is called and executed by a processor, the computer program implements the time synchronization method applied to a server according to any of the foregoing embodiments.
In order to implement the foregoing embodiments, this application further provides a machine-readable storage medium, where a computer program is stored, and when the computer program is called and executed by a processor, the computer program implements the time synchronization method applied to the access point AP according to any of the foregoing embodiments.
It should be noted that:
a machine-readable storage medium may be any electronic, magnetic, optical, or other physical storage device that can contain or store information such as executable instructions, data, and so forth. For example, the machine-readable storage medium may be: a RAM (random access Memory), a volatile Memory, a non-volatile Memory, a flash Memory, a storage drive (e.g., a hard drive), a solid state drive, any type of storage disk (e.g., an optical disk, a dvd, etc.), or similar storage medium, or a combination thereof.
The system, module or unit illustrated in the above embodiments may be implemented by a computer chip or an entity, or by a product with certain functions. A typical implementation device is a computer, which may be embodied in the form of a personal computer, laptop computer, personal digital assistant, tablet computer, wearable device, or a combination of any of these devices.
For convenience of description, the above devices are described as being divided into various units by function, and are described separately. Of course, the functionality of the units may be implemented in one or more software and/or hardware when implementing the present application.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, apparatus (system), or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, embodiments of the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus, systems and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
Furthermore, these computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
The above description is only for the preferred embodiment of the present application, but the scope of the present application is not limited thereto, and any changes or substitutions that can be easily conceived by those skilled in the art within the technical scope of the present application should be covered within the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (15)

1. A time synchronization method is applied to a server, the server divides a wireless local area network into a plurality of sub-networks, each sub-network comprises a reference AP and a plurality of member APs, different sub-networks keep communication connection through edge APs, APs simultaneously belonging to different sub-networks are taken as edge APs of the different sub-networks, and one AP except the edge AP is sequentially selected as a current AP in each sub-network, the method comprises the following steps:
sending a first time synchronization instruction to each reference AP, wherein the first time synchronization instruction is used for instructing the reference AP to send a second time synchronization instruction to each member AP included in the sub-network;
receiving time information returned by each member AP in each sub-network, wherein the time information comprises a sending time stamp and a first receiving time stamp of the second time synchronization instruction;
determining time adjustment information of a first type of AP according to the network attribution relation of the edge AP, the sending time stamp and the first receiving time stamp, wherein the first type of AP is an AP of which the time is to be adjusted;
sending a third time synchronization instruction to the first type of AP according to the time adjustment information, wherein the third time synchronization instruction is used for indicating the first type of AP to perform time synchronization operation; wherein,
the determining time adjustment information of the first type of AP according to the network affiliation of the edge AP, the sending timestamp, and the first receiving timestamp includes:
calculating the transmission time delay in each sub-network according to the position information;
selecting a target AP from a plurality of reference APs of the wireless local area network;
determining a target communication path between a reference AP and the target AP of each sub-network to which the edge AP belongs according to the network attribution relation of the edge AP;
determining a first time difference between every two adjacent APs in the target communication path according to the transmission delay, a sending time stamp and a first receiving time stamp returned by the edge AP;
and determining the time adjustment information of the first type AP relative to the target AP according to the first time difference, the sending time stamp and the first receiving time stamp returned by each member AP.
2. The method of claim 1, wherein the edge AP does not include the reference AP; before the server divides the wireless local area network into a plurality of sub-networks, the method further comprises the following steps:
and importing the position information of each AP in the wireless local area network.
3. The method of claim 2, wherein calculating the propagation delay within each sub-network based on the location information comprises:
calculating the distance between each member AP and a reference AP of the sub-network where the member AP is positioned according to the position information;
and obtaining the transmission time delay between each member AP and the reference AP of the sub-network according to the distance and the preset light speed.
4. The method according to claim 2, wherein the determining a target communication path between the reference AP and the target AP of each sub-network to which the edge AP belongs according to the network attribution relationship of the edge AP comprises:
taking a reference AP of one sub-network to which the edge AP belongs as a current reference AP;
taking the current reference AP as a starting point and the target AP as an end point, and searching all communication paths between the current reference AP and the target AP;
screening a first communication path consisting of a reference AP and a target AP from all the communication paths;
counting the number of the first communication paths;
and determining a target communication path between the current reference AP and the target AP according to the number of the first communication paths and the number of the APs included in each first communication path.
5. The method according to claim 4, wherein said determining a target communication path between said current reference AP and said target AP according to the number of said first communication paths and the number of APs included in each first communication path comprises:
judging whether the number of the first communication paths is unique or not;
if the number of the first communication paths is unique, taking the first communication paths as target communication paths between the current reference AP and the target AP;
if the number of the first communication paths is not unique, determining the number of the APs included in each first communication path, and selecting the first communication path with the least number of the APs from the plurality of first communication paths as a target communication path between the current reference AP and the target AP.
6. The method according to claim 3, wherein said determining a first time difference between two adjacent APs in the target communication path according to the transmission delay, the transmission timestamp and the first reception timestamp returned by the edge AP comprises:
subtracting the transmission time delay between the first receiving time stamp returned by each member AP and the reference AP of the sub-network where each member AP is located to obtain a second receiving time stamp of each member AP;
taking two adjacent APs in the target communication path as a first AP and a second AP respectively, and taking an edge AP which belongs to a sub-network where the first AP is located and a sub-network where the second AP is located at the same time as a current edge AP;
subtracting a second receiving time stamp and a sending time stamp of the current edge AP in the sub-network where the first AP is located to obtain a second time difference between the current edge AP and the first AP;
subtracting a second receiving time stamp and a sending time stamp of the current edge AP in the sub-network where the second AP is located to obtain a third time difference between the current edge AP and the second AP;
calculating a first average value of the second time difference and a second average value of the third time difference;
and subtracting the second average value from the first average value to obtain a first time difference between the first AP and the second AP.
7. The method of claim 6, wherein determining time adjustment information of the first class of APs relative to the target AP according to the first time difference, the transmission timestamp and the first reception timestamp returned by each member AP comprises:
acquiring a fourth time difference of each member AP included in a sub-network where the target AP is located, and taking the non-zero fourth time difference as time adjustment information of the member AP relative to the target AP, wherein the fourth time difference is a difference value of a second receiving time stamp and a sending time stamp of the member AP;
accumulating the first time difference between every two adjacent APs in the target communication path to obtain a fifth time difference;
when the fifth time difference is not zero, acquiring a sixth time difference of each member AP included in a sub-network where the reference AP serving as a starting point is located in the target communication path, wherein the sixth time difference is a difference value between a second receiving time stamp and a sending time stamp of the member AP;
adding the sixth time difference and the fifth time difference to obtain a seventh time difference, and using the seventh time difference as time adjustment information of the member AP relative to the target AP;
taking the fifth time difference as time adjustment information of a reference AP as a starting point in the target communication path with respect to the target AP;
and when the fifth time difference is zero, acquiring a sixth time difference of each member AP included in the sub-network where the reference AP is located in the target communication path as a starting point, and taking the non-zero sixth time difference as time adjustment information of the member AP relative to the target AP.
8. The method according to any of claims 1-7, wherein before sending the first time synchronization instruction to each reference access point AP, the method further comprises:
sending a notification message to each AP, wherein the notification message comprises type information, and the type information is used for enabling each AP to determine the identity attribute.
9. The method according to any of claims 1-7, wherein before sending the first time synchronization instruction to each reference access point AP, the method further comprises:
importing identification information of each AP in the wireless local area network;
and sending the identification information of the reference AP of the sub-network where the member AP is located to each member AP, so that the member AP compares the identification information with the identification information in the second time synchronization instruction, and determines the reference AP for sending the second time synchronization instruction.
10. A time synchronization method is applied to an Access Point (AP), a server divides a wireless local area network into a plurality of sub-networks, each sub-network comprises a reference AP and a plurality of member APs, different sub-networks are in communication connection through edge APs, APs simultaneously belonging to different sub-networks are taken as edge APs of the different sub-networks, and one AP except the edge AP is sequentially selected as a current AP in each sub-network, the method comprises the following steps:
when the access point AP is a reference AP, receiving a first time synchronization instruction sent by a server;
according to the first time synchronization instruction, sending a second time synchronization instruction to each member AP included in the sub-network, wherein the second time synchronization instruction is used for indicating the member AP to send a sending time stamp and a first receiving time stamp of the second time synchronization instruction to the server, so that the server determines time adjustment information of a first type of AP according to a network attribution relation, the sending time stamp and the first receiving time stamp corresponding to the edge AP, and the first type of AP is an AP with time to be adjusted; wherein,
the determining time adjustment information of the first type of AP according to the network affiliation of the edge AP, the sending timestamp, and the first receiving timestamp includes:
calculating the transmission time delay in each sub-network according to the position information;
selecting a target AP from a plurality of reference APs of the wireless local area network;
determining a target communication path between a reference AP and the target AP of each sub-network to which the edge AP belongs according to the network attribution relation of the edge AP;
determining a first time difference between every two adjacent APs in the target communication path according to the transmission delay, a sending time stamp and a first receiving time stamp returned by the edge AP;
and determining the time adjustment information of the first type AP relative to the target AP according to the first time difference, the sending time stamp and the first receiving time stamp returned by each member AP.
11. The method of claim 10, further comprising:
when the access point AP is a member AP, receiving a second time synchronization instruction sent by a reference AP which is in the same sub-network with the member AP;
acquiring a sending time stamp for sending the second time synchronization instruction and a receiving time stamp for receiving the second time synchronization instruction according to the second time synchronization instruction;
and sending the sending time stamp and the receiving time stamp to the server so that the server determines the time adjustment information of the first type of AP according to the network attribution relation corresponding to the edge AP, the sending time stamp and the receiving time stamp, wherein the first type of AP is the AP with the time to be adjusted.
12. The method of claim 11, wherein prior to receiving the second time synchronization instruction from the reference AP in the same subnet as the member AP, further comprising:
receiving identification information of a reference AP which is sent by a server and is positioned in the same sub-network with the member AP, and storing the identification information;
before acquiring the sending timestamp for sending the second time synchronization instruction and the receiving timestamp for receiving the second time synchronization instruction according to the second time synchronization instruction, the method further includes:
and comparing the stored identification information with the identification information in the second time synchronization instruction, and determining a reference AP for sending the second time synchronization instruction.
13. The method according to any one of claims 10 to 12, wherein before receiving the first time synchronization instruction sent by the server when the access point AP is the reference AP, the method further comprises:
receiving a notification message sent by a server, wherein the notification message comprises type information;
and determining the identity attribute according to the type information.
14. A time synchronization apparatus applied to a server, the server dividing a wireless local area network into a plurality of sub-networks, each sub-network including a reference AP and a plurality of member APs, different sub-networks maintaining communication connection via an edge AP, taking an AP simultaneously belonging to a different sub-network as an edge AP of the different sub-network, and sequentially selecting an AP other than the edge AP in each sub-network as a current AP, the apparatus comprising:
a first sending unit, configured to send a first time synchronization instruction to each reference AP, where the first time synchronization instruction is used to instruct the reference AP to send a second time synchronization instruction to each member AP included in a sub-network where the reference AP is located;
a receiving unit, configured to receive time information returned by each member AP in each subnet, where the time information includes a sending timestamp and a first receiving timestamp of the second time synchronization instruction;
a determining unit, configured to determine time adjustment information of a first type of AP according to a network attribution relationship corresponding to an edge AP, the sending timestamp, and the first receiving timestamp, where the first type of AP is an AP whose time is to be adjusted, and specifically includes a time delay calculating unit, configured to calculate a transmission time delay in each sub-network according to location information; selecting a target AP from a plurality of reference APs of the wireless local area network; determining a target communication path between a reference AP and the target AP of each sub-network to which the edge AP belongs according to the network attribution relation of the edge AP; determining a first time difference between every two adjacent APs in the target communication path according to the transmission delay, a sending time stamp and a first receiving time stamp returned by the edge AP; determining time adjustment information of the first type AP relative to the target AP according to the first time difference, the sending time stamp and the first receiving time stamp returned by each member AP;
a second sending unit, configured to send a third time synchronization instruction to the first class AP according to the time adjustment information, where the third time synchronization instruction is used to instruct the first class AP to perform a time synchronization operation.
15. A time synchronization apparatus applied to an Access Point (AP), the apparatus comprising:
a receiving unit, configured to receive a first time synchronization instruction sent by a server when the AP is a reference AP;
a sending unit, configured to send a second time synchronization instruction to each member AP included in a sub-network where the member AP is located according to the first time synchronization instruction, where the second time synchronization instruction is used to instruct the member AP to send a sending timestamp and a first receiving timestamp of the second time synchronization instruction to the server, so that the server determines time adjustment information of a first class AP according to a network affiliation relationship corresponding to an edge AP, the sending timestamp, and the first receiving timestamp, where the first class AP is an AP whose time is to be adjusted; wherein,
the server divides the wireless local area network into a plurality of sub-networks, each sub-network comprises a reference AP and a plurality of member APs, different sub-networks are in communication connection through edge APs, APs which belong to different sub-networks at the same time are used as edge APs of the different sub-networks, and one AP except the edge AP is selected from each sub-network as a current AP in sequence; the server further comprises a determining unit, wherein the determining unit is specifically used for calculating the transmission time delay in each sub-network according to the position information; selecting a target AP from a plurality of reference APs of the wireless local area network; determining a target communication path between a reference AP and the target AP of each sub-network to which the edge AP belongs according to the network attribution relation of the edge AP; determining a first time difference between every two adjacent APs in the target communication path according to the transmission delay, a sending time stamp and a first receiving time stamp returned by the edge AP; and determining the time adjustment information of the first type AP relative to the target AP according to the first time difference, the sending time stamp and the first receiving time stamp returned by each member AP.
CN201910305845.4A 2019-04-16 2019-04-16 Time synchronization method and device Active CN110099439B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910305845.4A CN110099439B (en) 2019-04-16 2019-04-16 Time synchronization method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910305845.4A CN110099439B (en) 2019-04-16 2019-04-16 Time synchronization method and device

Publications (2)

Publication Number Publication Date
CN110099439A CN110099439A (en) 2019-08-06
CN110099439B true CN110099439B (en) 2021-06-22

Family

ID=67444896

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910305845.4A Active CN110099439B (en) 2019-04-16 2019-04-16 Time synchronization method and device

Country Status (1)

Country Link
CN (1) CN110099439B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110636458B (en) * 2019-10-11 2021-08-03 长春理工大学 Wireless self-organizing network cooperation time synchronization optimization method
CN114124275B (en) * 2020-08-31 2024-07-12 深圳市中兴微电子技术有限公司 Time synchronization method, device, equipment and storage medium
CN112415996B (en) * 2020-10-12 2024-03-15 星火科技技术(深圳)有限责任公司 Calibration system and method based on steering engine execution time
FR3119904B1 (en) 2021-02-15 2023-10-06 Sagemcom Broadband Sas Process for synchronizing audio equipment

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102833685A (en) * 2005-03-25 2012-12-19 桥扬科技有限公司 Methods and apparatus for cellular broadcasting and communication system
CN108243396A (en) * 2016-12-27 2018-07-03 普天信息技术有限公司 A kind of time synchronizing method and device
CN108650050A (en) * 2018-05-09 2018-10-12 西安电子科技大学 A kind of distributed network clock synchronous method
CN109429325A (en) * 2017-08-24 2019-03-05 阿里巴巴集团控股有限公司 Data transmission method, device, base station and server

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7656855B2 (en) * 2006-04-29 2010-02-02 At&T Intellectual Property Ii, Lp Arrangement for synchronizing access points in WLAN using direct-sequence spread spectrum signaling

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102833685A (en) * 2005-03-25 2012-12-19 桥扬科技有限公司 Methods and apparatus for cellular broadcasting and communication system
CN108243396A (en) * 2016-12-27 2018-07-03 普天信息技术有限公司 A kind of time synchronizing method and device
CN109429325A (en) * 2017-08-24 2019-03-05 阿里巴巴集团控股有限公司 Data transmission method, device, base station and server
CN108650050A (en) * 2018-05-09 2018-10-12 西安电子科技大学 A kind of distributed network clock synchronous method

Also Published As

Publication number Publication date
CN110099439A (en) 2019-08-06

Similar Documents

Publication Publication Date Title
CN110099439B (en) Time synchronization method and device
US9954669B2 (en) Method and apparatus for over-the-air anchor-anchor synchronization
EP3668205B1 (en) Positioning and measurement reporting method and apparatus
CN110971326A (en) Time synchronization method and device
JP7512379B2 (en) Measurement reporting for conditional handover candidates - Patents.com
US10779118B2 (en) Media access control (MAC) frame structure and data communication method in a real-time localization system
US10582462B2 (en) Synchronization method and apparatus
CN109565314A (en) The receiving time combined with mark is utilized in a wireless communication system
EP3142430B1 (en) Synchronization method, synchronization device and base station
CN108353003B (en) Method and apparatus for bulk propagation timing measurement messaging
US11860289B2 (en) Moving user equipment geolocation
US20220408337A1 (en) User equipment positioning measurements under cell change
CN114342455A (en) Measurement reporting method and device
CN115002902A (en) Label positioning method, device, equipment and system
US11863968B2 (en) Static user equipment geolocation
TW201836408A (en) Method for synchronization signal measurement and related equipment
US20230080704A1 (en) User equipment geolocation framework
CN115150937B (en) Communication method and device
WO2010102565A1 (en) Method, apparatus and system for time synchronization
CN111866710A (en) UWB positioning system, tag positioning method and device
CN105612794A (en) Indoor locating features library establishment method and device
CN111182612B (en) Network access synchronization method and device for nodes in ad hoc network
CN102595473B (en) Measuring method, positioning server and user equipment
CN110896337A (en) Clock, time synchronization method, device and multi-router system
US20230110349A1 (en) Methods for Efficient RSTD Measurement Reporting in NR

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
GR01 Patent grant
GR01 Patent grant