WO2015161767A1 - 一种服务发现的方法及电子设备 - Google Patents

一种服务发现的方法及电子设备 Download PDF

Info

Publication number
WO2015161767A1
WO2015161767A1 PCT/CN2015/076983 CN2015076983W WO2015161767A1 WO 2015161767 A1 WO2015161767 A1 WO 2015161767A1 CN 2015076983 W CN2015076983 W CN 2015076983W WO 2015161767 A1 WO2015161767 A1 WO 2015161767A1
Authority
WO
WIPO (PCT)
Prior art keywords
service discovery
address
access point
response
request
Prior art date
Application number
PCT/CN2015/076983
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 EP15783107.4A priority Critical patent/EP3128718B1/en
Priority to US15/306,634 priority patent/US20170048788A1/en
Publication of WO2015161767A1 publication Critical patent/WO2015161767A1/zh

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W48/00Access restriction; Network selection; Access point selection
    • H04W48/16Discovering, processing access restriction or access information
    • 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
    • H04L65/00Network arrangements, protocols or services for supporting real-time applications in data packet communication
    • H04L65/40Support for services or applications
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W84/00Network topologies
    • H04W84/02Hierarchically pre-organised networks, e.g. paging networks, cellular networks, WLAN [Wireless Local Area Network] or WLL [Wireless Local Loop]
    • H04W84/10Small scale networks; Flat hierarchical networks
    • H04W84/12WLAN [Wireless Local Area Networks]

Definitions

  • the present invention relates to the field of communications technologies, and in particular, to a service discovery method and an electronic device.
  • the IEEE-defined wireless LAN standard 802.11 defines two network structure modes. One is based on the infrastructure, that is, one node is used as an access point (AP), and other nodes are used as stations (Stations, STAs). The ingress provides access services, and other nodes connect to the access point and access the network through the access point. The second is the independent Basic Service Set (IBSS) mode. Under this network structure, each device is an equal site, and each other establishes a connection. In a specific implementation, in some scenarios, for example, two mobile phones need to be connected to each other, the 802.11 standard cannot easily realize the discovery and connection between two devices.
  • IBSS Basic Service Set
  • the Wi-Fi Alliance developed the Wi-Fi Direct standard, which further defines how and how to establish a connection between two devices. Specifically, both devices randomly send probe messages on the three channels 1, 6, and 11, or listen to other people's probe messages. If they hear and respond to the response, the two devices discover each other, and then both. Beginning to negotiate who is the Group Owner (GO), the group master device is equivalent to the role of the access point, the other devices are group members (Group Client), and the group member device is equivalent to the site role. The group member device requests an association from the group master device and then establishes a connection.
  • GO Group Owner
  • Group Client group members
  • the group member device requests an association from the group master device and then establishes a connection.
  • the Wi-Fi Direct standard only defines the discovery and connectivity issues at the Wi-Fi level between the two devices and does not involve the service layer at the Wi-Fi level.
  • the device can be connected to the Wi-Fi layer through the Wi-Fi standard, but the upper layer services between the devices are not uniform.
  • the file transfer service of the manufacturer A uses the TCP protocol at the upper layer.
  • the file transfer service of B uses the UDP protocol at the upper layer, so that the business layers of each family cannot communicate.
  • the Wi-Fi Alliance has developed the Wi-Fi Direct Service (WFDS) standard based on the Wi-Fi Direct standard.
  • the WFDS standard standardizes the upper-layer interaction, so that the upper-layer services of each manufacturer can communicate with each other. For example, both devices use the UPnP File Transfer protocol for file transfer services.
  • the two devices in the process of using the above standards, if two devices are connected to the same access point, for example, the mobile phone and the television in the home network are connected to the router at home, and the two devices establish a service connection, and the query party is found ( For example, a mobile phone) needs to first disconnect from an access point (such as a router), and the first device (such as a mobile phone) needs to randomly send a probe message (or listen for a probe message) on the 1, 6, and 11 channels, for example, the second device (for example, After listening to the probe message and replying to the response message (or replying to the response message), the first device (for example, a mobile phone) and the second device (for example, a television) discover each other.
  • an access point such as a router
  • the first device such as a mobile phone
  • the second device for example, After listening to the probe message and replying to the response message (or replying to the response message), the first device (for example, a mobile phone) and the second device (for example,
  • the two devices negotiate who is the group owner, and the other device acts as the group member, and the group member device applies for association to the group master device, and then establishes a connection for data transmission.
  • the above Wi-Fi Direct standard and the WFDS standard only consider the way of direct discovery and connection between two devices, and do not consider how to achieve discovery between two devices when both devices are connected to the same access point. The situation of the connection.
  • the embodiment of the present invention provides a service discovery method and an electronic device, which are to solve the problem of how to discover and establish an upper layer connection between devices when an access point is connected to the access point, and then implement the device. Interworking between upper and lower services.
  • the present invention provides an embodiment of a service discovery method.
  • the method includes: a first device sends a service discovery request to an at least one second device connected to the access point via an access point; the service discovery request is used to The at least one second device queries the service that the first device requests to query; the first device receives a service discovery response sent by the at least one second device, and the service discovery response is the at least one second device pair The response of the service discovery request.
  • the service discovery request is a data frame format
  • the first device is connected to the access point via an access point.
  • the at least one second device sends the service discovery request, where the first device sends a service discovery request by the access point, where the frame header of the service discovery request data frame sent by the first device to the access point includes: The address of the access point; the address of the first device; the broadcast address; the frame header of the service discovery request data frame broadcast by the first device via the access point includes: the broadcast address; the access The address of the point; the address of the first device.
  • the service discovery request is a data frame format
  • the first device is connected to the access point via an access point.
  • the at least one second device sends a service discovery request, including: the first device sends a service discovery request by using the access point unicast; and the frame header of the service discovery request data frame sent by the first device to the access point includes: The address of the access point; the address of the first device; the address of the second device; the frame header of the service discovery request data frame sent by the first device via the access point includes: The address of the second device; the address of the access point; the address of the first device.
  • the frame body portion of the service discovery request data frame includes: a frame body portion of the probe request frame; or, a service Discover the frame body portion of the request frame.
  • the first device receives a service discovery response sent by the at least one second device, including: The first device receives a service discovery response sent by the at least one second device via the access point, and the service discovery response is a data frame format.
  • the service discovery response includes IP address information of the second device.
  • the service discovery response includes a MAC address of the second device, and is received by the first device
  • the method further includes: the first device sending a query request to a reverse address translation protocol server; the query request includes a Mac address of the second device; The query request is used to query IP address information of the second device; the first device receives a query response sent by a reverse address translation protocol server; and the query response includes IP address information of the second device.
  • the reverse address translation protocol server and the access point are the same device;
  • the sending, by the protocol server, the query request includes: sending, by the first device, a query request to the access point;
  • the first device receives the query response sent by the reverse address translation protocol server, and the first device receives the query response sent by the access point.
  • the method also includes:
  • the first device sends a first capability negotiation request to the second device; the first capability negotiation request is used to negotiate how to establish a connection with the second device;
  • the first device receives a first capability negotiation response sent by the second device, where the first capability negotiation response is a response of the second device to the first capability negotiation request.
  • the sending, by the first device, the first capability negotiation request to the second device The access point sends a first capability negotiation request to the second device, where the first capability negotiation request is a data frame format.
  • the first capability negotiation response includes the IP address information of the second device.
  • the first device receives the second capability negotiation request sent by the second device The first device sends a second capability negotiation response to the second device, where the second capability negotiation response is a response of the first device to the second capability negotiation request.
  • the first device sends a second capability negotiation response to the second device, including: the first device is configured to: The access point sends a second capability negotiation response to the second device, where the second capability negotiation response is a data frame format.
  • the second capability negotiation request includes the IP address information of the second device.
  • the present invention provides an embodiment of a service discovery method.
  • the method includes: receiving, by the second device, the first device a service discovery request sent by the access point; the service discovery request is used to query the second device for a service requested by the first device; and the second device sends a service discovery response to the first device; The service discovery response is a response of the second device to the first service discovery request.
  • the service discovery request is a data frame format.
  • the sending, by the second device, the service discovery response to the first device includes: The access point sends a service discovery response to the first device; the service discovery response is a data frame format; wherein a frame header of the service discovery response data frame sent by the second device to the access point is in turn The address of the access point, the address of the second device, the address of the first device, and the frame header of the service discovery response data frame sent by the second device via the access point in sequence: The address of the first device; the address of the access point; the address of the second device.
  • the service discovery response includes IP address information of the second device.
  • the method further includes:
  • the second device sends a first capability negotiation response to the first device, where the first capability negotiation response is a response of the second device to the first service discovery request.
  • the sending, by the second device, the first capability negotiation response to the first device The access point sends a first capability negotiation response to the first device; the first capability negotiation response is a data frame format.
  • the first capability negotiation response includes IP address information of the second device.
  • the method further includes:
  • the second device acquires a response instruction input by the user, and sends a second capability negotiation request to the first device;
  • the second device receives a second capability negotiation response sent by the first device, where the second capability negotiation response is a response of the first device to the second capability negotiation request.
  • the second device that obtains a response command input by the user, and sends a second capability negotiation request to the first device includes:
  • the second device acquires a response command input by the user, and sends a second capability negotiation request to the first device by using the access point, where the second capability negotiation request is a data frame format.
  • the second capability negotiation request includes the IP address information of the second device.
  • the present invention provides an embodiment of a service discovery method.
  • the method includes: an access point receiving a service discovery request sent by a first device; the service discovery request, configured to query the at least one second device for the first device request Querying the service; the access point is connected to the at least one second device; the access point sends the service discovery request to the at least one second device; the access point receives the at least one a service discovery response sent by the second device, the service discovery response being a response of the second device to the service discovery request; the access point transmitting the service discovery response to the first device.
  • the service discovery request is a data frame format
  • the access point sends the service discovery to the at least one second device
  • the request includes: the access point broadcasts the service discovery request; wherein, the frame header of the service discovery request data frame received by the access point includes: an address of the access point, where the first The address of the device; the broadcast address.
  • the frame header of the service discovery request data frame broadcasted by the access point includes: the broadcast address; an address of the access point; and an address of the first device.
  • the service discovery request is a data frame format
  • the frame header of the service discovery request data frame received by the access point is in turn The address of the access point, the address of the first device, and the address of the second device.
  • the frame header of the service discovery request data frame sent by the access point includes: an address of the second device; an address of the access point; an address of the first device.
  • the service discovery response includes IP address information of the second device.
  • the service discovery response includes a MAC address of the second device; After the first device sends the service discovery response, the method further includes:
  • the access point receives the query request sent by the first device, where the query request includes a MAC address of the second device, and the query request is used to query IP address information of the second device;
  • the access point sends a query response to the first device; the query response includes IP address information of the second device.
  • the method further includes:
  • the access point Receiving, by the access point, the first capability negotiation request sent by the first device; the first capability negotiation request is used to negotiate how to establish a connection with the second device; and the first capability negotiation request is a data frame format ;
  • the access point Receiving, by the access point, a first capability negotiation response sent by the second device, where the capability negotiation response is a response of the second device to the capability negotiation request; and the first capability negotiation response is a data frame format ;
  • the access point sends the first capability negotiation response to the first device.
  • the first capability negotiation response includes the IP address information of the second device.
  • the method further includes:
  • the second capability negotiation request is a data frame format
  • the access point sends the second capability negotiation response to the second device.
  • the second capability negotiation request includes IP address information of the second device.
  • the invention provides an embodiment of an electronic device.
  • the electronic device includes: a sending unit, configured to send, by using an access point, a service discovery request to at least one second device connected to the access point; Querying, to the at least one second device, a service that the first device requests to query;
  • a receiving unit configured to receive a service discovery response sent by the at least one second device, where the service discovery response is a response of the at least one second device to the service discovery request.
  • the service discovery request is a data frame format
  • the sending unit is specifically configured to: broadcast a service discovery request by using an access point; ,
  • the frame header of the service discovery request data frame sent by the sending unit to the access point includes: an address of the access point; an address of the first device; a broadcast address;
  • the frame header of the service discovery request data frame broadcast by the sending unit via the access point includes: the broadcast address; the address of the access point; and the address of the first device.
  • the service discovery request is a data frame format
  • the sending unit is specifically configured to send a service discovery request by using an access point unicast ;
  • the frame header of the service discovery request data frame sent by the sending unit to the access point includes: an address of the access point; an address of the first device; an address of the second device;
  • the frame header of the service discovery request data frame sent by the sending unit by the access point unicast includes: an address of the second device; an address of the access point; an address of the first device.
  • the frame body portion of the service discovery request data frame sent by the sending unit includes: a frame body portion of the probe request frame; or a frame body portion of the service discovery request frame.
  • the receiving unit is configured to receive, by using the access point, the at least one second device A service discovery response, the service discovery response being in a data frame format.
  • the service discovery response received by the receiving unit includes the IP address information of the second device.
  • the service discovery response includes a MAC address of the second device
  • the sending unit is further configured to: after the receiving unit receives the service discovery response sent by the at least one second device, send a query request to the reverse address translation protocol server; the query request includes the second device a Mac address; the query request is used to query IP address information of the second device;
  • the receiving unit is further configured to: receive a query response sent by a reverse address translation protocol server; and the query response includes IP address information of the second device.
  • the invention provides an embodiment of an electronic device.
  • the electronic device includes: a transmitter, configured to send, by using an access point, a service discovery request to at least one second device connected to the access point; Querying, to the at least one second device, a service that the first device requests to query;
  • a receiver configured to receive a service discovery response sent by the at least one second device, where the service discovery response is a response of the at least one second device to the service discovery request.
  • the service discovery request is a data frame format; the sender is specifically configured to broadcast a service discovery request via an access point;
  • the frame header of the service discovery request data frame sent by the sender to the access point includes: an address of the access point; an address of the first device; a broadcast address;
  • the frame header of the service discovery request data frame broadcasted by the sender via the access point includes: the broadcast address; an address of the access point; an address of the first device.
  • the service discovery request is a data frame format
  • the sender is specifically configured to send a service discovery request by using an access point unicast ;
  • the frame header of the service discovery request data frame sent by the sender to the access point includes: an address of the access point; an address of the first device; an address of the second device;
  • the frame header of the service discovery request data frame sent by the sender through the access point unicast includes: an address of the second device; an address of the access point; an address of the first device.
  • the frame body part of the service discovery request data frame sent by the sender includes: a frame body part of the probe request frame Or, the frame body portion of the service discovery request frame.
  • the receiver is configured to receive the at least one second device by using the access point
  • the transmitted service discovery response, the service discovery response is in a data frame format.
  • the service discovery response includes the IP address information of the second device.
  • the service discovery response includes a MAC address of the second device
  • the transmitter is further configured to: after the receiver receives the service discovery response sent by the at least one second device, send a query request to a reverse address translation protocol server; the query request includes the second device a Mac address; the query request is used to query IP address information of the second device;
  • the receiver is further configured to receive a query response sent by a reverse address translation protocol server; the query response includes IP address information of the second device.
  • the reverse address translation protocol server and the access point are the same device
  • the transmitter is specifically configured to send a query request to the access point
  • the receiver is specifically configured to receive a query response sent by the access point.
  • the transmitter is further configured to send, by using the second device, a first capability negotiation request; Determining, by the first capability negotiation request, how to establish a connection with the second device;
  • the receiver is further configured to receive a first capability negotiation response sent by the second device, where the first capability negotiation response is a response of the second device to the first capability negotiation request.
  • the transmitter is specifically configured to send, by using the access point, a first capability negotiation request to the second device, where
  • the first capability negotiation request is a data frame format.
  • the first capability negotiation response includes the IP address information of the second device.
  • the receiver is further configured to receive the second capability negotiation sent by the second device Request
  • the transmitter is further configured to send a second capability negotiation response to the second device, where the second capability negotiation response is a response of the first device to the second capability negotiation request.
  • the transmitter is configured to send, by using the access point, a second capability negotiation response to the second device
  • the second capability negotiation response is a data frame format.
  • the second capability negotiation request includes the IP address information of the second device.
  • the invention provides an embodiment of an electronic device.
  • the electronic device includes:
  • a receiver configured to receive a service discovery request sent by the first device via the access point, where the service discovery request is used to query the second device for a service requested by the first device;
  • a sender configured to send a service discovery response to the first device; the service discovery response is a response of the second device to the first service discovery request.
  • the service discovery request received by the receiver is a data frame format.
  • the transmitter is specifically configured to send a service discovery response to the first device by using the access point.
  • the service discovery response is a data frame format, wherein the frame header of the service discovery response data frame sent by the sender to the access point includes: an address of the access point; the second device Address; an address of the first device;
  • the frame header of the service discovery response data frame sent by the sender via the access point includes: an address of the first device; an address of the access point; and an address of the second device.
  • the service discovery response includes the IP address information of the second device.
  • the receiver is further configured to receive a first capability negotiation request sent by the first device, The first capability negotiation request is used to negotiate how to establish a connection with the second device;
  • the transmitter is further configured to send a first capability negotiation response to the first device, where the first capability negotiation response is a response of the second device to the first service discovery request.
  • the sending by the sending, the first capability negotiation response to the first device, specifically:
  • the transmitter sends a first capability negotiation response to the first device via the access point; the first capability negotiation response is a data frame format.
  • the first capability negotiation response includes the IP address information of the second device.
  • the electronic device further includes:
  • An input device for obtaining a response instruction input by the user An input device for obtaining a response instruction input by the user
  • the transmitter is further configured to: after the input device acquires a response instruction input by the user, send a second capability negotiation request to the first device;
  • the receiver is further configured to receive a second capability negotiation response sent by the first device, where the second capability negotiation response is a response of the first device to the second capability negotiation request.
  • the sender sends a second capability negotiation request to the first device, specifically:
  • the transmitter sends a second capability negotiation request to the first device via the access point, where the second capability negotiation request is a data frame format.
  • the second capability negotiation request includes the IP address information of the second device.
  • the invention provides an embodiment of an electronic device.
  • the electronic device includes:
  • a receiver configured to receive a service discovery request sent by the first device, where the service discovery request is used to query the at least one second device for a service requested by the first device, and send the at least one second device to send Service discovery response, the service discovery response being a response of the second device to the service discovery request;
  • a transmitter configured to send the service discovery request to the at least one second device; and send the service discovery response to the first device.
  • the service discovery request is a data frame format
  • the sender sends the service discovery request to the at least one second device Specifically, the sender broadcasts the service discovery request
  • the frame header of the service discovery request data frame received by the receiver includes: an address of the access point; an address of the first device; and a broadcast address.
  • the frame header of the service discovery request data frame broadcast by the transmitter includes: the broadcast address; an address of the access point; and an address of the first device.
  • the service discovery request is a data frame format, and the sender unicasts the service discovery request;
  • the frame header of the service discovery request data frame received by the receiver includes: the access point Address; address of the first device; address of the second device.
  • the frame header of the service discovery request data frame sent by the sender includes: an address of the second device; an address of the access point; an address of the first device.
  • the service discovery response includes IP address information of the second device.
  • the receiver is further configured to receive a query request sent by the first device, where the query The request includes a MAC address of the second device, where the query request is used to query IP address information of the second device;
  • the sender is further configured to send a query response to the first device; the query response includes IP address information of the second device.
  • the receiver is further configured to receive a first capability negotiation request sent by the first device;
  • the first capability negotiation request is used to negotiate how to establish a connection with the second device;
  • the first capability negotiation request is a data frame format;
  • the first capability negotiation response sent by the second device is received, and the capability negotiation is performed.
  • the response is a response of the second device to the capability negotiation request;
  • the first capability negotiation response is a data frame format;
  • the transmitter is further configured to send the first capability negotiation request to the second device, and send the first capability negotiation response to the first device.
  • the first capability negotiation response includes the IP address information of the second device.
  • the receiver is further configured to: receive a second capability negotiation request sent by the second device; the second capability negotiation request is a data frame format, and receive a second capability negotiation response sent by the first device, The second capability negotiation response is a response of the second device to the second capability negotiation request; the second capability negotiation response is a data frame format;
  • the transmitter is further configured to send the second capability negotiation request to the first device, and send the second capability negotiation response to the second device.
  • the second capability negotiation request includes the IP address information of the second device.
  • the access point mentioned above may be an access point (AP, Access Point) in an infrastructure Wi-Fi network, or may be a group master device that establishes a group through a Wi-Fi Direct protocol (Group Owner).
  • AP Access Point
  • Group Owner a Wi-Fi Direct protocol
  • the interaction of the service discovery messages between the multiple electronic devices can be realized without the electronic device disconnecting the connection with the access point.
  • Service discovery efficiency which in turn improves interoperability.
  • the embodiment of the invention expands the application range of the Wi-Fi Direct Service and improves the user experience.
  • Figure 3 is a data frame structure diagram defined by the WFDS standard
  • FIG. 4 is a flowchart of an embodiment of a service discovery method according to an embodiment of the present invention.
  • FIG. 5 is a flowchart of an embodiment of a service discovery method according to an embodiment of the present invention.
  • FIG. 6 is a flowchart of an embodiment of a service discovery method according to an embodiment of the present invention.
  • FIG. 7 is a schematic structural diagram of an embodiment of an electronic device according to an embodiment of the present disclosure.
  • FIG. 8 is a schematic structural diagram of an embodiment of an electronic device according to an embodiment of the present invention.
  • FIG. 1 is a general flowchart of complete service discovery and connection establishment provided by the prior art. Among them, the complete service discovery and connection establishment includes the following steps:
  • the Service Discovery is used to detect which device can support the services required by this device.
  • the service discovery includes a Probe interaction and a service discovery interaction, and the aforementioned two interactions use different Wi-Fi messages.
  • Provision Discovery including connection capability exchange, feature capability exchange, Wi-Fi Simple Configuration exchange, etc. This step is mainly to confirm the two devices. Connection capabilities, what state each device is in, and how to connect.
  • connection phase according to the negotiation result of the capability negotiation phase, it is determined whether the interaction between the two devices is to create a new connection or use the original connection.
  • ASP is based on the network layer (IP layer). Whether you create a new connection or use the original connection, you can obtain the IP address of the peer device.
  • IP layer the network layer
  • the service querying party obtains the IP address information of the other device. Based on the IP address, both parties establish an ASP session.
  • the service inquiring party sends a REQUEST_SESSION message to the service responder at the IP network layer based on the IP address.
  • the REQUEST_SESSION message is sent to the MAC layer, transmitted at the MAC layer, and sent directly by the service inquiring party to the service responder. In the environment where the access point participates, at the MAC layer, this message is forwarded through the AP.
  • the TDLS direct connection has been established, it can also be sent by the service inquiring party to the service responder.
  • an upper-layer service is established, such as a photo service.
  • both parties establish an Application socket connection and perform data transfer.
  • the aforementioned interactive message is also directly transmitted by the service inquiring party and the service responding party at the MAC layer.
  • the MAC layer carries these messages, it can be forwarded by the AP.
  • the service inquirer can directly interact with the service responder.
  • the existing ASP approach can be directly used, and whether the application environment of the access point has no influence on these two steps.
  • the processing manner of the embodiment of the present invention is different from the existing ASP.
  • the foregoing steps of the service discovery phase, the capability negotiation phase, and the connection establishment phase may include the following Interaction information, such as Probe Request, Probe Response, service discovery Request, service discovery Response, provision discovery request, provision discovery Response, and the like.
  • Interaction information such as Probe Request, Probe Response, service discovery Request, service discovery Response, provision discovery request, provision discovery Response, and the like.
  • these messages are sent from one site to another in the form of management frames; but in a network structure with access points, these messages can be through the access point. Forwarded.
  • the foregoing interaction information can be transmitted in the form of a data frame.
  • the data frame format in the IEEE 802.11 standard and the data frame format in the WFA WFDS standard are introduced as follows.
  • FIG. 2 is a data frame structure defined by IEEE 802.11.
  • the 802.11 MAC Header is a frame header, which includes Frame Control, Duration/ID Number (Duration/ID), Receive Address (Address1), Send Address (Address2), Sequence Control, and High Throughput. High Throughput Control, etc., especially including related address information.
  • the LLC Header is the head of the LLC layer.
  • the SNAP Header is an extended LLC header. When the Ether type is set to 0x890d, it means that the 802.11 management protocol is carried later, which is defined by the existing standard.
  • the Payload Type is now defined.
  • a new Payload Type may be added to the data frame structure, for example, the Payload Type is 3, indicating that the management frame of the WFDS is carried later.
  • the management frame needs to be distinguished according to the difference of the interaction information.
  • a byte can be taken to indicate the type of the management frame, and the byte can be called a Packet Type. For example, when the Packet Type is 0, it is used to identify the tube.
  • the type of the management frame is a P2P probe request; when the Packet Type is 1, the type used to identify the management frame is a P2P Probe Response; when the Packet Type is 2, the type used to identify the management frame is a P2P service discovery request; When the Packet Type is 3, the type for identifying the management frame is P2P service discovery Response; when the Packet Type is 4, the type for identifying the management frame is P2P provision discovery request; when the Packet Type is 5, The type identifying the management frame is P2P provision discovery Response.
  • the management frame may be all encapsulated into a data frame; or only the frame body part of the management frame may be encapsulated, and the frame header of the management frame is not encapsulated.
  • FIG. 3 is a data frame structure defined by the WFDS standard.
  • 0x506F9A is used to indicate that the data frame is WFA-defined content; the second part is the content defined by ASP2.0, and this value is specified by the WFA, for example, may be 0x1600 or the like.
  • the Packet Type and Frame Content sections are identical to those used in 802.11.
  • the first three bytes represent the organization and the last two bytes represent the type.
  • 0x000000 represents IEEE
  • 0x890d represents 802.11 management protocol
  • 0x506F9A represents WFA
  • 0x1600 represents WFDS management protocol.
  • the WFDS management protocol does not have to use 0x1600, and can be replaced by other values.
  • the service discovery method provided by the embodiment of the present invention may include the following steps, where the method may be executed by the discovery querying party to obtain information about the service that the discovery query party queries.
  • the discovery query party is a party that sends a service discovery request and receives a service discovery response.
  • the other party opposite to the discovery query party is a discovery responder, and the responder receives the discovery query.
  • the service discovery request of the party sends a service discovery response to the discovery query party, and the service discovery response includes information about the service that the query party queries.
  • the first device sends a service discovery request to the at least one second device connected to the access point, where the service discovery request is used to query the at least one second device for the first device request.
  • Query service
  • the first device is connected to the access point, and the access point is connected to at least two devices.
  • the access point is connected to at least one second device in addition to the first device.
  • the first device sends a service discovery request via an access point, where the service discovery request is used to query the at least one second device for a service requested by the first device.
  • the service discovery request may include information of a service requested by the first device, such as a name of a service queried by the first device or a corresponding ID value.
  • the service that the first device requests to query may include not only querying the service supported by the second device, but also querying the service that is not supported by the second device; the service of the query may include not only the type of the query service.
  • the service discovery request is used to request a query play service, which may request to query whether the second device supports the play service; the service query that may also be requested includes the type of the play service attribution, and the specific content of the play service.
  • the playback service may be attributed to a type of entertainment.
  • the service discovery request may request to query the entertainment type of the second device, and then query the playback service from the entertainment type; and directly query the playback service supported by the second device, for example, Play supported video formats, playback resolutions, etc.
  • the at least one second device acquires the name or ID value of the service included in the service discovery request, it may determine whether the service corresponding to the name or the ID value is supported, and if the service is supported, determine the The specific content of the service.
  • the service discovery request is a data frame format
  • the data frame is a Wi-Fi defined one.
  • a frame type the data frame including a frame header and a frame body.
  • the frame header of the data frame may include three addresses, and the names may be Address1 (A1), Address 2 (A2), Address 3 (A3), the address information included in the frame header, and the order of the address information. It can be adjusted according to the sender and receiver of the data frame.
  • the frame header address of the data frame is: the A1 is a direct receiver address, the A2 is a direct sender address, and the A3 is The final destination address; when the data frame is a data frame sent by the access point to the device, the A1 is a direct receiver address, and is also a target address, and the A2 is a direct sender address, and the A3 is Original source address.
  • the service discovery request may also be a management frame or a control frame.
  • the first device sends the service discovery request via the access point
  • the access point receives the service discovery request sent by the first device
  • the access point parses the management frame or control frame
  • the access point may process the management frame or the control frame according to a preset rule.
  • the access point sends the processed management frame or control frame to at least one second device.
  • the first device may broadcast a service discovery request via the access point.
  • the service discovery request is a data frame format.
  • A1 destination address information
  • A3 the final destination address information
  • the broadcast address is an address dedicated to simultaneously transmitting to the second device in the network.
  • the MAC layer it includes a 48-bit host identification segment host ID, and the 48-bit host identification segment host ID is 1 to indicate that the address is a broadcast address.
  • the frame header of the service discovery request data frame sent by the first device to the access point includes: an address of the access point; an address of the first device; a broadcast address.
  • the access point receives the service discovery request of the first device, changing the service discovery Requesting a frame header address format of the data frame, setting the broadcast address to A1 (destination address information), and broadcasting a service discovery request data frame in a modified frame header address format, so that the second device connected to the access point can receive the A service discovery request broadcast by an access point.
  • the frame header of the service discovery request data frame broadcasted by the access point includes: a broadcast address; an address of the access point; and an address of the first device.
  • the first device may also unicast a service discovery request to the second device connected to the access point via the access point.
  • the first device learns the Mac address of the second device, and sends a service discovery request to the second device corresponding to the Mac address.
  • the frame header of the service discovery request data frame sent by the first device to the access point includes: an address of the access point; an address of the first device; an address of the second device.
  • the frame header of the service discovery request data frame unicast by the access point includes: an address of the second device; an address of the access point; an address of the first device.
  • the service discovery request may include a first service discovery request and a second service discovery request.
  • the first device sends a first service discovery request to the second device, where the first service discovery request may include an ID value of a service required by the first device.
  • the ID value of the service may be a hash value after the name of the service is hashed.
  • the second device After acquiring the first service discovery request, acquires an ID value of the service, and acquires a name of the service according to the ID value.
  • the first service discovery response may include the name of the service. After acquiring the first service discovery response sent by the second device, the first device acquires the name of the service.
  • the first device may send a second service discovery request to the second device, where the second service discovery request may include a name of the service.
  • the second service discovery request is used to request to acquire specific information of the service corresponding to the service name of the second device.
  • the first service discovery request may be a Probe Request
  • the first service discovery response may be a Probe Response
  • the second service discovery request may be a Service Discovery Request
  • the second service discovery response may be a Service Discovery Response.
  • the first service discovery request that the first device broadcasts to the at least one second device by the access point may be a Probe Request.
  • the Probe Response may carry a service name or a service type that the first device wants to discover, and the service name or service type may be included in the Probe Request in the form of a hash value.
  • the first device may encapsulate the Probe Request in a data frame and forward it by the access point.
  • the first device broadcasts a first service discovery request to the at least one second device connected to the access point via the access point; that is, the first device sends the data frame carrying the Probe Request to the And the access point broadcasts the data frame including the Probe Request to the at least one second device.
  • the three addresses included in the data frame may be: an address of the access point; an address of the first device. ; broadcast address.
  • the three addresses included in the data frame may be: a broadcast address; an address of the access point; The address of the first device.
  • the access point changes address information of a data frame header of the first service discovery request, and the frame of the changed data frame
  • the three addresses in the header information are: a broadcast address, an address of the access point, and an address of the first device.
  • the access point broadcasts the data frame after the change frame header to at least one second device associated with the access point. Or the first device is connected to the access point via the access point.
  • a second device unicasts the first service discovery request; that is, the first device has learned the address information of the second device connected to the access point, and the first device sends the Probe request
  • the data frame is sent to the access point, where the data frame carries the address information of the second device, and the access point sends the data frame including the Probe Request to the at least one second device.
  • the address included in the frame header of the data frame is: information of the access point; Information about the first device; information of the second device.
  • the address included in the frame header of the data frame may be: the address of the second device, the connection The address of the ingress; the address of the first device.
  • the access point unicasts the data frame after the change frame header to at least one second device associated with the access point.
  • the first service discovery request that the first device broadcasts to the at least one second device via the access point may be a Service Discovery Request.
  • the frame body portion of the service discovery request data frame includes: a frame body portion of the probe request frame; or a frame body portion of the service discovery request frame.
  • the service discovery request data frame may include a frame header portion and a frame body portion.
  • the frame body part may only encapsulate a frame body part of the probe request frame, such as a frame body part of the Probe Request, and does not include a frame header part of the Probe Request; the frame body part may only encapsulate the frame body part of the service discovery request frame.
  • the body part of the Service Discovery Request not the frame header part of the Service Discovery Request.
  • the service discovery request data frame sets address information of a header portion according to a specific interaction object.
  • the Service Discovery Request/Response mentioned here may be a generic advertisement service request/response defined in the 802.11 standard, which is referred to as GAS request/response, or may be specifically defined for other purposes. Service discovery request/response.
  • the first device receives a service discovery response sent by the at least one second device, where the service discovery response is a response of the at least one second device to the service discovery request.
  • the second device After receiving the service discovery request sent by the access point, the second device parses the service discovery request, and acquires information about the service requested by the first device. When the second device supports the service requested by the first device, the second device generates a service discovery response.
  • the service discovery response may only include information that the second device supports the service. The information of the service itself is not involved, such as the type of the service, the specific content of the service; optionally, the service discovery response may include the service requested by the first device supported by the at least one second device, which is not only The information including the second device supporting the service, and the information of the service itself, such as the type of the service and the specific content of the service.
  • the second device may also generate a service discovery response, where the service discovery response includes information that the second device does not support the service.
  • the second device may not generate a service discovery response, and the current service discovery interaction process ends.
  • the service discovery request is a Probe Request
  • the service discovery response is a Probe Response
  • the Probe Response is a response of the second device to the Probe Request sent by the first device.
  • the service discovery request is a Service Discovery Request
  • the service discovery response is a Service Discovery Response
  • the Service Discovery Response is a response of the second device to the Service Discovery Request sent by the first device.
  • the second device may respond to different service discovery requests respectively.
  • the first service discovery request sent by the first device is In the probe request
  • the second device sends a Probe Response to the first device in response to the Probe Request.
  • the second service discovery request sent by the first device is a Service Discovery Request
  • the second device sends a Service Discovery Response to the first device in response to the Service Discovery Request.
  • the second device may directly send a first service discovery response to the first device, where the first service discovery response is a management frame format.
  • the frame header of the management frame may include three addresses, the A1 is a direct recipient address, the A2 is a direct sender address, and the A3 is a BSSID (Basic Service Set IDentifier).
  • the BSSID is a MAC (Medium Access Control) address of an access point that is connected to the first device and the second device.
  • the three addresses included in the frame header of the management frame may be: an address of the first device, an address of the second device, and an address of the access point.
  • the second device may send a first service discovery response to the first device via the access point, where the first device receives a first sent by the second device via the access point
  • the service discovery response, the first service discovery response is a data frame format.
  • the frame header address of the first service discovery response data frame sent by the second device to the access point may be: an address of the access point; an address of the second device; Addressing, after receiving the first service discovery response sent by the second device to the first device, the access point adjusts a frame header address of the first service discovery response data frame, after the adjusting
  • the frame header address of the data frame may be: an address of the first device; an address of the access point; an address of the second device.
  • the first device receives a first service discovery response data frame after the adjustment frame header address sent by the access point.
  • the interaction of the service discovery messages between the multiple electronic devices may be implemented without the electronic device disconnecting from the access point.
  • Improve service discovery efficiency and then improve interoperability.
  • Improve interoperability in a scenario where both the inquiring party and the discovery responder are connected to the access point.
  • the service discovery request includes a first service discovery request and a second service discovery request.
  • the first service discovery request is a Probe Request
  • the first service discovery response is a Probe Response.
  • the second service discovery request is a Service Discovery Request
  • the second service discovery response is a Service Discovery Response
  • the Service Discovery Response is a response of the second device to the Service Discovery Request sent by the first device.
  • the first device sends a first service discovery request via the access point, where the first service discovery request is a data frame format.
  • the first device receives a first service discovery response sent by the second device.
  • the second device may send the first service discovery response by using the access point, where the first service discovery response is a data frame format; the second device may also directly send the first device to the first device.
  • the first service discovery response at which time the first service discovery response is a management frame format.
  • the interaction between the second service discovery request and the second service discovery response may be implemented directly between the first device and the second device without forwarding via the access point.
  • the first device may send a second service discovery request to the second device without using the access point, and the first device sends a management frame of the Service Discovery Request to the second device, where the management
  • the frame header of the frame may include three addresses, the A1 is a direct recipient address, the A2 is a direct sender address, and the A3 is a BSSID.
  • the three addresses included in the frame header of the management frame may be: an address of the second device, an address of the access point, and an address of the first device.
  • the second device After the second device receives the second service discovery request sent by the first device, acquiring the service Discovery Request, generates a response to the Service Discovery Request, and the second service discovery response Service Discovery Response.
  • the second device sends a management frame of the Service Discovery Response to the first device.
  • the frame header of the management frame may include three addresses, the A1 is a direct receiver address, the A2 is a direct sender address, and the A3 is a BSSID.
  • the three addresses included in the frame header of the data frame may be: an address of the first device, an address of the second device, and an address of the access point.
  • the interaction between the second service discovery request and the second service discovery response may be forwarded via the access point, where the first device, the second device, and the access point are Realization.
  • the first device may send a second service discovery request to the second device via the access point, where the second service discovery request may be a data frame including a management frame Service Discovery Request.
  • the inclusion management frame may be a frame body portion including only the management frame, or may be a frame header and a frame body portion including the management frame.
  • the rules of the address in the frame header of the data frame are sequentially arranged according to the foregoing arrangement rule, that is, when the data frame is a data frame sent by the device to the access point, the A1 is a direct receiver address, and the A2 is Direct sender address, the A3 is the final destination address; when the data frame is a data frame sent by the access point to the device, the A1 is a direct receiver address, and is also a target address, and the A2 is Direct sender address, the A3 is the original source address. Therefore, when the first device sends a second service discovery request to the access point, the three addresses that can be included in the frame header of the data frame are respectively: an address of the access point; The address of a device; the address of the second device.
  • the access point After the access point receives the second service discovery request sent by the first device, changing a frame header address of the data frame of the second service discovery request, where three headers included in the frame header of the data frame are The specific change is: An address of the second device; an address of the access point; an address of the first device.
  • the second device After acquiring the second service discovery request sent by the access point, acquires a Service Discovery Request sent by the first device.
  • the second device generates a Service Discovery Response, where the Service Discovery Response includes detailed information about a service corresponding to the service name included in the Service Discovery Request, and the second device encapsulates the Service Discovery Response into a data frame. in.
  • the second device may send, by using the access point, the data frame including the Service Discovery Response to the first device, and the data frame of the second discovery response sent by the second device to the access point
  • the address information included in the frame header is: the address of the access point, the address of the second device, the address of the first device, and the access point acquires the second After the data frame of the response is found, the address information included in the frame header of the data frame is changed, and the address information included in the changed frame header is: the address of the first device, the address of the access point, Addressing the address of the second device; the first device receiving the second discovery response forwarded by the access point.
  • the interaction between the second service discovery request and the second service discovery response may be forwarded by the access point, implemented between the first device, the second device, and the access point.
  • the interaction between the second service discovery request and the second service discovery response may be partially forwarded via the access point, that is, the second service discovery request is forwarded via the access point, The second service discovery response is directly sent between the first device and the second device; or the second service discovery request is directly sent between the first device and the second device, The second service discovery response is forwarded via the access point.
  • the interaction between the possible second service discovery request and the second service discovery response is not limited in the embodiment of the present invention.
  • the format is a data frame format
  • the interaction information of the management frame format is encapsulated in the interaction information of the data frame format.
  • the encapsulation may be: encapsulating only the frame body of the management frame in the data frame, or encapsulating the frame header and the frame body of the management frame in the data frame.
  • the first device After the first device acquires the first service discovery response sent by the second device, sends a second service discovery request to the second device.
  • the second service discovery request carries a service name included in the first service discovery response.
  • the frame body portion of the service discovery request data frame includes: a frame body portion of the probe request frame; or a frame body portion of the service discovery request frame.
  • the service discovery request data frame includes a frame header and a frame body.
  • the probe request frame and the service discovery request frame are both management frames, and the management frame also includes a frame header and a frame body.
  • the probe request frame is a Probe Request
  • the service discovery request frame is a service discovery Request.
  • the frame body portion of the service discovery request data frame may include a frame header and a frame body of the probe request frame, or may only include a frame body portion of the probe request frame; likewise, the service discovery request frame of the data frame
  • the body part may include the service
  • the frame header and the frame body of the request frame may be found to include only the frame body portion of the service discovery request frame.
  • the service discovery response includes IP address information of the second device. Further, before the first device establishes an ASP session with the second device, the first device may acquire an IP address of the second device by using any response message acquired by the second device. information.
  • the first service discovery response includes IP address information of the second device, for example, the Probe response carries the IP address information of the second device.
  • the second service discovery response includes IP address information of the second device, for example, the service discovery response carries IP address information of the second device.
  • the first capability negotiation response includes the IP address information of the second device, for example, the provisioning response carries the IP address information of the second device.
  • the second capability negotiation response includes the IP address information of the second device, for example, the last address of the second device is carried in the Follow-on provision discovery Response.
  • the first device may acquire the obtained by using a Reverse Address Resolution Protocol (RARP). IP address information of the second device.
  • RARP Reverse Address Resolution Protocol
  • IP address information of the second device may be acquired by using a Reverse Address Resolution Protocol (RARP).
  • IP address information of the second device may be acquired by using a Reverse Address Resolution Protocol (RARP).
  • IP address information of the second device may be acquired by using a Reverse Address Resolution Protocol (RARP). IP address information of the second device.
  • the method further includes: the service discovery response includes a MAC address of the second device; after the first device receives the service discovery response sent by the at least one second device, the first device reverses The address translation protocol server sends a query request; the query request includes a Mac address of the second device; the query request is used to query IP address information of the second device; and the first device receives a reverse address translation protocol The query response sent by the server; the query response includes IP address information of the second device.
  • RARP Reverse Address Resolution Protocol
  • the first device when the first device sends a service discovery request to the second device unicast, the first device has acquired the Mac address of the second device; and the first device broadcasts the service discovery through the access point.
  • the first device receives a service discovery response sent by the second device, and acquires a Mac address included in the service discovery response.
  • the first device sends an address query request to the reverse address translation protocol server.
  • the reverse address translation protocol server stores a Mac address, an IP address, and a mapping relationship between the second device.
  • the reverse address translation protocol server After receiving the address query request sent by the first device, acquires a MAC address of the second device, and the reverse address translation protocol server acquires the MAC address according to the second device The IP address of the second device.
  • the reverse address translation protocol server generates a query response and sends the query response to the first device, the query response including IP address information of the second device.
  • the reverse address translation protocol server and the access point are the same device; the first device sends a query request to the access point, where the query request includes a Mac address of the second device, The query request is used to query IP address information of the second device; the first device receives a query response sent by the access point.
  • the access point stores a Mac address, an IP address, and a mapping relationship between the second device. After the access point obtains the query request that includes the second device's Mac address, the IP address corresponding to the Mac address is obtained, and a query response is generated, where the query response includes the IP address information of the second device.
  • the method further includes: the first device sending a first capability negotiation request to the second device via the access point; the first device receiving the second device And sending, by the first capability negotiation response, the first capability negotiation response is a response of the second device to the first capability negotiation request. Specifically, after the first device and the second device complete service discovery, the first device and the second device enter a capability negotiation phase.
  • the first device sends a first capability negotiation request to the second device by using the access point, where the first capability negotiation request may be a provision Discovery Request.
  • the first device encapsulates the management frame provision discovery request into a first capability negotiation request data frame, and the address information included in the frame header of the data frame may be: address information of the access point; Address information of a device; address information of the second device.
  • the first device sends the first capability negotiation request data frame to the access point.
  • the access point After receiving the first capability negotiation request data frame, the access point changes the frame header address of the data frame, and the address information included in the frame header of the modified data frame may be: the address of the second device Information; address information of the access point; address information of the first device.
  • the access point sends a capability negotiation request after the header address information is changed to the second device.
  • the second device acquires the provision discovery request, and obtains capability negotiation information, such as the networking requirement of the first device.
  • the first device may have multiple networking requirements: first, the first device is required to act as a group Owner (GO) role in interaction with the second device; The device is required to act as a group member in the interaction with the second device. Third, the first device has an unlimited identity in the interaction with the second device, and may be a group owner or a group.
  • Member 4 The first device requires transmission with the second device through an existing network connection of the access point.
  • the first device is required to be connected to the second device through an existing network connection of the access point, where the first device carries the existing network connection through the access point in the provision discovery Request.
  • the indication of the transmission is implemented.
  • the second device determines whether it is possible to receive the networking requirement of the first device according to its own situation.
  • the networking requirements mentioned here may be the need to establish a connection without a network connection, or the need to perform an upper layer service transmission after a network connection has been made.
  • the second device when the second device cannot meet the networking requirement of the first device, the second device generates a first capability negotiation response, where the first capability negotiation response may be a provision a discovery response, the first capability negotiation response is used to notify the first device that the second device cannot meet the networking requirement of the first device, and the interaction between the first device and the second device ends.
  • the second device may encapsulate the management frame Provision discovery Response into a capability negotiation response data frame, and send a first capability negotiation response to the first device via the access point; or the second device may not The access point directly sends the management frame provision discovery Response to the first device.
  • the second device when the second device can meet the networking requirement of the first device, the second device generates a first capability negotiation response, where the first capability negotiation response may be a provision discovery response, where the A capability negotiation response is used to inform the first device that the second device can meet the networking requirements of the first device and agree to the networking requirements of the first device.
  • the second device may encapsulate the management frame Provision discovery Response into a capability negotiation response data frame, and send a first capability negotiation response to the first device via the access point; or the second device may not The access point directly sends the management frame provision discovery Response to the first device.
  • the second device acquires a first capability negotiation request of the first device, and after acquiring the networking requirement of the first device, the second device generates a first capability negotiation response, where the first capability
  • the negotiation response may be a provision discovery response, where the first capability negotiation response is used to notify the first device that the second device has learned the networking requirement of the first device, but does not include whether the second device agrees to the The physical information of the first device networking needs.
  • the second device After transmitting the first capability negotiation response to the first device, the second device may present information included in the first capability negotiation request to the user.
  • the second device may send a second capability negotiation request to the first device via the access point, the second energy
  • the force negotiation request may be a Follow-on provision discovery request, and the second capability negotiation request is used to notify the first device whether the second device agrees with the networking requirement of the first device.
  • the second device may encapsulate the management frame Follow-on provision discovery Request into a second capability negotiation request data frame, and send the information to the first device via the access point according to the foregoing data frame frame header setting rule.
  • the second capability negotiation request data frame; or the second device may directly send the Follow-on provision discovery Request management frame to the first device without using the access point.
  • the first device After acquiring the second capability negotiation request sent by the second device, the first device generates a second capability negotiation response, where the second capability negotiation response may be a Follow-on provision discovery response, and the second capability negotiation response
  • the second device is used to notify the network device of the second device.
  • the first device may encapsulate the management frame Follow-on provision discovery Response into a second capability negotiation response data frame, and send the second frame to the second device according to the foregoing data frame frame header setting rule.
  • the first device may also directly send a management frame Follow-on provision discovery Response to the second device without using the access point.
  • the interaction between the first capability negotiation request and the first capability negotiation response, and the interaction between the second capability negotiation request and the second capability negotiation response may not Forwarded via the access point.
  • the other interactive manner includes: optionally, the interaction of the message may be directly performed by the first device and the second device, that is, the first device directly sends the first device to the second device After the second device acquires the first capability negotiation request to generate the first capability negotiation response, the second device directly sends the first capability negotiation response to the first device.
  • the first capability negotiation request and the first energy The interaction of the acknowledgment response, the interaction of the second capability negotiation request with the second capability negotiation response may be partially participated by the access point.
  • the first device sends a first capability negotiation request to the second device via the access point, and after the second device acquires the first capability negotiation request to generate a first capability negotiation response, the second device The device directly sends the first capability negotiation response to the first device.
  • the first device directly sends a first capability negotiation request to the second device, and after the second device acquires the first capability negotiation request to generate a first capability negotiation response, the second device passes the The access point sends the first capability negotiation response to the first device.
  • the embodiment of the present invention is not limited in this embodiment.
  • the service discovery method provided by the embodiment of the present invention may include the following steps, which may be performed by a discovery responder.
  • the second device receives a service discovery request that is sent by the first device, and the service discovery request is used to query the second device for the service that the first device requests to query.
  • the first device is a discovery query party
  • the second device is a discovery response party.
  • the first device is connected to the access point
  • the second device is connected to the access point.
  • the first device sends a service discovery request to the second device, where the service discovery request may include information about a service that the first device requests to query, and the service discovery request is used to query the second device The service that the first device requests to query.
  • the second device acquires information about the service that the first device requests to query.
  • the service discovery request is a data frame format, including a frame header and a frame body. The address information contained in the header of the data frame follows the rules mentioned above and can be adjusted according to the sender and receiver of the data frame.
  • the data frame is a device
  • the frame header address of the data frame is: A1 is a direct receiver address, A2 is a direct sender address, and A3 is a final destination address;
  • the data frame is a data frame sent by the access point to the device
  • the A1 is a direct receiver address, and is also a target address
  • the A2 is a direct sender address
  • the A3 is an initial source address.
  • the frame header address information of the data frame sent by the first device that is forwarded by the access point received by the second device may include: address information of the second device; address information of the access point. The address information of the first device.
  • the service discovery request may be a Probe Request.
  • the service discovery response is a Probe Response.
  • the Probe Response is a response of the second device to the Probe Request sent by the first device.
  • the service discovery request may be a Service Discovery Request.
  • the service discovery response is a Service Discovery Response.
  • the Service Discovery Response is a response of the second device to the Service Discovery Request sent by the first device.
  • the second device sends a service discovery response to the first device.
  • the service discovery response is a response of the second device to the first service discovery request.
  • the second device After the second device acquires the information of the service that the first device requests to query, when the second device supports the service that the first device requests to query, the second device generates a service discovery response,
  • the service discovery response may only include information that the second device supports the service, and does not relate to information of the service itself, such as a type of service, specific content of the service;
  • the service discovery response may be Included by the at least one second device, the first device requests a query service, which includes not only information that the second device supports the service, but also information about the service itself, such as The type of service, the specific content of the service. .
  • the second device may send a service discovery response directly to the first device without using the access point.
  • the service discovery response is a management frame format.
  • the second device may send a service discovery response to the first device via the access point;
  • the service discovery response is a data frame format.
  • the frame header of the service discovery response data frame sent by the second device to the access point includes: an address of the access point; an address of the second device; an address of the first device.
  • the access point After receiving the service discovery response data frame, the access point changes the frame header address information of the service discovery response data frame, where the frame header address of the changed data frame includes: the address of the first device The address of the access point, the address of the second device.
  • the service discovery response includes IP address information of the second device.
  • the management frame Probe Response includes IP address information of the second device, or the data frame including the Probe Response includes IP address information of the second device.
  • the management frame Service Discovery Response includes IP address information of the second device, or the data frame including the Service Discovery Response includes an IP of the second device. Address information.
  • the interaction of the service discovery messages between the multiple electronic devices can be realized without the electronic device disconnecting the connection with the access point.
  • Service discovery efficiency which in turn improves interoperability.
  • the method further includes: the second device receiving a first capability negotiation request sent by the first device; the second device sending a first capability negotiation to the first device Responding, the first capability negotiation response is a response of the second device to the first service discovery request should. Specifically, after the first device acquires the service discovery response of the second device, the first device learns whether the second device supports the service requested by the first device. When the second device supports the service that the first device requests to query, the first device sends a first capability negotiation request to the second device, where the first capability negotiation request may be a provision discovery request. .
  • the first device may send a first capability negotiation request to the second device by using the access point, where the first capability negotiation request is a data frame format; or the first device may directly
  • the second device sends a first capability negotiation request, where the first capability negotiation request is a management frame format.
  • the second device After acquiring the first capability negotiation request sent by the first device, the second device sends a second capability negotiation response to the first device, where the first capability negotiation response may be a provision discovery Response.
  • the second device sends a first capability negotiation response to the first device by using the access point, where the first capability negotiation response is a data frame format; or, optionally, the The second device may directly send a first capability negotiation response to the first device, where the first capability negotiation response is a management frame format.
  • the first capability negotiation response includes IP address information of the second device.
  • the management frame provision discovery Response includes IP address information of the second device, or the data frame including the provision discovery Response includes IP address information of the second device.
  • the method further includes: the second device acquiring a response instruction input by the user, and sending a second capability negotiation request to the first device; the second device receiving the first And a second capability negotiation response sent by the device, where the second capability negotiation response is a response of the first device to the second capability negotiation request.
  • the second device acquires the first device After the capability negotiation request is obtained, the second device generates a first capability negotiation response, and the first capability negotiation response is used to notify the first device that the second device has learned the location.
  • the networking requirement of the first device is described, but does not include whether the second device agrees with the substantial information of the first device networking requirement.
  • the second device After transmitting the first capability negotiation response to the first device, the second device may present information included in the first capability negotiation request to the user. After acquiring the user's instruction, the second device may send a second capability negotiation request to the first device by using the access point, where the second capability negotiation request may be a Follow-on provision discovery Request, The second capability negotiation request is used to notify the first device whether the second device agrees with the networking requirement of the first device.
  • the second device acquires a response instruction input by the user, and sends a second capability negotiation request to the first device by using the access point.
  • the second device may encapsulate the management frame Follow-on provision discovery Request into a second capability negotiation request data frame, and send the information to the first device via the access point according to the foregoing data frame frame header setting rule.
  • the second capability negotiation request data frame may be directly send a Follow-on provision discovery Request management frame to the first device without using the access point.
  • the first device After acquiring the second capability negotiation request sent by the second device, the first device generates a second capability negotiation response, where the second capability negotiation response may be a Follow-on provision discovery response, and the second capability negotiation response And configured to notify the second device, where the first device has learned network connection requirement information of the second device.
  • the first device may encapsulate the management frame Follow-on provision discovery Response into a second capability negotiation response data frame, and send the second frame to the second device according to the foregoing data frame frame header setting rule.
  • the first device may also directly send a management frame Follow-on provision to the second device without using the access point.
  • the discovery Response is sent.
  • the second capability negotiation request includes IP address information of the second device, for example, the management frame Follow-on provision discovery Request includes IP address information of the second device, or includes the Follow- The data frame of the on provision discovery Request includes the IP address information of the second device.
  • the service discovery method provided by the embodiment of the present invention may include the following steps, which may be performed by an access point.
  • the access point receives a service discovery request sent by the first device, where the service discovery request is used to query the at least one second device for a service that the first device requests to query; the access point and the at least a second device connection;
  • the access point participates in an interaction between the first device and the second device, the access point is connected to the first device, and the access point is connected to the at least one second device.
  • the interaction information forwarded by the access point may be a data frame format.
  • the interaction information of the data frame format includes a frame header and a frame body part, and the address information included in the frame header complies with the foregoing rules, and details are not described herein again.
  • the service discovery request may be a Probe Request.
  • the first device encapsulates the Probe Request into a data frame, and the access point receives a data frame that is sent by the first device and includes a Probe Request.
  • the service discovery request may be a Service Discovery Request.
  • the first device encapsulates the Service Discovery Request into a data frame, and the access point receives a data frame that is sent by the first device and includes a Service Discovery Request.
  • the access point sends the service discovery request to the at least one second device.
  • the service discovery request is in a data frame format
  • the first device unicasts the service discovery request via an access point.
  • the access point After the access point receives the service discovery request sent by the first device, the access point changes the address information included in the frame header of the service discovery request data frame, and sends the address information included in the frame header of the service discovery request data frame to the at least one second device.
  • the changed data frame The frame header address information of the data frame sent by the first device received by the access point may include: address information of the access point; address information of the first device; address of the second device information.
  • the access point modifies the frame header address of the data frame, and the frame header address information of the modified service discovery request data frame sent by the access point includes: address information of the second device in sequence; Address information of the inbound point, address information of the first device.
  • the access point transmits the modified data frame to the at least one second device.
  • the service discovery request is a data frame format
  • the access point broadcasts the service discovery request.
  • the first device broadcasts a service discovery request via the access point.
  • the frame header address information of the data frame sent by the first device received by the access point may include: address information of the access point; address information of the first device; and a broadcast address.
  • Modifying, by the access point, a frame header address of the data frame, where the frame header address information of the modified service discovery request data frame broadcasted by the access point includes: the broadcast address; the address of the crediting point The address of the first device.
  • the access point broadcasts the modified data frame.
  • the access point receives a service discovery response sent by the second device, where the service discovery response is a response of the second device to the service discovery request.
  • the second device When the second device supports the service requested by the first device, the second device generates a service discovery response.
  • the service discovery response may only include information that the second device supports the service. , does not involve information about the service itself, such as the type of service, the specific content of the service; optionally, The service discovery response may include a service requested by the first device supported by the at least one second device, including not only information of the second device supporting the service, but also information of the service itself, such as a type of the service, The specific content of the service.
  • the service discovery request is a Probe Request
  • the service discovery response is a Probe Response
  • the Probe Response is a response of the second device to the Probe Request sent by the first device.
  • the service discovery response includes IP address information of the second device
  • the Probe Response includes IP address information of the second device.
  • the service discovery request is a Service Discovery Request
  • the service discovery response is a Service Discovery Response
  • the Service Discovery Response is a response of the second device to the Service Discovery Request sent by the first device.
  • the service discovery response includes IP address information of the second device
  • the Service Discovery Response includes IP address information of the second device.
  • the access point sends the service discovery response to the first device.
  • the access point changes address information included in a frame header address of the service discovery response data frame.
  • the address information included in the frame header of the data frame of the modified service discovery response is: address information of the first device, address information of the access point, and address information of the second device.
  • the access point sends the service discovery response to the first device, and after acquiring the service discovery response, the first device acquires whether the second device supports the service information included in the service discovery request, and Knowing the services supported by the at least one second device.
  • the interaction of the service discovery messages between the multiple electronic devices may be implemented without the electronic device disconnecting from the access point.
  • the service discovery response includes a MAC address of the second device; after the access point sends the service discovery response to the first device, the method further includes: The access point receives the query request sent by the first device, where the query request includes a MAC address of the second device, and the query request is used to query IP address information of the second device; The ingress sends a query response to the first device; the query response includes IP address information of the second device.
  • the first device may obtain the IP address information of the second device by using a reverse address resolution protocol (RARP). Specifically, the first device acquires Mac address information of the second device.
  • RARP reverse address resolution protocol
  • the first device sends an address query request to the access point, and requests to obtain the IP address information of the second device according to the Mac address of the second device, where the address query request includes the MAC of the second device. address.
  • the access point stores a Mac address, an IP address, and a mapping relationship between the second device. After the access point receives the address query request sent by the first device, the access point acquires the MAC address of the second device, and the access point acquires the IP address of the second device according to the MAC address of the second device. address.
  • the access point generates a query response, and sends the query response to the first device, where the query response includes IP address information of the second device.
  • the method further includes: the access point receiving a first capability negotiation request sent by the first device; the first capability negotiation response being a data frame format; Sending the first capability negotiation request to the second device; the access point receives a first capability negotiation response sent by the second device, and the capability negotiation response is the second device pair capability Negotiating the response of the request; the first capability negotiation response is a data frame format; and the access point sends the first capability negotiation response to the first device.
  • the first capability negotiation request may be a provision The discovery request, the first device encapsulates the management frame provision discovery Request into a first capability negotiation request data frame, and sends the first capability negotiation request data frame to the access point.
  • the access point After receiving the first capability negotiation request data frame, the access point changes the frame header address of the data frame, and the address information included in the frame header of the modified data frame may be: the address of the second device Information; address information of the access point; address information of the first device.
  • the access point sends a capability negotiation request after the header address information is changed to the second device.
  • the second device After receiving the first capability negotiation request, the second device acquires the provision discovery request, parses and obtains the networking requirement of the first device, and generates a first capability negotiation response.
  • the first capability negotiation response may be a provision discovery Response.
  • the second device encapsulates the provision discovery Response into a first capability negotiation response data frame, and sends the first capability negotiation response data frame to the access point.
  • the access point After receiving the first capability negotiation response data frame, the access point changes the frame header address of the data frame, and sends the capability negotiation request after the frame header address information is changed to the first device.
  • the first capability negotiation response includes the IP address information of the second device, that is, the first capability negotiation response data frame that includes the provision discovery response includes the IP address information of the second device.
  • the method further includes: the access point receiving the second capability negotiation request sent by the second device; the second capability negotiation request being a data frame format;
  • the ingress point sends the second capability negotiation request to the first device;
  • the access point receives the second capability negotiation response sent by the first device, and the second capability negotiation response is the second device pair a response of the second capability negotiation request;
  • the second capability negotiation response is a data frame format; and the access point sends the second capability negotiation response to the second device.
  • the second device acquires a first capability negotiation request of the first device, and after acquiring the networking requirement of the first device, the second device generates a first capability negotiation response, where the first capability negotiation The response is used to inform the first device that the second device has learned the networking requirements of the first device, but does not include whether the second device agrees with the substantial information of the first device networking requirement.
  • the second device implements confirmation of the networking requirements of the first device and the second device by using an interaction of the second capability negotiation message.
  • the second capability negotiation request may be a Follow-on provision discovery Request, and the second device may encapsulate the Follow-on provision discovery Request into a second capability negotiation request data frame, where the access point receives the The second capability negotiation request data frame sent by the second device.
  • the access point Transmitting, by the access point, the address information included in the frame header of the second capability negotiation request data frame according to the foregoing data frame frame header setting rule, and sending the second capability negotiation request after the frame header address information is changed To the first device.
  • the first device After acquiring the second capability negotiation request, the first device generates a second capability negotiation response.
  • the first device encapsulates the Follow-on provision discovery Response into a second capability negotiation response data frame, and sends the second capability negotiation response data frame to the access point according to the foregoing data frame frame header setting rule.
  • the access point acquires the second capability negotiation response data frame
  • the address information included in the frame header of the second capability negotiation response data frame is changed according to the foregoing data frame frame header setting rule, and the change is performed.
  • the post-second second capability negotiation response data frame is sent to the second device.
  • the second capability negotiation request includes IP address information of the second device, that is, the data frame including the Follow-on provision discovery Response includes IP address information of the second device.
  • FIG. 7 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
  • Electronics A device which may also be called a User Equipment (UE), a mobile user equipment, or the like, may communicate with one or more core networks, such as a mobile phone, via a radio access network (eg, RAN, Radio Access Network).
  • a radio access network eg, RAN, Radio Access Network
  • cellular telephones and computers for example, can be portable, pocket-sized, handheld, computer-integrated or in-vehicle mobile devices that exchange voice and/or data with a wireless access network.
  • the electronic device may be a smart phone, a tablet personal computer, a personal digital assistant (PDA), a mobile Internet device (MID), or a wearable device (Wearable Device).
  • PDA personal digital assistant
  • MID mobile Internet device
  • Wearable Device wearable device
  • the electronic device provided by the embodiment of the present invention includes a sending unit 701 and a receiving unit 702, and the sending unit 701 is connected to
  • the sending unit 701 is configured to send, by using an access point, a service discovery request to at least one second device connected to the access point, where the service discovery request is used to query the at least one second device for the first A device that requests a query.
  • the first device is connected to the access point, and the access point is connected to at least two devices.
  • the access point is connected to at least one second device in addition to the first device.
  • the service discovery request sent by the sending unit 701 may be a Probe Request.
  • the service discovery request sent by the sending unit 701 may be a Service Discovery Request.
  • the sending unit 701 may send two service discovery requests via the access point, where the first service discovery request may be a Probe Request, and the second service discovery request may be a Service Discovery Request.
  • the receiving unit 702 is configured to receive a service discovery response sent by the at least one second device, where the service discovery response is a response of the at least one second device to the service discovery request.
  • the second device After receiving the service discovery request sent by the access point, the second device parses the service discovery request, acquires a service information acquisition requirement of the first device, and supports the first device request in the second device. Check When the service is queried, the second device generates a service discovery response.
  • the service discovery response may include only information that the second device supports the service, and does not involve information about the service itself, such as the type of service, The specific content of the service; optionally, the service discovery response may include a service that is requested by the first device supported by the at least one second device, and includes not only the information that the second device supports the service, but also the service Information about itself, such as the type of service, the specific content of the service.
  • the receiving unit 702 receives the service discovery response, and acquires specific information of the service included in the service response.
  • the service discovery request sent by the sending unit 701 is a Probe Request
  • the service discovery response received by the receiving unit 702 is a Probe Response
  • the Probe Response is the second device to the first device.
  • the response of the sent Probe Request when the service discovery request sent by the sending unit 701 is a Service Discovery Request, the service discovery response is a Service Discovery Response.
  • the Service Discovery Response is a response of the second device to the Service Discovery Request sent by the first device.
  • the interaction of the service discovery messages between the multiple electronic devices can be realized without the electronic device disconnecting the connection with the access point.
  • Service discovery efficiency which in turn improves interoperability.
  • the service discovery request is a data frame format
  • the sending unit is specifically configured to: broadcast, by the access point, a service discovery request; where the sending unit sends the information to the access point.
  • the frame header of the service discovery request data frame includes: an address of the access point; an address of the first device; a broadcast address; and a frame header of the service discovery request data frame broadcast by the sending unit via the access point includes : the broadcast address; an address of the access point; an address of the first device.
  • the data frame format includes a frame header and a frame body, and a frame header of the data frame includes address information of a service discovery request.
  • the address format of the frame header changes the address information (in order: the address of the access point; the address of the first device; the broadcast address) included in the header of the original data frame to the access point broadcast service discovery request data.
  • the address information included in the frame header of the frame in order: the broadcast address; the address of the access point; the address of the first device).
  • the access point broadcasts a service discovery request data frame after the frame header address is changed.
  • the service discovery request is a data frame format
  • the sending unit is specifically configured to: send a service discovery request by using an access point unicast; and send, by the sending unit, the access point
  • the frame header of the service discovery request data frame includes: an address of the access point; an address of the first device; an address of the second device; and a service discovery request sent by the sending unit by the access point unicast
  • the frame header of the data frame includes: an address of the second device; an address of the access point; an address of the first device.
  • the data frame format includes a frame header and a frame body, and a frame header of the data frame includes address information of a service discovery request.
  • the access point After receiving the service discovery request data frame sent by the sending unit, the access point changes the address format of the data frame frame header, and the address information included in the header of the original data frame (in order: the access point The address of the first device; the address of the second device is changed to the address information included in the frame header of the access point broadcast service discovery request data frame (in order: the address of the second device; The address of the access point; the address of the first device).
  • the access point unicasts a service discovery request data frame after the frame header address is changed.
  • the frame body part of the service discovery request data frame sent by the sending unit includes: a frame body part of the probe request frame; or a frame body part of the service discovery request frame.
  • the service discovery request data frame includes a frame header and a frame body.
  • the probe request frame and the service discovery request frame are both management frames, and the management frame also includes a frame header and a frame body.
  • the probe request frame is a Probe Request
  • the service discovery request frame is a service discovery Request.
  • the suit The frame body portion of the request data frame may include a frame header and a frame body of the probe request frame, or may only include a frame body portion of the probe request frame; likewise, the frame body portion of the service discovery request data frame
  • the frame header and the frame body of the service discovery request frame may be included, or only the frame body portion of the service discovery request frame may be included.
  • the receiving unit is specifically configured to receive a service discovery response sent by the at least one second device via the access point, where the service discovery response is a data frame format.
  • the second device may send a service discovery response to the first device in response to the service discovery request.
  • the second device may send a service discovery response to the first device via an access point, where the service discovery response is a data frame format, and the frame header format may refer to the foregoing rule.
  • the second device may also directly send a service discovery response to the first device without using the access point, and the service discovery response is a management frame.
  • the service discovery response received by the receiving unit includes IP address information of the second device.
  • the service discovery response includes a MAC address of the second device
  • the sending unit is further configured to: at the receiving unit, receive a service discovery response sent by the at least one second device And sending a query request to the reverse address translation protocol server; the query request includes a Mac address of the second device; the query request is used to query IP address information of the second device; Receiving a query response sent by the reverse address translation protocol server; the query response includes IP address information of the second device.
  • the reverse address translation protocol server stores a Mac address, an IP address, and a mapping relationship between the second device. The first device may obtain a Mac address of the second device included in the service discovery response.
  • the first device After the first device acquires the Mac address of the second device, send the query to the reverse address translation protocol server. Obtaining, obtaining an IP address of the second device.
  • the reverse address translation protocol server and the access point may be the same device, and the first device may also send a query request to the access point to obtain the second device. IP address information.
  • FIG. 8 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
  • the electronic device provided by the embodiment of the present invention includes a transmitter 801 and a receiver 802, and the transmitter 801 is connected to the receiver 802. specifically,
  • the transmitter 801 is configured to send, by using an access point, a service discovery request to at least one second device connected to the access point, where the service discovery request is used to query the at least one second device for the first A device that requests a query.
  • the first device is connected to the access point, and the access point is connected to at least two devices.
  • the access point is connected to at least one second device in addition to the first device.
  • the service discovery request sent by the sender 801 may be a Probe Request.
  • the service discovery request sent by the sender 801 may be a Service Discovery Request.
  • the sender 801 can send two service discovery requests via the access point, where the first service discovery request can be a Probe Request and the second service discovery request can be a Service Discovery Request.
  • the receiver 802 is configured to receive a service discovery response sent by the at least one second device, where the service discovery response is a response of the at least one second device to the service discovery request. After the second device receives the service discovery request sent by the access point, parsing the service discovery request, when the second device supports the service requested by the first device, the second device generates a service. Found a response.
  • the service discovery response may only include information that the second device supports the service, and does not relate to information of the service itself, such as a type of service, specific content of the service; optionally, the service The service discovery response may include a service requested by the first device supported by the at least one second device, including not only the information that the second device supports the service, but also the information of the service itself, such as the type of the service, the service. specific contents.
  • the receiver 802 receives the service discovery response and acquires specific information of the service included in the service response.
  • the service discovery request sent by the receiver 802 is a Probe Request
  • the service discovery response received by the receiver 802 is a Probe Response
  • the Probe Response is the second device to the first device.
  • the response of the sent Probe Request when the service discovery request sent by the sending unit 701 is a Service Discovery Request, the service discovery response is a Service Discovery Response.
  • the Service Discovery Response is a response of the second device to the Service Discovery Request sent by the first device.
  • the interaction of the service discovery messages between the multiple electronic devices can be realized without the electronic device disconnecting the connection with the access point.
  • Service discovery efficiency which in turn improves interoperability.
  • the service discovery request is a data frame format
  • the transmitter is specifically configured to: broadcast a service discovery request via an access point; where the sender sends the information to the access point
  • the frame header of the service discovery request data frame includes: an address of the access point; an address of the first device; a broadcast address; a frame header of the service discovery request data frame broadcast by the sender via the access point Including: the broadcast address; the address of the access point; the address of the first device.
  • the data frame format includes a frame header and a frame body, and a frame header of the data frame includes address information of a service discovery request.
  • the access point After receiving the service discovery request data frame sent by the sending unit, the access point changes the address format of the data frame frame header, and the address information included in the header of the original data frame (in order: the access point Address; the address of the first device; broadcast address) changed to access point broadcast service discovery please Obtaining address information included in a frame header of the data frame (in order: the broadcast address; an address of the access point; an address of the first device).
  • the access point broadcasts a service discovery request data frame after the frame header address is changed.
  • the service discovery request is a data frame format
  • the transmitter is specifically configured to send a service discovery request by using an access point unicast; and the sender sends the service discovery request to the access point.
  • the frame header of the service discovery request data frame includes: an address of the access point; an address of the first device; an address of the second device; and a service sent by the sender and transmitted unicast via the access point.
  • the frame header of the discovery request data frame includes: an address of the second device; an address of the access point; an address of the first device.
  • the data frame format includes a frame header and a frame body, and a frame header of the data frame includes address information of a service discovery request.
  • the access point After receiving the service discovery request data frame sent by the sending unit, the access point changes the address format of the data frame frame header, and the address information included in the header of the original data frame (in order: the access point The address of the first device; the address of the second device is changed to the address information included in the frame header of the access point broadcast service discovery request data frame (in order: the address of the second device; The address of the access point; the address of the first device).
  • the access point unicasts a service discovery request data frame after the frame header address is changed.
  • the frame body portion of the service discovery request data frame sent by the transmitter includes: a frame body portion of the probe request frame; or a frame body portion of the service discovery request frame.
  • the service discovery request data frame includes a frame header and a frame body.
  • the probe request frame and the service discovery request frame are both management frames, and the management frame also includes a frame header and a frame body.
  • the probe request frame is a Probe Request
  • the service discovery request frame is a service discovery Request.
  • the frame body portion of the service discovery request data frame may include a frame header and a frame body of the probe request frame, or may only include a frame body portion of the probe request frame; likewise, the service discovery request frame of the data frame Body part
  • the frame header and the frame body of the service discovery request frame may be included, or only the frame body portion of the service discovery request frame may be included.
  • the receiver is specifically configured to receive a service discovery response sent by the at least one second device via the access point, where the service discovery response is a data frame format.
  • the second device may send a service discovery response to the first device in response to the service discovery request.
  • the second device may send a service discovery response to the first device via an access point, where the service discovery response is a data frame format, and the frame header format may refer to the foregoing rule.
  • the second device may also directly send a service discovery response to the first device without using the access point, and the service discovery response is a management frame.
  • the service discovery response includes IP address information of the second device.
  • the service discovery response includes a MAC address of the second device
  • the transmitter is further configured to: at the receiver, receive a service discovery response sent by the at least one second device And sending a query request to the reverse address translation protocol server; the query request includes a Mac address of the second device; the query request is used to query IP address information of the second device; Receiving a query response sent by the reverse address translation protocol server; the query response includes IP address information of the second device.
  • the reverse address translation protocol server stores a Mac address, an IP address, and a mapping relationship between the second device. The first device may obtain a Mac address of the second device included in the service discovery response.
  • the first device After acquiring the MAC address of the second device, the first device sends a query request to the reverse address translation protocol server to obtain an IP address of the second device.
  • the reverse address translation protocol server and the access point may be the same device, and the first device may also send a query request to the access point. Obtaining IP address information of the second device.

Abstract

本发明实施例提供一种服务发现的方法及电子设备,涉及通信技术领域。所述服务发现的方法包括:第一设备经接入点向与所述接入点连接的至少一个第二设备发送服务发现请求;所述服务发现请求用于向所述至少一个第二设备查询所述第一设备请求查询的服务;所述第一设备接收所述至少一个第二设备发送的服务发现应答,所述服务发现应答为所述至少一个第二设备对所述服务发现请求的响应;所述服务发现应答包括所述至少一个第二设备支持的服务。在本发明实施例中,在多个电子设备均与接入点连接的场景中,不需要电子设备断开与接入点的连接即可实现多个电子设备之间服务发现消息的交互,提高了服务发现效率,继而提高了互通效率。

Description

一种服务发现的方法及电子设备
本申请要求于2014年4月26日提交中国专利局、申请号为201410180491.2、发明名称为“一种服务发现的方法及电子设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本发明涉及通信技术领域,尤其涉及一种服务发现的方法及电子设备。
背景技术
IEEE制定的无线局域网标准802.11定义了两种网络结构模式,其一是基于基础设施的方式,即有一个节点作为接入点(Access Point,AP),其他节点作为站点(Station,STA),接入点提供接入服务,其他节点跟接入点连接,通过接入点接入网络。其二是独立的基础服务集(Independent Basic Service Set,IBSS)模式,在此网络结构下,每个设备都是平等的站点,彼此两两间建立连接。具体实现中,在某些场景下,例如两个手机之间要互相连接,802.11标准无法便捷的实现两个设备间的发现和连接。
在此基础上,Wi-Fi联盟制定了Wi-Fi Direct标准,进一步定义了两个设备间如何发现以及如何建立连接。具体而言,两个设备都随机地在1、6、11这三个信道上发送探测消息或者监听别人的探测消息,如果听到并回复响应的话,说明两个设备相互发现了,然后两者开始协商谁当群主(Group Owner,GO),群主设备相当于接入点的角色,其他设备就作为群成员(Group Client),群成员设备相当于站点角色。群成员设备就向群主设备申请关联,然后建立连接。
Wi-Fi Direct标准仅定义了两个设备之间Wi-Fi层面的发现和连接问题,并不涉及Wi-Fi层面上的业务层面。如此便会出现这样的情况,各厂家的设备都可通过Wi-Fi标准建立Wi-Fi层连接,但设备间的上层业务并不统一,例如厂家A的文件传输业务在上层使用TCP协议,厂家B的文件传输业务在上层使用UDP协议,如此各家的业务层面就无法互通。基于这样的情形,Wi-Fi联盟又在Wi-Fi Direct标准的基础上,制定了Wi-Fi Direct Service(WFDS)标准。WFDS标准规范了上层交互,使得各厂家的上层业务能够互通,例如两个设备都采用UPnP File Transfer协议来进行文件传输业务。
现有技术中,在使用上述标准的过程中,若两个设备均与同一接入点连接,例如家庭网络中手机与电视均与家里的路由器连接,两个设备建立业务连接,发现查询方(例如手机)需要首先断开与接入点(例如路由器)的连接,第一设备(例如手机)需要在1、6、11信道上随机发送探测消息(或者监听探测消息),第二设备(例如电视)监听到探测消息并回复响应消息(或者回复响应消息)后,第一设备(例如手机)和第二设备(例如电视)相互发现。随后,两个设备协商谁当群主,另一设备作为群成员,群成员设备向群主设备申请关联,随后建立连接进行数据传输。上述Wi-Fi Direct标准和WFDS标准仅考虑了是两个设备之间直接发现和连接的方式,并没有考虑两个设备均连接到同一接入点的情况下如何实现两个设备之间发现和连接的情形。
发明内容
本发明实施例提供了一种服务发现方法和电子设备,旨在解决在设备与接入点连接的情况下,如何通过接入点来实现设备之间的发现和上层连接建立,继而实现设备之间上层服务的互通。
第一方面,本发明提供了一种服务发现方法的一个实施例。
在第一种可能的实现方式中,所述方法包括:第一设备经接入点向与所述接入点连接的至少一个第二设备发送服务发现请求;所述服务发现请求用于向所述至少一个第二设备查询所述第一设备请求查询的服务;所述第一设备接收所述至少一个第二设备发送的服务发现应答,所述服务发现应答为所述至少一个第二设备对所述服务发现请求的响应。
结合第一方面第一种可能的实现方式,在第二种可能的实现方式中,所述服务发现请求为数据帧格式;所述第一设备经接入点向与所述接入点连接的至少一个第二设备发送服务发现请求,包括:第一设备经接入点广播服务发现请求;其中,所述第一设备向所述接入点发送的服务发现请求数据帧的帧头依次包括:所述接入点的地址;所述第一设备的地址;广播地址;所述第一设备经接入点广播的服务发现请求数据帧的帧头依次包括:所述广播地址;所述接入点的地址;所述第一设备的地址。
结合第一方面第一种可能的实现方式,在第三种可能的实现方式中,所述服务发现请求为数据帧格式;所述第一设备经接入点向与所述接入点连接的至少一个第二设备发送服务发现请求,包括:第一设备经接入点单播发送服务发现请求;所述第一设备向所述接入点发送的服务发现请求数据帧的帧头依次包括:所述接入点的地址;所述第一设备的地址;所述第二设备的地址;所述第一设备经所述接入点发送的服务发现请求数据帧的帧头依次包括:所述第二设备的地址;所述接入点的地址;所述第一设备的地址。
结合第一方面第二种或第三种可能的实现方式,在第四种可能的实现方式中,所述服务发现请求数据帧的帧体部分包括:探测请求帧的帧体部分;或者,服务发现请求帧的帧体部分。
结合第一方面第一种至第四种任一可能的实现方式,在第五种可能的实现方式中,所述第一设备接收所述至少一个第二设备发送的服务发现应答,包括:所述第一设备接收所述至少一个第二设备经由所述接入点发送的服务发现应答,所述服务发现应答为数据帧格式。
结合第一方面第一种至第五种任一可能的实现方式,在第六种可能的实现方式中,所述服务发现应答包括所述第二设备的IP地址信息。
结合第一方面第一种至第五种任一可能的实现方式,在第七种可能的实现方式中,所述服务发现应答包括所述第二设备的MAC地址;在所述第一设备接收所述至少一个第二设备发送的服务发现应答后,所述方法还包括:所述第一设备向反向地址转换协议服务器发送查询请求;所述查询请求包括所述第二设备的Mac地址;所述查询请求用于查询所述第二设备的IP地址信息;所述第一设备接收反向地址转换协议服务器发送的查询应答;所述查询应答包括所述第二设备的IP地址信息。
结合第一方面第七种可能的实现方式,在第八种可能的实现方式中,所述反向地址转换协议服务器与所述接入点为同一设备;所述第一设备向反向地址转换协议服务器发送查询请求,包括:所述第一设备向所述接入点发送查询请求;
所述第一设备接收反向地址转换协议服务器发送的查询应答,包括:所述第一设备接收所述接入点发送的查询应答。
结合第一方面第一种至第八种任一可能的实现方式,在第九种可能的实现方式中,在所述第一设备接收所述至少一个第二设备发送的服务应答之后,所述方法还包括:
所述第一设备向所述第二设备发送第一能力协商请求;所述第一能力协商请求用于协商如何与所述第二设备建立连接;
所述第一设备接收所述第二设备发送的第一能力协商应答,所述第一能力协商应答为所述第二设备对所述第一能力协商请求的响应。
结合第一方面第九种可能的实现方式,在第十种可能的实现方式中,所述第一设备向所述第二设备发送第一能力协商请求,包括:所述第一设备经由所述接入点向所述第二设备发送第一能力协商请求,所述第一能力协商请求为数据帧格式。
结合第一方面第九种或第十种可能的实现方式,在第十一种可能的实现方式中,所述第一能力协商应答包括所述第二设备的IP地址信息。
结合第一方面第九种至第十一种任一可能的实现方式,在第十二种可能的实现方式中,所述第一设备接收所述所述第二设备发送的第二能力协商请求;所述第一设备向所述第二设备发送第二能力协商应答,所述第二能力协商应答为所述第一设备对所述第二能力协商请求的响应。
结合第一方面第十二种可能的实现方式,在第十三种可能的实现方式中,所述第一设备向所述第二设备发送第二能力协商应答,包括:所述第一设备经由所述接入点向所述第二设备发送第二能力协商应答,所述第二能力协商应答为数据帧格式。
结合第一方面第十二种或第十三种可能的实现方式,在第十四种可能的实现方式中,所述第二能力协商请求包括所述第二设备的IP地址信息。
第二方面,本发明提供了一种服务发现方法的一个实施例。
在第一种可能的实现方式中,所述方法包括:第二设备接收第一设备经由 接入点发送的服务发现请求;所述服务发现请求用于向所述第二设备查询所述第一设备请求查询的服务;所述第二设备向所述第一设备发送服务发现应答;所述服务发现应答为所述第二设备对所述第一服务发现请求的响应。
结合第二方面第一种可能的实现方式,在第二种可能的实现方式中,所述服务发现请求为数据帧格式。
结合第二方面第一种或第二种可能的实现方式,在第三种可能的实现方式中,所述第二设备向所述第一设备发送服务发现应答,包括:所述第二设备经由所述接入点向所述第一设备发送服务发现应答;所述服务发现应答为数据帧格式;其中,所述第二设备向所述接入点发送的服务发现应答数据帧的帧头依次包括:所述接入点的地址;所述第二设备的地址;所述第一设备的地址;所述第二设备经接入点发送的服务发现应答数据帧的帧头依次包括:所述第一设备的地址;所述接入点的地址;所述第二设备的地址。
结合第二方面第一种至第三种任一可能的实现方式,在第四种可能的实现方式中,所述服务发现应答包括所述第二设备的IP地址信息。
结合第二方面第一种至第四种任一可能的实现方式,在第五种可能的实现方式中,所述方法还包括:
所述第二设备接收所述第一设备发送的第一能力协商请求;所述第一能力协商请求用于协商如何与所述第二设备建立连接;
所述第二设备向所述第一设备发送第一能力协商应答,所述第一能力协商应答为所述第二设备对所述第一服务发现请求的响应。
结合第二方面第五种可能的实现方式,在第六种可能的实现方式中,所述第二设备向所述第一设备发送第一能力协商应答,包括:所述第二设备经由所 述接入点向所述第一设备发送第一能力协商应答;所述第一能力协商应答为数据帧格式。
结合第二方面第五种或第六种可能的实现方式,在第七种可能的实现方式中,所述第一能力协商应答包括所述第二设备的IP地址信息。
结合第二方面第五种至第七种任一可能的实现方式,在第八种可能的实现方式中,所述方法还包括:
所述第二设备获取用户输入的响应指令,向所述第一设备发送第二能力协商请求;
所述第二设备接收所述第一设备发送的第二能力协商应答,所述第二能力协商应答为所述第一设备对所述第二能力协商请求的响应。
结合第二方面第八种可能的实现方式,在第九种可能的实现方式中,所述第二设备获取用户输入的响应指令,向所述第一设备发送第二能力协商请求,包括:
所述第二设备获取用户输入的响应指令,经由所述接入点向所述第一设备发送第二能力协商请求,所述第二能力协商请求为数据帧格式。
结合第二方面第八种或第九种任一可能的实现方式,在第十种可能的实现方式中,所述第二能力协商请求包括所述第二设备的IP地址信息。
第三方面,本发明提供了一种服务发现方法的一个实施例。
在第一种可能的实现方式中,所述方法包括:接入点接收第一设备发送的服务发现请求;所述服务发现请求用于向所述至少一个第二设备查询所述第一设备请求查询的服务;所述接入点与所述至少一个第二设备连接;所述接入点向所述至少一个第二设备发送所述服务发现请求;所述接入点接收所述至少一 个第二设备发送的服务发现应答,所述服务发现应答为所述第二设备对所述服务发现请求的响应;所述接入点向所述第一设备发送所述服务发现应答。
结合第三方面第一种可能的实现方式,在第二种可能的实现方式中,所述服务发现请求为数据帧格式;所述接入点向所述至少一个第二设备发送所述服务发现请求,包括:所述接入点广播所述服务发现请求;其中,所述接入点接收的所述服务发现请求数据帧的帧头依次包括:所述接入点的地址;所述第一设备的地址;广播地址。所述接入点广播的所述服务发现请求数据帧的帧头依次包括:所述广播地址;所述接入点的地址;所述第一设备的地址。
结合第三方面第一种可能的实现方式,在第三种可能的实现方式中,所述服务发现请求为数据帧格式;所述接入点接收的所述服务发现请求数据帧的帧头依次包括:所述接入点的地址;所述第一设备的地址;所述第二设备的地址。所述接入点发送的所述服务发现请求数据帧的帧头依次包括:所述第二设备的地址;所述接入点的地址;所述第一设备的地址。
结合第三方面第一种至第三种任一可能的实现方式,在第四种可能的实现方式中,所述服务发现应答包括所述第二设备的IP地址信息。
结合第三方面第一种至第三种任一可能的实现方式,在第五种可能的实现方式中,所述服务发现应答包括所述第二设备的MAC地址;在所述接入点向所述第一设备发送所述服务发现应答后,所述方法还包括:
所述接入点接收所述第一设备发送的查询请求,所述查询请求包括所述第二设备的MAC地址,所述查询请求用于查询所述第二设备的IP地址信息;
所述接入点向所述第一设备发送查询应答;所述查询应答包括所述第二设备的IP地址信息。
结合第三方面第一种至第五种任一可能的实现方式,在第六种可能的实现方式中,所述方法还包括:
所述接入点接收所述第一设备发送的第一能力协商请求;所述第一能力协商请求用于协商如何与所述第二设备建立连接;所述第一能力协商请求为数据帧格式;
所述接入点向所述第二设备发送所述第一能力协商请求;
所述接入点接收所述第二设备发送的第一能力协商应答,所述能力协商应答为所述第二设备对所述能力协商请求的响应;所述第一能力协商应答为数据帧格式;
所述接入点向所述第一设备发送所述第一能力协商应答。
结合第三方面第六种可能的实现方式,在第七种可能的实现方式中,所述第一能力协商应答包括所述第二设备的IP地址信息。
结合第三方面第六种或第七种可能的实现方式,在第八种可能的实现方式中,所述方法还包括:
所述接入点接收所述第二设备发送的第二能力协商请求;所述第二能力协商请求为数据帧格式;
所述接入点向所述第一设备发送所述第二能力协商请求;
所述接入点接收所述第一设备发送的第二能力协商应答,所述第二能力协商应答为所述第二设备对所述第二能力协商请求的响应;所述第二能力协商应答为数据帧格式;
所述接入点向所述第二设备发送所述第二能力协商应答。
结合第三方面第八种可能的实现方式,在第九种可能的实现方式中,所述 第二能力协商请求包括所述第二设备的IP地址信息。
第四方面,本发明提供了一种电子设备的一个实施例。
在第一种可能的实现方式中,所述电子设备包括:发送单元,用于经接入点向与所述接入点连接的至少一个第二设备发送服务发现请求;所述服务发现请求用于向所述至少一个第二设备查询所述第一设备请求查询的服务;
接收单元,用于接收所述至少一个第二设备发送的服务发现应答,所述服务发现应答为所述至少一个第二设备对所述服务发现请求的响应。
结合第四方面第一种可能的实现方式,在第二种可能的实现方式中,所述服务发现请求为数据帧格式;所述发送单元具体用于,经接入点广播服务发现请求;其中,
所述发送单元向所述接入点发送的服务发现请求数据帧的帧头依次包括:所述接入点的地址;所述第一设备的地址;广播地址;
所述发送单元经接入点广播的服务发现请求数据帧的帧头依次包括:所述广播地址;所述接入点的地址;所述第一设备的地址。
结合第四方面第一种可能的实现方式,在第三种可能的实现方式中,所述服务发现请求为数据帧格式;所述发送单元具体用于,经接入点单播发送服务发现请求;
所述发送单元向所述接入点发送的服务发现请求数据帧的帧头依次包括:所述接入点的地址;所述第一设备的地址;所述第二设备的地址;
所述发送单元经接入点单播发送的服务发现请求数据帧的帧头依次包括:所述第二设备的地址;所述接入点的地址;所述第一设备的地址。
结合第四方面第二种或第三种可能的实现方式,在第四种可能的实现方式 中,所述发送单元发送的服务发现请求数据帧的帧体部分包括:探测请求帧的帧体部分;或者,服务发现请求帧的帧体部分。
结合第四方面第一种至第四种可能的实现方式,在第五种可能的实现方式中,所述接收单元具体用于,接收所述至少一个第二设备经由所述接入点发送的服务发现应答,所述服务发现应答为数据帧格式。
结合第四方面第一种至第五种可能的实现方式,在第六种可能的实现方式中,所述接收单元接收的服务发现应答包括所述第二设备的IP地址信息。
结合第四方面第一种至第五种可能的实现方式,在第七种可能的实现方式中,所述服务发现应答包括所述第二设备的MAC地址;
所述发送单元还用于,在所述接收单元接收所述至少一个第二设备发送的服务发现应答后,向反向地址转换协议服务器发送查询请求;所述查询请求包括所述第二设备的Mac地址;所述查询请求用于查询所述第二设备的IP地址信息;
所述接收单元还用于,接收反向地址转换协议服务器发送的查询应答;所述查询应答包括所述第二设备的IP地址信息。
第五方面,本发明提供了一种电子设备的一个实施例。
在第一种可能的实现方式中,所述电子设备包括:发送器,用于经接入点向与所述接入点连接的至少一个第二设备发送服务发现请求;所述服务发现请求用于向所述至少一个第二设备查询所述第一设备请求查询的服务;
接收器,用于接收所述至少一个第二设备发送的服务发现应答,所述服务发现应答为所述至少一个第二设备对所述服务发现请求的响应。
结合第五方面第一种可能的实现方式,在第二种可能的实现方式中,所述 服务发现请求为数据帧格式;所述发送器具体用于,经接入点广播服务发现请求;其中,
所述发送器向所述接入点发送的服务发现请求数据帧的帧头依次包括:所述接入点的地址;所述第一设备的地址;广播地址;
所述发送器发送的经由接入点广播的服务发现请求数据帧的帧头依次包括:所述广播地址;所述接入点的地址;所述第一设备的地址。
结合第五方面第一种可能的实现方式,在第三种可能的实现方式中,所述服务发现请求为数据帧格式;所述发送器具体用于,经接入点单播发送服务发现请求;
所述发送器向所述接入点发送的服务发现请求数据帧的帧头依次包括:所述接入点的地址;所述第一设备的地址;所述第二设备的地址;
所述发送器发送的经由接入点单播发送的服务发现请求数据帧的帧头依次包括:所述第二设备的地址;所述接入点的地址;所述第一设备的地址。
结合第五方面第二种或第三种可能的实现方式,在第四种可能的实现方式中,所述发送器发送的服务发现请求数据帧的帧体部分包括:探测请求帧的帧体部分;或者,服务发现请求帧的帧体部分。
结合第五方面第一种至第四种任一可能的实现方式,在第五种可能的实现方式中,所述接收器具体用于,接收所述至少一个第二设备经由所述接入点发送的服务发现应答,所述服务发现应答为数据帧格式。
结合第五方面第一种至第五种任一可能的实现方式,在第六种可能的实现方式中,所述服务发现应答包括所述第二设备的IP地址信息。
结合第五方面第一种至第五种任一可能的实现方式,在第七种可能的实现 方式中,所述服务发现应答包括所述第二设备的MAC地址;
所述发送器还用于,在所述接收器接收所述至少一个第二设备发送的服务发现应答后,向反向地址转换协议服务器发送查询请求;所述查询请求包括所述第二设备的Mac地址;所述查询请求用于查询所述第二设备的IP地址信息;
所述接收器还用于,接收反向地址转换协议服务器发送的查询应答;所述查询应答包括所述第二设备的IP地址信息。
结合第五方面第七种可能的实现方式,在第八种可能的实现方式中,所述反向地址转换协议服务器与所述接入点为同一设备;
所述发送器具体用于,向所述接入点发送查询请求;
所述接收器具体用于,接收所述接入点发送的查询应答。
结合第五方面第一种至第八种任一可能的实现方式,在第九种可能的实现方式中,所述发送器还用于,向所述第二设备发送第一能力协商请求;所述第一能力协商请求用于协商如何与所述第二设备建立连接;
所述接收器还用于,接收所述第二设备发送的第一能力协商应答,所述第一能力协商应答为所述第二设备对所述第一能力协商请求的响应。
结合第五方面第九种可能的实现方式,在第十种可能的实现方式中,所述发送器具体用于,经由所述接入点向所述第二设备发送第一能力协商请求,所述第一能力协商请求为数据帧格式。
结合第五方面第九种或第十种可能的实现方式,在第十一种可能的实现方式中,所述第一能力协商应答包括所述第二设备的IP地址信息。
结合第五方面第九种至第十一种可能的实现方式,在第十二种可能的实现方式中,所述接收器还用于,接收所述所述第二设备发送的第二能力协商请求;
所述发送器还用于,向所述第二设备发送第二能力协商应答,所述第二能力协商应答为所述第一设备对所述第二能力协商请求的响应。
结合第五方面第十二种可能的实现方式,在第十三种可能的实现方式中,所述发送器具体用于,经由所述接入点向所述第二设备发送第二能力协商应答,所述第二能力协商应答为数据帧格式。
结合第五方面第十二种或第十三种可能的实现方式,在第十四种可能的实现方式中,所述第二能力协商请求包括所述第二设备的IP地址信息。
第六方面,本发明提供了一种电子设备的一个实施例。
在第一种可能的实现方式中,所述电子设备包括:
接收器,用于接收第一设备经由接入点发送的服务发现请求;所述服务发现请求用于向所述第二设备查询所述第一设备请求查询的服务;
发送器,用于向所述第一设备发送服务发现应答;所述服务发现应答为所述第二设备对所述第一服务发现请求的响应。
结合第六方面第一种可能的实现方式,在第二种可能的实现方式中,所述接收器接收的服务发现请求为数据帧格式。
结合第六方面第一种或第二种可能的实现方式,在第三种可能的实现方式中,所述发送器具体用于,经由所述接入点向所述第一设备发送服务发现应答;所述服务发现应答为数据帧格式;其中,所述发送器向所述接入点发送的服务发现应答数据帧的帧头依次包括:所述接入点的地址;所述第二设备的地址;所述第一设备的地址;
所述发送器发送的经由接入点发送的服务发现应答数据帧的帧头依次包括:所述第一设备的地址;所述接入点的地址;所述第二设备的地址。
结合第六方面第一种至第三种任一可能的实现方式,在第四种可能的实现方式中,所述服务发现应答包括所述第二设备的IP地址信息。
结合第六方面第一种至第四种可能的实现方式,在第五种可能的实现方式中,所述接收器还用于,接收所述第一设备发送的第一能力协商请求;所述第一能力协商请求用于协商如何与所述第二设备建立连接;
所述发送器还用于,向所述第一设备发送第一能力协商应答,所述第一能力协商应答为所述第二设备对所述第一服务发现请求的响应。
结合第六方面第五种可能的实现方式,在第六种可能的实现方式中,所述发送器向所述第一设备发送第一能力协商应答,具体为:
所述发送器经由所述接入点向所述第一设备发送第一能力协商应答;所述第一能力协商应答为数据帧格式。
结合第六方面第五种或第六种可能的实现方式,在第七种可能的实现方式中,所述第一能力协商应答包括所述第二设备的IP地址信息。
结合第六方面第五种至第七种可能的实现方式,在第八种可能的实现方式中,所述电子设备还包括:
输入设备,用于获取用户输入的响应指令;
所述发送器还用于,在所述输入设备获取用户输入的响应指令后,向所述第一设备发送第二能力协商请求;
所述接收器还用于,接收所述第一设备发送的第二能力协商应答,所述第二能力协商应答为所述第一设备对所述第二能力协商请求的响应。
结合第六方面第八种可能的实现方式,在第九种可能的实现方式中,所述发送器向所述第一设备发送第二能力协商请求,具体为:
所述发送器经由所述接入点向所述第一设备发送第二能力协商请求,所述第二能力协商请求为数据帧格式。
结合第六方面第八种或第九种可能的实现方式,在第十种可能的实现方式中,所述第二能力协商请求包括所述第二设备的IP地址信息。
第七方面,本发明提供了一种电子设备的一个实施例。
在第一种可能的实现方式中,所述电子设备包括:
接收器,用于接收第一设备发送的服务发现请求;所述服务发现请求用于向所述至少一个第二设备查询所述第一设备请求查询的服务;接收所述至少一个第二设备发送的服务发现应答,所述服务发现应答为所述第二设备对所述服务发现请求的响应;
发送器,用于向所述至少一个第二设备发送所述服务发现请求;向所述第一设备发送所述服务发现应答。
结合第七方面第一种可能的实现方式,在第二种可能的实现方式中,所述服务发现请求为数据帧格式;所述发送器向所述至少一个第二设备发送所述服务发现请求,具体为:所述发送器广播所述服务发现请求;其中,
所述接收器接收的所述服务发现请求数据帧的帧头依次包括:所述接入点的地址;所述第一设备的地址;广播地址。
所述发送器广播的所述服务发现请求数据帧的帧头依次包括:所述广播地址;所述接入点的地址;所述第一设备的地址。
结合第七方面第一种可能的实现方式,在第三种可能的实现方式中,所述服务发现请求为数据帧格式;所述发送器单播发送所述服务发现请求;
所述接收器接收的所述服务发现请求数据帧的帧头依次包括:所述接入点 的地址;所述第一设备的地址;所述第二设备的地址。
所述发送器发送的所述服务发现请求数据帧的帧头依次包括:所述第二设备的地址;所述接入点的地址;所述第一设备的地址。
结合第七方面第一种至第三种任一可能的实现方式,在第四种可能的实现方式中,所述服务发现应答包括所述第二设备的IP地址信息。
结合第七方面第一种至第三种任一可能的实现方式,在第五种可能的实现方式中,所述接收器还用于,接收所述第一设备发送的查询请求,所述查询请求包括所述第二设备的MAC地址,所述查询请求用于查询所述第二设备的IP地址信息;
所述发送器还用于,向所述第一设备发送查询应答;所述查询应答包括所述第二设备的IP地址信息。
结合第七方面第一种至第五种任一可能的实现方式,在第六种可能的实现方式中,所述接收器还用于,接收所述第一设备发送的第一能力协商请求;所述第一能力协商请求用于协商如何与所述第二设备建立连接;所述第一能力协商请求为数据帧格式;接收所述第二设备发送的第一能力协商应答,所述能力协商应答为所述第二设备对所述能力协商请求的响应;所述第一能力协商应答为数据帧格式;
所述发送器还用于,向所述第二设备发送所述第一能力协商请求;向所述第一设备发送所述第一能力协商应答。
结合第七方面第六种可能的实现方式,在第七种可能的实现方式中,所述第一能力协商应答包括所述第二设备的IP地址信息。
结合第七方面第六种或第七种可能的实现方式,在第八种可能的实现方式 中,所述接收器还用于,接收所述第二设备发送的第二能力协商请求;所述第二能力协商请求为数据帧格式;接收所述第一设备发送的第二能力协商应答,所述第二能力协商应答为所述第二设备对所述第二能力协商请求的响应;所述第二能力协商应答为数据帧格式;
所述发送器还用于,向所述第一设备发送所述第二能力协商请求;向所述第二设备发送所述第二能力协商应答。
结合第七方面第八种可能的实现方式,在第九种可能的实现方式中,所述第二能力协商请求包括所述第二设备的IP地址信息。
上述所说的接入点,可以为有基础设施的Wi-Fi网络中的接入点(AP,Access Point),也可以为通过Wi-Fi Direct协议建立群组(Group)的群主设备(Group Owner)。
在本发明实施例中,在多个电子设备均与接入点连接的场景中,不需要电子设备断开与接入点的连接即可实现多个电子设备之间服务发现消息的交互,提高了服务发现效率,继而提高了互通效率。本发明实施例扩展了Wi-Fi Direct Service的应用范围,提高了用户体验。
附图说明
为了更清楚地说明本发明实施例的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。
图1为现有技术提供的完整的服务发现和连接建立的流程图;
图2为IEEE的802.11定义的数据帧结构图;
图3为WFDS标准定义的数据帧结构图;
图4为本发明实施例提供的一种服务发现方法的实施例的流程图;
图5为本发明实施例提供的一种服务发现方法的实施例的流程图;
图6为本发明实施例提供的一种服务发现方法的实施例的流程图;
图7为本发明实施例提供的一种电子设备的一个实施例的结构示意图;
图8为本发明实施例提供的一种电子设备的一个实施例的结构示意图。
具体实施方式
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。
在对本发明实施例进行具体介绍之前,先对服务发现和连接需要经历的步骤进行简要介绍。如图1所示,图1为现有技术提供的完整的服务发现和连接建立的总体流程图。其中,完整的服务发现和连接建立包括如下步骤:
服务发现(Service Discovery),用于探测哪个设备能够支持本设备需要的服务。所述服务发现包括Probe交互和service discovery交互,前述两个交互使用的Wi-Fi消息不同。
能力协商(Provision Discovery),包括连接能力交互(connection capability exchange),功能交互(feature capability exchange),WSC交互(Wi-Fi Simple Configuration exchange)等,该步骤主要是确认双方设备 的连接能力,各设备处于什么状态,以及如何连接等。
连接阶段,根据能力协商阶段的协商结果,确定双方设备的交互是创建新的连接还是使用原有的连接等。
ASP会话建立阶段,ASP是基于网络层(IP层)进行的,无论是创建新的连接,或者使用原有连接,均可获得对端设备的IP地址。在双方建立ASP会话前,所述服务查询方获取对方设备的IP地址信息。基于所述IP地址,双方建立ASP会话。例如,所述服务查询方基于所述IP地址,在IP网络层向服务应答方发送REQUEST_SESSION消息。在现有WFDS标准中,所述REQUEST_SESSION消息被送到MAC层,在MAC层进行传输,由服务查询方直接发送到服务应答方。在有接入点参与的环境下,在MAC层,这个消息通过AP转发。当然,如果TDLS直连已经建立,也可由服务查询方发送到服务应答方。
业务建立阶段,在ASP会话的基础上,建立上层业务,比如传照片业务等等。ASP session建立以后,基于IP网络层的应用程序的连接和数据交互,双方建立Application socket connection和进行data transfer。在现有WFDS标准中,前述交互消息也是在MAC层由服务查询方和服务应答方直接传输。在有接入点参与的环境下,MAC层承载这些消息时,可通过AP转发。同理,如果建立了TDLS直连,也可由服务查询方与服务应答方直接交互。
在前述ASP会话建立阶段和业务建立阶段,可直接使用现有ASP的做法,是否具有接入点的应用环境,对这两个步骤没有太多影响。但在前述服务发现阶段、能力协商阶段、连接阶段中,在存在接入点的情况下,本发明的实施例的处理方式跟现有的ASP是不相同的。
前述服务发现阶段、能力协商阶段、连接建立阶段的步骤中,可包括如下 交互信息,如Probe Request,Probe Response,service discovery Request,service discovery Response,provision discovery request,provision discovery Response等消息。在具体交互过程中,在现有WFDS标准中,这些消息都是以管理帧的形式从一个站点发送到另一个站点;但是在具有接入点的网络结构中,这些消息可以是通过接入点进行转发的。在通过接入点进行转发时,前述交互信息都可以数据帧的方式传递。这也是本发明的发明点之一。根据这个数据帧标准化组织的不同,可以分成IEEE和WFA两种定义方式,两种方式大体相似,但是细节上有所区别。如下将对IEEE的802.11标准中的数据帧格式和在WFA的WFDS标准中的数据帧格式进行介绍。
在IEEE的802.11标准中,所述数据帧的格式可如图2所示,图2为IEEE的802.11定义的数据帧结构。其中,802.11MAC Header是帧头,其包括帧控制(Frame Control)、持续时间/ID号(Duration/ID)、接收地址(Address1)、发送地址(Address2)、顺序控制(Sequence Control)、高吞吐量控制(High Throughput Control)等,尤其包含相关地址信息。LLC Header是LLC层的头。SNAP Header是扩展的LLC头,其中的Ether type被设置成0x890d时,表示后面携带的是是802.11的管理协议,这个是现有标准定义的。Payload Type现在已经有了定义,比如为2时表示后面携带的是TDLS(Tunnel Direct-Link Setup,隧道直连建立)的管理帧。在本发明实施例中,为了携带WFDS的管理帧(即前述交互信息),可以在数据帧结构中添加一个新的Payload Type,比如Payload Type为3,表示后面携带的是WFDS的管理帧。具体地,因交互信息的不同,需要对管理帧进行区分,例如在Payload部分可拿出一个字节来表示管理帧的类型,该字节可叫做Packet Type。例如,在Packet Type为0时,用于标识该管 理帧的类型是P2P Probe Request;在Packet Type为1时,用于标识该管理帧的类型是P2P Probe Response;在Packet Type为2时,用于标识该管理帧的类型是P2P service discovery request;在Packet Type为3时,用于标识该管理帧的类型是P2P service discovery Response;在Packet Type为4时,用于标识该管理帧的类型是P2P provision discovery request;在Packet Type为5时,用于标识该管理帧的类型是P2P provision discovery Response。在具体实现过程中,可将所述管理帧全部封装到数据帧中;也可只封装管理帧的帧体部分,不封装管理帧的帧头。
在WFA的WFDS标准中,所述数据帧的格式可如图3所示,图3为WFDS标准定义的数据帧结构。在SNAP header中的第一部分,使用0x506F9A指示该数据帧是WFA定义的内容;第二部分表示是ASP2.0定义的内容,这个值由WFA指定,例如可以为0x1600等。Packet Type和帧内容部分,可跟802.11中的使用一致。
应当理解,Protocol Identifier中,前三个字节表示组织,后两个字节表示类型。例如,在IEEE的802.11标准中,0x000000表示IEEE,0x890d表示802.11管理协议;在WFA的WFDS标准中,,0x506F9A表示WFA,0x1600表示WFDS管理协议。当然,在实际使用中,WFDS管理协议不一定是用0x1600,还可以用其它值代替。
具体地,如图4所示,本发明实施例提供的服务发现方法可包括如下步骤,该方法可以由发现查询方执行,以获取所述发现查询方查询的服务的信息。所述发现查询方为发送服务发现请求、接收服务发现应答的一方。本发明实施例中,与所述发现查询方相对的另一方为发现响应方,所述响应方接收发现查询 方的服务发现请求,向发现查询方发送服务发现应答,所述服务发现应答包括发现查询方查询的服务的相关信息。
S101,第一设备经接入点向与所述接入点连接的至少一个第二设备发送服务发现请求;所述服务发现请求用于向所述至少一个第二设备查询所述第一设备请求查询的服务;
具体地,所述第一设备与所述接入点连接,所述接入点与至少两个设备连接。除所述第一设备外,所述接入点至少与至少一个第二设备连接。所述第一设备经由接入点发送服务发现请求,所述服务发现请求用于向所述至少一个第二设备查询所述第一设备请求查询的服务。所述服务发现请求可包含所述第一设备请求查询的服务的信息,例如第一设备查询的服务的名称或者对应的ID值等。所述第一设备请求查询的服务,不仅可以包括查询所述第二设备支持的服务,也可包括查询所述第二设备不支持的服务;所述查询的服务,不仅可以包括查询服务的类型,也可以包括查询具体的服务,如服务本身的相关参数及服务内容。例如,所述服务发现请求用于请求查询播放服务,其可以请求查询第二设备是否支持该播放服务;还可以请求的服务查询包括该播放服务归属的类型,以及该播放服务的具体内容。播放服务可归属于一种娱乐类型,此时,所述服务发现请求可请求查询第二设备的娱乐类型,然后从娱乐类型中查询播放服务;还可以直接查询第二设备支持的播放服务,例如播放支持的视频格式,播放的分辨率等。所述至少一个第二设备获取所述服务发现请求包含的服务的名称或ID值后,可确定是否支持所述名称或ID值对应的服务,并在支持所述服务的情况下,确定所述服务的具体内容。
可选地,所述服务发现请求为数据帧格式,所述数据帧是Wi-Fi定义的一 种帧类型,所述数据帧包括帧头和帧体。所述数据帧的帧头可包含三个地址,其名称可以分别为为Address1(A1),Address2(A2),Address3(A3),所述帧头包含的地址信息以及所述地址信息的顺序,可根据数据帧的发送方和接收方的不同而调整。在所述数据帧为设备向接入点发送的数据帧时,所述数据帧的帧头地址依次为:所述A1为直接接收者地址,所述A2为直接发送者地址,所述A3为最终目标地址;在所述数据帧为接入点向设备发送的数据帧时,所述A1为直接接收者地址,同时也刚好是目标地址,所述A2为直接发送者地址,所述A3为最初源地址。
可选地,所述服务发现请求也可以为管理帧或控制帧。所述第一设备经由所述接入点发送所述服务发现请求,所述接入点接收所述第一设备发送的所述服务发现请求,所述接入点解析所述管理帧或控制帧,所述接入点可按照预设的规则对所述管理帧或所述控制帧进行处理。所述接入点将所述处理后的管理帧或控制帧发送给至少一个第二设备。
可选地,所述第一设备可经由所述接入点广播服务发现请求。所述服务发现请求为数据帧格式。在所述第一设备向接入点发送所述服务发现请求时,其A1(目标地址信息)为所述接入点的地址信息,A3(最终目标地址信息)可不为具体的第二设备的地址信息,而是广播地址(Broadcast Address)。所述广播地址为专门用于同时向网络中所述第二设备进行发送的一个地址。在MAC层,其包括48位主机标识段host ID,并且所述48位主机标识段host ID均为1,以表明该地址为广播地址。此时,所述第一设备向所述接入点发送的服务发现请求数据帧的帧头依次包括:所述接入点的地址;所述第一设备的地址;广播地址。所述接入点接收所述第一设备的所述服务发现请求后,改变所述服务发现 请求数据帧的帧头地址格式,将所述广播地址设置为A1(目标地址信息),并广播修改帧头地址格式的服务发现请求数据帧,以便与接入点连接的第二设备可接收所述接入点广播的服务发现请求。所述接入点广播的服务发现请求数据帧的帧头依次包括:广播地址;所述接入点的地址;所述第一设备的地址。
可选地,所述第一设备也可经由所述接入点向与所述接入点连接的第二设备单播发送服务发现请求。所述第一设备获知第二设备的Mac地址,向所述Mac地址对应的第二设备单播发送服务发现请求。此时,所述第一设备向所述接入点发送的服务发现请求数据帧的帧头依次包括:所述接入点的地址;所述第一设备的地址;所述第二设备的地址;所述接入点单播的服务发现请求数据帧的帧头依次包括:所述第二设备的地址;所述接入点的地址;所述第一设备的地址。
可选地,所述服务发现请求可以包括第一服务发现请求和第二服务发现请求。所述第一设备向所述第二设备发送第一服务发现请求,所述第一服务发现请求可包含所述第一设备所需要的服务的ID值。所述服务的ID值可以是所述服务的名称经过哈希运算后的哈希值。所述第二设备获取所述第一服务发现请求后,获取所述服务的ID值,并根据所述ID值获取所述服务的名称。所述第一服务发现应答可包含所述服务的名称。所述第一设备获取所述第二设备发送的第一服务发现应答后,获取所述服务的名称。在所述第一设备需进一步了解该服务的详细信息时,所述第一设备可向所述第二设备发送第二服务发现请求,所述第二服务发现请求可包含所述服务的名称,所述第二服务发现请求用于请求获取所述第二设备的所述服务名称对应的所述服务的具体信息。所述第一设备接收所述第二设备发送的第二服务发现应答,所述第二服务发现应答为所述第 二设备对所述第二服务发现请求的响应。具体地,所述第一服务发现请求可以为Probe Request,所述第一服务发现应答可以为Probe Response。所述第二服务发现请求可以为Service Discovery Request,所述第二服务发现应答可以为Service Discovery Response。
可选地,所述第一设备经接入点向所述至少一个第二设备广播的第一服务发现请求可以为Probe Request。所述Probe Response可携带所述第一设备想要发现的服务名称或服务类型,所述服务名称或服务类型可以哈希值的形式包含在所述Probe Request中。所述第一设备可将所述Probe Request封装在数据帧中,由所述接入点转发。所述第一设备经接入点向与接入点连接的至少一个第二设备广播第一服务发现请求;即所述第一设备将所述携带所述Probe Request的数据帧发送至所述接入点,所述接入点将所述包含Probe Request的数据帧广播至所述至少一个第二设备。在所述数据帧为所述第一设备向所述接入点发送的数据帧时,该数据帧包含的三个地址可依次为:所述接入点的地址;所述第一设备的地址;广播地址。在所述数据帧为所述接入点向所述至少一个第二设备广播的数据帧时,该数据帧包含的三个地址可以依次为:广播地址;所述接入点的地址;所述第一设备的地址。所述接入点接收所述第一设备发送的第一服务发现请求后,向与该接入点连接的至少一个第二设备广播第一服务发现请求。在所述第一设备发送的第一服务发现请求为数据帧格式时,所述接入点更改所述第一服务发现请求的数据帧帧头的地址信息,所述更改后的数据帧的帧头信息中的三个地址依次为:广播地址、所述接入点的地址、所述第一设备的地址。所述接入点将所述更改帧头后的数据帧广播给与该接入点关联的至少一个第二设备。或者;所述第一设备经接入点向与接入点连接的至少 一个第二设备单播发送第一服务发现请求;即所述第一设备已获知与所述接入点连接的第二设备的地址信息,所述第一设备将所述携带所述Probe Request的数据帧发送至所述接入点,所述数据帧中携带所述第二设备的地址信息,所述接入点将所述包含Probe Request的数据帧发送至所述至少一个第二设备。在所述数据帧为所述第一设备向所述接入点发送第一服务发现请求的数据帧时,所述数据帧的帧头包含的地址依次为:所述接入点的信息;所述第一设备的信息;所述第二设备的信息。在所述数据帧为所述接入点向所述第二设备单播发送的数据帧时,所述数据帧的帧头包含的地址可以依次为:所述第二设备的地址、所述接入点的地址;所述第一设备的地址。所述接入点将所述更改帧头后的数据帧单播发送给与该接入点关联的至少一个第二设备。
可选地,所述第一设备经接入点向所述至少一个第二设备广播的第一服务发现请求可以为Service Discovery Request。
所述服务发现请求数据帧的帧体部分包括:探测请求帧的帧体部分;或者,服务发现请求帧的帧体部分。具体地,所述服务发现请求数据帧可包括帧头部分和帧体部分。所述帧体部分可只封装探测请求帧的帧体部分,例如Probe Request的帧体部分,而不包括Probe Request的帧头部分;所述帧体部分可只封装服务发现请求帧的帧体部分,例如Service Discovery Request的帧体部分,而不包括Service Discovery Request的帧头部分。所述服务发现请求数据帧根据具体的交互对象设置帧头部分的地址信息。
这里所说的Service Discovery Request/Response,具体可以为802.11标准中定义的通用广告服务请求/应答(generic advertisement service request/response),简称为GAS request/response,也可以为其他专门定义 的服务发现请求/应答。
S102,所述第一设备接收所述至少一个第二设备发送的服务发现应答,所述服务发现应答为所述至少一个第二设备对所述服务发现请求的响应。
所述第二设备接收所述接入点发送的服务发现请求后,解析所述服务发现请求,获取所述第一设备的请求查询的服务的信息。在所述第二设备支持所述第一设备请求查询的服务时,所述第二设备生成服务发现应答,可选地,所述服务发现应答可仅包括所述第二设备支持该服务的信息,不涉及服务本身的信息,例如服务的类型、服务的具体内容;可选地,所述服务发现应答可包括所述至少一个第二设备支持的所述第一设备请求查询的服务,其不仅包括第二设备支持该服务的信息,还包括服务本身的信息,例如服务的类型、服务的具体内容。在所述第二设备不支持所述第一设备请求查询的服务时,所述第二设备也可生成服务发现应答,所述服务发现应答包括所述第二设备不支持该服务的信息。在所述第二设备不支持所述第一设备请求查询的服务时,所述第二设备也可不生成服务发现应答,本次服务发现交互过程结束。
可选地,在所述服务发现请求为Probe Request,所述服务发现应答为Probe Response。所述Probe Response为所述第二设备对所述第一设备发送的Probe Request的响应。
可选地,在所述服务发现请求为Service Discovery Request,所述服务发现应答为Service Discovery Response。所述Service Discovery Response为所述第二设备对所述第一设备发送的Service Discovery Request的响应。
可选地,在所述服务发现请求包括多条交互消息时,所述第二设备可分别响应不同服务发现请求。例如,在所述第一设备发送的第一服务发现请求为 Probe Request时,所述第二设备响应所述Probe Request,向所述第一设备发送Probe Response。在所述第一设备发送的第二服务发现请求为Service Discovery Request时,所述第二设备响应所述Service Discovery Request,向所述第一设备发送Service Discovery Response。
可选地,所述第二设备可直接向所述第一设备发送第一服务发现应答,所述第一服务发现应答为管理帧格式。所述管理帧的帧头可包含三个地址,所述A1为直接接受者地址,所述A2为直接发送者地址,所述A3为BSSID(Basic Service Set IDentifier,基本服务集标识),所述BSSID为所述第一设备和所述第二设备共同连接的接入点的MAC(MAC,Medium Access Control,媒体接入控制)地址。具体地,该管理帧的帧头包含的三个地址可依次为:所述第一设备的地址,所述第二设备的地址,所述接入点的地址。
可选地,所述第二设备可经由所述接入点向所述第一设备发送第一服务发现应答,所述第一设备接收所述第二设备经由所述接入点发送的第一服务发现应答,所述第一服务发现应答为数据帧格式。所述第二设备向所述接入点发送的第一服务发现应答数据帧的帧头地址可依次为:所述接入点的地址;所述第二设备的地址;所述第一设备的地址;所述接入点接收所述第二设备经由该接入点向第一设备发送的第一服务发现应答后,调整所述第一服务发现应答数据帧的帧头地址,所述调整后的数据帧的帧头地址可依次为:所述第一设备的地址;所述接入点的地址;所述第二设备的地址。所述第一设备接收所述接入点发送的调整帧头地址后的第一服务发现应答数据帧。
在本发明实施例中,在多个电子设备均与接入点连接的场景中,不需要电子设备断开与接入点的连接即可实现多个电子设备之间服务发现消息的交互, 提高了服务发现效率,继而提高了互通效率。例如,在发现查询方与发现响应方均与接入点连接的场景中,不需要发现查询方断开与接入点的连接即可实现与发现响应方的连接,提高了服务发现效率,继而提高了互通效率。
在本发明的一个实施例中,所述服务发现请求包括第一服务发现请求和第二服务发现请求。具体地,所述第一服务发现请求为Probe Request,所述第一服务发现应答为Probe Response。所述第二服务发现请求为Service Discovery Request,所述第二服务发现应答为Service Discovery Response,所述Service Discovery Response为所述第二设备对所述第一设备发送的Service Discovery Request的响应。所述第一设备经由所述接入点发送第一服务发现请求,所述第一服务发现请求为数据帧格式。所述第一设备接收第二设备发送的第一服务发现应答。所述第二设备可经由所述接入点发送所述第一服务发现应答,此时所述第一服务发现应答为数据帧格式;所述第二设备也可直接向所述第一设备发送所述第一服务发现应答,此时所述第一服务发现应答为管理帧格式。
可选地,所述第二服务发现请求与所述第二服务发现应答的交互,可不经由所述接入点转发,直接在所述第一设备和所述第二设备之间实现。所述第一设备可不经所述接入点直接向所述第二设备发送第二服务发现请求,所述第一设备向所述第二设备发送所述Service Discovery Request的管理帧,所述管理帧的帧头可包含三个地址,所述A1为直接接收者地址,所述A2为直接发送者地址,所述A3为BSSID。具体地,该管理帧的帧头所包含的三个地址可依次为:所述第二设备的地址,所述接入点的地址,所述第一设备的地址。所述第二设备接收所述第一设备发送的第二服务发现请求后,获取所述Service  Discovery Request,生成对该Service Discovery Request的响应第二服务发现响应Service Discovery Response。所述第二设备向所述第一设备发送所述Service Discovery Response的管理帧。所述管理帧的帧头可包含三个地址,所述所述A1为直接接收者地址,所述A2为直接发送者地址,所述A3为BSSID。具体地,该数据帧的帧头所包含的三个地址可依次为:所述第一设备的地址,所述第二设备的地址,所述接入点的地址。所述第一设备获取所述Service Discovery Response的管理帧后,获取所述第二服务发现应答,获取详细的服务信息。
可选地,所述第二服务发现请求与所述第二服务发现应答的交互,可经由所述接入点转发,在所述第一设备、所述第二设备和所述接入点之间实现。所述第一设备可经所述接入点向所述第二设备发送第二服务发现请求,所述第二服务发现请求可以为包含管理帧Service Discovery Request的数据帧。所述包含管理帧可以是只包含该管理帧的帧体部分,也可以是包含该管理帧的帧头和帧体部分。所述数据帧的帧头中地址的规则按照上述排列规则依次排列,即:在所述数据帧为设备向接入点发送的数据帧时,所述A1为直接接收者地址,所述A2为直接发送者地址,所述A3为最终目标地址;在所述数据帧为接入点向设备发送的数据帧时,所述A1为直接接收者地址,同时也刚好是目标地址,所述A2为直接发送者地址,所述A3为最初源地址。因此,在所述第一设备向所述接入点发送第二服务发现请求时,所述数据帧的帧头可包含的三个地址具体分别为:所述接入点的地址;所述第一设备的地址;所述第二设备的地址。在所述接入点接收所述第一设备发送的第二服务发现请求后,更改所述第二服务发现请求的数据帧的帧头地址,所述数据帧的帧头包括的三个地址可具体更改为: 所述第二设备的地址;所述接入点的地址;所述第一设备的地址。所述第二设备获取所述接入点发送的第二服务发现请求后,获取所述第一设备发送的Service Discovery Request。所述第二设备生成Service Discovery Response,所述Service Discovery Response包括对所述Service Discovery Request中包含的服务名称所对应的服务的详细信息,所述第二设备将所述Service Discovery Response封装到数据帧中。所述第二设备可经由所述接入点将所述包含Service Discovery Response的数据帧发送给所述第一设备,所述第二设备向所述接入点发送的第二发现应答的数据帧的帧头所包含的地址信息依次为:所述接入点的地址,所述第二设备的地址,所述第一设备的地址;所述接入点获取所述第二设备发送的第二发现响应的数据帧后,更改所述数据帧的帧头所包含的地址信息,变更后的帧头包含的地址信息依次为:所述第一设备的地址,所述接入点的地址,所述第二设备的地址;所述第一设备接收所述接入点转发的第二发现应答。所述第二服务发现请求与所述第二服务发现应答的交互,可经由所述接入点转发,在所述第一设备、所述第二设备和所述接入点之间实现。
可选地,所述第二服务发现请求与所述第二服务发现应答的交互,可部分经由所述接入点转发,即所述第二服务发现请求经由所述接入点转发,所述第二服务发现应答在所述第一设备和所述第二设备之间直接发送;或者,所述第二服务发现请求在所述第一设备和所述第二设备之间直接发送,所述第二服务发现应答经由所述接入点转发。对此可能的第二服务发现请求与第二服务发现应答的交互形式,本发明实施例不做限定。
需要说明的是,在本发明实施例的上述交互形式中,在所述第二服务发现 请求与所述第二服务发现应答的交互有接入点参与时,经由所述接入点参与的消息,如所述接入点接收的消息或所述接入点发送的消息,所述消息的格式为数据帧格式,所述管理帧格式的交互信息封装在数据帧格式的交互信息中。所述封装可以是只把管理帧的帧体封装在数据帧中,也可以是把管理帧的帧头和帧体全部都封装在数据帧中。在所述第二服务发现请求与所述第二服务发现应答的交互没有接入点参与,消息直接在所述第一设备和所述第二设备之间发送时,所述消息的格式为管理帧格式。
在所述第一设备获取所述第二设备发送的第一服务发现应答后,向所述第二设备发送第二服务发现请求。所述第二服务发现请求携带所述第一服务发现应答所包含的服务名称。所述第二设备接收所述第一设备发送的第二服务发现请求,获取所述服务名称,生成第二服务发现应答,所述第二服务发现应答包括所述服务名称对应的服务的详细描述,以便所述第一设备获取所述第二设备关于该服务的具体提供信息,例如是否支持该服务、支持何种服务类型、所支持服务的层级、参数等,所述第一设备可据此判断是否为该设备需要的服务,进而确定是否建立连接,提高了连接效率。
在本发明的一个实施例中,所述服务发现请求数据帧的帧体部分包括:探测请求帧的帧体部分;或者,服务发现请求帧的帧体部分。具体地,所述服务发现请求数据帧包括帧头和帧体。所述探测请求帧和所述服务发现请求帧均为管理帧,所述管理帧同样包括帧头和帧体。所述探测请求帧为Probe Request,所述服务发现请求帧为service discovery Request。所述服务发现请求数据帧的帧体部分可包括所述探测请求帧的帧头和帧体,也可以只包括所述探测请求帧的帧体部分;同样,所述服务发现请求数据帧的帧体部分可包括所述服务 发现请求帧的帧头和帧体,也可以只包括所述服务发现请求帧的帧体部分。
在本发明的一个实施例中,所述服务发现应答包括所述第二设备的IP地址信息。更进一步地,在所述第一设备与所述第二设备建立ASP会话前,所述第一设备可通过与所述第二设备交互获取的任一应答消息获取所述第二设备的IP地址信息。可选地,所述第一服务发现应答包括所述第二设备的IP地址信息,例如所述Probe Response中携带所述第二设备的IP地址信息。可选地,所述第二服务发现应答包括所述第二设备的IP地址信息,例如所述service discovery Response中携带所述第二设备的IP地址信息。可选地,第一能力协商应答包括所述第二设备的IP地址信息,例如所述provision discovery Response中携带所述第二设备的IP地址信息。可选地,第二能力协商应答包括所述第二设备的IP地址信息,例如所述Follow-on provision discovery Response中携带所述第二设备的IP地址信息。
在本发明的一个实施例中,在所述第一设备与所述第二设备建立ASP会话前,所述第一设备可通过反向地址转换协议(Reverse Address Resolution Protocol,RARP)获取获取所述第二设备的IP地址信息。所述方法还包括:所述服务发现应答包括所述第二设备的MAC地址;在所述第一设备接收所述至少一个第二设备发送的服务发现应答后,所述第一设备向反向地址转换协议服务器发送查询请求;所述查询请求包括所述第二设备的Mac地址;所述查询请求用于查询所述第二设备的IP地址信息;所述第一设备接收反向地址转换协议服务器发送的查询应答;所述查询应答包括所述第二设备的IP地址信息。具体地,在所述第一设备向第二设备单播发送服务发现请求时,所述第一设备已经获取所述第二设备的Mac地址;在所述第一设备经由接入点广播服务发现请求时, 所述第一设备接收第二设备发送的服务发现应答,获取所述服务发现应答中包含的Mac地址。所述第一设备向所述反向地址转换协议服务器发送地址查询请求。所述反向地址转换协议服务器存储有所述第二设备的Mac地址、IP地址以及两者之间的映射关系。所述反向地址转换协议服务器接收所述第一设备发送的地址查询请求后,获取所述第二设备的MAC地址,所述反向地址转换协议服务器根据所述第二设备的MAC地址获取所述第二设备的IP地址。所述反向地址转换协议服务器生成查询应答,并向所述第一设备发送所述查询应答,所述查询应答包括所述第二设备的IP地址信息。
进一步地,所述反向地址转换协议服务器与所述接入点为同一设备;所述第一设备向所述接入点发送查询请求,所述查询请求包括所述第二设备的Mac地址,所述查询请求用于查询所述第二设备的IP地址信息;所述第一设备接收所述接入点发送的查询应答。所述接入点存储有所述第二设备的Mac地址、IP地址以及两者之间的映射关系。所述接入点获取包含第二设备Mac地址的查询请求后,获取所述Mac地址对应的IP地址,并生成查询应答,所述查询应答包括所述第二设备的IP地址信息。
在本发明的一个实施例中,所述方法还包括:所述第一设备经由所述接入点向所述第二设备发送第一能力协商请求;所述第一设备接收所述第二设备发送的第一能力协商应答,所述第一能力协商应答为所述第二设备对所述第一能力协商请求的响应。具体地,在所述第一设备与所述第二设备完成服务发现后,所述第一设备与所述第二设备进入能力协商阶段。
在本发明实施例的一种实现方式中,所述第一设备向经由所述接入点向所述第二设备发送第一能力协商请求,所述第一能力协商请求可以为provision  discovery Request。所述第一设备将所述管理帧provision discovery Request封装成第一能力协商请求数据帧,所述数据帧的帧头包含的地址信息可依次为:所述接入点的地址信息;所述第一设备的地址信息;所述第二设备的地址信息。所述第一设备向所述接入点发送所述第一能力协商请求数据帧。所述接入点接收所述第一能力协商请求数据帧后,更改所述数据帧的帧头地址,更改后的数据帧的帧头包含的地址信息可依次为:所述第二设备的地址信息;所述接入点的地址信息;所述第一设备的地址信息。所述接入点将帧头地址信息更改后的能力协商请求发送至所述第二设备。所述第二设备接收所述第一能力协商请求后,获取所述provision discovery Request,解析获得所述第一设备的联网需求等能力协商信息。具体地,所述第一设备可有多种联网需求:一,所述第一设备要求在与所述第二设备的交互中充当群主(Group Owner,GO)角色;二,所述第一设备要求在与所述第二设备的交互中充当群成员(GroupClient)角色;三,所述第一设备在与所述第二设备的交互中身份不限,既可为群主,也为群成员;四,所述第一设备要求与所述第二设备通过接入点的已有网络连接进行传输。所述所述第一设备要求与所述第二设备通过接入点的已有网络连接进行传输,具体可通过所述第一设备在provision discovery Request中携带通过接入点的已有网络连接进行传输的指示信息实现。所述第二设备判断根据自身情况,确定是否可接收所述第一设备的联网需求。这里所说的联网需求,可以是没有网络连接的情况下建立连接的需求,也可以是已经有了网络连接后,如何进行上层业务传输的需求。
可选地,在所述第二设备无法满足所述第一设备的联网需求时,所述第二设备生成第一能力协商应答,所述第一能力协商应答可以为provision  discovery Response,所述第一能力协商应答用于告知所述第一设备该第二设备无法满足所述第一设备的联网需求,所述第一设备与所述第二设备的交互结束。所述第二设备可将所述管理帧provision discovery Response封装成能力协商应答数据帧,经由所述接入点向所述第一设备发送第一能力协商应答;或者,所述第二设备可不经由所述接入点,直接将所述管理帧provision discovery Response发送给所述第一设备。
可选地,在所述第二设备可以满足所述第一设备的联网需求时,所述第二设备生成第一能力协商应答,所述第一能力协商应答可以为provision discovery Response,所述第一能力协商应答用于告知所述第一设备该第二设备可满足所述第一设备的联网需求,并同意所述第一设备的联网需求。所述第二设备可将所述管理帧provision discovery Response封装成能力协商应答数据帧,经由所述接入点向所述第一设备发送第一能力协商应答;或者,所述第二设备可不经由所述接入点,直接将所述管理帧provision discovery Response发送给所述第一设备。
可选地,所述第二设备获取所述第一设备的第一能力协商请求,获取所述第一设备的联网需求后,所述第二设备生成第一能力协商应答,所述第一能力协商应答可以为provision discovery Response,所述第一能力协商应答用于告知所述第一设备该第二设备已获知所述第一设备的联网需求,但不包含所述第二设备是否同意所述第一设备联网需求的实质信息。在向所述第一设备发送第一能力协商应答(provision discovery Response)后,所述第二设备可将所述第一能力协商请求包含的信息呈现给用户。在获取用户的指令后,所述第二设备可经由所述接入点向所述第一设备发送第二能力协商请求,所述第二能 力协商请求可以为Follow-on provision discovery Request,所述第二能力协商请求用于告知所述第一设备,所述第二设备是否同意所述第一设备的联网需求。所述第二设备可将所述管理帧Follow-on provision discovery Request封装成第二能力协商请求数据帧,并按照前述的数据帧帧头设置规则经由所述接入点向所述第一设备发送第二能力协商请求数据帧;或者,所述第二设备也可不经所述接入点,直接向所述第一设备发送Follow-on provision discovery Request管理帧。所述第一设备获取所述第二设备发送的第二能力协商请求后,生成第二能力协商应答,所述第二能力协商应答可以为Follow-on provision discovery Response,所述第二能力协商应答用于告知所述第二设备,所述第一设备已获知所述第二设备的联网需求意见。所述第一设备可将所述管理帧Follow-on provision discovery Response封装成第二能力协商应答数据帧,并按照前述的数据帧帧头设置规则经由所述接入点向所述第二设备发送;所述第一设备也可不经所述接入点,直接向所述第二设备发送管理帧Follow-on provision discovery Response。
在本发明实施例的一种实现方式中,所述第一能力协商请求与所述第一能力协商应答的交互,所述第二能力协商请求与所述第二能力协商应答的交互,均可不经由所述接入点转发。其它可交互的方式包括:可选地,所述消息的交互可直接由所述第一设备和所述第二设备进行,即所述第一设备直接向所述第二设备发送所述第一能力协商请求,所述第二设备获取所述第一能力协商请求生成第一能力协商应答后,所述第二设备直接向所述第一设备发送所述第一能力协商应答。
在本发明实施例的一种实现方式中,所述第一能力协商请求与所述第一能 力协商应答的交互,所述第二能力协商请求与所述第二能力协商应答的交互,可由所述接入点部分参与。例如所述第一设备经由所述接入点向所述第二设备发送第一能力协商请求,所述第二设备获取所述第一能力协商请求生成第一能力协商应答后,所述第二设备直接向所述第一设备发送所述第一能力协商应答。又例如,所述第一设备直接向所述第二设备发送第一能力协商请求,所述第二设备获取所述第一能力协商请求生成第一能力协商应答后,所述第二设备经由所述接入点向所述第一设备发送所述第一能力协商应答。
对此可能的交互形式,本发明实施例不做限定。
具体地,如图5所示,本发明实施例提供的服务发现方法可包括如下步骤,该方法可以由发现响应方执行。
S201,第二设备接收第一设备经由接入点发送的服务发现请求;所述服务发现请求用于向所述第二设备查询所述第一设备请求查询的服务;
具体地,本发明实施例中,所述第一设备为发现查询方,所述第二设备为发现响应方。所述第一设备与所述接入点连接,所述第二设备与所述接入点连接。
所述第一设备向所述第二设备发送服务发现请求,所述服务发现请求可包含所述第一设备请求查询的服务的信息,所述服务发现请求用于向所述第二设备查询所述第一设备请求查询的服务。所述第二设备接收所述服务发现请求后,获取所述第一设备请求查询的服务的信息。可选地,所述服务发现请求为数据帧格式,包括帧头和帧体。所述数据帧的帧头所包含的地址信息遵循上述提及的规则,可根据数据帧的发送方和接收方的不同而调整。在所述数据帧为设备 向接入点发送的数据帧时,所述数据帧的帧头地址依次为:所述A1为直接接收者地址,所述A2为直接发送者地址,所述A3为最终目标地址;在所述数据帧为接入点向设备发送的数据帧时,所述A1为直接接收者地址,同时也刚好是目标地址,所述A2为直接发送者地址,所述A3为最初源地址。例如,所述第二设备接收的接入点转发的由所述第一设备发送的数据帧的帧头地址信息可依次包括:所述第二设备的地址信息;所述接入点的地址信息;所述第一设备的地址信息。
可选地,所述服务发现请求可以为Probe Request。在所述服务发现请求为Probe Request时,所述服务发现应答为Probe Response。所述Probe Response为所述第二设备对所述第一设备发送的Probe Request的响应。
可选地,所述服务发现请求可以为Service Discovery Request。在所述服务发现请求为Service Discovery Request时,所述服务发现应答为Service Discovery Response。所述Service Discovery Response为所述第二设备对所述第一设备发送的Service Discovery Request的响应。
S202,所述第二设备向所述第一设备发送服务发现应答;所述服务发现应答为所述第二设备对所述第一服务发现请求的响应。
具体地,所述第二设备获取所述第一设备请求查询的服务的信息后,在所述第二设备支持所述第一设备请求查询的服务时,所述第二设备生成服务发现应答,可选地,所述服务发现应答可仅包括所述第二设备支持该服务的信息,不涉及服务本身的信息,例如服务的类型、服务的具体内容;可选地,所述服务发现应答可包括所述至少一个第二设备支持的所述第一设备请求查询的服务,其不仅包括第二设备支持该服务的信息,还包括服务本身的信息,例如服 务的类型、服务的具体内容。。
可选地,所述第二设备可不经所述接入点直接向所述第一设备发送服务发现应答。此时,所述服务发现应答为管理帧格式。
可选地,所述第二设备可经由所述接入点向所述第一设备发送服务发现应答;所述服务发现应答为数据帧格式。所述第二设备向所述接入点发送的服务发现应答数据帧的帧头依次包括:所述接入点的地址;所述第二设备的地址;所述第一设备的地址。所述接入点接收所述服务发现应答数据帧后,改变所述服务发现应答数据帧的帧头地址信息,所述更改后的数据帧的帧头地址依次包括:所述第一设备的地址,所述接入点的地址,所述第二设备的地址。
可选地,所述服务发现应答包括所述第二设备的IP地址信息。例如,在所述服务发现请求为Probe Request时,所述管理帧Probe Response包括所述第二设备的IP地址信息,或者包含所述Probe Response的数据帧包括所述第二设备的IP地址信息。或者,在所述服务发现应答为Service Discovery Response时,所述管理帧Service Discovery Response包括所述第二设备的IP地址信息,或者包含所述Service Discovery Response的数据帧包括所述第二设备的IP地址信息。
在本发明实施例中,在多个电子设备均与接入点连接的场景中,不需要电子设备断开与接入点的连接即可实现多个电子设备之间服务发现消息的交互,提高了服务发现效率,继而提高了互通效率。
在本发明的一个实施例中,所述方法还包括:所述第二设备接收所述第一设备发送的第一能力协商请求;所述第二设备向所述第一设备发送第一能力协商应答,所述第一能力协商应答为所述第二设备对所述第一服务发现请求的响 应。具体地,在所述第一设备获取所述第二设备的服务发现应答后,所述第一设备获知所述第二设备是否支持该第一设备请求查询的服务。在所述第二设备支持所述第一设备请求查询的服务的情形时,所述第一设备向所述第二设备发送第一能力协商请求,所述第一能力协商请求可以为provision discovery Request。所述第一设备可经由所述接入点向所述第二设备发送第一能力协商请求,此时所述第一能力协商请求为数据帧格式;或者,所述第一设备也可直接向所述第二设备发送第一能力协商请求,此时所述第一能力协商请求为管理帧格式。
所述第二设备获取所述第一设备发送的第一能力协商请求后,向所述第一设备发送发送第二能力协商应答,所述第一能力协商应答可以为provision discovery Response。可选地,所述第二设备经由所述接入点向所述第一设备发送第一能力协商应答,此时所述第一能力协商应答为数据帧格式;或者,可选地,所述第二设备可直接向所述第一设备发送第一能力协商应答,此时所述第一能力协商应答为管理帧格式。
可选地,所述第一能力协商应答包括所述第二设备的IP地址信息。例如所述管理帧provision discovery Response包括所述第二设备的IP地址信息,或者包含所述provision discovery Response的数据帧包括所述第二设备的IP地址信息。
在本发明的一个实施例中,所述方法还包括:所述第二设备获取用户输入的响应指令,向所述第一设备发送第二能力协商请求;所述第二设备接收所述第一设备发送的第二能力协商应答,所述第二能力协商应答为所述第一设备对所述第二能力协商请求的响应。具体地,所述第二设备获取所述第一设备的第 一能力协商请求,获取所述第一设备的联网需求后,所述第二备生成第一能力协商应答,所述第一能力协商应答用于告知所述第一设备该第二设备已获知所述第一设备的联网需求,但不包含所述第二设备是否同意所述第一设备联网需求的实质信息。在向所述第一设备发送第一能力协商应答(provision discovery Response)后,所述第二设备可将所述第一能力协商请求包含的信息呈现给用户。在获取用户的指令后,所述第二设备可经由所述接入点向所述第一设备发送第二能力协商请求,所述第二能力协商请求可以为Follow-on provision discovery Request,所述第二能力协商请求用于告知所述第一设备,所述第二设备是否同意所述第一设备的联网需求。
可选地,所述第二设备获取用户输入的响应指令,经由所述接入点向所述第一设备发送第二能力协商请求。所述第二设备可将所述管理帧Follow-on provision discovery Request封装成第二能力协商请求数据帧,并按照前述的数据帧帧头设置规则经由所述接入点向所述第一设备发送第二能力协商请求数据帧。或者,可选地,所述第二设备也可不经所述接入点,直接向所述第一设备发送Follow-on provision discovery Request管理帧。
所述第一设备获取所述第二设备发送的第二能力协商请求后,生成第二能力协商应答,所述第二能力协商应答可以为Follow-on provision discovery Response,所述第二能力协商应答用于告知所述第二设备,所述第一设备已获知所述第二设备的联网需求信息。所述第一设备可将所述管理帧Follow-on provision discovery Response封装成第二能力协商应答数据帧,并按照前述的数据帧帧头设置规则经由所述接入点向所述第二设备发送;所述第一设备也可不经所述接入点,直接向所述第二设备发送管理帧Follow-on provision  discovery Response发送。
可选地,所述第二能力协商请求包括所述第二设备的IP地址信息,例如所述管理帧Follow-on provision discovery Request包括所述第二设备的IP地址信息,或者包含所述Follow-on provision discovery Request的数据帧包括所述第二设备的IP地址信息。
具体地,如图6所示,本发明实施例提供的服务发现方法可包括如下步骤,该方法可以由接入点执行。
S301,接入点接收第一设备发送的服务发现请求;所述服务发现请求用于向所述至少一个第二设备查询所述第一设备请求查询的服务;所述接入点与所述至少一个第二设备连接;
具体地,所述接入点参与第一设备与第二设备之间的交互,所述接入点与所述第一设备连接,所述接入点与至少一个第二设备连接。所述第一设备与所述第二设备的交互信息中,经由所述接入点转发的交互信息可为数据帧格式。所述数据帧格式的交互信息包括帧头和帧体部分,所述帧头所包含的地址信息遵循上述规则,本发明实施例在此不再赘述。
可选地,所述服务发现请求可以为Probe Request。所述第一设备将所述Probe Request封装为数据帧,所述接入点接收所述第一设备发送的包含Probe Request的数据帧。
可选地,所述服务发现请求可以为Service Discovery Request。所述第一设备将所述Service Discovery Request封装为数据帧,所述接入点接收所述第一设备发送的包含Service Discovery Request的数据帧。
S302,所述接入点向所述至少一个第二设备发送所述服务发现请求;
可选地,所述服务发现请求为数据帧格式,所述第一设备经由接入点单播发送所述服务发现请求。在所述接入点接收所述第一设备发送的服务发现请求后,所述接入点更改所述服务发现请求数据帧的帧头所包含的地址信息,向所述至少一个第二设备发送所述更改后的数据帧。所述接入点接收的所述第一设备发送的数据帧的帧头地址信息可依次包括:所述接入点的地址信息;所述第一设备的地址信息;所述第二设备的地址信息。所述接入点修改所述数据帧的帧头地址,所述接入点发送的修改后的服务发现请求数据帧的帧头地址信息依次包括:所述第二设备的地址信息;所述接入点的地址信息,所述第一设备的地址信息。所述接入点将所述修改后的数据帧发送至所述至少一个第二设备。
可选地,所述服务发现请求为数据帧格式,所述接入点广播所述服务发现请求。具体地,所述第一设备经由所述接入点广播服务发现请求。此时,所述接入点接收的所述第一设备发送的数据帧的帧头地址信息可依次包括:所述接入点的地址信息;所述第一设备的地址信息;广播地址。所述接入点修改所述数据帧的帧头地址,所述接入点广播的修改后的服务发现请求数据帧的帧头地址信息依次包括;所述广播地址;所述计入点的地址;所述第一设备的地址。所述接入点广播所述修改后的数据帧。
S303,所述接入点接收所述第二设备发送的服务发现应答,所述服务发现应答为所述第二设备对所述服务发现请求的响应;
在所述第二设备支持所述第一设备请求查询的服务时,所述第二设备生成服务发现应答,可选地,所述服务发现应答可仅包括所述第二设备支持该服务的信息,不涉及服务本身的信息,例如服务的类型、服务的具体内容;可选地, 所述服务发现应答可包括所述至少一个第二设备支持的所述第一设备请求查询的服务,其不仅包括第二设备支持该服务的信息,还包括服务本身的信息,例如服务的类型、服务的具体内容。
可选地,所述服务发现请求为Probe Request,所述服务发现应答为Probe Response。所述Probe Response为所述第二设备对所述第一设备发送的Probe Request的响应。可选地,所述服务发现应答包括所述第二设备的IP地址信息,所述Probe Response包括所述第二设备的IP地址信息。
可选地,所述服务发现请求为Service Discovery Request,所述服务发现应答为Service Discovery Response。所述Service Discovery Response为所述第二设备对所述第一设备发送的Service Discovery Request的响应。可选地,所述服务发现应答包括所述第二设备的IP地址信息,所述Service Discovery Response包括所述第二设备的IP地址信息。
S304,所述接入点向所述第一设备发送所述服务发现应答。
具体地,在所述接入点获取所述第二设备的服务发现应答后,所述接入点更改所述服务发现应答数据帧的帧头地址包含的地址信息。所述更改后的服务发现应答的数据帧的帧头包括的地址信息依次为:所述第一设备的地址信息;所述接入点的地址信息;所述第二设备的地址信息。所述接入点向所述第一设备发送所述服务发现应答,所述第一设备获取所述服务发现应答后,获取所述第二设备是否支持所述服务发现请求包含的服务信息,并获知所述至少一个第二设备支持的服务。
在本发明实施例中,在多个电子设备均与接入点连接的场景中,不需要电子设备断开与接入点的连接即可实现多个电子设备之间服务发现消息的交互, 提高了服务发现效率,继而提高了互通效率。
在本发明的一个实施例中,所述服务发现应答包括所述第二设备的MAC地址;在所述接入点向所述第一设备发送所述服务发现应答后,所述方法还包括:所述接入点接收所述第一设备发送的查询请求,所述查询请求包括所述第二设备的MAC地址,所述查询请求用于查询所述第二设备的IP地址信息;所述接入点向所述第一设备发送查询应答;所述查询应答包括所述第二设备的IP地址信息。在所述第一设备与所述第二设备建立ASP会话前,所述第一设备可通过反向地址转换协议(Reverse Address Resolution Protocol,RARP)获取获取所述第二设备的IP地址信息。具体地,所述第一设备获取所述第二设备的Mac地址信息。所述第一设备向所述接入点发送地址查询请求,请求根据所述第二设备的Mac地址获取所述第二设备的IP地址信息,所述地址查询请求包括所述第二设备的MAC地址。所述接入点存储有所述第二设备的Mac地址、IP地址以及两者之间的映射关系。所述接入点接收所述第一设备发送的地址查询请求后,获取所述第二设备的MAC地址,所述接入点根据所述第二设备的MAC地址获取所述第二设备的IP地址。所述接入点生成查询应答,并向所述第一设备发送所述查询应答,所述查询应答包括所述第二设备的IP地址信息。
在本发明的一个实施例中,所述方法还包括:所述接入点接收所述第一设备发送的第一能力协商请求;所述第一能力协商应答为数据帧格式;所述接入点向所述第二设备发送所述第一能力协商请求;所述接入点接收所述第二设备发送的第一能力协商应答,所述能力协商应答为所述第二设备对所述能力协商请求的响应;所述第一能力协商应答为数据帧格式;所述接入点向所述第一设备发送所述第一能力协商应答。所述第一能力协商请求可以为provision  discovery Request,所述第一设备将所述管理帧provision discovery Request封装成第一能力协商请求数据帧,向所述接入点发送所述第一能力协商请求数据帧。所述接入点接收所述第一能力协商请求数据帧后,更改所述数据帧的帧头地址,更改后的数据帧的帧头包含的地址信息可依次为:所述第二设备的地址信息;所述接入点的地址信息;所述第一设备的地址信息。所述接入点将帧头地址信息更改后的能力协商请求发送至所述第二设备。所述第二设备接收所述第一能力协商请求后,获取所述provision discovery Request,解析获得所述第一设备的联网需求,并生成第一能力协商应答。所述第一能力协商应答可以为provision discovery Response。所述第二设备将所述provision discovery Response封装成第一能力协商应答数据帧,向所述接入点发送所述第一能力协商应答数据帧。所述接入点接收所述第一能力协商应答数据帧后,更改所述数据帧的帧头地址,并将所述帧头地址信息更改后的能力协商请求发送至所述第一设备。
可选地,所述第一能力协商应答包括所述第二设备的IP地址信息,即包含所述provision discovery Response的第一能力协商应答数据帧包含所述第二设备的IP地址信息。
进一步地,在本发明实施例中,所述方法还包括:所述接入点接收所述第二设备发送的第二能力协商请求;所述第二能力协商请求为数据帧格式;所述接入点向所述第一设备发送所述第二能力协商请求;所述接入点接收所述第一设备发送的第二能力协商应答,所述第二能力协商应答为所述第二设备对所述第二能力协商请求的响应;所述第二能力协商应答为数据帧格式;所述接入点向所述第二设备发送所述第二能力协商应答。
具体地,所述第二设备获取所述第一设备的第一能力协商请求,获取所述第一设备的联网需求后,所述第二备生成第一能力协商应答,所述第一能力协商应答用于告知所述第一设备该第二设备已获知所述第一设备的联网需求,但不包含所述第二设备是否同意所述第一设备联网需求的实质信息。所述第二设备通过第二能力协商消息的交互实现所述第一设备和所述第二设备联网需求的确认。所述第二能力协商请求可以为Follow-on provision discovery Request,所述第二设备可将所述Follow-on provision discovery Request封装成第二能力协商请求数据帧,所述接入点接收所述第二设备发送的所述第二能力协商请求数据帧。所述接入点按照前述的数据帧帧头设置规则更改所述第二能力协商请求数据帧的帧头所包含的地址信息,并将所述帧头地址信息更改后的第二能力协商请求发送至所述第一设备。所述第一设备获取第二能力协商请求后,生成第二能力协商应答。所述第一设备将Follow-on provision discovery Response封装成第二能力协商应答数据帧,并按照前述的数据帧帧头设置规则向所述接入点发送所述第二能力协商应答数据帧。所述接入点获取所述第二能力协商应答数据帧后,按照前述的数据帧帧头设置规则更改所述第二能力协商应答数据帧的帧头所包含的地址信息,并将所述更改后额第二能力协商应答数据帧发送至所述第二设备。
可选地,所述第二能力协商请求包括所述第二设备的IP地址信息,即所述包括Follow-on provision discovery Response的数据帧包括所述第二设备的IP地址信息。
请参阅图7,图7为本发明实施例提供的一种电子设备的结构示意图。电子 设备,也可称之为用户设备(UE,User Equipment),移动用户设备等,可以经无线接入网(例如,RAN,Radio Access Network)与一个或多个核心网进行通信,如移动电话(或称为“蜂窝”电话)和计算机,例如,可以是便携式、袖珍式、手持式、计算机内置的或者车载的移动装置,它们与无线接入网交换语音和/或数据。所述电子设备可以是智能手机、平板电脑(Tablet Personal Computer)、个人数字助理(personal digital assistant,简称PDA)、移动上网装置(Mobile Internet Device,MID)或可穿戴式设备(Wearable Device)等。本发明实施例提供的电子设备包括发送单元701和接收单元702,所述发送单元701与所述接收单元702连接。具体地,
所述发送单元701,用于经接入点向与所述接入点连接的至少一个第二设备发送服务发现请求;所述服务发现请求用于向所述至少一个第二设备查询所述第一设备请求查询的服务。具体地,所述第一设备与所述接入点连接,所述接入点与至少两个设备连接。除所述第一设备外,所述接入点至少与至少一个第二设备连接。可选地,所述发送单元701发送的服务发现请求可以为Probe Request。可选地,所述发送单元701发送的服务发现请求可以为Service Discovery Request。可选地,所述发送单元701可经由接入点发送两个服务发现请求,其中,第一服务发现请求可以为Probe Request,第二服务发现请求可以为Service Discovery Request。
接收单元702,用于接收所述至少一个第二设备发送的服务发现应答,所述服务发现应答为所述至少一个第二设备对所述服务发现请求的响应。所述第二设备接收所述接入点发送的服务发现请求后,解析所述服务发现请求,获取所述第一设备的服务信息获取需求,在所述第二设备支持所述第一设备请求查 询的服务时,所述第二设备生成服务发现应答,可选地,所述服务发现应答可仅包括所述第二设备支持该服务的信息,不涉及服务本身的信息,例如服务的类型、服务的具体内容;可选地,所述服务发现应答可包括所述至少一个第二设备支持的所述第一设备请求查询的服务,其不仅包括第二设备支持该服务的信息,还包括服务本身的信息,例如服务的类型、服务的具体内容。所述接收单元702接收所述服务发现应答,获取服务应答包括的所述服务的具体信息。可选地,在所述发送单元701发送的服务发现请求为Probe Request时,所述接收单元702接收的服务发现应答为Probe Response,所述Probe Response为所述第二设备对所述第一设备发送的Probe Request的响应。可选地,在所述发送单元701发送的服务发现请求为Service Discovery Request时,所述服务发现应答为Service Discovery Response。所述Service Discovery Response为所述第二设备对所述第一设备发送的Service Discovery Request的响应。
在本发明实施例中,在多个电子设备均与接入点连接的场景中,不需要电子设备断开与接入点的连接即可实现多个电子设备之间服务发现消息的交互,提高了服务发现效率,继而提高了互通效率。
在本发明的一个实施例中,所述服务发现请求为数据帧格式;所述发送单元具体用于,经接入点广播服务发现请求;其中,所述发送单元向所述接入点发送的服务发现请求数据帧的帧头依次包括:所述接入点的地址;所述第一设备的地址;广播地址;所述发送单元经接入点广播的服务发现请求数据帧的帧头依次包括:所述广播地址;所述接入点的地址;所述第一设备的地址。所述数据帧格式包括帧头和帧体,所述数据帧的帧头包括服务发现请求的地址信息。所述接入点接收所述发送单元发送的服务发现请求数据帧后,更改所述数据帧 帧头的地址格式,将原先数据帧帧头所包括的地址信息(依次为:所述接入点的地址;所述第一设备的地址;广播地址)更改为接入点广播服务发现请求数据帧的帧头所包括的地址信息(依次为:所述广播地址;所述接入点的地址;所述第一设备的地址)。所述接入点广播帧头地址更改后的服务发现请求数据帧。
在本发明的一个实施例中,所述服务发现请求为数据帧格式;所述发送单元具体用于,经接入点单播发送服务发现请求;所述发送单元向所述接入点发送的服务发现请求数据帧的帧头依次包括:所述接入点的地址;所述第一设备的地址;所述第二设备的地址;所述发送单元经接入点单播发送的服务发现请求数据帧的帧头依次包括:所述第二设备的地址;所述接入点的地址;所述第一设备的地址。所述数据帧格式包括帧头和帧体,所述数据帧的帧头包括服务发现请求的地址信息。所述接入点接收所述发送单元发送的服务发现请求数据帧后,更改所述数据帧帧头的地址格式,将原先数据帧帧头所包括的地址信息(依次为:所述接入点的地址;所述第一设备的地址;所述第二设备的地址)更改为接入点广播服务发现请求数据帧的帧头所包括的地址信息(依次为:所述第二设备的地址;所述接入点的地址;所述第一设备的地址)。所述接入点单播发送帧头地址更改后的服务发现请求数据帧。
在本发明的上述实施例中,所述发送单元发送的服务发现请求数据帧的帧体部分包括:探测请求帧的帧体部分;或者,服务发现请求帧的帧体部分。具体地,所述服务发现请求数据帧包括帧头和帧体。所述探测请求帧和所述服务发现请求帧均为管理帧,所述管理帧同样包括帧头和帧体。所述探测请求帧为Probe Request,所述服务发现请求帧为service discovery Request。所述服 务发现请求数据帧的帧体部分可包括所述探测请求帧的帧头和帧体,也可以只包括所述探测请求帧的帧体部分;同样,所述服务发现请求数据帧的帧体部分可包括所述服务发现请求帧的帧头和帧体,也可以只包括所述服务发现请求帧的帧体部分。
在本发明的上述实施例中,所述接收单元具体用于,接收所述至少一个第二设备经由所述接入点发送的服务发现应答,所述服务发现应答为数据帧格式。具体地,第二设备接收所述服务发现请求后,可响应所述服务发现请求,向第一设备发送服务发现应答。所述第二设备可经由接入点向所述第一设备发送服务发现应答,所述服务发现应答为数据帧格式,其帧头格式可参照上述规则。所述第二设备也可不经接入点直接向第一设备发送服务发现应答,此时所述服务发现应答为管理帧。
在本发明的上述实施例中,所述接收单元接收的服务发现应答包括所述第二设备的IP地址信息。
在本发明的上述实施例中,所述服务发现应答包括所述第二设备的MAC地址;所述发送单元还用于,在所述接收单元接收所述至少一个第二设备发送的服务发现应答后,向反向地址转换协议服务器发送查询请求;所述查询请求包括所述第二设备的Mac地址;所述查询请求用于查询所述第二设备的IP地址信息;所述接收单元还用于,接收反向地址转换协议服务器发送的查询应答;所述查询应答包括所述第二设备的IP地址信息。具体地,所述反向地址转换协议服务器存储有所述第二设备的Mac地址、IP地址以及两者之间的映射关系。所述第一设备可获取服务发现应答所包括的第二设备的Mac地址。所述第一设备获取所述第二设备的Mac地址后,向所述反向地址转换协议服务器发送查询请 求,获取所述第二设备的IP地址。在一种可能的实现方式中,所述反向地址转换协议服务器与接入点可为同一设备,所述第一设备也可向所述接入点发送查询请求,获取所述第二设备的IP地址信息。
请参阅图8,图8为本发明实施例提供的一种电子设备的结构示意图。本发明实施例提供的电子设备包括发送器801和接收器802,所述发送器801和所述接收器802连接。具体地,
所述发送器801,用于经接入点向与所述接入点连接的至少一个第二设备发送服务发现请求;所述服务发现请求用于向所述至少一个第二设备查询所述第一设备请求查询的服务。具体地,所述第一设备与所述接入点连接,所述接入点与至少两个设备连接。除所述第一设备外,所述接入点至少与至少一个第二设备连接。可选地,发送器801发送的服务发现请求可以为Probe Request。可选地,发送器801发送的服务发现请求可以为Service Discovery Request。可选地,发送器801可经由接入点发送两个服务发现请求,其中,第一服务发现请求可以为Probe Request,第二服务发现请求可以为Service Discovery Request。
所述接收器802,用于接收所述至少一个第二设备发送的服务发现应答,所述服务发现应答为所述至少一个第二设备对所述服务发现请求的响应。所述第二设备接收所述接入点发送的服务发现请求后,解析所述服务发现请求,在所述第二设备支持所述第一设备请求查询的服务时,所述第二设备生成服务发现应答。可选地,所述服务发现应答可仅包括所述第二设备支持该服务的信息,不涉及服务本身的信息,例如服务的类型、服务的具体内容;可选地,所述服 务发现应答可包括所述至少一个第二设备支持的所述第一设备请求查询的服务,其不仅包括第二设备支持该服务的信息,还包括服务本身的信息,例如服务的类型、服务的具体内容。所述接收器802接收所述服务发现应答,获取服务应答包括的所述服务的具体信息。可选地,在所述接收器802发送的服务发现请求为Probe Request时,所述接收器802接收的服务发现应答为Probe Response,所述Probe Response为所述第二设备对所述第一设备发送的Probe Request的响应。可选地,在所述发送单元701发送的服务发现请求为Service Discovery Request时,所述服务发现应答为Service Discovery Response。所述Service Discovery Response为所述第二设备对所述第一设备发送的Service Discovery Request的响应。
在本发明实施例中,在多个电子设备均与接入点连接的场景中,不需要电子设备断开与接入点的连接即可实现多个电子设备之间服务发现消息的交互,提高了服务发现效率,继而提高了互通效率。
在本发明的一个实施例中,所述服务发现请求为数据帧格式;所述发送器具体用于,经接入点广播服务发现请求;其中,所述发送器向所述接入点发送的服务发现请求数据帧的帧头依次包括:所述接入点的地址;所述第一设备的地址;广播地址;所述发送器发送的经由接入点广播的服务发现请求数据帧的帧头依次包括:所述广播地址;所述接入点的地址;所述第一设备的地址。所述数据帧格式包括帧头和帧体,所述数据帧的帧头包括服务发现请求的地址信息。所述接入点接收所述发送单元发送的服务发现请求数据帧后,更改所述数据帧帧头的地址格式,将原先数据帧帧头所包括的地址信息(依次为:所述接入点的地址;所述第一设备的地址;广播地址)更改为接入点广播服务发现请 求数据帧的帧头所包括的地址信息(依次为:所述广播地址;所述接入点的地址;所述第一设备的地址)。所述接入点广播帧头地址更改后的服务发现请求数据帧。
在本发明的一个实施例中,所述服务发现请求为数据帧格式;所述发送器具体用于,经接入点单播发送服务发现请求;所述发送器向所述接入点发送的服务发现请求数据帧的帧头依次包括:所述接入点的地址;所述第一设备的地址;所述第二设备的地址;所述发送器发送的经由接入点单播发送的服务发现请求数据帧的帧头依次包括:所述第二设备的地址;所述接入点的地址;所述第一设备的地址。所述数据帧格式包括帧头和帧体,所述数据帧的帧头包括服务发现请求的地址信息。所述接入点接收所述发送单元发送的服务发现请求数据帧后,更改所述数据帧帧头的地址格式,将原先数据帧帧头所包括的地址信息(依次为:所述接入点的地址;所述第一设备的地址;所述第二设备的地址)更改为接入点广播服务发现请求数据帧的帧头所包括的地址信息(依次为:所述第二设备的地址;所述接入点的地址;所述第一设备的地址)。所述接入点单播发送帧头地址更改后的服务发现请求数据帧。
在本发明的上述实施例中,所述发送器发送的服务发现请求数据帧的帧体部分包括:探测请求帧的帧体部分;或者,服务发现请求帧的帧体部分。具体地,所述服务发现请求数据帧包括帧头和帧体。所述探测请求帧和所述服务发现请求帧均为管理帧,所述管理帧同样包括帧头和帧体。所述探测请求帧为Probe Request,所述服务发现请求帧为service discovery Request。所述服务发现请求数据帧的帧体部分可包括所述探测请求帧的帧头和帧体,也可以只包括所述探测请求帧的帧体部分;同样,所述服务发现请求数据帧的帧体部分 可包括所述服务发现请求帧的帧头和帧体,也可以只包括所述服务发现请求帧的帧体部分。
在本发明的上述实施例中,所述接收器具体用于,接收所述至少一个第二设备经由所述接入点发送的服务发现应答,所述服务发现应答为数据帧格式。具体地,第二设备接收所述服务发现请求后,可响应所述服务发现请求,向第一设备发送服务发现应答。所述第二设备可经由接入点向所述第一设备发送服务发现应答,所述服务发现应答为数据帧格式,其帧头格式可参照上述规则。所述第二设备也可不经接入点直接向第一设备发送服务发现应答,此时所述服务发现应答为管理帧。
在本发明的上述实施例中,所述服务发现应答包括所述第二设备的IP地址信息。
在本发明的上述实施例中,所述服务发现应答包括所述第二设备的MAC地址;所述发送器还用于,在所述接收器接收所述至少一个第二设备发送的服务发现应答后,向反向地址转换协议服务器发送查询请求;所述查询请求包括所述第二设备的Mac地址;所述查询请求用于查询所述第二设备的IP地址信息;所述接收器还用于,接收反向地址转换协议服务器发送的查询应答;所述查询应答包括所述第二设备的IP地址信息。具体地,所述反向地址转换协议服务器存储有所述第二设备的Mac地址、IP地址以及两者之间的映射关系。所述第一设备可获取服务发现应答所包括的第二设备的Mac地址。所述第一设备获取所述第二设备的Mac地址后,向所述反向地址转换协议服务器发送查询请求,获取所述第二设备的IP地址。在一种可能的实现方式中,所述反向地址转换协议服务器与接入点可为同一设备,所述第一设备也可向所述接入点发送查询请求, 获取所述第二设备的IP地址信息。
需要说明的是,在本发明的上述实施例中,前述相同或相应的技术特征可相互借鉴。本发明实施例可包括上述技术特征的各种组合。
综上所述,以上实施例仅用以说明本发明的技术方案,而非对其限制;尽管参照上述实施例对本发明进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对上述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本发明各实施例技术方案的精神和范围。

Claims (30)

  1. 一种服务发现的方法,其特征在于,所述方法包括:
    第一设备经接入点向与所述接入点连接的至少一个第二设备发送服务发现请求;所述服务发现请求用于向所述至少一个第二设备查询所述第一设备请求查询的服务;
    所述第一设备接收所述至少一个第二设备发送的服务发现应答,所述服务发现应答为所述至少一个第二设备对所述服务发现请求的响应。
  2. 根据权利要求1所述的方法,其特征在于,所述服务发现请求为数据帧格式;所述第一设备经接入点向与所述接入点连接的至少一个第二设备发送服务发现请求,包括:第一设备经接入点广播服务发现请求;
    其中,所述第一设备向所述接入点发送的服务发现请求数据帧的帧头依次包括:所述接入点的地址;所述第一设备的地址;广播地址;
    所述第一设备经接入点广播的服务发现请求数据帧的帧头依次包括:所述广播地址;所述接入点的地址;所述第一设备的地址。
  3. 根据权利要求1所述的方法,其特征在于,所述服务发现请求为数据帧格式;
    所述第一设备经接入点向与所述接入点连接的至少一个第二设备发送服务发现请求,包括:第一设备经接入点单播发送服务发现请求;
    所述第一设备向所述接入点发送的服务发现请求数据帧的帧头依次包括:所述接入点的地址;所述第一设备的地址;所述第二设备的地址;
    所述第一设备经所述接入点发送的服务发现请求数据帧的帧头依次包括:所述第二设备的地址;所述接入点的地址;所述第一设备的地址。
  4. 根据权利要求2或3所述的方法,其特征在于,所述服务发现请求数据帧的帧体部分包括:探测请求帧的帧体部分;或者,服务发现请求帧的帧体部分。
  5. 根据权利要求1-4任一所述的方法,其特征在于,所述第一设备接收所述至少一个第二设备发送的服务发现应答,包括:
    所述第一设备接收所述至少一个第二设备经由所述接入点发送的服务发现应答,所述服务发现应答为数据帧格式。
  6. 根据权利要求1-5任一所述的方法,其特征在于,所述服务发现应答包括所述第二设备的IP地址信息。
  7. 根据权利要求1-5任一所述的方法,其特征在于,所述服务发现应答包括所述第二设备的MAC地址;在所述第一设备接收所述至少一个第二设备发送的服务发现应答后,所述方法还包括:
    所述第一设备向反向地址转换协议服务器发送查询请求;所述查询请求包括所述第二设备的Mac地址;所述查询请求用于查询所述第二设备的IP地址信息;
    所述第一设备接收反向地址转换协议服务器发送的查询应答;所述查询应答包括所述第二设备的IP地址信息。
  8. 一种服务发现方法,其特征在于,所述方法包括:
    第二设备接收第一设备经由接入点发送的服务发现请求;所述服务发现请求用于向所述第二设备查询所述第一设备请求查询的服务;
    所述第二设备向所述第一设备发送服务发现应答;所述服务发现应答为所述第二设备对所述第一服务发现请求的响应。
  9. 根据权利要求8所述的方法,其特征在于,所述服务发现请求为数据帧格式。
  10. 根据权利要求8或9所述的方法,其特征在于,所述第二设备向所述第一设备发送服务发现应答,包括:
    所述第二设备经由所述接入点向所述第一设备发送服务发现应答;所述服务发现应答为数据帧格式;其中,
    所述第二设备向所述接入点发送的服务发现应答数据帧的帧头依次包括:所述接入点的地址;所述第二设备的地址;所述第一设备的地址;
    所述第二设备经接入点发送的服务发现应答数据帧的帧头依次包括:所述第一设备的地址;所述接入点的地址;所述第二设备的地址。
  11. 根据权利要求8-10任一所述的方法,其特征在于,所述服务发现应答包括所述第二设备的IP地址信息。
  12. 一种服务发现方法,其特征在于,所述方法包括:
    接入点接收第一设备发送的服务发现请求;所述服务发现请求用于向所述至少一个第二设备查询所述第一设备请求查询的服务;所述接入点与所述至少一个第二设备连接;
    所述接入点向所述至少一个第二设备发送所述服务发现请求;
    所述接入点接收所述至少一个第二设备发送的服务发现应答,所述服务发现应答为所述第二设备对所述服务发现请求的响应;
    所述接入点向所述第一设备发送所述服务发现应答。
  13. 根据权利要求12所述的方法,其特征在于,所述服务发现请求为数据帧格式;所述接入点向所述至少一个第二设备发送所述服务发现请求,包括: 所述接入点广播所述服务发现请求;其中,
    所述接入点接收的所述服务发现请求数据帧的帧头依次包括:所述接入点的地址;所述第一设备的地址;广播地址。
    所述接入点广播的所述服务发现请求数据帧的帧头依次包括:所述广播地址;所述接入点的地址;所述第一设备的地址。
  14. 根据权利要求12所述的方法,其特征在于,所述服务发现请求为数据帧格式;
    所述接入点接收的所述服务发现请求数据帧的帧头依次包括:所述接入点的地址;所述第一设备的地址;所述第二设备的地址。
    所述接入点发送的所述服务发现请求数据帧的帧头依次包括:所述第二设备的地址;所述接入点的地址;所述第一设备的地址。
  15. 根据权利要求12-14任一所述的方法,其特征在于,所述服务发现应答包括所述第二设备的IP地址信息。
  16. 根据权利要求12-14任一所述的方法,其特征在于,所述服务发现应答包括所述第二设备的MAC地址;在所述接入点向所述第一设备发送所述服务发现应答后,所述方法还包括:
    所述接入点接收所述第一设备发送的查询请求,所述查询请求包括所述第二设备的MAC地址,所述查询请求用于查询所述第二设备的IP地址信息;
    所述接入点向所述第一设备发送查询应答;所述查询应答包括所述第二设备的IP地址信息。
  17. 一种电子设备,其特征在于,所述电子设备包括:
    发送单元,用于经接入点向与所述接入点连接的至少一个第二设备发送服 务发现请求;所述服务发现请求用于向所述至少一个第二设备查询所述第一设备请求查询的服务;
    接收单元,用于接收所述至少一个第二设备发送的服务发现应答,所述服务发现应答为所述至少一个第二设备对所述服务发现请求的响应。
  18. 根据权利要求17所述的电子设备,其特征在于,所述服务发现请求为数据帧格式;所述发送单元具体用于,经接入点广播服务发现请求;其中,
    所述发送单元向所述接入点发送的服务发现请求数据帧的帧头依次包括:所述接入点的地址;所述第一设备的地址;广播地址;
    所述发送单元经接入点广播的服务发现请求数据帧的帧头依次包括:所述广播地址;所述接入点的地址;所述第一设备的地址。
  19. 根据权利要求17所述的电子设备,其特征在于,所述服务发现请求为数据帧格式;所述发送单元具体用于,经接入点单播发送服务发现请求;
    所述发送单元向所述接入点发送的服务发现请求数据帧的帧头依次包括:所述接入点的地址;所述第一设备的地址;所述第二设备的地址;
    所述发送单元经接入点单播发送的服务发现请求数据帧的帧头依次包括:所述第二设备的地址;所述接入点的地址;所述第一设备的地址。
  20. 根据权利要求18或19所述的电子设备,其特征在于,所述发送单元发送的服务发现请求数据帧的帧体部分包括:探测请求帧的帧体部分;或者,服务发现请求帧的帧体部分。
  21. 根据权利要求17-20任一所述的电子设备,其特征在于,所述接收单元具体用于,接收所述至少一个第二设备经由所述接入点发送的服务发现应答,所述服务发现应答为数据帧格式。
  22. 根据权利要求17-21任一所述的电子设备,其特征在于,所述接收单元接收的服务发现应答包括所述第二设备的IP地址信息。
  23. 根据权利要求17-21任一所述的电子设备,其特征在于,所述服务发现应答包括所述第二设备的MAC地址;
    所述发送单元还用于,在所述接收单元接收所述至少一个第二设备发送的服务发现应答后,向反向地址转换协议服务器发送查询请求;所述查询请求包括所述第二设备的Mac地址;所述查询请求用于查询所述第二设备的IP地址信息;
    所述接收单元还用于,接收反向地址转换协议服务器发送的查询应答;所述查询应答包括所述第二设备的IP地址信息。
  24. 一种电子设备,其特征在于,所述电子设备包括:
    发送器,用于经接入点向与所述接入点连接的至少一个第二设备发送服务发现请求;所述服务发现请求用于向所述至少一个第二设备查询所述第一设备请求查询的服务;
    接收器,用于接收所述至少一个第二设备发送的服务发现应答,所述服务发现应答为所述至少一个第二设备对所述服务发现请求的响应。
  25. 根据权利要求24所述的电子设备,其特征在于,所述服务发现请求为数据帧格式;所述发送器具体用于,经接入点广播服务发现请求;其中,
    所述发送器向所述接入点发送的服务发现请求数据帧的帧头依次包括:所述接入点的地址;所述第一设备的地址;广播地址;
    所述发送器发送的经由接入点广播的服务发现请求数据帧的帧头依次包括:所述广播地址;所述接入点的地址;所述第一设备的地址。
  26. 根据权利要求24所述的电子设备,其特征在于,所述服务发现请求为数据帧格式;所述发送器具体用于,经接入点单播发送服务发现请求;
    所述发送器向所述接入点发送的服务发现请求数据帧的帧头依次包括:所述接入点的地址;所述第一设备的地址;所述第二设备的地址;
    所述发送器发送的经由接入点单播发送的服务发现请求数据帧的帧头依次包括:所述第二设备的地址;所述接入点的地址;所述第一设备的地址。
  27. 根据权利要求25或26所述的电子设备,其特征在于,所述发送器发送的服务发现请求数据帧的帧体部分包括:探测请求帧的帧体部分;或者,服务发现请求帧的帧体部分。
  28. 根据权利要求24-27任一所述的电子设备,其特征在于,所述接收器具体用于,接收所述至少一个第二设备经由所述接入点发送的服务发现应答,所述服务发现应答为数据帧格式。
  29. 根据权利要求24-28任一所述的电子设备,其特征在于,所述服务发现应答包括所述第二设备的IP地址信息。
  30. 根据权利要求24-28任一所述的电子设备,其特征在于,所述服务发现应答包括所述第二设备的MAC地址;
    所述发送器还用于,在所述接收器接收所述至少一个第二设备发送的服务发现应答后,向反向地址转换协议服务器发送查询请求;所述查询请求包括所述第二设备的Mac地址;所述查询请求用于查询所述第二设备的IP地址信息;
    所述接收器还用于,接收反向地址转换协议服务器发送的查询应答;所述查询应答包括所述第二设备的IP地址信息。
PCT/CN2015/076983 2014-04-26 2015-04-20 一种服务发现的方法及电子设备 WO2015161767A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
EP15783107.4A EP3128718B1 (en) 2014-04-26 2015-04-20 Service discovery method and device
US15/306,634 US20170048788A1 (en) 2014-04-26 2015-04-20 Service Discovery Method and Electronic Device

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201410180491.2 2014-04-26
CN201410180491.2A CN105100137B (zh) 2014-04-26 2014-04-26 一种服务发现的方法及电子设备

Publications (1)

Publication Number Publication Date
WO2015161767A1 true WO2015161767A1 (zh) 2015-10-29

Family

ID=54331744

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2015/076983 WO2015161767A1 (zh) 2014-04-26 2015-04-20 一种服务发现的方法及电子设备

Country Status (4)

Country Link
US (1) US20170048788A1 (zh)
EP (1) EP3128718B1 (zh)
CN (1) CN105100137B (zh)
WO (1) WO2015161767A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108464041A (zh) * 2016-01-15 2018-08-28 高通股份有限公司 基于请求寻址或请求信道的调节响应

Families Citing this family (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10368232B2 (en) * 2015-08-05 2019-07-30 Qualcomm Incorporated Methods for connection capability exchange
US10084676B2 (en) * 2015-08-18 2018-09-25 International Business Machines Corporation Auditing networking devices
CN109314858B (zh) * 2016-06-22 2022-02-11 索尼公司 无线通信设备和无线通信方法
CN108605051B (zh) * 2016-11-08 2020-06-26 华为技术有限公司 一种服务发现方法及服务发现装置
US11082476B2 (en) * 2016-11-15 2021-08-03 Verizon Media Inc. Computerized system and method for automatically providing networked devices non-native functionality
CN108989372B (zh) * 2017-06-02 2021-04-09 华为技术有限公司 服务发现的方法、注册中心和设备
CN109257793B (zh) * 2017-07-14 2020-12-25 腾讯科技(深圳)有限公司 网络连接方法、装置、设备及存储介质
CN108337671A (zh) * 2018-01-30 2018-07-27 乐鑫信息科技(上海)有限公司 一种mesh网络内设备发现方法
US10568046B1 (en) * 2018-08-01 2020-02-18 Motorola Mobility Llc Homogeneous system determination in a network
CN111245666B (zh) * 2018-11-29 2022-12-06 华为技术有限公司 数据传输方法、装置及系统
US11467815B2 (en) * 2019-01-17 2022-10-11 Vmware, Inc. Package distribution and installation in response to user logon
US10856160B1 (en) 2019-06-19 2020-12-01 Motorola Mobility Llc Performing round trip time ranging using fewer than all addresses of a wireless device
CN113709555B (zh) * 2021-08-27 2023-03-21 联想(北京)有限公司 一种无线视频连接方法、装置以及系统

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101965029A (zh) * 2009-07-21 2011-02-02 华为终端有限公司 支持切换的处理方法、通信装置及通信系统
CN102907125A (zh) * 2009-11-04 2013-01-30 高通股份有限公司 用于无线通信网络中对等方发现的方法与装置
CN103179634A (zh) * 2011-12-21 2013-06-26 株式会社Ntt都科摩 一种伙伴发现和选择方法、装置及系统
CN103298068A (zh) * 2012-02-24 2013-09-11 三星电子株式会社 用于发现在无线通信网络中的装置的方法和设备

Family Cites Families (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006101293A (ja) * 2004-09-30 2006-04-13 Sanyo Electric Co Ltd 通信装置、通信プログラム及び通信方法
US8762543B2 (en) * 2009-12-15 2014-06-24 Intel Corporation Method and apparatus for autonomous peer discovery and enhancing link reliability for wireless peer direct links
US8737370B2 (en) * 2010-05-17 2014-05-27 Qualcomm Incorporated Methods and apparatuses for direct link setup
US8867514B2 (en) * 2012-03-20 2014-10-21 Qualcomm Incorporated System and method of infrastructure service discovery
US9002352B2 (en) * 2012-04-18 2015-04-07 Qualcomm Incorporated System and method of service discovery
KR101727090B1 (ko) * 2012-07-06 2017-04-14 후아웨이 테크놀러지 컴퍼니 리미티드 서비스를 등록 및 발견하는 방법, 기기, 및 시스템
US9654960B2 (en) * 2013-05-31 2017-05-16 Qualcomm Incorporated Server-assisted device-to-device discovery and connection
WO2015111811A1 (ko) * 2014-01-26 2015-07-30 엘지전자 주식회사 무선 통신 시스템에서 디스커버리를 수행하는 방법 및 장치
KR101801591B1 (ko) * 2014-02-07 2017-11-27 엘지전자 주식회사 무선 통신 시스템에서 디스커버리를 수행하는 방법 및 장치
US10080182B2 (en) * 2014-04-02 2018-09-18 Lg Electronics Inc. Method and apparatus for transceiving signal by NAN terminal in wireless communication system

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101965029A (zh) * 2009-07-21 2011-02-02 华为终端有限公司 支持切换的处理方法、通信装置及通信系统
CN102907125A (zh) * 2009-11-04 2013-01-30 高通股份有限公司 用于无线通信网络中对等方发现的方法与装置
CN103179634A (zh) * 2011-12-21 2013-06-26 株式会社Ntt都科摩 一种伙伴发现和选择方法、装置及系统
CN103298068A (zh) * 2012-02-24 2013-09-11 三星电子株式会社 用于发现在无线通信网络中的装置的方法和设备

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108464041A (zh) * 2016-01-15 2018-08-28 高通股份有限公司 基于请求寻址或请求信道的调节响应
CN108464041B (zh) * 2016-01-15 2021-05-28 高通股份有限公司 基于请求寻址或请求信道的调节方法及装置

Also Published As

Publication number Publication date
EP3128718A4 (en) 2017-04-05
CN105100137A (zh) 2015-11-25
CN105100137B (zh) 2019-05-24
US20170048788A1 (en) 2017-02-16
EP3128718B1 (en) 2018-08-29
EP3128718A1 (en) 2017-02-08

Similar Documents

Publication Publication Date Title
WO2015161767A1 (zh) 一种服务发现的方法及电子设备
CA2897007C (en) Method and apparatus for changing services in wireless communication system
AU2013356802B2 (en) Method and device for session initialization in wireless communication system
AU2013338811B2 (en) Method for searching for or advertising service in direct communication system and device for same
US20160127424A1 (en) Method for searching for device in direct communication system and apparatus therefor
AU2013382296B2 (en) Method for peer to peer group formation in direct communication system and device therefor
JP5526236B2 (ja) 無線通信ネットワーク内でのピア発見のための方法および装置
US9699819B2 (en) Method and apparatus for establishing session in wireless communication system
US9980121B2 (en) Method and apparatus for performing discovery in wireless communication system
KR20100042207A (ko) 터널 다이렉트 링크 설정 무선 네트워크에서의 다이렉트 링크 설정 절차
CN106465251B (zh) 利用存储的高层信息的系统和方法
US11310649B2 (en) Method for wireless connection in wireless LAN system and wireless device using same
US10051673B2 (en) Method and apparatus for session initiation in wireless communication system
US10506501B2 (en) Service discovery method and device in wireless communication system
US9980122B2 (en) Method and device for conducting discovery in wireless communication system
WO2014169670A1 (zh) 一种wlan组网方法及系统
US10194381B2 (en) Method and apparatus for performing discovery using MDNS in wireless communication system
US20180077738A1 (en) Method and apparatus for establishing application service platform session in wireless communication system
WO2010088834A1 (zh) 基于Wi-Fi和WiMAX的双模通信方法、设备及系统

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

Country of ref document: EP

Kind code of ref document: A1

WWE Wipo information: entry into national phase

Ref document number: 15306634

Country of ref document: US

NENP Non-entry into the national phase

Ref country code: DE

REEP Request for entry into the european phase

Ref document number: 2015783107

Country of ref document: EP

WWE Wipo information: entry into national phase

Ref document number: 2015783107

Country of ref document: EP

WWE Wipo information: entry into national phase

Ref document number: IDP00201608093

Country of ref document: ID