WO2017113176A1 - 临近感知网络nan中用于服务发现的方法和终端设备 - Google Patents

临近感知网络nan中用于服务发现的方法和终端设备 Download PDF

Info

Publication number
WO2017113176A1
WO2017113176A1 PCT/CN2015/099841 CN2015099841W WO2017113176A1 WO 2017113176 A1 WO2017113176 A1 WO 2017113176A1 CN 2015099841 W CN2015099841 W CN 2015099841W WO 2017113176 A1 WO2017113176 A1 WO 2017113176A1
Authority
WO
WIPO (PCT)
Prior art keywords
service
information
terminal device
ndc
initiating
Prior art date
Application number
PCT/CN2015/099841
Other languages
English (en)
French (fr)
Inventor
庞高昆
方平
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Priority to PCT/CN2015/099841 priority Critical patent/WO2017113176A1/zh
Priority to EP15911805.8A priority patent/EP3383102B1/en
Priority to US16/067,504 priority patent/US10575241B2/en
Priority to CN201580085376.XA priority patent/CN108370548B/zh
Publication of WO2017113176A1 publication Critical patent/WO2017113176A1/zh

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W48/00Access restriction; Network selection; Access point selection
    • H04W48/08Access restriction or access information delivery, e.g. discovery data delivery
    • H04W48/10Access restriction or access information delivery, e.g. discovery data delivery using broadcasted information
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/02Topology update or discovery
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/51Discovery or management thereof, e.g. service location protocol [SLP] or web services
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/56Provisioning of proxy services
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W40/00Communication routing or communication path finding
    • H04W40/02Communication route or path selection, e.g. power-based or shortest path routing
    • H04W40/12Communication route or path selection, e.g. power-based or shortest path routing based on transmission quality or channel quality
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W40/00Communication routing or communication path finding
    • H04W40/24Connectivity information management, e.g. connectivity discovery or connectivity update
    • H04W40/246Connectivity information discovery
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W56/00Synchronisation arrangements
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W56/00Synchronisation arrangements
    • H04W56/001Synchronization between nodes
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W72/00Local resource management
    • H04W72/30Resource management for broadcast services
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W8/00Network data management
    • H04W8/005Discovery of network devices, e.g. terminals
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W88/00Devices specially adapted for wireless communication networks, e.g. terminals, base stations or access point devices
    • H04W88/02Terminal devices
    • H04W88/04Terminal devices adapted for relaying to or from another terminal or user
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D30/00Reducing energy consumption in communication networks
    • Y02D30/70Reducing energy consumption in communication networks in wireless communication networks

Definitions

  • the present invention relates to the field of communications, and more particularly to a method and terminal device for service discovery in a proximity aware network NAN.
  • the proximity network (English name: Neighbor Awareness Network, referred to as: NAN) is a standard developed by the Wireless Fidelity Alliance (WFA). The role of this standard is that without a central node, All the devices participating in the NAN network are synchronized, and the NAN network maintenance work and service discovery work are performed in the agreed discovery window (English name: Discovery Window, referred to as DW).
  • WFA Wireless Fidelity Alliance
  • NAN2.0 a data link between devices requires the establishment of a NAN data link (English name: NAN Data Link, NDL).
  • NAN Data Link English name: NAN Data Link, NDL.
  • the existing NAN technology only supports service discovery and data transmission between devices within one hop range (within wireless transmission distance, and can also be understood as data transmission does not need to be forwarded), and does not support multi-hop range (wireless transmission distance, also It can be understood as service discovery and data transmission between devices that need to be forwarded to reach the target device.
  • the device needs to establish a multi-hop path with the target device, and then transmit data through this path.
  • the embodiment of the invention provides a method and a terminal device for service discovery in the proximity sensing network NAN, which can implement the path discovery process in the process of service discovery, thereby reducing a large number of air interface messages and saving a large number of time-frequency resources. .
  • a method for service discovery in a proximity sensing network NAN includes: receiving, by a first device, a first service discovery message sent by a second device, where the first service discovery message carries service identification information And first path information, the service identification information indicating that the service is sent
  • the service that is inquired by the device or the service that the service initiating device supports, the second device is the service initiating device or the service relay device, and the first path information includes the identifier information of the service initiating device, or the Identification information of the second device and the service initiating device; the first device determining, according to the first path information, second path information, where the second path information includes identifier information of the service initiating device and the The first device sends the second service discovery message, where the second service discovery message carries the service identification information and the second path information.
  • the first device is a service relay device
  • the second device may be a service initiation device or another service relay device
  • the first device can forward the first service discovery message of the first device.
  • the service discovery message sent by the service initiating device is transmitted, so that the service response device capable of providing the service that the service initiating device queries, or the service response device that needs the service supported by the service initiating device, may be found in the service discovery message or the
  • the forwarding message of the service discovery message further carries the path information, which is used to record the transmission path of the message, so that the path discovery process can be implemented at the same time as the service discovery.
  • the method for service discovery according to the embodiment of the present invention can The process of implementing path discovery in service discovery, that is, the process of service discovery and path discovery is implemented in a process, thereby reducing a large number of air interface messages and saving a large amount of time-frequency resources.
  • the sending, by the first device, the second service discovery message includes: if the first device is not in any one of the NAN data clusters NDC The first device sends the second service discovery message in a discovery window DW of the NAN; or if the first device is in a first NDC, the first device is in the first NDC Sending the second service discovery message; or if the first device is in at least two NDCs, the first device sends the second service discovery message in at least one of the at least two NDCs.
  • the first device may send the second service discovery message in the DW window.
  • the device in the first NDC can listen to the message sent by the first device, then the first The device may choose to broadcast the second service discovery message in the first NDC, or if the first device is in at least two NDCs, the first device may broadcast in one or more of the at least two NDCs The second service discovery message.
  • the method further includes: the first device receiving a first response message sent by a third device, where the first response message indicates the third
  • the device is a service response device of the service initiating device, and the first response message carries the third path information, where the third path information includes the identifier information of the service initiating device and the identifier information of the third device;
  • the first device determines the fourth path information according to the third path information, where the fourth path information includes the identifier information of the service initiating device, the identifier information of the first device, and the identifier of the third device.
  • the first device sends a second response message, and the second response message carries the fourth path information.
  • the third device is a service response device, and is a receiving device of the second service discovery message sent by the first device. After receiving the second service discovery message, the third device carries the message through the message.
  • the service identifier information is determined to be a service response device of the service initiating device, and may send a first response message to the first device, where the first response message carries the third path information, and the first device may determine, according to the third path information,
  • the fourth path information is then forwarded by sending the second response message until the first response message is forwarded to the service initiating device, where the second response message is a forwarding message of the first response message.
  • the sending, by the first device, the second response message includes: sending, by the first device, the first device to the second device a second response message; or if the first device is in the first NDC, the first device broadcasts the second response message in the first NDC; or if the first device is in at least two NDCs The first device broadcasts the second response message in at least one of the at least two NDCs.
  • the first device may send the second response message to the second device in a unicast manner, and forward the first response message of the service response device to the service initiating device, or may also be broadcasted.
  • the form broadcasts the second response message in the NDC where the first device is located, so that the device in the NDC in the NDC where the first device is located can forward the second response message, so that the NDC-based service initiating device can be established.
  • the first device may select not to send the second response message in the NDC in which the first response message has been broadcasted. Instead, the second response message is broadcasted in other NDCs, thereby saving air interface resources to a certain extent.
  • the fourth device is a forwarding device of the first response message, where the first device is in the first NDC, where the The fourth device is in the second NDC, and before the first device sends the second response message, the method further includes: the first device receiving a third response message that is broadcast by the fourth device in the second NDC, The third response message is a forwarding message of the first response message; if the first NDC and the second NDC are different NDCs, the first device broadcasts the second response in the first NDC a message; or if the first NDC and the second NDC are the same NDC, the first device does not broadcast the second response message in the first NDC.
  • the third device may forward the response message, but the fourth device may also forward the response message, if, before the first device forwards the response message, The fourth device has forwarded the response message, and the first device can determine whether the NDC in which the first device and the fourth device are located are the same. If not, the first device can select the NDC that is not broadcasted in the fourth device. The second response message is broadcasted; if the same, it indicates that the device in the NDC in which the first device is located has broadcast the response message, and other devices in the NDC may not need to be forwarded, thereby saving air interface resources.
  • the second path information further includes a first measurement metric value, where the first metric is used to measure the first device and a degree of the path between the second devices, the first metric value being characterized by at least one of the following parameters: an intersection of the wake-up time of the first device and the second device, The intersection of the NDC of the first device and the basic schedule of the NDC where the second device is located, the length of the base schedule of the NDC where the first device is located, and the value of the MP of the first device.
  • the second path information may further include a first metric value, that is, the second path information may include not only the identifier information of the service initiating device and the identifier information of the first device, but also the The first metric information of the path between the first device and the second device, in other words, the second path information may not only record the transmission path of the message, but also carry path measurement information for measuring the degree of the path, so
  • the method for service discovery in the embodiment of the present invention can not only discover the transmission path in the service discovery, but also determine the path with better performance according to the metric value used to measure the degree of the path.
  • the second path information further includes a first measurement metric value, where the first metric is used to measure the quality of the path between the first device and the second device, and the second device sends the second Before the service discovery message
  • the method further includes: the first device receiving a third service discovery message of the fifth device, where the third service discovery message carries the service identification information and the fifth path information, the fifth The path information includes the identifier information of the service initiating device, the identifier information of the fifth device, and a second metric value, where the second metric value is used to measure a path between the first device and the fifth device.
  • the first device determines that the path between the first device and the second device is better than the first device and the device according to the first metric value and the second metric value. a path between the fifth devices; the first device forwarding the first service discovery message, and not forwarding the third service discovery message.
  • the first device may determine the metric according to the metric values included in the two forwarding messages. The path between the first device and the device is better, so that the forwarding message sent by the device with better forwarding path can be selected.
  • the first metric value is represented by an intersection of the waking time of the second device and the first device, where The second metric value is represented by an intersection of the waking time of the fifth device and the first device, and the first device determines the first device according to the first metric value and the second metric value.
  • the path between the second device and the second device is better than the path between the first device and the fifth device, if the intersection of the waking time of the second device and the first device is greater than When the intersection of the fifth device and the waking time of the first device is performed, the first metric value is greater than the second metric value, and the first device is greater than the second metric by the first metric value.
  • the first device determines the first device and the The path between the second devices is better than the path between the first device and the fifth device.
  • the first metric value may be represented by an intersection of the waking time of the first device and the second device, and the longer the intersection of the awake times, the longer the device can be used to transmit data. , then the better the path, optionally, you can set the longer the wake-up time, the more the metric value Large or small, that is, the wake-up time can be established to be proportional or inversely proportional to the metric value, then the first device can determine the path with a larger metric value when the intersection of the wake-up time is proportional to the metric value. Excellent, or when the intersection of the waking time is inversely proportional to the metric value, the path with the smaller metric value is determined to be superior.
  • the first service discovery message further carries at least one of the following information, so that the first device calculates the a first metric value between the second device and the first device, where the first metric is used to measure the degree of the path between the first device and the second device: the second device a dormancy rule, a sleep time of the second device, a working law of the second device, and a working time of the second device.
  • the first device may not know the foregoing information of the second device.
  • the first service discovery message may carry the foregoing.
  • the first device calculates a first metric value between the first device and the second device according to the information, where the first metric value can measure the first device and the first The pros and cons of the path between the two devices.
  • the first service discovery message further carries the change information in the NAN
  • the method further includes: the service identifier information and
  • the first device is determined to be a service response device of the service initiating device, where the service identifier information is generated by the service initiating device according to service information of the service initiating device, or
  • the service initiating device generates, according to the change information in the NAN and the service information of the service initiating device, where the first service identifier is generated by the first device according to the service information of the first device, or the a device is generated according to the change information in the NAN and the service information of the first device, where the service information of the service initiating device indicates information about a service supported by the service initiating device or information of a service that is queried, if The service information of the service initiating device is the information of the service supported by the service initiating device device, and the service information of the first device is
  • the service identifier information may be generated by the service initiating device according to the service information of the service initiating device, or generated by the service initiating device according to the change information in the NAN and the service information of the service initiating device.
  • the device may generate the first service identifier according to the service information of the first device, or generate the first service identifier according to the service information of the first device and the change information in the NAN, and then the first device may compare the first service.
  • Identifying and the service identification information of the service initiating device determining whether the first device is a service response device of the service initiating device, because the service identification information is generated by the service information combined with the change information, and the change information is dynamically changed, so Ensure that the service identity is dynamically changed to prevent eavesdropper tracking.
  • the first service discovery message further carries the identifier change rule information of the service initiating device, where the identifier change rule information indicates a change rule of the identifier information of the service initiating device, so that the receiving device of the first service discovery message identifies the service initiating device according to the identifier change rule information, after the identifier information of the service initiating device is changed, Or updating the identification information of the service initiating device according to the identifier change rule information.
  • the first service discovery message may further carry the identifier change rule information of the service initiating device, so that after the identifier information of the service initiating device changes, the receiving device of the service discovery message changes according to the identifier.
  • the regular information identifies the service initiating device, or updates the service information of the service initiating device according to the identification change rule information.
  • Service information is also changing, which improves the security and privacy of the service discovery process.
  • the service discovery message may further carry the service identifier change rule information of the service initiating device, where the service identifier change rule information indicates a change rule of the service identifier information of the service initiating device, so as to be in the service.
  • the receiving device of the service discovery message identifies the service identifier of the service initiating device according to the identifier change rule information, or updates the service initiating device according to the identifier change rule information.
  • Service identification information may be used to the service identifier change rule information of the service initiating device, where the service identifier change rule information indicates a change rule of the service identifier information of the service initiating device, so as to be in the service.
  • the method before the sending, by the first device, the second service discovery message, the method further includes: determining the first device When the forwarding capability is available, the first device sends the second service discovery message; or when it is determined that the first device does not have a forwarding capability, the first device does not send the second service discovery message.
  • the first device may determine whether to forward the first service discovery message according to whether it has forwarding capability, and if the forwarding capability is available, send the second Service discovery message.
  • the message format of the service discovery message is one of the following: a service discovery frame SDF message format, and an action action frame message format. , beacon frame beacon message format and user-defined message format.
  • the service discovery message may be a subscribe message or a publish message in the SDF message, or may use a new frame defined by an action frame format, or may use other existing frames. Format, or user-defined frame format, etc.
  • the service discovery message further carries multi-hop indication information, where the multi-hop indication information is used to discover a multi-hop range Service response device.
  • the service discovery message may include multi-hop indication information, and the multi-hop indication information may be used to indicate that the service is found to be one hop or multiple hops, that is, the service discovery of the multi-hop can be performed in the embodiment of the present invention.
  • One-hop service discovery can be implemented, so that one-hop or multi-hop path discovery in the service discovery process of one-hop or multi-hop can be realized.
  • a second aspect provides a method for service discovery in a proximity aware network NAN, the method comprising: receiving, by a first device, a first service discovery message of a second device, where the first service discovery message carries service identification information and a first path information, where the service identifier information indicates a service that is inquired by the service initiating device or a service that is supported by the service initiating device, where the second device is a service initiating device or a service relay device; Identifying information, determining that the first device is a service response device of the service initiating device; the first device sends a response message, the response information carries second path information, and the second path information includes the service initiation The identifier information of the device and the identifier information of the first device, or the identifier information of the service initiating device, the identifier information of the second device, and the identifier information of the first device.
  • the first device is a service response device of the service initiating device
  • the second device may be a service initiating device or a service relay device.
  • the first device may The service identification information in the first service discovery message determines that it is a service response device of the service initiating device, that is, the first device is a device capable of providing a service that the service initiating device queries, or a service that needs to be supported by the service initiating device.
  • the device can reply to the response message, and the path information including the identifier information of the first device is carried in the response message.
  • the sending, by the first device, the response message includes: the first device sending the response information to the second device; or a device is in a first NAN data cluster NDC, the first device broadcasts the response message in the first NDC; or the first device is in at least two NDCs, the first device is in the Broadcasting the response message in at least one of the at least two NDCs; or if the first device is not in any one of the NANs, the first device joins the second NDC in the NAN Transmitting the response message in the second NDC.
  • the first device may reversely transmit the response message according to the path information, that is, which service forwarding message is forwarded by the relay device, and which relay device returns a response message, or the first device further After the service is successfully matched, the response message may be broadcasted in the NDC where the first device is located, or if the first device is not in any one of the NDCs, the first device may choose to join an NDC and then broadcast in the NDC.
  • the response message after receiving the response message, the relay device of the other NDC may broadcast the response message in another NDC, so that the response message is sequentially transmitted until the service initiating device, so that the service response device and the service initiating device can be established.
  • the first device determines, according to the service identifier information, that the first device is a service response device of the service initiating device.
  • the first device determines that the first device is a service response device of the service initiating device when the service identifier information matches the first service identifier of the first device, where the service is
  • the identifier information is generated by the service initiating device according to the service information of the service initiating device, or the service initiating device generates, according to the change information in the NAN and the service information of the service initiating device, the first service identifier.
  • the first device is generated according to the service information of the first device, or the first device generates, according to the change information in the NAN and the service information of the first device, the service information of the service initiation device And indicating information about the service supported by the service initiating device or information of the service that is queried; if the service information of the service initiating device is sent by the service
  • the information of the service supported by the device where the service information of the first device is the information of the service queried by the first device; or the service information of the service initiation device is the information of the service queried by the service initiation device,
  • the service information of the first device is information of a service supported by the first device;
  • the change information in the NAN includes at least one of the following information: a level of the anchor node, an AMR, a MR of the master node, and a master Node MP, anchor master node willingness value AMP, random factor RF, anchor master node beacon frame transmission time AMBTT, time synchronization function TSF value, cluster identification and
  • the service identifier information may be generated by the service initiating device according to the service information of the service initiating device, or generated by the service initiating device according to the change information in the NAN and the service information of the service initiating device.
  • the first device may generate a first service identifier according to the service information of the first device, or generate a first service identifier according to the service information of the first device and the change information in the NAN, and then the first device may compare the first The service identifier and the service identifier information of the service initiating device determine whether the first device is a service response device of the service initiating device device, because the service identifier information is generated by the service information combined with the change information, and the change information is dynamically changed. Therefore, it can be ensured that the service identifier is dynamically changed, thereby preventing the eavesdropper from tracking, thus ensuring the security of the service discovery process.
  • the method further includes: the first device forwarding the first service discovery message; or discovering according to the first service
  • the spreading indication information carried in the message determines whether to forward the first service discovery message, and the diffusion indication information indicates whether to forward the forwarding message when the first device is a service response device of the service initiating device.
  • the first device may continue to forward the first service discovery message after the service is successfully matched, so as to query more service response devices, or may also use the diffusion indication in the first service discovery message.
  • Information determining whether to forward the first service discovery message.
  • the response message includes hop count information and a first metric value, where the hop information is obtained by the service discovery message Determining, by the service initiating device, the number of times of forwarding to the service response device, where the first metric value is used to measure the degree of the path between the first device and the service response device.
  • the response message may further include hop count information and first metric information, where the hop count information may be used to determine a maximum transmission distance between the service initiating device and the service responding device, the first metric value.
  • the service response device can be used to select an optimal backhaul path.
  • a terminal device for performing the method of any of the first aspect or the first aspect.
  • the terminal device may comprise means for performing the method of the first aspect or any one of the implementations of the first aspect.
  • a terminal device for performing the second aspect or the second aspect A method in an implementation.
  • the terminal device may comprise means for performing the method of the second aspect or any of the implementations of the second aspect.
  • a terminal device comprising a transceiver, a memory, a processor, and a bus system.
  • the transceiver, the memory and the processor are connected by the bus system
  • the memory is for storing instructions for executing instructions stored by the memory to control the transceiver to receive or transmit signals, and when the processing When the processor executes the instructions stored by the memory, the execution causes the processor to perform the method of any of the first aspect or the first aspect.
  • a terminal device comprising a transceiver, a memory, a processor, and a bus system.
  • the transceiver, the memory and the processor are connected by the bus system
  • the memory is for storing instructions for executing instructions stored by the memory to control the transceiver to receive or transmit signals, and when the processing When the processor executes the instructions stored by the memory, the execution causes the processor to perform the method of any of the implementations of the second aspect or the second aspect.
  • the method for the service discovery and the terminal device in the NAN of the embodiment of the present invention can implement the path discovery process in the process of service discovery, thereby reducing a large number of air interface messages and saving a large amount of time-frequency resources. .
  • FIG. 1 is a schematic diagram of an application scenario of an embodiment of the present invention.
  • FIG. 2 is a schematic flow chart of a method for service discovery in a NAN according to an embodiment of the present invention.
  • FIG. 3 is a schematic flowchart of a method for service discovery in a NAN according to another embodiment of the present invention.
  • FIG. 4 is a schematic flowchart of a method for service discovery in a NAN according to still another embodiment of the present invention.
  • FIG. 5 is a schematic block diagram of a terminal device according to an embodiment of the present invention.
  • FIG. 6 is a schematic block diagram of a terminal device according to another embodiment of the present invention.
  • FIG. 7 is a schematic block diagram of a terminal device according to an embodiment of the present invention.
  • FIG. 8 is a schematic block diagram of a terminal device according to another embodiment of the present invention.
  • the technical solution of the present invention can be applied to various communication systems, for example, Global System of Mobile communication (English name: GSM), code division multiple access (English full name: Code Division Multiple Access, referred to as: CDMA) system, Wideband Code Division Multiple Access Wireless (WCDMA), General Packet Radio Service (English name: General Packet Radio Service, referred to as: GPRS), long-term evolution (English full name: Long Term Evolution, referred to as LTE), NAN system, etc.
  • GSM Global System of Mobile communication
  • CDMA Code Division Multiple Access
  • WCDMA Wideband Code Division Multiple Access Wireless
  • GPRS General Packet Radio Service
  • LTE Long Term Evolution
  • NAN system etc.
  • UE User Equipment
  • MT Mobile Terminal
  • terminal equipment mobile user equipment, etc.
  • RAN Radio Access Network
  • core networks may be mobile terminals, such as mobile phones (or "cellular" phones) and computers with mobile terminals, for example, may be portable, Pocket, handheld, computer built-in or in-vehicle mobile devices.
  • FIG. 1 is a schematic diagram of an application scenario of an embodiment of the present invention.
  • a service initiating device is a device that sends a service discovery message, and the service discovery message is used to discover a service response device outside a wireless transmission distance (also It may be referred to as a target device, the service response device being a device capable of providing a service required by the service initiation device, or a device requiring a service supported by the service initiation device; the service relay device transmitting the device for forwarding the service initiation device
  • the service relay device includes a first transit device and a second transit device. In actual applications, more service relay devices may be included, and the service relay device forwards The service discovery message sent by the service initiating device, or the forwarding message of the service discovery message sent by the other service relay device.
  • the embodiment of the present invention is only described by taking an application scenario of 2 hops as an example, but the present invention
  • the embodiment is not limited thereto, and the system may further include more service relay devices, and the path between the service initiating device and the service response device may be 3 hops or more, etc., and the hop from the service initiating device to the service responding device.
  • the number n is understood to be that the service discovery message sent by the service initiating device needs to be forwarded by the n-1 service relay devices to reach the service response device.
  • the service initiating device to the service response device has a service relay device and a service discovery message. After a single forwarding, the service response device can be reached, and the number of hops from the service initiating device to the service responding device is 2.
  • the meaning of the device A's last hop device is that the device B is the receiving device for the message sent by the device A on a certain transmission path from the service initiating device to the service responding device; the device C is the device.
  • the next hop device of B refers to a receiving device of the message sent by the device B on a certain transmission path from the service initiating device to the service responding device.
  • FIG. 2 shows a specific flow diagram of a method 200 for service discovery in a NAN, in accordance with an embodiment of the present invention, as described in terms of device interaction.
  • device A is a service initiating device
  • device B and device D are service relay devices
  • device C is a service in response device.
  • device A sends a service discovery message.
  • the device A serves as a service initiating device, and wants to initiate service discovery of a device within a range of one hop or multiple hops.
  • the device A may send a service discovery message, where the service discovery message carries service identification information, where the service identification information indicates that the service is initiated.
  • the service discovery message may be a service query message or a service broadcast message. If the service discovery message is a service query message, the service query message is used to discover a device capable of providing a service that is inquired by the service initiating device.
  • the service identification information may indicate that the device A needs to discover the service. If the service discovery message is a service broadcast message, the service broadcast message may be used for a service supported by the broadcast service initiating device. Service.
  • the service identification information may be a service identifier (English name: Service Identifier, SID for short) or a bitmap format.
  • the service identification information may be generated by the service initiating device according to the service information, or the service initiating device may be generated according to the service information and the change information in the NAN.
  • the change information in the NAN may include at least the following information.
  • the change information in the NAN may also be part or all of some of the above information.
  • the service information may be a service name, a hash value of the service name, or a service number, and the like.
  • the service identification information may be operated (eg, performing a hash operation) on one or more of the service information and the change information to generate a mapping value, and then determining the mapping value of the device A.
  • Service identification information may be operated (eg, performing a hash operation) on one or more of the service information and the change information to generate a mapping value, and then determining the mapping value of the device A.
  • the service identification information may be obtained by performing a hash operation according to the service information and the TSF value, or performing a hash operation according to the service information and the partial information of the TSF value, or according to the hash value and the TSF value of the service information. Performing a hash operation, or performing a hash operation based on the hash information of the service information and the partial information of the TSF value, or performing a hash operation based on the service information and the TSF value and the AMR, or a part according to the service information and the TSF value.
  • the information and the partial information of the AMR are obtained by hashing, or are obtained by hashing the partial information of the hash value of the service information and the partial information of the TSF value and the partial information of the AMR, or according to the hash value of the service information.
  • the partial information and the partial information of the TSF value are hashed and obtained.
  • the service identification information may also be represented by a bitmap form, and the device A may generate the service identification information according to different service information, where the process of generating the service identification information may be to calculate different service information (for example, The hash bits are mapped to different bits in the bitmap, ie different bits represent different service identifiers, in particular the bitmap can be a Bloom filter bitmap.
  • the first service discovery message may further carry the identifier change rule information of the service initiating device, so that after the identifier information of the service initiating device changes, the receiving device of the service discovery message changes the rule according to the identifier. Identifying the service initiating device, or updating the identification information of the service initiating device according to the identifier change rule information.
  • the first service discovery message may further carry the service identifier change rule information of the service initiating device, so that after the service identifier information of the service initiating device changes, the receiving device of the service discovery message is configured according to the service identifier.
  • the change rule information identifies the service initiating device, or updates the service identification information of the service initiating device according to the identifier change rule information.
  • the service discovery message may further carry the multi-hop indication information, where the multi-hop indication information indicates that the service initiating device needs to discover the service response device in the multi-hop range, and the multi-hop refers to the service discovery message needs to be transited through the service. The forwarding of the device can reach the service response device.
  • the service discovery message may be used in an existing message frame, for example, a service discovery frame (English name: Service Discovery Frame, SDF for short), an action frame, and a beacon frame.
  • the multi-hop service-related attributes are found to indicate that the service discovery message is used to discover a service response device in a multi-hop range, or a user-defined message format may be used.
  • the service discovery message may further include path information.
  • the path information may include the service initiation device, that is, the identifier information of the device A.
  • the identifier information may be media access control.
  • the media access control abbreviated as: MAC address information, or interface address information, is used to distinguish the identification information of the device, which is not limited in this embodiment of the present invention.
  • the path information may be carried in the MAC header of the service discovery message.
  • the identifier information of the device in the path information may be address information in the MAC header.
  • the identifier information of the service initiating device may be a source address (English name: Source Address, SA for short).
  • the address information of the service discovery message may be set as follows: the SA of the service discovery message may be set to The service initiating device is the MAC address of device A.
  • the receiving address English name: Receive Address, RA for short
  • RA can be set to the broadcast address of device A, such as the address of wi-fi
  • the sending address English name: Transmit Address
  • TA can be set to the address of device A.
  • the destination address (English name: Destination Address, abbreviated as DA) can be empty.
  • the path information may also be carried in the service discovery message in other manners, and the embodiment of the present invention does not limit the bearer manner of the path information in the service discovery message.
  • the path information may further include metric information, where the metric value may be used to measure the quality of the path, and the measurement information may be used for the next hop device of the device A, that is, the service discovery message.
  • the receiving device finds the optimal path based on the measurement information.
  • the metric value can be characterized by the wake up time of the device, for example, the metric value between device X and device Y can be measured by the intersection of device X and the wake-up time of device Y.
  • the NAN network uses channel 6 as the discovery channel, and the 512 time unit on the channel (English full name: A DW is set in the Time Unit (referred to as TU) (about 1024us), and the duration of the DW is 16TU.
  • the metric value between the device X and the device Y can be measured in units of 512 TUs by the length of time that the device X and the device Y are awake within the 512 TU.
  • both device X and device Y wake up for 30 TU, and both device X and device Z wake up for 20 TU.
  • the metric value of the 30TU is 3 and the metric value of the 20TU is 2, then the device X and the device X can be determined by comparison.
  • the path between the devices Y is better than the path between the device X and the device Z; or the wake-up time can be set to be inversely proportional to the metric value, that is, the longer the wake-up time is, the smaller the metric value is, the smaller the metric value is. The better the path.
  • the metric value may be measured by the sleep time of the device X and the device Y in the 512 TU.
  • the shorter the sleep time the larger the metric value, the better the path between the devices, or the sleep time may be set.
  • the metric value between the two devices may be represented by the intersection of the base schedule of the NDCs between the devices. For example, the larger the intersection, the larger the metric value, and the better the path between the devices. If the metric value of device X to device Y is 3, and the metric value of device X to device Z is 2, by comparison, it can be determined that the path between the device X and the device Y is better than the path between the device X and the device Z. Alternatively, the larger the intersection, the smaller the metric value, and the smaller the metric value, the better the path between devices.
  • the metric value may be represented by the MP of the device. For example, the larger the MP value of the device, the larger the metric value, and the better the path. Then, if the metric value of the device Z to the device Y is greater than the metric value of the device X to the device Y, it may be determined that the path from the device Z to the device Y is better than the path from the device X to the device Y, so that the device Y may select the forwarding device Z to send. Service discovery messages, without forwarding service discovery messages sent by device X, can save air interface resources. Similarly, the larger the MP value of the device, the smaller the metric value is, indicating that the path between the device and the next hop device is better.
  • the metric value may be represented by the grading value of the device.
  • the grading value of the device is used to measure the willingness value of the device to arrange the base schedule. The greater the willing value, the more willing to arrange the base schedule, and the grading value of the device is larger. You can set the higher the tier value of the device. The larger the metric value, the better the path between the device and the next hop device. Then, if the metric value of device X to device Y is 3 and the metric value of device X to device Z is 2, it can be determined that the path of device X to device Y is better than the path of device X to device Z. Similarly, you can set the higher the rating value, The smaller the metric value, the better the path with smaller metric values.
  • the metric message may be characterized by the length of time of the base schedule of the NDC where the device is located. For example, you can set the base schedule of the NDC where the device resides. The longer the metric value is. For example, the base schedule time of the NDC where the device Y is located is greater than the base schedule time of the NDC where the device Z is located. The metric value of the device X to the device Y is 3, and the metric value of the device X to the device Z is 2. The path from device X to device Y is better than the path from device X to device Z. Similarly, you can set the base schedule time of the NDC where the device is located. The smaller the metric value is, the smaller the metric value is.
  • the metric message may also be characterized by the role information of the device.
  • the role information of the device can be the anchor master node (English name: Anchor Master, AM), the master node (master), the synchronous non-master node (sync non master), the non-synchronous non-master node (non sync non master), the proxy server ( The proxy server, the proxy client, can use the priority of one or more of the above role information as the metric value.
  • the role of device Y is anchor master
  • the role of device Z is non sync non master
  • the metric of device X to device Y is 3, and the metric of device X to device Z is 2.
  • device X to device Y can be determined.
  • the path is better than the path from device X to device Z.
  • the service discovery message may further carry at least one of the following information, so that the receiving device of the service discovery message calculates a first measurement metric value between the device A and the receiving device.
  • the sleep rule of the device A The sleep rule of the device A, the sleep time of the device A, the working law of the device A, and the working time of the device A.
  • the working time of the device A is used as a specific embodiment to describe in detail how the device B calculates the first metric value between the device A and the device B according to the working time of the device A.
  • the first metric value may be expressed in the form of a bitmap
  • the first dimension of the bitmap is time information
  • the 16 TU is the minimum time unit for the device to work on a certain channel.
  • the second dimension of the bitmap is channel information, that is, the channel information that the device can work.
  • a minimum time unit and a unit corresponding to one channel can be set as a measurement unit, and a unit corresponding to a certain time unit and a certain minimum time unit can be used.
  • a channel and a unit corresponding to a certain minimum time unit are set to 0 or blank to indicate that the device enters a sleep state during a time period indicated by the minimum time unit, and the device A transmits information of the working time of the device A to the device B.
  • the device B can set the corresponding unit in the bitmap according to the information of the working time of the device A, and then set the corresponding unit in the bitmap according to the information of the working time of the device B, by using the device in the bitmap.
  • the unit with A set is matched with the unit set by device B in the bitmap to determine the first metric value.
  • the first metric information may also be calculated in other manners.
  • the percentage of the matching of the measurement unit of the device A and the device B in the bitmap may be used as the first metric value, for example, the device in the bitmap.
  • A has a number of units of 32, and among the 32 units, 16 units can be used for device B to transmit data, then the percentage of the unit to be matched is 50%, and the first metric value can be determined to be 50. %.
  • the range of the matching degree in the bitmap may be quantized, and the range of the matching degree may correspond to a preset first metric value. For example, when the matching degree ranges from 10% to 20%, the first metric value may be corresponding.
  • the first metric value when the matching degree ranges from 80% to 90%, the first metric value may be corresponding to N, where M ⁇ N, then when it is determined that the matching degree of the measuring unit of the device A and the device B is 85%, it may be determined.
  • the corresponding first metric value is N.
  • the first metric value may also be a determined value or a grading value, for example, may be represented by a letter or a symbol, or may be represented as a range, etc., which is not limited by the embodiment of the present invention.
  • the service discovery message may be sent in a broadcast or multicast manner, or may be sent in a unicast manner, which is not limited in this embodiment of the present invention.
  • the service discovery message may be broadcast in the DW, or may be broadcast in other time periods, or may be broadcasted in the NDC where the device A is located, and may be further broadcasted in the base schedule of the NDC where the device A is located.
  • the embodiment of the invention is not limited thereto.
  • the service discovery message may further include diffusion indication information for indicating whether the service response device continues to forward the service discovery message after discovering the service response device that satisfies the condition. If the service discovery message only needs to find a service response device that satisfies the condition, the diffusion indication information may indicate that the service discovery message is not diffused after the service response device receives the service discovery message; otherwise, the service discovery is continued. Messages in order to discover more service response devices.
  • the device B forwards the service discovery message.
  • the device B determines that it is a device with forwarding capability, for example, a proxy device, a master device, The service discovery message is forwarded when the device is in the NMC or in the NDC, otherwise the service discovery message is not forwarded.
  • a device with forwarding capability for example, a proxy device, a master device
  • the device B may further determine, according to the received sequence number carried in the service discovery message, whether to forward the service discovery message, where the sequence number indicates an order of services that the service initiating device needs to discover, if the service is initiated.
  • the device initiates a new service discovery message, and updates the serial number. For example, the sequence number may be incremented by 1. If the sequence number in the service discovery message received by the device B is less than or equal to the sequence number of the previously received service discovery message, The device B may determine that the service discovery message is not the latest service discovery message, and may choose not to forward the service discovery message.
  • the device B may further obtain the service information and the path information according to the service discovery message, and then carry the service identification information and the updated path information when forwarding the service discovery message.
  • the device B may obtain the service initiating device, that is, the service information that is inquired by the device A, or the supported service information, according to the service identifier information carried in the service discovery message.
  • the device B may, according to the service identifier information, reply to the device A when determining that the service information that the device A queries is satisfied, or when determining that the service information supported by the device A is the service information required by the device A,
  • the response message may carry the service identification information, and may also carry the identification information of the device B, for example, MAC address information.
  • the service discovery message may be Unicast mode is sent to the device X.
  • the device B may further obtain path information according to the service discovery message, where the path information includes the service initiation device, that is, the identifier information of the device A, for example, MAC address information or interface address information.
  • the identifier information of the device A may be carried in the address information in the MAC header of the service discovery message.
  • the device A may be obtained from the SA information in the address information in the MAC header of the service discovery message.
  • MAC address information may be carried in the address information in the MAC header of the service discovery message.
  • the path information may further include the identifier information of the service forwarding device.
  • the identifier information may also be the MAC address information of the service relay device.
  • the identifier information may also be carried in the address information in the MAC header of the service discovery message, and the device B may discover the message from the service.
  • the MAC address information of the service relay device is obtained from the TA information in the address information in the MAC header.
  • the device B may diffuse the service discovery message in a broadcast or unicast manner. For example, if the device B is a master device or a non-master sync device, the device B may choose to broadcast the service discovery message in the DW; or, if the device B is a proxy device or a relay device, the device B may also select Broadcasting the service discovery message in the DW; or, if the device B is a device in an NDC, the device B may broadcast the service discovery message in the NDC, or may choose to broadcast the service discovery in the base schedule of the NDC.
  • the device B may choose to broadcast the service discovery message in the plurality of different NDCs, or may broadcast the base schedule in the plurality of different NDCs.
  • the service discovery message and the like are not limited in this embodiment of the present invention.
  • the device B updates the path information of the forwarding message of the service discovery message before forwarding the service discovery message.
  • the path information of the forwarding message may include not only the service initiation device but also the identifier information of the device A.
  • the identification information of the device B may be included.
  • the identifier information may be the MAC address information of the device, and the identifier information of the device may be carried in the MAC header of the forwarding message of the service discovery message.
  • the address information of the forwarding message may be set as follows: the SA may be set to be service initiated.
  • the device is also the MAC address of device A.
  • the RA can be set to the broadcast address of device A, such as the address of wi-fi, and TA is the address of device B.
  • the path information may further include a metric value of the device A to the device B, where the metric value is used to measure the degree of the path between the device A and the device B.
  • the metric value may be described in S201. The metric value is characterized by any way, in order to avoid repetition, it will not be repeated here.
  • the device may further receive multiple forwarding messages, each of the multiple forwarding messages.
  • the path information of the forwarded message carries a metric value.
  • the device B can determine which metric value indicates the path is better according to the multiple metric values, so that the forwarding message sent by the device carrying the metric value can be selected and forwarded. For example, the device B receives the forwarding message of the device M and the device N. According to the metric value carried in the two forwarding messages, the device B determines that the path from the device M to the device B is better than the path from the device N to the device B.
  • the device B can select the forwarding message sent by the device M, and does not forward the forwarding message sent by the device N. This avoids repeated forwarding. Therefore, the air interface resource is saved to a certain extent, and the path with better performance can also be selected as the service. Initiate a transmission path between the device and the service response device.
  • device C replies with a response message.
  • the device C receives the service discovery message sent by the device B in a broadcast or unicast manner.
  • the service identifier information carried by the service query message indicates that the service initiating device queries.
  • Service information if the device C supports the service information, the device C may reply to the response message; or, if the service discovery message is a service broadcast message, the service identification information carried by the service discovery message indicates the service information supported by the service initiation device.
  • the device C determines that the service information supported by the device A is needed, the device C can reply the response message.
  • the response message may further carry service identifier information.
  • the service identifier information may indicate service information supported by the device C or required service information, that is, the device A.
  • the device C can match the successful service information, and the device C can support one or more of the multiple service information, which is not limited by the embodiment of the present invention.
  • the device C may determine whether the device C is a service response device of the device A according to whether the first service identifier of the device A and the second service identifier of the device C match.
  • the first service identifier may be generated by the device A according to the first service information of the device A, or the device A is generated according to the change information in the NAN and the first service information of the device A, the second service.
  • the device C is generated according to the second service information of the device C, or generated according to the change information in the NAN and the second service information;
  • the corresponding second service information is the information of the service queried by the device C; if the first service information is the information of the service queried by the device A, The corresponding second service information is information of a service supported by the device C.
  • the change information in the NAN may include at least one of the following information: an anchor master node level (English full name: Anchor Master Rank, abbreviation: AMR), and a master node level (English full name Master Rank, referred to as MR) , the main node willingness value (English full name: Master Preference, referred to as: MP), anchor master node willingness value (English full name: Anchor Master Preference, referred to as: AMP), random factor (English full name: Random Factor, referred to as: RF), anchor
  • the master node's beacon transmission time English name: Anchor Master Beacon Transmission Time, referred to as: AMBTT
  • time synchronization function English full name: Time Synchronization Function, referred to as: TSF
  • cluster identification cluster level
  • cluster level English full name: Cluster Grade, CG
  • interface address may also be the whole or part of some of the above information.
  • part of the TSF value may be used to generate a service identifier.
  • the last 24 bits of the TSF value
  • the first service identifier may be an SID, and is generated based on the service information of the service initiating device.
  • the service information may be hashed (or the partial information of the result after the hash operation is further used as the SID).
  • the SID may be processed in combination with one or more of the change information in the NAN, for example, by performing a hash operation process; or may be processed by combining the change information of the device A itself. This ensures dynamic changes to the first service identity and prevents eavesdroppers from tracking.
  • the hash operation may be a SHA256 hash algorithm.
  • the first service identifier may be operated by one or more of the service information and the change information to generate a mapping value, and then the mapping value is determined by the first service identifier of the device A.
  • the first service identifier may be represented by using a bitmap format described in S201.
  • the device C may calculate and map different second service information into the bitmap of the second service identifier. Whether the bit of the corresponding location in the bitmap of the second service identifier is the same as the bit position of the corresponding location in the bitmap of the second service identifier, for example, if the bit of the corresponding location is 1, the device A can be determined. Matches the service information of device C.
  • the device C may reply to the response message when the multiple service identifiers of the device C and the plurality of service identifiers of the device A all match. If not all matches, the device C may not reply to the response message;
  • the device C may also reply to the response message. Partial matching can be understood as that device C supports some of the multiple services that device A is to query, or device C supports some of the multiple services that device A queries.
  • the response message may further indicate that the service response device supports a part of the service. Specifically, the response message may further indicate that the device C matches the device A with successful service information.
  • the response message may further include path information, where the path information includes the identifier information of the service initiating device, the identifier information of the device B, and the identifier information of the device C.
  • the identifier information of the device may be the MAC address information of the device, and the path information may be carried in the MAC header of the response message.
  • the address information of the response message may be set as follows: the SA may be set as a service initiating device, that is, a device.
  • the MAC address of A, RA can be set to the broadcast address of device B, such as the address of wi-fi, TA is the address of the device C, and DA can be the address of device C.
  • the response message may further include hop count information and a metric value, where the metric The value is the metric value of device B to device C, and the metric value indicates the quality of the path from device B to device C.
  • the hop count information indicates that a number of paths are passed from the service initiating device to the service responding device, and the hop information may be determined by the service initiating device to the service responding device after several times of forwarding according to the service discovery message, if the service discovery message only passes The forwarding of a service relay device reaches the service response device, and the hop count of the service initiation device to the service response device is 2. If the service discovery message is forwarded by the n service relay devices, the service response device is reached, and the service is initiated.
  • the device-to-service response device has a hop count of n+1, and the hop count information can be used to determine the maximum transmission distance from the service-initiating device to the service-responsive device.
  • the device C may send the response message to the device B in a unicast manner; or if the device C is in the NDC, the device C may broadcast the response message in the NDC where the device C is located, for example, the device C may broadcast the response message in the base schedule of the NDC; or if the device C is not in any NDC of the NAN, the device C may choose to join an NDC, and then broadcast the response message and the like in the NDC, and the implementation of the present invention This example does not limit this.
  • the device B or the device D forwards the response message.
  • the device B After receiving the response message of the device C, the device B determines to forward the response message, and may update the path information of the response message according to the response message. Optionally, if the path information includes the metric value, the metric value may be updated. It is the metric value of the device C to the device B, and the metric value indicates the degree of the path of the device C to the device B.
  • the updated path information may include the identifier information of the service initiating device, and the identifier information of the device B and the service response device are the identifier information of the device C.
  • the address information of the response message may be set as follows.
  • the SA can be set to the service initiating device, that is, the MAC address of the device A
  • the RA can be set to the broadcast address of the device C, such as the address of the wi-fi
  • the TA is the address of the device B
  • the DA can be the address of the device C.
  • the device B may forward the response message to the device A in a unicast manner; or if the device B and the device C are in the same NDC, the device B may choose not to forward the response message; or if the device B is not in the same NDC as device C, and device B may choose to broadcast the response message in the NDC in which device C does not broadcast the response message; or if device B is in multiple different NDCs, and the device B is located In one or several NDCs, another device broadcasts the response message in advance, and the device B may select to broadcast the response message in an NDC other than the one or more NDCs, for example, the device B is in the NDC 1 , In NDC 2 and NDC 3 , before device B broadcasts the response message, if device D has broadcast the response message in NDC 1 and NDC 2 , the device may choose to broadcast the response message only in NDC 3 . That is to say, if a device forwards the response message in an NDC, other devices may choose not to forward the response message,
  • the response message may adopt an attribute for discovering a multi-hop service in an existing message frame, for example, an SDF, an action frame, or a beacon frame, to indicate that the response message is used to implement a multi-hop range.
  • an SDF Session Initiation Function
  • an action frame Session Initiation Function
  • a beacon frame Session Initiation Function
  • the path is found, or a user-defined message format or the like may be used, which is not limited by the embodiment of the present invention.
  • the device A acquires path information of the service response device according to the response message.
  • the device A may obtain the path information according to the response message forwarded by the device B or the device D.
  • the path information may include the service initiation device, that is, the identification information of the device A, the identification information of the device B or the device D, and the service response. Identification information of the device.
  • the forwarding message of the response message may further include hop count information and a metric value, where the metric value is a metric value of the device C to the device B or the device D.
  • the device A may determine which service response device to communicate according to the hop count information and/or the metric value in the plurality of forwarding messages. For example, the device A receives the forwarding message of the response message sent by the device B and the device D, and if the device A determines the service response device indicated by the forwarding message of the device B according to the forwarding message of the response message sent by the device B and the device D, The number of hops of the service initiating device is smaller than the number of hops of the service initiating device indicated by the forwarding message of the device D, that is, the service response device on the path where the device B is located is more than the service response on the path where the device D is located.
  • the device is closer to the service initiating device, that is, device A, so that device A can communicate with the service responding device on the path where selection B is located.
  • the device A can determine, according to the metric value carried in the forwarding message of the response message sent by the device B and the device D, that the path of the device B is better than the path where the device D is located, so that the device B can be selected.
  • the service on the path responds to the device to communicate.
  • the device A can also determine to communicate with one or more of the service response devices of the reply response message with reference to other factors.
  • the method for service discovery in the NAN can implement the path discovery process in the process of service discovery, thereby reducing a large number of air interface messages and saving a large amount of time-frequency resources.
  • Figure 3 shows a NAN in accordance with an embodiment of the present invention as described from the perspective of a service relay device
  • the first device receives a first service discovery message sent by the second device, where the first service discovery message carries service identifier information and first path information, where the service identifier information indicates that the service initiating device queries or the service initiating device supports
  • the second device is the service initiating device or the service relay device, and the first path information includes the identification information of the service initiating device, or the second device and the identification information of the service initiating device;
  • the first device determines the second path information according to the first path information, where the second path information includes the identifier information of the service initiating device and the identifier information of the first device.
  • the first device sends a second service discovery message, where the second service discovery message carries the service identification information and the second path information.
  • the first device may be the device B in the method 200 for service discovery in the NAN shown in FIG. 2, and the first device may perform related actions of the device B in the method 200, the second device It may be device A in method 200 for service discovery in a NAN according to an embodiment of the present invention, or may be another service relay device, which may perform related actions of device A in the method 200, or device Related actions of B.
  • the first service discovery message may be a service discovery message
  • the first service discovery message may be a forwarding message of the service discovery message.
  • the service identification information carried by the first service discovery message indicates service information or supported service information queried by the service initiation device.
  • the service identifier information may be an SID of the service initiating device, or other identifier information that uniquely identifies the service initiating device.
  • the first device may obtain the first path information according to the first service discovery message. If the second device is a service initiating device, the first path information may include the identifier information of the service initiating device, if the second device is a service The transit path device may include the identifier information of the service initiating device and the identifier information of the second device.
  • the first device updates the second path information included in the second service discovery message, where the second path information includes the identifier information of the service initiating device and the first device Identification information, optionally, the identification information of the first device may be a MAC address of the first device.
  • the second path information may be carried in a MAC header of the second service discovery message.
  • the address information in the MAC header of the second service discovery message may be set in such a manner that the SA can be set as the MAC address of the service originating device, and the RA can be set as the broadcast address of the second device, such as the address of the wi-fi.
  • TA is the address of the first device. Since the service response device has not been found at this time, the DA can be empty.
  • the service discovery message may adopt an attribute for discovering a multi-hop service in an existing message frame, for example, an SDF, an action frame, or a beacon frame, to indicate that the service discovery message is used to discover a multi-hop.
  • the service response device in the range may be a user-defined message format or the like, which is not limited in this embodiment of the present invention.
  • the method for service discovery in the NAN of the embodiment of the present invention can implement the path discovery process in the process of service discovery, thereby reducing a large number of air interface messages and saving a large amount of time-frequency resources.
  • the first service discovery message further carries the change information in the NAN, where the service identifier information may be generated by the service initiating device according to the service information of the service initiating device, or may also be initiated for the service.
  • the device generates, according to the change information in the NAN and the service information of the service initiating device, where the service information of the service initiating device indicates the information of the service supported by the service initiating device or the information of the service that is inquired;
  • the service information of the service initiating device is the information of the service supported by the device initiating the device device
  • the service information of the first device is the information of the service that the first device queries; or if the service information of the service initiating device is the service Initiating information about the service that is queried by the device, and the service information of the first device is information of the service supported by the first device;
  • the change information in the NAN includes at least one of the following information: the level of the anchor master node AMR, the level of the master node MR, the master node willingness value MP, the anchor master node willingness value AMP, the random factor RF, the anchor master node letter Frame transmission time AMBTT, time synchronization function TSF value, cluster identification and cluster level CG, and group key group key.
  • the change information may include part or all of a certain information in the above information, for example, the change information may include part or all of the TSF value, or may include a part of the TSF value and all of the RF value, etc.
  • the embodiment of the invention does not limit this.
  • the service initiating device may generate a mapping value by calculating at least one of service information (for example, a hash value of the service name or the service name) and the change information, and The value of the shot is used as the service identification information.
  • the service initiating device may perform the hash operation to generate the service identification information by combining the service information with the TSF value, or perform the hash operation to generate the service identification information by combining the service information with the partial information of the TSF value, or may also
  • the hash value of the service information and the downlink or the downlink of the TSF are hashed to generate the service identification information, etc., which is not limited in this embodiment of the present invention.
  • the method 300 further includes:
  • the service identifier information matches the first service identifier of the first device, determining that the first device is a service response device of the service initiating device;
  • the first service identifier is generated by the first device according to the service information of the first device, or generated according to the change information in the NAN and the service information of the first device, where the service information of the service initiation device indicates the service Initiating information about a service supported by the device or information of the service being queried;
  • the service information of the service initiating device is the information of the service supported by the service initiating device
  • the service information of the first device is the information of the service that is queried by the first device
  • the service information of the service initiating device is the service The information of the service that is initiated by the device
  • the service information of the first device is the information of the service supported by the first device.
  • the first device After the first device obtains the service identification information of the service initiating device, the first device generates the first service identifier according to the service information of the first device and the change information in the NAN, and then the service is used.
  • the service identification information of the initiating device matches the first service identifier of the first device. If the matching is successful, the first device may determine that it is the service response device of the service initiating device. If the service identifier information indicates the information of the service supported by the service initiating device, the first device generates the service information according to the service identifier of the first device, or the service identifier.
  • the information indicates that the service initiates the information of the service that is inquired by the device, and the information that the first device generates the first service identifier is the information of the service supported by the first device.
  • the first device may determine whether the first device is a service response device of the service initiating device according to whether the first service identifier and the service identifier information of the service initiating device match, and if the matching succeeds, the response message is returned, otherwise , does not reply to the response message.
  • the first service discovery message may further carry identifier change rule information of the service initiating device, where the identifier change rule information indicates an identifier of the service initiating device.
  • the change rule of the information so that after the identification information of the service initiating device changes, the receiving device of the service discovery message identifies the service initiating device according to the identifier change rule information, or updates the service initiating device according to the identifier change rule information. Identification information.
  • the service identification information of the service initiating device may be changed.
  • the first service discovery message may further carry the identifier change rule information of the service initiating device, so that If the identifier of the service initiating device changes, the receiving device of the first service discovery message may identify the service initiating device according to the identifier change rule information, and may also update the recorded service initiating device according to the identifier change rule information. Identification information. Therefore, the security and privacy of the service discovery process is increased.
  • the method 300 may further include:
  • the first device may further determine whether to forward the first service discovery message according to the sequence number carried in the first service discovery message.
  • the first service discovery message further carries at least one of the following information, so that the first device calculates a first measurement metric value between the second device and the first device. :
  • the dormancy rule of the second device The dormancy rule of the second device, the sleep time of the second device, the working law of the second device, and the working time of the second device.
  • the first device may represent the working time information of the second device in the form of a bitmap, and then calculate the working time information of the first device and the working time information of the second device in the bitmap. First metric information between the first device and the second device.
  • the second path information further includes a first metric value, where the first metric value is characterized by one of:
  • the first metric value may also be characterized according to other parameters, for example, may be characterized according to at least one of the following information:
  • the airtime of the first device and the second device, the communication cost of the first device and the second device, the sleep rule of the second device, the bandwidth required by the first device, the bandwidth required by the second device, and the reliability required by the first device The reliability required by the second device, the delay required by the first device, the delay required by the second device, the load of the first device, the load of the second device, the time-frequency resource information of the second device, and the quality of service information (Quality Of Service, QOS).
  • the information of the time-frequency resource may indicate time information and channel information that the first device can use to transmit data.
  • the information of the time-frequency resource may indicate a working period and a channel of the first device in a DW interval, or a working period and a channel of the first device in a plurality of DW intervals, or a working period of the first device
  • the dormant period, the working rule, the dormancy rule, etc., for example, the information of the time-frequency resource may indicate how many DW or DW intervals the first device sleeps, or which time period in the DW interval sleeps, and at other times The segment works on a certain channel.
  • the information of the time-frequency resource may be described by using a bitmap, a bloom filter, a starting working time and a working duration of the device, or a starting working time and an ending working time of the device.
  • the embodiment of the invention does not limit this.
  • Table 1 shows a quantitative representation of the information of the time-frequency resource.
  • the first dimension of the bitmap is time information
  • 16 TUs are the minimum time units for the device to work on a certain channel. Within each 16 TU, the device is in a dormant state or works on a certain channel.
  • the second dimension of the bitmap is channel information, that is, channel information that the device can work.
  • the device may be operated on the channel by the time zone indicated by the minimum time unit by setting a bitmap corresponding to a certain channel and a certain minimum time unit, by corresponding to a certain channel and a certain minimum time unit.
  • the bitmap is set to 0 or blanked to indicate that the device enters a sleep state during the time period indicated by the minimum time unit; the device may also be represented by setting or blanking a bitmap corresponding to a certain channel and a certain minimum time unit. Running on the channel during the time period indicated by the minimum time unit, indicating that the device enters a sleep state during the time period indicated by the minimum time unit by setting a bitmap corresponding to a certain channel and a certain minimum time unit, or The information of the available time-frequency resources of the device may be indicated by other indication manners. The manner of indicating the time-frequency resources is not limited in the embodiment of the present invention.
  • the bitmap can also indicate multiple consecutive DWs and adjacent DWs.
  • the law of time-frequency resources can also be specified by standards.
  • Table 1 the bitmap expresses the information of the time-frequency resources of the device in each 512 TU period. As can be seen from Table 1, the device works on channel 6 in the 0th to 5th 16TUs. ⁇ The 20th 16TU operates on channel 11, and operates on channel 1 in the 21st to 31th 16TUs.
  • the second dimension of the bitmap is introduced by including channels 1, 6, and 11 as an example for convenience of expression.
  • the channel number in the bitmap may include channel 1 to channel 11. (Some countries may also include channel 1 to channel 13), indicating that the device can operate on any of the 11 channels in a certain time slot.
  • QoS information can be expressed in various ways.
  • the EDCA Enhanced Distributed Channel Access
  • the services represented by the QoS information are divided into AC_BK (Access Category_Background, Background Access Type) and AC_BE (Access Category_Best Effort, Maximum effort access type), AC_VI (Access Category_Video, video access type), AC_VO (Access Category_Voice, audio access type), because each type of service requires different transmission delays, when the service information carries QoS information,
  • the time-frequency resource can be arranged according to the QoS classification indicating the service.
  • the QOS information may also be expressed by a Traffic Specification (TSPEC) element.
  • TSPEC element structure is as shown in Table 2.
  • the service information may carry all the elements in Table 2, and may also carry the part in Table 2.
  • the element for example, carries at least one of a minimum data transmission rate, an average data transmission rate, a peak data transmission rate, and a traffic burst size.
  • a maximum service interval (Maximum) Service Interval may also be carried, for example, carrying a maximum service interval (Maximum) Service Interval), Minimum Service Interval, Maximum Data Rate, Minimum Data Transmission Rate, Average Data Transmission Rate, Maximum Packet Transmission Time, Preferred Packet Transmission Time, Maximum Transmission Delay (Maximum) At least one of a Transmission Delay), a preferred data transmission delay, and a Burst Size.
  • QoS may refer to a maximum service interval, a minimum service interval, and a minimum service interval required for the user experience service.
  • the maximum packet transmission time, preferably packet transmission time, maximum transmission delay, transmission delay preferred data, packet burst size of at least one embodiment of the present invention is not limited to this.
  • the first metric value may also be calculated according to the following formula:
  • O is the channel load (overhead);
  • B t is the number of bits (bit);
  • r is the data rate;
  • e f is the probability.
  • the method 300 may further include:
  • the first device receives a third service discovery message of the fifth device, where the third service discovery message carries a second metric value, where the third service discovery message carries the service identification information and the fifth path information, where the fifth path information includes The service initiating device identification information, the fifth device identification information, and the second metric value,
  • Determining, by the first device, the path between the first device and the second device is better than the path between the first device and the fifth device, according to the first metric value and the second metric value;
  • the first device forwards the first service discovery message and does not forward the third service discovery message.
  • the fifth device is another service relay device, and the first device may receive the third service discovery message sent by the fifth device, or may receive the first service discovery message sent by the second device, that is, the first device A device may receive a service discovery message forwarded by multiple devices, and the first device may determine, according to the metric value of the multiple forwarding messages, which device to send the service discovery message.
  • the first device may determine, according to the metric value of the multiple forwarding messages, which device to send the service discovery message.
  • the first metric value is represented by an intersection of the second device and the waking time of the first device, where the second metric value is awake by the fifth device and the first device.
  • the intersection of the first device and the second device determines that the path between the first device and the second device is better than the first device and the fifth device. Path, including:
  • the first metric value is greater than the second metric value, the first device When the first metric value is greater than the second metric value, determining that a path between the first device and the second device is better than a path between the first device and the fifth device; or
  • the intersection of the waking time of the second device and the first device is greater than the intersection of the waking time of the fifth device and the first device, the first metric value is smaller than the second metric value, the first device When the first metric value is smaller than the second metric value, determining that a path between the first device and the second device is better than a path between the first device and the fifth device.
  • the method 300 may further include:
  • the first device receives a first response message sent by the third device, where the first response message indicates that the third device is a service response device of the service initiating device, and the first response message carries third path information, the third path
  • the information includes the identification information of the service initiating device and the identification information of the third device;
  • the first device determines the fourth path information according to the third path information, where the fourth path information includes the identifier information of the service initiating device, the identifier information of the first device, and the identifier information of the third device.
  • the first device sends a second response message, where the second response message carries the fourth path information.
  • the first device may select to broadcast the second response message in other NDCs other than the first NDC, thereby avoiding an NDC.
  • the third device may be the device C in the method 200 in FIG. 2, and the third device may perform the related action of the device C in the method 200, where the first response message may be in the method 200 in FIG.
  • the response message replied by device C For detailed steps, refer to the related descriptions in S203 and S204 in FIG. 2. To avoid repetition, details are not described herein again.
  • the fourth device is a forwarding device of the first response message, where the first device is in the first NDC, the fourth device is in the second NDC, and the first device sends the first device.
  • the method further includes:
  • the first device broadcasts the second response message in the first NDC
  • the first device does not broadcast the second response message in the first NDC.
  • the fourth device may be the device D in the method 200 in FIG. 2, and the fourth device may perform related actions of the device D in the method 200.
  • the fourth device may perform related actions of the device D in the method 200.
  • S204 in FIG. 2 refers to the related description in S204 in FIG. 2 . To avoid repetition, we will not repeat them here.
  • the message format of the second service discovery message is one of the following:
  • Service discovery frame SDF message format Service discovery frame SDF message format, action action frame message format, beacon frame beacon elimination Information format and user-defined message format.
  • the service discovery message further carries multi-hop indication information, where the multi-hop indication information is used to discover a service response device within a multi-hop range, and the multi-hop indicates that the service discovery message is transmitted to the service response device and needs to be transited through the service. Forwarding of the device.
  • the process of determining the path between the service initiating device and the service responding device does not need to establish a connection relationship between the devices, but may be found in the service of the service response device.
  • the process determines the path between the service originating device and the service responding device, thus reducing a large number of air interface messages and saving a large amount of air interface resources.
  • Method 400 shows a schematic flow diagram of a method 400 for service discovery in a NAN, according to an embodiment of the present invention, from the perspective of a service response device, the method 400 being performed by a first device, as shown in FIG.
  • Method 400 includes:
  • the first device receives a first service discovery message of the second device, where the first service discovery message carries service identifier information and first path information, where the service identifier information indicates a service that is inquired by the service initiating device or supported by the service initiating device.
  • Service the second device is a service originating device or a service relay device;
  • the first device determines, according to the service identifier information, that the first device is a service response device of the service initiating device;
  • the first device sends a response message, where the response information carries the second path information, where the second path information includes the identifier information of the service initiating device and the identifier information of the first device, or the identifier information of the service initiating device, Identification information of the second device and identification information of the first device.
  • the second device may be the device B in the method 200 in FIG. 2, and the second device may perform related actions of the device B in the method 200, where the first device may be in the method 200 in FIG. Device C, the first device can perform the related actions of device C in method 200.
  • the first device sends a response message, including:
  • the first device sends the response information to the second device;
  • the first device broadcasts the response message in the first NDC;
  • the terminal device is in at least two NDCs, broadcasting the response message in at least one of the at least two NDCs;
  • the first device joins the second NDC in the NAN, and the response message is broadcast in the second NDC.
  • the second NDC may be the first NDC, or may be one of the at least two NDCs, or the first device may also be added to multiple NDCs, one or more NDCs among multiple NDCs.
  • the response message is broadcasted in the embodiment of the present invention.
  • the first device determines, according to the service identifier information, that the first device is a service response device of the service initiating device, and includes:
  • the first device determines that the first device is a service response device of the service initiating device;
  • the service identification information is generated by the service initiating device according to the service information of the service initiating device, or the service initiating device generates, according to the change information in the NAN and the service information of the service initiating device, where the first service identifier is The first device is generated according to the service information of the first device, or the first device is generated according to the change information in the NAN and the service information of the first device, where the service information of the service initiation device indicates the service supported by the service initiation device Information or information about the service being queried;
  • the service information of the service initiating device is the information of the service supported by the service initiating device
  • the service information of the first device is the information of the service that is queried by the first device
  • the service information of the service initiating device is the service The information of the service that is initiated by the device
  • the service information of the first device is the information of the service supported by the first device
  • the change information in the NAN includes at least one of the following information: the level of the anchor master node AMR, the MR of the master node, the master node MP, the anchor master node willingness value AMP, the random factor RF, the beacon frame transmission of the anchor master node Time AMBTT, time synchronization function TSF value, cluster identification and cluster level CG and group key group key.
  • the method 400 further includes:
  • the service response device meets one or more service information, and the diffusion indication information may further indicate that the forwarding message is flooded, so as to find that other service information is found to be satisfied. Service response device.
  • the response message may further include hop count information and a first metric value, where the hop information is transmitted from the service initiating device to the service by the service discovery message.
  • the first metric value is used to measure the degree of the path between the first device and the service response device.
  • the method for service discovery in the NAN can implement the path discovery process in the process of service discovery, thereby reducing a large number of air interface messages and saving a large amount of time-frequency resources.
  • FIG. 5 shows a schematic block diagram of a terminal device 500 according to an embodiment of the present invention.
  • the terminal device 500 includes:
  • the transceiver module 510 is configured to receive a first service discovery message sent by the second device, where the first service discovery message carries service identifier information and first path information, where the service identifier information indicates a service that is inquired by the service initiating device or the The service-initiated device supports the service, the second device is the service-initiating device or the service relay device, the first path information includes the identifier information of the service-initiating device, or the second device and the service-initiated device Identification information of the device;
  • the determining module 520 is configured to determine the second path information according to the first path information, where the second path information includes the identifier information of the service initiating device and the identifier information of the terminal device;
  • the transceiver module 510 is further configured to send a second service discovery message, where the second service discovery message carries the service identifier information and the second path information.
  • the terminal device for service discovery in the NAN can implement the path discovery process in the process of service discovery, thereby reducing a large number of air interface messages and saving a large amount of time-frequency resources.
  • the terminal device 500 may correspond to the first device in the method 300 for service discovery in the NAN in the embodiment of the present invention or the method 200 for service discovery in the NAN according to the embodiment of the present invention.
  • the above-mentioned and other operations and/or functions of the respective modules in the terminal device 500 are respectively implemented in order to implement the respective processes of the respective methods in FIG. 2 and FIG. 3, and are not described herein again for brevity.
  • FIG. 6 shows a schematic block diagram of a terminal device 600 according to another embodiment of the present invention. As shown in FIG. 6, the terminal device 600 includes:
  • the transceiver module 610 is configured to receive a first service discovery message of the second device, where the first service discovery message carries service identifier information and first path information, where the service identifier information indicates that the service is sent.
  • the service that is inquired by the device or the service that the service initiating device supports, and the second device is a service initiating device or a service relay device;
  • a determining module 620 configured to determine, according to the service identifier information, that the terminal device is a service response device of the service initiating device;
  • the transceiver module 610 is further configured to:
  • the response information carrying the second path information, where the second path information includes the identifier information of the service initiating device and the identifier information of the terminal device, or the identifier information of the service initiating device, Identification information of the second device and identification information of the terminal device.
  • the terminal device for service discovery in the NAN can implement the path discovery process in the process of service discovery, thereby reducing a large number of air interface messages and saving a large amount of time-frequency resources.
  • the terminal device 600 may correspond to the first device in the method 400 for service discovery in the NAN in the embodiment of the present invention or the method 200 for service discovery in the NAN according to the embodiment of the present invention.
  • the above-mentioned and other operations and/or functions of the respective modules in the terminal device 600 are respectively implemented in order to implement the respective processes of the respective methods in FIG. 2 and FIG. 4, and are not described herein again for brevity.
  • an embodiment of the present invention further provides a terminal device 700, which includes a processor 710, a memory 720, a bus system 730, and a transceiver 740.
  • the processor 710, the memory 720 and the transceiver 740 are connected by a bus system 730 for storing instructions for executing instructions stored in the memory 720 for receiving signals or transmitting signals through the transceiver 740.
  • the structure of the terminal device shown in FIG. 7 does not constitute a limitation on the embodiment of the present invention. It may be a bus-shaped structure or a star-shaped structure, and may include more or less components than those shown in FIG. 7. , or combine some of these components, or use different component layouts.
  • the transceiver 740 is configured to receive a first service discovery message sent by the second device, where the first service discovery message carries service identifier information and first path information, where the service identifier information indicates a service or a service that is inquired by the service initiating device.
  • the second device is the service initiating device or the service relay device
  • the first path information includes the identifier information of the service initiating device, or the second device and the identifier information of the service initiating device
  • the device 710 is configured to determine the second path information according to the first path information, where the second path information includes the identifier information of the service initiating device and the identifier information of the terminal device, and the transceiver 740 is further configured to send the second service discovery.
  • the message, the second service discovery message carries the service identification information and the second path information.
  • the processor 710 may be a central processing unit (“CPU"), and the processor 710 may also be other general-purpose processors, digital signal processors (DSPs). , an application specific integrated circuit (ASIC), an off-the-shelf programmable gate array (FPGA) or other programmable logic device, discrete gate or transistor logic device, discrete hardware component, and the like.
  • the general purpose processor may be a microprocessor or the processor or any conventional processor or the like.
  • the memory 720 can include read only memory and random access memory and provides instructions and data to the processor 710. A portion of the memory 720 can also include a non-volatile random access memory. For example, the memory 720 can also store information of the device type.
  • the bus system 730 may include a power bus, a control bus, a status signal bus, and the like in addition to the data bus. However, for clarity of description, various buses are labeled as bus system 730 in the figure.
  • each step of the foregoing method may be completed by an integrated logic circuit of hardware in the processor 710 or an instruction in a form of software.
  • the steps of the method disclosed in the embodiments of the present invention may be directly implemented as a hardware processor, or may be performed by a combination of hardware and software modules in the processor.
  • the software module can be located in a conventional storage medium such as random access memory, flash memory, read only memory, programmable read only memory or electrically erasable programmable memory, registers, and the like.
  • the storage medium is located in memory 720, and processor 710 reads the information in memory 720 and, in conjunction with its hardware, performs the steps of the above method. To avoid repetition, it will not be described in detail here.
  • the terminal device for service discovery in the NAN can implement the path discovery process in the process of service discovery, thereby reducing a large number of air interface messages and saving a large amount of time-frequency resources.
  • the terminal device 700 may correspond to the first device in the method 300 for service discovery in the NAN in the embodiment of the present invention or the method 200 for service discovery in the NAN according to the embodiment of the present invention.
  • the above-mentioned and other operations and/or functions of the respective modules in the terminal device 700 are respectively implemented in order to implement the respective processes of the respective methods in FIG. 2 and FIG. 3, and are not described herein again for brevity.
  • an embodiment of the present invention further provides a terminal device 800, which includes a processor 810, a memory 820, a bus system 830, and a transceiver 840.
  • the processor 810, the memory 820 and the transceiver 840 are connected by a bus system 830 for storing instructions for executing instructions stored by the memory 820 to receive signals or transmit signals through the transceiver 840.
  • the structure of the terminal device shown in FIG. 8 does not constitute the present invention.
  • the definition of the embodiment which may be a bus-shaped structure or a star-shaped structure, may also include more or less components than those shown in FIG. 8, or combine some of the components, or adopt different component arrangements. Ways, etc.
  • the transceiver 840 is configured to receive a first service discovery message of the second device, where the first service discovery message carries service identifier information and first path information, where the service identifier information indicates a service that is initiated by the service initiating device or initiated by the service.
  • the processor 810 is configured to determine, according to the service identification information, that the terminal device is a service response device of the service initiating device; And sending the response message, where the response information carries the second path information, where the second path information includes the identifier information of the service initiating device and the identifier information of the terminal device, or the identifier information of the service initiating device, and the identifier of the second device.
  • Information and identification information of the terminal device is a service supported by the device, where the second device is a service initiating device or a service relay device; the processor 810 is configured to determine, according to the service identification information, that the terminal device is a service response device of the service initiating device; And sending the response message, where the response information carries the second path information, where the second path information includes the identifier information of the service initiating device and the identifier information of the terminal device, or the identifier information of the service initiating device, and the identifier of the second device.
  • Information and identification information of the terminal device is configured to determine,
  • the processor 810 can connect various portions of the entire terminal device using various interfaces and lines, by running or executing software programs and/or modules stored in the memory 820, and calling the storage in Data within memory 820 to perform various functions of the terminal device and/or process data.
  • the processor 810 can be a central processing unit (“CPU"), and the processor 810 can also be other general purpose processors, digital signal processors (DSPs), application specific integrated circuits (ASICs), ready-made Programming gate arrays (FPGAs) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, and the like.
  • the general purpose processor may be a microprocessor or the processor or any conventional processor or the like.
  • Memory 820 can include read only memory and random access memory that can be used to store software programs and modules, and to provide instructions and data to processor 810.
  • the memory 820 can include a program storage area and a data storage area, wherein the program storage area can store an operating system, an application required for at least one function, such as a sound playing program, an image playing program, and the like; the data storage area can be stored according to the electronic Data created by the use of the device (such as audio data, phone book, etc.).
  • a portion of the memory 820 may further include a volatile memory, such as a non-volatile volatile random access memory (NVRAM), a phase change random access memory (PRAM), or a magnetoresistive random
  • NVRAM non-volatile volatile random access memory
  • PRAM phase change random access memory
  • MRAM magnetoresistive random
  • the memory may also include a non-volatile memory, such as at least one disk storage device, an electrically erasable programmable read-only memory (EEPROM), Flash memory devices, such as NOR flash memory or NAND flash memory.
  • EEPROM electrically erasable programmable read-only memory
  • Flash memory devices such as NOR flash memory or NAND flash memory.
  • the non-volatile memory can store operating systems and applications executed by the processor 810.
  • the memory 820 can also store a device type letter interest.
  • the bus system 830 may include a power bus, a control bus, a status signal bus, and the like in addition to the data bus. However, for clarity of description, various buses are labeled as bus system 830 in the figure.
  • each step of the foregoing method may be completed by an integrated logic circuit of hardware in the processor 810 or an instruction in a form of software.
  • the steps of the method disclosed in the embodiments of the present invention may be directly implemented as a hardware processor, or may be performed by a combination of hardware and software modules in the processor.
  • the software module can be located in a conventional storage medium such as random access memory, flash memory, read only memory, programmable read only memory or electrically erasable programmable memory, registers, and the like.
  • the storage medium is located in the memory 820, and the processor 810 reads the information in the memory 820 and completes the steps of the above method in combination with its hardware. To avoid repetition, it will not be described in detail here.
  • the terminal device for service discovery in the NAN can implement the path discovery process in the process of service discovery, thereby reducing a large number of air interface messages and saving a large amount of time-frequency resources.
  • the terminal device 800 may correspond to the first device in the method 400 for service discovery in the NAN in the embodiment of the present invention or the method 200 for service discovery in the NAN according to an embodiment of the present invention.
  • the above-mentioned and other operations and/or functions of the respective modules in the terminal device 800 are respectively implemented in order to implement the respective processes of the respective methods in FIG. 2 and FIG. 4, and are not described herein again for brevity.
  • the size of the sequence numbers of the above processes does not mean the order of execution, and the order of execution of each process should be determined by its function and internal logic, and should not be taken to the embodiments of the present invention.
  • the implementation process constitutes any limitation.
  • the disclosed systems, devices, and methods may be implemented in other manners.
  • the device embodiments described above are merely illustrative.
  • the division of the unit is only a logical function division.
  • there may be another division manner for example, multiple units or components may be combined or 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 invention 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 functions may be stored in a computer readable storage medium if implemented in the form of a software functional unit and sold or used as a standalone product.
  • the technical solution of the present invention which is essential or contributes to the prior art, or a part of the technical solution, may be embodied in the form of a software product, which is stored in a storage medium, including
  • the instructions are used to cause a computer device (which may be a personal computer, server, or network device, etc.) to perform all or part of the steps of the methods described in various embodiments of the present invention.
  • the foregoing storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, and the like. .

Abstract

本发明实施例提供了一种NAN中用于服务发现的方法和终端设备,该方法包括:第一设备接收第二设备发送的第一服务发现消息,该第一服务发现消息携带服务标识信息和第一路径信息,该第一路径信息包括该服务发起设备的标识信息,或该第二设备和该服务发起设备的标识信息;该第一设备根据该第一路径信息,确定第二路径信息,该第二路径信息包括该服务发起设备的标识信息和该第一设备的标识信息;该第一设备发送第二服务发现消息,该第二服务发现消息携带该服务标识信息和该第二路径信息。本发明实施例的方法和终端设备,能够减少大量的空口消息,节约了大量的时频资源。

Description

临近感知网络NAN中用于服务发现的方法和终端设备 技术领域
本发明涉及通信领域,并且更具体地,涉及一种临近感知网络NAN中用于服务发现的方法和终端设备。
背景技术
临近感知网络(英文全称:Neighbor Awareness Network,简称:NAN)是无线保真联盟(英文全称:Wireless Fidelity Alliance,简称:WFA)制订的一个标准,这个标准的作用是在没有中心节点的情况下,使得所有参与NAN网络的设备同步起来,在约定的发现窗口(英文全称:Discovery Window,简称:DW)中进行NAN网络的维持工作和服务发现工作。
设备在完成服务发现后,需要与目标设备建立数据通信。在NAN2.0中,设备之间要进行数据通信就需要建立NAN数据链路(英文全称:NAN Data Link,NDL)。现有NAN技术只支持1跳范围内(无线传输距离内,也可以理解为数据传输不需要转发)的设备之间进行服务发现和数据传输,不支持多跳范围内(无线传输距离外,也可以理解为数据需要进行转发才能到达目标设备)的设备之间的服务发现和数据传输。现有的其他网络中的多跳的数据传输方式,设备需要和目标设备建立多跳的路径,然后通过这个路径进行数据的传输。如果直接套用现有的其他网络中的多跳路径发现方法,需要先将NAN设备两两之间建立连接,建立连接关系的过程需要消耗大量的空口消息,然而NAN网络是个松散的结构,设备之间不一定需要建立连接关系才能通信,而且路径的发现和建立的过程都需要消耗大量的空口消息,占用大量的时频资源。
发明内容
本发明实施例提供一种临近感知网络NAN中用于服务发现的方法和终端设备,能够在服务发现的过程中实现路径发现的过程,因此减少了大量的空口消息,节约了大量的时频资源。
第一方面,提供了一种临近感知网络NAN中用于服务发现的方法,该方法包括:第一设备接收第二设备发送的第一服务发现消息,所述第一服务发现消息携带服务标识信息和第一路径信息,所述服务标识信息指示服务发 起设备查询的服务或所述服务发起设备支持的服务,所述第二设备为所述服务发起设备或服务中转设备,所述第一路径信息包括所述服务发起设备的标识信息,或所述第二设备和所述服务发起设备的标识信息;所述第一设备根据所述第一路径信息,确定第二路径信息,所述第二路径信息包括所述服务发起设备的标识信息和所述第一设备的标识信息;所述第一设备发送第二服务发现消息,所述第二服务发现消息携带所述服务标识信息和所述第二路径信息。
在该实现方式中,该第一设备为服务中转设备,该第二设备可以为服务发起设备或另一个服务中转设备,该第一设备通过转发该第一设备的第一服务发现消息,能够将该服务发起设备发送的服务发现消息传递下去,从而可以发现能够提供该服务发起设备查询的服务的服务响应设备,或需要该服务发起设备支持的服务的服务响应设备,在该服务发现消息或该服务发现消息的转发消息中还携带路径信息,该路径信息用于记录消息的传输路径,从而可以在服务发现的同时实现路径发现的过程,因此本发明实施例的用于服务发现的方法,能够在服务发现中实现路径发现的过程,也就是将服务发现和路径发现的过程放在一个过程中实现,从而减少了大量的空口消息,节约了大量的时频资源。
结合第一方面,在第一方面的第一种实现方式中,所述第一设备发送第二服务发现消息,包括:若所述第一设备不处于所述NAN中的任一个NAN数据簇NDC中,所述第一设备在所述NAN的发现窗口DW中发送所述第二服务发现消息;或若所述第一设备处于第一NDC中,所述第一设备在所述第一NDC中发送所述第二服务发现消息;或若所述第一设备处于至少两个NDC中,所述第一设备在所述至少两个NDC中的至少一个NDC中发送所述第二服务发现消息。
在该实现方式中,若该第一设备不处于任何一个NDC中,因为NAN中的设备在DW窗口都是醒来的,所以该第一设备可以在DW窗口中发送该第二服务发现消息,以便于更多的设备监听到该第二服务发现消息,或者若该第一设备处于第一NDC中,该第一NDC中的设备都可以监听到该第一设备发送的消息,那么该第一设备可以选择在该第一NDC中广播该第二服务发现消息,或者若该第一设备处于至少两个NDC中,该第一设备可以在该至少两个NDC中的一个或多个NDC中广播该第二服务发现消息。
结合第一方面,在第一方面的第二种实现方式中,所述方法还包括:所述第一设备接收第三设备发送的第一响应消息,所述第一响应消息指示所述第三设备为所述服务发起设备的服务响应设备,所述第一响应消息携带第三路径信息,所述第三路径信息包括所述服务发起设备的标识信息和所述第三设备的标识信息;所述第一设备根据所述第三路径信息,确定第四路径信息,所述第四路径信息包括所述服务发起设备的标识信息、所述第一设备的标识信息和所述第三设备的标识信息;所述第一设备发送第二响应消息,所述第二响应消息携带所述第四路径信息。
在该实现方式中,该第三设备为服务响应设备,也是该第一设备发送的第二服务发现消息的接收设备,该第三设备接收到该第二服务发现消息后,通过该消息中携带的服务标识信息,确定自身为服务发起设备的服务响应设备,可以向第一设备发送第一响应消息,该第一响应消息携带第三路径信息,该第一设备可以根据该第三路径信息确定第四路径信息,然后通过发送第二响应消息将该第四路径信息传递下去直到将该第一响应消息转发到服务发起设备,其中,该第二响应消息为该第一响应消息的转发消息。
结合第一方面及其上述实现方式,在第一方面的第三种实现方式中,所述第一设备发送第二响应消息,包括:所述第一设备向所述第二设备发送所述第二响应消息;或若所述第一设备处于第一NDC中,所述第一设备在所述第一NDC中广播所述第二响应消息;或若所述第一设备处于至少两个NDC中,所述第一设备在所述至少两个NDC中的至少一个NDC中广播所述第二响应消息。
在该实现方式中,该第一设备可以以单播的方式向第二设备发送第二响应消息的方式,将该服务响应设备的第一响应消息转发到服务发起设备,或者也可以以广播的形式在其所在的NDC中广播该第二响应消息,以便于该第一设备所在的NDC中的处于不同NDC的设备,可以将该第二响应消息转发出去,从而可以建立基于NDC的服务发起设备和服务响应设备之间的传输路径。
可选地,若该第三设备已经在一个或多个NDC中广播第一响应消息,该第一设备可以选择在上述已经广播过该第一响应消息的NDC中不发送该第二响应消息,而选择在其他NDC中广播该第二响应消息,从而在一定程度上节约了空口资源。
结合第一方面及其上述实现方式,在第一方面的第四种实现方式中,第四设备为所述第一响应消息的转发设备,所述第一设备处于第一NDC中,所述第四设备处于第二NDC中,在所述第一设备发送第二响应消息之前,所述方法还包括:所述第一设备接收所述第四设备在第二NDC中广播的第三响应消息,所述第三响应消息为第一响应消息的转发消息;若所述第一NDC与所述第二NDC为不同的NDC,所述第一设备在所述第一NDC中广播所述第二响应消息;或若所述第一NDC和所述第二NDC为相同的NDC,所述第一设备不在所述第一NDC中广播所述第二响应消息。
在该实现方式中,第三设备发送响应消息后,不仅该第一设备可以转发该响应消息,该第四设备也可以转发该响应消息,那么,如果在该第一设备转发该响应消息前,该第四设备已经转发该响应消息,该第一设备可以判断该第一设备和第四设备所处的NDC是否相同,如果不相同,该第一设备可以选择在该第四设备未广播的NDC中广播该第二响应消息;如果相同,表示该第一设备所处的NDC中已经有设备广播了该响应消息,这时该NDC中的其他设备可以不必进行转发,从而节约了空口资源。
结合第一方面及其上述实现方式,在第一方面的第五种实现方式中,所述第二路径信息还包括第一衡量metric值,所述第一metric用于衡量所述第一设备和所述第二设备之间的路径的优劣程度,所述第一metric值采用以下参数中的至少一项表征:所述第一设备与所述第二设备的醒来时间的交集,所述第一设备所在的NDC与所述第二设备所在的NDC的基本安排base schedule的交集,所述第一设备所在的NDC的base schedule的时间长度,所述第一设备的意愿值MP值,所述第一设备的等级MR和所述第一设备在所述NAN中的角色信息。
在该实现方式中,该第二路径信息还可以包括第一metric值,也就是说该第二路径信息不仅可以包括该服务发起设备的标识信息和该第一设备的标识信息,还可以包括该第一设备和第二设备之间的路径的第一metric信息,换句话说,该第二路径信息不仅可以记录消息的传输路径,还可以携带用于衡量路径优劣程度的路径衡量信息,因此本发明实施例的用于服务发现的方法不仅可以在服务发现中发现传输路径,还可以根据用于衡量路径优劣程度的metric值,确定出性能更优的路径。
结合第一方面及其上述实现方式,在第一方面的第六种实现方式中,所 述第二路径信息还包括第一衡量metric值,所述第一metric用于衡量所述第一设备和所述第二设备之间的路径的优劣程度,在所述第一设备发送第二服务发现消息之前,所述方法还包括:所述第一设备接收第五设备的第三服务发现消息,所述第三服务发现消息携带所述服务标识信息和第五路径信息,所述第五路径信息包括所述服务发起设备的标识信息、所述第五设备的标识信息和第二metric值,所述第二metric值用于衡量所述第一设备和所述第五设备之间的路径的优劣程度;所述第一设备根据所述第一metric值和所述第二metric值,确定所述第一设备和所述第二设备之间的路径优于所述第一设备和所述第五设备之间的路径;所述第一设备转发所述第一服务发现消息,不转发所述第三服务发现消息。
在该实现方式中,若该第一设备可以接收到第二设备和该第五设备的服务发现消息的转发消息,那么该第一设备可以根据这两个转发消息中包括的metric值,确定该第一设备和哪个设备之间的路径更优,从而可以选择转发路径更优的设备发送的转发消息。
结合第一方面及其上述实现方式,在第一方面的第七种实现方式中,所述第一metric值采用所述第二设备与所述第一设备的醒来时间的交集表征,所述第二metric值采用所述第五设备与所述第一设备的醒来时间的交集表征,所述第一设备根据所述第一metric值和所述第二metric值,确定所述第一设备和所述第二设备之间的路径优于所述第一设备和所述第五设备之间的路径,包括:若所述第二设备与所述第一设备的醒来时间的交集大于所述第五设备与所述第一设备的醒来时间的交集时,所述第一metric值大于所述第二metric值,所述第一设备在所述第一metric值大于所述第二metric值时,确定所述第一设备和所述第二设备之间的路径优于所述第一设备和所述第五设备之间的路径;或若所述第二设备与所述第一设备的醒来时间的交集大于所述第五设备与所述第一设备的醒来时间的交集时,所述第一metric值小于所述第二metric值,所述第一设备在所述第一metric值小于所述第二metric值时,确定所述第一设备和所述第二设备之间的路径优于所述第一设备和所述第五设备之间的路径。
在该实现方式中,该第一metric值,可以采用第一设备和该第二设备的醒来时间的交集来表征,醒来时间的交集越长,表示设备可以用于传输数据的时间越长,那么路径越优,可选地,可以设置醒来时间越长,metric值越 大或越小,也就是可以建立醒来时间与该metric值成正比或反比关系,那么该第一设备可以在醒来时间的交集与该metric值成正比时,确定metric值较大的路径较优,或在醒来时间的交集与该metric值成反比时,确定metric值较小的路径较优。
结合第一方面及其上述实现方式,在第一方面的第八种实现方式中,所述第一服务发现消息还携带以下信息中的至少一项,以便于所述第一设备计算所述第二设备和所述第一设备之间的第一metric值,所述第一metric用于衡量所述第一设备和所述第二设备之间的路径的优劣程度:所述第二设备的休眠规律、所述第二设备的休眠时间、所述第二设备的工作规律和所述第二设备的工作时间。
在该实现方式中,如果第一设备和第二设备之间没有通信过,该第一设备可能不知道该第二设备的上述信息,可选地,此时该第一服务发现消息可以携带上述信息中的一种或几种,以便于该第一设备根据该信息计算该第一设备和该第二设备之间的第一metric值,该第一metric值可以衡量该第一设备和该第二设备之间的路径的优劣程度。
结合第一方面及其上述实现方式,在第一方面的第九种实现方式中,所述第一服务发现消息还携带NAN中的变化信息,所述方法还包括:在所述服务标识信息和第一服务标识匹配时,确定所述第一设备为所述服务发起设备的服务响应设备,其中,所述服务标识信息为所述服务发起设备根据所述服务发起设备的服务信息生成,或所述服务发起设备根据所述NAN中的变化信息和所述服务发起设备的服务信息生成,所述第一服务标识为所述第一设备根据所述第一设备的服务信息生成,或所述第一设备根据所述NAN中的变化信息和所述第一设备的服务信息生成,所述服务发起设备的服务信息指示所述服务发起设备支持的服务的信息或查询的服务的信息,若所述服务发起设备的服务信息为所述服务发起设备设备支持的服务的信息,所述第一设备的服务信息为所述第一设备查询的服务的信息;或若所述服务发起设备的服务信息为所述服务发起设备设备查询的服务的信息,则所述第一设备的服务信息为所述第一设备支持的服务的信息;所述NAN中的变化信息包括以下信息中的至少一项:锚主节点的等级AMR、主节点的MR、主节点MP、锚主节点意愿值AMP、随机因子RF、锚主节点的信标帧传输时间AMBTT、时间同步功能TSF值、簇标识和簇级别CG和组密钥group key。
在该实现方式中,该服务标识信息可以为该服务发起设备根据服务发起设备的服务信息生成,或为该服务发起设备根据该NAN中的变化信息和该服务发起设备的服务信息生成,该第一设备可以根据该第一设备的服务信息生成第一服务标识,或根据该第一设备的服务信息结合NAN中的变化信息生成第一服务标识,然后该第一设备可以通过对比该第一服务标识和该服务发起设备的服务标识信息,确定该第一设备是否为该服务发起设备的服务响应设备,因为服务标识信息是服务信息结合变化信息生成的,而变化信息是动态变化的,因此可以保证服务标识是动态改变的,从而可以防止偷听者跟踪。
结合第一方面及其上述实现方式,在第一方面的第十种实现方式中,所述第一服务发现消息还携带所述服务发起设备的标识变化规律信息,所述标识变化规律信息指示所述服务发起设备的标识信息的变化规律,以便于在所述服务发起设备的标识信息发生变化后,所述第一服务发现消息的接收设备根据所述标识变化规律信息识别所述服务发起设备,或根据所述标识变化规律信息更新所述服务发起设备的标识信息。
在该实现方式中,该第一服务发现消息还可以携带该服务发起设备的标识变化规律信息,以便于在该服务发起设备的标识信息发生变化后,该服务发现消息的接收设备根据该标识变化规律信息识别该服务发起设备,或根据该标识变化规律信息更新该服务发起设备的服务信息。由于服务信息也是变化的,从而提高了服务发现过程的安全性和私密性。
可选地,该服务发现消息还可以携带所述服务发起设备的服务标识变化规律信息,所述服务标识变化规律信息指示所述服务发起设备的服务标识信息的变化规律,以便于在所述服务发起设备的服务标识信息发生变化后,所述服务发现消息的接收设备根据所述标识变化规律信息识别所述服务发起设备的服务标识,或根据所述标识变化规律信息更新所述服务发起设备的服务标识信息。
结合第一方面及其上述实现方式,在第一方面的第十一种实现方式中,在所述第一设备发送第二服务发现消息之前,所述方法还包括:在确定所述第一设备具有转发能力时,所述第一设备发送所述第二服务发现消息;或在确定所述第一设备不具有转发能力时,所述第一设备不发送所述第二服务发现消息。
在该实现方式中,该第一设备接收到该第一服务发现消息之后,可以根据自己是否具有转发能力来确定是否转发该第一服务发现消息,在有转发能力的情况下,发送该第二服务发现消息。
结合第一方面及其上述实现方式,在第一方面的第十二种实现方式中,所述服务发现消息的消息格式为以下中的一种:服务发现帧SDF消息格式、动作action帧消息格式、信标帧beacon消息格式和用户自定义消息格式。
在该实现方式中,该服务发现消息可以为SDF消息中的订阅(subscribe)消息或广播(publish)消息,或者可以采用动作帧格式定义的一个新的帧,也可以采用现有的其他的帧格式,或者为用户自定义的帧格式等。
结合第一方面及其上述实现方式,在第一方面的第十三种实现方式中,所述服务发现消息还携带多跳指示信息,所述多跳指示信息指示用于发现多跳范围内的服务响应设备。
在该实现方式中,该服务发现消息可以包括多跳指示信息,可以通过该多跳指示信息指示服务发现为1跳或多跳,也就是本发明实施例既可以做多跳的服务发现,也可以实现1跳的服务发现,从而可以实现1跳或多跳的服务发现过程中的1跳或多跳的路径发现。
第二方面,提供了一种临近感知网络NAN中用于服务发现的方法,该方法包括:第一设备接收第二设备的第一服务发现消息,所述第一服务发现消息携带服务标识信息和第一路径信息,所述服务标识信息指示服务发起设备查询的服务或所述服务发起设备支持的服务,所述第二设备为服务发起设备或服务中转设备;所述第一设备根据所述服务标识信息,确定所述第一设备为所述服务发起设备的服务响应设备;所述第一设备发送响应消息,所述响应信息携带第二路径信息,所述第二路径信息包括所述服务发起设备的标识信息和所述第一设备的标识信息,或所述服务发起设备的标识信息、所述第二设备的标识信息和所述第一设备的标识信息。
在该实现方式中,该第一设备为服务发起设备的服务响应设备,该第二设备可以为服务发起设备或服务中转设备,该第一设备接收到该第一服务发现消息后,可以根据该第一服务发现消息中的服务标识信息确定自身为该服务发起设备的服务响应设备,即该第一设备为能够提供该服务发起设备查询的服务的设备,或需要该服务发起设备支持的服务的设备,从而可以回复响应消息,在该响应消息中携带包括该第一设备的标识信息的路径信息。
结合第二方面,在第二方面的第一种实现方式中,所述第一设备发送响应消息,包括:所述第一设备向所述第二设备发送所述响应信息;或若所述第一设备处于第一NAN数据簇NDC中,所述第一设备在所述第一NDC中广播所述响应消息;或所述第一设备处于至少两个NDC中,所述第一设备在所述至少两个NDC中的至少一个NDC中广播所述响应消息;或若所述第一设备不处于所述NAN中的任何一个NDC中,所述第一设备加入所述NAN中的第二NDC中,在所述第二NDC中广播所述响应消息。
在该实现方式中,该第一设备可以根据路径信息沿路反向传输该响应消息,也就是接收到哪个中转设备转发的服务发现消息,就向哪个中转设备回复响应消息,或者该第一设备还可以在服务匹配成功后,在该第一设备所在的NDC中广播该响应消息,或者如果该第一设备不处于任何一个NDC中,该第一设备可以选择加入一个NDC,然后在该NDC中广播该响应消息,其他NDC的中转设备接收到该响应消息后,可以在另一个NDC中广播该响应消息,这样,该响应消息依次传输下去直到服务发起设备,从而可以建立服务响应设备和服务发起设备之间的基于NDC的传输路径。
结合第二方面及其上述实现方式,在第二方面的第二种实现方式中,所述第一设备根据所述服务标识信息,确定所述第一设备为所述服务发起设备的服务响应设备,包括:所述第一设备在所述服务标识信息和所述第一设备的第一服务标识匹配时,确定所述第一设备为所述服务发起设备的服务响应设备;其中,所述服务标识信息为所述服务发起设备根据所述服务发起设备的服务信息生成,或所述服务发起设备根据所述NAN中的变化信息和所述服务发起设备的服务信息生成,所述第一服务标识为所述第一设备根据所述第一设备的服务信息生成,或所述第一设备根据所述NAN中的变化信息和所述第一设备的服务信息生成,所述服务发起设备的服务信息指示所述服务发起设备支持的服务的信息或查询的服务的信息;若所述服务发起设备的服务信息为所述服务发起设备支持的服务的信息,则所述第一设备的服务信息为所述第一设备查询的服务的信息;或若所述服务发起设备的服务信息为所述服务发起设备查询的服务的信息,则所述第一设备的服务信息为所述第一设备支持的服务的信息;所述NAN中的变化信息包括以下信息中的至少一项:锚主节点的等级AMR、主节点的MR、主节点MP、锚主节点意愿值AMP、随机因子RF、锚主节点的信标帧传输时间AMBTT、时间同步功能 TSF值、簇标识和簇级别CG和组密钥group key。
在该实现方式中,该服务标识信息可以为该服务发起设备根据该服务发起设备的服务信息生成,或为该服务发起设备根据该NAN中的变化信息和该服务发起设备的服务信息生成,该第一设备可以根据该第一设备的服务信息生成第一服务标识,或根据该第一设备的服务信息结合NAN中的变化信息生成第一服务标识,然后该第一设备可以通过对比该第一服务标识和该服务发起设备的服务标识信息,确定该第一设备是否为该服务发起设备设备的服务响应设备,因为服务标识信息是服务信息结合变化信息生成的,而变化信息是动态变化的,因此可以保证服务标识是动态改变的,从而可以防止偷听者跟踪,因此保证了服务发现过程的安全性。
结合第二方面及其上述实现方式,在第二方面的第三种实现方式中,所述方法还包括:所述第一设备转发所述第一服务发现消息;或根据所述第一服务发现消息中携带的扩散指示信息,确定是否转发所述第一服务发现消息,所述扩散指示信息指示在所述第一设备为所述服务发起设备的服务响应设备时是否转发所述转发消息。
在该实现方式中,该第一设备可以在服务匹配成功后,继续转发该第一服务发现消息,以便于查询更多的服务响应设备,或者也可以根据该第一服务发现消息中的扩散指示信息,确定是否转发该第一服务发现消息。
结合第二方面及其上述实现方式,在第二方面的第四种实现方式中,所述响应消息包括跳数信息和第一衡量metric值,所述跳数信息由所述服务发现消息从所述服务发起设备传输到所述服务响应设备的转发次数确定,所述第一metric值用于衡量所述第一设备到所述服务响应设备之间的路径的优劣程度。
在该实现方式中,该响应消息还可以包括跳数信息和第一metric信息,该跳数信息可以用于确定该服务发起设备和服务响应设备之间的最大的传输距离,该第一metric值可以用于该服务响应设备选择最优的回程路径。
第三方面,提供了一种终端设备,用于执行第一方面或第一方面的任一种实现方式中的方法。
具体地,该终端设备可以包括用于执行第一方面或第一方面的任一种实现方式中的方法的各单元。
第四方面,提供了一种终端设备,用于执行第二方面或第二方面的任一 种实现方式中的方法。
具体地,该终端设备可以包括用于执行第二方面或第二方面的任一种实现方式中的方法的各单元。
第五方面,提供了一种终端设备,该终端设备包括收发器、存储器、处理器和总线系统。其中,该收发器、该存储器和该处理器通过该总线系统相连,该存储器用于存储指令,该处理器用于执行该存储器存储的指令,以控制该收发器接收或发送信号,并且当该处理器执行该存储器存储的指令时,该执行使得该处理器执行第一方面或第一方面的任一种实现方式中的方法。
第六方面,提供了一种终端设备,该终端设备包括收发器、存储器、处理器和总线系统。其中,该收发器、该存储器和该处理器通过该总线系统相连,该存储器用于存储指令,该处理器用于执行该存储器存储的指令,以控制该收发器接收或发送信号,并且当该处理器执行该存储器存储的指令时,该执行使得该处理器执行第二方面或第二方面的任一种实现方式中的方法。
基于上述技术方案,本发明实施例的NAN中用于服务发现的方法和终端设备,能够在服务发现的过程中实现路径发现的过程,因此减少了大量的空口消息,节约了大量的时频资源。
附图说明
为了更清楚地说明本发明实施例的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。
图1是本发明实施例的一个应用场景的示意图。
图2是根据本发明实施例的NAN中用于服务发现的方法的示意性流程图。
图3是根据本发明另一实施例的NAN中用于服务发现的方法的示意性流程图。
图4是根据本发明再一实施例的NAN中用于服务发现的方法的示意性流程图。
图5是根据本发明实施例的终端设备的示意性框图。
图6是根据本发明另一实施例的终端设备的示意性框图。
图7是根据本发明实施例的终端设备的示意性框图。
图8是根据本发明另一实施例的终端设备的示意性框图。
具体实施方式
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。
本发明的技术方案,可以应用于各种通信系统,例如:全球移动通讯系统(英文全称:Global System of Mobile communication,简称:GSM),码分多址(英文全称:Code Division Multiple Access,简称:CDMA)系统,宽带码分多址(英文全称:Wideband Code Division Multiple Access Wireless,简称:WCDMA),通用分组无线业务(英文全称:General Packet Radio Service,简称:GPRS),长期演进(英文全称:Long Term Evolution,简称:LTE),NAN系统等。
用户设备(英文全称:User Equipment,简称:UE)也可称之为移动终端(英文全称:Mobile Terminal,简称:MT)、终端设备、移动用户设备等,可以经无线接入网(英文全称:Radio Access Network,简称:RAN)与一个或多个核心网进行通信,用户设备可以是移动终端,如移动电话(或称为“蜂窝”电话)和具有移动终端的计算机,例如,可以是便携式、袖珍式、手持式、计算机内置的或者车载的移动装置。
图1示出了本发明实施例的一个应用场景的示意图,如图1所示,服务发起设备为发送服务发现消息的设备,该服务发现消息用于发现无线传输距离外的服务响应设备(也可以称为目标设备),该服务响应设备为能够提供该服务发起设备所需的服务的设备,或需要该服务发起设备的支持的服务的设备;服务中转设备,为转发该服务发起设备发送的该服务发现消息的设备,在图1的应用场景中,服务中转设备包括第一中转设备和第二中转设备,在实际应用中,还可能包括更多的服务中转设备,服务中转设备转发的是服务发起设备发送的服务发现消息,或转发的是其他服务中转设备发送的服务发现消息的转发消息。
应理解,本发明实施例仅以2跳的应用场景为例进行说明,但本发明实 施例并不限于此,该系统还可以包括更多的服务中转设备,服务发起设备到服务响应设备之间的路径可以为3跳或更多跳等,从服务发起设备到服务响应设备的跳数为n可以理解为服务发起设备发送的服务发现消息需要经过n-1个服务中转设备的转发才到达服务响应设备,例如,服务发起设备到服务响应设备中间有一个服务中转设备,服务发现消息经过一次转发就可以到达服务响应设备,这时从服务发起设备到服务响应设备的跳数为2。
还应理解,设备A为设备B的上一跳设备的含义是,在从服务发起设备到服务响应设备的某一条传输路径上,设备B为设备A发送的消息的接收设备;设备C为设备B的下一跳设备指的是,在从服务发起设备到服务响应设备的某一条传输路径上,设备C为设备B发送的消息的接收设备。
下面结合图1所示的2跳的应用场景,详细介绍如何在服务发现过程中,完成服务发起设备到服务响应设备之间的路径的发现的过程。图2示出了从设备交互的角度描述的根据本发明实施例的NAN中用于服务发现的方法200的一个具体流程图。在图2中,设备A为服务发起设备,设备B和设备D为服务中转设备,设备C为服务响应设备。
在S201中,设备A发送服务发现消息。
具体地,设备A作为服务发起设备,想要发起1跳或多跳范围内设备的服务发现,该设备A可以发送服务发现消息,该服务发现消息携带服务标识信息,该服务标识信息指示服务发起设备查询的服务或该服务发起设备支持的服务。可选地,该服务发现消息可以为服务查询消息或服务广播消息,若该服务发现消息为服务查询消息,该服务查询消息用于发现能够提供该服务发起设备查询的服务的设备,此时,该服务标识信息可以指示该设备A需要发现的服务,若该服务发现消息为服务广播消息,该服务广播消息可以用于广播服务发起设备支持的服务,此时,该服务标识信息指示设备A支持的服务。
例如,该服务标识信息可以为服务标识(英文全称:Service Identifier,简称:SID)或一个位图(bitmap)形式等。该服务标识信息可以为该服务发起设备根据服务信息生成的,或该服务发起设备根据服务信息结合NAN中的变化信息生成的,可选地,该NAN中的变化信息可以包括以下信息中的至少一项:锚主节点的等级(Anchor Master Rank,简称AMR)、主节点的等级(Master Rank,简称MR)、主节点意愿值(Master Preference,简称 MP)、锚主节点意愿值(Anchor Master Preference,简称AMP)、随机因子(Random Factor,简称RF)、锚主节点的信标帧传输时间(Anchor Master Beacon Transmission Time,简称AMBTT)、时间同步功能(Time Synchronization Function,简称TSF)值、簇标识、簇级别(Cluster Grade,简称CG)、和接口地址(interface address),该NAN中的变化信息也可以是上述某些信息的部分或全部。该服务信息可以为服务名称、服务名称的哈希值或服务编号等,本发明实施例对此不作限制。
具体地,该服务标识信息可以为将该服务信息和该变化信息中的一种或几种进行运算(例如,进行哈希运算)以生成一个映射值,然后将该映射值确定该设备A的服务标识信息。
例如,该服务标识信息可以根据该服务信息和TSF值进行哈希运算得到,或根据该服务信息和该TSF值的部分信息进行哈希运算得到,或根据该服务信息的哈希值和TSF值进行哈希运算得到,或根据服务信息的哈希值和TSF值的部分信息进行哈希运算得到,或根据服务信息和TSF值以及AMR进行哈希运算得到,或根据服务信息和TSF值的部分信息以及AMR的部分信息进行哈希运算得到,或根据该服务信息的哈希值的部分信息和TSF值的部分信息以及AMR的部分信息进行哈希运算得到,或根据该服务信息的哈希值的部分信息和TSF值的部分信息进行哈希运算得到等。
可选地,该服务标识信息还可以采用位图形式来表示,该设备A可以根据不同的服务信息生成该服务标识信息,该生成服务标识信息的过程可以是将不同的服务信息经过计算(例如采用哈希运算)映射到位图中的不同比特位,即不同比特位表示不同的服务标识,具体地,该位图可以是布隆过滤器位图。
可选地,该第一服务发现消息还可以携带该服务发起设备的标识变化规律信息,以便于在该服务发起设备的标识信息发生变化后,该服务发现消息的接收设备根据该标识变化规律信息识别该服务发起设备,或根据该标识变化规律信息更新该服务发起设备的标识信息。
可选地,该第一服务发现消息还可以携带该服务发起设备的服务标识变化规律信息,以便于在该服务发起设备的服务标识信息发生变化后,该服务发现消息的接收设备根据该服务标识变化规律信息识别该服务发起设备,或根据该标识变化规律信息更新该服务发起设备的服务标识信息。
可选地,该服务发现消息还可以携带多跳指示信息,该多跳指示信息指示该服务发起设备需要发现多跳范围内的服务响应设备,多跳指的是该服务发现消息需要经过服务中转设备的转发才能到达服务响应设备。
可选地,该服务发现消息可以采用在现有的消息帧,例如,服务发现帧(英文全称:Service Discovery Frame,简称:SDF)、动作(Action)帧、信标帧(Beacon)中加入用于发现多跳服务相关的属性,来指示该服务发现消息用于发现多跳范围内的服务响应设备,或者也可以采用用户自定义的消息格式等,本发明实施例对此不作限制。
可选地,该服务发现消息还可以包括路径信息,例如,该路径信息可以包括该服务发起设备也就是设备A的标识信息,可选地,该标识信息可以为媒体接入控制(英文全称:Media Access Control,简称:MAC)地址信息,或接口地址(interface address)信息等用来区分该设备的标识信息,本发明实施例对此不作限制。
可选地,该路径信息可以承载于该服务发现消息的MAC头中,例如,该路径信息中的设备的标识信息可以为MAC头中的地址信息。具体地,该服务发起设备的标识信息可以为源地址(英文全称:Source Address,简称:SA),例如,该服务发现消息的地址信息可以按照以下方式设置:该服务发现消息的SA可以设置为该服务发起设备也就是设备A的MAC地址,接收地址(英文全称:Receive Address,简称:RA)可以设置为设备A的广播的地址,例如wi-fi的地址,发送地址(英文全称:Transmit Address,简称:TA)可以设置为设备A的地址,由于此时还未发现服务响应设备,所以目的地址(英文全称:Destination Address,简称:DA)可以为空。需要说明的是,该路径信息也可以通过其他方式承载在该服务发现消息中,本发明实施例不对该路径信息在该服务发现消息中的承载方式作出限定。
可选地,该路径信息还可以包括衡量(metric)信息,该metric值可以用于衡量路径的优劣,该衡量信息可以用于该设备A的下一跳设备,也就是该服务发现消息的接收设备,根据该衡量信息发现最优路径。
下面结合具体例子详细介绍可以采用哪些参数来表征metric值。
例如,可以用设备的醒来时间表征该metric值,例如,设备X和设备Y之间的metric值可以用设备X与设备Y的醒来时间的交集来衡量。例如,NAN网络以信道6为发现信道,在该信道上每512时间单位(英文全称: Time Unit,简称:TU)(大约1024us)内设置一个DW,DW的持续时长为16TU。可以以512TU为单位,以在该512TU内该设备X和该设备Y都醒来的时间长短来衡量该设备X和设备Y之间的metric值。例如,在512TU内,设备X和设备Y都醒来的时间为30TU,设备X和设备Z都醒来的时间为20TU。可选地,可以设置醒来时间越长,该metric值越大,路径越优,若30TU对应的metric值为3,20TU对应的metric值为2,那么,通过对比,可以确定该设备X和设备Y之间的路径优于设备X与设备Z之间的路径;或者可以设置醒来时间与该metric值成反比,也就是醒来时间越长,该metric值越小,那么metric值越小的路径越优。或者也可以以该512TU内该设备X与设备Y的休眠时间来衡量该metric值,例如,可以设置休眠时间越短,该metric值越大,设备之间的路径越优,或者可以设置休眠时间越短,该metric值越小,设备之间的路径越优等,本发明实施例对此不作限制。
或者,可以用设备之间所在的NDC的base schedule的交集来表征该两个设备之间的metric值,例如,可以设置交集越大,metric值越大,设备之间的路径越优。若设备X到设备Y的metric值为3,设备X到设备Z的metric值为2,通过对比,可以确定该设备X和设备Y之间的路径优于设备X与设备Z之间的路径。或者也可以设置交集越大,metric值越小,那么metric值越小的设备之间的路径越优。
或者,可以用设备的MP来表征该metric值,例如,可以设置设备的MP值越大,metric值越大,路径越优。那么,如果设备Z到设备Y的metric值大于设备X到设备Y的metric值,可以确定设备Z到设备Y的路径优于设备X到设备Y的路径,从而设备Y可以选择转发设备Z发送的服务发现消息,而不用转发设备X发送的服务发现消息,从而可以节省空口资源。同样地,也可以设置该设备的MP值越大,该metric值越小,来表示该设备和下一跳设备之间的路径越优等。
或者,可以用设备的等级值来表征该metric值,设备的等级值用于衡量设备安排base schedule的意愿值,意愿值越大,就表示越愿意去安排base schedule,设备的等级值越大。可以设置该设备的等级值越大,该metric值越大,该设备和下一跳设备之间的路径越优。那么,如果设备X到设备Y的metric值为3,设备X到设备Z的metric值为2,可以确定设备X到设备Y的路径优于设备X到设备Z的路径。同样地,可以设置等级值越大,该 metric值越小,那么metric值越小的路径越优等。
或者,可以用该设备所在的NDC的base schedule的时间长短来表征该metric消息。例如,可以设置该设备的所在的NDC的base schedule时间越长,metric值越大。举例说明:设备Y所在的NDC的base schedule时间大于设备Z所在的NDC的base schedule时间,设备X到设备Y的metric值为3,设备X到设备Z的metric值为2,那么相比之下,设备X到设备Y的路径优于设备X到设备Z的路径。同样地,可以设置设备所在的NDC的base schedule时间越大,metric值越小,那么metric值越小的路径越优等。
或者,也可以用设备的角色信息来表征该metric消息。
设备的角色信息可以为锚主节点(英文全称:Anchor Master,AM)、主节点(master),同步非主节点(sync non master),非同步非主节点(non sync non master),代理服务器(proxy server),代理客户端(proxy client),可以根据上述角色信息中的一种或几种的优先级作为该metric值。可以设置设备的角色的优先级越高,metric值越大,metric值越大的路径越优。例如,设备Y的角色为anchor master,设备Z的角色为non sync non master,设备X到设备Y的metric为3,设备X到设备Z的metric为2,那么,可以确定设备X到设备Y的路径优于设备X到设备Z的路径。同样地,可以设置设备的角色的优先级越高,metric值越小,那么metric值越小的路径越优。
可选地,该服务发现消息还可以携带以下信息中的至少一项,以便于该服务发现消息的接收设备计算该设备A和该接收设备之间的第一衡量metric值
该设备A的休眠规律、该设备A的休眠时间、该设备A的工作规律和该设备A的工作时间。
下面以设备A的工作时间为具体实施例来详细介绍设备B如何根据设备A的工作时间计算设备A和设备B之间的第一metric值。
例如,该第一metric值可以用位图的形式来表示,位图第一维度为时间信息,以16个TU为设备在某个信道上工作的最小时间单元,在每个16TU内,设备处于休眠状态或工作在某个信道上。位图第二维度为信道信息,即该设备能够工作的信道信息,可以设置一个最小时间单元和一个信道对应的单元为一个衡量单元,可以通过将某个信道和某个最小时间单元对应的单元置1来表示该设备在该最小时间单元指示的时间段工作于该信道上,通过将 某个信道和某个最小时间单元对应的单元置0或置空来表示该设备在该最小时间单元指示的时间段进入休眠状态,该设备A通过将设备A的工作时间的信息发送给设备B,该设备B可以根据该设备A的工作时间的信息将位图中的相应单元置1,然后根据设备B的工作时间的信息将位图中的相应单元置1,通过将位图中该设备A置1的单元与位图中设备B置1的单元进行匹配,确定该第一metric值。
应理解,还可以采用其他方式来计算该第一metric信息,例如,可以以位图中该设备A和设备B的衡量单元的匹配的百分比作为该第一metric值,例如,位图中该设备A的衡量单元数为32个,在该32个衡量单元中,有16个衡量单元可以用于设备B传输数据,那么该衡量单元匹配的百分比为50%,可以确定该第一metric值为50%。或者可以对位图中匹配度的范围进行量化,某一个匹配度的范围可以对应一个预设的第一metric值,例如匹配度的范围为10%~20%时,可以对应第一metric值为M,匹配度的范围为80%~90%时,可以对应第一metric值为N,其中M<N,那么在确定该设备A和设备B的衡量单元的匹配度为85%时,可以确定对应的第一metric值为N。可选地,该第一metric值还可以为确定的数值或等级值,例如,可以用字母、符号表征,也可以表示为一个范围等,本发明实施例对此不作限制
可选地,该服务发现消息可以以广播或组播的方式发送,也可以采用单播的方式发送,本发明实施例对此不作限制。
应理解,该服务发现消息可以在DW中广播,也可以在其他时间段广播,或者可以在该设备A所在的NDC中广播,进一步可以在该设备A所在的NDC的base schedule中广播等,本发明实施例对此不作限制。
还应理解,该服务发现消息还可以包括扩散指示信息,该扩散指示信息用于指示在发现满足条件的服务响应设备后,该服务响应设备是否继续转发该服务发现消息。若该服务发现消息只需发现一个满足条件的服务响应设备,则该扩散指示信息可以指示在该服务响应设备接收到该服务发现消息后,不扩散该服务发现消息,否则,继续转发该服务发现消息,以便于发现更多的服务响应设备。
在S202中,该设备B转发该服务发现消息。
可选地,在该设备B接收该设备A发送的服务发现消息后,该设备B确定自身为具有转发能力的设备,例如,代理(Proxy)设备、master设备、 non master sync设备、或处于NDC中的设备时,转发该服务发现消息,否则不转发该服务发现消息。
可选地,该设备B还可以根据该接收的该服务发现消息中携带的序列号,确定是否转发该服务发现消息,该序列号指示该服务发起设备需要发现的服务的顺序,如果该服务发起设备发起新的服务发现消息,更新该序列号,例如,可以将序列号加1,如果该设备B接收到的服务发现消息中的序列号小于或等于之前接收到的服务发现消息的序列号,该设备B可以确定该服务发现消息不是最新的服务发现消息,可以选择不转发该服务发现消息。
在确定转发该服务发现消息后,该设备B还可以根据该服务发现消息,获取服务信息和路径信息,然后可以在转发该服务发现消息时,携带该服务标识信息以及更新后的路径信息。
具体地,该设备B可以根据该服务发现消息中携带的服务标识信息获取服务发起设备也就是该设备A查询的服务信息,或支持的服务信息。可选地,该设备B可以根据该服务标识信息,在确定自身满足设备A查询的服务信息时,或在确定设备A支持的服务信息为自身需要的服务信息时,向设备A回复响应消息,该响应消息可以携带该服务标识信息,也可以携带该设备B的标识信息,例如,MAC地址信息等。或者该设备B在通过匹配该服务标识信息,确定自身不是服务发起设备的服务响应设备时,若该设备B知道设备X为该服务发起设备需要发现的服务响应设备,可以将该服务发现消息以单播的方式发送给该设备X。
可选地,设备B还可以根据该服务发现消息,获取路径信息,该路径信息包括该服务发起设备也就是设备A的标识信息,例如,MAC地址信息或接口地址信息等。可选地,该设备A的标识信息可以承载于该服务发现消息的MAC头中的地址信息中,例如,可以从该服务发现消息的MAC头中的地址信息中的SA信息中获取该设备A的MAC地址信息。
可选地,若该设备B接收的是服务发现消息的转发消息,也就是说发送该转发消息的设备为另一个服务中转设备,此时,该路径信息还可以包括该服务中转设备的标识信息,该标识信息也可以为该服务中转设备的MAC地址信息,可选地,该标识信息也可以承载于该服务发现消息的MAC头中的地址信息中,该设备B可以从该服务发现消息的MAC头中的地址信息中的TA信息中获取该服务中转设备的MAC地址信息。
若该设备B确定转发该服务发现消息,该设备B可以以广播或单播的方式将该服务发现消息扩散出去。例如,若该设备B为master设备,或non master sync设备,该设备B可以选择在DW中广播该服务发现消息;或者,若该设备B为Proxy设备,或relay设备,该设备B也可以选择在DW中广播该服务发现消息;或者,若设备B为某个NDC中的设备,该设备B可以在该NDC中广播该服务发现消息,也可以选择在该NDC的base schedule中广播该服务发现消息;或者,若该设备B处于多个不同的NDC中,该设备B可以选择在该多个不同的NDC中广播该服务发现消息,也可以在该多个不同的NDC的base schedule中广播该服务发现消息等,本发明实施例对此不做限制。
可选地,设备B在转发该服务发现消息之前,更新该服务发现消息的转发消息的路径信息,此时,该转发消息的路径信息不仅可以包括服务发起设备也就是设备A的标识信息,还可以包括设备B的标识信息。该标识信息可以为设备的MAC地址信息,设备的标识信息可以承载于该服务发现消息的转发消息的MAC头中,例如,该转发消息的地址信息可以按照以下方式设置:SA可以设置为服务发起设备也就是设备A的MAC地址,RA可以设置为设备A的广播的地址,例如wi-fi的地址,TA为该设备B的地址,由于此时还未发现服务响应设备,DA可以为空。可选地,该路径信息还可以包括设备A到设备B的metric值,该metric值用于衡量设备A到设备B之间的路径的优劣程度,同样地,该metric值可以采用S201中描述的metric值的任何一种方式来表征,为了避免重复,这里不再赘述。
可选地,若该设备B的上一跳设备为服务发起设备到服务响应设备之间的另一个服务中转设备时,该设备还可以接收多个转发消息,该多个转发消息中的每个转发消息的路径信息中都携带一个metric值,该设备B可以根据多个metric值,确定哪个metric值指示的路径较优,从而可以选择转发携带该metric值的设备发送的转发消息。例如,该设备B接收到设备M和设备N的转发消息,根据这两个转发消息中携带的metric值,该设备B确定设备M到设备B的路径优于设备N到设备B的路径,那么该设备B可以选择转发设备M发送的转发消息,而不转发设备N发送的转发消息,这样避免了重复转发,因此在一定程度上节约了空口资源,同时也可以选择性能更优的路径作为服务发起设备到服务响应设备之间的传输路径。
在S203中,设备C回复响应消息。
具体地,设备C接收该设备B以广播或单播方式发送的服务发现消息,可选地,若该服务发现消息为服务查询消息,该服务查询消息携带的服务标识信息指示服务发起设备查询的服务信息,若该设备C支持该服务信息,该设备C可以回复响应消息;或者,若该服务发现消息为服务广播消息,该服务发现消息携带的服务标识信息指示该服务发起设备支持的服务信息,该设备C在确定需要设备A支持的服务信息时,该设备C可以回复响应消息。
可选地,该响应消息还可以携带服务标识信息,若服务发现消息用于发现多个服务信息,该服务标识信息可以指示该设备C支持的服务信息或需要的服务信息,也就是该设备A和设备C匹配成功的服务信息,该设备C可以支持该多个服务信息中的某个或某几个,本发明实施例对此不作限制。
可选地,该设备C可以根据该设备A的第一服务标识和该设备C的第二服务标识是否匹配,确定该设备C是否为该设备A的服务响应设备。
其中,该第一服务标识可以为该设备A根据该设备A的第一服务信息生成,或该设备A根据该NAN中的变化信息和该设备A的第一服务信息生成的,该第二服务标识为该设备C根据该设备C的第二服务信息生成,或根据该NAN中的变化信息和该第二服务信息生成的;
若该第一服务信息为该设备A支持的服务的信息,则对应的该第二服务信息为该设备C查询的服务的信息;若该第一服务信息为该设备A查询的服务的信息,则对应的该第二服务信息为该设备C支持的服务的信息。
其中,该NAN中的变化信息可以包括以下信息中的至少一项:锚主节点的等级(英文全称:Anchor Master Rank,简称:AMR)、主节点的等级(英文全称Master Rank,简称:MR)、主节点意愿值(英文全称:Master Preference,简称:MP)、锚主节点意愿值(英文全称:Anchor Master Preference,简称:AMP)、随机因子(英文全称:Random Factor,简称:RF)、锚主节点的信标帧传输时间(英文全称:Anchor Master Beacon Transmission Time,简称:AMBTT)、时间同步功能(英文全称:Time Synchronization Function,简称:TSF)值、簇标识、簇级别(英文全称:Cluster Grade,简称:CG)和接口地址(interface address),也可以是上述某些信息的整体或部分,举例来说,可以取TSF值的部分信息生成服务标识,例如,可以取TSF值的后24bit生成服务标识。
可选地,该第一服务标识可以是SID,基于服务发起设备的服务信息生成,例如,可以对该服务信息进行哈希运算得到(或进一步取哈希运算后的结果的部分信息作为SID),或者可以结合该NAN中的变化信息中的一种或多种进行处理,比如进行哈希运算处理得到;或者可以结合该设备A自身的变化信息进行处理得到。这样可保证该第一服务标识的动态改变,防止偷听者跟踪。可选地,该哈希运算可以是SHA256哈希算法。
具体地,该第一服务标识可以为将该服务信息和该变化信息中的一种或几种进行运算以生成一个映射值,然后将该映射值确定该设备A的第一服务标识。
可选地,该第一服务标识可以采用S201中描述的位图形式来表示,同样地,该设备C也可以将不同的第二服务信息计算后映射到该第二服务标识的位图中的不同比特位,通过查看该第一服务标识的位图中与该第二服务标识的位图中对应位置的比特位是否相同,例如,如果对应位置的比特位都为1,可以确定该设备A和设备C的服务信息匹配。
可选地,可以在设备C的多个服务标识与该设备A的多个服务标识全部匹配时,该设备C回复响应消息。如果不是全部匹配,该设备C可以不回复响应消息;
或在设备C的多个服务标识与该设备A的多个服务标识部分匹配时,该设备C也可以回复响应消息。部分匹配可以理解为,设备C支持设备A要查询的多个服务中的部分服务,或设备C支持设备A查询的多个服务中的部分服务。
可选地,该响应消息还可以进一步指示该服务响应设备支持部分服务,具体地,该响应消息还可以指示该设备C与设备A匹配成功的服务信息。
可选地,该响应消息还可以携带路径信息,该路径信息包括服务发起设备的标识信息,该设备B的标识信息以及该设备C的标识信息。设备的标识信息可以为设备的MAC地址信息,该路径信息可以承载于该响应消息的MAC头中,例如,该响应消息的地址信息可以按照以下方式设置:SA可以设置为服务发起设备也就是设备A的MAC地址,RA可以设置为设备B的广播的地址,例如wi-fi的地址,TA为该设备C的地址,DA可以为设备C的地址。
可选地,该响应消息还可以包括跳数信息和metric值,其中,该metric 值为设备B到设备C的metric值,该metric值指示该设备B到设备C的路径的优劣。该跳数信息指示从服务发起设备到服务响应设备经过几段路径,该跳数信息可以根据服务发现消息从服务发起设备到服务响应设备经过了几次转发来确定,若该服务发现消息只经过一个服务中转设备的转发就到达了该服务响应设备,服务发起设备到服务响应设备的跳数为2,若该服务发现消息经过n个服务中转设备的转发就到达了该服务响应设备,服务发起设备到服务响应设备的跳数为n+1,该跳数信息可以用于确定服务发起设备到服务响应设备的最大的传输距离。
可选地,该设备C可以以单播方式将该响应消息发送给该设备B;或者若该设备C在NDC中,该设备C可以在其所在的NDC中广播该响应消息,例如,该设备C可以在该NDC的base schedule中广播该响应消息;或者若该设备C不在NAN的任何一个NDC中,该设备C可以选择加入一个NDC,然后在该NDC中广播该响应消息等,本发明实施例对此不作限制。
在S204中,该设备B或设备D转发响应消息。
设备B接收到设备C的响应消息后,确定转发该响应消息,可以根据该响应消息,更新该响应消息的路径信息,可选地,若该路径信息包括metric值,还可以将该metric值更新为该设备C到设备B的metric值,该metric值指示该设备C到设备B的路径的优劣程度。
具体地,更新后的路径信息可以包括该服务发起设备的标识信息,该设备B的标识信息以及服务响应设备也就是该设备C的标识信息,例如,该响应消息的地址信息可以按照以下方式设置:SA可以设置为服务发起设备也就是设备A的MAC地址,RA可以设置为设备C的广播的地址,例如wi-fi的地址,TA为该设备B的地址,DA可以为设备C的地址。
可选地,该设备B可以以单播的方式将该响应消息转发到设备A;或者若设备B和设备C处于相同的NDC中,该设备B可以选择不转发该响应消息;或者,若设备B与设备C不处于相同的NDC中,该设备B可以选择在设备C未广播该响应消息的NDC中广播该响应消息;或者如果该设备B处于多个不同的NDC中,而且该设备B所在的某一个或几个NDC中,有其他设备提前广播该响应消息,该设备B可以选择在除上述一个或几个NDC以外的其他的NDC中广播该响应消息,例如,设备B处于NDC1、NDC2和NDC3中,在设备B广播该响应消息之前,如果设备D在NDC1和NDC2 中已广播该响应消息,那么该设备可以选择只在NDC3中广播该响应消息。也就是说如果在一个NDC中有设备转发了该响应消息,其他的设备可以选择不转发该响应消息,这样可以防止在同一个NDC中多次广播该响应消息,造成空口资源的浪费。
可选地,该响应消息可以采用在现有的消息帧,例如,SDF、action帧、或beacon帧中加入用于发现多跳服务相关的属性来指示该响应消息用于实现多跳范围内的路径发现,或者也可以采用用户自定义的消息格式等,本发明实施例对此不作限制。
在S205中,设备A根据响应消息,获取服务响应设备的路径信息。
可选地,该设备A可以根据设备B或设备D转发的响应消息,获取路径信息,该路径信息可以包括服务发起设备也就是设备A的标识信息,设备B或设备D的标识信息和服务响应设备的标识信息。
可选地,该响应消息的转发消息还可以包括跳数信息和metric值,该metric值为设备C到设备B或设备D的metric值。
若该设备A接收到多个服务响应设备回复的响应消息的转发消息时,该设备A可以根据多个转发消息中的跳数信息和/或metric值,确定选择哪个服务响应设备进行通信。例如,设备A接收到设备B和设备D发送的响应消息的转发消息,若该设备A根据该设备B和设备D发送的响应消息的转发消息,确定该设备B的转发消息指示的服务响应设备距离服务发起设备的跳数小于设备D的转发消息指示的服务响应设备距离服务发起设备的跳数,也就是说,设备B所在的路径上的服务响应设备比设备D所在的路径上的服务响应设备距离服务发起设备也就是设备A的距离更近,从而设备A可以与选择B所在的路径上的服务响应设备进行通信。或者,该设备A可以根据该设备B和设备D发送的响应消息的转发消息中携带的metric值,确定该设备B所在的路径的优于小于设备D所在的路径,从而可以选择与B所在的路径上的服务响应设备进行通信。同样地,该设备A也可以参考其他因素确定与回复响应消息的服务响应设备中的某个或某几个进行通信。
因此,根据本发明实施例的NAN中用于服务发现的方法,能够在服务发现的过程中实现路径发现的过程,因此减少了大量的空口消息,节约了大量的时频资源。
图3示出了从服务中转设备的角度描述的根据本发明实施例的NAN中 用于服务发现的方法300的示意性流程图,如图3所示,该方法300可以由第一设备执行,该方法300包括:
S310,第一设备接收第二设备发送的第一服务发现消息,该第一服务发现消息携带服务标识信息和第一路径信息,该服务标识信息指示服务发起设备查询的服务或该服务发起设备支持的服务,该第二设备为该服务发起设备或服务中转设备,该第一路径信息包括该服务发起设备的标识信息,或该第二设备和该服务发起设备的标识信息;
S320,该第一设备根据该第一路径信息,确定第二路径信息,该第二路径信息包括该服务发起设备的标识信息和该第一设备的标识信息;
S330,该第一设备发送第二服务发现消息,该第二服务发现消息携带该服务标识信息和该第二路径信息。
具体而言,该第一设备可以为图2所示的NAN中用于服务发现的方法200中的设备B,该第一设备可以执行该方法200中的设备B的相关动作,该第二设备可以为根据本发明实施例的NAN中用于服务发现的方法200中的设备A,或者可以为另一个服务中转设备,该第二设备可以执行该方法200中的设备A的相关动作,或者设备B的相关动作。若第二设备为服务发起设备,该第一服务发现消息可以为服务发现消息,若该第二设备为服务中转设备,该第一服务发现消息可以为服务发现消息的转发消息。该第一服务发现消息携带的服务标识信息指示服务发起设备查询的服务信息或支持的服务信息。
可选地,该服务标识信息可以为该服务发起设备的SID,或者其他的唯一标识该服务发起设备的标识信息。
该第一设备可以根据该第一服务发现消息,获取第一路径信息,若该第二设备为服务发起设备,该第一路径信息可以包括服务发起设备的标识信息,若该第二设备为服务中转设备,该第一路径信息可以包括该服务发起设备的标识信息以及该第二设备的标识信息。
在第一设备确定发送该第二服务发现消息时,该第一设备更新该第二服务发现消息包括的第二路径信息,该第二路径信息包括服务发起设备的标识信息和该第一设备的标识信息,可选地,该第一设备的标识信息可以为该第一设备的MAC地址。
可选地,该第二路径信息可以承载于该第二服务发现消息的MAC头中, 例如,该第二服务发现消息的MAC头中的地址信息可以按照以下方式设置:SA可以设置为服务发起设备的MAC地址,RA可以设置为第二设备的广播的地址,例如wi-fi的地址,TA为该第一设备的地址,由于此时还未发现服务响应设备,DA可以为空。
可选地,该服务发现消息可以采用在现有的消息帧,例如,SDF、动作帧、信标帧中加入用于发现多跳服务相关的属性,来指示该服务发现消息用于发现多跳范围内的服务响应设备,或者也可以采用用户自定义的消息格式等,本发明实施例对此不作限制。
具体地,S310~S330详细的步骤可以参见图2中的S201、S202中的相关描述,为了避免重复,这里不再赘述。
因此,本发明实施例的NAN中用于服务发现的方法,能够在服务发现的过程中实现路径发现的过程,因此减少了大量的空口消息,节约了大量的时频资源。
可选地,作为一个实施例,该第一服务发现消息还携带NAN中的变化信息,该服务标识信息可以为该服务发起设备根据该服务发起设备的服务信息生成,或者也可以为该服务发起设备根据该NAN中的变化信息和该服务发起设备的服务信息生成,该服务发起设备的服务信息指示该服务发起设备支持的服务的信息或查询的服务的信息;
若该服务发起设备的服务信息为该服务发起设备设备支持的服务的信息,该第一设备的服务信息为该第一设备查询的服务的信息;或若该服务发起设备的服务信息为该服务发起设备设备查询的服务的信息,则该第一设备的服务信息为该第一设备支持的服务的信息;
该NAN中的变化信息包括以下信息中的至少一项:锚主节点的等级AMR、主节点的等级MR、主节点意愿值MP、锚主节点意愿值AMP、随机因子RF、锚主节点的信标帧传输时间AMBTT、时间同步功能TSF值、簇标识和簇级别CG和组密钥group key。
应理解,该变化信息可以包括以上信息中某个信息的部分或全部,例如,该变化信息可以包括该TSF值的部分或全部,或者可以包括该TSF值的部分和该RF值的全部等,本发明实施例对此不作限制。
具体地,该服务发起设备可以通过将服务信息(例如,服务名称或服务名称的哈希值)和该变化信息中的至少一项进行计算生成映射值,并将该映 射值作为该服务标识信息。例如,该服务发起设备可以将该服务信息结合TSF值进行哈希运算生成该服务标识信息,或将该服务信息结合TSF值的部分信息进行哈希运算生成该服务标识信息,或者也可以将该服务信息的哈希值和该TSF的部分或全部下行进行哈希运算生成该服务标识信息等,本发明实施例对此不作限制。
可选地,作为一个实施例,该方法300还包括:
若该服务标识信息和该第一设备的第一服务标识匹配,确定该第一设备为该服务发起设备的服务响应设备;
其中,该第一服务标识为该第一设备根据该第一设备的服务信息生成,或根据该NAN中的变化信息和该第一设备的服务信息生成,该服务发起设备的服务信息指示该服务发起设备支持的服务的信息或查询的服务的信息;
若该服务发起设备的服务信息为该服务发起设备支持的服务的信息,则该第一设备的服务信息为该第一设备查询的服务的信息;或若该服务发起设备的服务信息为该服务发起设备查询的服务的信息,则该第一设备的服务信息为该第一设备支持的服务的信息。
具体地,该第一设备获取到该服务发起设备的服务标识信息后,根据该第一设备的服务信息结合该NAN中的变化信息中的至少一项生成该第一服务标识,然后将该服务发起设备的服务标识信息跟该第一设备的第一服务标识进行匹配,若匹配成功,该第一设备可以确定自身为该服务发起设备的服务响应设备。其中,若该服务标识信息指示该服务发起设备支持的服务的信息,那么该第一设备生成该第一服务标识依据的该服务信息为该第一设备查询的服务的信息;或若该服务标识信息指示该服务发起设备查询的服务的信息,那么该第一设备生成该第一服务标识依据的该服务信息为该第一设备支持的服务的信息。
也就是说该第一设备可以根据该第一服务标识和服务发起设备的服务标识信息是否匹配,确定该第一设备是否为该服务发起设备的服务响应设备,若匹配成功,回复响应消息,否则,不回复响应消息。
具体地,服务标识详细的生成过程和匹配过程可以参见图2中的S203中的相关描述,为了避免重复,这里不再赘述。
可选地,作为一个实施例,该第一服务发现消息还可以携带该服务发起设备的标识变化规律信息,该标识变化规律信息指示该服务发起设备的标识 信息的变化规律,以便于在该服务发起设备的标识信息发生变化后,该服务发现消息的接收设备根据该标识变化规律信息识别该服务发起设备,或根据该标识变化规律信息更新该服务发起设备的标识信息。
具体的,为了防止偷听者追踪,该服务发起设备的服务标识信息可以是变化的,可选地,此时该第一服务发现消息还可以携带该服务发起设备的标识变化规律信息,这样,若该服务发起设备的标识信息发生变化时,该第一服务发现消息的接收设备就可以根据该标识变化规律信息识别该服务发起设备,还可以根据该标识变化规律信息更新记录的该服务发起设备的标识信息。因此,增加了服务发现过程的安全性和私密性。
可选地,作为一个实施例,在该第一设备发送第二服务发现消息之前,该方法300还可以包括:
确定第一设备具有转发能力,发送该第二服务发现消息;或
确定第一设备不具有转发能力,取消发送该第二服务发现消息。
可选地,该第一设备还可以根据该第一服务发现消息中携带的序列号,确定是否转发该第一服务发现消息。
具体地,详细的步骤可以参见图2中的S202中的相关描述,为了避免重复,这里不再赘述。
可选地,作为另一个实施例,该第一服务发现消息还携带以下信息中的至少一项,以便于该第一设备计算该第二设备和该第一设备之间的第一衡量metric值:
该第二设备的休眠规律、该第二设备的休眠时间、该第二设备的工作规律和该第二设备的工作时间。
例如,该第一设备可以将该第二设备的工作时间信息通过位图的形式来表示,然后通过对比位图中该第一设备的工作时间信息和该第二设备的工作时间信息,计算该第一设备和第二设备之间的第一metric信息。
具体地,详细的步骤可以参见图2中的S201中的相关描述,为了避免重复,这里不再赘述。
可选地,作为另一个实施例,该第二路径信息还包括第一metric值,该第一metric值采用以下中的一项表征:
该第二设备与该第一设备的醒来时间的交集,该第一设备所在的NAN数据簇NDC与该第二设备所在的NDC的基本安排base schedule的交集,该 第一设备的MP值,该第一设备的设备等级值MR,该第一设备所在的NDC的base schedule的时间长短和该第一设备的角色信息。
可选地,该第一metric值还可以根据其他参数来表征,例如,可以根据以下信息中的至少一项来表征:
第一设备与第二设备传输时长airtime,第一设备与第二设备的通信代价,第二设备的休眠规律,第一设备需要的带宽,第二设备需要的带宽,第一设备需要的可靠性,第二设备需要的可靠性,第一设备需要的延迟,第二设备需要的延迟,第一设备的负载,第二设备的负载、该第二设备的时频资源信息、服务质量信息(Quality Of Service,QOS)。
其中,该时频资源的信息可以指示该第一设备能够用于传输数据的时间信息和信道信息。该时频资源的信息可以指示所述第一设备在DW interval中的工作时段和信道,或者所述第一设备在若干个DW interval中的工作时段和信道,或者所述第一设备的工作时段、休眠时段、工作规律、休眠规律等,例如,该时频资源的信息可以指示该第一设备在多少个DW或DW interval中休眠,或者在DW interval中的哪个时间段休眠,而在其他时间段工作于某个信道等。具体地,该时频资源的信息可以用位图(bitmap)、布隆滤波器(bloom filter)、设备的开始工作时间与工作持续时间或设备的开始工作时间与结束工作时间等方式进行描述,本发明实施例对此不作限制。
下面以位图的方式为例详细介绍时频资源的信息的表现形式,表1示出了时频资源的信息的一种量化表现形式。在表1中,位图第一维度为时间信息,以16个TU为设备在某个信道上工作的最小时间单元,在每个16TU内,设备处于休眠状态或工作在某个信道上。位图第二维度为信道信息,即该设备能够工作的信道信息。可以通过将某个信道和某个最小时间单元对应的位图置1来表示该设备在该最小时间单元指示的时间段运行于该信道上,通过将某个信道和某个最小时间单元对应的位图置0或置空来表示该设备在该最小时间单元指示的时间段进入休眠状态;也可以通过将某个信道和某个最小时间单元对应的位图置0或置空来表示该设备在该最小时间单元指示的时间段运行于该信道上,通过将某个信道和某个最小时间单元对应的位图置1来表示该设备在该最小时间单元指示的时间段进入休眠状态,或者也可以通过其他的指示方式来指示该设备的可用的时频资源的信息,本发明实施例对该时频资源的指示方式不作限制。该位图也可以指示连续多个DW和相邻DW  interval的时频资源的信息,或者可以指示该设备的可以用于传输数据的时频资源的规律从而表达较长一段时间的时频资源的信息等。需要说明的是,时频资源的规律也可以通过标准进行规定。如表1所示,该位图表达了设备在每512TU时间段内的时频资源的信息,从表1可以看出,该设备在第0~第5个16TU工作于信道6,在第6~第20个16TU工作于信道11,在第21~31个16TU工作于信道1。
表1
Figure PCTCN2015099841-appb-000001
应理解,表1中通过置1、置0或置空来指示时频资源是否可用仅是一种可靠的指示方法,也可以通过其他方法进行指示。还应理解,位图的第二维度上以包括信道1、6、11为例进行介绍,仅是为了表达方便,在实际的NAN系统中,位图中的信道号可以包括信道1~信道11(部分国家也可以包括信道1~信道13),表示该设备可以在某个时隙内工作于该11个信道中的任何一个信道上。
其中,QoS信息的表达方式有多种,例如,可以参考IEEE(Institute of Electrical and Electronics Engineers,美国电气和电子工程师协会)802.11中规定的EDCA(Enhanced Distributed Channel Access,增强分布式信道接入)机制,在EDCA机制中,QoS信息所表示的服务分为AC_BK(Access Category_Background,背景访问类型)、AC_BE(Access Category_Best Effort, 最大努力访问类型)、AC_VI(Access Category_Video,视频访问类型)、AC_VO(Access Category_Voice,音频访问类型)四类,由于每一类服务要求不同的传输时延,因此,服务信息中携带QoS信息时,可以根据表示该服务的QoS分类进行安排时频资源。或者,该QOS信息也可以用业务量规范(Traffic Specification,TSPEC)元素来表达,TSPEC元素结构如表2所示,服务信息中可以携带表2中的全部元素,也可以携带表2中的部分元素,如携带最小数据传输速率、平均数据传输速率、峰值数据传输速率及业务突发量大小中的至少一种,当然,也可以携带表2中的其他元素,例如,携带最大服务间隔(Maximum Service Interval)、最小服务间隔、最大数据传输速率(Maximum Data Rate)、最小数据传输速率、平均数据传输速率、最大包传输时间(Maximum packet transmission time)、优选包传输时间、最大传输时延(Maximum Transmission Delay)、优选数据传输时延,突发数据包大小(Burst Size)中的至少一种,此时,也就是说,QoS可以指保证用户体验服务所要求的最大服务间隔、最小服务间隔、最大数据传输速率、最小数据传输速率、平均数据传输速率、最大包传输时间、优选包传输时间、最大传输时延、优选数据传输时延,突发数据包大小等中的至少一种,本发明实施例对此不作限制。
表2
Figure PCTCN2015099841-appb-000002
具体地,如何根据上述信息表征该第一metric值,参见图2中的S201中的相关描述,为了避免重复,这里不再赘述。
可选地,该第一metric值还可以根据以下公式来计算:
Figure PCTCN2015099841-appb-000003
其中,O是信道负载(overhead);Bt是比特数(bit);r是数据率(data rate);ef是概率(probability)。
可选地,作为再一个实施例,该方法300还可以包括:
该第一设备接收第五设备的第三服务发现消息,该第三服务发现消息携带第二metric值,该第三服务发现消息携带该服务标识信息和第五路径信息,该第五路径信息包括该服务发起设备的标识信息、第五设备的标识信息和第二metric值,
该第一设备根据该第一metric值和该第二metric值,确定该第一设备和该第二设备之间的路径优于该第一设备和该第五设备之间的路径;
该第一设备转发该第一服务发现消息,不转发该第三服务发现消息。
其中,该第五设备为另一个服务中转设备,该第一设备可以接收该第五设备发送的第三服务发现消息,也可以接收第二设备发送的第一服务发现消息,也就是说该第一设备可以接收多个设备转发的服务发现消息,该第一设备可以根据该多个转发消息中metric值,确定转发哪个设备发送的服务发现消息。详细步骤可以参见图2中的S202中的相关描述,为避免重复,这里不再赘述。
可选地,作为再一个实施例,该第一metric值采用该第二设备与该第一设备的醒来时间的交集表征,该第二metric值采用该第五设备与该第一设备的醒来时间的交集表征,该第一设备根据该第一metric值和该第二metric值,确定该第一设备和该第二设备之间的路径优于该第一设备和该第五设备之间的路径,包括:
若该第二设备与该第一设备的醒来时间的交集大于该第五设备与该第一设备的醒来时间的交集时,该第一metric值大于该第二metric值,该第一设备在该第一metric值大于该第二metric值时,确定该第一设备和该第二设备之间的路径优于该第一设备和该第五设备之间的路径;或
若该第二设备与该第一设备的醒来时间的交集大于该第五设备与该第一设备的醒来时间的交集时,该第一metric值小于该第二metric值,该第一设备在该第一metric值小于该第二metric值时,确定该第一设备和该第二设备之间的路径优于该第一设备和该第五设备之间的路径。
可选地,作为再一个实施例,该方法300还可以包括:
该第一设备接收第三设备发送的第一响应消息,该第一响应消息指示该第三设备为该服务发起设备的服务响应设备,该第一响应消息携带第三路径信息,该第三路径信息包括该服务发起设备的标识信息和该第三设备的标识信息;
该第一设备根据该第三路径信息,确定第四路径信息,该第四路径信息包括该服务发起设备的标识信息、该第一设备的标识信息和该第三设备的标识信息;
该第一设备发送第二响应消息,该第二响应消息携带该第四路径信息。
可选地,若该第三设备已经在第一NDC中广播该第一响应消息,该第一设备可以选择在该第一NDC以外的其他NDC中广播该第二响应消息,从而可以避免一个NDC中有多个设备广播响应消息,造成系统资源的浪费。
其中,该第三设备可以为图2中的方法200中的设备C,该第三设备可以执行方法200中的设备C的相关动作,该第一响应消息可以为图2中的方法200中的设备C回复的响应消息。详细的步骤参见图2中的S203和S204中的相关描述,为避免重复,这里不再赘述。
可选地,作为再一个实施例,第四设备为所述第一响应消息的转发设备,该第一设备处于第一NDC中,第四设备处于第二NDC中,在该第一设备发送第二响应消息之前,该方法还包括:
该第一设备接收该第四设备在第二NDC中广播的第三响应消息,该第三响应消息为第一响应消息的转发消息;
若该第一NDC与该第二NDC为不同的NDC,该第一设备在该第一NDC中广播该第二响应消息;或
若该第一NDC和该第二NDC为相同的NDC,该第一设备不在该第一NDC中广播该第二响应消息。
其中,该第四设备可以为图2中的方法200中的设备D,该第四设备可以执行该方法200中的设备D的相关动作,具体地,可以参见图2中的S204中的相关描述,为避免重复,这里不再赘述。
可选地,作为再一个实施例,该第二服务发现消息的消息格式为以下中的一种:
服务发现帧SDF消息格式、动作action帧消息格式、信标帧beacon消 息格式和用户自定义消息格式。
可选地,该服务发现消息还携带多跳指示信息,该多跳指示信息指示用于发现多跳范围内的服务响应设备,多跳指示该服务发现消息传输到该服务响应设备需要经过服务中转设备的转发。
因此,本发明实施例的NAN中用于服务发现的方法,服务发起设备和服务响应设备之间的路径确定的过程不需要建立设备之间的连接关系,而是可以在服务响应设备的服务发现过程中确定服务发起设备和服务响应设备之间的路径,因此,减少了大量的空口消息,节约了大量的空口资源。
图4示出了从服务响应设备的角度描述的根据本发明实施例的NAN中用于服务发现的方法400的示意性流程图,该方法400由第一设备执行,如图4所示,该方法400包括:
S410,第一设备接收第二设备的第一服务发现消息,该第一服务发现消息携带服务标识信息和第一路径信息,该服务标识信息指示服务发起设备查询的服务或该服务发起设备支持的服务,该第二设备为服务发起设备或服务中转设备;
S420,该第一设备根据该服务标识信息,确定该第一设备为该服务发起设备的服务响应设备;
S430,该第一设备发送响应消息,该响应信息携带第二路径信息,该第二路径信息包括该服务发起设备的标识信息和该第一设备的标识信息,或该服务发起设备的标识信息、该第二设备的标识信息和该第一设备的标识信息。
具体地,该第二设备可以为图2中的方法200中的设备B,该第二设备可以执行方法200中的设备B的相关动作,该第一设备可以为图2中的方法200中的设备C,该第一设备可以执行方法200中的设备C的相关动作。
可选地,作为一个实施例,该第一设备发送响应消息,包括:
该第一设备向该第二设备发送该响应信息;或
若该第一设备处于第一NAN数据簇NDC中,该第一设备在该第一NDC中广播该响应消息;或
若该终端设备处于至少两个NDC中,在该至少两个NDC中的至少一个NDC中广播该响应消息;或
若该第一设备不处于该NAN中的任何一个NDC中,该第一设备加入该NAN中的第二NDC中,在该第二NDC中广播该响应消息。
其中,该第二NDC可以为该第一NDC,也可以为该至少两个NDC中的一个NDC,或者该第一设备也可以加入多个NDC中,在多个NDC中的一个或多个NDC中广播该响应消息,本发明实施例对此不作限制。
可选地,作为一个实施例,该第一设备根据该服务标识信息,确定该第一设备为该服务发起设备的服务响应设备,包括:
该第一设备在该服务标识信息和该第一设备的第一服务标识匹配时,确定该第一设备为该服务发起设备的服务响应设备;
其中,该服务标识信息为该服务发起设备根据该服务发起设备的服务信息生成,或该服务发起设备根据该NAN中的变化信息和该服务发起设备的服务信息生成,该第一服务标识为该第一设备根据该第一设备的服务信息生成,或该第一设备根据该NAN中的变化信息和该第一设备的服务信息生成,该服务发起设备的服务信息指示该服务发起设备支持的服务的信息或查询的服务的信息;
若该服务发起设备的服务信息为该服务发起设备支持的服务的信息,则该第一设备的服务信息为该第一设备查询的服务的信息;或若该服务发起设备的服务信息为该服务发起设备查询的服务的信息,则该第一设备的服务信息为该第一设备支持的服务的信息;
该NAN中的变化信息包括以下信息中的至少一项:锚主节点的等级AMR、主节点的MR、主节点MP、锚主节点意愿值AMP、随机因子RF、锚主节点的信标帧传输时间AMBTT、时间同步功能TSF值、簇标识和簇级别CG和组密钥group key。
可选地,作为再一个实施例,该方法400还包括:
该服务响应设备转发该第一服务发现消息;或
根据该第一服务发现消息中携带的扩散指示信息,确定是否转发该第一服务发现消息,该扩散指示信息指示在该服务响应设备与该服务发起设备的服务匹配时是否转发该转发消息。
可选地,若服务发现消息携带多个服务信息,该服务响应设备满足其中的一个或几个服务信息,此时该扩散指示信息还可以指示扩散该转发消息,以便于发现满足其他的服务信息的服务响应设备。
可选地,作为再一个实施例,该响应消息还可以包括跳数信息和第一衡量metric值,该跳数信息由该服务发现消息从该服务发起设备传输到该服务 响应设备的转发次数确定,该第一metric值用于衡量该第一设备到该服务响应设备之间的路径的优劣程度。
具体地,可以参见图2中的S203、S204中的相关描述,为避免重复,这里不再赘述。
因此,根据本发明实施例的NAN中用于服务发现的方法,能够在服务发现的过程中实现路径发现的过程,因此减少了大量的空口消息,节约了大量的时频资源。
图5示出了根据本发明实施例的终端设备500的示意性框图,如图5所示,该终端设备500包括:
收发模块510,用于接收第二设备发送的第一服务发现消息,所述第一服务发现消息携带服务标识信息和第一路径信息,所述服务标识信息指示服务发起设备查询的服务或所述服务发起设备支持的服务,所述第二设备为所述服务发起设备或服务中转设备,所述第一路径信息包括所述服务发起设备的标识信息,或所述第二设备和所述服务发起设备的标识信息;
确定模块520,用于根据所述第一路径信息,确定第二路径信息,所述第二路径信息包括所述服务发起设备的标识信息和所述终端设备的标识信息;
所述收发模块510还用于发送第二服务发现消息,所述第二服务发现消息携带所述服务标识信息和所述第二路径信息。
因此,根据本发明实施例的NAN中用于服务发现的终端设备,能够在服务发现的过程中实现路径发现的过程,因此减少了大量的空口消息,节约了大量的时频资源。
根据本发明实施例的终端设备500可对应于本发明实施例中的NAN中用于服务发现的方法300中的第一设备或根据本发明实施例的NAN中用于服务发现的方法200中的设备B,并且终端设备500中的各个模块的上述和其它操作和/或功能分别为了实现图2和图3中的各个方法的相应流程,为了简洁,在此不再赘述。
图6示出了根据本发明另一个实施例的终端设备600的示意性框图,如图6所示,该终端设备600包括:
收发模块610,用于接收第二设备的第一服务发现消息,所述第一服务发现消息携带服务标识信息和第一路径信息,所述服务标识信息指示服务发 起设备查询的服务或所述服务发起设备支持的服务,所述第二设备为服务发起设备或服务中转设备;
确定模块620,用于根据所述服务标识信息,确定所述终端设备为所述服务发起设备的服务响应设备;
所述收发模块610还用于:
发送响应消息,所述响应信息携带第二路径信息,所述第二路径信息包括所述服务发起设备的标识信息和所述终端设备的标识信息,或所述服务发起设备的标识信息、所述第二设备的标识信息和所述终端设备的标识信息。
因此,根据本发明实施例的NAN中用于服务发现的终端设备,能够在服务发现的过程中实现路径发现的过程,因此减少了大量的空口消息,节约了大量的时频资源。
根据本发明实施例的终端设备600可对应于本发明实施例中的NAN中用于服务发现的方法400中的第一设备或根据本发明实施例的NAN中用于服务发现的方法200中的设备C,并且终端设备600中的各个模块的上述和其它操作和/或功能分别为了实现图2和图4中的各个方法的相应流程,为了简洁,在此不再赘述。
如图7所示,本发明实施例还提供了一种终端设备700,该终端设备700包括处理器710、存储器720、总线系统730和收发器740。其中,处理器710、存储器720和收发器740通过总线系统730相连,该存储器720用于存储指令,该处理器710用于执行该存储器720存储的指令,以通过收发器740接收信号或发送信号。图7中示出的终端设备的结构并不构成对本发明实施例的限定,它既可以是总线形结构,也可以是星型结构,还可以包括比图7所示更多或更少的部件,或者组合其中的某些部件,或者采用不同的部件布置方式等。其中,该收发器740用于接收第二设备发送的第一服务发现消息,该第一服务发现消息携带服务标识信息和第一路径信息,该服务标识信息指示服务发起设备查询的服务或该服务发起设备支持的服务,该第二设备为该服务发起设备或服务中转设备,该第一路径信息包括该服务发起设备的标识信息,或该第二设备和该服务发起设备的标识信息;该处理器710用于根据该第一路径信息,确定第二路径信息,该第二路径信息包括该服务发起设备的标识信息和该终端设备的标识信息;该收发器740还用于发送第二服务发现消息,该第二服务发现消息携带该服务标识信息和该第二路径信息。
应理解,在本发明实施例中,该处理器710可以是中央处理单元(Central Processing Unit,简称为“CPU”),该处理器710还可以是其他通用处理器、数字信号处理器(DSP)、专用集成电路(ASIC)、现成可编程门阵列(FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。
该存储器720可以包括只读存储器和随机存取存储器,并向处理器710提供指令和数据。存储器720的一部分还可以包括非易失性随机存取存储器。例如,存储器720还可以存储设备类型的信息。
该总线系统730除包括数据总线之外,还可以包括电源总线、控制总线和状态信号总线等。但是为了清楚说明起见,在图中将各种总线都标为总线系统730。
在实现过程中,上述方法的各步骤可以通过处理器710中的硬件的集成逻辑电路或者软件形式的指令完成。结合本发明实施例所公开的方法的步骤可以直接体现为硬件处理器执行完成,或者用处理器中的硬件及软件模块组合执行完成。软件模块可以位于随机存储器,闪存、只读存储器,可编程只读存储器或者电可擦写可编程存储器、寄存器等本领域成熟的存储介质中。该存储介质位于存储器720,处理器710读取存储器720中的信息,结合其硬件完成上述方法的步骤。为避免重复,这里不再详细描述。
因此,根据本发明实施例的NAN中用于服务发现的终端设备,能够在服务发现的过程中实现路径发现的过程,因此减少了大量的空口消息,节约了大量的时频资源。
根据本发明实施例的终端设备700可对应于本发明实施例中的NAN中用于服务发现的方法300中的第一设备或根据本发明实施例的NAN中用于服务发现的方法200中的设备B,并且终端设备700中的各个模块的上述和其它操作和/或功能分别为了实现图2和图3中的各个方法的相应流程,为了简洁,在此不再赘述。
如图8所示,本发明实施例还提供了一种终端设备800,该终端设备800包括处理器810、存储器820、总线系统830和收发器840。其中,处理器810、存储器820和收发器840通过总线系统830相连,该存储器820用于存储指令,该处理器810用于执行该存储器820存储的指令,以通过收发器840接收信号或发送信号。图8中示出的终端设备的结构并不构成对本发明 实施例的限定,它既可以是总线形结构,也可以是星型结构,还可以包括比图8所示更多或更少的部件,或者组合其中的某些部件,或者采用不同的部件布置方式等。其中,该收发器840用于接收第二设备的第一服务发现消息,该第一服务发现消息携带服务标识信息和第一路径信息,该服务标识信息指示服务发起设备查询的服务或该服务发起设备支持的服务,该第二设备为服务发起设备或服务中转设备;该处理器810用于根据该服务标识信息,确定该终端设备为该服务发起设备的服务响应设备;该收发器840还用于发送响应消息,该响应信息携带第二路径信息,该第二路径信息包括该服务发起设备的标识信息和该终端设备的标识信息,或该服务发起设备的标识信息、该第二设备的标识信息和该终端设备的标识信息。
应理解,在本发明实施例中,该处理器810可以利用各种接口和线路连接整个终端设备的各个部分,通过运行或执行存储在存储器820内的软件程序和/或模块,以及调用存储在存储器820内的数据,以执行终端设备的各种功能和/或处理数据。该处理器810可以是中央处理单元(Central Processing Unit,简称为“CPU”),该处理器810还可以是其他通用处理器、数字信号处理器(DSP)、专用集成电路(ASIC)、现成可编程门阵列(FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。
存储器820可以包括只读存储器和随机存取存储器,可用于存储软件程序以及模块,并向处理器810提供指令和数据。该存储器820可以包括程序存储区和数据存储区,其中,程序存储区可存储操作系统、至少一个功能所需的应用程序,比如声音播放程序、图像播放程序等等;数据存储区可存储根据电子设备的使用所创建的数据(比如音频数据、电话本等)等。存储器820的一部分还可以包括易失性存储器,例如非挥发性动态随机存取内存(Nonvolatile Random Access Memory,简称NVRAM)、相变化随机存取内存(Phase Change RAM,简称PRAM)、磁阻式随机存取内存(Magetoresistive RAM,简称MRAM)等,还可以包括非易失性存储器,例如至少一个磁盘存储器件、电子可擦除可编程只读存储器(Electrically Erasable Programmable Read-Only Memory,简称EEPROM)、闪存器件,例如反或闪存(NOR flash memory)或是反及闪存(NAND flash memory)。非易失存储器可以存储处理器810所执行的操作系统及应用程序。该存储器820还可以存储设备类型的信 息。
该总线系统830除包括数据总线之外,还可以包括电源总线、控制总线和状态信号总线等。但是为了清楚说明起见,在图中将各种总线都标为总线系统830。
在实现过程中,上述方法的各步骤可以通过处理器810中的硬件的集成逻辑电路或者软件形式的指令完成。结合本发明实施例所公开的方法的步骤可以直接体现为硬件处理器执行完成,或者用处理器中的硬件及软件模块组合执行完成。软件模块可以位于随机存储器,闪存、只读存储器,可编程只读存储器或者电可擦写可编程存储器、寄存器等本领域成熟的存储介质中。该存储介质位于存储器820,处理器810读取存储器820中的信息,结合其硬件完成上述方法的步骤。为避免重复,这里不再详细描述。
因此,根据本发明实施例的NAN中用于服务发现的终端设备,能够在服务发现的过程中实现路径发现的过程,因此减少了大量的空口消息,节约了大量的时频资源。
根据本发明实施例的终端设备800可对应于本发明实施例中的NAN中用于服务发现的方法400中的第一设备或根据本发明实施例的NAN中用于服务发现的方法200中的设备C,并且终端设备800中的各个模块的上述和其它操作和/或功能分别为了实现图2和图4中的各个方法的相应流程,为了简洁,在此不再赘述。
应理解,本文中术语“和/或”,仅仅是一种描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。另外,本文中字符“/”,一般表示前后关联对象是一种“或”的关系。
应理解,在本发明的各种实施例中,上述各过程的序号的大小并不意味着执行顺序的先后,各过程的执行顺序应以其功能和内在逻辑确定,而不应对本发明实施例的实施过程构成任何限定。
本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、或者计算机软件和电子硬件的结合来实现。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本发明的范围。
所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的系统、装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。
在本申请所提供的几个实施例中,应该理解到,所揭露的系统、装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。
另外,在本发明各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。
所述功能如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本发明的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本发明各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、磁碟或者光盘等各种可以存储程序代码的介质。
以上所述,仅为本发明的具体实施方式,但本发明的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本发明揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本发明的保护范围之内。因此,本发明的保护范围应以所述权利要求的保护范围为准。

Claims (48)

  1. 一种临近感知网络NAN中用于服务发现的方法,其特征在于,包括:
    第一设备接收第二设备发送的第一服务发现消息,所述第一服务发现消息携带服务标识信息和第一路径信息,所述服务标识信息指示服务发起设备查询的服务或所述服务发起设备支持的服务,所述第二设备为所述服务发起设备或服务中转设备,所述第一路径信息包括所述服务发起设备的标识信息,或所述第二设备和所述服务发起设备的标识信息;
    所述第一设备根据所述第一路径信息,确定第二路径信息,所述第二路径信息包括所述服务发起设备的标识信息和所述第一设备的标识信息;
    所述第一设备发送第二服务发现消息,所述第二服务发现消息携带所述服务标识信息和所述第二路径信息。
  2. 根据权利要求1所述的方法,其特征在于,所述第一设备发送第二服务发现消息,包括:
    若所述第一设备不处于所述NAN中的任何一个NAN数据簇NDC中,所述第一设备在所述NAN的发现窗口DW中发送所述第二服务发现消息;或
    若所述第一设备处于第一NDC中,所述第一设备在所述第一NDC中发送所述第二服务发现消息;或
    若所述第一设备处于至少两个NDC中,所述第一设备在所述至少两个NDC中的至少一个NDC中发送所述第二服务发现消息。
  3. 根据权利要求1或2所述的方法,其特征在于,所述方法还包括:
    所述第一设备接收第三设备发送的第一响应消息,所述第一响应消息指示所述第三设备为所述服务发起设备的服务响应设备,所述第一响应消息携带第三路径信息,所述第三路径信息包括所述服务发起设备的标识信息和所述第三设备的标识信息;
    所述第一设备根据所述第三路径信息,确定第四路径信息,所述第四路径信息包括所述服务发起设备的标识信息、所述第一设备的标识信息和所述第三设备的标识信息;
    所述第一设备发送第二响应消息,所述第二响应消息携带所述第四路径信息。
  4. 根据权利要求3所述的方法,其特征在于,所述第一设备发送第二 响应消息,包括:
    所述第一设备向所述第二设备发送所述第二响应消息;或
    若所述第一设备处于第一NDC中,所述第一设备在所述第一NDC中广播所述第二响应消息;或
    若所述第一设备处于至少两个NDC中,所述第一设备在所述至少两个NDC中的至少一个NDC中广播所述第二响应消息。
  5. 根据权利要求3所述的方法,其特征在于,第四设备为所述第一响应消息的转发设备,所述第一设备处于第一NDC中,所述第四设备处于第二NDC中,在所述第一设备发送第二响应消息之前,所述方法还包括:
    所述第一设备接收所述第四设备在所述第二NDC中广播的第三响应消息,所述第三响应消息为第一响应消息的转发消息;
    若所述第一NDC与所述第二NDC为不同的NDC,所述第一设备在所述第一NDC中广播所述第二响应消息;或
    若所述第一NDC与所述第二NDC为相同的NDC,所述第一设备不在所述第一NDC中广播所述第二响应消息。
  6. 根据权利要求1至5中任一项所述的方法,其特征在于,所述第二路径信息还包括第一衡量metric值,所述第一metric用于衡量所述第一设备和所述第二设备之间的路径的优劣程度,所述第一metric值采用以下参数中的至少一项表征:
    所述第一设备与所述第二设备的醒来时间的交集,
    所述第一设备所在的NDC与所述第二设备所在的NDC的基本安排base schedule的交集,
    所述第一设备所在的NDC的base schedule的时间长度,所述第一设备的意愿值MP值,所述第一设备的等级MR和
    所述第一设备在所述NAN中的角色信息。
  7. 根据权利要求1至6中任一项所述的方法,其特征在于,所述第二路径信息还包括第一衡量metric值,所述第一metric用于衡量所述第一设备和所述第二设备之间的路径的优劣程度,在所述第一设备发送第二服务发现消息之前,所述方法还包括:
    所述第一设备接收第五设备的第三服务发现消息,所述第三服务发现消息携带所述服务标识信息和第五路径信息,所述第五路径信息包括所述服务 发起设备的标识信息、所述第五设备的标识信息和第二metric值,所述第二metric值用于衡量所述第一设备和所述第五设备之间的路径的优劣程度;
    所述第一设备根据所述第一metric值和所述第二metric值,确定所述第一设备和所述第二设备之间的路径优于所述第一设备和所述第五设备之间的路径;
    所述第一设备转发所述第一服务发现消息,不转发所述第三服务发现消息。
  8. 根据权利要求1至7中任一项所述的方法,其特征在于,所述第一服务发现消息还携带以下信息中的至少一项,以便于所述第一设备计算所述第二设备和所述第一设备之间的第一metric值,所述第一metric用于衡量所述第一设备和所述第二设备之间的路径的优劣程度:
    所述第二设备的休眠规律、所述第二设备的休眠时间、所述第二设备的工作规律和所述第二设备的工作时间。
  9. 根据权利要求1至8中任一项所述的方法,其特征在于,所述第一服务发现消息还携带NAN中的变化信息,所述方法还包括:
    在所述服务标识信息和第一服务标识匹配时,确定所述第一设备为所述服务发起设备的服务响应设备,
    其中,所述服务标识信息为所述服务发起设备根据所述服务发起设备的服务信息生成,或所述服务发起设备根据所述NAN中的变化信息和所述服务发起设备的服务信息生成;所述第一服务标识为所述第一设备根据所述第一设备的服务信息生成,或所述第一设备根据所述NAN中的变化信息和所述第一设备的服务信息生成,所述服务发起设备的服务信息指示所述服务发起设备支持的服务的信息或查询的服务的信息;
    若所述服务发起设备的服务信息为所述服务发起设备设备支持的服务的信息,所述第一设备的服务信息为所述第一设备查询的服务的信息;或若所述服务发起设备的服务信息为所述服务发起设备设备查询的服务的信息,则所述第一设备的服务信息为所述第一设备支持的服务的信息;
    所述NAN中的变化信息包括以下信息中的至少一项:锚主节点的等级AMR、主节点的MR、主节点MP、锚主节点意愿值AMP、随机因子RF、锚主节点的信标帧传输时间AMBTT、时间同步功能TSF值、簇标识和簇级别CG和组密钥group key。
  10. 根据权利要求1至9中任一项所述的方法,其特征在于,所述第一服务发现消息还携带所述服务发起设备的标识变化规律信息,所述标识变化规律信息指示所述服务发起设备的标识信息的变化规律,以便于在所述服务发起设备的标识信息发生变化后,所述第一服务发现消息的接收设备根据所述标识变化规律信息识别所述服务发起设备,或根据所述标识变化规律信息更新所述服务发起设备的标识信息。
  11. 根据权利要求1至10中任一项所述的方法,其特征在于,所述服务发现消息的消息格式为以下中的一种:
    服务发现帧SDF消息格式、动作Action帧消息格式、信标帧Beacon消息格式和用户自定义消息格式。
  12. 一种临近感知网络NAN中用于服务发现的方法,其特征在于,包括:
    第一设备接收第二设备的第一服务发现消息,所述第一服务发现消息携带服务标识信息和第一路径信息,所述服务标识信息指示服务发起设备查询的服务或所述服务发起设备支持的服务,所述第二设备为服务发起设备或服务中转设备;
    所述第一设备根据所述服务标识信息,确定所述第一设备为所述服务发起设备的服务响应设备;
    所述第一设备发送响应消息,所述响应信息携带第二路径信息,所述第二路径信息包括所述服务发起设备的标识信息和所述第一设备的标识信息,或所述服务发起设备的标识信息、所述第二设备的标识信息和所述第一设备的标识信息。
  13. 根据权利要求12所述的方法,其特征在于,所述第一设备发送响应消息,包括:
    所述第一设备向所述第二设备发送所述响应信息;或
    若所述第一设备处于第一NAN数据簇NDC中,所述第一设备在所述第一NDC广播所述响应消息;或
    若所述第一设备处于至少两个NDC中,所述第一设备在所述至少两个NDC中的至少一个NDC中广播所述响应消息;或
    若所述第一设备不处于所述NAN中的任何一个NDC中,所述第一设备加入所述NAN中的第二NDC中,在所述第二NDC中广播所述响应消息。
  14. 根据权利要求12或13所述的方法,其特征在于,所述第一设备根据所述服务标识信息,确定所述第一设备为所述服务发起设备的服务响应设备,包括:
    所述第一设备在所述服务标识信息和所述第一设备的第一服务标识匹配时,确定所述第一设备为所述服务发起设备的服务响应设备;
    其中,所述服务标识信息为所述服务发起设备根据所述服务发起设备的服务信息生成,或所述服务发起设备根据所述NAN中的变化信息和所述服务发起设备的服务信息生成,所述第一服务标识为所述第一设备根据所述第一设备的服务信息生成,或所述第一设备根据所述NAN中的变化信息和所述第一设备的服务信息生成,所述服务发起设备的服务信息指示所述服务发起设备支持的服务的信息或查询的服务的信息;
    若所述服务发起设备的服务信息为所述服务发起设备支持的服务的信息,则所述第一设备的服务信息为所述第一设备查询的服务的信息;或若所述服务发起设备的服务信息为所述服务发起设备查询的服务的信息,则所述第一设备的服务信息为所述第一设备支持的服务的信息;
    所述NAN中的变化信息包括以下信息中的至少一项:锚主节点的等级AMR、主节点的MR、主节点MP、锚主节点意愿值AMP、随机因子RF、锚主节点的信标帧传输时间AMBTT、时间同步功能TSF值、簇标识和簇级别CG和组密钥group key。
  15. 根据权利要求12至14中任一项所述的方法,其特征在于,所述方法还包括:
    所述第一设备转发所述第一服务发现消息;或
    根据所述第一服务发现消息中携带的扩散指示信息,确定是否转发所述第一服务发现消息,所述扩散指示信息指示在所述第一设备为所述服务发起设备的服务响应设备时是否转发所述转发消息。
  16. 根据权利要求12至15中任一项所述的方法,其特征在于,所述响应消息还包括跳数信息和第一衡量metric值,所述跳数信息由所述服务发现消息从所述服务发起设备传输到所述服务响应设备的转发次数确定,所述第一metric值用于衡量所述第一设备到所述第二设备之间的路径的优劣程度。
  17. 一种终端设备,其特征在于,包括:
    收发模块,用于接收第二设备发送的第一服务发现消息,所述第一服务 发现消息携带服务标识信息和第一路径信息,所述服务标识信息指示服务发起设备查询的服务或所述服务发起设备支持的服务,所述第二设备为所述服务发起设备或服务中转设备,所述第一路径信息包括所述服务发起设备的标识信息,或所述第二设备和所述服务发起设备的标识信息;
    确定模块,用于根据所述第一路径信息,确定第二路径信息,所述第二路径信息包括所述服务发起设备的标识信息和所述终端设备的标识信息;
    所述收发模块还用于发送第二服务发现消息,所述第二服务发现消息携带所述服务标识信息和所述第二路径信息。
  18. 根据权利要求17所述的终端设备,其特征在于,所述收发模块具体用于:
    若所述终端设备不处于所述NAN中的任一个NAN数据簇NDC中,在所述NAN的发现窗口DW中发送所述第二服务发现消息;或
    若所述终端设备处于第一NDC中,在所述第一NDC中发送所述第二服务发现消息;或
    若所述终端设备处于至少两个NDC中,在所述至少两个NDC中的至少一个NDC中发送所述第二服务发现消息。
  19. 根据权利要求17或18所述的终端设备,其特征在于,所述收发模块还用于:
    接收第三设备发送的第一响应消息,所述第一响应消息指示所述第三设备为所述服务发起设备的服务响应设备,所述第一响应消息携带第三路径信息,所述第三路径信息包括所述服务发起设备的标识信息和所述第三设备的标识信息;
    所述确定模块还用于:
    根据所述第三路径信息,确定第四路径信息,所述第四路径信息包括所述服务发起设备的标识信息、所述终端设备的标识信息和所述第三设备的标识信息;
    所述收发模块还用于发送第二响应消息,所述第二响应消息携带所述第四路径信息。
  20. 根据权利要求19所述的终端设备,其特征在于,所述收发模块具体用于:
    向所述第二设备发送所述第二响应消息;或
    若所述终端设备处于第一NDC中,在所述第一NDC中广播所述第二响应消息;或
    若所述终端设备处于至少两个NDC中,在所述至少两个NDC中的至少一个NDC中广播所述第二响应消息。
  21. 根据权利要求19所述的方法,其特征在于,第四设备为所述第一响应消息的转发设备,所述终端设备处于第一NDC中,第四设备处于第二NDC中,所述收发模块还用于:
    接收所述第四设备在所述第二NDC中广播的第三响应消息,所述第三响应消息为第一响应消息的转发消息;
    所述确定模块还用于确定所述第一NDC与所述第二NDC是否为不同的NDC;
    所述收发模块还用于:
    在所述确定模块确定所述第一NDC与所述第二NDC为不同的NDC时,在所述第一NDC中广播所述第二响应消息;或
    在所述确定模块确定所述第一NDC与所述第二NDC为相同的NDC时,不在所述第一NDC中广播所述第二响应消息。
  22. 根据权利要求17至21中任一项所述的终端设备,其特征在于,所述第二路径信息还包括第一衡量metric值,所述第一metric用于衡量所述终端设备和所述第二设备之间的路径的优劣程度,所述第一metric值采用以下参数中的至少一项表征:
    所述终端设备与所述第二设备的醒来时间的交集,
    所述终端设备所在的NDC与所述第二设备所在的NDC的基本安排base schedule的交集,
    所述终端设备所在的NDC的base schedule的时间长度,所述终端设备的意愿值MP值、所述终端设备的等级MR和
    所述终端设备在所述NAN中的角色信息。
  23. 根据权利要求22所述的终端设备,其特征在于,所述收发模块还用于接收第五设备的第三服务发现消息,所述第三服务发现消息携带所述服务标识信息和第五路径信息,所述第五路径信息包括所述服务发起设备的标识信息、所述第五设备的标识信息和第二metric值,所述第二metric值用于衡量所述终端设备和所述第五设备之间的路径的优劣程度;
    所述确定模块还用于:
    根据所述第一metric值和所述第二metric值,确定所述终端设备和所述第二设备之间的路径优于所述终端设备和所述第五设备之间的路径;
    所述收发模块还用于转发所述第一服务发现消息,不转发所述第三服务发现消息。
  24. 根据权利要求17至23中任一项所述的终端设备,其特征在于,所述第一服务发现消息还携带以下信息中的至少一项,以便于所述终端设备计算所述第二设备和所述终端设备之间的第一metric值,所述第一metric用于衡量所述终端设备和所述第二设备之间的路径的优劣程度:
    所述第二设备的休眠规律、所述第二设备的休眠时间、所述第二设备的工作规律和所述第二设备的工作时间。
  25. 根据权利要求17至24中任一项所述的终端设备,其特征在于,所述第一服务发现消息还携带NAN中的变化信息,所述确定模块还用于:
    在所述服务标识信息和第一服务标识匹配时,确定所述终端设备为所述服务发起设备的服务响应设备,
    其中,所述服务标识信息为所述服务发起设备根据所述服务发起设备的服务信息生成,或所述服务发起设备根据所述NAN中的变化信息和所述服务发起设备的服务信息生成;所述第一服务标识为所述终端设备根据所述终端设备的服务信息生成,或所述终端设备根据所述NAN中的变化信息和所述终端设备的服务信息生成,所述服务发起设备的服务信息指示所述服务发起设备支持的服务的信息或查询的服务的信息;
    若所述服务发起设备的服务信息为所述服务发起设备设备支持的服务的信息,所述终端设备的服务信息为所述终端设备查询的服务的信息;或若所述服务发起设备的服务信息为所述服务发起设备设备查询的服务的信息,则所述终端设备的服务信息为所述终端设备支持的服务的信息;
    所述NAN中的变化信息包括以下信息中的至少一项:锚主节点的等级AMR、主节点的MR、主节点MP、锚主节点意愿值AMP、随机因子RF、锚主节点的信标帧传输时间AMBTT、时间同步功能TSF值、簇标识和簇级别CG和组密钥group key。
  26. 根据权利要求17至25中任一项所述的终端设备,其特征在于,所述第一服务发现消息还携带所述服务发起设备的标识变化规律信息,所述标 识变化规律信息指示所述服务发起设备的标识信息的变化规律,以便于在所述服务发起设备的标识信息发生变化后,所述第一服务发现消息的接收设备根据所述标识变化规律信息识别所述服务发起设备,或根据所述标识变化规律信息更新所述服务发起设备的标识信息。
  27. 根据权利要求17至26中任一项所述的终端设备,其特征在于,所述服务发现消息的消息格式为以下中的一种:
    服务发现帧SDF消息格式、动作action帧消息格式、信标帧beacon消息格式和用户自定义消息格式。
  28. 一种终端设备,其特征在于,包括:
    收发模块,用于接收第二设备的第一服务发现消息,所述第一服务发现消息携带服务标识信息和第一路径信息,所述服务标识信息指示服务发起设备查询的服务或所述服务发起设备支持的服务,所述第二设备为服务发起设备或服务中转设备;
    确定模块,用于根据所述服务标识信息,确定所述终端设备为所述服务发起设备的服务响应设备;
    所述收发模块还用于:
    发送响应消息,所述响应信息携带第二路径信息,所述第二路径信息包括所述服务发起设备的标识信息和所述终端设备的标识信息,或所述服务发起设备的标识信息、所述第二设备的标识信息和所述终端设备的标识信息。
  29. 根据权利要求28所述的终端设备,其特征在于,所述收发模块具体用于:
    向所述第二设备发送所述响应信息;或
    若所述终端设备处于第一NAN数据簇NDC中,在所述第一NDC中广播所述响应消息;或
    若所述终端设备处于至少两个NDC中,在所述至少两个NDC中的至少一个NDC中广播所述响应消息;或
    若所述终端设备不处于所述NAN中的任何一个NDC中,所述终端设备加入所述NAN中的第二NDC中,在所述第二NDC中广播所述响应消息。
  30. 根据权利要求28或29所述的终端设备,其特征在于,所述确定模块还用于:
    在所述服务标识信息和所述终端设备的第一服务标识匹配时,确定所述 终端设备为所述服务发起设备的服务响应设备;
    其中,所述服务标识信息为所述服务发起设备根据所述服务发起设备的服务信息生成,或所述服务发起设备根据所述NAN中的变化信息和所述服务发起设备的服务信息生成,所述第一服务标识为所述终端设备根据所述终端设备的服务信息生成,或所述终端设备根据所述NAN中的变化信息和所述终端设备的服务信息生成,所述服务发起设备的服务信息指示所述服务发起设备支持的服务的信息或查询的服务的信息;
    若所述服务发起设备的服务信息为所述服务发起设备支持的服务的信息,则所述终端设备的服务信息为所述终端设备查询的服务的信息;或若所述服务发起设备的服务信息为所述服务发起设备查询的服务的信息,则所述终端设备的服务信息为所述终端设备支持的服务的信息;
    所述NAN中的变化信息包括以下信息中的至少一项:锚主节点的等级AMR、主节点的MR、主节点MP、锚主节点意愿值AMP、随机因子RF、锚主节点的信标帧传输时间AMBTT、时间同步功能TSF值、簇标识和簇级别CG和组密钥group key。
  31. 根据权利要求28至30中任一项所述的终端设备,其特征在于,所述收发模块还用于转发所述第一服务发现消息;或
    在所述确定模块根据第一服务发现消息中携带的扩散指示信息,确定需要转发所述第一服务发现消息时,转发所述第一服务发现消息,或
    在所述确定模块根据第一服务发现消息中携带的扩散指示信息,确定不需要转发所述第一服务发现消息时,不转发所述第一服务发现消息。
  32. 根据权利要求28至31中任一项所述的终端设备,其特征在于,所述响应消息包括跳数信息和第一衡量metric值,所述跳数信息由所述服务发现消息从所述服务发起设备传输到所述终端设备的转发次数确定,所述第一metric值用于衡量所述终端设备到所述第二设备之间的路径的优劣程度。
  33. 一种终端设备,其特征在于,包括:收发器、处理器、存储器和总线系统,所述收发器、所述处理器和所述存储器通过所述总线系统相连;
    所述收发器用于接收第二设备发送的第一服务发现消息,所述第一服务发现消息携带服务标识信息和第一路径信息,所述服务标识信息指示服务发起设备查询的服务或所述服务发起设备支持的服务,所述第二设备为所述服务发起设备或服务中转设备,所述第一路径信息包括所述服务发起设备的标 识信息,或所述第二设备和所述服务发起设备的标识信息;
    所述处理器用于根据所述第一路径信息,确定第二路径信息,所述第二路径信息包括所述服务发起设备的标识信息和所述终端设备的标识信息;
    所述收发器还用于发送第二服务发现消息,所述第二服务发现消息携带所述服务标识信息和所述第二路径信息。
  34. 根据权利要求33所述的终端设备,其特征在于,所述收发器具体用于:
    若所述终端设备不处于所述NAN中的任一个NAN数据簇NDC中,在所述NAN的发现窗口DW中发送所述第二服务发现消息;或
    若所述终端设备处于第一NDC中,在所述第一NDC中发送所述第二服务发现消息;或
    若所述终端设备处于至少两个NDC中,在所述至少两个NDC中的至少一个NDC中发送所述第二服务发现消息。
  35. 根据权利要求33或34所述的终端设备,其特征在于,所述收发器还用于:
    接收第三设备发送的第一响应消息,所述第一响应消息指示所述第三设备为所述服务发起设备的服务响应设备,所述第一响应消息携带第三路径信息,所述第三路径信息包括所述服务发起设备的标识信息和所述第三设备的标识信息;
    所述处理器还用于:
    根据所述第三路径信息,确定第四路径信息,所述第四路径信息包括所述服务发起设备的标识信息、所述终端设备的标识信息和所述第三设备的标识信息;
    所述收发器还用于发送第二响应消息,所述第二响应消息携带所述第四路径信息。
  36. 根据权利要求35所述的终端设备,其特征在于,所述收发器具体用于:
    向所述第二设备发送所述第二响应消息;或
    若所述终端设备处于第一NDC中,在所述第一NDC中广播所述第二响应消息;或
    若所述终端设备处于至少两个NDC中,在所述至少两个NDC中的至少 一个NDC中广播所述第二响应消息。
  37. 根据权利要求35所述的终端设备,其特征在于,第四设备为所述第一响应消息的转发设备,所述终端设备处于第一NDC中,第四设备处于第二NDC中,所述收发器还用于:
    接收所述第四设备在第二NDC中广播的第三响应消息,所述第三响应消息为第一响应消息的转发消息;
    所述处理器还用于确定所述第一NDC与所述第二NDC是否为不同的NDC;
    所述收发器还用于:
    在所述处理器确定所述第一NDC与所述第二NDC为不同的NDC时,在所述第一NDC中广播所述第二响应消息;或
    在所述处理器确定所述第一NDC与所述第二NDC为相同的NDC时,在所述第一NDC中广播所述第二响应消息。
  38. 根据权利要求33至37中任一项所述的终端设备,其特征在于,所述第二路径信息还包括第一衡量metric值,所述第一metric用于衡量所述终端设备和所述第二设备之间的路径的优劣程度,所述第一metric值采用以下参数中的至少一项表征:
    所述终端设备与所述第二设备的醒来时间的交集,
    所述终端设备所在的NDC与所述第二设备所在的NDC的基本安排base schedule的交集,
    所述终端设备所在的NDC的base schedule的时间长度,所述终端设备的意愿值MP值,所述终端设备的等级MR和
    所述终端设备在所述NAN中的角色信息。
  39. 根据权利要求38所述的终端设备,其特征在于,所述收发器还用于接收第五设备的第三服务发现消息,所述第三服务发现消息携带所述服务标识信息和第五路径信息,所述第五路径信息包括所述服务发起设备的标识信息、所述第五设备的标识信息和第二metric值,所述第二metric值用于衡量所述终端设备和所述第五设备之间的路径的优劣程度;
    所述处理器还用于:
    根据所述第一metric值和所述第二metric值,确定所述终端设备和所述第二设备之间的路径优于所述终端设备和所述第五设备之间的路径;
    所述收发器还用于转发所述第一服务发现消息,不转发所述第三服务发现消息。
  40. 根据权利要求33至39中任一项所述的终端设备,其特征在于,所述第一服务发现消息还携带以下信息中的至少一项,以便于所述终端设备计算所述第二设备和所述终端设备之间的第一metric值,所述第一metric用于衡量所述终端设备和所述第二设备之间的路径的优劣程度:
    所述第二设备的休眠规律、所述第二设备的休眠时间、所述第二设备的工作规律和所述第二设备的工作时间。
  41. 根据权利要求33至40中任一项所述的终端设备,其特征在于,所述第一服务发现消息还携带NAN中的变化信息,所述处理器还用于:
    在所述服务标识信息和第一服务标识匹配时,确定所述终端设备为所述服务发起设备的服务响应设备,
    其中,所述服务标识信息为所述服务发起设备根据所述服务发起设备的服务信息生成,或所述服务发起设备根据所述NAN中的变化信息和所述服务发起设备的服务信息生成,所述第一服务标识为所述终端设备根据所述终端设备的服务信息生成,或所述终端设备根据所述NAN中的变化信息和所述终端设备的服务信息生成,所述服务发起设备的服务信息指示所述服务发起设备支持的服务的信息或查询的服务的信息;
    若所述服务发起设备的服务信息为所述服务发起设备设备支持的服务的信息,所述终端设备的服务信息为所述终端设备查询的服务的信息;或若所述服务发起设备的服务信息为所述服务发起设备设备查询的服务的信息,则所述终端设备的服务信息为所述终端设备支持的服务的信息;
    所述NAN中的变化信息包括以下信息中的至少一项:锚主节点的等级AMR、主节点的MR、主节点MP、锚主节点意愿值AMP、随机因子RF、锚主节点的信标帧传输时间AMBTT、时间同步功能TSF值、簇标识和簇级别CG和组密钥group key。
  42. 根据权利要求33至41中任一项所述的终端设备,其特征在于,所述第一服务发现消息还携带所述服务发起设备的标识变化规律信息,所述标识变化规律信息指示所述服务发起设备的标识信息的变化规律,以便于在所述服务发起设备的标识信息发生变化后,所述第一服务发现消息的接收设备根据所述标识变化规律信息识别所述服务发起设备,或根据所述标识变化规 律信息更新所述服务发起设备的标识信息。
  43. 根据权利要求33至42中任一项所述的终端设备,其特征在于,所述服务发现消息的消息格式为以下中的一种:
    服务发现帧SDF消息格式、动作action帧消息格式、信标帧beacon消息格式和用户自定义消息格式。
  44. 一种终端设备,其特征在于,包括:收发器、处理器、存储器和总线系统,所述收发器、所述处理器和所述存储器通过所述总线系统相连;
    所述收发器用于接收第二设备的第一服务发现消息,所述第一服务发现消息携带服务标识信息和第一路径信息,所述服务标识信息指示服务发起设备查询的服务或所述服务发起设备支持的服务,所述第二设备为服务发起设备或服务中转设备;
    所述处理器用于根据所述服务标识信息,确定所述终端设备为所述服务发起设备的服务响应设备;
    所述收发器还用于发送响应消息,所述响应信息携带第二路径信息,所述第二路径信息包括所述服务发起设备的标识信息和所述终端设备的标识信息,或所述服务发起设备的标识信息、所述第二设备的标识信息和所述终端设备的标识信息。
  45. 根据权利要求44所述的终端设备,其特征在于,所述收发器具体用于:
    向所述第二设备发送所述响应信息;或
    若所述终端设备处于第一NAN数据簇NDC中,在所述第一NDC中广播所述响应消息;或
    若所述终端设备处于至少两个NDC中,在所述至少两个NDC中的至少一个NDC中广播所述响应消息;或
    若所述终端设备不处于所述NAN中的任何一个NDC中,所述终端设备加入所述NAN中的第二NDC中,在所述第二NDC中广播所述响应消息。
  46. 根据权利要求44或45所述的终端设备,其特征在于,所述处理器还用于:
    在所述服务标识信息和所述终端设备的第一服务标识匹配时,确定所述终端设备为所述服务发起设备的服务响应设备,
    其中,所述服务标识信息为所述服务发起设备根据所述服务发起设备的 服务信息生成,或所述服务发起设备根据所述NAN中的变化信息和所述服务发起设备的服务信息生成,所述第一服务标识为所述终端设备根据所述终端设备的服务信息生成,或所述终端设备根据所述NAN中的变化信息和所述终端设备的服务信息生成,所述服务发起设备的服务信息指示所述服务发起设备支持的服务的信息或查询的服务的信息;
    若所述服务发起设备的服务信息为所述服务发起设备支持的服务的信息,则所述终端设备的服务信息为所述终端设备查询的服务的信息;或若所述服务发起设备的服务信息为所述服务发起设备查询的服务的信息,则所述终端设备的服务信息为所述终端设备支持的服务的信息;
    所述NAN中的变化信息包括以下信息中的至少一项:锚主节点的等级AMR、主节点的MR、主节点MP、锚主节点意愿值AMP、随机因子RF、锚主节点的信标帧传输时间AMBTT、时间同步功能TSF值、簇标识和簇级别CG和组密钥group key。
  47. 根据权利要求44至46中任一项所述的终端设备,其特征在于,所述收发器还用于转发所述第一服务发现消息;或
    在所述处理器根据第一服务发现消息中携带的扩散指示信息,确定需要转发所述第一服务发现消息时,转发所述第一服务发现消息,或
    在所述处理器根据第一服务发现消息中携带的扩散指示信息,确定不需要转发所述第一服务发现消息时,不转发所述第一服务发现消息。
  48. 根据权利要求44至47中任一项所述的终端设备,其特征在于,所述响应消息包括跳数信息和第一衡量metric值,所述跳数信息由所述服务发现消息从所述服务发起设备传输到所述终端设备的转发次数确定,所述第一metric值用于衡量所述终端设备到所述第二设备之间的路径的优劣程度。
PCT/CN2015/099841 2015-12-30 2015-12-30 临近感知网络nan中用于服务发现的方法和终端设备 WO2017113176A1 (zh)

Priority Applications (4)

Application Number Priority Date Filing Date Title
PCT/CN2015/099841 WO2017113176A1 (zh) 2015-12-30 2015-12-30 临近感知网络nan中用于服务发现的方法和终端设备
EP15911805.8A EP3383102B1 (en) 2015-12-30 2015-12-30 Method for service discovery in neighbor awareness network (nan) and terminal device
US16/067,504 US10575241B2 (en) 2015-12-30 2015-12-30 Method for service discovery in neighbor awareness network NAN, and terminal device
CN201580085376.XA CN108370548B (zh) 2015-12-30 2015-12-30 临近感知网络nan中用于服务发现的方法和终端设备

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2015/099841 WO2017113176A1 (zh) 2015-12-30 2015-12-30 临近感知网络nan中用于服务发现的方法和终端设备

Publications (1)

Publication Number Publication Date
WO2017113176A1 true WO2017113176A1 (zh) 2017-07-06

Family

ID=59224055

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2015/099841 WO2017113176A1 (zh) 2015-12-30 2015-12-30 临近感知网络nan中用于服务发现的方法和终端设备

Country Status (4)

Country Link
US (1) US10575241B2 (zh)
EP (1) EP3383102B1 (zh)
CN (1) CN108370548B (zh)
WO (1) WO2017113176A1 (zh)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109429301A (zh) * 2017-09-04 2019-03-05 中兴通讯股份有限公司 服务搜索方法、相应设备及存储介质
WO2021185141A1 (zh) * 2020-03-18 2021-09-23 华为技术有限公司 Wi-Fi Aware的建链方法、系统、电子设备和存储介质
CN113556692A (zh) * 2020-04-24 2021-10-26 北京小米移动软件有限公司 网络设备探测方法、装置及系统

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10477449B2 (en) * 2016-08-26 2019-11-12 Veniam, Inc. Systems and methods for route selection in a network of moving things, for example including autonomous vehicles
US11259233B2 (en) 2019-02-15 2022-02-22 Qualcomm Incorporated Signaling port information of user equipment ports in a wireless communication system including a radio access network
US11412442B2 (en) * 2020-04-30 2022-08-09 Cisco Technology, Inc. Predictive service advertisements by service discovery gateway

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104349285A (zh) * 2013-08-05 2015-02-11 诺基亚公司 用于在集群选择中的跳数使用的方法、装置和计算机程序产品
CN104661260A (zh) * 2015-01-20 2015-05-27 中南大学 一种QoS感知和负载均衡的无线Mesh智能电网路由机制
CN104716993A (zh) * 2013-12-16 2015-06-17 诺基亚公司 短程通信环境中用于服务发现的方法、设备和计算机程序产品
WO2015187255A1 (en) * 2014-06-02 2015-12-10 Qualcomm Incorporated Peer discovery in neighbor awareness networking (nan) aided data link networks

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9485708B2 (en) * 2013-09-10 2016-11-01 Qualcomm Incorporated Systems and methods for concurrent service discovery and minimum spanning tree formation for service delivery
US9686369B2 (en) * 2013-09-13 2017-06-20 Qualcomm Incorporated System and method for multihop service discovery with member station proxy service advertisements
US9258193B2 (en) * 2014-01-14 2016-02-09 Nokia Technologies Oy Method, apparatus, and computer program product for wireless network cluster discovery and concurrency management
US9648485B2 (en) 2014-02-03 2017-05-09 Qualcomm Incorporated Discovery of a neighbor awareness network (NAN) using a wake up message
US10433353B2 (en) * 2015-03-09 2019-10-01 Apple Inc. Neighbor awareness networking service discovery proxy

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104349285A (zh) * 2013-08-05 2015-02-11 诺基亚公司 用于在集群选择中的跳数使用的方法、装置和计算机程序产品
CN104716993A (zh) * 2013-12-16 2015-06-17 诺基亚公司 短程通信环境中用于服务发现的方法、设备和计算机程序产品
WO2015187255A1 (en) * 2014-06-02 2015-12-10 Qualcomm Incorporated Peer discovery in neighbor awareness networking (nan) aided data link networks
CN104661260A (zh) * 2015-01-20 2015-05-27 中南大学 一种QoS感知和负载均衡的无线Mesh智能电网路由机制

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
See also references of EP3383102A4 *

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109429301A (zh) * 2017-09-04 2019-03-05 中兴通讯股份有限公司 服务搜索方法、相应设备及存储介质
CN109429301B (zh) * 2017-09-04 2022-03-25 中兴通讯股份有限公司 服务搜索方法、相应设备及存储介质
WO2021185141A1 (zh) * 2020-03-18 2021-09-23 华为技术有限公司 Wi-Fi Aware的建链方法、系统、电子设备和存储介质
CN113556692A (zh) * 2020-04-24 2021-10-26 北京小米移动软件有限公司 网络设备探测方法、装置及系统

Also Published As

Publication number Publication date
EP3383102B1 (en) 2020-05-20
EP3383102A1 (en) 2018-10-03
CN108370548A (zh) 2018-08-03
US20190021044A1 (en) 2019-01-17
US10575241B2 (en) 2020-02-25
CN108370548B (zh) 2020-06-02
EP3383102A4 (en) 2018-12-05

Similar Documents

Publication Publication Date Title
WO2017113176A1 (zh) 临近感知网络nan中用于服务发现的方法和终端设备
JP6266841B2 (ja) 通信の方法および装置
WO2017113182A1 (zh) 用于确定传输链路的方法和终端设备
JP6408151B2 (ja) ネットワーク発見
EP2874434B1 (en) Method, device and system for joining neighbor awareness network cluster
CN107431969B (zh) 通信资源分配方法及装置、终端设备、基站和通信系统
KR101780267B1 (ko) 블루투스 디바이스들을 이웃 인식 네트워크들로 통합하기 위한 방법들 및 장치
JP6400599B2 (ja) 近傍アウェアネットワークにおいてフレームをフォーマットするためのシステムおよび方法
US9313641B2 (en) System and method for advertising and communicating within a neighborhood aware network
US9585046B2 (en) Systems, methods, and devices for social proximity fine timing measurement requests multicast signaling
US20140082205A1 (en) System and method for post-discovery communication within a neighborhood-aware network
JP6040466B2 (ja) 通信制御方法、ユーザ機器、ネットワークサーバ、およびシステム
US20160081005A1 (en) Route formation and message transmission in a data link group over multiple channels
JP2015503874A (ja) アクセスポイントと局との間で構成変更メッセージを送信するシステムおよび方法
US10594598B2 (en) Path setup in a mesh network
US20160352782A1 (en) Proxy advertisements in a neighbor aware network
WO2013091135A1 (en) Method and apparatus for facilitating gateway selection
US10609627B2 (en) Identifying communications technology from cellular broadcast data
US20170055199A1 (en) Enhanced power reduction in mesh networks
WO2017049931A1 (zh) 一种获取用户设备信息的方法以及相关设备
WO2019114670A1 (zh) 一种中继系统接入方法及装置
TW201935968A (zh) 配置同步載波的方法、設備及電腦存儲媒介
US9924400B2 (en) Enhanced power reduction in mesh networks
WO2023108628A1 (zh) 通信方法、装置、设备、存储介质、芯片、产品及程序
WO2017113282A1 (zh) 网络消息通知装置、方法以及通信系统

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: 15911805

Country of ref document: EP

Kind code of ref document: A1

WWE Wipo information: entry into national phase

Ref document number: 2015911805

Country of ref document: EP

NENP Non-entry into the national phase

Ref country code: DE

ENP Entry into the national phase

Ref document number: 2015911805

Country of ref document: EP

Effective date: 20180626