WO2023246601A1 - 设备发现方法、装置及系统 - Google Patents

设备发现方法、装置及系统 Download PDF

Info

Publication number
WO2023246601A1
WO2023246601A1 PCT/CN2023/100266 CN2023100266W WO2023246601A1 WO 2023246601 A1 WO2023246601 A1 WO 2023246601A1 CN 2023100266 W CN2023100266 W CN 2023100266W WO 2023246601 A1 WO2023246601 A1 WO 2023246601A1
Authority
WO
WIPO (PCT)
Prior art keywords
target
information
request message
characteristic value
connection
Prior art date
Application number
PCT/CN2023/100266
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 华为技术有限公司
Publication of WO2023246601A1 publication Critical patent/WO2023246601A1/zh

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W8/00Network data management
    • H04W8/005Discovery of network devices, e.g. terminals
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W48/00Access restriction; Network selection; Access point selection
    • H04W48/08Access restriction or access information delivery, e.g. discovery data delivery
    • H04W48/10Access restriction or access information delivery, e.g. discovery data delivery using broadcasted information
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W76/00Connection management
    • H04W76/10Connection setup
    • H04W76/14Direct-mode setup
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W8/00Network data management

Definitions

  • the present application relates to the field of communications, and in particular to device discovery methods, devices and systems.
  • distributed networking is the establishment of communication connections between multiple devices through standard Bluetooth, wireless fidelity (WiFi), Ethernet, etc.
  • WiFi wireless fidelity
  • Ethernet an important part of distributed networking is device discovery. The device discovery process can be quickly implemented based on short-range communication technology to establish connections between devices.
  • the current device discovery method is: the first device obtains the connection information of the target device, determines based on the connection information that it cannot directly connect to the target device, and then forwards the remaining devices in the distributed network (for the convenience of description, this application describes it as the second device ) sends a device discovery request message.
  • Each second device responds to the broadcast by connecting back to the first device and establishing a secure channel with the first device.
  • the first device exchanges device information with the corresponding second device through each secure channel.
  • the first device matches the acquired device information of each second device with the connection information (such as device identification) of the target device, and determines the target device from these second devices.
  • the first device obtains the connection address of the target device from the device information fed back by the target device, and establishes a connection with the target device through the connection address.
  • Embodiments of the present application provide a device discovery method, device and system to solve the problem of long time-consuming and high energy consumption in the device discovery process.
  • a device discovery method is provided, which is applied in a system (which can also be described as a distributed cluster in this application).
  • the system includes a first device and at least one second device.
  • the method includes: a first device sending a first request message to at least one second device; wherein the first request message includes a characteristic value of a target device, and the characteristic value of the target device is used by the device that receives the first request message to send the first request message to at least one second device.
  • the characteristic values of the machine are matched with the characteristic values of the target device.
  • the first device receives a response message from the target device.
  • the response message is sent by the target device after successfully matching the characteristic value in the first request message with the characteristic value of the local device; the response message includes the second device information of the target device.
  • the characteristic value is first device information; the first device information includes one or more of a device identification, a device type, a device name, user information logging in to the device, and a service identification.
  • the first device information can be encrypted as a characteristic value.
  • the characteristic value may be obtained by the first device from the electronic tag of the target device or input by the user, and may be part of the device information of the target device, such as the device identification of the target.
  • the second device information may be more detailed information of the target device, such as information other than the information contained in the electronic tag, such as connection information of the target device, etc.
  • the first request message sent by the first device carries the characteristic value of the target device.
  • the device that receives the request message matches the characteristic value of the target device with the characteristic value of the local device, and only the successfully matched target device sends a response message to the first device. Therefore, the first device can be prevented from establishing a connection with a non-target device.
  • the first device needs to exchange device information with it and perform device information matching to determine the target device from these second devices. This process is time-consuming. longer. The method provided by this application can reduce the time-consuming device discovery.
  • the broadcast message is a Bluetooth broadcast message.
  • the target device is one of the at least one second device.
  • the first request message includes connection information of the first device.
  • the connection information can be a Bluetooth address, Internet protocol (IP), IP+port number, media access control (media access control, MAC) address, etc.
  • IP Internet protocol
  • MAC media access control
  • the target device first connects back to the first device according to the connection information of the first device, and then sends its own device information to the first device through the connection.
  • the target device connects back to the first device according to the connection information of the first device, and directly carries its own device information in the connection request. In this way, the target device directly carries its own device information in the connection request. There is no need to establish a connection first and then send the local device information through the connection, which can reduce the interaction between the first device and the target device, thereby further reducing the delay.
  • the target device may be a third device, that is, the first device cannot directly communicate with the target device.
  • the first device receiving a response message from the target device mainly means that the first device receives the device information of the target device forwarded by the target second device, where the target second device The device is the second device in the subnet where the target device is located. Therefore, the first device receives the response message from the target device, which can be implemented as:
  • the first device receives a third response message sent by the target second device; the third response message includes second device information of the target device.
  • the first device can receive the third response sent by the target second device in two ways.
  • the first device receives a connection request sent by the target second device according to the connection information of the first device, and establishes a connection with the target second device according to the connection request.
  • the first device receives a third response message sent by the target second device through the connection; the third response message includes the second device information of the target device.
  • the target second device first connects back to the first device according to the connection information of the first device, and then sends the device information of the target device to the first device through the connection.
  • the first device receives a connection request from the target second device, may regard the connection request as third response information, and further include the second device of the target device in the connection request. information.
  • the target second device connects back to the first device according to the connection information of the first device, and directly carries the device information of the target device in the connection request. In this way, the target second device directly carries the target device's device information in the connection request. The device information does not need to be established first and then the device information of the target device is sent through the connection, which can reduce the interaction between the first device and the target second device, thereby further reducing the delay.
  • the first device can use the proxy discovery service of the second device to expand the scope of discovered devices and discover devices located in different subnets from the first device.
  • Target devices enable device discovery technical solutions to cope with more realistic and complex networking environments and achieve more universal device discovery capabilities.
  • the first device is configured with a first preset protocol; wherein the first field in the first preset protocol includes a broadcast type and a feature code.
  • the broadcast type is device discovery; the feature code is used to indicate the type of feature value.
  • the second field of the first preset protocol includes the value of the characteristic value.
  • a device discovery method is provided, applied in a system, where the system includes a first device and at least one second device.
  • the method includes: the second device receives a first request message from the first device, where the first request message includes a characteristic value of the target device. If the characteristic value of the target device successfully matches the characteristic value of the local device, the second device sends a first response message to the first device; the first response message includes the second device information of the target device.
  • the first request message sent by the first device carries the characteristic value of the target device.
  • the device that receives the request message matches the characteristic value of the target device with the characteristic value of the local device, and only the successfully matched target device sends a response message to the first device. Therefore, the first device can be prevented from establishing a connection with a non-target device.
  • the first device needs to exchange device information with it and perform device information matching to determine the target device from these second devices. This process is time-consuming. longer. The method provided by this application can reduce the time-consuming device discovery.
  • the number of second devices is multiple.
  • the second device receiving the first request message from the first device includes: the second device receiving a broadcast message from the first device, the broadcast message carrying the first request message.
  • the first request message includes connection information of the first device. Then, the second device sends the first response message to the first device in the following two ways:
  • the first method is that the second device establishes a first connection with the first device according to the connection information of the first device.
  • a connection sends the first response message to the first device.
  • the second device as the target device, first connects back to the first device according to the connection information of the first device, and then sends its own device information to the first device through the connection.
  • the second device serves as the target device and connects back to the first device according to the connection information of the first device, and directly carries its own device information in the connection request.
  • the target device directly carries its own device information in the connection request.
  • the device information of the device does not need to be established first and then the device information of the machine is sent through the connection, which can reduce the interaction between the first device and the target device, thereby further reducing the delay.
  • the target device may be a third device, that is, the first device cannot directly communicate with the target device.
  • the method further includes:
  • the second device When the second device determines to enable the proxy function, it sends a second request message to a third device located in the same subnet as the second device, where the second request message includes the characteristic value of the target device. If the second device information of the target device is obtained, the second device sends a third response message to the first device. The third response message includes second device information of the target device. The second device information of the target device is sent by the target device to the second device after the third device located in the same subnet as the second device determines that the characteristic value of the device matches the characteristic value of the target device.
  • the second device executes the solution when it is determined that the characteristic value of the target device carried in the first request message does not match the characteristic value of the local device.
  • the number of third devices located in the same subnet as the second device is multiple.
  • sending a second request message to the at least one third device located in the same subnet as the second device includes:
  • the second request message includes connection information of the second device. Then, if the second device information of the target device is obtained, the second device sends the third response message to the first device, which can be implemented as:
  • the second device If a second response message is received from the target device, the second device establishes a first connection with the first device and a second connection with the target device.
  • the second response message is a connection response message sent by the target device according to the connection information of the second device, and is used to establish a connection with the second device.
  • the second device receives a third request message from the first device through the first connection, where the third request message is used to request information of the target device. Forward the third request message to the target device through the second connection and receive the target device. The second device information of the target device sent by the target device. Finally, the second device sends the third response message to the first device through the first connection.
  • the second device after determining the target device, the second device establishes connections with the target device and the first device respectively, and then transmits the second device information of the target device through the established connections.
  • the target device can send a reconnection request to the second device, and the reconnection request carries its device information; correspondingly, the second device can send a reconnection request to the first device, in The connection request carries the device information of the target device.
  • the first device can use the proxy discovery service of the second device to expand the scope of discovered devices and discover devices located in different subnets from the first device.
  • Target devices enable device discovery technical solutions to cope with more realistic and complex networking environments and achieve more universal device discovery capabilities.
  • the second device includes a low-power device; the low-power device stores local characteristic values.
  • the characteristic value is first device information; the first device information includes one or more of device identification, device type, device name, user information logged in to the device, and service identification. item.
  • the second device is configured with a second preset protocol; wherein the first field in the second preset protocol includes whether to enable the proxy function; the second field includes the characteristic value of Take value.
  • a device discovery method applied in a system, the system includes a first device, at least one second device and at least one third device; wherein the system includes at least one subnet; each subnet
  • the network includes a second device and a third device; the first device communicates with the third device located in the subnet through the second device.
  • the method includes:
  • the third device receives a second request message from the second device in the same subnet; the second request message includes the characteristic value of the target device. If the characteristic value of the target device successfully matches the characteristic value of the local device, the third device sends the second device information of the target device to the second device.
  • the number of third devices is multiple.
  • the third device receives the second request message from the second device in the same subnet, including: the third device receives a broadcast message from the second device in the same subnet, and the broadcast message is used to Carrying the second request message;
  • the second request message includes connection information of the second device. If the characteristic value of the target device successfully matches the characteristic value of the local device, the third device sends the second device information of the target device to the second device, including:
  • the third device sends a second response message to the second device according to the connection information of the second device.
  • the second response message is a connection response message sent by the target device according to the connection information of the second device, and is used to establish a connection with the second device.
  • the third device establishes a second connection with the second device, and then the third device receives a third request message sent by the second device through the second connection.
  • the third request message is used to obtain the second device information of the third device. .
  • the third device sends the second device information of the third device to the second device through the second connection.
  • a fourth aspect provides an electronic device.
  • the electronic device includes: a processor and a memory.
  • the memory is coupled to the processor.
  • the memory is used to store computer-readable instructions.
  • the processor reads the computer-readable instructions from the memory, the electronic device executes the first aspect and any of the first aspects.
  • a fifth aspect provides an electronic device.
  • the electronic device includes: a processor and a memory.
  • the memory is coupled to the processor.
  • the memory is used to store computer-readable instructions.
  • the processor reads the computer-readable instructions from the memory, the electronic device executes the second aspect and any of the second aspects.
  • a sixth aspect provides an electronic device.
  • the electronic device includes: a processor and a memory.
  • the memory is coupled to the processor.
  • the memory is used to store computer-readable instructions.
  • the processor reads the computer-readable instructions from the memory, the electronic device executes the third aspect and any of the third aspects.
  • a seventh aspect provides a device discovery system, which includes a first device and at least one second device; wherein,
  • the first device is used to send a first request message to the at least one second device; the first request message includes a characteristic value of the target device; the characteristic value of the target device is used to receive the first request message.
  • the device requesting the message matches the characteristic value of its own machine with the characteristic value of the target device.
  • the second device is configured to receive a first request message from the first device; and is also configured to send a first request message to the first device if the characteristic value of the target device successfully matches the characteristic value of the local device.
  • a response message; the first response message includes second device information of the target device.
  • the system further includes at least one third device; the system includes at least one subnet; each subnet includes a second device and a third device; the first device passes through the The second device communicates with a third device located within the subnet.
  • the second device is further configured to send a second request message to a third device located in the same subnet as the second device, where the second request message includes the target device. eigenvalues;
  • the second device is further configured to, if the second device information of the target device is obtained, send a third response message to the first device; wherein the third response message includes the second device information of the target device.
  • Device information; the second device information of the target device is sent by the target device after a third device located in the same subnet as the second device determines that the characteristic value of its own machine matches the characteristic value of the target device. to the second device.
  • embodiments of the present application provide an electronic device that has the function of implementing the device discovery method described in the above first aspect and any possible implementation manner.
  • This function can be implemented by hardware, or can be implemented by hardware and corresponding software.
  • the hardware or software includes one or more modules corresponding to the above functions.
  • embodiments of the present application provide an electronic device that has the function of implementing the device discovery method described in the above second aspect and any possible implementation manner thereof.
  • This function can be implemented by hardware, or can be implemented by hardware and corresponding software.
  • the hardware or software includes one or more modules corresponding to the above functions.
  • embodiments of the present application provide an electronic device that has the function of implementing the device discovery method described in the above third aspect and any possible implementation manner.
  • This function can be implemented by hardware, or can be implemented by hardware and corresponding software.
  • the hardware or software includes one or more modules corresponding to the above functions.
  • a computer-readable storage medium stores a computer program (which may also be referred to as instructions or codes).
  • the computer program When the computer program is executed by an electronic device, it causes the electronic device to perform the method of the first aspect or any one of the embodiments of the first aspect; or , causing the electronic device to perform the second aspect or the method of any one of the implementation modes of the second aspect; or, causing the electronic device to perform the third aspect or the method of any one of the implementation modes of the third aspect.
  • embodiments of the present application provide a computer program product, which when the computer program product is run on an electronic device, causes the electronic device to execute the method of the first aspect or any one of the implementation modes of the first aspect; or, causes the electronic device to execute The electronic device performs the second aspect or the method of any one of the implementation modes of the second aspect; or, the electronic device is caused to perform the third aspect or the method of any one of the implementation modes of the third aspect.
  • inventions of the present application provide a circuit system.
  • the circuit system includes a processing circuit.
  • the processing circuit is configured to perform the method of the first aspect or any one of the implementation modes of the first aspect; or, the processing circuit is configured to Perform the method of the second aspect or any one of the implementations of the second aspect; alternatively, the processing circuit is configured to perform the method of the third aspect or any one of the implementations of the third aspect.
  • embodiments of the present application provide a chip system, including at least one processor and at least one interface circuit.
  • the at least one interface circuit is used to perform transceiver functions and send instructions to at least one processor.
  • the processor executes instructions, at least one processor executes the first aspect or the method of any one implementation of the first aspect; or, at least one processor executes the second aspect or the method of any one implementation of the second aspect; or , at least one processor executes the method of the third aspect or any one of the implementation modes of the third aspect.
  • Figure 1 is a schematic diagram of an existing device discovery method provided by an embodiment of the present application.
  • Figure 2 is a schematic diagram of a device static label provided by an embodiment of the present application.
  • Figure 3 is a schematic diagram of a scenario provided by an embodiment of the present application.
  • Figure 4 is a schematic structural diagram of a device provided by an embodiment of the present application.
  • Figure 5 is a schematic diagram of a software system of a device provided by an embodiment of the present application.
  • Figure 6 is a flow chart of a device discovery method provided by an embodiment of the present application.
  • Figure 7 is a schematic diagram of a device discovery method provided by an embodiment of the present application.
  • Figure 8 is a flow chart of another device discovery method provided by an embodiment of the present application.
  • Figure 9 is a flow chart of another device discovery method provided by an embodiment of the present application.
  • Figure 10 is a schematic structural diagram of the first device provided by the embodiment of the present application.
  • Figure 11 is a schematic structural diagram of the second device provided by the embodiment of the present application.
  • Figure 12 is a schematic structural diagram of a third device provided by an embodiment of the present application.
  • distributed networking is the establishment of communication connections between multiple devices through standard Bluetooth, wireless fidelity (WiFi), Ethernet, etc.
  • WiFi wireless fidelity
  • Ethernet Ethernet
  • One of the distributed networking An important link is device discovery. The device discovery process can be quickly implemented based on short-range communication technology to establish connections between devices.
  • the process of a device discovery method provided by the prior art specifically includes the following steps:
  • the first device obtains the connection information of the target device in advance.
  • the target device has a static label as shown in Figure 2, and the static label contains the connection information of the target device.
  • the connection information may be the first type of information, such as: Internet protocol (IP), IP+port number, media access control (media access control, MAC) address, etc.
  • IP Internet protocol
  • IP+port number media access control
  • MAC media access control
  • the connection information can also be the second type of information, such as some attribute information, such as the device's serial number (SN) or unique device identifier (UDID), etc.
  • the first device can read the connection information of the target device in the static tag through short-range communication technologies such as near field communication (NFC), QR code scanning, and Bluetooth proximity.
  • NFC near field communication
  • QR code scanning QR code scanning
  • Bluetooth proximity Bluetooth proximity
  • the first device can directly connect to the target device according to the connection information, that is, a direct connection is achieved.
  • the first device cannot be directly connected to the target device, and further matching process of device information is required, which is the following steps:
  • the first device sends a device discovery request message to surrounding devices including the target device (for convenience of description, these devices are described as second devices in this application).
  • the device discovery request message is used to request discovery of the target device.
  • each second device After receiving the broadcast, each second device sends a first response message to the first device.
  • the first response message is used to establish a connection with the first device.
  • the first device establishes a connection with the second device according to the first response message.
  • the first device sends a request message to the second device through the connection established with the second device.
  • the request message is used to request device information of the second device, such as a device identification.
  • the first device matches the device information in the second response message sent by each second device with the device information of the target device read through S101, and confirms that the successfully matched device is the target device.
  • the first device reads the connection information contained in the second response message sent by the target device.
  • the distributed device cluster may include smartphones, televisions, wireless headsets, smart watches, smart bracelets, speakers, personal computers (PCs) (such as laptops, desktop computers, super Mobile personal computers (ultra-mobile personal computers, UMPCs, etc.), tablets, augmented reality (AR)/virtual reality (VR) devices, Internet of things (IoT) devices (such as smart phones household equipment).
  • PCs personal computers
  • AR augmented reality
  • VR virtual reality
  • IoT devices Internet of things (IoT) devices (such as smart phones household equipment).
  • IoT devices are an important part of the future development of information technology. Its main technical feature is to connect objects to the network through communication technology, thereby realizing an intelligent network of human-machine interconnection and object-object interconnection.
  • a distributed device cluster may include "1+8+N” terminal products.
  • the "1+8+N” terminal products are used to create fifth-generation mobile communication technology (fifth-generation, 5G) full-scenario smart life and subsequent mobile communication technologies such as the next generation.
  • 5G fifth-generation mobile communication technology
  • “1” refers to smartphones, the entrance to future smart life
  • “8” refers to tablets, PCs, wearable devices, high-definition (HD) devices, artificial intelligence (AI)
  • Speakers headphones, AR/VR equipment, car equipment
  • N generally refers to IoT equipment, such as smart home equipment.
  • a necessary link for multi-device collaboration is device discovery.
  • device discovery is initiated by the discovery device, and device discovery is used to discover specified devices (i.e., discovered devices), such as devices identified by specific devices, devices that can provide specific services, and devices that log in to the same account, so that the discovered device can communicate with the discovered device.
  • discovered devices such as devices identified by specific devices, devices that can provide specific services, and devices that log in to the same account, so that the discovered device can communicate with the discovered device.
  • Device collaboration to provide screen projection (such as video projection, picture projection, etc.), remote screen control, audio projection, file sharing and other services.
  • discovered devices and discovered devices can be any device in the distributed device cluster.
  • discovered devices and discovered devices may include, but are not limited to, desktop devices, laptop devices, handheld devices, wearable devices, smart home devices, computing devices, vehicle-mounted devices, airborne devices, industrial equipment, etc.
  • wisdom Smart phones netbooks, tablets, smart watches, smart bracelets, phone watches, PCs, wireless headsets, televisions, audio, smart cameras, somatosensory game consoles, personal digital assistants (PDAs), portable multimedia players (portable multimedia player, PMP), AR/VR equipment, session initiation protocol (SIP) telephone, IOT terminal equipment, wireless equipment in smart city (smart city), wireless equipment in smart home (smart home) etc.
  • PDAs personal digital assistants
  • portable multimedia players portable multimedia player, PMP
  • AR/VR equipment AR/VR equipment
  • session initiation protocol (SIP) telephone IOT terminal equipment, wireless equipment in smart city (smart city), wireless equipment in smart home (smart home) etc.
  • the device 400 may also include a memory 404.
  • the processor 401, the memory 404 and the transceiver 402 may be connected through a communication line 403.
  • Communication module 503 through which the device interacts with other devices.
  • the communication module 503 can be implemented as a distributed softbus.
  • the device can interact with other devices through the distributed soft bus, for example, exchange messages with other devices through the distributed soft bus.
  • the message is a user datagram protocol (UDP) message.
  • the communication module can also be a Bluetooth module, etc.
  • the application program of the device application layer 501 specifies the information of the target device to be discovered as a feature value. For example: For example, an application can read the value of a static tag and read the SN from the static tag. Call DM to discover the second device of this SN. For another example, the application can also configure the UDID of the peripheral device (which can be configured by the administrator of the application), and then the APP initiates the discovery of the specific UDID. Afterwards, the application program at the application layer can send the characteristic value to the device management module 502 through the DM API.
  • the local machine extracts the connection address of the first device from the broadcast header sent by the first device (the connection address can be any one of Bluetooth, IP, and MAC addresses), and according to the The connection address establishes a connection with the first device; or, if the local device is determined to be the target device, the local device replies with a response broadcast to the first device, carrying the local device information in the broadcast, thereby transmitting the local device information back. to the first device.
  • the connection address can be any one of Bluetooth, IP, and MAC addresses
  • the SPDD protocol includes the capability filter field.
  • the value of the high 2 bits of this field indicates the specific broadcast mode under the broadcast type of a specific extension (in this case, device discovery). Only one specific broadcast mode can be sent at a time. Mode, for example, 00 means using the default discovery method (for example, the discovery method in the prior art), 01 means using the discovery method provided by the embodiment of this application; the lower 6 bits of this field indicate which feature is used to determine the device to be discovered. (This application describes it as a feature code).
  • the first device sends a broadcast message to the multiple second devices, and the broadcast message is used to carry the request message.
  • the characteristic value in the embodiment of the present application may be device information, or may be obtained by encrypting the device information.
  • the second device sends a response message to the first device.
  • the first device receives the response message from the second device.
  • the response message includes second device information of the target device, that is, the successfully matched second device.
  • the second device that is successfully matched can directly reply with a response message, and the response message carries the device information of the device.
  • the device information can include device identification, connection information, such as IP address, MAC address, etc., which is not limited in this application.
  • the second device may first establish a connection with the first device, and then exchange device information between the second device and the first device through the connection.
  • the first request message includes connection information of the first device.
  • the connection information can be a Bluetooth address, Internet protocol (IP), IP+port number, media access control (media access control, MAC) address, etc.
  • IP Internet protocol
  • MAC media access control
  • the second device serves as the target device and sends a connection request to the first device based on the connection information of the first device.
  • the first device receives the connection request sent by the target device, and establishes the first connection with the target device according to the connection request.
  • the first device receives a first response message sent by the target device through the first connection; the first response message includes second device information of the target device.
  • the target device first connects back to the first device according to the connection information of the first device, and then sends its own device information to the first device through the connection.
  • the target device connects back to the first device according to the connection information of the first device, and in the connection request
  • the request directly carries its own device information, so that the target device directly carries its own device information in the connection request, without first establishing a connection and then sending its own device information through the connection, which can reduce the number of first devices and target devices. device interaction, thereby further reducing latency.
  • the first device can read the device information in the response message, such as connection information, and establish a connection with the target device based on the connection information.
  • device information in the response message such as connection information
  • the discovery request message in S601-S603 may also be described as the first request message; the response message therein may be described as the first response message.
  • device A sends a device discovery request message (dashed line in the figure) to surrounding devices, and the device discovery request message carries the characteristic value of the target device.
  • the device discovery request message carries the characteristic value of the target device.
  • device B, device C, device D, device E and device F respectively match the received characteristic value of the target device with the characteristic value of the local machine. If device B, device C, device D and device F fail to match, the broadcast will be discarded.
  • the successfully matched device E exchanges device information with device A (solid line in the figure).
  • the smart speaker Only if the smart speaker is successfully matched, the smart speaker will send a response message to the mobile phone, carrying its own device information, such as the connection address, etc. in the response message. After receiving the response message, the mobile phone only establishes a connection with the smart speaker to complete the device discovery process.
  • the first device and the target device cannot be directly connected, that is, the discovery request message sent by the first device
  • the information cannot reach the target device directly and needs to be forwarded through a proxy device.
  • the distributed device cluster includes a first device, a second device, and a third device.
  • the first device and the third device cannot be directly connected, but the first device and the second device, and the second device and the third device located in the same subnet can be directly connected.
  • the connection methods include Bluetooth connection, WIFI connection, and Ethernet connection. , PLC, etc.
  • part or all of the second device can serve as a proxy device, and the second device as a proxy device can forward the discovery request message sent by the first device to a third device located in the same subnet.
  • a distributed cluster contains devices A, B, C, D, E, F, and G.
  • Devices B, C, and D are located on the same subnet, and E, F, and G are located on the same subnet.
  • A, B, and E can communicate with each other. Then, if A, as the first device, wants to discover device C, the discovery request message sent by A in broadcast mode cannot be sent directly to C. Instead, A sends the discovery request message to B, and B acts as a proxy device to send the discovery request message. The message is forwarded to C and D.
  • the first device sends a first request message to the second device.
  • the second device receives the first request message from the first device,
  • the first request message includes the characteristic value of the target device.
  • the second device matches the characteristic value of the target device with the characteristic value of the local device.
  • the second device sends a first response message to the first device; the first response message includes second device information of the target device.
  • the second request message also includes the characteristic value of the target device.
  • the second request message may also include connection information of the second device, etc.
  • the second device may send the second request message through broadcast.
  • the second device locally checks whether the proxy discovery configuration item is configured and whether the proxy discovery service is enabled. Make sure that the proxy function is turned on when the proxy discovery service of the second device is turned on.
  • the third device matches the characteristic value of the target device in the received second request message with the characteristic value of the local device.
  • the third device is the target device, so the following S806 is executed. If the matching fails, the third device discards the second request message.
  • the third device sends the second device information to the second device.
  • the second device receives the second device information of the third device.
  • the second device referred to in this step can also be described as the target second device.
  • the target second device refers to a second device located in the same subnet as the target device.
  • the successfully matched third device sends a response message to the second device, and the successfully matched third device is the first device.
  • Discovered target devices only the successfully matched third device sends a response message to the second device, and the successfully matched third device is the first device.
  • the second device sends a third response message to the first device.
  • the first device receives the third response message from the second device.
  • the third response message includes second device information of the target device, such as device identification, connection address, etc.
  • the successfully matched third device can directly reply with the third response information (including the second device information of the third device) and forward it directly to the first device by the second device; or the second device and the first device can directly reply. After a connection is established between the devices, the data is forwarded to the first device through the connection.
  • the successfully matched third device serving as the target device, can also establish a connection with the second device, and the second device establishes a connection with the first device.
  • the third device exchanges device information with the first device through the second device. That is, as shown in Figure 9, S806 and S807 can be implemented as the following steps:
  • the second response message is a connection response message sent by the target device according to the connection information of the second device, and is used to establish a connection with the second device.
  • the second device establishes a first connection with the first device and a second connection with the target device.
  • the second device receives the third request message from the first device through the first connection, and forwards the third request message to the target device through the second connection; wherein the second request The message is used to request information about the target device.
  • this application does not limit the order in which the second device performs feature value matching and the third device performs feature value matching. That is to say, this application does not limit the order in which the processes of S804-S807 and the process of S802 are executed.
  • the second device will Reply a response message to the first device.
  • the second device executes S802 to successfully match the characteristic value of the local device with the characteristic value of the target device.
  • S804-S807 can be executed when the second device fails to match the characteristic value of the local device with the characteristic value of the target device.
  • the mobile phone and the tablet are in the same network A, and the tablet and the Bluetooth headset are directly connected through Bluetooth (network B). Then if the mobile phone wants to access the Bluetooth headset, the mobile phone and the Bluetooth headset cannot be directly connected. At this time, the mobile phone can access the Bluetooth headset through the tablet.
  • the mobile phone As an intermediate agent device, that is, the mobile phone first establishes a connection with the tablet, and then the tablet establishes a connection with the Bluetooth headset. In this way, the tablet agent forwards the discovery broadcast of the mobile phone, forwards and returns the broadcast message, and transfers and returns the connection transmission, thereby realizing Subnet penetration allows the mobile phone to discover Bluetooth headsets that are not in the same subnet.
  • the first device can use the proxy discovery service of the second device to expand the scope of the discovered device and discover the target device located in a different subnet from the first device, so that the device discovery technology
  • the solution can cope with more realistic and complex networking environments and achieve more universal device discovery capabilities.
  • the above combination describes in detail the device discovery method provided by the embodiment of the present application.
  • the screen projection device provided by the embodiment of the present application is described in detail below.
  • FIG. 10 is a schematic structural diagram of a first device provided by an embodiment of the present application.
  • the first device 1000 may include: a transceiver unit 1001 and a processing unit 1002.
  • the transceiver unit may include a receiving unit and a transmitting unit, may be implemented by a transceiver or a transceiver-related circuit component, and may be a transceiver or a transceiver module.
  • the operation and/or function of each unit in the first device 1000 is to implement the corresponding process of the device discovery method described in the above method embodiment. All relevant content of each step involved in the above method embodiment can be quoted to the corresponding function. The functional description of the unit will not be repeated here for the sake of brevity.
  • the first device 1000 shown in Fig. 10 may also include a storage unit (not shown in Fig. 10), in which programs or instructions are stored.
  • a storage unit not shown in Fig. 10
  • the transceiver unit 1001 and the processing unit 1002 execute the program or instruction
  • the first device 1000 shown in FIG. 10 can execute the device discovery method described in the above method embodiment.
  • the technical solution provided by this application can also be a functional unit or chip in the first device, or a device used in conjunction with the first device.
  • FIG. 11 is a schematic structural diagram of a second device provided by an embodiment of the present application.
  • the second device 1100 may include: a transceiver unit 1101 and a processing unit 1102.
  • the transceiver unit 1101 is used to support the second device 1100 to perform S601 and S603 in Figure 6, S801, S803, S804, S806, and S807 in Figure 8, and S901, S903, and S904 in Figure 9.
  • the processing unit 1102 is configured to support the second device 1100 in performing S602 in Figure 6, S802 in Figure 8, and S902 in Figure 9.
  • the transceiver unit may include a receiving unit and a transmitting unit, may be implemented by a transceiver or a transceiver-related circuit component, and may be a transceiver or a transceiver module.
  • the operation and/or function of each unit in the second device 1100 is to implement the corresponding process of the device discovery method described in the above method embodiment. All relevant content of each step involved in the above method embodiment can be quoted to the corresponding function. The functional description of the unit will not be repeated here for the sake of brevity.
  • the second device 1100 shown in FIG. 11 may also include a storage unit (not shown in FIG. 11), in which programs or instructions are stored.
  • a storage unit not shown in FIG. 11
  • the transceiver unit 1101 and the processing unit 1102 execute the program or instruction
  • the second device 1100 shown in FIG. 11 can perform the device discovery method described in the above method embodiment.
  • the technical solution provided by this application can also be a functional unit or chip in the second device, or a device used in conjunction with the second device.
  • FIG. 12 is a schematic structural diagram of a third device provided by an embodiment of the present application.
  • the third device 1200 may include: a transceiver unit 1201 and a processing unit 1202.
  • the third device 1200 may be used to implement the function of a device in the trusted group involved in the above method embodiment that has established a screen casting connection with the peer device.
  • the transceiver unit 1201 is used to support the third device 1200 to perform S804 and S806 in Figure 8, and S901 and S904 in Figure 9.
  • processing unit 1202 is used to support the third device 1200 to perform S805 in Figure 8.
  • the transceiver unit may include a receiving unit and a transmitting unit, may be implemented by a transceiver or a transceiver-related circuit component, and may be a transceiver or a transceiver module.
  • the operation and/or function of each unit in the third device 1200 is to implement the corresponding process of the device discovery method described in the above method embodiment. All relevant content of each step involved in the above method embodiment can be quoted to the corresponding function. The functional description of the unit will not be repeated here for the sake of brevity.
  • the third device 1200 shown in FIG. 12 may also include a storage unit (not shown in FIG. 12), in which programs or instructions are stored.
  • a storage unit not shown in FIG. 12
  • the third device 1200 shown in FIG. 12 can perform the device discovery method described in the above method embodiment.
  • the technical solution provided by this application can also be a functional unit or chip in the third device, or a device used in conjunction with the third device.
  • An embodiment of the present application also provides a chip system, including: a processor, the processor is coupled to a memory, and the memory is used to store programs or instructions. When the program or instructions are executed by the processor, the The chip system implements the method in any of the above method embodiments.
  • processors in the chip system there may be one or more processors in the chip system.
  • the processor can be implemented in hardware or software.
  • the processor may be a logic circuit, an integrated circuit, or the like.
  • the processor may be a general-purpose processor implemented by reading software code stored in memory.
  • the memory may be integrated with the processor or may be provided separately from the processor, which is not limited by the embodiments of the present application.
  • the memory may be a non-transient processor, such as a read-only memory ROM, which may be integrated with the processor on the same chip, or may be separately provided on different chips.
  • the embodiments of this application vary on the type of memory, and The arrangement of the memory and processor is not specifically limited.
  • the chip system may be a field programmable gate array (field programmable gate array, FPGA), which can be an application specific integrated circuit (ASIC), a system on chip (SoC), a central processor unit (CPU), or a network
  • a processor network processor, NP
  • DSP digital signal processor
  • MCU microcontroller
  • PLD programmable logic device
  • each step in the above method embodiment can be completed by an integrated logic circuit of hardware in the processor or instructions in the form of software.
  • the method steps disclosed in conjunction with the embodiments of this application can be directly implemented by a hardware processor, or executed by a combination of hardware and software modules in the processor.
  • Embodiments of the present application also provide a computer-readable storage medium.
  • a computer program is stored in the computer-readable storage medium. When the computer program is run on a computer, it causes the computer to perform the above related steps to implement the above embodiments. device discovery method.
  • An embodiment of the present application also provides a computer program product.
  • the computer program product When the computer program product is run on a computer, it causes the computer to perform the above related steps to implement the device discovery method in the above embodiment.
  • the embodiment of the present application also provides a device.
  • the device may specifically be a component or module, and the device may include one or more connected processors and memories. Among them, memory is used to store computer programs. When the computer program is executed by one or more processors, the device is caused to execute the device discovery method in each of the above method embodiments.
  • the devices, computer-readable storage media, computer program products or chips provided by the embodiments of the present application are all used to execute the corresponding methods provided above. Therefore, the beneficial effects it can achieve can be referred to the beneficial effects in the corresponding methods provided above, and will not be described again here.
  • the steps of the methods or algorithms described in connection with the disclosure of the embodiments of this application can be implemented in hardware or by a processor executing software instructions.
  • Software instructions can be composed of corresponding software modules, and software modules can be stored in random access memory (RAM), flash memory, read only memory (read only memory, ROM), erasable programmable read-only memory (ROM), erasable programmable ROM (EPROM), electrically erasable programmable read-only memory (EPROM, EEPROM), register, hard disk, removable hard disk, compact disc (CD-ROM) or any other form of storage media well known in the art.
  • An exemplary storage medium is coupled to the processor such that the processor can read information from the storage medium and write information to the storage medium.
  • the storage medium can also be an integral part of the processor.
  • the processor and storage medium may be located in an application specific integrated circuit (ASIC).
  • ASIC application specific integrated circuit
  • the disclosed method can be implemented in other ways.
  • the device embodiments described above are merely illustrative.
  • the division of modules or units is only a logical function division, and there may be other division methods in actual implementation; for example, multiple units or components may be combined or integrated into another system, or some features may be ignored. or not executed.
  • the shown The mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces, and the indirect coupling or communication connection of modules or units may be in electrical, mechanical or other forms.
  • each functional unit in various embodiments of the present application may be integrated into one processing unit, or each unit may exist physically alone, or two or more units may be integrated into one unit.
  • the above integrated units can be implemented in the form of hardware or software functional units.
  • Computer-readable storage media includes but is not limited to any of the following: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), magnetic disk or optical disk, etc.
  • ROM read-only memory
  • RAM random access memory
  • magnetic disk or optical disk etc.
  • Various media that can store program code include but is not limited to any of the following: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), magnetic disk or optical disk, etc.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Security & Cryptography (AREA)
  • Databases & Information Systems (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

本申请实施例提供了一种设备发现方法、装置及系统,该方法可以解决现有技术中设备发现时延较长、功耗较大的问题。其中,本申请实施例提供的设备发现方法,包括:第一设备,向至少一个第二设备发送第一请求消息;该第一请求消息包括目标设备的特征值;目标设备的特征值用于收到第一请求消息的设备将本机的特征值与目标设备的特征值进行匹配。第二设备,接收来自第一设备的第一请求消息;若目标设备的特征值与本机的特征值匹配成功,则向第一设备发送第一响应消息;该第一响应消息包括目标设备的第二设备信息。本申请实施例提供的设备发现方法、装置及系统能够减少设备发现过程中的时延,可应用在可以应用于分布式组网的设备发现的过程中。

Description

设备发现方法、装置及系统
本申请要求于2022年06月20日提交国家知识产权局、申请号为202210698383.9、发明名称为“设备发现方法、装置及系统”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及通信领域,尤其涉及设备发现方法、装置及系统。
背景技术
随着终端技术的发展,多个终端设备可以通过分布式组网实现多设备互联,执行分布式业务,以提供多样的服务。其中,分布式组网是多个设备之间通过标准的蓝牙、无线保真(wireless fidelity,WiFi)、以太网等方式建立起通信连接。分布式组网的一个重要环节是设备发现,设备发现过程可以基于短距通信技术来快速实现,从而建立设备之间的连接。
目前的设备发现方法为:第一设备获取目标设备的连接信息,根据该连接信息确定无法与该目标设备直连后向分布式网络中的其余设备(为便于描述,本申请描述为第二设备)发送设备发现请求消息。各个第二设备响应该广播回连该第一设备,与第一设备建立安全通道。第一设备分别通过各个安全通道与对应的第二设备交换设备信息。第一设备将获取到的各个第二设备的设备信息与目标设备的连接信息(如设备标识)匹配,从这些第二设备中确定目标设备。进而第一设备从目标设备反馈的设备信息中得到目标设备的连接地址,通过该连接地址与目标设备建立连接。
随着设备发现涉及的终端设备的数量越来越多,在现有的设备发现过程中,第一设备与周围各设备逐个进行建立连接、请求其设备信息并匹配的过程,耗费的时间会越来越长。此外,该过程能耗较高,难以适应分布式组网设备的数量快速增长的现状。
发明内容
本申请实施例提供一种设备发现方法、装置及系统,用于解决设备发现过程耗时较长、能耗高的问题。
为达到上述目的,本申请的实施例采用如下技术方案:
第一方面,提供一种设备发现方法,应用于系统(本申请中也可以描述为分布式集群)中,该系统包括第一设备和至少一个第二设备。该方法包括:第一设备向至少一个第二设备发送第一请求消息;其中,该第一请求消息包括目标设备的特征值,目标设备的特征值用于收到第一请求消息的设备将本机的特征值与目标设备的特征值进行匹配。之后,第一设备接收来自目标设备的响应消息。该响应消息为目标设备在将第一请求消息中的特征值与本机的特征值匹配成功后发送;该响应消息中包括目标设备的第二设备信息。
示例性的,所述特征值为第一设备信息;所述第一设备信息包括设备标识、设备类型、设备名称、登录所述设备的用户信息和业务标识中的一项或多项。可选的,可以将第一设备信息加密作为特征值。
可选的,特征值可以为第一设备从目标设备的电子标签中获取或者用户输入,可以为目标设备的部分设备信息,比如目标的设备标识等。第二设备信息可以为目标设备的更详尽的信息,比如除了电子标签中包含的信息以外的信息,比如目标设备的连接信息等。
这样,第一设备发送的第一请求消息中携带有目标设备的特征值。收到该请求消息的设备将该目标设备的特征值与本机的特征值进行匹配,只有匹配成功的目标设备向第一设备发出响应消息,因此可以避免第一设备与非目标设备建立连接。而现有技术中,针对每个接收到发现请求广播的第二设备,第一设备都需要和其交换设备信息并进行设备信息匹配从而从这些第二设备中确定出目标设备,该过程耗时较长。本申请提供的方法可以减少设备发现的耗时。
在一种可能的设计中,第二设备的数量为多个。那么,第一设备向至少一个第二设备发送第一请求消息,可以实现为:第一设备向多个第二设备发送广播报文,该广播报文用于承载第一请求消息。
示例性的,所述广播报文为蓝牙广播报文。
在一种可能的设计中,目标设备为所述至少一个第二设备中的一个。
在一种可能的设计中,第一请求消息中包括第一设备的连接信息。示例性的,该连接信息可以为蓝牙地址、网络互联协议(Internet protocol,IP)、IP+端口号、媒体访问控制(media access control,MAC)地址等。那么目标设备收到该第一请求消息后,向第一设备回复响应消息的方式可以包括以下两种:
第一种,第一设备接收目标设备根据第一设备的连接信息发送的连接请求,并根据所述连接请求与目标设备建立第一连接。进而,第一设备通过该第一连接接收目标设备发送的第一响应消息;该第一响应消息包括目标设备的第二设备信息。
在该实现方式中,目标设备先根据第一设备的连接信息回连第一设备,然后通过该连接向第一设备发送其本机的设备信息。
第二种,第一设备接收来自目标设备的第一响应消息。其中,该第一响应消息为目标设备根据第一设备的连接信息发送的连接请求。该第一响应消息中包括目标设备的第二设备信息。
在该实现方式中,目标设备根据第一设备的连接信息回连第一设备,并在连接请求中直接携带其本机的设备信息,这样目标设备直接在连接请求中携带本机的设备信息,而无需先建立连接再通过该连接再发送本机的设备信息,能够减少第一设备和目标设备的交互,进而进一步减少时延。
在有些场景下,系统中还包括至少一个第三设备;第三设备无法和第一设置直接通信,所述第一设备通过所述第二设备与位于子网内的第三设备通信。也即,第二设备作为代理设备可以在第一设备和第三设备之间转发消息。本申请中将第二设备以及能够与第二设备直接通信的第三设备描述为一个子网。该系统中包括至少一个子网。
在该场景下,目标设备有可能为第三设备,也即第一设备无法直接与目标设备通信。
那么,在目标设备为第三设备的场景下,第一设备接收来自目标设备的响应消息,主要是指第一设备接收目标第二设备转发的目标设备的设备信息,其中,目标第二设 备为目标设备所在的子网内的第二设备。因此,第一设备接收来自目标设备的响应消息,可实现为:
第一设备接收目标第二设备发送的第三响应消息;该第三响应消息中包括目标设备的第二设备信息。
在一种可能的设计中,第一设备接收目标第二设备发送的第三响应也可以有两种实现方式。可选的,在一种实现方式中,第一设备接收目标第二设备根据第一设备的连接信息发送的连接请求,并根据所述连接请求与目标第二设备建立连接。进而,第一设备通过该连接接收目标第二设备发送的第三响应消息;该第三响应消息包括目标设备的第二设备信息。在该实现方式中,目标第二设备先根据第一设备的连接信息回连第一设备,然后通过该连接向第一设备发送目标设备的设备信息。可选的,在另一种实现方式中,第一设备接收来自目标第二设备的连接请求,可将该连接请求视为第三响应信息,进而在该连接请求中包括目标设备的第二设备信息。在该实现方式中,目标第二设备根据第一设备的连接信息回连第一设备,并在连接请求中直接携带目标设备的设备信息,这样目标第二设备直接在连接请求中携带目标设备的设备信息,而无需先建立连接再通过该连接再发送目标设备的设备信息,能够减少第一设备和目标第二设备的交互,进而进一步减少时延。
针对第一设备与其要发现的目标设备无法直接通信的场景,本申请中,第一设备可通过第二设备的代理发现服务,扩大发现设备的范围,发现到与第一设备位于不同子网的目标设备,使得设备发现技术方案可以应对更加现实、复杂的组网环境,实现更加普适性的设备发现能力。
在一种可能的设计中,为了实现上述方法,第一设备配置有第一预设协议;其中,该第一预设协议中的第一字段包括广播类型和特征码。具体的,广播类型为设备发现;特征码用于表示特征值的类型。该第一预设协议的第二字段包括特征值的取值。
第二方面,提供一种设备发现方法,应用于系统中,该系统包括第一设备和至少一个第二设备。该方法包括:第二设备接收来自第一设备的第一请求消息,该第一请求消息包括目标设备的特征值。若目标设备的特征值与本机的特征值匹配成功,则第二设备向第一设备发送第一响应消息;该第一响应消息包括目标设备的第二设备信息。
这样,第一设备发送的第一请求消息中携带有目标设备的特征值。收到该请求消息的设备将该目标设备的特征值与本机的特征值进行匹配,只有匹配成功的目标设备向第一设备发出响应消息,因此可以避免第一设备与非目标设备建立连接。而现有技术中,针对每个接收到发现请求广播的第二设备,第一设备都需要和其交换设备信息并进行设备信息匹配从而从这些第二设备中确定出目标设备,该过程耗时较长。本申请提供的方法可以减少设备发现的耗时。
在一种可能的设计中,第二设备的数量为多个。相应的,第二设备接收来自第一设备的第一请求消息,包括:第二设备接收来自第一设备的广播报文,该广播报文中携带有第一请求消息。
在一种可能的设计中,第一请求消息中包括所述第一设备的连接信息。那么,第二设备向第一设备发送第一响应消息,可以包括以下两种方式:
第一种,第二设备根据第一设备的连接信息与第一设备建立第一连接,通过该第 一连接向第一设备发送所述第一响应消息。
在该实现方式中,第二设备作为目标设备先根据第一设备的连接信息回连第一设备,然后通过该连接向第一设备发送其本机的设备信息。
第二种,第二设备根据第一设备的连接信息向第一设备发送所述第一响应消息,该第一响应消息用于与所述第一设备建立第一连接。也即,该第一响应消息可以理解为回连请求。
在该实现方式中,第二设备作为目标设备根据第一设备的连接信息回连第一设备,并在连接请求中直接携带其本机的设备信息,这样目标设备直接在连接请求中携带本机的设备信息,而无需先建立连接再通过该连接再发送本机的设备信息,能够减少第一设备和目标设备的交互,进而进一步减少时延。
在有些场景下,系统中还包括至少一个第三设备;第三设备无法和第一设置直接通信,所述第一设备通过所述第二设备与位于子网内的第三设备通信。也即,第二设备作为代理设备可以在第一设备和第三设备之间转发消息。本申请中将第二设备以及能够与第二设备直接通信的第三设备描述为一个子网。该系统中包括至少一个子网。
在该场景下,目标设备有可能为第三设备,也即第一设备无法直接与目标设备通信。
那么,在一种可能的设计中,在该场景下,在第二设备接收来自第一设备的第一请求消息之后,所述方法还包括:
第二设备在确定开启代理功能的情况下,向与第二设备位于同一子网内的第三设备发送第二请求消息,该第二请求消息中包括目标设备的特征值。若获取到目标设备的第二设备信息,则第二设备向第一设备发送第三响应消息。其中,该第三响应消息中包括目标设备的第二设备信息。该目标设备的第二设备信息为与第二设备位于同一子网内的第三设备确定本机的特征值与所述目标设备的特征值匹配后由目标设备发送给第二设备。
可选的,第二设备在确定第一请求消息中携带的目标设备的特征值与本机的特征值不匹配的情况下执行该方案。
在一种可能的设计中,与第二设备位于同一子网内的第三设备的数量为多个。相应的,向与所述第二设备位于同一子网内的所述至少一个第三设备发送第二请求消息,包括:
向与第二设备位于同一子网内的所述至少一个第三设备发送广播报文,所述广播报文用于承载所述第二请求消息。
在一种可能的设计中,所述第二请求消息中包括所述第二设备的连接信息。那么,所述若获取到目标设备的第二设备信息,则第二设备向所述第一设备发送所述第三响应消息,可以实现为:
若收到来自目标设备的第二响应消息,则第二设备与第一设备建立第一连接,与目标设备建立第二连接。其中,第二响应消息为目标设备根据第二设备的连接信息发送的连接响应消息,用于与所述第二设备建立连接。
之后,第二设备通过第一连接接收第一设备的第三请求消息,该第三请求消息用于请求目标设备的信息。通过第二连接向目标设备转发所述第三请求消息以及接收目 标设备发送的目标设备的第二设备信息。最后,第二设备再通过第一连接向所述第一设备发送所述第三响应消息。
在该实现方式中,在确定了目标设备后,第二设备分别与目标设备和第一设备建立连接,然后通过建立的连接传输目标设备的第二设备信息。
可选的,在其他实现方式中,目标设备可以向第二设备发送回连请求,在该回连请求中携带其设备信息;相应的,第二设备可以向第一设备发送回连请求,在该回连请求中携带目标设备的设备信息。
针对第一设备与其要发现的目标设备无法直接通信的场景,本申请中,第一设备可通过第二设备的代理发现服务,扩大发现设备的范围,发现到与第一设备位于不同子网的目标设备,使得设备发现技术方案可以应对更加现实、复杂的组网环境,实现更加普适性的设备发现能力。
在一种可能的设计中,所述第二设备中包含低功耗器件;所述低功耗器件中存储有本机的特征值。
在该实现方式中,可以实现在第二设备免唤醒处理器的情况下由低功耗器件进行特征值匹配,减少耗时,降低功耗。
在一种可能的设计中,所述特征值为第一设备信息;所述第一设备信息包括设备标识、设备类型、设备名称、登录所述设备的用户信息和业务标识中的一项或多项。
在一种可能的设计中,所述第二设备配置有第二预设协议;其中,所述第二预设协议中的第一字段包括是否开启代理功能;第二字段包括所述特征值的取值。
第三方面,提供一种设备发现方法,应用于系统中,所述系统包括第一设备、至少一个第二设备和至少一个第三设备;其中,所述系统中包括至少一个子网;每个子网中包括第二设备和第三设备;所述第一设备通过第二设备与位于子网内的第三设备通信。
该方法包括:
第三设备接收来自同一子网内的第二设备的第二请求消息;该第二请求消息包括目标设备的特征值。若目标设备的特征值与本机的特征值匹配成功,则第三设备向第二设备发送所述目标设备的第二设备信息。
在一种可能的设计中,第三设备的数量为多个。第三设备接收来自同一子网内的所述第二设备的第二请求消息,包括:第三设备接收来自同一子网内的所述第二设备的广播报文,所述广播报文用于承载所述第二请求消息;
在一种可能的设计中,第二请求消息中包括第二设备的连接信息。所述若目标设备的特征值与本机的特征值匹配成功,则第三设备向第二设备发送目标设备的第二设备信息,包括:
若目标设备的特征值与本机的特征值匹配成功,则第三设备根据第二设备的连接信息向第二设备发送第二响应消息。其中,该第二响应消息为目标设备根据第二设备的连接信息发送的连接响应消息,用于与第二设备建立连接。之后,第三设备与第二设备建立第二连接,然后,第三设备通过第二连接接收第二设备发送的第三请求消息,该第三请求消息用于获取第三设备的第二设备信息。之后,第三设备通过第二连接向第二设备发送第三设备的第二设备信息。
第四方面,提供一种电子设备。该电子设备包括:处理器和存储器,存储器与处理器耦合,存储器用于存储计算机可读指令,当处理器从存储器中读取计算机可读指令,使得电子设备执行第一方面以及第一方面任意一种可能的实现方式。
第四方面以及第四方面中任意一种实现方式所对应的技术效果,可参见上述第一方面、及第一方面中任意一种实现方式所对应的技术效果,此处不再赘述。
第五方面,提供一种电子设备。该电子设备包括:处理器和存储器,存储器与处理器耦合,存储器用于存储计算机可读指令,当处理器从存储器中读取计算机可读指令,使得电子设备执行第二方面以及第二方面任意一种可能的实现方式。
第五方面以及第五方面中任意一种实现方式所对应的技术效果,可参见上述第二方面及第二方面中任意一种实现方式所对应的技术效果,此处不再赘述。
第六方面,提供一种电子设备。该电子设备包括:处理器和存储器,存储器与处理器耦合,存储器用于存储计算机可读指令,当处理器从存储器中读取计算机可读指令,使得电子设备执行第三方面以及第三方面任意一种可能的实现方式。
第六方面以及第六方面中任意一种实现方式所对应的技术效果,可参见上述第三方面及第三方面中任意一种实现方式所对应的技术效果,此处不再赘述。
第七方面,提供一种设备发现系统,该系统包括第一设备和至少一个第二设备;其中,
所述第一设备,用于向所述至少一个第二设备发送第一请求消息;所述第一请求消息包括目标设备的特征值;所述目标设备的特征值用于收到所述第一请求消息的设备将本机的特征值与所述目标设备的特征值进行匹配。
所述第二设备,用于接收来自所述第一设备的第一请求消息;还用于若所述目标设备的特征值与本机的特征值匹配成功,则向所述第一设备发送第一响应消息;所述第一响应消息包括所述目标设备的第二设备信息。
在一种可能的设计中,所述系统中还包括至少一个第三设备;所述系统包括至少一个子网;每个子网中包括第二设备和第三设备;所述第一设备通过所述第二设备与位于子网内的第三设备通信。
第二设备,还用于在确定开启代理功能的情况下,向与所述第二设备位于同一子网内的第三设备发送第二请求消息,所述第二请求消息中包括所述目标设备的特征值;
第二设备,还用于若获取到所述目标设备的第二设备信息,则向所述第一设备发送第三响应消息;其中,所述第三响应消息中包括所述目标设备的第二设备信息;所述目标设备的第二设备信息为与所述第二设备位于同一子网内的第三设备确定本机的特征值与所述目标设备的特征值匹配后由所述目标设备发送给所述第二设备。
第七方面以及第七方面中任意一种实现方式所对应的技术效果,可参见上述第一方面、第二方面、第三方面及第一方面、第二方面、第三方面中任意一种实现方式所对应的技术效果,此处不再赘述。
第八方面,本申请实施例提供一种电子设备,该电子设备具有实现如上述第一方面及其中任一种可能的实现方式中所述的设备发现方法的功能。该功能可以通过硬件实现,也可以通过硬件执行相应地软件实现。该硬件或软件包括一个或多个与上述功能相对应的模块。
第八方面以及第八方面中任意一种实现方式所对应的技术效果,可参见上述第一方面及第一方面中任意一种实现方式所对应的技术效果,此处不再赘述。
第九方面,本申请实施例提供一种电子设备,该电子设备具有实现如上述第二方面及其中任一种可能的实现方式中所述的设备发现方法的功能。该功能可以通过硬件实现,也可以通过硬件执行相应地软件实现。该硬件或软件包括一个或多个与上述功能相对应的模块。
第九方面以及第九方面中任意一种实现方式所对应的技术效果,可参见上述第二方面及第二方面中任意一种实现方式所对应的技术效果,此处不再赘述。
第十方面,本申请实施例提供一种电子设备,该电子设备具有实现如上述第三方面及其中任一种可能的实现方式中所述的设备发现方法的功能。该功能可以通过硬件实现,也可以通过硬件执行相应地软件实现。该硬件或软件包括一个或多个与上述功能相对应的模块。
第十方面以及第十方面中任意一种实现方式所对应的技术效果,可参见上述第三方面及第三方面中任意一种实现方式所对应的技术效果,此处不再赘述。
第十一方面,提供一种计算机可读存储介质。计算机可读存储介质存储有计算机程序(也可称为指令或代码),当该计算机程序被电子设备执行时,使得电子设备执行第一方面或第一方面中任意一种实施方式的方法;或者,使得电子设备执行第二方面或第二方面中任意一种实施方式的方法;或者,使得电子设备执行第三方面或第三方面中任意一种实施方式的方法。
第十一方面以及第十一方面中任意一种实现方式所对应的技术效果,可参见上述第一方面及第一方面中任意一种实现方式所对应的技术效果,或者,参见上述第二方面及第二方面中任意一种实现方式所对应的技术效果,或者,参见上述第三方面及第三方面中任意一种实现方式所对应的技术效果,此处不再赘述。
第十二方面,本申请实施例提供一种计算机程序产品,当计算机程序产品在电子设备上运行时,使得电子设备执行第一方面或第一方面中任意一种实施方式的方法;或者,使得电子设备执行第二方面或第二方面中任意一种实施方式的方法;或者,使得电子设备执行第三方面或第三方面中任意一种实施方式的方法。
第十二方面以及第十二方面中任意一种实现方式所对应的技术效果,可参见上述第一方面及第一方面中任意一种实现方式所对应的技术效果,或者,参见上述第二方面及第二方面中任意一种实现方式所对应的技术效果,或者,参见上述第三方面及第三方面中任意一种实现方式所对应的技术效果,此处不再赘述。
第十三方面,本申请实施例提供一种电路系统,电路系统包括处理电路,处理电路被配置为执行第一方面或第一方面中任意一种实施方式的方法;或者,处理电路被配置为执行第二方面或第二方面中任意一种实施方式的方法;或者,处理电路被配置为执行第三方面或第三方面中任意一种实施方式的方法。
第十三方面以及第十三方面中任意一种实现方式所对应的技术效果,可参见上述第一方面及第一方面中任意一种实现方式所对应的技术效果,或者,参见上述第二方面及第二方面中任意一种实现方式所对应的技术效果,或者,参见上述第三方面及第三方面中任意一种实现方式所对应的技术效果,此处不再赘述。
第十四方面,本申请实施例提供一种芯片系统,包括至少一个处理器和至少一个接口电路,至少一个接口电路用于执行收发功能,并将指令发送给至少一个处理器,当至少一个处理器执行指令时,至少一个处理器执行第一方面或第一方面中任意一种实施方式的方法;或者,至少一个处理器执行第二方面或第二方面中任意一种实施方式的方法;或者,至少一个处理器执行第三方面或第三方面中任意一种实施方式的方法。
第十四方面以及第十四方面中任意一种实现方式所对应的技术效果,可参见上述第一方面及第一方面中任意一种实现方式所对应的技术效果,或者,参见上述第二方面及第二方面中任意一种实现方式所对应的技术效果,或者,参见上述第三方面及第三方面中任意一种实现方式所对应的技术效果,此处不再赘述。
附图说明
图1为本申请实施例提供的一种现有的设备发现方法的示意图;
图2为本申请实施例提供的一种设备静态标签的示意图;
图3为本申请实施例提供的一种场景示意图;
图4为本申请实施例提供的一种设备的结构示意图;
图5为本申请实施例提供的一种设备的软件系统的示意图;
图6为本申请实施例提供的一种设备发现方法的流程图;
图7为本申请实施例提供的一种设备发现方法的示意图;
图8为本申请实施例提供的另一种设备发现方法的流程图;
图9为本申请实施例提供的另一种设备发现方法的流程图;
图10为本申请实施例提供的第一设备的结构示意图;
图11为本申请实施例提供的第二设备的结构示意图;
图12为本申请实施例提供的第三设备的结构示意图。
具体实施方式
为了方便理解本申请实施例的技术方案,首先给出本申请相关技术的简要介绍或定义如下。
在本申请实施例的描述中,除非另有说明,“/”表示或的意思,例如,A/B可以表示A或B;本文中的“和/或”仅仅是一种描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。以下,术语“第一”、“第二”仅用于描述目的,而不能理解为指示或暗示相对重要性或者隐含指明所指示的技术特征的数量。由此,限定有“第一”、“第二”的特征可以明示或者隐含地包括一个或者更多个该特征。在本申请实施例的描述中,除非另有说明,“多个”的含义是两个或两个以上。另外,“示例性的”或者“例如”等词用于表示作例子、例证或说明。本申请实施例中被描述为“示例性的”或者“例如”的任何实施例或设计方案不应被解释为比其它实施例或设计方案更优选或更具优势。确切而言,使用“示例性的”或者“例如”等词旨在以具体方式呈现相关概念。
随着终端技术的发展,多个终端设备可以通过分布式组网实现多设备互联,执行分布式业务,以提供多样的服务。其中,分布式组网是多个设备之间通过标准的蓝牙、无线保真(wireless fidelity,WiFi)、以太网等方式建立起通信连接。分布式组网的一 个重要环节是设备发现,设备发现过程可以基于短距通信技术来快速实现,从而建立设备之间的连接。
如图1所示,现有技术提供的一种设备发现方法的流程具体包括如下步骤:
S101、第一设备预先获取目标设备的连接信息。
示例性的,目标设备上有如图2所示的静态标签,静态标签包含目标设备的连接信息。其中,该连接信息可以为第一类信息,例如:网络互联协议(Internet protocol,IP)、IP+端口号、媒体访问控制(media access control,MAC)地址等。该连接信息还可以为第二类信息,如一些属性信息,例如:设备的序列号(serial number,SN)或唯一设备识别码(unique device identifier,UDID)等。第一设备可以通过近场通讯(near field communication,NFC)碰一碰、二维码扫描、蓝牙靠近等短距通信技术读取静态标签中目标设备的连接信息。
针对上述第一类信息,第一设备可以直接根据该连接信息与目标设备连接,也即实现直连。针对上述第二类信息,第一设备无法与目标设备直连,还需要进一步进行设备信息的匹配过程,也即以下步骤:
S102、第一设备向包括目标设备的周围各设备(为便于描述本申请将这些设备描述为第二设备)发送设备发现请求消息,该设备发现请求消息用于请求发现目标设备。
S103、各个第二设备收到该广播后分别向第一设备发送第一响应消息,第一响应消息用于与第一设备建立连接。
S104、第一设备根据第一响应消息与第二设备建立连接。
S105、第一设备通过与第二设备之间建立的连接向第二设备发送请求消息,该请求消息用于请求第二设备的设备信息,如设备标识等。
S106、第二设备收到请求消息后向第一设备发出第二响应消息,第二响应消息包含第二设备本机的设备信息。
S107、第一设备将各个第二设备发送的第二响应消息中的设备信息与通过S101读取到目标设备的设备信息进行匹配,确认匹配成功的设备为目标设备。
S108、第一设备读取该目标设备发送的第二响应消息中包含的连接信息。
S109、根据该连接信息与目标设备建立直连。
需要说明的是,图1中仅示例性的以设备A作为第一设备(图中标记为第一设备A),设备B、C、D作为第二设备,以设备C作为目标设备进行说明。
在现有技术提供的上述方法中,第一设备需要与周围的各设备分别建立连接,并分别与各设备进行交互请求设备信息,将接收到的各设备的信息与目标设备的信息进行一一匹配。随着设备数量的增长,现有的设备发现方式,面临发现性能差,时延过长,功耗较大等问题。例如:随着鸿蒙操作系统(operation system,OS)生态的拓展,分布式组网作为鸿蒙分布式业务的基础底座,面临着越来越复杂的使用场景、日渐增多的设备类型和数量、以及基础通信协议的不稳定等诸多挑战。当前的方案无法满足鸿蒙分布式能力规模化部署对低功耗、低负载、高可靠可用的核心诉求。
为解决上述问题,本申请提供一种设备发现方法,该方法应用于由多个设备组成的系统中(本申请实施例也可以将该系统描述为分布式设备集群),多设备协同为用户服务的过程中。
在分布式设备集群中,多个设备之间通过WiFi、标准蓝牙、以太网、电力线通信(power line communication,PLC)等方式连接。
示例性的,分布式设备集群可以包括图3所示的智能手机、电视机、无线耳机、智能手表、智能手环、音响、个人电脑(personal computer,PC)(如笔记本电脑、台式电脑、超级移动个人计算机(ultra-mobile personal computer,UMPC)等)、平板电脑、增强现实(augmented reality,AR)/虚拟现实(virtual reality,VR)设备、物联网(internet of things,IoT)设备(如智能家居设备)。其中,IoT设备是未来信息技术发展的重要组成部分,其主要技术特点是将物品通过通信技术与网络连接,从而实现人机互连,物物互连的智能化网络。
示例性的,IoT设备可以包括但不限于用于安防的报警器、智能门锁等设备;用于照明的智能台灯等设备;用于健康的新风系统、空调、冰箱、空气净化器、空气质量传感器等设备;用于厨电的洗碗机、消毒柜等设备;用于家装的电动窗帘等设备;或者用于清洁的扫地机器人等设备。
需要说明的是,本申请图3仅作为一种分布式设备集群架构示例,本申请并不限定分布式设备集群的具体架构。
例如,分布式设备集群中可以包括“1+8+N”终端产品。其中,“1+8+N”终端产品用于打造第五代移动通信技术(fifth-generation,5G)全场景智慧生活以及下一代等后续的移动通信技术。示例性的,“1”是指智能手机,即未来智慧生活的入口;“8”是指平板电脑、PC、可穿戴设备、高清(high-definition,HD)设备、人工智能(artificial intelligence,AI)音箱、耳机、AR/VR设备、车机设备;“N”泛指IoT设备,例如智能家居设备。
其中,在本申请实施例中,多设备协同是指多设备(如分布式设备集群中的终端设备)通过协作,提供跨平台、跨系统的服务。
例如,多设备协同可以提供多屏协作(multi-screen collaboration)的服务。示例性的,多屏协作服务可以如投屏(如视频投屏、图片投屏等)、远程屏幕控制等。作为一种示例,多屏协作的投屏方式可以包括但不限于同源投屏、异源投屏等方式,本申请实施例不限定。
又如,多设备协同可以提供文件共享。例如,通过设备共享服务可以实现多设备之间图片、视频、音频等文件的任意共享。又如,通过运动健康服务等设备共享服务可以实现可穿戴设备(如智能手表、智能手环等)与便携设备(如智能手机、平板电脑等)之间的运动数据(如速度、运动时间等)、身体指标(如心率、血压等)、睡眠指标(如入睡时刻、总睡眠时间、深度睡眠时间等)等的共享。
在本申请实施例中,多设备协同的必要环节是设备发现。例如,设备发现由发现设备发起,设备发现用于发现指定设备(即被发现设备),例如特定设备标识的设备、能提供特定服务的设备、登录同一账号的设备,以便被发现设备能够和发现设备协同,以提供投屏(如视频投屏、图片投屏等)、远程屏幕控制、投音、文件共享等服务。
其中,发现设备和被发现设备可以是分布式设备集群中的任意设备。例如,发现设备和被发现设备可以包括但不限于桌面型设备、膝上型设备、手持型设备、可穿戴设备、智能家居设备、计算设备、车载型设备、机载型设备、工业设备等。例如,智 能手机、上网本、平板电脑、智能手表、智能手环、电话手表、PC、无线耳机、电视机、音响、智能相机、体感游戏机、个人数字助理(personal digital assistant,PDA)、便携式多媒体播放器(portable multimedia player,PMP)、AR/VR设备、会话启动协议(session initiation protocol,SIP)电话、IOT终端设备、智慧城市(smart city)中的无线设备、智慧家庭(smart home)中的无线设备等,本申请不限定。
以图3所示分布式设备集群架构为例,发现设备和被发现设备可以是图3所示分布式设备集群中的智能手机、平板电脑、PC等任意设备。
由于分布式设备集群中,能够提供指定服务的设备可能有多个,因此以图3所示分布式设备集群架构为例,发现设备通过设备发现,能够发现的被发现设备可以包括图3所示分布式设备集群中的智能手机、平板电脑、PC等任意一个或多个设备。即,发现设备通过设备发现,能够发现一个或多个指定的被发现设备。
本申请实施例提供的设备发现方法可用于任一通信系统,该通信系统可以为短距通信系统、蜂窝通信系统(例如,长期演进(long term evolution,LTE)系统、新空口(new radio access technology,NR))、全球互联微波接入(worldwide interoperability for microwave access,WiMAX)通信系统以及各种类型的下一代通信系统(例如,第六代(the sixth generation,6G)移动通信系统)等,不予限制。其中,短距通信系统可以为蓝牙通信系统、低功耗蓝牙通信系统、无线保真(wireless-fidelity,Wi-Fi)通信系统以及各种类型的下一代短距通信系统等,不予限制。
图4为本申请实施例提供的一种设备400的组成示意图,该设备400可以为分布式设备集群中的任一设备或者该设备中的芯片或者片上系统。如图4所示,该设备400包括处理器401,收发器402以及通信线路403。
进一步的,该设备400还可以包括存储器404。其中,处理器401,存储器404以及收发器402之间可以通过通信线路403连接。
其中,处理器401是中央处理器(central processing unit,CPU)、通用处理器网络处理器(network processor,NP)、数字信号处理器(digital signal processing,DSP)、微处理器、微控制器、可编程逻辑器件(programmable logic device,PLD)或它们的任意组合。处理器401还可以是其它具有处理功能的装置,例如电路、器件或软件模块,不予限制。
收发器402,用于与其他设备或其它通信网络进行通信。该其它通信网络可以为以太网,无线接入网(radio access network,RAN),无线局域网(wireless local area networks,WLAN)等。收发器402可以是模块、电路、收发器或者任何能够实现通信的装置。
通信线路403,用于在设备400所包括的各部件之间传送信息。
存储器404,用于存储指令。其中,指令可以是计算机程序。
其中,存储器404可以是只读存储器(read-only memory,ROM)或可存储静态信息和/或指令的其他类型的静态存储设备,也可以是随机存取存储器(random access memory,RAM)或可存储信息和/或指令的其他类型的动态存储设备,还可以是电可擦可编程只读存储器(electrically erasable programmable read-only memory,EEPROM)、只读光盘(compact disc read-only memory,CD-ROM)或其他光盘存储、光碟存储(包 括压缩光碟、激光碟、光碟、数字通用光碟、蓝光光碟等)、磁盘存储介质或其他磁存储设备等,不予限制。
需要指出的是,存储器404可以独立于处理器401存在,也可以和处理器401集成在一起。存储器404可以用于存储指令或者程序代码或者一些数据等。存储器404可以位于设备400内,也可以位于设备400外,不予限制。处理器401,用于执行存储器404中存储的指令,以实现本申请下述实施例提供的设备发现方法。
在一种示例中,处理器401可以包括一个或多个CPU,例如图4中的CPU0和CPU1。
作为一种可选的实现方式,设备400包括多个处理器,例如,除图4中的处理器401之外,还可以包括处理器407。
作为一种可选的实现方式,设备400还包括输出设备405和输入设备406。示例性地,输入设备406是键盘、鼠标、麦克风或操作杆等设备,输出设备405是显示屏、扬声器(speaker)等设备。
需要指出的是,设备400可以是台式机、便携式电脑、网络服务器、移动手机、平板电脑、无线终端、嵌入式设备、芯片系统或有图4中类似结构的设备。此外,图4中示出的组成结构并不构成对该设备的限定,除图4所示部件之外,该设备可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件布置。
本申请实施例中,芯片系统可以由芯片构成,也可以包括芯片和其他分立器件。
此外,本申请的各实施例之间涉及的动作、术语等均可以相互参考,不予限制。本申请的实施例中各个设备之间交互的消息名称或消息中的参数名称等只是一个示例,具体实现中也可以采用其他的名称,不予限制。
本申请实施例还提供一种软件系统架构。如图5所示,该软件系统架构包括应用程序(application,APP)层501、设备管理(device manage,DM)模块502、通信模块503和存储模块504。
其中,应用程序层501包括一系列应用程序包,例如相机,图库,日历,通话,地图,导航,蓝牙,音乐,视频,短信息等应用程序。
应用程序层501与设备管理模块502之间通过设备管理接口(device manage application interface,DM API)505通信。
通信模块503,设备通过该通信模块503与其他设备交互。示例性的,该通信模块503具体可以实现为分布式软总线(distributed softbus)。设备可以通过分布式软总线与其他设备交互,例如:通过分布式软总线与其他设备之间交互报文。示例性的,该报文为用户数据协议(user datagram protocol,UDP)报文。该通信模块还可以是蓝牙模块等。
存储模块504,用于存储设备的一些数据和程序。其中,数据包括设备信息和用户信息等,可以存储在特定文件中。示例性的,该设备信息包括设备标识、设备厂商、设备型号等,该设备信息可以存储在开机启动文件等文件中;使用该设备的用户信息包括登录该设备的用户账户信息等,也可以存储在特定文件中。
本申请实施例中,当设备作为发现设备(也即需要发现其他设备的设备,前文所述的第一设备)时,该设备应用程序层501的应用程序指定要发现的目标设备的信息作为特征值。如:比如某个应用可以读取静态标签的值,把SN从静态标签读出来, 调用DM发现这个SN的第二设备。再比如应用也可以配置好周边设备的UDID(可由应用的管理员配置),然后由APP发起针对特定UDID的发现。之后,应用程序层的应用程序可将该特征值通过DM API发送给设备管理模块502。之后,设备管理模块502通过通信模块503(例如蓝牙)将该特征值发送给其他设备。当设备作为被发现设备(前文所述的第二设备)时,设备管理模块502能够通过通信模块接收第一设备发送的发现请求消息,从存储模块504中读取设备信息和用户信息等本机信息,进而将读取到的本机信息与发现请求消息中携带的特征值进行比较,确定自身是否为第一设备要发现的目标设备。如果确定本机为目标设备,则本机从第一设备发送的广播头(header)中提取第一设备的连接地址(该连接地址可以为蓝牙、IP、MAC地址中的任意一个),根据该连接地址与第一设备建立连接;或者,如果确定本机为目标设备,则本机向第一设备回复响应广播,在该广播中携带本机的设备信息,从而将本机的设备信息回传给第一设备。
可选的,设备中如果包含低功耗器件,该低功耗器件中可以设置有存储模块。这样,在接收到其他设备的发现请求消息后,可以无需唤醒设备管理模块502,而是由低功耗器件将发现请求消息中携带的目标设备的特征值与本机特征值进行匹配。
为了实现本申请实施例提供的方法,本申请实施例中的设备可预先配置第一预设协议和第二预设协议。其中,当某个设备作为发现设备(前文所述第一设备)时,为了支持其功能,该设备可预先配置第一预设协议。当某个设备作为被发现设备(前文所述第二设备)时,为了支持其功能,该设备可预先配置第二预设协议。实际应用中,某个设备在一些场景下为发现设备,在另一些场景下为被发现设备。因此,其一般可预先同时配置第一预设协议和第二预设协议。
可选的,本申请实施例中将第一预设协议描述为基于短路径设备发现(short-path device discovery,SPDD)协议,该协议是在现有的发现协议的基础上进行改进,对现有协议中的一些自定义字段进行设置。该现有发现协议例如可以为蓝牙低功耗(bluetooth-low-energy,BLE)或者约束应用协议(constrained application protocol,CoAP)等。其中,BLE、CoAP等协议的具体实现可参考现有技术,此处不再赘述。
在一种可能的实现方式中,所述第一预设协议中的第一字段包括广播类型和特征码;所述广播类型为设备发现;所述特征码用于表示所述特征值的类型;所述第一预设协议的第二字段包括所述特征值的取值。
示例性的,以该SPDD协议是在BLE协议基础上进行改进为例,对BLE协议的能力(capablity)字段进行如下设置:
表1

如表1所示,SPDD协议中包括capablity filter字段,该字段的高2位的取值表示在特定的extension(此时为设备发现)的广播类型下具体的广播模式,一次只能发送一个特定模式,如00表示采用默认发现方式(例如:现有技术中的发现方式),01表示采用本申请实施例提供的发现方式;该字段的低6位则表示基于哪个特征来确定要发现的设备(本申请描述为特征码),如000010表示以sn这一特征值进行设备发现,对应的spdd serial number字段为该特征值的具体取值;000100表示以udid这一特征值进行设备发现,对应的spdd udid number字段为该特征值的具体取值;001000表示以account这一特征值进行设备发现,对应的spdd account number字段为该特征值的具体取值。此外,特征值还可以为设备类型、设备名称、登录账号、业务标识等,第一设备发送的广播中携带的发现请求消息满足该协议的格式要求,其中特征值表示按照该特征值进行匹配。
在本申请的一些实施例中,有些设备作为代理设备可以将第一设备发送的请求消息转发给其他设备。这些设备实现该功能前提是其具体代理功能,因此,该协议还提供用于表明该设备是否开启代理功能的字段。示例性的,如表1中所示,spdd_discovery_proxy字段的取值用于表示是否启动代理发现功能;当该字段的取值为0时代表关闭代理功能,当该字段的取值为1时代表开启代理功能。
需要说明的是,TLV字段可以是将设备类型、设备标识、设备名称、业务标识等采用哈希等加密算法加密后得到。
在一种可能的实现方式中,所述第二设备配置有第二预设协议;其中,所述第二预设协议中的第一字段包括是否开启代理功能;第二字段包括所述特征值的取值。
示例性的,仍然以该SPDD协议是在BLE协议基础上进行改进为例,第二设备需 要配置以下信息:
表2
该表2中各个字段的说明参考前文所述,此处不再赘述。
需要说明的是,该表2中的各个字段为设备本地配置。
以下将结合附图,对本申请实施例提供的一种设备发现方法作具体的介绍。如图6所示,本申请实施例提供的一种设备发现方法可以包括以下S601-S603。
S601、第一设备向至少一个第二设备发送发现请求消息。相应的,第二设备接收来自第一设备的发现请求消息。
可选的,第二设备的数量为多个,那么,第一设备向所述多个第二设备发送广播报文,该广播报文用于承载所述请求消息。
其中,发现请求消息包括第一设备预先获取的目标设备的特征值。目标设备的特征值用于表示第一设备要发现的设备(目标设备)所具备的特征,例如设备标识为某个标识,登录的用户账户为某个账户,厂商为某个厂商等。收到所述请求消息的设备可以将本机的特征值与所述目标设备的特征值进行匹配。与该特征值匹配的目标设备可以为一个或多个。
在一些实施例中,所述特征值为第一设备信息;所述第一设备信息包括设备标识、设备类型、设备名称、登录所述设备的用户信息和业务标识中的一项或多项。例如设备的序列号(serial number,SN)或唯一设备识别码(unique device identifier,UDID)等。
示例性的,目标设备上有包含其特征值的静态标签。第一设备可以通过NFC碰一碰、二维码扫描、蓝牙靠近等短距通信技术读取静态标签中目标设备的特征值。
第一设备获取目标设备的特征值,还可以为用户直接在第一设备中输入等其他方式。例如:第一设备中安装有多设备协同这一应用,用户打开该应用,在该应用提供的界面中输入要发现的目标设备的特征值,例如:登录账户为账户A。本申请实施例不限定第一设备获取目标设备的特征值的具体实现方式。
需要说明的是,第一设备预先获取目标设备的特征值的方法不限于上述示例,本申请对此不作限定。
可选的,在本申请实施例中,可以采用预设加密算法对设备的特征值(例如设备的序列号(serial number,SN)、国际移动设备识别码(international mobile equipment identity,IMEI)等)进行加密。其中,预设加密算法例如可以是RSA3072、HmacSHA256 等加密算法。例如,在采用某个加密算法进行加密时,可以以该加密算法提供的公钥和公钥的前X个字节作为参数,对设备的SN计算哈希值(hash code),取计算得到的哈希值的前Y个字节作为该设备的唯一标识。由于哈希值不易识别以及不易被反解析,因此使用哈希值作为设备的唯一标识,提升了设备发现过程以及连接过程中的安全问题。
S602、第二设备将接收到的发现请求消息中的目标设备的特征值与本机的特征值进行匹配。
其中,本机的特征值存储在本地文件中,第二设备读取本地文件中存储的本机的特征值,并将发现请求消息中的目标设备的特征值与本机的特征值进行匹配。如果匹配成功,则表明该第二设备则为第一设备想要发现的设备,也即目标设备。那么,第二设备执行下述S603。
在本申请的一些实施例中,如果匹配失败,则第二设备丢弃所述发现请求消息。
可选的,第二设备配置有低功耗器件,那么可在低功耗器件中存储本机的特征值,进而由低功耗器件执行该S602以及后续步骤。这样,可以实现在设备免唤醒处理器的情况下由低功耗器件进行特征值匹配,减少耗时,降低功耗。
需要说明的是,如前文所述,本申请实施例中的特征值可以是设备信息,也可以是将设备信息加密后得到。
S603、第二设备向第一设备发送响应消息。相应的,第一设备接收来自第二设备的响应消息。
其中,响应消息包括目标设备也即匹配成功的第二设备的第二设备信息。匹配成功的第二设备可以直接回复响应消息,在响应消息中携带本机的设备信息,设备信息可以包括设备标识、连接信息,如IP地址、MAC地址等,本申请不做限定。
在本申请的一些实施例中,第二设备作为目标设备也可以与第一设备先建立连接,之后通过该连接,第二设备和第一设备之间交换设备信息。
具体的,第一请求消息中包括第一设备的连接信息。示例性的,该连接信息可以为蓝牙地址、网络互联协议(Internet protocol,IP)、IP+端口号、媒体访问控制(media access control,MAC)地址等。那么目标设备收到该第一请求消息后,向第一设备回复响应消息的方式可以包括以下两种:
第一种,第二设备作为目标设备根据第一设备的连接信息向第一设备发送连接请求。相应的,第一设备接收目标设备发送的连接请求,并根据该连接请求与目标设备建立第一连接。进而,第一设备通过该第一连接接收目标设备发送的第一响应消息;该第一响应消息包括目标设备的第二设备信息。
在该实现方式中,目标设备先根据第一设备的连接信息回连第一设备,然后通过该连接向第一设备发送其本机的设备信息。
第二种,第二设备作为目标设备根据第一设备的连接信息向第一设备发送第一响应消息,相应的,第一设备接收来自目标设备的第一响应消息。其中,该第一响应消息为目标设备根据第一设备的连接信息发送的连接请求。该第一响应消息中包括目标设备的第二设备信息。
在该实现方式中,目标设备根据第一设备的连接信息回连第一设备,并在连接请 求中直接携带其本机的设备信息,这样目标设备直接在连接请求中携带本机的设备信息,而无需先建立连接再通过该连接再发送本机的设备信息,能够减少第一设备和目标设备的交互,进而进一步减少时延。
通过上述S602和S603,在接收到来自第一设备的设备发现请求消息的一个或多个第二设备中,只有匹配成功的第二设备向第一设备发出响应消息,匹配成功的第二设备即为第一设备要发现的目标设备。
之后,第一设备可读取该响应消息中的设备信息,如连接信息,第一设备根据该连接信息与目标设备建立连接,其具体实现可参考现有技术,此处不再赘述。
需要说明的是,为便于描述,本申请中还可将S601-S603中的发现请求消息描述为第一请求消息;将其中的响应消息描述为第一响应消息。
示例性的,如图7所示,设备A向周围设备发送设备发现请求消息(图中虚线),设备发现请求消息中携带有目标设备的特征值。设备B、设备C、设备D、设备E和设备F接收到广播后,分别将接收到的目标设备的特征值与本机的特征值进行匹配。设备B、设备C、设备D和设备F匹配不成功,则将广播丢弃。匹配成功的设备E与设备A交换设备信息(图中实线)。
示例性的,分布式集群中包括手机、智能冰箱、电视、PC、智能空调、智能音箱等设备。智能音箱上贴有静态标签,手机扫描该静态标签后,读取到智能音箱上标签中包含的设备信息,该设备信息为智能音箱的SN,不包含该智能音箱的连接地址。那么,手机无法和智能音箱直连,则手机向分布式集群中的各个设备发送广播,广播中携带智能音箱的SN。各个设备收到广播后,将广播中的SN与本机的SN进行匹配。经匹配,智能冰箱、电视、PC均匹配失败,则这些设备丢弃该广播。只有智能音箱匹配成功,那么智能音箱向手机发送响应消息,在该响应消息中携带其本机的设备信息,如连接地址等。手机收到该响应消息后仅与智能音箱建立连接,完成设备发现过程。
示例性的,分布式集群中包括手机、智能冰箱、电视、PC、智能空调、智能音箱等设备。其中,手机、PC、电视的登录账户都为账户A,智能空调的登录账户为账户B,智能音箱的登录账户为账户C。如果用户A想要通过手机与该用户所登录的其他设备交互,那么手机需要先发现PC和电视。采用本申请实施例的方法,手机向分布式集群中的所有设备发送广播,广播中携带的特征值为账户A。各个设备收到该广播后,由于智能空调和智能音箱的登录账户不是账户A,则丢弃该广播。电视和PC则向手机发送响应消息,该响应消息中包括其设备信息,手机可读取该设备信息分别与电视和PC建立连接,完成设备发现过程。
本申请实施例中,第一设备发送的设备发现请求消息中携带有目标设备的特征值,第二设备将该目标设备的特征值与本机的特征值进行匹配,只有匹配成功的第二设备向第一设备发出响应消息,因此可以避免第一设备与非目标设备建立连接。而现有技术中,针对每个接收到广播的设备,第一设备都需要和其交换设备信息、建立连接,该过程耗时较长。本申请提供的方法可以减少设备发现的耗时。
此外,如前文所述,如果第二设备具备低功耗器件,那么匹配过程可在低功耗器件上进行,免唤醒设备的处理器,能够进一步减少耗时,降低功耗。
在有些场景下,第一设备和目标设备无法直连,也即第一设备发送的发现请求消 息无法直接到达目标设备,需要通过代理设备进行代理转发。在该场景下,分布式设备集群中包括第一设备、第二设备和第三设备。其中,第一设备与第三设备不能直接连接,第一设备与第二设备、第二设备与位于同一子网内的第三设备可以直接连接,连接方式包括蓝牙连接、WIFI连接、以太网连接、PLC等。在该场景下,部分或全部第二设备可以作为代理设备,作为代理设备的第二设备可以向与其位于同一子网内的第三设备转发第一设备发送的发现请求消息。例如,分布式集群中包含设备A、B、C、D、E、F、G等设备,其中设备B、C和D位于同一子网,E、F、G位于同一子网。A、B、E之间可以互相通信。那么,A作为第一设备如果想发现设备C,则A以广播方式发送的发现请求消息无法直接发送给C,而是A将该发现请求消息发送给B,由B作为代理设备将该发现请求消息转发给C和D。
基于该场景,如图8所示,本申请实施例提供的设备发现方法具体包括以下步骤:
S801、第一设备向第二设备发送第一请求消息。相应的,第二设备接收来自第一设备的第一请求消息,
其中,所述第一请求消息包括目标设备的特征值。
该步骤的具体实现可参考前述S601,此处不再赘述。
S802、第二设备将目标设备的特征值与本机设备的特征值进行匹配。
该步骤的具体实现可参考前述S602,此处不再赘述。
如果匹配成功则第二设备执行S803。
此外,如果第一请求消息中指示将该第一请求消息通过代理转发,那么第二设备开启了代理功能,则第二设备作为代理设备,将该发现请求消息转发给其他设备(本申请描述为第三设备)。第二设备收到第一设备发送的第一请求消息后,在第一请求消息指示将该请求消息通过代理转发给其他设备,且第二设备确定开启代理功能的情况下,第二设备直接将第一请求消息转发给与该第二设备位于同一子网内的第三设备。也即第二设备还要执行下述S804-S807。
S803、第二设备向所述第一设备发送第一响应消息;所述第一响应消息包括所述目标设备的第二设备信息。
该步骤的具体实现过程可参考前述S603,此处不再赘述。
S804、第二设备在确定开启代理功能的情况下,向与该第二设备位于同一子网内的第三设备发送第二请求消息。
其中,第二请求消息中同样包括目标设备的特征值。可选的,第二请求消息还可包括第二设备的连接信息等。
示例性的,第二设备可以通过广播发送所述第二请求消息。
其中,第二设备通过本地检查是否配置了代理发现配置项,以及代理发现服务是否处于开启状态。在第二设备的代理发现服务开启的状态下确定已开启代理功能。
S805、第三设备将接收到的第二请求消息中的目标设备的特征值与本机的特征值进行匹配。
该步骤的具体实现可参考前述S602,此处不再赘述。
如果匹配成功则该第三设备为目标设备,因此执行下述S806,如果匹配失败,则第三设备丢弃第二请求消息。
S806、第三设备向第二设备发送第二设备信息。相应的,第二设备接收第三设备的第二设备信息。
其中,本实施例中,该步骤所指的第二设备也可描述为目标第二设备。该目标第二设备是指与目标设备位于同一子网内的第二设备。
在接收到来自第二设备的第一请求消息中的一个或多个第三设备中,只有匹配成功的第三设备向第二设备发出响应消息,匹配成功的第三设备即为第一设备要发现的目标设备。
S807、第二设备向第一设备发送第三响应消息。相应的,第一设备接收来自第二设备的第三响应消息。
其中,第三响应消息包括目标设备的第二设备信息,例如设备标识、连接地址等。
在一些实施例中,匹配成功的第三设备可以直接回复第三响应信息(包含第三设备的第二设备信息)并由第二设备直接转发给第一设备;或者由第二设备和第一设备之间建立连接后,通过该连接转发给第一设备。
在另一些实施例中,匹配成功的第三设备作为目标设备也可以与第二设备建立连接,第二设备与第一设备建立连接。第三设备通过第二设备与第一设备交换设备信息。也即如图9所示,S806和S807可以实现为以下步骤:
S901、目标设备向第二设备发送第二响应消息,相应的,第二设备接收该第二响应消息。
其中,所述第二响应消息为所述目标设备根据所述第二设备的连接信息发送的连接响应消息,用于与所述第二设备建立连接。
S902、第二设备与第一设备建立第一连接,与目标设备建立第二连接。
S903、第二设备通过所述第一连接接收所述第一设备的第三请求消息,并通过所述第二连接向所述目标设备转发所述第三请求消息;其中,所述第二请求消息用于请求所述目标设备的信息。
S904、第二设备通过第二连接接收所述目标设备发送的第二设备信息(图中描述为设备信息)。
S905、第二设备通过所述第一连接向所述第一设备发送第三响应消息。
需要说明的是,本申请不限定第二设备执行特征值匹配和第三设备执行特征值匹配的过程的先后顺序。也即本申请不限定执行S804-S807的过程和执行S802的过程的顺序。
第二设备如果其本机的特征值匹配成功和/或与该第二设备位于同一子网内的一个或多个第三设备的特征值与目标设备的特征值匹配成功,则第二设备都会给第一设备回复响应消息。
在本申请实施例的另一些实施例中,如果特征值为设备标识等唯一标识某个特定设备的标识,则第二设备在执行S802,将本机的特征值与目标设备的特征值匹配成功后,说明该第二设备则为目标设备,无需转发给子网内的其他设备,也即S804-S807可以在第二设备将本机的特征值与目标设备的特征值匹配失败的情况下执行。
还需要说明的是,图8和图9中均以第二设备为1个,该第二设备和三个第三设备组成1个子网为例进行说明。实际应用中,第二设备可以有多个,有些第二设备可 以作为代理设备与第三设备位于同一子网,有些第二设备则未与第三设备连接。作为代理设备的第二设备则都执行上述过程。
示例性的,手机、平板处于一个网络A,而平板和蓝牙耳机通过蓝牙直接连接(网络B),那么手机如果要访问蓝牙耳机,手机和蓝牙耳机之间无法直接连接,此时手机可以通过平板作为中间代理设备,即手机先和平板建立连接,平板和蓝牙耳机再建立连接,这样平板代理转发手机的发现广播,进行广播消息的转发和回传,以及连接传输的中转和回传,从而实现子网穿透,使手机可以发现不在同一子网的蓝牙耳机。
在本申请的上述实施例二提供的方法中,第一设备可通过第二设备的代理发现服务,扩大发现设备的范围,发现到与第一设备位于不同子网的目标设备,使得设备发现技术方案可以应对更加现实、复杂的组网环境,实现更加普适性的设备发现能力。
以上结合详细说明了本申请实施例提供的设备发现方法。以下详细说明本申请实施例提供的投屏装置。
在一种可能的设计中,图10为本申请实施例提供的第一设备的结构示意图。如图10所示,第一设备1000可以包括:收发单元1001和处理单元1002。
可选地,收发单元1001用于支持第一设备1000执行图6中的S601和S603;图8中的S801、S803。处理单元1002,用于支持第一设备1000执行图9中的S902。
其中,收发单元可以包括接收单元和发送单元,可以由收发器或收发器相关电路组件实现,可以为收发器或收发模块。第一设备1000中的各个单元的操作和/或功能分别为了实现上述方法实施例中所述的设备发现方法的相应流程,上述方法实施例涉及的各步骤的所有相关内容均可以援引到对应功能单元的功能描述,为了简洁,在此不再赘述。
可选地,图10所示的第一设备1000还可以包括存储单元(图10中未示出),该存储单元中存储有程序或指令。当收发单元1001和处理单元1002执行该程序或指令时,使得图10所示的第一设备1000可以执行上述方法实施例中所述的设备发现方法。
图10所示的第一设备1000的技术效果可以参考上述方法实施例中所述的设备发现方法的技术效果,此处不再赘述。
除了以第一设备1000的形式以外,本申请提供的技术方案也可以为第一设备中的功能单元或者芯片,或者与第一设备匹配使用的装置。
在一种可能的设计中,图11为本申请实施例提供的第二设备的结构示意图。如图11所示,第二设备1100可以包括:收发单元1101和处理单元1102。
可选地,收发单元1101,用于支持第二设备1100执行图6中的S601和S603、图8中的S801、S803、S804、S806、S807,图9中的S901、S903、S904。
可选地,处理单元1102,用于支持第二设备1100执行图6中的S602、图8中的S802、图9中的S902。
其中,收发单元可以包括接收单元和发送单元,可以由收发器或收发器相关电路组件实现,可以为收发器或收发模块。第二设备1100中的各个单元的操作和/或功能分别为了实现上述方法实施例中所述的设备发现方法的相应流程,上述方法实施例涉及的各步骤的所有相关内容均可以援引到对应功能单元的功能描述,为了简洁,在此不再赘述。
可选地,图11所示的第二设备1100还可以包括存储单元(图11中未示出),该存储单元中存储有程序或指令。当收发单元1101和处理单元1102执行该程序或指令时,使得图11所示的第二设备1100可以执行上述方法实施例中所述的设备发现方法。
图11所示的第二设备1100的技术效果可以参考上述方法实施例中所述的设备发现方法的技术效果,此处不再赘述。
除了以第二设备1100的形式以外,本申请提供的技术方案也可以为第二设备中的功能单元或者芯片,或者与第二设备匹配使用的装置。
在一种可能的设计中,图12为本申请实施例提供的第三设备的结构示意图。如图12所示,第三设备1200可以包括:收发单元1201和处理单元1202。第三设备1200可用于实现上述方法实施例中涉及的可信群组中已经与对端设备建立投屏连接的设备的功能。
可选地,收发单元1201,用于支持第三设备1200执行图8中的S804和S806,以及图9中的S901和S904。
可选地,处理单元1202,用于支持第三设备1200执行图8中的S805。
其中,收发单元可以包括接收单元和发送单元,可以由收发器或收发器相关电路组件实现,可以为收发器或收发模块。第三设备1200中的各个单元的操作和/或功能分别为了实现上述方法实施例中所述的设备发现方法的相应流程,上述方法实施例涉及的各步骤的所有相关内容均可以援引到对应功能单元的功能描述,为了简洁,在此不再赘述。
可选地,图12所示的第三设备1200还可以包括存储单元(图12中未示出),该存储单元中存储有程序或指令。当收发单元1201和处理单元1202执行该程序或指令时,使得图12所示的第三设备1200可以执行上述方法实施例中所述的设备发现方法。
图12所示的第三设备1200的技术效果可以参考上述方法实施例中所述的设备发现方法的技术效果,此处不再赘述。
除了以第三设备1200的形式以外,本申请提供的技术方案也可以为第三设备中的功能单元或者芯片,或者与第三设备匹配使用的装置。
本申请实施例还提供一种芯片系统,包括:处理器,所述处理器与存储器耦合,所述存储器用于存储程序或指令,当所述程序或指令被所述处理器执行时,使得该芯片系统实现上述任一方法实施例中的方法。
可选地,该芯片系统中的处理器可以为一个或多个。该处理器可以通过硬件实现也可以通过软件实现。当通过硬件实现时,该处理器可以是逻辑电路、集成电路等。当通过软件实现时,该处理器可以是一个通用处理器,通过读取存储器中存储的软件代码来实现。
可选地,该芯片系统中的存储器也可以为一个或多个。该存储器可以与处理器集成在一起,也可以和处理器分离设置,本申请实施例并不限定。示例性地,存储器可以是非瞬时性处理器,例如只读存储器ROM,其可以与处理器集成在同一块芯片上,也可以分别设置在不同的芯片上,本申请实施例对存储器的类型,以及存储器与处理器的设置方式不作具体限定。
示例性地,该芯片系统可以是现场可编程门阵列(field programmable gate array, FPGA),可以是专用集成芯片(AP设备plication specific integrated circuit,ASIC),还可以是系统芯片(system on chip,SoC),还可以是中央处理器(central processor unit,CPU),还可以是网络处理器(network processor,NP),还可以是数字信号处理电路(digital signal processor,DSP),还可以是微控制器(micro controller unit,MCU),还可以是可编程控制器(programmable logic device,PLD)或其他集成芯片。
应理解,上述方法实施例中的各步骤可以通过处理器中的硬件的集成逻辑电路或者软件形式的指令完成。结合本申请实施例所公开的方法步骤可以直接体现为硬件处理器执行完成,或者用处理器中的硬件及软件模块组合执行完成。
本申请实施例还提供一种计算机可读存储介质,该计算机可读存储介质中存储有计算机程序,当该计算机程序在计算机上上运行时,使得计算机执行上述相关步骤,以实现上述实施例中的设备发现方法。
本申请实施例还提供一种计算机程序产品,当该计算机程序产品在计算机上运行时,使得计算机执行上述相关步骤,以实现上述实施例中的设备发现方法。
另外,本申请实施例还提供一种装置。该装置具体可以是组件或模块,该装置可包括相连的一个或多个处理器和存储器。其中,存储器用于存储计算机程序。当该计算机程序被一个或多个处理器执行时,使得装置执行上述各方法实施例中的设备发现方法。
其中,本申请实施例提供的装置、计算机可读存储介质、计算机程序产品或芯片均用于执行上文所提供的对应的方法。因此,其所能达到的有益效果可参考上文所提供的对应的方法中的有益效果,此处不再赘述。
结合本申请实施例公开内容所描述的方法或者算法的步骤可以硬件的方式来实现,也可以是由处理器执行软件指令的方式来实现。软件指令可以由相应地软件模块组成,软件模块可以被存放于随机存取存储器(random access memory,RAM)、闪存、只读存储器(read only memory,ROM)、可擦除可编程只读存储器(erasable programmable ROM,EPROM)、电可擦可编程只读存储器(electrically EPROM,EEPROM)、寄存器、硬盘、移动硬盘、只读光盘(CD-ROM)或者本领域熟知的任何其它形式的存储介质中。一种示例性的存储介质耦合至处理器,从而使处理器能够从该存储介质读取信息,且可向该存储介质写入信息。当然,存储介质也可以是处理器的组成部分。处理器和存储介质可以位于专用集成电路(AP设备plication specific integrated circuit,ASIC)中。
通过以上的实施方式的描述,本领域技术人员可以清楚地了解到,为描述的方便和简洁,仅以上述各功能模块的划分进行举例说明。实际应用中,可以根据需要而将上述功能分配由不同的功能模块完成;即将装置的内部结构划分成不同的功能模块,以完成以上描述的全部或者部分功能。上述描述的系统,装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。
在本申请所提供的几个实施例中,应该理解到,所揭露的方法,可以通过其它的方式实现。以上所描述的装置实施例仅仅是示意性的。例如,所述模块或单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式;例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另外,所显 示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,模块或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。
计算机可读存储介质包括但不限于以下的任意一种:U盘、移动硬盘、只读存储器(read-only memory,ROM)、随机存取存储器(random access memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。
以上所述,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何在本申请揭露的技术范围内的变化或替换,都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以所述权利要求的保护范围为准。

Claims (26)

  1. 一种设备发现方法,其特征在于,应用于系统中,所述系统包括第一设备和至少一个第二设备;所述方法包括:
    所述第一设备向所述至少一个第二设备发送第一请求消息;所述第一请求消息包括目标设备的特征值;所述目标设备的特征值用于收到所述第一请求消息的设备将本机的特征值与所述目标设备的特征值进行匹配;
    所述第一设备接收来自所述目标设备的响应消息;所述响应消息为所述目标设备在将所述第一请求消息中的特征值与本机的特征值匹配成功后发送;所述响应消息中包括所述目标设备的第二设备信息。
  2. 根据权利要求1所述的设备发现方法,其特征在于,所述第二设备的数量为多个;所述第一设备向所述至少一个第二设备发送第一请求消息,包括:
    所述第一设备向所述多个第二设备发送广播报文,所述广播报文用于承载所述第一请求消息。
  3. 根据权利要求1或2所述的设备发现方法,其特征在于,所述目标设备为所述至少一个第二设备中的一个。
  4. 根据权利要求3所述的设备发现方法,其特征在于,所述第一请求消息中包括所述第一设备的连接信息;所述第一设备接收来自所述目标设备的响应消息,包括:
    所述第一设备接收所述目标设备根据所述第一设备的连接信息发送的连接请求;
    所述第一设备根据所述连接请求与所述目标设备建立第一连接;
    所述第一设备通过所述第一连接接收所述目标设备发送的第一响应消息;所述第一响应消息包括所述目标设备的第二设备信息;
    或者,
    所述第一设备接收来自所述目标设备的第一响应消息;所述第一响应消息为所述目标设备根据所述第一设备的连接信息发送的连接请求;所述第一响应消息中包括所述目标设备的第二设备信息。
  5. 根据权利要求1或2所述的设备发现方法,其特征在于,所述系统还包括至少一个第三设备;所述系统包括至少一个子网;每个子网中包括第二设备和第三设备;所述第一设备通过所述第二设备与位于子网内的第三设备通信;所述目标设备为第三设备;
    所述第一设备接收来自所述目标设备的响应消息,包括:
    所述第一设备接收目标第二设备发送的第三响应消息;其中,所述目标第二设备为所述目标设备所在的子网内的第二设备;所述第三响应消息中包括所述目标设备的第二设备信息。
  6. 根据权利要求1至5任一项所述的设备发现方法,其特征在于,所述特征值为第一设备信息;所述第一设备信息包括设备标识、设备类型、设备名称、登录所述设备的用户信息和业务标识中的一项或多项。
  7. 根据权利要求1至6任一项所述的设备发现方法,其特征在于,所述第一设备配置有第一预设协议;其中,所述第一预设协议中的第一字段包括广播类型和特征码;所述广播类型为设备发现;所述特征码用于表示所述特征值的类型;所述第一预设协议的第二字段包括所述特征值的取值。
  8. 一种设备发现方法,其特征在于,应用于系统中,所述系统包括第一设备和至少一个第二设备;所述方法包括:
    所述第二设备接收来自所述第一设备的第一请求消息,所述第一请求消息包括目标设备的特征值;
    若所述目标设备的特征值与本机的特征值匹配成功,则所述第二设备向所述第一设备发送第一响应消息;所述第一响应消息包括所述目标设备的第二设备信息。
  9. 根据权利要求8所述的设备发现方法,其特征在于,所述第二设备的数量为多个;所述第二设备接收来自所述第一设备的第一请求消息,包括:
    所述第二设备接收来自所述第一设备的广播报文,所述广播报文中携带有所述第一请求消息。
  10. 根据权利要求9所述的设备发现方法,其特征在于,所述第一请求消息中包括所述第一设备的连接信息;所述第二设备向所述第一设备发送第一响应消息,包括:
    所述第二设备根据所述第一设备的连接信息与所述第一设备建立第一连接;
    所述第二设备通过所述第一连接向所述第一设备发送所述第一响应消息;
    或者,
    所述第二设备根据所述第一设备的连接信息向所述第一设备发送所述第一响应消息,所述第一响应消息用于与所述第一设备建立第一连接。
  11. 根据权利要求8或9所述的设备发现方法,其特征在于,所述系统还包括至少一个第三设备;所述系统包括至少一个子网;每个子网中包括第二设备和第三设备;所述第一设备通过所述第二设备与位于子网内的第三设备通信;在所述第二设备接收来自所述第一设备的第一请求消息之后,所述方法还包括:
    所述第二设备在确定开启代理功能的情况下,向与所述第二设备位于同一子网内的第三设备发送第二请求消息,所述第二请求消息中包括所述目标设备的特征值;
    若获取到所述目标设备的第二设备信息,则所述第二设备向所述第一设备发送第三响应消息;其中,所述第三响应消息中包括所述目标设备的第二设备信息;所述目标设备的第二设备信息为与所述第二设备位于同一子网内的第三设备确定本机的特征值与所述目标设备的特征值匹配后由所述目标设备发送给所述第二设备。
  12. 根据权利要求11所述的设备发现方法,其特征在于,与所述第二设备位于同一子网内的第三设备的数量为多个;所述向与所述第二设备位于同一子网内的所述至少一个第三设备发送第二请求消息,包括:
    向与所述第二设备位于同一子网内的所述至少一个第三设备发送广播报文,所述广播报文用于承载所述第二请求消息。
  13. 根据权利要求12所述的设备发现方法,其特征在于,所述第二请求消息中包 括所述第二设备的连接信息;所述若获取到所述目标设备的第二设备信息,则所述第二设备向所述第一设备发送所述第三响应消息,包括:
    若收到来自所述目标设备的第二响应消息,则所述第二设备与所述第一设备建立第一连接,与所述目标设备建立第二连接;其中,所述第二响应消息为所述目标设备根据所述第二设备的连接信息发送的连接响应消息,用于与所述第二设备建立连接;
    通过所述第一连接接收所述第一设备的第三请求消息,所述第三请求消息用于请求所述目标设备的信息;
    通过所述第二连接向所述目标设备转发所述第三请求消息以及接收所述目标设备发送的所述目标设备的第二设备信息;
    通过所述第一连接向所述第一设备发送所述第三响应消息。
  14. 根据权利要求8至13任一项所述的设备发现方法,其特征在于,所述第二设备中包含低功耗器件;所述低功耗器件中存储有本机的特征值。
  15. 根据权利要求8至14任一项所述的设备发现方法,其特征在于,所述特征值为第一设备信息;所述第一设备信息包括设备标识、设备类型、设备名称、登录所述设备的用户信息和业务标识中的一项或多项。
  16. 根据权利要求8至15任一项所述的设备发现方法,其特征在于,所述第二设备配置有第二预设协议;其中,所述第二预设协议中的第一字段包括是否开启代理功能;第二字段包括所述特征值的取值。
  17. 一种设备发现方法,其特征在于,应用于系统中,所述系统包括第一设备、至少一个第二设备和至少一个第三设备;其中,所述系统中包括至少一个子网;每个子网中包括第二设备和第三设备;所述第一设备通过所述第二设备与位于子网内的第三设备通信;所述方法包括:
    第三设备接收来自同一子网内的所述第二设备的第二请求消息;所述第二请求消息包括所述目标设备的特征值;
    若所述目标设备的特征值与本机的特征值匹配成功,则所述第三设备向所述第二设备发送所述目标设备的第二设备信息。
  18. 根据权利要求17所述的设备发现方法,其特征在于,所述第三设备的数量为多个;所述第三设备接收来自同一子网内的所述第二设备的第二请求消息,包括:
    所述第三设备接收来自同一子网内的所述第二设备的广播报文,所述广播报文用于承载所述第二请求消息。
  19. 根据权利要求17或18所述的设备发现方法,其特征在于,所述第二请求消息中包括所述第二设备的连接信息;所述若所述目标设备的特征值与本机的特征值匹配成功,则所述第三设备向所述第二设备发送所述目标设备的第二设备信息,包括:
    若所述目标设备的特征值与本机的特征值匹配成功,则所述第三设备根据所述第二设备的连接信息向所述第二设备发送第二响应消息;其中,所述第二响应消息为所述目标设备根据所述第二设备的连接信息发送的连接响应消息,用于与所述第二设备建立连接;
    所述第三设备与所述第二设备建立第二连接;
    所述第三设备通过所述第二连接接收所述第二设备发送的第三请求消息,所述第三请求消息用于获取所述第三设备的第二设备信息;
    所述第三设备通过所述第二连接向所述第二设备发送所述第三设备的第二设备信息。
  20. 一种设备发现系统,其特征在于,包括第一设备和至少一个第二设备;其中,
    所述第一设备,用于向所述至少一个第二设备发送第一请求消息;所述第一请求消息包括目标设备的特征值;所述目标设备的特征值用于收到所述第一请求消息的设备将本机的特征值与所述目标设备的特征值进行匹配;
    所述第二设备,用于接收来自所述第一设备的第一请求消息;
    所述第二设备,还用于若所述目标设备的特征值与本机的特征值匹配成功,则向所述第一设备发送第一响应消息;所述第一响应消息包括所述目标设备的第二设备信息。
  21. 根据权利要求20所述的设备发现系统,其特征在于,所述系统中还包括至少一个第三设备;所述系统包括至少一个子网;每个子网中包括第二设备和第三设备;所述第一设备通过所述第二设备与位于子网内的第三设备通信;
    所述第二设备,还用于在确定开启代理功能的情况下,向与所述第二设备位于同一子网内的第三设备发送第二请求消息,所述第二请求消息中包括所述目标设备的特征值;
    所述第二设备,还用于若获取到所述目标设备的第二设备信息,则向所述第一设备发送第三响应消息;其中,所述第三响应消息中包括所述目标设备的第二设备信息;所述目标设备的第二设备信息为与所述第二设备位于同一子网内的第三设备确定本机的特征值与所述目标设备的特征值匹配后由所述目标设备发送给所述第二设备。
  22. 一种电子设备,其特征在于,包括:处理器和存储器,所述存储器与所述处理器耦合,所述存储器用于存储计算机可读指令,当所述处理器从所述存储器中读取所述计算机可读指令,使得所述电子设备执行如权利要求1-7中任意一项所述的方法。
  23. 一种电子设备,其特征在于,包括:处理器和存储器,所述存储器与所述处理器耦合,所述存储器用于存储计算机可读指令,当所述处理器从所述存储器中读取所述计算机可读指令,使得所述电子设备执行如权利要求8-16中任意一项所述的方法。
  24. 一种电子设备,其特征在于,包括:处理器和存储器,所述存储器与所述处理器耦合,所述存储器用于存储计算机可读指令,当所述处理器从所述存储器中读取所述计算机可读指令,使得所述电子设备执行如权利要求17-19中任意一项所述的方法。
  25. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质包括计算机程序,当所述计算机程序在电子设备上运行时,使得所述电子设备执行如权利要求1-7中任意一项所述的方法;或者,使得所述电子设备执行如权利要求8-16中任意一项所述的方法;或者,使得所述电子设备执行如权利要求17-19任意一项所述的方法。
  26. 一种计算机程序产品,其特征在于,当所述计算机程序产品在计算机上运行 时,使得所述计算机执行如权利要求1-7中任意一项所述的方法;或者,使得所述计算机执行如权利要求8-16中任意一项所述的方法;或者,使得所述计算机执行如权利要求17-19任意一项所述的方法。
PCT/CN2023/100266 2022-06-20 2023-06-14 设备发现方法、装置及系统 WO2023246601A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202210698383.9A CN117319981A (zh) 2022-06-20 2022-06-20 设备发现方法、装置及系统
CN202210698383.9 2022-06-20

Publications (1)

Publication Number Publication Date
WO2023246601A1 true WO2023246601A1 (zh) 2023-12-28

Family

ID=89272369

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2023/100266 WO2023246601A1 (zh) 2022-06-20 2023-06-14 设备发现方法、装置及系统

Country Status (2)

Country Link
CN (1) CN117319981A (zh)
WO (1) WO2023246601A1 (zh)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103095749A (zh) * 2011-10-28 2013-05-08 浙江大华技术股份有限公司 用于实现跨网段设备发现的方法和系统
WO2014013320A1 (en) * 2012-07-18 2014-01-23 Accedian Networks Inc. Systems and methods of using beacon messages to discover devices across subnets
CN105049495A (zh) * 2015-06-29 2015-11-11 广州酷狗计算机科技有限公司 设备发现方法、装置及系统

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103095749A (zh) * 2011-10-28 2013-05-08 浙江大华技术股份有限公司 用于实现跨网段设备发现的方法和系统
WO2014013320A1 (en) * 2012-07-18 2014-01-23 Accedian Networks Inc. Systems and methods of using beacon messages to discover devices across subnets
CN105049495A (zh) * 2015-06-29 2015-11-11 广州酷狗计算机科技有限公司 设备发现方法、装置及系统

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
HAO DENG, ZHOU YU; YE QING-WEI; WANG XIAO-DONG: "Device Discovery Mechanism and Implementation Based on ONVIF Protocol and Discovery Proxy ", WIRELESS COMMUNICATION TECHNOLOGY, 15 December 2016 (2016-12-15), pages 41 - 45, XP093120723 *

Also Published As

Publication number Publication date
CN117319981A (zh) 2023-12-29

Similar Documents

Publication Publication Date Title
US10225098B2 (en) Methods, devices and systems for supporting wireless communication
EP3000217B1 (en) Electronic device using logical channels for communication
CN112787685B (zh) 用于支持无线通信的方法、装置及系统
US11611863B2 (en) Method and apparatus for low energy discovery
EP3005822B1 (en) Mac layer transport for wi-fi direct services application service platform without internet protocol
US10932313B2 (en) Wireless connection switching method and terminal
EP3836577B1 (en) Session management method and device for user groups
EP3893109B1 (en) Method and device for connecting bluetooth devices
WO2018000134A1 (zh) 一种蓝牙连接的方法及终端
JP6325105B2 (ja) 複数のソースから単一のシンクへのワイヤレスメディア共有
US11172530B2 (en) Communication establishment method and terminal
EP2792195A1 (en) Shared network access via a peer-to-peer link
JP2018506874A (ja) ワイヤレスディスプレイシステム中の複数のシンクへの同期オーディオまたはビデオストリーミングサービスの発見および管理
EP3114821B1 (en) Method and devices for establishing a connection between a seeker device and a target device
WO2022143508A1 (zh) 一种近场中传输数据的方法、设备及系统
WO2017214137A1 (en) Methods, devices and systems for supporting wireless communication
CN114697879A (zh) 蓝牙配对方法、电子设备、芯片和存储介质
WO2016029772A1 (zh) 一种通信方法及设备
WO2022127785A1 (zh) 一种心跳同步方法、电子设备和系统
CN111386749A (zh) 用于在基础设施链路上建立点对点服务会话的方法
WO2023246601A1 (zh) 设备发现方法、装置及系统
WO2022143339A1 (zh) 跨网段发现的方法、路由设备及系统
WO2023024119A1 (zh) 一种应用于短距无线通信的数据传输方法及通信装置
EP4366333A1 (en) Device discovery method, device and system
WO2024061034A1 (zh) 通信方法和通信装置

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 23826250

Country of ref document: EP

Kind code of ref document: A1