Device connection method and electronic device

By reducing the bandwidth usage of existing Bluetooth connections, the problem that electronic devices can no longer connect to new devices is solved, and the success rate and user experience of Bluetooth connections are improved.

CN118984450BActive Publication Date: 2025-08-01HONOR DEVICE CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202411049661.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-30
Publication Date
2025-08-01
Estimated Expiration
2044-07-30

AI Technical Summary

Technical Problem

The problem of having multiple devices connected via Bluetooth is that the new device cannot be successfully connected.

Method used

By reducing the bandwidth usage of existing Bluetooth connections, such as switching encoding formats, it reserves more Bluetooth bandwidth for new devices and increases the probability of connection success.

Benefits of technology

It improves the success rate of electronic devices and new devices through Bluetooth connection and improves the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118984450B_ABST
    Figure CN118984450B_ABST
Patent Text Reader

Abstract

An embodiment of the present application provides a device connection method and an electronic device, which can improve the probability of successful Bluetooth connection between the electronic device and a new electronic device under the condition that the electronic device has already established a Bluetooth connection with at least one other electronic device. The device connection method includes: the first electronic device establishes a first Bluetooth connection with the second electronic device, and the first Bluetooth connection transmits data using a first coding format; the first electronic device initiates a pairing connection with the third electronic device; when the pairing connection between the first electronic device and the third electronic device fails, the first electronic device switches the coding format used by the first Bluetooth connection from the first coding format to a second coding format, and re-initiates a pairing connection with the third electronic device, and the bandwidth occupied by the second coding format is lower than the bandwidth occupied by the first coding format.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the technical field of device connection, and in particular, to a device connection method and an electronic device. Background Art

[0002] With the development of technology, users have more and more electronic devices. When using electronic devices, users often need to connect one electronic device to multiple other electronic devices via Bluetooth. For example, a mobile phone connects to surrounding earphones, speakers, keyboards, styluses, etc. via Bluetooth.

[0003] However, if an electronic device (such as a mobile phone) has already been connected to one or more other electronic devices via Bluetooth, if the user wants this electronic device to connect to a new electronic device via Bluetooth, a connection failure may occur. Summary of the Invention

[0004] Embodiments of this application provide a device connection method and an electronic device, which can increase the probability of successful Bluetooth connection between an electronic device and a new electronic device under the condition that the electronic device has already established a Bluetooth connection with at least one other electronic device.

[0005] In a first aspect, embodiments of this application provide a device connection method, which is applied to a first electronic device. The method includes: the first electronic device establishes a first Bluetooth connection with a second electronic device, and the first electronic device transmits data on the first Bluetooth connection using a first coding format; the first electronic device initiates a pairing connection with a third electronic device; when the pairing connection between the first electronic device and the third electronic device fails, the first electronic device switches the coding format used on the first Bluetooth connection from the first coding format to a second coding format, and re-initiates a pairing connection with the third electronic device. The bandwidth occupied by the second coding format is lower than the bandwidth occupied by the first coding format. Herein, the above-mentioned first Bluetooth connection is a Bluetooth-based communication connection established between the first electronic device and the second electronic device when the pairing connection between the first electronic device and the second electronic device is successful. The above-mentioned pairing connection is specifically a Bluetooth-based pairing connection, that is, a pairing connection based on the Bluetooth communication protocol. This method switches the coding format used on the existing first Bluetooth connection of the first electronic device from the first coding format with relatively high bandwidth occupancy to the second coding format with relatively low bandwidth occupancy, so that the Bluetooth resources occupied by the first Bluetooth connection are reduced, thereby increasing the possibility of successful pairing connection between the first electronic device and the third electronic device, that is, increasing the probability of successful Bluetooth connection between the first electronic device and the new third electronic device.

[0006] Among them, the first electronic device can be, for example, a mobile phone in subsequent embodiments, and the second electronic device can be, for example, a Bluetooth headset in subsequent embodiments. The first coding format, the second coding format, etc. can be, for example, the coding formats of audio data on a Bluetooth connection.

[0007] In a possible implementation manner, the method further includes: when the pairing connection with the third electronic device that is re-initiated fails, the first electronic device switches the coding format used on the first Bluetooth connection from the second coding format to a third coding format, and re-initiates the pairing connection with the third electronic device again. The bandwidth occupied by the third coding format is lower than the bandwidth occupied by the second coding format; and so on, until the pairing connection with the third electronic device that is re-initiated is successful, or the first electronic device switches the coding format used on the first Bluetooth connection to the coding format with the lowest occupied bandwidth, and the pairing connection with the third electronic device that is re-initiated fails. The coding format with the lowest occupied bandwidth is the coding format with the lowest occupied bandwidth among the coding formats supported by both the first electronic device and the second electronic device. In this method, the first electronic device gradually reduces the coding format used on the first Bluetooth connection, that is, gradually switches the coding format used on the first Bluetooth connection to a coding format with relatively lower occupied bandwidth, thereby gradually reducing the Bluetooth resources occupied by the first Bluetooth connection. Each time it is reduced, the pairing connection with the third electronic device is re-initiated until the pairing connection is successful or finally fails, so as to improve the possibility of successful pairing connection between the first electronic device and the third electronic device under the condition of minimizing the impact on the data transmission quality on the first Bluetooth connection.

[0008] In a possible implementation, before the first electronic device switches the encoding format used on the first Bluetooth connection from the first encoding format to the second encoding format, the method further includes: when the pairing connection between the first electronic device and the third electronic device fails, determining that there is an encoding format among the encoding formats supported by both the first electronic device and the second electronic device that has a lower bandwidth occupancy than the first encoding format, and displaying a first interface, where the first interface includes a first control; the first control is used to trigger the first electronic device to lower the encoding format used on the first Bluetooth connection and re-initiate the pairing connection with the third electronic device; and receiving a selection operation for the first control. This method provides an interface implementation for the user, enabling the user to independently select whether to reduce the quality of the first Bluetooth connection, improving the user's participation and usage experience. Moreover, before displaying the first interface, determining that there is an encoding format among the encoding formats supported by both the first electronic device and the second electronic device that has a lower bandwidth occupancy than the first encoding format ensures the rationality of the display of the first interface and prevents the problem that the user selects to reduce the quality of the first Bluetooth connection but the first Bluetooth connection cannot switch the encoding format. The above first interface may be, for example, the first prompt interface in subsequent embodiments, such as the interface 60 or interface 60a shown.

[0009] In a possible implementation, before the first electronic device switches the encoding format used on the first Bluetooth connection from the second encoding format to the third encoding format, the method further includes: determining that there is an encoding format among the encoding formats supported by both the first electronic device and the second electronic device that has a lower bandwidth occupancy than the second encoding format. This method ensures the rationality and reliability of the process of the first electronic device switching the encoding format used on the first Bluetooth connection from the second encoding format to the third encoding format.

[0010] In a possible implementation, the first encoding format and the second encoding format are different encoding formats; or, the first encoding format and the second encoding format are the same encoding format with different transmission bitrates.

[0011] In a possible implementation, the method further includes: when the first electronic device switches the encoding format used on the first Bluetooth connection to the encoding format with the lowest bandwidth occupancy and the re-initiated pairing connection with the third electronic device fails, switching the encoding format used on the first Bluetooth connection to the first encoding format. This method can restore the data transmission quality of the first Bluetooth connection when the pairing connection between the first electronic device and the third electronic device fails, improving the user experience.

[0012] In a possible implementation, the method further includes: when the first electronic device switches the encoding format used on the first Bluetooth connection to the encoding format with the lowest bandwidth occupancy and the re-initiated pairing connection with the third electronic device fails, a second interface is displayed. The second interface includes: a second control, and the second control is used to trigger the first electronic device to restore the encoding format used on the first Bluetooth connection to the first encoding format; when a selection operation for the second control is received, the encoding format used on the first Bluetooth connection is switched to the first encoding format. When the first electronic device and the third electronic device cannot be paired and connected, this method provides the user with the option of whether to restore the encoding format of the first Bluetooth connection to the first encoding format, improving the user's participation and usage experience. The above-mentioned second interface may be, for example, the third prompt interface in the subsequent embodiments, such as the interface 80 or the interface 70a shown.

[0013] In a possible implementation, the method further includes: when the re-initiated pairing connection between the first electronic device and the third electronic device is successful, the encoding format used on the first Bluetooth connection is switched to the first encoding format. This method can restore the data transmission quality of the first Bluetooth connection when the pairing connection between the first electronic device and the third electronic device is successful, improving the user experience.

[0014] In a possible implementation, it further includes: when the re-initiated pairing connection with the third electronic device is successful, a third interface is displayed. The third interface includes a third control, and the third control is used to trigger the first electronic device to restore the encoding format used on the first Bluetooth connection to the first encoding format; when a selection operation for the third control is received, the encoding format used on the first Bluetooth connection is switched to the first encoding format. When the first electronic device and the third electronic device are paired and connected successfully, this method provides the user with the option of whether to restore the encoding format of the first Bluetooth connection to the first encoding format, improving the user's participation and usage experience. The above-mentioned third interface may be, for example, the second prompt interface in the subsequent embodiments, such as the interface 70 or the interface 70a shown.

[0015] In a possible implementation, before the first electronic device initiates a pairing connection with the third electronic device, the method further includes: the first electronic device establishes a second Bluetooth connection with a fourth electronic device, and the first electronic device transmits data using a fourth encoding format on the second Bluetooth connection;

[0016] Before reinitiating the pairing connection with the third electronic device, the method further includes: when the pairing connection between the first electronic device and the third electronic device fails, the first electronic device switches the coding format used on the second Bluetooth connection from the fourth coding format to a fifth coding format, and the bandwidth occupied by the fifth coding format is lower than the bandwidth occupied by the fourth coding format.

[0017] When the first electronic device already has at least two Bluetooth connections and the pairing connection with the third electronic device fails, the method reduces the Bluetooth resources occupied by the existing Bluetooth connections by reducing the quality of the two existing Bluetooth connections simultaneously, thereby increasing the probability of successful pairing connection between the first electronic device and the third electronic device.

[0018] In a possible implementation, before the first electronic device initiates a pairing connection with the third electronic device, the method further includes: the first electronic device establishes a second Bluetooth connection with a fourth electronic device, and the first electronic device uses a fourth coding format to transmit data on the second Bluetooth connection;

[0019] The method further includes: the first electronic device switches the coding format used on the first Bluetooth connection to the coding format with the lowest occupied bandwidth; when the reinitiated pairing connection with the third electronic device fails, the first electronic device switches the coding format used on the second Bluetooth connection from the fourth coding format to a fifth coding format, and reinitiates the pairing connection with the third electronic device; the bandwidth occupied by the fifth coding format is lower than the bandwidth occupied by the fourth coding format.

[0020] When the first electronic device already has at least two Bluetooth connections and the pairing connection with the third electronic device fails, the method reduces the Bluetooth resources occupied by the existing two Bluetooth connections by reducing the quality of the existing two Bluetooth connections in sequence, thereby increasing the probability of successful pairing connection between the first electronic device and the third electronic device.

[0021] In a second aspect, an embodiment of the present application provides a device connection method applied to a first electronic device. The method includes: the first electronic device establishes a first Bluetooth connection with a second electronic device, and the first electronic device uses a first coding format to transmit data to the second electronic device on the first Bluetooth connection for the second electronic device to perform a first function service according to the data; when it is detected that the second electronic device has a lag during the execution of the first function service, the first electronic device switches the coding format used on the first Bluetooth connection from the first coding format to a second coding format, and the first electronic device uses the second coding format to transmit the data to the second electronic device on the first Bluetooth connection; the bandwidth occupied by the second coding format is lower than the bandwidth occupied by the first coding format.

[0022] Optionally, the above-mentioned first functional service may specifically be playing music, and the above-mentioned data may specifically be audio data for playing music. Detecting that the second electronic device experiences lag during the execution of the first functional service may specifically be achieved by the first electronic device detecting whether the packet loss rate of the data transmitted over the first Bluetooth connection exceeds a preset threshold.

[0023] When the first functional service experiences lag, this method switches the encoding format used on the first Bluetooth connection of the first electronic device from a first encoding format with relatively high bandwidth occupancy to a second encoding format with relatively low bandwidth occupancy, so that the amount of data to be transmitted over the first Bluetooth connection becomes lower. Thus, when the first Bluetooth connection occupies less Bluetooth resources, the possibility of the second electronic device experiencing lag during the execution of the first functional service is reduced.

[0024] In a possible implementation manner, after the first electronic device transmits data to the second electronic device using the second encoding format on the first Bluetooth connection, the method further includes: when it is detected that the second electronic device experiences lag during the execution of the first functional service, the first electronic device switches the encoding format used on the first Bluetooth connection from the second encoding format to a third encoding format, and the first electronic device transmits the data to the second electronic device using the third encoding format on the first Bluetooth connection, and the bandwidth occupied by the third encoding format is lower than the bandwidth occupied by the second encoding format; and so on, until the second electronic device does not experience lag during the execution of the first functional service, or until the first electronic device switches the encoding format used on the first Bluetooth connection to the encoding format with the lowest bandwidth occupancy and the second electronic device still experiences lag during the execution of the first functional service, where the encoding format with the lowest bandwidth occupancy is the encoding format with the lowest bandwidth occupancy among the encoding formats supported by both the first electronic device and the second electronic device. In this method, the first electronic device gradually reduces the encoding format used on the first Bluetooth connection, that is, gradually switches the encoding format used on the first Bluetooth connection to an encoding format with relatively lower bandwidth occupancy, thereby gradually reducing the amount of data to be transmitted over the first Bluetooth connection, and re-detecting whether the second electronic device experiences lag during the execution of the first functional service each time it is reduced, so as to reduce the possibility of the second electronic device experiencing lag during the execution of the first functional service under the condition of minimizing the impact on the quality of data transmission over the first Bluetooth connection.

[0025] In a possible implementation, before the first electronic device switches the encoding format used on the first Bluetooth connection from the second encoding format to the third encoding format, the method further includes: determining that there is an encoding format among the encoding formats supported by both the first electronic device and the second electronic device that occupies less bandwidth than the second encoding format. This method ensures the rationality and reliability of the process of the first electronic device switching the encoding format used on the first Bluetooth connection from the second encoding format to the third encoding format.

[0026] In a possible implementation, the first encoding format and the second encoding format are different encoding formats; or, the first encoding format and the second encoding format are the same encoding format with different transmission bitrates.

[0027] In a possible implementation, before the first electronic device switches the encoding format used on the first Bluetooth connection from the first encoding format to the second encoding format, the method further includes: when it is detected that the second electronic device has a lag in executing the first function service, determining that there is an encoding format among the encoding formats supported by both the first electronic device and the second electronic device that occupies less bandwidth than the first encoding format, and displaying a fourth interface, where the fourth interface includes a fourth control; the fourth control is used to trigger the first electronic device to lower the encoding format used on the first Bluetooth connection; and receiving a selection operation for the fourth control. This method provides an interface implementation for the user, enabling the user to independently select whether to reduce the quality of the first Bluetooth connection, improving the user's participation and usage experience. Moreover, before displaying the fourth interface, determining that there is an encoding format among the encoding formats supported by both the first electronic device and the second electronic device that occupies less bandwidth than the first encoding format ensures the rationality of the display of the fourth interface and prevents the problem that the user selects to reduce the quality of the first Bluetooth connection but the first Bluetooth connection cannot switch the encoding format.

[0028] In a third aspect, an embodiment of the present application provides a first electronic device, including: a processor, a memory; one or more computer programs are stored in the memory, and the one or more computer programs include instructions that, when executed by the processor, cause the first electronic device to execute the method according to any one of the first aspect or the second aspect.

[0029] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, in which a computer program is stored, and when it runs on a computer, it causes the computer to execute the method according to any one of the first aspect or the second aspect.

[0030] Fifth aspect, an embodiment of the present application provides a computer program product, which includes a computer program. When it runs on a computer, it enables the computer to execute the method described in any one of the first aspect or the second aspect.

[0031] Sixth aspect, an embodiment of the present application provides a system, including a first electronic device, a second electronic device, and a third electronic device of the first aspect.

[0032] Seventh aspect, an embodiment of the present application provides a system, including a first electronic device and a second electronic device of the second aspect. Description of the Drawings

[0033] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for the embodiments will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present application. For those of ordinary skill in the art, without creative efforts, other drawings can be obtained based on these drawings.

[0034] Figure 1 It is a schematic diagram of the transmission process of audio data between the electronic device and the Bluetooth headset provided by the embodiment of the present application;

[0035] Figure 2A It is a schematic structural diagram of an electronic device provided by the embodiment of the present application;

[0036] Figure 2B It is a schematic software structure diagram of an electronic device provided by the embodiment of the present application;

[0037] Figure 3 It is a schematic diagram of an interface implementation of the device connection method provided by the embodiment of the present application;

[0038] Figure 4 It is another schematic diagram of an interface implementation of the device connection method provided by the embodiment of the present application;

[0039] Figure 5 It is yet another schematic diagram of an interface implementation of the device connection method provided by the embodiment of the present application;

[0040] Figure 6 It is a schematic flowchart of a device connection method provided by the embodiment of the present application;

[0041] Figure 7 It is another schematic flowchart of a device connection method provided by the embodiment of the present application;

[0042] Figure 8 It is a third schematic flowchart of a device connection method provided by the embodiment of the present application;

[0043] Figure 9The fourth schematic flowchart of the device connection method provided by the embodiments of the present application;

[0044] Figure 10 The fifth schematic flowchart of the device connection method provided by the embodiments of the present application;

[0045] Figure 11 The fourth schematic interface diagram of the device connection method provided by the embodiments of the present application;

[0046] Figure 12 The sixth schematic flowchart of the device connection method provided by the embodiments of the present application;

[0047] Figure 13 The seventh schematic flowchart of the device connection method provided by the embodiments of the present application;

[0048] Figure 14 The eighth schematic flowchart of the device connection method provided by the embodiments of the present application. Detailed implementation manners

[0049] The terms used in the implementation manners part of the present application are only for explaining the specific embodiments of the present application, rather than aiming to limit the present application.

[0050] Bluetooth technology is a short-range radio technology. By using the "Bluetooth" technology, the communication between electronic devices can be effectively simplified.

[0051] With the development of technology, users own more and more electronic devices. During the use of electronic devices, users often need to connect one electronic device to multiple electronic devices via Bluetooth. For example, a mobile phone connects to Bluetooth peripherals such as headphones, speakers, keyboards, and styluses via Bluetooth. However, if an electronic device (such as a mobile phone) has already been connected to one or more electronic devices via Bluetooth, if the user hopes that this electronic device connects to a new electronic device via Bluetooth, a problem of failed connection may occur.

[0052] Taking a mobile phone connecting to Bluetooth peripherals via Bluetooth as an example, users sometimes need to connect the mobile phone to multiple Bluetooth peripherals such as a Bluetooth keyboard and Bluetooth headphones respectively. However, when the mobile phone has already been connected to one or more Bluetooth peripherals including Bluetooth headphones, if the user wants the mobile phone to connect to a new Bluetooth peripheral such as a Bluetooth keyboard, a problem that the mobile phone cannot successfully connect to the Bluetooth keyboard may occur, and moreover, the mobile phone may repeatedly attempt to connect to the Bluetooth keyboard under the user's trigger but still cannot successfully connect.

[0053] After analysis, it is found that the Advanced Audio Distribution Profile (A2DP) stipulates that the highest audio standard is 328 kbps for mono and 512 kbps for stereo, which results in the inability to directly transmit higher - format audio files over a Bluetooth connection. Audio codec processing must be performed in the middle. See Figure 1 As shown, it shows a possible processing flow for transmitting an audio file from an electronic device such as a mobile phone / tablet / computer to a Bluetooth headset and playing music on the Bluetooth headset. Among them, on the electronic device side, audio files in formats such as.mp3 and.flac are decoded to restore the compressed audio data to an audio signal in pulse code modulation (PCM) format. Then, the audio signal is successively PCM - encoded and Bluetooth - audio - encoded, and the resulting audio data is transmitted to the Bluetooth headset side via Bluetooth; on the Bluetooth headset side, corresponding Bluetooth - audio decoding and PCM decoding are performed, and the resulting audio data is transmitted to the speaker via a digital - to - analog converter (DAC) and an amplifier (AMP), thus realizing music playback.

[0054] When transmitting an audio file over a Bluetooth connection, the audio codec protocols used can include but are not limited to: low - latency hi - definition audio codec (LHDC), LDAC, aptXHD, Adaptive, advanced audio coding (AAC), sub - band coding (SBC), etc. The ranking of Bluetooth audio codec protocols mainly depends on factors such as sound quality, latency, transmission rate, and compatibility. Based on the technical characteristics and market acceptance of each codec protocol, the current ranking of existing Bluetooth codec protocols from high to low is basically: LHDC / LDAC, aptX HD / Adaptive, AAC, SBC. Among them, SBC is the most common Bluetooth transmission protocol, and 99% of Bluetooth headsets support it. Generally, the higher the ranking of a Bluetooth codec protocol, the higher the sound quality and the greater the Bluetooth bandwidth occupied. When a mobile phone connects to a Bluetooth headset to play music, if high - quality audio coding protocols such as LHDC / LDAC are used to transmit audio data to the Bluetooth headset, since the amount of audio data transmitted is large and the Bluetooth time slots (Bluetooth bandwidth) occupied are more, the Bluetooth time slots left for the mobile phone to page the Bluetooth keyboard are less, and the paging packets sent are not dense. Most likely, the Bluetooth keyboard will not be able to receive the paging packets sent by the mobile phone, resulting in the failure of the mobile phone to connect to the Bluetooth keyboard.

[0055] For similar reasons, when an electronic device has already connected to one or more other electronic devices via Bluetooth, and the existing Bluetooth connection occupies too much Bluetooth bandwidth of the electronic device, it may also cause the electronic device to fail to successfully connect to a new electronic device via Bluetooth.

[0056] In view of this, the embodiments of the present application provide a device connection method and an electronic device to reduce the problem that when an electronic device has already connected to at least one electronic device via Bluetooth, it cannot successfully connect to a new electronic device via Bluetooth. In other words, the probability of the electronic device successfully connecting to a new electronic device via Bluetooth is increased.

[0057] Specifically, in the embodiments of the present application, this problem is solved by reducing the bandwidth occupied by the existing Bluetooth connection. By reducing the bandwidth occupied by the existing Bluetooth connection of the electronic device, more Bluetooth bandwidth can be freed up for the electronic device to establish a new Bluetooth connection, thereby increasing the probability of the electronic device successfully connecting to a new electronic device via Bluetooth.

[0058] The device connection method of the embodiments of the present application can be applied to electronic devices supporting Bluetooth functions, such as mobile phones, personal computers (PCs), tablet computers (PADs), wearable devices, smart screens, vehicle-mounted devices, etc.

[0059] It can be understood that the Bluetooth connection in the embodiments of the present application can also be extended to other connections such as wifi connections.

[0060] Figure 2A The structural schematic diagram of the electronic device 100 is shown. The electronic device 100 may include a processor 110, an internal memory 121, an antenna 1, an antenna 2, a wireless communication module 160, a display screen 194, etc.

[0061] It can be understood that the structure schematically shown in the embodiments of the present invention does not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may include more or fewer components than those shown in the figure, or combine certain components, or split certain components, or have different component arrangements. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware. For example Figure 2AAs shown in the figure, the electronic device 100 may further include: an external memory interface 120, 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, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, a headphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, and a subscriber identification module (SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, a barometric pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.

[0062] 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 processing unit (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Among them, different processing units may be independent devices or integrated in one or more processors.

[0063] The controller may generate operation control signals according to the instruction operation code and timing signals to complete the control of fetching and executing instructions.

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

[0065] In some embodiments, the processor 110 may include one or more interfaces. The interfaces 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.

[0066] The USB interface 130 is an interface that complies with the USB standard specification. Specifically, it 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 peripheral devices. It can also be used to connect headphones to play audio through the headphones. This interface can also be used to connect other electronic devices, such as AR devices, etc.

[0067] It can be understood that the interface connection relationship between the modules illustrated in the embodiments of the present invention is only for illustrative purposes 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.

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

[0069] 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 inputs from the battery 142 and / or the charging management module 140 to supply power to the processor 110, the internal memory 121, the display screen 194, the camera 193, the wireless communication module 160, etc. The power management module 141 can also be used to monitor parameters such as battery capacity, battery cycle count, and battery health status (leakage, impedance). In some other embodiments, the power management module 141 can also be disposed in the processor 110. In some other embodiments, the power management module 141 and the charging management module 140 can also be disposed in the same device.

[0070] The electronic device 100 realizes the display function through the GPU, the display screen 194, and the application processor, etc. The GPU is a microprocessor for image processing, which is connected to 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, which execute program instructions to generate or change display information.

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

[0072] The internal memory 121 can be used to store computer-executable program code, and the executable program code includes instructions. The internal memory 121 can include a program storage area and a data storage area. Among them, the program storage area can store an operating system, application programs required for at least one function (such as a sound playback function, an image playback function, etc.). The data storage area can store data created during the use of the electronic device 100 (such as audio data, a phone book, etc.). In addition, the internal memory 121 can include a high-speed random access memory and can also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc. 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 and / or the instructions stored in the memory provided in the processor.

[0073] The software system of the electronic device 100 can adopt a layered architecture, an event-driven architecture, a microkernel architecture, a microservices architecture, or a cloud architecture. In the embodiments of the present invention, taking the system as an example, the software structure of the electronic device 100 is exemplarily described.

[0074] Figure 2B The following is a software structure block diagram of an electronic device provided by an embodiment of the present application. The layered architecture divides the software into several layers, and each layer has a clear role and division of labor. The layers communicate with each other through software interfaces. In the embodiments of the present application, taking the Android system as an example, the software structure of the first electronic device of the Android system is described. In some embodiments, the Android system is divided into five layers, from top to bottom are the application layer, the application framework layer, the system library and the Android runtime layer, the hardware abstraction layer (HAL), and the kernel layer.

[0075] The application layer can include several application programs (hereinafter simply referred to as applications), such as a music application, a video application, a settings application, etc.

[0076] The application framework layer provides application programming interfaces (APIs) and programming frameworks for the applications in the application layer, including various components and services to support developers' Android development. The application framework layer also includes some predefined functions. For example, the framework layer can include: a window manager, a resource manager, etc.

[0077] The system libraries and Android Runtime layer include system libraries and Android Runtime. The system libraries can include multiple functional modules. For example: Surface Manager, 2D graphics engine, 3D graphics processing library (such as OpenGLES), media library, font library, etc. Among them, the browser kernel is responsible for interpreting web page syntax (such as HTML, JavaScript, an application under the Standard Generalized Markup Language) and rendering (displaying) web pages; the 2D graphics engine is used to implement 2D graphics drawing, image rendering, synthesis, and layer processing, etc.; the 3D graphics processing library is used to implement 3D graphics drawing, image rendering, synthesis, and layer processing, etc.; the media library is used to implement the input of different streaming media; the font library is used to implement the input of different fonts. Android Runtime is responsible for the scheduling and management of the Android system, specifically including core libraries and virtual machines. Among them, the core libraries contain two parts: one part is the functional functions that need to be called by the Java language, and the other part is the core libraries of Android; the virtual machine is used to run Android applications developed using the Java language.

[0078] The HAL layer is an interface layer located between the operating system kernel and the hardware circuit. The HAL layer includes but is not limited to: Camera Hardware Abstraction Layer (Camera HAL), Audio Hardware Abstraction Layer (Audio HAL), etc. Among them, the Camera Hardware Abstraction Layer is used to process the image stream; the Audio Hardware Abstraction Layer is used to process audio data.

[0079] The kernel layer is the layer between hardware and software. The kernel layer can include: Bluetooth driver, WIFI driver, display driver, etc. Among them, the Bluetooth driver is used to drive the Bluetooth chip, the WIFI driver is used to drive the WIFI chip, and the display driver is used to drive the display screen.

[0080] In the following embodiments, the device connection method of the present application will be described in detail in combination with the structure of the above-mentioned electronic device.

[0081] First, taking the example of a mobile phone (the first electronic device) already connected to a Bluetooth headset (the second electronic device) and the mobile phone connecting to a Bluetooth keyboard (the third electronic device) through Bluetooth, an exemplary description will be given of the possible interface implementation of the device connection method of the embodiments of the present application.

[0082] In some embodiments, such as Figure 3As shown, the settings application of the mobile phone can provide a settings main interface, such as that shown in interface 10. The settings main interface includes several settings options, such as the "Bluetooth" option shown in interface 10, settings option 1 to settings option 4, etc. Corresponding controls can also be set for each settings option in the settings main interface. For example, control 11 set for the "Bluetooth" option in interface 10. It can be understood that other information such as the current on / off state of Bluetooth can also be displayed in the settings main interface. For example, in interface 10, in addition to displaying the "Bluetooth" option and the control 11 corresponding to the Bluetooth option, the current on / off state of Bluetooth is also displayed: on.

[0083] When the user clicks the control corresponding to the settings option in the settings main interface, the settings application can display the settings interface corresponding to the settings option. For example, if the user clicks control 11 of the "Bluetooth" option in interface 10, the settings application can display the Bluetooth settings interface, such as that shown in interface 20. The Bluetooth settings interface includes a Bluetooth on / off control 21 for controlling the opening or closing of the Bluetooth function. When the Bluetooth function is turned on, as shown in interface 20, a list of available devices can be displayed in the Bluetooth settings interface.

[0084] The list of available devices displays a list of devices searched by the mobile phone via Bluetooth, which includes both devices that have been paired and connected to the mobile phone via Bluetooth and devices that have not been paired and connected to the mobile phone. For devices that have been paired and connected to the mobile phone via Bluetooth, the current connection state between the device and the mobile phone can also be displayed in the Bluetooth settings interface. For example, in interface 20, the list shown in the available devices column includes a Bluetooth headset, a Bluetooth keyboard, and a speaker. Among them, since the Bluetooth headset has been successfully paired and connected to the mobile phone via Bluetooth, the current connection state of the Bluetooth headset is also recorded in interface 20: connected.

[0085] To enable the user to instruct the mobile phone to pair and connect with the settings in the list of available devices, corresponding controls can be set for the devices in the list of available devices for the user to trigger the pairing and connection of the mobile phone with the device. For example, in the Bluetooth settings interface shown in interface 20, corresponding controls 22 to 24 can be set for the Bluetooth headset, the Bluetooth keyboard, and the speaker respectively, and device information such as the Bluetooth headset, the Bluetooth keyboard, and the speaker is displayed on the corresponding controls.

[0086] If the user selects the control corresponding to a device in the list of available devices, the mobile phone can attempt to pair and connect with the third electronic device selected by the user via Bluetooth. For example, if the user selects the control 23 corresponding to the Bluetooth keyboard (the third electronic device) in the user selection interface 20, the mobile phone can attempt to pair and connect with the Bluetooth keyboard via Bluetooth. If the pairing and connection between the mobile phone and the Bluetooth keyboard is successful, a prompt interface indicating successful pairing and connection as shown in, for example, interface 30 can be displayed. After the user clicks the OK control in interface 30, a Bluetooth settings interface as shown in, for example, interface 40 can be displayed, and the current connection status of the Bluetooth keyboard in this Bluetooth settings interface is updated to connected; if the pairing and connection between the mobile phone and the Bluetooth keyboard fails, a prompt interface indicating connection failure as shown in, for example, interface 50 can be displayed. After the user clicks the OK control in interface 50, the Bluetooth settings interface as shown in, for example, interface 20 can be returned.

[0087] In the above example of interface implementation, after the settings application returns the Bluetooth settings interface as shown in, for example, interface 20, in order to enable the mobile phone to pair and connect with the Bluetooth keyboard, the user may click the Bluetooth keyboard multiple times to instruct the mobile phone to re-attempt to pair and connect with the Bluetooth keyboard. However, when the amount of audio data transmitted between the mobile phone and the Bluetooth headset is large and occupies a large amount of Bluetooth bandwidth and time slots, it may occur that the mobile phone is unable to connect to the Bluetooth keyboard all the time. As a result, the settings application will display the prompt interface indicating connection failure as shown in interface 50 multiple times and finally return the Bluetooth settings interface as shown in, for example, interface 20.

[0088] In order to increase the success probability of the mobile phone connecting to the third electronic device, in another embodiment provided in this application, when the user clicks the third electronic device (such as a Bluetooth keyboard or a speaker) and the mobile phone fails to connect to the third electronic device, in addition to displaying the prompt interface indicating connection failure as shown in, for example, interface 50, the user is also provided with an option to reduce the quality of the existing Bluetooth connection and attempt to reconnect to the third electronic device, so as to increase the probability and possibility of the mobile phone successfully pairing and connecting to the third electronic device.

[0089] Still taking the third electronic device as a Bluetooth keyboard as an example, refer to Figure 4 As shown, if the user selects the Bluetooth keyboard in the Bluetooth settings interface as shown in, for example, interface 20 and the pairing and connection between the mobile phone and the Bluetooth keyboard fails, the displayed prompt interface indicating pairing and connection failure is as shown in, for example, interface 60. In addition to including the OK control, this prompt interface also provides the user with a control 61, and the information displayed on the control 61 can be: Reduce the quality of the existing Bluetooth connection and re-attempt to connect.

[0090] If the user clicks the control 61, the mobile phone executes the device connection method in the embodiment of this application to reduce the quality of the existing Bluetooth connection, for example, to reduce the connection quality between the mobile phone and the Bluetooth headset in this embodiment, and re-attempt to connect to the Bluetooth keyboard.

[0091] If the mobile phone successfully pairs and connects with a Bluetooth keyboard after reducing the quality of an existing Bluetooth connection, a pairing connection success prompt interface as shown in, for example, interface 70 can be displayed. There are control 71 and control 72 set on this prompt interface. The text displayed on control 71 is: Restore the connection with reduced quality to the original quality, and the text displayed on control 72 is: Keep the connection with reduced quality at the current quality. When the user clicks on control 71, the mobile phone can restore the previously reduced-quality connection, such as the connection between the mobile phone and the Bluetooth headset in this embodiment, to the original quality, and display a Bluetooth settings interface as shown in, for example, interface 40. When the user clicks on control 72, the mobile phone keeps the previously reduced-quality connection, such as the connection between the mobile phone and the Bluetooth headset in this embodiment, at the current quality unchanged, and displays a Bluetooth settings interface as shown in, for example, interface 40.

[0092] If the mobile phone fails to pair and connect with the Bluetooth keyboard after reducing the quality of an existing Bluetooth connection to the lowest quality, a pairing connection failure prompt interface as shown in, for example, interface 80 can be displayed. There are control 81 and control 82 set on this prompt interface. The text displayed on control 81 is: Restore the connection with reduced quality to the original quality, and the text displayed on control 82 is: Keep the connection with reduced quality at the current quality. When the user clicks on control 81, the mobile phone can restore the previously reduced-quality connection, such as the connection between the mobile phone and the Bluetooth headset in this embodiment, to the original quality, and return to a Bluetooth settings interface as shown in, for example, interface 20. When the user clicks on control 82, the mobile phone keeps the previously reduced-quality connection, such as the connection between the mobile phone and the Bluetooth headset in this embodiment, at the current quality unchanged, and returns to a Bluetooth settings interface as shown in, for example, interface 20.

[0093] In other embodiments provided by the present application, the above-mentioned interface 60 can be split into 2 prompt interfaces for implementation. Specifically, reference can be made to Figure 5 interfaces 30 and 60a in. If the user selects a Bluetooth keyboard in the Bluetooth settings interface as shown in, for example, interface 20 and the pairing connection between the mobile phone and the Bluetooth keyboard fails, a pairing connection failure prompt interface as shown in, for example, interface 30 is displayed. When the user clicks on the confirmation control in interface 30, a prompt interface for reconnecting after reducing the quality of an existing Bluetooth connection as shown in, for example, interface 60a is displayed. The prompt message displayed on this interface is: Whether to reduce the quality of the existing Bluetooth connection and retry connecting to the Bluetooth keyboard? There are also corresponding "Yes" control and "No" control set on this prompt interface. If the user clicks on the "No" control, the user can return to the Bluetooth settings interface as shown in, for example, interface 20. If the user clicks on the "Yes" control, the mobile phone executes the device connection method in the embodiment of the present application to reduce the quality of an existing Bluetooth connection, such as reducing the connection quality between the mobile phone and the Bluetooth headset in this embodiment, and retries connecting to the Bluetooth keyboard.

[0094] Based on a similar interface implementation principle, such as Figure 5As shown, in other embodiments provided by the present application, the above interface 70 can also be split into two prompt interfaces for implementation. Specifically, reference can be made to Figure 5 the interface 50 and the interface 70a therein. If the mobile phone executes the device connection method of the embodiment of the present application to reduce the quality of the existing Bluetooth connection, for example, in this embodiment, to reduce the connection quality between the mobile phone and the Bluetooth headset, and then re-attempt to connect to the Bluetooth keyboard and the pairing connection is successful, the setting application can first display the pairing connection success prompt interface shown in the interface 50. After the user clicks the OK control, it then displays, for example, the prompt interface for restoring the quality of the existing Bluetooth connection shown in the interface 70a. The prompt message displayed in this interface is: Do you want to restore the connection with reduced quality to the original quality? This prompt interface is also correspondingly provided with a "Yes" control and a "No" control. If the user clicks the "Yes" control, the mobile phone can restore the quality of the existing Bluetooth connection with reduced quality, that is, the connection between the mobile phone and the Bluetooth headset, to the original quality, and display, for example, the Bluetooth settings interface shown in the interface 40. If the user clicks the "No" control, the existing Bluetooth connection with reduced quality, that is, the connection between the mobile phone and the Bluetooth headset, can be maintained at the current quality (i.e., the reduced quality), and display, for example, the Bluetooth settings interface shown in the interface 40.

[0095] It can be understood that the above interface 80 can also be split into two prompt interfaces for implementation. The specific interface implementation can refer to the prompt interface shown in the interface 50 and the prompt interface shown in the interface 70a, which will not be elaborated in the embodiments of the present application.

[0096] It can be understood that the interface implementation in the above embodiments is only an example. The text descriptions displayed in the interface and the layout of the controls, etc. can be adjusted or set as needed in actual applications, and are not used to limit the implementation of the above interface.

[0097] Next, through Figure 6 , an exemplary description will be given of the possible implementation process of the device connection method of the embodiment of the present application in combination with the above interface implementation.

[0098] In this embodiment, the first electronic device (such as the mobile phone in the above embodiment) and the second electronic device (such as the Bluetooth headset in the above embodiment) are in a paired connection state and normally transmit data. The second electronic device can be one or more. The third electronic device is a device that the first electronic device hopes to pair and connect to, such as the Bluetooth keyboard in the above embodiment.

[0099] The pairing connection in the embodiments of the present application can be regarded as a process of mutual authentication and connection establishment between the first electronic device and the target device (such as the second electronic device or the third electronic device mentioned above). The pairing connection based on Bluetooth can be regarded as a process of mutual authentication and establishment of a Bluetooth connection between the first electronic device and the target device. The above-mentioned Bluetooth connection is a communication connection based on Bluetooth established between the first electronic device and the target device when the Bluetooth pairing connection between the first electronic device and the target device is successful.

[0100] As Figure 6 shown, the device connection method in the embodiments of the present application may include:

[0101] Step 601: The first electronic device displays a first Bluetooth settings interface, and the first Bluetooth settings interface includes a list of available devices.

[0102] The first Bluetooth settings interface in this step is, for example, as shown in Interface 20.

[0103] The devices included in the list of available devices are the devices searched by the first electronic device through Bluetooth. The devices included in the list of available devices can be either devices that have been successfully paired and connected to the first electronic device through Bluetooth, such as the Bluetooth headset in Interface 20, or devices that have not been paired and connected to the first electronic device, such as the Bluetooth keyboard and speaker in Interface 20.

[0104] In some embodiments, the pairing connection status (connected or not connected) of each device in the list of available devices may be displayed in the first Bluetooth settings interface.

[0105] Combined with Figure 7 , in some embodiments, this step may specifically be executed by the settings application in the first electronic device.

[0106] Step 602: The first electronic device receives a pairing connection request for the third electronic device in the list of available devices, and performs a pairing connection with the third electronic device.

[0107] The user can click on the control corresponding to a certain device in the list of available devices of the first Bluetooth settings interface. Correspondingly, the first electronic device can detect the click operation on the control, and use the device corresponding to the control as the third electronic device, thereby receiving a pairing connection request for the third electronic device. Still taking the first Bluetooth settings interface as Interface 20 as an example, the user can click on the control 23 corresponding to the Bluetooth keyboard. Correspondingly, the first electronic device can detect the click operation on the control 23, that is, receive a pairing connection request for the Bluetooth keyboard corresponding to the control 23.

[0108] In this step, the pairing connection between the first electronic device and the third electronic device can be achieved using the relevant pairing connection technology of Bluetooth. In this step, the first electronic device does not change the quality of the Bluetooth connection already established between the first electronic device and other devices. Continuing the foregoing example, if the mobile phone has been paired and connected with a Bluetooth headset, and in this step it is paired and connected with a Bluetooth keyboard, when the mobile phone is paired and connected with the Bluetooth keyboard in this step, the quality of the Bluetooth connection between the mobile phone and the Bluetooth headset is not changed.

[0109] Combined with Figure 7 , in this step, specifically, the settings application in the first electronic device can receive a pairing connection request for the third electronic device in the list of available devices, request the Bluetooth driver to pair and connect with the third electronic device, and the Bluetooth driver responds to the pairing connection request to pair and connect with the third electronic device.

[0110] Step 603: The first electronic device determines whether the pairing connection with the third electronic device is successful. If successful, execute Step 604; otherwise, execute Step 605.

[0111] Combined with Figure 7 , the Bluetooth driver can send the pairing connection result to the settings application, and the settings application can make the judgment in this step based on the received pairing connection result.

[0112] Step 604: The first electronic device displays a prompt interface indicating successful pairing connection. After receiving the confirmation operation of the user, it displays the second Bluetooth settings interface, and this branch process ends.

[0113] The prompt interface for successful pairing connection is, for example, the above-mentioned interface 30. When the user clicks the OK control in interface 30, the corresponding first electronic device detects the click operation on the OK control, that is, receives the confirmation operation of the user.

[0114] The above-mentioned second Bluetooth settings interface is, for example, interface 40.

[0115] Combined with Figure 7 , this step can be specifically executed by the settings application.

[0116] Step 605: The first electronic device determines whether there is a connection among the existing Bluetooth connections that can reduce the quality. If not, execute Step 606; if so, execute Step 607.

[0117] It is understandable that there may be one or more existing Bluetooth connections. An existing Bluetooth connection refers to the Bluetooth connections that have been established between the first electronic device and each second electronic device when this step is executed. For example, if there are 2 second electronic devices connected to the first electronic device, namely the second electronic device A and the second electronic device B, then the Bluetooth connection 1 established between the first electronic device and the second electronic device A, and the Bluetooth connection 2 established between the first electronic device and the second electronic device B are both existing Bluetooth connections. In other words, the first electronic device has 2 existing Bluetooth connections.

[0118] Reducing the quality of a Bluetooth connection in the embodiments of the present application can also be considered as reducing the bandwidth occupied by the Bluetooth connection. Specifically, it can include reducing the encoding format used for data transmission on the Bluetooth connection.

[0119] Taking a mobile phone (the first electronic device) and a Bluetooth headset (the second electronic device) paired and connected via Bluetooth as an example, in some embodiments, the quality ranking of different encoding formats can be preset in the mobile phone, such as LHDC / LDAC, aptXHD / Adaptive, AAC, SBC. This quality ranking can also be regarded as the ranking of the occupied bandwidth. Then, in this step, the mobile phone can obtain the encoding formats supported by the mobile phone and the Bluetooth headset respectively. According to the encoding format currently used for the connection between the mobile phone and the Bluetooth headset, combined with the above ranking and the encoding formats supported by the mobile phone and the Bluetooth headset respectively, it is determined whether there is an encoding format with lower quality than the currently used encoding format among the encoding formats supported by both the mobile phone and the Bluetooth headset. If there is, the existing Bluetooth connection can reduce the quality; otherwise, the existing Bluetooth connection cannot reduce the quality. Specifically, the encoding formats supported by both the mobile phone and the Bluetooth headset can be determined first, and then the quality ranking of the encoding formats supported by both of them can be obtained. Based on this ranking, it is determined whether there is an encoding format with lower quality than the encoding format currently used by the existing Bluetooth connection. For example, assume that the mobile phone supports LDAC, Adaptive, AAC, SBC, and the pre-stored quality ranking of the encoding formats is: LDAC, Adaptive, AAC, SBC, while the Bluetooth headset only supports LDAC, AAC, SBC. Then it can be known that both the mobile phone and the Bluetooth headset support LDAC, AAC, SBC, and the ranking is LDAC, AAC, SBC. If the encoding format currently used by the existing Bluetooth connection is LDAC, then it can be determined that there are encoding formats AAC and SBC with lower quality than the currently used encoding format LDAC, and the existing Bluetooth connection can reduce the quality; if both the mobile phone and the Bluetooth headset support LDAC, AAC, SBC, and the encoding format currently used by the existing Bluetooth connection is SBC, then it can be determined that there is no encoding format with lower quality than the currently used encoding format SBC, and the existing Bluetooth connection cannot reduce the quality.

[0120] In some other embodiments, considering that some encoding formats may also have different transmission bitrates, and the higher the transmission bitrate, the higher the quality of the connection can be considered. Therefore, in the above embodiments, when determining whether an existing Bluetooth connection can reduce the quality, the transmission bitrate of the encoding format can be combined on the basis of the encoding format. For the same encoding format with different transmission bitrates, it can be considered as encoding formats of different qualities. For example, LDAC has three transmission bitrates: 990 kbps, 660 kbps, and 330 kbps, then it can be considered as three different qualities of LDAC, and the three different qualities of LDAC are distinguished and sorted by the transmission bitrate. For example, if the first electronic device and the Bluetooth headset only support LDAC, and LDAC has three transmission bitrates: 990 kbps, 660 kbps, and 330 kbps, and the quality ranking of the encoding formats pre-stored in the first electronic device is: LDAC of 990 kbps, LDAC of 660 kbps, LDAC of 330 kbps, and the encoding format currently used by the existing Bluetooth connection is LDAC of 990 kbps, then it can be determined that there is an encoding format with a lower quality than the currently used LDAC of 990 kbps, and the existing Bluetooth connection can reduce the quality; if the first electronic device and the Bluetooth headset only support LDAC, and LDAC has three transmission bitrates: 990 kbps, 660 kbps, and 330 kbps, and the quality ranking of the encoding formats pre-stored in the first electronic device is: LDAC of 990 kbps, LDAC of 660 kbps, LDAC of 330 kbps, and the encoding format currently used by the existing Bluetooth connection is LDAC of 330 kbps, then it can be determined that there is no encoding format with a lower quality than the currently used LDAC of 330 kbps, and the existing Bluetooth connection cannot reduce the quality.

[0121] Combined with Figure 7 , this step can be executed by the settings application, or, alternatively, the settings application can request the Bluetooth driver to execute, and the Bluetooth driver sends the judgment result to the settings application.

[0122] Step 606: The first electronic device displays a prompt interface for pairing connection failure. After receiving the confirmation operation of the user, it displays the third Bluetooth settings interface, and this branch process ends.

[0123] The prompt interface for pairing connection failure is, for example, as shown in interface 50. When the user clicks the OK control in interface 50, the corresponding first electronic device detects the click operation on the OK control, that is, receives the confirmation operation of the user.

[0124] The above-mentioned third Bluetooth settings interface is, for example, as shown in interface 20.

[0125] It can be understood that since the pairing connection fails and the connection status of each available device in the first Bluetooth settings interface remains unchanged, the third Bluetooth settings interface can be the same as the first Bluetooth settings interface, such as shown in interface 20. Alternatively, in other embodiments, the third Bluetooth settings interface can also be different from the first Bluetooth settings interface. For example, a mark or text description can be set for the third electronic device (such as a Bluetooth keyboard) with a failed pairing connection in the third Bluetooth settings interface to prompt the user that the pairing connection of the third electronic device (such as a Bluetooth keyboard) fails. The specific interface implementation is not limited in the embodiments of the present application.

[0126] Combined with Figure 7 , this step can be executed by the settings application.

[0127] Step 607: The first electronic device displays a first prompt interface for prompting the user whether to reduce the quality of the existing Bluetooth connection of the first electronic device and retry connecting to the third electronic device.

[0128] The first prompt interface may include a first control for triggering the first electronic device to reduce the quality of the existing Bluetooth connection of the first electronic device and retry connecting to the third electronic device.

[0129] In some embodiments, as shown in interface 60 for example, the first control may be control 61 in interface 60.

[0130] In some embodiments, as shown in interface 60a for example, the first control may be the "Yes" control in interface 60a.

[0131] Combined with Figure 7 , this step can be executed by the settings application.

[0132] Step 608: The first electronic device receives a selection operation for the first control and attempts to re-pair and connect to the third electronic device by reducing the quality of the existing Bluetooth connection until a final pairing connection result is obtained.

[0133] The final pairing connection result may include: the third electronic device is successfully paired and connected, or the quality occupied by the existing Bluetooth connection is reduced to the lowest level, and the pairing connection with the third electronic device still fails.

[0134] The first electronic device receiving a selection operation for the first control can also be considered as detecting an instruction to reduce the quality of the existing Bluetooth connection and retry connecting to the third electronic device.

[0135] The user can click on the control 61 in the interface 60, or the "Yes" control in the interface 60a. Correspondingly, the first electronic device detects the user's click operation on the above control, that is, it detects the indication information to reduce the quality of the existing Bluetooth connection and re-attempt to connect to the third electronic device.

[0136] When the first electronic device detects the indication information to re-attempt to connect to the third electronic device without reducing the quality of the existing Bluetooth connection, it can directly return to the Bluetooth settings interface, such as the interface 20 shown. For example, the user can click on the "OK" control in the interface 60, or the "No" control in the interface 60a. Correspondingly, the first electronic device detects the user's click operation on the above control, that is, it detects the indication information to re-attempt to connect to the third electronic device without reducing the quality of the existing Bluetooth connection.

[0137] Combined with Figure 7 , in this step, after the settings application receives the selection operation for the first control, it can send a request to the Bluetooth driver to reduce the quality of the existing Bluetooth connection and reconnect to the third electronic device. The Bluetooth driver responds to this request and attempts to re-pair and connect to the third electronic device by reducing the quality of the existing Bluetooth connection until the final pairing and connection result is obtained.

[0138] This method switches the encoding format used in the existing Bluetooth connection of the first electronic device from an encoding format with relatively high quality (occupying bandwidth) to an encoding format with relatively low quality, so as to reduce the Bluetooth resources occupied by the existing Bluetooth connection, thereby increasing the possibility of successful pairing and connection between the first electronic device and the third electronic device, that is, improving the probability of successful Bluetooth connection between the first electronic device and the new third electronic device.

[0139] Step 609: The first electronic device determines whether the pairing and connection between the first electronic device and the third electronic device is successful according to the final pairing and connection result. If successful, execute step 610; if failed, execute step 612.

[0140] Combined with Figure 7 , the Bluetooth driver obtains the final pairing and connection result and sends the final pairing and connection result to the settings application. The settings application can determine whether the pairing and connection between the first electronic device and the third electronic device is successful according to the final pairing and connection result.

[0141] Step 610: The first electronic device displays a second prompt interface, and the second prompt interface includes a second control and a third control.

[0142] The second control is used to trigger the first electronic device to restore the connection with reduced quality.

[0143] The third control is used to trigger the first electronic device not to restore the connection with reduced quality, that is, to keep the quality of the connection with reduced quality unchanged.

[0144] In some embodiments, as shown in interface 70 for example, the second control may be control 71 in interface 70, and the third control may be control 72 in interface 70.

[0145] In some embodiments, as shown in interface 70a for example, the second control may be the "Yes" control in interface 70a, and the third control may be the "No" control in interface 70a.

[0146] Combined with Figure 7 , this step may be executed by the settings application.

[0147] Step 611: When the first electronic device receives a selection operation for the second control, it restores the connection with reduced quality to the original quality, and displays the fourth Bluetooth settings interface; when the first electronic device receives a selection operation for the third control, it keeps the quality of the connection with reduced quality unchanged and displays the fourth Bluetooth settings interface. This branch process ends.

[0148] Among them, the fourth Bluetooth settings interface is as shown in interface 40 for example.

[0149] Combined with Figure 7 , when the settings application in this step receives a selection operation for the second control, it may send a request message to the Bluetooth driver to request the Bluetooth driver to restore the connection with reduced quality to the original quality. The Bluetooth driver responds to this request and restores the connection with reduced quality to the original quality. Moreover, the settings application displays the fourth Bluetooth settings interface. It can be understood that the execution order between the settings application sending the request and displaying the fourth Bluetooth settings interface is not restricted.

[0150] When the settings application in this step receives a selection operation for the third control, it may directly display the fourth Bluetooth settings interface (not shown in Figure 7 ), and at this time the settings application may not send a request to the Bluetooth driver, so that the Bluetooth driver can keep the quality of the connection with reduced quality unchanged.

[0151] Step 612: The first electronic device displays a third prompt interface, and the third prompt interface includes a fourth control and a fifth control.

[0152] The fourth control is used to trigger the first electronic device to restore the connection with reduced quality.

[0153] The fifth control is used to trigger the first electronic device not to restore the connection with reduced quality, that is, to keep the quality of the connection with reduced quality unchanged.

[0154] In some embodiments, as shown in interface 80 for example, the fourth control may be control 81 in interface 80, and the fifth control may be control 82 in interface 80.

[0155] In some embodiments, as shown in the third prompt interface such as interface 70a, the fourth control may be the "Yes" control in interface 70a, and the fifth control may be the "No" control in interface 70a.

[0156] Combined with Figure 7 , this step may be executed by the settings application.

[0157] Step 613: When the first electronic device receives a selection operation for the fourth control, it restores the connection with reduced quality to its original quality, and displays the fifth Bluetooth settings interface; when the first electronic device receives a selection operation for the fifth control, it keeps the quality of the connection with reduced quality unchanged and displays the fifth Bluetooth settings interface. This branch process ends.

[0158] Among them, the fifth Bluetooth settings interface is, for example, as shown in interface 40.

[0159] It can be understood that in the above examples, the second Bluetooth settings interface, the fourth Bluetooth settings interface, and the fifth Bluetooth settings interface may be the same interface, such as interface 40. In other embodiments, the second Bluetooth settings interface, the fourth Bluetooth settings interface, and the fifth Bluetooth settings interface may also be different. The specific interface implementation is not limited in the embodiments of the present application.

[0160] Combined with Figure 7 , when the settings application in this step receives a selection operation for the fourth control, it may send a request message to the Bluetooth driver to request the Bluetooth driver to restore the connection with reduced quality to its original quality. The Bluetooth driver responds to this request and restores the connection with reduced quality to its original quality. And the settings application displays the fifth Bluetooth settings interface. It can be understood that the execution order between the settings application sending the request and displaying the fifth Bluetooth settings interface is not limited.

[0161] Combined with Figure 7 , when the settings application in this step receives a selection operation for the sixth control, it can directly display the fifth Bluetooth settings interface. At this time, the settings application may not send a request to the Bluetooth driver, so that the Bluetooth driver can keep the quality of the connection with reduced quality unchanged.

[0162] The following gives an exemplary description of the possible implementation of the first electronic device attempting to re-pair and connect to the third electronic device by reducing the quality of the existing Bluetooth connection in step 608 until the final pairing connection result is obtained.

[0163] Combined with the description in step 608, the following Figure 8 The method shown can be specifically executed by the Bluetooth driver in the first electronic device.

[0164] As Figure 8As shown, the first electronic device attempts to re-pair and connect to the third electronic device by reducing the quality of an existing Bluetooth connection until a final pairing and connection result is obtained. Specifically, it may include:

[0165] Step 801: The first electronic device determines a first connection from the existing Bluetooth connections.

[0166] Here, the first connection refers to a connection in the existing Bluetooth connections that can have its quality reduced, or a connection in the existing Bluetooth connections that can have its occupied bandwidth reduced. It can be understood that when there are multiple connections in the existing Bluetooth connections, the determined first connection can be one or more. In some embodiments, the above first connection can be determined according to the judgment result in step 605.

[0167] Step 802: The first electronic device reduces the quality of at least one first connection.

[0168] Based on Figure 8 the method flow shown, Figure 8 which is a loopable processing flow, step 802 can be executed one round (one loop) or multiple rounds.

[0169] When executing this step in each round, if the number of first connections is multiple, the quality of some of the first connections (for example, one first connection) can be selected to be reduced, or the quality of each first connection can be selected to be reduced. For example, if the first electronic device has three existing Bluetooth connections, namely Bluetooth connection 1 to 3, and the quality of Bluetooth connection 1 and 2 can be reduced, then in step 801, the first connections can be determined as Bluetooth connection 1 and Bluetooth connection 2. In this step, the quality of Bluetooth connection 1 or Bluetooth connection 2 can be selected to be reduced, or the quality of both Bluetooth connection 1 and Bluetooth connection 2 can be selected to be reduced.

[0170] For a first connection, when reducing the quality of this first connection, the quality of this first connection can be directly reduced to the lowest level, or it can be gradually reduced according to a certain preset rule, and the quality of this first connection is reduced to the lowest level by executing step 802 multiple rounds. It can be understood that when reducing the quality of different first connections, the same strategy can be used, or different strategies can be used.

[0171] Taking the first connection as an example of the Bluetooth connection established between a mobile phone (the first electronic device) and a Bluetooth headset (the second electronic device), the coding formats used for the Bluetooth connection can include LHDC / LDAC, aptX HD / Adaptive, AAC, SBC, etc. LDAC can be further divided into three different quality coding formats: LDAC at 990 kbps, LDAC at 660 kbps, and LDAC at 330 kbps. When reducing the quality of the first connection, the coding format used for the first connection can be gradually reduced step by step according to the quality ranking of the coding formats, and the specific step size is not specifically set. For example, if both the first electronic device and the second electronic device support the coding formats of LDAC at 990 kbps, LDAC at 660 kbps, LDAC at 330 kbps, Adaptive, AAC, and SBC, and the quality ranking of the coding formats is as follows: LDAC at 990 kbps, LDAC at 660 kbps, LDAC at 330 kbps, Adaptive, AAC, SBC. Assuming that the coding format currently used for the first connection is LDAC at 990 kbps,

[0172] Then, in one embodiment, when reducing the quality of the first connection, the coding format can be gradually reduced step by step according to the quality ranking, with a step size of 1. That is, when executing step 802 for the first time, it is first reduced to LDAC at 660 kbps. Then, when the pairing connection with the third electronic device fails and returns to step 802 next time, it is reduced to LDAC at 330 kbps. Then, when the pairing connection with the third electronic device fails and returns to step 802 next time, it is reduced to Adaptive, and so on, until the pairing connection with the third electronic device is successful, or the coding format of this first connection is reduced to SBC and cannot be further reduced.

[0173] In another embodiment, when reducing the quality of the first connection, the coding format can also be gradually reduced step by step according to the quality ranking, with a step size of 2, 3, or a larger step size, etc. This is not listed here one by one.

[0174] In yet another embodiment, when reducing the quality of the first connection, the coding format of the first connection can be directly reduced to the lowest coding format, such as SBC, according to the quality ranking.

[0175] It can be understood that the above three embodiments are only examples, and in actual applications, the coding format may not be reduced according to a fixed step size, which is not limited in the embodiments of the present application.

[0176] In one embodiment, when it is determined in step 801 that there are two first connections a1 and a2, each time step 802 is executed in each round, the quality of the two first connections a1 and a2 can be reduced simultaneously until the loop ends or the quality of the two first connections a1 and a2 drops to the lowest. It can be understood that in this embodiment, when step 802 is executed in a loop, it is possible that the quality of one first connection a1 drops to the lowest first, while the quality of the other first connection a2 has not dropped to the lowest yet. At this time, when executing step 802, the quality of only the first connection a2 can be reduced. For example, assuming that the encoding format quality ranking is: LDAC, AAC, SBC, if the encoding format used by the first connection a1 is AAC and the encoding format used by the first connection a2 is LDAC, then when step 802 is executed for the first time, the quality of the first connection a1 and the second connection a2 is reduced simultaneously. The first connection a1 drops to SBC, and the second connection a2 drops to AAC. Then when step 802 is executed for the second time, since the quality of the first connection a1 has dropped to the lowest, only the quality of the second connection a1 is reduced, that is, the encoding format is changed from AAC to SBC.

[0177] In another embodiment, when it is determined in step 801 that there are two first connections a1 and a2, each time step 802 is executed in each round, the quality of only one first connection can be reduced, and the quality of the two first connections is reduced alternately. For example, assuming that the encoding format quality ranking is: LDAC, AAC, SBC, if the encoding formats used by the first connection a1 and the first connection a2 are both LDAC, then when step 802 is executed for the first time, the quality of the first connection a1 can be reduced, for example, to AAC. Then when step 802 is executed for the second time, the quality of the first connection a2 is reduced, for example, to AAC. When step 802 is executed for the third time, the quality of the first connection a1 is reduced again, for example, to SBC. When step 802 is executed for the fourth time, the quality of the first connection a2 is reduced again, for example, to SBC. Compared with the previous embodiment, this embodiment can improve the success probability of pairing and connecting between the first electronic device and the third electronic device under the condition of minimizing the impact on the quality of the existing first connections a1 and a2.

[0178] In yet another embodiment, when it is determined in step 801 that there are two first connections a1 and a2, when step 802 is executed in each round, the quality of only one first connection can be reduced. And after reducing the quality of the first connection a1 to the lowest first, then reduce the quality of the first connection a2 until it reaches the lowest. For example, assuming that the encoding format quality ranking is: LDAC, AAC, SBC, if the encoding formats used by both the first connection a1 and the first connection a2 are LDAC, then when step 802 is executed for the first time, the quality of the first connection a1 can be reduced, for example, to AAC. Then when step 802 is executed for the second time, the quality of the first connection a1 is reduced, for example, to SBC. When step 802 is executed for the third time, since the quality of the first connection a1 has reached the lowest, the quality of the first connection a2 is reduced, for example, to AAC. When step 802 is executed for the fourth time, the quality of the first connection a2 is further reduced, for example, to SBC. This embodiment can also improve the success probability of the pairing connection between the first electronic device and the third electronic device while minimizing the impact on the quality of the existing first connections a1 and a2 compared to the first embodiment. In this embodiment, the Bluetooth connection with less impact on the functional services of the electronic device can be preferentially selected for quality reduction to reduce the impact of the Bluetooth connection quality degradation on the functional services of the electronic device.

[0179] Step 803: The first electronic device retries to pair and connect with the third electronic device. If the pairing connection is successful, the final pairing connection result is a successful pairing connection. If the pairing connection fails, step 804 is executed.

[0180] Among them, if the pairing connection is successful in this step, then in step 608, the pairing connection result of a successful pairing connection is obtained, and step 609 is executed.

[0181] Step 804: The first electronic device determines whether there is a connection in the first connection whose quality can be reduced. If there is, return to execute step 802. Otherwise, the final pairing connection result is a failed pairing connection.

[0182] It can be understood that when returning to execute step 802 again, the first electronic device reduces the quality of at least one connection in the first connection whose quality can be reduced. For example:

[0183] Example 1: If there are two first connections, respectively called the first connection 1 and the first connection 2, when step 802 is executed for the first time, the quality of the first connection 1 is reduced to the lowest. Then, after executing step 803 and step 804, it can be determined that the quality of the first connection 2 can be reduced. When returning to execute step 802, since the quality of the first connection 1 has reached the lowest, the first electronic device can reduce the quality of the first connection 2.

[0184] Example 2: If there are two first connections, respectively called the first connection 1 and the first connection 2, when step 802 is first executed, the quality of the first connection 1 is reduced, but not reduced to the lowest quality. Then, after executing step 803 and step 804, it can be determined that both the first connection 1 and the first connection 2 can reduce the quality. Return to execute step 802, and the first electronic device can reduce the quality of at least one of the first connection 1 and the first connection 2. For the specific selection and implementation method, reference can be made to the corresponding description in step 802, which will not be elaborated in this embodiment of the present application.

[0185] In this method, the first electronic device gradually reduces the encoding format used on the existing Bluetooth connection, that is, gradually switches the encoding format used on the existing Bluetooth connection to an encoding format with relatively lower quality (occupied bandwidth), so as to gradually reduce the Bluetooth resources occupied by the first Bluetooth connection. Each time the quality is reduced, a pairing connection with the third electronic device is re-initiated until the pairing connection is successful or finally fails. Thus, under the condition of minimizing the impact on the data transmission quality of the existing Bluetooth connection, the possibility of successful pairing connection between the first electronic device and the third electronic device is improved.

[0186] For the sake of easy understanding, the following takes the example that the first electronic device has established a Bluetooth connection with one second electronic device to illustrate the specific implementation of the pairing connection between the first electronic device and the third electronic device.

[0187] Step 901: The first electronic device and the second electronic device are paired and connected, and data is normally transmitted on the established Bluetooth connection.

[0188] Step 902: The pairing connection between the first electronic device and the third electronic device fails, and a request to reduce the quality of the existing Bluetooth connection and re-attempt to connect to the third electronic device is received.

[0189] Step 903: Does the first electronic device determine whether the reconnection to the third electronic device is successful? If not, execute step 904; if so, execute step 911.

[0190] Step 904: The first electronic device queries the encoding format used for the existing Bluetooth connection between the first electronic device and the second electronic device.

[0191] For the sake of easy explanation, hereinafter, the encoding format used for the existing Bluetooth connection between the first electronic device and the second electronic device is simply referred to as the encoding format of the existing Bluetooth connection.

[0192] Step 905: The first electronic device determines whether this encoding format is the LDAC encoding format. If so, execute step 906; otherwise, execute step 908.

[0193] Step 906: The first electronic device determines whether there is a transport code rate that can be reduced for this coding format. If so, it executes Step 907; if not, it executes Step 908.

[0194] Step 907: The first electronic device reduces the transport code rate of the coding format of the existing Bluetooth connection, returns to Step 903, and attempts to reconnect to the third electronic device.

[0195] Step 908: The first electronic device determines whether there is a coding format that can be reduced for the coding format of the existing Bluetooth connection. If so, it executes Step 909; otherwise, it executes Step 910.

[0196] Step 909: The first electronic device reduces the coding format of the existing Bluetooth connection, returns to Step 903, and attempts to reconnect to the third electronic device.

[0197] Step 910: The first electronic device determines that the final pairing and connection result with the third electronic device is a pairing and connection failure, and displays the third prompt interface.

[0198] Step 911: The first electronic device determines that the final pairing and connection result with the third electronic device is a pairing and connection success, and displays the second prompt interface.

[0199] Step 912: The first electronic device determines whether to restore the coding format of the existing Bluetooth connection to the original coding format. If so, it executes Step 913; otherwise, it ends the processing flow.

[0200] It is understandable that ending the processing flow in this step means that the first electronic device keeps the current coding format of the existing Bluetooth connection unchanged.

[0201] Step 913: The first electronic device restores the coding format of the existing Bluetooth connection to the original coding format.

[0202] Based on the above processing flow, assuming that the coding formats supported by the first electronic device and the second electronic device and their quality rankings are as follows: LDAC at 990 kbps, LDAC at 660 kbps, LDAC at 330 kbps, AptX, AAC, SBC, and the coding format used for the connection between the first electronic device and the second electronic device is LDAC at 990 kbps, then the interaction process among the first electronic device, the second electronic device, and the third electronic device is as follows Figure 10 shown.

[0203] Among them, when the connection between the first electronic device and the second electronic device uses the LDAC encoding format of 990 kbps, if the pairing connection between the first electronic device and the third electronic device fails, and a request to reduce the quality of the existing Bluetooth connection and attempt to reconnect to the third electronic device is received, the LDAC encoding format used between the first electronic device and the second electronic device can be reduced from the transmission rate of 990 kbps to 660 bps, and then attempt to pair-connect to the third electronic device. If the pairing connection is successful, the process terminates; otherwise,

[0204] reduce the LDAC encoding format used between the first electronic device and the second electronic device from the transmission rate of 990 kbps to 660 bps, and then attempt to pair-connect to the third electronic device. If the pairing connection is successful, the process terminates; otherwise,

[0205] reduce the LDAC encoding format used between the first electronic device and the second electronic device from the transmission rate of 660 kbps to 330 bps, and then attempt to pair-connect to the third electronic device. If the pairing connection is successful, the process terminates; otherwise,

[0206] reduce the LDAC encoding format used between the first electronic device and the second electronic device to the aptX HD encoding format, and then attempt to pair-connect to the third electronic device, and so on, until the pairing connection is successful and the process terminates, or reduce the encoding format used between the first electronic device and the second electronic device to the encoding format with the lowest quality, still the pairing connection fails and the process terminates.

[0207] In some embodiments, a certain existing Bluetooth connection of the first electronic device may be affected by other existing Bluetooth connections or other non-Bluetooth connections, resulting in poor signal transmission, thereby affecting data transmission on the Bluetooth connection, and further affecting the functional services on the first electronic device and / or the second electronic device, and affecting the user experience. The above functional services are the functions and / or services provided for the user on the first electronic device and / or the second electronic device. For example, playing music with a Bluetooth headset, playing music on a mobile phone, playing videos on a mobile phone, etc. can all be considered as functions and / or services provided for the user.

[0208] Examples of the impact of other non - Bluetooth connections on existing Bluetooth connections are as follows: Take the case where a mobile phone (the first electronic device) has already been connected to a Bluetooth headset (the second electronic device) via Bluetooth, and the mobile phone has also been connected to a Wi - Fi hotspot such as a router. In this scenario, if the mobile phone plays online music through the Bluetooth headset, the Bluetooth connection between the mobile phone and the Bluetooth headset uses a high - quality encoding format such as the LDAC encoding format for audio data transmission. At this time, if the mobile phone moves away from the router until the Wi - Fi connection between the mobile phone and the router is disconnected, the audio data played by the headset may become stuck. After analysis, the reason is that in this co - existence scenario, in order to maintain the connection with the router, the mobile phone has been maintaining a very high transmission power, even reaching the maximum transmission power, which results in less available bandwidth resources for the Bluetooth connection between the mobile phone and the Bluetooth headset. The audio data transmission cannot find a suitable channel, so the mobile phone cannot transmit audio data to the Bluetooth headset in a timely manner, resulting in the music played by the Bluetooth headset becoming stuck. At this time, the device connection method provided by the embodiments of the present application can be used. The mobile phone continues to transmit audio data to the Bluetooth headset by reducing the encoding format of the existing Bluetooth connection (the connection between the mobile phone and the Bluetooth headset), and then checks the status of the music played by the Bluetooth headset, thereby alleviating or solving the problem of the music played by the Bluetooth headset becoming stuck.

[0209] Examples of the impact of other existing Bluetooth connections on existing Bluetooth connections are as follows: Take the case where a mobile phone (the first electronic device) has already been connected to a Bluetooth headset (the second electronic device) via Bluetooth, plays online music using the Bluetooth headset, and has also been connected to another Bluetooth device such as a smartwatch via Bluetooth. If a large amount of data is transmitted between the mobile phone and the smartwatch, it may occupy the Bluetooth resources available for the Bluetooth connection between the mobile phone and the Bluetooth headset, thereby affecting the audio data transmission speed between the mobile phone and the Bluetooth headset, and the music played by the Bluetooth headset becomes stuck. At this time, the device connection method provided by the embodiments of the present application can be used. The mobile phone continues to transmit audio data to the Bluetooth headset by reducing the encoding format of the existing Bluetooth connection (the connection between the mobile phone and the Bluetooth headset), and then checks the status of the music played by the Bluetooth headset, thereby alleviating or solving the problem of the music played by the Bluetooth headset becoming stuck.

[0210] As Figure 11 shown, when the mobile phone detects that the music playback on the Bluetooth headset becomes stuck, it can provide a prompt interface as shown in Figure 11 to prompt the user whether to reduce the music playback quality to solve the stuck problem. The prompt interface may include a "Yes" control and a "No" control. When the user selects the "Yes" control, the mobile phone can continue to transmit audio data by reducing the quality (such as the encoding format) of the existing Bluetooth connection to alleviate or solve the stuck problem. When the user selects the "No" control, the mobile phone can keep the encoding format of the existing Bluetooth connection unchanged and continue to transmit audio data.

[0211] It is understandable that the coexistence of the above-mentioned Wi-Fi connection and Bluetooth connection, and the increase in the communication bandwidth occupied by the Wi-Fi connection resulting in a decrease in the available bandwidth for the Bluetooth connection between the mobile phone and the Bluetooth headset is only an example. The reason for the decrease in the available bandwidth for the Bluetooth connection between the mobile phone and the Bluetooth headset is not limited to the Wi-Fi connection, and it can also be the Bluetooth connection in the above example, or other communication connections.

[0212] Figure 12 Another flowchart of the device connection method provided by the embodiment of the present application is shown as Figure 12 shown, and the method may include:

[0213] Step 1201: The first electronic device establishes a first Bluetooth connection with the second electronic device. The first electronic device transmits audio data to the second electronic device using a first coding format through the first Bluetooth connection, and the second electronic device plays music according to the audio data.

[0214] Among them, the second electronic device is a device that can play audio data, such as a Bluetooth headset, a Bluetooth speaker, etc.

[0215] It is understandable that the above-mentioned audio data can also be extended to other data with multiple coding formats, and the above-mentioned playing music can also be extended to other functional services provided by the second electronic device. In other words, as long as the data required for the functional services provided by the second electronic device has multiple coding formats when transmitted between the first electronic device and the second electronic device via Bluetooth, and different coding formats can correspond to different service qualities of the functional services.

[0216] Combined with Figure 13 , in this step, the Bluetooth driver in the first electronic device can establish a Bluetooth connection with the second electronic device. When an application in the first electronic device ( Figure 13 not shown in the figure), such as a music application or a video application, etc., needs to use the second electronic device to play music, the audio data is sent to the Bluetooth driver, and the Bluetooth driver transmits it to the second electronic device using the first coding format through the first Bluetooth connection.

[0217] Step 1202: The first electronic device detects that the music played by the second electronic device according to the audio data has a stutter.

[0218] In some embodiments, the first electronic device can detect the packet loss rate of audio data transmission on the first Bluetooth connection. When the packet loss rate exceeds a preset threshold, it can be determined that the second electronic device is detected to have a stutter when playing music, otherwise it is determined that the second electronic device does not have a stutter when playing music.

[0219] It can be understood that when playing music based on audio data is extended to other functional services, the first electronic device can detect that the functional service provided by the second electronic device is stuck. Specifically, it can also be achieved by detecting whether the packet loss rate of the data transmitted over the first Bluetooth connection exceeds a preset threshold.

[0220] Combined with Figure 13 , in this step, specifically, the Bluetooth driver in the first electronic device can detect whether the music played by the second electronic device is stuck based on the packet loss rate of the audio data transmitted over the first Bluetooth connection.

[0221] Step 1203: The first electronic device determines whether there is a coding format that can be reduced for the first Bluetooth connection. If so, execute Step 1204.

[0222] Among them, for the first electronic device to determine whether there is a coding format that can be reduced for the first Bluetooth connection, it can specifically determine whether the coding format currently used by the first Bluetooth connection is the coding format with the lowest bandwidth occupancy among the coding formats supported by both the first electronic device and the second electronic device. If the judgment result is yes, then there is no coding format that can be reduced for the first Bluetooth connection. If the judgment result is no, then there is a coding format that can be reduced for the first Bluetooth connection.

[0223] Optionally, the coding format with the lowest bandwidth occupancy can be the coding format with the last (lowest) sorting position in the preset quality sorting among the coding formats supported by both the first electronic device and the second electronic device; or, the coding format with the lowest bandwidth occupancy can also be a preset coding format. The above preset can be the default specified in the first electronic device or set by the user, etc. Taking the quality sorting of the above coding formats LDAC, AptX, AAC, SBC as an example, if there is no preset coding format with the lowest bandwidth occupancy in the first electronic device, then the coding format with the lowest bandwidth occupancy can be the coding format SBC with the lowest sorting position. If the coding format currently used by the first Bluetooth connection is AAC, then in this step, it can be determined that there is a coding format that can be reduced for the first Bluetooth connection. If the preset coding format with the lowest bandwidth occupancy in the first electronic device is AAC, then in this step, the coding format with the lowest bandwidth occupancy is AAC. If the coding format currently used by the first Bluetooth connection is AAC, then in this step, it can be determined that there is no coding format that can be reduced for the first Bluetooth connection.

[0224] Among them, if the first electronic device determines that there is no coding format that can be reduced for the first Bluetooth connection, it can maintain the state of transmitting audio data to the second electronic device using the first coding format through the first Bluetooth connection, which will not be elaborated here.

[0225] The first electronic device determines whether there is an encoding format that can be reduced for the first Bluetooth connection. The implementation can refer to the corresponding description in step 605 and will not be elaborated here.

[0226] Combined with Figure 13 , this step can specifically be executed by the Bluetooth driver in the first electronic device.

[0227] Step 1204: The first electronic device displays a fourth prompt interface, which includes a sixth control for triggering the first electronic device to reduce the encoding format of the first Bluetooth connection.

[0228] The fourth prompt interface can be, for example, Figure 11 the shown prompt interface, and the sixth control can be a "Yes" control.

[0229] Combined with Figure 13 , when the Bluetooth driver in the first electronic device determines that there is an encoding format that can be reduced for the first Bluetooth connection, it can send a notification message to the system service in the first electronic device to indicate to the system service that the music playback of the second electronic device has lags and there is an encoding format that can be reduced; correspondingly, when the system service receives this notification message, it can display, for example, Figure 11 the shown fourth prompt interface.

[0230] It can be understood that the above system service can be a service provided by the operating system of the first electronic device for information prompting through an interface. Exemplarily, the system service can be located in the framework layer or the application layer of the operating system. Or, in other embodiments, the Bluetooth driver can also send the above notification message to an application that uses the first Bluetooth connection for audio data transmission (such as a music application or a video application, etc.), and this application can display the above fourth prompt interface.

[0231] Step 1205: The first electronic device detects the selection operation of the sixth control and reduces the encoding format of the first Bluetooth connection until the music lag is resolved or the encoding format of the first Bluetooth connection is reduced to the encoding format with the lowest bandwidth occupancy.

[0232] Combined with Figure 13 , in this step, the system service in the first electronic device that displays the fourth prompt interface can detect the selection operation of the sixth control and send a feedback message to the Bluetooth driver. The above feedback message is used to indicate to the Bluetooth driver to reduce the encoding format. The Bluetooth driver responds to this feedback message and can reduce the encoding format of the first Bluetooth connection until the music lag is resolved or the encoding format of the first Bluetooth connection is reduced to the encoding format with the lowest bandwidth occupancy.

[0233] When reducing the encoding format of the first Bluetooth connection, the encoding format of the first Bluetooth connection can be directly reduced from the current encoding format to the encoding format with the lowest bandwidth occupancy, or the encoding format of the first Bluetooth connection can be gradually reduced according to certain preset rules until the encoding format with the lowest bandwidth occupancy. In some embodiments, when gradually reducing the encoding format of the first Bluetooth connection, the encoding formats can be sorted by quality, and the encoding format of the first Bluetooth connection can be gradually reduced in preset steps until it is reduced to the encoding format with the lowest bandwidth occupancy. The specific value of the above preset steps is not limited in the embodiments of the present application.

[0234] In some embodiments, if the encoding format of the first Bluetooth connection is gradually reduced, step 1205 may specifically include:

[0235] Step S1: The first electronic device switches the encoding format used by the first Bluetooth connection from the first encoding format to the second encoding format, and the first electronic device transmits audio data to the second electronic device using the second encoding format through the first Bluetooth connection.

[0236] The quality sorting of different encoding formats can be pre-set in the first electronic device. Among them, the quality sorting of the second encoding format is after the first encoding format. In other words, the quality of the second encoding format is lower than that of the first encoding format, or the bandwidth occupied by the second encoding format is lower than that of the first encoding format.

[0237] Step S2: The first electronic device determines whether the music played by the second electronic device is stuck. If so, step S3 is executed. If not, this branch process ends.

[0238] The implementation of this step can refer to step 1202 and will not be elaborated here.

[0239] Among them, when the judgment result in this step is negative, it means that the music played by the second electronic device is not stuck, so the current encoding format used by the first Bluetooth connection can be maintained for audio data transmission.

[0240] Step S3: The first electronic device determines whether there is an encoding format that can be reduced for the first Bluetooth connection. If so, step S4 is executed. If not, this branch process ends.

[0241] Step S4: The first electronic device switches the encoding format used by the first Bluetooth connection from the second encoding format to the third encoding format, and the first electronic device transmits audio data to the second electronic device using the third encoding format through the first Bluetooth connection.

[0242] After that, the first electronic device can continue to execute steps S2 and S3, and when the result in step S3 is yes, execute step S4 to further reduce the encoding format used for the first Bluetooth connection, and so on until the music does not stutter or the encoding format used for the first Bluetooth connection is reduced to the encoding format with the lowest bandwidth occupancy.

[0243] Based on the above processing flow, assuming that the encoding formats supported by the first electronic device and the second electronic device and their quality rankings are as follows: LDAC at 990 kbps, LDAC at 660 kbps, LDAC at 330 kbps, AptX, AAC, SBC, and the encoding format with the lowest bandwidth occupancy is not preset in the first electronic device, and the encoding format used for the connection between the first electronic device and the second electronic device is LDAC at 990 kbps. If the encoding format is gradually reduced step by step with a step size of 1, then the interaction process between the first electronic device and the second electronic device is as follows Figure 14 shown.

[0244] Among them, when the Bluetooth connection between the first electronic device and the second electronic device uses the LDAC encoding format at 990 kbps, if the music played by the second electronic device stutters, the LDAC encoding format used between the first electronic device and the second electronic device can be reduced from the transmission rate of 990 kbps to 660 bps, and then it is judged whether the music played by the second electronic device stutters. If it does not stutter, the process terminates; otherwise,

[0245] the LDAC encoding format used between the first electronic device and the second electronic device is reduced from the transmission rate of 660 kbps to 330 bps, and then it is judged whether the music played by the second electronic device stutters. If it does not stutter, the process terminates; otherwise,

[0246] the LDAC encoding format used between the first electronic device and the second electronic device is reduced to the AptX HD encoding format, and then it is judged whether the music played by the second electronic device stutters, and so on until the music played by the second electronic device does not stutter and the process terminates, or the encoding format used between the first electronic device and the second electronic device is reduced to the encoding format with the lowest bandwidth occupancy, that is, the SBC with the lowest quality in the above quality ranking, and the music played by the second electronic device still stutters and the process terminates.

[0247] When the functions such as music playback have lags, this method switches the encoding format used on the first Bluetooth connection of the first electronic device from the encoding format with relatively high bandwidth occupancy to the encoding format with relatively low bandwidth occupancy, so that the amount of data to be transmitted on the first Bluetooth connection becomes lower. When the Bluetooth resources occupied by the first Bluetooth connection become lower, the possibility of lags in the second electronic device when performing functions such as music playback is reduced. In this method, the first electronic device gradually reduces the encoding format used on the first Bluetooth connection, that is, gradually switches the encoding format used on the first Bluetooth connection to the encoding format with relatively lower bandwidth occupancy, so as to gradually reduce the amount of data to be transmitted on the first Bluetooth connection. Each time it is reduced, it re-detects whether the second electronic device has lags when performing the first function service, so as to reduce the possibility of lags in the second electronic device when performing the function service under the condition of minimizing the impact on the data transmission quality on the first Bluetooth connection.

[0248] An embodiment of this application also provides an electronic device, including a processor and a memory. The processor is used to implement the method provided by the embodiment of this application.

[0249] An embodiment of this application also provides a system, including the above-mentioned first electronic device, second electronic device, and third electronic device.

[0250] An embodiment of this application also provides a system, including the above-mentioned first electronic device and second electronic device.

[0251] An embodiment of this application also provides a computer-readable storage medium. A computer program is stored in the computer-readable storage medium. When it runs on a computer, it enables the computer to execute the method provided by the embodiment of this application.

[0252] An embodiment of this application also provides a computer program product. The computer program product includes a computer program. When it runs on a computer, it enables the computer to execute the method provided by the embodiment of this application.

[0253] In the embodiments of this application, "at least one" means one or more, and "a plurality" means two or more. "And / or" describes the association relationship of associated objects and indicates that three relationships can exist. For example, A and / or B can represent the situation where A exists alone, A and B exist simultaneously, and B exists alone. Among them, A and B can be singular or plural. The character " / " generally represents an "or" relationship between the associated objects before and after. "At least one of the following" and its similar expressions refer to any combination of these items, including any combination of single items or plural items. For example, at least one of a, b, and c can represent: a, b, c, a and b, a and c, b and c, or a and b and c, where a, b, and c can be single or multiple.

[0254] Those of ordinary skill in the art will realize that the various units and algorithm steps described in the embodiments disclosed herein can be implemented by electronic hardware, computer software, or a combination of electronic hardware. Whether these functions are executed in hardware or software depends on the specific application and design constraints of the technical solution. A professional technician can use different methods for each specific application to implement the described functions, but such implementation should not be considered to exceed the scope of this application.

[0255] Those skilled in the art can clearly understand that for the convenience and conciseness of description, the specific working processes of the systems, devices, and units described above can refer to the corresponding processes in the foregoing method embodiments and will not be elaborated herein.

[0256] In several embodiments provided in this application, if any function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a part of this technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The foregoing storage medium includes: various media such as USB flash drives, mobile hard disks, read-only memories (hereinafter referred to as ROMs), random access memories (hereinafter referred to as RAMs), magnetic disks, or optical discs that can store program codes.

[0257] The above is only the specific implementation manner of this application. Any changes or substitutions that can be easily thought of by those skilled in the art within the technical scope disclosed in this application should be covered by the protection scope of this application. The protection scope of this application shall be subject to the protection scope of the claimed rights.

Claims

1. A device connection method, characterized in that, Applied to a first electronic device, the method includes: The first electronic device establishes a first Bluetooth connection with a second electronic device, and the first electronic device transmits data on the first Bluetooth connection using a first encoding format; The first electronic device keeps transmitting data on the first Bluetooth connection using the first encoding format unchanged and initiates a Bluetooth-based pairing connection with a third electronic device; When the pairing connection between the first electronic device and the third electronic device fails, the first electronic device switches the encoding format used on the first Bluetooth connection from the first encoding format to a second encoding format and re-initiates the pairing connection with the third electronic device, where the bandwidth occupied by the second encoding format is lower than the bandwidth occupied by the first encoding format; When the re-initiated pairing connection with the third electronic device fails, the first electronic device determines that there is an encoding format among the encoding formats supported by both the first electronic device and the second electronic device that occupies less bandwidth than the second encoding format, switches the encoding format used on the first Bluetooth connection from the second encoding format to a third encoding format, and re-initiates the pairing connection with the third electronic device again, where the bandwidth occupied by the third encoding format is lower than the bandwidth occupied by the second encoding format; And so on, until the re-initiated pairing connection with the third electronic device is successful, or the first electronic device switches the encoding format used on the first Bluetooth connection to the encoding format with the lowest occupied bandwidth and the re-initiated pairing connection with the third electronic device fails, where the encoding format with the lowest occupied bandwidth is the encoding format with the lowest occupied bandwidth among the encoding formats supported by both the first electronic device and the second electronic device.

2. The method according to claim 1, wherein Before the first electronic device switches the encoding format used on the first Bluetooth connection from the first encoding format to the second encoding format, the method further includes: When the pairing connection between the first electronic device and the third electronic device fails, determining that there is an encoding format among the encoding formats supported by both the first electronic device and the second electronic device that occupies less bandwidth than the first encoding format, and displaying a first interface, where the first interface includes a first control; the first control is used to trigger the first electronic device to lower the encoding format used on the first Bluetooth connection and re-initiate the pairing connection with the third electronic device; Receiving a selection operation for the first control.

3. The method according to claim 1 or 2, characterized in that, The first encoding format and the second encoding format are different encoding formats; or, the first encoding format and the second encoding format are the same encoding format with different transmission bitrates.

4. The method according to claim 1 or 2, characterized in that, The method further includes: When the first electronic device switches the encoding format used on the first Bluetooth connection to the encoding format with the lowest occupied bandwidth and the re-initiated pairing connection with the third electronic device fails, displaying a second interface, where the second interface includes: a second control, and the second control is used to trigger the first electronic device to restore the encoding format used on the first Bluetooth connection to the first encoding format; Upon receiving a selection operation for the second control, switch the encoding format used on the first Bluetooth connection to the first encoding format.

5. The method according to claim 1 or 2, characterized in that, It further includes: When the re-initiated pairing connection with the third electronic device is successful, display a third interface, where the third interface includes a third control, and the third control is used to trigger the first electronic device to restore the encoding format used on the first Bluetooth connection to the first encoding format; Upon receiving a selection operation for the third control, switch the encoding format used on the first Bluetooth connection to the first encoding format.

6. The method according to claim 1, characterized in that Before the first electronic device initiates a pairing connection with the third electronic device, the method further includes: The first electronic device establishes a second Bluetooth connection with the fourth electronic device, and the first electronic device uses a fourth encoding format to transmit data on the second Bluetooth connection; Before the re-initiated pairing connection with the third electronic device, the method further includes: When the pairing connection between the first electronic device and the third electronic device fails, the first electronic device switches the encoding format used on the second Bluetooth connection from the fourth encoding format to a fifth encoding format, and the bandwidth occupied by the fifth encoding format is lower than the bandwidth occupied by the fourth encoding format.

7. The method according to claim 1, wherein Before the first electronic device initiates a pairing connection with the third electronic device, the method further includes: The first electronic device establishes a second Bluetooth connection with the fourth electronic device, and the first electronic device uses a fourth encoding format to transmit data on the second Bluetooth connection; The method further includes: The first electronic device switches the encoding format used on the first Bluetooth connection to the encoding format with the lowest occupied bandwidth. When the re-initiated pairing connection with the third electronic device fails, the first electronic device switches the encoding format used on the second Bluetooth connection from the fourth encoding format to a fifth encoding format, and re-initiate a pairing connection with the third electronic device; the bandwidth occupied by the fifth encoding format is lower than the bandwidth occupied by the fourth encoding format.

8. A first electronic device, characterized in that, It includes: A processor, a memory; One or more computer programs are stored in the memory, and the one or more computer programs include instructions that, when executed by the processor, cause the first electronic device to perform the method according to any one of claims 1 to 7.

9. A computer-readable storage medium, characterized in that, A computer program is stored in the computer-readable storage medium, and when it runs on a computer, it causes the computer to perform the method according to any one of claims 1 to 7.

10. A computer program product, characterized in that, This computer program product includes a computer program that, when it runs on a computer, causes the computer to perform the method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Coding control method and device, electronic equipment and storage medium

    CN109003618A

  • Data transmission method, terminal device, storage medium and chip system

    CN116055462A

  • Adaptive bit rates for wi-fi and bluetooth coexistence

    US20200044769A1