Device connection method and related apparatus

By optimizing the connection methods and process management of electronic devices, the problem of slow or failed connections was solved, resulting in faster device connections and a better user experience.

CN120018321BActive Publication Date: 2026-01-09HONOR DEVICE CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510028449.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-01-07
Publication Date
2026-01-09
Estimated Expiration
2045-01-07

AI Technical Summary

Technical Problem

During the process of establishing a connection between electronic devices and external devices, slow connection or connection failure may occur, affecting the user experience.

Method used

By employing different connection methods and connection process management in electronic devices, including pausing the connection process with a device, adding service discovery protocol information and remaining execution time to the queue, and adding connection tasks for new devices to the task queue, connection order and time management are optimized to quickly establish communication connections with target devices.

Benefits of technology

It improves the connection speed between electronic devices and external devices, enhances the user experience, and ensures timely notification of successful connections.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120018321B_ABST
    Figure CN120018321B_ABST
Patent Text Reader

Abstract

Embodiments of the present application provide a device connection method and related apparatus, and relate to the technical field of terminals. The method comprises: at a first time, a first device requests to establish a communication connection with a second device using a first connection mode; at a second time, the first device and the second device perform a communication connection process; at a third time, the first device requests to establish a communication connection with a third device using the first connection mode; at a fourth time, the first device and the second device continue to perform the communication connection process, and the first device does not perform a communication connection process with the third device; at a fifth time, the first device receives a first operation of a user; and at a sixth time, the first device and a fourth device perform a communication connection process. In this way, since the first device does not need to wait for the communication connection with the second device to fail or time out, the first device can perform the communication connection process with the fourth device, which can improve the speed of establishing a communication connection between the first device and the fourth device, thereby improving the user experience.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of terminal, in particular to a device connection method and related apparatus. BACKGROUND

[0002] With the development of Internet technology, electronic devices logged in the same account can establish a connection, and these electronic devices can also establish a connection with external devices in response to user operations. Among them, the electronic devices logged in the same account establishing a connection means that the electronic devices can discover other electronic devices logged in the same account, and the user operations can include enabling Bluetooth connection on the electronic devices, etc. The electronic devices can include mobile phones, computers, and tablet computers, etc. The external devices can include earphones, car machines, and keyboards, etc.

[0003] However, in the process of establishing a connection between the electronic devices and the external devices, the connection may be slow, or even fail, affecting the user experience. SUMMARY

[0004] The embodiments of the present application provide a device connection method and related apparatus, which are applied to the technical field of terminal, and can make the electronic devices establish a connection with the external devices more quickly, thereby improving the user experience.

[0005] In a first aspect, the embodiments of the present application provide a device connection method. The method comprises:

[0006] At a first time, a first device requests to establish a communication connection with a second device by using a first connection mode; at a second time, the first device and the second device perform a communication connection process based on the first connection mode; at a third time, the first device requests to establish a communication connection with a third device by using the first connection mode; at a fourth time, the first device and the second device continue to perform the communication connection process based on the first connection mode, and the first device does not perform the communication connection process with the third device; at a fifth time, the first device receives a first operation of a user, and the first operation is used to instruct the first device to establish a communication connection with a fourth device; and at a sixth time, the first device performs the communication connection process with the fourth device by using a second connection mode, and the second connection mode is different from the first connection mode.

[0007] Among them, the second time is later than the first time, the third time is later than the second time, the fourth time is later than the third time, and the fifth time is later than the fourth time; between the first time and the fifth time, the first device continuously performs the communication connection process with the second device, and the first device does not complete the communication connection with the second device; between the third time and the fifth time, the first device does not perform the communication connection with the third device; and at the sixth time, the first device suspends the communication connection process between the first device and the second device.

[0008] Thus, the first device can perform a communication connection process with the fourth device without waiting for the communication connection process with the second device to fail or time out, which can improve the speed of establishing a communication connection between the first device and the fourth device. In addition, if the first device and the fourth device successfully establish a communication connection, the first device can quickly notify the user that the first device and the fourth device have successfully established a communication connection, which can improve the user experience.

[0009] In a possible implementation, at the sixth time, the first device suspends the communication connection process between the first device and the second device, and can: add the service discovery protocol (SDP) information of the second device and the first remaining execution time to the SDP queue; the first remaining execution time includes a difference between the execution time threshold and the first executed time, and the first executed time includes a time used by the first device and the second device to perform the communication connection process between the first time and the sixth time; remove the establishment of the communication connection between the first device and the second device from the connection task queue; and add the establishment of the communication connection between the first device and the third device to the connection task queue.

[0010] In this way, the SDP information of the second device and the first remaining execution time are added to the SDP queue, which can prepare for subsequently adding the establishment of the communication connection between the first device and the second device and the first remaining execution time to the connection task queue.

[0011] In a possible implementation, at the second time, the first device and the second device perform the communication connection process based on the first connection manner, and can: add the SDP information of the second device to the SDP queue, and add the establishment of the communication connection between the first device and the second device to the connection task queue; at the third time, after the first device requests to establish a communication connection with the third device by using the first connection manner, can: add the SDP information of the third device to the SDP queue; and at the fifth time, after the first device receives the first operation of the user, can: add the establishment of the communication connection between the first device and the fourth device to the connection task queue.

[0012] In this way, in the case where the first device requests to establish a communication connection with the second device by using the first connection manner, the establishment of the communication connection between the first device and the second device is added to the connection task queue, so that the first device can quickly perform the communication connection process with the second device.

[0013] In a possible implementation, after adding the establishing a communication connection between the first device and the fourth device into the connection task queue, the following operations can further be performed: determining whether a time used by the first device to perform the communication connection process based on the first connection manner with the second device is greater than an execution threshold; if the time used is greater than or equal to the execution threshold, the first device performs the communication connection process with the fourth device by using the second connection manner; if the time used is less than the execution threshold, the first device continues to perform the communication connection process with the second device until the time used is greater than or equal to the execution threshold, and then the first device performs the communication connection process with the fourth device by using the second connection manner, and the first device suspends the communication connection process with the second device.

[0014] In this way, after the first device receives the first operation of the user, if the time used by the first device to perform the communication connection process based on the first connection manner with the second device is greater than or equal to the execution threshold, it indicates that the time used by the first device to establish the communication connection with the second device can be longer, and then the first device can perform the communication connection process with the fourth device, so that the first device can more quickly establish the communication connection with the fourth device, and the user experience is improved; if the time used by the first device to perform the communication connection process based on the first connection manner with the second device is less than the execution threshold, the first device can continue to perform the communication connection process with the second device, and the first device and the second device can possibly implement the service flow.

[0015] In a possible implementation, the following operations can further be performed: at a seventh time, the first device successfully establishes the communication connection with the fourth device; at an eighth time, the first device performs the communication connection process based on the first connection manner with the third device; at a ninth time, the first device successfully performs the communication connection process with the third device or times out; and at a tenth time, the first device performs the communication connection process with the second device.

[0016] The seventh time is later than the sixth time, the eighth time is later than the seventh time, the ninth time is later than the eighth time, and the tenth time is later than the ninth time; between the eighth time and the ninth time, the first device continuously performs the communication connection process with the third device, and the first device does not complete the communication connection with the third device; between the seventh time and the ninth time, the first device does not perform the communication connection with the second device; and the first device and the second device establishing the communication connection and the first remaining execution time are added into the connection task queue at the ninth time.

[0017] In this way, in the case that the first device successfully establishes the communication connection with the fourth device and the first device successfully performs the communication connection process with the third device or times out, the first device can further perform the communication connection process with the second device, and the first device and the second device can possibly implement the service flow.

[0018] In a possible implementation, at the tenth moment, the first device and the second device perform the communication connection procedure for a time less than or equal to the first remaining execution time.

[0019] In this way, more time is provided for the first device and the other device to perform the communication connection procedure, and the first device and the other device can successfully establish the communication connection.

[0020] In a possible implementation, at the eleventh moment, the first device receives a second operation of the user, the second operation is used to instruct the first device to establish a communication connection with a fifth device, and the first operation and the second operation can be the same or different; at the twelfth moment, the first device performs the communication connection procedure with the fifth device by using a second connection manner; at the thirteenth moment, the first device and the fifth device successfully establish the connection; and at the fourteenth moment, the first device and the second device continue to perform the communication connection procedure based on the first connection manner.

[0021] The eleventh moment is later than the tenth moment, the twelfth moment is later than the eleventh moment, the thirteenth moment is later than the twelfth moment, and the fourteenth moment is later than the thirteenth moment; and at the twelfth moment, the first device suspends the communication connection procedure between the first device and the second device.

[0022] In this way, by causing the first device to perform the communication connection procedure with the fifth device, the speed of establishing the communication connection between the first device and the fifth device can be improved, and in addition, if the first device and the fifth device successfully establish the communication connection, the first device can more quickly notify the user that the first device and the fifth device successfully establish the communication connection, and the user experience can be improved.

[0023] In a possible implementation, at the twelfth moment, the first device suspends the communication connection procedure between the first device and the second device, and the following operations can be performed: adding SDP information of the second device and a second remaining execution time to an SDP queue, the second remaining execution time including a difference between the first remaining execution time and a second executed time, the second executed time including a time used by the first device and the second device to perform the communication connection procedure between the ninth moment and the twelfth moment; removing the establishment of the communication connection between the first device and the second device from a connection task queue; and adding the establishment of the communication connection between the first device and the second device and the second remaining execution time to the connection task queue.

[0024] In this way, the SDP information of the second device and the second remaining execution time are added to the SDP queue, which can prepare for subsequently adding the establishment of the communication connection between the first device and the second device and the second remaining execution time to the connection task queue.

[0025] In a possible implementation, at the fourteenth moment, the first device and the second device continue to perform the communication connection procedure based on the first connection mode for a time less than or equal to the second remaining execution time.

[0026] In this way, more time is provided for the first device and the other device to perform the communication connection procedure, and the first device and the other device can successfully establish the communication connection.

[0027] In a second aspect, an embodiment of the present application provides a device connection apparatus. The device connection apparatus can be an electronic device, or a chip or chip system in the electronic device. The device connection apparatus can include a display unit and a processing unit. When the device connection apparatus is an electronic device, the display unit can be a display screen. The display unit is configured to perform the display step, so that the electronic device implements the device connection method described in the first aspect or any possible implementation of the first aspect. When the device connection apparatus is an electronic device, the processing unit can be a processor. The device connection apparatus can further include a storage unit, which can be a memory. The storage unit is configured to store instructions, and the processing unit executes the instructions stored in the storage unit, so that the electronic device implements the device connection method described in the first aspect or any possible implementation of the first aspect. When the device connection apparatus is a chip or chip system in the electronic device, the processing unit can be a processor. The processing unit executes the instructions stored in the storage unit, so that the electronic device implements the device connection method described in the first aspect or any possible implementation of the first aspect. The storage unit can be a storage unit (for example, a register, a cache, etc.) in the chip, or a storage unit (for example, a read-only memory, a random access memory, etc.) in the electronic device and located outside the chip.

[0028] For example, the processing unit is configured to, at a first moment, request, by the first device, establishment of a communication connection with a second device by using a first connection mode; at a second moment, perform, by the first device and the second device, a communication connection procedure based on the first connection mode; at a third moment, request, by the first device, establishment of a communication connection with a third device by using the first connection mode; at a fourth moment, continue, by the first device and the second device, to perform the communication connection procedure based on the first connection mode, and the first device does not perform the communication connection procedure with the third device; at a fifth moment, receive, by the first device, a first operation of a user, and the first operation is used to instruct the first device to establish a communication connection with a fourth device; and at a sixth moment, perform, by the first device, the communication connection procedure with the fourth device by using a second connection mode, and the second connection mode is different from the first connection mode.

[0029] The second time is later than the first time, the third time is later than the second time, the fourth time is later than the third time, and the fifth time is later than the fourth time. Between the first time and the fifth time, the first device continuously performs the communication connection process with the second device, and the first device does not complete the communication connection with the second device. Between the third time and the fifth time, the first device does not perform the communication connection with the third device. At the sixth time, the first device suspends the communication connection process with the second device.

[0030] In a possible implementation, at the sixth time, the first device suspends the communication connection process with the second device, and the processing unit is configured to: add SDP (Service Discovery Protocol) information of the second device and a first remaining execution time to an SDP queue; the first remaining execution time comprises a difference between an execution time threshold and a first executed time; the first executed time comprises a time used by the first device to perform the communication connection process with the second device between the first time and the sixth time; remove the establishment of the communication connection between the first device and the second device from a connection task queue; and add the establishment of the communication connection between the first device and the third device to the connection task queue.

[0031] In a possible implementation, at the second time, the first device performs the communication connection process with the second device based on a first connection mode, and the processing unit is configured to: add SDP information of the second device to the SDP queue, and add the establishment of the communication connection between the first device and the second device to the connection task queue. At the third time, after the first device requests to establish the communication connection with the third device based on the first connection mode, the method comprises: adding SDP information of the third device to the SDP queue. At the fifth time, after the first device receives the first operation of the user, the method further comprises: adding the establishment of the communication connection between the first device and the fourth device to the connection task queue.

[0032] In a possible implementation, after the establishment of the communication connection between the first device and the fourth device is added to the connection task queue, the processing unit is further configured to: determine whether a time used by the first device to perform the communication connection process with the second device based on the first connection mode is greater than an execution threshold; if the time is greater than or equal to the execution threshold, the first device performs the communication connection process with the fourth device based on a second connection mode; if the time is less than the execution threshold, the first device continuously performs the communication connection process with the second device, until the time is greater than or equal to the execution threshold, the first device performs the communication connection process with the fourth device based on the second connection mode, and the first device suspends the communication connection process with the second device.

[0033] In a possible implementation, the processing unit is further configured to: at a seventh time point, the first device successfully establishes a communication connection with the fourth device; at an eighth time point, the first device performs a communication connection process with the third device based on the first connection mode; at a ninth time point, the first device successfully performs the communication connection process with the third device or times out; and at a tenth time point, the first device performs the communication connection process with the second device.

[0034] The seventh time point is later than the sixth time point, the eighth time point is later than the seventh time point, the ninth time point is later than the eighth time point, and the tenth time point is later than the ninth time point. Between the eighth time point and the ninth time point, the first device continuously performs the communication connection process with the third device, and the first device does not complete the communication connection with the third device. Between the seventh time point and the ninth time point, the first device does not perform the communication connection with the second device. At the ninth time point, the first device and the second device are added to the connection task queue.

[0035] In a possible implementation, at the tenth time point, a time used by the first device to perform the communication connection process with the second device is less than or equal to the first remaining execution time.

[0036] In a possible implementation, the processing unit is further configured to: at an eleventh time point, the first device receives a second operation of a user, the second operation is used to instruct the first device to establish a communication connection with a fifth device, and the first operation and the second operation can be the same or different; at a twelfth time point, the first device performs a communication connection process with the fifth device by using a second connection mode; at a thirteenth time point, the first device successfully establishes a connection with the fifth device; and at a fourteenth time point, the first device continues to perform the communication connection process with the second device based on the first connection mode.

[0037] The eleventh time point is later than the tenth time point, the twelfth time point is later than the eleventh time point, the thirteenth time point is later than the twelfth time point, and the fourteenth time point is later than the thirteenth time point. At the twelfth time point, the first device suspends the communication connection process between the first device and the second device.

[0038] In a possible implementation, at the twelfth time point, the first device suspends the communication connection process between the first device and the second device, and the processing unit is configured to: add SDP information of the second device and a second remaining execution time to an SDP queue, the second remaining execution time includes a difference between the first remaining execution time and a second executed time, and the second executed time includes a time used by the first device to perform the communication connection process with the second device between the ninth time point and the twelfth time point; remove, from the connection task queue, the first device and the second device establishing the communication connection; and add, to the connection task queue, the first device and the second device establishing the communication connection and the second remaining execution time.

[0039] In a possible implementation, at the fourteenth moment, the first device and the second device continue to perform the communication connection process based on the first connection mode for a time less than or equal to the second remaining execution time.

[0040] In a third aspect, an electronic device is provided, including a processor and a memory. The memory is configured to store code instructions, and the processor is configured to execute the code instructions to perform the method described in the first aspect or any possible implementation of the first aspect.

[0041] In a fourth aspect, a computer readable storage medium is provided, and the computer readable storage medium stores a computer program or instructions. When the computer program or instructions are executed on a computer, the computer is caused to perform the method described in the first aspect or any possible implementation of the first aspect.

[0042] In a fifth aspect, a computer program product including a computer program is provided. When the computer program is executed on a computer, the computer is caused to perform the method described in the first aspect or any possible implementation of the first aspect.

[0043] In a sixth aspect, a chip or chip system is provided, including at least one processor and a communication interface. The communication interface and the at least one processor are interconnected by a line. The at least one processor is configured to execute a computer program or instructions to perform the method described in the first aspect or any possible implementation of the first aspect. The communication interface in the chip can be an input / output interface, a pin or a circuit, etc.

[0044] In a possible implementation, the chip or chip system described above in the present application further includes at least one memory. The at least one memory stores instructions. The memory can be a storage unit inside the chip, such as a register, a cache, etc. or a storage unit of the chip (such as a read-only memory, a random access memory, etc.).

[0045] It should be understood that the second aspect to the sixth aspect of the present application correspond to the technical solution of the first aspect of the present application, and the beneficial effects obtained by each aspect and the corresponding feasible implementation are similar, which will not be repeated. BRIEF DESCRIPTION OF DRAWINGS

[0046] Figure 1 A trust ring interface schematic diagram provided by an embodiment of the present application;

[0047] Figure 2 A schematic diagram of establishing a connection between a tablet computer and a headset provided by an embodiment of the present application;

[0048] Figure 3This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application;

[0049] Figure 4 A software structure block diagram of an electronic device provided in an embodiment of this application;

[0050] Figure 5 A schematic flowchart illustrating a device connection method provided in an embodiment of this application;

[0051] Figure 6 A schematic flowchart illustrating a device connection method provided in an embodiment of this application;

[0052] Figure 7 This is a schematic block diagram of a device connection apparatus provided in an embodiment of this application. Detailed Implementation

[0053] To facilitate a clear description of the technical solutions in the embodiments of this application, some terms and technologies involved in the embodiments of this application will be briefly introduced below:

[0054] 1. Smart Interconnection: Smart interconnection of electronic devices can be used to establish connections between electronic devices and other electronic devices, as well as between electronic devices and external devices. Specifically, electronic devices and other electronic devices can log in to the same account. Establishing connections between electronic devices indicates that other electronic devices logged into the same account can be discovered. Through this connection, electronic devices and other electronic devices can support various business functions such as notification routing and call routing.

[0055] Smart connectivity can be an application on any electronic device.

[0056] 2. Trust Ring Interface: A trust ring interface can be displayed in the intelligent interconnection of electronic devices. This interface allows for the monitoring and management of electronic devices, other electronic devices, and external devices. Users can monitor the status of these devices, including battery levels, through the trust ring interface. Users can also establish connections between electronic devices and external devices by dragging and dropping icons. This drag-and-drop connection can be achieved on any electronic device with a trust ring interface.

[0057] For example, Figure 1 A schematic diagram of a trust ring interface provided in an embodiment of this application is shown below. Figure 1 As shown, the trust ring interface includes an icon for the device, an icon 101 for the headphones, and an icon 102 for the tablet. Dragging the icon 101 for the headphones to the icon 102 for the tablet instructs the headphones to establish a connection with the tablet.

[0058] It should be understood that the trust circle interface can be any interface that can realize monitoring and management of the electronic device, other electronic devices and external devices, and / or management of the trust circle network, and embodiments of the present application do not limit the style of the trust circle interface.

[0059] 3. Bluetooth socket connection and create bond connection: The bluetooth socket connection can be used for the electronic device to discover other electronic devices that log in the same account as the electronic device, that is, the electronic device and other electronic devices establish a connection. The bluetooth socket connection is a core class for data exchange in the Bluetooth application programming interface (API).

[0060] The create bond connection can be used for the electronic device to establish a connection with an external device. The create bond connection is also a core class for data exchange in the Bluetooth API.

[0061] In embodiments of the present application, the bluetooth socket connection can include a connection method used when the electronic device initiates a communication connection with other electronic devices automatically, and the create bond connection can include a connection method used when the electronic device initiates a communication connection with other electronic devices based on user triggering.

[0062] In some implementations, before the electronic device establishes a connection with other electronic devices, the electronic device can be paired with other electronic devices through the create bond connection or other methods, or can not be paired with other electronic devices. In the case of pairing with other electronic devices, the communication process of the bluetooth socket connection can be encrypted, and in the case of not pairing with other electronic devices, the communication process of the bluetooth socket connection is not encrypted. In embodiments of the present application, whether the electronic device is paired with other electronic devices is not limited, and next, an example in which the electronic device is not paired with other electronic devices before the electronic device establishes a connection with other electronic devices is described.

[0063] 4. Other terms

[0064] In the embodiments of the present application, the terms "first", "second", and the like are used to distinguish between similar or identical items or components having substantially the same function and effect. For example, the first chip and the second chip are merely used to distinguish between different chips, and do not limit the sequence. Those skilled in the art can understand that the terms "first", "second", and the like do not limit the quantity and execution sequence, and the terms "first", "second", and the like do not necessarily mean different.

[0065] It should be noted that in the embodiments of the present application, the words "exemplary" or "for example" are used to represent an example, illustration, or description. Any embodiment or design scheme described as "exemplary" or "for example" in the present application should not be interpreted as more preferred or more advantageous than other embodiments or design schemes. Rather, the words "exemplary" or "for example" are intended to present the relevant concept in a specific manner.

[0066] In the embodiments of the present application, "at least one" means one or more, and "multiple" means two or more. The association relationship between the associated objects is described by "and / or", which means that there can be three relationships, for example, A and / or B, which can represent the following three cases: A exists alone, A and B exist together, and B exists alone, where A and B can be singular or plural. The character " / " generally represents an "or" relationship between the associated objects before and after it. "At least one of the following" or similar expressions means any combination of these items, including any combination of single item or multiple items. For example, at least one of a, b, or c can represent a, b, c, a-b, a-c, b-c, or a-b-c, where a, b, and c can be single or multiple.

[0067] 5、Electronic device

[0068] The electronic device in the embodiments of the present application can include a handheld device with device connection function, a vehicle-mounted device, etc. For example, some electronic devices are: a mobile phone, a tablet computer, a palm computer, a notebook computer, a mobile internet device (MID), a virtual reality (VR) device, an augmented reality (AR) device, a wireless terminal in industrial control, a wireless terminal in self driving, a wireless terminal in remote medical surgery, a wireless terminal in smart grid, a wireless terminal in transportation safety, a wireless terminal in smart city, a wireless terminal in smart home, a cellular phone, a cordless phone, a session initiation protocol (SIP) phone, a wireless local loop (WLL) station, a personal digital assistant (PDA), a handheld device with wireless communication function, a computing device or other processing device connected to a wireless modem, a vehicle-mounted device, a terminal device in a 5G network, or a terminal device in a future evolved public land mobile network (PLMN), etc. The embodiments of the present application are not limited thereto.

[0069] By way of example and not limitation, in the embodiments of the present application, the electronic device can also be a wearable device. The wearable device can also be referred to as a wearable smart device, which is a general term for devices that are designed and developed by applying wearable technology to daily wear, such as glasses, gloves, watches, clothing, and shoes, etc. The wearable device is a portable device that is directly worn on the body or integrated into the clothes or accessories of the user. The wearable device is not only a hardware device, but also has strong functions through software support and data interaction and cloud interaction. The general wearable smart device includes a device with full functions and large size, which can realize complete or partial functions without relying on a smart phone, such as a smart watch or smart glasses, etc., and a device that focuses on a certain application function and needs to cooperate with other devices such as a smart phone, such as various smart wristbands and smart jewelry for monitoring vital signs, etc.

[0070] In addition, in the embodiments of the present application, the electronic device can also be a terminal device in an internet of things (IoT) system. The IoT is an important part of future information technology development, and its main technical feature is to connect objects through communication technology and network, so as to realize the intelligent network of man-machine interconnection and interconnection.

[0071] The electronic device in the embodiments of the present application can also be referred to as a terminal device, a user equipment (UE), a mobile station (MS), a mobile terminal (MT), an access terminal, a subscriber unit, a subscriber station, a mobile station, a mobile terminal, a remote station, a remote terminal, a mobile device, a user terminal, a terminal, a wireless communication device, a user agent, or a user apparatus, etc.

[0072] In the embodiments of the present application, the electronic device or each network device includes a hardware layer, an operating system layer running on the hardware layer, and an application layer running on the operating system layer. The hardware layer includes central processing unit (CPU), memory management unit (MMU), and memory (also known as main memory), etc. The operating system can be any one or more computer operating systems that implement business processing through processes, such as Linux operating system, Unix operating system, Android operating system, iOS operating system, or windows operating system, etc. The application layer includes browser, address book, word processing software, instant messaging software, etc.

[0073] When the electronic device establishes a connection with an external device, the connection may be slow or even fail. Next, taking the case that the electronic device is a tablet computer, the other electronic device is a mobile phone, and the external device is a headset as an example, the electronic device and the external device are connected in the trusted ring interface of the electronic device by dragging an icon.

[0074] It should be understood that the tablet computer and the headset can be connected by dragging an icon only when the icon of the headset appears in the trusted ring interface of the tablet computer, and there are various ways to make the icon of the headset appear in the trusted ring interface of the tablet computer.

[0075] One implementation is that after the mobile phone and the tablet computer establish a connection, the mobile phone establishes a connection with the earphone, and in the case that the mobile phone and the earphone establish a connection successfully, the icon of the earphone can appear on the trust ring interface of the tablet computer. Another implementation is that after the mobile phone and the earphone establish a connection, the mobile phone establishes a connection with the tablet computer, and in the case that the mobile phone and the tablet computer establish a connection successfully, the icon of the earphone can appear on the trust ring interface of the tablet computer.

[0076] In some implementations, in the case that the icon of the earphone can be seen on the trust ring interface of the tablet computer, the tablet computer can establish a connection with the earphone by dragging the icon. Exemplarily, Figure 2 A schematic diagram of establishing a connection between the tablet computer and the earphone provided by the embodiments of the present application, it should be understood that, Figure 2 is described from the perspective of the tablet computer, as Figure 2 indicated, the method comprises:

[0077] S201, the wisdom interconnection initiates a request for establishing a connection with device A through a Bluetooth socket connection.

[0078] It should be understood that before the tablet computer establishes a connection with the earphone, the tablet computer can also need to establish a connection with other electronic devices. Exemplarily, in the embodiments of the present application, the tablet computer can also need to establish a connection with device A and device B. Since the system Bluetooth can process the request for establishing a connection in series, the system Bluetooth can first process the request for establishing a connection with device A, and then process the request for establishing a connection with device B.

[0079] In the embodiments of the present application, device A refers to other electronic devices that log in to the same account as the tablet computer and are not displayed on the trust ring interface, indicating that device A does not establish a connection with the tablet computer. It can be understood that in the case that the tablet computer opens the wisdom interconnection, the wisdom interconnection can initiate a request for establishing a connection with other electronic devices that log in to the same account as the tablet computer every preset time interval, for example, 5 minutes (minute, min), or 3 min, etc.

[0080] S202, the socket management module sets the service discovery protocol (SDP) information of device A, and adds the SDP information of device A to the SDP queue.

[0081] The SDP information of device A can be used for the tablet computer to discover device A and establish a connection with device A. The SDP information of device A can include port information, transmission protocol and / or encoding method used by device A to establish a connection, etc.

[0082] The SDP queue is used to store and manage SDP information of one or more electronic devices. When the SDP module of the tablet processes the SDP messages in the SDP queue, a serial manner can be adopted, so that the SDP information can be processed in a certain order. In the embodiments of the present application, the SDP information added to the SDP queue earlier can be processed earlier, and the SDP information added to the SDP queue later can be processed later, that is, in some implementations, the SDP information of device A is added to the SDP queue first, and it is indicated that the SDP information of device A is processed first.

[0083] In a possible implementation, the socket management module sets the SDP information of device A, which can include: querying the SDP information of device A, and in the case that device A returns the SDP information of device A to the socket management module, the socket management module can parse the SDP information. In the case that the socket management module successfully parses the SDP information of device A, the SDP information of device A can be added to the SDP queue, so that the SDP module can process the information in the SDP queue in order.

[0084] S203, the SDP module adds a task of establishing a connection with device A to the connection task queue.

[0085] In a possible implementation, in the case that the SDP information of device A exists in the SDP queue, the SDP module adds a task of establishing a connection with device A to the connection task queue.

[0086] S204, the link management module initiates establishment of a connection with device A.

[0087] In a possible implementation, in the case that the task of establishing a connection with device A exists in the connection task queue, the link management module can initiate establishment of a connection with device A.

[0088] S205, the smart interconnection initiates a request of establishing a connection with device B through a bluetooth socket connection.

[0089] In the embodiments of the present application, in the case that the system Bluetooth processes the request of establishing a connection with device A, the smart interconnection can initiate a request of establishing a connection with device B through a bluetooth socket connection, and the system Bluetooth can process the request of establishing a connection with device B. Wherein, device B refers to other electronic devices which log in the same account as the tablet and are not displayed on the trusted ring interface, indicating that device B does not establish a connection with the tablet.

[0090] S206, the socket management module sets the SDP information of device B, and adds the SDP information of device B to the SDP queue.

[0091] The SDP information of device B can be used by the tablet computer to discover device B and establish a connection with device B. The SDP information of device B may include port information, transmission protocol and / or encoding method used by device B to establish the connection.

[0092] In this embodiment of the application, the SDP information of device B is added to the SDP queue. At this time, the SDP queue can contain the SDP information of device A and device B at the same time. Since the processing of SDP information can be done in a serial manner, that is, one possible implementation includes: processing the SDP information according to the order of the SDP information in the SDP queue. Since the SDP information of device A was added to the SDP queue earlier than the SDP information of device B, the SDP module can process the SDP information of device B after processing the SDP information of device A.

[0093] In one possible implementation, the socket management module sets the SDP information of device B, which may include: querying the SDP information of device B; if device B returns its own SDP information to the socket management module, the socket management module can parse the SDP information. If the socket management module successfully parses the SDP information of device B, it can add the SDP information of device B to the SDP queue, so that the SDP module can process the information in the SDP queue in sequence.

[0094] S207. Smart Connect initiates a request to establish a connection with the headphones via createbond.

[0095] In one possible implementation, in response to a user dragging an icon on the Trust Ring interface, Smart Connect can initiate a request to establish a connection with the headphones via createbond.

[0096] S208. The device management module adds the task of establishing a connection with the headset to the connection task queue.

[0097] In this embodiment, when the device management module receives a request from the smart interconnection to establish a connection with the headphones, the device management module can add the task of establishing a connection with the headphones to the connection task queue. In one possible implementation, when the device management module adds the task of establishing a connection with the headphones to the connection task queue, the task of establishing a connection with device A in the connection task queue has not yet been completed, that is, the connection with device A has not yet been successfully established. At this time, the connection task queue can simultaneously contain tasks: establishing a connection with device A and establishing a connection with the headphones.

[0098] In a related implementation, the link management module processes the connection task queue in a serial manner, that is, one possible implementation includes that the link management module executes the tasks in the connection task queue according to the order of the tasks, and the task of establishing a connection with the device A is added to the connection task queue earlier than the task of establishing a connection with the earphone, thus, in the case that the connection with the device A is successfully established or the connection with the device A is timed out, the link management module can execute the task of establishing a connection with the earphone.

[0099] Next, taking the case that the connection with the device A is timed out as an example, the link management module executes the task of establishing a connection with the earphone.

[0100] S209, in the case that the connection response time with the device A reaches the first threshold value, the link management module removes the task of establishing a connection with the device A from the connection task queue, and initiates establishing a connection with the earphone.

[0101] The first threshold value is used to indicate the maximum allowable time of establishing a connection with the device A, and the first threshold value is, for example, 8 seconds (s), and in the case that the connection response time with the device A reaches 8 s, it indicates that the connection with the device A is timed out.

[0102] In the case that the connection response time with the device A reaches the first threshold value, the link management module can remove the task of establishing a connection with the device A from the connection task queue, at this time, the connection task queue can only exist the task of establishing a connection with the earphone, and the link management module can start executing the task of establishing a connection with the earphone, that is, the link management module can initiate establishing a connection with the earphone.

[0103] S210, the SDP module removes the SDP information of the device A from the SDP queue, and adds the task of establishing a connection with the device B to the connection task queue.

[0104] In the case that the connection with the device A is timed out, the SDP module can remove the SDP information of the device A from the SDP queue, at this time, the SDP queue can only exist the SDP information of the device B, and the SDP module can add the task of establishing a connection with the device B to the connection task queue.

[0105] In one possible implementation, in the case that the task of establishing a connection with the device B is added to the connection task queue, the tablet computer has not successfully established a connection with the earphone, at this time, the connection task queue can simultaneously exist the tasks of establishing a connection with the earphone and establishing a connection with the device B, and in the case that the connection with the earphone is successfully established or the connection with the earphone is timed out, the link management module can execute the task of establishing a connection with the device B.

[0106] S211, the earphone establishes a connection with the tablet computer and performs authentication encryption.

[0107] In a possible implementation, in response to a request for establishing a connection with the earphone initiated by the link management module, the earphone can establish a connection with the tablet computer and perform identity authentication, after the identity authentication is completed, the connection between the earphone and the tablet computer can be encrypted, the identity authentication is used to verify the identity of the earphone and the tablet computer, so that the earphone and the tablet computer can establish a connection, the identity authentication can be implemented by a personal identification number (PIN) or a pairing code, the encryption is used to make the data transmission of the earphone and the tablet computer secure, and the encryption can be implemented by a security manager protocol (SMP). The identity authentication and the encryption manner are not limited in the embodiments of the application.

[0108] S212, the tablet computer successfully establishes a connection with the earphone, the link management module notifies the smart interconnection that the connection with the earphone is successful, removes the task of establishing a connection with the earphone from the connection task queue, and initiates establishing a connection with device B.

[0109] For example, the successful establishment of the connection between the tablet computer and the earphone can indicate that the connection between the tablet computer and the earphone is successfully established in the system Bluetooth internal.

[0110] In the case where the connection between the system Bluetooth internal and the earphone is successfully established, the link management module can notify the device management module that the connection with the earphone is successfully established, the device management module can notify the smart interconnection that the connection with the earphone is successfully established, the smart interconnection can return to the user that the connection with the earphone is successfully established, and the link management module can remove the task of establishing a connection with the earphone from the connection task queue. At this time, the connection task queue only has a task of establishing a connection with device B, and the link management module can start to execute the task of establishing a connection with device B and initiate establishing a connection with device B.

[0111] S213, in the case where the no-response time of establishing a connection with the earphone reaches a second threshold value, the smart interconnection notifies the system Bluetooth to cancel establishing a connection with the earphone.

[0112] The second threshold value is used to indicate the maximum allowable time of establishing a connection with the earphone. For example, the second threshold value is 10 s, and when the no-response time of establishing a connection with the earphone reaches 10 s, it indicates that the connection with the earphone fails.

[0113] It should be understood that the maximum allowable time of establishing a connection between the tablet computer and the earphone in a manner other than the drag icon can be in a first time interval. For example, the first time interval is [3, 4], and when the time of establishing a connection between the tablet computer and the earphone exceeds 4 s, the connection between the tablet computer and the earphone fails.

[0114] However, in the wisdom interconnection, the maximum allowable time for the tablet computer to establish a connection with the earphone can be increased by a second time interval based on the first time interval, for example, the second time interval is (0, 8], for example, the minimum value of the time for the tablet computer to establish a connection with the earphone can be 3s, and the maximum value can be 12s, that is, in the case that the time for the tablet computer to establish a connection with the earphone exceeds 12s, the tablet computer fails to establish a connection with the earphone, in order to make the user experience better, the second threshold value can be any value less than or equal to 12s, in the embodiment of the present application, the maximum allowable time for the tablet computer to establish a connection with the earphone is 10s, that is, the second threshold value is 10s, which is taken as an example for description.

[0115] In a possible implementation, in the case that the connection establishment non-response time reaches the second threshold value, in the system Bluetooth, the tablet computer can successfully establish a connection with the earphone, and the tablet computer can also fail to establish a connection with the earphone.

[0116] In the system Bluetooth, if the tablet computer successfully establishes a connection with the earphone, and the link management module successfully notifies the wisdom interconnection that the connection establishment is successful, the wisdom interconnection can notify the system Bluetooth to cancel the connection establishment with the earphone, that is, in the trust ring interface of the wisdom interconnection, it is displayed that the connection establishment with the earphone fails, in the embodiment of the present application, the style of the trust ring interface displaying that the connection establishment with the earphone fails is not limited;

[0117] In the system Bluetooth, if the tablet computer fails to establish a connection with the earphone, the wisdom interconnection can also notify the system Bluetooth to cancel the connection establishment with the earphone.

[0118] S214, the system Bluetooth cancels the connection establishment with the earphone.

[0119] It should be understood that, in the system Bluetooth, if the tablet computer successfully establishes a connection with the earphone, the system Bluetooth cancels the connection establishment with the earphone, which means that the connection between the tablet computer and the earphone is disconnected; if the tablet computer fails to establish a connection with the earphone, the system Bluetooth cancels the connection establishment with the earphone, which means that the task of establishing a connection with the earphone is stopped, and the tablet computer fails to establish a connection with the earphone.

[0120] In the above embodiment, the system Bluetooth, the socket management module, the device management module, the SDP module, and the link management module can refer to the description in the subsequent embodiments, which will not be described here. It can be understood that, in the Figure 2 The steps in the corresponding embodiments are optional, and the order between the steps can be exchanged, and the layer, module or unit executed by each step can be replaced by any implementable manner, which is not limited.

[0121] Since the link management module can execute the tasks in the connection task queue in sequence and in series, that is, the task of establishing a connection with the earphone in the task queue can be executed only after the task of establishing a connection with the device A is completed or times out, the speed of establishing a connection with the earphone is slow, and thus the user experience is poor.

[0122] In addition, before the task of establishing a connection with the device A is completed or times out, the user can request to establish a connection with the earphone by dragging an icon in the smart interconnection. If the smart interconnection does not receive a message about the success of establishing a connection with the earphone from the system Bluetooth before the time of requesting to establish a connection with the earphone exceeds the second threshold, the smart interconnection displays to the user that the connection with the earphone fails, and thus the user experience is poor.

[0123] Therefore, the embodiments of the present application provide a device method and related apparatus. In the process of establishing a connection between an electronic device and another electronic device, if the electronic device receives a request of establishing a connection with an external device initiated by a user, the electronic device executes a task of establishing a connection with the external device first. In this way, the electronic device can initiate the establishment of a connection with the external device without waiting for the establishment of a connection with the other electronic device to fail or time out, and can establish a connection with the external device more quickly. In addition, if the establishment of a connection with the external device is successful, the system Bluetooth can notify an application program of the success of establishing a connection with the external device more quickly, and thus the user experience is improved.

[0124] The device connection method provided by the embodiments of the present application can be implemented based on an electronic device. In order to facilitate understanding of the device connection method provided by the embodiments of the present application, the hardware structure of the electronic device provided by the embodiments of the present application is introduced below.

[0125] An exemplary hardware structure of an electronic device is shown in FIG. 1. Figure 3 An exemplary hardware structure of an electronic device is shown in FIG. 1.

[0126] The electronic device can include a processor 310, an external memory interface 320, an internal memory 321, a universal serial bus (USB) interface 330, a charging management module 340, a power management module 341, a battery 342, an antenna 1, an antenna 2, a mobile communication module 350, a wireless communication module 360, an audio module 370, a speaker 370A, a receiver 370B, a microphone 370C, a headset jack 370D, a sensor module 380, a key 390, a motor 391, an indicator 392, a camera 393, and a subscriber identification module (SIM) card interface, etc. The sensor module 380 can include a pressure sensor 380A, a gyro sensor 380B, a barometric pressure sensor 380C, a magnetic sensor 380D, an acceleration sensor 380E, a distance sensor 380F, a proximity light sensor 380G, a fingerprint sensor 380H, a temperature sensor 380J, a touch sensor 380K, an ambient light sensor 380L, a bone conduction sensor 380M, etc.

[0127] It can be understood that the structure illustrated by the embodiments of the present application does not constitute a specific limitation on the electronic device. In other embodiments of the present application, the electronic device can include more or fewer components than illustrated, or combine certain components, or split certain components, or different arrangement of components. The illustrated components can be implemented by hardware, software, or a combination of software and hardware.

[0128] The processor 310 can include one or more processing units, for example: the processor 310 can include an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Different processing units can be independent devices, or can be integrated in one or more processors.

[0129] The controller can generate operation control signals according to instruction operation codes and timing signals, and complete the control of fetching and executing instructions.

[0130] The processor 310 can also include a memory that stores instructions and data. In some embodiments, the memory in the processor 310 is a cache memory. The memory can hold instructions or data that the processor 310 has just used or is using. If the processor 310 needs to use the instructions or data again, it can call them directly from the memory. This avoids repeated access and reduces the waiting time of the processor 310, thus improving the efficiency of the system.

[0131] In some embodiments, the processor 310 can include one or more interfaces. The interfaces can include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal aS5nchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a SIM card interface, and / or a USB interface, etc.

[0132] It can be understood that the interface connection relationship between the modules shown in the embodiments of the present application is only illustrative and does not constitute a limitation on the structure of the electronic device. In some other embodiments of the present application, the electronic device can also use different interface connection modes or a combination of multiple interface connection modes in the above embodiments.

[0133] The camera 393 can be used to capture still images or videos. In some embodiments, the electronic device can include at least one camera 393. The internal memory 321 can be used to store computer executable program codes, including instructions. The internal memory 321 can include a program storage area and a data storage area. The program storage area can store an operating system, application programs required by at least one function (such as an image shooting function, an image editing function, etc.), and the like. The data storage area can store data (such as image data, video streams, etc.) created during use of the electronic device. In addition, the internal memory 321 can include a high-speed random access memory, and can also include a non-volatile memory, such as at least one magnetic disk storage device, a flash memory device, a universal flash storage (UFS), etc. The processor 310 executes various function applications and data processing of the electronic device by running instructions stored in the internal memory 321 and / or instructions stored in a memory disposed in the processor.

[0134] For example, in the embodiments of the present application, by running the executable program codes related to the device connection method provided by the embodiments of the present application through the processor 310, the connection with the external device can be initiated without waiting for the success, failure or timeout of the connection with other electronic devices, and the connection with the external device can be established more quickly.

[0135] Figure 4 A software structure block diagram of an electronic device provided by the embodiments of the present application is shown. The layered architecture divides the software into several layers, each layer has a clear role and division of labor. Layers communicate with each other through software interfaces. In some embodiments, the operating system can be divided into four layers, from top to bottom, applications, application framework, native, and driver.

[0136] The application layer can include a series of application packages, and the application layer runs the application programs by calling the APIs provided by the application framework layer. As shown in Figure 4 The application packages can include smart interconnection, sports health, Bluetooth connection, wireless fidelity (Wi-Fi) connection, and camera application, etc. The applications can include system applications and third-party applications.

[0137] The application framework layer provides APIs and programming frameworks for the application programs of the application layer. The application framework layer includes some pre-defined functions. As shown in Figure 4As shown, the application framework layer can include a bluetooth manager, a wifi manager, and a camera manager, etc.

[0138] The native layer is used to directly interact with the underlying functions of hardware or operating system, and the native layer can include APIs provided by the operating system, such as Figure 4 As shown, the native layer includes a bluetooth stack, wifi, and camera, etc. The SDP module and the link management module in the above embodiment can be in the bluetooth stack.

[0139] The SDP module is used to manage the connection task queue, and the management of the connection task queue can include adding a task of establishing a connection with other electronic devices to the connection task queue, removing a task of establishing a connection with other electronic devices from the connection task queue, adding a task of establishing a connection with external devices to the connection task queue, or removing a task of establishing a connection with external devices from the connection task queue; the SDP module can also manage the SDP queue, and the management of the SDP queue can include adding SDP information of the electronic device or other electronic devices to the SDP queue, or removing SDP information of the electronic device or other electronic devices from the SDP queue.

[0140] The link management module is used to serially execute the tasks in the connection task queue.

[0141] The driver layer is a layer between hardware and software. As shown, Figure 4 As shown, the driver layer can include one or more of the following: a bluetooth driver, a wifi driver, and a camera driver, etc.

[0142] The socket management module and the device management module in the above embodiment can be in one or more of the application layer, the application framework layer, the native service layer, and the driver layer, that is, the application layer, the application framework layer, the native service layer, and / or the driver layer can be combined to realize the corresponding functions of the socket management module and the device management module.

[0143] The socket management module can be used to set the SDP information of other electronic devices, and the socket management module can also be used to manage the SDP queue.

[0144] The device management module can be used to receive a message that the electronic device and the external device are successfully connected or failed to be connected, and the device management module can also be used to add a task of connecting external devices to the connection task queue.

[0145] The system Bluetooth expressed in the present application can include a socket management module, a device management module, an SDP module, and a link management module. By using these modules in combination, the system Bluetooth can process a request for establishing a connection with other electronic devices initiated by the smart interconnection and a request for establishing a connection with external devices initiated by the smart interconnection.

[0146] It should be understood that in some embodiments, layers that implement the same function can be referred to as other names, or layers that can implement the functions of multiple layers can be taken as one layer, or layers that can implement the functions of multiple layers can be divided into multiple layers. The embodiments of the present application do not limit this.

[0147] It should be noted that the embodiments of the present application are only illustrated by taking the Android operating system as an example. In other operating systems (for example, the windows operating system, the iOS operating system, etc.), as long as the functions implemented by each functional module are similar to the embodiments of the present application, the scheme of the present application can also be implemented.

[0148] The device connection method provided by the embodiments of the present application will be described below in combination with specific embodiments. The following embodiments can be combined with each other, and the same or similar concept processes can not be described in some embodiments.

[0149] Figure 5 A flowchart of a device connection method provided by the embodiments of the present application is shown in FIG. 5. As shown in FIG. 5, the method includes the following steps. Figure 5

[0150] S501, the smart interconnection initiates a request for establishing a connection with a device A through a Bluetooth socket.

[0151] S502, the socket management module sets SDP information of the device A, and adds the SDP information of the device A to an SDP queue.

[0152] S503, the SDP module adds a task for establishing a connection with the device A to a connection task queue.

[0153] In the embodiments of the present application, the specific implementation of S501-S503 is consistent with S201-S203, which will not be described here.

[0154] S504, the link management module initiates establishing a connection with the device A, and records a starting time of initiating establishing a connection with the device A.

[0155] ​In a possible implementation, in a case where there is a task of establishing a connection with device A in the connection task queue, the link management module can initiate establishing a connection with device A, and can record the starting time of initiating establishing a connection with device A by means of a timer or other manners.

[0156] For example, by recording the starting time of initiating establishing a connection with device A, in a case where the smart interconnection initiates a request of establishing a connection with the earphone through createbond in subsequent execution methods, the time of establishing a connection with device A can be determined, and if the time is too long, the establishing a connection with device A is cancelled, so that the link management module can execute the task of establishing a connection with the earphone and initiate a connection with the earphone.

[0157] In this way, the link management module can initiate establishing a connection with the earphone without establishing a connection with device A failing or establishing a connection with device A timing out, can accelerate the speed of establishing a connection with the earphone, and in addition, if establishing a connection with the earphone succeeds, the user experience can be further improved.

[0158] S505, the smart interconnection initiates a request of establishing a connection with device B through bluetoothsocket.

[0159] S506, the socket management module sets the SDP information of device B, and adds the SDP information of device B to the SDP queue.

[0160] S507, the smart interconnection initiates a request of establishing a connection with the earphone through createbond.

[0161] S508, the device management module adds the task of establishing a connection with the earphone to the connection task queue.

[0162] In the embodiments of the present application, the specific implementation of S505-S508 is consistent with S205-S208, which will not be repeated here.

[0163] In a case where the application layer initiates a request of establishing a connection with an external device through createbond, the link management module can preferentially execute the task of initiating establishing a connection with the external device through createbond, and then execute the task of initiating establishing a connection with other electronic devices through bluetoothsocket.

[0164] It should be understood that, in the case that the application layer initiates a request for establishing a connection with the external device through the createbond connection, the time used by the link management module to initiate the establishment of the connection with the other electronic device is judged whether it is less than the third threshold value, if it is less than the third threshold value, the timer is started to wait, if it is equal to the third threshold value, the initiation of the establishment of the connection with the other electronic device is cancelled, and the initiation of the establishment of the connection with the external device is initiated; if it is greater than the third threshold value, the initiation of the establishment of the connection with the other electronic device is cancelled, and the initiation of the establishment of the connection with the external device is initiated; the specific implementation method can be referred to S509-S514.

[0165] The third threshold value can be set to be any value less than or equal to the first threshold value, in order to enable the user to obtain a better experience, the third threshold value can be any value less than the first threshold value.

[0166] In the embodiments of the present application, the external device for example includes: earphone, the other electronic device for example includes device A.

[0167] It should be understood that, for example, in the case that the connection task queue simultaneously exists the task of establishing the connection with the device A and the task of establishing the connection with the earphone, S509-S514 can be used to enable the tablet computer to more quickly establish the connection with the earphone, so that the system Bluetooth of the tablet computer can quickly notify the smart interconnection that the connection with the earphone is successfully established, thereby improving the user experience.

[0168] S509, in the case that the no-response time of the establishment of the connection with the device A reaches the third threshold value, the link management module removes the task of establishing the connection with the device A from the connection task queue, and initiates the establishment of the connection with the earphone.

[0169] It should be understood that the description of the third threshold value in the embodiments of the present application can refer to the description of the third threshold value in the above-mentioned embodiments, and in the following embodiments, the third threshold value is taken as 2s for example.

[0170] In a possible implementation, in the case that the no-response time of the establishment of the connection with the device A is greater than or equal to 2s, the link management module can cancel the establishment of the connection with the device A, and remove the task of establishing the connection with the device A from the connection task queue, at this time, the connection task queue can only have the task of establishing the connection with the earphone, and the link management module can initiate the establishment of the connection with the earphone.

[0171] S510, the SDP module adds the SDP information of the device A carrying the first remaining execution time into the SDP queue, and adds the task of establishing the connection with the device B into the connection task queue.

[0172] The first remaining execution time refers to a maximum allowed time for establishing a connection with the device A in the next execution method when the link management module initiates the connection with the device A again. In a possible implementation, the first remaining execution time can be a difference between the first threshold value and the first executed time. The first executed time can include a time for establishing the connection between the tablet and the device A during execution of S504-S509.

[0173] For example, if the first execution time is 2s, the first threshold value is 8s, and the first remaining execution time is 6s, which indicates that if the link management module fails to successfully establish the connection with the device A again after 6s, the connection with the device A is timed out.

[0174] In a possible implementation, during execution of S504-S509, when the time for establishing the connection with the device A is greater than or equal to a third threshold value, the SDP module can add the SDP information of the device A carrying the first remaining execution time to the SDP queue. At this time, the SDP information of the device B and the SDP information of the device A carrying the first remaining execution time can exist in the SDP queue at the same time. The SDP module can process the SDP information according to the order of the SDP information in the SDP queue. Since the SDP information of the device B is earlier than the SDP information of the device A carrying the first remaining execution time in the SDP queue, the SDP module can add a task of establishing a connection with the device B to the connection task queue, wait for a successful connection with the earphone, and the link management module can execute the task of establishing the connection with the device B to initiate the connection with the device B.

[0175] S511, the earphone establishes a connection with the tablet and performs authentication and encryption.

[0176] S512, the tablet successfully establishes a connection with the earphone, the link management module notifies the smart interconnection that the connection with the earphone is successful, removes the task of establishing the connection with the earphone from the connection task queue, and initiates the connection with the device B.

[0177] In the embodiments of the present application, the specific implementation of S511-S512 is consistent with that of S211-S212, which is not described herein.

[0178] Since the link management module does not need to wait for the non-response time of establishing the connection with the device A to reach the first threshold value, the task of establishing the connection with the earphone can be executed to initiate the connection with the earphone, which can improve the speed of establishing the connection with the earphone. In addition, if the connection with the earphone is successful, the link management module can quickly notify the smart interconnection that the connection with the earphone is successful, which can improve the user experience.

[0179] S513、In the case of successful establishment of the connection with device B or timeout, the SDP module removes the SDP information of device B from the SDP queue, removes the task of establishing the connection with device B from the connection task queue, and adds the task of establishing the connection with device A carrying the first remaining execution time to the connection task queue.

[0180] In a possible implementation, in the case of successful establishment of the connection with device B or timeout, the SDP module can remove the SDP information of device B from the SDP queue, at this time, the SDP queue can only have the SDP information of device A carrying the first remaining execution time, and the task of establishing the connection with device A carrying the first remaining execution time can be added to the connection task queue, so that the link management module can initiate establishment of the connection with device A.

[0181] S514、The link management module initiates establishment of the connection with device A, and records a starting time of initiating establishment of the connection with device A.

[0182] In a possible implementation, in the case that the connection task queue has the task of establishing the connection with device A carrying the first remaining execution time, the link management module can initiate establishment of the connection with device A, and can record the starting time of initiating establishment of the connection with device A by means of a timer or other manners, so that in the next embodiment, in the case that the smart interconnection initiates a request of establishing a connection with other external device through createbond, the link management module can initiate establishment of the connection with other external device more quickly, and next, taking the case that the other external device includes a car machine as an example.

[0183] S515、The three-party application initiates a request of establishing a connection with the car machine through createbond.

[0184] In a possible implementation, the user can initiate the request of establishing the connection with the car machine through createbond in the three-party application of the car machine by means of enabling a Bluetooth connection.

[0185] S516、The device management module adds the task of establishing the connection with the car machine to the connection task queue.

[0186] In the embodiment of the present application, in the case that the device management module receives the request of establishing the connection with the car machine initiated by the three-party application, the device management module can add the task of establishing the connection with the car machine to the connection task queue.

[0187] Exemplarily, when the device management module adds the task of establishing connection with the car machine into the connection task queue, the task of establishing connection with the device A in the connection task queue has not been completed, and the time of establishing connection with the device A can be greater than or equal to the third threshold value or less than the third threshold value, for example, the time of establishing connection with the device A is 3s, and in the following embodiments, the time of establishing connection with the device A is taken as 3s for example.

[0188] S517, in the case where the time of establishing connection with the device A reaches the third threshold value, the link management module removes the task of establishing connection with the device A from the connection task queue and initiates the task of establishing connection with the car machine.

[0189] Exemplarily, in the case where the time of establishing connection with the device A is 3s, the link management module cancels the task of establishing connection with the device A and removes the task of establishing connection with the device A from the connection task queue, at this time, the connection task queue can only have the task of establishing connection with the car machine, and the link management module can initiate the task of establishing connection with the car machine.

[0190] Since the link management module does not need to wait for the time of establishing connection with the device A to reach the first remaining execution time, the task of establishing connection with the car machine can be executed, and the task of establishing connection with the car machine can be initiated, which can improve the speed of establishing connection with the car machine, and in addition, if the task of establishing connection with the car machine is successful, the link management module can also quickly notify the three-party application that the task of establishing connection with the car machine is successful, which can improve the user experience.

[0191] S518, the SDP module adds the SDP information of the device A carrying the second remaining execution time into the SDP queue and adds the task of establishing connection with the device A carrying the second remaining execution time into the connection task queue.

[0192] The second remaining execution time can refer to the maximum allowable time of establishing connection with the device A in the following execution method when the link management module initiates the task of establishing connection with the device A again. In one possible implementation, the second remaining execution time can be the difference between the first remaining execution time and the second executed time, and the second executed time can include the time of establishing connection with the device A by the tablet computer between S514-S517. If the first remaining execution time is 6s and the second executed time is 3s, the second remaining execution time is 3s, which indicates that if the time of establishing connection with the device A exceeds 3s when the link management module initiates the task of establishing connection with the device A again, the task of establishing connection with the device A is timed out.

[0193] In a possible implementation, between performing S514-S517, in a case where the time of establishing the connection with the device A is greater than or equal to the third threshold value, the SDP module can add the SDP information of the device A carrying the second remaining execution time into the SDP queue, at this time, the SDP queue can only exist the SDP information of the device A carrying the second remaining execution time, the SDP module can add the task of establishing the connection with the device A into the connection task queue, wait for the connection with the vehicle machine to be successfully established, and then the link management module can perform the task of establishing the connection with the device A, and initiate the establishment of the connection with the device A.

[0194] S519, the vehicle machine establishes the connection with the tablet computer, and performs authentication encryption.

[0195] In a possible implementation, the specific implementation method of the vehicle machine establishing the connection with the tablet computer and performing authentication encryption can refer to the specific implementation method of the earphone establishing the connection with the tablet computer and performing authentication encryption in S211, which is not described herein.

[0196] S520, the tablet computer successfully establishes the connection with the vehicle machine, the link management module informs the three-party application that the connection with the vehicle machine is successfully established, removes the task of establishing the connection with the vehicle machine from the connection task queue, initiates the establishment of the connection with the device A, and records the starting time of initiating the establishment of the connection with the device A.

[0197] Since the link management module does not need to wait for the non-response time of establishing the connection with the device A to reach the first remaining execution time, the task of establishing the connection with the vehicle machine can be performed, the establishment of the connection with the vehicle machine is initiated, the speed of establishing the connection with the vehicle machine can be improved, in addition, if the connection with the vehicle machine is successfully established, the link management module can also more quickly inform the three-party application that the connection with the vehicle machine is successfully established, thereby improving the user experience.

[0198] It should be understood that the log generated by the embodiments of the present application can be stored in the host controller interface (HCI) log of the system Bluetooth, or in the log of other paths, which is not limited by the embodiments of the present application; the link management module can establish the connection with other electronic devices in the way of bluetooth low energy (BLE) link or other ways, which is not limited by the embodiments of the present application.

[0199] It can be understood that, in the above embodiments, the link management module can establish the connection with the device A in the way of BLE link, which is not limited by the embodiments of the present application. Figure 5 It should be understood that the steps in the corresponding embodiments are optional, the order between the steps can be exchanged, and the layer, module or unit executed by each step can be replaced by any implementable way, which is not limited.

[0200] The file reading method of the embodiments of the present application is described in detail below through specific examples. The following examples can be combined with each other or implemented independently, and the same or similar concepts or processes can not be described again in some examples.

[0201] Figure 6 A flowchart of a device connection method provided by the embodiments of the present application is shown. The method is applied to an electronic device, such as Figure 6 As shown in the figure, the method comprises the following steps.

[0202] S601, at a first time, the first device requests to establish a communication connection with the second device by using a first connection mode.

[0203] In the embodiments of the present application, the first connection mode request can include the bluetooth socket connection mode in the above-described embodiments, the first device can be understood as Figure 5 the tablet computer in the embodiments, the second device can be understood as Figure 5 device A in the embodiments, and the first time can be understood as any time of performing S501. The first device can request to establish a communication connection with the second device by using the first connection mode in the smart interconnection of the first device. It should be understood that the first device can request to establish a communication connection with the second device or the third device by using the first connection mode every preset time interval.

[0204] In the case where the first device requests to establish a communication connection with the second device by using the first connection mode, S602-S606 can be performed.

[0205] S602, at a second time, the first device and the second device perform a communication connection process based on the first connection mode.

[0206] In the embodiments of the present application, the second time can be understood as any time between performing S502-S504, and the specific implementation of the first device and the second device performing a communication connection process based on the first connection mode can refer to S502-S504 in the foregoing embodiments.

[0207] For example, in the case where the first device and the second device perform a communication connection process based on the first connection mode, the starting time of performing the communication connection process with the second device can be recorded. For example, the starting time can be recorded by a timer or other means, and the specific implementation can refer to S504 in the foregoing embodiments.

[0208] S603, at a third time, the first device requests to establish a communication connection with the third device by using the first connection mode.

[0209] In the embodiments of the present application, the third time can be understood as any time between performing S505-S506, and the second device can be understood as Figure 5The device B in the embodiment, in the case that the first device requests to establish a communication connection with the third device by using the first connection mode, the first device can set the SDP information of the third device, and add the SDP information of the third device into the SDP queue, and the specific implementation manner can refer to S506 in the foregoing embodiment.

[0210] S604, at the fourth time, the first device and the second device continue to perform the communication connection process based on the first connection mode, and the first device does not perform the communication connection process with the third device.

[0211] In the embodiment of the present application, the fourth time can be understood as any time between performing S507-S508 and earlier than the fifth time. Since the first device initiates the establishment of the communication connection with the third device, the user is not aware of the success of the establishment of the communication connection between the first device and the third device, and therefore, the communication connection process with the second device based on the first connection mode can be performed first in the order of the request to establish the communication connection.

[0212] S605, at the fifth time, the first device receives a first operation of the user, the first operation being used to instruct the first device to establish a communication connection with a fourth device, between the first time and the fifth time, the first device continues to perform the communication connection process with the second device, and the first device does not complete the communication connection with the second device, and between the third time and the fifth time, the first device does not perform the communication connection with the third device.

[0213] In the embodiment of the present application, the fifth time can be understood as any time of performing S507, the first operation can be understood as the operation of enabling the Bluetooth connection or dragging the icon in the smart interconnection in the foregoing embodiment, without limitation, and the fourth device can be understood as Figure 5 The earphone in the embodiment. For example, before the first device establishes a communication connection with the fourth device, the first device can perform the communication connection process with the second device, and when the time for the first device to perform the communication connection process with the second device is greater than or equal to the execution threshold, the first device can perform the communication connection process with the fourth device, that is, S606 can be performed.

[0214] S606, at the sixth time, the first device performs the communication connection process with the fourth device by using a second connection mode, the second connection mode being different from the first connection mode, wherein the second time is later than the first time, the third time is later than the second time, the fourth time is later than the third time, the fifth time is later than the fourth time, and at the sixth time, the first device suspends the communication connection process with the second device.

[0215] In the embodiment of the present application, the sixth moment can be understood as any moment between performing S508-S510, and the second connection mode request can include the createbond connection mode in the above embodiment. Since the link management module of the first device can perform the communication connection process in series, the first device suspends the communication connection process between the first device and the second device, and then performs the communication connection process with the fourth device.

[0216] Optionally, based on the embodiment of the above, at the sixth moment, the first device suspends the communication connection process between the first device and the second device, and further adds the service discovery protocol (SDP) information of the second device and the first remaining execution time to the SDP queue; the first remaining execution time includes a difference between the execution time threshold and the first executed time, and the first executed time includes a time used by the first device and the second device to perform the communication connection process between the first moment and the sixth moment; the first device and the second device are removed from the connection task queue; and the first device and the third device are added to the connection task queue. Figure 6 In the embodiment of the present application, the execution time threshold can refer to the description of the first threshold in the above embodiment, the first remaining execution time and the first executed time can refer to the description in the above embodiment, and the specific implementation of adding the service discovery protocol (SDP) information of the second device and the first remaining execution time to the SDP queue can refer to S510 in the above embodiment. The specific implementation of adding the first device and the third device to the connection task queue can also refer to S510 in the above embodiment, and the removal of the first device and the second device from the connection task queue can refer to S509 in the above embodiment, and details are not repeated.

[0217] Optionally, at the second moment, the first device and the second device perform the communication connection process based on the first connection mode, and further add the SDP information of the second device to the SDP queue and add the first device and the second device to the connection task queue; at the third moment, after the first device requests to establish the communication connection with the third device using the first connection mode, the first device further adds the SDP information of the third device to the SDP queue; and at the fifth moment, after the first device receives the first operation of the user, the first device further adds the first device and the fourth device to the connection task queue.

[0218]

[0219] ​In the embodiments of the present application, the specific implementation of adding the SDP information of the second device to the SDP queue can refer to S502 in the foregoing embodiments, the specific implementation of adding the establishment of the communication connection between the first device and the second device to the connection task queue can refer to S503 in the foregoing embodiments, the specific implementation of adding the SDP information of the third device to the SDP queue after the first device requests to establish the communication connection with the third device by using the first connection mode can refer to S506 in the foregoing embodiments, and the specific implementation of adding the establishment of the communication connection between the first device and the fourth device to the connection task queue after the first device receives the first operation of the user can refer to S508 in the foregoing embodiments.

[0220] Optionally, after adding the establishment of the communication connection between the first device and the fourth device to the connection task queue, the method further includes: determining whether the time used by the first device and the second device to perform the communication connection process based on the first connection mode is greater than an execution threshold; if the time used is greater than or equal to the execution threshold, the first device performs the communication connection process with the fourth device by using the second connection mode; and if the time used is less than the execution threshold, the first device continues to perform the communication connection process with the second device until the time used is greater than or equal to the execution threshold, the first device performs the communication connection process with the fourth device by using the second connection mode, and the first device suspends the communication connection process between the first device and the second device.

[0221] In the embodiments of the present application, the execution threshold can be understood as the third threshold in the foregoing embodiments.

[0222] Optionally, the time used by the first device and the second device to perform the communication connection process based on the first connection mode can be determined according to the start time of the communication connection process recorded in S504, and the specific implementation can refer to S508 in the foregoing embodiments.

[0223] Optionally, at the seventh moment, the first device and the fourth device successfully establish the communication connection; at the eighth moment, the first device and the third device perform the communication connection process based on the first connection mode; at the ninth moment, the first device and the third device successfully perform the communication connection process or time out; and at the tenth moment, the first device and the second device perform the communication connection process, wherein the seventh moment is later than the sixth moment, the eighth moment is later than the seventh moment, the ninth moment is later than the eighth moment, and the tenth moment is later than the ninth moment.

[0224] Between the eighth moment and the ninth moment, the first device continues to perform the communication connection process with the third device, and the first device does not complete the communication connection with the third device; between the seventh moment and the ninth moment, the first device does not perform the communication connection with the second device; and the ninth moment, the first device and the second device are established to establish a communication connection, and the first remaining execution time is added to the connection task queue.

[0225] In the embodiments of the present application, the seventh moment can be understood as any moment between performing S511-S512, the eighth moment can be understood as any moment of performing S512, the ninth moment can be understood as any moment of performing S513, and the tenth moment can be understood as any moment of performing S514-S516.

[0226] In the embodiments of the present application, the first device and the fourth device successfully establishing a communication connection means that the system Bluetooth of the first device successfully informs the smart interconnection of the first device that the communication connection with the fourth device is successfully established. In the case that the first device and the third device successfully perform the communication connection process or timeout, the first device can re-perform the communication connection process with the second device.

[0227] It should be understood that in the case that the first device and the second device perform the communication connection process, the starting time of the communication connection process performed by the first device and the second device can be recorded, for example, the starting time can be recorded by a timer or other means. The specific implementation can refer to S504 in the foregoing embodiments, which will not be described here.

[0228] Optionally, at the tenth moment, the time used by the first device and the second device to perform the communication connection process is less than or equal to the first remaining execution time.

[0229] In the embodiments of the present application, the maximum time used by the first device and the second device to perform the communication connection process can be less than or equal to the first remaining execution time. If it is greater than the first remaining execution time, the first device and the second device cannot perform the communication connection process.

[0230] Optionally, at the eleventh moment, the first device receives a second operation of a user, the second operation is used to instruct the first device to establish a communication connection with a fifth device, and the first operation and the second operation can be the same or different; at the twelfth moment, the first device performs the communication connection process with the fifth device by using a second connection mode; at the thirteenth moment, the first device and the fifth device successfully establish a connection; and at the fourteenth moment, the first device and the second device continue to perform the communication connection process based on the first connection mode.

[0231] The eleventh moment is later than the tenth moment, the twelfth moment is later than the eleventh moment, the thirteenth moment is later than the twelfth moment, and the fourteenth moment is later than the thirteenth moment. At the twelfth moment, the first device suspends the communication connection process between the first device and the second device.

[0232] In the embodiments of the present application, the eleventh moment can be understood as any moment of performing S515, the twelfth moment can be understood as any moment between performing S516-S519, the thirteenth moment can be understood as any moment of performing the first part of the method in S520, the first part of the method can include: the tablet computer successfully establishes a connection with the car machine, the link management module informs the three-party application that the connection with the car machine is successfully established, and removes the task of establishing a connection with the car machine from the connection task queue, the fourteenth moment can be understood as any moment of performing the second part of the method in S520, the second part of the method can include: initiating a connection with the device A, and recording the starting time of initiating the connection with the device A, and the optional method after S520.

[0233] In the embodiments of the present application, the second operation can include enabling a Bluetooth connection, etc., and the fifth device can be understood as Figure 5 It should be understood that, before the twelfth moment, the car machine in the embodiments can also: determine whether the time used by the first device and the second device to perform the communication connection process based on the first connection mode is greater than an execution threshold; if the time used is greater than or equal to the execution threshold, the first device performs the communication connection process with the fifth device using the second connection mode; if the time used is less than the execution threshold, the first device continues to perform the communication connection process with the second device until the time used is greater than or equal to the execution threshold, the first device performs the communication connection process with the fifth device using the second connection mode, and the first device suspends the communication connection process between the first device and the second device.

[0234] Optionally, at the twelfth moment, the first device suspends the communication connection process between the first device and the second device, which can: add the SDP information of the second device and the second remaining execution time to the SDP queue, the second remaining execution time including: the difference between the first remaining execution time and the second executed time, and the second executed time including: the time used by the first device and the second device to perform the communication connection process between the ninth moment and the twelfth moment; remove the establishment of the communication connection between the first device and the second device from the connection task queue; and add the establishment of the communication connection between the first device and the second device and the second remaining execution time to the connection task queue.

[0235] Optionally, at the fourteenth moment, the time used by the first device and the second device to continue to perform the communication connection process based on the first connection mode is less than or equal to the second remaining execution time.

[0236] In the embodiments of the present application, the second remaining execution time and the second executed time can refer to the descriptions in the foregoing embodiments, the specific implementation of adding the SDP information of the second device and the second remaining execution time to the SDP queue can refer to S518 in the foregoing embodiments, the specific implementation of removing the establishment of the communication connection between the first device and the second device from the connection task queue can refer to S517 in the foregoing embodiments, and the specific implementation of adding the establishment of the communication connection between the first device and the second device and the second remaining execution time to the connection task queue can refer to S518 in the foregoing embodiments.

[0237] The embodiments of the present application and the foregoing embodiments have the same technical effects, and the descriptions in the foregoing embodiments can be referred to, and details are not repeated here.

[0238] It should be noted that the module names involved in the embodiments of the present application can be defined as other names, as long as the functions of the modules can be realized, and the names of the modules are not limited specifically.

[0239] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) involved in the embodiments of 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 select authorization or refusal.

[0240] The above mainly introduces the scheme provided by the embodiments of the present application from the perspective of method. In order to realize the above functions, it contains the hardware structure and / or software module corresponding to the execution of each function. Those skilled in the art should easily realize that, in combination with the method steps of each example described in the embodiments disclosed in the present text, the present application can be realized in the form of hardware or combination of hardware and computer software. Whether a certain function is executed in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical scheme. Professional technicians can use different methods to realize the described functions for each specific application, but such implementation should not be considered beyond the scope of the present application.

[0241] The embodiments of the present application can divide the functions of the device for realizing the method according to the method examples described above into function modules, Figure 7 A schematic diagram block diagram of a device connection apparatus provided by the embodiments of the present application is shown in FIG. 8. Referring to FIG. 8, Figure 7The device connection apparatus 700 includes a processor 701, a communication interface 702, and a memory 703. The processor 701, the communication interface 702, and the memory 703 communicate with each other through an internal connection path. The memory 703 is configured to store instructions, and the processor 701 is configured to execute the instructions stored in the memory 703. The communication interface 702 can be configured to send signals to other devices (for example, the processor 701 or a touch screen of an electronic device) and receive signals from other devices (for example, the memory 703). For example, the communication interface 702 reads instructions stored in the memory 703 and sends the instructions to the processor 701.

[0242] It should be understood that the device 700 can be embodied as an electronic device in the above-described embodiments, and can be configured to perform each step and / or process corresponding to the electronic device in the above-described method embodiments. Optionally, the memory 703 can include a read-only memory and a random access memory, and provide instructions and data for the processor. A portion of the memory can also include a non-volatile random access memory. For example, the memory can also store device type information. The processor 701 can be configured to execute instructions stored in the memory, and when the processor 701 executes the instructions stored in the memory, the processor 701 is configured to perform each step and / or process of the above-described method embodiments.

[0243] It should be understood that, in the embodiments of the present application, the processor can be a central processing unit (CPU), and the processor can also be other general-purpose processors, digital signal processors (DSPs), application specific integrated circuits (ASICs), field programmable gate arrays (FPGAs) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor.

[0244] In the implementation process, the steps of the above method can be completed by the integrated logic circuit of hardware in the processor or the instructions in the form of software. The steps of the method disclosed in combination with the embodiments of the present application can be directly embodied as hardware processor execution completion, or executed by a combination of hardware and software modules in the processor. The software module can be located in a mature storage medium in the art such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, register, etc. The storage medium is located in the memory, and the processor executes the instructions in the memory, and combines the hardware to complete the steps of the above method. To avoid repetition, it will not be described in detail here.

[0245] The device connection method provided by the embodiments of the present application can be applied to electronic devices with communication functions. The electronic device includes a terminal device, and the specific device form of the terminal device can refer to the above related description, which will not be described here.

[0246] The embodiments of the present application provide a terminal device, which includes: a processor and a memory; the memory stores computer execution instructions; and the processor executes the computer execution instructions stored in the memory, so that the terminal device executes the above method.

[0247] The embodiments of the present application provide a chip. The chip includes a processor, which is used to call a computer program in a memory to execute the technical solutions in the above embodiments. The implementation principle and technical effects are similar to those of the above related embodiments, which will not be described here.

[0248] The embodiments of the present application also provide a computer readable storage medium. The computer readable storage medium stores a computer program. The computer program is executed by the processor to implement the above method. The method described in the above embodiments can be realized by software, hardware, firmware or any combination thereof, in whole or in part. If realized in software, the functions can be stored as one or more instructions or codes on a computer readable medium or transmitted on a computer readable medium. The computer readable medium can include computer storage medium and communication medium, and can also include any medium that can transfer computer programs from one place to another. The storage medium can be any target medium accessible by a computer.

[0249] In a possible implementation, the computer readable medium can include a RAM, a ROM, a compact disc read-only memory (CD-ROM) or other optical disk storage, magnetic disk storage or other magnetic storage devices, or any other medium that is suitable for storing desired program code in the form of instructions or data structures and that can be accessed by a computer. Also, any connection is properly termed a computer readable medium. For example, if the software is transmitted from a website, server, or other remote source using a coaxial cable, fiber optic cable, twisted pair, digital subscriber line (DSL), or wireless technologies such as infrared, radio, and microwave, then the coaxial cable, fiber optic cable, twisted pair, DSL, or wireless technologies such as infrared, radio, and microwave are included in the definition of medium. Disk and disc, as used herein, include compact disc (CD), laser disc, optical disc, digital versatile disc (DVD), floppy disk, and Blu-ray® disc where disks usually reproduce data magnetically, while discs reproduce data optically with lasers. Combinations of the above should also be included within the scope of computer readable media.

[0250] The embodiment of the present application provides a computer program product, which comprises a computer program, and when the computer program is executed, the computer executes the above method.

[0251] The embodiment of the present application is described with reference to flowcharts and / or block diagrams of the method, device (system), and computer program product according to the embodiment of the present application. It should be understood that each flow and / or block in the flowcharts and / or block diagrams, and the combination of the flows and / or blocks in the flowcharts and / or block diagrams can be implemented by computer program instructions. These computer program instructions can be provided to a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing devices to produce a machine, so that the instructions executed by the computer or other programmable data processing devices generate a device for implementing the functions specified in the flowcharts and / or block diagrams. Figure 1 The device for implementing the functions specified in one flow or multiple flows and / or one block or multiple blocks. Figure 1 The device for implementing the functions specified in one flow or multiple flows and / or one block or multiple blocks.

[0252] The above detailed description further describes the purpose, technical scheme, and beneficial effects of the present application. It should be understood that the above is only a specific embodiment of the present application, and is not used to limit the protection scope of the present application. Any modification, equivalent replacement, improvement, etc. made on the basis of the technical scheme of the present application should be included in the protection scope of the present application.

Claims

1. A device connection method characterized by, The method comprises: a first time, a first device requests to establish a communication connection with a second device by using a first connection mode; a second time, the first device and the second device perform a communication connection process based on the first connection mode; a third time, the first device requests to establish a communication connection with a third device by using the first connection mode; a fourth time, the first device and the second device continue to perform the communication connection process based on the first connection mode, and the first device does not perform the communication connection process with the third device; a fifth time, the first device receives a first operation of a user, and the first operation is used to instruct the first device to establish a communication connection with a fourth device; a sixth time, the first device performs a communication connection process with the fourth device by using a second connection mode, and the second connection mode is different from the first connection mode; wherein the second time is later than the first time, the third time is later than the second time, the fourth time is later than the third time, and the fifth time is later than the fourth time; between the first time and the fifth time, the first device continuously performs the communication connection process with the second device, and the first device does not complete the communication connection with the second device; between the third time and the fifth time, the first device does not perform the communication connection with the third device; at the sixth time, the first device suspends the communication connection process between the first device and the second device.

2. The method of claim 1, wherein, At the sixth time, the first device suspends the communication connection process between the first device and the second device, which comprises: adding service discovery protocol (SDP) information of the second device and a first remaining execution time to an SDP queue, wherein the first remaining execution time comprises a difference between an execution time threshold and a first executed time, and the first executed time comprises a time used by the first device to perform the communication connection process with the second device between the first time and the sixth time; removing the establishment of the communication connection between the first device and the second device from a connection task queue; and adding the establishment of the communication connection between the first device and the third device to the connection task queue.

3. The method of claim 2, wherein, At the second time, the first device and the second device perform the communication connection process based on the first connection mode, which comprises adding SDP information of the second device to the SDP queue and adding the establishment of the communication connection between the first device and the second device to the connection task queue. At the third time, after the first device requests to establish the communication connection with the third device by using the first connection mode, the method comprises adding SDP information of the third device to the SDP queue. At the fifth time, after the first device receives the first operation of the user, the method further comprises adding the establishment of the communication connection between the first device and the fourth device to the connection task queue.

4. The method of claim 3, wherein, After the first device and the fourth device are added to the connection task queue, the method further comprises: determining whether a time used by the first device and the second device to perform the communication connection process based on the first connection mode is greater than an execution threshold value; If the time used is greater than or equal to the execution threshold value, the first device performs the communication connection process with the fourth device by using a second connection mode; If the time used is less than the execution threshold value, the first device continues to perform the communication connection process with the second device until the time used is greater than or equal to the execution threshold value, the first device performs the communication connection process with the fourth device by using the second connection mode, and the first device suspends the communication connection process between the first device and the second device.

5. The method according to any one of claims 2-4, characterized in that, The method further comprises: At a seventh time, the first device and the fourth device successfully establish a communication connection; At an eighth time, the first device and the third device perform a communication connection process based on the first connection mode; At a ninth time, the first device and the third device successfully perform the communication connection process or time out; At a tenth time, the first device and the second device perform the communication connection process; The seventh time is later than the sixth time, the eighth time is later than the seventh time, the ninth time is later than the eighth time, and the tenth time is later than the ninth time; Between the eighth time and the ninth time, the first device continues to perform the communication connection process with the third device, and the first device does not complete the communication connection with the third device; Between the seventh time and the ninth time, the first device does not perform the communication connection with the second device; At the ninth time, the first device and the second device establish a communication connection, and the first remaining execution time are added to the connection task queue.

6. The method of claim 5, wherein, At the tenth time, the time used by the first device and the second device to perform the communication connection process is less than or equal to the first remaining execution time.

7. The method according to any of claims 5-6, characterized by, The method further comprises: At an eleventh time, the first device receives a second operation of a user, and the second operation is used to instruct the first device to establish a communication connection with a fifth device, and the first operation and the second operation can be the same or different; At a twelfth time, the first device performs a communication connection process with the fifth device by using a second connection mode; At a thirteenth time, the first device successfully establishes a connection with the fifth device; At a fourteenth time, the first device continues to perform a communication connection process with the second device based on the first connection mode; The eleventh time is later than the tenth time, the twelfth time is later than the eleventh time, the thirteenth time is later than the twelfth time, and the fourteenth time is later than the thirteenth time; At the twelfth time, the first device suspends the communication connection process between the first device and the second device.

8. The method of claim 7, wherein, At the twelfth time, the first device suspends the communication connection process between the first device and the second device, which comprises: adding the SDP information of the second device and a second remaining execution time to the SDP queue, the second remaining execution time comprising a difference between the first remaining execution time and a second executed time, the second executed time comprising a time used by the first device and the second device to perform the communication connection procedure between the ninth time and the twelfth time; removing the first device and the second device from the connection task queue after the first device and the second device establish the communication connection; adding the first device and the second device establishing the communication connection and the second remaining execution time to the connection task queue.

9. The method of claim 8, wherein, the time used by the first device and the second device to continue performing the communication connection procedure based on the first connection mode at the fourteenth time is less than or equal to the second remaining execution time.

10. An electronic device, comprising: comprising: a processor and a memory; the memory stores computer-executed instructions; the processor executes the computer-executed instructions stored in the memory, so that the electronic device executes the method in any one of claims 1-9.

11. A computer-readable storage medium storing a computer program, wherein the computer program comprises the following steps of: the computer program is executed by the processor to implement the method in any one of claims 1-9.

12. A chip system, characterized by comprising at least one processor and a communication interface, the communication interface and the at least one processor are interconnected by a line, the at least one processor is used to run a computer program or instructions to execute the method in any one of claims 1-9.

13. A computer program product, characterised in that, comprising a computer program, when the computer program is executed, so that the computer executes the method in any one of claims 1-9.

Citation Information

Patent Citations

  • Ue with multiple subscriber identity modules with improved pause / resume operation

    CN115361673A

  • Bluetooth connection method and device and readable storage medium

    CN117580192A