EP-4460096-B1 - COMMUNICATION METHODS
Inventors
- ZHANG, Qihu
- HU, Shiyao
- LIU, FENG
- ZHANG, YINGYING
Dates
- Publication Date
- 20260506
- Application Date
- 20230301
Claims (10)
- A communication method, carried out by a first device, wherein the first device supports a first protocol, and the method comprises: performing (S501) a device discovery operation based on the first protocol, to discover a first candidate device that supports the first protocol; determining (S501) the first candidate device as an auxiliary device in response to determining that the first candidate device further supports a second protocol, wherein the second protocol is different from the first protocol; or broadcasting (S501) a query packet based on the first protocol; receiving (S502) a protocol information packet, wherein the protocol information packet is a packet fed back by a second device in response to the query packet, and the protocol information packet indicates a communication protocol supported by the second device, or indicates a communication protocol currently available for the second device; and determining (S503) the second device as an auxiliary device based on the protocol information packet indicating that the second device supports or is currently capable of using the second protocol; after determining the auxiliary device, sending (S504) a scan packet to the auxiliary device, wherein the scan packet indicates the auxiliary device to perform a device discovery operation; receiving (S505) a device information packet sent by the auxiliary device, wherein the device information packet comprises device information of a second candidate device discovered by the auxiliary device by performing the device discovery operation based on the second protocol; and displaying (S506) device information of the first candidate device and the device information of the second candidate device; wherein the first device receives one or more protocol information packets; and the determining the second device as an auxiliary device based on the protocol information packet indicating that the second device supports or is currently capable of using the second protocol specifically comprises: determining, based on the one or more protocol information packets, one or more second protocol sets corresponding to the one or more second devices, wherein the second protocol set is a set of communication protocols supported by or currently available for the second device; and determining, as the auxiliary device, a second device corresponding to a second protocol set that comprises the second protocol and that is not a proper subset of another second protocol set; wherein if there are at least two second devices that support a same target protocol set, the first device sequentially compares, based on priorities of various types of working status information, the second devices that support the same target protocol set, reserves a second device with optimal performance as the auxiliary device and removes a second device with poorer performance; wherein the working status information comprises one or more of a power connection status, remaining battery level information, central processing unit usage, memory usage, and communication capability information.
- The method according to claim 1, wherein the method further comprises: detecting a device selection operation of a user; determining a target device in response to the device selection operation, wherein the target device is the first candidate device or the second candidate device; and when the target device is the second candidate device, sending a first connection request to the auxiliary device that discovers the target device, wherein the first connection request is used to trigger the first device to establish a connection to the auxiliary device based on the first protocol, and is used to trigger the auxiliary device to establish a connection to the target device based on the second protocol.
- The method according to claim 2, wherein after the sending a first connection request to the auxiliary device that discovers the target device, the method further comprises: sending a data packet to the auxiliary device, wherein the data packet comprises data to be sent to the target device by the first device.
- The method according to claim 2, wherein after the determining a target device, the method further comprises: when the target device is the first candidate device, establishing a connection to the target device based on the first protocol.
- The method according to any one of claims 1 to 4, wherein the device information packet further comprises device information of an electronic device discovered by a next-level auxiliary device corresponding to the auxiliary device.
- A communication method, carried out by a second device, wherein the second device supports a first protocol and a second protocol, and the method comprises: receiving a query packet that is broadcast by a first device based on the first protocol; sending a protocol information packet to the first device in response to the query packet, wherein the protocol information packet indicates a communication protocol supported by the second device, or indicates a communication protocol currently available for the second device; after receiving a scan packet sent by the first device, performing a device discovery operation based on the second protocol, to discover a second candidate device that supports the second protocol, wherein the second protocol is different from the first protocol; and sending a device information packet to the first device, wherein the device information packet comprises device information of the second candidate device; wherein when sending the protocol information packet, the second device includes the working status information of the second device in the protocol information packet; wherein the working status information comprises one or more of a power connection status, remaining battery level information, central processing unit usage, memory usage, and communication capability information.
- The method according to claim 6, wherein the sending a protocol information packet to the first device in response to the query packet specifically comprises: obtaining, in response to the query packet, information about the communication protocol supported by the second device; and sending the protocol information packet to the first device after determining that the communication protocol supported by the second device comprises the second protocol.
- The method according to claim 6 or 7, wherein the device information packet further comprises device information of an electronic device discovered by a next-level auxiliary device corresponding to the second device; and before the sending a device information packet to the first device, the method further comprises: determining the next-level auxiliary device corresponding to the second device; sending an auxiliary scan packet to the next-level auxiliary device, wherein the auxiliary scan packet is used to trigger the next-level auxiliary device to perform a device discovery operation; and receiving a response packet sent by the next-level auxiliary device, wherein the response packet comprises the device information of the electronic device discovered by the next-level auxiliary device by performing the device discovery operation.
- A computer-readable storage medium, comprising instructions which, when executed by a computer, cause the computer to carry out the method of any one of claims 1 to 8.
- A chip system, comprising a memory and a processor, the memory storing instructions and the processor being configured to execute the instructions to cause a device to carry out the method of any one of claims 1 to 8.
Description
TECHNICAL FIELD This application relates to the communication field, and in particular, to a communication method, an electronic device, and an apparatus. BACKGROUND With continuous development of the smart home industry, more internet of things devices appear in people's homes, and these internet of things devices may support different communication protocols. When a user wants to control an internet of things device by using a personal device of the user, the personal device of the user needs to support a communication protocol used by the internet of things device. If the personal device of the user does not support the communication protocol used by the internet of things device, or cannot communicate with the internet of things device temporarily by using the communication protocol used by the internet of things device, the personal device of the user cannot discover the internet of things device, and cannot establish a connection to the internet of things device. However, in an actual application scenario, the personal device of the user can support a limited quantity of communication protocols. As a result, the personal device of the user may not be able to support a communication protocol used by some internet of things devices, and cannot discover these internet of things devices, affecting user experience. US 2021/127244 A1 discloses that an electronic device comprises a first communication circuit configured to support a first communication protocol; a display; and at least one processor operatively connected to the first communication circuit and the display, wherein the at least one processor is configured to: configure a cluster with at least one external electronic based on the first communication protocol device through the first communication circuit, receive through the first communication circuit, from the at least one external electronic device, information identifying at least one short-range communication device connected to the at least one external electronic device via a second communication protocol, and control the display to display at least one indicator of the at least one short-range communication device based on the information received from the at least one external electronic device. SUMMARY The present invention is set out in the appended set of claims. Embodiments of this application provide a communication method, an electronic device, and an apparatus, to resolve a problem that a device discovery capability of an electronic device used by a user is insufficient because the electronic device can support a limited quantity of communication protocols or the electronic device cannot use some communication protocols temporarily. According to a first aspect, an embodiment of this application provides a communication method, applied to a first device. The first device supports a first protocol. The method includes: performing a device discovery operation based on the first protocol, to discover a first candidate device that supports the first protocol;determining the first candidate device as an auxiliary device in response to determining that the first candidate device further supports a second protocol, where the second protocol is different from the first protocol; orbroadcasting a query packet based on the first protocol; receiving a protocol information packet, where the protocol information packet is a packet fed back by a second device in response to the query packet, and the protocol information packet indicates a communication protocol supported by the second device, or indicates a communication protocol currently available for the second device; and determining the second device as an auxiliary device based on the protocol information packet indicating that the second device supports or is currently capable of using the second protocol;after determining the auxiliary device, sending a scan packet to the auxiliary device, where the scan packet indicates the auxiliary device to perform a device discovery operation;receiving a device information packet sent by the auxiliary device, where the device information packet includes device information of a second candidate device discovered by the auxiliary device by performing the device discovery operation based on the second protocol; anddisplaying device information of the first candidate device and the device information of the second candidate device. It should be noted that, in embodiments of this application, the first device may be understood as an electronic device that is being used by a user. For example, the first device may be any one or more of electronic devices such as a mobile phone, a tablet computer, a smart large screen, and a smartwatch that are being used by the user. The first device supports a communication protocol in a first protocol set. The first protocol set may include one or more communication protocols. The communication protocol may include a wired communication protocol and/or a wireless comm