WO2016149890A1 - Method of measuring distance between nan device, and nan device - Google Patents
Method of measuring distance between nan device, and nan device Download PDFInfo
- Publication number
- WO2016149890A1 WO2016149890A1 PCT/CN2015/074802 CN2015074802W WO2016149890A1 WO 2016149890 A1 WO2016149890 A1 WO 2016149890A1 CN 2015074802 W CN2015074802 W CN 2015074802W WO 2016149890 A1 WO2016149890 A1 WO 2016149890A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- nan device
- message
- ranging
- information
- parameter group
- Prior art date
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W48/00—Access restriction; Network selection; Access point selection
- H04W48/16—Discovering, processing access restriction or access information
Definitions
- the present invention relates to the field of communications technologies, and in particular, to a distance measurement method between NAN devices and a NAN device.
- Wi-Fi Wireless-Fidelity
- Wi-Fi-based NAN Neighbor Awareness Network
- Wi-Fi Aware Wi-Fi Aware
- a DW (discovery window) is set, and the NAN device performs service discovery in the DW.
- wireless terminals have various service forms, and there is an increasing demand for ranging between wireless terminals when performing service discovery, such as friends approaching detection, advertising within a limited distance range, and the like.
- service discovery such as friends approaching detection, advertising within a limited distance range, and the like.
- the NAN devices if the ranging is to be completed, it generally needs to be performed after the DW ends. That is, after the DW ends, one NAN device can send a trigger message for ranging to another NAN device.
- Another NAN device supports ranging, and the two NAN devices can complete the ranging. It can be seen that in the prior art, if the ranging between the NAN devices is to be completed, it takes a lot of time and the ranging efficiency is low.
- the embodiments of the present invention provide a distance measurement method between NAN devices and a NAN device, which are used to solve the technical problem of low efficiency when ranging between NAN devices.
- an embodiment of the present invention provides a method for measuring a distance between NAN devices, and a packet include:
- the first NAN device sends a first message in the DW, where the first message carries ranging trigger information for triggering the second NAN device to perform ranging, and information of the first time window;
- the discovery window is a time window for performing service discovery in the NAN, the first message is a message for performing service discovery, and the first time window is a time window for performing ranging;
- the second message is a response message for the first message
- the first NAN device sends a third message to the second NAN device, obtains a second time to send the third message, and obtains first parameter group information according to the first time and the second time;
- the first parameter group information is used to obtain a distance between the first NAN device and the second NAN device, where the third message is an acknowledgement message for the second message;
- the first NAN device Receiving, by the first NAN device, the second parameter group information sent by the second NAN device in the first time window, where the first NAN device is configured according to the first parameter group information and the second parameter Group information, obtaining a distance between the first NAN device and the second NAN device; and/or, the first NAN device transmitting the first to the second NAN device in a first time window a parameter group information, so that the second NAN device obtains a distance between the first NAN device and the second NAN device according to the first parameter group information and the second parameter group information;
- the second parameter group information is: the second time when the second NAN device obtains the second message, and obtains a fourth time to receive the third message, according to the third moment and the The parameter group information obtained at the fourth time, the second parameter group information is used to obtain a distance between the first NAN device and the second NAN device.
- the first message is an SDF message in the NAN, and the first message carries the service information subscribed or issued by the first NAN device.
- the first NAN device receives the second message sent by the second NAN device, including:
- the first NAN device receives the second message in the discovery window or the first time window.
- the embodiment of the present invention provides one or any of the following;
- the ranging principle indication information is used to indicate a measurement principle on which the distance measurement is performed
- the ranging protocol indication information is used to indicate a measurement protocol on which the distance measurement is performed
- the ranging requirement indication information is used to indicate a requirement for a parameter that needs to be met for the measured distance
- the ranging requirement indication information is used to indicate a requirement for a distance of a NAN device that satisfies the service information
- the ranging open indication information is used to instruct the second NAN device to enable the ranging function.
- an embodiment of the present invention provides a method for measuring a distance between NAN devices, including:
- the second NAN device receives the first message sent by the first NAN device in the DW, where the first message carries the ranging trigger information for triggering the second NAN device to perform ranging, and the information of the first time window.
- the discovery window is a time window for performing service discovery in the NAN
- the first message is a message for performing service discovery
- the first time window is a time window for performing ranging
- the second NAN device sends a second message to the first NAN device to obtain a third time to send the second message, where the second message is used to indicate the ranging capability of the second NAN device.
- the second message is a response message for the first message;
- the second NAN device receives the third message sent by the first NAN device, obtains a fourth time to receive the third message, and obtains second parameter group information according to the third time and the fourth time;
- the second parameter group information is used to obtain a distance between the first NAN device and the second NAN device, where the third message is an acknowledgement message for the second message;
- the second NAN device Receiving, by the second NAN device, the first parameter group information sent by the first NAN device in the first time window, where the second NAN device is configured according to the first parameter group information and the second parameter group information Obtaining a distance between the first NAN device and the second NAN device; and / Or the second NAN device sends the second parameter group information to the first NAN device in a first time window, so that the first NAN device is configured according to the second parameter group information and the first Obtaining a distance between the first NAN device and the second NAN device by a parameter group information;
- the first parameter group information is: the first time that the first NAN device obtains the second message, and the second time that the third message is sent, according to the first time and the The parameter group information obtained at the second moment is used to obtain a distance between the first NAN device and the second NAN device.
- the first message is an SDF message in the NAN, where the first message carries a service subscribed or published by the first NAN device. information.
- the second NAN device sends the second message to the first NAN device, including:
- the second NAN device sends the second message to the first NAN device in the discovery window or the first time window.
- the embodiment of the present invention provides one or any of the following;
- the ranging principle indication information is used to indicate a measurement principle on which the distance measurement is performed
- the ranging protocol indication information is used to indicate a measurement protocol on which the distance measurement is performed
- the ranging requirement indication information is used to indicate a requirement for a parameter that needs to be met for the measured distance
- the ranging requirement indication information is used to indicate a requirement for a distance of a NAN device that satisfies the service information
- the ranging open indication information is used to instruct the second NAN device to enable the ranging function.
- an embodiment of the present invention provides a NAN device, including:
- a sending module configured to send a first message in the DW, where the first message carries ranging trigger information for triggering the second NAN device to perform ranging, and information of a first time window; the discovery window The time window for performing service discovery in the NAN, the first message is for Performing a service discovery message, where the first time window is a time window for performing ranging;
- a determining module configured to receive a second message sent by the second NAN device, obtain a first time to receive the second message, and determine a ranging capability of the second NAN device according to the second message, where The second message is a response message for the first message;
- the sending module is further configured to send a third message to the second NAN device, obtain a second time to send the third message, and obtain first parameter group information according to the first time and the second time
- the first parameter group information is used to obtain a distance between the NAN device and the second NAN device, and the third message is an acknowledgement message for the second message;
- the determining module is further configured to receive the second parameter group information sent by the second NAN device in the first time window, and obtain the second parameter group information according to the first parameter group information and the second parameter group information. a distance between the NAN device and the second NAN device; and/or the sending module is further configured to send the first parameter group information to the second NAN device in a first time window The second NAN device obtains a distance between the NAN device and the second NAN device according to the first parameter group information and the second parameter group information;
- the second parameter group information is: the second time when the second NAN device obtains the second message, and obtains a fourth time to receive the third message, according to the third moment and the The parameter group information obtained at the fourth time is used, and the second parameter group information is used to obtain a distance between the NAN device and the second NAN device.
- the first message is an SDF message in the NAN, where the first message carries a service subscribed or published by the first NAN device. information.
- the determining module is configured to receive the second message sent by the second NAN device, specifically:
- the embodiment of the present invention provides one or any of the following;
- the ranging principle indication information is used to indicate a measurement principle on which the distance measurement is performed
- the ranging protocol indication information is used to indicate a measurement protocol on which the distance measurement is performed
- the ranging requirement indication information is used to indicate a requirement for a parameter that needs to be met for the measured distance
- the ranging requirement indication information is used to indicate a requirement for a distance of a NAN device that satisfies the service information
- the ranging open indication information is used to instruct the second NAN device to enable the ranging function.
- an embodiment of the present invention provides a NAN device, including:
- a receiving module configured to receive, in the DW, a first message sent by the first NAN device, where the first message carries ranging trigger information for triggering the NAN device to perform ranging, and information of the first time window;
- the discovery window is a time window for performing service discovery in the NAN, the first message is a message for performing service discovery, and the first time window is a time window for performing ranging;
- An acquiring module configured to send a second message to the first NAN device, to obtain a third moment to send the second message, where the second message is used to indicate a ranging capability of the NAN device, and the second The message is a response message for the first message;
- the receiving module is further configured to receive a third message sent by the first NAN device, obtain a fourth time to receive the third message, and obtain a second parameter group according to the third time and the fourth time
- the second parameter group information is used to obtain a distance between the first NAN device and the NAN device, where the third message is an acknowledgement message for the second message;
- the receiving module is further configured to receive the first parameter group information sent by the first NAN device in a first time window, and obtain the foregoing according to the first parameter group information and the second parameter group information. a distance between the first NAN device and the NAN device; and/or the acquiring module is further configured to send the second parameter group information to the first NAN device in a first time window, so that Obtaining, by the first NAN device, a distance between the first NAN device and the NAN device according to the second parameter group information and the first parameter group information;
- the first parameter group information is: the first time when the first NAN device obtains the second message, and the second time when the third message is sent, according to the first time And the parameter group information obtained at the second moment, the first parameter group information is used to obtain a distance between the first NAN device and the NAN device.
- the first message is an SDF message in the NAN, where the first message carries a service subscribed or published by the first NAN device. information.
- the acquiring module is configured to send a second message to the first NAN device, specifically: Transmitting the second message to the first NAN device in the discovery window or the first time window.
- the embodiment of the present invention provides one or any of the following;
- the ranging principle indication information is used to indicate a measurement principle on which the distance measurement is performed
- the ranging protocol indication information is used to indicate a measurement protocol on which the distance measurement is performed
- the ranging requirement indication information is used to indicate a requirement for a parameter that needs to be met for the measured distance
- the ranging requirement indication information is used to indicate a requirement for a distance of a NAN device that satisfies the service information
- the ranging open indication information is used to instruct the second NAN device to enable the ranging function.
- an embodiment of the present invention provides a NAN device, including a memory, a processor, and a transceiver connected to the same bus;
- the memory is configured to store an instruction
- the transceiver is configured to send a first message in the DW, where the first message carries ranging trigger information for triggering the second NAN device to perform ranging, and information of a first time window;
- the discovery window is a time window for performing service discovery in the NAN, the first message is a message for performing service discovery, the first time window is a time window for performing ranging, and the second is received a second message sent by the NAN device;
- the processor is configured to execute the instruction, obtain a first time to receive the second message, and determine a ranging capability of the second NAN device according to the second message, where the second message is a pin a response message to the first message;
- the transceiver is further configured to send a third message to the second NAN device
- the processor is further configured to obtain a second time when the third message is sent, and obtain first parameter group information according to the first time and the second time; the first parameter group information is used to obtain a Defining a distance between the NAN device and the second NAN device, where the third message is an acknowledgement message for the second message;
- the transceiver is further configured to receive the second parameter group information that is sent by the second NAN device in the first time window, where the processor is further configured to use the first parameter group information and the The second parameter group information is obtained, obtaining a distance between the NAN device and the second NAN device; and/or the transceiver is further configured to, in the first time window, to the second NAN device Transmitting the first parameter group information, so that the second NAN device obtains a distance between the NAN device and the second NAN device according to the first parameter group information and the second parameter group information;
- the second parameter group information is: the second time when the second NAN device obtains the second message, and obtains a fourth time to receive the third message, according to the third moment and the The parameter group information obtained at the fourth time is used, and the second parameter group information is used to obtain a distance between the NAN device and the second NAN device.
- the first message is an SDF message in the NAN, where the first message carries a service subscribed or published by the first NAN device. information.
- the transceiver is configured to receive the second message sent by the second NAN device, specifically:
- the embodiment of the present invention provides one or any of the following;
- the ranging principle indication information is used to indicate a measurement principle on which the distance measurement is performed
- the ranging protocol indication information is used to indicate a measurement protocol on which the distance measurement is performed
- the ranging requirement indication information is used to indicate a requirement of a parameter that needs to be satisfied for the measured distance begging;
- the ranging requirement indication information is used to indicate a requirement for a distance of a NAN device that satisfies the service information
- the ranging open indication information is used to instruct the second NAN device to enable the ranging function.
- an embodiment of the present invention provides a proximity aware network NAN device, including a memory, a processor, and a transceiver connected to the same bus;
- the memory is configured to store an instruction
- the transceiver is configured to receive, in a discovery window DW, a first message sent by a first NAN device, where the first message carries a ranging trigger information for triggering the NAN device to perform ranging, and a first time Information of the window;
- the discovery window is a time window for performing service discovery in the NAN, the first message is a message for performing service discovery, and the first time window is a time window for performing ranging;
- the processor is configured to execute the instruction, obtain a third moment to send the second message, where the second message is used to indicate ranging capability of the NAN device, and the second message is for the a response message of the first message;
- the transceiver is further configured to receive a third message sent by the first NAN device;
- the processor is further configured to obtain a fourth time to receive the third message, obtain second parameter group information according to the third time and the fourth time; the second parameter group information is used to obtain the Defining a distance between the first NAN device and the NAN device, where the third message is an acknowledgement message for the second message;
- the transceiver is further configured to receive the first parameter group information sent by the first NAN device in a first time window, where the processor is further configured to use, according to the first parameter group information, the The second parameter group information is obtained, and the distance between the first NAN device and the NAN device is obtained; and/or the transceiver is further configured to send the first NAN device to the first NAN device in a first time window.
- the second parameter group information is obtained, so that the first NAN device obtains a distance between the first NAN device and the NAN device according to the second parameter group information and the first parameter group information;
- the first parameter group information is: the first NAN device obtains the second cancellation The first time of the information, and the second time when the third message is sent, the first parameter group information is used to obtain the first parameter according to the parameter group information obtained by the first time and the second time The distance between a NAN device and the NAN device.
- the first message is an SDF message in the NAN, where the first message carries the first NAN device subscription or release Service information.
- the transceiver is configured to send a second message to the first NAN device, specifically:
- the embodiment of the present invention provides one or any of the following;
- the ranging principle indication information is used to indicate a measurement principle on which the distance measurement is performed
- the ranging protocol indication information is used to indicate a measurement protocol on which the distance measurement is performed
- the ranging requirement indication information is used to indicate a requirement for a parameter that needs to be met for the measured distance
- the ranging requirement indication information is used to indicate a requirement for a distance of a NAN device that satisfies the service information
- the ranging open indication information is used to instruct the second NAN device to enable the ranging function.
- the first NAN device may carry the ranging trigger information in the first message, so that the first message may be in the DW. Transmitting, and if the second NAN device supports ranging, the second NAN device sends the second parameter group information to the first NAN device in the first time window, so that the first NAN device can obtain the first NAN.
- the distance between the device and the second NAN device, or the first NAN device may also send the obtained first parameter group information to the second NAN device, so that the second NAN device obtains the first NAN device and the second NAN device. The distance between them.
- the first time window is a service window, that is, in the embodiment of the present invention, the ranging trigger can be performed in the DW without After the completion of the DW, a special message is used to perform the ranging trigger, which saves the time required for ranging and improves the ranging efficiency.
- the ranging trigger information can be carried in the first message, and the measurement trigger information is not required to be sent by using a message as in the prior art, thereby reducing the amount of information interaction and saving network resources. .
- FIG. 1 is a main flowchart of a method for measuring a distance between a first type of NAN device according to an embodiment of the present invention
- FIG. 2 is a main flowchart of a distance measurement method between second NAN devices according to an embodiment of the present invention
- FIG. 3 is a flowchart of a specific example of a method for measuring a distance between NAN devices according to an embodiment of the present invention
- FIG. 4 is a flowchart of another specific example of a distance measurement method between NAN devices according to an embodiment of the present invention.
- FIG. 5 is a structural block diagram of a first NAN device according to an embodiment of the present invention.
- FIG. 6 is a structural block diagram of a second NAN device according to an embodiment of the present invention.
- FIG. 7 is a schematic structural diagram of a first NAN device according to an embodiment of the present invention.
- FIG. 8 is a schematic structural diagram of a second NAN device according to an embodiment of the present invention.
- the NAN mechanism generally has one DW set in every 512 TU (time unit), wherein the duration of one TU is about 1024 ⁇ s, and the duration of DW is generally 16 TU, that is, in the NAN mechanism, generally every 496 TUs.
- one or more NAN devices form a cluster. When a cluster enters the DW, the cluster is in the master (master node), anchor master (AM, anchor master node), and non-master. NAN device sending status such as sync (non-master synchronization, master node responsible for synchronization) A sync beacon message, the message carrying the information of the AM in the cluster, and the NAN device receiving the message is synchronized with the AM in the cluster.
- a device activates the NAN function (that is, after becoming a NAN device), it can set itself to AM, create a cluster, and set the cluster's Cluster ID based on its MAC (Media Access Control) address.
- Identity identity value, set the TSF to an integer multiple of 512TU.
- the NAN device receives a Beacon frame (that is, a sync beacon, which is collectively referred to as a Beacon frame) sent from a NAN device of one or more other clusters, it can determine whether it wants to join the other party's Cluster.
- a Beacon frame that is, a sync beacon, which is collectively referred to as a Beacon frame
- the information about the corresponding cluster is generally carried, which may be the information of the AM in the corresponding cluster.
- the AMR anchor master rank
- the MR master rank
- MP Master Preference
- AMP anchor Master Preference
- RF random factor, random factor
- AMBTT Anchor Master Beacon Transmission Time
- TSF time synchronization function
- Cluster ID Cluster ID
- CG Cluster grade
- a NAN device can send the information of the AM of the cluster to which it belongs to other NAN devices by sending a Beacon frame. Similarly, a NAN device can also receive the Beacon frame sent by the NAN device in the cluster or other clusters.
- the NAN device can determine whether the Beacon frame is from a NAN device in the cluster to which it belongs or from a NAN device in another cluster. If the NAN device is from another Cluster, the NAN device can determine to receive the packet. If the value of the CG in the Beacon frame is greater than the value of the CG, if the value is greater than, the NAN device joins the cluster corresponding to the received Beacon frame. Otherwise, the NAN device does not process. This completes the aggregation of the NAN device, that is, the NAN device will join the Cluster with a higher CG value.
- the AM in the added cluster is synchronized, and the parameter information in the AM is synchronized with the AM in the added cluster, for example, the original TSF is updated to the TSF of the AM in the added cluster.
- the NAN device After the synchronization, when the DW of the added Cluster arrives, the NAN device sends an SDF (Service Discovery Frames) message in the DW to perform service discovery.
- the SDF message may be carried, for example, for query.
- Service Query information of the service or for example, may carry Service Publish information for publishing the service that the NAN device can provide.
- the other NAN device After receiving the SDF message sent by the NAN device, the other NAN device receives the SDF message. If it is determined that the SDF message is satisfied, that is, the service matching can be performed, the SDF message can be replied to the NAN device in the DW.
- the NAN device may also receive an SDF message sent by another NAN device for service discovery. If the NAN device determines that the received SDF message is satisfied, the NAN device is also in the DW. Reply to the corresponding NAN device with an SDF message.
- AMR which generally has a maximum value of 8 bytes, is the value of MR of AM.
- the maximum value of the MR is 8 bytes, which is calculated based on the MP value, the RF value, and the MAC address of the NAN device, indicating the willingness of the NAN device to be the master.
- MR can also be seen as an additional form of expression for MP.
- MP generally the maximum value is 1 byte, indicating the willingness of the NAN device to be the master. The larger the value of MP, the higher the willingness of the NAN device to be master.
- AMP generally the maximum value is 1 byte, which is the value of AM's MP.
- the RF value is generally 1 byte and is a random number selected by the NAN device.
- AMBTT which is generally 4 bytes in length, indicates the transmission time of the Beacon frame of the AM.
- the NAN device that sends the Beacon frame carries the AMBTT, and is used for synchronization between other NAN devices and the AM corresponding to the AMBTT.
- TSF generally with a maximum value of 8 bytes, indicates that the synchronization function of the NAN device enables reception.
- the timer of the NAN device to the TSF is synchronized with the time of the AM corresponding to the NAN device transmitting the TSF.
- the TSF can also represent time information.
- the cluster ID which is a maximum of 6 bytes, is carried in the field of Address 3 in the Beacon frame.
- CG generally the maximum value is 8 bytes, indicating the level of the Cluster, used for comparison of different Clusters at the time of merging, and the Cluster with a small CG value is merged into the Cluster with a large CG value.
- SDF message is an action frame specifically defined for service discovery. Depending on the function, SDF messages can be roughly classified into three types: SDF Publish (SDF Publishing) message, SDF Subscribe (SDF subscription) message, SDF.
- SDF SDF Publishing
- SDF Subscribe SDF subscription
- SDF SDF.
- a follow-Up message in general, includes an indication bit in the SDF message indicating which SDF message the SDF message is.
- SDF Publish message used to publish the services that the NAN device can provide, or to reply to the received SDF Subscribe message sent by other NAN devices;
- SDF Subscribe message used to find the service that needs to be used
- SDF follow-Up message Used to reply to the received SDF Publish message or to negotiate more information.
- the embodiments of the present invention can implement ranging between NAN devices based on the existing FTM (Fine Timing Measurement) ranging principle.
- FTM Frequency Measurement
- a NAN device that initiates ranging sends an FTM Request (FTM Request) to the NAN device to which the NAN device 1 is to be measured (for example, hereinafter referred to as NAN device 2).
- FTM Request FTM Request
- NAN device 2 can reply to the message according to its own resource situation and capability, etc., indicating that a time window is accepted or reset.
- FTM Request is an Action Frame.
- both the NAN device 2 and the NAN device 1 start time capture. Wherein, the NAN device 2 captures the NAN device 2 and returns a pin to the NAN device 1.
- the time of the reply message to the FTM Request is t1
- the time at which the NAN device 1 captures the reply message of the NAN device 2 for the FTM Request is t2.
- the NAN device 1 replies to the NAN device 2 with an ACK (Acknowledgement) for the reply message, and captures that the time at which the ACK is transmitted is t3, and the time at which the NAN device 2 captures the ACK is t4.
- ACK Acknowledgement
- the NAN device 2 sends a ranging message to the NAN device 1, and the ranging message carries t1 and t4.
- the NAN device 1 obtains four times of time t1, t2, t3, and t4, so that the time RTT (Round-Trip Time) of the message can be calculated as:
- c is the speed of light, which can also be equal to the transmission speed of the Wi-Fi signal.
- system and “network” are used interchangeably herein.
- the term “and/or” in this context is merely an association describing the associated object, indicating that there may be three relationships, for example, A and / or B, which may indicate that A exists separately, and both A and B exist, respectively. B these three situations.
- the character "/" in this article unless otherwise specified, generally indicates that the contextual object is an "or" relationship.
- the embodiment of the present invention is mainly described by taking a NAN device as an example, but the technical solution of the embodiment of the present invention can also be applied to other wireless devices in a similar network mechanism.
- an embodiment of the present invention provides a method for measuring distance between first NAN devices, and a main process of the method is described as follows.
- Step 101 The first NAN device sends a first message in the DW, where the first message carries ranging trigger information for triggering the second NAN device to perform ranging, and information of the first time window;
- the discovery window is a time window for performing service discovery in the NAN, and the first message is a message for performing service discovery, and the first time window is a time window for performing ranging.
- the NAN device that initiates ranging is referred to as a first NAN device
- the NAN device that receives ranging is referred to as a second NAN device.
- the first time window is, for example, a service window (Service Window, SW).
- the first time window is a time window for performing ranging, that is, a service for performing ranging. window.
- the first time window may be adjacent to the DW, that is, the end point of the DW is the start point of the first time window, that is, the interval length between the DW and the first time window is equal to zero.
- DW is DW
- the first time window may be an adjacent time period after the end of DW, or for example, DW is the first part time period in DW
- the first time window is the second part time period in DW
- DW is the starting point of the first time window, that is, the first time window is all the remaining time periods after the end of the first part of the time period in the DW; or, the interval between the first time window and the DW may be longer, and the interval duration is greater than 0.
- DW is DW
- the first time window may be a time period after a period of time after the end of DW, or for example, DW is a first part time period in DW, and the first time window is a second part time period in DW, and The interval between the DW and the first time window is greater than 0, that is, the first time window is a portion of the remaining time period after the end of the first portion of the time period in the DW.
- the first message may be a message for performing service discovery, where the message may carry service information subscribed or published by the first NAN device.
- the ranging itself may also be a service
- the service corresponding to the service information may also be ranging, that is, the service information is used to indicate that the first NAN device needs to be subscribed to the ranging.
- the service or the first NAN device needs to publish information about the ranging service.
- the first message may be an SDF message.
- the first NAN device sends the first message
- the service information carried in the first message may be, for example, service subscription information for subscribing (also referred to as querying) the service required by the first NAN device, or It may be service release information for publishing a service that the first NAN device can provide, and the like.
- the service information is information that can represent a service subscribed or published by the first NAN device, and may be a service name or a conversion value of the service name, for example, a value obtained by hashing the service name, such as a service.
- the name is SHA (Secure Hash Algorithm)-256 operation and takes the value of the first 48 bits as the service information; or the value of the bitmap mapping of the service name, for example, the Bloom Filter for the service name. (a binary vector data structure) transformation, using a bitmap to indicate the service name, and so on.
- the service corresponding to the service information may be a service that the first NAN device itself needs to subscribe to or publish, or a service that the other NAN device needs to subscribe to or publish for the first NAN device, and the present invention is not limited thereto.
- the service information carried in the first message is service information for publishing a service that the first NAN device can provide, and if the first message is an SDF Subscribe message, The service information carried in the first message is service information for subscribing to a service that the first NAN device needs to use.
- the ranging trigger information is carried in the first message and sent, so that the ranging trigger can be performed in the DW, and the ranging triggering can be performed in other time windows without waiting for the DW to end. It saves the time required for ranging and reduces the amount of information interaction.
- the first message may also carry information of the first time window.
- the information of the first time window may include a start time of the first time window and a duration of the first time window, or may include a start time and a stop time of the first time window, or the first time window information
- the information of the first time window is not limited. .
- the first NAN device sends the first message, and may send the first message in different forms, such as broadcast, multicast, or unicast.
- the second NAN device may parse the first message, and The ranging trigger information carried therein is obtained, and the service information carried therein and the like are further obtained.
- the ranging trigger information may include one of ranging principle indication information, ranging protocol indication information, ranging requirement indication information, ranging requirement indication information, and ranging opening indication information. Or any of them; among them,
- the ranging principle indication information is used to indicate the measurement principle on which the distance measurement is performed;
- the ranging protocol indication information is used to indicate a measurement protocol on which the distance measurement is performed
- the ranging request indication information is used to indicate a requirement for a parameter that needs to be satisfied for the measured distance
- the ranging demand indication information is used to indicate a demand for a distance of the NAN device that satisfies the service information
- the ranging open indication information is used to instruct the second NAN device to enable the ranging function.
- the ranging principle indication information or the ranging protocol indication information may be used to indicate that the ranging method is based on the FTM principle, or the ranging scheme based on the triangulation principle is used for ranging, and further, the ranging triggering
- the information may include multiple supported ranging schemes, and the second NAN device may select from the support according to its own support situation or further negotiate with the first NAN device to determine the final ranging scheme.
- the ranging requirement indication information may include requirements of the first NAN device for ranging accuracy, ranging range, and the like.
- the ranging requirement indication information may include a distance requirement of the first NAN device to the NAN device that satisfies the service of the subscription or the search.
- the ranging open indication information may include information indicating that the second NAN device turns on the ranging function.
- the first NAN device and the second NAN device support a certain ranging solution by default.
- the first NAN device and the second NAN device respectively support the FTM principle-based ranging solution.
- the ranging trigger information may include only the ranging opening indication information.
- the first NAN device may send the first message to the second NAN device in the first channel.
- Step 102 The first NAN device receives the second message sent by the second NAN device, obtains a first time to receive the second message, and determines, according to the second message, the measurement of the second NAN device. From the capability, the second message is a response message for the first message.
- the second message is a response message for the first message
- the second message may be an SDF message, and may be an SDF Publish message or an SDF Follow-up message.
- the second message may be an SDF Publish message in response to the message; when the first message is an SDF Publish message, the second message may be an SDF Follow-Up message in response to the message.
- the second NAN device may determine, according to the ranging trigger information in the first message, whether it has the corresponding ranging capability, and send the first message to the first NAN device according to the determination result. Two messages.
- the second NAN device has the corresponding ranging capability indicated by the first NAN device, and may have several different situations:
- the second NAN device needs to satisfy the service information carried in the first message, and the second NAN device is to be able to support ranging.
- the service information is information for subscribing to a service required by the first NAN device, and the second NAN device needs to be able to provide the service, or for example, the service information is information for publishing a service that the first NAN device can provide. The second NAN device needs to accept the service.
- the second NAN device needs to support the ranging indicated by the first NAN device.
- the second NAN device determines whether it supports the ranging principle indicated by the ranging principle indication information, and if so, indicates that the second NAN device owns the first NAN.
- the ranging capability indicated by the device
- the second NAN device determines whether it supports the ranging protocol indicated by the ranging protocol indication information, and if so, indicates that the second NAN device has the first Ranging capability indicated by the NAN device;
- the second NAN device determines whether it can satisfy the ranging accuracy, the ranging range, and the like indicated by the ranging request indication information, and if yes, indicates The second NAN device has a ranging capability indicated by the first NAN device;
- the second NAN device determines whether it can satisfy the distance requirement indicated by the ranging demand indication information, and if yes, indicates that the second NAN device has the first The ranging capability indicated by a NAN device;
- the second NAN device determines whether it is currently capable of turning on the ranging function, and if so, indicating that the second NAN device has the ranging indicated by the first NAN device. ability.
- the ranging trigger information includes ranging requirement information and ranging principle indication information.
- the second NAN device learns that the service of the first NAN device needs the distance between the second NAN device and the first NAN device to reach a certain threshold by using the ranging requirement indication information, and further, the second NAN device passes the ranging.
- the principle indication information is related to the ranging technology supported by the first NAN device. When the second NAN device supports the ranging technology, the second NAN device determines to support the ranging.
- the ranging trigger information includes the ranging open indication information, and the first NAN device and the second NAN device support some ranging technology by default, and the second NAN device determines to support the ranging.
- the ranging trigger information includes ranging request information and ranging protocol indication information.
- the second NAN device learns that the service of the first NAN device needs the distance between the second NAN device and the first NAN device to meet a certain parameter to establish a service connection, and further, the second NAN device passes the distance determination request indication information.
- the ranging protocol indication information is related to the ranging protocol supported by the first NAN device. When the second NAN device supports the ranging protocol, the second NAN device determines to support the ranging.
- the second NAN device needs to be able to satisfy the service information carried in the first message, and the second NAN device can support the ranging required by the first NAN device, and both of the conditions are satisfied.
- the second message sent by the second NAN device to the first NAN device indicates that the second NAN device supports the ranging. Otherwise, the second information that the second NAN device replies to the first NAN device indicates that the second NAN device does not support the measurement. distance.
- the service subscribed or issued by the first NAN device is the ranging, that is, the ranging is the service corresponding to the service information, and at this time, the second NAN device determines whether it can satisfy the
- the service corresponding to the service information is essentially the determination of whether or not the support for the first NAN device is required.
- the second NAN device can support ranging.
- the second NAN device determines whether it supports the ranging principle indicated by the ranging principle indication information, and if so, indicates that the second NAN device owns the first NAN.
- the ranging capability indicated by the device
- the second NAN device determines whether it supports the ranging protocol indicated by the ranging protocol indication information, and if so, indicates that the second NAN device has the first Ranging capability indicated by the NAN device;
- the second NAN device determines whether it can satisfy the ranging accuracy, the ranging range, and the like indicated by the ranging request indication information, and if yes, indicates The second NAN device has a ranging capability indicated by the first NAN device;
- the second NAN device determines whether it can satisfy the distance requirement indicated by the ranging demand indication information, and if yes, indicates that the second NAN device has the first The ranging capability indicated by a NAN device;
- the second NAN device determines whether it is currently capable of turning on the ranging function, and if so, indicating that the second NAN device has the ranging indicated by the first NAN device. ability.
- the ranging trigger information includes ranging requirement information and ranging principle indication information.
- the second NAN device learns that the service of the first NAN device needs the distance between the second NAN device and the first NAN device to reach a certain threshold by using the ranging requirement indication information, and further, the second NAN device passes the ranging.
- the principle indication information is related to the ranging technology supported by the first NAN device. When the second NAN device supports the ranging technology, the second NAN device determines to support the ranging.
- the ranging trigger information includes the ranging open indication information, and the first NAN device and the second NAN device support some ranging technology by default, and the second NAN device determines to support the ranging.
- the ranging trigger information includes ranging request information and ranging protocol indication information.
- the second NAN device learns that the service of the first NAN device needs the distance between the second NAN device and the first NAN device to meet a certain parameter to establish a service connection, and further, the second NAN device passes the distance determination request indication information.
- the ranging protocol indication information is related to the ranging protocol supported by the first NAN device. When the second NAN device supports the ranging protocol, the second NAN device determines to support the ranging.
- the second NAN device does not matter whether the service information carried in the first message can be satisfied, as long as the second NAN device can support the ranging required by the first NAN device, the second NAN device
- the second information replied by the first NAN device may indicate that the second NAN device supports ranging.
- the first NAN device receives the second message sent by the second NAN device, including:
- the first NAN device receives the second message in the DW or the first time window.
- the second NAN device may continue to send the second message to the first NAN device in the DW, or the second NAN device may also send the second message to the first NAN device in the first time window.
- the second message may also be used to indicate whether the second NAN device satisfies the service information in the first message.
- the second message may be an SDF message, and may be an SDF Publish message or an SDF Follow-up message.
- the second message may be an SDF Publish message in response to the message; when the first message is an SDF Publish message, the second message may be an SDF Follow-Up message in response to the message.
- the second message is sent by the second NAN device on the first channel in the DW.
- the first NAN device may determine whether the second NAN device meets the service subscribed or published by the first NAN device, and The ranging capability of the second NAN device can be determined.
- the second message may also be a service connection message, and the second message may be sent by the second NAN device on the second channel in the first time window for requesting a service connection with the first NAN device, for example, the service connection message is specific.
- the service connection message is specific.
- associated messages including but not limited to Association Request
- the second channel represents an operating channel in which the first NAN device establishes a service with other NAN devices, and the channel may be other channels different from the first channel, or may be the same channel as the first channel.
- the first channel is considered to be associated with the DW
- the second channel is associated with the first time window, that is, the message transmitted in the DW is transmitted through the first channel, in the first time window.
- the transmitted messages are transmitted through the second channel.
- Step 103 The first NAN device sends a third message to the second NAN device, obtains a second time to send the third message, and obtains a first parameter group according to the first time and the second time.
- the first parameter group information is used to obtain a distance between the first NAN device and the second NAN device, and the third message is an acknowledgement message for the second message.
- the first NAN device After receiving the second message, the first NAN device sends an acknowledgement message for the second message to the second NAN device, that is, sends a third message, for example, the third message is specifically an ACK.
- the first NAN device may directly use the first time and the second time as the first parameter group information, or the first NAN device may also process the first time and the second time.
- the information obtained after the processing is used as the first parameter group information.
- the specific form of the first parameter group information is not limited in the embodiment of the present invention, as long as the second NAN device can obtain the first time and the second time according to the first parameter group information. Just fine.
- the third message may be sent in the DW or may also be sent in the first time window.
- the method further includes:
- the first NAN device Transmitting, by the first NAN device, the first parameter group information to the second NAN device in the first time window; the first parameter group information is used by the second NAN device according to the A parameter group information and the second parameter group information obtain a distance between the first NAN device and the second NAN device.
- the first NAN device may send the first parameter group information to the second NAN device, so that the second NAN device can be
- the first parameter group information and the second parameter group information obtain a distance between the first NAN device and the second NAN device.
- the second parameter group information will be introduced in step 104.
- the manner in which the second NAN device obtains the distance between the first NAN device and the second NAN device according to the first parameter group information and the second parameter group information may refer to a formula. (1) and formula (2).
- the first time is t2
- the second time is t3
- the third time is t1
- the fourth time is t4.
- ranging based on the FTM principle is only one possible implementation solution of the present invention, but is not limited thereto.
- ranging can also be implemented according to the principles of triangulation ranging, signal strength ranging, and the like.
- Step 104 The first NAN device receives, in the first time window, second parameter group information that is sent by the second NAN device, where the first NAN device is configured according to the first parameter group information.
- the second parameter group information obtains a distance between the first NAN device and the second NAN device; and/or, the first NAN device sends the second NAN device to the second NAN device in a first time window The first parameter group information, so that the second NAN device obtains a distance between the first NAN device and the second NAN device according to the first parameter group information and the second parameter group information.
- the second parameter group information is: the second time when the second NAN device obtains the second message, and obtains a fourth time to receive the third message, according to the third moment and the The parameter group information obtained at the fourth time, the second parameter group information is used to obtain a distance between the first NAN device and the second NAN device.
- the parameter group information required for the ranging when transmitted, it may be transmitted in the first time window, and may also be transmitted in other time periods, and the present invention is not limited thereto.
- the second NAN device may obtain second parameter group information, which is also information for obtaining a distance between the first NAN device and the second NAN device.
- the second NAN device can capture the third moment of transmitting the second message, and capture and receive Confirming the fourth moment of the message, and obtaining the second parameter group information according to the third moment and the fourth moment.
- the second NAN device may directly use the third time and the fourth time as the second parameter group information, or the second NAN device may process the third time and the fourth time, and the obtained information is used as the first
- the second parameter group information is not limited in the embodiment of the present invention.
- the first NAN device can obtain the third time and the fourth time according to the second parameter group information.
- the second NAN device may separately send the second parameter group information to the first NAN device, or may also carry the second parameter group information in the service connection message for sending.
- the service connection message may be used to indicate that the second NAN device is to be established with the first NAN device, in addition to carrying the second parameter group information.
- a service connection such as a related message (including but not limited to an Association Request, an Association Response message, etc.), a message for paging, and the like.
- the first NAN device may obtain the distance between the first NAN device and the second NAN device according to the first parameter group information and the second parameter group information, specifically, according to the FTM ranging.
- the principle is to perform ranging, and the manner in which the first NAN device obtains the distance between the first NAN device and the second NAN device according to the first parameter group information and the second parameter group information may refer to formula (1) and formula (2).
- the first time is t2
- the second time is t3
- the third time is t1
- the fourth time is t4.
- ranging based on the FTM principle is only one possible implementation of the present invention, but is not limited thereto.
- the first NAN device After receiving the second parameter group information, the first NAN device obtains a distance between the first NAN device and the second NAN device according to the second parameter group information and the first parameter group information, for example, it is referred to as a first distance, and thus A NAN device can determine whether to establish a service connection with the second NAN device according to the first distance.
- the first NAN device when the first distance satisfies the distance threshold of the subscribed or published service set by the first NAN device, the first NAN device confirms that the service connection is established with the second NAN device, and the first NAN device replies with the service connection response to the second NAN device.
- Message such as when the service connection message is Association
- the service connection response message replied by the first NAN device may be an Association Response to instruct the second NAN device to perform a subsequent connection process.
- the service connection response message replied by the first NAN device may be a Paging response message. And indicates that the service connection is terminated, as indicated by Status: Fail. Further, the first NAN device may also indicate the reason for the service termination, such as indicating the Reason Code: Out-of-Range.
- the first NAN device when the first distance satisfies a distance threshold of the subscribed or published service set by the first NAN device, the first NAN device confirms establishing a service connection with the second NAN device, and determines to provide the first type for the first NAN device subsequently. Services, such as providing video file sharing services.
- the first NAN device replies to the second NAN device with a service connection response message. For example, when the service connection message is an Association Request, the service connection response message replied by the first NAN device may be an Association Response to indicate that the second NAN device performs subsequent connection. process.
- the first NAN device when the first distance does not satisfy the distance threshold of the subscribed or published service set by the first NAN device, the first NAN device confirms establishing a service connection with the second NAN device, and determines to provide the second NAN device subsequently. Services, such as providing advertising push services.
- the first NAN device replies to the second NAN device with a service connection response message.
- the service connection message is an Association Request
- the service connection response message replied by the first NAN device may be an Association Response to indicate that the second NAN device performs subsequent connection. process.
- the first NAN device may determine whether to establish a service connection with the second NAN device according to the distance between the first NAN device and the second NAN device, or the first NAN device may also be according to the first NAN device and the second NAN device.
- the distance between the determinations is specifically what the second NAN device provides, and so on, and the same is true for the second NAN device, and no more examples are given here.
- the effects of the distance obtained by the ranging are all possible embodiments, and the present invention is not limited thereto.
- the method further includes:
- the first NAN device Transmitting, by the first NAN device, the first parameter group information to the second NAN device in the first time window; the first parameter group information is used by the second NAN device according to the A parameter group information and the second parameter group information obtain a distance between the first NAN device and the second NAN device.
- the first NAN The device may also send the first parameter group information to the second NAN device, so that the second NAN device can also obtain the distance between the first NAN device and the second NAN device, and meet the requirement that the two NAN devices simultaneously obtain the distance.
- the method further includes:
- the first NAN device sends the obtained distance between the first NAN device and the second NAN device to the second NAN device.
- the first NAN device may send the first parameter group information to the second NAN device in addition to the distance between the first NAN device and the second NAN device, and then directly send the obtained distance to the second NAN device.
- the second NAN device does not need to perform calculations to alleviate the workload of the second NAN device.
- the first NAN device sends the first parameter group information to the second NAN device in a first time window
- the method further includes:
- the method further includes:
- the second NAN device may also send the second parameter group information to the first NAN device, so that the first NAN device can also obtain the distance between the first NAN device and the second NAN device, and meet the requirement that the two NAN devices simultaneously obtain the distance.
- the method further includes:
- the first NAN device receives the distance between the first NAN device and the second NAN device that is sent by the second NAN device.
- the second NAN device may send the second parameter group information to the first NAN device, and after obtaining the distance between the first NAN device and the second NAN device, directly send the obtained distance to the first NAN device.
- the first NAN device does not need to perform calculations, reducing the workload of the first NAN device.
- an embodiment of the present invention provides a distance measurement method between second NAN devices, and the main flow of the method is as follows.
- Step 201 The second NAN device receives the first message sent by the first NAN device in the DW, where the first message carries the ranging trigger information for triggering the second NAN device to perform ranging, and the first time Information of the window; the discovery window is a time window for performing service discovery in the NAN, the first message is a message for performing service discovery, and the first time window is a time window for performing ranging.
- Step 202 The second NAN device sends a second message to the first NAN device to obtain a third moment to send the second message, where the second message is used to indicate ranging of the second NAN device. Capability, the second message is a response message for the first message;
- Step 203 The second NAN device receives the third message sent by the first NAN device, obtains a fourth time to receive the third message, and obtains a second parameter according to the third time and the fourth time.
- Group information the second parameter group information is used to obtain a distance between the first NAN device and the second NAN device, and the third message is an acknowledgement message for the second message;
- Step 204 The first NAN device receives, in a first time window, first parameter group information sent by the first NAN device, where the second NAN device is configured according to the first parameter group information and the second Parameter group information, obtaining a distance between the first NAN device and the second NAN device; and/or, the second NAN device transmitting the the NAN device to the first NAN device in a first time window a second parameter group information, so that the first NAN device obtains a distance between the first NAN device and the second NAN device according to the second parameter group information and the first parameter group information.
- the first parameter group information is: the first time that the first NAN device obtains the second message, and the second time that the third message is sent, according to the first time and the The parameter group information obtained at the second moment is used to obtain a distance between the first NAN device and the second NAN device.
- the NAN device that initiates ranging is referred to as a first NAN device
- the NAN device that receives ranging is referred to as a second NAN device.
- the first time window may be adjacent to the DW, that is, the end point of the DW is the start point of the first time window, that is, the interval length between the DW and the first time window is equal to zero.
- DW is DW
- the first time window may be an adjacent time period after the end of DW, or for example, DW is the first part time period in DW
- the first time window is the second part time period in DW
- DW is the starting point of the first time window, that is, the first time window is all the remaining time periods after the end of the first part of the time period in the DW; or, the interval between the first time window and the DW may be longer, and the interval duration is greater than 0.
- the first time window can be after a period of time after the end of DW.
- the time period or for example, the DW is the first partial time period in the DW
- the first time window is the second partial time period in the DW
- the interval between the DW and the first time window is greater than 0, that is, the first time
- the window is the remaining time period after the end of the first part of the DW.
- the first message carries the service information subscribed or issued by the first NAN device.
- the ranging itself may also be a service
- the service corresponding to the service information may also be ranging, that is, the service information is used to indicate that the first NAN device needs to be subscribed to the ranging.
- the service or the first NAN device needs to publish information about the ranging service.
- the second message is a response message for the first message.
- the second message may be an SDF message, and may be an SDF Publish message or an SDF Follow-up message.
- the first message is an SDF Subscribe message
- the second message may be an SDF Publish message in response to the message
- the first message is an SDF Publish message
- the second message may be an SDF Follow-Up message in response to the message.
- the third message is an acknowledgement message for the second message.
- the second NAN device sends the second message to the first NAN device, including:
- the second NAN device transmits a second message to the first NAN device in the DW or the first time window.
- the ranging trigger information includes one of a ranging principle indication information, a ranging protocol indication information, a ranging requirement indication information, a ranging requirement indication information, and a ranging opening indication information. Any of them; among them,
- the ranging principle indication information is used to indicate the measurement principle on which the distance measurement is performed;
- the ranging protocol indication information is used to indicate a measurement protocol on which the distance measurement is performed
- the ranging request indication information is used to indicate a requirement for a parameter that needs to be satisfied for the measured distance
- the ranging demand indication information is used to indicate a demand for a distance of the NAN device that satisfies the service information
- the ranging open indication information is used to instruct the second NAN device to turn on the ranging function.
- the second NAN device has the corresponding ranging capability indicated by the first NAN device, and may have several different situations, which are described in the flow of FIG. 1.
- the second NAN device may directly use the third time and the fourth time as the second parameter group information, or the second NAN device may also process the third time and the fourth time.
- the information obtained after the processing is used as the second parameter group information.
- the specific form of the second parameter group information is not limited in the embodiment of the present invention, as long as the first NAN device can obtain the third time and the fourth time according to the second parameter group information. Just fine.
- the second NAN device receives the first parameter group information sent by the first NAN device in the first time window, obtaining the second parameter according to the third time and the fourth time After the group information, it also includes:
- the second NAN device sends the second parameter group information to the first NAN device in the first time window; the second parameter group information is used by the first NAN device to obtain the first NAN according to the first parameter group information and the second parameter group information.
- the distance between the device and the second NAN device is used by the first NAN device to obtain the first NAN according to the first parameter group information and the second parameter group information.
- the second NAN device may also send the second parameter group information to the first NAN device, so that the first NAN device can also obtain the distance between the first NAN device and the second NAN device, and meet the requirement that the two NAN devices simultaneously obtain the distance.
- the second NAN device if the second NAN device receives the first parameter group information sent by the first NAN device in the first time window, the second NAN device performs the first parameter group information according to the first parameter group information.
- the parameter information After obtaining the distance between the first NAN device and the second NAN device, the parameter information includes:
- the second NAN device transmits the obtained distance between the first NAN device and the second NAN device to the first NAN device.
- the second NAN device can send the second parameter group information to the first NAN device.
- the obtained distance can be directly sent to the first NAN device, so that the first NAN device does not need to perform calculation, and the first NAN device is mitigated. The amount of work.
- the second NAN device if the second NAN device sends the second parameter group information to the first NAN device in the first time window, the second NAN device receives the third information sent by the first NAN device. After the news, it also includes:
- the first NAN device receives the first parameter group information sent by the first NAN device in the first time window, where the first parameter group information is that the first NAN device receives the third message according to the first time, and sends the third message. Obtained at the second moment;
- the method further includes:
- the first NAN device may send the obtained first parameter group information to the second NAN device, so that the second NAN device can also obtain the distance between the first NAN device and the second NAN device, and meet the requirement that the two NAN devices simultaneously obtain the distance. .
- the method further includes:
- the second NAN device receives the distance between the first NAN device and the second NAN device that is sent by the first NAN device.
- the first NAN device may send the first parameter group information to the second NAN device in addition to the distance between the first NAN device and the second NAN device, and then directly send the obtained distance to the second NAN device.
- the second NAN device does not need to be calculated again. Reduce the workload of the second NAN device.
- FIG. 3 is a first specific example of distance measurement between NAN devices in an embodiment of the present invention. The following is a detailed description of the process shown in FIG. 3 .
- Step 1 The first NAN device sends an SDF Subscribe message on the first channel in the DW.
- the SDF Subscribe message includes a Service ID (Service Identity) of the service that the first NAN device needs to subscribe to, ranging trigger information based on the FTM principle, information of the SW, and information of the second channel establishing the service connection.
- Service ID Service Identity
- the FTM ranging in the embodiment of the present invention refers to the ranging based on the FTM ranging principle, and is not limited to the FTM ranging procedure specified in the IEEE P802.11-REVmc standard.
- Step 2 After receiving the SDF Subscribe message, the second NAN device determines that the service indicated by the Service ID can be provided, starts FTM ranging, returns an SDF Publish message to the first NAN device, and obtains a sending time of sending the SDF Publish message. For example, this time is referred to as t1.
- the first NAN device receives the SDF Publish message and obtains the time to receive the SDF Publish message, for example, the time is referred to as t2.
- Step 3 The first NAN device sends an ACK message for the SDF Publish message to the second NAN device, and obtains a time to send the ACK message, for example, the time is referred to as t3.
- the second NAN device receives the ACK message and obtains the time to receive the ACK message, for example, the time is referred to as t4.
- Step 4 After the DW ends, the second NAN device switches to the second channel according to the information of the second channel, and sends a service connection message to the first NAN device in the SW (for example, connecting the service) The message is called the first service connection message). Similarly, the first NAN device also temporarily switches to the second channel at SW time.
- the first service connection message sent by the second NAN device including t1 and t4.
- the first service connection message may be a Paging message or Association Request and other news.
- the first NAN device may obtain the RTT according to formula (1) according to t1, t4, and t2 and t3 captured by the first NAN device, and may calculate and the second NAN according to formula (2).
- the distance between the devices for example, the calculated distance is d1.
- Step 5 When the first NAN device is set to query only the service within a certain distance d1', the first NAN device determines whether d1 satisfies d1 ⁇ d1'. When satisfied, the first NAN device returns a second service to the second NAN device.
- the connection message such as the second service connection message, is a Paging message or an Association Response message.
- the first NAN device may also carry t2 and t3 in the second service connection message, where the second NAN device calculates the distance from the first NAN device, or the first NAN device may also be in the second service connection message.
- the calculated distance d1 is carried in, so that the second NAN device directly obtains d1.
- the second NAN device determines whether the obtained distance between the first NAN device and the second NAN device is less than d2', If yes, continue with the service establishment process.
- the lengths of the DW and the SW shown in FIG. 3 are only for explaining the technical solutions in the embodiment of the present invention, and do not represent the actual lengths of the DW and the SW. That is, in practical applications, the durations of DW and SW may be equal or may not be equal. If they are not equal, the duration of DW may be longer, or the duration of SW may be longer.
- FIG. 4 is a second specific example of distance measurement between NAN devices in an embodiment of the present invention. The following is a detailed description of the process shown in FIG. 4.
- Step 1 The first NAN device sends an SDF Subscribe message on the first channel in the DW.
- the SDF Subscribe message includes a Service ID of a service that the first NAN device needs to subscribe to, a ranging trigger information based on the FTM principle, information of the SW, and information of a second channel establishing a service connection.
- Step 2 After receiving the SDF Subscribe message, the second NAN device determines that the service indicated by the Service ID can be provided, and starts FTM ranging. When the SW period arrives, it runs on the second channel, and returns an SDF Publish message to the first NAN device in the SW, and obtains a message.
- the sending time of the SDF Publish message is sent, for example, this time is called t1.
- the first NAN device receives the SDF Publish message and obtains the time to receive the SDF Publish message, for example, the time is referred to as t2.
- Step 3 The first NAN device sends an ACK message for the SDF Publish message to the second NAN device, and obtains a time to send the ACK message, for example, the time is referred to as t3.
- the second NAN device receives the ACK message and obtains the time to receive the ACK message, for example, the time is referred to as t4.
- Step 4 The first NAN device sends a service connection message to the second NAN device, and carries the first parameter group information in the service connection message, for example, the first parameter group information includes t2 and t3, so that the second NAN device obtains t2 and T3, and calculate the distance between the first NAN device and the second NAN device.
- the first parameter group information includes t2 and t3, so that the second NAN device obtains t2 and T3, and calculate the distance between the first NAN device and the second NAN device.
- the second NAN device may determine whether to perform subsequent service connection establishment with the first NAN device according to the obtained distance.
- the lengths of the DW and the SW shown in FIG. 4 are only for explaining the technical solutions in the embodiment of the present invention, and do not represent the actual lengths of the DW and the SW. That is, in practical applications, the durations of DW and SW may be equal or may not be equal. If they are not equal, the duration of DW may be longer, or the duration of SW may be longer.
- the first NAN device may carry the ranging trigger information in the first message, so that the first message may be in the DW. Transmitting, and if the second NAN device supports ranging, the second NAN device sends the second parameter group information to the first NAN device in the first time window, so that the first NAN device can obtain the first NAN. The distance between the device and the second NAN device, or the first NAN device may also send the obtained first parameter group information to the second NAN device, so that the second NAN device obtains the first NAN device and the second NAN device. The distance between them.
- the ranging trigger can be performed in the DW, and the ranging triggering is not required after the DW is completed, thereby saving the time required for ranging and improving the time. Ranging efficiency.
- the ranging trigger information can be carried in the first message, and does not need to be sent separately as in the prior art, which reduces the amount of information interaction and saves network resources.
- an embodiment of the present invention provides a NAN device, which may be a first NAN device as described above.
- the NAN device can include a sending module 501 and a determining module 502.
- the sending module 501 is configured to send a first message in the DW, where the first message carries ranging trigger information for triggering the second NAN device to perform ranging, and information of the first time window; the discovery The window is a time window for performing service discovery in the NAN, the first message is a message for performing service discovery, and the first time window is a time window for performing ranging;
- a determining module 502 configured to receive a second message sent by the second NAN device, obtain a first time to receive the second message, and determine a ranging capability of the second NAN device according to the second message, The second message is a response message for the first message;
- the sending module 501 is further configured to send a third message to the second NAN device, obtain a second time to send the third message, and obtain first parameter group information according to the first time and the second time;
- the first parameter group information is used to obtain a distance between the NAN device and the second NAN device, where the third message is an acknowledgement message for the second message;
- the determining module 502 is further configured to receive the second parameter group information sent by the second NAN device in the first time window, and obtain the location according to the first parameter group information and the second parameter group information.
- the distance between the NAN device and the second NAN device; and/or the sending module 501 is further configured to send the first parameter group information to the second NAN device in a first time window, so that Obtaining, by the second NAN device, a distance between the NAN device and the second NAN device according to the first parameter group information and the second parameter group information;
- the second parameter group information is: the second time when the second NAN device obtains the second message, and obtains a fourth time to receive the third message, according to the third moment and the The parameter group information obtained at the fourth time is used, and the second parameter group information is used to obtain a distance between the NAN device and the second NAN device.
- the first message is an SDF message in the NAN, and the first message carries the service information subscribed or issued by the first NAN device.
- the determining module 502 is configured to receive the second message sent by the second NAN device, specifically:
- the ranging trigger information includes one of a ranging principle indication information, a ranging protocol indication information, a ranging requirement indication information, a ranging requirement indication information, and a ranging opening indication information.
- a ranging principle indication information includes one of a ranging principle indication information, a ranging protocol indication information, a ranging requirement indication information, a ranging requirement indication information, and a ranging opening indication information.
- the ranging principle indication information is used to indicate a measurement principle on which the distance measurement is performed
- the ranging protocol indication information is used to indicate a measurement protocol on which the distance measurement is performed
- the ranging requirement indication information is used to indicate a requirement for a parameter that needs to be met for the measured distance
- the ranging requirement indication information is used to indicate a requirement for a distance of a NAN device that satisfies the service information
- the ranging open indication information is used to instruct the second NAN device to enable the ranging function.
- the first NAN device is the same device as the first NAN device in the method described in the flow of FIG. 1, the content not described in the device portion may be referred to the description of the method portion.
- an embodiment of the present invention provides another NAN device, which may be a second NAN device as described above.
- the NAN device may include a receiving module 601 and an obtaining module 602.
- the receiving module 601 is configured to receive, in the DW, the first message sent by the first NAN device, where the first message carries the ranging trigger information for triggering the NAN device to perform ranging, and the information of the first time window.
- the discovery window is a time window for performing service discovery in the NAN
- the first message is a message for performing service discovery
- the first time window is a time window for performing ranging
- the obtaining module 602 is configured to send a second message to the first NAN device, to obtain a third time to send the second message, where the second message is used to indicate a ranging capability of the NAN device, where The second message is a response message for the first message;
- the receiving module 601 is further configured to receive a third message sent by the first NAN device, obtain a fourth time to receive the third message, and obtain second parameter group information according to the third time and the fourth time
- the second parameter group information is used to obtain a distance between the first NAN device and the NAN device, and the third message is an acknowledgement message for the second message;
- the receiving module 601 is further configured to receive the first parameter group information sent by the first NAN device in the first time window, and obtain the first parameter according to the first parameter group information and the second parameter group information. a distance between a NAN device and the NAN device; and/or an obtaining module 602, configured to send the second parameter group information to the first NAN device in a first time window, so that Obtaining, by the first NAN device, a distance between the first NAN device and the NAN device according to the second parameter group information and the first parameter group information;
- the first parameter group information is: the first time that the first NAN device obtains the second message, and the second time that the third message is sent, according to the first time and the The parameter group information obtained at the second moment is used to obtain a distance between the first NAN device and the NAN device.
- the first message is an SDF message in the NAN, and the first message carries the service information subscribed or issued by the first NAN device.
- the acquiring module 602 is configured to send the second message to the first NAN device, specifically:
- the ranging trigger information includes one of a ranging principle indication information, a ranging protocol indication information, a ranging requirement indication information, a ranging requirement indication information, and a ranging opening indication information.
- a ranging principle indication information includes one of a ranging principle indication information, a ranging protocol indication information, a ranging requirement indication information, a ranging requirement indication information, and a ranging opening indication information.
- the ranging principle indication information is used to indicate a measurement principle on which the distance measurement is performed
- the ranging protocol indication information is used to indicate a measurement protocol on which the distance measurement is performed
- the ranging requirement indication information is used to indicate a requirement of a parameter that needs to be satisfied for the measured distance begging;
- the ranging requirement indication information is used to indicate a requirement for a distance of a NAN device that satisfies the service information
- the ranging open indication information is used to instruct the second NAN device to enable the ranging function.
- the second NAN device is the same device as the second NAN device in the method described in the flow of FIG. 2, for the content not introduced in the device part, reference may be made to the description of the method part.
- an embodiment of the present invention provides a NAN device, which may be a first NAN device as described above.
- the NAN device can include a memory 701, a processor 702, and a transceiver 703 that are coupled to the bus 700.
- the memory 701 is configured to store an instruction required by the processor 702 to perform a task
- the transceiver 703 is configured to send a first message in the discovery window DW, where the first message carries the ranging trigger information for triggering the second NAN device to perform ranging, and the information of the first time window;
- the discovery window is a time window for performing service discovery in the NAN, the first message is a message for performing service discovery, the first time window is a time window for performing ranging, and receiving the a second message sent by the second NAN device;
- the processor 702 is configured to execute the instruction, obtain a first time to receive the second message, and determine a ranging capability of the second NAN device according to the second message, where the second message is for a response message describing the first message;
- the transceiver 703 is further configured to send a third message to the second NAN device.
- the processor 702 is further configured to obtain a second time when the third message is sent, and obtain first parameter group information according to the first time and the second time; the first parameter group information is used to obtain the a distance between the NAN device and the second NAN device, the third message being an acknowledgement message for the second message;
- the transceiver 703 is further configured to receive the second parameter group information sent by the second NAN device in the first time window, where the processor 702 is further configured to use the first parameter group information and the The second parameter group information is obtained, and the distance between the NAN device and the second NAN device is obtained; and/or the transceiver 703 is further configured to send the the NN device to the second NAN device in the first time window. a first parameter group information, so that the second NAN device obtains a distance between the NAN device and the second NAN device according to the first parameter group information and the second parameter group information;
- the second parameter group information is: the second time when the second NAN device obtains the second message, and obtains a fourth time to receive the third message, according to the third moment and the The parameter group information obtained at the fourth time is used, and the second parameter group information is used to obtain a distance between the NAN device and the second NAN device.
- the first message is an SDF message in the NAN, and the first message carries the service information subscribed or issued by the first NAN device.
- the transceiver 703 is configured to receive the second message sent by the second NAN device, specifically:
- the ranging trigger information includes one of a ranging principle indication information, a ranging protocol indication information, a ranging requirement indication information, a ranging requirement indication information, and a ranging opening indication information.
- a ranging principle indication information includes one of a ranging principle indication information, a ranging protocol indication information, a ranging requirement indication information, a ranging requirement indication information, and a ranging opening indication information.
- the ranging principle indication information is used to indicate a measurement principle on which the distance measurement is performed
- the ranging protocol indication information is used to indicate a measurement protocol on which the distance measurement is performed
- the ranging requirement indication information is used to indicate a requirement for a parameter that needs to be met for the measured distance
- the ranging requirement indication information is used to indicate a requirement for a distance of a NAN device that satisfies the service information
- the ranging open indication information is used to instruct the second NAN device to enable the ranging function.
- the first NAN device is the same device as the first NAN device in the method described in the flow of FIG. 1, the content not described in the device portion may be referred to the description of the method portion.
- an embodiment of the present invention provides another NAN device, which may be a second NAN device as described above.
- the NAN device can include a memory 801, a processor 802, and a transceiver 803 that are coupled to bus 800.
- the memory 801 is configured to store an instruction required by the processor 802 to perform a task
- the transceiver 803 is configured to receive, in the DW, a first message sent by the first NAN device, where the first message carries ranging trigger information for triggering the NAN device to perform ranging, and information of the first time window.
- the discovery window is a time window for performing service discovery in the NAN
- the first message is a message for performing service discovery
- the first time window is a time window for performing ranging;
- the first NAN device sends a second message;
- the processor 802 is configured to execute the instruction, obtain a third moment to send the second message, where the second message is used to indicate ranging capability of the NAN device, and the second message is for the first a response message to a message;
- the transceiver 803 is further configured to receive a third message sent by the first NAN device;
- the processor 802 is further configured to obtain a fourth moment to receive the third message, obtain second parameter group information according to the third moment and the fourth moment, where the second parameter group information is used to obtain the a distance between the first NAN device and the NAN device, the third message being an acknowledgement message for the second message;
- the transceiver 803 is further configured to receive the first parameter group information sent by the first NAN device in a first time window, where the processor 802 is further configured to use, according to the first parameter group information and the second parameter Group information, obtaining a distance between the first NAN device and the NAN device; and/or, the transceiver 803 is further configured to send the second to the first NAN device in a first time window Parameter group information, so that the first NAN device obtains a distance between the first NAN device and the NAN device according to the second parameter group information and the first parameter group information;
- the first parameter group information is: the first time that the first NAN device obtains the second message, and the second time that the third message is sent, according to the first time and the The parameter group information obtained at the second moment is used to obtain a distance between the first NAN device and the NAN device.
- the first message is an SDF message in the NAN, and the first message carries the service information subscribed or issued by the first NAN device.
- the transceiver 803 is configured to send the second message to the first NAN device, specifically:
- the ranging trigger information includes one of a ranging principle indication information, a ranging protocol indication information, a ranging requirement indication information, a ranging requirement indication information, and a ranging opening indication information.
- a ranging principle indication information includes one of a ranging principle indication information, a ranging protocol indication information, a ranging requirement indication information, a ranging requirement indication information, and a ranging opening indication information.
- the ranging principle indication information is used to indicate a measurement principle on which the distance measurement is performed
- the ranging protocol indication information is used to indicate a measurement protocol on which the distance measurement is performed
- the ranging requirement indication information is used to indicate a requirement for a parameter that needs to be met for the measured distance
- the ranging requirement indication information is used to indicate a requirement for a distance of a NAN device that satisfies the service information
- the ranging open indication information is used to instruct the second NAN device to enable the ranging function.
- the second NAN device is the same device as the second NAN device in the method described in the flow of FIG. 2, for the content not introduced in the device part, reference may be made to the description of the method part.
- the first NAN device may carry the ranging trigger information in the first message, so that the first message may be in the DW. Transmitting, and if the second NAN device supports ranging, the second NAN device sends the second parameter group information to the first NAN device in the first time window, so that the first NAN device can obtain the first NAN.
- the distance between the device and the second NAN device, or the first NAN device may also send the obtained first parameter group information to the second NAN device, so that the second NAN device obtains the first NAN device and the second NAN device. The distance between them.
- the first time window is a service window, that is, in the embodiment of the present invention, the ranging trigger can be performed in the DW without waiting for the DW to complete the measurement trigger with a message, thereby saving the time required for the ranging. , improve the efficiency of ranging.
- the ranging trigger information can be carried in the first message, and the measurement trigger information is not required to be sent by using a message as in the prior art, thereby reducing the amount of information interaction and saving network resources. .
- the disclosed system, apparatus, and method may be implemented in other manners.
- the device embodiments described above are merely illustrative.
- the division of the modules or units is only a logical function division.
- there may be another division manner for example, multiple units or components may be used. Combinations can be integrated into another system, or some features can be ignored or not executed.
- the mutual coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interface, device or unit, and may be in an electrical, mechanical or other form.
- the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of the embodiment.
- each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
- the above integrated unit can be implemented in the form of hardware or in the form of a software functional unit.
- the integrated unit if implemented in the form of a software functional unit and sold or used as a standalone product, may be stored in a computer readable storage medium.
- a computer readable storage medium A number of instructions are included to cause a computer device (which may be a personal computer, server, or network device, etc.) or a processor to perform all or part of the steps of the methods described in various embodiments of the present application.
- the foregoing storage medium includes: a U disk, a mobile hard disk, and a read-only memory.
- a medium that can store program code such as a ROM (Read-Only Memory), a random access memory (RAM), a magnetic disk, or an optical disk.
Landscapes
- Engineering & Computer Science (AREA)
- Computer Security & Cryptography (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Mobile Radio Communication Systems (AREA)
Abstract
The present invention relates to the technical field of communications, and particularly relates to a method of measuring a distance between neighbor awareness network (NAN) devices and a NAN device, so as to address the low efficiency problem of measuring a distance between NAN devices. In embodiments of the present invention, a first NAN device can carry distance measurement triggering information in a first message, thus allowing the first message to be discovered in a discovery window (DW); namely, in the embodiments of the present invention, a distance measurement can be triggered in the DW, and does not have to be separately triggered after the completion of the DW, thereby saving the time required for distance measuring and improving the efficiency of distance measuring.
Description
本发明涉及通信技术领域,尤其涉及一种NAN设备之间的距离测量方法及NAN设备。The present invention relates to the field of communications technologies, and in particular, to a distance measurement method between NAN devices and a NAN device.
目前,Wi-Fi(Wireless-Fidelity,无线保真)技术还在持续改进,例如目前提出了基于Wi-Fi的NAN(Neighbor Awareness Network,邻近感知网络)技术,也称为Wi-Fi Aware(Wi-Fi邻近)技术,在没有中心节点的情况下,该技术可使得所有参与NAN的设备(可称为NAN设备)同步起来,在NAN约定的发现窗口中进行NAN维持的工作和服务发现工作,这样NAN设备可以不断地发现其他的NAN设备,从而在NAN设备之间建立连接,实现数据传输。Currently, Wi-Fi (Wireless-Fidelity) technology continues to improve. For example, Wi-Fi-based NAN (Neighbor Awareness Network) technology is also proposed, also known as Wi-Fi Aware (Wi). -Fi proximity technology, in the absence of a central node, the technology can synchronize all NAN-involved devices (which can be called NAN devices), and perform NAN maintenance work and service discovery in the NAN-consured discovery window. In this way, the NAN device can continuously discover other NAN devices, thereby establishing a connection between the NAN devices to implement data transmission.
在NAN机制中,设置有DW(discovery window,发现窗口),NAN设备会在DW中进行服务发现。In the NAN mechanism, a DW (discovery window) is set, and the NAN device performs service discovery in the DW.
目前无线终端的业务形式多样,无线终端之间在进行服务发现时进行测距的需求日益增加,例如朋友接近检测、限定距离范围内广告等。然而在NAN设备之间,若要完成测距,则一般都需要在DW结束之后才能进行,即,在DW结束之后,一个NAN设备才能向另一个NAN设备发送用于测距的触发消息,若另一个NAN设备支持进行测距,则这两个NAN设备才能完成测距。可见,现有技术中,若要完成NAN设备之间的测距,需要耗费较多的时间,测距效率较低。At present, wireless terminals have various service forms, and there is an increasing demand for ranging between wireless terminals when performing service discovery, such as friends approaching detection, advertising within a limited distance range, and the like. However, between the NAN devices, if the ranging is to be completed, it generally needs to be performed after the DW ends. That is, after the DW ends, one NAN device can send a trigger message for ranging to another NAN device. Another NAN device supports ranging, and the two NAN devices can complete the ranging. It can be seen that in the prior art, if the ranging between the NAN devices is to be completed, it takes a lot of time and the ranging efficiency is low.
发明内容Summary of the invention
本发明实施例提供一种NAN设备之间的距离测量方法及NAN设备,用以解决NAN设备之间测距时效率较低的技术问题。The embodiments of the present invention provide a distance measurement method between NAN devices and a NAN device, which are used to solve the technical problem of low efficiency when ranging between NAN devices.
第一方面,本发明实施例提供了一种NAN设备之间的距离测量方法,包
括:In a first aspect, an embodiment of the present invention provides a method for measuring a distance between NAN devices, and a packet
include:
第一NAN设备在DW中发送第一消息,所述第一消息中携带有用于触发所述第二NAN设备进行测距的测距触发信息,以及第一时间窗口的信息;所述发现窗口为NAN中用于进行服务发现的时间窗口,所述第一消息为用于进行服务发现的消息,所述第一时间窗口为用于进行测距的时间窗口;The first NAN device sends a first message in the DW, where the first message carries ranging trigger information for triggering the second NAN device to perform ranging, and information of the first time window; the discovery window is a time window for performing service discovery in the NAN, the first message is a message for performing service discovery, and the first time window is a time window for performing ranging;
所述第一NAN设备接收所述第二NAN设备发送的第二消息,获得接收所述第二消息的第一时刻,并根据所述第二消息确定所述第二NAN设备的测距能力,所述第二消息为针对所述第一消息的响应消息;Receiving, by the first NAN device, the second message sent by the second NAN device, obtaining a first time to receive the second message, and determining a ranging capability of the second NAN device according to the second message, The second message is a response message for the first message;
所述第一NAN设备向所述第二NAN设备发送第三消息,获得发送所述第三消息的第二时刻,根据所述第一时刻和所述第二时刻获得第一参数组信息;所述第一参数组信息用于获得所述第一NAN设备与所述第二NAN设备之间的距离,所述第三消息为针对所述第二消息的确认消息;The first NAN device sends a third message to the second NAN device, obtains a second time to send the third message, and obtains first parameter group information according to the first time and the second time; The first parameter group information is used to obtain a distance between the first NAN device and the second NAN device, where the third message is an acknowledgement message for the second message;
所述第一NAN设备在所述第一时间窗口中,接收所述第二NAN设备发送的第二参数组信息,所述第一NAN设备根据所述第一参数组信息和所述第二参数组信息,获得所述第一NAN设备与所述第二NAN设备之间的距离;和/或,所述第一NAN设备在第一时间窗口中,向所述第二NAN设备发送所述第一参数组信息,以便所述第二NAN设备根据所述第一参数组信息及所述第二参数组信息获得所述第一NAN设备与所述第二NAN设备之间的距离;Receiving, by the first NAN device, the second parameter group information sent by the second NAN device in the first time window, where the first NAN device is configured according to the first parameter group information and the second parameter Group information, obtaining a distance between the first NAN device and the second NAN device; and/or, the first NAN device transmitting the first to the second NAN device in a first time window a parameter group information, so that the second NAN device obtains a distance between the first NAN device and the second NAN device according to the first parameter group information and the second parameter group information;
其中,所述第二参数组信息为:所述第二NAN设备获得发送所述第二消息的第三时刻,以及获得接收所述第三消息的第四时刻,根据所述第三时刻和所述第四时刻获得的参数组信息,所述第二参数组信息用于获得所述第一NAN设备与所述第二NAN设备之间的距离。The second parameter group information is: the second time when the second NAN device obtains the second message, and obtains a fourth time to receive the third message, according to the third moment and the The parameter group information obtained at the fourth time, the second parameter group information is used to obtain a distance between the first NAN device and the second NAN device.
结合第一方面,在第一种可能的实现方式中,所述第一消息为NAN中的SDF消息,所述第一消息中携带有所述第一NAN设备订阅或发布的服务信息。With reference to the first aspect, in a first possible implementation, the first message is an SDF message in the NAN, and the first message carries the service information subscribed or issued by the first NAN device.
结合第一方面,或者第一方面的第一种可能的实现方式,在第二种可能的实现方式中,所述第一NAN设备接收所述第二NAN设备发送的第二消息,包括:
With reference to the first aspect, or the first possible implementation manner of the first aspect, in a second possible implementation, the first NAN device receives the second message sent by the second NAN device, including:
所述第一NAN设备在所述发现窗口或所述第一时间窗口中接收所述第二消息。The first NAN device receives the second message in the discovery window or the first time window.
第二方面,本发明实施例提供了一种或任意几种;其中,In a second aspect, the embodiment of the present invention provides one or any of the following;
所述测距原理指示信息用于指示进行距离测量所依据的测量原理;The ranging principle indication information is used to indicate a measurement principle on which the distance measurement is performed;
所述测距协议指示信息用于指示进行距离测量所依据的测量协议;The ranging protocol indication information is used to indicate a measurement protocol on which the distance measurement is performed;
所述测距要求指示信息用于指示对所测量的距离所需要满足的参数的需求;The ranging requirement indication information is used to indicate a requirement for a parameter that needs to be met for the measured distance;
所述测距需求指示信息用于指示对满足所述服务信息的NAN设备的距离的需求;The ranging requirement indication information is used to indicate a requirement for a distance of a NAN device that satisfies the service information;
所述测距开启指示信息用于指示所述第二NAN设备开启测距功能。The ranging open indication information is used to instruct the second NAN device to enable the ranging function.
第三方面,本发明实施例提供了一种NAN设备之间的距离测量方法,包括:In a third aspect, an embodiment of the present invention provides a method for measuring a distance between NAN devices, including:
第二NAN设备在DW中接收第一NAN设备发送的第一消息,所述第一消息中携带有用于触发所述第二NAN设备进行测距的测距触发信息,以及第一时间窗口的信息;所述发现窗口为NAN中用于进行服务发现的时间窗口,所述第一消息为用于进行服务发现的消息,所述第一时间窗口为用于进行测距的时间窗口;The second NAN device receives the first message sent by the first NAN device in the DW, where the first message carries the ranging trigger information for triggering the second NAN device to perform ranging, and the information of the first time window. The discovery window is a time window for performing service discovery in the NAN, the first message is a message for performing service discovery, and the first time window is a time window for performing ranging;
所述第二NAN设备向所述第一NAN设备发送第二消息,获得发送所述第二消息的第三时刻,所述第二消息用于表明所述第二NAN设备的测距能力,所述第二消息为针对所述第一消息的响应消息;The second NAN device sends a second message to the first NAN device to obtain a third time to send the second message, where the second message is used to indicate the ranging capability of the second NAN device. The second message is a response message for the first message;
所述第二NAN设备接收所述第一NAN设备发送的第三消息,获得接收所述第三消息的第四时刻,根据所述第三时刻和所述第四时刻获得第二参数组信息;所述第二参数组信息用于获得所述第一NAN设备与所述第二NAN设备之间的距离,所述第三消息为针对所述第二消息的确认消息;The second NAN device receives the third message sent by the first NAN device, obtains a fourth time to receive the third message, and obtains second parameter group information according to the third time and the fourth time; The second parameter group information is used to obtain a distance between the first NAN device and the second NAN device, where the third message is an acknowledgement message for the second message;
所述第二NAN设备在第一时间窗口中,接收所述第一NAN设备发送的第一参数组信息,所述第二NAN设备根据所述第一参数组信息和所述第二参数组信息,获得所述第一NAN设备与所述第二NAN设备之间的距离;和/
或,所述第二NAN设备在第一时间窗口中,向所述第一NAN设备发送所述第二参数组信息,以便所述第一NAN设备根据所述第二参数组信息和所述第一参数组信息获得所述第一NAN设备与所述第二NAN设备之间的距离;Receiving, by the second NAN device, the first parameter group information sent by the first NAN device in the first time window, where the second NAN device is configured according to the first parameter group information and the second parameter group information Obtaining a distance between the first NAN device and the second NAN device; and /
Or the second NAN device sends the second parameter group information to the first NAN device in a first time window, so that the first NAN device is configured according to the second parameter group information and the first Obtaining a distance between the first NAN device and the second NAN device by a parameter group information;
其中,所述第一参数组信息为:所述第一NAN设备获得接收所述第二消息的第一时刻,以及获得发送所述第三消息的第二时刻,根据所述第一时刻和所述第二时刻获得的参数组信息,所述第一参数组信息用于获得所述第一NAN设备与所述第二NAN设备之间的距离。The first parameter group information is: the first time that the first NAN device obtains the second message, and the second time that the third message is sent, according to the first time and the The parameter group information obtained at the second moment is used to obtain a distance between the first NAN device and the second NAN device.
结合第三方面,在第三方面的第一种可能的实现方式中,所述第一消息为NAN中的SDF消息,所述第一消息中携带有所述第一NAN设备订阅或发布的服务信息。With reference to the third aspect, in a first possible implementation manner of the third aspect, the first message is an SDF message in the NAN, where the first message carries a service subscribed or published by the first NAN device. information.
结合第三方面,或者第三方面的第一种可能的实现方式,在第二种可能的实现方式中,所述第二NAN设备向所述第一NAN设备发送第二消息,包括:With the third aspect, or the first possible implementation manner of the third aspect, in a second possible implementation manner, the second NAN device sends the second message to the first NAN device, including:
所述第二NAN设备在所述发现窗口或所述第一时间窗口中向所述第一NAN设备发送所述第二消息。The second NAN device sends the second message to the first NAN device in the discovery window or the first time window.
第四方面,本发明实施例提供了一种或任意几种;其中,In a fourth aspect, the embodiment of the present invention provides one or any of the following;
所述测距原理指示信息用于指示进行距离测量所依据的测量原理;The ranging principle indication information is used to indicate a measurement principle on which the distance measurement is performed;
所述测距协议指示信息用于指示进行距离测量所依据的测量协议;The ranging protocol indication information is used to indicate a measurement protocol on which the distance measurement is performed;
所述测距要求指示信息用于指示对所测量的距离所需要满足的参数的需求;The ranging requirement indication information is used to indicate a requirement for a parameter that needs to be met for the measured distance;
所述测距需求指示信息用于指示对满足所述服务信息的NAN设备的距离的需求;The ranging requirement indication information is used to indicate a requirement for a distance of a NAN device that satisfies the service information;
所述测距开启指示信息用于指示所述第二NAN设备开启测距功能。The ranging open indication information is used to instruct the second NAN device to enable the ranging function.
第五方面,本发明实施例提供了一种NAN设备,包括:In a fifth aspect, an embodiment of the present invention provides a NAN device, including:
发送模块,用于在DW中发送第一消息,所述第一消息中携带有用于触发所述第二NAN设备进行测距的测距触发信息,以及第一时间窗口的信息;所述发现窗口为NAN中用于进行服务发现的时间窗口,所述第一消息为用于
进行服务发现的消息,所述第一时间窗口为用于进行测距的时间窗口;a sending module, configured to send a first message in the DW, where the first message carries ranging trigger information for triggering the second NAN device to perform ranging, and information of a first time window; the discovery window The time window for performing service discovery in the NAN, the first message is for
Performing a service discovery message, where the first time window is a time window for performing ranging;
确定模块,用于接收所述第二NAN设备发送的第二消息,获得接收所述第二消息的第一时刻,并根据所述第二消息确定所述第二NAN设备的测距能力,所述第二消息为针对所述第一消息的响应消息;a determining module, configured to receive a second message sent by the second NAN device, obtain a first time to receive the second message, and determine a ranging capability of the second NAN device according to the second message, where The second message is a response message for the first message;
所述发送模块,还用于向所述第二NAN设备发送第三消息,获得发送所述第三消息的第二时刻,根据所述第一时刻和所述第二时刻获得第一参数组信息;所述第一参数组信息用于获得所述NAN设备与所述第二NAN设备之间的距离,所述第三消息为针对所述第二消息的确认消息;The sending module is further configured to send a third message to the second NAN device, obtain a second time to send the third message, and obtain first parameter group information according to the first time and the second time The first parameter group information is used to obtain a distance between the NAN device and the second NAN device, and the third message is an acknowledgement message for the second message;
所述确定模块,还用于在所述第一时间窗口中,接收所述第二NAN设备发送的第二参数组信息,根据所述第一参数组信息和所述第二参数组信息,获得所述NAN设备与所述第二NAN设备之间的距离;和/或,所述发送模块,还用于在第一时间窗口中,向所述第二NAN设备发送所述第一参数组信息,以便所述第二NAN设备根据所述第一参数组信息及所述第二参数组信息获得所述NAN设备与所述第二NAN设备之间的距离;The determining module is further configured to receive the second parameter group information sent by the second NAN device in the first time window, and obtain the second parameter group information according to the first parameter group information and the second parameter group information. a distance between the NAN device and the second NAN device; and/or the sending module is further configured to send the first parameter group information to the second NAN device in a first time window The second NAN device obtains a distance between the NAN device and the second NAN device according to the first parameter group information and the second parameter group information;
其中,所述第二参数组信息为:所述第二NAN设备获得发送所述第二消息的第三时刻,以及获得接收所述第三消息的第四时刻,根据所述第三时刻和所述第四时刻获得的参数组信息,所述第二参数组信息用于获得所述NAN设备与所述第二NAN设备之间的距离。The second parameter group information is: the second time when the second NAN device obtains the second message, and obtains a fourth time to receive the third message, according to the third moment and the The parameter group information obtained at the fourth time is used, and the second parameter group information is used to obtain a distance between the NAN device and the second NAN device.
结合第五方面,在第五方面的第一种可能的实现方式中,所述第一消息为NAN中的SDF消息,所述第一消息中携带有所述第一NAN设备订阅或发布的服务信息。With reference to the fifth aspect, in a first possible implementation manner of the fifth aspect, the first message is an SDF message in the NAN, where the first message carries a service subscribed or published by the first NAN device. information.
结合第五方面,或者第五方面的第一种可能的实现方式,在第二种可能的实现方式中,所述确定模块用于接收所述第二NAN设备发送的第二消息,具体为:With reference to the fifth aspect, or the first possible implementation manner of the fifth aspect, in the second possible implementation, the determining module is configured to receive the second message sent by the second NAN device, specifically:
在所述发现窗口或所述第一时间窗口中接收所述第二消息。Receiving the second message in the discovery window or the first time window.
第六方面,本发明实施例提供了一种或任意几种;其中,In a sixth aspect, the embodiment of the present invention provides one or any of the following;
所述测距原理指示信息用于指示进行距离测量所依据的测量原理;
The ranging principle indication information is used to indicate a measurement principle on which the distance measurement is performed;
所述测距协议指示信息用于指示进行距离测量所依据的测量协议;The ranging protocol indication information is used to indicate a measurement protocol on which the distance measurement is performed;
所述测距要求指示信息用于指示对所测量的距离所需要满足的参数的需求;The ranging requirement indication information is used to indicate a requirement for a parameter that needs to be met for the measured distance;
所述测距需求指示信息用于指示对满足所述服务信息的NAN设备的距离的需求;The ranging requirement indication information is used to indicate a requirement for a distance of a NAN device that satisfies the service information;
所述测距开启指示信息用于指示所述第二NAN设备开启测距功能。The ranging open indication information is used to instruct the second NAN device to enable the ranging function.
第七方面,本发明实施例提供了一种NAN设备,包括:In a seventh aspect, an embodiment of the present invention provides a NAN device, including:
接收模块,用于在DW中接收第一NAN设备发送的第一消息,所述第一消息中携带有用于触发所述NAN设备进行测距的测距触发信息,以及第一时间窗口的信息;所述发现窗口为NAN中用于进行服务发现的时间窗口,所述第一消息为用于进行服务发现的消息,所述第一时间窗口为用于进行测距的时间窗口;a receiving module, configured to receive, in the DW, a first message sent by the first NAN device, where the first message carries ranging trigger information for triggering the NAN device to perform ranging, and information of the first time window; The discovery window is a time window for performing service discovery in the NAN, the first message is a message for performing service discovery, and the first time window is a time window for performing ranging;
获取模块,用于向所述第一NAN设备发送第二消息,获得发送所述第二消息的第三时刻,所述第二消息用于表明所述NAN设备的测距能力,所述第二消息为针对所述第一消息的响应消息;An acquiring module, configured to send a second message to the first NAN device, to obtain a third moment to send the second message, where the second message is used to indicate a ranging capability of the NAN device, and the second The message is a response message for the first message;
所述接收模块,还用于接收所述第一NAN设备发送的第三消息,获得接收所述第三消息的第四时刻,根据所述第三时刻和所述第四时刻获得第二参数组信息;所述第二参数组信息用于获得所述第一NAN设备与所述NAN设备之间的距离,所述第三消息为针对所述第二消息的确认消息;The receiving module is further configured to receive a third message sent by the first NAN device, obtain a fourth time to receive the third message, and obtain a second parameter group according to the third time and the fourth time The second parameter group information is used to obtain a distance between the first NAN device and the NAN device, where the third message is an acknowledgement message for the second message;
所述接收模块,还用于在第一时间窗口中,接收所述第一NAN设备发送的第一参数组信息,根据所述第一参数组信息和所述第二参数组信息,获得所述第一NAN设备与所述NAN设备之间的距离;和/或,所述获取模块,还用于在第一时间窗口中,向所述第一NAN设备发送所述第二参数组信息,以便所述第一NAN设备根据所述第二参数组信息和所述第一参数组信息获得所述第一NAN设备与所述NAN设备之间的距离;The receiving module is further configured to receive the first parameter group information sent by the first NAN device in a first time window, and obtain the foregoing according to the first parameter group information and the second parameter group information. a distance between the first NAN device and the NAN device; and/or the acquiring module is further configured to send the second parameter group information to the first NAN device in a first time window, so that Obtaining, by the first NAN device, a distance between the first NAN device and the NAN device according to the second parameter group information and the first parameter group information;
其中,所述第一参数组信息为:所述第一NAN设备获得接收所述第二消息的第一时刻,以及获得发送所述第三消息的第二时刻,根据所述第一时刻
和所述第二时刻获得的参数组信息,所述第一参数组信息用于获得所述第一NAN设备与所述NAN设备之间的距离。The first parameter group information is: the first time when the first NAN device obtains the second message, and the second time when the third message is sent, according to the first time
And the parameter group information obtained at the second moment, the first parameter group information is used to obtain a distance between the first NAN device and the NAN device.
结合第七方面,在第七方面的第一种可能的实现方式中,所述第一消息为NAN中的SDF消息,所述第一消息中携带有所述第一NAN设备订阅或发布的服务信息。With reference to the seventh aspect, in a first possible implementation manner of the seventh aspect, the first message is an SDF message in the NAN, where the first message carries a service subscribed or published by the first NAN device. information.
结合第七方面,或者第七方面第一种可能的实现方式,在第二种可能的实现方式中,所述获取模块用于向所述第一NAN设备发送第二消息,具体为:在所述发现窗口或所述第一时间窗口中向所述第一NAN设备发送所述第二消息。With reference to the seventh aspect, or the first possible implementation manner of the seventh aspect, in a second possible implementation, the acquiring module is configured to send a second message to the first NAN device, specifically: Transmitting the second message to the first NAN device in the discovery window or the first time window.
第八方面,本发明实施例提供了一种或任意几种;其中,In an eighth aspect, the embodiment of the present invention provides one or any of the following;
所述测距原理指示信息用于指示进行距离测量所依据的测量原理;The ranging principle indication information is used to indicate a measurement principle on which the distance measurement is performed;
所述测距协议指示信息用于指示进行距离测量所依据的测量协议;The ranging protocol indication information is used to indicate a measurement protocol on which the distance measurement is performed;
所述测距要求指示信息用于指示对所测量的距离所需要满足的参数的需求;The ranging requirement indication information is used to indicate a requirement for a parameter that needs to be met for the measured distance;
所述测距需求指示信息用于指示对满足所述服务信息的NAN设备的距离的需求;The ranging requirement indication information is used to indicate a requirement for a distance of a NAN device that satisfies the service information;
所述测距开启指示信息用于指示所述第二NAN设备开启测距功能。The ranging open indication information is used to instruct the second NAN device to enable the ranging function.
第九方面,本发明实施例提供了一种NAN设备,包括连接到同一总线的存储器、处理器和收发器;In a ninth aspect, an embodiment of the present invention provides a NAN device, including a memory, a processor, and a transceiver connected to the same bus;
所述存储器,用于存储指令;The memory is configured to store an instruction;
所述收发器,用于在DW中发送第一消息,所述第一消息中携带有用于触发所述第二NAN设备进行测距的测距触发信息,以及第一时间窗口的信息;所述发现窗口为NAN中用于进行服务发现的时间窗口,所述第一消息为用于进行服务发现的消息,所述第一时间窗口为用于进行测距的时间窗口;及接收所述第二NAN设备发送的第二消息;The transceiver is configured to send a first message in the DW, where the first message carries ranging trigger information for triggering the second NAN device to perform ranging, and information of a first time window; The discovery window is a time window for performing service discovery in the NAN, the first message is a message for performing service discovery, the first time window is a time window for performing ranging, and the second is received a second message sent by the NAN device;
所述处理器,用于执行所述指令,获得接收所述第二消息的第一时刻,并根据所述第二消息确定所述第二NAN设备的测距能力,所述第二消息为针
对所述第一消息的响应消息;The processor is configured to execute the instruction, obtain a first time to receive the second message, and determine a ranging capability of the second NAN device according to the second message, where the second message is a pin
a response message to the first message;
所述收发器,还用于向所述第二NAN设备发送第三消息;The transceiver is further configured to send a third message to the second NAN device;
所述处理器,还用于获得发送所述第三消息的第二时刻,根据所述第一时刻和所述第二时刻获得第一参数组信息;所述第一参数组信息用于获得所述NAN设备与所述第二NAN设备之间的距离,所述第三消息为针对所述第二消息的确认消息;The processor is further configured to obtain a second time when the third message is sent, and obtain first parameter group information according to the first time and the second time; the first parameter group information is used to obtain a Defining a distance between the NAN device and the second NAN device, where the third message is an acknowledgement message for the second message;
所述收发器,还用于在所述第一时间窗口中,接收所述第二NAN设备发送的第二参数组信息,所述处理器,还用于根据所述第一参数组信息和所述第二参数组信息,获得所述NAN设备与所述第二NAN设备之间的距离;和/或,所述收发器,还用于在第一时间窗口中,向所述第二NAN设备发送所述第一参数组信息,以便所述第二NAN设备根据所述第一参数组信息及所述第二参数组信息获得所述NAN设备与所述第二NAN设备之间的距离;The transceiver is further configured to receive the second parameter group information that is sent by the second NAN device in the first time window, where the processor is further configured to use the first parameter group information and the The second parameter group information is obtained, obtaining a distance between the NAN device and the second NAN device; and/or the transceiver is further configured to, in the first time window, to the second NAN device Transmitting the first parameter group information, so that the second NAN device obtains a distance between the NAN device and the second NAN device according to the first parameter group information and the second parameter group information;
其中,所述第二参数组信息为:所述第二NAN设备获得发送所述第二消息的第三时刻,以及获得接收所述第三消息的第四时刻,根据所述第三时刻和所述第四时刻获得的参数组信息,所述第二参数组信息用于获得所述NAN设备与所述第二NAN设备之间的距离。The second parameter group information is: the second time when the second NAN device obtains the second message, and obtains a fourth time to receive the third message, according to the third moment and the The parameter group information obtained at the fourth time is used, and the second parameter group information is used to obtain a distance between the NAN device and the second NAN device.
结合第九方面,在第九方面的第一种可能的实现方式中,所述第一消息为NAN中的SDF消息,所述第一消息中携带有所述第一NAN设备订阅或发布的服务信息。With reference to the ninth aspect, in a first possible implementation manner of the ninth aspect, the first message is an SDF message in the NAN, where the first message carries a service subscribed or published by the first NAN device. information.
结合第九方面,或者第九方面第一种可能的实现方式,在第二种可能的实现方式中,所述收发器用于接收所述第二NAN设备发送的第二消息,具体为:With reference to the ninth aspect, or the first possible implementation manner of the ninth aspect, in a second possible implementation, the transceiver is configured to receive the second message sent by the second NAN device, specifically:
在所述发现窗口或所述第一时间窗口中接收所述第二消息。Receiving the second message in the discovery window or the first time window.
第十方面,本发明实施例提供了一种或任意几种;其中,A tenth aspect, the embodiment of the present invention provides one or any of the following;
所述测距原理指示信息用于指示进行距离测量所依据的测量原理;The ranging principle indication information is used to indicate a measurement principle on which the distance measurement is performed;
所述测距协议指示信息用于指示进行距离测量所依据的测量协议;The ranging protocol indication information is used to indicate a measurement protocol on which the distance measurement is performed;
所述测距要求指示信息用于指示对所测量的距离所需要满足的参数的需
求;The ranging requirement indication information is used to indicate a requirement of a parameter that needs to be satisfied for the measured distance
begging;
所述测距需求指示信息用于指示对满足所述服务信息的NAN设备的距离的需求;The ranging requirement indication information is used to indicate a requirement for a distance of a NAN device that satisfies the service information;
所述测距开启指示信息用于指示所述第二NAN设备开启测距功能。The ranging open indication information is used to instruct the second NAN device to enable the ranging function.
第十一方面,本发明实施例提供了一种邻近感知网络NAN设备,包括连接到同一总线的存储器、处理器和收发器;In an eleventh aspect, an embodiment of the present invention provides a proximity aware network NAN device, including a memory, a processor, and a transceiver connected to the same bus;
所述存储器,用于存储指令;The memory is configured to store an instruction;
所述收发器,用于在发现窗口DW中接收第一NAN设备发送的第一消息,所述第一消息中携带有用于触发所述NAN设备进行测距的测距触发信息,以及第一时间窗口的信息;所述发现窗口为NAN中用于进行服务发现的时间窗口,所述第一消息为用于进行服务发现的消息,所述第一时间窗口为用于进行测距的时间窗口;及向所述第一NAN设备发送第二消息;The transceiver is configured to receive, in a discovery window DW, a first message sent by a first NAN device, where the first message carries a ranging trigger information for triggering the NAN device to perform ranging, and a first time Information of the window; the discovery window is a time window for performing service discovery in the NAN, the first message is a message for performing service discovery, and the first time window is a time window for performing ranging; And sending a second message to the first NAN device;
所述处理器,用于执行所述指令,获得发送所述第二消息的第三时刻,所述第二消息用于表明所述NAN设备的测距能力,所述第二消息为针对所述第一消息的响应消息;The processor is configured to execute the instruction, obtain a third moment to send the second message, where the second message is used to indicate ranging capability of the NAN device, and the second message is for the a response message of the first message;
所述收发器,还用于接收所述第一NAN设备发送的第三消息;The transceiver is further configured to receive a third message sent by the first NAN device;
所述处理器,还用于获得接收所述第三消息的第四时刻,根据所述第三时刻和所述第四时刻获得第二参数组信息;所述第二参数组信息用于获得所述第一NAN设备与所述NAN设备之间的距离,所述第三消息为针对所述第二消息的确认消息;The processor is further configured to obtain a fourth time to receive the third message, obtain second parameter group information according to the third time and the fourth time; the second parameter group information is used to obtain the Defining a distance between the first NAN device and the NAN device, where the third message is an acknowledgement message for the second message;
所述收发器,还用于在第一时间窗口中,接收所述第一NAN设备发送的第一参数组信息,所述处理器,还用于根据所述第一参数组信息和所述第二参数组信息,获得所述第一NAN设备与所述NAN设备之间的距离;和/或,所述收发器,还用于在第一时间窗口中,向所述第一NAN设备发送所述第二参数组信息,以便所述第一NAN设备根据所述第二参数组信息和所述第一参数组信息获得所述第一NAN设备与所述NAN设备之间的距离;The transceiver is further configured to receive the first parameter group information sent by the first NAN device in a first time window, where the processor is further configured to use, according to the first parameter group information, the The second parameter group information is obtained, and the distance between the first NAN device and the NAN device is obtained; and/or the transceiver is further configured to send the first NAN device to the first NAN device in a first time window. The second parameter group information is obtained, so that the first NAN device obtains a distance between the first NAN device and the NAN device according to the second parameter group information and the first parameter group information;
其中,所述第一参数组信息为:所述第一NAN设备获得接收所述第二消
息的第一时刻,以及获得发送所述第三消息的第二时刻,根据所述第一时刻和所述第二时刻获得的参数组信息,所述第一参数组信息用于获得所述第一NAN设备与所述NAN设备之间的距离。The first parameter group information is: the first NAN device obtains the second cancellation
The first time of the information, and the second time when the third message is sent, the first parameter group information is used to obtain the first parameter according to the parameter group information obtained by the first time and the second time The distance between a NAN device and the NAN device.
结合第十一方面,在第十一方面的第一种可能的实现方式中,所述第一消息为NAN中的SDF消息,所述第一消息中携带有所述第一NAN设备订阅或发布的服务信息。With reference to the eleventh aspect, in a first possible implementation manner of the eleventh aspect, the first message is an SDF message in the NAN, where the first message carries the first NAN device subscription or release Service information.
结合第十一方面,或者第十一方面第一种可能的实现方式,在第二种可能的实现方式中,所述收发器用于向所述第一NAN设备发送第二消息,具体为:With reference to the eleventh aspect, or the first possible implementation manner of the eleventh aspect, in a second possible implementation, the transceiver is configured to send a second message to the first NAN device, specifically:
在所述发现窗口或所述第一时间窗口中向所述第一NAN设备发送所述第二消息。Transmitting the second message to the first NAN device in the discovery window or the first time window.
第十二方面,本发明实施例提供了一种或任意几种;其中,In a twelfth aspect, the embodiment of the present invention provides one or any of the following;
所述测距原理指示信息用于指示进行距离测量所依据的测量原理;The ranging principle indication information is used to indicate a measurement principle on which the distance measurement is performed;
所述测距协议指示信息用于指示进行距离测量所依据的测量协议;The ranging protocol indication information is used to indicate a measurement protocol on which the distance measurement is performed;
所述测距要求指示信息用于指示对所测量的距离所需要满足的参数的需求;The ranging requirement indication information is used to indicate a requirement for a parameter that needs to be met for the measured distance;
所述测距需求指示信息用于指示对满足所述服务信息的NAN设备的距离的需求;The ranging requirement indication information is used to indicate a requirement for a distance of a NAN device that satisfies the service information;
所述测距开启指示信息用于指示所述第二NAN设备开启测距功能。The ranging open indication information is used to instruct the second NAN device to enable the ranging function.
本发明实施例中,第一NAN设备若想要测量与第二NAN设备之间的距离,则第一NAN设备可以将测距触发信息携带在第一消息中,从而可以将第一消息在DW中进行发送,而后续若第二NAN设备支持测距,则第二NAN设备会在第一时间窗口中向第一NAN设备发送第二参数组信息,从而第一NAN设备就能够获得第一NAN设备与第二NAN设备之间的距离,或者第一NAN设备也可以将获得的第一参数组信息发送给第二NAN设备,以使第二NAN设备获得第一NAN设备和第二NAN设备之间的距离。例如第一时间窗口是服务窗口,即本发明实施例中,在DW中就能够进行测距触发,而无需
等到DW完毕后再专门用一个消息进行测距触发,节省了测距所需的时间,提高了测距效率。In the embodiment of the present invention, if the first NAN device wants to measure the distance between the second NAN device and the second NAN device, the first NAN device may carry the ranging trigger information in the first message, so that the first message may be in the DW. Transmitting, and if the second NAN device supports ranging, the second NAN device sends the second parameter group information to the first NAN device in the first time window, so that the first NAN device can obtain the first NAN. The distance between the device and the second NAN device, or the first NAN device may also send the obtained first parameter group information to the second NAN device, so that the second NAN device obtains the first NAN device and the second NAN device. The distance between them. For example, the first time window is a service window, that is, in the embodiment of the present invention, the ranging trigger can be performed in the DW without
After the completion of the DW, a special message is used to perform the ranging trigger, which saves the time required for ranging and improves the ranging efficiency.
并且,本发明实施例中可以将测距触发信息携带在第一消息中发送,无需像现有技术中那样再专门用一个消息来发送测距触发信息,减少了信息的交互量,节省网络资源。In addition, in the embodiment of the present invention, the ranging trigger information can be carried in the first message, and the measurement trigger information is not required to be sent by using a message as in the prior art, thereby reducing the amount of information interaction and saving network resources. .
图1为本发明实施例中第一种NAN设备之间的距离测量方法的主要流程图;1 is a main flowchart of a method for measuring a distance between a first type of NAN device according to an embodiment of the present invention;
图2为本发明实施例中第二种NAN设备之间的距离测量方法的主要流程图;2 is a main flowchart of a distance measurement method between second NAN devices according to an embodiment of the present invention;
图3为本发明实施例中NAN设备之间的距离测量方法的一个具体示例的流程图;3 is a flowchart of a specific example of a method for measuring a distance between NAN devices according to an embodiment of the present invention;
图4为本发明实施例中NAN设备之间的距离测量方法的另一个具体示例的流程图;4 is a flowchart of another specific example of a distance measurement method between NAN devices according to an embodiment of the present invention;
图5为本发明实施例中第一NAN设备的结构框图;FIG. 5 is a structural block diagram of a first NAN device according to an embodiment of the present invention;
图6为本发明实施例中第二NAN设备的结构框图;6 is a structural block diagram of a second NAN device according to an embodiment of the present invention;
图7为本发明实施例中第一NAN设备的结构示意图;FIG. 7 is a schematic structural diagram of a first NAN device according to an embodiment of the present invention;
图8为本发明实施例中第二NAN设备的结构示意图。FIG. 8 is a schematic structural diagram of a second NAN device according to an embodiment of the present invention.
首先介绍NAN机制的相关内容。First introduce the relevant content of the NAN mechanism.
NAN机制一般每512个TU(time unit,时间单元)内设置有一个DW,其中一个TU的持续时长大约为1024μs,DW的持续时长一般为16TU,即在NAN机制中,一般每隔496个TU设置一个DW。在NAN机制中,一个或多个NAN设备形成一个Cluster(簇),一个Cluster在进入DW时,由该Cluster中处于master(主节点)、anchor master(AM,锚主节点)、以及non-master sync(non-master synchronization,负责同步的主节点)状态等的NAN设备发送
sync beacon(同步信标帧)消息,该消息中携带有该Cluster中的AM的信息,用于接收到该消息的NAN设备与该Cluster中的AM实现同步。The NAN mechanism generally has one DW set in every 512 TU (time unit), wherein the duration of one TU is about 1024 μs, and the duration of DW is generally 16 TU, that is, in the NAN mechanism, generally every 496 TUs. Set a DW. In the NAN mechanism, one or more NAN devices form a cluster. When a cluster enters the DW, the cluster is in the master (master node), anchor master (AM, anchor master node), and non-master. NAN device sending status such as sync (non-master synchronization, master node responsible for synchronization)
A sync beacon message, the message carrying the information of the AM in the cluster, and the NAN device receiving the message is synchronized with the AM in the cluster.
NAN设备完成服务发现的流程如下:The process for NAN equipment to complete service discovery is as follows:
1、一个设备激活NAN功能后(即成为NAN设备后),可以将自身设置为AM,创建一个Cluster,并基于自身的MAC(Media Access Control,介质访问控制)地址设定该Cluster的Cluster ID(Identity,身份标识)值,将TSF设置为512TU的整数倍。1. After a device activates the NAN function (that is, after becoming a NAN device), it can set itself to AM, create a cluster, and set the cluster's Cluster ID based on its MAC (Media Access Control) address. Identity, identity value, set the TSF to an integer multiple of 512TU.
2、一旦该NAN设备接收到来自一个或多个其他Cluster的NAN设备发送的Beacon帧(即sync beacon,以下统一称为Beacon帧)时,就可以判断自己是否要加入对方的Cluster。2. Once the NAN device receives a Beacon frame (that is, a sync beacon, which is collectively referred to as a Beacon frame) sent from a NAN device of one or more other clusters, it can determine whether it wants to join the other party's Cluster.
在Beacon帧中,一般携带有相应的Cluster的信息,具体可以是相应的Cluster中的AM的信息,例如可以包括AMR(anchor master rank,锚主节点等级)、MR(master rank,主节点等级)、MP(Master Preference,主节点优先权)、AMP(anchor Master Preference,锚主节点优先权)、RF(random factor,随机因素)、AMBTT(Anchor Master Beacon Transmission Time,锚主节点信号传输时间)、TSF(time synchronization function,时间同步功能)、Cluster ID、以及CG(Cluster grade,簇等级)中的一种或多种。In the Beacon frame, the information about the corresponding cluster is generally carried, which may be the information of the AM in the corresponding cluster. For example, the AMR (anchor master rank) and the MR (master rank) may be included. , MP (Master Preference), AMP (anchor Master Preference), RF (random factor, random factor), AMBTT (Anchor Master Beacon Transmission Time), One or more of TSF (time synchronization function), Cluster ID, and CG (Cluster grade).
一个NAN设备可以通过发送Beacon帧将自己所属的Cluster的AM的信息发送给其他的NAN设备,同样,一个NAN设备也可以接收本Cluster或其他Cluster中的NAN设备发送的Beacon帧。A NAN device can send the information of the AM of the cluster to which it belongs to other NAN devices by sending a Beacon frame. Similarly, a NAN device can also receive the Beacon frame sent by the NAN device in the cluster or other clusters.
在NAN设备接收到一个Beacon帧后,可以判断该Beacon帧是来自自身所属的Cluster中的NAN设备还是来自其他Cluster中的NAN设备,若是来自其他Cluster中的NAN设备,则该NAN设备可以判断接收的Beacon帧中的CG的值是否大于自身的CG的值,若大于,则该NAN设备加入该接收的Beacon帧对应的Cluster,否则,该NAN设备不做处理。这就完成了NAN设备的聚合,即,NAN设备会加入CG的值较高的Cluster。After receiving a Beacon frame, the NAN device can determine whether the Beacon frame is from a NAN device in the cluster to which it belongs or from a NAN device in another cluster. If the NAN device is from another Cluster, the NAN device can determine to receive the packet. If the value of the CG in the Beacon frame is greater than the value of the CG, if the value is greater than, the NAN device joins the cluster corresponding to the received Beacon frame. Otherwise, the NAN device does not process. This completes the aggregation of the NAN device, that is, the NAN device will join the Cluster with a higher CG value.
3、若判断确定要加入对方的Cluster,则,在加入对方的Cluster之后与
加入的Cluster中的AM实现同步,具体可以是将自身的AM中的各项参数信息与加入的Cluster中的AM同步,例如将自身原有的TSF更新为加入的Cluster中的AM的TSF等。3. If it is determined that you want to join the other party's Cluster, then after joining the other party's Cluster,
The AM in the added cluster is synchronized, and the parameter information in the AM is synchronized with the AM in the added cluster, for example, the original TSF is updated to the TSF of the AM in the added cluster.
4、在同步后,当加入的Cluster的DW到来时,该NAN设备在DW中发送SDF(Service Discovery Frames,服务发现帧)消息以进行服务发现,该SDF消息中例如可以携带有用于查询所需的服务的服务查询(Service Subscription)信息,或例如可以携带有用于发布该NAN设备所能够提供的服务的服务发布(Service Publish)信息,其他NAN设备在接收到该NAN设备发送的SDF消息后,若确定满足该SDF消息,即能够进行服务匹配,则可以在DW中向该NAN设备回复SDF消息。After the synchronization, when the DW of the added Cluster arrives, the NAN device sends an SDF (Service Discovery Frames) message in the DW to perform service discovery. The SDF message may be carried, for example, for query. Service Query information of the service, or for example, may carry Service Publish information for publishing the service that the NAN device can provide. After receiving the SDF message sent by the NAN device, the other NAN device receives the SDF message. If it is determined that the SDF message is satisfied, that is, the service matching can be performed, the SDF message can be replied to the NAN device in the DW.
同样的,在DW中,该NAN设备也可能会接收到其他NAN设备发送的用于进行服务发现的SDF消息,若该NAN设备确定满足所接收的SDF消息,则该NAN设备也会在DW中向相应的NAN设备回复SDF消息。Similarly, in the DW, the NAN device may also receive an SDF message sent by another NAN device for service discovery. If the NAN device determines that the received SDF message is satisfied, the NAN device is also in the DW. Reply to the corresponding NAN device with an SDF message.
以下对AM中包含的各类信息进行解释。The following explains the various types of information contained in the AM.
AMR,一般最大取值为8个字节(byte),是AM的MR的值。AMR, which generally has a maximum value of 8 bytes, is the value of MR of AM.
MR,一般最大取值为8个字节,是根据MP值、RF值以及本NAN设备的MAC地址计算得出,表示该NAN设备想当master的意愿。MR的值越大,表明该NAN设备想当master意愿越高。MR也可以看做是MP的另外表达形式。The maximum value of the MR is 8 bytes, which is calculated based on the MP value, the RF value, and the MAC address of the NAN device, indicating the willingness of the NAN device to be the master. The larger the value of MR, the higher the willingness of the NAN device to be master. MR can also be seen as an additional form of expression for MP.
MP,一般最大取值为1个字节,表明本NAN设备想当master的意愿。MP的值越大,表明该NAN设备想当master意愿越高。MP, generally the maximum value is 1 byte, indicating the willingness of the NAN device to be the master. The larger the value of MP, the higher the willingness of the NAN device to be master.
AMP,一般最大取值为1个字节,是AM的MP的值。AMP, generally the maximum value is 1 byte, which is the value of AM's MP.
RF,一般最大取值为1个字节,是NAN设备选择的随机数。The RF value is generally 1 byte and is a random number selected by the NAN device.
AMBTT,一般最大取值为4个字节,表明AM的Beacon帧的发送时间。一般来说,发送Beacon帧的NAN设备会携带有AMBTT,用于其他NAN设备与该AMBTT对应的AM的时间实现同步。AMBTT, which is generally 4 bytes in length, indicates the transmission time of the Beacon frame of the AM. Generally, the NAN device that sends the Beacon frame carries the AMBTT, and is used for synchronization between other NAN devices and the AM corresponding to the AMBTT.
TSF,一般最大取值为8个字节,表明NAN设备的同步功能,使得接收
到该TSF的NAN设备的计时器(timer)与发送该TSF的NAN设备对应的AM的时间实现同步。TSF也可以表示时间信息。TSF, generally with a maximum value of 8 bytes, indicates that the synchronization function of the NAN device enables reception.
The timer of the NAN device to the TSF is synchronized with the time of the AM corresponding to the NAN device transmitting the TSF. The TSF can also represent time information.
Cluster ID,一般最大取值为6个字节,将其携带在Beacon帧中的Address(地址)3的字段中。The cluster ID, which is a maximum of 6 bytes, is carried in the field of Address 3 in the Beacon frame.
CG,一般最大取值为8个字节,表示Cluster的等级,用于不同的Cluster在合并时进行比较,CG的值小的Cluster合并到CG的值大的Cluster中。CG, generally the maximum value is 8 bytes, indicating the level of the Cluster, used for comparison of different Clusters at the time of merging, and the Cluster with a small CG value is merged into the Cluster with a large CG value.
以下介绍SDF消息。The following describes the SDF message.
SDF消息是一种专门定义用来做服务发现的动作帧(Action Frame),根据功能不同,SDF消息大致可以分为三种:SDF Publish(SDF发布)消息、SDF Subscribe(SDF订阅)消息、SDF Follow-Up(SDF回复)消息,一般来说,在SDF消息中包括一个指示位,用于指示该SDF消息是哪种SDF消息。An SDF message is an action frame specifically defined for service discovery. Depending on the function, SDF messages can be roughly classified into three types: SDF Publish (SDF Publishing) message, SDF Subscribe (SDF subscription) message, SDF. A Follow-Up message, in general, includes an indication bit in the SDF message indicating which SDF message the SDF message is.
SDF Publish消息:用于发布NAN设备所能提供的服务,或用于回复收到的其他NAN设备发送的SDF Subscribe消息;SDF Publish message: used to publish the services that the NAN device can provide, or to reply to the received SDF Subscribe message sent by other NAN devices;
SDF Subscribe消息:用于查找需要使用的服务;SDF Subscribe message: used to find the service that needs to be used;
SDF Follow-Up消息:用于回复收到的SDF Publish消息,或者用于协商更多的信息。SDF Follow-Up message: Used to reply to the received SDF Publish message or to negotiate more information.
本发明实施例可以基于现有的FTM(Fine Timing Measurement,精确时间测量)测距原理,实现NAN设备之间的测距,下面介绍本发明实施例应用了FTM测距原理的具体例子。The embodiments of the present invention can implement ranging between NAN devices based on the existing FTM (Fine Timing Measurement) ranging principle. The specific example of applying the FTM ranging principle in the embodiment of the present invention is described below.
1、首先,由发起测距的NAN设备(例如以下将其称为NAN设备1)向该NAN设备1待测距的NAN设备(例如以下将其称为NAN设备2)发送FTM Request(FTM请求),用于请求一个周期性的时间窗口,NAN设备2在接收到FTM Request后,可根据自己的资源情况和能力等来回复消息,表明接受或重置一个时间窗口。其中,FTM Request是一种Action Frame。1. First, a NAN device that initiates ranging (for example, hereinafter referred to as NAN device 1) sends an FTM Request (FTM Request) to the NAN device to which the NAN device 1 is to be measured (for example, hereinafter referred to as NAN device 2). ), for requesting a periodic time window, after receiving the FTM Request, the NAN device 2 can reply to the message according to its own resource situation and capability, etc., indicating that a time window is accepted or reset. Among them, FTM Request is an Action Frame.
2、NAN设备2如果接受了预置时间窗,那么NAN设备2和NAN设备1就都开始进行时间捕获。其中,NAN设备2捕获该NAN设备2向NAN设备1回复针
对FTM Request的回复消息的时刻为t1,NAN设备1捕获接收到NAN设备2针对FTM Request的回复消息的时刻为t2。2. If the NAN device 2 accepts the preset time window, both the NAN device 2 and the NAN device 1 start time capture. Wherein, the NAN device 2 captures the NAN device 2 and returns a pin to the NAN device 1.
The time of the reply message to the FTM Request is t1, and the time at which the NAN device 1 captures the reply message of the NAN device 2 for the FTM Request is t2.
3、NAN设备1向NAN设备2回复针对该回复消息的ACK(Acknowledgement,确认应答),并捕获发送该ACK的时刻为t3,NAN设备2捕获接收该ACK的时刻为t4。3. The NAN device 1 replies to the NAN device 2 with an ACK (Acknowledgement) for the reply message, and captures that the time at which the ACK is transmitted is t3, and the time at which the NAN device 2 captures the ACK is t4.
4、若NAN设备1要完成测距,则NAN设备2向NAN设备1发送测距消息,该测距消息中携带有t1和t4。4. If the NAN device 1 is to complete the ranging, the NAN device 2 sends a ranging message to the NAN device 1, and the ranging message carries t1 and t4.
这样NAN设备1就获得了时间t1、t2、t3、t4四个时间,从而可计算出消息来回的时间RTT(Round-Trip Time,往返时延)为:In this way, the NAN device 1 obtains four times of time t1, t2, t3, and t4, so that the time RTT (Round-Trip Time) of the message can be calculated as:
RTT=[(t4–t1)–(t3–t2)] (1)RTT=[(t4–t1)–(t3–t2)] (1)
然后可以计算出NAN设备1与NAN设备2之间的距离d为:It can then be calculated that the distance d between the NAN device 1 and the NAN device 2 is:
d=1/2*RTT*c (2)d=1/2*RTT*c (2)
其中c为光速,也可以等于Wi-Fi信号的传输速度。Where c is the speed of light, which can also be equal to the transmission speed of the Wi-Fi signal.
为使本发明实施例的目的、技术方案和优点更加清楚,下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。The technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the drawings in the embodiments of the present invention. It is a partial embodiment of the invention, and not all of the embodiments. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative efforts are within the scope of the present invention.
另外,本文中术语“系统”和“网络”在本文中常被可互换使用。本文中术语“和/或”,仅仅是一种描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。另外,本文中字符“/”,如无特殊说明,一般表示前后关联对象是一种“或”的关系。Additionally, the terms "system" and "network" are used interchangeably herein. The term "and/or" in this context is merely an association describing the associated object, indicating that there may be three relationships, for example, A and / or B, which may indicate that A exists separately, and both A and B exist, respectively. B these three situations. In addition, the character "/" in this article, unless otherwise specified, generally indicates that the contextual object is an "or" relationship.
本发明实施例主要以NAN设备为例进行描述,但本发明实施例的技术方案也可以应用于其他类似的网络机制中的无线设备。The embodiment of the present invention is mainly described by taking a NAN device as an example, but the technical solution of the embodiment of the present invention can also be applied to other wireless devices in a similar network mechanism.
下面结合说明书附图对本发明实施例作进一步详细描述。
The embodiments of the present invention are further described in detail below with reference to the accompanying drawings.
请参见图1,本发明实施例提供第一种NAN设备之间的距离测量方法,所述方法的主要流程描述如下。Referring to FIG. 1, an embodiment of the present invention provides a method for measuring distance between first NAN devices, and a main process of the method is described as follows.
步骤101:第一NAN设备在DW中发送第一消息,所述第一消息中携带有用于触发所述第二NAN设备进行测距的测距触发信息,以及第一时间窗口的信息;所述发现窗口为NAN中用于进行服务发现的时间窗口,所述第一消息为用于进行服务发现的消息,所述第一时间窗口为用于进行测距的时间窗口。Step 101: The first NAN device sends a first message in the DW, where the first message carries ranging trigger information for triggering the second NAN device to perform ranging, and information of the first time window; The discovery window is a time window for performing service discovery in the NAN, and the first message is a message for performing service discovery, and the first time window is a time window for performing ranging.
本发明实施例中,将发起测距的NAN设备称为第一NAN设备,将接受测距的NAN设备称为第二NAN设备。In the embodiment of the present invention, the NAN device that initiates ranging is referred to as a first NAN device, and the NAN device that receives ranging is referred to as a second NAN device.
本发明实施例中,第一时间窗口例如是服务窗口(Service Window,SW),在本发明实施例中,第一时间窗口就是用于进行测距的时间窗口,即用于进行测距的服务窗口。In the embodiment of the present invention, the first time window is, for example, a service window (Service Window, SW). In the embodiment of the present invention, the first time window is a time window for performing ranging, that is, a service for performing ranging. window.
本发明实施例中,第一时间窗口可以与DW相邻,即DW的终点就是第一时间窗口的起点,也就是说DW和第一时间窗口之间的间隔时长等于0。例如DW为DW,第一时间窗口可以为DW结束后相邻的时间段,或例如,DW为DW中的第一部分时间段,第一时间窗口为DW中的第二部分时间段,且DW的终点是第一时间窗口的起点,即第一时间窗口是DW中第一部分时间段结束后的全部剩余时间段;或者,第一时间窗口与DW之间可以有间隔时长,该间隔时长大于0,例如DW为DW,第一时间窗口可以为DW结束后相隔一段时间之后的时间段,或例如,DW为DW中的第一部分时间段,第一时间窗口为DW中的第二部分时间段,且DW和第一时间窗口之间的间隔时长大于0,即第一时间窗口是DW中第一部分时间段结束后的部分剩余时间段。In the embodiment of the present invention, the first time window may be adjacent to the DW, that is, the end point of the DW is the start point of the first time window, that is, the interval length between the DW and the first time window is equal to zero. For example, DW is DW, the first time window may be an adjacent time period after the end of DW, or for example, DW is the first part time period in DW, the first time window is the second part time period in DW, and DW The end point is the starting point of the first time window, that is, the first time window is all the remaining time periods after the end of the first part of the time period in the DW; or, the interval between the first time window and the DW may be longer, and the interval duration is greater than 0. For example, DW is DW, the first time window may be a time period after a period of time after the end of DW, or for example, DW is a first part time period in DW, and the first time window is a second part time period in DW, and The interval between the DW and the first time window is greater than 0, that is, the first time window is a portion of the remaining time period after the end of the first portion of the time period in the DW.
可选的,本发明实施例中,第一消息可以为用于进行服务发现的消息,该消息中可以携带有第一NAN设备订阅或发布的服务信息。Optionally, in the embodiment of the present invention, the first message may be a message for performing service discovery, where the message may carry service information subscribed or published by the first NAN device.
可选的,本发明实施例中,测距本身也可以是一种服务,那么该服务信息所对应的服务也可以是测距,即该服务信息是用于表明第一NAN设备需要订阅测距服务或第一NAN设备需要发布测距服务的信息。Optionally, in the embodiment of the present invention, the ranging itself may also be a service, and the service corresponding to the service information may also be ranging, that is, the service information is used to indicate that the first NAN device needs to be subscribed to the ranging. The service or the first NAN device needs to publish information about the ranging service.
具体的,本发明实施例中,第一消息可以是SDF消息。
Specifically, in the embodiment of the present invention, the first message may be an SDF message.
即,在DW中,第一NAN设备发送第一消息,在第一消息中携带的服务信息例如可以是用于订阅(又称查询)第一NAN设备所需的服务的服务订阅信息,或者也可以是用于发布第一NAN设备能够提供的服务的服务发布信息,等等。That is, in the DW, the first NAN device sends the first message, and the service information carried in the first message may be, for example, service subscription information for subscribing (also referred to as querying) the service required by the first NAN device, or It may be service release information for publishing a service that the first NAN device can provide, and the like.
其中,服务信息为能够表示第一NAN设备订阅或发布的服务的信息,可以为一个服务名称,或是服务名称的转化值,例如,对服务名称进行哈希运算后得到的值,如对服务名称进行SHA(Secure Hash Algorithm,安全散列算法)-256运算并取前48bit的值做为服务信息;或是对服务名称进行位图(bitmap)映射的值,例如,对服务名称进行Bloom Filter(一种二进制向量数据结构)转化,利用位图对该服务名称进行指示等。服务信息所对应的服务可以为第一NAN设备本身需要订阅或发布的服务,也可以为第一NAN设备代理其他NAN设备需要订阅或发布的服务,本发明并不以此为限。The service information is information that can represent a service subscribed or published by the first NAN device, and may be a service name or a conversion value of the service name, for example, a value obtained by hashing the service name, such as a service. The name is SHA (Secure Hash Algorithm)-256 operation and takes the value of the first 48 bits as the service information; or the value of the bitmap mapping of the service name, for example, the Bloom Filter for the service name. (a binary vector data structure) transformation, using a bitmap to indicate the service name, and so on. The service corresponding to the service information may be a service that the first NAN device itself needs to subscribe to or publish, or a service that the other NAN device needs to subscribe to or publish for the first NAN device, and the present invention is not limited thereto.
例如,若该第一消息是SDF Publish消息,则在该第一消息中携带的服务信息为用于发布第一NAN设备所能提供的服务的服务信息,若该第一消息是SDF Subscribe消息,则在该第一消息中携带的服务信息为用于订阅第一NAN设备需要使用的服务的服务信息。For example, if the first message is an SDF Publish message, the service information carried in the first message is service information for publishing a service that the first NAN device can provide, and if the first message is an SDF Subscribe message, The service information carried in the first message is service information for subscribing to a service that the first NAN device needs to use.
本发明实施例中,将测距触发信息携带在第一消息中一并发送,从而在DW中就可以进行测距触发,而无需等到DW结束之后在其他的时间窗口中才能进行测距触发,节省了测距所需的时间,也减少了信息交互量。In the embodiment of the present invention, the ranging trigger information is carried in the first message and sent, so that the ranging trigger can be performed in the DW, and the ranging triggering can be performed in other time windows without waiting for the DW to end. It saves the time required for ranging and reduces the amount of information interaction.
另外,第一消息中还可以携带有第一时间窗口的信息。In addition, the first message may also carry information of the first time window.
第一时间窗口的信息,可以包括第一时间窗口的起始时刻以及第一时间窗口的持续时长,或者可以包括第一时间窗口的起始时刻以及终止时刻,或者,所述第一时间窗口信息为用于表示第一时间窗口的位图信息,等等,只要第一时间窗口的信息能够清楚表明第一时间窗口即可,本发明实施例对于第一时间窗口的信息具体是什么信息不作限制。The information of the first time window may include a start time of the first time window and a duration of the first time window, or may include a start time and a stop time of the first time window, or the first time window information The information of the first time window is not limited. .
其中,第一NAN设备发送第一消息,可以以广播、组播或单播等不同的形式发送,第二NAN设备接收到第一消息后,可以对第一消息进行解析,并
获得其中携带的测距触发信息、以及进一步还可以获得其中携带的服务信息等。The first NAN device sends the first message, and may send the first message in different forms, such as broadcast, multicast, or unicast. After receiving the first message, the second NAN device may parse the first message, and
The ranging trigger information carried therein is obtained, and the service information carried therein and the like are further obtained.
可选的,本发明实施例中,测距触发信息中可以包括测距原理指示信息、测距协议指示信息、测距要求指示信息、测距需求指示信息以及测距开启指示信息中的一种或任意几种;其中,Optionally, in the embodiment of the present invention, the ranging trigger information may include one of ranging principle indication information, ranging protocol indication information, ranging requirement indication information, ranging requirement indication information, and ranging opening indication information. Or any of them; among them,
测距原理指示信息用于指示进行距离测量所依据的测量原理;The ranging principle indication information is used to indicate the measurement principle on which the distance measurement is performed;
测距协议指示信息用于指示进行距离测量所依据的测量协议;The ranging protocol indication information is used to indicate a measurement protocol on which the distance measurement is performed;
测距要求指示信息用于指示对所测量的距离所需要满足的参数的需求;The ranging request indication information is used to indicate a requirement for a parameter that needs to be satisfied for the measured distance;
测距需求指示信息用于指示对满足所述服务信息的NAN设备的距离的需求;The ranging demand indication information is used to indicate a demand for a distance of the NAN device that satisfies the service information;
测距开启指示信息用于指示所述第二NAN设备开启测距功能。The ranging open indication information is used to instruct the second NAN device to enable the ranging function.
具体的,测距原理指示信息或测距协议指示信息可用于指示,是基于FTM原理的测距方案进行测距或是基于三角测距原理的测距方案进行测距,进一步地,测距触发信息中可以包含多个支持的测距方案,第二NAN设备接收后可根据自己的支持情况从中进行选择,或者与第一NAN设备进行进一步地协商,以确定最终的测距方案。Specifically, the ranging principle indication information or the ranging protocol indication information may be used to indicate that the ranging method is based on the FTM principle, or the ranging scheme based on the triangulation principle is used for ranging, and further, the ranging triggering The information may include multiple supported ranging schemes, and the second NAN device may select from the support according to its own support situation or further negotiate with the first NAN device to determine the final ranging scheme.
具体的,测距要求指示信息可以包括第一NAN设备对测距精度、测距范围等的要求。Specifically, the ranging requirement indication information may include requirements of the first NAN device for ranging accuracy, ranging range, and the like.
具体的,测距需求指示信息可以包括第一NAN设备对满足其订阅或查找的服务的NAN设备的距离需求。Specifically, the ranging requirement indication information may include a distance requirement of the first NAN device to the NAN device that satisfies the service of the subscription or the search.
具体的,测距开启指示信息可以包括指示第二NAN设备开启测距功能的信息。Specifically, the ranging open indication information may include information indicating that the second NAN device turns on the ranging function.
例如,在一种可能的实现中,第一NAN设备与第二NAN设备缺省支持某种测距方案,例如第一NAN设备与第二NAN设备都缺省支持基于FTM原理的测距方案,则测距触发信息中可以只包括测距开启指示信息。For example, in a possible implementation, the first NAN device and the second NAN device support a certain ranging solution by default. For example, the first NAN device and the second NAN device respectively support the FTM principle-based ranging solution. The ranging trigger information may include only the ranging opening indication information.
本发明实施例中,第一NAN设备可以在第一信道中向第二NAN设备发送第一消息。
In this embodiment of the present invention, the first NAN device may send the first message to the second NAN device in the first channel.
步骤102:所述第一NAN设备接收所述第二NAN设备发送的第二消息,获得接收所述第二消息的第一时刻,并根据所述第二消息确定所述第二NAN设备的测距能力,所述第二消息为针对所述第一消息的响应消息。Step 102: The first NAN device receives the second message sent by the second NAN device, obtains a first time to receive the second message, and determines, according to the second message, the measurement of the second NAN device. From the capability, the second message is a response message for the first message.
可选的,本发明实施例中,第二消息为针对第一消息的响应消息,例如,第二消息可以为SDF消息,具体可以为SDF Publish消息或SDF Follow-up消息。例如,当第一消息为SDF Subscribe消息时,第二消息可以为响应该消息的SDF Publish消息;当第一消息为SDF Publish消息时,第二消息可以为响应该消息的SDF Follow-Up消息。Optionally, in the embodiment of the present invention, the second message is a response message for the first message, for example, the second message may be an SDF message, and may be an SDF Publish message or an SDF Follow-up message. For example, when the first message is an SDF Subscribe message, the second message may be an SDF Publish message in response to the message; when the first message is an SDF Publish message, the second message may be an SDF Follow-Up message in response to the message.
第二NAN设备在接收到第一消息后,可以根据第一消息中的测距触发信息判断自身是否拥有相应的测距能力,并根据判断结果向第一NAN设备发送针对该第一消息的第二消息。After receiving the first message, the second NAN device may determine, according to the ranging trigger information in the first message, whether it has the corresponding ranging capability, and send the first message to the first NAN device according to the determination result. Two messages.
本发明实施例中,第二NAN设备要拥有第一NAN设备所指示的相应的测距能力,可以有几种不同的情况:In the embodiment of the present invention, the second NAN device has the corresponding ranging capability indicated by the first NAN device, and may have several different situations:
一、第二NAN设备需要满足第一消息中携带的服务信息,并且第二NAN设备要能够支持测距。1. The second NAN device needs to satisfy the service information carried in the first message, and the second NAN device is to be able to support ranging.
例如,服务信息为用于订阅第一NAN设备所需要的服务的信息,则第二NAN设备需要能够提供该服务,或例如,服务信息为用于发布第一NAN设备所能够提供的服务的信息,则第二NAN设备需要接受该服务。For example, the service information is information for subscribing to a service required by the first NAN device, and the second NAN device needs to be able to provide the service, or for example, the service information is information for publishing a service that the first NAN device can provide. The second NAN device needs to accept the service.
以及,第二NAN设备需要支持第一NAN设备所指示的测距。And, the second NAN device needs to support the ranging indicated by the first NAN device.
例如,当测距触发信息中包括测距原理指示信息时,第二NAN设备判断自身是否支持该测距原理指示信息所指示的测距原理,若支持,则表明第二NAN设备拥有第一NAN设备所指示的测距能力;For example, when the ranging trigger information includes the ranging principle indication information, the second NAN device determines whether it supports the ranging principle indicated by the ranging principle indication information, and if so, indicates that the second NAN device owns the first NAN. The ranging capability indicated by the device;
或例如,当测距触发信息中包括测距协议指示信息时,第二NAN设备判断自身是否支持该测距协议指示信息所指示的测距协议,若支持,则表明第二NAN设备拥有第一NAN设备所指示的测距能力;
Or, for example, when the ranging trigger information includes the ranging protocol indication information, the second NAN device determines whether it supports the ranging protocol indicated by the ranging protocol indication information, and if so, indicates that the second NAN device has the first Ranging capability indicated by the NAN device;
或例如,当测距触发信息中包括测距要求指示信息时,第二NAN设备判断自身是否能够满足该测距要求指示信息所指示的测距精度、测距范围等,若能够满足,则表明第二NAN设备拥有第一NAN设备所指示的测距能力;Or, for example, when the ranging trigger information includes the ranging request indication information, the second NAN device determines whether it can satisfy the ranging accuracy, the ranging range, and the like indicated by the ranging request indication information, and if yes, indicates The second NAN device has a ranging capability indicated by the first NAN device;
或例如,当测距触发信息中包括测距需求指示信息时,第二NAN设备判断自身是否能够满足该测距需求指示信息所指示的距离需求,若能够满足,则表明第二NAN设备拥有第一NAN设备所指示的测距能力;Or, for example, when the ranging trigger information includes the ranging demand indication information, the second NAN device determines whether it can satisfy the distance requirement indicated by the ranging demand indication information, and if yes, indicates that the second NAN device has the first The ranging capability indicated by a NAN device;
或例如,当测距触发信息中包括测距开启指示信息时,第二NAN设备判断自身当前是否能够开启测距功能,若能,则表明第二NAN设备拥有第一NAN设备所指示的测距能力。Or, for example, when the ranging triggering information includes the ranging opening indication information, the second NAN device determines whether it is currently capable of turning on the ranging function, and if so, indicating that the second NAN device has the ranging indicated by the first NAN device. ability.
或例如,测距触发信息中包括测距需求信息和测距原理指示信息。第二NAN设备通过测距需求指示信息得知第一NAN设备的服务需要第二NAN设备与第一NAN设备的距离达到某个阈值才可建立服务连接,进一步地,第二NAN设备通过测距原理指示信息得知第一NAN设备所支持的测距技术,当第二NAN设备支持该测距技术时,第二NAN设备确定支持测距。Or for example, the ranging trigger information includes ranging requirement information and ranging principle indication information. The second NAN device learns that the service of the first NAN device needs the distance between the second NAN device and the first NAN device to reach a certain threshold by using the ranging requirement indication information, and further, the second NAN device passes the ranging. The principle indication information is related to the ranging technology supported by the first NAN device. When the second NAN device supports the ranging technology, the second NAN device determines to support the ranging.
或例如,测距触发信息中包括测距开启指示信息,且第一NAN设备与第二NAN设备缺省支持某种测距技术,则第二NAN设备确定支持测距。Or, for example, the ranging trigger information includes the ranging open indication information, and the first NAN device and the second NAN device support some ranging technology by default, and the second NAN device determines to support the ranging.
或例如,测距触发信息中包括测距要求信息和测距协议指示信息。第二NAN设备通过测距要求指示信息得知所述第一NAN设备的服务需要第二NAN设备与第一NAN设备的距离需要满足一定参数才可建立服务连接,进一步地,第二NAN设备通过测距协议指示信息得知第一NAN设备所支持的测距协议,当第二NAN设备支持该测距协议时,第二NAN设备确定支持测距。Or for example, the ranging trigger information includes ranging request information and ranging protocol indication information. The second NAN device learns that the service of the first NAN device needs the distance between the second NAN device and the first NAN device to meet a certain parameter to establish a service connection, and further, the second NAN device passes the distance determination request indication information. The ranging protocol indication information is related to the ranging protocol supported by the first NAN device. When the second NAN device supports the ranging protocol, the second NAN device determines to support the ranging.
即,在这种情况下,第二NAN设备需要能够满足第一消息中携带的服务信息,且第二NAN设备能够支持第一NAN设备所需的测距,在这两个条件均满足的前提下,第二NAN设备向第一NAN设备发送的第二消息才能表明第二NAN设备支持测距,否则第二NAN设备向第一NAN设备回复的第二信息会表明第二NAN设备不支持测距。
That is, in this case, the second NAN device needs to be able to satisfy the service information carried in the first message, and the second NAN device can support the ranging required by the first NAN device, and both of the conditions are satisfied. The second message sent by the second NAN device to the first NAN device indicates that the second NAN device supports the ranging. Otherwise, the second information that the second NAN device replies to the first NAN device indicates that the second NAN device does not support the measurement. distance.
在一种可能的情况下,第一NAN设备订阅或发布的服务即为测距,即此时,测距为服务信息所对应的服务,则此时,第二NAN设备判断自身是否能够满足该服务信息所对应的服务,实质就是判断自身是否支持第一NAN设备所需的测距。In a possible case, the service subscribed or issued by the first NAN device is the ranging, that is, the ranging is the service corresponding to the service information, and at this time, the second NAN device determines whether it can satisfy the The service corresponding to the service information is essentially the determination of whether or not the support for the first NAN device is required.
二、第二NAN设备能够支持测距即可。Second, the second NAN device can support ranging.
例如,当测距触发信息中包括测距原理指示信息时,第二NAN设备判断自身是否支持该测距原理指示信息所指示的测距原理,若支持,则表明第二NAN设备拥有第一NAN设备所指示的测距能力;For example, when the ranging trigger information includes the ranging principle indication information, the second NAN device determines whether it supports the ranging principle indicated by the ranging principle indication information, and if so, indicates that the second NAN device owns the first NAN. The ranging capability indicated by the device;
或例如,当测距触发信息中包括测距协议指示信息时,第二NAN设备判断自身是否支持该测距协议指示信息所指示的测距协议,若支持,则表明第二NAN设备拥有第一NAN设备所指示的测距能力;Or, for example, when the ranging trigger information includes the ranging protocol indication information, the second NAN device determines whether it supports the ranging protocol indicated by the ranging protocol indication information, and if so, indicates that the second NAN device has the first Ranging capability indicated by the NAN device;
或例如,当测距触发信息中包括测距要求指示信息时,第二NAN设备判断自身是否能够满足该测距要求指示信息所指示的测距精度、测距范围等,若能够满足,则表明第二NAN设备拥有第一NAN设备所指示的测距能力;Or, for example, when the ranging trigger information includes the ranging request indication information, the second NAN device determines whether it can satisfy the ranging accuracy, the ranging range, and the like indicated by the ranging request indication information, and if yes, indicates The second NAN device has a ranging capability indicated by the first NAN device;
或例如,当测距触发信息中包括测距需求指示信息时,第二NAN设备判断自身是否能够满足该测距需求指示信息所指示的距离需求,若能够满足,则表明第二NAN设备拥有第一NAN设备所指示的测距能力;Or, for example, when the ranging trigger information includes the ranging demand indication information, the second NAN device determines whether it can satisfy the distance requirement indicated by the ranging demand indication information, and if yes, indicates that the second NAN device has the first The ranging capability indicated by a NAN device;
或例如,当测距触发信息中包括测距开启指示信息时,第二NAN设备判断自身当前是否能够开启测距功能,若能,则表明第二NAN设备拥有第一NAN设备所指示的测距能力。Or, for example, when the ranging triggering information includes the ranging opening indication information, the second NAN device determines whether it is currently capable of turning on the ranging function, and if so, indicating that the second NAN device has the ranging indicated by the first NAN device. ability.
或例如,测距触发信息中包括测距需求信息和测距原理指示信息。第二NAN设备通过测距需求指示信息得知第一NAN设备的服务需要第二NAN设备与第一NAN设备的距离达到某个阈值才可建立服务连接,进一步地,第二NAN设备通过测距原理指示信息得知第一NAN设备所支持的测距技术,当第二NAN设备支持该测距技术时,第二NAN设备确定支持测距。Or for example, the ranging trigger information includes ranging requirement information and ranging principle indication information. The second NAN device learns that the service of the first NAN device needs the distance between the second NAN device and the first NAN device to reach a certain threshold by using the ranging requirement indication information, and further, the second NAN device passes the ranging. The principle indication information is related to the ranging technology supported by the first NAN device. When the second NAN device supports the ranging technology, the second NAN device determines to support the ranging.
或例如,测距触发信息中包括测距开启指示信息,且第一NAN设备与第二NAN设备缺省支持某种测距技术,则第二NAN设备确定支持测距。
Or, for example, the ranging trigger information includes the ranging open indication information, and the first NAN device and the second NAN device support some ranging technology by default, and the second NAN device determines to support the ranging.
或例如,测距触发信息中包括测距要求信息和测距协议指示信息。第二NAN设备通过测距要求指示信息得知所述第一NAN设备的服务需要第二NAN设备与第一NAN设备的距离需要满足一定参数才可建立服务连接,进一步地,第二NAN设备通过测距协议指示信息得知第一NAN设备所支持的测距协议,当第二NAN设备支持该测距协议时,第二NAN设备确定支持测距。Or for example, the ranging trigger information includes ranging request information and ranging protocol indication information. The second NAN device learns that the service of the first NAN device needs the distance between the second NAN device and the first NAN device to meet a certain parameter to establish a service connection, and further, the second NAN device passes the distance determination request indication information. The ranging protocol indication information is related to the ranging protocol supported by the first NAN device. When the second NAN device supports the ranging protocol, the second NAN device determines to support the ranging.
即,在这种情况下,第二NAN设备无论是否能够满足第一消息中携带的服务信息都无所谓,只要第二NAN设备能够支持第一NAN设备所需的测距,则第二NAN设备向第一NAN设备回复的第二信息会表明第二NAN设备支持测距。That is, in this case, the second NAN device does not matter whether the service information carried in the first message can be satisfied, as long as the second NAN device can support the ranging required by the first NAN device, the second NAN device The second information replied by the first NAN device may indicate that the second NAN device supports ranging.
可选的,本发明实施例中,第一NAN设备接收第二NAN设备发送的第二消息,包括:Optionally, in the embodiment of the present invention, the first NAN device receives the second message sent by the second NAN device, including:
第一NAN设备在DW或第一时间窗口中接收第二消息。The first NAN device receives the second message in the DW or the first time window.
即,第二NAN设备可以继续在DW中向第一NAN设备发送第二消息,或者第二NAN设备也可以在第一时间窗口中向第一NAN设备发送第二消息。That is, the second NAN device may continue to send the second message to the first NAN device in the DW, or the second NAN device may also send the second message to the first NAN device in the first time window.
当然,第二消息还可以用于指示第二NAN设备是否满足第一消息中的服务信息。Of course, the second message may also be used to indicate whether the second NAN device satisfies the service information in the first message.
例如,第二消息可以为SDF消息,具体可以为SDF Publish消息或SDF Follow-up消息。例如,当第一消息为SDF Subscribe消息时,第二消息可以为响应该消息的SDF Publish消息;当第一消息为SDF Publish消息时,第二消息可以为响应该消息的SDF Follow-Up消息。For example, the second message may be an SDF message, and may be an SDF Publish message or an SDF Follow-up message. For example, when the first message is an SDF Subscribe message, the second message may be an SDF Publish message in response to the message; when the first message is an SDF Publish message, the second message may be an SDF Follow-Up message in response to the message.
第二消息由第二NAN设备于DW内在第一信道上进行发送,第一NAN设备在到接收第二消息后,可以确定第二NAN设备是否满足第一NAN设备所订阅或发布的服务,以及可以确定第二NAN设备的测距能力。The second message is sent by the second NAN device on the first channel in the DW. After receiving the second message, the first NAN device may determine whether the second NAN device meets the service subscribed or published by the first NAN device, and The ranging capability of the second NAN device can be determined.
例如,第二消息也可以为服务连接消息,第二消息可以由第二NAN设备于第一时间窗口内在第二信道上发送,用于请求与第一NAN设备的服务连接,例如服务连接消息具体为关联消息(包括但不限于Association Request(关联
请求)消息等)、用于Paging(页面调度)的消息等,第一NAN设备接收第二消息后,确定第二NAN设备的测距能力,并获得第一参数组信息。For example, the second message may also be a service connection message, and the second message may be sent by the second NAN device on the second channel in the first time window for requesting a service connection with the first NAN device, for example, the service connection message is specific. For associated messages (including but not limited to Association Request)
After the first NAN device receives the second message, the first NAN device determines the ranging capability of the second NAN device and obtains the first parameter group information.
其中,第二信道表示第一NAN设备与其他NAN设备建立服务的运行信道,该信道可以为不同于第一信道的其他信道,或者也可以与第一信道为同一信道。The second channel represents an operating channel in which the first NAN device establishes a service with other NAN devices, and the channel may be other channels different from the first channel, or may be the same channel as the first channel.
另外,本发明实施例中,认为第一信道与DW关联,第二信道与第一时间窗口关联,即认为,在DW中传输的消息,都是通过第一信道传输,在第一时间窗口中传输的消息,都是通过第二信道传输。In addition, in the embodiment of the present invention, the first channel is considered to be associated with the DW, and the second channel is associated with the first time window, that is, the message transmitted in the DW is transmitted through the first channel, in the first time window. The transmitted messages are transmitted through the second channel.
步骤103:所述第一NAN设备向所述第二NAN设备发送第三消息,获得发送所述第三消息的第二时刻,根据所述第一时刻和所述第二时刻获得第一参数组信息;所述第一参数组信息用于获得所述第一NAN设备与所述第二NAN设备之间的距离,所述第三消息为针对所述第二消息的确认消息。Step 103: The first NAN device sends a third message to the second NAN device, obtains a second time to send the third message, and obtains a first parameter group according to the first time and the second time. The first parameter group information is used to obtain a distance between the first NAN device and the second NAN device, and the third message is an acknowledgement message for the second message.
第一NAN设备接收到第二消息后,会向第二NAN设备发送针对该第二消息的确认消息,即发送第三消息,例如该第三消息具体为ACK。After receiving the second message, the first NAN device sends an acknowledgement message for the second message to the second NAN device, that is, sends a third message, for example, the third message is specifically an ACK.
可选的,本发明实施例中,第一NAN设备可以直接将第一时刻和第二时刻作为第一参数组信息,或,第一NAN设备也可以对第一时刻和第二时刻进行处理,将处理后得到的信息作为第一参数组信息,本发明实施例中对第一参数组信息的具体形式不作限制,只要第二NAN设备能够根据第一参数组信息得到第一时刻和第二时刻即可。Optionally, in the embodiment of the present invention, the first NAN device may directly use the first time and the second time as the first parameter group information, or the first NAN device may also process the first time and the second time. The information obtained after the processing is used as the first parameter group information. The specific form of the first parameter group information is not limited in the embodiment of the present invention, as long as the second NAN device can obtain the first time and the second time according to the first parameter group information. Just fine.
其中,该第三消息可以在DW中发送,或者也可以在第一时间窗口中发送。The third message may be sent in the DW or may also be sent in the first time window.
可选的,本发明实施例中,在根据第一时刻和第二时刻获得第一参数组信息之后,还包括:Optionally, in the embodiment of the present invention, after obtaining the first parameter group information according to the first time and the second time, the method further includes:
所述第一NAN设备在所述第一时间窗口中将所述第一参数组信息发送给所述第二NAN设备;所述第一参数组信息用于所述第二NAN设备根据所述第一参数组信息和所述第二参数组信息获得所述第一NAN设备与所述第二NAN设备之间的距离。
Transmitting, by the first NAN device, the first parameter group information to the second NAN device in the first time window; the first parameter group information is used by the second NAN device according to the A parameter group information and the second parameter group information obtain a distance between the first NAN device and the second NAN device.
即,如果第二NAN设备也需要获得第一NAN设备与第二NAN设备之间的距离,第一NAN设备可以将第一参数组信息发送给第二NAN设备,这样第二NAN设备就可以根据第一参数组信息和第二参数组信息获得第一NAN设备和第二NAN设备之间的距离。其中,关于第二参数组信息将在步骤104中进行介绍。That is, if the second NAN device also needs to obtain the distance between the first NAN device and the second NAN device, the first NAN device may send the first parameter group information to the second NAN device, so that the second NAN device can be The first parameter group information and the second parameter group information obtain a distance between the first NAN device and the second NAN device. The second parameter group information will be introduced in step 104.
具体的,若根据FTM测距原理来进行测距,则第二NAN设备根据第一参数组信息和第二参数组信息获得第一NAN设备和第二NAN设备之间的距离的方式可参照公式(1)和公式(2)。此时,第一时刻为t2,第二时刻为t3,第三时刻为t1,第四时刻为t4。需要说明的是,基于FTM原理进行测距只是本发明中一种可能的实现方案,但并不以此为限,例如,还可以根据三角测距、信号强度测距等原理来实现测距。Specifically, if the ranging is performed according to the FTM ranging principle, the manner in which the second NAN device obtains the distance between the first NAN device and the second NAN device according to the first parameter group information and the second parameter group information may refer to a formula. (1) and formula (2). At this time, the first time is t2, the second time is t3, the third time is t1, and the fourth time is t4. It should be noted that ranging based on the FTM principle is only one possible implementation solution of the present invention, but is not limited thereto. For example, ranging can also be implemented according to the principles of triangulation ranging, signal strength ranging, and the like.
步骤104:所述第一NAN设备在所述第一时间窗口中,接收所述第二NAN设备发送的第二参数组信息,所述第一NAN设备根据所述第一参数组信息和所述第二参数组信息,获得所述第一NAN设备与所述第二NAN设备之间的距离;和/或,所述第一NAN设备在第一时间窗口中,向所述第二NAN设备发送所述第一参数组信息,以便所述第二NAN设备根据所述第一参数组信息及所述第二参数组信息获得所述第一NAN设备与所述第二NAN设备之间的距离。Step 104: The first NAN device receives, in the first time window, second parameter group information that is sent by the second NAN device, where the first NAN device is configured according to the first parameter group information. The second parameter group information obtains a distance between the first NAN device and the second NAN device; and/or, the first NAN device sends the second NAN device to the second NAN device in a first time window The first parameter group information, so that the second NAN device obtains a distance between the first NAN device and the second NAN device according to the first parameter group information and the second parameter group information.
其中,所述第二参数组信息为:所述第二NAN设备获得发送所述第二消息的第三时刻,以及获得接收所述第三消息的第四时刻,根据所述第三时刻和所述第四时刻获得的参数组信息,所述第二参数组信息用于获得所述第一NAN设备与所述第二NAN设备之间的距离。The second parameter group information is: the second time when the second NAN device obtains the second message, and obtains a fourth time to receive the third message, according to the third moment and the The parameter group information obtained at the fourth time, the second parameter group information is used to obtain a distance between the first NAN device and the second NAN device.
即,本发明实施例中,在传输测距所需的参数组信息时,可以是在第一时间窗口中传输,当然也可能在其他时间段内传输,本发明并不以此为限。That is, in the embodiment of the present invention, when the parameter group information required for the ranging is transmitted, it may be transmitted in the first time window, and may also be transmitted in other time periods, and the present invention is not limited thereto.
第二NAN设备可以获得第二参数组信息,第二参数组信息也为用于获得第一NAN设备和第二NAN设备之间的距离的信息。The second NAN device may obtain second parameter group information, which is also information for obtaining a distance between the first NAN device and the second NAN device.
例如,第二NAN设备可以捕获发送第二消息的第三时刻,以及捕获接收
确认消息的第四时刻,并可以根据第三时刻和第四时刻得到第二参数组信息。For example, the second NAN device can capture the third moment of transmitting the second message, and capture and receive
Confirming the fourth moment of the message, and obtaining the second parameter group information according to the third moment and the fourth moment.
其中,第二NAN设备可以直接将第三时刻和第四时刻作为第二参数组信息,或,第二NAN设备也可以对第三时刻和第四时刻进行处理,将处理后得到的信息作为第二参数组信息,本发明实施例中对第二参数组信息的具体形式不作限制,只要第一NAN设备能够根据第二参数组信息得到第三时刻和第四时刻即可。The second NAN device may directly use the third time and the fourth time as the second parameter group information, or the second NAN device may process the third time and the fourth time, and the obtained information is used as the first The second parameter group information is not limited in the embodiment of the present invention. The first NAN device can obtain the third time and the fourth time according to the second parameter group information.
本发明实施例中,第二NAN设备可以单独向第一NAN设备发送第二参数组信息,或者也可以将第二参数组信息携带在服务连接消息中进行发送。In the embodiment of the present invention, the second NAN device may separately send the second parameter group information to the first NAN device, or may also carry the second parameter group information in the service connection message for sending.
例如,若将第二参数组信息携带在服务连接消息中进行发送,则服务连接消息除了携带有第二参数组信息外,还可以用于表明所述第二NAN设备要与第一NAN设备建立服务连接,该服务连接消息例如具体为关联消息(包括但不限于Association Request(关联请求)、Association Response(关联回复)消息等)、用于Paging的消息等。For example, if the second parameter group information is carried in the service connection message for sending, the service connection message may be used to indicate that the second NAN device is to be established with the first NAN device, in addition to carrying the second parameter group information. A service connection, such as a related message (including but not limited to an Association Request, an Association Response message, etc.), a message for paging, and the like.
在接收到第二参数组信息后,第一NAN设备可以根据第一参数组信息和第二参数组信息获得第一NAN设备和第二NAN设备之间的距离,具体的,若根据FTM测距原理来进行测距,则第一NAN设备根据第一参数组信息和第二参数组信息获得第一NAN设备和第二NAN设备之间的距离的方式可参照公式(1)和公式(2)。此时,第一时刻为t2,第二时刻为t3,第三时刻为t1,第四时刻为t4。同样的,基于FTM原理进行测距只是本发明中一种可能的实现方案,但并不以此为限。After receiving the second parameter group information, the first NAN device may obtain the distance between the first NAN device and the second NAN device according to the first parameter group information and the second parameter group information, specifically, according to the FTM ranging. The principle is to perform ranging, and the manner in which the first NAN device obtains the distance between the first NAN device and the second NAN device according to the first parameter group information and the second parameter group information may refer to formula (1) and formula (2). . At this time, the first time is t2, the second time is t3, the third time is t1, and the fourth time is t4. Similarly, ranging based on the FTM principle is only one possible implementation of the present invention, but is not limited thereto.
第一NAN设备接收第二参数组信息后,根据第二参数组信息和第一参数组信息得到第一NAN设备和第二NAN设备之间的距离,例如将其称为第一距离,从而第一NAN设备可以根据第一距离确定是否与第二NAN设备建立服务连接。After receiving the second parameter group information, the first NAN device obtains a distance between the first NAN device and the second NAN device according to the second parameter group information and the first parameter group information, for example, it is referred to as a first distance, and thus A NAN device can determine whether to establish a service connection with the second NAN device according to the first distance.
例如,当第一距离满足第一NAN设备设置的订阅或发布的服务的距离阈值时,第一NAN设备确认与第二NAN设备建立服务连接,第一NAN设备向第二NAN设备回复服务连接响应消息,如当服务连接消息为Association
Request时,第一NAN设备回复的服务连接响应消息可以是Association Response,以指示第二NAN设备进行后续的连接过程。For example, when the first distance satisfies the distance threshold of the subscribed or published service set by the first NAN device, the first NAN device confirms that the service connection is established with the second NAN device, and the first NAN device replies with the service connection response to the second NAN device. Message, such as when the service connection message is Association
When the request is received, the service connection response message replied by the first NAN device may be an Association Response to instruct the second NAN device to perform a subsequent connection process.
或者例如,当第一距离不满足第一NAN设备设置的订阅或发布的服务的距离阈值时,若服务连接消息为Paging请求消息,则第一NAN设备回复的服务连接响应消息可以是Paging响应消息,并指示服务连接终止,如指示的是Status(状态):Fail(失败)。进一步地,第一NAN设备还可以指示服务终止的原因,如指示Reason Code(原因码):Out-of-Range(不在服务范围)。Or for example, when the first distance does not meet the distance threshold of the subscribed or published service set by the first NAN device, if the service connection message is a Paging request message, the service connection response message replied by the first NAN device may be a Paging response message. And indicates that the service connection is terminated, as indicated by Status: Fail. Further, the first NAN device may also indicate the reason for the service termination, such as indicating the Reason Code: Out-of-Range.
或者例如,当第一距离满足第一NAN设备设置的订阅或发布的服务的距离阈值时,第一NAN设备确认与第二NAN设备建立服务连接,并确定后续为第一NAN设备提供第一种服务,例如提供视频文件分享服务。第一NAN设备向第二NAN设备回复服务连接响应消息,如当服务连接消息为Association Request时,第一NAN设备回复的服务连接响应消息可以是Association Response,以指示第二NAN设备进行后续的连接过程。Or for example, when the first distance satisfies a distance threshold of the subscribed or published service set by the first NAN device, the first NAN device confirms establishing a service connection with the second NAN device, and determines to provide the first type for the first NAN device subsequently. Services, such as providing video file sharing services. The first NAN device replies to the second NAN device with a service connection response message. For example, when the service connection message is an Association Request, the service connection response message replied by the first NAN device may be an Association Response to indicate that the second NAN device performs subsequent connection. process.
或者例如,当第一距离不满足第一NAN设备设置的订阅或发布的服务的距离阈值时,第一NAN设备确认与第二NAN设备建立服务连接,并确定后续为第一NAN设备提供第二种服务,例如提供广告推送服务。第一NAN设备向第二NAN设备回复服务连接响应消息,如当服务连接消息为Association Request时,第一NAN设备回复的服务连接响应消息可以是Association Response,以指示第二NAN设备进行后续的连接过程。Or for example, when the first distance does not satisfy the distance threshold of the subscribed or published service set by the first NAN device, the first NAN device confirms establishing a service connection with the second NAN device, and determines to provide the second NAN device subsequently. Services, such as providing advertising push services. The first NAN device replies to the second NAN device with a service connection response message. For example, when the service connection message is an Association Request, the service connection response message replied by the first NAN device may be an Association Response to indicate that the second NAN device performs subsequent connection. process.
即,第一NAN设备可以根据第一NAN设备和第二NAN设备之间的距离确定是否与第二NAN设备建立服务连接,或者,第一NAN设备也可以根据第一NAN设备和第二NAN设备之间的距离确定具体为第二NAN设备提供什么样的服务,等等,对于第二NAN设备来说也是同样的,此处不再多举例。具体的,测距得到的距离的作用,以上均为可能的实施方案,本发明并不以此为限。That is, the first NAN device may determine whether to establish a service connection with the second NAN device according to the distance between the first NAN device and the second NAN device, or the first NAN device may also be according to the first NAN device and the second NAN device. The distance between the determinations is specifically what the second NAN device provides, and so on, and the same is true for the second NAN device, and no more examples are given here. Specifically, the effects of the distance obtained by the ranging are all possible embodiments, and the present invention is not limited thereto.
可选的,本发明实施例中,若所述第一NAN设备在所述第一时间窗口中,接收所述第二NAN设备发送的第二参数组信息,则,在根据所述第一时刻和
所述第二时刻获得第一参数组信息之后,还包括:Optionally, in the embodiment of the present invention, if the first NAN device receives the second parameter group information sent by the second NAN device in the first time window, according to the first moment with
After the obtaining, by the second moment, the first parameter group information, the method further includes:
所述第一NAN设备在所述第一时间窗口中将所述第一参数组信息发送给所述第二NAN设备;所述第一参数组信息用于所述第二NAN设备根据所述第一参数组信息和所述第二参数组信息获得所述第一NAN设备与所述第二NAN设备之间的距离。Transmitting, by the first NAN device, the first parameter group information to the second NAN device in the first time window; the first parameter group information is used by the second NAN device according to the A parameter group information and the second parameter group information obtain a distance between the first NAN device and the second NAN device.
那么,若第一NAN设备要获得第一NAN设备和第二NAN设备之间的距离,而如果第二NAN设备也需要获得第一NAN设备与第二NAN设备之间的距离,则第一NAN设备还可以将第一参数组信息发送给第二NAN设备,这样第二NAN设备也就能获得第一NAN设备和第二NAN设备之间的距离,满足两个NAN设备同时获得距离的需求。Then, if the first NAN device is to obtain the distance between the first NAN device and the second NAN device, and if the second NAN device also needs to obtain the distance between the first NAN device and the second NAN device, the first NAN The device may also send the first parameter group information to the second NAN device, so that the second NAN device can also obtain the distance between the first NAN device and the second NAN device, and meet the requirement that the two NAN devices simultaneously obtain the distance.
可选的,本发明实施例中,若所述第一NAN设备在所述第一时间窗口中,接收所述第二NAN设备发送的第二参数组信息,则,在获得所述第一NAN设备与所述第二NAN设备之间的距离之后,还包括:Optionally, in the embodiment of the present invention, if the first NAN device receives the second parameter group information sent by the second NAN device in the first time window, obtain the first NAN After the distance between the device and the second NAN device, the method further includes:
所述第一NAN设备将获得的所述第一NAN设备与所述第二NAN设备之间的距离发送给所述第二NAN设备。The first NAN device sends the obtained distance between the first NAN device and the second NAN device to the second NAN device.
即,若第一NAN设备要获得第一NAN设备和第二NAN设备之间的距离,而如果第二NAN设备也需要获得第一NAN设备与第二NAN设备之间的距离,则第一NAN设备除了可以将第一参数组信息发送给第二NAN设备之外,还可以在获得第一NAN设备与第二NAN设备之间的距离后,直接将获得的距离发送给第二NAN设备,这样第二NAN设备就无需再进行计算,减轻第二NAN设备的工作量。That is, if the first NAN device is to obtain the distance between the first NAN device and the second NAN device, and if the second NAN device also needs to obtain the distance between the first NAN device and the second NAN device, the first NAN The device may send the first parameter group information to the second NAN device in addition to the distance between the first NAN device and the second NAN device, and then directly send the obtained distance to the second NAN device. The second NAN device does not need to perform calculations to alleviate the workload of the second NAN device.
可选的,本发明实施例中,若所述第一NAN设备在第一时间窗口中,向所述第二NAN设备发送所述第一参数组信息,则,Optionally, in the embodiment of the present invention, if the first NAN device sends the first parameter group information to the second NAN device in a first time window,
在所述第一NAN设备向所述第二NAN设备发送第三消息之后,还包括:After the first NAN device sends the third message to the second NAN device, the method further includes:
所述第一NAN设备在第一时间窗口中,接收所述第二NAN设备发送的所述第二参数组信息;Receiving, by the first NAN device, the second parameter group information sent by the second NAN device in a first time window;
在根据所述第一时刻和所述第二时刻获得第一参数组信息之后,还包括:
After obtaining the first parameter group information according to the first time and the second time, the method further includes:
根据所述第一参数组信息和所述第二参数组信息获得所述第一NAN设备与所述第二NAN设备之间的距离。Obtaining a distance between the first NAN device and the second NAN device according to the first parameter group information and the second parameter group information.
即,若第二NAN设备要获得第一NAN设备和第二NAN设备之间的距离,而如果第一NAN设备也需要获得第一NAN设备与第二NAN设备之间的距离,则第二NAN设备还可以将第二参数组信息发送给第一NAN设备,这样第一NAN设备也就能获得第一NAN设备和第二NAN设备之间的距离,满足两个NAN设备同时获得距离的需求。That is, if the second NAN device is to obtain the distance between the first NAN device and the second NAN device, and if the first NAN device also needs to obtain the distance between the first NAN device and the second NAN device, the second NAN The device may also send the second parameter group information to the first NAN device, so that the first NAN device can also obtain the distance between the first NAN device and the second NAN device, and meet the requirement that the two NAN devices simultaneously obtain the distance.
可选的,本发明实施例中,若第一NAN设备在第一时间窗口中,向第二NAN设备发送第一参数组信息,则,在第一NAN设备在第一时间窗口中,向第二NAN设备发送第一参数组信息之后,还包括:Optionally, in the embodiment of the present invention, if the first NAN device sends the first parameter group information to the second NAN device in the first time window, then the first NAN device is in the first time window. After the second NAN device sends the first parameter group information, the method further includes:
第一NAN设备接收第二NAN设备发送的、第一NAN设备与第二NAN设备之间的距离。The first NAN device receives the distance between the first NAN device and the second NAN device that is sent by the second NAN device.
即,若第二NAN设备要获得第一NAN设备和第二NAN设备之间的距离,而如果第一NAN设备也需要获得第一NAN设备与第二NAN设备之间的距离,则第二NAN设备除了可以将第二参数组信息发送给第一NAN设备之外,还可以在获得第一NAN设备与第二NAN设备之间的距离后,直接将获得的距离发送给第一NAN设备,这样第一NAN设备就无需再进行计算,减轻第一NAN设备的工作量。That is, if the second NAN device is to obtain the distance between the first NAN device and the second NAN device, and if the first NAN device also needs to obtain the distance between the first NAN device and the second NAN device, the second NAN The device may send the second parameter group information to the first NAN device, and after obtaining the distance between the first NAN device and the second NAN device, directly send the obtained distance to the first NAN device. The first NAN device does not need to perform calculations, reducing the workload of the first NAN device.
其中,图1流程中没有详细介绍的内容,在后续的图2流程中均有介绍,相关内容可以相互参考。Among them, the content not detailed in the process of FIG. 1 is introduced in the subsequent process of FIG. 2, and related content can refer to each other.
请参见图2,基于同一发明构思,本发明实施例提供第二种NAN设备之间的距离测量方法,所述方法的主要流程如下。Referring to FIG. 2, based on the same inventive concept, an embodiment of the present invention provides a distance measurement method between second NAN devices, and the main flow of the method is as follows.
步骤201:第二NAN设备在DW中接收第一NAN设备发送的第一消息,所述第一消息中携带有用于触发所述第二NAN设备进行测距的测距触发信息,以及第一时间窗口的信息;所述发现窗口为NAN中用于进行服务发现的时间窗口,所述第一消息为用于进行服务发现的消息,所述第一时间窗口为用于进行测距的时间窗口。
Step 201: The second NAN device receives the first message sent by the first NAN device in the DW, where the first message carries the ranging trigger information for triggering the second NAN device to perform ranging, and the first time Information of the window; the discovery window is a time window for performing service discovery in the NAN, the first message is a message for performing service discovery, and the first time window is a time window for performing ranging.
步骤202:所述第二NAN设备向所述第一NAN设备发送第二消息,获得发送所述第二消息的第三时刻,所述第二消息用于表明所述第二NAN设备的测距能力,所述第二消息为针对所述第一消息的响应消息;Step 202: The second NAN device sends a second message to the first NAN device to obtain a third moment to send the second message, where the second message is used to indicate ranging of the second NAN device. Capability, the second message is a response message for the first message;
步骤203:所述第二NAN设备接收所述第一NAN设备发送的第三消息,获得接收所述第三消息的第四时刻,根据所述第三时刻和所述第四时刻获得第二参数组信息;所述第二参数组信息用于获得所述第一NAN设备与所述第二NAN设备之间的距离,所述第三消息为针对所述第二消息的确认消息;Step 203: The second NAN device receives the third message sent by the first NAN device, obtains a fourth time to receive the third message, and obtains a second parameter according to the third time and the fourth time. Group information; the second parameter group information is used to obtain a distance between the first NAN device and the second NAN device, and the third message is an acknowledgement message for the second message;
步骤204:所述第二NAN设备在第一时间窗口中,接收所述第一NAN设备发送的第一参数组信息,所述第二NAN设备根据所述第一参数组信息和所述第二参数组信息,获得所述第一NAN设备与所述第二NAN设备之间的距离;和/或,所述第二NAN设备在第一时间窗口中,向所述第一NAN设备发送所述第二参数组信息,以便所述第一NAN设备根据所述第二参数组信息和所述第一参数组信息获得所述第一NAN设备与所述第二NAN设备之间的距离。Step 204: The first NAN device receives, in a first time window, first parameter group information sent by the first NAN device, where the second NAN device is configured according to the first parameter group information and the second Parameter group information, obtaining a distance between the first NAN device and the second NAN device; and/or, the second NAN device transmitting the the NAN device to the first NAN device in a first time window a second parameter group information, so that the first NAN device obtains a distance between the first NAN device and the second NAN device according to the second parameter group information and the first parameter group information.
其中,所述第一参数组信息为:所述第一NAN设备获得接收所述第二消息的第一时刻,以及获得发送所述第三消息的第二时刻,根据所述第一时刻和所述第二时刻获得的参数组信息,所述第一参数组信息用于获得所述第一NAN设备与所述第二NAN设备之间的距离。The first parameter group information is: the first time that the first NAN device obtains the second message, and the second time that the third message is sent, according to the first time and the The parameter group information obtained at the second moment is used to obtain a distance between the first NAN device and the second NAN device.
本发明实施例中,将发起测距的NAN设备称为第一NAN设备,将接受测距的NAN设备称为第二NAN设备。In the embodiment of the present invention, the NAN device that initiates ranging is referred to as a first NAN device, and the NAN device that receives ranging is referred to as a second NAN device.
本发明实施例中,第一时间窗口可以与DW相邻,即DW的终点就是第一时间窗口的起点,也就是说DW和第一时间窗口之间的间隔时长等于0。例如DW为DW,第一时间窗口可以为DW结束后相邻的时间段,或例如,DW为DW中的第一部分时间段,第一时间窗口为DW中的第二部分时间段,且DW的终点是第一时间窗口的起点,即第一时间窗口是DW中第一部分时间段结束后的全部剩余时间段;或者,第一时间窗口与DW之间可以有间隔时长,该间隔时长大于0,例如DW为DW,第一时间窗口可以为DW结束后相隔一段时间之后
的时间段,或例如,DW为DW中的第一部分时间段,第一时间窗口为DW中的第二部分时间段,且DW和第一时间窗口之间的间隔时长大于0,即第一时间窗口是DW中第一部分时间段结束后的部分剩余时间段。In the embodiment of the present invention, the first time window may be adjacent to the DW, that is, the end point of the DW is the start point of the first time window, that is, the interval length between the DW and the first time window is equal to zero. For example, DW is DW, the first time window may be an adjacent time period after the end of DW, or for example, DW is the first part time period in DW, the first time window is the second part time period in DW, and DW The end point is the starting point of the first time window, that is, the first time window is all the remaining time periods after the end of the first part of the time period in the DW; or, the interval between the first time window and the DW may be longer, and the interval duration is greater than 0. For example, if DW is DW, the first time window can be after a period of time after the end of DW.
The time period, or for example, the DW is the first partial time period in the DW, the first time window is the second partial time period in the DW, and the interval between the DW and the first time window is greater than 0, that is, the first time The window is the remaining time period after the end of the first part of the DW.
可选的,本发明实施例中,第一消息中携带有第一NAN设备订阅或发布的服务信息。Optionally, in the embodiment of the present invention, the first message carries the service information subscribed or issued by the first NAN device.
可选的,本发明实施例中,测距本身也可以是一种服务,那么该服务信息所对应的服务也可以是测距,即该服务信息是用于表明第一NAN设备需要订阅测距服务或第一NAN设备需要发布测距服务的信息。Optionally, in the embodiment of the present invention, the ranging itself may also be a service, and the service corresponding to the service information may also be ranging, that is, the service information is used to indicate that the first NAN device needs to be subscribed to the ranging. The service or the first NAN device needs to publish information about the ranging service.
可选的,本发明实施例中,第二消息为针对第一消息的响应消息。例如,第二消息可以为SDF消息,具体可以为SDF Publish消息或SDF Follow-up消息。例如,当第一消息为SDF Subscribe消息时,第二消息可以为响应该消息的SDF Publish消息;当第一消息为SDF Publish消息时,第二消息可以为响应该消息的SDF Follow-Up消息。Optionally, in the embodiment of the present invention, the second message is a response message for the first message. For example, the second message may be an SDF message, and may be an SDF Publish message or an SDF Follow-up message. For example, when the first message is an SDF Subscribe message, the second message may be an SDF Publish message in response to the message; when the first message is an SDF Publish message, the second message may be an SDF Follow-Up message in response to the message.
可选的,本发明实施例中,第三消息为针对第二消息的确认消息。Optionally, in the embodiment of the present invention, the third message is an acknowledgement message for the second message.
可选的,本发明实施例中,第二NAN设备向第一NAN设备发送第二消息,包括:Optionally, in the embodiment of the present invention, the second NAN device sends the second message to the first NAN device, including:
第二NAN设备在DW或第一时间窗口中向第一NAN设备发送第二消息。The second NAN device transmits a second message to the first NAN device in the DW or the first time window.
可选的,本发明实施例中,测距触发信息中包括测距原理指示信息、测距协议指示信息、测距要求指示信息、测距需求指示信息以及测距开启指示信息中的一种或任意几种;其中,Optionally, in the embodiment of the present invention, the ranging trigger information includes one of a ranging principle indication information, a ranging protocol indication information, a ranging requirement indication information, a ranging requirement indication information, and a ranging opening indication information. Any of them; among them,
测距原理指示信息用于指示进行距离测量所依据的测量原理;The ranging principle indication information is used to indicate the measurement principle on which the distance measurement is performed;
测距协议指示信息用于指示进行距离测量所依据的测量协议;The ranging protocol indication information is used to indicate a measurement protocol on which the distance measurement is performed;
测距要求指示信息用于指示对所测量的距离所需要满足的参数的需求;The ranging request indication information is used to indicate a requirement for a parameter that needs to be satisfied for the measured distance;
测距需求指示信息用于指示对满足所述服务信息的NAN设备的距离的需求;The ranging demand indication information is used to indicate a demand for a distance of the NAN device that satisfies the service information;
测距开启指示信息用于指示第二NAN设备开启测距功能。
The ranging open indication information is used to instruct the second NAN device to turn on the ranging function.
本发明实施例中,第二NAN设备要拥有第一NAN设备所指示的相应的测距能力,可以有几种不同的情况,在图1流程中已有介绍。In the embodiment of the present invention, the second NAN device has the corresponding ranging capability indicated by the first NAN device, and may have several different situations, which are described in the flow of FIG. 1.
可选的,本发明实施例中,第二NAN设备可以直接将第三时刻和第四时刻作为第二参数组信息,或,第二NAN设备也可以对第三时刻和第四时刻进行处理,将处理后得到的信息作为第二参数组信息,本发明实施例中对第二参数组信息的具体形式不作限制,只要第一NAN设备能够根据第二参数组信息得到第三时刻和第四时刻即可。Optionally, in the embodiment of the present invention, the second NAN device may directly use the third time and the fourth time as the second parameter group information, or the second NAN device may also process the third time and the fourth time. The information obtained after the processing is used as the second parameter group information. The specific form of the second parameter group information is not limited in the embodiment of the present invention, as long as the first NAN device can obtain the third time and the fourth time according to the second parameter group information. Just fine.
可选的,本发明实施例中,若第二NAN设备在第一时间窗口中,接收第一NAN设备发送的第一参数组信息,则,在根据第三时刻和第四时刻获得第二参数组信息之后,还包括:Optionally, in the embodiment of the present invention, if the second NAN device receives the first parameter group information sent by the first NAN device in the first time window, obtaining the second parameter according to the third time and the fourth time After the group information, it also includes:
第二NAN设备在第一时间窗口中将第二参数组信息发送给第一NAN设备;第二参数组信息用于第一NAN设备根据第一参数组信息和第二参数组信息获得第一NAN设备与第二NAN设备之间的距离。The second NAN device sends the second parameter group information to the first NAN device in the first time window; the second parameter group information is used by the first NAN device to obtain the first NAN according to the first parameter group information and the second parameter group information. The distance between the device and the second NAN device.
那么,若第二NAN设备要获得第一NAN设备和第二NAN设备之间的距离,而如果第一NAN设备也需要获得第一NAN设备与第二NAN设备之间的距离,则第二NAN设备还可以将第二参数组信息发送给第一NAN设备,这样第一NAN设备也就能获得第一NAN设备和第二NAN设备之间的距离,满足两个NAN设备同时获得距离的需求。Then, if the second NAN device is to obtain the distance between the first NAN device and the second NAN device, and if the first NAN device also needs to obtain the distance between the first NAN device and the second NAN device, the second NAN The device may also send the second parameter group information to the first NAN device, so that the first NAN device can also obtain the distance between the first NAN device and the second NAN device, and meet the requirement that the two NAN devices simultaneously obtain the distance.
可选的,本发明实施例中,若第二NAN设备在第一时间窗口中,接收第一NAN设备发送的第一参数组信息,则,在第二NAN设备根据第一参数组信息和第二参数组信息,获得第一NAN设备与第二NAN设备之间的距离之后,还包括:Optionally, in the embodiment of the present invention, if the second NAN device receives the first parameter group information sent by the first NAN device in the first time window, the second NAN device performs the first parameter group information according to the first parameter group information. After obtaining the distance between the first NAN device and the second NAN device, the parameter information includes:
第二NAN设备将获得的第一NAN设备与第二NAN设备之间的距离发送给第一NAN设备。The second NAN device transmits the obtained distance between the first NAN device and the second NAN device to the first NAN device.
即,若第二NAN设备要获得第一NAN设备和第二NAN设备之间的距离,而如果第一NAN设备也需要获得第一NAN设备与第二NAN设备之间的距离,则第二NAN设备除了可以将第二参数组信息发送给第一NAN设备
之外,还可以在获得第一NAN设备与第二NAN设备之间的距离后,直接将获得的距离发送给第一NAN设备,这样第一NAN设备就无需再进行计算,减轻第一NAN设备的工作量。That is, if the second NAN device is to obtain the distance between the first NAN device and the second NAN device, and if the first NAN device also needs to obtain the distance between the first NAN device and the second NAN device, the second NAN The device can send the second parameter group information to the first NAN device.
In addition, after obtaining the distance between the first NAN device and the second NAN device, the obtained distance can be directly sent to the first NAN device, so that the first NAN device does not need to perform calculation, and the first NAN device is mitigated. The amount of work.
可选的,本发明实施例中,若第二NAN设备在第一时间窗口中,向第一NAN设备发送第二参数组信息,则,在第二NAN设备接收第一NAN设备发送的第三消息之后,还包括:Optionally, in the embodiment of the present invention, if the second NAN device sends the second parameter group information to the first NAN device in the first time window, the second NAN device receives the third information sent by the first NAN device. After the news, it also includes:
第二NAN设备在第一时间窗口中接收第一NAN设备发送的第一参数组信息;其中,第一参数组信息为第一NAN设备根据接收第二消息的第一时刻,以及发送第三消息的第二时刻获得的;The first NAN device receives the first parameter group information sent by the first NAN device in the first time window, where the first parameter group information is that the first NAN device receives the third message according to the first time, and sends the third message. Obtained at the second moment;
在根据第三时刻和第四时刻获得第二参数组信息之后,还包括:After obtaining the second parameter group information according to the third time and the fourth time, the method further includes:
根据第一参数组信息和第二参数组信息获得第一NAN设备与第二NAN设备之间的距离。Obtaining a distance between the first NAN device and the second NAN device according to the first parameter group information and the second parameter group information.
即,若第一NAN设备要获得第一NAN设备和第二NAN设备之间的距离,而若第二NAN设备也需要获得第一NAN设备与第二NAN设备之间的距离,则第一NAN设备可以将获得的第一参数组信息发送给第二NAN设备,这样第二NAN设备也就能获得第一NAN设备和第二NAN设备之间的距离,满足两个NAN设备同时获得距离的需求。That is, if the first NAN device is to obtain the distance between the first NAN device and the second NAN device, and if the second NAN device also needs to obtain the distance between the first NAN device and the second NAN device, the first NAN The device may send the obtained first parameter group information to the second NAN device, so that the second NAN device can also obtain the distance between the first NAN device and the second NAN device, and meet the requirement that the two NAN devices simultaneously obtain the distance. .
可选的,本发明实施例中,若第二NAN设备在第一时间窗口中,向第一NAN设备发送第二参数组信息,则,在第二NAN设备在第一时间窗口中,向第一NAN设备发送第二参数组信息之后,还包括:Optionally, in the embodiment of the present invention, if the second NAN device sends the second parameter group information to the first NAN device in the first time window, then the second NAN device is in the first time window. After the NAN device sends the second parameter group information, the method further includes:
第二NAN设备接收第一NAN设备发送的、第一NAN设备和第二NAN设备之间的距离。The second NAN device receives the distance between the first NAN device and the second NAN device that is sent by the first NAN device.
即,若第一NAN设备要获得第一NAN设备和第二NAN设备之间的距离,而如果第二NAN设备也需要获得第一NAN设备与第二NAN设备之间的距离,则第一NAN设备除了可以将第一参数组信息发送给第二NAN设备之外,还可以在获得第一NAN设备与第二NAN设备之间的距离后,直接将获得的距离发送给第二NAN设备,这样第二NAN设备就无需再进行计算,
减轻第二NAN设备的工作量。That is, if the first NAN device is to obtain the distance between the first NAN device and the second NAN device, and if the second NAN device also needs to obtain the distance between the first NAN device and the second NAN device, the first NAN The device may send the first parameter group information to the second NAN device in addition to the distance between the first NAN device and the second NAN device, and then directly send the obtained distance to the second NAN device. The second NAN device does not need to be calculated again.
Reduce the workload of the second NAN device.
其中,图2流程中没有详细介绍的内容,在图1流程中均有介绍,可以互相参考。Among them, the contents that are not described in detail in the flow of Figure 2 are introduced in the flow of Figure 1, and can be referred to each other.
以下举两个例子说明本发明实施例中的NAN设备之间的距离测量的方法。Two methods are described below to illustrate the method of distance measurement between NAN devices in the embodiments of the present invention.
请参见图3,为本发明实施例中NAN设备之间的距离测量的第一个具体示例,如下为对图3所示的过程的具体描述。Please refer to FIG. 3 , which is a first specific example of distance measurement between NAN devices in an embodiment of the present invention. The following is a detailed description of the process shown in FIG. 3 .
步骤1:第一NAN设备在DW内,在第一信道发送SDF Subscribe消息。在该SDF Subscribe消息中包含第一NAN设备需要订阅的服务的Service ID(服务身份标识),基于FTM原理的测距触发信息、SW的信息、及建立服务连接的第二信道的信息。Step 1: The first NAN device sends an SDF Subscribe message on the first channel in the DW. The SDF Subscribe message includes a Service ID (Service Identity) of the service that the first NAN device needs to subscribe to, ranging trigger information based on the FTM principle, information of the SW, and information of the second channel establishing the service connection.
其中,本发明实施例中的FTM测距是指基于FTM测距原理的测距,并不限定为IEEE P802.11-REVmc标准中指定的FTM测距过程。The FTM ranging in the embodiment of the present invention refers to the ranging based on the FTM ranging principle, and is not limited to the FTM ranging procedure specified in the IEEE P802.11-REVmc standard.
步骤2:第二NAN设备接收SDF Subscribe消息后,判断确定能够提供该Service ID所指示的服务,并开启FTM测距,向第一NAN设备回复SDF Publish消息,并获得发送SDF Publish消息的发送时间,例如将该时间称为t1。Step 2: After receiving the SDF Subscribe message, the second NAN device determines that the service indicated by the Service ID can be provided, starts FTM ranging, returns an SDF Publish message to the first NAN device, and obtains a sending time of sending the SDF Publish message. For example, this time is referred to as t1.
第一NAN设备接收该SDF Publish消息,并获得接收该SDF Publish消息的时间,例如将该时间称为t2。The first NAN device receives the SDF Publish message and obtains the time to receive the SDF Publish message, for example, the time is referred to as t2.
步骤3:第一NAN设备向第二NAN设备发送针对该SDF Publish消息的ACK消息,并获得发送该ACK消息的时间,例如将该时间称为t3。Step 3: The first NAN device sends an ACK message for the SDF Publish message to the second NAN device, and obtains a time to send the ACK message, for example, the time is referred to as t3.
第二NAN设备接收该ACK消息,并获得接收该ACK消息的时间,例如将该时间称为t4。The second NAN device receives the ACK message and obtains the time to receive the ACK message, for example, the time is referred to as t4.
步骤4:第二NAN设备在DW结束后,在SW来临时,根据第二信道的信息切换到第二信道上运行,并在SW中向第一NAN设备发送服务连接消息(例如将该服务连接消息称为第一服务连接消息)。同样的,第一NAN设备也在SW时间来临时切换到第二信道。第二NAN设备发送的第一服务连接消息,其中包括t1和t4。例如第一服务连接消息可以为Paging消息或者
Association Request等消息。Step 4: After the DW ends, the second NAN device switches to the second channel according to the information of the second channel, and sends a service connection message to the first NAN device in the SW (for example, connecting the service) The message is called the first service connection message). Similarly, the first NAN device also temporarily switches to the second channel at SW time. The first service connection message sent by the second NAN device, including t1 and t4. For example, the first service connection message may be a Paging message or
Association Request and other news.
第一NAN设备接收第一服务连接消息后,根据t1、t4,以及第一NAN设备捕获的t2和t3,可以根据公式(1)获得RTT,并可以根据公式(2)计算出与第二NAN设备之间的距离,例如计算出的距离为d1。After receiving the first service connection message, the first NAN device may obtain the RTT according to formula (1) according to t1, t4, and t2 and t3 captured by the first NAN device, and may calculate and the second NAN according to formula (2). The distance between the devices, for example, the calculated distance is d1.
步骤5:当第一NAN设备设置只查询一定距离d1’内的服务时,第一NAN设备判断d1是否满足d1<d1’,当满足时,第一NAN设备向第二NAN设备回复第二服务连接消息,如第二服务连接消息为Paging消息或Association Response消息等。Step 5: When the first NAN device is set to query only the service within a certain distance d1', the first NAN device determines whether d1 satisfies d1<d1'. When satisfied, the first NAN device returns a second service to the second NAN device. The connection message, such as the second service connection message, is a Paging message or an Association Response message.
进一步地,第一NAN设备也可以在第二服务连接消息中携带t2和t3,供第二NAN设备计算与第一NAN设备之间的距离,或者第一NAN设备也可以在第二服务连接消息中携带计算出的距离d1,使第二NAN设备直接获得d1。同样的,当第二NAN设备设置只向一定距离d2’内的NAN设备提供所述服务时,第二NAN设备判断获得的第一NAN设备和第二NAN设备之间的距离是否小于d2’,若是,则继续进行服务建立过程。Further, the first NAN device may also carry t2 and t3 in the second service connection message, where the second NAN device calculates the distance from the first NAN device, or the first NAN device may also be in the second service connection message. The calculated distance d1 is carried in, so that the second NAN device directly obtains d1. Similarly, when the second NAN device is configured to provide the service only to the NAN device within a certain distance d2', the second NAN device determines whether the obtained distance between the first NAN device and the second NAN device is less than d2', If yes, continue with the service establishment process.
另需要说明的是,图3中示出的DW和SW的长度,只是为了说明本发明实施例中的技术方案,并不代表DW和SW的实际长度。即在实际应用中,DW与SW所持续的时长可能相等也可能不等,若不相等,则可能是DW持续时间较长,也可能是SW持续时间较长。It should be noted that the lengths of the DW and the SW shown in FIG. 3 are only for explaining the technical solutions in the embodiment of the present invention, and do not represent the actual lengths of the DW and the SW. That is, in practical applications, the durations of DW and SW may be equal or may not be equal. If they are not equal, the duration of DW may be longer, or the duration of SW may be longer.
请参见图4,为本发明实施例中NAN设备之间的距离测量的第二个具体示例,如下为对图4所示的过程的具体描述。4 is a second specific example of distance measurement between NAN devices in an embodiment of the present invention. The following is a detailed description of the process shown in FIG. 4.
步骤1:第一NAN设备在DW内,在第一信道发送SDF Subscribe消息。在该SDF Subscribe消息中包含第一NAN设备需要订阅的服务的Service ID,基于FTM原理的测距触发信息、SW的信息、及建立服务连接的第二信道的信息。Step 1: The first NAN device sends an SDF Subscribe message on the first channel in the DW. The SDF Subscribe message includes a Service ID of a service that the first NAN device needs to subscribe to, a ranging trigger information based on the FTM principle, information of the SW, and information of a second channel establishing a service connection.
步骤2:第二NAN设备接收SDF Subscribe消息后,判断确定能够提供该Service ID所指示的服务,并开启FTM测距。在SW时段到来时,运行于第二信道上,并在SW中向第一NAN设备回复SDF Publish消息,并获得发
送SDF Publish消息的发送时间,例如将该时间称为t1。Step 2: After receiving the SDF Subscribe message, the second NAN device determines that the service indicated by the Service ID can be provided, and starts FTM ranging. When the SW period arrives, it runs on the second channel, and returns an SDF Publish message to the first NAN device in the SW, and obtains a message.
The sending time of the SDF Publish message is sent, for example, this time is called t1.
第一NAN设备接收该SDF Publish消息,并获得接收该SDF Publish消息的时间,例如将该时间称为t2。The first NAN device receives the SDF Publish message and obtains the time to receive the SDF Publish message, for example, the time is referred to as t2.
步骤3:第一NAN设备向第二NAN设备发送针对该SDF Publish消息的ACK消息,并获得发送该ACK消息的时间,例如将该时间称为t3。Step 3: The first NAN device sends an ACK message for the SDF Publish message to the second NAN device, and obtains a time to send the ACK message, for example, the time is referred to as t3.
第二NAN设备接收该ACK消息,并获得接收该ACK消息的时间,例如将该时间称为t4。The second NAN device receives the ACK message and obtains the time to receive the ACK message, for example, the time is referred to as t4.
步骤4:第一NAN设备向第二NAN设备发送服务连接消息,并在服务连接消息中携带第一参数组信息,例如第一参数组信息包括t2和t3,以使得第二NAN设备获得t2和t3,并计算出第一NAN设备和第二NAN设备之间的距离。Step 4: The first NAN device sends a service connection message to the second NAN device, and carries the first parameter group information in the service connection message, for example, the first parameter group information includes t2 and t3, so that the second NAN device obtains t2 and T3, and calculate the distance between the first NAN device and the second NAN device.
第二NAN设备可以根据获得的距离判断是否与第一NAN设备进行后续的服务连接建立。The second NAN device may determine whether to perform subsequent service connection establishment with the first NAN device according to the obtained distance.
另需要说明的是,图4中示出的DW和SW的长度,只是为了说明本发明实施例中的技术方案,并不代表DW和SW的实际长度。即在实际应用中,DW与SW所持续的时长可能相等也可能不等,若不相等,则可能是DW持续时间较长,也可能是SW持续时间较长。It should be noted that the lengths of the DW and the SW shown in FIG. 4 are only for explaining the technical solutions in the embodiment of the present invention, and do not represent the actual lengths of the DW and the SW. That is, in practical applications, the durations of DW and SW may be equal or may not be equal. If they are not equal, the duration of DW may be longer, or the duration of SW may be longer.
本发明实施例中,第一NAN设备若想要测量与第二NAN设备之间的距离,则第一NAN设备可以将测距触发信息携带在第一消息中,从而可以将第一消息在DW中进行发送,而后续若第二NAN设备支持测距,则第二NAN设备会在第一时间窗口中向第一NAN设备发送第二参数组信息,从而第一NAN设备就能够获得第一NAN设备与第二NAN设备之间的距离,或者第一NAN设备也可以将获得的第一参数组信息发送给第二NAN设备,以使第二NAN设备获得第一NAN设备和第二NAN设备之间的距离。例如第一时间窗口是服务窗口,即本发明实施例中,在DW中就能够进行测距触发,而无需等到DW完毕后再单独进行测距触发,节省了测距所需的时间,提高了测距效率。
In the embodiment of the present invention, if the first NAN device wants to measure the distance between the second NAN device and the second NAN device, the first NAN device may carry the ranging trigger information in the first message, so that the first message may be in the DW. Transmitting, and if the second NAN device supports ranging, the second NAN device sends the second parameter group information to the first NAN device in the first time window, so that the first NAN device can obtain the first NAN. The distance between the device and the second NAN device, or the first NAN device may also send the obtained first parameter group information to the second NAN device, so that the second NAN device obtains the first NAN device and the second NAN device. The distance between them. For example, in the embodiment of the present invention, the ranging trigger can be performed in the DW, and the ranging triggering is not required after the DW is completed, thereby saving the time required for ranging and improving the time. Ranging efficiency.
并且,本发明实施例中可以将测距触发信息携带在第一消息中发送,无需像现有技术中那样单独发送,减少了信息的交互量,节省网络资源。Moreover, in the embodiment of the present invention, the ranging trigger information can be carried in the first message, and does not need to be sent separately as in the prior art, which reduces the amount of information interaction and saves network resources.
以下结合附图介绍本发明实施例中的NAN设备。The NAN device in the embodiment of the present invention is described below with reference to the accompanying drawings.
请参见图5,基于同一发明构思,本发明实施例提供一种NAN设备,所述NAN设备可以是如前所述的第一NAN设备。所述NAN设备可以包括发送模块501和确定模块502。Referring to FIG. 5, based on the same inventive concept, an embodiment of the present invention provides a NAN device, which may be a first NAN device as described above. The NAN device can include a sending module 501 and a determining module 502.
发送模块501,用于在DW中发送第一消息,所述第一消息中携带有用于触发所述第二NAN设备进行测距的测距触发信息,以及第一时间窗口的信息;所述发现窗口为NAN中用于进行服务发现的时间窗口,所述第一消息为用于进行服务发现的消息,所述第一时间窗口为用于进行测距的时间窗口;The sending module 501 is configured to send a first message in the DW, where the first message carries ranging trigger information for triggering the second NAN device to perform ranging, and information of the first time window; the discovery The window is a time window for performing service discovery in the NAN, the first message is a message for performing service discovery, and the first time window is a time window for performing ranging;
确定模块502,用于接收所述第二NAN设备发送的第二消息,获得接收所述第二消息的第一时刻,并根据所述第二消息确定所述第二NAN设备的测距能力,所述第二消息为针对所述第一消息的响应消息;a determining module 502, configured to receive a second message sent by the second NAN device, obtain a first time to receive the second message, and determine a ranging capability of the second NAN device according to the second message, The second message is a response message for the first message;
发送模块501,还用于向所述第二NAN设备发送第三消息,获得发送所述第三消息的第二时刻,根据所述第一时刻和所述第二时刻获得第一参数组信息;所述第一参数组信息用于获得所述NAN设备与所述第二NAN设备之间的距离,所述第三消息为针对所述第二消息的确认消息;The sending module 501 is further configured to send a third message to the second NAN device, obtain a second time to send the third message, and obtain first parameter group information according to the first time and the second time; The first parameter group information is used to obtain a distance between the NAN device and the second NAN device, where the third message is an acknowledgement message for the second message;
确定模块502,还用于在所述第一时间窗口中,接收所述第二NAN设备发送的第二参数组信息,根据所述第一参数组信息和所述第二参数组信息,获得所述NAN设备与所述第二NAN设备之间的距离;和/或,发送模块501,还用于在第一时间窗口中,向所述第二NAN设备发送所述第一参数组信息,以便所述第二NAN设备根据所述第一参数组信息及所述第二参数组信息获得所述NAN设备与所述第二NAN设备之间的距离;The determining module 502 is further configured to receive the second parameter group information sent by the second NAN device in the first time window, and obtain the location according to the first parameter group information and the second parameter group information. The distance between the NAN device and the second NAN device; and/or the sending module 501 is further configured to send the first parameter group information to the second NAN device in a first time window, so that Obtaining, by the second NAN device, a distance between the NAN device and the second NAN device according to the first parameter group information and the second parameter group information;
其中,所述第二参数组信息为:所述第二NAN设备获得发送所述第二消息的第三时刻,以及获得接收所述第三消息的第四时刻,根据所述第三时刻和所述第四时刻获得的参数组信息,所述第二参数组信息用于获得所述NAN设备与所述第二NAN设备之间的距离。
The second parameter group information is: the second time when the second NAN device obtains the second message, and obtains a fourth time to receive the third message, according to the third moment and the The parameter group information obtained at the fourth time is used, and the second parameter group information is used to obtain a distance between the NAN device and the second NAN device.
可选的,本发明实施例中,所述第一消息为NAN中的SDF消息,所述第一消息中携带有所述第一NAN设备订阅或发布的服务信息。Optionally, in the embodiment of the present invention, the first message is an SDF message in the NAN, and the first message carries the service information subscribed or issued by the first NAN device.
可选的,本发明实施例中,确定模块502用于接收所述第二NAN设备发送的第二消息,具体为:Optionally, in the embodiment of the present invention, the determining module 502 is configured to receive the second message sent by the second NAN device, specifically:
在所述发现窗口或所述第一时间窗口中接收所述第二消息。Receiving the second message in the discovery window or the first time window.
可选的,本发明实施例中,所述测距触发信息中包括测距原理指示信息、测距协议指示信息、测距要求指示信息、测距需求指示信息以及测距开启指示信息中的一种或任意几种;其中,Optionally, in the embodiment of the present invention, the ranging trigger information includes one of a ranging principle indication information, a ranging protocol indication information, a ranging requirement indication information, a ranging requirement indication information, and a ranging opening indication information. Kind or any of them; among them,
所述测距原理指示信息用于指示进行距离测量所依据的测量原理;The ranging principle indication information is used to indicate a measurement principle on which the distance measurement is performed;
所述测距协议指示信息用于指示进行距离测量所依据的测量协议;The ranging protocol indication information is used to indicate a measurement protocol on which the distance measurement is performed;
所述测距要求指示信息用于指示对所测量的距离所需要满足的参数的需求;The ranging requirement indication information is used to indicate a requirement for a parameter that needs to be met for the measured distance;
所述测距需求指示信息用于指示对满足所述服务信息的NAN设备的距离的需求;The ranging requirement indication information is used to indicate a requirement for a distance of a NAN device that satisfies the service information;
所述测距开启指示信息用于指示所述第二NAN设备开启测距功能。The ranging open indication information is used to instruct the second NAN device to enable the ranging function.
因第一NAN设备与图1流程中所述的方法中的第一NAN设备为同一设备,因此在装置部分未介绍的内容,可参考方法部分的描述。Since the first NAN device is the same device as the first NAN device in the method described in the flow of FIG. 1, the content not described in the device portion may be referred to the description of the method portion.
请参见图6,基于同一发明构思,本发明实施例提供另一种NAN设备,所述NAN设备可以是如前所述的第二NAN设备。所述NAN设备可以包括接收模块601和获取模块602。Referring to FIG. 6, based on the same inventive concept, an embodiment of the present invention provides another NAN device, which may be a second NAN device as described above. The NAN device may include a receiving module 601 and an obtaining module 602.
接收模块601,用于在DW中接收第一NAN设备发送的第一消息,所述第一消息中携带有用于触发所述NAN设备进行测距的测距触发信息,以及第一时间窗口的信息;所述发现窗口为NAN中用于进行服务发现的时间窗口,所述第一消息为用于进行服务发现的消息,所述第一时间窗口为用于进行测距的时间窗口;The receiving module 601 is configured to receive, in the DW, the first message sent by the first NAN device, where the first message carries the ranging trigger information for triggering the NAN device to perform ranging, and the information of the first time window. The discovery window is a time window for performing service discovery in the NAN, the first message is a message for performing service discovery, and the first time window is a time window for performing ranging;
获取模块602,用于向所述第一NAN设备发送第二消息,获得发送所述第二消息的第三时刻,所述第二消息用于表明所述NAN设备的测距能力,所
述第二消息为针对所述第一消息的响应消息;The obtaining module 602 is configured to send a second message to the first NAN device, to obtain a third time to send the second message, where the second message is used to indicate a ranging capability of the NAN device, where
The second message is a response message for the first message;
接收模块601,还用于接收所述第一NAN设备发送的第三消息,获得接收所述第三消息的第四时刻,根据所述第三时刻和所述第四时刻获得第二参数组信息;所述第二参数组信息用于获得所述第一NAN设备与所述NAN设备之间的距离,所述第三消息为针对所述第二消息的确认消息;The receiving module 601 is further configured to receive a third message sent by the first NAN device, obtain a fourth time to receive the third message, and obtain second parameter group information according to the third time and the fourth time The second parameter group information is used to obtain a distance between the first NAN device and the NAN device, and the third message is an acknowledgement message for the second message;
接收模块601,还用于在第一时间窗口中,接收所述第一NAN设备发送的第一参数组信息,根据所述第一参数组信息和所述第二参数组信息,获得所述第一NAN设备与所述NAN设备之间的距离;和/或,获取模块602,还用于在第一时间窗口中,向所述第一NAN设备发送所述第二参数组信息,以便所述第一NAN设备根据所述第二参数组信息和所述第一参数组信息获得所述第一NAN设备与所述NAN设备之间的距离;The receiving module 601 is further configured to receive the first parameter group information sent by the first NAN device in the first time window, and obtain the first parameter according to the first parameter group information and the second parameter group information. a distance between a NAN device and the NAN device; and/or an obtaining module 602, configured to send the second parameter group information to the first NAN device in a first time window, so that Obtaining, by the first NAN device, a distance between the first NAN device and the NAN device according to the second parameter group information and the first parameter group information;
其中,所述第一参数组信息为:所述第一NAN设备获得接收所述第二消息的第一时刻,以及获得发送所述第三消息的第二时刻,根据所述第一时刻和所述第二时刻获得的参数组信息,所述第一参数组信息用于获得所述第一NAN设备与所述NAN设备之间的距离。The first parameter group information is: the first time that the first NAN device obtains the second message, and the second time that the third message is sent, according to the first time and the The parameter group information obtained at the second moment is used to obtain a distance between the first NAN device and the NAN device.
可选的,本发明实施例中,所述第一消息为NAN中的SDF消息,所述第一消息中携带有所述第一NAN设备订阅或发布的服务信息。Optionally, in the embodiment of the present invention, the first message is an SDF message in the NAN, and the first message carries the service information subscribed or issued by the first NAN device.
可选的,本发明实施例中,获取模块602用于向所述第一NAN设备发送第二消息,具体为:Optionally, in the embodiment of the present invention, the acquiring module 602 is configured to send the second message to the first NAN device, specifically:
在所述发现窗口或所述第一时间窗口中向所述第一NAN设备发送所述第二消息。Transmitting the second message to the first NAN device in the discovery window or the first time window.
可选的,本发明实施例中,所述测距触发信息中包括测距原理指示信息、测距协议指示信息、测距要求指示信息、测距需求指示信息以及测距开启指示信息中的一种或任意几种;其中,Optionally, in the embodiment of the present invention, the ranging trigger information includes one of a ranging principle indication information, a ranging protocol indication information, a ranging requirement indication information, a ranging requirement indication information, and a ranging opening indication information. Kind or any of them; among them,
所述测距原理指示信息用于指示进行距离测量所依据的测量原理;The ranging principle indication information is used to indicate a measurement principle on which the distance measurement is performed;
所述测距协议指示信息用于指示进行距离测量所依据的测量协议;The ranging protocol indication information is used to indicate a measurement protocol on which the distance measurement is performed;
所述测距要求指示信息用于指示对所测量的距离所需要满足的参数的需
求;The ranging requirement indication information is used to indicate a requirement of a parameter that needs to be satisfied for the measured distance
begging;
所述测距需求指示信息用于指示对满足所述服务信息的NAN设备的距离的需求;The ranging requirement indication information is used to indicate a requirement for a distance of a NAN device that satisfies the service information;
所述测距开启指示信息用于指示所述第二NAN设备开启测距功能。The ranging open indication information is used to instruct the second NAN device to enable the ranging function.
因第二NAN设备与图2流程中所述的方法中的第二NAN设备为同一设备,因此在装置部分未介绍的内容,可参考方法部分的描述。Since the second NAN device is the same device as the second NAN device in the method described in the flow of FIG. 2, for the content not introduced in the device part, reference may be made to the description of the method part.
请参见图7,基于同一发明构思,本发明实施例提供一种NAN设备,所述NAN设备可以是如前所述的第一NAN设备。所述NAN设备可以包括连接到总线700的存储器701、处理器702和收发器703。Referring to FIG. 7, based on the same inventive concept, an embodiment of the present invention provides a NAN device, which may be a first NAN device as described above. The NAN device can include a memory 701, a processor 702, and a transceiver 703 that are coupled to the bus 700.
存储器701,用于存储处理器702执行任务所需的指令;The memory 701 is configured to store an instruction required by the processor 702 to perform a task;
收发器703,用于在发现窗口DW中发送第一消息,所述第一消息中携带有用于触发所述第二NAN设备进行测距的测距触发信息,以及第一时间窗口的信息;所述发现窗口为NAN中用于进行服务发现的时间窗口,所述第一消息为用于进行服务发现的消息,所述第一时间窗口为用于进行测距的时间窗口;及接收所述第二NAN设备发送的第二消息;The transceiver 703 is configured to send a first message in the discovery window DW, where the first message carries the ranging trigger information for triggering the second NAN device to perform ranging, and the information of the first time window; The discovery window is a time window for performing service discovery in the NAN, the first message is a message for performing service discovery, the first time window is a time window for performing ranging, and receiving the a second message sent by the second NAN device;
处理器702,用于执行所述指令,获得接收所述第二消息的第一时刻,并根据所述第二消息确定所述第二NAN设备的测距能力,所述第二消息为针对所述第一消息的响应消息;The processor 702 is configured to execute the instruction, obtain a first time to receive the second message, and determine a ranging capability of the second NAN device according to the second message, where the second message is for a response message describing the first message;
收发器703,还用于向所述第二NAN设备发送第三消息;The transceiver 703 is further configured to send a third message to the second NAN device.
处理器702,还用于获得发送所述第三消息的第二时刻,根据所述第一时刻和所述第二时刻获得第一参数组信息;所述第一参数组信息用于获得所述NAN设备与所述第二NAN设备之间的距离,所述第三消息为针对所述第二消息的确认消息;The processor 702 is further configured to obtain a second time when the third message is sent, and obtain first parameter group information according to the first time and the second time; the first parameter group information is used to obtain the a distance between the NAN device and the second NAN device, the third message being an acknowledgement message for the second message;
收发器703,还用于在所述第一时间窗口中,接收所述第二NAN设备发送的第二参数组信息,处理器702,还用于根据所述第一参数组信息和所述第二参数组信息,获得所述NAN设备与所述第二NAN设备之间的距离;和/或,收发器703,还用于在第一时间窗口中,向所述第二NAN设备发送所述
第一参数组信息,以便所述第二NAN设备根据所述第一参数组信息及所述第二参数组信息获得所述NAN设备与所述第二NAN设备之间的距离;The transceiver 703 is further configured to receive the second parameter group information sent by the second NAN device in the first time window, where the processor 702 is further configured to use the first parameter group information and the The second parameter group information is obtained, and the distance between the NAN device and the second NAN device is obtained; and/or the transceiver 703 is further configured to send the the NN device to the second NAN device in the first time window.
a first parameter group information, so that the second NAN device obtains a distance between the NAN device and the second NAN device according to the first parameter group information and the second parameter group information;
其中,所述第二参数组信息为:所述第二NAN设备获得发送所述第二消息的第三时刻,以及获得接收所述第三消息的第四时刻,根据所述第三时刻和所述第四时刻获得的参数组信息,所述第二参数组信息用于获得所述NAN设备与所述第二NAN设备之间的距离。The second parameter group information is: the second time when the second NAN device obtains the second message, and obtains a fourth time to receive the third message, according to the third moment and the The parameter group information obtained at the fourth time is used, and the second parameter group information is used to obtain a distance between the NAN device and the second NAN device.
可选的,本发明实施例中,所述第一消息为NAN中的SDF消息,所述第一消息中携带有所述第一NAN设备订阅或发布的服务信息。Optionally, in the embodiment of the present invention, the first message is an SDF message in the NAN, and the first message carries the service information subscribed or issued by the first NAN device.
可选的,本发明实施例中,收发器703用于接收所述第二NAN设备发送的第二消息,具体为:Optionally, in the embodiment of the present invention, the transceiver 703 is configured to receive the second message sent by the second NAN device, specifically:
在所述发现窗口或所述第一时间窗口中接收所述第二消息。Receiving the second message in the discovery window or the first time window.
可选的,本发明实施例中,所述测距触发信息中包括测距原理指示信息、测距协议指示信息、测距要求指示信息、测距需求指示信息以及测距开启指示信息中的一种或任意几种;其中,Optionally, in the embodiment of the present invention, the ranging trigger information includes one of a ranging principle indication information, a ranging protocol indication information, a ranging requirement indication information, a ranging requirement indication information, and a ranging opening indication information. Kind or any of them; among them,
所述测距原理指示信息用于指示进行距离测量所依据的测量原理;The ranging principle indication information is used to indicate a measurement principle on which the distance measurement is performed;
所述测距协议指示信息用于指示进行距离测量所依据的测量协议;The ranging protocol indication information is used to indicate a measurement protocol on which the distance measurement is performed;
所述测距要求指示信息用于指示对所测量的距离所需要满足的参数的需求;The ranging requirement indication information is used to indicate a requirement for a parameter that needs to be met for the measured distance;
所述测距需求指示信息用于指示对满足所述服务信息的NAN设备的距离的需求;The ranging requirement indication information is used to indicate a requirement for a distance of a NAN device that satisfies the service information;
所述测距开启指示信息用于指示所述第二NAN设备开启测距功能。The ranging open indication information is used to instruct the second NAN device to enable the ranging function.
因第一NAN设备与图1流程中所述的方法中的第一NAN设备为同一设备,因此在装置部分未介绍的内容,可参考方法部分的描述。Since the first NAN device is the same device as the first NAN device in the method described in the flow of FIG. 1, the content not described in the device portion may be referred to the description of the method portion.
请参见图8,基于同一发明构思,本发明实施例提供另一种NAN设备,所述NAN设备可以是如前所述的第二NAN设备。所述NAN设备可以包括连接到总线800的存储器801、处理器802和收发器803。Referring to FIG. 8, based on the same inventive concept, an embodiment of the present invention provides another NAN device, which may be a second NAN device as described above. The NAN device can include a memory 801, a processor 802, and a transceiver 803 that are coupled to bus 800.
存储器801,用于存储处理器802执行任务所需的指令;
The memory 801 is configured to store an instruction required by the processor 802 to perform a task;
收发器803,用于在DW中接收第一NAN设备发送的第一消息,所述第一消息中携带有用于触发所述NAN设备进行测距的测距触发信息,以及第一时间窗口的信息;所述发现窗口为NAN中用于进行服务发现的时间窗口,所述第一消息为用于进行服务发现的消息,所述第一时间窗口为用于进行测距的时间窗口;及向所述第一NAN设备发送第二消息;The transceiver 803 is configured to receive, in the DW, a first message sent by the first NAN device, where the first message carries ranging trigger information for triggering the NAN device to perform ranging, and information of the first time window. The discovery window is a time window for performing service discovery in the NAN, the first message is a message for performing service discovery, and the first time window is a time window for performing ranging; The first NAN device sends a second message;
处理器802,用于执行所述指令,获得发送所述第二消息的第三时刻,所述第二消息用于表明所述NAN设备的测距能力,所述第二消息为针对所述第一消息的响应消息;The processor 802 is configured to execute the instruction, obtain a third moment to send the second message, where the second message is used to indicate ranging capability of the NAN device, and the second message is for the first a response message to a message;
收发器803,还用于接收所述第一NAN设备发送的第三消息;The transceiver 803 is further configured to receive a third message sent by the first NAN device;
处理器802,还用于获得接收所述第三消息的第四时刻,根据所述第三时刻和所述第四时刻获得第二参数组信息;所述第二参数组信息用于获得所述第一NAN设备与所述NAN设备之间的距离,所述第三消息为针对所述第二消息的确认消息;The processor 802 is further configured to obtain a fourth moment to receive the third message, obtain second parameter group information according to the third moment and the fourth moment, where the second parameter group information is used to obtain the a distance between the first NAN device and the NAN device, the third message being an acknowledgement message for the second message;
收发器803,还用于在第一时间窗口中,接收所述第一NAN设备发送的第一参数组信息,处理器802,还用于根据所述第一参数组信息和所述第二参数组信息,获得所述第一NAN设备与所述NAN设备之间的距离;和/或,收发器803,还用于在第一时间窗口中,向所述第一NAN设备发送所述第二参数组信息,以便所述第一NAN设备根据所述第二参数组信息和所述第一参数组信息获得所述第一NAN设备与所述NAN设备之间的距离;The transceiver 803 is further configured to receive the first parameter group information sent by the first NAN device in a first time window, where the processor 802 is further configured to use, according to the first parameter group information and the second parameter Group information, obtaining a distance between the first NAN device and the NAN device; and/or, the transceiver 803 is further configured to send the second to the first NAN device in a first time window Parameter group information, so that the first NAN device obtains a distance between the first NAN device and the NAN device according to the second parameter group information and the first parameter group information;
其中,所述第一参数组信息为:所述第一NAN设备获得接收所述第二消息的第一时刻,以及获得发送所述第三消息的第二时刻,根据所述第一时刻和所述第二时刻获得的参数组信息,所述第一参数组信息用于获得所述第一NAN设备与所述NAN设备之间的距离。The first parameter group information is: the first time that the first NAN device obtains the second message, and the second time that the third message is sent, according to the first time and the The parameter group information obtained at the second moment is used to obtain a distance between the first NAN device and the NAN device.
可选的,本发明实施例中,所述第一消息为NAN中的SDF消息,所述第一消息中携带有所述第一NAN设备订阅或发布的服务信息。Optionally, in the embodiment of the present invention, the first message is an SDF message in the NAN, and the first message carries the service information subscribed or issued by the first NAN device.
可选的,本发明实施例中,收发器803用于向所述第一NAN设备发送第二消息,具体为:
Optionally, in the embodiment of the present invention, the transceiver 803 is configured to send the second message to the first NAN device, specifically:
在所述发现窗口或所述第一时间窗口中向所述第一NAN设备发送所述第二消息。Transmitting the second message to the first NAN device in the discovery window or the first time window.
可选的,本发明实施例中,所述测距触发信息中包括测距原理指示信息、测距协议指示信息、测距要求指示信息、测距需求指示信息以及测距开启指示信息中的一种或任意几种;其中,Optionally, in the embodiment of the present invention, the ranging trigger information includes one of a ranging principle indication information, a ranging protocol indication information, a ranging requirement indication information, a ranging requirement indication information, and a ranging opening indication information. Kind or any of them; among them,
所述测距原理指示信息用于指示进行距离测量所依据的测量原理;The ranging principle indication information is used to indicate a measurement principle on which the distance measurement is performed;
所述测距协议指示信息用于指示进行距离测量所依据的测量协议;The ranging protocol indication information is used to indicate a measurement protocol on which the distance measurement is performed;
所述测距要求指示信息用于指示对所测量的距离所需要满足的参数的需求;The ranging requirement indication information is used to indicate a requirement for a parameter that needs to be met for the measured distance;
所述测距需求指示信息用于指示对满足所述服务信息的NAN设备的距离的需求;The ranging requirement indication information is used to indicate a requirement for a distance of a NAN device that satisfies the service information;
所述测距开启指示信息用于指示所述第二NAN设备开启测距功能。The ranging open indication information is used to instruct the second NAN device to enable the ranging function.
因第二NAN设备与图2流程中所述的方法中的第二NAN设备为同一设备,因此在装置部分未介绍的内容,可参考方法部分的描述。Since the second NAN device is the same device as the second NAN device in the method described in the flow of FIG. 2, for the content not introduced in the device part, reference may be made to the description of the method part.
本发明实施例中,第一NAN设备若想要测量与第二NAN设备之间的距离,则第一NAN设备可以将测距触发信息携带在第一消息中,从而可以将第一消息在DW中进行发送,而后续若第二NAN设备支持测距,则第二NAN设备会在第一时间窗口中向第一NAN设备发送第二参数组信息,从而第一NAN设备就能够获得第一NAN设备与第二NAN设备之间的距离,或者第一NAN设备也可以将获得的第一参数组信息发送给第二NAN设备,以使第二NAN设备获得第一NAN设备和第二NAN设备之间的距离。例如第一时间窗口是服务窗口,即本发明实施例中,在DW中就能够进行测距触发,而无需等到DW完毕后再专门用一个消息进行测距触发,节省了测距所需的时间,提高了测距效率。In the embodiment of the present invention, if the first NAN device wants to measure the distance between the second NAN device and the second NAN device, the first NAN device may carry the ranging trigger information in the first message, so that the first message may be in the DW. Transmitting, and if the second NAN device supports ranging, the second NAN device sends the second parameter group information to the first NAN device in the first time window, so that the first NAN device can obtain the first NAN. The distance between the device and the second NAN device, or the first NAN device may also send the obtained first parameter group information to the second NAN device, so that the second NAN device obtains the first NAN device and the second NAN device. The distance between them. For example, the first time window is a service window, that is, in the embodiment of the present invention, the ranging trigger can be performed in the DW without waiting for the DW to complete the measurement trigger with a message, thereby saving the time required for the ranging. , improve the efficiency of ranging.
并且,本发明实施例中可以将测距触发信息携带在第一消息中发送,无需像现有技术中那样再专门用一个消息来发送测距触发信息,减少了信息的交互量,节省网络资源。
In addition, in the embodiment of the present invention, the ranging trigger information can be carried in the first message, and the measurement trigger information is not required to be sent by using a message as in the prior art, thereby reducing the amount of information interaction and saving network resources. .
所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,仅以上述各功能模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能模块完成,即将装置的内部结构划分成不同的功能模块,以完成以上描述的全部或者部分功能。上述描述的系统,装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。It will be clearly understood by those skilled in the art that for the convenience and brevity of the description, only the division of each functional module described above is exemplified. In practical applications, the above function assignment can be completed by different functional modules as needed. The internal structure of the device is divided into different functional modules to perform all or part of the functions described above. For the specific working process of the system, the device and the unit described above, reference may be made to the corresponding process in the foregoing method embodiments, and details are not described herein again.
在本申请所提供的几个实施例中,应该理解到,所揭露的系统,装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述模块或单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。In the several embodiments provided by the present application, it should be understood that the disclosed system, apparatus, and method may be implemented in other manners. For example, the device embodiments described above are merely illustrative. For example, the division of the modules or units is only a logical function division. In actual implementation, there may be another division manner, for example, multiple units or components may be used. Combinations can be integrated into another system, or some features can be ignored or not executed. In addition, the mutual coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interface, device or unit, and may be in an electrical, mechanical or other form.
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of the embodiment.
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above integrated unit can be implemented in the form of hardware or in the form of a software functional unit.
所述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)或处理器(processor)执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存
储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、磁碟或者光盘等各种可以存储程序代码的介质。The integrated unit, if implemented in the form of a software functional unit and sold or used as a standalone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application, in essence or the contribution to the prior art, or all or part of the technical solution may be embodied in the form of a software product stored in a storage medium. A number of instructions are included to cause a computer device (which may be a personal computer, server, or network device, etc.) or a processor to perform all or part of the steps of the methods described in various embodiments of the present application. The foregoing storage medium includes: a U disk, a mobile hard disk, and a read-only memory.
A medium that can store program code, such as a ROM (Read-Only Memory), a random access memory (RAM), a magnetic disk, or an optical disk.
以上所述,以上实施例仅用以对本申请的技术方案进行了详细介绍,但以上实施例的说明只是用于帮助理解本发明的方法及其核心思想,不应理解为对本发明的限制。本技术领域的技术人员在本发明揭露的技术范围内,可轻易想到的变化或替换,都应涵盖在本发明的保护范围之内。
The above embodiments are only used to describe the technical solutions of the present application in detail, but the description of the above embodiments is only for helping to understand the method and the core idea of the present invention, and should not be construed as limiting the present invention. Those skilled in the art will be able to devise variations or alternatives within the scope of the present invention within the scope of the present invention.
Claims (24)
- 一种邻近感知网络NAN设备之间的距离测量方法,其特征在于,包括:A method for measuring distance between neighboring sensing network NAN devices, comprising:第一NAN设备在发现窗口DW中发送第一消息,所述第一消息中携带有用于触发所述第二NAN设备进行测距的测距触发信息,以及第一时间窗口的信息;所述发现窗口为NAN中用于进行服务发现的时间窗口,所述第一消息为用于进行服务发现的消息,所述第一时间窗口为用于进行测距的时间窗口;The first NAN device sends a first message in the discovery window DW, where the first message carries ranging trigger information for triggering the second NAN device to perform ranging, and information of the first time window; the discovery The window is a time window for performing service discovery in the NAN, the first message is a message for performing service discovery, and the first time window is a time window for performing ranging;所述第一NAN设备接收所述第二NAN设备发送的第二消息,获得接收所述第二消息的第一时刻,并根据所述第二消息确定所述第二NAN设备的测距能力,所述第二消息为针对所述第一消息的响应消息;Receiving, by the first NAN device, the second message sent by the second NAN device, obtaining a first time to receive the second message, and determining a ranging capability of the second NAN device according to the second message, The second message is a response message for the first message;所述第一NAN设备向所述第二NAN设备发送第三消息,获得发送所述第三消息的第二时刻,根据所述第一时刻和所述第二时刻获得第一参数组信息;所述第一参数组信息用于获得所述第一NAN设备与所述第二NAN设备之间的距离,所述第三消息为针对所述第二消息的确认消息;The first NAN device sends a third message to the second NAN device, obtains a second time to send the third message, and obtains first parameter group information according to the first time and the second time; The first parameter group information is used to obtain a distance between the first NAN device and the second NAN device, where the third message is an acknowledgement message for the second message;所述第一NAN设备在所述第一时间窗口中,接收所述第二NAN设备发送的第二参数组信息,所述第一NAN设备根据所述第一参数组信息和所述第二参数组信息,获得所述第一NAN设备与所述第二NAN设备之间的距离;和/或,所述第一NAN设备在第一时间窗口中,向所述第二NAN设备发送所述第一参数组信息,以便所述第二NAN设备根据所述第一参数组信息及所述第二参数组信息获得所述第一NAN设备与所述第二NAN设备之间的距离;Receiving, by the first NAN device, the second parameter group information sent by the second NAN device in the first time window, where the first NAN device is configured according to the first parameter group information and the second parameter Group information, obtaining a distance between the first NAN device and the second NAN device; and/or, the first NAN device transmitting the first to the second NAN device in a first time window a parameter group information, so that the second NAN device obtains a distance between the first NAN device and the second NAN device according to the first parameter group information and the second parameter group information;其中,所述第二参数组信息为:所述第二NAN设备获得发送所述第二消息的第三时刻,以及获得接收所述第三消息的第四时刻,根据所述第三时刻和所述第四时刻获得的参数组信息,所述第二参数组信息用于获得所述第一NAN设备与所述第二NAN设备之间的距离。The second parameter group information is: the second time when the second NAN device obtains the second message, and obtains a fourth time to receive the third message, according to the third moment and the The parameter group information obtained at the fourth time, the second parameter group information is used to obtain a distance between the first NAN device and the second NAN device.
- 如权利要求2所述的方法,其特征在于,所述第一消息为NAN中的服务发现帧SDF消息,所述第一消息中携带有所述第一NAN设备订阅或发 布的服务信息。The method according to claim 2, wherein the first message is a service discovery frame SDF message in the NAN, and the first message carries the first NAN device subscription or Cloth service information.
- 如权利要求1或2所述的方法,其特征在于,所述第一NAN设备接收所述第二NAN设备发送的第二消息,包括:The method of claim 1 or 2, wherein the receiving, by the first NAN device, the second message sent by the second NAN device comprises:所述第一NAN设备在所述发现窗口或所述第一时间窗口中接收所述第二消息。The first NAN device receives the second message in the discovery window or the first time window.
- 如权利要求1-3任一所述的方法,其特征在于,所述测距触发信息中包括测距原理指示信息、测距协议指示信息、测距要求指示信息、测距需求指示信息以及测距开启指示信息中的一种或任意几种;其中,The method according to any one of claims 1-3, wherein the ranging trigger information includes ranging principle indication information, ranging protocol indication information, ranging request indication information, ranging demand indication information, and measurement. One or any of the opening indication information; wherein所述测距原理指示信息用于指示进行距离测量所依据的测量原理;The ranging principle indication information is used to indicate a measurement principle on which the distance measurement is performed;所述测距协议指示信息用于指示进行距离测量所依据的测量协议;The ranging protocol indication information is used to indicate a measurement protocol on which the distance measurement is performed;所述测距要求指示信息用于指示对所测量的距离所需要满足的参数的需求;The ranging requirement indication information is used to indicate a requirement for a parameter that needs to be met for the measured distance;所述测距需求指示信息用于指示对满足所述服务信息的NAN设备的距离的需求;The ranging requirement indication information is used to indicate a requirement for a distance of a NAN device that satisfies the service information;所述测距开启指示信息用于指示所述第二NAN设备开启测距功能。The ranging open indication information is used to instruct the second NAN device to enable the ranging function.
- 一种邻近感知网络NAN设备之间的距离测量方法,其特征在于,包括:A method for measuring distance between neighboring sensing network NAN devices, comprising:第二NAN设备在发现窗口DW中接收第一NAN设备发送的第一消息,所述第一消息中携带有用于触发所述第二NAN设备进行测距的测距触发信息,以及第一时间窗口的信息;所述发现窗口为NAN中用于进行服务发现的时间窗口,所述第一消息为用于进行服务发现的消息,所述第一时间窗口为用于进行测距的时间窗口;The second NAN device receives the first message sent by the first NAN device in the discovery window DW, where the first message carries the ranging trigger information for triggering the second NAN device to perform ranging, and the first time window. The information window is a time window for performing service discovery in the NAN, the first message is a message for performing service discovery, and the first time window is a time window for performing ranging;所述第二NAN设备向所述第一NAN设备发送第二消息,获得发送所述第二消息的第三时刻,所述第二消息用于表明所述第二NAN设备的测距能力,所述第二消息为针对所述第一消息的响应消息;The second NAN device sends a second message to the first NAN device to obtain a third time to send the second message, where the second message is used to indicate the ranging capability of the second NAN device. The second message is a response message for the first message;所述第二NAN设备接收所述第一NAN设备发送的第三消息,获得接收所述第三消息的第四时刻,根据所述第三时刻和所述第四时刻获得第二参数 组信息;所述第二参数组信息用于获得所述第一NAN设备与所述第二NAN设备之间的距离,所述第三消息为针对所述第二消息的确认消息;Receiving, by the second NAN device, the third message sent by the first NAN device, obtaining a fourth time to receive the third message, and obtaining a second parameter according to the third time and the fourth time Group information; the second parameter group information is used to obtain a distance between the first NAN device and the second NAN device, and the third message is an acknowledgement message for the second message;所述第二NAN设备在第一时间窗口中,接收所述第一NAN设备发送的第一参数组信息,所述第二NAN设备根据所述第一参数组信息和所述第二参数组信息,获得所述第一NAN设备与所述第二NAN设备之间的距离;和/或,所述第二NAN设备在第一时间窗口中,向所述第一NAN设备发送所述第二参数组信息,以便所述第一NAN设备根据所述第二参数组信息和所述第一参数组信息获得所述第一NAN设备与所述第二NAN设备之间的距离;Receiving, by the second NAN device, the first parameter group information sent by the first NAN device in the first time window, where the second NAN device is configured according to the first parameter group information and the second parameter group information Obtaining a distance between the first NAN device and the second NAN device; and/or, the second NAN device transmitting the second parameter to the first NAN device in a first time window Group information, so that the first NAN device obtains a distance between the first NAN device and the second NAN device according to the second parameter group information and the first parameter group information;其中,所述第一参数组信息为:所述第一NAN设备获得接收所述第二消息的第一时刻,以及获得发送所述第三消息的第二时刻,根据所述第一时刻和所述第二时刻获得的参数组信息,所述第一参数组信息用于获得所述第一NAN设备与所述第二NAN设备之间的距离。The first parameter group information is: the first time that the first NAN device obtains the second message, and the second time that the third message is sent, according to the first time and the The parameter group information obtained at the second moment is used to obtain a distance between the first NAN device and the second NAN device.
- 如权利要求5所述的方法,其特征在于,所述第一消息为NAN中的服务发现帧SDF消息,所述第一消息中携带有所述第一NAN设备订阅或发布的服务信息。The method according to claim 5, wherein the first message is a service discovery frame SDF message in the NAN, and the first message carries service information subscribed or published by the first NAN device.
- 如权利要求5或6所述的方法,其特征在于,所述第二NAN设备向所述第一NAN设备发送第二消息,包括:The method of claim 5 or 6, wherein the sending, by the second NAN device, the second message to the first NAN device comprises:所述第二NAN设备在所述发现窗口或所述第一时间窗口中向所述第一NAN设备发送所述第二消息。The second NAN device sends the second message to the first NAN device in the discovery window or the first time window.
- 如权利要求5-7任一所述的方法,其特征在于,所述测距触发信息中包括测距原理指示信息、测距协议指示信息、测距要求指示信息、测距需求指示信息以及测距开启指示信息中的一种或任意几种;其中,The method according to any one of claims 5-7, wherein the ranging trigger information includes ranging principle indication information, ranging protocol indication information, ranging request indication information, ranging demand indication information, and measurement. One or any of the opening indication information; wherein所述测距原理指示信息用于指示进行距离测量所依据的测量原理;The ranging principle indication information is used to indicate a measurement principle on which the distance measurement is performed;所述测距协议指示信息用于指示进行距离测量所依据的测量协议;The ranging protocol indication information is used to indicate a measurement protocol on which the distance measurement is performed;所述测距要求指示信息用于指示对所测量的距离所需要满足的参数的需求;The ranging requirement indication information is used to indicate a requirement for a parameter that needs to be met for the measured distance;所述测距需求指示信息用于指示对满足所述服务信息的NAN设备的距 离的需求;The ranging demand indication information is used to indicate a distance to a NAN device that satisfies the service information Departure demand;所述测距开启指示信息用于指示所述第二NAN设备开启测距功能。The ranging open indication information is used to instruct the second NAN device to enable the ranging function.
- 一种邻近感知网络NAN设备,其特征在于,包括:A proximity sensing network NAN device, comprising:发送模块,用于在发现窗口DW中发送第一消息,所述第一消息中携带有用于触发所述第二NAN设备进行测距的测距触发信息,以及第一时间窗口的信息;所述发现窗口为NAN中用于进行服务发现的时间窗口,所述第一消息为用于进行服务发现的消息,所述第一时间窗口为用于进行测距的时间窗口;a sending module, configured to send a first message in the discovery window DW, where the first message carries ranging trigger information for triggering the second NAN device to perform ranging, and information of the first time window; The discovery window is a time window for performing service discovery in the NAN, the first message is a message for performing service discovery, and the first time window is a time window for performing ranging;确定模块,用于接收所述第二NAN设备发送的第二消息,获得接收所述第二消息的第一时刻,并根据所述第二消息确定所述第二NAN设备的测距能力,所述第二消息为针对所述第一消息的响应消息;a determining module, configured to receive a second message sent by the second NAN device, obtain a first time to receive the second message, and determine a ranging capability of the second NAN device according to the second message, where The second message is a response message for the first message;所述发送模块,还用于向所述第二NAN设备发送第三消息,获得发送所述第三消息的第二时刻,根据所述第一时刻和所述第二时刻获得第一参数组信息;所述第一参数组信息用于获得所述NAN设备与所述第二NAN设备之间的距离,所述第三消息为针对所述第二消息的确认消息;The sending module is further configured to send a third message to the second NAN device, obtain a second time to send the third message, and obtain first parameter group information according to the first time and the second time The first parameter group information is used to obtain a distance between the NAN device and the second NAN device, and the third message is an acknowledgement message for the second message;所述确定模块,还用于在所述第一时间窗口中,接收所述第二NAN设备发送的第二参数组信息,根据所述第一参数组信息和所述第二参数组信息,获得所述NAN设备与所述第二NAN设备之间的距离;和/或,所述发送模块,还用于在第一时间窗口中,向所述第二NAN设备发送所述第一参数组信息,以便所述第二NAN设备根据所述第一参数组信息及所述第二参数组信息获得所述NAN设备与所述第二NAN设备之间的距离;The determining module is further configured to receive the second parameter group information sent by the second NAN device in the first time window, and obtain the second parameter group information according to the first parameter group information and the second parameter group information. a distance between the NAN device and the second NAN device; and/or the sending module is further configured to send the first parameter group information to the second NAN device in a first time window The second NAN device obtains a distance between the NAN device and the second NAN device according to the first parameter group information and the second parameter group information;其中,所述第二参数组信息为:所述第二NAN设备获得发送所述第二消息的第三时刻,以及获得接收所述第三消息的第四时刻,根据所述第三时刻和所述第四时刻获得的参数组信息,所述第二参数组信息用于获得所述NAN设备与所述第二NAN设备之间的距离。The second parameter group information is: the second time when the second NAN device obtains the second message, and obtains a fourth time to receive the third message, according to the third moment and the The parameter group information obtained at the fourth time is used, and the second parameter group information is used to obtain a distance between the NAN device and the second NAN device.
- 如权利要求9所述的NAN设备,其特征在于,所述第一消息为NAN中的服务发现帧SDF消息,所述第一消息中携带有所述第一NAN设备订阅 或发布的服务信息。The NAN device according to claim 9, wherein the first message is a service discovery frame SDF message in the NAN, and the first message carries the first NAN device subscription. Or published service information.
- 如权利要求9或10所述的NAN设备,其特征在于,所述确定模块用于接收所述第二NAN设备发送的第二消息,具体为:The NAN device according to claim 9 or 10, wherein the determining module is configured to receive the second message sent by the second NAN device, specifically:在所述发现窗口或所述第一时间窗口中接收所述第二消息。Receiving the second message in the discovery window or the first time window.
- 如权利要求9-11任一所述的NAN设备,其特征在于,所述测距触发信息中包括测距原理指示信息、测距协议指示信息、测距要求指示信息、测距需求指示信息以及测距开启指示信息中的一种或任意几种;其中,The NAN device according to any one of claims 9-11, wherein the ranging trigger information includes ranging principle indication information, ranging protocol indication information, ranging request indication information, ranging demand indication information, and One or any of a range opening indication information; wherein所述测距原理指示信息用于指示进行距离测量所依据的测量原理;The ranging principle indication information is used to indicate a measurement principle on which the distance measurement is performed;所述测距协议指示信息用于指示进行距离测量所依据的测量协议;The ranging protocol indication information is used to indicate a measurement protocol on which the distance measurement is performed;所述测距要求指示信息用于指示对所测量的距离所需要满足的参数的需求;The ranging requirement indication information is used to indicate a requirement for a parameter that needs to be met for the measured distance;所述测距需求指示信息用于指示对满足所述服务信息的NAN设备的距离的需求;The ranging requirement indication information is used to indicate a requirement for a distance of a NAN device that satisfies the service information;所述测距开启指示信息用于指示所述第二NAN设备开启测距功能。The ranging open indication information is used to instruct the second NAN device to enable the ranging function.
- 一种邻近感知网络NAN设备,其特征在于,包括:A proximity sensing network NAN device, comprising:接收模块,用于在发现窗口DW中接收第一NAN设备发送的第一消息,所述第一消息中携带有用于触发所述NAN设备进行测距的测距触发信息,以及第一时间窗口的信息;所述发现窗口为NAN中用于进行服务发现的时间窗口,所述第一消息为用于进行服务发现的消息,所述第一时间窗口为用于进行测距的时间窗口;a receiving module, configured to receive, in a discovery window DW, a first message sent by the first NAN device, where the first message carries ranging trigger information for triggering the NAN device to perform ranging, and a first time window. Information: the discovery window is a time window for performing service discovery in the NAN, the first message is a message for performing service discovery, and the first time window is a time window for performing ranging;获取模块,用于向所述第一NAN设备发送第二消息,获得发送所述第二消息的第三时刻,所述第二消息用于表明所述NAN设备的测距能力,所述第二消息为针对所述第一消息的响应消息;An acquiring module, configured to send a second message to the first NAN device, to obtain a third moment to send the second message, where the second message is used to indicate a ranging capability of the NAN device, and the second The message is a response message for the first message;所述接收模块,还用于接收所述第一NAN设备发送的第三消息,获得接收所述第三消息的第四时刻,根据所述第三时刻和所述第四时刻获得第二参数组信息;所述第二参数组信息用于获得所述第一NAN设备与所述NAN设备之间的距离,所述第三消息为针对所述第二消息的确认消息; The receiving module is further configured to receive a third message sent by the first NAN device, obtain a fourth time to receive the third message, and obtain a second parameter group according to the third time and the fourth time The second parameter group information is used to obtain a distance between the first NAN device and the NAN device, where the third message is an acknowledgement message for the second message;所述接收模块,还用于在第一时间窗口中,接收所述第一NAN设备发送的第一参数组信息,根据所述第一参数组信息和所述第二参数组信息,获得所述第一NAN设备与所述NAN设备之间的距离;和/或,所述获取模块,还用于在第一时间窗口中,向所述第一NAN设备发送所述第二参数组信息,以便所述第一NAN设备根据所述第二参数组信息和所述第一参数组信息获得所述第一NAN设备与所述NAN设备之间的距离;The receiving module is further configured to receive the first parameter group information sent by the first NAN device in a first time window, and obtain the foregoing according to the first parameter group information and the second parameter group information. a distance between the first NAN device and the NAN device; and/or the acquiring module is further configured to send the second parameter group information to the first NAN device in a first time window, so that Obtaining, by the first NAN device, a distance between the first NAN device and the NAN device according to the second parameter group information and the first parameter group information;其中,所述第一参数组信息为:所述第一NAN设备获得接收所述第二消息的第一时刻,以及获得发送所述第三消息的第二时刻,根据所述第一时刻和所述第二时刻获得的参数组信息,所述第一参数组信息用于获得所述第一NAN设备与所述NAN设备之间的距离。The first parameter group information is: the first time that the first NAN device obtains the second message, and the second time that the third message is sent, according to the first time and the The parameter group information obtained at the second moment is used to obtain a distance between the first NAN device and the NAN device.
- 如权利要求13所述的NAN设备,其特征在于,所述第一消息为NAN中的服务发现帧SDF消息,所述第一消息中携带有所述第一NAN设备订阅或发布的服务信息。The NAN device according to claim 13, wherein the first message is a service discovery frame SDF message in the NAN, and the first message carries service information subscribed or published by the first NAN device.
- 如权利要求13或14所述的NAN设备,其特征在于,所述获取模块用于向所述第一NAN设备发送第二消息,具体为:The NAN device according to claim 13 or 14, wherein the obtaining module is configured to send a second message to the first NAN device, specifically:在所述发现窗口或所述第一时间窗口中向所述第一NAN设备发送所述第二消息。Transmitting the second message to the first NAN device in the discovery window or the first time window.
- 如权利要求13-15任一所述的NAN设备,其特征在于,所述测距触发信息中包括测距原理指示信息、测距协议指示信息、测距要求指示信息、测距需求指示信息以及测距开启指示信息中的一种或任意几种;其中,The NAN device according to any one of claims 13-15, wherein the ranging trigger information includes ranging principle indication information, ranging protocol indication information, ranging request indication information, ranging demand indication information, and One or any of a range opening indication information; wherein所述测距原理指示信息用于指示进行距离测量所依据的测量原理;The ranging principle indication information is used to indicate a measurement principle on which the distance measurement is performed;所述测距协议指示信息用于指示进行距离测量所依据的测量协议;The ranging protocol indication information is used to indicate a measurement protocol on which the distance measurement is performed;所述测距要求指示信息用于指示对所测量的距离所需要满足的参数的需求;The ranging requirement indication information is used to indicate a requirement for a parameter that needs to be met for the measured distance;所述测距需求指示信息用于指示对满足所述服务信息的NAN设备的距离的需求;The ranging requirement indication information is used to indicate a requirement for a distance of a NAN device that satisfies the service information;所述测距开启指示信息用于指示所述第二NAN设备开启测距功能。 The ranging open indication information is used to instruct the second NAN device to enable the ranging function.
- 一种邻近感知网络NAN设备,其特征在于,包括连接到同一总线的存储器、处理器和收发器;A proximity aware network NAN device, comprising: a memory, a processor and a transceiver connected to the same bus;所述存储器,用于存储指令;The memory is configured to store an instruction;所述收发器,用于在发现窗口DW中发送第一消息,所述第一消息中携带有用于触发所述第二NAN设备进行测距的测距触发信息,以及第一时间窗口的信息;所述发现窗口为NAN中用于进行服务发现的时间窗口,所述第一消息为用于进行服务发现的消息,所述第一时间窗口为用于进行测距的时间窗口;及接收所述第二NAN设备发送的第二消息;The transceiver is configured to send a first message in the discovery window DW, where the first message carries ranging trigger information for triggering the second NAN device to perform ranging, and information of the first time window; The discovery window is a time window for performing service discovery in the NAN, the first message is a message for performing service discovery, the first time window is a time window for performing ranging, and receiving the a second message sent by the second NAN device;所述处理器,用于执行所述指令,获得接收所述第二消息的第一时刻,并根据所述第二消息确定所述第二NAN设备的测距能力,所述第二消息为针对所述第一消息的响应消息;The processor is configured to execute the instruction, obtain a first time to receive the second message, and determine a ranging capability of the second NAN device according to the second message, where the second message is a response message of the first message;所述收发器,还用于向所述第二NAN设备发送第三消息;The transceiver is further configured to send a third message to the second NAN device;所述处理器,还用于获得发送所述第三消息的第二时刻,根据所述第一时刻和所述第二时刻获得第一参数组信息;所述第一参数组信息用于获得所述NAN设备与所述第二NAN设备之间的距离,所述第三消息为针对所述第二消息的确认消息;The processor is further configured to obtain a second time when the third message is sent, and obtain first parameter group information according to the first time and the second time; the first parameter group information is used to obtain a Defining a distance between the NAN device and the second NAN device, where the third message is an acknowledgement message for the second message;所述收发器,还用于在所述第一时间窗口中,接收所述第二NAN设备发送的第二参数组信息,所述处理器,还用于根据所述第一参数组信息和所述第二参数组信息,获得所述NAN设备与所述第二NAN设备之间的距离;和/或,所述收发器,还用于在第一时间窗口中,向所述第二NAN设备发送所述第一参数组信息,以便所述第二NAN设备根据所述第一参数组信息及所述第二参数组信息获得所述NAN设备与所述第二NAN设备之间的距离;The transceiver is further configured to receive the second parameter group information that is sent by the second NAN device in the first time window, where the processor is further configured to use the first parameter group information and the The second parameter group information is obtained, obtaining a distance between the NAN device and the second NAN device; and/or the transceiver is further configured to, in the first time window, to the second NAN device Transmitting the first parameter group information, so that the second NAN device obtains a distance between the NAN device and the second NAN device according to the first parameter group information and the second parameter group information;其中,所述第二参数组信息为:所述第二NAN设备获得发送所述第二消息的第三时刻,以及获得接收所述第三消息的第四时刻,根据所述第三时刻和所述第四时刻获得的参数组信息,所述第二参数组信息用于获得所述NAN设备与所述第二NAN设备之间的距离。The second parameter group information is: the second time when the second NAN device obtains the second message, and obtains a fourth time to receive the third message, according to the third moment and the The parameter group information obtained at the fourth time is used, and the second parameter group information is used to obtain a distance between the NAN device and the second NAN device.
- 如权利要求17所述的NAN设备,其特征在于,所述第一消息为NAN 中的服务发现帧SDF消息,所述第一消息中携带有所述第一NAN设备订阅或发布的服务信息。The NAN device according to claim 17, wherein said first message is NAN The service discovery frame SDF message carries the service information subscribed or issued by the first NAN device.
- 如权利要求17或18所述的NAN设备,其特征在于,所述收发器用于接收所述第二NAN设备发送的第二消息,具体为:The NAN device according to claim 17 or 18, wherein the transceiver is configured to receive the second message sent by the second NAN device, specifically:在所述发现窗口或所述第一时间窗口中接收所述第二消息。Receiving the second message in the discovery window or the first time window.
- 如权利要求17-19任一所述的NAN设备,其特征在于,所述测距触发信息中包括测距原理指示信息、测距协议指示信息、测距要求指示信息、测距需求指示信息以及测距开启指示信息中的一种或任意几种;其中,The NAN device according to any one of claims 17 to 19, wherein the ranging trigger information includes ranging principle indication information, ranging protocol indication information, ranging request indication information, ranging demand indication information, and One or any of a range opening indication information; wherein所述测距原理指示信息用于指示进行距离测量所依据的测量原理;The ranging principle indication information is used to indicate a measurement principle on which the distance measurement is performed;所述测距协议指示信息用于指示进行距离测量所依据的测量协议;The ranging protocol indication information is used to indicate a measurement protocol on which the distance measurement is performed;所述测距要求指示信息用于指示对所测量的距离所需要满足的参数的需求;The ranging requirement indication information is used to indicate a requirement for a parameter that needs to be met for the measured distance;所述测距需求指示信息用于指示对满足所述服务信息的NAN设备的距离的需求;The ranging requirement indication information is used to indicate a requirement for a distance of a NAN device that satisfies the service information;所述测距开启指示信息用于指示所述第二NAN设备开启测距功能。The ranging open indication information is used to instruct the second NAN device to enable the ranging function.
- 一种邻近感知网络NAN设备,其特征在于,包括连接到同一总线的存储器、处理器和收发器;A proximity aware network NAN device, comprising: a memory, a processor and a transceiver connected to the same bus;所述存储器,用于存储指令;The memory is configured to store an instruction;所述收发器,用于在发现窗口DW中接收第一NAN设备发送的第一消息,所述第一消息中携带有用于触发所述NAN设备进行测距的测距触发信息,以及第一时间窗口的信息;所述发现窗口为NAN中用于进行服务发现的时间窗口,所述第一消息为用于进行服务发现的消息,所述第一时间窗口为用于进行测距的时间窗口;及向所述第一NAN设备发送第二消息;The transceiver is configured to receive, in a discovery window DW, a first message sent by a first NAN device, where the first message carries a ranging trigger information for triggering the NAN device to perform ranging, and a first time Information of the window; the discovery window is a time window for performing service discovery in the NAN, the first message is a message for performing service discovery, and the first time window is a time window for performing ranging; And sending a second message to the first NAN device;所述处理器,用于执行所述指令,获得发送所述第二消息的第三时刻,所述第二消息用于表明所述NAN设备的测距能力,所述第二消息为针对所述第一消息的响应消息;The processor is configured to execute the instruction, obtain a third moment to send the second message, where the second message is used to indicate ranging capability of the NAN device, and the second message is for the a response message of the first message;所述收发器,还用于接收所述第一NAN设备发送的第三消息; The transceiver is further configured to receive a third message sent by the first NAN device;所述处理器,还用于获得接收所述第三消息的第四时刻,根据所述第三时刻和所述第四时刻获得第二参数组信息;所述第二参数组信息用于获得所述第一NAN设备与所述NAN设备之间的距离,所述第三消息为针对所述第二消息的确认消息;The processor is further configured to obtain a fourth time to receive the third message, obtain second parameter group information according to the third time and the fourth time; the second parameter group information is used to obtain the Defining a distance between the first NAN device and the NAN device, where the third message is an acknowledgement message for the second message;所述收发器,还用于在第一时间窗口中,接收所述第一NAN设备发送的第一参数组信息,所述处理器,还用于根据所述第一参数组信息和所述第二参数组信息,获得所述第一NAN设备与所述NAN设备之间的距离;和/或,所述收发器,还用于在第一时间窗口中,向所述第一NAN设备发送所述第二参数组信息,以便所述第一NAN设备根据所述第二参数组信息和所述第一参数组信息获得所述第一NAN设备与所述NAN设备之间的距离;The transceiver is further configured to receive the first parameter group information sent by the first NAN device in a first time window, where the processor is further configured to use, according to the first parameter group information, the The second parameter group information is obtained, and the distance between the first NAN device and the NAN device is obtained; and/or the transceiver is further configured to send the first NAN device to the first NAN device in a first time window. The second parameter group information is obtained, so that the first NAN device obtains a distance between the first NAN device and the NAN device according to the second parameter group information and the first parameter group information;其中,所述第一参数组信息为:所述第一NAN设备获得接收所述第二消息的第一时刻,以及获得发送所述第三消息的第二时刻,根据所述第一时刻和所述第二时刻获得的参数组信息,所述第一参数组信息用于获得所述第一NAN设备与所述NAN设备之间的距离。The first parameter group information is: the first time that the first NAN device obtains the second message, and the second time that the third message is sent, according to the first time and the The parameter group information obtained at the second moment is used to obtain a distance between the first NAN device and the NAN device.
- 如权利要求21所述的NAN设备,其特征在于,所述第一消息为NAN中的服务发现帧SDF消息,所述第一消息中携带有所述第一NAN设备订阅或发布的服务信息。The NAN device of claim 21, wherein the first message is a service discovery frame SDF message in the NAN, and the first message carries service information subscribed or published by the first NAN device.
- 如权利要求21或22所述的NAN设备,其特征在于,所述收发器用于向所述第一NAN设备发送第二消息,具体为:The NAN device according to claim 21 or 22, wherein the transceiver is configured to send a second message to the first NAN device, specifically:在所述发现窗口或所述第一时间窗口中向所述第一NAN设备发送所述第二消息。Transmitting the second message to the first NAN device in the discovery window or the first time window.
- 如权利要求21-24任一所述的NAN设备,其特征在于,所述测距触发信息中包括测距原理指示信息、测距协议指示信息、测距要求指示信息、测距需求指示信息以及测距开启指示信息中的一种或任意几种;其中,The NAN device according to any one of claims 21 to 24, wherein the ranging trigger information includes ranging principle indication information, ranging protocol indication information, ranging request indication information, ranging demand indication information, and One or any of a range opening indication information; wherein所述测距原理指示信息用于指示进行距离测量所依据的测量原理;The ranging principle indication information is used to indicate a measurement principle on which the distance measurement is performed;所述测距协议指示信息用于指示进行距离测量所依据的测量协议;The ranging protocol indication information is used to indicate a measurement protocol on which the distance measurement is performed;所述测距要求指示信息用于指示对所测量的距离所需要满足的参数的需 求;The ranging requirement indication information is used to indicate a requirement of a parameter that needs to be satisfied for the measured distance begging;所述测距需求指示信息用于指示对满足所述服务信息的NAN设备的距离的需求;The ranging requirement indication information is used to indicate a requirement for a distance of a NAN device that satisfies the service information;所述测距开启指示信息用于指示所述第二NAN设备开启测距功能。 The ranging open indication information is used to instruct the second NAN device to enable the ranging function.
Priority Applications (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201580051236.0A CN106717068B (en) | 2015-03-20 | 2015-03-20 | The distance between a kind of NAN equipment measurement method and NAN equipment |
PCT/CN2015/074802 WO2016149890A1 (en) | 2015-03-20 | 2015-03-20 | Method of measuring distance between nan device, and nan device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
PCT/CN2015/074802 WO2016149890A1 (en) | 2015-03-20 | 2015-03-20 | Method of measuring distance between nan device, and nan device |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2016149890A1 true WO2016149890A1 (en) | 2016-09-29 |
Family
ID=56977907
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2015/074802 WO2016149890A1 (en) | 2015-03-20 | 2015-03-20 | Method of measuring distance between nan device, and nan device |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN106717068B (en) |
WO (1) | WO2016149890A1 (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108966128A (en) * | 2018-07-19 | 2018-12-07 | Oppo广东移动通信有限公司 | Navigation locating method and Related product |
CN108965466A (en) * | 2018-08-10 | 2018-12-07 | Oppo广东移动通信有限公司 | Information pushing method and related equipment |
WO2023168720A1 (en) * | 2022-03-11 | 2023-09-14 | 北京小米移动软件有限公司 | Distance measurement method and apparatus |
Families Citing this family (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109151796B (en) * | 2018-08-10 | 2021-06-04 | Oppo广东移动通信有限公司 | NAN device finding method, related device, and computer-readable storage medium |
CN113207084B (en) * | 2021-04-16 | 2023-04-14 | 南京大鱼半导体有限公司 | Method and device for searching terminal, storage medium and electronic equipment |
WO2024242513A1 (en) * | 2023-05-25 | 2024-11-28 | 엘지전자 주식회사 | Method for measuring location using wi-fi nan in v2x communication |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103364774A (en) * | 2012-04-02 | 2013-10-23 | 深圳富泰宏精密工业有限公司 | System and method for positioning adjacent devices based on WiFi direct connection |
US20140301285A1 (en) * | 2012-11-16 | 2014-10-09 | Electronics And Telecommunications Research Institute | Method of transmission and reception for device to device discovery and apparatus thereof |
CN104378800A (en) * | 2013-08-13 | 2015-02-25 | 华为终端有限公司 | Method, device and system for joining in neighbor awareness network cluster |
Family Cites Families (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102598797B (en) * | 2009-10-21 | 2014-12-17 | Lg电子株式会社 | Method of efficient ranging procedure considering ranging purpose in broadband wireless access system |
US10477376B2 (en) * | 2013-01-11 | 2019-11-12 | Qualcomm Incorporated | Systems and methods for formatting frames in neighborhood aware networks |
-
2015
- 2015-03-20 CN CN201580051236.0A patent/CN106717068B/en active Active
- 2015-03-20 WO PCT/CN2015/074802 patent/WO2016149890A1/en active Application Filing
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103364774A (en) * | 2012-04-02 | 2013-10-23 | 深圳富泰宏精密工业有限公司 | System and method for positioning adjacent devices based on WiFi direct connection |
US20140301285A1 (en) * | 2012-11-16 | 2014-10-09 | Electronics And Telecommunications Research Institute | Method of transmission and reception for device to device discovery and apparatus thereof |
CN104378800A (en) * | 2013-08-13 | 2015-02-25 | 华为终端有限公司 | Method, device and system for joining in neighbor awareness network cluster |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108966128A (en) * | 2018-07-19 | 2018-12-07 | Oppo广东移动通信有限公司 | Navigation locating method and Related product |
CN108965466A (en) * | 2018-08-10 | 2018-12-07 | Oppo广东移动通信有限公司 | Information pushing method and related equipment |
WO2023168720A1 (en) * | 2022-03-11 | 2023-09-14 | 北京小米移动软件有限公司 | Distance measurement method and apparatus |
Also Published As
Publication number | Publication date |
---|---|
CN106717068A (en) | 2017-05-24 |
CN106717068B (en) | 2019-11-29 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
WO2016149890A1 (en) | Method of measuring distance between nan device, and nan device | |
RU2670279C1 (en) | Wireless device method, wireless device and computer device (options) | |
JP6204510B2 (en) | Topology discovery in hybrid networks | |
US9832725B2 (en) | Power save mechanism for peer-to-peer communication networks | |
EP2754310B1 (en) | Access point assisted direct client discovery | |
EP2587848B1 (en) | Method, apparatus, and computer program product for discovery of wireless networks | |
US9401874B2 (en) | Minimizing coverage holes in a communication network | |
JP2018520580A (en) | Method, apparatus and computer program product for service discovery proxy for wireless communication | |
JP6579884B2 (en) | Communication device, control method, and program | |
US20160352842A1 (en) | Proxy advertisements in a neighbor aware network | |
JP6579883B2 (en) | Communication device, control method, and program | |
US20160352782A1 (en) | Proxy advertisements in a neighbor aware network | |
WO2016134530A1 (en) | Access point (ap) discovery method and apparatus | |
WO2017028205A1 (en) | Anchor master node management method and node | |
US20180014164A1 (en) | Data Transmission Method and Device | |
KR20190053225A (en) | Communication device, communication method, and program | |
US20160316395A1 (en) | Service query method, apparatus and system, and station | |
JP7093159B2 (en) | Communication equipment, control methods for communication equipment, and programs | |
CN108718401B (en) | Video conference implementation method and related device | |
WO2019201106A1 (en) | Multicast message processing method and network device | |
KR102138135B1 (en) | Communication devices, control methods, computer programs and storage media | |
WO2016131196A1 (en) | Method and associated device used for data transmission in a neighbor awareness network | |
JP6827819B2 (en) | Communication equipment, its control method, and programs | |
WO2018051947A1 (en) | Communication device, communication method, and program | |
WO2023125051A1 (en) | Measurement establishment identifier determination method and related device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 15885829 Country of ref document: EP Kind code of ref document: A1 |
|
NENP | Non-entry into the national phase |
Ref country code: DE |
|
122 | Ep: pct application non-entry in european phase |
Ref document number: 15885829 Country of ref document: EP Kind code of ref document: A1 |