Device pairing method and apparatus
Patent Information
- Application Number
- CN202310304652.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-27
- Publication Date
- 2026-09-22
- Estimated Expiration
- 2043-03-27
AI Technical Summary
然而,在用户具有多台电子设备且需要多台电子设备之间均建立设备互联的情况下,那么就可能涉及到多次二维码的扫描,才能完成多台电子设备中两两电子设备的配对,使得设备互联过程中电子设备之间的配对复杂度较高
Smart Images

Figure CN116347664B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of communication technology, and in particular to a device pairing method and apparatus. Background Technology
[0002] To improve the ease of interaction between two electronic devices, device interconnection technology can be used to establish an interconnection channel between them.
[0003] To enable interconnection between two electronic devices, pairing is required. Currently, the pairing process involves one device scanning a QR code generated by the other, and pairing is completed based on the pairing information contained in the QR code. However, when a user has multiple electronic devices and needs to establish interconnection between them, multiple QR code scans may be required to complete pairing between any two devices, making the pairing process complex. Summary of the Invention
[0004] On one hand, this application provides a device pairing method applied to a first electronic device, comprising:
[0005] Identify the second electronic device that is connected to the first electronic device via the first interaction channel;
[0006] Identify at least one third electronic device that is connected to the second electronic device via a second interaction channel;
[0007] Based on the second electronic device, a pairing relationship is established between the first electronic device and the third electronic device, and the pairing relationship is used to establish a third interaction channel between the first electronic device and the third electronic device.
[0008] In one possible implementation, the first interaction channel is an interaction channel constructed based on the first pairing information between the first electronic device and the second electronic device;
[0009] The second interaction channel is an interaction channel constructed based on the second pairing information between the second electronic device and the third electronic device.
[0010] In yet another possible implementation, determining the third electronic device connected to the second electronic device via the second interaction channel includes:
[0011] The second electronic device obtains a list of paired devices through the first interaction channel, the list of paired devices indicating at least one third electronic device connected to the second electronic device through the second interaction channel.
[0012] In another possible implementation, before obtaining the list of paired devices of the second electronic device through the first interaction channel, the method further includes:
[0013] Output an active pairing reminder, which is used to prompt the user to confirm whether to start device pairing;
[0014] The step of obtaining the paired device list of the second electronic device through the first interaction channel includes:
[0015] Upon detecting a confirmation pairing instruction in response to the proactive pairing reminder, the second electronic device obtains a list of paired devices through the first interaction channel.
[0016] In another possible implementation, establishing a pairing relationship between the first electronic device and the third electronic device based on the second electronic device includes:
[0017] Generate target pairing information between the first electronic device and the third electronic device;
[0018] Based on the second electronic device, the target pairing information is transmitted to the third electronic device, so that the first electronic device and the third electronic device have a pairing relationship based on the target pairing information.
[0019] In yet another possible implementation, generating the target pairing information between the first electronic device and the third electronic device includes:
[0020] Generate a communication key between the first electronic device and the third electronic device;
[0021] The step of transmitting the target pairing information to the third electronic device based on the second electronic device includes:
[0022] Based on the second electronic device, the device identifier and communication key of the first electronic device are transmitted to the third electronic device, so that the first electronic device and the third electronic device have a pairing relationship based on the communication key.
[0023] In yet another possible implementation, before transmitting the target pairing information to the third electronic device, the method further includes:
[0024] Determine the IP address and port number of the first electronic device;
[0025] Simultaneously or subsequently, the method includes:
[0026] Based on the second electronic device, the IP address and port number of the first electronic device are transmitted to the third electronic device, so that the third electronic device can establish a third interaction channel with the first electronic device based on the pairing relationship, the IP address and port number of the first electronic device.
[0027] Furthermore, this application also provides another device pairing method applied to a second electronic device, including:
[0028] Identify the first electronic device that is connected to the second electronic device via the first interaction channel;
[0029] Identify at least one third electronic device that is connected to the second electronic device via a second interaction channel;
[0030] A pairing relationship is established between the first electronic device and the third electronic device, and the pairing relationship is used to establish a third interaction channel between the first electronic device and the third electronic device.
[0031] In another aspect, this application also provides a device pairing apparatus for use in a first electronic device, comprising:
[0032] The first device determination unit is used to determine a second electronic device that is connected to the first electronic device through a first interaction channel;
[0033] The second device determining unit is configured to determine at least one third electronic device that is connected to the second electronic device via a second interaction channel;
[0034] A pairing processing unit is used to establish a pairing relationship between the first electronic device and the third electronic device based on the second electronic device. The pairing relationship is used to establish a third interaction channel between the first electronic device and the third electronic device.
[0035] In another aspect, this application also provides another device pairing device for use in a second electronic device, comprising:
[0036] The first determining unit is used to determine the first electronic device that is connected to the second electronic device through the first interaction channel;
[0037] The second determining unit is configured to determine at least one third electronic device that is connected to the second electronic device via a second interaction channel;
[0038] A pairing establishment unit is used to establish a pairing relationship between the first electronic device and the third electronic device, and the pairing relationship is used to establish a third interaction channel between the first electronic device and the third electronic device. Attached Figure Description
[0039] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only embodiments of this application. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.
[0040] Figure 1 This paper illustrates a flowchart of a device pairing method provided in an embodiment of the present application.
[0041] Figure 2 This illustration shows yet another flowchart of the device pairing method provided in an embodiment of this application;
[0042] Figure 3 This illustration shows yet another flowchart of the device pairing method provided in an embodiment of this application;
[0043] Figure 4 This invention illustrates a flowchart of yet another device pairing method provided in an embodiment of this application.
[0044] Figure 5 This illustration shows a flowchart of a device pairing method provided in an embodiment of this application.
[0045] Figure 6 This paper shows a schematic diagram of the composition structure of a device pairing device provided in an embodiment of this application;
[0046] Figure 7 This paper shows a schematic diagram of the composition structure of a device pairing device provided in an embodiment of this application;
[0047] Figure 8 This paper illustrates a schematic diagram of the component architecture of an electronic device provided in an embodiment of this application. Detailed Implementation
[0048] The solution in this application embodiment is applicable to establishing pairing relationships between different electronic devices for building interactive channels, reducing the complexity of pairing between electronic devices.
[0049] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of this application.
[0050] like Figure 1The diagram illustrates a flowchart of a device pairing method provided in an embodiment of this application. This method is applied to an electronic device. To distinguish this electronic device from other electronic devices that establish interaction channels and pairing relationships with it, the electronic device is referred to as a first electronic device. This first electronic device can be a tablet, mobile phone, or laptop computer, etc., without limitation.
[0051] The method in this embodiment may include:
[0052] S101, determine the second electronic device that is connected to the first electronic device through the first interaction channel.
[0053] In this application, the interactive channel established between two electronic devices can also be called a device interconnection channel or a device direct connection channel, which refers to an interactive channel that enables direct data transmission between two electronic devices without the aid of a third-party device for data forwarding.
[0054] For example, the interaction channel can be a direct connection channel established between two electronic devices based on Wi-Fi (Wireless Fidelity), a P2P direct connection channel established based on P2P (peer-to-peer) technology, or a direct connection channel established through a wireless network or the same local area network, etc., without any restrictions.
[0055] Through the interaction channel between the two electronic devices, file transfer, screen mirroring, and mutual control can be achieved without any restrictions.
[0056] For ease of distinction, this application refers to the interaction channel established between the first electronic device and the second electronic device as the first interaction channel, and the interaction channel established between the subsequent second electronic device and the third electronic device as the second interaction channel.
[0057] It is understandable that after the first electronic device establishes a first interaction channel with the second electronic device, the first electronic device can identify the second electronic device that is connected to the first electronic device through the first interaction channel.
[0058] S102, at least one third electronic device is identified that is connected to the second electronic device via a second interaction channel.
[0059] In this application, provided that a second interaction channel is established between the second electronic device and the third electronic device, the first electronic device can determine the third electronic device that the second electronic device is connected to through the second interaction channel.
[0060] For example, if the first electronic device and the second electronic device establish a first interaction channel, the first electronic device can request the device information of the second electronic device that the second electronic device is connected to through the first interaction channel, thereby determining the information of each third electronic device connected to the second electronic device through the second interaction channel.
[0061] For example, if a second electronic device and a third electronic device have established a second interaction channel, and the second electronic device and the first electronic device have also established a first interaction channel, the second electronic device can actively report information about the third electronic devices it connects to through the second interaction channel to the first electronic device, so that the first electronic device can confirm the third electronic devices connected by the second electronic device through the second interaction channel.
[0062] S103, Based on the second electronic device, establish a pairing relationship between the first electronic device and the third electronic device.
[0063] The pairing relationship between the first electronic device and the third electronic device is used to establish a third interaction channel between the first electronic device and the third electronic device.
[0064] The third interaction channel that can be established based on the pairing relationship between the first electronic device and the third electronic device is also the device interconnection channel or device direct connection channel mentioned above.
[0065] It is understandable that the third interaction channel can be the same type of interaction channel as the first and second interaction channels, or it can be a different type of interaction channel, without any restrictions.
[0066] It is understandable that the first electronic device achieves pairing with the third electronic device through the second electronic device. Essentially, it can use the second electronic device, which has already established an interaction channel with the first electronic device, to complete the automatic pairing between the first electronic device and the third electronic device that is already connected to the second electronic device. This eliminates the need for manual pairing by scanning QR codes between the first and third electronic devices.
[0067] In this application, any two of the first electronic device, the second electronic device, and the third electronic device can be of the same type or different types of electronic devices, without limitation.
[0068] As can be seen from the above, in this embodiment of the application, under the premise that the first electronic device and the second electronic device have established a first interaction channel, the first electronic device can determine at least one third electronic device connected to the second electronic device through the second interaction channel. On this basis, the first electronic device can establish a pairing relationship between the first electronic device and the third electronic device through the second electronic device, thereby eliminating the need for the user to manually complete the pairing between the first electronic device and the third electronic device by scanning a QR code, thus reducing the complexity of pairing between different electronic devices.
[0069] The pairing of the first electronic device with the third electronic device, which is connected to the second electronic device, can be implemented in various ways. For example, the first electronic device can use the first interaction channel and the second interaction channel between the second and third electronic devices to realize the information exchange required for pairing and complete the relevant pairing.
[0070] For ease of understanding, the device pairing method of this application will be introduced below using one implementation as an example.
[0071] like Figure 2 As shown, it illustrates another flowchart of the device pairing method provided in this application embodiment. The method of this embodiment is applied to a first electronic device and may include:
[0072] S201, determine the second electronic device that is connected to the first electronic device through the first interaction channel.
[0073] S202, at least one third electronic device is identified that is connected to the second electronic device via a second interaction channel.
[0074] The above two steps can be found in the relevant descriptions of other embodiments of this application, and will not be repeated here.
[0075] In one possible implementation, in order for the first electronic device to distinguish each of the third electronic devices connected to the second electronic device, the first electronic device can use the second electronic device to determine the device identifier of each of the at least one third electronic device connected to the second electronic device via the second interaction channel.
[0076] S203, for each third electronic device, generate target pairing information between the first electronic device and the third electronic device.
[0077] The target pairing information is information generated by the first electronic device for the third electronic device to establish a pairing relationship. The target pairing information generated by the first electronic device differs for different third electronic devices.
[0078] In one possible implementation, the target pairing information includes at least a communication key between the first electronic device and the third electronic device. This communication key is used by the first electronic device to verify that the third electronic device is a trusted electronic device. Similarly, after the third electronic device establishes a pairing relationship with the first electronic device, the third electronic device can also identify the first electronic device as a trusted communication device based on this communication key.
[0079] For example, the first electronic device and the third electronic device can establish an interactive channel based on the communication key and transmit data based on the interactive channel.
[0080] Of course, the target pairing information may also include: the name of the first electronic device and other information, without limitation.
[0081] S204, based on the second electronic device, the target pairing information is transmitted to the third electronic device so that the first electronic device and the third electronic device have a pairing relationship based on the target pairing information.
[0082] For example, the first electronic device can instruct the second electronic device to transmit target pairing information to the third electronic device.
[0083] It is understandable that, since a first interaction channel is established between the first electronic device and the second electronic device, the first electronic device can transmit the target pairing information to the second electronic device through the first interaction channel, so that the second electronic device can send the target pairing information to the third electronic device through the second interaction channel.
[0084] For example, a first electronic device sends a forwarding request to a second electronic device via a first interaction channel. This forwarding request carries the target pairing information and the device identifier of the third electronic device. Accordingly, in response to the forwarding request, the second electronic device forwards the target pairing information to the corresponding third electronic device based on the device identifier of the third electronic device.
[0085] As mentioned above, the pairing relationship between the first electronic device and the third electronic device is used to establish a third interaction channel between the first electronic device and the third electronic device.
[0086] After receiving the target pairing information, the third electronic device can store the target pairing information as pairing information between the first electronic device and the second electronic device, thereby establishing a pairing relationship between the first electronic device and the second electronic device.
[0087] In one possible implementation, in order for the third electronic device to know the first electronic device corresponding to the target pairing information, the first electronic device may also transmit its device identifier and communication key to the third electronic device based on the second electronic device, so that the first electronic device and the third electronic device have a pairing relationship based on the communication key.
[0088] Correspondingly, the third electronic device can associate and store the device identifier and communication key of the first electronic device to establish a pairing relationship between the third electronic device and the first electronic device.
[0089] Of course, in practical applications, after the first electronic device sends the target pairing information (such as a communication key) to the second electronic device, the second electronic device can determine the sender of the target pairing information, and thus determine the device identifier of the first electronic device. Based on this, in this application, the first electronic device may only send the target pairing information to the second electronic device, and the second electronic device will send the target pairing information and the device identifier of the first electronic device to the third electronic device.
[0090] It is understandable that, in order for the first electronic device to subsequently confirm that the third electronic device is an electronic device paired with the first electronic device based on the target pairing information, the first electronic device may also store the target pairing information between the first electronic device and the third electronic device after generating the target pairing information or after this step S204.
[0091] For example, the first electronic device can associate and store the device identifier of the third electronic device with the target pairing information to complete the pairing between the first electronic device and the third electronic device.
[0092] It is understood that, in any embodiment of this application, after the first electronic device sends the target pairing information to the third electronic device through the second electronic device, a pairing relationship based on the target pairing information is established between the first electronic device and the third electronic device. Based on this, the first electronic device and the third electronic device can construct an interaction channel based on the target pairing information.
[0093] In practical applications, the first electronic device and the third electronic device can establish an interaction channel after the pairing relationship is established; or, if the user needs to establish an interaction channel between the first electronic device and the second electronic device, the first electronic device (or the third electronic device) can then establish an interaction channel with the third electronic device (or the first electronic device) based on the target pairing information.
[0094] There are various possibilities for establishing a third interaction channel between the first electronic device and the third electronic device based on the target pairing information, and this application does not impose any restrictions on this.
[0095] To make it easier to understand, let's take one possible scenario as an example:
[0096] Taking the example of a first electronic device actively establishing an interaction channel with a third electronic device, where the target pairing information includes at least a communication key:
[0097] The first electronic device can scan for the third electronic device using Bluetooth technology. If it detects an electronic device with the same device identifier as the third electronic device, then the third electronic device is detected. Based on this, the first electronic device obtains the current IP address and port number of the third electronic device via Bluetooth communication. The first electronic device can then send a channel establishment request encrypted with the specified communication key to the third electronic device using this IP address and port number. The third electronic device decrypts the communication establishment request using the stored communication key corresponding to the first electronic device. If decryption is successful, a third interactive channel can be established between the first and third electronic devices.
[0098] Of course, this is only for ease of understanding, and the example of establishing an interaction channel is used for illustration. In this application, there are no restrictions on how and when the third interaction channel based on the target pairing information is established between the first electronic device and the third electronic device.
[0099] In one possible implementation, in order to enable the first electronic device and the third electronic device to build a third interaction channel in a timely and convenient manner after a pairing relationship is established between the first electronic device and the third electronic device, the first electronic device may also determine its IP address and port number before transmitting the target pairing information to the third electronic device based on the second electronic device.
[0100] Correspondingly, at the same time or after the first electronic device transmits the target pairing information to the third electronic device, the first electronic device may also transmit the IP address and port number of the first electronic device to the third electronic device based on the second electronic device, so that the third electronic device can establish a third interactive channel with the first electronic device based on the pairing relationship, the IP address and port number of the first electronic device.
[0101] It is understandable that since the first electronic device sends its IP address and port number to the third electronic device at the same time or after sending the target pairing information, if the third electronic device needs to establish an interaction channel with the first electronic device after obtaining the target pairing information, then the third electronic device does not need to scan or obtain the IP address and port number of the first electronic device through Bluetooth or other wireless communication technologies. It can directly establish an interaction channel with the first electronic device based on the IP address and port number of the first electronic device. This not only reduces and improves the efficiency of establishing the interaction channel, but also reduces the resource consumption caused by multiple data exchanges between the first and second electronic devices.
[0102] It is understood that, in this application, the third interaction channel that the first electronic device and the third electronic device can establish based on the target pairing information can be the same type of interaction channel as the first interaction channel and the second interaction channel, or it can be an interaction channel of a different type.
[0103] In one possible implementation, the first interaction channel is an interaction channel constructed based on first pairing information between the first electronic device and the second electronic device. Correspondingly, the second interaction channel is an interaction channel constructed based on second pairing information between the second electronic device and the third electronic device.
[0104] It is understandable that a pairing relationship had already been established between the first electronic device and the second electronic device before the first interaction channel was built between them.
[0105] In this application, establishing a pairing relationship between the first electronic device and the second electronic device means that both the first electronic device and the second electronic device obtain first pairing information between them, which is information used to establish a first interaction channel.
[0106] It is understandable that the pairing relationship between the first electronic device and the second electronic device can be historically established, or it can be a pairing relationship established to establish the first interaction channel. Accordingly, the first interaction channel can be an interaction channel established for the first time between the first electronic device and the second electronic device based on the first pairing information, or it can be an interaction channel established before the first time, without any restriction.
[0107] It is understandable that the first interconnection channel can be initiated by the first electronic device or by the second electronic device, without any restriction.
[0108] In this application, the pairing relationship between the first electronic device and the second electronic device can be established in various ways, and this application does not impose any restrictions on the specific implementation process of obtaining the first pairing information.
[0109] For example, the first electronic device can obtain the first pairing information between the first electronic device and the second electronic device by scanning the QR code generated by the second electronic device; or, the first electronic device generates a QR code containing pairing information, and the second electronic device obtains the pairing information by scanning the QR code, thus completing the pairing between the first electronic device and the second electronic device.
[0110] Taking the example of a first electronic device scanning a QR code containing first pairing information generated by a second electronic device: The second electronic device can generate a QR code containing first pairing information, which may include at least: a first communication key used by the second electronic device for pairing and a unique identifier of the second electronic device (such as the MAC address of the second electronic device). Based on this, the first electronic device can obtain the first pairing information by scanning the QR code of the second electronic device, and complete the pairing with the second electronic device by storing the first pairing information.
[0111] In most cases, if the first electronic device and the second electronic device are not paired, but the user needs to establish an interaction channel between them, the user will scan the QR code generated by the second electronic device to complete the pairing. Therefore, the QR code generated by the second electronic device may also include the second electronic device's current IP address and port number. Correspondingly, the first electronic device can initiate the establishment of an interaction channel with the second electronic device based on its IP address, port number, and the first communication key. The second electronic device agrees to establish the interaction channel and will also store the device identifier of the first electronic device, thus completing the pairing and establishing the interaction channel simultaneously.
[0112] If the first electronic device and the second electronic device have already established a pairing relationship, and the first electronic device (or the second electronic device) needs to establish an interaction channel with the second electronic device (or the first electronic device) again, then the first electronic device (or the second electronic device) can obtain the current IP address and port number of the second electronic device (or the first electronic device) through wireless technologies such as Bluetooth in order to establish an interaction channel again.
[0113] For example, the first electronic device and the second electronic device can also be paired using the scheme of this application with the help of a fourth electronic device.
[0114] Of course, the first electronic device and the second electronic device can also be paired in other ways, and this application does not impose any restrictions on this.
[0115] Similarly, the second electronic device and the third electronic device have already established a pairing relationship before the second interaction channel is constructed. The specific implementation method for establishing the pairing relationship between the second electronic device and the third electronic device can refer to the method for establishing the pairing relationship between the first electronic device and the second electronic device, without any specific restrictions.
[0116] Understandably, given that both the first and second interaction channels are established based on corresponding pairing information, the third electronic device that the first electronic device determines is connected to the second electronic device can be at least a third electronic device that determines that the second electronic device has been paired and has established a second interaction channel.
[0117] The following explanation will be based on a specific implementation.
[0118] like Figure 3 This illustrates another flowchart of the device pairing method provided in this application embodiment. The method in this embodiment may include:
[0119] S301, based on the first pairing information that has been paired between the first electronic device and the second electronic device, a first interconnection channel is established between the first electronic device and the second electronic device.
[0120] It is understandable that, given that the first electronic device and the second electronic device have established a first interaction channel, the first electronic device can naturally determine the second electronic device connected to the first interaction channel.
[0121] As mentioned above, the establishment of the first interaction channel can be initiated by either the first electronic device or the second electronic device, without any restriction.
[0122] S302, obtain the list of paired devices of the second electronic device through the first interaction channel.
[0123] The paired device list indicates at least one third electronic device connected to the second electronic device via a second interaction channel. The second interaction channel is an interaction channel constructed based on the second pairing information between the second and third electronic devices.
[0124] For example, the list of paired devices may include the device identifiers of each third electronic device that is connected to the second electronic device via a second interaction channel.
[0125] Understandably, in practical applications, there are multiple ways to obtain this list of paired devices.
[0126] For example, after the first electronic device confirms its connection to the second electronic device through the first interaction channel, the first electronic device sends a paired list request to the second electronic device. This paired list request requests a list of paired devices for the second electronic device. Accordingly, the second electronic device responds to the list request and returns the paired list to the first electronic device.
[0127] For example, after the first electronic device and the second electronic device establish a first interaction channel, the second electronic device can actively send its paired device list to the first electronic device through the first interaction channel.
[0128] In one possible implementation, to avoid pairing unwanted electronic devices without the user's knowledge, the first electronic device can output a proactive pairing reminder before obtaining the list of paired devices. This reminder prompts the user to confirm whether to initiate device pairing. Of course, the proactive pairing reminder can also indicate information such as the device name and device identifier of the second electronic device on which automatic pairing depends; there are no limitations on this.
[0129] Accordingly, upon detecting a confirmation pairing instruction in response to the proactive pairing reminder, a list of paired devices for the second electronic device is obtained through the first interaction channel. The confirmation pairing instruction indicates that the user confirms pairing of the first electronic device with other electronic devices based on the second electronic device.
[0130] S303, Based on the second electronic device, establish a pairing relationship between the first electronic device and the third electronic device.
[0131] This pairing relationship is used to establish a third interaction channel between the first electronic device and the third electronic device.
[0132] This step S303 can be referred to in the relevant description of the previous embodiments, and there are no limitations thereon.
[0133] In this embodiment of the application, when the second electronic device has been paired with the first electronic device and a first interaction channel has been established, and the second electronic device has been paired with the third electronic device and a second interaction channel has been established, the first electronic device can achieve pairing with the third electronic device based on the second electronic device, without the user having to manually establish pairing between the first electronic device and the third electronic device.
[0134] Based on this, when a user has multiple electronic devices, only one electronic device needs to be used to establish a pairing and interaction channel with the other electronic devices. Then, the user's other electronic devices can establish device pairings with each of the user's devices through this device, which greatly improves the complexity of pairing multiple electronic devices.
[0135] For example:
[0136] Taking a user with 10 electronic devices as an example, let's assume that the user's 5 electronic devices are electronic device 1 to electronic device 5.
[0137] In the traditional pairing method, any two electronic devices need to scan a QR code to complete the pairing. Therefore, to pair up any two of five electronic devices, the user would need to scan the QR code 10 times. Of course, the more electronic devices a user has, the more QR codes will need to be scanned to complete the pairing. For example, if a user has six electronic devices, pairing up any two of them would require scanning the QR code 16 times.
[0138] In this embodiment, device 1 only needs to scan the QR codes generated by the other four electronic devices to pair with electronic devices 2, 3, 4, and 5, establishing an interaction channel. Based on this, using the solution of this application, electronic device 2 can pair with electronic devices 3, 4, and 5 through electronic device 1; similarly, electronic device 3 can pair with electronic devices 4 and 5 through electronic device 1, and electronic device 4 can pair with electronic device 5 through electronic device 1. Therefore, by using the solution of this application, pairing five devices only requires scanning four QR codes, greatly reducing the complexity of pairing multiple electronic devices.
[0139] The device pairing method of this application is described below from the perspective of the second electronic device. For example... Figure 4 This illustration shows a schematic diagram of an implementation process of the device pairing method provided in this application on the second electronic device side. The method of this embodiment is applied to the second electronic device and may include:
[0140] S401, determine the first electronic device that is connected to the second electronic device through the first interaction channel.
[0141] For example, based on the first pairing information between the first electronic device and the second electronic device, a first interaction channel is established between the first electronic device and the second electronic device, so that the second electronic device can confirm that the first electronic device is connected through the first interaction channel.
[0142] This step S401 is similar to the specific implementation of the first electronic device determining the second electronic device connected through the first interaction channel, and will not be described again here.
[0143] S402, at least one third electronic device is identified that is connected to the second electronic device via a second interaction channel.
[0144] For example, based on the first pairing information between the second electronic device and the third electronic device, a second interaction channel is established between the second electronic device and the third electronic device, thereby obtaining the third electronic device connected to the second electronic device through the second interaction channel.
[0145] It is understood that the second interaction channels connected to each third electronic device are different. This application is only for the purpose of easy distinction, and refers to any electronic device other than the first and second electronic devices that is connected to the second electronic device through an interaction channel as a third electronic device.
[0146] For information on the first and second interaction channels, please refer to the relevant descriptions in the previous embodiments, which will not be repeated here.
[0147] S403, establish a pairing relationship between the first electronic device and the third electronic device.
[0148] The pairing relationship between the first electronic device and the third electronic device is used to establish a third interaction channel between the first electronic device and the third electronic device.
[0149] For example, in one possible implementation, the second electronic device can send information about at least one third electronic device connected to the second electronic device via the second interaction channel to the first electronic device. Based on this, the first electronic device can send target pairing information to the second electronic device via the first interaction channel, and the second electronic device then sends this target pairing information to the third electronic device to establish a pairing relationship between the first and second electronic devices based on the target pairing information.
[0150] The specific method by which the second electronic device sends information from at least one third electronic device to the first electronic device can be found in the description of the previous embodiments. For example, the second electronic device can send a list of paired devices to the first electronic device, which will not be repeated here.
[0151] To facilitate understanding of the solution and related benefits of this application, a specific implementation method is described below, using the example of a first electronic device interconnected with a second electronic device via a first interaction channel, while the second electronic device is interconnected with two third electronic devices via a second interaction channel. For ease of distinction, the two third electronic devices will be referred to as third electronic device A and third electronic device B, respectively.
[0152] like Figure 5 The diagram illustrates a flowchart of a device pairing method provided in this embodiment. The method of this embodiment may include:
[0153] S501, based on the first pairing information that has been paired between the first electronic device and the second electronic device, a first interaction channel is established between the first electronic device and the second electronic device.
[0154] S502, based on the second pairing information A between the second electronic device and the third electronic device A, a second interaction channel A is established between the second electronic device and the third electronic device A.
[0155] S503, based on the second pairing information B between the second electronic device and the third electronic device B, a second interaction channel B is established between the second electronic device and the third electronic device B.
[0156] It is understandable that the order of the above three steps is not limited to... Figure 5 As shown, in practical applications, these three interaction channels may be established simultaneously or interchanged in sequence, depending on the actual situation, without any restrictions.
[0157] S504, the first electronic device confirms that the second electronic device is connected through the first interaction channel, and sends a paired list request to the second electronic device through the first interaction channel.
[0158] The paired list request is used to request a list of devices that the second electronic device has been paired with.
[0159] S505, in response to the paired list request, the second electronic device sends a list of paired devices to the first electronic device through the first interaction channel.
[0160] The list of paired devices includes the device identifiers of each third electronic device that has been paired with the second electronic device and connected via an interaction channel. Therefore, in this embodiment, the list of paired devices includes the device identifier of the third electronic device A and the device identifier of the third electronic device B.
[0161] It is understandable that step S504 is illustrated by the example of the first electronic device requesting the second electronic device to send a list of paired devices. In practical applications, it is also possible that the second electronic device actively sends a list of paired devices to the first electronic device after connecting to the first electronic device.
[0162] S506, for the third electronic device A in the paired device list, the first electronic device generates a communication key A corresponding to the third electronic device A, stores the communication key A as pairing information corresponding to the device identifier of the third electronic device A, and sends the communication key A corresponding to the device identifier of the third electronic device A to the second electronic device through the first interaction channel.
[0163] The communication key A can be sent to indicate that the receiving device is a third electronic device A, so that the second electronic device can send the communication key A to the third electronic device through the second interaction channel A.
[0164] S507, the second electronic device sends the device identifier and communication key A of the first electronic device to the third electronic device A through the second interaction channel A, so that the third electronic device A stores the communication key A as pairing information corresponding to the device identifier of the first electronic device.
[0165] S508, for the third electronic device B in the paired device list, the first electronic device generates a communication key B corresponding to the third electronic device B, stores the communication key B as pairing information corresponding to the device identifier of the third electronic device B, and sends the communication key B corresponding to the device identifier of the third electronic device B to the second electronic device through the first interaction channel.
[0166] S509, the second electronic device sends the device identifier and communication key B of the first electronic device to the third electronic device B through the second interaction channel B, so that the third electronic device B stores the communication key B as pairing information corresponding to the device identifier of the first electronic device.
[0167] As can be seen from this embodiment, when the first electronic device and the second electronic device establish a first interaction channel, the first electronic device can establish a pairing relationship with the two third electronic devices connected to the second electronic device, thereby eliminating the need for the user to manually scan the QR codes generated by the two third electronic devices to complete the pairing, thus reducing the complexity of device pairing.
[0168] Corresponding to the operation of the device pairing method on the first electronic device side in this application, this application also provides a device pairing apparatus.
[0169] like Figure 6 The diagram illustrates a structural schematic of a device pairing apparatus according to an embodiment of this application. The apparatus is applied to a first electronic device. The apparatus may include:
[0170] The first device determination unit 601 is used to determine a second electronic device that is connected to the first electronic device through a first interaction channel;
[0171] The second device determination unit 602 is used to determine at least one third electronic device that is connected to the second electronic device through a second interaction channel;
[0172] The pairing processing unit 603 is used to establish a pairing relationship between the first electronic device and the third electronic device based on the second electronic device. The pairing relationship is used to establish a third interaction channel between the first electronic device and the third electronic device.
[0173] In one possible implementation, the first interaction channel is an interaction channel constructed based on the first pairing information between the first electronic device and the second electronic device;
[0174] The second interaction channel is an interaction channel constructed based on the second pairing information between the second electronic device and the third electronic device.
[0175] In yet another possible implementation, the second device determining unit includes:
[0176] The device list determination unit is configured to obtain a list of paired devices of the second electronic device through the first interaction channel, wherein the list of paired devices indicates at least one third electronic device connected to the second electronic device through the second interaction channel.
[0177] In yet another possible implementation, the device further includes:
[0178] The reminder output unit is used to output an active pairing reminder before the device list determination unit obtains the list of paired devices of the second electronic device through the first interaction channel. The active pairing reminder is used to prompt the user to confirm whether to start device pairing.
[0179] The device list determination unit includes:
[0180] The device list determination subunit is used to obtain the list of paired devices of the second electronic device through the first interaction channel after detecting a confirmation pairing instruction for the active pairing reminder.
[0181] In yet another possible implementation, the pairing processing unit includes:
[0182] An information generation unit is used to generate target pairing information between the first electronic device and the third electronic device;
[0183] An information transmission unit is configured to transmit the target pairing information to the third electronic device based on the second electronic device, so that the first electronic device and the third electronic device have a pairing relationship based on the target pairing information.
[0184] In yet another possible implementation, the information generation unit includes:
[0185] A key generation subunit is used to generate a communication key between the first electronic device and the third electronic device;
[0186] The information transmission unit includes:
[0187] An information transmission subunit is configured to transmit the device identifier and communication key of the first electronic device to the third electronic device based on the second electronic device, so that the first electronic device and the third electronic device have a pairing relationship based on the communication key.
[0188] In yet another possible implementation, the device further includes:
[0189] An auxiliary information determination unit is used to determine the IP address and port number of the first electronic device before the information transmission unit transmits the target pairing information to the third electronic device.
[0190] An auxiliary information sending unit is used to transmit the IP address and port number of the first electronic device to the third electronic device simultaneously or after the information transmission unit transmits the target pairing information to the third electronic device, based on the second electronic device, so that the third electronic device can establish a third interaction channel with the first electronic device based on the pairing relationship, the IP address and port number of the first electronic device.
[0191] On the other hand, corresponding to the operation of the device pairing method on the second electronic device side in this application, this application also provides another device pairing device.
[0192] like Figure 7 The diagram illustrates a structural composition of another device pairing device provided in this application embodiment. This device is applied to a second electronic device and includes:
[0193] The first determining unit 701 is used to determine the first electronic device that is connected to the second electronic device through the first interaction channel;
[0194] The second determining unit 702 is used to determine at least one third electronic device that is connected to the second electronic device through a second interaction channel;
[0195] The pairing establishment unit 703 is used to establish a pairing relationship between the first electronic device and the third electronic device, and the pairing relationship is used to establish a third interaction channel between the first electronic device and the third electronic device.
[0196] Furthermore, this application also provides an electronic device, such as Figure 8 As shown, it illustrates a schematic diagram of the composition structure of the electronic device. The electronic device can be any type of electronic device, and the electronic device includes at least a processor 801 and a memory 802.
[0197] The processor 801 is used to execute the device pairing method as described in any of the above embodiments.
[0198] The memory 802 is used to store programs required by the processor to perform operations.
[0199] It is understood that the electronic device may also include a display unit 803 and an input unit 804.
[0200] Of course, the electronic device can also have more than Figure 8 There are no restrictions on the number of components, whether more or fewer.
[0201] On the other hand, this application also provides a computer-readable storage medium storing at least one instruction, at least one program, code set, or instruction set, wherein the at least one instruction, the at least one program, the code set, or the instruction set is loaded and executed by a processor to implement the device pairing method as described in any of the above embodiments.
[0202] This application also proposes a computer program comprising computer instructions stored in a computer-readable storage medium. When executed on an electronic device, the computer program performs the device pairing method as described in any of the above embodiments.
[0203] It is understood that in this application, the terms "first," "second," "third," "fourth," etc. (if present) in the specification, claims, and accompanying drawings are used to distinguish similar parts and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in a sequence other than that illustrated herein.
[0204] It should be noted that the various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. Furthermore, the features described in the various embodiments of this specification can be substituted or combined with each other, enabling those skilled in the art to implement or use this application. For apparatus embodiments, since they are basically similar to method embodiments, the description is relatively simple; relevant parts can be referred to the descriptions of the method embodiments.
[0205] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes the element.
[0206] The above description of the disclosed embodiments enables those skilled in the art to make or use this application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this application. Therefore, this application is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
[0207] The above are merely preferred embodiments of this application. It should be noted that those skilled in the art can make various improvements and modifications without departing from the principles of this application, and these improvements and modifications should also be considered within the scope of protection of this application.
Claims
1. A device pairing method, applied to a first electronic device, comprising: Identify the second electronic device that is connected to the first electronic device via the first interaction channel; The second electronic device obtains a list of paired devices through the first interaction channel, the list of paired devices indicating at least one third electronic device that has successfully connected to the second electronic device through the second interaction channel; Determine a third electronic device from the list of paired devices to be connected to the first electronic device; The communication key between the first electronic device and the third electronic device to be connected, as well as the IP address and port number of the first electronic device, are sent to the second electronic device through the first interaction channel. This allows the second electronic device to establish a third interaction channel between the first electronic device and the third electronic device in response to a request from the third electronic device to create a third interaction channel based on the communication key, which is transmitted to the third electronic device to be connected through the second interaction channel.
2. The method according to claim 1, wherein the first interaction channel is an interaction channel constructed based on the first pairing information between the first electronic device and the second electronic device; The second interaction channel is an interaction channel constructed based on the second pairing information between the second electronic device and the third electronic device.
3. The method according to claim 1, further comprising, before obtaining the paired device list of the second electronic device through the first interaction channel: Output an active pairing reminder, which is used to prompt the user to confirm whether to start device pairing; The step of obtaining the paired device list of the second electronic device through the first interaction channel includes: Upon detecting a confirmation pairing instruction in response to the proactive pairing reminder, the second electronic device obtains a list of paired devices through the first interaction channel.
4. A device pairing method, applied to a second electronic device, comprising: Identify the first electronic device that is connected to the second electronic device via the first interaction channel; The second electronic device sends a list of paired devices to the first electronic device through the first interaction channel, so that the first electronic device can determine a third electronic device to be connected to the first electronic device from the list of paired devices; the list of paired devices indicates at least one third electronic device that has successfully connected to the second electronic device through the second interaction channel. The communication key used between the first electronic device and the third electronic device to be connected, as well as the IP address and port number of the first electronic device, are obtained through the first interaction channel. The first electronic device transmits the information to the third electronic device to be connected through the second interaction channel. In response to the request from the third electronic device to be connected to create a third interaction channel based on the communication key, a third interaction channel is established between the first electronic device and the third electronic device.
5. A device pairing device, applied to a first electronic device, comprising: The first device determination unit is used to determine a second electronic device that is connected to the first electronic device through a first interaction channel; The second device determination unit is configured to obtain a list of paired devices of the second electronic device through the first interaction channel, wherein the list of paired devices indicates at least one third electronic device that has successfully connected to the second electronic device through the second interaction channel; and to determine a third electronic device to be connected to the first electronic device from the list of paired devices. A pairing processing unit is configured to send a communication key for the first electronic device and the third electronic device to be connected, as well as the IP address and port number of the first electronic device, to the second electronic device through a first interaction channel, so that the second electronic device, based on the communication key passed to the third electronic device to be connected through a second interaction channel, establishes a third interaction channel between the first electronic device and the third electronic device in response to a request from the third electronic device to be connected to create a third interaction channel based on the communication key.
6. A device pairing device, applied to a second electronic device, comprising: The first determining unit is used to determine the first electronic device that is connected to the second electronic device through the first interaction channel; The second determining unit is configured to send a list of paired devices of the second electronic device to the first electronic device through the first interaction channel, so that the first electronic device can determine a third electronic device to be connected to the first electronic device from the list of paired devices; the list of paired devices indicates at least one third electronic device that has successfully connected to the second electronic device through the second interaction channel. A pairing establishment unit is used to obtain, through a first interaction channel, a communication key for the first electronic device and the third electronic device to be connected, as well as the IP address and port number of the first electronic device; The first electronic device transmits the information to the third electronic device to be connected through the second interaction channel. In response to the request from the third electronic device to be connected to create a third interaction channel based on the communication key, a third interaction channel is established between the first electronic device and the third electronic device.
Citation Information
Patent Citations
Electronic equipment and method for establishing communication connection among electronic equipment
CN105933897A