Equipment connection method and device, electronic equipment, storage medium and program product

By acquiring a set of paired devices and establishing a logical connection based on channel information for data interaction authentication, the problem of cumbersome device connection operations is solved, and a faster device connection process is achieved.

CN121368034APending Publication Date: 2026-01-20BEIJING XIAOMI MOBILE SOFTWARE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410979847.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-19
Publication Date
2026-01-20

AI Technical Summary

Technical Problem

In device connectivity scenarios, connecting different electronic devices logged into the same account is cumbersome and time-consuming, especially when a device successfully connects to another electronic device and then needs to be reset before it can be paired and connected to another device.

Method used

By acquiring a set of paired devices, a logical connection is established with the device to be connected based on the target channel information, and data interaction authentication is performed. If the authentication is successful, a device connection is established using a paired connection method, which simplifies the device connection process.

Benefits of technology

It improves the speed and efficiency of device connection, and reduces cumbersome operation steps and time costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121368034A_ABST
    Figure CN121368034A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of communication, and particularly provides an equipment connection method and device, electronic equipment, a storage medium and a program product. The equipment connection method comprises the following steps of: logging in a target user account at present; when it is determined that a broadcast message sent by the to-be-connected device is received, obtaining target channel information and device information; if it is determined that the to-be-connected device is a paired device of other devices logged in with the target user account according to the device information, when it is determined that a connection instruction is received, a logic connection request is sent to the to-be-connected device based on the target channel information; if a returned connection confirmation response is received, determining to establish a logic connection with the to-be-connected device; performing data interaction authentication with the to-be-connected equipment through the logic connection; and if it is determined that the data interaction authentication is passed, establishing a device connection with the to-be-connected device in a pairing connection mode. Therefore, the equipment connection speed can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of communication, in particular to a device connection method and device, electronic device, storage medium and program product. BACKGROUND

[0002] In some device connection scenarios, different electronic devices logged in with the same account are respectively connected to the same device, and if the device has already been successfully connected with one of the electronic devices, it is usually necessary to reset it before pairing with another electronic device.

[0003] For example, in the Bluetooth connection scenario of a mobile phone and a headset, if the headset has been successfully paired with mobile phone A, the headset will usually remain in an unconnectable and undiscoverable mode. If mobile phone B logged in with the same account as mobile phone A wants to pair with the headset, it usually needs to reset the headset first so that the headset is in a pairable mode, and then mobile phone B can pair with the headset.

[0004] However, in this way, when the device connection is logged in with the same account as the paired device of other devices, the device connection operation is more cumbersome and time-consuming. SUMMARY

[0005] The purpose of the embodiments of the present application is to provide a device connection method, device, electronic device, storage medium and program product to improve the device connection speed when the device connection is logged in with the same account as the paired device of other devices.

[0006] In one aspect, the present application provides a device connection method, which comprises:

[0007] Obtaining a set of paired devices corresponding to a target user account currently logged in, wherein the set of paired devices includes paired devices logged in with the target user account;

[0008] When a broadcast message sent by a to-be-connected device is received, obtaining target channel information in the broadcast message and device information of the to-be-connected device;

[0009] If it is determined that the set of paired devices includes the to-be-connected device according to the device information, when a connection instruction for the to-be-connected device is received from a current user, a logical connection request is sent to the to-be-connected device based on the target channel information;

[0010] If a connection confirmation response returned by the to-be-connected device based on the logical connection request is received, a logical connection between the to-be-connected device and the device is established;

[0011] Through the logical connection, data interaction authentication between the to-be-connected device and the device is performed;

[0012] If it is determined that the data interaction authentication is passed, a pairing connection is adopted to establish the device connection with the to-be-connected device.

[0013] In an implementation, the paired device set corresponding to the target user account currently logged in is acquired, including:

[0014] When the target user account is logged in locally, a pairing device request containing the target user account is sent to the server.

[0015] The paired device set returned by the server based on the pairing device request is received.

[0016] In an implementation, when it is determined that the connection instruction of the current user for the to-be-connected device is received, a logical connection request is sent to the to-be-connected device based on the target channel information, including:

[0017] When the connection instruction is received, a first physical connection request is sent to the to-be-connected device according to the device address information contained in the broadcast message.

[0018] If the connection confirmation response returned by the to-be-connected device based on the first physical connection request is received, it is determined that the first physical connection with the to-be-connected device is established.

[0019] Based on the first physical connection and the target channel information, a logical connection request is sent to the to-be-connected device.

[0020] In an implementation, a pairing connection is adopted to establish the device connection with the to-be-connected device, including:

[0021] A paging message is sent to the to-be-connected device.

[0022] When it is determined that the paging response returned by the to-be-connected device based on the paging message is received, a file system data packet is sent to the to-be-connected device; when the data interaction authentication is passed, the to-be-connected device lowers the current paging scanning period to a set paging scanning period, and performs paging scanning based on the set paging scanning period to scan the paging message.

[0023] When it is determined that the notification response returned by the to-be-connected device based on the file system data packet is received, a second physical connection request is sent to the to-be-connected device.

[0024] If the connection confirmation response returned by the to-be-connected device based on the second physical connection request is received, it is determined that the second physical connection with the to-be-connected device is established.

[0025] Based on the second physical connection, a pairing connection is adopted to establish the device connection with the to-be-connected device.

[0026] In one implementation, the paging scanning period is set as a paging scanning window; the paging scanning window refers to a scanning duration in each paging scanning period.

[0027] In one aspect, a device connection method is provided in the embodiments of the present application, and the method comprises:

[0028] The device to be connected sends a broadcast message containing target channel information;

[0029] When it is determined that a logical connection request sent by the target device based on the target channel information is received, a connection confirmation response is sent to the target device to establish a logical connection with the target device; the target user account currently logged in the target device corresponds to a paired device set containing the device to be connected; the paired device set includes paired devices of the device logged in with the target user account;

[0030] Through the logical connection, data interaction authentication with the target device is performed;

[0031] If it is determined that the data interaction authentication is passed, a paired connection is adopted to establish a device connection with the target device.

[0032] In one implementation, when it is determined that a logical connection request sent by the target device based on the target channel information is received, a connection confirmation response is sent to the target device, which comprises:

[0033] When it is determined that a first physical connection request sent by the target device according to the device address information contained in the broadcast message is received, a connection confirmation response is sent to the target device to establish a first physical connection with the target device;

[0034] When it is determined that a logical connection request sent by the target device based on the first physical connection and the target channel information is received, a connection confirmation response is sent to the target device based on the first physical connection.

[0035] In one implementation, if it is determined that the data interaction authentication is passed, a paired connection is adopted to establish a device connection with the target device, which comprises:

[0036] If it is determined that the data interaction authentication is passed, the current paging scanning period is lowered to the set paging scanning period;

[0037] Paging scanning is performed based on the set paging scanning period;

[0038] If it is determined that a paging message sent by the target device is scanned, a paging response is sent to the target device;

[0039] If it is determined that a file system data packet sent by the target device is received, a notification response is sent to the target device;

[0040] If it is determined that the second physical connection request sent by the target device is received, a connection confirmation response is returned to the target device to establish the second physical connection with the device to be connected.

[0041] Based on the second physical connection, a device connection with the target device is established in a pairing connection mode.

[0042] In an embodiment, the paging scanning period is set as a paging scanning window, which refers to a scanning duration in each paging scanning period.

[0043] In an aspect, an apparatus for device connection is provided in the embodiments of the present application, and the apparatus comprises:

[0044] An obtaining unit is configured to obtain a paired device set corresponding to a target user account currently logged in, wherein the paired device set comprises a paired device of a device logged in with the target user account.

[0045] A receiving unit is configured to, when it is determined that a broadcast message sent by a device to be connected is received, obtain target channel information in the broadcast message and device information of the device to be connected.

[0046] A sending unit is configured to, if it is determined that the device to be connected is included in the paired device set according to the device information, send a logical connection request to the device to be connected based on the target channel information when a connection instruction for the device to be connected is received by a current user.

[0047] A connecting unit is configured to, if a connection confirmation response returned by the device to be connected based on the logical connection request is received, determine that a logical connection with the device to be connected is established.

[0048] An authenticating unit is configured to perform data interaction authentication with the device to be connected through the logical connection.

[0049] A pairing unit is configured to, if it is determined that the data interaction authentication is passed, establish a device connection with the device to be connected in a pairing connection mode.

[0050] In an embodiment, the obtaining unit is configured to:

[0051] When the target user account is logged in locally, send a pairing device request containing the target user account to a server.

[0052] Receive the paired device set returned by the server based on the pairing device request.

[0053] In an embodiment, the sending unit is configured to:

[0054] When the connection instruction is received, send a first physical connection request to the device to be connected according to device address information further included in the broadcast message.

[0055] If a connection confirmation response returned by the to-be-connected device based on the first physical connection request is received, it is determined that the first physical connection between the to-be-connected device is established.

[0056] Based on the first physical connection and the target channel information, a logical connection request is sent to the to-be-connected device.

[0057] In an embodiment, the pairing unit is configured to:

[0058] A paging message is sent to the to-be-connected device.

[0059] When it is determined that a paging response returned by the to-be-connected device based on the paging message is received, a file system data packet is sent to the to-be-connected device; and when the to-be-connected device determines that the data interaction authentication is passed, the current paging scanning period is lowered to a set paging scanning period, and the to-be-connected device performs paging scanning based on the set paging scanning period to scan the paging message.

[0060] When it is determined that a notification response returned by the to-be-connected device based on the file system data packet is received, a second physical connection request is sent to the to-be-connected device.

[0061] If a connection confirmation response returned by the to-be-connected device based on the second physical connection request is received, it is determined that the second physical connection between the to-be-connected device is established.

[0062] Based on the second physical connection, a device connection between the to-be-connected device is established in a pairing connection manner.

[0063] In an embodiment, the set paging scanning period is a paging scanning window; the paging scanning window refers to a scanning duration in each paging scanning period.

[0064] In an aspect, an apparatus for device connection is provided in an embodiment of the present application, and the apparatus comprises:

[0065] A sending unit is configured to send a broadcast message containing target channel information through the to-be-connected device.

[0066] A receiving unit is configured to, when it is determined that a logical connection request sent by a target device based on the target channel information is received, send a connection confirmation response to the target device to establish a logical connection between the target device; the to-be-connected device is included in a paired device set corresponding to a target user account currently logged in by the target device; and the paired device set includes paired devices of devices logged in by the target user account.

[0067] An authentication unit is configured to perform data interaction authentication between the target device through the logical connection.

[0068] The connection unit is used to establish a device connection with the target device by means of pairing if the data interaction authentication is successful.

[0069] In one embodiment, the receiving unit is used to:

[0070] Upon receiving a first physical connection request from the target device based on the device address information also included in the broadcast message, a connection confirmation response is sent to the target device to establish a first physical connection with the target device.

[0071] When it is determined that a logical connection request has been received from the target device based on the first physical connection and the target channel information, a connection confirmation response is sent to the target device based on the first physical connection.

[0072] In one implementation, the authentication unit is used for:

[0073] If the data interaction authentication is confirmed to be successful, the current paging scan cycle will be reduced to the set paging scan cycle.

[0074] Paging scans are performed based on a set paging scan cycle;

[0075] If a paging message sent by the target device is detected, a paging response is sent to the target device.

[0076] If it is determined that a file system data packet has been received from the target device, a notification response is sent to the target device.

[0077] If it is determined that a second physical connection request has been received from the target device, a connection confirmation response is returned to the target device to establish a second physical connection with the device to be connected.

[0078] Based on the second physical connection, a device connection with the target device is established using a pairing connection method.

[0079] In one implementation, the paging scan cycle is set as the paging scan window; the paging scan window refers to the scan duration in each paging scan cycle.

[0080] On one hand, this application provides an electronic device, including:

[0081] Processor; and

[0082] The memory stores computer instructions that cause the processor to perform the steps of the methods provided in the various alternative implementations of any of the aforementioned device connections.

[0083] In an aspect, the embodiments of the present application provide a computer readable storage medium storing computer instructions, the computer instructions being used to make a computer execute steps of the method provided in any of the various optional implementation manners of the device connection.

[0084] In an aspect, the embodiments of the present application provide a computer program product comprising computer readable code, or a non-volatile computer readable storage medium carrying computer readable code, when the computer readable code is run in a processor of an electronic device, the processor in the electronic device executes steps of the method provided in any of the various optional implementation manners of the device connection.

[0085] The method of device connection in the embodiments of the present application comprises obtaining target channel information and device information of a device to be connected; if it is determined according to the device information that the device to be connected is included in a set of paired devices, then based on a connection instruction, a logical connection is established with the device to be connected by using the target channel information; data interaction authentication is performed through the logical connection; if it is determined that the data interaction authentication is passed, then a device connection between the device to be connected and the device is established in a paired connection manner. In this way, the device information of the device to be connected can be used to determine whether the device to be connected is a paired device that is logged in with other devices of the same account, so as to determine whether the device to be connected can be paired and connected with a device in an unconnectable and undiscoverable mode. Furthermore, when a paired device that is logged in with other devices of the same account is discovered, a logical connection is established based on the target channel information, and data interaction authentication is performed through the logical connection, without having to perform data interaction authentication through a cumbersome and time-consuming service discovery manner. Compared with a traditional manner, the step of establishing a logical connection is relatively simple and time-consuming, and the efficiency of data interaction authentication is improved. Then, after the data interaction authentication, the device connection is performed in a paired connection manner, the pairing of the device is completed, and the efficiency of pairing and connecting with a paired device that is logged in with other devices of the same account is improved. BRIEF DESCRIPTION OF DRAWINGS

[0086] In order to more clearly illustrate the technical solutions of the embodiments of the present application or the prior art, the following will briefly introduce the drawings needed to be used in the description of the embodiments or the prior art. Obviously, the drawings described below are some embodiments of the present application, and other drawings can also be obtained by those skilled in the art without any creative effort on the basis of these drawings.

[0087] Figure 1 is a flowchart of a method of device connection in the embodiments of the present application.

[0088] Figure 2 is an interaction flowchart of a broadcast sending method in the embodiments of the present application.

[0089] Figure 3 is an interaction flowchart of a broadcast parsing method in an embodiment of the present application.

[0090] Figure 4 is a scenario diagram of device discovery and connection in an embodiment of the present application.

[0091] Figure 5 is an interaction flowchart of a logical connection method in an embodiment of the present application.

[0092] Figure 6 is a diagram of a Page flow in an embodiment of the present application.

[0093] Figure 7 is a diagram of a paging scanning time in an embodiment of the present application.

[0094] Figure 8 is an example diagram of a paging scanning period configuration interface in an embodiment of the present application.

[0095] Figure 9 is an example diagram of a paging scanning window configuration interface in an embodiment of the present application.

[0096] Figure 10 is an interaction flowchart of a device connection method in an embodiment of the present application.

[0097] Figure 11 is a structural block diagram of a device connection apparatus in an embodiment of the present application.

[0098] Figure 12 is a structural block diagram of another device connection apparatus in an embodiment of the present application.

[0099] Figure 13 is a structural diagram of an electronic device in an embodiment of the present application. DETAILED DESCRIPTION

[0100] The technical solutions of the present application will be described clearly and completely below with reference to the drawings. Obviously, the described embodiments are some of the embodiments of the present application, but not all the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work fall within the scope of protection of the present application. In addition, the technical features involved in the different embodiments of the present application described below can be combined with each other as long as they do not conflict with each other.

[0101] In some device connection scenarios, different electronic devices logged in with the same account are connected to the same device respectively, and if the device has already been successfully connected with one of the electronic devices, it is usually required to be reset before being connected with another electronic device. However, in this way, the device connection operation is relatively cumbersome and time-consuming when the device is connected to the paired device of the other device logged in with the same account.

[0102] Based on the defects of the above related technologies, the embodiments of the present application provide a device connection method, device, electronic device, storage medium and program product, aiming to improve the device connection speed when the device is connected to the paired device of the other device logged in with the same account.

[0103] The embodiments of the present application provide a device connection method, which can be applied to an electronic device. The type of the electronic device is not limited in the present application, which can be any suitable device type, such as a terminal device and a server, and the like, and the present application will not be repeated here.

[0104] Referring to Figure 1 The flowchart of a device connection method in the embodiments of the present application is shown, and the method will be described below in combination with Figure 1 The specific implementation process of the method is as follows:

[0105] Step 101: The target device obtains a set of paired devices corresponding to the target user account currently logged in.

[0106] The set of paired devices includes the paired devices of the devices logged in with the target user account. The paired devices can be any electronic device, such as earphones and other peripheral devices.

[0107] In one embodiment, when the target user account is logged in locally, a pairing device request containing the target user account is sent to the server, and the set of paired devices returned by the server based on the pairing device request is received.

[0108] For example, after logging in the user account on the terminal device, the list of peripheral devices paired under the user account is queried from the cloud, displayed on the "Settings" -> "Bluetooth" interface, and the information of all peripheral devices under the user account is downloaded.

[0109] In this way, the paired devices of the other devices logged in with the target user account can be obtained.

[0110] Step 102: When the broadcast message sent by the to-be-connected device is received, the target channel information in the broadcast message and the device information of the to-be-connected device are obtained.

[0111] The to-be-connected device can be any electronic device that has not established a connection with the target device, such as a headset. The device information is used to indicate the to-be-connected device, and can include device identification and / or device address information of the to-be-connected device. For example, the device address information can be a Bluetooth Low Energy (BLE) address. The role of the target device is a (Client) client. The role of the to-be-connected device is a (Server) server.

[0112] In an embodiment, the to-be-connected device sends a broadcast message containing target channel information, and the target device determines to receive the broadcast message sent by the to-be-connected device, and obtains the target channel information in the broadcast message and the device information of the to-be-connected device.

[0113] For example, the to-be-connected device starts and sends a BLE broadcast (i.e., a broadcast message) for connecting with the account device, wherein the BLE broadcast contains target channel information and device information of the to-be-connected device. The target device determines to receive the BLE broadcast sent by the to-be-connected device, and analyzes the BLE broadcast to obtain the target channel information and the device information of the to-be-connected device.

[0114] The following will be described in conjunction with Figure 2 The method of sending a broadcast by the to-be-connected device will be described by way of example. Referring to Figure 2 , it is an interaction flowchart of a broadcast sending method. Figure 2 The to-be-connected device includes three modules: a BLE module, a broadcast management module, and a connection management module. The flow of the method includes:

[0115] S201: The connection management module sends an openServer request to the BLE module.

[0116] S202: The BLE module registers a Low Energy (LE) socket service to obtain PSM channel information, i.e., target channel information.

[0117] The LE socket is an important component of Bluetooth Low Energy technology, which allows an application program to send and receive data. This socket is specifically designed to handle communication between BLE devices, and its design aims to optimize energy use, making it more efficient to manage power during the connection process.

[0118] In an embodiment, after the BLE module registers the LE socket service, it applies for a Physical Serial Multiplexer (PSM) channel to obtain PSM channel information.

[0119] The PSM channel information can be dynamic.

[0120] S203: The broadcast management module sends a channel acquisition request to the BLE module.

[0121] S204: The broadcast management module receives PSM channel information returned by the BLE module.

[0122] S205: The broadcast management module adds the PSM channel information and the BLE address to the BLE broadcast.

[0123] S206: The broadcast management module sends a BLE broadcast start instruction to the BLE module.

[0124] S207: The BLE module sends the BLE broadcast.

[0125] In an embodiment, the BLE module uses the Advertisement (ADV) broadcast technology to send the BLE broadcast.

[0126] The method for parsing the broadcast of the target device will be described below. Figure 3 The method for parsing the broadcast of the target device will be described below. Figure 3 The method for parsing the broadcast of the target device will be described below. Figure 3 The method for parsing the broadcast of the target device will be described below.

[0127] S301: The BLE module reports the received BLE broadcast to the scan management module.

[0128] S302: The scan management module sends the BLE broadcast to the device management module.

[0129] In an embodiment, the device management module stores the PSM channel information and the BLE address in the BLE broadcast.

[0130] S303: The device management module receives a broadcast information acquisition request sent by the connection management module.

[0131] S304: The connection management module receives the PSM channel information and the BLE address returned by the device management module.

[0132] In this way, the device information and the target channel information of the device to be connected can be parsed and acquired through the broadcast message of the device to be connected, so as to establish subsequent connection.

[0133] Step 103: If it is determined according to the device information that the device to be connected is included in the paired device set, when a connection instruction of the current user for the device to be connected is received, a logical connection request is sent to the device to be connected based on the target channel information.

[0134] In one implementation, when performing step 103, the following steps can be adopted:

[0135] S1031: According to the device information, determine that the to-be-connected device is contained in the set of paired devices.

[0136] In one implementation, the set of paired devices contains the device information of each paired device, and if the device information of the to-be-connected device matches the device information of any paired device in the set of paired devices, it is determined that the to-be-connected device is contained in the set of paired devices.

[0137] S1032: When receiving the connection instruction, according to the device address information contained in the broadcast message, send a first physical connection request to the to-be-connected device.

[0138] Optionally, the device address information can be a BLE address.

[0139] In one implementation, the target device displays a connection prompt pop-up window, and the user clicks a connection control in the connection prompt pop-up window to issue a connection instruction. The connection control is used to indicate device connection. When the target device determines that the connection instruction is received, a first physical connection request containing device address information is sent to the to-be-connected device.

[0140] Referring to FIG. 1, Figure 4 which is a schematic diagram of a device discovery and connection scenario. When the mobile phone A discovers that the earphone is connectable, a first pop-up window is displayed, that is, the left drawing of FIG. 1. The user clicks the connection control in the first pop-up window to establish a connection with the earphone. When the mobile phone B discovers that the earphone connected to other devices logged in with the same account exists, a second pop-up window is displayed, that is, the right drawing of FIG. 1. The user clicks the connection control of the second pop-up window to issue a connection instruction. Figure 4 Figure 4

[0141] S1033: If a connection confirmation response returned by the to-be-connected device based on the first physical connection request is received, it is determined that a first physical connection between the to-be-connected device and the target device is established.

[0142] In one implementation, when the to-be-connected device determines that the first physical connection request sent by the target device according to the device address information contained in the broadcast message is received, a connection confirmation response is sent to the target device to establish a first physical connection between the to-be-connected device and the target device.

[0143] Optionally, the first physical connection can be an asynchronous connectionless link (ACL) connection.

[0144] ​​Further, after the first physical connection is established, device attribute information is exchanged through the first physical connection. Optionally, the device attribute information can include Feature and Version. The Feature and Version are used for subsequent pairing connection settings.

[0145] S1034: Based on the first physical connection and the target channel information, a logical connection request is sent to the to-be-connected device.

[0146] In an implementation, when the to-be-connected device determines that the logical connection request sent based on the first physical connection and the target channel information is received, the to-be-connected device sends a connection confirmation response to the target device based on the first physical connection.

[0147] Step 104: If the connection confirmation response returned by the to-be-connected device based on the logical connection request is received, it is determined that a logical connection between the to-be-connected device and the target device is established.

[0148] For example, the logical connection request can be sent by createInsecureL2capChannel(int psm) to establish a physical connection, and the connection confirmation response of the to-be-connected device can be listened to by BluetoothAdapter.listenUsingInsecureL2capChannel().

[0149] In an implementation, when the target device determines that the logical connection request sent by the target device based on the target channel information is received, the target device sends a connection confirmation response to the target device to establish a logical connection between the target device and the target device.

[0150] The target user account currently logged in the target device corresponds to a paired device set containing the to-be-connected device; the paired device set includes paired devices of the device logged in the target user account.

[0151] Optionally, the logical connection can be based on a low-energy connection-oriented channel (Low Energy Connection-Oriented Channels, LE COC).

[0152] The logical connection is described below. Figure 5 Referring to FIG. 5, a logical connection method is described. The flow of the method includes: Figure 5

[0153] S501: The target device sends an ACL connection request to the to-be-connected device.

[0154] S502: The target device receives a connection confirmation response returned by the to-be-connected device. ​

[0155] S503: The target device sends first device attribute information of the target device to the to-be-connected device.

[0156] S504: The target device receives second device attribute information of the to-be-connected device returned by the to-be-connected device.

[0157] S505: The target device sends a logical connection request to the to-be-connected device.

[0158] For example, the target device sends L2CAP_LE_CREDIT_BASED_CONNECTION_REQ, i.e., a logical connection request, to the to-be-connected device.

[0159] S506: The target device receives a connection confirmation response returned by the to-be-connected device.

[0160] For example, the target device receives L2CAP_LE_CREDIT_BASED_CONNECTION_RSP, i.e., a connection confirmation response, returned by the to-be-connected device.

[0161] Step 105: Data interaction authentication between the target device and the to-be-connected device is performed through the logical connection.

[0162] In an embodiment, the target device sends an authentication request containing first authentication information to the to-be-connected device through the logical connection. The to-be-connected device returns an authentication response containing second authentication information to the target device after authenticating the first authentication information. If the target device authenticates the second authentication information, it is determined that the data interaction authentication is passed.

[0163] The first authentication information and the second authentication information can be set according to actual application scenarios, which are not limited herein.

[0164] Step 106: If it is determined that the data interaction authentication is passed, the device connection between the target device and the to-be-connected device is established in a pairing connection manner.

[0165] In an embodiment, if it is determined that the data interaction authentication is passed, the first physical connection and the logical connection are disconnected, then a Page flow is executed, and when it is determined that the connection state is entered, a second physical connection is established, and the device connection between the target device and the to-be-connected device is established in a pairing connection manner based on the second physical connection.

[0166] Wherein, the role of Page is: the target device initiating connection such as a mobile phone sends a connection request or authentication to the connected device to be connected such as a Bluetooth device, and the request is a page action. The connected device enters a page scan mode to respond to the connection of other devices. For example, a Bluetooth headset is allowed to be connected by other devices only when it is in a page scan mode.

[0167] In an embodiment, when step 106 is performed, the following steps can be used:

[0168] S1061: If it is determined that the data interaction authentication is passed, a paging message is sent to the connected device.

[0169] Wherein, if it is determined that the data interaction authentication is passed, the connected device enters a pairable mode.

[0170] The following will be described in conjunction with Figure 6 The page process is described. Referring to FIG. 1, which is a schematic diagram of a page process, a target device is a master device, and a connected device is a slave device, Figure 6 In step 1, the target device is in a page sub-state, and the connected device is in a page scan sub-state. The target device sends a page message. Figure 6

[0171] S1062: When it is determined that a page response returned by the connected device based on the page message is received, a file system data packet is sent to the connected device. When it is determined that the data interaction authentication is passed, the current page scan period is lowered to a set page scan period, and the connected device performs page scan based on the set page scan period to scan the page message.

[0172] In an embodiment, if the connected device determines that the data interaction authentication is passed, the current page scan period is lowered to a set page scan period, and the connected device performs page scan based on the set page scan period. If it is determined that the page message sent by the target device is scanned, a page response is sent to the target device.

[0173] Wherein, the page scan period (Page Scan Interval) can also be referred to as a page scan interval. It is equivalent to how long to scan once, and the maximum value can be 2560 ms.

[0174] Optionally, the set page scan period can be a page scan window (Page Scan Windows). Figure 7 FIG. 2 is a schematic diagram of a page scan time. Figure 7 ​In the embodiment, the paging scan window refers to the scanning duration in each paging scan process, i.e., the scanning time. The paging scan period refers to the cycle length of the paging scan. In the embodiment, the paging scan window is not higher than the paging scan period, and the difference between the paging scan period and the paging scan window is the rest time of the paging scan. If the paging scan period is the same as the paging scan window, it means continuous scanning, and thus the time for scanning the to-be-connected device is shortened.

[0175] The same paging scan period and paging scan window are taken as an example for description. Referring to FIG. 8, which is an example diagram of a paging scan period configuration interface. Figure 8 Figure 8 In the embodiment, the paging scan period is Time=N*0.625. Referring to FIG. 9, which is an example diagram of a paging scan window configuration interface. Figure 9 Figure 8 In the embodiment, the paging scan window is also Time=N*0.625. N is a positive integer.

[0176] For example, Figure 6 In step 2 of FIG. 7, when the to-be-connected device receives the page message, the to-be-connected device enters a to-be-connected device response state. The to-be-connected device receives the page message, and after an interval of 625 us, sends a paging response, and after an interval of 312.5 us, starts to listen to a Filesystem Hierarchy Standard (FHS) packet, i.e., a file system packet, from the target device.

[0177] Figure 6 In step 3 of FIG. 7, when the target device receives the paging response, the target device enters a target device response state. The target device sends an FHS packet of the target device to the to-be-connected device, and after sending the FHS packet, listens to the notification response of the to-be-connected device.

[0178] Optionally, the FHS packet can include at least one of the following: a clock, an address, and a Class of Device (COD).

[0179] In this way, after the data interaction authentication is determined to be passed, the current paging scan period can be shortened, so as to reduce the time cost of page scanning and improve the device connection efficiency.

[0180] S1063: In response to determining that the notification response returned by the to-be-connected device based on the file system packet is received, sending a second physical connection request to the to-be-connected device.

[0181] In an embodiment, the to-be-connected device sends a notification response to the target device if it is determined that the file system packet sent by the target device is received.​​

[0182] Figure 6 In step 4 of the method, the to-be-connected device receives the FHS packet from the target device, and returns a response notification to the target device to indicate that the FHS packet is received. Figure 6 In step 5 of the method, the to-be-connected device enters a connection state, and the target device enters the connection state after receiving the response of the to-be-connected device, and then the target device sends a polling (POLL) packet. Figure 6 In step 6 of the method, the to-be-connected device receives the POLL packet and may return any type of packet.

[0183] S1064: If the connection confirmation response returned by the to-be-connected device based on the second physical connection request is received, it is determined that the second physical connection between the to-be-connected device and the target device is established.

[0184] In an embodiment, if the to-be-connected device determines that the second physical connection request sent by the target device is received, the to-be-connected device returns a connection confirmation response to the target device to establish the second physical connection between the to-be-connected device and the target device.

[0185] The second physical connection can be established based on the same principle as the establishment of the first physical connection, which is not described herein.

[0186] S1065: Based on the second physical connection, the device connection between the to-be-connected device and the target device is established in a pairing connection manner. That is, the to-be-connected device establishes the device connection with the target device in a pairing connection manner based on the second physical connection.

[0187] In an embodiment, the target device and the to-be-connected device can be configured with input and output (IO) capabilities, which are Display / YesNo, indicating that the target device and the to-be-connected device have display and input capabilities, and the verification requirement is Man-in-the-Middle (MITM) protection. The pairing display interface can be displayed, and the pairing information input by the user is obtained in response to the input operation of the user on the pairing display interface. The pairing information is sent to the to-be-connected device based on the second physical connection, and a pairing success response returned by the to-be-connected device is received. Then, the target device and the to-be-connected device generate a passkey, and perform a confirmation operation to establish the device connection with the to-be-connected device.

[0188] Wherein, optionally, the IO Capabilities can also have other types of IO capabilities, such as KeyboardOnly indicating only keyboard input, and KeyboardDisplay indicating keyboard and display input and output. Each type of capability corresponds to different interaction modes and device functions. KeyboardOnly devices can input numbers and confirmation keys, as well as YES / NO, but have no display capability; while KeyboardDisplay devices have both keyboard input and display functions.

[0189] Referring to Figure 10 As shown in FIG. 1, an interactive flowchart of a method for device connection. The flow of the method includes:

[0190] Step 1001: The target device obtains a set of paired devices corresponding to a target user account currently logged in.

[0191] Step 1002: The device to be connected sends a broadcast message.

[0192] Step 1003: The target device determines, based on the received broadcast message, that the device to be connected is a device in the set of paired devices.

[0193] Step 1004: The target device receives a connection instruction of a user.

[0194] Step 1005: The target device sends, through LE COC connection, an authentication request containing first authentication information to the device to be connected.

[0195] Step 1006: The device to be connected returns an authentication response containing second authentication information to the target device.

[0196] Step 1007: The device to be connected is in a pairable mode, and the current paging scan period is adjusted to a set paging scan period.

[0197] Step 1008: The target device and the device to be connected establish a device connection with the target device in a paired connection mode.

[0198] Wherein, when steps 1001-1008 are executed, the specific steps can refer to steps 101-106 described above, which will not be repeated here.

[0199] In this way, a logical connection is established based on the target channel information, and data interaction authentication is performed based on the logical connection, and then a paired connection is established with the paired devices of the same account device, reducing the cumbersome operation of device connection with the paired devices of the same account device, improving the device connection efficiency, and in the pairing process, the paging scan period is shortened, further reducing the device connection time consumption, and improving the device connection efficiency.

[0200] The user information (including but not limited to user equipment information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) involved in the present application are all information and data authorized by the user or authorized by all parties, and the collection, use and processing of related data need to comply with relevant laws, regulations and standards of relevant countries and regions, and provide corresponding operation portal for user to choose authorization or refusal.

[0201] Based on the same inventive concept, the embodiments of the present application also provide a device connection apparatus. Since the above apparatus and device solve problems by similar principles to a device connection method, the implementation of the above apparatus can be referred to the implementation of the method, and the repeated parts will not be described herein again. The apparatus can be applied to electronic devices, and the type of the electronic device is not limited in the present application, which can be any suitable device type, such as terminal devices and servers, etc., and the present application will not be described herein again.

[0202] Reference Figure 11 FIG. 1 is a structural block diagram of a device connection apparatus in an embodiment of the present application. In some embodiments, the device connection apparatus of the present application includes:

[0203] The acquisition unit 1101 is configured to acquire a paired device set corresponding to a target user account currently logged in. The paired device set includes a paired device of a device logged in with the target user account.

[0204] The receiving unit 1102 is configured to, when it is determined that a broadcast message sent by a to-be-connected device is received, acquire target channel information in the broadcast message and device information of the to-be-connected device.

[0205] The sending unit 1103 is configured to, if it is determined that the to-be-connected device is included in the paired device set according to the device information, determine that a connection instruction for the to-be-connected device is received by a current user, and send a logical connection request to the to-be-connected device based on the target channel information.

[0206] The connection unit 1104 is configured to, if a connection confirmation response returned by the to-be-connected device based on the logical connection request is received, determine to establish a logical connection between the to-be-connected device.

[0207] The authentication unit 1105 is configured to, through the logical connection, perform data interaction authentication between the to-be-connected device.

[0208] The pairing unit 1106 is configured to, if it is determined that the data interaction authentication is passed, establish a device connection between the to-be-connected device in a paired connection manner.

[0209] In an embodiment, the acquisition unit 1101 is configured to:

[0210] When the target user account for local login is determined, a pairing device request containing the target user account is sent to the server;

[0211] The server returns a set of paired devices based on the paired device request.

[0212] In one embodiment, the transmitting unit 1103 is used for:

[0213] Upon receiving a connection command, a first physical connection request is sent to the device to be connected based on the device address information also contained in the broadcast message.

[0214] If a connection confirmation response is received from the device to be connected based on the first physical connection request, then it is determined that a first physical connection is to be established with the device to be connected.

[0215] Based on the first physical connection and the target channel information, a logical connection request is sent to the device to be connected.

[0216] In one embodiment, the pairing unit 1106 is used for:

[0217] Send a paging message to the device to be connected;

[0218] When it is determined that a paging response based on a paging message has been received from the device to be connected, a file system data packet is sent to the device to be connected; when the device to be connected determines that the data interaction authentication is successful, the current paging scan cycle is reduced to the set paging scan cycle, and a paging scan is performed based on the set paging scan cycle to scan for paging messages;

[0219] Upon receiving a notification response from the device to be connected based on a file system data packet, a second physical connection request is sent to the device to be connected.

[0220] If a connection confirmation response is received from the device to be connected based on the second physical connection request, then it is determined that a second physical connection with the device to be connected will be established.

[0221] Based on the second physical connection, a device connection is established with the device to be connected using a pairing connection method.

[0222] In one implementation, the paging scan cycle is set as the paging scan window; the paging scan window refers to the scan duration in each paging scan cycle.

[0223] See Figure 12 The diagram shown is a structural block diagram of another device connection apparatus according to an embodiment of this application. In some embodiments, the device connection apparatus exemplified in this application includes:

[0224] The transmitting unit 1201 is used to transmit a broadcast message containing target channel information through the device to be connected;

[0225] The receiving unit 1202 is configured to, when it is determined that the logical connection request sent by the target device based on the target channel information is received, send a connection confirmation response to the target device to establish a logical connection with the target device; the target user account currently logged in the target device corresponds to a paired device set containing the to-be-connected device; and the paired device set includes paired devices of the device logged in with the target user account.

[0226] The authentication unit 1203 is configured to, through the logical connection, perform data interaction authentication with the target device.

[0227] The connection unit 1204 is configured to, if it is determined that the data interaction authentication is passed, establish a device connection with the target device in a paired connection manner.

[0228] In an embodiment, the receiving unit 1202 is configured to:

[0229] When it is determined that the first physical connection request sent by the target device according to the device address information contained in the broadcast message is received, send a connection confirmation response to the target device to establish a first physical connection with the target device.

[0230] When it is determined that the logical connection request sent by the target device based on the first physical connection and the target channel information is received, send a connection confirmation response to the target device based on the first physical connection.

[0231] In an embodiment, the authentication unit 1203 is configured to:

[0232] If it is determined that the data interaction authentication is passed, lower the current paging scan period to a set paging scan period.

[0233] Perform paging scanning based on the set paging scan period.

[0234] If it is determined that the paging message sent by the target device is scanned, send a paging response to the target device.

[0235] If it is determined that the file system data packet sent by the target device is received, send a notification response to the target device.

[0236] If it is determined that the second physical connection request sent by the target device is received, return a connection confirmation response to the target device to establish a second physical connection with the to-be-connected device.

[0237] Based on the second physical connection, a device connection with the target device is established in a paired connection manner.

[0238] In an embodiment, the set paging scan period is a paging scan window; the paging scan window refers to the scanning duration in each paging scan period.

[0239] The method for device connection in the embodiments of the present application comprises: obtaining target channel information and device information of a device to be connected; if it is determined according to the device information that the device to be connected is included in a set of paired devices, then based on a connection instruction, a logical connection is established with the device to be connected by using the target channel information; data interaction authentication is performed through the logical connection; if it is determined that the data interaction authentication is passed, then a device connection between the device to be connected and the device is established in a paired connection mode. In this way, the device information of the device to be connected can be used to determine whether the device to be connected is a paired device that is logged in with other devices of the same account, so as to determine whether the device to be connected can be paired and connected with a device in an unconnectable and undiscoverable mode. Furthermore, when a paired device that is logged in with other devices of the same account is discovered, a logical connection is established based on the target channel information, and data interaction authentication is performed through the logical connection, without having to perform data interaction authentication through a cumbersome and time-consuming service discovery mode. Compared with a traditional mode, the step of establishing a logical connection is relatively simple and time-consuming, and the efficiency of data interaction authentication is improved. Then, after the data interaction authentication, the device connection is performed in a paired connection mode, the pairing of the devices is completed, and the efficiency of pairing and connecting with a paired device that is logged in with other devices of the same account is improved.

[0240] In the embodiments of the present application, an electronic device is provided, comprising:

[0241] a processor; and

[0242] a memory storing computer instructions for causing the processor to execute the method of any of the above embodiments.

[0243] In the embodiments of the present application, a computer readable storage medium is provided, storing computer instructions for causing a computer to execute the method of any of the above embodiments.

[0244] The embodiments of the present application also provide a computer program product comprising computer readable code, or a non-volatile computer readable storage medium carrying computer readable code, when the computer readable code is executed in the processor of the electronic device, the processor of the electronic device executes the method of any of the above embodiments.

[0245] Figure 13 A structural schematic diagram of an electronic device 1300 is shown. Referring to Figure 13 As shown, the electronic device 1300 comprises a processor 1310 and a memory 1320, and optionally, a power supply 1330, a display unit 1340, and an input unit 1350.

[0246] The processor 1310 is a control center of the electronic device 1300, connects various components by using various interfaces and lines, performs various functions of the electronic device 1300 by running or executing software programs and / or data stored in the memory 1320, and thus performs overall monitoring of the electronic device 1300.

[0247] In the embodiments of the present application, the processor 1310 performs the steps in the above embodiments when calling the computer programs stored in the memory 1320.

[0248] Optionally, the processor 1310 can include one or more processing units; preferably, the processor 1310 can integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, the user interface, and the application, etc., and the modem processor mainly processes wireless communication. It can be understood that the above-mentioned modem processor can also not be integrated into the processor 1310. In some embodiments, the processor, the memory, can be implemented on a single chip, and in some embodiments, they can also be implemented on separate chips respectively.

[0249] The memory 1320 can mainly include a program storage area and a data storage area, wherein the program storage area can store the operating system, various applications, etc.; the data storage area can store data created according to the use of the electronic device 1300, etc. In addition, the memory 1320 can include a high-speed random access memory, and can also include a non-volatile memory, for example, at least one magnetic disk storage device, a flash memory device, or other volatile solid-state memory device, etc.

[0250] The electronic device 1300 further includes a power supply 1330 (such as a battery) for supplying power to various components, and the power supply can be logically connected to the processor 1310 through a power management system, so as to realize the functions of managing charging, discharging, and power consumption, etc. through the power management system.

[0251] The display unit 1340 can be used to display information input by a user or information provided to the user, and various menus of the electronic device 1300, etc., and in the embodiments of the present application, is mainly used to display the display interface of each application in the electronic device 1300 and the objects such as text, pictures, etc. displayed in the display interface. The display unit 1340 can include a display panel 1341. The display panel 1341 can be configured in the form of a liquid crystal display (LCD), an organic light-emitting diode (OLED), etc.

[0252] The input unit 1350 can be configured to receive information such as a number or character input by a user. The input unit 1350 can include a touch panel 1351 and another input device 1352. The touch panel 1351, also called a touch screen, can collect a touch operation of a user on or proximity to the touch panel 1351, such as an operation of the user using a finger, a stylus, or any suitable object or accessory on or in proximity to the touch panel 1351.

[0253] Specifically, the touch panel 1351 can detect a touch operation of a user, and detect signals caused by the touch operation, convert the signals into touch coordinates, and send the touch coordinates to the processor 1310. The processor 1310 can receive a command from the touch panel 1351 and execute the command. The touch panel 1351 can be implemented in various types such as a resistive type, a capacitive type, an infrared type, and a surface acoustic wave type. The other input device 1352 can include one or more of, for example, a physical keyboard, a function key (for example, a volume control key, a power on / off key, and the like), a trackball, a mouse, a lever, and the like.

[0254] Of course, the touch panel 1351 can cover the display panel 1341, and when the touch panel 1351 detects a touch operation on or in proximity to the touch panel 1351, the touch panel 1351 can transmit the touch operation to the processor 1310 to determine a type of the touch event, and then the processor 1310 can provide a corresponding visual output on the display panel 1341 according to the type of the touch event. Although in Figure 13 the above description, the touch panel 1351 and the display panel 1341 are implemented as two independent components to realize the input and output functions of the electronic device 1300, in some embodiments, the touch panel 1351 and the display panel 1341 can be integrated to realize the input and output functions of the electronic device 1300.

[0255] The electronic device 1300 can further include one or more sensors, such as a pressure sensor, a gravity acceleration sensor, a proximity light sensor, and the like. Of course, the electronic device 1300 can further include other components such as a camera, according to the needs in a specific application, since these components are not the components that are mainly used in the embodiments of the present application, and thus are not shown in Figure 13 the above description, and will not be described in detail.

[0256] Those skilled in the art can understand that Figure 13 Figure 13 the above description is only an example of the electronic device, and does not constitute a limitation on the electronic device, and the electronic device can include more or fewer components than those shown, or combine some components, or different components.

[0257] For the convenience of description, each part is described as a module (or unit) according to the function. Of course, the functions of the modules (or units) can be implemented in one or more software or hardware in the implementation of the present application.

Claims

1. A method of device connection, characterized by, The method comprises: obtaining a set of paired devices corresponding to a target user account currently logged in; the set of paired devices comprises a paired device of a device logged in with the target user account; when a broadcast message sent by a to-be-connected device is received, obtaining target channel information in the broadcast message and device information of the to-be-connected device; if it is determined that the set of paired devices contains the to-be-connected device according to the device information, when a connection instruction for the to-be-connected device is received by a current user, sending a logical connection request to the to-be-connected device based on the target channel information; if a connection confirmation response returned by the to-be-connected device based on the logical connection request is received, it is determined that a logical connection between the to-be-connected device and the device is established; through the logical connection, data interaction authentication between the device and the to-be-connected device is performed; if it is determined that the data interaction authentication is passed, a device connection between the device and the to-be-connected device is established in a paired connection mode.

2. The method of claim 1, wherein, The method comprises: when the target user account is locally logged in, sending a pairing device request containing the target user account to a server; receiving the set of paired devices returned by the server based on the pairing device request.

3. The method according to claim 1 or 2, characterized in that, The method comprises: when the connection instruction is received, a first physical connection request is sent to the to-be-connected device according to device address information also contained in the broadcast message; if a connection confirmation response returned by the to-be-connected device based on the first physical connection request is received, it is determined that a first physical connection between the device and the to-be-connected device is established; based on the first physical connection and the target channel information, a logical connection request is sent to the to-be-connected device.

4. The method according to claim 1 or 2, characterized in that, The method comprises: sending a paging message to the to-be-connected device; when a paging response returned by the to-be-connected device based on the paging message is received, a file system data packet is sent to the to-be-connected device; when the data interaction authentication is passed, the to-be-connected device lowers a current paging scanning period to a set paging scanning period, and performs paging scanning based on the set paging scanning period to scan the paging message; when a notification response returned by the to-be-connected device based on the file system data packet is received, a second physical connection request is sent to the to-be-connected device; if a connection confirmation response returned by the to-be-connected device based on the second physical connection request is received, it is determined that a second physical connection between the device and the to-be-connected device is established; based on the second physical connection, a device connection between the device and the to-be-connected device is established in a paired connection mode.

5. The method of claim 4, wherein, The set paging scanning period is a paging scanning window; the paging scanning window refers to a scanning duration in each paging scanning period.

6. A method of device connection, characterized by, The method comprises: The to-be-connected device sends a broadcast message containing target channel information; When it is determined that a logical connection request sent by the target device based on the target channel information is received, a connection confirmation response is sent to the target device to establish a logical connection with the target device; the to-be-connected device is included in a paired device set corresponding to a target user account currently logged in by the target device; the paired device set includes paired devices of devices logged in by the target user account; Through the logical connection, data interaction authentication with the target device is performed; If it is determined that the data interaction authentication is passed, a device connection between the target device and the to-be-connected device is established in a paired connection manner.

7. The method of claim 6, wherein, The determination that a connection confirmation response is sent to the target device when a logical connection request sent by the target device based on the target channel information is received includes: When a first physical connection request sent by the target device based on the device address information contained in the broadcast message is received, a connection confirmation response is sent to the target device to establish a first physical connection with the target device; When a logical connection request sent by the target device based on the first physical connection and the target channel information is received, a connection confirmation response is sent to the target device based on the first physical connection.

8. The method according to claim 6 or 7, characterized in that, If it is determined that the data interaction authentication is passed, the current paging scan period is adjusted to a set paging scan period in a paired connection manner. The set paging scan period is used for paging scan. If it is determined that a paging message sent by the target device is scanned, a paging response is sent to the target device. If it is determined that a file system data packet sent by the target device is received, a notification response is sent to the target device. If it is determined that a second physical connection request sent by the target device is received, a connection confirmation response is returned to the target device to establish a second physical connection with the to-be-connected device. In a paired connection manner, a device connection between the target device and the to-be-connected device is established based on the second physical connection. The set paging scan period is a paging scan window; the paging scan window refers to a scan duration in each paging scan period.

9. The method of claim 8, wherein, The apparatus includes:

10. An apparatus for connecting devices, characterized by An obtaining unit is configured to obtain a paired device set corresponding to a target user account currently logged in; the paired device set includes paired devices of devices logged in by the target user account; A receiving unit is configured to, when a broadcast message sent by a to-be-connected device is received, obtain target channel information in the broadcast message and device information of the to-be-connected device; A sending unit is configured to, if it is determined that the to-be-connected device is included in the paired device set according to the device information, send a logical connection request to the to-be-connected device based on the target channel information when a connection instruction for the to-be-connected device is received by a current user. ​ The connecting unit is configured to determine to establish the logical connection with the to-be-connected device if a connection confirmation response returned by the to-be-connected device based on the logical connection request is received. The authentication unit is configured to perform data interaction authentication with the to-be-connected device through the logical connection. The pairing unit is configured to establish device connection with the to-be-connected device in a paired connection manner if it is determined that the data interaction authentication is passed.

11. An apparatus for connecting devices, characterized by The apparatus comprises: The sending unit is configured to send a broadcast message containing target channel information by a to-be-connected device. The receiving unit is configured to send a connection confirmation response to the target device to establish a logical connection with the target device if it is determined that a logical connection request sent by the target device based on the target channel information is received; the to-be-connected device is included in a paired device set corresponding to a target user account currently logged in by the target device; and the paired device set comprises paired devices of devices logged in by the target user account. The authentication unit is configured to perform data interaction authentication with the target device through the logical connection. The connecting unit is configured to establish device connection with the target device in a paired connection manner if it is determined that the data interaction authentication is passed.

12. An electronic device, comprising: comprises: a processor; and a memory storing computer instructions for causing the processor to perform the method according to any one of claims 1 to 9. The computer instructions are configured to cause a computer to perform the method according to any one of claims 1 to 9.

13. A computer-readable storage medium, characterized in that, The computer readable code or the non-volatile computer readable storage medium carrying the computer readable code, when the computer readable code is run in the processor of the electronic device, causes the processor in the electronic device to perform the method according to any one of claims 1 to 9.

14. A computer program product, characterised in that, ​