Method for establishing Bluetooth connection and electronic equipment

By prioritizing the high-priority Bluetooth connection request in the phone, pausing the established second Bluetooth connection problem, solving the problem of slow Bluetooth connection speed and low user experience, achieving faster and more efficient Bluetooth connection.

CN119997043APending Publication Date: 2025-05-13HONOR DEVICE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311455312.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-11-02
Publication Date
2025-05-13

AI Technical Summary

Technical Problem

In the prior art, establishing a Bluetooth connection between a mobile phone and a wireless headset is slow and has low efficiency, resulting in a long wait time for users and a low user experience.

Method used

When obtaining a connection request to establish the first Bluetooth connection, if a second Bluetooth connection is being established, the first connection request is processed first, and the second connection request is suspended so that the first Bluetooth connection is immediately established.

Benefits of technology

By prioritizing the processing of high-priority Bluetooth connection requests, users' waiting time is reduced, the speed and efficiency of Bluetooth connections are improved, and the user experience is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119997043A_ABST
    Figure CN119997043A_ABST
Patent Text Reader

Abstract

The invention provides a method for establishing Bluetooth connection and electronic equipment. The method comprises the following steps: when a first connection request is obtained, if Bluetooth connection is being established according to a second connection request at the moment, under the condition that the timeliness priority of the first connection request is higher than the timeliness priority of the second connection request, the establishment of the second Bluetooth connection can be suspended firstly; then, first Bluetooth connection between the electronic equipment and the first external equipment can be established immediately according to the first connection request, and the second connection request is used for establishing second Bluetooth connection between the electronic equipment and the second external equipment; thus, the first Bluetooth connection can be established according to the first connection request without waiting for timeout of the process of processing the second connection request, the effect of establishing the first Bluetooth connection according to the first connection request as soon as possible is achieved, the waiting time for the first connection request can be shortened, the speed of establishing the first Bluetooth connection can be remarkably improved, and the user experience is improved. The waiting time of a user can be shortened, and the user experience can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of wireless communication technology, and in particular to a method and electronic device for establishing a Bluetooth connection. Background Art

[0002] With the rapid development of wireless communication technology, mobile phones can establish Bluetooth connections with wireless headsets through Bluetooth technology and exchange data based on the Bluetooth connection.

[0003] For example, the user may input an operation to turn on the Bluetooth function on the mobile phone, and the mobile phone turns on the Bluetooth function of the mobile phone in response to the operation input by the user. Afterwards, the user may input an operation to establish a Bluetooth connection between the mobile phone and the wireless headset on the mobile phone, and the mobile phone may establish a Bluetooth connection between the mobile phone and the wireless headset in response to the operation input by the user.

[0004] However, establishing a Bluetooth connection between a mobile phone and a wireless headset is slow and inefficient, resulting in long user waiting times and poor user experience. Summary of the invention

[0005] In order to solve the above technical problems, the present application provides a method and electronic device for establishing a Bluetooth connection. In the present application, when a first connection request for establishing a first Bluetooth connection is obtained, if a Bluetooth connection is being established according to a second connection request at this time, then when the timeliness priority of the first connection request is higher than the timeliness priority of the second connection request, the establishment of the second Bluetooth connection according to the second connection request can be suspended first, and then the first Bluetooth connection can be established immediately according to the first connection request, the first connection request is used to establish a first Bluetooth connection between the electronic device and the first external device, and the second connection request is used to establish a second Bluetooth connection between the electronic device and the second external device; in this way, the first Bluetooth connection can be established according to the first connection request without waiting for the process of processing the second connection request to time out, which plays the role of establishing the first Bluetooth connection according to the first connection request as soon as possible, so that the waiting time for the first connection request can be reduced, the speed of establishing the first Bluetooth connection can be significantly improved, the waiting time of the user can be reduced, and the user experience can be improved.

[0006] In a first aspect, the present application provides a method for establishing a Bluetooth connection, which is applied to an electronic device, and the method includes:

[0007] Acquire a first connection request, where the first connection request is used to establish a first Bluetooth connection between the electronic device and a first external device;

[0008] detecting whether a second Bluetooth connection is being established according to a second connection request; wherein the second establishment request is used to establish the second Bluetooth connection between the electronic device and a second external device;

[0009] In the case that the second Bluetooth connection is being established according to the second connection request, obtaining the timeliness priority of the first connection request, and obtaining the timeliness priority of the second connection request;

[0010] comparing the timeliness priority of the first connection request with the timeliness priority of the second connection request;

[0011] When the timeliness priority of the first connection request is higher than the timeliness priority of the second connection request, the step of establishing the second Bluetooth connection according to the second connection request is interrupted, and the first Bluetooth connection is established according to the first connection request.

[0012] Through the present application, when a first connection request for establishing a first Bluetooth connection is obtained, if a Bluetooth connection is being established according to a second connection request at this time, then when the timeliness priority of the first connection request is higher than the timeliness priority of the second connection request, it can be explained that the user's requirement for the real-time performance of the first Bluetooth connection is often greater than the requirement for the real-time performance of the second Bluetooth connection. For this reason, the establishment of the second Bluetooth connection according to the second connection request can be paused first, and then the first Bluetooth connection can be established immediately according to the first connection request. In this way, the waiting time for the first connection request can be reduced. That is, after obtaining the first connection request, the first Bluetooth connection can be established according to the first connection request without waiting for the process of processing the second connection request to time out, which plays the role of establishing the first Bluetooth connection according to the first connection request as soon as possible, can significantly improve the speed of establishing the first Bluetooth connection, can improve the timeliness of establishing the first Bluetooth connection as much as possible, can reduce the user's waiting time, and can improve the user experience.

[0013] In an optional implementation, the connection request includes: a manually triggered connection request, a service automatically triggered connection request, and a connection request other than a manually triggered connection request and a service automatically triggered connection request;

[0014] The obtaining the timeliness priority of the first connection request includes:

[0015] In response to the first connection request being a manually triggered connection request, determining that the timeliness priority of the first connection request is a high priority;

[0016] or,

[0017] In response to the first connection request being a connection request automatically triggered by a service, determining that the timeliness priority of the first connection request is a medium priority;

[0018] or,

[0019] In response to the first connection request being a connection request other than a manually triggered connection request and a service automatically triggered connection request, determining that the timeliness priority of the first connection request is a low priority.

[0020] The manually triggered connection request is often the connection request that the user pays the most attention to, and its timeliness priority is often higher than the connection request automatically triggered by the service. The connection requests other than the manually triggered connection request and the connection request automatically triggered by the service are often the connection requests that the user does not pay much attention to. Thus, the timeliness priority of the connection requests other than the manually triggered connection request and the connection request automatically triggered by the service is often lower than the timeliness priority of the connection request automatically triggered by the service. Thus, by determining the timeliness priority of the first connection request and the timeliness priority of the second connection request in the above manner, the accuracy of the determined timeliness priority of the first connection request and the timeliness priority of the second connection request can be improved.

[0021] In an optional implementation, the comparing the timeliness priority of the first connection request with the timeliness priority of the second connection request includes:

[0022] In the case that the timeliness priority of the first connection request is high priority and the timeliness priority of the second connection request is high priority, since the second connection request is obtained by the electronic device before obtaining the first connection request, that is, the time when the electronic device obtains the first connection request is later than the time when the electronic device obtains the second connection request, in the present application, the timeliness requirement for the connection request that is obtained later is higher. Therefore, the timeliness requirement for the first connection request is often higher than the timeliness requirement for the second connection request. In this way, it can be determined that the timeliness priority of the first connection request is higher than the timeliness priority of the second connection request.

[0023] or,

[0024] In the case that the timeliness priority of the first connection request is medium priority and the timeliness priority of the second connection request is medium priority, since the second connection request is obtained by the electronic device before obtaining the first connection request, that is, the time when the electronic device obtains the first connection request is later than the time when the electronic device obtains the second connection request, in the present application, the timeliness requirement for the connection request that is obtained later is higher. Therefore, the timeliness requirement for the first connection request is often higher than the timeliness requirement for the second connection request. In this way, it can be determined that the timeliness priority of the first connection request is higher than the timeliness priority of the second connection request.

[0025] or,

[0026] In the case that the timeliness priority of the first connection request is low priority and the timeliness priority of the second connection request is low priority, since the second connection request is obtained by the electronic device before obtaining the first connection request, that is, the time when the electronic device obtains the first connection request is later than the time when the electronic device obtains the second connection request, in the present application, the timeliness requirement for the connection request that is obtained later is higher. Therefore, the timeliness requirement for the first connection request is often higher than the timeliness requirement for the second connection request. In this way, it can be determined that the timeliness priority of the first connection request is higher than the timeliness priority of the second connection request.

[0027] In an optional implementation, after obtaining the timeliness priority of the first connection request, the method further includes:

[0028] According to the timeliness priority of the first connection request, the first connection request is stored in a request queue, and the request queue is used to store connection requests, so as to record that the first connection request needs to be processed but has not been processed yet.

[0029] In an optional implementation, the method further includes:

[0030] After the first Bluetooth connection is successfully established according to the first connection request, the first connection request is deleted from the request queue. In this way, the electronic device can be prevented from extracting the first connection request from the request queue again, thereby preventing the electronic device from repeatedly processing the first connection request, that is, avoiding the attempt to establish the first Bluetooth connection between the electronic device and the first external device again according to the first connection request when the first Bluetooth connection between the electronic device and the first external device has been successfully established according to the first connection request, thereby saving system resources of the electronic device.

[0031] In an optional implementation, before interrupting the step of establishing the second Bluetooth connection according to the second connection request, the step further includes:

[0032] Detecting whether the first connection request is at the first position in the request queue;

[0033] When the first connection request is at the first position in the request queue, the step of establishing the second Bluetooth connection according to the second connection request is interrupted.

[0034] In this way, after interrupting the step of establishing a second Bluetooth connection between the electronic device and the second external device according to the second connection request, the processing request at the top of the request queue is processed first, so that the connection request with the highest time priority can be processed first, so as to further improve the timeliness of processing the connection request.

[0035] In an optional implementation, the timeliness priority of the first connection request is a high priority;

[0036] The storing the first connection request in a request queue according to the timeliness priority of the first connection request includes:

[0037] The first connection request is stored in the request queue at a position before all the connection requests, so that the first connection request is located at the first position in the request queue.

[0038] In an optional implementation, the timeliness priority of the first connection request is medium priority;

[0039] The storing the first connection request in a request queue according to the timeliness priority of the first connection request includes:

[0040] In the case where there are medium-priority connection requests in the request queue, in the request queue, a position that is before the connection request ranked first in sequence among the medium priority and adjacent to the connection request ranked first in sequence is determined; the first connection request is stored in the determined position; and the first connection request is made to be the connection request ranked first in sequence among all medium-priority connection requests in the request queue.

[0041] or,

[0042] In the case where there is no medium-priority connection request in the request queue, if there is no high-priority connection request in the request queue, the first connection request is stored in a position before all the connection requests in the request queue, so that the first connection request is located at the first position in the request queue; or, if there is a high-priority connection request in the request queue, in the request queue, a position after the last connection request in the high-priority order and adjacent to the last connection request is determined, and the first connection request is stored in the determined position, so that the first connection request is located after all the high-priority connection requests in the request queue.

[0043] When the electronic device obtains the first connection request, the electronic device is establishing a second Bluetooth connection between the electronic device and the second external device according to the second connection request. At this time, the second Bluetooth connection between the electronic device and the second external device may be successfully established. In this case, if the step of establishing the second Bluetooth connection between the electronic device and the second external device according to the second connection request is interrupted immediately, the second Bluetooth connection between the electronic device and the second external device will not be successfully established. That is, for "establishing the second Bluetooth connection between the electronic device and the second external device", it will fail, and the process that has been executed in the process of "establishing the second Bluetooth connection between the electronic device and the second external device" is no longer valid, and the system resources consumed will become silent costs. In the case of needing to retry to establish the second Bluetooth connection between the electronic device and the second external device according to the second connection request, the process that has been executed in the aforementioned process of "establishing the second Bluetooth connection between the electronic device and the second external device" needs to be re-executed, wasting system resources in vain.

[0044] Therefore, in an optional implementation, the method further includes:

[0045] In the case where the timeliness priority of the first connection request is higher than the timeliness priority of the second connection request, detecting whether the second Bluetooth connection is successfully established within a preset time length starting from a starting time; the preset time length is less than a default connection timeout length; the starting time includes: a detection time when detecting whether the second Bluetooth connection is being established according to the second connection request;

[0046] If the second Bluetooth connection is not successfully established within the preset time period starting from the starting moment, the step of establishing the second Bluetooth connection according to the second connection request is interrupted, thereby avoiding wasting of the consumed system resources.

[0047] or,

[0048] If the second Bluetooth connection is successfully established within the preset time period starting from the starting time, it can be explained that the step of establishing the second Bluetooth connection between the electronic device and the second external device according to the second connection request has been completed. In this case, there is no need to interrupt the step of establishing the second Bluetooth connection between the electronic device and the second external device according to the second connection request. At this time, the first Bluetooth connection between the electronic device and the first external device can be directly established according to the first connection request.

[0049] In an optional implementation, the second connection request is located in a request queue, and the request queue is used to store connection requests;

[0050] The method further comprises:

[0051] If the second Bluetooth connection is successfully established within the preset time period starting from the starting time, the second connection request is deleted from the request queue.

[0052] In this way, the electronic device can be prevented from extracting the second connection request from the request queue again, thereby avoiding the electronic device from repeatedly processing the second connection request. That is, when the second Bluetooth connection between the electronic device and the second external device has been successfully established according to the second connection request, it is avoided to try again to establish the second Bluetooth connection between the electronic device and the second external device according to the second connection request, thereby saving system resources of the electronic device.

[0053] In an optional implementation, the second connection request is located in a request queue, and the request queue is used to store connection requests;

[0054] The method further comprises:

[0055] After interrupting the step of establishing the second Bluetooth connection according to the second connection request, detecting whether the number of times the second connection request is processed is greater than or equal to a preset number;

[0056] When the number of times the second connection request is processed is greater than or equal to the preset number of times, it is very likely that the external device involved in the second connection request does not have the objective conditions for establishing a Bluetooth connection with the electronic device, and therefore, the second connection request can be deleted from the request queue. In this way, the electronic device can be prevented from extracting the second connection request from the request queue again, and the Bluetooth connection with the second external device can no longer be established according to the second connection request, that is, avoiding another attempt to establish the second Bluetooth connection between the electronic device and the second external device according to the second connection request, so as to save system resources of the electronic device.

[0057] In an optional implementation, after interrupting the step of establishing the second Bluetooth connection according to the second connection request, the method further includes:

[0058] The first interface includes a first prompt message, wherein the first prompt message is used to prompt that the establishment of the second Bluetooth connection has been interrupted, so that the user can know from the first prompt message that the electronic device has interrupted the second Bluetooth connection between the electronic device and the second external device established according to the second connection request.

[0059] In an optional implementation, after establishing the first Bluetooth connection according to the first connection request, the method further includes:

[0060] The second interface is displayed, wherein the second interface includes second prompt information, and the second prompt information is used to prompt that the first Bluetooth connection is being established, so that the user can know that the electronic device is establishing the first Bluetooth connection between the electronic device and the first external device according to the second prompt information.

[0061] In an optional implementation, the method further includes:

[0062] When the first Bluetooth connection is successfully established, a third interface is displayed, wherein the third interface includes third prompt information, and the third prompt information is used to prompt that the first Bluetooth connection has been successfully established, so that the user can know that the electronic device has successfully established the first Bluetooth connection between the electronic device and the first external device according to the third prompt information.

[0063] In a second aspect, the present application provides an electronic device, the electronic device comprising:

[0064] One or more processors, memory;

[0065] and one or more computer programs, wherein the one or more computer programs are stored in the memory, and when the computer programs are executed by the one or more processors, the electronic device performs the following steps:

[0066] Acquire a first connection request, where the first connection request is used to establish a first Bluetooth connection between the electronic device and a first external device;

[0067] detecting whether a second Bluetooth connection is being established according to a second connection request; wherein the second establishment request is used to establish the second Bluetooth connection between the electronic device and a second external device;

[0068] In the case that the second Bluetooth connection is being established according to the second connection request, obtaining the timeliness priority of the first connection request, and obtaining the timeliness priority of the second connection request;

[0069] comparing the timeliness priority of the first connection request with the timeliness priority of the second connection request;

[0070] When the timeliness priority of the first connection request is higher than the timeliness priority of the second connection request, the step of establishing the second Bluetooth connection according to the second connection request is interrupted, and the first Bluetooth connection is established according to the first connection request.

[0071] In an optional implementation, the connection request includes: a manually triggered connection request, a service automatically triggered connection request, and a connection request other than a manually triggered connection request and a service automatically triggered connection request; when the program instructions are executed by the processor, the electronic device performs the following steps:

[0072] In response to the first connection request being a manually triggered connection request, determining that the timeliness priority of the first connection request is a high priority;

[0073] or,

[0074] In response to the first connection request being a connection request automatically triggered by a service, determining that the timeliness priority of the first connection request is a medium priority;

[0075] or,

[0076] In response to the first connection request being a connection request other than a manually triggered connection request and a service automatically triggered connection request, determining that the timeliness priority of the first connection request is a low priority.

[0077] In an optional implementation, when the program instructions are executed by the processor, the electronic device performs the following steps:

[0078] In a case where the timeliness priority of the first connection request is a high priority and the timeliness priority of the second connection request is a high priority, determining that the timeliness priority of the first connection request is higher than the timeliness priority of the second connection request;

[0079] or,

[0080] When the timeliness priority of the first connection request is medium priority and the timeliness priority of the second connection request is medium priority, determining that the timeliness priority of the first connection request is higher than the timeliness priority of the second connection request;

[0081] or,

[0082] In the case where the timeliness priority of the first connection request is a low priority and the timeliness priority of the second connection request is a low priority, it is determined that the timeliness priority of the first connection request is higher than the timeliness priority of the second connection request.

[0083] In an optional implementation, when the program instructions are executed by the processor, the electronic device performs the following steps:

[0084] After acquiring the timeliness priority of the first connection request, the first connection request is stored in a request queue according to the timeliness priority of the first connection request, and the request queue is used to store connection requests.

[0085] In an optional implementation, when the program instructions are executed by the processor, the electronic device performs the following steps:

[0086] After the first Bluetooth connection is successfully established according to the first connection request, the first connection request is deleted from the request queue.

[0087] In an optional implementation, when the program instructions are executed by the processor, the electronic device performs the following steps:

[0088] Before interrupting the step of establishing the second Bluetooth connection according to the second connection request, detecting whether the first connection request is at the first position in the request queue;

[0089] When the first connection request is at the first position in the request queue, the step of establishing the second Bluetooth connection according to the second connection request is interrupted.

[0090] In an optional implementation, the timeliness priority of the first connection request is a high priority; when the program instruction is executed by the processor, the electronic device executes the following steps:

[0091] The first connection request is stored at a position in the request queue that is located before all the connection requests.

[0092] In an optional implementation, the timeliness priority of the first connection request is a medium priority; when the program instruction is executed by the processor, the electronic device executes the following steps:

[0093] In the case where there is a connection request of medium priority in the request queue, determining a position in the request queue that is before the connection request ranked first in the medium priority and adjacent to the connection request ranked first in the sequence; and storing the first connection request at the determined position;

[0094] or,

[0095] In the case where there is no medium-priority connection request in the request queue, if there is no high-priority connection request in the request queue, the first connection request is stored in a position before all the connection requests in the request queue; or, if there is a high-priority connection request in the request queue, in the request queue, a position after the last connection request in the high priority order and adjacent to the last connection request is determined, and the first connection request is stored in the determined position.

[0096] In an optional implementation, when the program instructions are executed by the processor, the electronic device performs the following steps:

[0097] In the case where the timeliness priority of the first connection request is higher than the timeliness priority of the second connection request, detecting whether the second Bluetooth connection is successfully established within a preset time length starting from a starting time; the preset time length is less than a default connection timeout length; the starting time includes: a detection time when detecting whether the second Bluetooth connection is being established according to the second connection request;

[0098] If the second Bluetooth connection is not successfully established within the preset time period starting from the starting time, interrupting the step of establishing the second Bluetooth connection according to the second connection request;

[0099] or,

[0100] In a case where the second Bluetooth connection is successfully established within the preset time period starting from the starting moment, the first Bluetooth connection is established according to the first connection request.

[0101] In an optional implementation, the second connection request is located in a request queue, and the request queue is used to store connection requests; when the program instructions are executed by the processor, the electronic device executes the following steps:

[0102] If the second Bluetooth connection is successfully established within the preset time period starting from the starting time, the second connection request is deleted from the request queue.

[0103] In an optional implementation, the second connection request is located in a request queue, and the request queue is used to store connection requests; when the program instructions are executed by the processor, the electronic device executes the following steps:

[0104] After interrupting the step of establishing the second Bluetooth connection according to the second connection request, detecting whether the number of times the second connection request is processed is greater than or equal to a preset number;

[0105] When the number of times the second connection request is processed is greater than or equal to a preset number, the second connection request is deleted from the request queue.

[0106] In an optional implementation, when the program instructions are executed by the processor, the electronic device performs the following steps:

[0107] After the step of establishing the second Bluetooth connection according to the second connection request is interrupted, a first interface is displayed, wherein the first interface includes first prompt information, and the first prompt information is used to prompt that the establishment of the second Bluetooth connection has been interrupted.

[0108] In an optional implementation, when the program instructions are executed by the processor, the electronic device performs the following steps:

[0109] After the first Bluetooth connection is established according to the first connection request, a second interface is displayed, wherein the second interface includes second prompt information, and the second prompt information is used to prompt that the first Bluetooth connection is being established.

[0110] In an optional implementation, when the program instructions are executed by the processor, the electronic device performs the following steps:

[0111] When the first Bluetooth connection is successfully established, a third interface is displayed, wherein the third interface includes third prompt information, and the third prompt information is used to prompt that the first Bluetooth connection has been successfully established.

[0112] The second aspect and any implementation of the second aspect correspond to the first aspect and any implementation of the first aspect, respectively. The technical effects corresponding to the second aspect and any implementation of the second aspect can refer to the technical effects corresponding to the first aspect and any implementation of the first aspect, which will not be repeated here.

[0113] In a third aspect, the present application provides a computer storage medium comprising computer instructions, which, when executed on an electronic device, causes the electronic device to execute the steps of the method executed by the electronic device as shown in the first aspect and any one of the implementations of the first aspect.

[0114] The third aspect and any implementation of the third aspect correspond to the first aspect and any implementation of the first aspect, respectively. The technical effects corresponding to the third aspect and any implementation of the third aspect can refer to the technical effects corresponding to the first aspect and any implementation of the first aspect, which will not be repeated here.

[0115] In a fourth aspect, the present application provides a computer program product. When the computer program product runs on a computer, it enables the computer to execute the steps of the method executed by the electronic device shown in the first aspect and any one of the implementations of the first aspect.

[0116] The fourth aspect and any implementation of the fourth aspect correspond to the first aspect and any implementation of the first aspect, respectively. The technical effects corresponding to the fourth aspect and any implementation of the fourth aspect can refer to the technical effects corresponding to the above-mentioned first aspect and any implementation of the first aspect, which will not be repeated here.

[0117] In a fifth aspect, the present application provides a chip comprising one or more interface circuits and one or more processors; the interface circuit is used to receive a signal from a memory of an electronic device and send the signal to the processor, wherein the signal comprises a computer instruction stored in the memory; when the processor executes the computer instruction, the electronic device executes the steps of the method executed by the electronic device as shown in the first aspect and any one of the implementations of the first aspect.

[0118] The fifth aspect and any implementation of the fifth aspect correspond to the first aspect and any implementation of the first aspect, respectively. The technical effects corresponding to the fifth aspect and any implementation of the fifth aspect can refer to the technical effects corresponding to the first aspect and any implementation of the first aspect, which will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0119] Figure 1 A schematic diagram of a Bluetooth communication scenario is shown as an example;

[0120] Figure 2 is a schematic diagram of the structure of an electronic device shown as an example;

[0121] Figure 3 A schematic diagram of the software structure of an electronic device is shown as an example;

[0122] Figure 4 is a schematic diagram of the structure of an external device shown as an example;

[0123] Figure 5 is a schematic diagram of an exemplary Bluetooth protocol framework;

[0124] Figure 6 is a schematic diagram showing exemplary Bluetooth communication between a mobile phone and a wireless headset;

[0125] Figure 7 is a schematic diagram of an exemplary mobile phone interface;

[0126] Figure 8 is a schematic diagram of an exemplary mobile phone interface;

[0127] Fig.9A is a schematic diagram of an exemplary mobile phone interface;

[0128] Fig. 9B is a schematic diagram of an exemplary mobile phone interface;

[0129] Fig.10 is a schematic diagram of an exemplary wireless headset;

[0130] Fig.11 is a schematic diagram of a flow chart of the Page phase between a mobile phone and a wireless headset;

[0131] Fig.12 is a schematic diagram of an exemplary mobile phone interface;

[0132] Fig.13 is a schematic diagram of an exemplary mobile phone interface;

[0133] Fig.14 is a schematic diagram of an exemplary mobile phone interface;

[0134] Fig.15 is a schematic diagram of an exemplary request queue;

[0135] Fig.16 is a schematic diagram of an exemplary request queue;

[0136] Fig.17 is a schematic diagram of an exemplary request queue;

[0137] Fig.18 is a schematic diagram of an exemplary request queue;

[0138] Fig.19 is a schematic diagram of an exemplary request queue;

[0139] Fig. 20 is a schematic diagram of an exemplary request queue;

[0140] Fig.21 is a schematic diagram of an exemplary request queue;

[0141] Fig. 22 is a schematic diagram of an exemplary mobile phone interface;

[0142] Fig.23 is a schematic diagram of a flow chart of the Page phase between a mobile phone and a wireless headset;

[0143] Fig.24 The figure is a schematic diagram of the structure of a device shown as an example. DETAILED DESCRIPTION

[0144] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0145] The term "and / or" in this article is merely a description of the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone.

[0146] The terms "first" and "second" in the description and claims of the embodiments of the present application are used to distinguish different objects rather than to describe a specific order of objects. For example, a first target object and a second target object are used to distinguish different target objects rather than to describe a specific order of target objects.

[0147] In the embodiments of the present application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a specific way.

[0148] In the description of the embodiments of the present application, unless otherwise specified, the meaning of "multiple" refers to two or more than two. For example, multiple processing units refer to two or more processing units; multiple systems refer to two or more systems.

[0149] Among them, before the user inputs the establishment operation of establishing the first Bluetooth connection between the mobile phone and the wireless headset on the mobile phone, the mobile phone may have initiated a Bluetooth connection to other external devices. In this case, when the user inputs the establishment operation of establishing the first Bluetooth connection between the mobile phone and the wireless headset on the mobile phone, the mobile phone is establishing a second Bluetooth connection between the mobile phone and the other external device.

[0150] Since the mobile phone is establishing a second Bluetooth connection between the mobile phone and the other external device, the mobile phone will not establish a first Bluetooth connection between the mobile phone and the wireless headset at this time, that is, the mobile phone will not initiate a Bluetooth connection to the wireless headset, but will establish the first Bluetooth connection between the mobile phone and the wireless headset after waiting for the process of establishing the first Bluetooth connection between the mobile phone and the wireless headset to be completed.

[0151] For example, in one possible situation, if the Bluetooth connection between the mobile phone and the other external device has not been successfully established (the page has not been successful), then after the process of establishing the Bluetooth connection between the mobile phone and the other external device times out (page timeout, for example, 7 or 8 seconds, etc.), the mobile phone will establish the first Bluetooth connection between the mobile phone and the wireless headset, that is, the mobile phone will initiate a Bluetooth connection to the wireless headset.

[0152] However, the process from the user inputting the establishment operation on the mobile phone to the successful establishment of the first Bluetooth connection between the mobile phone and the wireless headset takes a long time, for example, it takes more than 10 seconds, etc., which results in slow speed and low efficiency in establishing the first Bluetooth connection between the mobile phone and the wireless headset, long waiting time for the user, and low user experience.

[0153] In view of this, the present application provides a method for establishing a Bluetooth connection, obtaining a first connection request, the first connection request being used to establish a first Bluetooth connection between an electronic device and a first external device; detecting whether a second Bluetooth connection between the electronic device and the second external device is being established according to a second connection request; the second connection request is used to establish a second Bluetooth connection between the electronic device and the second external device; in the case where the second Bluetooth connection is being established according to the second connection request, obtaining a timeliness priority of the first connection request, and obtaining a timeliness priority of the second connection request; comparing the timeliness priority of the first connection request with the timeliness priority of the second connection request; in the case where the timeliness priority of the first connection request is higher than the timeliness priority of the second connection request, interrupting the step of establishing the second Bluetooth connection according to the second connection request, that is, first pausing the establishment of the second Bluetooth connection, and then establishing the first Bluetooth connection according to the first connection request.

[0154] In this way, through the present application, when a first connection request for establishing a first Bluetooth connection is obtained, if a Bluetooth connection is being established according to a second connection request at this time, then when the timeliness priority of the first connection request is higher than the timeliness priority of the second connection request, it can be explained that the user's requirement for the real-time performance of the first Bluetooth connection is often greater than the requirement for the real-time performance of the second Bluetooth connection. For this reason, the establishment of the second Bluetooth connection according to the second connection request can be paused first, and then the first Bluetooth connection can be established immediately according to the first connection request. In this way, the waiting time for the first connection request can be reduced. That is, after obtaining the first connection request, the first Bluetooth connection can be established according to the first connection request without waiting for the process of processing the second connection request to time out, which plays the role of establishing the first Bluetooth connection according to the first connection request as soon as possible, can significantly improve the speed of establishing the first Bluetooth connection, can improve the timeliness of establishing the first Bluetooth connection as much as possible, can reduce the user's waiting time, and can improve the user experience.

[0155] Before describing the technical solution of the embodiment of the present application, the application scenario of the embodiment of the present application is first described with reference to the accompanying drawings.

[0156] The application scenario of the embodiment of the present application may include an initiator and a responder. The initiator can establish a Bluetooth connection with the responder, and then the initiator and the responder can exchange data based on the Bluetooth connection.

[0157] In one embodiment, the initiator may include an electronic device. The responder may include an external device (or a wireless external device, etc.). The electronic device may establish a Bluetooth connection with one or more external devices via Bluetooth (BT) technology.

[0158] In one embodiment, the electronic device may include a terminal, and the terminal may include: a mobile phone, a tablet computer, a laptop computer, a desktop computer, an ultra-mobile personal computer (UMPC), a media player (such as MP3, MP4, etc.), a personal digital assistant (PDA), a smart screen (such as a smart TV or a large screen, etc.), a vehicle-mounted device, a netbook, a projector, and other possible electronic devices, etc. The embodiment of the present application does not specifically limit the type of electronic device.

[0159] In one embodiment, the external device may include: wireless headphones, wireless speakers, smart bracelets, vehicle-mounted terminals, smart glasses, smart watches, augmented reality (AR) devices, and virtual reality (VR) devices, etc. The embodiment of the present application does not specifically limit the type of external devices.

[0160] The electronic device and the external device in the embodiment of the present application both have Bluetooth function.

[0161] The Bluetooth technology involved in the embodiments of the present application may include: traditional Bluetooth or low-power Bluetooth (Bluetooth Low Energy, BLE), etc.

[0162] In a possible implementation, the Bluetooth communication scenarios in the embodiments of the present application may include: Bluetooth communication scenarios between a mobile phone and a wireless headset, Bluetooth communication scenarios between a mobile phone and a smart watch, and Bluetooth communication scenarios between a mobile phone and smart glasses, etc. Of course, it can be understood that the Bluetooth communication scenarios in the embodiments of the present application may also include Bluetooth communication scenarios between other devices. The present application does not limit the types of devices involved in the Bluetooth communication scenarios, and no further examples are given.

[0163] Figure 1 Shown is a schematic diagram of an exemplary scenario of Bluetooth communication between a mobile phone and a wireless headset, wherein the mobile phone can act as an initiator, the mobile phone can send a connection request to the wireless headset, the connection request is used to establish a first Bluetooth connection between the mobile phone and the wireless headset, the wireless headset can receive the connection request sent by the mobile phone and respond to the connection request, thereby achieving the purpose of establishing the first Bluetooth connection between the mobile phone and the wireless headset, and thereafter, the mobile phone and the wireless headset can exchange data based on the Bluetooth connection between the two.

[0164] Figure 1 This is merely an illustrative example of the Bluetooth communication scenario of the present application and is not intended to limit the Bluetooth communication scenario of the present application.

[0165] Figure 2 A schematic diagram of the structure of an electronic device shown in an embodiment of the present application.

[0166] It is clear to those skilled in the art that Figure 2 The structure of the electronic device in can be applied to Figure 1 The mobile phone shown, it is understood that Figure 2 The structure of the electronic device in the figure can also be applied to tablet computers, laptop computers, desktop computers, ultra-mobile personal computers, media players, personal digital assistants, smart screens, vehicle-mounted devices, netbooks, projectors, etc., which are not shown in the figure, and other possible electronic devices. The embodiment of the present application does not impose any restrictions on the specific type of the electronic device 100.

[0167] It should be understood that Figure 2 The illustrated electronic device 100 is merely one example of an electronic device, and the electronic device 100 may have more or fewer components than those shown in the figure, may combine two or more components, or may have a different configuration of components. Figure 2 The various components shown in the EMBODIMENTS 2000 may be implemented in hardware, software, or a combination of hardware and software, including one or more signal processing and / or application specific integrated circuits.

[0168] The electronic device 100 may include: a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc.

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

[0170] The controller may be the nerve center and command center of the electronic device 100. The controller may generate an operation control signal according to the instruction operation code and the timing signal to complete the control of fetching and executing instructions.

[0171] The processor 110 may also be provided with a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may store instructions or data that the processor 110 has just used or cyclically used. If the processor 110 needs to use the instruction or data again, it may be directly called from the memory. This avoids repeated access, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.

[0172] In some embodiments, the processor 110 may include one or more interfaces. The interface may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface, etc.

[0173] The I2C interface is a bidirectional synchronous serial bus, including a serial data line (SDA) and a serial clock line (SCL). In some embodiments, the processor 110 may include multiple groups of I2C buses. The processor 110 may be coupled to the touch sensor 180K, the charger, the flash, the camera 193, etc. through different I2C bus interfaces. For example: the processor 110 may be coupled to the touch sensor 180K through the I2C interface, so that the processor 110 communicates with the touch sensor 180K through the I2C bus interface, thereby realizing the touch function of the electronic device 100.

[0174] The I2S interface can be used for audio communication. In some embodiments, the processor 110 can include multiple I2S buses. The processor 110 can be coupled to the audio module 170 via the I2S bus to achieve communication between the processor 110 and the audio module 170. In some embodiments, the audio module 170 can transmit an audio signal to the wireless communication module 160 via the I2S interface to achieve the function of answering a call through a Bluetooth headset.

[0175] The PCM interface can also be used for audio communication, sampling, quantizing and encoding analog signals. In some embodiments, the audio module 170 and the wireless communication module 160 can be coupled via a PCM bus interface. In some embodiments, the audio module 170 can also transmit audio signals to the wireless communication module 160 via the PCM interface to realize the function of answering calls via a Bluetooth headset. Both the I2S interface and the PCM interface can be used for audio communication.

[0176] The UART interface is a universal serial data bus for asynchronous communication. The bus can be a bidirectional communication bus. It converts the data to be transmitted between serial communication and parallel communication. In some embodiments, the UART interface is generally used to connect the processor 110 and the wireless communication module 160. For example, the processor 110 communicates with the Bluetooth module in the wireless communication module 160 through the UART interface to implement the Bluetooth function. In some embodiments, the audio module 170 can transmit an audio signal to the wireless communication module 160 through the UART interface to implement the function of playing music through a Bluetooth headset.

[0177] The MIPI interface can be used to connect the processor 110 with peripheral devices such as the display screen 194 and the camera 193. The MIPI interface includes a camera serial interface (CSI), a display serial interface (DSI), etc. In some embodiments, the processor 110 and the camera 193 communicate via the CSI interface to implement the shooting function of the electronic device 100. The processor 110 and the display screen 194 communicate via the DSI interface to implement the display function of the electronic device 100.

[0178] The GPIO interface can be configured by software. The GPIO interface can be configured as a control signal or as a data signal. In some embodiments, the GPIO interface can be used to connect the processor 110 with the camera 193, the display 194, the wireless communication module 160, the audio module 170, the sensor module 180, etc. The GPIO interface can also be configured as an I2C interface, an I2S interface, a UART interface, a MIPI interface, etc.

[0179] The USB interface 130 is an interface that complies with the USB standard specification, and specifically can be a Mini USB interface, a Micro USB interface, a USB Type C interface, etc. The USB interface 130 can be used to connect a charger to charge the electronic device 100, and can also be used to transfer data between the electronic device 100 and a peripheral device. It can also be used to connect headphones to play audio through the headphones. The interface can also be used to connect other electronic devices, such as AR devices, etc.

[0180] It is understandable that the interface connection relationship between the modules illustrated in the embodiment of the present application is only a schematic illustration and does not constitute a structural limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may also adopt different interface connection methods in the above embodiments, or a combination of multiple interface connection methods.

[0181] The charging management module 140 is used to receive charging input from a charger. The charger may be a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 140 may receive charging input from a wired charger through the USB interface 130. In some wireless charging embodiments, the charging management module 140 may receive wireless charging input through a wireless charging coil of the electronic device 100. While the charging management module 140 is charging the battery 142, it may also power the electronic device through the power management module 141.

[0182] The power management module 141 is used to connect the battery 142, the charging management module 140 and the processor 110. The power management module 141 receives input from the battery 142 and / or the charging management module 140, and supplies power to the processor 110, the internal memory 121, the external memory, the display screen 194, the camera 193, and the wireless communication module 160. The power management module 141 can also be used to monitor parameters such as battery capacity, battery cycle number, battery health status (leakage, impedance), etc. In some other embodiments, the power management module 141 can also be set in the processor 110. In other embodiments, the power management module 141 and the charging management module 140 can also be set in the same device.

[0183] The wireless communication function of the electronic device 100 can be implemented through the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor and the baseband processor.

[0184] Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in electronic device 100 can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve the utilization of antennas. For example, antenna 1 can be reused as a diversity antenna for a wireless local area network. In some other embodiments, the antenna can be used in combination with a tuning switch.

[0185] The mobile communication module 150 can provide solutions for wireless communications including 2G / 3G / 4G / 5G, etc., applied to the electronic device 100. The mobile communication module 150 may include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves from the antenna 1, and filter, amplify, and process the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modulation and demodulation processor, and convert it into electromagnetic waves for radiation through the antenna 1. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the processor 110. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the same device as at least some of the modules of the processor 110.

[0186] The modem processor may include a modulator and a demodulator. Among them, the modulator is used to modulate the low-frequency baseband signal to be sent into a medium-high frequency signal. The demodulator is used to demodulate the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low-frequency baseband signal to the baseband processor for processing. After the low-frequency baseband signal is processed by the baseband processor, it is passed to the application processor. The application processor outputs a sound signal through an audio device (not limited to a speaker 170A, a receiver 170B, etc.), or displays an image or video through a display screen 194. In some embodiments, the modem processor may be an independent device. In other embodiments, the modem processor may be independent of the processor 110 and be set in the same device as the mobile communication module 150 or other functional modules.

[0187] The wireless communication module 160 can provide wireless communication solutions including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR), etc., which are applied to the electronic device 100. The wireless communication module 160 can be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, modulates the frequency of the electromagnetic wave signal and performs filtering, and sends the processed signal to the processor 110. The wireless communication module 160 can also receive the signal to be sent from the processor 110, modulate the frequency of it, amplify it, and convert it into electromagnetic waves for radiation through the antenna 2.

[0188] In some embodiments, the antenna 1 of the electronic device 100 is coupled to the mobile communication module 150, and the antenna 2 is coupled to the wireless communication module 160, so that the electronic device 100 can communicate with the network and other devices through wireless communication technology. The wireless communication technology may include global system for mobile communications (GSM), general packet radio service (GPRS), code division multiple access (CDMA), wideband code division multiple access (WCDMA), time-division code division multiple access (TD-SCDMA), long term evolution (LTE), BT, GNSS, WLAN, NFC, FM, and / or IR technology. The GNSS may include a global positioning system (GPS), a global navigation satellite system (GLONASS), a Beidou navigation satellite system (BDS), a quasi-zenith satellite system (QZSS) and / or a satellite based augmentation system (SBAS).

[0189] The electronic device 100 implements the display function through a GPU, a display screen 194, and an application processor. The GPU is a microprocessor for image processing, which connects the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 may include one or more GPUs that execute program instructions to generate or change display information.

[0190] The display screen 194 is used to display images, videos, etc. The display screen 194 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode or an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), Miniled, MicroLed, Micro-oLed, a quantum dot light-emitting diode (QLED), etc. In some embodiments, the electronic device 100 may include 1 or N display screens 194, where N is a positive integer greater than 1.

[0191] The electronic device 100 can realize the shooting function through ISP, camera 193, video codec, GPU, display screen 194 and application processor.

[0192] ISP is used to process the data fed back by camera 193. For example, when taking a photo, the shutter is opened, and the light is transmitted to the camera photosensitive element through the lens. The light signal is converted into an electrical signal, and the camera photosensitive element transmits the electrical signal to ISP for processing and converts it into an image visible to the naked eye. ISP can also perform algorithm optimization on the noise, brightness, and skin color of the image. ISP can also optimize the exposure, color temperature and other parameters of the shooting scene. In some embodiments, ISP can be set in camera 193.

[0193] The camera 193 is used to capture still images or videos. The object generates an optical image through the lens and projects it onto the photosensitive element. The photosensitive element can be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the optical signal into an electrical signal, and then passes the electrical signal to the ISP to be converted into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into an image signal in a standard RGB, YUV or other format. In some embodiments, the electronic device 100 may include 1 or N cameras 193, where N is a positive integer greater than 1.

[0194] The digital signal processor is used to process digital signals, and can process not only digital image signals but also other digital signals. For example, when the electronic device 100 is selecting a frequency point, the digital signal processor is used to perform Fourier transform on the frequency point energy.

[0195] Video codecs are used to compress or decompress digital videos. The electronic device 100 may support one or more video codecs. Thus, the electronic device 100 may play or record videos in a variety of coding formats, such as Moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, MPEG4, etc.

[0196] NPU is a neural network (NN) computing processor. By drawing on the structure of biological neural networks, such as the transmission mode between neurons in the human brain, it can quickly process input information and can also continuously self-learn. Through NPU, applications such as intelligent cognition of electronic device 100 can be realized, such as image recognition, face recognition, voice recognition, text understanding, etc.

[0197] The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100. The external memory card communicates with the processor 110 through the external memory interface 120 to implement a data storage function, such as storing music, video and other files in the external memory card.

[0198] The internal memory 121 can be used to store computer executable program codes, which include instructions. The processor 110 executes various functional applications and data processing of the electronic device 100 by running the instructions stored in the internal memory 121. The internal memory 121 may include a program storage area and a data storage area. Among them, the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc. The data storage area may store data created during the use of the electronic device 100 (such as audio data, a phone book, etc.), etc. In addition, the internal memory 121 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc.

[0199] The electronic device 100 can implement audio functions such as music playing and recording through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the headphone jack 170D, and the application processor.

[0200] The audio module 170 is used to convert digital audio information into analog audio signal output, and is also used to convert analog audio input into digital audio signals. The audio module 170 can also be used to encode and decode audio signals. In some embodiments, the audio module 170 can be set in the processor 110, or some functional modules of the audio module 170 can be set in the processor 110. The hardware system of the electronic device 100 is described in detail above. Figure 2 The connection relationship between the modules shown is only a schematic illustration and does not constitute a limitation on the connection relationship between the modules of the electronic device 100. Optionally, the modules of the electronic device 100 may also adopt a combination of multiple connection modes in the above embodiments.

[0201] The software system of the electronic device 100 may adopt a layered architecture, an event-driven architecture, a micro-core architecture, a micro-service architecture, or a cloud architecture, etc. The embodiment of the present application takes the Android system of the layered architecture as an example to exemplify the software structure of the electronic device 100.

[0202] Figure 3 It is a schematic diagram of the software structure of the electronic device 100 according to an embodiment of the present application.

[0203] The layered architecture of the electronic device 100 divides the software into several layers, each layer has a clear role and division of labor, and the layers communicate with each other through software interfaces.

[0204] In some embodiments, the Android system is divided into an application layer, an application framework layer, and a kernel layer from top to bottom.

[0205] The application layer can include a series of applications. For example, the application layer can include camera, gallery, calendar, screen projection, WLAN, music, call, navigation, video, map, Bluetooth, music, video, multi-screen collaboration, Honor sharing, short message and other applications.

[0206] It should be noted that Figure 3 The applications included in the application layer shown in the figure are only exemplary and are not limited in this application. It is understandable that the applications included in the application layer do not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, compared with Figure 3 The application layer shown includes applications, and the electronic device 100 may include more or fewer applications, or the electronic device 100 may include completely different applications.

[0207] The application framework layer provides application programming interfaces (APIs) and programming frameworks for applications in the application layer, and can include various components and services to support developers' Android development. The application framework layer includes some predefined functions.

[0208] like Figure 2 As shown, the application framework layer may include a window manager, a content provider, a view system, a phone manager, a resource manager, a notification manager, a Bluetooth manager, and the like.

[0209] The window manager is used to manage window programs. The window manager can obtain the display screen size, determine whether there is a status bar, lock the screen, capture the screen, etc.

[0210] Content providers are used to store and retrieve data and make it accessible to applications. The data may include videos, images, audio, calls made and received, browsing history and bookmarks, phone books, etc.

[0211] The view system includes visual controls, such as controls for displaying text, controls for displaying images, etc. The view system can be used to build applications. A display interface can be composed of one or more views. For example, a display interface including a text notification icon can include a view for displaying text and a view for displaying images.

[0212] The phone manager is used to provide communication functions of the electronic device 100, such as management of call status (including connecting, hanging up, etc.).

[0213] The resource manager provides various resources for applications, such as localized strings, icons, images, layout files, video files, and so on.

[0214] The notification manager enables applications to display notification information in the status bar. It can be used to convey notification-type messages and can disappear automatically after a short stay without user interaction. For example, the notification manager is used to notify download completion, message reminders, etc. The notification manager can also be a notification that appears in the system top status bar in the form of a chart or scroll bar text, such as notifications of applications running in the background, or a notification that appears on the screen in the form of a dialog window. For example, a text message is displayed in the status bar, a prompt sound is emitted, an electronic device vibrates, an indicator light flashes, etc.

[0215] The Bluetooth manager is used to manage the Bluetooth connection between the electronic device 100 and other external devices (such as wireless headphones or wireless speakers, etc.), for example, to establish a Bluetooth connection between the electronic device 100 and other external devices, and to interact with other external devices through the established Bluetooth connection, to release the Bluetooth connection, and to maintain the Bluetooth connection, etc.

[0216] The kernel layer is a layer between hardware and software. The kernel layer includes at least a display driver, an audio driver, a sensor driver, and a Bluetooth driver. The Bluetooth driver is used to process data on the Bluetooth connection between the electronic device 100 and other external devices (such as wireless headphones or wireless speakers, etc.).

[0217] Understandably, Figure 3 The layers in the software structure shown and the components included in each layer do not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may include Figure 3 More or fewer layers are shown, and each layer may include more or fewer components, which is not limited in the present application.

[0218] Figure 4 The following is a diagram showing an example structure of an external device. The external device may include a wireless headset and a wireless speaker, etc. The external device has a Bluetooth function.

[0219] Wireless headsets may include various types, such as earbud wireless headsets, in-ear wireless headsets, head-mounted wireless headsets, earmuff wireless headsets, or ear-hook wireless headsets.

[0220] The wireless headset may include a first part and a second part respectively worn on the left ear and the right ear of the user, which may be connected by a connecting line, such as a neckband wireless headset; or may be two independent parts, such as a True Wireless Stereo (TWS) headset. Exemplarily, when the wireless headset is a TWS headset, the first part and the second part of the wireless headset may be a left earplug and a right earplug.

[0221] like Figure 4 As shown, the external device 200 includes at least one processor 201, at least one memory 202, a wireless communication module 203, an audio module 204, a power module 205, and an input / output interface 206. The processor 201 may include one or more interfaces for connecting to other components of the external device 200. Optionally, the external device 200 is stored in an earphone box.

[0222] The memory 202 can be used to store program codes, such as program codes for connecting the external device 200 with multiple electronic devices, processing audio services of electronic devices (such as music playback, answering / calling, etc.), charging the external device 200, and wirelessly pairing the external device 200 with other electronic devices. The memory 202 can also be used to store other information, such as pairing information of the most recently connected electronic device.

[0223] The processor 201 can be used to execute the above application code and call related modules to implement the functions of the external device 200 in the embodiment of the present application. Exemplarily, when the external device 200 receives the connection request information of the electronic device, the external device 200 can establish a physical connection with the electronic device.

[0224] The processor 201 may include one or more processing units, and different processing units may be independent devices or integrated into one or more processors 201. The processor 201 may be an integrated control chip or may be composed of a circuit including various active and / or passive components, and the circuit is configured to perform the functions of the processor 201 described in the embodiments of the present application.

[0225] The wireless communication module 203 can be used to support data exchange between the external device 200 and other electronic devices or earphone boxes, including wireless communications such as BT, WLAN (such as Wi-Fi), Zigbee, FM, NFC, IR, or general 2.4G / 5G wireless communication technologies.

[0226] In some embodiments, the wireless communication module 203 may be a Bluetooth chip. The external device 200 may be paired with the Bluetooth chip of other electronic devices and establish a wireless connection through the Bluetooth chip to achieve wireless communication and business processing between the external device 200 and other electronic devices through the wireless connection. The wireless connection may be a physical connection or a virtual connection. Typically, a Bluetooth chip may support Basic Rate (BR) / Enhanced Data Rate (EDR) Bluetooth and BLE, for example, it may receive / send paging information, receive / send BLE broadcast messages, etc.

[0227] In addition, the wireless communication module 203 may also include an antenna, and the wireless communication module 203 receives electromagnetic waves via the antenna, modulates the electromagnetic wave signal and performs filtering, and sends the processed signal to the processor 201. The wireless communication module 203 may also receive a signal to be sent from the processor 201, modulate the frequency of the signal, amplify the signal, and convert it into an electromagnetic wave for radiation through the antenna.

[0228] The audio module 204 can be used to manage audio data and implement the input and output of audio signals by the external device 200. For example, the audio module 204 can obtain audio signals from the wireless communication module 203, or transmit audio signals to the wireless communication module 203, to implement functions such as making and receiving calls, playing music, starting / turning off the voice assistant of the electronic device connected to the external device 200, receiving / sending the user's voice data, etc. through the external device 200. The audio module 204 may include a speaker (or earpiece, receiver) component for outputting audio signals, a microphone (or microphone, microphone), a microphone receiving circuit matched with the microphone, etc. The speaker can be used to convert audio electrical signals into sound signals and play them. The microphone can be used to convert sound signals into audio electrical signals.

[0229] The power module 205 can be used to provide system power for the external device 200, power each module of the external device 200, and support the external device 200 to receive charging input, etc. The power module 205 may include a power management unit (PMU) and a battery. Among them, the power management unit can receive external charging input; transform the electrical signal input by the charging circuit and provide it to the battery for charging, and can also transform the electrical signal provided by the battery and provide it to other modules such as the audio module 204 and the wireless communication module 203; and prevent the battery from being overcharged, over-discharged, short-circuited or overcurrent, etc. In some embodiments, the power module 205 may also include a wireless charging coil for wirelessly charging the external device 200. In addition, the power management unit can also be used to monitor parameters such as battery capacity, battery cycle number, battery health status (leakage, impedance), etc.

[0230] Multiple input / output interfaces 206 can be used to provide a wired connection for charging or communication between the external device 200 and the earphone box. In some embodiments, the input / output interface can be a USB interface. In other embodiments, the input / output interface 206 can be an earphone electrical connector. When the external device 200 is placed in the earphone box, the external device 200 can establish an electrical connection with the electrical connector in the earphone box through the earphone electrical connector, thereby charging the battery in the external device 200. In other embodiments, after the electrical connection is established, the external device 200 can also communicate data with the earphone box, for example, it can receive a pairing instruction from the earphone box.

[0231] In addition, the external device 200 may also include a sensor 207. For example, the sensor 207 may be a distance sensor or a proximity light sensor, which may be used to determine whether the external device 200 is worn by the user. Exemplarily, the external device 200 may use a distance sensor to detect whether there is an object near the external device 200, thereby determining whether the external device 200 is worn by the user. When it is determined that the external device 200 is worn, the external device 200 may turn on the speaker. For another example, the sensor 207 may also include a bone conduction sensor, combined into a bone conduction headset. Using the bone conduction sensor, the external device 200 may obtain the vibration signal of the vibrating bone of the human vocal part, parse the voice signal, realize the voice function, and thus receive the user's voice command. The external device 200 may also perform voice authentication based on the user's voice signal obtained by the bone conduction headset to authenticate the user's identity in business scenarios such as payment transactions. For another example, the sensor 207 may also include: a touch sensor for detecting a user's touch operation; a fingerprint sensor for detecting a user's fingerprint and identifying the user's identity; an ambient light sensor that can adaptively adjust some parameters (such as volume) according to the perceived brightness of the ambient light; and some other sensors.

[0232] In some embodiments, the touch sensor can detect the user's touch operations such as single click, double click, multiple clicks, long press, and heavy pressure, and can also perform user fingerprint recognition to authenticate the user's identity in business scenarios such as payment transactions.

[0233] It is understood that the structure shown in the embodiment of the present application does not constitute a specific limitation on the external device 200. Figure 4 More or fewer components shown may be combined with two or more components, or may have different component configurations. For example, the outer surface of the external device 200 may also include a button 208, an indicator light (which may indicate battery level, incoming / outgoing call, pairing mode, etc.), a display screen (which may prompt the user with relevant information), a dust screen (which may be used in conjunction with a handset), and other components. The button 208 may be a physical button or a touch button (used in conjunction with a touch sensor), etc., which is used to trigger operations such as power on, power off, pause, play, record, start pairing, and reset.

[0234] It should be understood that Figure 4 The various components shown may be implemented in hardware, software, or a combination of hardware and software, including one or more signal processing or application specific integrated circuits.

[0235] Optionally, a mobile phone is used as an electronic device and a wireless headset is used as an external device for illustration. Exemplarily, the mobile phone and the wireless headset can communicate via Bluetooth, for example, the mobile phone and the wireless headset can exchange data based on the Bluetooth connection between the two.

[0236] It should be noted that the embodiments of the present application are described by taking the Bluetooth communication between a mobile phone and a wireless headset as an example. In other embodiments, it can also be the communication between any two or more devices with Bluetooth function, such as mobile phones, tablet computers, wearable devices, smart home devices (such as Bluetooth speakers, TVs), wireless headsets, and vehicle-mounted devices.

[0237] Among them, the Bluetooth communication between the mobile phone and the wireless headset is maintained through the Bluetooth protocol framework.

[0238] For example, see Figure 5 The embodiment of the present application provides a Bluetooth protocol framework, including a host protocol stack, a host controller interface (HCI), and a controller.

[0239] The host protocol stack defines multiple application protocols (profiles) and core protocols (protocols) in the Bluetooth framework. Each profile defines its own corresponding message format and application rules. Profiles are Bluetooth services (applications). In order to achieve interoperability between different devices on different platforms, the Bluetooth protocol has formulated specifications for various possible and universal application scenarios, such as the A2DP and HFP mentioned above.

[0240] The core protocol includes but is not limited to the basic Bluetooth service protocol (service discovery protocol, SDP), logical link control and adaptation protocol (logical link control and adaptation protocol, L2CAP), etc. The core protocol is indispensable in the Bluetooth protocol stack.

[0241] Among them, HCI provides a unified interface for upper-layer protocols to enter the link manager and a unified way to enter the baseband.

[0242] There are several transport layers between the host core protocol stack and the controller. These transport layers are transparent and complete the task of transmitting data. The Bluetooth Special Interest Group (SIG) specifies four physical bus modes for connecting to hardware, namely four HCI transport layers: USB, RS232, UART and PC card.

[0243] Among them, the controller defines the underlying hardware part, including radio frequency (RF), baseband (BB) and link management (LM). The RF layer filters and transmits data bit streams through microwaves in the 2.4GHz unlicensed ISM band, and mainly defines the conditions that the Bluetooth transceiver needs to meet for normal operation in this band. The baseband is responsible for frequency hopping and the transmission of Bluetooth data and information frames. The LM layer is responsible for connecting, establishing and dismantling links and performing security control. The LM layer is the link management layer protocol of the Bluetooth protocol stack, responsible for translating upper-layer HCI commands into operations that the baseband can accept, establishing ACLs, synchronous links (synchronous connection-oriented / extended, SCO) and extended synchronous links (extended synchronous connection-oriented, ESCO), and making Bluetooth devices enter energy-saving working modes (such as sniff mode). The LC layer is responsible for responding to upper-layer LM commands (such as LM commands that execute functions such as establishing a transmission link for data packets and maintaining links) during the transmission of a batch of data packets.

[0244] Usually, after a Bluetooth device establishes an ACL connection with an electronic device, it also needs to establish a profile connection to enable audio service continuation. Among them, profile connection includes A2DP connection and HFP connection. A Bluetooth device needs to establish an A2DP connection with an electronic device to enable media services, and also needs to establish an HFP connection to enable call services.

[0245] in, Figure 6 Schematic diagram of Bluetooth communication between a mobile phone and a wireless headset. Figure 6 ,include:

[0246] S301, the mobile phone and wireless headset enter the discovery stage.

[0247] In this application, the mobile phone can turn on the Bluetooth function. After the mobile phone turns on the Bluetooth function, the mobile phone can enter the discovery phase to discover devices with the Bluetooth function turned on near the mobile phone.

[0248] In the present application, the wireless headset can turn on the Bluetooth function. After the wireless headset turns on the Bluetooth function, the wireless headset can enter the discovery phase to discover devices with the Bluetooth function turned on near the wireless headset.

[0249] For example, after the wireless headset and the mobile phone turn on the Bluetooth function, they can periodically broadcast and monitor Bluetooth on the designated Bluetooth channel to find nearby devices with Bluetooth function turned on (hereinafter referred to as Bluetooth devices). For example, the designated Bluetooth channels can include Bluetooth channel 37, Bluetooth channel 38, and Bluetooth channel 39.

[0250] For example, after the wireless headset turns on the Bluetooth function, the wireless headset can perform Bluetooth broadcasting on a designated Bluetooth channel. Exemplarily, after the mobile phone turns on the Bluetooth function, the mobile phone can monitor on the designated Bluetooth channel and receive the Bluetooth broadcast message sent by the wireless headset. Optionally, the Bluetooth broadcast message sent by the wireless headset includes but is not limited to: the Bluetooth address information of the wireless headset and the identification information of the wireless headset. Optionally, the identification information of the wireless headset may include the device name and device type of the wireless headset. Of course, it is understandable that the identification information of the wireless headset may also include other possible content according to actual conditions, and this application does not limit this. In other words, in the discovery stage, the mobile phone can obtain information such as the Bluetooth address information and identification information of the wireless headset.

[0251] It should be noted that, based on different protocols, after receiving the Bluetooth broadcast message sent by the wireless headset, the mobile phone can send a response message to the wireless headset, or it can not reply, and this application does not limit it.

[0252] Correspondingly, after the mobile phone turns on the Bluetooth function, the mobile phone can perform Bluetooth broadcasting on the designated Bluetooth channel. Exemplarily, after the wireless headset turns on the Bluetooth function, the wireless headset can monitor on the designated Bluetooth channel and receive the Bluetooth broadcast message sent by the mobile phone. Optionally, the Bluetooth broadcast message sent by the mobile phone includes but is not limited to: the Bluetooth address information of the mobile phone and the identification information of the mobile phone. Optionally, the identification information of the mobile phone may include the device name and device type of the mobile phone, etc. Of course, it can be understood that the identification information of the mobile phone may also include other possible content according to the actual situation, and this application does not limit this. In other words, in the discovery stage, the wireless headset can obtain information such as the Bluetooth address information and identification information of the mobile phone.

[0253] It should be noted that, based on different protocols, after receiving the Bluetooth broadcast message sent by the mobile phone, the wireless headset can send a response message to the mobile phone or not reply, and this application does not limit it.

[0254] Regarding activating the Bluetooth function of a mobile phone, the embodiment of the present application does not specifically limit the manner in which the Bluetooth function of a mobile phone is activated, and the following are illustrative examples.

[0255] For example, a user can enter the Bluetooth setting interface of the mobile phone through the setting application of the mobile phone, and turn on the Bluetooth function of the mobile phone through the Bluetooth switch control in the Bluetooth setting interface.

[0256] For another example, the user can enter the sliding notification bar (or status bar) of the mobile phone and turn on the Bluetooth function of the mobile phone through the Bluetooth switch control in the sliding notification bar of the mobile phone.

[0257] For another example, a user can enable the Bluetooth function of the mobile phone by transferring files in a certain application of the mobile phone.

[0258] For another example, users can use applications such as Honor Share or multi-screen collaboration on their mobile phones to trigger the phone to turn on its Bluetooth function.

[0259] For another example, the user can turn on the Bluetooth functions of both the mobile phone and the wireless headset at the same time by touching the mobile phone and the wireless headset together.

[0260] For example, in one embodiment, Figure 7 It is a schematic diagram of an exemplary interface, which illustrates that "a user can enter the Bluetooth setting interface of the mobile phone through the setting application of the mobile phone, and turn on the Bluetooth function of the mobile phone through the Bluetooth switch control in the Bluetooth setting interface."

[0261] Reference Figure 7 (1), illustratively, the main interface 401 of the mobile phone may include one or more controls, for example, including but not limited to: an icon for the mobile phone battery level, an icon for the mobile network signal, an icon for the Wi-Fi signal, an icon for the time, and icons for multiple applications, etc. Among them, the application icons include but are not limited to: an icon 402 for the settings application, an icon for the calendar application, and an icon for the gallery application, etc. For details, see Figure 7 (1) and will not be elaborated here.

[0262] It should be noted that Figure 7 The application icons shown in (1) are merely illustrative application icons. Depending on actual conditions, other application icons may also be included, and this application does not limit this.

[0263] If the user needs to turn on the Bluetooth function of the mobile phone, the user can input a single click operation on the icon 402 of the setting application in the main interface 401 of the mobile phone to enter the interface 403 of the setting application. In response to the single click operation input by the user on the icon 402 of the setting application, the mobile phone displays the interface 403 of the setting application.

[0264] Reference Figure 7 (2) Exemplarily, the interface 403 of the setting application may include one or more controls, for example, including but not limited to: WLAN setting options, Bluetooth setting options 404, mobile network setting options and more connection setting options.

[0265] It should be noted that Figure 7 The various controls shown in (2) are merely illustrative controls and may include other controls depending on actual conditions. This application does not limit this.

[0266] At this time, the Bluetooth function of the mobile phone is in the on state, so Figure 7 The Bluetooth setting option 404 in the setting application interface 403 shown in (2) indicates that the Bluetooth function is turned off (the word "turned off" is displayed in the Bluetooth setting option 404). Figure 7 As can be seen from the Bluetooth setting option 404 in the setting application interface 403 shown in (2), the Bluetooth function of the mobile phone is turned off at this time. Figure 7 (2) will not be elaborated here.

[0267] If the user needs to enable the Bluetooth function of the mobile phone, the user can input a single click operation on the Bluetooth setting option 404 to enter the Bluetooth setting interface 405. In response to the single click operation input by the user on the Bluetooth setting option 404, the mobile phone displays the Bluetooth setting interface 405.

[0268] Reference Figure 7 (3) Exemplarily, the Bluetooth setting interface 405 may include one or more controls, such as but not limited to: a Bluetooth switch control 406, etc.

[0269] It should be noted that Figure 7 The controls shown in (3) are merely illustrative controls and may include other controls depending on actual conditions. This application does not limit this.

[0270] At this time, the Bluetooth function of the mobile phone is in the on state, so Figure 7 (3) The Bluetooth switch control 406 in the Bluetooth setting interface 405 indicates that the Bluetooth function of the mobile phone is turned off. Figure 7 (3) The Bluetooth switch control 406 in the Bluetooth setting interface 405 shows that the Bluetooth function of the mobile phone is in the off state. Figure 7 (3) will not be elaborated here.

[0271] If the user needs to turn on the Bluetooth function of the mobile phone, the user can input a single click operation to the Bluetooth switch control 406 to turn on the Bluetooth function of the mobile phone. In response to the single click operation input by the user to the Bluetooth switch control 406, the mobile phone turns on the Bluetooth function of the mobile phone.

[0272] Further, refer to Figure 7 (4) After the Bluetooth function of the mobile phone is turned on, the content in the Bluetooth setting interface 405 changes.

[0273] For example, the Bluetooth function of the mobile phone is turned on at this time, so Figure 7 (4) The Bluetooth switch control 406 in the Bluetooth setting interface 405 indicates that the Bluetooth function is turned on. Figure 7As can be seen from the Bluetooth switch control 406 in the Bluetooth setting interface 405 shown in (4), the Bluetooth function of the mobile phone is turned on at this time. Figure 7 (4) will not be elaborated here.

[0274] Secondly, in Figure 7 In (4), a Bluetooth icon 407 is also displayed on the left side of the mobile phone battery icon to indicate that the Bluetooth function of the mobile phone is turned on. Figure 7 As shown in (4), the Bluetooth icon 407 displayed on the left side of the icon of the mobile phone battery level indicates that the Bluetooth function of the mobile phone is turned on.

[0275] Secondly, in Figure 7 In (4), a paired device list 408 is also displayed at the bottom of the Bluetooth switch control 406.

[0276] The paired device list 408 includes one or more paired device identifiers. The device identifier may include the name or type of the device. For example, Figure 7 The paired device identifiers in the paired device list 408 shown in (4) include the identifier of the wireless headset "FlyPods3" and the identifier of the mobile phone "HonorX40".

[0277] It should be noted that Figure 7 The identifiers of the paired devices in the paired device list 408 shown in (4) are merely illustrative examples of the identifiers of the paired devices. Depending on actual conditions, the identifiers of other paired devices may also be included, and this application does not limit this.

[0278] It should be noted that the paired device has established a Bluetooth connection with the mobile phone, and the mobile phone stores the fingerprint information of the paired device.

[0279] Exemplarily, the fingerprint information of a device may include, but is not limited to: Bluetooth address information of the device, an identification of the device (eg, a device name or a device type), and the like.

[0280] Furthermore, it should be noted that if a device has established a Bluetooth connection with a mobile phone before, but the mobile phone does not store the fingerprint information of the device (for example, the saved fingerprint information is cleared after the mobile phone is initialized), then the device is a non-paired device. In other words, when the mobile phone scans the device again during the discovery phase, the device will not appear in the paired device list, but will appear in the available device list.

[0281] Furthermore, it should be noted that the paired devices can be further divided into online devices and offline devices.

[0282] Exemplarily, online devices may include electronic devices scanned by the mobile phone in the discovery phase. For example, if the mobile phone receives a Bluetooth broadcast message sent by a device (such as HonrorX40) in the paired device in the discovery phase, the device may be an online device.

[0283] Exemplarily, offline devices may include electronic devices that are not scanned by the mobile phone during the discovery phase. For example, if the mobile phone does not receive a Bluetooth broadcast message sent by an electronic device in the paired device list within a specific time (which can be set according to actual needs) during the discovery phase, the device may be an offline device.

[0284] Still refer to Figure 7 (4) Exemplarily, an available device list 409 is also displayed below the paired device list 407. The available device list 409 may include the identifiers of one or more available devices.

[0285] For example, Figure 7 The identifiers of the available devices in the available device list 409 shown in (4) include the identifier of the tablet computer "MagicPad" and the identifier of the wireless earphone "Earbuds3i".

[0286] It should be noted that Figure 7 The identifiers of the available devices in the available device list 409 shown in (4) are merely illustrative identifiers of the available devices. According to actual conditions, the identifiers of other available devices may also be included, and this application does not limit this.

[0287] Optionally, the available devices include discovered and non-paired devices (or Bluetooth devices, i.e. devices with Bluetooth function enabled). It can be understood that the available devices have never established a Bluetooth connection with the mobile phone, or the available devices have established a Bluetooth connection with the mobile phone, but the mobile phone does not store the fingerprint information of the available devices.

[0288] For example, a laptop has established a Bluetooth connection with a mobile phone, but after the mobile phone is initialized, the fingerprint information of the laptop is deleted. Accordingly, the laptop is not a paired device for the mobile phone. It can be understood that the way to distinguish whether it is a paired device is whether the mobile phone has stored its fingerprint information.

[0289] For example, in one embodiment, Figure 8 It is a schematic diagram of an exemplary interface, which illustrates that "a user can enter the sliding notification bar (or status bar) of the mobile phone and turn on the Bluetooth function of the mobile phone through the Bluetooth switch control in the sliding notification bar of the mobile phone."

[0290] Reference Figure 8(1), illustratively, the main interface 501 of the mobile phone may include one or more controls, for example, including but not limited to: an icon for the mobile phone battery level, an icon for the mobile network signal, an icon for the Wi-Fi signal, an icon for the time, and icons for multiple applications, etc. Among them, application icons include but are not limited to: an icon for the settings application, an icon for the calendar application, and an icon for the gallery application, etc. For details, see Figure 8 (1) and will not be elaborated here.

[0291] It should be noted that Figure 8 The application icons shown in (1) are merely illustrative application icons. Depending on actual conditions, other application icons may also be included, and this application does not limit this.

[0292] If the user needs to turn on the Bluetooth function of the mobile phone, the user can input a downward sliding operation starting from the right side of the upper edge of the mobile phone screen. The mobile phone responds to the downward sliding operation starting from the right side of the upper edge of the mobile phone screen and displays the sliding notification bar 502. For example, illustratively, the sliding notification bar 502 is displayed in a floating manner in the area above the main interface 501 of the mobile phone.

[0293] Reference Figure 8 (2) Exemplarily, the sliding notification bar 502 may include one or more controls, for example, including but not limited to: a WLAN switch control, a Bluetooth switch control 503, a volume adjustment control, a screenshot control, and a screen recording control.

[0294] It should be noted that Figure 8 The various controls shown in (2) are merely illustrative controls and may include other controls depending on actual conditions. This application does not limit this.

[0295] At this time, the Bluetooth function of the mobile phone is in the on state, so Figure 8 (2) The Bluetooth switch control 503 in the sliding notification bar 502 indicates that the Bluetooth function of the mobile phone is turned off. Figure 8 As shown in (2), the Bluetooth switch control 503 in the sliding notification bar 502 indicates that the Bluetooth function of the mobile phone is in the off state. Figure 8 (2) will not be elaborated here.

[0296] If the user needs to turn on the Bluetooth function of the mobile phone, the user can input a single click operation to the Bluetooth switch control 503 to turn on the Bluetooth function of the mobile phone. In response to the single click operation input by the user to the Bluetooth switch control 503, the mobile phone turns on the Bluetooth function of the mobile phone.

[0297] Further, refer to Figure 8(3) After the Bluetooth function of the mobile phone is turned on, the content in the sliding notification bar 502 changes.

[0298] For example, the Bluetooth function of the mobile phone is turned on at this time, for example, Figure 8 (3) In the example, the color of the Bluetooth switch control 503 changes. Figure 8 (3) The Bluetooth switch control 503 shown indicates that the Bluetooth function is turned on. Figure 8 (3) The Bluetooth switch control 503 shown indicates that the Bluetooth function of the mobile phone is turned on. Figure 8 (3) will not be elaborated here.

[0299] Secondly, in Figure 8 In (3), a Bluetooth icon 504 is also displayed on the left side of the mobile phone battery icon to indicate that the Bluetooth function of the mobile phone is turned on. Figure 8 As shown in (3), the Bluetooth icon 504 displayed on the left side of the icon of the mobile phone battery level indicates that the Bluetooth function of the mobile phone is turned on.

[0300] Secondly, in Figure 8 (3), a Bluetooth extension control 505 is also displayed on the right side of the Bluetooth switch control 503, for example, Figure 8 The Bluetooth extension control 505 in (3) is in the shape of a triangle.

[0301] Of course, it is understandable that the Bluetooth extension control 505 may also be in other shapes, and the present application does not limit the shape of the Bluetooth extension control 505.

[0302] Reference Figure 8 (4) After turning on the Bluetooth function of the mobile phone, the user can input a long press operation on the Bluetooth extension control 505. In response to the long press operation input by the user on the Bluetooth extension control 505, the mobile phone displays a paired interface 506. For example, illustratively, the paired interface 506 is displayed in a floating manner in the area below the main interface 501 of the mobile phone.

[0303] The paired interface 506 displays a paired device list 507, which includes one or more paired device identifiers. The device identifier may include the name or type of the device. For example, Figure 8 The paired device identifiers in the paired device list 507 shown in (4) include the identifier of the wireless headset "FlyPods3" and the identifier of the mobile phone "HonorX40".

[0304] It should be noted that Figure 8The identifiers of the paired devices in the paired device list 507 shown in (4) are merely illustrative examples of the identifiers of the paired devices. Depending on actual conditions, the identifiers of other paired devices may also be included, and this application does not limit this.

[0305] For the explanation of the paired device list 507 , reference may be made to the explanation of the paired device list 408 mentioned above, which will not be described in detail here.

[0306] For example, in one embodiment, Fig.9A and Fig. 9B It is a schematic diagram of an exemplary interface, which illustrates that "a user can enable the Bluetooth function of a mobile phone by transferring files in a certain application of the mobile phone."

[0307] Reference Fig.9A (1), illustratively, the main interface 601 of the mobile phone may include one or more controls, for example, including but not limited to: an icon of the mobile phone battery level, an icon of the mobile network signal, an icon of the Wi-Fi signal, an icon of the time, and icons of multiple applications, etc. Among them, the application icons include but are not limited to: an icon of the setting application, an icon of the calendar application, and an icon 602 of the gallery application, etc. For details, please refer to Fig.9A (1) and will not be elaborated here.

[0308] It should be noted that Fig.9A The application icons shown in (1) are merely illustrative application icons. Depending on actual conditions, other application icons may also be included, and this application does not limit this.

[0309] If the user needs to enter the gallery application to view pictures, the user can input a single click operation on the gallery application icon 602 on the main interface 601 of the mobile phone to enter the gallery application interface 603. In response to the user's single click operation on the gallery application icon 602, the mobile phone displays the gallery application interface 603.

[0310] Reference Fig.9A (2) For example, the interface 603 of the gallery application may include multiple picture icons and one or more controls. For example, the multiple picture icons include an icon 604 of a picture.

[0311] It should be noted that Fig.9A The icons and controls shown in (2) are merely illustrative icons and controls. Other icons and controls may also be included depending on actual conditions, and this application does not limit this.

[0312] See also Fig.9A(3) If the user needs to share the picture (the picture corresponding to the picture icon 604) with others, the user can input a long press operation on the picture icon 604. The mobile phone responds to the user's long press operation on the picture icon 604, so that the picture icon 604 is selected.

[0313] Secondly, the interface 603 of the gallery application has changed. For example, the state of the picture icon 604 has changed to a selected state, and multiple controls are displayed below the interface 603 of the gallery application, such as a share control 605, a select all control, a create control, a delete control, and more controls.

[0314] It should be noted that Fig.9A The various controls shown in (3) are merely illustrative controls and may include other controls depending on actual conditions. This application does not limit this.

[0315] Afterwards, the user may input a single-click operation on the sharing control 605. In response to the single-click operation on the sharing control 605 by the user, the mobile phone displays a sharing interface 606 in a floating manner in the area below the interface 603 of the gallery application.

[0316] See also Fig. 9B (1) Exemplarily, the sharing interface 606 may include one or more controls, for example, including but not limited to: a Bluetooth control 607, a memo control, a send to friend control, a screen casting control, and a send to computer control.

[0317] It should be noted that Fig. 9B The various controls shown in (1) are merely illustrative controls. Other controls may also be included depending on actual conditions, and this application does not limit this.

[0318] When the user needs to share the picture with other people via Bluetooth, the user can input a single-click operation on the Bluetooth control 607 .

[0319] See also Fig. 9B (2) Exemplarily, in response to a single click operation of the user on the Bluetooth control 607, the mobile phone displays a Bluetooth enable prompt box 608, where the Bluetooth enable prompt box 608 is used to prompt: "If you want to use the Bluetooth service, please turn on Bluetooth first. Do you want to turn on Bluetooth immediately?" The Bluetooth enable prompt box 608 also includes a cancel button and an enable button 609.

[0320] It should be noted that Fig. 9B The Bluetooth-enabling prompt box 608 shown in (2) is merely an illustrative example of the Bluetooth-enabling prompt box 608. Depending on the actual situation, the Bluetooth-enabling prompt box 608 may also include other content or be in other forms of prompt content, and this application does not limit this.

[0321] When the user needs to turn on the Bluetooth function of the mobile phone, the user can input a single click operation on the turn-on button 609. Fig. 9B (3) Exemplarily, the mobile phone displays a Bluetooth device selection interface 610 in response to the user's single-click operation on the start button 609. For example, the Bluetooth device selection interface 610 is displayed in a floating manner in the area below the interface 603 of the gallery application.

[0322] The Bluetooth device selection interface 610 displays an available device list 611. The available device list 611 may include one or more identifiers of available devices. The identifier of the device may include the name or type of the device. For example, Fig. 9B The identifiers of the available devices in the available device list 611 shown in (3) include the identifier of the tablet computer “MagicPad” and the identifier of the wireless earphone “Earbuds3i”.

[0323] It should be noted that Fig. 9B The contents in the Bluetooth device selection interface 610 and the contents in the available device list 611 shown in (3) are merely illustrative examples, and other contents may also be included according to actual circumstances, and this application does not limit this.

[0324] For the explanation of the available device list 611, reference may be made to the explanation of the available device list 409 mentioned above, which will not be described in detail here.

[0325] Secondly, in Fig. 9B In (3), a Bluetooth icon 612 is also displayed to the left of the icon of the mobile phone battery level to indicate that the Bluetooth function of the mobile phone is turned on. Fig. 9B As shown in (3), the Bluetooth icon 612 displayed on the left side of the icon of the mobile phone battery level indicates that the Bluetooth function of the mobile phone is turned on.

[0326] In addition, the embodiment of the present application does not specifically limit the manner in which the wireless headset activates the Bluetooth function. The following are illustrative examples.

[0327] For example, the wireless headset is Figure 1 The wireless headset shown in Figure 1 When the wireless headset is in a turned-off state, the user can turn on the wireless headset through a physical on / off button. After the wireless headset is turned on, the wireless headset can automatically turn on the Bluetooth function of the wireless headset.

[0328] For another example, see Fig.10 The wireless earphone is located in an earphone box. When the earphone cover of the earphone box is closed, the user can lift the earphone cover of the earphone box, and the earphone box can trigger the wireless earphone to turn on the Bluetooth function of the wireless earphone.

[0329] S302, the mobile phone and the wireless headset enter the Page stage.

[0330] Exemplarily, the mobile phone may be triggered by the user to actively establish a first Bluetooth connection with the wireless headset, that is, enter the Page stage.

[0331] Or, illustratively, the mobile phone can automatically trigger the establishment of the first Bluetooth connection with the wireless headset through the service executed by the mobile phone, that is, enter the Page stage.

[0332] It should be noted that in the embodiment of the present application, the Page stage is used as an example to illustrate the starting point for establishing the first Bluetooth connection between the mobile phone and the wireless headset. After the Page stage is completed, that is, the mobile phone and the wireless headset successfully Page, it can be considered that the first Bluetooth connection between the mobile phone and the wireless headset has been successfully established. On the contrary, if the mobile phone fails to successfully Page with the wireless headset, it can be considered that the first Bluetooth connection between the mobile phone and the wireless headset has not been successfully established, that is, the Bluetooth connection establishment fails.

[0333] Optionally, in other embodiments, the discovery phase or the data transmission phase may also be considered as the starting point for establishing the Bluetooth connection. This application does not limit this.

[0334] For a description of the Page phase between the mobile phone and the wireless headset, please refer to the subsequent Fig.11 and Fig.23 The illustrated embodiment will not be described in detail here.

[0335] S303, the mobile phone and the wireless headset perform data transmission.

[0336] After the Page stage is completed, the mobile phone and the wireless headset can interact with each other based on the Bluetooth connection between the two, for example, transmitting data to each other.

[0337] The following is an example of the Page stage between a mobile phone and a wireless headset.

[0338] Fig.11 The schematic diagram of the process of the Page stage between the mobile phone and the wireless headset is shown as an example. The method of the process is applied to the mobile phone, see Fig.11 , specifically including:

[0339] S701: Obtain a first connection request. The first connection request is used to establish a first Bluetooth connection between a mobile phone and a wireless headset.

[0340] For example, the first connection request indicates that the mobile phone needs to establish a first Bluetooth connection with the opposite end (eg, a wireless headset). Thus, the mobile phone can establish the first Bluetooth connection between the mobile phone and the wireless headset according to the first connection request, i.e., enter the Page stage.

[0341] This application does not specifically limit the manner in which the mobile phone obtains the first connection request.

[0342] For example, based on Figure 7 For the example shown in (4), see Fig.12 , assuming that the user needs to control the mobile phone to establish a first Bluetooth connection between the wireless headset corresponding to the identifier "FlyPods3" 410. The user can input a single-click operation on the identifier "FlyPods3" 410 of the paired device in the paired device list 408. In response to the single-click operation input by the user on the identifier "FlyPods3" 410 of the paired device in the paired device list 408, the mobile phone can be informed that the first Bluetooth connection between the mobile phone and the wireless headset corresponding to the identifier "FlyPods3" 410 needs to be established, and then a first connection request can be generated, and the first connection request is used to establish the first Bluetooth connection between the mobile phone and the wireless headset corresponding to the identifier "FlyPods3" 410.

[0343] For example, based on Figure 8 For the example shown in (4), see Fig.13 , assuming that the user needs to control the mobile phone to establish a first Bluetooth connection between the wireless headset corresponding to the identifier "FlyPods3" 508. The user can input a single-click operation on the identifier "FlyPods3" 508 of the paired device in the paired device list 507. In response to the single-click operation input by the user on the identifier "FlyPods3" 508 of the paired device in the paired device list 507, the mobile phone can be informed that the first Bluetooth connection between the mobile phone and the wireless headset corresponding to the identifier "FlyPods3" 508 needs to be established, and then a first connection request can be generated, and the first connection request is used to establish the first Bluetooth connection between the mobile phone and the wireless headset corresponding to the identifier "FlyPods3" 508.

[0344] For example, based on Fig. 9B (3) shows an example, see Fig.14, assuming that the user needs to control the mobile phone to establish the first Bluetooth connection between the wireless headset corresponding to the identifier "Earbuds3i" 613. The user can input a single-click operation on the identifier "Earbuds3i" 613 of the available device in the available device list 611. In response to the single-click operation input by the user on the identifier "Earbuds3i" 613 of the paired device in the paired device list 611, the mobile phone can be informed that the first Bluetooth connection between the mobile phone and the wireless headset corresponding to the identifier "Earbuds3i" 613 needs to be established, and then a first connection request can be generated, which is used to establish the first Bluetooth connection between the mobile phone and the wireless headset corresponding to the identifier "Earbuds3i" 613.

[0345] exist Figure 12 to Figure 14 In the example shown, the user may manually specify the peer end to which the mobile phone needs to establish the first Bluetooth connection (for example, Fig.12 The peer end specified in is the wireless headset corresponding to the identifier "FlyPods3" 410, Fig.13 The peer end specified in is the wireless headset corresponding to the identifier "FlyPods3" 508, Fig.14 The other end specified in is the wireless headset corresponding to the identifier "Earbuds3i" 613). And the first connection request is a connection request manually triggered by the user.

[0346] For example, the first connection request is a connection request triggered by a user's control operation input to the mobile phone, and the control operation includes an operation to establish a Bluetooth connection, etc. The operation to establish a Bluetooth connection includes: a single-click operation on the identifier of an external device in the available device list or the paired device list, etc.

[0347] In addition, after the Bluetooth function of the mobile phone is manually turned on, the mobile phone automatically reconnects (automatically connects to the external device that was connected last time, and the external device and the mobile phone are paired), thereby generating the first connection request related to automatic reconnection.

[0348] Secondly, in some other embodiments, the first connection request may also be a connection request automatically triggered by a service executed by the mobile phone, and the mobile phone automatically specifies the opposite end with which the mobile phone needs to establish the first Bluetooth connection.

[0349] For example, the first connection request is a connection request automatically triggered by a preset type of service executed by the mobile phone, and the preset type includes at least an audio type, a video type, and a call type.

[0350] For example, audio services include services such as mobile phone voice playback (eg, mobile phone music playback or voice messages in network applications, etc.).

[0351] Video services include: mobile phone video playback (for example, mobile phone playback of online movies, online short videos) and the like.

[0352] The call type services include: outgoing call services from the mobile phone and incoming call services received by the mobile phone.

[0353] Sometimes a wireless headset is used when a mobile phone executes a preset type of service. Thus, when the mobile phone is about to execute or is executing a preset type of service, it is determined that a first Bluetooth connection can be established between the mobile phone and the wireless headset, and the wireless headset and the mobile phone have been paired.

[0354] When the mobile phone obtains the first connection request, the mobile phone may be establishing a second Bluetooth connection between the mobile phone and another external device according to the second connection request, or may not be establishing a Bluetooth connection with any external device.

[0355] For example, in one example, when the mobile phone obtains the first connection request, if the mobile phone is not establishing a Bluetooth connection with any external device, the mobile phone can immediately execute step S706: establish a first Bluetooth connection between the mobile phone and the wireless headset according to the first connection request.

[0356] However, in another example, when the mobile phone obtains the first connection request, if the mobile phone is establishing a second Bluetooth connection between the mobile phone and the other external device according to the second connection request, the mobile phone will not execute step S706 at this time: establishing the first Bluetooth connection between the mobile phone and the wireless headset according to the first connection request, but will establish the first Bluetooth connection between the mobile phone and the wireless headset according to the first connection request after waiting for the process of establishing the second Bluetooth connection between the mobile phone and the other external device to be completed.

[0357] Therefore, after the mobile phone receives the first acquisition request, step S702 can be executed, so that the mobile phone can know whether to immediately establish the first Bluetooth connection between the mobile phone and the wireless headset according to the first connection request, or not to establish the first Bluetooth connection between the mobile phone and the wireless headset according to the first connection request, but to establish the first Bluetooth connection between the mobile phone and the wireless headset according to the first connection request after the mobile phone times out in the process of establishing a second Bluetooth connection with other external devices or successfully establishes the second Bluetooth connection between the mobile phone and the other external device before timeout.

[0358] S702: Detect whether the mobile phone is establishing a second Bluetooth connection between the mobile phone and another external device according to the second connection request.

[0359] The second connection request is different from the first connection request, the other external device is different from the mobile phone, and the first Bluetooth connection is different from the second Bluetooth connection.

[0360] The connection request being processed by the mobile phone can be regarded as the second connection request, and the Bluetooth connection between the mobile phone and an external device established by the mobile phone according to the connection request being processed can be regarded as the second Bluetooth connection. The external device related to the connection request being processed by the mobile phone and the second Bluetooth connection can be regarded as other external devices.

[0361] When a second Bluetooth connection is being established between the mobile phone and the other external device according to the second connection request, S703 obtains the timeliness priority of the first connection request and obtains the timeliness priority of the second connection request.

[0362] As mentioned above, when the mobile phone is establishing a second Bluetooth connection between the mobile phone and the other external device according to the second connection request, the mobile phone may not establish the first Bluetooth connection between the mobile phone and the wireless headset according to the first connection request first, and after the mobile phone times out in the process of establishing the second Bluetooth connection with the other external device or successfully establishes the second Bluetooth connection between the mobile phone and the other external device before timeout, the mobile phone may establish the first Bluetooth connection between the mobile phone and the wireless headset according to the first connection request.

[0363] However, since it is necessary to wait for the process of waiting for the mobile phone to establish the second Bluetooth connection with the other external device to time out and successfully establish the second Bluetooth connection between the mobile phone and the other external device before the timeout, the process from the mobile phone receiving the first connection request to the successful establishment of the first Bluetooth connection between the mobile phone and the wireless headset takes a long time, for example, more than 10 seconds, etc., which results in slow speed and low efficiency in establishing the first Bluetooth connection between the mobile phone and the wireless headset, long waiting time for the user, and poor user experience.

[0364] To this end, in the present application, when the mobile phone is establishing a second Bluetooth connection between the mobile phone and another external device according to a second connection request, the timeliness priority of the first connection request can be obtained, and the timeliness priority of the second connection request can be obtained.

[0365] As mentioned above, the connection request for establishing a Bluetooth connection in the present application may include: a connection request triggered manually, a connection request automatically triggered by a service, and a connection request other than a connection request triggered manually and a connection request automatically triggered by a service.

[0366] In addition to the connection request triggered manually and the connection request automatically triggered by the service, the connection request may include: when the mobile phone and the external device are both in an idle state and the mobile phone and the external device (such as a wireless headset) are paired, without manual triggering and without automatic service triggering, the mobile phone may automatically generate a first connection request for establishing a first Bluetooth connection between the mobile phone and the external device in the background. For example, the mobile phone automatically forms a network in the background.

[0367] Among them, the mobile phone and the external device are both in idle state, which can be understood as: there is currently no Bluetooth connection between the mobile phone and the other device, there is currently no Bluetooth connection between the external device and the other device, the mobile phone is not establishing a Bluetooth connection with the other device, and the external device is not establishing a Bluetooth connection with the other device, etc.

[0368] A manually triggered connection request, a service automatically triggered connection request, and a connection request other than a manually triggered connection request and a service automatically triggered connection request have their own timeliness priority.

[0369] Exemplarily, the timeliness priority of a manually triggered connection request is a high priority. The timeliness priority of a service automatically triggered connection request is a medium priority. The timeliness priority of connection requests other than manually triggered connection requests and service automatically triggered connection requests is a low priority.

[0370] In this way, when obtaining the timeliness priority of the first connection request, in response to the first connection request being a manually triggered connection request, the timeliness priority of the first connection request can be determined as a high priority; or, in response to the first connection request being a connection request automatically triggered by a service, the timeliness priority of the first connection request can be determined as a medium priority; or, in response to the first connection request being a connection request other than a manually triggered connection request and a connection request automatically triggered by a service, the timeliness priority of the first connection request can be determined as a low priority.

[0371] Also, when obtaining the timeliness priority of the second connection request, in response to the second connection request being a manually triggered connection request, the timeliness priority of the second connection request can be determined to be a high priority; or, in response to the second connection request being a connection request automatically triggered by a service, the timeliness priority of the second connection request can be determined to be a medium priority; or, in response to the second connection request being a connection request other than a manually triggered connection request and a connection request automatically triggered by a service, the timeliness priority of the second connection request can be determined to be a low priority.

[0372] The manually triggered connection request is often the connection request that the user pays the most attention to, and its timeliness priority is often higher than the connection request automatically triggered by the service. The connection requests other than the manually triggered connection request and the connection request automatically triggered by the service are often the connection requests that the user does not pay much attention to. Thus, the timeliness priority of the connection requests other than the manually triggered connection request and the connection request automatically triggered by the service is often lower than the timeliness priority of the connection request automatically triggered by the service. Thus, by determining the timeliness priority of the first connection request and the timeliness priority of the second connection request in the above manner, the accuracy of the determined timeliness priority of the first connection request and the timeliness priority of the second connection request can be improved.

[0373] S704: Compare the timeliness priority of the first connection request with the timeliness priority of the second connection request.

[0374] In this application, high priority is higher than medium priority, and medium priority is higher than low priority.

[0375] Thus, in one embodiment of the present application, when the timeliness priority of the first connection request and the timeliness priority of the second connection request are not both high priorities, or are not both medium priorities, or are not both low priorities, the relationship between the timeliness priority of the first connection request and the timeliness priority of the second connection request can be directly determined based on the standard of "high priority is higher than medium priority, and medium priority is higher than low priority".

[0376] Alternatively, in another embodiment of the present application, when the timeliness priority of the first connection request and the timeliness priority of the second connection request are both high priorities, or both medium priorities, or both low priorities, the high-low relationship between the timeliness priority of the first connection request and the timeliness priority of the second connection request can be determined in the following manner.

[0377] For instance, in one example, when the timeliness priority of the first connection request is high priority and the timeliness priority of the second connection request is high priority, since the second connection request is obtained by the mobile phone before obtaining the first connection request, that is, the time when the mobile phone obtains the first connection request is later than the time when the mobile phone obtains the second connection request, in the present application, the timeliness requirement for the connection request that is obtained later is higher, and therefore, the timeliness requirement for the first connection request is often higher than the timeliness requirement for the second connection request. In this way, it can be determined that the timeliness priority of the first connection request is higher than the timeliness priority of the second connection request.

[0378] Alternatively, in another example, when the timeliness priority of the first connection request is medium priority and the timeliness priority of the second connection request is medium priority, since the second connection request is obtained by the mobile phone before obtaining the first connection request, that is, the time when the mobile phone obtains the first connection request is later than the time when the mobile phone obtains the second connection request, in the present application, the timeliness requirement for the connection request that is obtained later is higher, and therefore, the timeliness requirement for the first connection request is often higher than the timeliness requirement for the second connection request. In this way, it can be determined that the timeliness priority of the first connection request is higher than the timeliness priority of the second connection request.

[0379] Alternatively, in another example, when the timeliness priority of the first connection request is low priority and the timeliness priority of the second connection request is low priority, since the second connection request is obtained by the mobile phone before obtaining the first connection request, that is, the time when the mobile phone obtains the first connection request is later than the time when the mobile phone obtains the second connection request, in the present application, the timeliness requirement for the connection request that is obtained later is higher, and therefore, the timeliness requirement for the first connection request is often higher than the timeliness requirement for the second connection request. In this way, it can be determined that the timeliness priority of the first connection request is higher than the timeliness priority of the second connection request.

[0380] When the timeliness priority of the first connection request is higher than the timeliness priority of the second connection request, S705 , interrupting the step of establishing a second Bluetooth connection between the mobile phone and the other external device according to the second connection request.

[0381] S706: Establish a first Bluetooth connection between the mobile phone and the wireless headset according to the first connection request.

[0382] The term “interrupting the step of establishing a second Bluetooth connection between the mobile phone and the other external device according to the second connection request” can be understood as: for other external devices, interrupting the connection of the physical link for establishing the second Bluetooth connection between the mobile phone and the other external devices.

[0383] Furthermore, after successfully establishing the first connection between the mobile phone and the wireless headset, the step of establishing a second Bluetooth connection between the mobile phone and the other external device according to the second connection request can be resumed to continue trying to establish the second Bluetooth connection between the mobile phone and the other external device.

[0384] Alternatively, when the timeliness priority of the first connection request is lower than the timeliness priority of the second connection request, the step of establishing the second Bluetooth connection between the mobile phone and the other external device according to the second connection request is not interrupted, and step S707 can be executed: continue to execute the step of establishing the second Bluetooth connection between the mobile phone and the other external device according to the second connection request, and do not establish the first Bluetooth connection between the mobile phone and the wireless headset according to the first connection request first, and after the mobile phone times out in the process of establishing the second Bluetooth connection with the other external device or successfully establishes the second Bluetooth connection between the mobile phone and the other external device before timeout, establish the first Bluetooth connection between the mobile phone and the wireless headset according to the first connection request.

[0385] Furthermore, in another embodiment of the present application, after obtaining the timeliness priority of the first connection request, the first connection request may be stored in the request queue according to the timeliness priority of the first connection request, so as to record that the first connection request needs to be processed but has not been processed yet.

[0386] The request queue is used to store connection requests. For example, the request queue is used to store connection requests that need to be processed but have not been processed yet in the order of time priority.

[0387] A connection request that has not been processed yet can be understood as: the mobile phone has not successfully established a Bluetooth connection between the mobile phone and the corresponding external device based on this connection request (the mobile phone may have previously attempted to establish a Bluetooth connection between the mobile phone and the corresponding external device based on this connection request, or may have not previously attempted to establish a Bluetooth connection between the mobile phone and the corresponding external device based on this connection request, but both attempts have failed to successfully establish a Bluetooth connection between the mobile phone and the corresponding external device).

[0388] in, Fig.15 The schematic diagram of the request queue before the first connection request is stored in the request queue is exemplified. For example, before the mobile phone obtains the first connection request, four connection requests for establishing a Bluetooth connection have been obtained, namely the second connection request, the third connection request, the fourth connection request and the fifth connection request.

[0389] The second connection request, the third connection request, the fourth connection request and the fifth connection request can be used to establish Bluetooth connections between the mobile phone and different external devices respectively.

[0390] Exemplarily, the timeliness priority of the second connection request is higher than the timeliness priority of the third connection request, the timeliness priority of the third connection request is higher than the timeliness priority of the fourth connection request, and the timeliness priority of the fourth connection request is higher than the timeliness priority of the fifth connection request.

[0391] Fig.15 The request queue shown stores the second connection request, the third connection request, the fourth connection request and the fifth connection request in order from high to low time priority.

[0392] Since the timeliness priority of the first connection request is higher than the timeliness priority of the second connection request, see Fig.16 , you can Fig.15 The first connection request is stored at the first position in the request queue shown, and then it can be obtained Fig.17 The request queue is shown.

[0393] In the present application, the request queue is maintained by the Bluetooth manager in the mobile phone, and the connection requests stored in the request queue have a sequence, and the timeliness priority of the connection requests in the earlier sequence is higher than the timeliness priority of the connection requests in the later sequence.

[0394] In one embodiment, the timeliness priority of the first connection request is a high priority; thus, when storing the first connection request in the request queue according to the timeliness priority of the first connection request, the first connection request can be stored before all the connection requests in the request queue.

[0395] For example, when there is no high-priority connection request in the request queue, the first connection request may be stored before all the connection requests in the request queue, so that the first connection request is located at the first position in the request queue.

[0396] Alternatively, when there are high-priority connection requests in the request queue, the first connection request is stored in a position in the request queue before all high-priority connection requests, so that the first connection request is located at the first position in the request queue.

[0397] In another embodiment, the timeliness priority of the first connection request is medium priority; thus, when the first connection request is stored in the request queue according to the timeliness priority of the first connection request, in one example, if there is no medium priority connection request in the request queue, if there is no high priority connection request in the request queue, the first connection request is stored in a position before all the connection requests in the request queue, so that the first connection request is located at the first position in the request queue; or, if there is a high priority connection request in the request queue, in the request queue, a position after the last connection request in the high priority order and adjacent to the last connection request in the order is determined, and the first connection request is stored in the determined position. So that the first connection request is located after all the high priority connection requests in the request queue.

[0398] Alternatively, in another example, when there are medium-priority connection requests in the request queue, in the request queue, a position that is before the first-ranked connection request in the medium priority and adjacent to the first-ranked connection request is determined; and the first connection request is stored at the determined position.

[0399] For example, if there is no high-priority connection request in the request queue, the first connection request is stored in a position before all the connection requests in the request queue (i.e., before the first connection request in the medium priority order and adjacent to the first connection request), so that the first connection request is located at the first position in the request queue.

[0400] Alternatively, if there are high-priority connection requests in the request queue, the first connection request is stored after all high-priority connection requests in the request queue and adjacent to the last high-priority connection request in sequence, so that the first connection request is the first connection request in sequence among all medium-priority connection requests in the request queue.

[0401] Furthermore, in another embodiment of the present application, after interrupting the execution of the step of establishing a second Bluetooth connection between the mobile phone and the other external device according to the second connection request, it is detected whether the number of processing times of the second connection request is greater than or equal to a preset number; when the number of processing times of the second connection request is greater than or equal to the preset number, it is very likely that the external device involved in the second connection request does not have the objective conditions for establishing a Bluetooth connection with the mobile phone, etc., and therefore, the second connection request can be deleted from the request queue. In this way, it can be avoided that the mobile phone extracts the second connection request from the request queue again, and the Bluetooth connection with this external device can no longer be established according to the second connection request, that is, it is avoided to try to establish the second Bluetooth connection between the mobile phone and the other external device according to the second connection request again, so as to save system resources of the mobile phone.

[0402] The number of times the second connection request is processed may be understood as: the number of times the second Bluetooth connection is attempted to be established according to the second connection request, and the like.

[0403] Exemplarily, when the number of times the second connection request is processed is greater than or equal to the preset number of times, see Fig.18 ,exist Fig.17 In the queue request shown in the embodiment shown, the second connection request is deleted, and then the result can be obtained. Fig.19 The request queue is shown.

[0404] The preset number of times may include 2, 3 or 4, etc., which may be determined according to actual conditions and is not limited in this application.

[0405] Furthermore, in another embodiment of the present application, after the first Bluetooth connection between the mobile phone and the wireless headset is successfully established according to the first connection request, the first connection request can be deleted from the request queue. In this way, the mobile phone can be prevented from extracting the first connection request from the request queue again, thereby avoiding the mobile phone from repeatedly processing the first connection request. That is, when the first Bluetooth connection between the mobile phone and the wireless headset has been successfully established according to the first connection request, it is avoided to try to establish the first Bluetooth connection between the mobile phone and the wireless headset again according to the first connection request, thereby saving system resources of the mobile phone.

[0406] Exemplarily, after successfully establishing the first Bluetooth connection between the mobile phone and the wireless headset according to the first connection request, see Fig. 20 ,exist Fig.19 In the queue request shown in the embodiment shown, the first connection request is deleted, and then the Fig.21 The request queue is shown.

[0407] In one embodiment of the present application, after the first connection request is stored in the request queue, the first connection request may or may not be located at the first position in the request queue, that is, the first connection request may or may not be the connection request with the highest timeliness priority in the request queue, but it is certain that the timeliness priority of the first connection request is higher than the timeliness priority of the second connection request.

[0408] To this end, in this embodiment, regardless of whether the first connection request is at the top of the request queue, if the timeliness priority of the first connection request is higher than the timeliness priority of the second connection request, the mobile phone can interrupt the execution of the step of establishing the second Bluetooth connection between the mobile phone and the other external device according to the second connection request, and the first Bluetooth connection between the mobile phone and the wireless headset according to the first connection request. After interrupting the execution of the step of establishing the second Bluetooth connection between the mobile phone and the other external device according to the second connection request, the newly acquired first connection request is processed first, so that the connection request with a timeliness priority higher than the timeliness priority of the second connection request being processed can be processed first, so as to improve the timeliness of processing the connection request.

[0409] Secondly, in another embodiment of the present application, after the first connection request is stored in the request queue, when the time priority of the first connection request is higher than the time priority of the second connection request, if the first connection request is at the top of the request queue, that is, the first connection request is the connection request with the highest time priority in the request queue, the mobile phone interrupts the execution of the step of establishing a second Bluetooth connection between the mobile phone and the other external device according to the second connection request, and establishes a first Bluetooth connection between the mobile phone and the wireless headset according to the first connection request.

[0410] Specifically, before the mobile phone interrupts the step of establishing a second Bluetooth connection between the mobile phone and the other external device according to the second connection request, it can be detected whether the first connection request is at the first place in the request queue; when the first connection request is at the first place in the request queue, the step of establishing a second Bluetooth connection between the mobile phone and the other external device according to the second connection request is interrupted again, and the first Bluetooth connection between the mobile phone and the wireless headset is established according to the first connection request.

[0411] That is, in this embodiment, after interrupting the execution of the step of establishing a second Bluetooth connection between the mobile phone and the other external device according to the second connection request, the processing request at the top of the request queue is processed first, so that the connection request with the highest time priority can be processed first, so as to further improve the timeliness of processing the connection request.

[0412] In the present application, during the process of a mobile phone establishing a Bluetooth connection with an external device, if an attempt to establish a Bluetooth connection with the external device fails, the mobile phone will continue to try to establish a Bluetooth connection with the external device until the number of attempts to establish a Bluetooth connection with the external device reaches a preset number. Regardless of whether a Bluetooth connection is established, the mobile phone will no longer try to establish a Bluetooth connection with the external device. For example, according to statistics, it is often because the external device does not have the objective conditions to establish a Bluetooth connection with the mobile phone, etc. Therefore, the mobile phone may no longer try to establish a Bluetooth connection with the external device to save system resources of the mobile phone.

[0413] According to statistics, the time taken to attempt to establish a Bluetooth connection between a mobile phone and an external device for a preset number of consecutive times is often within a range. In this way, a default connection timeout period can be set, and the default connection timeout period is within the range.

[0414] In one embodiment, when the timeliness priority of the first connection request is higher than the timeliness priority of the second connection request, the step of establishing the second Bluetooth connection between the mobile phone and the other external device according to the second connection request may be immediately interrupted.

[0415] However, when the mobile phone obtains the first connection request, the mobile phone is establishing a second Bluetooth connection between the mobile phone and the other external device according to the second connection request. At this time, the second Bluetooth connection between the mobile phone and the other external device may be successfully established. In this case, if the step of establishing the second Bluetooth connection between the mobile phone and the other external device according to the second connection request is interrupted immediately, the second Bluetooth connection between the mobile phone and the other external device will not be successfully established. In other words, for "establishing the second Bluetooth connection between the mobile phone and the other external device", it will fail, and the already executed process in the process of "establishing the second Bluetooth connection between the mobile phone and the other external device" will no longer be valid, and the system resources consumed will become silent costs. In the case of needing to retry to establish the second Bluetooth connection between the mobile phone and the other external device according to the second connection request, the already executed process in the aforementioned process of "establishing the second Bluetooth connection between the mobile phone and the other external device" needs to be re-executed, wasting system resources in vain.

[0416] Therefore, in another embodiment of the present application, when the timeliness priority of the first connection request is higher than the timeliness priority of the second connection request, it can be detected whether the second Bluetooth connection between the mobile phone and the other external device is successfully established according to the second connection request within a preset time length starting from the starting time; the preset time length is less than the default connection timeout time length; the starting time includes: the detection time when it is detected whether the second Bluetooth connection between the mobile phone and the other external device is being established according to the second connection request; for example, the preset time length can include 1 second, 1.5 seconds, 2 seconds or 2.5 seconds, which can be determined according to the actual situation, and the present application does not limit this.

[0417] If the second Bluetooth connection between the mobile phone and the other external device is not successfully established according to the second connection request within the preset time period starting from the starting time, interrupting the step of establishing the second Bluetooth connection between the mobile phone and the other external device according to the second connection request;

[0418] Alternatively, if the second Bluetooth connection between the mobile phone and the other external device is successfully established according to the second connection request within a preset time period starting from the starting time, it can be said that the step of establishing the second Bluetooth connection between the mobile phone and the other external device according to the second connection request has been completed. In this way, there is no need to interrupt the step of establishing the second Bluetooth connection between the mobile phone and the other external device according to the second connection request. At this time, the first Bluetooth connection between the mobile phone and the wireless headset can be directly established according to the first connection request.

[0419] In the present application, in the case that the mobile phone has previously obtained the second connection request, the mobile phone will store the second connection request in the request queue, that is, the second connection request is located in the request queue.

[0420] Thus, in one embodiment of the present application, if the second Bluetooth connection between the mobile phone and the other external device is successfully established according to the second connection request within the preset time period starting from the start time, the second connection request can be deleted from the request queue. In this way, it can be avoided that the mobile phone extracts the second connection request from the request queue again, thereby avoiding the mobile phone from repeatedly processing the second connection request, that is, avoiding the attempt to establish the second Bluetooth connection between the mobile phone and the other external device according to the second connection request again when the second Bluetooth connection between the mobile phone and the other external device has been successfully established according to the second connection request, which can save the system resources of the mobile phone.

[0421] In another embodiment of the present application, after interrupting the step of establishing a second Bluetooth connection between the mobile phone and the other external device according to the second connection request, the mobile phone can also display a first interface, and the first interface includes a first prompt information. The first prompt information is used to prompt that the second Bluetooth connection between the mobile phone and the wireless headset according to the second connection request has been interrupted, so that the user can know from the first prompt information that the mobile phone has interrupted the second Bluetooth connection between the mobile phone and the other external device according to the second connection request.

[0422] Furthermore, in another embodiment of the present application, after the mobile phone establishes the first Bluetooth connection between the mobile phone and the wireless headset according to the first connection request, the mobile phone may also display a second interface, wherein the second interface includes second prompt information, and the second prompt information is used to prompt the mobile phone that the first Bluetooth connection between the mobile phone and the wireless headset is being established, so that the user can know that the mobile phone is establishing the first Bluetooth connection between the mobile phone and the wireless headset according to the second prompt information.

[0423] Furthermore, in another embodiment of the present application, when the first Bluetooth connection between the mobile phone and the wireless headset is successfully established, the mobile phone may also display a third interface, wherein the third interface includes third prompt information, and the third prompt information is used to prompt that the first Bluetooth connection between the mobile phone and the wireless headset has been successfully established, so that the user can know that the first Bluetooth connection between the mobile phone and the wireless headset has been successfully established according to the third prompt information.

[0424] For example, see Fig. 22 (1) Figure 7 Based on the example shown in (4), it is assumed that the user needs to control the mobile phone to establish a first Bluetooth connection between the wireless headset corresponding to the identifier “FlyPods3” 410. Then the user can input a single-click operation on the identifier “FlyPods3” 410 of the paired device in the paired device list 408.

[0425] For example, assume that before the user inputs a single-click operation on the paired device identifier "FlyPods3" 410 in the paired device list 408, the mobile phone is establishing a second Bluetooth connection with an external device (another mobile phone) corresponding to the device identifier "HonorX40" 411. At this time, a prompt 412 of "Connecting..." may be displayed below the device identifier "HonorX40" 411 to prompt that the mobile phone is establishing a second Bluetooth connection with the external device corresponding to the identifier "HonorX40" 411.

[0426] In response to the user's single-click operation on the identifier "FlyPods3" 410 of the paired device in the paired device list 408, the mobile phone may be informed that a first Bluetooth connection needs to be established between the wireless headset corresponding to the identifier "FlyPods3" 410, and then a first connection request may be generated, where the first connection request is used to establish a first Bluetooth connection between the mobile phone and the wireless headset corresponding to the identifier "FlyPods3" 410.

[0427] Accordingly, see Fig. 22 (2) After interrupting the step of establishing a second Bluetooth connection between the mobile phone and the other external device according to the second connection request, a prompt 413 of "Cancel connection..." can be displayed below the device identifier "HonorX40" 411 to prompt that the mobile phone has interrupted the establishment of the second Bluetooth connection between the external device corresponding to the identifier "HonorX40" 411.

[0428] Furthermore, a prompt 414 of “Connecting…” may be displayed below the device identifier “FlyPods3” 410 to prompt that the mobile phone is establishing a first Bluetooth connection with the wireless headset corresponding to the identifier “FlyPods3” 410 .

[0429] Also, see Fig. 22 (3) When the first Bluetooth connection between the mobile phone and the wireless headset is successfully established, a prompt 415 of “Connected” may be displayed below the device identifier “FlyPods3” 410 to prompt that the mobile phone has successfully established the first Bluetooth connection between the wireless headset corresponding to the identifier “FlyPods3” 410 .

[0430] Fig.23 The schematic diagram of the process of the Page stage between the mobile phone and the wireless headset is shown as an example. The method of the process is applied to the mobile phone, see Fig.23 , specifically including:

[0431] S801: Obtain a first connection request. The first connection request is used to establish a first Bluetooth connection between a mobile phone and a wireless headset.

[0432] This step can be referred to Fig.11 The description of step S701 in the illustrated embodiment is not described in detail here.

[0433] S802: Obtain the timeliness priority of the first connection request.

[0434] This step can be referred to Fig.11 The description of step S703 in the illustrated embodiment is not described in detail here.

[0435] S803: Store the first connection request in a request queue according to the timeliness priority of the first connection request, where the request queue is used to store the connection requests.

[0436] This step can be referred to Fig.11 The text description after step S705 in the illustrated embodiment is not described in detail here.

[0437] S804: Detect whether the mobile phone is establishing a second Bluetooth connection between the mobile phone and the other external device according to the second connection request.

[0438] This step can be referred to Fig.11 The description of step S702 in the illustrated embodiment is not described in detail here.

[0439] If the mobile phone is not establishing a second Bluetooth connection between the mobile phone and the other external device according to the second connection request, step S805 is executed. Alternatively, if the mobile phone is establishing a second Bluetooth connection between the mobile phone and the other external device according to the second connection request, step S807 is executed.

[0440] In the case that the mobile phone is not establishing a second Bluetooth connection between the mobile phone and the other external device according to the second connection request, S805 , establishing a first Bluetooth connection between the mobile phone and the wireless headset according to the first connection request.

[0441] Furthermore, after executing step S805, the method further includes:

[0442] S806: After successfully establishing the first Bluetooth connection between the mobile phone and the wireless headset according to the first connection request, delete the first connection request in the request queue.

[0443] This step can be referred to Fig.11 The text description after step S705 in the illustrated embodiment is not described in detail here.

[0444] When the mobile phone is establishing a second Bluetooth connection between the mobile phone and the other external device according to the second connection request, S807 detects whether the first connection request is at the first position in the request queue.

[0445] In the case that the first connection request is not at the first position in the request queue, S808, the step of establishing a second Bluetooth connection between the mobile phone and the other external device according to the second connection request is continued.

[0446] When the first connection request is at the first position in the request queue, S809 detects whether a second Bluetooth connection between the mobile phone and the other external device is successfully established according to the second connection request within a preset time period starting from the start time.

[0447] This step can be referred to Fig.11 The text description after step S705 in the illustrated embodiment is not described in detail here.

[0448] The preset duration is less than the default connection timeout duration. The starting time includes: a detection time when detecting whether a second Bluetooth connection between the mobile phone and the other external device is being established according to the second connection request.

[0449] If a second Bluetooth connection between the mobile phone and the other external device is successfully established according to the second connection request within the preset time period starting from the starting time, execute S805: establish a first Bluetooth connection between the mobile phone and the wireless headset according to the first connection request.

[0450] And, in the case where a second Bluetooth connection between the mobile phone and the other external device is successfully established according to the second connection request within the preset time period starting from the starting time, S810, the second connection request is deleted from the request queue.

[0451] If the second Bluetooth connection between the mobile phone and the other external device is not successfully established according to the second connection request within the preset time period starting from the starting time, S811, interrupt the step of establishing the second Bluetooth connection between the mobile phone and the other external device according to the second connection request, and then execute S805: establish the first Bluetooth connection between the mobile phone and the wireless headset according to the first connection request.

[0452] Furthermore, the method further comprises:

[0453] After the step of establishing a second Bluetooth connection between the mobile phone and the other external device according to the second connection request is interrupted, S812 is performed to detect whether the number of times the second connection request is processed is greater than or equal to a preset number.

[0454] This step can be referred to Fig.11 The text description after step S705 in the illustrated embodiment is not described in detail here.

[0455] When the number of times the second connection request is processed is greater than or equal to the preset number, S813, the second connection request is deleted from the request queue.

[0456] The above mainly introduces the solution provided by the embodiment of the present application from the perspective of the interaction between various network elements. It can be understood that in order to realize the above functions, the electronic device includes a 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 units and algorithm steps of each example described in the embodiments disclosed in this document, the embodiments of the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application in combination with the embodiments, but such implementation should not be considered to exceed the scope of this application.

[0457] The embodiment of the present application can divide the functional modules of the electronic device according to the above method example. For example, each functional module can be divided according to each function, or two or more functions can be integrated into one processing module. The above integrated module can be implemented in the form of hardware or in the form of software functional modules. It should be noted that the division of modules in the embodiment of the present application is schematic and is only a logical function division. There may be other division methods in actual implementation.

[0458] In one example, Fig.24 A schematic block diagram of a device 900 according to an embodiment of the present application is shown. The device 900 may include: a processor 901 and a transceiver / transceiver pin 902 , and optionally, may further include a memory 903 .

[0459] The components of the device 900 are coupled together via a bus 904, wherein the bus 904 may include a power bus, a control bus, and a status signal bus in addition to a data bus. However, for the sake of clarity, various buses are referred to as bus 904 in the figure.

[0460] Optionally, the memory 903 may be used for the instructions in the aforementioned method embodiment. The processor 901 may be used to execute the instructions in the memory 903, and control the receiving pin to receive a signal, and control the sending pin to send a signal.

[0461] The apparatus 900 may be the electronic device or a chip of the electronic device in the above method embodiment.

[0462] Among them, all relevant contents of each step involved in the above method embodiment can be referred to the functional description of the corresponding functional module, and will not be repeated here.

[0463] This embodiment further provides a computer storage medium, in which computer instructions are stored. When the computer instructions are executed on an electronic device, the electronic device executes the above-mentioned related method steps to implement the method for establishing a Bluetooth connection in the above-mentioned embodiment.

[0464] This embodiment further provides a computer program product. When the computer program product is run on a computer, the computer is caused to execute the above-mentioned related steps to implement the method for establishing a Bluetooth connection in the above-mentioned embodiment.

[0465] In addition, an embodiment of the present application also provides a device, which can specifically be a chip, component or module, and the device may include a connected processor and memory; wherein the memory is used to store computer-executable instructions, and when the device is running, the processor can execute the computer-executable instructions stored in the memory so that the chip executes the above-mentioned related method steps to implement the method of establishing a Bluetooth connection in the above-mentioned embodiment.

[0466] Among them, the electronic device, computer storage medium, computer program product or chip provided in this embodiment is used to execute the corresponding method provided above. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding method provided above and will not be repeated here.

[0467] Through the description of the above implementation methods, technical personnel in the relevant field can understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.

[0468] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of modules or units is only a logical function division, and there may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0469] The units described as separate components may or may not be physically separated, and the components shown as units may be one physical unit or multiple physical units, that is, they may be located in one place or distributed in multiple different places. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.

[0470] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0471] Any content of each embodiment of the present application, as well as any content of the same embodiment, can be freely combined. Any combination of the above content is within the scope of the present application.

[0472] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and may include several instructions to enable a device (which may be a single-chip microcomputer, chip, etc.) or a processor (processor) to perform all or part of the steps of the various embodiments of the present application. The aforementioned storage medium may include: U disk, mobile hard disk, read only memory (ROM), random access memory (RAM), disk or optical disk and other media that can store program code.

[0473] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present application, ordinary technicians in this field can also make many forms without departing from the purpose of the present application and the scope of protection of the claims, all of which are within the protection of the present application.

[0474] The steps of the method or algorithm described in conjunction with the disclosure of the embodiments of the present application can be implemented in a hardware manner, or can be implemented by a processor executing a software instruction. The software instruction can be composed of corresponding software modules, and the software module can be stored in a random access memory (Random Access Memory, RAM), a flash memory, a read-only memory (Read Only Memory, ROM), an erasable programmable read-only memory (Erasable Programmable ROM, EPROM), an electrically erasable programmable read-only memory (Electrically EPROM, EEPROM), a register, a hard disk, a mobile hard disk, a read-only compact disk (CD-ROM) or any other form of storage medium known in the art. An exemplary storage medium is coupled to a processor so that the processor can read information from the storage medium and can write information to the storage medium. Of course, the storage medium can also be a component of the processor. The processor and the storage medium can be located in an ASIC. In addition, the ASIC can be located in a network device. Of course, the processor and the storage medium can also be present in a network device as discrete components.

[0475] Those skilled in the art should be aware that in one or more of the above examples, the functions described in the embodiments of the present application can be implemented with hardware, software, firmware, or any combination thereof. When implemented using software, these functions can be stored in a computer-readable medium or transmitted as one or more instructions or codes on a computer-readable medium. Computer-readable media may include computer storage media and communication media, wherein the communication media may include any medium that is convenient for transmitting a computer program from one place to another. The storage medium may be any available medium that a general or special-purpose computer can access.

[0476] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present application, ordinary technicians in this field can also make many forms without departing from the purpose of the present application and the scope of protection of the claims, all of which are within the protection of the present application.

Claims

1. A method for establishing a Bluetooth connection, applied to an electronic device, characterized in that: The method comprises: Acquire a first connection request, where the first connection request is used to establish a first Bluetooth connection between the electronic device and a first external device; detecting whether a second Bluetooth connection is being established according to a second connection request; wherein the second establishment request is used to establish the second Bluetooth connection between the electronic device and a second external device; In the case that the second Bluetooth connection is being established according to the second connection request, obtaining the timeliness priority of the first connection request, and obtaining the timeliness priority of the second connection request; comparing the timeliness priority of the first connection request with the timeliness priority of the second connection request; When the timeliness priority of the first connection request is higher than the timeliness priority of the second connection request, the step of establishing the second Bluetooth connection according to the second connection request is interrupted, and the first Bluetooth connection is established according to the first connection request.

2. The method according to claim 1, characterized in that The connection request includes: a connection request triggered manually, a connection request triggered automatically by a service, and a connection request other than a connection request triggered manually and a connection request triggered automatically by a service; The obtaining the timeliness priority of the first connection request includes: In response to the first connection request being a manually triggered connection request, determining that the timeliness priority of the first connection request is a high priority; or, In response to the first connection request being a connection request automatically triggered by a service, determining that the timeliness priority of the first connection request is a medium priority; or, In response to the first connection request being a connection request other than a manually triggered connection request and a service automatically triggered connection request, determining that the timeliness priority of the first connection request is a low priority.

3. The method according to claim 2, characterized in that The comparing the timeliness priority of the first connection request with the timeliness priority of the second connection request includes: In a case where the timeliness priority of the first connection request is a high priority and the timeliness priority of the second connection request is a high priority, determining that the timeliness priority of the first connection request is higher than the timeliness priority of the second connection request; or, When the timeliness priority of the first connection request is medium priority and the timeliness priority of the second connection request is medium priority, determining that the timeliness priority of the first connection request is higher than the timeliness priority of the second connection request; or, In the case where the timeliness priority of the first connection request is a low priority and the timeliness priority of the second connection request is a low priority, it is determined that the timeliness priority of the first connection request is higher than the timeliness priority of the second connection request.

4. The method according to claim 1, characterized in that: After obtaining the timeliness priority of the first connection request, the method further includes: According to the timeliness priority of the first connection request, the first connection request is stored in a request queue, and the request queue is used to store connection requests.

5. The method according to claim 4, characterized in that The method further comprises: After the first Bluetooth connection is successfully established according to the first connection request, the first connection request is deleted from the request queue.

6. The method according to claim 4, characterized in that Before interrupting the step of establishing the second Bluetooth connection according to the second connection request, the method further includes: Detecting whether the first connection request is at the first position in the request queue; When the first connection request is at the first position in the request queue, the step of establishing the second Bluetooth connection according to the second connection request is interrupted.

7. The method according to claim 4, characterized in that The timeliness priority of the first connection request is high priority; The storing the first connection request in a request queue according to the timeliness priority of the first connection request includes: The first connection request is stored at a position in the request queue that is located before all the connection requests.

8. The method according to claim 4, characterized in that The timeliness priority of the first connection request is medium priority; The storing the first connection request in a request queue according to the timeliness priority of the first connection request includes: In the case where there is a connection request of medium priority in the request queue, determining a position in the request queue that is before the connection request ranked first in the medium priority and adjacent to the connection request ranked first in the sequence; and storing the first connection request at the determined position; or, In the case where there is no medium-priority connection request in the request queue, if there is no high-priority connection request in the request queue, the first connection request is stored in a position before all the connection requests in the request queue; or, if there is a high-priority connection request in the request queue, in the request queue, a position after the last connection request in the high priority order and adjacent to the last connection request is determined, and the first connection request is stored in the determined position.

9. The method according to claim 1, characterized in that: The method further comprises: In the case where the timeliness priority of the first connection request is higher than the timeliness priority of the second connection request, detecting whether the second Bluetooth connection is successfully established within a preset time length starting from a starting time; the preset time length is less than a default connection timeout length; the starting time includes: a detection time when detecting whether the second Bluetooth connection is being established according to the second connection request; If the second Bluetooth connection is not successfully established within the preset time period starting from the starting time, interrupting the step of establishing the second Bluetooth connection according to the second connection request; or, In a case where the second Bluetooth connection is successfully established within the preset time period starting from the starting moment, the first Bluetooth connection is established according to the first connection request.

10. The method according to claim 9, characterized in that The second connection request is located in a request queue, and the request queue is used to store connection requests; The method further comprises: If the second Bluetooth connection is successfully established within the preset time period starting from the starting moment, the second connection request is deleted from the request queue.

11. The method according to claim 1, characterized in that The second connection request is located in a request queue, and the request queue is used to store connection requests; The method further comprises: After interrupting the step of establishing the second Bluetooth connection according to the second connection request, detecting whether the number of times the second connection request is processed is greater than or equal to a preset number; When the number of times the second connection request is processed is greater than or equal to a preset number, the second connection request is deleted from the request queue.

12. The method according to claim 1, characterized in that After the step of interrupting the execution of establishing the second Bluetooth connection according to the second connection request, the method further includes: A first interface is displayed, wherein the first interface includes first prompt information, and the first prompt information is used to prompt that establishment of the second Bluetooth connection has been interrupted.

13. The method according to claim 1, characterized in that After establishing the first Bluetooth connection according to the first connection request, the method further includes: A second interface is displayed, wherein the second interface includes second prompt information, and the second prompt information is used to prompt that the first Bluetooth connection is being established.

14. The method according to claim 1, characterized in that The method further comprises: When the first Bluetooth connection is successfully established, a third interface is displayed, wherein the third interface includes third prompt information, and the third prompt information is used to prompt that the first Bluetooth connection has been successfully established.

15. An electronic device, characterized in that: The electronic device comprises: One or more processors, memory; and one or more computer programs, wherein the one or more computer programs are stored in the memory, and when the computer programs are executed by the one or more processors, the electronic device performs the following steps: Acquire a first connection request, where the first connection request is used to establish a first Bluetooth connection between the electronic device and a first external device; detecting whether a second Bluetooth connection is being established according to a second connection request; wherein the second establishment request is used to establish the second Bluetooth connection between the electronic device and a second external device; In the case that the second Bluetooth connection is being established according to the second connection request, obtaining the timeliness priority of the first connection request, and obtaining the timeliness priority of the second connection request; comparing the timeliness priority of the first connection request with the timeliness priority of the second connection request; When the timeliness priority of the first connection request is higher than the timeliness priority of the second connection request, the step of establishing the second Bluetooth connection according to the second connection request is interrupted, and the first Bluetooth connection is established according to the first connection request.

16. The electronic device according to claim 15, characterized in that: The connection request includes: a connection request triggered manually, a connection request automatically triggered by a service, and a connection request other than a connection request triggered manually and a connection request automatically triggered by a service; when the program instruction is executed by the processor, the electronic device executes the following steps: In response to the first connection request being a manually triggered connection request, determining that the timeliness priority of the first connection request is a high priority; or, In response to the first connection request being a connection request automatically triggered by a service, determining that the timeliness priority of the first connection request is a medium priority; or, In response to the first connection request being a connection request other than a manually triggered connection request and a service automatically triggered connection request, determining that the timeliness priority of the first connection request is a low priority.

17. The electronic device according to claim 16, characterized in that: When the program instructions are executed by the processor, the electronic device performs the following steps: In a case where the timeliness priority of the first connection request is a high priority and the timeliness priority of the second connection request is a high priority, determining that the timeliness priority of the first connection request is higher than the timeliness priority of the second connection request; or, When the timeliness priority of the first connection request is medium priority and the timeliness priority of the second connection request is medium priority, determining that the timeliness priority of the first connection request is higher than the timeliness priority of the second connection request; or, In the case where the timeliness priority of the first connection request is a low priority and the timeliness priority of the second connection request is a low priority, it is determined that the timeliness priority of the first connection request is higher than the timeliness priority of the second connection request.

18. The electronic device according to claim 15, characterized in that: When the program instructions are executed by the processor, the electronic device performs the following steps: After acquiring the timeliness priority of the first connection request, the first connection request is stored in a request queue according to the timeliness priority of the first connection request, and the request queue is used to store connection requests.

19. The electronic device according to claim 18, characterized in that: When the program instructions are executed by the processor, the electronic device performs the following steps: After the first Bluetooth connection is successfully established according to the first connection request, the first connection request is deleted from the request queue.

20. The electronic device according to claim 18, characterized in that When the program instructions are executed by the processor, the electronic device performs the following steps: Before interrupting the step of establishing the second Bluetooth connection according to the second connection request, detecting whether the first connection request is at the first position in the request queue; When the first connection request is at the first position in the request queue, the step of establishing the second Bluetooth connection according to the second connection request is interrupted.

21. The electronic device according to claim 18, characterized in that: The timeliness priority of the first connection request is a high priority; when the program instruction is executed by the processor, the electronic device executes the following steps: The first connection request is stored at a position in the request queue that is located before all the connection requests.

22. The electronic device according to claim 18, characterized in that: The timeliness priority of the first connection request is a medium priority; when the program instruction is executed by the processor, the electronic device executes the following steps: In the case where there is a connection request of medium priority in the request queue, determining a position in the request queue that is before the connection request ranked first in the medium priority and adjacent to the connection request ranked first in the sequence; and storing the first connection request at the determined position; or, In the case where there is no medium-priority connection request in the request queue, if there is no high-priority connection request in the request queue, the first connection request is stored in a position before all the connection requests in the request queue; or, if there is a high-priority connection request in the request queue, in the request queue, a position after the last connection request in the high priority order and adjacent to the last connection request is determined, and the first connection request is stored in the determined position.

23. The electronic device according to claim 15, characterized in that: When the program instructions are executed by the processor, the electronic device performs the following steps: In a case where the timeliness priority of the first connection request is higher than the timeliness priority of the second connection request, detecting whether the second Bluetooth connection is successfully established within a preset time period starting from a starting time; The preset duration is shorter than the default connection timeout duration; The starting time includes: a detection time when detecting whether the second Bluetooth connection is being established according to the second connection request; If the second Bluetooth connection is not successfully established within the preset time period starting from the starting time, interrupting the step of establishing the second Bluetooth connection according to the second connection request; or, In a case where the second Bluetooth connection is successfully established within the preset time period starting from the starting moment, the first Bluetooth connection is established according to the first connection request.

24. The electronic device according to claim 23, characterized in that: The second connection request is located in a request queue, and the request queue is used to store connection requests; when the program instructions are executed by the processor, the electronic device executes the following steps: If the second Bluetooth connection is successfully established within the preset time period starting from the starting moment, the second connection request is deleted from the request queue.

25. The electronic device according to claim 15, characterized in that: The second connection request is located in a request queue, and the request queue is used to store connection requests; when the program instructions are executed by the processor, the electronic device executes the following steps: After interrupting the step of establishing the second Bluetooth connection according to the second connection request, detecting whether the number of times the second connection request is processed is greater than or equal to a preset number; When the number of times the second connection request is processed is greater than or equal to a preset number, the second connection request is deleted from the request queue.

26. The electronic device according to claim 15, characterized in that: When the program instructions are executed by the processor, the electronic device performs the following steps: After the step of establishing the second Bluetooth connection according to the second connection request is interrupted, a first interface is displayed, wherein the first interface includes first prompt information, and the first prompt information is used to prompt that the establishment of the second Bluetooth connection has been interrupted.

27. The electronic device according to claim 15, characterized in that: When the program instructions are executed by the processor, the electronic device performs the following steps: After the first Bluetooth connection is established according to the first connection request, a second interface is displayed, wherein the second interface includes second prompt information, and the second prompt information is used to prompt that the first Bluetooth connection is being established.

28. The electronic device according to claim 15, characterized in that: When the program instructions are executed by the processor, the electronic device performs the following steps: When the first Bluetooth connection is successfully established, a third interface is displayed, wherein the third interface includes third prompt information, and the third prompt information is used to prompt that the first Bluetooth connection has been successfully established.

29. A computer storage medium, characterized in that The method comprises computer instructions, which, when executed on an electronic device, cause the electronic device to execute the steps of the method according to any one of claims 1 to 14.

30. A computer program product, characterized in that When the computer program product is executed on a computer, the computer is caused to execute the steps of the method according to any one of claims 1 to 14.

31. A chip, characterized in that: It comprises one or more interface circuits and one or more processors; the interface circuit is used to receive a signal from a memory of an electronic device and send the signal to the processor, wherein the signal includes a computer instruction stored in the memory; when the processor executes the computer instruction, the electronic device executes the steps of the method described in any one of claims 1 to 14.