Device discovery method, device and system
Through the combination of multicast/broadcast and unicast, device status information is indirectly obtained, which solves the problems of device discovery reliability and network load, and achieves efficient device discovery.
Patent Information
- Application Number
- CN202111089471.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-09-16
- Publication Date
- 2025-09-05
- Estimated Expiration
- 2041-09-16
AI Technical Summary
In complex network environments, equipment based on unicast technology finds that data traffic is large and network load is high, while equipment based on multicast/broadcast technology finds that have low reliability and weak anti-interference ability, resulting in low success rate of equipment discovery.
Send discovery request messages through multicast/broadcast, and the receiving device indirectly obtains device identification and status information that meets the specified conditions, uses keep-alive testing to determine whether the device is in a working state, and combines unicast to obtain the device status to optimize the device discovery process.
Improves the success rate and reliability of device discovery, while saving network overhead and reducing network load.
Smart Images

Figure CN115811707B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of communication technologies, and in particular to a device discovery method, device, and system. Background Art
[0002] With the diversification of terminal technologies, the scope of terminal devices used by users has expanded from one terminal device to multiple terminal devices. For example, in daily life, users can use multiple terminal devices (such as TVs, speakers, smartphones, and tablets) to implement different services based on multi-device collaboration technology. Among them, multi-device collaboration technology can break down barriers between devices and applications, and provide cross-platform and cross-system services, such as screen projection (such as video projection, picture projection, etc.), audio projection, remote screen control, file sharing and other services.
[0003] Device discovery is a crucial component of multi-device collaboration technology. Typically, device discovery can be implemented using unicast, multicast (also known as multicast), or broadcast technologies. Unicast operates on a one-to-one basis, meaning information is sent and received only between two devices (nodes). Multicast / broadcast operates on a one-to-many basis, meaning one device (node) sends information to multiple devices (nodes).
[0004] However, as the network environment becomes more and more complex, the number of terminal devices involved in device discovery increases. Device discovery based on unicast technology usually has a large data flow and high network load, so it is rarely used. Device discovery based on multicast / broadcast technology has weak anti-interference ability and is prone to packet loss, so its reliability is low. Figure 1 As shown in (a) in the figure, suppose that mobile phone 1 multicasts / broadcasts to discover devices, but due to external influences such as poor network coverage or strong interference, the multicast / broadcast message is lost, resulting in the laptop, TV and smart watch not being discovered by mobile phone 1. In addition, due to the different anti-interference capabilities of different devices, the devices discovered by different devices based on multicast / broadcast technology will be different. For example, suppose Figure 1 (a) shows the mobile phone 1 and Figure 1 In (b), the mobile phone 2 performs device discovery at the same location under the same network environment, and the discovery results may be different. Figure 2 As shown, mobile phone 1 only discovered the tablet computer, and mobile phone 2 discovered the tablet computer and the laptop computer. Summary of the Invention
[0005] In order to solve the above technical problems, the present application provides a device discovery method, device and system. The technical solution provided by the present application can save network overhead and reduce network load while ensuring the reliability of device discovery.
[0006] In a first aspect, a device discovery method is provided. The method is applied to a first device, and the method includes: the first device sends a discovery request message for discovering devices that meet specified conditions to N (N is a positive integer greater than or equal to 1) devices including a second device. The discovery request message includes information indicating the specified conditions. The first device receives a first response message from the second device including an identifier of a third device that meets the specified conditions. The first response message is used to indicate that the third device meets the specified conditions. The first device sends a first status acquisition message to the third device to obtain the status of the third device, wherein the status of the third device is used to indicate whether the third device is in a working state. When the first device obtains that the third device is in a working state, it discovers the third device.
[0007] In one embodiment, when most modules of the third device are in sleep mode (for example, the processor is in sleep mode and the display screen is in off mode), but a module (for example, a Bluetooth module) or some modules of the third device are in operation, the third device is still in operation. In another embodiment, when most modules or all modules of the third device are in operation, the third device is in operation. The limitation on the working state is not limited to the above two methods. This application does not make any limitation on this. The limitation on the working state in other schemes is the same as here and will not be repeated hereafter.
[0008] In the solution provided by the first aspect above, the first device (i.e., the discovery device) discovers devices by multicasting / broadcasting a discovery request message. When a device (e.g., the second device) receives the discovery request message from the first device, it can notify the first device when it determines that there are other devices (e.g., the third device) that meet the conditions specified by the first device. This allows the first device to discover the device (i.e., the third device) when it determines through a keep-alive probe that the device that meets the specified conditions (i.e., the third device) is in a working state. This method breaks through the conventional direct discovery technology and discovers devices by indirectly obtaining information. It can improve the success rate of device discovery, optimize the discovery process, and save network overhead and reduce network load while ensuring the reliability of device discovery.
[0009] In a possible implementation, the first response message further includes an identifier of a fourth device that meets specified conditions; the method further includes: the first device sends a second status acquisition message to the fourth device for obtaining the status of the fourth device, wherein the status of the fourth device is used to indicate whether the fourth device is in a working state. When the first device obtains that the fourth device is in a working state, it discovers the fourth device. In the present application, the second device that receives the discovery request message from the first device can send the identifiers of multiple devices (such as a third device and a fourth device) that it has determined to meet the specified conditions of the first device to the first device through a first response message. This method breaks through the conventional direct discovery technology and performs device discovery by indirectly obtaining information, which can improve the success rate of device discovery, optimize the discovery process, and save network overhead and reduce network load while ensuring the reliability of device discovery.
[0010] In a possible implementation, the above method also includes: the first device receives a second response message from the third device. The second response message includes the identifier of the fifth device that meets the specified conditions. The first device sends a third status acquisition message to the fifth device to obtain the status of the fifth device, wherein the status of the fifth device is used to indicate whether the fifth device is in a working state. When the first device obtains that the fifth device is in a working state, it discovers the fifth device. In the present application, the third device that meets the specified conditions and is indirectly discovered by the first device through the second device can also notify the first device when it determines that other devices (such as the fifth device) meet the specified conditions; so that the first device can discover the fifth device when it determines that the fifth device is in a working state through a keep-alive test. This method breaks through the conventional direct discovery technology and performs device discovery by indirectly obtaining information, which can improve the success rate of device discovery, optimize the discovery process, and save network overhead and reduce network load while ensuring the reliability of device discovery.
[0011] In one possible implementation, in the present application, the first device may send a discovery request message to N devices including the second device in a multicast or broadcast manner, and send a status acquisition message to a device that meets the specified conditions (such as a third device, a third device, or a fifth device). For example, a first status acquisition message is sent to the third device in a unicast manner. For another example, a second status acquisition message is sent to the fourth device in a unicast manner. For another example, a third status acquisition message is sent to the fifth device in a unicast manner. Furthermore, a device that meets the specified conditions (such as a third device, a third device, or a fifth device) may send a response message to the first device in a unicast manner. For example, the second device sends a first response message to the first device in a unicast manner; the third device sends a second response message to the first device in a unicast manner; the fourth device sends a third response message to the first device in a unicast manner; and the fifth device sends a fourth response message to the first device in a unicast manner. In this way, network overhead can be saved and network load can be reduced.
[0012] In one possible implementation, the first device pre-stores service information for M devices. Before the first device sends a discovery request message to N devices, including the second device, the method further includes: the first device determining N devices that meet specified conditions based on the service information of the M devices; where M is a positive integer greater than or equal to N. Based on the concept of discovering devices based on service information provided in this application, the first device can also determine which devices to send the discovery request message to based on the service information of multiple devices pre-stored therein. This method can improve the success rate and reliability of device discovery and optimize the discovery process.
[0013] In one possible implementation, the first response message further includes response information indicating that the second device is in an operating state; and the method further includes: the first device discovering the second device in response to the first response message. This application is also compatible with conventional device discovery mechanisms. For example, a device (such as the second device) that receives a discovery request message may also notify the first device when it meets specified conditions. This method can improve the success rate and reliability of device discovery and optimize the discovery process.
[0014] In one possible implementation, the above-mentioned specified conditions include at least one of the following: being in a specified wireless local area network, supporting a specified service type, being able to meet specified service parameters, and supporting specified functions. In the solution provided in this application, device discovery can be used in different business scenarios and can be customized according to the needs of the first device, with strong applicability.
[0015] In one possible implementation, after discovering the third device, the method further includes: receiving a notification message from the third device, the notification message including service information of the third device; wherein the service information of the third device is used to indicate at least one of the following: the wireless local area network identifier of the location of the third device, the service type supported by the third device, the service parameters that the third device can meet, and the functions supported by the third device. The first device updates the service information of N devices stored by the first device based on the service information of the third device. When the third device disconnects from the network (also known as "going offline"), the service information of the third device is updated to other devices in real time to ensure the accuracy of the service information of the third device in the first device.
[0016] In one possible implementation, the above-mentioned conditions include supporting screen projection services.
[0017] In one possible implementation, the N devices include a third device; alternatively, the N devices do not include a third device, which is not a limitation in this application. This application does not specify whether the third device receives the discovery request message from the first device. This solution allows for the discovery of as many devices as possible, thereby improving the success rate and reliability of device discovery.
[0018] In one possible implementation, the N devices include the fourth device; alternatively, the N devices do not include the fourth device, which is not a limitation in this application. This application does not limit whether the fourth device receives the discovery request message from the first device. This solution allows for the discovery of as many devices as possible, thereby improving the success rate and reliability of device discovery.
[0019] In one possible implementation, the N devices include the fifth device; alternatively, the N devices do not include the fifth device, which is not a limitation in this application. This application does not limit whether the fourth device receives the discovery request message from the first device. This solution allows for the discovery of as many devices as possible, thereby improving the success rate and reliability of device discovery.
[0020] In one possible implementation, after the first device discovers the third device, the above method also includes: the first device displays at least one of the following information on the discovered device interface: the device name of the third device, the device type of the third device, the identifier of the third device, and the device serial number of the third device.
[0021] In a second aspect, a device discovery method is provided. The method is applied to a second device, where the second device is associated with a third device. The method includes: the second device receiving a discovery request message from a first device for discovering devices that meet specified conditions, wherein the discovery request message includes information indicating the specified conditions. The second device sends a first response message to the first device that includes an identifier of the third device that meets the specified conditions, wherein the first response message is used by the first device to discover the third device.
[0022] In the solution provided by the second aspect above, a device (such as a second device) that receives a discovery request message from a first device can notify the first device when it determines that another device (such as a third device) meets the conditions specified by the first device. This allows the first device to discover the device (i.e., the third device) when it determines through a keep-alive probe that the device that meets the specified conditions (i.e., the third device) is in a working state. This method breaks through the conventional direct discovery technology and performs device discovery by indirectly obtaining information. This can improve the success rate of device discovery, optimize the discovery process, and save network overhead and reduce network load while ensuring the reliability of device discovery.
[0023] In a possible implementation, the second device is pre-associated with the third device.
[0024] In one possible implementation, the second device is related to the fourth device, and the first response message further includes an identifier of the fourth device that meets the specified conditions. In the present application, the second device that receives the discovery request message from the first device can send the identifiers of multiple devices (such as the third device and the fourth device) that it has determined to meet the conditions specified by the first device to the first device through the first response message. This method breaks through the conventional direct discovery technology and performs device discovery by indirectly obtaining information, which can improve the success rate of device discovery, optimize the discovery process, and save network overhead and reduce network load while ensuring the reliability of device discovery.
[0025] In a possible implementation, the second device is pre-associated with the fourth device.
[0026] In a possible implementation, in this application, the second device may send the first response message to the first device in a unicast manner, thereby saving network overhead and reducing network load.
[0027] In one possible implementation, the second device is associated with the third device, including at least one of the following: the second device has been discovered by the third device, the second device has discovered the third device, the second device and the third device have established a connection, and the second device and the third device have jointly provided a collaborative service. In this application, the second device can know the service information of all devices related to it, such as devices discovered by the second device, devices that have discovered the second device, devices with which the second device has established a connection, and devices with which the second device has jointly provided a collaborative service, etc., which is not limited in this application.
[0028] In one possible implementation, the method further includes: receiving a notification message from a third device, the notification message including service information of the third device; wherein the service information of the third device is used to indicate at least one of the following: a wireless local area network identifier of the location of the third device, a service type supported by the third device, service parameters that the third device can meet, and functions supported by the third device. The first device updates the service information of N devices stored by the first device based on the service information of the third device. When the third device disconnects from the network (also known as "going offline"), the service information of the third device is updated to other devices in real time to ensure the accuracy of the service information of the third device in the second device.
[0029] According to a third aspect, a first device is provided. The first device includes: a transceiver unit, configured to send a discovery request message for discovering a device that meets specified conditions to N (N is a positive integer greater than or equal to 1) devices including a second device, wherein the discovery request message includes information indicating the specified conditions. A first response message including an identifier of a third device that meets the specified conditions is received from the second device. And, a first status acquisition message is sent to the third device to obtain the status of the third device, wherein the status of the third device is used to indicate whether the third device is in a working state. A processing unit is configured to discover the third device when it is obtained that the third device is in a working state.
[0030] In the solution provided by the third aspect above, the first device (i.e., the discovery device) discovers devices by multicasting / broadcasting a discovery request message. When a device (e.g., the second device) receives the discovery request message from the first device, it can notify the first device when it determines that there are other devices (e.g., the third device) that meet the conditions specified by the first device. This allows the first device to discover the device (i.e., the third device) when it determines through a keep-alive probe that the device that meets the specified conditions (i.e., the third device) is in a working state. This method breaks through the conventional direct discovery technology and discovers devices by indirectly obtaining information. It can improve the success rate of device discovery, optimize the discovery process, and save network overhead and reduce network load while ensuring the reliability of device discovery.
[0031] In a possible implementation, the first response message also includes an identifier of a fourth device that meets the specified conditions; the transceiver unit is further used to send a second status acquisition message to the fourth device for obtaining the status of the fourth device, wherein the status of the fourth device is used to indicate whether the fourth device is in a working state. The processing unit is further used to discover the fourth device when it is obtained that the fourth device is in a working state. In the present application, the second device that receives the discovery request message from the first device can send the identifiers of multiple devices (such as a third device and a fourth device) that it has determined to meet the specified conditions of the first device to the first device through a first response message. This method breaks through the conventional direct discovery technology and performs device discovery by indirectly obtaining information, which can improve the success rate of device discovery, optimize the discovery process, and save network overhead and reduce network load while ensuring the reliability of device discovery.
[0032] In one possible implementation, the transceiver unit is further configured to: receive a second response message from a third device, wherein the second response message includes an identifier of a fifth device that meets specified conditions. And, send a third status acquisition message to the fifth device to obtain the status of the fifth device, wherein the status of the fifth device is used to indicate whether the fifth device is in working condition. The processing unit is further configured to: upon obtaining that the fifth device is in working condition, the first device discovers the fifth device. In the present application, the third device that meets specified conditions and is indirectly discovered by the first device through the second device may also notify the first device when determining that other devices (such as the fifth device) meet the specified conditions. This allows the first device to discover the fifth device when determining that the fifth device is in working condition through a keep-alive probe. This method breaks through conventional direct discovery technology and performs device discovery by indirectly acquiring information, thereby improving the success rate of device discovery, optimizing the discovery process, and saving network overhead and reducing network load while ensuring the reliability of device discovery.
[0033] In one possible implementation, in the present application, the transceiver unit of the first device can send a discovery request message to N devices including the second device in a multicast or broadcast manner, and send a status acquisition message to a device that meets the specified conditions (such as a third device, a third device, or a fifth device). For example, the transceiver unit sends a first status acquisition message to the third device in a unicast manner. For another example, the transceiver unit sends a second status acquisition message to the fourth device in a unicast manner. For another example, the transceiver unit sends a third status acquisition message to the fifth device in a unicast manner. Furthermore, a device that meets the specified conditions (such as a third device, a third device, or a fifth device) can send a response message to the first device in a unicast manner. For example, the second device sends a first response message to the first device in a unicast manner; the third device sends a second response message to the first device in a unicast manner; the fourth device sends a third response message to the first device in a unicast manner; and the fifth device sends a fourth response message to the first device in a unicast manner. In this way, network overhead can be saved and network load can be reduced.
[0034] In one possible implementation, the first device further includes a storage unit pre-stored with service information for M devices. The processing unit is further configured to: determine, before the transceiver unit sends a discovery request message to N devices including the second device, N devices that meet specified conditions based on the service information of the M devices; where M is a positive integer greater than or equal to N. Based on the concept of discovering devices based on service information provided in this application, the first device can also determine which devices to send discovery request messages to based on the service information of multiple devices pre-stored therein. This method can improve the success rate and reliability of device discovery and optimize the discovery process.
[0035] In one possible implementation, the first response message further includes response information indicating that the second device is in an operating state; and the processing unit is further configured to discover the second device in response to the first response message. This application is also compatible with conventional device discovery mechanisms. For example, a device (such as a second device) that receives a discovery request message may also notify the first device when it meets specified conditions. This method can improve the success rate and reliability of device discovery and optimize the discovery process.
[0036] In one possible implementation, the above-mentioned specified conditions include at least one of the following: being in a specified wireless local area network, supporting a specified service type, being able to meet specified service parameters, and supporting specified functions. In the solution provided in this application, device discovery can be used in different business scenarios and can be customized according to the needs of the first device, with strong applicability.
[0037] In one possible implementation, after discovering the third device, the transceiver unit is further used to: receive a notification message from the third device, the notification message including the service information of the third device; wherein the service information of the third device is used to indicate at least one of the following: the wireless local area network identifier of the location of the third device, the service type supported by the third device, the service parameters that the third device can meet, and the functions supported by the third device. The processing unit is also used to: update the service information of N devices stored in the first device according to the service information of the third device. When the third device is disconnected from the network (also called "going offline"), the service information of the third device is updated to other devices in real time to ensure the accuracy of the service information of the third device in the first device.
[0038] In one possible implementation, the above-mentioned conditions refer to supporting screen projection services.
[0039] In one possible implementation, the N devices include a third device; alternatively, the N devices do not include a third device, which is not a limitation in this application. This application does not specify whether the third device receives the discovery request message from the first device. This solution allows for the discovery of as many devices as possible, thereby improving the success rate and reliability of device discovery.
[0040] In one possible implementation, the N devices include the fourth device; alternatively, the N devices do not include the fourth device, which is not a limitation in this application. This application does not limit whether the fourth device receives the discovery request message from the first device. This solution allows for the discovery of as many devices as possible, thereby improving the success rate and reliability of device discovery.
[0041] In one possible implementation, the N devices include the fifth device; alternatively, the N devices do not include the fifth device, which is not a limitation in this application. This application does not limit whether the fourth device receives the discovery request message from the first device. This solution allows for the discovery of as many devices as possible, thereby improving the success rate and reliability of device discovery.
[0042] In one possible implementation, the first device further includes: a display unit for displaying a discovered device interface, wherein the discovered device interface includes at least one of the following information: a device name of the third device, a device type of the third device, an identifier of the third device, and a device serial number of the third device.
[0043] In a fourth aspect, a second device is provided. The second device is associated with a third device. The second device includes a transceiver unit configured to receive a discovery request message from a first device for discovering devices that meet specified conditions, wherein the discovery request message includes information indicating the specified conditions. The second device also includes a transceiver unit configured to send a first response message to the first device that includes an identifier of the third device that meets the specified conditions, wherein the first response message is used by the first device to discover the third device.
[0044] In the solution provided by the fourth aspect above, a device (such as a second device) that receives a discovery request message from a first device can notify the first device when it determines that another device (such as a third device) meets the conditions specified by the first device. This allows the first device to discover the device (i.e., the third device) when it determines through a keep-alive probe that the device that meets the specified conditions (i.e., the third device) is in a working state. This method breaks through the conventional direct discovery technology and performs device discovery by indirectly obtaining information. This can improve the success rate of device discovery, optimize the discovery process, and save network overhead and reduce network load while ensuring the reliability of device discovery.
[0045] In a possible implementation, the second device is pre-associated with the third device.
[0046] In one possible implementation, the second device is related to the fourth device, and the first response message further includes an identifier of the fourth device that meets the specified conditions. In the present application, the second device that receives the discovery request message from the first device can send the identifiers of multiple devices (such as the third device and the fourth device) that it has determined to meet the conditions specified by the first device to the first device through the first response message. This method breaks through the conventional direct discovery technology and performs device discovery by indirectly obtaining information, which can improve the success rate of device discovery, optimize the discovery process, and save network overhead and reduce network load while ensuring the reliability of device discovery.
[0047] In a possible implementation, the second device is pre-associated with the fourth device.
[0048] In a possible implementation, in this application, the transceiver unit of the second device may send the first response message to the first device in a unicast manner, thereby saving network overhead and reducing network load.
[0049] In one possible implementation, the second device is associated with the third device, including at least one of the following: the second device has been discovered by the third device, the second device has discovered the third device, the second device and the third device have established a connection, and the second device and the third device have jointly provided a collaborative service. In this application, the second device can know the service information of all devices related to it, such as devices discovered by the second device, devices that have discovered the second device, devices with which the second device has established a connection, and devices with which the second device has jointly provided a collaborative service, etc., which is not limited in this application.
[0050] In one possible implementation, the transceiver unit is further configured to: receive a notification message from a third device, the notification message including service information of the third device; wherein the service information of the third device is used to indicate at least one of the following: a wireless local area network identifier of the location of the third device, a service type supported by the third device, service parameters that the third device can meet, and functions supported by the third device. The processing unit is further configured to: update the service information of N devices stored by the first device based on the service information of the third device. When the third device is disconnected from the network (also referred to as "going offline"), the service information of the third device is updated to other devices in real time to ensure the accuracy of the service information of the third device in the second device.
[0051] In a fifth aspect, a first device is provided. The first device includes: a memory for storing a computer program; a transceiver for receiving or sending a radio signal; a processor for executing the computer program, so that the first device sends a discovery request message for discovering a device that meets the specified conditions to N (N is a positive integer greater than or equal to 1) devices including the second device through the transceiver, wherein the discovery request message includes information indicating the specified conditions. And, a first response message including an identifier of a third device that meets the specified conditions is received from the second device through the transceiver. And, a first status acquisition message for obtaining the status of the third device is sent to the third device through the transceiver, wherein the status of the third device is used to indicate whether the third device is in a working state. And, when the first device obtains that the third device is in a working state, it discovers the third device.
[0052] In the solution provided by the fifth aspect above, the first device (i.e., the discovery device) discovers devices by multicasting / broadcasting a discovery request message. When a device (e.g., the second device) receives the discovery request message from the first device, it can notify the first device when it determines that there are other devices (e.g., the third device) that meet the conditions specified by the first device. This allows the first device to discover the device (i.e., the third device) when it determines through a keep-alive probe that the device that meets the specified conditions (i.e., the third device) is in a working state. This method breaks through the conventional direct discovery technology and discovers devices by indirectly obtaining information. It can improve the success rate of device discovery, optimize the discovery process, and save network overhead and reduce network load while ensuring the reliability of device discovery.
[0053] In one possible implementation, the first response message further includes an identifier of a fourth device that meets specified conditions; the transceiver is further configured to send a second status acquisition message to the fourth device for acquiring the status of the fourth device, wherein the status of the fourth device is used to indicate whether the fourth device is in a working state. The processor is further configured to discover the fourth device when it is acquired that the fourth device is in a working state. In the present application, the second device that receives the discovery request message from the first device can send the identifiers of multiple devices (such as a third device and a fourth device) that it has determined to meet the specified conditions of the first device to the first device through a first response message. This method breaks through the conventional direct discovery technology and performs device discovery by indirectly acquiring information, which can improve the success rate of device discovery, optimize the discovery process, and save network overhead and reduce network load while ensuring the reliability of device discovery.
[0054] In one possible implementation, the transceiver is further configured to: receive a second response message from a third device, wherein the second response message includes an identifier of a fifth device that meets specified conditions. And, send a third status acquisition message to the fifth device to obtain the status of the fifth device, wherein the status of the fifth device is used to indicate whether the fifth device is in a working state. The processor is further configured to: upon obtaining that the fifth device is in a working state, the first device discovers the fifth device. In the present application, the third device that meets the specified conditions and is indirectly discovered by the first device through the second device may also notify the first device when determining that other devices (such as the fifth device) meet the specified conditions. This allows the first device to discover the fifth device when determining that the fifth device is in a working state through a keep-alive probe. This method breaks through conventional direct discovery technology and performs device discovery by indirectly acquiring information, thereby improving the success rate of device discovery, optimizing the discovery process, and saving network overhead and reducing network load while ensuring the reliability of device discovery.
[0055] In one possible implementation, in the present application, the transceiver of the first device may send a discovery request message to N devices including the second device in a multicast or broadcast manner, and send a status acquisition message to a device that meets the specified conditions (such as a third device, a third device, or a fifth device). For example, the transceiver sends a first status acquisition message to the third device in a unicast manner. For another example, the transceiver sends a second status acquisition message to the fourth device in a unicast manner. For another example, the transceiver sends a third status acquisition message to the fifth device in a unicast manner. Furthermore, devices that meet the specified conditions (such as a third device, a third device, or a fifth device) may send a response message to the first device in a unicast manner. For example, the second device sends a first response message to the first device in a unicast manner; the third device sends a second response message to the first device in a unicast manner; the fourth device sends a third response message to the first device in a unicast manner; and the fifth device sends a fourth response message to the first device in a unicast manner. In this way, network overhead can be saved and network load can be reduced.
[0056] In one possible implementation, the memory of the first device pre-stores service information for M devices, and the processor is further configured to: determine, before the transceiver sends a discovery request message to N devices, including the second device, N devices that meet specified conditions based on the service information of the M devices; where M is a positive integer greater than or equal to N. Based on the concept of discovering devices based on service information provided in this application, the first device can also determine which devices to send discovery request messages to based on the service information of multiple devices pre-stored therein. This method can improve the success rate and reliability of device discovery and optimize the discovery process.
[0057] In one possible implementation, the first response message further includes response information indicating that the second device is in an operating state; and the processor is further configured to discover the second device in response to the first response message. This application is also compatible with conventional device discovery mechanisms. For example, a device (such as a second device) that receives a discovery request message may also notify the first device when it meets specified conditions. This method can improve the success rate and reliability of device discovery and optimize the discovery process.
[0058] In one possible implementation, the above-mentioned specified conditions include at least one of the following: being in a specified wireless local area network, supporting a specified service type, being able to meet specified service parameters, and supporting specified functions. In the solution provided in this application, device discovery can be used in different business scenarios and can be customized according to the needs of the first device, with strong applicability.
[0059] In one possible implementation, after discovering the third device, the transceiver is further configured to: receive a notification message from the third device, the notification message including service information of the third device; wherein the service information of the third device is used to indicate at least one of the following: a wireless local area network identifier of the location of the third device, a service type supported by the third device, service parameters that the third device can meet, and functions supported by the third device. The processor is further configured to: update the service information of N devices stored by the first device based on the service information of the third device. When the third device is disconnected from the network (also referred to as "going offline"), the service information of the third device is updated to other devices in real time to ensure the accuracy of the service information of the third device in the first device.
[0060] In one possible implementation, the above-mentioned conditions include supporting screen projection services.
[0061] In one possible implementation, the N devices include a third device; alternatively, the N devices do not include a third device, which is not a limitation in this application. This application does not specify whether the third device receives the discovery request message from the first device. This solution allows for the discovery of as many devices as possible, thereby improving the success rate and reliability of device discovery.
[0062] In one possible implementation, the N devices include the fourth device; alternatively, the N devices do not include the fourth device, which is not a limitation in this application. This application does not limit whether the fourth device receives the discovery request message from the first device. This solution allows for the discovery of as many devices as possible, thereby improving the success rate and reliability of device discovery.
[0063] In one possible implementation, the N devices include the fifth device; alternatively, the N devices do not include the fifth device, which is not a limitation in this application. This application does not limit whether the fourth device receives the discovery request message from the first device. This solution allows for the discovery of as many devices as possible, thereby improving the success rate and reliability of device discovery.
[0064] In one possible implementation, the first device further includes: a display for displaying a discovered device interface, the discovered device interface including at least one of the following information: a device name of the third device, a device type of the third device, an identifier of the third device, and a device serial number of the third device.
[0065] In a sixth aspect, a second device is provided. The second device is associated with a third device. The second device includes: a memory for storing a computer program; a transceiver for receiving or transmitting radio signals; and a processor for executing the computer program, causing the second device to receive, via the transceiver, a discovery request message from a first device for discovering devices that meet specified conditions; wherein the discovery request message includes information indicating the specified conditions; and, further, to send a first response message to the first device including an identifier of a third device that meets the specified conditions, wherein the first response message is used by the first device to discover the third device.
[0066] In the solution provided in the sixth aspect, a device (such as a second device) that receives a discovery request message from a first device can notify the first device when it determines that another device (such as a third device) meets the conditions specified by the first device. This allows the first device to discover the device (i.e., the third device) when it determines through a keep-alive probe that the device (i.e., the third device) that meets the specified conditions is in a working state. This method breaks through the conventional direct discovery technology and performs device discovery by indirectly obtaining information, which can improve the success rate of device discovery, optimize the discovery process, and save network overhead and reduce network load while ensuring the reliability of device discovery.
[0067] In a possible implementation, the second device is pre-associated with the third device.
[0068] In one possible implementation, the second device is related to the fourth device, and the first response message further includes an identifier of the fourth device that meets the specified conditions. In the present application, the second device that receives the discovery request message from the first device can send the identifiers of multiple devices (such as the third device and the fourth device) that it has determined to meet the conditions specified by the first device to the first device through the first response message. This method breaks through the conventional direct discovery technology and performs device discovery by indirectly obtaining information, which can improve the success rate of device discovery, optimize the discovery process, and save network overhead and reduce network load while ensuring the reliability of device discovery.
[0069] In a possible implementation, the second device is pre-associated with the fourth device.
[0070] In a possible implementation, in this application, the transceiver unit of the second device may send the first response message to the first device in a unicast manner, thereby saving network overhead and reducing network load.
[0071] In one possible implementation, the second device is associated with the third device, including at least one of the following: the second device has been discovered by the third device, the second device has discovered the third device, the second device and the third device have established a connection, and the second device and the third device have jointly provided a collaborative service. In this application, the second device can know the service information of all devices related to it, such as devices discovered by the second device, devices that have discovered the second device, devices with which the second device has established a connection, and devices with which the second device has jointly provided a collaborative service, etc., which is not limited in this application.
[0072] In one possible implementation, the transceiver is further configured to receive a notification message from a third device, the notification message including service information of the third device; wherein the service information of the third device indicates at least one of the following: an identifier of the wireless local area network where the third device is located, service types supported by the third device, service parameters that the third device can meet, and functions supported by the third device. The processor is further configured to update the service information of N devices stored by the first device based on the service information of the third device. When the third device disconnects from the network (also referred to as "going offline"), the service information of the third device is updated in real time to other devices to ensure the accuracy of the service information of the third device in the second device.
[0073] In a seventh aspect, a device discovery method is provided, which is applied to a communication system. The communication system includes a first device and N devices. The method includes: the first device sends a discovery request message for discovering a device that meets specified conditions to N (N is a positive integer greater than or equal to 1) devices including a second device, wherein the discovery request message includes information indicating the specified conditions. The second device receives the discovery request message from the first device. The second device sends a first response message including an identifier of a third device that meets the specified conditions to the first device, wherein the first response message is used for the first device to discover the third device. The first device receives the first response message from the second device. The first device sends a first status acquisition message to the third device to obtain the status of the third device, wherein the status of the third device is used to indicate whether the third device is in a working state. When the first device obtains that the third device is in a working state, it discovers the third device.
[0074] In the solution provided by the seventh aspect above, the first device (i.e., the discovery device) discovers devices by multicasting / broadcasting a discovery request message. When a device (e.g., the second device) receives a discovery request message from the first device, it can notify the first device when it determines that there are other devices (e.g., the third device) that meet the conditions specified by the first device. This allows the first device to discover the device (i.e., the third device) when it determines through a keep-alive probe that the device that meets the specified conditions (i.e., the third device) is in a working state. This method breaks through the conventional direct discovery technology and discovers devices by indirectly obtaining information. It can improve the success rate of device discovery, optimize the discovery process, and save network overhead and reduce network load while ensuring the reliability of device discovery.
[0075] In a possible implementation, the communication system further includes: a fourth device. The first response message further includes an identifier of a fourth device that meets specified conditions; the method further includes: the first device sends a second status acquisition message to the fourth device for obtaining the status of the fourth device, wherein the status of the fourth device is used to indicate whether the fourth device is in a working state. When the first device obtains that the fourth device is in a working state, it discovers the fourth device. In the present application, the second device that receives the discovery request message from the first device can send the identifiers of multiple devices (such as a third device and a fourth device) that it has determined to meet the specified conditions of the first device to the first device through a first response message. This method breaks through the conventional direct discovery technology and performs device discovery by indirectly obtaining information, which can improve the success rate of device discovery, optimize the discovery process, and save network overhead and reduce network load while ensuring the reliability of device discovery.
[0076] In one possible implementation, in the present application, the first device may send a discovery request message to N devices including the second device in a multicast or broadcast manner, and send a status acquisition message to a device that meets the specified conditions (such as a third device, a third device, or a fifth device). For example, a first status acquisition message is sent to the third device in a unicast manner. For another example, a second status acquisition message is sent to the fourth device in a unicast manner. For another example, a third status acquisition message is sent to the fifth device in a unicast manner. Furthermore, a device that meets the specified conditions (such as a third device, a third device, or a fifth device) may send a response message to the first device in a unicast manner. For example, the second device sends a first response message to the first device in a unicast manner; the third device sends a second response message to the first device in a unicast manner; the fourth device sends a third response message to the first device in a unicast manner; and the fifth device sends a fourth response message to the first device in a unicast manner. In this way, network overhead can be saved and network load can be reduced.
[0077] In one possible implementation, the second device is associated with the third device, including at least one of the following: the second device has been discovered by the third device, the second device has discovered the third device, the second device and the third device have established a connection, and the second device and the third device have jointly provided a collaborative service. In this application, the second device can know the service information of all devices related to it, such as devices discovered by the second device, devices that have discovered the second device, devices with which the second device has established a connection, and devices with which the second device has jointly provided a collaborative service, etc., which is not limited in this application.
[0078] In a possible implementation, the communication system further includes: a fifth device. The method further includes: the first device receiving a second response message from the third device, wherein the second response message includes an identifier of a fifth device that meets the specified conditions. The first device sends a third status acquisition message to the fifth device to obtain the status of the fifth device, wherein the status of the fifth device is used to indicate whether the fifth device is in a working state. When the first device obtains that the fifth device is in a working state, it discovers the fifth device. In the present application, the third device that meets the specified conditions and is indirectly discovered by the first device through the second device can also notify the first device when it determines that other devices (such as the fifth device) meet the specified conditions. So that the first device can discover the fifth device when it determines that the fifth device is in a working state through a keep-alive test. This method breaks through the conventional direct discovery technology and performs device discovery by indirectly obtaining information, which can improve the success rate of device discovery, optimize the discovery process, and save network overhead and reduce network load while ensuring the reliability of device discovery.
[0079] In one possible implementation, after discovering the third device, the method further includes: the first device receiving a notification message from the third device, the notification message including service information of the third device; wherein the service information of the third device is used to indicate at least one of the following: the wireless local area network identifier of the location of the third device, the service type supported by the third device, the service parameters that the third device can meet, and the functions supported by the third device. And, based on the service information of the third device, the service information of N devices stored by the first device is updated. When the third device disconnects from the network (also known as "going offline"), the service information of the third device is updated to other devices in real time to ensure the accuracy of the service information of the third device in the first device.
[0080] In one possible implementation, the above-mentioned conditions include supporting screen projection services.
[0081] In one possible implementation, the N devices include a third device; alternatively, the N devices do not include a third device, which is not a limitation in this application. This application does not specify whether the third device receives the discovery request message from the first device. This solution allows for the discovery of as many devices as possible, thereby improving the success rate and reliability of device discovery.
[0082] In one possible implementation, the N devices include the fourth device; alternatively, the N devices do not include the fourth device, which is not a limitation in this application. This application does not limit whether the fourth device receives the discovery request message from the first device. This solution allows for the discovery of as many devices as possible, thereby improving the success rate and reliability of device discovery.
[0083] In one possible implementation, the N devices include the fifth device; alternatively, the N devices do not include the fifth device, which is not a limitation in this application. This application does not limit whether the fourth device receives the discovery request message from the first device. This solution allows for the discovery of as many devices as possible, thereby improving the success rate and reliability of device discovery.
[0084] In one possible implementation, after the first device discovers the third device, the above method also includes: the first device displays at least one of the following information on the discovered device interface: the device name of the third device, the device type of the third device, the identifier of the third device, and the device serial number of the third device.
[0085] In an eighth aspect, a communication system is provided, comprising: a first device as in any possible implementation of the third or fifth aspects, and N devices, the N devices including a second device as in any possible implementation of the fourth or sixth aspects. The first device is configured to execute: sending a discovery request message for discovering devices that meet specified conditions to N (N is a positive integer greater than or equal to 1) devices including the second device, wherein the discovery request message includes information indicating the specified conditions. Furthermore, receiving a first response message from the second device. Furthermore, sending a first status acquisition message to a third device to obtain the status of the third device, wherein the status of the third device is used to indicate whether the third device is in a working state. Furthermore, upon obtaining that the third device is in a working state, discovering the third device. The second device is configured to execute: receiving a discovery request message from the first device. The second device sends a first response message including an identifier of a third device that meets the specified conditions to the first device, wherein the first response message is used for the first device to discover the third device.
[0086] In the solution provided in the eighth aspect, the first device (i.e., the discovery device) discovers devices by multicasting / broadcasting a discovery request message. When a device (e.g., the second device) receives a discovery request message from the first device, it can notify the first device when it determines that there are other devices (e.g., the third device) that meet the conditions specified by the first device. This allows the first device to discover the device (i.e., the third device) when it determines through a keep-alive probe that the device that meets the specified conditions (i.e., the third device) is in a working state. This method breaks through the conventional direct discovery technology and discovers devices by indirectly obtaining information. It can improve the success rate of device discovery, optimize the discovery process, and save network overhead and reduce network load while ensuring the reliability of device discovery.
[0087] In one possible implementation, the first response message also includes an identifier of a fourth device that meets the specified conditions; the first device is further used to execute: sending a second status acquisition message to the fourth device for obtaining the status of the fourth device, wherein the status of the fourth device is used to indicate whether the fourth device is in a working state. And, when it is obtained that the fourth device is in a working state, the fourth device is discovered. In the present application, the second device that receives the discovery request message from the first device can send the identifiers of multiple devices (such as a third device and a fourth device) that it has determined to meet the specified conditions of the first device to the first device through a first response message. This method breaks through the conventional direct discovery technology and performs device discovery by indirectly obtaining information, which can improve the success rate of device discovery, optimize the discovery process, and save network overhead and reduce network load while ensuring the reliability of device discovery.
[0088] In one possible implementation, in the present application, the first device may send a discovery request message to N devices including the second device in a multicast or broadcast manner, and send a status acquisition message to a device that meets the specified conditions (such as a third device, a third device, or a fifth device). For example, a first status acquisition message is sent to the third device in a unicast manner. For another example, a second status acquisition message is sent to the fourth device in a unicast manner. For another example, a third status acquisition message is sent to the fifth device in a unicast manner. Furthermore, a device that meets the specified conditions (such as a third device, a third device, or a fifth device) may send a response message to the first device in a unicast manner. For example, the second device sends a first response message to the first device in a unicast manner; the third device sends a second response message to the first device in a unicast manner; the fourth device sends a third response message to the first device in a unicast manner; and the fifth device sends a fourth response message to the first device in a unicast manner. In this way, network overhead can be saved and network load can be reduced.
[0089] In one possible implementation, the second device is associated with the third device, including at least one of the following: the second device has been discovered by the third device, the second device has discovered the third device, the second device and the third device have established a connection, and the second device and the third device have jointly provided a collaborative service. In this application, the second device can know the service information of all devices related to it, such as devices discovered by the second device, devices that have discovered the second device, devices with which the second device has established a connection, and devices with which the second device has jointly provided a collaborative service, etc., which is not limited in this application.
[0090] In one possible implementation, the first device is further configured to execute: receiving a second response message from a third device, wherein the second response message includes an identifier of a fifth device that meets specified conditions. And, sending a third status acquisition message to the fifth device to obtain the status of the fifth device, wherein the status of the fifth device is used to indicate whether the fifth device is in working condition. And, upon obtaining that the fifth device is in working condition, discovering the fifth device. In the present application, the third device that meets the specified conditions and is indirectly discovered by the first device through the second device may also notify the first device when determining that other devices (such as the fifth device) meet the specified conditions. So that the first device can discover the fifth device when determining that the fifth device is in working condition through a keep-alive probe. This method breaks through the conventional direct discovery technology and performs device discovery by indirectly acquiring information, which can improve the success rate of device discovery, optimize the discovery process, and save network overhead and reduce network load while ensuring the reliability of device discovery.
[0091] In one possible implementation, after discovering the third device, the first device is further configured to: receive a notification message from the third device, the notification message including service information of the third device; wherein the service information of the third device is configured to indicate at least one of the following: an identifier of the wireless local area network where the third device is located, service types supported by the third device, service parameters that the third device can meet, and functions supported by the third device. Furthermore, based on the service information of the third device, the service information of N devices stored by the first device is updated. When the third device disconnects from the network (also known as "going offline"), the service information of the third device is updated in real time to other devices to ensure the accuracy of the service information of the third device in the first device.
[0092] In one possible implementation, the above-mentioned conditions include supporting screen projection services.
[0093] In one possible implementation, the N devices include a third device; alternatively, the N devices do not include a third device, which is not a limitation in this application. This application does not specify whether the third device receives the discovery request message from the first device. This solution allows for the discovery of as many devices as possible, thereby improving the success rate and reliability of device discovery.
[0094] In one possible implementation, the N devices include the fourth device; alternatively, the N devices do not include the fourth device, which is not a limitation in this application. This application does not limit whether the fourth device receives the discovery request message from the first device. This solution allows for the discovery of as many devices as possible, thereby improving the success rate and reliability of device discovery.
[0095] In one possible implementation, the N devices include the fifth device; alternatively, the N devices do not include the fifth device, which is not a limitation in this application. This application does not limit whether the fourth device receives the discovery request message from the first device. This solution allows for the discovery of as many devices as possible, thereby improving the success rate and reliability of device discovery.
[0096] In a possible implementation, the first device is further configured to display at least one of the following information on the discovered device interface: a device name of the third device, a device type of the third device, an identifier of the third device, and a device serial number of the third device.
[0097] In a ninth aspect, a computer-readable storage medium is provided, which includes a computer program. When the computer program runs on an electronic device, the electronic device executes a method in any possible implementation of the first aspect or the second aspect.
[0098] In a tenth aspect, a chip system is provided, comprising a processor and a memory, wherein the memory stores computer program code; when the computer program code is executed by the processor, the processor implements the method as described in any possible implementation of the first or second aspects. The chip system may be composed of a chip alone, or may include a chip and other discrete components.
[0099] In an eleventh aspect, a computer program product is provided. When the computer program product is run on an electronic device, the electronic device executes the method in any possible implementation of the first aspect or the second aspect. BRIEF DESCRIPTION OF THE DRAWINGS
[0100] Figure 1 This is an example diagram of a device discovery scenario based on multicast / broadcast technology;
[0101] Figure 2 This is a comparison chart of device discovery results based on multicast / broadcast technology;
[0102] Figure 3 A diagram of a distributed device cluster architecture provided in an embodiment of the present application;
[0103] Figure 4A schematic diagram of the hardware structure of a terminal device provided in an embodiment of the present application;
[0104] Figure 5 A schematic diagram of the software structure of a terminal device provided in an embodiment of the present application;
[0105] Figure 6 An example diagram of the device discovery process interaction provided in an embodiment of the present application;
[0106] Figure 7 A flow chart of a device discovery method provided in an embodiment of the present application;
[0107] Figure 8 An example diagram of interaction in the discovery request phase provided by an embodiment of the present application;
[0108] Figure 9 An example of interaction in the unicast reply phase provided in the embodiment of this application Figure 1 ;
[0109] Figure 10 An example of interaction in the unicast reply phase provided in the embodiment of this application Figure 2 ;
[0110] Figure 11 An example of interaction in the unicast reply phase provided in the embodiment of this application Figure 3 ;
[0111] Figure 12 This is an example diagram of an interaction in the keep-alive trial phase provided in an embodiment of the present application;
[0112] Figure 13 This is an example diagram of a discovered device interface provided in an embodiment of the present application;
[0113] Figure 14 This is an example diagram of an interaction in the offline notification phase provided by an embodiment of the present application;
[0114] Figure 15 A schematic diagram of the structural composition of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0115] The technical solutions in the embodiments of the present application will be described below in conjunction with the accompanying drawings in the embodiments of the present application. In the description of the embodiments of the present application, unless otherwise specified, " / " means or, for example, A / B can mean A or B; "and / or" in this article is merely a description of the association relationship of associated objects, indicating that three relationships can exist, for example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, in the description of the embodiments of the present application, "multiple" means two or more than two.
[0116] In the following, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the technical features indicated. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features. In the description of this embodiment, unless otherwise specified, "plurality" means two or more (including two).
[0117] An embodiment of the present application provides a device discovery method, which is applied in a distributed device cluster, in a process where multiple devices collaborate to serve users.
[0118] The embodiments of the present application do not limit the application scenarios of the device discovery method. For example, the device discovery method provided in the embodiments of the present application can be applied in but not limited to home scenarios, driving scenarios, medical and health scenarios, office scenarios, and other scenarios.
[0119] Taking the home scene as an example, the distributed device cluster may include Figure 3 The devices shown include smartphones, televisions, wireless headphones, smart watches, smart bracelets, speakers, personal computers (PCs) (such as laptops, desktops, and ultra-mobile personal computers (UMPCs)), tablets, augmented reality (AR) / virtual reality (VR) devices, and Internet of Things (IoT) devices (such as smart home devices). IoT devices are an important component of future information technology development. Their main technical feature is that they connect objects to the Internet through communication technologies, thereby realizing an intelligent network that interconnects people, machines, and things.
[0120] For example, IoT devices may include, but are not limited to, alarms, smart door locks and other devices for security; smart desk lamps and other devices for lighting; fresh air systems, air conditioners, refrigerators, air purifiers, air quality sensors and other devices for health; dishwashers, disinfection cabinets and other devices for kitchen appliances; electric curtains and other devices for home decoration; or sweeping robots and other devices for cleaning.
[0121] It should be noted that this application Figure 3 This is only an example of a distributed device cluster architecture, and this application does not limit the specific architecture of the distributed device cluster.
[0122] For example, a distributed device cluster can include "1+8+N" terminal products. Among them, "1+8+N" terminal products are used to create full-scene smart life of the fifth-generation mobile communication technology (5G) and subsequent mobile communication technologies such as the next generation. For example, "1" refers to smartphones, which are the entrance to future smart life; "8" refers to tablets, PCs, wearable devices, high-definition (HD) devices, artificial intelligence (AI) speakers, headphones, AR / VR devices, and car equipment; "N" refers to IoT devices in general, such as smart home devices.
[0123] Among them, in the embodiment of the present application, multi-device collaboration refers to multiple devices (such as terminal devices in a distributed device cluster) collaborating to provide cross-platform and cross-system services.
[0124] For example, multi-device collaboration can provide multi-screen collaboration services. Exemplary multi-screen collaboration services include screen projection (such as video projection, image projection, etc.), remote screen control, etc. As an example, the screen projection methods of multi-screen collaboration may include but are not limited to same-source projection, different-source projection, etc., which are not limited in the embodiments of this application.
[0125] For example, multi-device collaboration can provide distributed audio collaborative output services. As an example, distributed audio collaborative output can be used to achieve audio transfer from device A to device B, adaptive switching of audio with the distributed display of the interface, etc., which is not limited in the embodiments of this application.
[0126] For example, multi-device collaboration can provide file sharing. For example, through device sharing services such as Huawei Share, you can share pictures, videos, audio and other files between multiple devices. For another example, through device sharing services such as sports health services, you can share exercise data (such as speed, exercise time, etc.), physical indicators (such as heart rate, blood pressure, etc.), sleep indicators (such as time of falling asleep, total sleep time, deep sleep time, etc.) between wearable devices (such as smart watches, smart bracelets, etc.) and portable devices (such as smartphones, tablets, etc.).
[0127] In the embodiments of the present application, device discovery is an essential step in multi-device collaboration. For example, device discovery is initiated by a discovery device, which is used to discover devices that can provide specified services (i.e., discovered devices) so that the discovered devices can collaborate with the discovery device to provide services such as screen projection (such as video projection, image projection, etc.), remote screen control, audio projection, and file sharing.
[0128] Among them, the discovery device and the discovered device can be any device in the distributed device cluster. For example, the discovery device and the discovered device can include but are not limited to desktop devices, laptop devices, handheld devices, wearable devices, smart home devices, computing devices, vehicle-mounted devices, airborne devices, etc. For example, smart phones, netbooks, tablets, smart watches, smart bracelets, phone watches, PCs, wireless headphones, televisions, speakers, smart cameras, somatosensory game consoles, personal digital assistants (PDAs), portable multimedia players (PMPs), AR / VR devices, session initiation protocol (SIP) phones, IOT terminal devices, wireless devices in smart cities, wireless devices in smart homes, etc., are not limited in this application.
[0129] by Figure 3 As an example of the distributed device cluster architecture shown in the figure, the discovery device and the discovered device can be Figure 3 Any device such as a smartphone, tablet, or PC in the distributed device cluster shown.
[0130] Since there may be multiple devices in a distributed device cluster that can provide a specified service, Figure 3 As an example of the distributed device cluster architecture shown in the figure, devices are discovered through device discovery. The discovered devices that can be discovered include Figure 3 Any one or more devices such as smart phones, tablet computers, and PCs in the distributed device cluster shown. That is, the discovery device can discover one or more discovered devices that can provide the specified service through device discovery.
[0131] Please refer to Figure 4 , Figure 4 The hardware structure diagram of a terminal device provided in an embodiment of the present application is shown. The terminal device can be a discovery device or a discovered device. Figure 4As shown, the terminal device may include a processor 410, a memory (including an external memory interface 420 and an internal memory 421), a universal serial bus (USB) interface 430, a charging management module 440, a power management module 441, a battery 442, an antenna 1, an antenna 2, a mobile communication module 450, a wireless communication module 460, an audio module 470, a speaker 470A, a receiver 470B, a microphone 470C, an earphone interface 470D, a sensor module 480, a button 490, a motor 491, an indicator 492, a camera component 493, a display screen 494, etc. Among them, the sensor module 480 may include a gyroscope sensor, an acceleration sensor, a magnetic sensor, a touch sensor, a fingerprint sensor, a pressure sensor, an air pressure sensor, a distance sensor, a proximity light sensor, a temperature sensor, an ambient light sensor, a bone conduction sensor, etc.
[0132] It should be understood that the structures illustrated in the embodiments of the present invention do not constitute specific limitations on the terminal device. In other embodiments of the present application, the terminal device may include more or fewer components than shown, or may combine or separate certain components, or arrange the components differently. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
[0133] Processor 410 may include one or more processing units. For example, processor 410 may include an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a flight controller, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU). The different processing units may be independent devices or integrated into one or more processors.
[0134] Processor 410 may also include a memory for storing instructions and data. In some embodiments, the memory in processor 410 is a cache memory. This memory can store instructions or data that have just been used or are being recycled by processor 410. If processor 410 needs to use the same instruction or data again, it can directly access the memory. This avoids duplicate accesses, reduces processor 410 latency, and thus improves system efficiency.
[0135] In some embodiments, the processor 410 may include one or more interfaces. The interfaces may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, and / or a universal serial bus (USB) interface.
[0136] The charging management module 440 is configured to receive charging input from a charger. The power management module 441 is configured to connect the battery 442, the charging management module 440, and the processor 410. The power management module 441 receives input from the battery 442 and / or the charging management module 440 to provide power to the processor 410, the internal memory 421, the display 494, the camera assembly 493, and the wireless communication module 460.
[0137] The wireless communication function of the terminal device can be implemented through antenna 1, antenna 2, mobile communication module 450, wireless communication module 460, modem processor and baseband processor.
[0138] Antenna 1 and Antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in the terminal device can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve antenna utilization. For example, antenna 1 can be reused as a diversity antenna for a wireless local area network. In other embodiments, the antennas can be used in conjunction with a tuning switch.
[0139] The mobile communication module 450 can provide solutions for wireless communications including 2G / 3G / 4G / 5G / 6G applied to terminal devices. The mobile communication module 450 may include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), etc. The mobile communication module 450 can receive electromagnetic waves from the antenna 1, and filter, amplify, and process the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation. The mobile communication module 450 can also amplify the signal modulated by the modulation and demodulation processor, and convert it into electromagnetic waves for radiation through the antenna 1. In some embodiments, at least some of the functional modules of the mobile communication module 450 can be set in the processor 410. In some embodiments, at least some of the functional modules of the mobile communication module 450 can be set in the same device as at least some of the modules of the processor 410.
[0140] The modem processor may include a modulator and a demodulator. The modulator is used to modulate the low-frequency baseband signal to be transmitted into a medium-high frequency signal. The demodulator is used to demodulate the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low-frequency baseband signal to the baseband processor for processing. After being processed by the baseband processor, the low-frequency baseband signal is passed to the application processor. The application processor outputs a sound signal through an audio device (not limited to the speaker 470A, the receiver 470B, etc.) or displays an image or video through the display screen 494. In some embodiments, the modem processor may be an independent device. In other embodiments, the modem processor may be independent of the processor 410 and be provided in the same device as the mobile communication module 450 or other functional modules.
[0141] The wireless communication module 460 can provide wireless communication solutions including wireless local area networks (WLAN) (such as Wi-Fi networks), Bluetooth BT, global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared technology (IR), etc. applied to the terminal device. The wireless communication module 460 can be one or more devices integrating at least one communication processing module. The wireless communication module 460 receives electromagnetic waves via the antenna 2, frequency modulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 410. The wireless communication module 460 can also receive the signal to be sent from the processor 410, frequency modulate it, amplify it, and convert it into electromagnetic waves for radiation through the antenna 2.
[0142] In some embodiments, antenna 1 of the terminal device is coupled to mobile communication module 450, and antenna 2 is coupled to wireless communication module 460, so that the terminal device can communicate with a network and other devices through wireless communication technology. The wireless communication technology may include global system for mobile communications (GSM), general packet radio service (GPRS), code division multiple access (CDMA), wideband code division multiple access (WCDMA), time-division code division multiple access (TD-SCDMA), long term evolution (LTE), new radio (NR), BT, GNSS, WLAN, NFC, FM, and / or IR technology. The GNSS may include a global positioning system (GPS), a global navigation satellite system (GLONASS), a Beidou navigation satellite system (BDS), a quasi-zenith satellite system (QZSS) and / or a satellite based augmentation system (SBAS).
[0143] In an embodiment of the present application, the wireless communication module 460 and the antenna 1 can be used to support the discovery device in sending discovery request messages, receiving and processing response messages, sending status acquisition messages, sending notification information, etc., and support the device in receiving and processing discovery request messages, sending response messages, receiving and processing status acquisition messages, receiving and processing notification information, etc.
[0144] The terminal device implements display functionality through a GPU, display screen 494, and an application processor. The GPU is a microprocessor for image processing that connects display screen 494 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. Processor 410 may include one or more GPUs that execute program instructions to generate or modify display information.
[0145] In an embodiment of the present application, the GPU, the display screen 494 and the application processor can be used to support the discovery device in rendering and displaying the discovered device interface.
[0146] Display screen 494 is used to display images, videos, etc. Display screen 494 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), a MiniLED, a MicroLED, a Micro-OLED, a quantum dot light-emitting diode (QLED), etc. In some embodiments, the terminal device may include one or K display screens 494, where K is a positive integer greater than 1.
[0147] The terminal device can realize the shooting function through ISP, camera component 493, video codec, GPU, display screen 494 and application processor.
[0148] External memory interface 420 can be used to connect an external memory card, such as a Micro SD card or solid-state drive, to expand the storage capacity of the terminal device. The external memory card communicates with processor 410 via external memory interface 420 to implement data storage. For example, files such as music and videos can be stored on the external memory card.
[0149] The internal memory 421 can be used to store computer executable program code, which includes instructions. The internal memory 421 may include a program storage area and a data storage area. Among them, the program storage area can store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc. The data storage area can store data created during the use of the terminal device (such as audio data, a phone book, etc.), etc. In addition, the internal memory 421 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc. The processor 410 executes various functional applications and data processing of the terminal device by running instructions stored in the internal memory 421 and / or instructions stored in a memory provided in the processor.
[0150] In the embodiment of the present application, the internal memory 421 may include and maintain service information of one or more devices.
[0151] The terminal device can implement audio functions such as music playback and recording through the audio module 470, speaker 470A, receiver 470B, microphone 470C, and application processor. For the specific working principles and functions of the audio module 470, speaker 470A, receiver 470B, and microphone 470C, please refer to the description of conventional technologies.
[0152] Keys 490 include a power button, a volume button, and the like. Keys 490 may be mechanical keys or touch-sensitive keys. The terminal device may receive key inputs and generate key signal inputs related to user settings and function control of the terminal device.
[0153] It should be noted that Figure 4 The hardware modules included in the terminal device shown are merely illustrative and do not limit the specific structure of the terminal device. For example, if the terminal device is a smartphone, the terminal device may also include a subscriber identity module (SIM) interface. If the terminal device is a television, the terminal device may also include components such as a remote control assembly. If the terminal device is a PC, the terminal device may also include components such as a keyboard and a mouse.
[0154] In this application, the operating system of the terminal device may include but is not limited to Harmony And other operating systems.
[0155] Including layered architecture Take the terminal equipment of the system as an example, Figure 5 As shown in Figure 1, the software of the terminal device can be divided into several layers, each with a clear role and division of labor. The layers communicate with each other through software interfaces. Figure 5 As shown in the figure, the software structure of the terminal device can be divided into three layers from top to bottom: application layer (referred to as application layer), application framework layer (referred to as framework layer), system library, Android runtime and kernel layer (also called driver layer).
[0156] The application layer may include a series of application packages, such as camera, gallery, calendar, call, map, navigation, Bluetooth, music, video, short message, etc. For the convenience of description, the application is referred to as application below.
[0157] The application framework layer provides application programming interface (API) and programming framework for the applications in the application layer. Figure 5 As shown, the application framework layer may include a window manager service (WMS), an activity manager service (AMS), and an input event manager service (IMS). In some embodiments, the application framework layer may also include a content provider, a view system, a phone manager, a resource manager, a notification manager, etc. ( Figure 5 not shown).
[0158] The system library and Android runtime contain the functions called by the FWK, the Android core library, and the Android virtual machine. The system library can include multiple functional modules, such as the browser kernel, three-dimensional (3D) graphics, and font libraries.
[0159] The system library can include multiple functional modules, such as surface manager, media library, 3D graphics processing library (such as OpenGL ES), 2D graphics engine (such as SGL), etc.
[0160] The kernel layer is the layer between hardware and software. It includes display drivers, input / output device drivers (e.g., keyboard, touchscreen, headset, speaker, microphone, etc.), device nodes, camera drivers, audio drivers, and sensor drivers. Users perform input operations through input devices. The kernel layer generates corresponding raw input events based on these input operations and stores them in device nodes. Input / output device drivers detect user input events. For example, a microphone can detect user speech.
[0161] It should be noted that Figure 5 Only layered architecture This application does not limit the specific architecture of the terminal device software system. For the specific introduction of software systems with other architectures, please refer to conventional technologies.
[0162] Figure 4 、 Figure 5 The hardware structure and software architecture of the terminal device are respectively shown as examples. The above hardware structure and software architecture can be applied to the first device, the second device, the third device, etc. This application does not limit the comparison.
[0163] It is understood that the advantage of multicast / broadcast is that it can save network overhead, while the advantage of unicast is its reliability. Based on this, the device discovery method provided in the embodiment of the present application can adopt the method of multicast / broadcast scanning and unicast interaction, while ensuring the reliability of device discovery, saving network overhead and reducing network load.
[0164] As a specific example, a device discovery method provided in an embodiment of the present application may mainly include the following four stages:
[0165] Phase 1: Discovery request phase.
[0166] The discovery request phase is used for a discovery device (hereinafter referred to as a "first device") to send a discovery request message to one or more devices to discover devices that meet conditions specified by the first device.
[0167] Phase 2: Unicast reply phase.
[0168] It can be understood that there is a certain overlap in the collaboration between terminal devices. For example, the second device has collaborated with the third device, and the second device has collaborated with the fourth device. Therefore, assuming that the terminal devices can share their respective service information (such as the types of services supported), then one device may know the service information of other devices, for example, the second device knows the types of services supported by the third and fourth devices. Based on this, in the device discovery process, the discovery device can not only know its service information from a certain device (such as the third device) itself, but also obtain its service information from other devices related to it (such as the second device).
[0169] Among them, in the embodiment of the present application, other devices related to the second device may include but are not limited to devices that have been discovered by the second device, devices that have discovered the second device, devices that have established a connection with the second device, devices that have provided collaborative services with the second device, etc., which are not limited in this application.
[0170] Based on this, in an embodiment of the present application, the unicast reply phase is used by the second device to notify the first device of information about other devices (such as a third device) that it knows about and that meet the conditions specified by the first device. The second device is any device among the multiple devices that received the discovery request message from the first device.
[0171] Phase 3: Liveness preservation trial phase.
[0172] The keep-alive probe phase is used to determine whether a device (such as a third device) that meets the conditions specified by the first device is in a working state through unicast probe. For example, if the third device is in a working state, the third device responds to the unicast probe.
[0173] In the embodiments of the present application, the device being in an operating state can be understood by way of example. For example, if the device is powered off, offline, etc., the device is not in an operating state. If the device is in a dormant state but can be awakened at any time for communication, the device is in an operating state.
[0174] Phase 4: Device discovery phase.
[0175] The device discovery phase is used by the first device to discover a device that meets the conditions specified by the first device, such as the third device.
[0176] In some embodiments, further, to ensure the accuracy of the device discovery result, a device discovery method provided in an embodiment of the present application may further include:
[0177] Phase 5: Offline notification phase.
[0178] The offline notification phase is used to notify other devices when a device is disconnected from the network (also known as "offline").
[0179] Furthermore, in some embodiments, in stage five, when the discovered device is disconnected from the network (also referred to as "going offline"), it will also update the service information of the third device to other devices in real time.
[0180] As an example, a device discovery method provided in an embodiment of the present application can be applied to Figure 6 As shown in the communication system. Figure 6 As shown, the communication system includes a smartphone, a television, a smartwatch, a tablet, a desktop computer, and a laptop computer. The smartphone, television, smartwatch, tablet, desktop computer, and laptop computer are all connected to the same Wi-Fi network. The smartphone is the discovering device, i.e., the first device.
[0181] exist Figure 6 When the smartphone shown in the figure (taking the smartphone as an example, other devices can also be used) performs device discovery, first, the smartphone (i.e., the first device) sends a discovery request message to the TV, smart watch, tablet, desktop computer, and laptop computer to discover devices that meet the specified conditions. Assuming that the laptop computer knows the service information of the desktop computer (for example, the laptop computer stores the service information of the desktop computer), and determines that the desktop computer meets the specified conditions based on the service information of the desktop computer, the laptop computer unicasts a reply to the smartphone (i.e., the first device) to inform the smartphone that the desktop computer meets the specified conditions. Among them, the laptop computer is the second device, the desktop computer is the third device, and the laptop computer and the desktop computer are related.
[0182] Furthermore, after the smartphone receives the unicast reply from the laptop, in order to ensure the normal status of the TV, e.g. Figure 12As shown, the smartphone uses unicast to detect whether the desktop computer is in working state. Assuming that the desktop computer is in working state, the desktop computer sends information (such as status information) indicating its state to the smartphone, so that the smartphone can find the desktop computer based on the message.
[0183] The following will be combined with the accompanying drawings to specifically introduce a device discovery method provided by an embodiment of the present application. Figure 7 As shown, the device discovery method provided in the embodiment of the present application may include the following S701-S705, wherein S701 is the above-mentioned stage 1, S702 is the above-mentioned stage 2, S703 is the above-mentioned stage 3, S704 is the above-mentioned stage 4, and S705 is the above-mentioned stage 5.
[0184] S701: A first device sends a discovery request message to multiple devices. The discovery request message is used to discover devices that meet specified conditions.
[0185] In some embodiments, the discovery request message includes a field or information indicating a specified condition.
[0186] Exemplarily, in an embodiment of the present application, the specified conditions may include but are not limited to one or more of being in a specified wireless local area network, supporting a specified service type, being able to meet specified service parameters, supporting specified functions, etc.
[0187] Among them, in the embodiments of the present application, the service types may include but are not limited to screen projection (such as video projection, picture projection, etc.), audio projection, remote screen control, file sharing, etc., which are not limited in this application.
[0188] As a possible implementation manner, the first device may use a broadcast technology to send a discovery request message to multiple devices.
[0189] As another possible implementation manner, the first device may use a groupcast (also called "multicast") technology to send a discovery request message to multiple devices.
[0190] The similarity between multicast and broadcast is that they are both one-to-many communication modes. The difference between multicast and broadcast is that multicast sends messages to devices within a multicast domain, while broadcast sends messages to devices within a broadcast domain. A multicast domain is a device group consisting of all devices that use the same multicast address to receive multicast data packets, also known as a multicast group. A broadcast domain refers to all devices within the same wireless local area network, also known as a broadcast group. Multicast domains and broadcast domains are also called multicast domains. For a detailed introduction to multicast and broadcast, please refer to conventional technology and this application will not elaborate on them.
[0191] It should be noted that Figure 7 Only the first device sending a discovery request message to device 1 and device 2 is taken as an example. Figure 7As shown, S701 may include S701-1 and S701-2. However, the embodiment of the present application does not limit the specific number of devices that receive the discovery request message from the first device.
[0192] Assume that Figure 6 In the device discovery process interaction example diagram shown in FIG, the TV, smart watch, tablet computer, desktop computer and laptop computer constitute the multicast domain of the smartphone (ie, the first device). Figure 8 As shown, when the smartphone (i.e., the first device) performs device discovery, it uses multicast technology to send a discovery request message to the TV, smart watch, tablet computer, desktop computer, and laptop computer to discover devices that meet the specified conditions. The discovery request message includes a field or information indicating the specified conditions. Figure 8 This example uses the case where a desktop computer fails to successfully receive a discovery request message from a smartphone, for example, due to poor network coverage or severe interference.
[0193] As an example, the first device may store service information of one or more devices. The first device may determine a multicast domain based on the service information of the one or more devices and a specified condition. For example, multiple devices in the multicast domain meet the specified condition.
[0194] For example, the first device may passively receive service information from one or more devices (including the second device). In another example, the first device may actively obtain service information from one or more devices (including the second device). This application does not limit the specific method for obtaining service information in the device.
[0195] As an example, in an embodiment of the present application, the first device may perform device discovery based on any multicast discovery-based protocol such as the Simple Service Discovery Protocol (SSDP), including sending discovery request messages to multiple devices based on any protocol, which is not limited by the present application. The discovery request message carries a field for identifying a specified condition (such as a specified service type).
[0196] The SSDP protocol is an application layer protocol. It is commonly used to find Universal Plug and Play (UPnP) devices. The SSDP protocol is implemented using a multicast discovery method based on notification and discovery routing. In Internet Protocol version 4 (IPv4), a multicast address is a Class D Internet Protocol (IP) address ranging from 224.0.0.0 to 239.255.255.255, such as 239.255.255.250. For another example, in Internet Protocol version 6 (IPv6), a multicast address might be FF0x::C (i.e., FF0x:0000:0000:0000:0000:0000:0000:0000:000C). In an embodiment of the present application, devices in a multicast domain listen for discovery request messages at a multicast address (such as 239.255.255.250) and a port (such as port 1900).
[0197] Taking the M-SEARCH method implemented based on SSDP and extended by the Hypertext Transfer Protocol (HTTP) as an example, the discovery request message can be as follows:
[0198] M-SEARCH*HTTP / 1.1 / / indicates that the message is implemented by extending the M-SEARCH method through the HTTP protocol. 1.1 indicates the version of the HTTP protocol. M-SEARCH indicates that the message is used for querying.
[0199] HOST:239.255.255.250:1900 / / The multicast address is 239.255.255.250 and the port is 1900 (IPv4)
[0200] MAN:ssdp:discover / / The protocol query type is ssdp:discover
[0201] MX: seconds to delay response / / Maximum response waiting time
[0202] ST:search target / / The target of service query.
[0203] The maximum response waiting time (ie, MX) is used by the device to randomly select a response delay value between 0 and this value to balance the network load for the device response.
[0204] As an example, the search target (ST) of the service query may include but is not limited to any of the following: ssdp:all (search all devices and services), upnp:rootdevice (search only the root device in the network), uuid:device-UUID (query the device identified by the universally unique identifier (UUID)), urn:schemas-upnp-org:device:device-Type:version (query the device type specified by the device-Type field, the device type and version are defined by the UPNP organization), urn:schemas-upnp-org:service:service-Type:version (query the service type specified by the service-Type field, the service type and version are defined by the UPNP organization).
[0205] Further, if a device (such as the second device) determines that another device meets the specified conditions, then further, the device (i.e., the second device) executes S702;
[0206] S702: The second device sends a response message to the first device, where the response message carries an identifier of a third device that meets a specified condition.
[0207] Exemplarily, the second device sends a response message to the first device in a unicast reply manner.
[0208] Exemplarily, the identifier of the third device may be a media access control (MAC) address, an identity number (ID), an international mobile equipment identity (IMEI), etc. of the third device, which is not limited in the embodiments of the present application.
[0209] The second device is one of the multiple collaborative devices that received the discovery request message from the first device. Figure 7 As shown, the second device is related to the third device. For example, the second device has been discovered by the third device, the second device has discovered the third device, the second device has established a connection with the third device, or the second device and the third device have provided a collaborative service together.
[0210] The second device stores service information of one or more devices, including service information of the third device.
[0211] This application does not limit the specific method for obtaining service information in the device. As an example, the second device can passively receive service information from one or more devices (including the third device). For example, the one or more devices and the second device are in the same multicast domain, broadcast domain, or local area network.
[0212] For example, when a device (such as the third device) accesses a local area network, the device can broadcast the types of services it can provide to devices in the same local area network (such as the second device) based on SSDP. Exemplarily, the device (such as the third device) can broadcast the above service information by sending a discovery request message to a standard address and port. Devices in the same local area network (such as the second device) listen on this port to see if there are new services added to the system. Exemplarily, the message format for obtaining service information is as follows:
[0213] NOTIFY*HTTP / 1.1 / / indicates that the message is implemented by extending the NOTIFY method of the HTTP protocol. 1.1 indicates the version of the HTTP protocol. NOTIFY indicates that the message is used for notification (such as notification service information (such as service type)).
[0214] HOST:239.255.255.250:1900 / / The multicast address is 239.255.255.250 and the port is 1900 (IPv4)
[0215] CACHE-CONTROL: max-age = seconds until advertisement expires / / max-age specifies the lifetime of the notification message. If this time interval is exceeded, the control point can assume that the device does not exist.
[0216] LOCATION: URL for UPnP description for root device / URL address of root device description
[0217] NT:search target / / Service query target
[0218] NTS:ssdp:alive / / The subtype of the notification message is ssdp:alive
[0219] USN: advertisement UUID / / The unified service name of different services, which provides a capability to identify the same service type.
[0220] As another example, the second device may actively obtain service information from one or more devices (including the third device). Exemplarily, the message format for obtaining service information is as follows:
[0221] C-SERVICES*HTTP / 1.1 / / indicates that the message is implemented by extending the C-SERVICES method through the HTTP protocol. 1.1 indicates the version of the HTTP protocol. C-SERVICES indicates that the message is used to obtain device service information (such as service type).
[0222] MX:seconds to delay response / / Maximum waiting time for response.
[0223] Furthermore, one or more devices, such as a third device, reply to the second device with their service information. Exemplarily, the reply message format is as follows:
[0224] HTTP / 1.1 200OK / / indicates the response information of the HTTP protocol, 1.1 indicates the version of the HTTP protocol, 200 is the status code, and 200OK indicates a successful connection
[0225] SERVICES: The type of service provided / / The service type can be a 16-bit field, each bit identifies a different service, for example, 1 for support and 0 for non-support
[0226] LOCATION: Network information / / For example, network information can mainly include IP address and port number
[0227] SERVICE-DESCRIPTION: The necessary description content required for the service / / varies for different services. For example, screen projection requires device resolution, audio projection requires the playback type supported by the playback device, etc.
[0228] It is understood that since the second device and the third device are related, the second device is aware of the service information of the third device. The service information of the third device can be used to indicate at least one or more of the following: service types supported by the third device, service parameters that the third device can meet, functions supported by the third device, etc.
[0229] For example, the second device knows one or more of the service types supported by the third device, the service parameters that the third device can meet, or the functions supported by the third device, etc. Based on this, if the third device meets the specified conditions, the first device can indirectly know from the second device.
[0230] As an example, in an embodiment of the present application, the second device may store service information of one or more devices. When the second device receives a discovery request message carrying a specified service type from the first device, the second device determines the device that supports the specified service type by querying the service information of the one or more devices stored locally, and sends a response message carrying an identifier of the device that supports the specified service type to the first device.
[0231] For example, a service information list is stored and maintained in the second device. The service information list is used to indicate one or more of the following: one or more devices that support screen projection, one or more devices that support distributed screen control, one or more devices that support audio projection, or one or more devices that support file sharing devices, etc. For example, the above-mentioned service information list may include an identifier of a device that supports screen projection, an identifier of a device that supports distributed screen control, an identifier of a device that supports audio projection, and an identifier of a device that supports file sharing.
[0232] Please refer to the following Table 1, which takes service information used to indicate supported service types as an example and shows a form of service information of one or more devices stored by a second device:
[0233] Table 1
[0234]
[0235] It should be noted that Table 1 is only an example, and the embodiment of the present application does not limit the specific form in which the second device stores the service information of one or more devices.
[0236] like Figure 9 As shown, assuming that the laptop computer determines that the desktop computer meets the specified conditions of the smartphone (i.e., the first device), the laptop computer unicasts a reply (i.e., sends a response message) to the smartphone to inform the smartphone that the desktop computer meets the specified conditions. The response message carries the identification of the desktop computer. The laptop computer is the second device, and the desktop computer is the third device.
[0237] Taking the SSDP protocol as an example, the response message can be as follows:
[0238] CACHE-CONTROL: max-age = seconds until advertisement expires / / max-age specifies the lifetime of the notification message. If this time interval is exceeded, the control point can assume that the device does not exist.
[0239] DATE: when response was generated
[0240] EXT: / / confirms that the MAN header field has been understood by the device
[0241] LOCATION: URL for UPnP description for root device / / Uniform resource locator (URL) address of root device description
[0242] SERVER:OS / Version UPNP / 1.0product / version / / Operating system name / version / product name / product version information
[0243] ST:search target / / Service query target
[0244] USN: advertisement UUID / / Unified service name for different services, which provides a capability to identify the same service type
[0245] COLLABORATIVE-DISCOVERY:ip:port / / If it is not empty, it means that the response message from the second device carries the identifier of the third device that meets the preset conditions.
[0246] As a possible implementation, if the second device meets the specified conditions, the above response message also carries information indicating that the second device meets the specified conditions, so as to notify the first device that the second device meets the specified conditions. Figure 10 As shown, assuming that the laptop meets the specified conditions, then Figure 10 The response message also carries the identifier of the laptop computer, which is the second device.
[0247] It should be noted that this application does not limit the specific manner in which the second device sends the identifier of the second device and the identifier of the third device that meet the specified conditions to the first device. For example, the second device may also send the identifier of the third device and the identifier of the second device to the first device respectively.
[0248] It should be noted that Figure 6 Take the laptop (i.e., the second device) unicasting a reply (i.e., sending a response message) to the smartphone (i.e., the first device) as an example. In some embodiments, if Figure 6 The laptop computer, tablet computer, smart watch or TV shown meets the specified conditions and can also reply a response message (i.e., a unicast reply) to the smartphone to inform the smartphone that it meets the specified conditions.
[0249] like Figure 11As shown, assuming that the laptop computer, tablet computer, smart watch and TV meet the specified conditions, the laptop computer, tablet computer, smart watch and TV each unicast a reply to the smartphone, carrying their own identification to notify the smartphone that they meet the specified conditions.
[0250] in addition, Figure 6 Taking the example of a laptop (i.e., the second device) unicasting a reply to the smartphone to inform the smartphone that the desktop computer meets the specified conditions, in some embodiments, if Figure 6 If the tablet computer, smart watch or TV determines that other devices also meet the specified conditions, the identification of the device can also be carried in the response message (where Figure 6 For example, assuming Figure 6 As shown, if the TV determines that the tablet computer meets the specified conditions, the TV can also send a response message (i.e., a unicast reply) to the smartphone, where the response message carries the tablet computer's identifier, wherein the TV is the second device and the tablet computer is the third device.
[0251] in addition, Figure 6 Take the example of a desktop computer that fails to receive the discovery request message from the smartphone due to poor network coverage or strong interference, and therefore does not unicast a reply to the smartphone. As a possible scenario, Figure 6 The desktop computer may also successfully receive the discovery request message from the smartphone, but fail to successfully unicast a reply to the smartphone. As another possible scenario, Figure 6 The desktop computer shown may not belong to the multicast domain of the smartphone, so the smartphone does not send a discovery request message to it. This application does not limit the specific reason why the smartphone does not receive a unicast reply from the desktop computer.
[0252] It should be noted that, Figure 7 Taking the example of the second device determining that the third device meets the specified conditions, the embodiments of the present application do not limit the number of devices that the second device determines to meet the specified conditions. For example, the response message sent by the second device to the first device may also include the identifier of a fourth device. The fourth device meets the specified conditions and is related to the second device. Furthermore, the first device may send a status acquisition message to the fourth device to obtain the status of the fourth device, that is, whether the fourth device is in an operating state. Furthermore, the first device may discover the fourth device upon obtaining that the fourth device is in an operating state.
[0253] In the embodiment of the present application, the fourth device may be in the multicast domain where the first device sends the discovery request message, or may not be in the multicast domain, which is not limited in the present application.
[0254] S703: The first device sends a status acquisition message to the third device to acquire the status of the third device. The status of the third device indicates whether the third device is in working state.
[0255] Whether the third device is in working state includes at least one of whether the third device is powered on, online, etc.
[0256] For example, the first device sending a status acquisition message to the third device includes the first device sending a unicast probe message to the third device. For example, the status acquisition message may include a probe message.
[0257] Taking SSDP as an example, the state acquisition message can be implemented by extending the P_ALIVE method of the HTTP protocol as follows:
[0258] P_ALIVE*HTTP / 1.1 / / indicates that the message is implemented by extending the P_ALIVE method of the HTTP protocol. 1.1 indicates the HTTP protocol version. P_ALIVE indicates that the message is used for keep-alive testing.
[0259] MAN:ssdp:probes-live / / Identifies this message as a keep-alive probe
[0260] MX:seconds to delay response / / The maximum waiting time for the device to respond.
[0261] It's understandable that because the first device indirectly learns that the third device meets the specified conditions from the second device, the first device is unaware of whether the third device is actually operating. Alternatively, even if the second device notifies the first device that the third device is operating, this information may be inaccurate. For example, the third device may be offline, but the second device is unaware of it. Therefore, the first device sends a status acquisition message to the third device to obtain its status, ensuring that the third device is operating and avoiding false detection.
[0262] Furthermore, if the third device is in a working state, the third device replies with a status response message to the first device.
[0263] Exemplarily, the reply to the status response message may be sent in a unicast manner.
[0264] It is understood that if the third device sends a status response message to the first device, it indicates that the third device is in an operational state, such as being powered on and online. For example, the status response message may carry status information of the third device. For another example, the status response message may carry information indicating that the third device is alive (e.g., Alive). This application does not limit the specific form or content of the status response message.
[0265] Taking SSDP as an example, the status response message can be as follows:
[0266] HTTP / 1.1 200OK / / indicates the response information of the HTTP protocol, 1.1 indicates the version of the HTTP protocol, 200 is the status code, and 200OK indicates a successful connection
[0267] LOCATION: URL for UPnP description for root device / / / URL address of root device description
[0268] NTS:ssdp:alive / / This message is used to notify that the device is in working state (i.e. keep alive)
[0269] USN: advertisement UUID / / / / The unified service name of different services, which provides a capability to identify the same service type.
[0270] Furthermore, in some embodiments, if the third device determines that another device related to it (e.g., a fifth device) meets specified conditions, the status response message sent by the third device to the first device may also include the identifier of the fifth device. Furthermore, the first device may send a status acquisition message to the fifth device to obtain the status of the fifth device, i.e., whether the fifth device is in an operating state. Furthermore, the first device may discover the fifth device upon obtaining that the fifth device is in an operating state.
[0271] In this embodiment of the present application, the fifth device may be in the multicast domain where the first device sends the discovery request message, or may not be in the multicast domain, which is not limited in this application.
[0272] S704: When determining that the third device is in working state, the first device discovers the third device.
[0273] In some embodiments, if the first device receives a status response message from the third device, it indicates that the third device is in a working state. In this case, the first device discovers the third device.
[0274] On the contrary, if the first device does not receive the status response message from the third device, it means that the third device cannot be in the working state. In this case, the first device fails to detect the third device.
[0275] Furthermore, after the first device discovers the third device, the first device saves information of the third device.
[0276] As an example, the information of the third device may include but is not limited to the device name, device type, device serial number, device identification or functions and parameters supported by the device, etc. of the third device, which is not limited in this application.
[0277] In some embodiments, during the process of device discovery by the first device, if the first device discovers a third device, the discovered device interface of the first device may include the discovered third device. Figure 13 shown.
[0278] S705: When the third device goes offline, it sends notification information to the first device and other devices.
[0279] In this embodiment of the present application, the third device going offline means that the third device disconnects the communication connection used for multi-device collaboration with the first device after the multi-device collaboration ends.
[0280] Illustratively, in an embodiment of the present application, when the third device goes offline, it can send notification information to the first device and other devices in a broadcast / multicast manner.
[0281] Taking SSDP as an example, the notification information can be implemented by extending the NOTIFY method of the HTTP protocol as follows:
[0282] NOTIFY*HTTP / 1.1 / / Indicates that the message is implemented by extending the NOTIFY method of the HTTP protocol
[0283] HOST:239.255.255.250:1900 / / The multicast address is 239.255.255.250 and the port is 1900 (IPv4)
[0284] NT:search target / / Service query target
[0285] NTS:ssdp:byebye / / The subtype of the notification message is ssdp:byebye.
[0286] In some embodiments, as Figure 14 As shown in FIG, when a desktop computer goes offline, a notification message is sent to a smartphone and a laptop computer, wherein the notification message includes the service information of the desktop computer.
[0287] It is understandable that the service information of a device is likely to change. For example, suppose that the third device supports service type 1, service type 2, and service type 3, but the service information of the third device saved in the second device indicates that the third device only supports service type 1 and service type 2. Based on this, in an embodiment of the application, when the third device goes offline, it sends notification information including the service information of the device to the first device and multiple collaborative devices, so that the first device and other devices can update the service information of the third device in real time. Based on this, more convenient, fast, and accurate device discovery is provided during subsequent device discovery. For example, the next time the first device discovers a device, it can send a device discovery request to the corresponding device based on the service information of one or more devices saved.
[0288] The embodiment of the present application provides a device discovery method, when a device (such as a second device) receives a discovery request message multicast / broadcasted from a discovery device (such as a first device), it can determine the device (such as a third device) that meets the conditions specified by the discovery device (i.e., the first device) by searching the service information of one or more devices stored in itself, and notify the discovery device (i.e., the first device). So that the discovery device (i.e., the first device) can discover the device (i.e., the third device) when it determines whether the device (i.e., the third device) that meets the specified conditions is in a working state through a keep-alive test. This method breaks through the conventional direct discovery technology and performs device discovery by indirectly obtaining information, which can improve the success rate of device discovery, optimize the discovery process, and save network overhead and reduce network load while ensuring the reliability of device discovery.
[0289] Furthermore, embodiments of the present application provide a device discovery method that can improve device awareness during device discovery and connection. For example, during the device discovery process, this method facilitates fault data retention and abnormal recovery in the event of a device failure. For example, if a third device meets preset conditions but the first device does not receive a response from the third device to the discovery request message from the first device, it is inferred that the third device has failed or that the communication link between the first and third devices has failed.
[0290] It should be noted that all or part of the above embodiments provided in this application can be freely and arbitrarily combined with each other, and the combined technical solutions are also within the scope of this application.
[0291] The device discovery method provided in the embodiments of the present application is applicable to the following electronic devices.
[0292] Figure 15The figure shows an electronic device 1500 provided by the present application. For example, the electronic device 1500 includes at least one processor 1510, a memory 1520 and a display screen 1530. Among them, the processor 1510 is coupled with the memory 1520 and the display screen 1530. The coupling in the embodiment of the present application can be a communication connection, can be electrical, or other forms. Specifically, the memory 1520 is used to store program instructions. The display screen 1530 is used to display a user interface. The processor 1510 is used to call the program instructions stored in the memory 1520, so that the electronic device 1500 executes the steps performed by the electronic device in the device discovery method provided by the embodiment of the present application. It should be understood that the electronic device 1500 can be used to implement the device discovery method provided by the embodiment of the present application. The relevant features can be referred to above and will not be repeated here.
[0293] In some embodiments, when a display screen has a touch function, the display screen is also referred to as a touch display screen. Operations on a touch display screen can be performed using virtual buttons. When a display screen does not have a touch function, the display screen is also referred to as a non-touch display screen. Operations on a non-touch display screen can be performed using physical buttons.
[0294] The present application provides a computer program product containing instructions. When the computer program product is run on an electronic device, the electronic device executes the steps performed by the electronic device in the device discovery method provided in the embodiments of the present application.
[0295] Exemplarily, the electronic device includes a mobile device, etc.
[0296] Those skilled in the art can clearly understand that the embodiments of the present application can be implemented in hardware, or in the form of hardware and software. When implemented using hardware and software, the above functions can be stored in a computer-readable medium. Based on this understanding, the technical solution of the embodiment of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as flash memory, mobile hard disk, read-only memory, random access memory, magnetic disk or optical disk.
[0297] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any changes or substitutions within the technical scope disclosed in the present invention should be included in the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be based on the scope of protection of the claims.
Claims
1. A device discovery method, applied to a first device; characterized in that: The method comprises: Sending a discovery request message to N devices including the second device, wherein the discovery request message is used to discover a device that meets a specified condition; the discovery request message includes information indicating the specified condition; N is a positive integer greater than or equal to 1; receiving a first response message from the second device, where the first response message includes an identifier of a third device that meets the specified condition; Sending a first status acquisition message to the third device to acquire a status of the third device, where the status of the third device indicates whether the third device is in a working state; When it is obtained that the third device is in a working state, the third device is discovered.
2. The method according to claim 1, characterized in that The first response message further includes an identifier of a fourth device that meets the specified conditions; The method further comprises: Sending a second status acquisition message to the fourth device to acquire a status of the fourth device, where the status of the fourth device is used to indicate whether the fourth device is in a working state; When it is obtained that the fourth device is in a working state, the fourth device is discovered.
3. The method according to claim 1, characterized in that The method further comprises: receiving a second response message from the third device, where the second response message includes an identifier of a fifth device that meets the specified condition; Sending a third status acquisition message to the fifth device to acquire a status of the fifth device, where the status of the fifth device indicates whether the fifth device is in a working state; When it is obtained that the fifth device is in a working state, the fifth device is discovered.
4. The method according to claim 1, wherein The sending of the discovery request message to the N devices including the second device includes: sending the discovery request message to the N devices including the second device in a multicast or broadcast manner; The receiving the first response message from the second device includes: receiving the first response message from the second device sent in a unicast manner; The sending the first status acquisition message to the third device includes: sending the first status acquisition message to the third device in a unicast manner.
5. The method according to claim 2, characterized in that The sending the second status acquisition message to the fourth device includes: sending the second status acquisition message to the fourth device in a unicast manner.
6. The method according to claim 3, characterized in that The receiving the second response message from the third device includes: receiving the second response message sent in a unicast manner from the third device; The sending the third status acquisition message to the fifth device includes: sending the third status acquisition message to the fifth device in a unicast manner.
7. The method according to any one of claims 1 to 6, characterized in that The first device pre-stores service information of M devices. Before sending the discovery request message to the N devices including the second device, the method further includes: The N devices that meet the specified conditions are determined based on the service information of the M devices; wherein M is a positive integer greater than or equal to N.
8. The method according to any one of claims 1 to 6, characterized in that The first response message further includes information indicating that the second device meets the specified condition; and the method further includes: In response to the first response message, the second device is discovered.
9. The method according to any one of claims 1 to 6, characterized in that The specified conditions include at least one of the following: being in a specified wireless local area network, supporting a specified service type, being able to meet specified service parameters, and supporting specified functions.
10. The method according to any one of claims 1 to 6, characterized in that The N devices include the third device.
11. A device discovery method, applied to a second device; characterized in that: The second device is associated with a third device; and the method includes: receiving a discovery request message from a first device, the discovery request message being used to discover a device meeting a specified condition; the discovery request message including information indicating the specified condition; A first response message is sent to the first device, where the first response message includes an identifier of the third device that meets the specified condition.
12. The method according to claim 11, characterized in that The second device is related to a fourth device, and the first response message further includes an identifier of the fourth device that meets the specified condition.
13. The method according to claim 11, characterized in that The sending the first response message to the first device includes: sending the first response message to the first device in a unicast manner.
14. The method according to any one of claims 11 to 13, characterized in that The second device is related to the third device, including at least one of the following: the second device has been discovered by the third device, the second device has discovered the third device, the second device and the third device have established a connection, and the second device and the third device have provided collaborative services together.
15. A device discovery method, applied to a communication system; the communication system includes a first device and N devices, the N devices including a second device; the second device is related to a third device, characterized in that: The method comprises: The first device sends a discovery request message to N devices including the second device, where the discovery request message is used to discover devices that meet specified conditions; the discovery request message includes information indicating the specified conditions; N is a positive integer greater than or equal to 1; The second device receives a discovery request message from the first device; The second device sends a first response message to the first device, where the first response message includes an identifier of the third device that meets the specified condition; The first device receives a first response message from the second device; The first device sends a first status acquisition message to the third device, for acquiring a status of the third device, where the status of the third device indicates whether the third device is in a working state; When it is obtained that the third device is in the working state, the first device discovers the third device.
16. The method according to claim 15, characterized in that The first response message further includes an identifier of a fourth device that meets the specified conditions; the second device is related to the fourth device; and the method further includes: The first device sends a second status acquisition message to the fourth device, for acquiring a status of the fourth device, where the status of the fourth device is used to indicate whether the fourth device is in a working state; When it is obtained that the fourth device is in the working state, the first device discovers the fourth device.
17. The method according to claim 15, characterized in that The first device sending a discovery request message to N devices including the second device includes: the first device sending the discovery request message to the N devices including the second device in a multicast or broadcast manner; The second device sending a first response message to the first device includes: the second device sending the first response message to the first device in a unicast manner; The sending, by the first device, of a first status acquisition message to the third device includes: the first device sending the first status acquisition message to the third device in a unicast manner.
18. The method according to any one of claims 15 to 17, characterized in that The second device is related to the third device, including at least one of the following: the second device has been discovered by the third device, the second device has discovered the third device, the second device and the third device have established a connection, and the second device and the third device have provided collaborative services together.
19. The method according to claim 18, characterized in that The second device stores the service information of the third device.
20. A communication system comprising a first device and N devices, wherein the N devices include a second device; the second device is associated with a third device; wherein: The first device is configured to perform: sending a discovery request message to N devices including the second device, the discovery request message being used to discover a device that meets a specified condition; the discovery request message including information indicating the specified condition; N being a positive integer greater than or equal to 1; and receiving a first response message from the second device, the first response message including an identifier of the third device that meets the specified condition; Sending a first status acquisition message to the third device to acquire a status of the third device, where the status of the third device indicates whether the third device is in a working state; When it is obtained that the third device is in a working state, discovering the third device; The second device is configured to execute: receiving the discovery request message from the first device; The first response message is sent to the first device, where the first response message is used to indicate that the third device meets the specified condition.
21. The system according to claim 20, wherein: The first response message further includes an identifier of a fourth device that meets the specified conditions; The first device is further configured to execute: A second status acquisition message is sent to the fourth device to obtain the status of the fourth device, where the status of the fourth device is used to indicate whether the fourth device is in a working state; when it is obtained that the fourth device is in a working state, the fourth device is discovered.
22. The system according to claim 20 or 21, characterized in that The first device sending a discovery request message to N devices including the second device includes: the first device sending the discovery request message to the N devices including the second device in a multicast or broadcast manner; The second device sending a first response message to the first device includes: the second device sending the first response message to the first device in a unicast manner; The sending, by the first device, of a first status acquisition message to the third device includes: the first device sending the first status acquisition message to the third device in a unicast manner.
23. A first device, characterized in that: The first device includes: memory for storing computer programs; A transceiver for receiving and sending radio signals; A processor, configured to execute the computer program so that the first device performs the method according to any one of claims 1 to 10.
24. A second device, characterized in that: The second device includes: memory for storing computer programs; A transceiver for receiving and sending radio signals; A processor, configured to execute the computer program so that the second device performs the method according to any one of claims 11 to 14.
25. A computer-readable storage medium, characterized in that The computer-readable storage medium includes a computer program, which, when executed on a first device, enables the first device to execute the method according to any one of claims 1 to 10; and which, when executed on a second device, enables the second device to execute the method according to any one of claims 11 to 14.
26. A computer program product comprising instructions, characterized in that When the computer program product runs on a first device, the first device executes the method according to any one of claims 1 to 10. When the computer program product runs on a second device, the second device executes the method according to any one of claims 11 to 14.
Citation Information
Patent Citations
Reverse discovery and pairing of client devices to a media device
US10999331B1