Equipment connection method and electronic equipment

By reducing the bandwidth of existing Bluetooth connections, the problem that electronic devices cannot connect to new devices through Bluetooth is solved, the connection success rate is improved, and the original quality is restored when necessary, and the connection failure problem in the existing technology is solved.

CN118984450AActive Publication Date: 2024-11-19HONOR DEVICE CO LTD
View PDF 7 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

After an electronic device has connected to another device through Bluetooth, the problem of failure to connect to a new device may occur when trying to connect to a new device. This is mainly because the existing Bluetooth connection occupies too much bandwidth, causing the new device to fail to receive the page packet.

Method used

By reducing the bandwidth of existing Bluetooth connections, such as switching encoding formats, switching from high-bandwidth formats to low-bandwidth formats, freeing up more Bluetooth bandwidth to increase the probability of connection success for new devices, and providing a user interface to automatically select lower connections quality.

Benefits of technology

It increases the probability of successful connection between electronic devices and new devices through Bluetooth, enhances the user experience, and restores the original connection quality when necessary to ensure the quality of data transmission.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118984450A_ABST
    Figure CN118984450A_ABST
Patent Text Reader

Abstract

The embodiment of the invention 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 one electronic device has established a Bluetooth connection with at least one other electronic device. The device connection method comprises the following steps: a first electronic device establishes a first Bluetooth connection with a second electronic device, wherein the first Bluetooth connection uses a first coding format to transmit data; the first electronic equipment initiates pairing connection with third electronic equipment; when the pairing connection between the first electronic device and the third electronic device fails, the first electronic device switches the encoding format used by the first Bluetooth connection from the first encoding format to the second encoding format, the pairing connection with the third electronic device is initiated again, and the bandwidth occupied by the second encoding format is lower than that occupied by the first encoding format.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of device connection, and in particular to a device connection method and electronic equipment. 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 electronic devices via Bluetooth. For example, a mobile phone is connected to surrounding headphones, speakers, keyboards, styluses, etc. via Bluetooth.

[0003] However, if an electronic device (such as a mobile phone) has been connected to one or more electronic devices via Bluetooth, if a user wishes to connect the electronic device to a new electronic device via Bluetooth, the connection may fail. Summary of the invention

[0004] The embodiments of the present application provide a device connection method and an electronic device, which can improve the probability of a 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.

[0005] In the first aspect, the embodiment of the present application provides a device connection method, which is applied to a first electronic device, and 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 on the first Bluetooth connection; 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 the 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. Among them, 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 pairing connection based on Bluetooth, in other words, a pairing connection based on the Bluetooth communication protocol. The method switches the coding format used on the first Bluetooth connection of the first electronic device from the first coding format with a relatively high occupied bandwidth to the second coding format with a relatively low occupied bandwidth, 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 connection between the first electronic device and the new third electronic device via Bluetooth.

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

[0007] In a possible implementation, the method further includes: when the re-initiated pairing connection with the third electronic device fails, the first electronic device switches the coding format used on the first Bluetooth connection from the second coding format to the third coding format, and re-initiates the pairing connection with the third electronic device again, and the bandwidth occupied by the third coding format is lower than the bandwidth occupied by the second coding format; and so on, until the re-initiated pairing connection with the third electronic device is successful, or the first electronic device switches the coding format used on the first Bluetooth connection to the coding format with the lowest bandwidth, and the re-initiated pairing connection with the third electronic device fails, and the coding format with the lowest bandwidth is the coding format with the lowest 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 a relatively lower bandwidth, thereby gradually reducing the Bluetooth resources occupied by the first Bluetooth connection, and re-initiates the pairing connection with the third electronic device each time it is reduced, until the pairing connection is successful or the pairing connection fails, thereby increasing 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 that occupies a lower bandwidth than the first encoding format among the encoding formats supported by both the first electronic device and the second electronic device, and displaying a first interface, wherein the first interface includes a first control; the first control is used to trigger the first electronic device to reduce 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. The method provides an interface implementation for the user, so that the user can make an independent choice on whether to reduce the quality of the first Bluetooth connection, thereby improving the user's participation and usage experience. Moreover, before displaying the first interface, determining that there is an encoding format that occupies a lower bandwidth than the first encoding format among the encoding formats supported by both the first electronic device and the second electronic device, ensures the rationality of the display of the first interface, and prevents the problem that the user chooses to reduce the quality of the first Bluetooth connection, but the first Bluetooth connection cannot switch the encoding format. The above-mentioned first interface can be, for example, the first prompt interface in the subsequent embodiments, such as shown in interface 60 or interface 60a.

[0009] In a possible implementation, before the first electronic device switches the encoding format used for 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 that occupies a lower bandwidth than the second encoding format among the encoding formats supported by both the first electronic device and the second electronic device. The method ensures the rationality and reliability of the processing by the first electronic device to switch the encoding format used for the first Bluetooth connection from the second encoding format to the third encoding format.

[0010] In a possible implementation manner, 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 code rates.

[0011] In a possible implementation, the method further includes: the first electronic device switches the encoding format used on the first Bluetooth connection to the encoding format that occupies the lowest bandwidth, and when the re-initiated pairing connection with the third electronic device fails, switches 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, thereby improving the user experience.

[0012] In a possible implementation, the method further includes: the first electronic device switches the encoding format used on the first Bluetooth connection to the encoding format that occupies the lowest bandwidth, and when the re-initiated pairing connection with the third electronic device fails, displays a second interface, the second interface including: a second control, 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, 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, the method provides the user with the choice of whether to restore the encoding format of the first Bluetooth connection to the first encoding format, thereby improving the user's participation and usage experience. The above-mentioned second interface can, for example, be the third prompt interface in the subsequent embodiments, such as shown in interface 80 or interface 70a.

[0013] In a possible implementation, the method further includes: when the first electronic device successfully re-initiates the pairing connection with the third electronic device, 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 is successful, thereby improving the user experience.

[0014] In a possible implementation, it also 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; upon receiving a selection operation for the third control, the encoding format used on the first Bluetooth connection is switched to the first encoding format. When the first electronic device is successfully paired with the third electronic device, 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, thereby improving the user's participation and usage experience. The above-mentioned third interface can, for example, be the second prompt interface in the subsequent embodiments, such as shown in interface 70 or interface 70a.

[0015] In a possible implementation, before the first electronic device initiates a pairing connection with a 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 re-initiating the pairing connection with the third electronic device, the method also 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.

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

[0018] In a possible implementation, before the first electronic device initiates a pairing connection with a 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;

[0019] The method also includes: the first electronic device switches the encoding format used on the first Bluetooth connection to the encoding format occupying the lowest bandwidth, and 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 the fifth encoding format, and re-initiates the 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.

[0020] When the first electronic device already has at least two Bluetooth connections and fails to pair with a third electronic device, the method reduces the Bluetooth resources occupied by the existing Bluetooth connections and increases the probability of pairing the first electronic device with the third electronic device by successively reducing the quality of the two existing Bluetooth connections.

[0021] In a second aspect, an embodiment of the present application provides a device connection method, which is applied to a first electronic device, and 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, so that the second electronic device performs a first functional service based on the data; when it is detected that the second electronic device encounters a freeze in executing the first functional 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 first functional service may specifically be playing music, and the data may specifically be audio data for playing music. Detecting that the second electronic device is stuck when executing the first functional service may be achieved by the first electronic device detecting whether a packet loss rate of data transmitted on the first Bluetooth connection exceeds a preset threshold.

[0023] When a first functional service is stuck, the method switches the coding format used on the first Bluetooth connection of the first electronic device from a first coding format that occupies a relatively high bandwidth to a second coding format that occupies a relatively low bandwidth, thereby reducing the amount of data required to be transmitted on the first Bluetooth connection. This reduces the possibility of a stuck condition when the first Bluetooth connection occupies less Bluetooth resources when executing the first functional service, thereby reducing the possibility of a stuck condition when the second electronic device occupies less Bluetooth resources.

[0024] In one possible implementation, 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 encounters a freeze in executing the first function 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 executes the first function service without freeze, or the first electronic device switches the encoding format used on the first Bluetooth connection to the encoding format occupying the lowest bandwidth, and the second electronic device still encounters a freeze in executing the first function service, and the encoding format occupying the lowest bandwidth is the encoding format that occupies the lowest bandwidth among the encoding formats supported by both the first electronic device and the second electronic device. In the 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 that occupies relatively lower bandwidth, thereby gradually reducing the amount of data required to be transmitted by the first Bluetooth connection, and re-detects whether the second electronic device is stuck in executing the first functional service each time the data is reduced, thereby reducing the possibility of the second electronic device being stuck in executing the first functional service while minimizing the impact on the quality of data transmission on 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 that occupies a lower bandwidth than the second encoding format among the encoding formats supported by both the first electronic device and the second electronic device. The method ensures the rationality and reliability of the processing by the first electronic device to switch the encoding format used for the first Bluetooth connection from the second encoding format to the third encoding format.

[0026] In a possible implementation manner, 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 code rates.

[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 is stuck in executing the first functional service, determining that there is an encoding format that occupies a lower bandwidth than the first encoding format among the encoding formats supported by both the first electronic device and the second electronic device, and displaying a fourth interface, wherein the fourth interface includes a fourth control; the fourth control is used to trigger the first electronic device to reduce the encoding format used on the first Bluetooth connection; and receiving a selection operation for the fourth control. The method provides an interface implementation for the user, so that the user can make an independent choice of whether to reduce the quality of the first Bluetooth connection, thereby improving the user's participation and usage experience. Moreover, before displaying the fourth interface, determining that there is an encoding format that occupies a lower bandwidth than the first encoding format among the encoding formats supported by both the first electronic device and the second electronic device, ensures the rationality of the display of the fourth interface, and prevents the problem that the user chooses 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, comprising: a processor and a memory; wherein one or more computer programs are stored in the memory, and the one or more computer programs include instructions, and when the instructions are executed by the processor, the first electronic device executes the method described in 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, wherein the computer-readable storage medium stores a computer program, which, when executed on a computer, enables the computer to execute the method described in any one of the first aspect or the second aspect.

[0030] In a fifth aspect, an embodiment of the present application provides a computer program product, which includes a computer program, and when the computer program is run on a computer, it enables the computer to execute the method described in any one of the first aspect or the second aspect.

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

[0032] In a seventh aspect, an embodiment of the present application provides a system, comprising the first electronic device and the second electronic device of the second aspect. BRIEF 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 use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

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

[0035] Figure 2A A schematic diagram of the structure of an electronic device provided in an embodiment of the present application;

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

[0037] Figure 3 A schematic diagram of an interface implementation of the device connection method provided in an embodiment of the present application;

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

[0039] Figure 5 A schematic diagram of another interface implementation of the device connection method provided in an embodiment of the present application;

[0040] Figure 6 A schematic diagram of a flow chart of a device connection method provided in an embodiment of the present application;

[0041] Figure 7 Another schematic diagram of a flow chart of a device connection method provided in an embodiment of the present application;

[0042] Figure 8 A third flow chart of the device connection method provided in the embodiment of the present application;

[0043] Fig. 9A fourth flow chart of the device connection method provided in an embodiment of the present application;

[0044] Fig.10 A fifth flow chart of the device connection method provided in the embodiment of the present application;

[0045] Fig.11 A fourth interface schematic diagram of the device connection method provided in an embodiment of the present application;

[0046] Fig.12 A sixth flow chart of the device connection method provided in the embodiment of the present application;

[0047] Fig.13 A seventh flow chart of the device connection method provided in the embodiment of the present application;

[0048] Fig.14 The eighth flow chart of the device connection method provided in the embodiment of the present application. DETAILED DESCRIPTION

[0049] The terms used in the implementation section of this application are only used to explain the specific embodiments of this application and are not intended to limit this application.

[0050] Bluetooth technology is a short-range radio technology that can effectively simplify communication between electronic devices.

[0051] 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 electronic devices via Bluetooth. For example, a mobile phone connects to peripheral Bluetooth peripherals such as headphones, speakers, keyboards, and styluses via Bluetooth. However, if an electronic device (such as a mobile phone) has been connected to one or more electronic devices via Bluetooth, if the user wants the electronic device to connect to a new electronic device via Bluetooth, the connection may fail.

[0052] For example, when a mobile phone connects to a Bluetooth peripheral via Bluetooth, a user sometimes needs to connect the mobile phone to multiple Bluetooth peripherals such as a Bluetooth keyboard, a Bluetooth headset, etc. However, when the mobile phone is already connected to one or more Bluetooth peripherals including a Bluetooth headset, if the user wants to connect the mobile phone to a new Bluetooth peripheral such as a Bluetooth keyboard, the mobile phone may fail to successfully connect to the Bluetooth keyboard. Moreover, the mobile phone may try to connect to the Bluetooth keyboard multiple times under the user's triggering but still fail to successfully connect.

[0053] After analysis, it was found that the Bluetooth Advanced Audio Distribution Profile (A2DP) stipulates that the highest audio standard is 328kbps for single channel and 512kbps for dual channel. This results in that higher-format audio files cannot be directly transmitted over the Bluetooth connection and must be processed by audio codec. Figure 1 As shown, a possible processing flow of transmitting audio files from electronic devices such as mobile phones / tablets / computers to Bluetooth headsets, and playing music on Bluetooth headsets is shown. Among them, on the electronic device side, audio files in formats such as .mp3 and .flac are decoded, so that the compressed audio data is restored to an audio signal in pulse code modulation (PCM) format, and then the audio signal is sequentially PCM encoded and Bluetooth audio encoded, and the obtained audio data is transmitted to the Bluetooth headset side via Bluetooth; the Bluetooth headset side performs corresponding Bluetooth audio decoding and PCM decoding, and transmits the obtained audio data to the speaker via a digital-to-analog converter (DAC) and an amplifier (AMP), so as to play music.

[0054] When transmitting audio files over a Bluetooth connection, the audio codec protocols used may 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 which SBC is the most common Bluetooth transmission protocol, supported by 99% of Bluetooth headsets. Generally, the higher the ranking of the Bluetooth codec protocol, the higher the sound quality and the larger the Bluetooth bandwidth occupied. When a mobile phone is connected to a Bluetooth headset to play music, if a high-quality audio encoding protocol such as LHDC / LDAC is used to transmit audio data to the Bluetooth headset, due to the large amount of audio data transmitted, more Bluetooth time slots (Bluetooth bandwidth) are occupied, leaving fewer Bluetooth time slots for the mobile phone to paging the Bluetooth keyboard, and the paging packets sent are not dense. There is a high probability that 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 been connected to one or more other electronic devices via Bluetooth, the existing Bluetooth connection occupies too much Bluetooth bandwidth of the electronic device, which may also cause the electronic device to be unable to successfully connect to a new electronic device via Bluetooth.

[0056] In view of this, an embodiment of the present application provides a device connection method and an electronic device to reduce the problem that when an electronic device is 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, the present invention solves this problem 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 embodiment of the present application can be applied to electronic devices that support Bluetooth function, such as mobile phones, personal computers (PCs), tablet computers (PADs), wearable devices, smart screens, car-mounted devices, etc.

[0059] It is understandable that the Bluetooth connection in the embodiment of the present application can also be extended to other connections such as WiFi connection.

[0060] Figure 2A 1 shows a schematic diagram of the structure of an electronic device 100. 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, and the like.

[0061] It is to be understood that the structure illustrated in the embodiment 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 illustrated, or combine certain components, or separate certain components, or arrange the components differently. The illustrated components may be implemented in hardware, software, or a combination of software and hardware. For example, Figure 2AAs shown, 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, an earphone 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, an air 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 processor (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Different processing units may be independent devices or integrated into one or more processors.

[0063] The controller can generate operation control signals according to the instruction operation code and timing signal to complete the control of instruction fetching and execution.

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

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

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

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

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

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

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

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

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

[0073] The software system of the electronic device 100 may adopt a layered architecture, an event-driven architecture, a micro-kernel architecture, a micro-service architecture, or a cloud architecture. Taking the system as an example, the software structure of the electronic device 100 is exemplified.

[0074] Figure 2B The software structure block diagram of an electronic device provided in an embodiment of the present application is shown. The layered architecture divides the software into several layers, each layer has a clear role and division of labor. The layers communicate with each other through software interfaces. The embodiment of the present application takes the Android system as an example to illustrate the software structure of the first electronic device of the Android system. In some embodiments, the Android system is divided into five layers, which are, from top to bottom, 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 may include several applications (hereinafter referred to as applications), such as music applications, video applications, setting applications, etc.

[0076] The application framework layer provides application programming interfaces (APIs) and programming frameworks for 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 may include: window managers, resource managers, etc.

[0077] The system library and Android runtime layer include the system library and Android runtime. The system library can include multiple functional modules. For example: surface manager, two-dimensional graphics engine, three-dimensional graphics processing library (for example: OpenGLES), media library, font library, etc. Among them, the browser kernel is responsible for interpreting the syntax of the web page (such as an application HTML, JavaScript under the standard universal markup language) and rendering (displaying) the web page; the two-dimensional graphics engine is used to implement two-dimensional graphics drawing, image rendering, synthesis and layer processing, etc.; the three-dimensional graphics processing library is used to implement three-dimensional 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. The Android runtime is responsible for the scheduling and management of the Android system, specifically including the core library and the virtual machine. Among them, the core library contains two parts: one part is the function function that needs to be called by the Java language, and the other part is the core library of Android; the virtual machine is used to run Android applications developed using the Java language.

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

[0079] The kernel layer is the layer between hardware and software. The kernel layer may 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 embodiment 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 (first electronic device) connected to a Bluetooth headset (second electronic device) and a mobile phone connected to a Bluetooth keyboard (third electronic device) via Bluetooth, the possible interface implementations of the device connection method of the embodiment of the present application are exemplified.

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

[0083] When a user clicks a control corresponding to a setting option in the main setting interface, the setting application may display a setting interface corresponding to the setting option. For example, if a user clicks a control 11 of the "Bluetooth" option in interface 10, the setting application may display a Bluetooth setting interface, such as shown in interface 20. The Bluetooth setting interface includes a Bluetooth switch control 21, which is used to control the turning on or off of the Bluetooth function. When the Bluetooth function is turned on, as shown in interface 20, a list of available devices may be displayed in the Bluetooth setting interface.

[0084] The list of available devices displays a list of devices that the mobile phone has searched for via Bluetooth, including 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 Bluetooth settings interface can also display the current connection status between the device and the mobile phone. For example, in interface 20, the list displayed in the column of available devices includes Bluetooth headsets, Bluetooth keyboards, and speakers. Since the Bluetooth headset has been successfully paired and connected to the mobile phone via Bluetooth, the current connection status of the Bluetooth headset is also recorded in interface 20: connected.

[0085] In order to enable the user to instruct the mobile phone to pair with the settings in the available device list, a corresponding control can be set for the device in the available device list, so that the user can trigger the pairing connection between the mobile phone and the device. For example, in the Bluetooth setting interface shown in interface 20, corresponding controls 22 to 24 can be set for Bluetooth headsets, Bluetooth keyboards, and speakers, respectively, and the device information such as Bluetooth headsets, Bluetooth keyboards, and speakers is displayed on the corresponding controls.

[0086] If the user selects a control corresponding to a device in the list of available devices, the mobile phone can try 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 (third electronic device) in interface 20, the mobile phone can try to pair and connect with the Bluetooth keyboard via Bluetooth. If the mobile phone is successfully paired with the Bluetooth keyboard, a prompt interface for successful pairing and connection, such as that shown in interface 30, can be displayed. After the user clicks the OK control in interface 30, a Bluetooth setting interface, such as that shown in interface 40, can be displayed, in which the current connection status of the Bluetooth keyboard is updated to connected; if the mobile phone fails to pair with the Bluetooth keyboard, a prompt interface for failed connection, such as that shown in interface 50, can be displayed. After the user clicks the OK control in interface 50, the user can return to the Bluetooth setting interface, such as that shown in interface 20.

[0087] In the above interface implementation example, after the settings application returns to the Bluetooth settings interface such as that shown in interface 20, the user may click on the Bluetooth keyboard multiple times in order to allow the mobile phone to pair and connect to the Bluetooth keyboard, thereby instructing the mobile phone to retry pairing and connecting to the Bluetooth keyboard. However, when the amount of audio data transmitted between the mobile phone and the Bluetooth headset is large and occupies a lot of Bluetooth bandwidth and time slots, the mobile phone may not be able to connect to the Bluetooth keyboard. As a result, the settings application will display multiple connection failure prompt interfaces such as that shown in interface 50, and finally return to the Bluetooth settings interface such as that shown in interface 20.

[0088] In order to increase the success rate of a mobile phone connecting to a third electronic device, in another embodiment provided in the present application, when a user clicks on a 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 a connection failure prompt interface such as that shown in interface 50, the user is provided with the option of reducing the quality of the existing Bluetooth connection and trying 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, see Figure 4 As shown, if the user selects a Bluetooth keyboard in the Bluetooth setting interface such as shown in interface 20, the pairing connection between the mobile phone and the Bluetooth keyboard fails, and the prompt interface for the failed pairing connection is displayed, such as shown in interface 60. In addition to the confirmation control, the prompt interface also provides the user with a control 61. The information displayed on control 61 may be: reduce the quality of the existing Bluetooth connection and try to connect again.

[0090] If the user clicks on control 61, the mobile phone executes the device connection method of the embodiment of the present application, reduces the existing Bluetooth connection. For example, in this embodiment, to reduce the connection quality between the mobile phone and the Bluetooth headset, try to connect the Bluetooth keyboard again.

[0091] If the mobile phone successfully pairs and connects with the Bluetooth keyboard after reducing the quality of the existing Bluetooth connection, a prompt interface for successful pairing connection, such as that shown in interface 70, may be displayed. The prompt interface is provided with controls 71 and 72. 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 setting interface, such as that shown in 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 setting interface, such as that shown in interface 40.

[0092] If the mobile phone reduces the quality of the existing Bluetooth connection to the lowest quality, but the pairing connection between the mobile phone and the Bluetooth keyboard still fails, a prompt interface for pairing connection failure, such as that shown in interface 80, may be displayed. The prompt interface is provided with controls 81 and 82. 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 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 the Bluetooth setting interface, such as that shown in interface 20. When the user clicks 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 the Bluetooth setting interface, such as that shown in interface 20.

[0093] In other embodiments provided in the present application, the above interface 60 can be split into two prompt interfaces, which can be specifically referred to in Figure 5 In interface 30 and interface 60a, if the user selects a Bluetooth keyboard in the Bluetooth setting interface shown in interface 20, for example, the pairing connection between the mobile phone and the Bluetooth keyboard fails, and the prompt interface for the displayed pairing connection failure is shown in interface 30, for example, and the user clicks the confirmation control in interface 30, and a prompt interface for reducing the quality of the existing Bluetooth connection and reconnecting is displayed, for example, as shown in interface 60a. The prompt information displayed in the interface is: Do you want to reduce the quality of the existing Bluetooth connection and try to connect the Bluetooth keyboard again? The prompt interface is also provided with corresponding "Yes" and "No" controls. If the user clicks the "No" control, you can return to the Bluetooth setting interface shown in interface 20, for example. If the user clicks the "Yes" control, the mobile phone executes the device connection method of the embodiment of the present application, reduces the existing Bluetooth connection, for example, in this embodiment, to reduce the connection quality between the mobile phone and the Bluetooth headset, and tries to connect the Bluetooth keyboard again.

[0094] Based on similar interface implementation principles, such as Figure 5As shown, in other embodiments provided in the present application, the above interface 70 can also be split into two prompt interfaces for implementation, for details, see Figure 5 Interface 50 and interface 70a in. If the mobile phone executes the device connection method of the embodiment of the present application, and reduces the quality of the existing Bluetooth connection, for example, in this embodiment, in order to reduce the quality of the connection between the mobile phone and the Bluetooth headset, retry to connect the Bluetooth keyboard, and the pairing connection is successful, the setting application can first display the pairing connection success prompt interface shown in interface 50, and after the user clicks the confirmation control, it will display the prompt interface for restoring the existing Bluetooth connection quality, such as shown in interface 70a. The prompt information displayed in the interface is: Do you want to restore the connection with reduced quality to the original quality? The 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 existing Bluetooth connection with reduced quality, that is, the connection between the mobile phone and the Bluetooth headset to the original quality, and display the Bluetooth setting interface shown in interface 40, for example. 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 kept at the current quality (that is, the reduced quality), and the Bluetooth setting interface shown in interface 40, for example, is displayed.

[0095] It is understandable that the above-mentioned interface 80 can also be split into two prompt interfaces for implementation. For the specific interface implementation, reference can be made to the prompt interface shown in interface 50 and the prompt interface shown in interface 70a, which will not be described in detail in the embodiment of the present application.

[0096] It is understandable that the interface implementation in the above embodiment is only an example, and the text description displayed in the interface and the layout of the controls can be adjusted or set as needed in actual applications, and are not intended to limit the implementation of the above interface.

[0097] Below, through Figure 6 , combined with the above-mentioned interface implementation, an exemplary description is given of the possible implementation process of the device connection method in the embodiment of the present application.

[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 transmit data normally. The second electronic device can be one or more, and the third electronic device is the device that the first electronic device hopes to pair and connect, such as the Bluetooth keyboard in the above embodiment.

[0099] The pairing connection in the embodiment of the present application can be considered as the process of mutual authentication and establishment of connection 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 considered as the process of mutual authentication and establishment of Bluetooth connection between the first electronic device and the target device based on the Bluetooth protocol. The above-mentioned Bluetooth connection is a communication connection based on Bluetooth between the first electronic device and the target device established when the Bluetooth pairing connection between the first electronic device and the target device is successful.

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

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

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

[0103] The devices included in the available device list are devices that the first electronic device has searched for via Bluetooth. The devices included in the available device list can be devices that have been successfully paired and connected with the first electronic device via Bluetooth, such as the Bluetooth headset in interface 20, or devices that have not been paired and connected with the first electronic device, such as the Bluetooth keyboard and speakers in interface 20.

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

[0105] Combination Figure 7 In some embodiments, this step can be specifically performed by a setting application in the first electronic device.

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

[0107] The user can click on a control corresponding to a device in the list of available devices on the first Bluetooth setting interface. Accordingly, 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 setting interface 20 as an example, the user can click on the control 23 corresponding to the Bluetooth keyboard. Accordingly, 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 established between the first electronic device and the other devices. Continuing with the above example, if the mobile phone has been paired with a Bluetooth headset, it is paired with a Bluetooth keyboard in this step. When the mobile phone is paired 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] Combination Figure 7 In this step, the setting application in the first electronic device receives a pairing connection request for a third electronic device in the available device list, requests 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] Combination Figure 7 The Bluetooth driver can send the pairing connection result to the setting application, and the setting 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 and connection, and after receiving a confirmation operation from the user, displays a second Bluetooth setting interface, and this branch process ends.

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

[0114] The second Bluetooth setting interface is shown as interface 40, for example.

[0115] Combination Figure 7 , this step can be specifically performed by the settings application.

[0116] Step 605 : The first electronic device determines whether there is a connection in the existing Bluetooth connection whose quality can be reduced. If not, execute step 606 ; if yes, execute step 607 .

[0117] It is understandable that the existing Bluetooth connection can be one or more, and the existing Bluetooth connection refers to the Bluetooth connection that has been established between the first electronic device and each second electronic device when this step is executed. For example, if there are two second electronic devices that have established connections with the first electronic device, namely the second electronic device A and the second electronic device B, then the Bluetooth connection 1 that has been established between the first electronic device and the second electronic device A, and the Bluetooth connection 2 that has been 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 two existing Bluetooth connections.

[0118] Reducing the quality of the Bluetooth connection in the embodiment 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 the Bluetooth pairing connection between a mobile phone (a first electronic device) and a Bluetooth headset (a second electronic device) as an example, in some embodiments, the quality ranking between different encoding formats can be preset in the mobile phone, such as LHDC / LDAC, aptXHD / Adaptive, AAC, SBC, and the quality ranking can also be a ranking of occupied bandwidth. In this step, the mobile phone can obtain the encoding formats supported by the mobile phone and the Bluetooth headset respectively, and according to the encoding format currently used for the connection between the mobile phone and the Bluetooth headset, combined with the above ranking, the encoding formats supported by the mobile phone and the Bluetooth headset respectively, it is determined whether there is a encoding format with lower quality than the currently used encoding format in the encoding formats supported by 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 can be obtained. Based on the ranking, it is determined whether there is a encoding format with lower quality than the encoding format currently used by the existing Bluetooth connection. For example, assuming that the mobile phone supports LDAC, Adaptive, AAC, and SBC, and the quality of the pre-stored encoding formats is ranked as follows: LDAC, Adaptive, AAC, and SBC, while the Bluetooth headset only supports LDAC, AAC, and SBC, then it can be known that the mobile phone and the Bluetooth headset both support LDAC, AAC, and SBC, and are ranked as LDAC, AAC, and 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 quality of the existing Bluetooth connection can be reduced; if the mobile phone and the Bluetooth headset both support LDAC, AAC, and SBC, and the current encoding format 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 quality of the existing Bluetooth connection cannot be reduced.

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

[0121] Combination Figure 7 This step can be executed by the setting application, or the setting application can request the Bluetooth driver to execute it, and the Bluetooth driver sends the judgment result to the setting application.

[0122] Step 606: the first electronic device displays a prompt interface indicating that the pairing connection has failed, and after receiving a confirmation operation from the user, displays a third Bluetooth setting interface, and this branch process ends.

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

[0124] The third Bluetooth setting interface is shown as interface 20, for example.

[0125] It is understandable that, since the pairing connection fails, the connection status of each available device in the first Bluetooth setting interface has not changed, so the third Bluetooth setting interface and the first Bluetooth setting interface may be the same, such as shown in interface 20. Alternatively, in other embodiments, the third Bluetooth setting interface may also be different from the first Bluetooth setting interface, for example, a mark or text description may be set for the third electronic device (such as a Bluetooth keyboard) that failed to pair and connect in the third Bluetooth setting interface, so as to prompt the user that the third electronic device (such as a Bluetooth keyboard) failed to pair and connect, and the specific interface implementation is not limited to the embodiment of the present application.

[0126] Combination Figure 7 , this step can be performed by the Settings app.

[0127] Step 607: the first electronic device displays a first prompt interface, where the first prompt interface is used to prompt the user whether to reduce the quality of the existing Bluetooth connection of the first electronic device and retry to connect 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 to connect to the third electronic device.

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

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

[0131] Combination Figure 7 , this step can be performed by the Settings app.

[0132] Step 608: The first electronic device receives the 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 and connection result is obtained.

[0133] The final pairing connection result may include: the pairing connection with the third electronic device is successful, or the quality occupied by the existing Bluetooth connection is reduced to the minimum, but the pairing connection with the third electronic device still fails.

[0134] The first electronic device receiving the 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. Accordingly, the first electronic device detects the user's click operation on the above control, that is, detects the instruction information to reduce the quality of the existing Bluetooth connection and retry to connect to the third electronic device.

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

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

[0138] The method switches the coding format used on the existing Bluetooth connection of the first electronic device from a coding format with relatively high quality (occupied bandwidth) to a coding format with relatively low quality, thereby reducing 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, increasing the probability of successful connection between the first electronic device and the new third electronic device via Bluetooth.

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

[0140] Combination Figure 7 The Bluetooth driver obtains a final pairing connection result and sends the final pairing connection result to the setting application. The setting application can determine whether the pairing connection between the first electronic device and the third electronic device is successful based on the final pairing connection result.

[0141] Step 610: The first electronic device displays a second prompt interface, where 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 degraded quality.

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

[0144] In some embodiments, the second prompt interface is shown as 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, the second prompt interface is shown as interface 70a, for example, the second control may be a "yes" control in interface 70a, and the third control may be a "no" control in interface 70a.

[0146] Combination Figure 7 , this step can be performed by the Settings app.

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

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

[0149] Combination Figure 7 In this step, the setting application receives a selection operation for the second control and can send a request message to the Bluetooth driver to request the Bluetooth driver to restore the connection whose quality has been reduced to the original quality. In response to the request, the Bluetooth driver restores the connection whose quality has been reduced to the original quality, and the setting application displays the fourth Bluetooth setting interface. It can be understood that there is no restriction on the execution order between the setting application sending the request and displaying the fourth Bluetooth setting interface.

[0150] In this step, the setting application receives the selection operation for the third control and can directly display the fourth Bluetooth setting interface ( Figure 7 In this case, the setting application may not send a request to the Bluetooth driver, so that the Bluetooth driver can maintain the quality of the connection with reduced quality unchanged.

[0151] Step 612: The first electronic device displays a third prompt interface, where 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 degraded quality.

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

[0154] In some embodiments, the third prompt interface is shown as 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, the third prompt interface is shown as interface 70a, for example, the fourth control may be a "yes" control in interface 70a, and the fifth control may be a "no" control in interface 70a.

[0156] Combination Figure 7 , this step can be performed by the Settings app.

[0157] Step 613: The first electronic device receives the selection operation for the fourth control, restores the connection with reduced quality to the original quality, and displays the fifth Bluetooth setting interface; the first electronic device receives the selection operation for the fifth control, maintains the quality of the connection with reduced quality unchanged, and displays the fifth Bluetooth setting interface. This branch process ends.

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

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

[0160] Combination Figure 7 In this step, the setting application receives a selection operation for the fourth control and can send a request message to the Bluetooth driver to request the Bluetooth driver to restore the connection whose quality has been reduced to the original quality. In response to the request, the Bluetooth driver restores the connection whose quality has been reduced to the original quality, and the setting application displays the fifth Bluetooth setting interface. It can be understood that there is no restriction on the execution order between the setting application sending the request and displaying the fifth Bluetooth setting interface.

[0161] Combination Figure 7 In this step, the setting application receives the selection operation for the sixth control and can directly display the fifth Bluetooth setting interface. At this time, the setting application may not send a request to the Bluetooth driver, so that the Bluetooth driver can maintain the quality of the connection that has been reduced.

[0162] The following is an exemplary description of a 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 a final pairing and connection result is obtained.

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

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

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

[0166] The first connection here refers to a connection in the existing Bluetooth connection that can reduce the quality, or a connection in the existing Bluetooth connection that can reduce the occupied bandwidth. It can be understood that when there are multiple existing Bluetooth connections, the determined first connection can be one or more. In some embodiments, the above-mentioned 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 shows that Figure 8 For a cyclic processing flow, step 802 can be executed for one round (one cycle) or multiple rounds.

[0169] When executing this step in each round, if there are multiple first connections, you can choose to reduce the quality of some first connections (for example, 1 first connection), or you can choose to reduce the quality of each first connection. For example, the first electronic device has 3 Bluetooth connections, namely, Bluetooth connections 1 to 3, of which the quality of Bluetooth connections 1 and 2 can be reduced. Then, in step 801, it can be determined that the first connection is Bluetooth connection 1 and Bluetooth connection 2. In this step, you can choose to reduce the quality of Bluetooth connection 1 or Bluetooth connection 2, or you can choose to reduce the quality of Bluetooth connection 1 and Bluetooth connection 2.

[0170] For a first connection, when reducing the quality of the first connection, the quality of the first connection may be directly reduced to the minimum, or may be gradually reduced according to a certain preset rule, and the quality of the first connection may be reduced to the minimum by performing step 802 for multiple rounds. It is understandable that when reducing the quality of different first connections, the same strategy may be used, or different strategies may be used.

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

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

[0173] In another embodiment, when reducing the quality of the first connection, the encoding format may also be gradually reduced by sorting according to the quality with a step size of 2, 3 or more, which is not listed here.

[0174] In yet another embodiment, when reducing the quality of the first connection, the encoding format of the first connection may be directly reduced to the lowest encoding format such as SBC by sorting according to the quality.

[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, and the embodiments of the present application are not limited thereto.

[0176] In one embodiment, when it is determined in step 801 that there are two first connections a1 and a2, the quality of the two first connections a1 and a2 can be reduced at the same time when step 802 is executed in each round, until the loop ends or the quality of the two first connections a1 and a2 is reduced to the minimum. It can be understood that in this embodiment, when step 802 is executed in a loop, the quality of one first connection a1 may be reduced to the minimum first, while the quality of the other first connection a2 has not yet been reduced to the minimum. In this case, when step 802 is executed, only the quality of the first connection a2 can be reduced. For example, assuming that the coding format quality is ranked as: LDAC, AAC, SBC, if the coding format used by the first connection a1 is AAC, and the coding 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 at the same time, the first connection a1 is reduced to SBC, and the second connection a2 is reduced to AAC. When step 802 is executed for the second time, since the quality of the first connection a1 has been reduced to the minimum, only the quality of the second connection a1 is reduced, that is, the coding format is reduced from AAC to SBC.

[0177] In another embodiment, when it is determined in step 801 that there are two first connections a1 and a2, in each round of executing step 802, the quality of only one first connection may be reduced, and the qualities of the two first connections may be reduced alternately. For example, assuming that the coding format quality is ranked as: LDAC, AAC, SBC, if the coding formats used by the first connection a1 and the first connection a2 are both LDAC, then the quality of the first connection a1 may be reduced, for example, to AAC, when step 802 is executed for the first time, the quality of the first connection a2 may be reduced, for example, to AAC, when step 802 is executed for the second time, the quality of the first connection a2 may be reduced, for example, to AAC, when step 802 is executed for the third time, the quality of the first connection a1 may be reduced again, for example, to SBC, and when step 802 is executed for the fourth time, the quality of the first connection a2 may be reduced again, for example, to SBC. Compared with the previous embodiment, this embodiment can improve the probability of successful 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.

[0178] In yet another embodiment, when it is determined in step 801 that there are two first connections a1 and a2, in each round of executing step 802, the quality of only one first connection may be reduced, and the quality of the first connection a1 may be reduced to the lowest first, and then the quality of the first connection a2 may be reduced until it is the lowest. For example, assuming that the coding format quality is ranked as: LDAC, AAC, SBC, if the coding formats used by the first connection a1 and the first connection a2 are both LDAC, then the quality of the first connection a1 may be reduced, for example, to AAC, when step 802 is executed for the first time, the quality of the first connection a1 may be reduced, for example, to SBC, and when step 802 is executed for the second time, the quality of the first connection a1 may be reduced, for example, to AAC, and when step 802 is executed for the third time, since the quality of the first connection a1 is reduced to the lowest, the quality of the first connection a2 may be reduced, for example, to AAC, and when step 802 is executed for the fourth time, the quality of the first connection a2 may be reduced again, for example, to SBC. Compared with the first embodiment, this embodiment may also improve the probability of successful pairing connection 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. In this embodiment, the quality of Bluetooth connections that have less impact on the functional services of the electronic device may be preferentially reduced to reduce the impact of the reduced quality of the Bluetooth connection on the functional services of the electronic device.

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

[0180] If the pairing connection is successful in this step, a pairing connection result indicating that the pairing connection is successful is obtained in step 608 , 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 so, the process returns to step 802. Otherwise, the final pairing connection result is pairing connection failure.

[0182] It is understandable that when returning to execute step 802, 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, referred to as first connection 1 and first connection 2, when step 802 is first executed, the quality of first connection 1 is reduced to the minimum, and then after executing steps 803 and 804, it can be determined that the quality of first connection 2 can be reduced, and the process returns to step 802. Since the quality of first connection 1 has been reduced to the minimum, the first electronic device can reduce the quality of first connection 2.

[0184] Example 2: If there are two first connections, referred to as 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, but not reduced to the lowest quality. After executing steps 803 and 804, it can be determined that both the first connection 1 and the first connection 2 can be reduced in quality, and the process returns to step 802. The first electronic device can reduce the quality of at least one of the first connection 1 and the first connection 2. For specific selection and implementation, please refer to the corresponding instructions in step 802, and the embodiments of the present application will not be elaborated herein.

[0185] In the method, the first electronic device gradually reduces the coding format used on the existing Bluetooth connection, that is, gradually switches the coding format used on the existing Bluetooth connection to a coding format with relatively lower quality (occupied bandwidth), thereby gradually reducing the Bluetooth resources occupied by the first Bluetooth connection, and re-initiates a pairing connection with the third electronic device each time the connection is reduced until the pairing connection is successful or the pairing connection ultimately fails, thereby increasing the possibility of a successful pairing connection between the first electronic device and the third electronic device while minimizing the impact on the data transmission quality on the existing Bluetooth connection.

[0186] For ease of understanding, the following takes the Bluetooth connection established between the first electronic device and a second electronic device as an example 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 transmitted normally 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 is received to reduce the quality of the existing Bluetooth connection and retry to connect to the third electronic device.

[0189] Step 903: The first electronic device determines whether the reconnection to the third electronic device is successful. If not, execute step 904; if yes, execute step 911.

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

[0191] For ease of explanation, the encoding format used in the existing Bluetooth connection between the first electronic device and the second electronic device is referred to as the encoding format of the existing Bluetooth connection.

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

[0193] Step 906: The first electronic device determines whether the encoding format has a transmission code rate that can be reduced. If so, execute step 907; if not, execute step 908.

[0194] Step 907: The first electronic device reduces the transmission bit rate of the encoding 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 the coding format of the existing Bluetooth connection has a coding format that can be reduced. If so, execute step 909; otherwise, execute step 910.

[0196] Step 909: The first electronic device reduces the encoding 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 connection result with the third electronic device is a pairing connection failure, and displays a third prompt interface.

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

[0199] Step 912: The first electronic device determines whether to restore the encoding format of the existing Bluetooth connection to the original encoding format. If yes, execute step 913; otherwise, end the processing flow.

[0200] It can be understood that ending the processing flow in this step means that the first electronic device keeps the current encoding format of the existing Bluetooth connection unchanged.

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

[0202] 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 ranking are as follows: 990kbps LDAC, 660kbps LDAC, 330kbps LDAC, AptX, AAC, SBC, and the encoding format used for the connection between the first electronic device and the second electronic device is 990kbps LDAC, then, the interaction process between the first electronic device, the second electronic device and the third electronic device is as follows: Fig.10 shown.

[0203] Among them, when the connection between the first electronic device and the second electronic device uses the LDAC encoding format of 990kbps, 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 try 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 bit rate of 990kbps to 660bps, and then the pairing connection with the third electronic device is attempted. If the pairing connection is successful, the process is terminated, otherwise,

[0204] The LDAC encoding format used between the first electronic device and the second electronic device is reduced from 990kbps to 660bps, and then an attempt is made to pair and connect to a third electronic device. If the pairing connection is successful, the process is terminated. Otherwise,

[0205] The LDAC encoding format used between the first electronic device and the second electronic device is reduced from 660kbps to 330bps, and then an attempt is made to pair and connect to a third electronic device. If the pairing connection is successful, the process is terminated. Otherwise,

[0206] 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 an attempt is made to pair and connect with a third electronic device, and so on, until the pairing and connection process is successfully terminated, or the encoding format used between the first electronic device and the second electronic device is reduced to the lowest quality encoding format, and the pairing and connection still fails and the process is terminated.

[0207] In some embodiments, a Bluetooth connection already in use by the first electronic device may cause signal transmission to deteriorate due to the influence of other existing Bluetooth connections or other non-Bluetooth connections, 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's experience. The above-mentioned functional services are functions and / or services provided to users by the first electronic device and / or the second electronic device, such as playing music with a Bluetooth headset, playing music with a mobile phone, playing videos with a mobile phone, etc., which can all be considered as functions and / or services provided to users.

[0208] For other non-Bluetooth connections that affect existing Bluetooth connections, the following examples are given: Take the case where a mobile phone (first electronic device) has been connected to a Bluetooth headset (second electronic device) via Bluetooth, and the mobile phone has been connected to a wifi hotspot such as a router. In this scenario, if the mobile phone plays online music through a 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 is away from the router until the wifi connection between the mobile phone and the router is disconnected, the audio data played by the headset may be stuck. After analysis, the reason is that in this coexistence 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 bandwidth resources available for the Bluetooth connection between the mobile phone and the Bluetooth headset, and the audio data transmission cannot find a suitable channel, resulting in the mobile phone being unable to transmit audio data to the Bluetooth headset in time, so that the Bluetooth headset plays music and freezes. At this time, the device connection method provided in the embodiment 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 Bluetooth headset playing music, thereby alleviating or solving the problem of music playing music being stuck in the Bluetooth headset.

[0209] The following is an example of the situation where other existing Bluetooth connections affect existing Bluetooth connections: a mobile phone (first electronic device) has been connected to a Bluetooth headset (second electronic device) via Bluetooth, and the Bluetooth headset is used to play online music. Another Bluetooth device such as a smart watch is also connected via Bluetooth. If a large amount of data is transmitted between the mobile phone and the smart watch, the Bluetooth resources that can be occupied by the Bluetooth connection between the mobile phone and the Bluetooth headset may be squeezed, thereby affecting the audio data transmission speed between the mobile phone and the Bluetooth headset, and the Bluetooth headset plays music in a lag. At this time, the device connection method provided in the embodiment 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 Bluetooth headset playing music, thereby alleviating or solving the problem of the Bluetooth headset playing music in a lag.

[0210] like Fig.11 As shown, when the mobile phone detects that the music playing in the Bluetooth headset is stuck, it can provide the user with, for example Fig.11 The prompt interface shown is used to prompt the user whether to reduce the quality of music playback to solve the jamming 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 of the existing Bluetooth connection (such as the encoding format) to alleviate or solve the jamming 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 can be understood that the above-mentioned WiFi connection and Bluetooth connection coexist, and the WiFi connection occupies more communication bandwidth, resulting in a reduction in the bandwidth that can be occupied by the Bluetooth connection between the mobile phone and the Bluetooth headset. This is only an example. The reasons for the reduction in the bandwidth that can be occupied by the Bluetooth connection between the mobile phone and the Bluetooth headset are not limited to WiFi connection, but can also be the Bluetooth connection in the above example, or other communication connections.

[0212] Fig.12 Another schematic diagram of the device connection method provided in the embodiment of the present application is as follows: Fig.12 As shown, the method may include:

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

[0214] 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 encoding formats, and the above-mentioned music playback can also be extended to other functional services that can be provided by the second electronic device. In other words, as long as the data required for the functional service provided by the second electronic device has multiple encoding formats when transmitted between the first electronic device and the second electronic device via Bluetooth, and different encoding formats can correspond to different service qualities of the functional service.

[0216] Combination Fig.13 In this step, the Bluetooth driver in the first electronic device can establish a Bluetooth connection with the second electronic device, and the application in the first electronic device ( Fig.13 (not shown) For example, when a music application or a video application needs to use a second electronic device to play music, the audio data is sent to a Bluetooth driver, and the Bluetooth driver transmits it to the second electronic device via a first Bluetooth connection using a first encoding format.

[0217] Step 1202: The first electronic device detects that music played by the second electronic device based on audio data is stuck.

[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 playing music without lag. Otherwise, it can be determined that the second electronic device is playing music without lag.

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

[0220] Combination Fig.13 In this step, the Bluetooth driver in the first electronic device can specifically detect whether the music playing of the second electronic device is stuck based on the packet loss rate of the audio data transmission on the first Bluetooth connection.

[0221] Step 1203 : the first electronic device determines whether the first Bluetooth connection has a coding format that can be reduced, and if so, executes step 1204 .

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

[0223] Optionally, the coding format with the lowest bandwidth may be the coding format supported by both the first electronic device and the second electronic device, which is ranked last (lowest in ranking) in the preset quality ranking; or, the coding format with the lowest bandwidth may also be a preset coding format, which may be a default setting in the first electronic device or set by the user. Taking the quality ranking of the aforementioned coding formats LDAC, AptX, AAC, SBC as an example, if the first electronic device does not have a preset coding format with the lowest bandwidth, the coding format with the lowest bandwidth may be the coding format SBC with the lowest ranking position, if the coding format currently used by the first Bluetooth connection is AAC, then this step may determine that the first Bluetooth connection has a coding format that can be reduced, if the first electronic device has a preset coding format with the lowest bandwidth, which is AAC, then in this step, the coding format with the lowest bandwidth is AAC, and if the first Bluetooth connection currently uses AAC, then in this step, it may be determined that the first Bluetooth connection does not have a coding format that can be reduced.

[0224] If the first electronic device determines that there is no encoding format that can be reduced in the first Bluetooth connection, it can keep transmitting audio data to the second electronic device using the first encoding format through the first Bluetooth connection, which is not elaborated here.

[0225] The implementation of the first electronic device determining whether there is a coding format that can be reduced for the first Bluetooth connection can refer to the corresponding description in step 605, which is not repeated here.

[0226] Combination Fig.13 This step can be specifically performed by the Bluetooth driver in the first electronic device.

[0227] Step 1204: the first electronic device displays a fourth prompt interface, where the fourth prompt interface 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, Fig.11 In the prompt interface shown, the sixth control may be a “yes” control.

[0229] Combination Fig.13 When the Bluetooth driver in the first electronic device determines that there is a coding format that can be reduced in the first Bluetooth connection, a notification message can be sent to the system service in the first electronic device to indicate to the system service that the music playback of the second electronic device is stuck and there is a music format that can be reduced; in response, the system service receives the notification message and can display, for example Fig.11 The fourth prompt interface is shown.

[0230] It is understandable that the above system service may be a service provided by the operating system of the first electronic device and used to provide information prompts through an interface. For example, the system service may be located in the framework layer or application layer of the operating system. Alternatively, in other embodiments, the Bluetooth driver may also send the above notification message to an application (such as a music application or a video application) that uses the first Bluetooth connection to transmit audio data, and the application displays 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 freeze is resolved or the encoding format of the first Bluetooth connection is reduced to the encoding format that occupies the lowest bandwidth.

[0232] Combination Fig.13 In this step, the system service that displays the fourth prompt interface in the first electronic device detects the selection operation of the sixth control and sends a feedback message to the Bluetooth driver. The feedback message is used to instruct the Bluetooth driver to reduce the encoding format. In response to the feedback message, the Bluetooth driver can reduce the encoding format of the first Bluetooth connection until the music freeze is resolved or the encoding format of the first Bluetooth connection is reduced to the encoding format that occupies the lowest bandwidth.

[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 occupied bandwidth, 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 occupied bandwidth is reached. In some embodiments, when gradually reducing the encoding format of the first Bluetooth connection, the encoding format can be sorted according to the quality of the encoding formats, and the encoding format of the first Bluetooth connection can be gradually reduced with a preset step size until it is reduced to the encoding format with the lowest occupied bandwidth. The specific values ​​of the above preset steps are 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 in 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 via the first Bluetooth connection.

[0236] The quality ranking of different encoding formats can be pre-set in the first electronic device, wherein the quality ranking of the second encoding format is located after the first encoding format. In other words, the quality of the second encoding format is lower than the quality of the first encoding format, or the bandwidth occupied by the second encoding format is lower than the bandwidth 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 yes, step S3 is executed; if not, this branch process ends.

[0238] The implementation of this step may refer to step 1202 and will not be described in detail here.

[0239] Wherein, when the judgment result of this step is no, it means that the second electronic device plays music without lag, so that the first Bluetooth connection can be maintained to use the current encoding format for audio data transmission.

[0240] Step S3: The first electronic device determines whether the first Bluetooth connection has a coding format that can be reduced. If yes, step S4 is executed; if not, this branch process ends.

[0241] Step S4: the first electronic device switches the encoding format used in 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 via the first Bluetooth connection.

[0242] Afterwards, the first electronic device can continue to execute steps S2 and S3, and when the result of step S3 is yes, execute step S4 to further reduce the encoding format used by the first Bluetooth connection, and so on, until the music is no longer stuck, or the encoding format used by the first Bluetooth connection is reduced to the encoding format that occupies the lowest bandwidth.

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

[0244] When the Bluetooth connection between the first electronic device and the second electronic device uses the LDAC encoding format of 990kbps, if the music played by the second electronic device is stuck, the transmission bit rate of the LDAC encoding format used between the first electronic device and the second electronic device can be reduced from 990kbps to 660bps, and then it is determined whether the music played by the second electronic device is stuck. If not, the process is terminated. Otherwise,

[0245] The LDAC encoding format used between the first electronic device and the second electronic device is reduced from 660kbps to 330bps, and then it is determined whether the music played by the second electronic device is stuck. If not, the process is terminated. 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 determined whether the music played by the second electronic device is stuck, and so on, until the music played by the second electronic device is not stuck and the process is terminated, 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, that is, the SBC encoding format with the lowest quality in the above quality ranking, and the music played by the second electronic device is still stuck and the process is terminated.

[0247] When a functional service such as music playback freezes, the method switches the encoding format used on the first Bluetooth connection of the first electronic device from an encoding format that occupies a relatively high bandwidth to an encoding format that occupies a relatively low bandwidth, thereby reducing the amount of data required to be transmitted on the first Bluetooth connection, thereby reducing the possibility of freezes when the second electronic device performs functional services such as music playback when the Bluetooth resources occupied by the first Bluetooth connection become low. 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 that occupies a relatively low bandwidth, thereby gradually reducing the amount of data required to be transmitted on the first Bluetooth connection, and re-detects whether the second electronic device is freezed in performing the first functional service each time it is reduced, thereby reducing the possibility of freezes when the second electronic device performs the functional service under the condition of minimizing the impact on the quality of data transmission on the first Bluetooth connection.

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

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

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

[0251] The embodiment of the present application also provides a computer-readable storage medium, in which a computer program is stored. When the computer-readable storage medium is run on a computer, the computer executes the method provided by the embodiment of the present application.

[0252] The embodiment of the present application also provides a computer program product, which includes a computer program. When the computer program is run on a computer, it enables the computer to execute the method provided by the embodiment of the present application.

[0253] In the embodiments of the present application, "at least one" refers to one or more, and "more than one" refers to two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent the existence of A alone, the existence of A and B at the same time, and the existence of B alone. Among them, A and B can be singular or plural. The character " / " generally indicates that the previous and next associated objects are in an "or" relationship. "At least one of the following" and similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one of a, b and c can be represented by: a, b, c, a and b, a and c, b and c, or a and b and c, where a, b, c can be single or multiple.

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

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

[0256] In several embodiments provided in the present 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 the present application, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory; hereinafter referred to as: ROM), random access memory (Random Access Memory; hereinafter referred to as: RAM), disk or optical disk, and other media that can store program codes.

[0257] The above is only a specific implementation of the present application. Any changes or substitutions that can be easily thought of by a person skilled in the art within the technical scope disclosed in the present application should be included in the protection scope of the present application. The protection scope of the present application should be based on the protection scope of the claims.

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 using a first coding format over the first Bluetooth connection; 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 encoding format used on the first Bluetooth connection from the first encoding format to the second encoding format, and re-initiates the pairing connection with the third electronic device, and the bandwidth occupied by the second encoding format is lower than the bandwidth occupied by the first encoding format.

2. The method according to claim 1, characterized in that The method further comprises: When the re-initiated pairing connection with the third electronic device fails, 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 re-initiates the pairing connection with the third electronic device, 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 occupying the lowest bandwidth, and the re-initiated pairing connection with the third electronic device fails, and the encoding format occupying the lowest bandwidth is the encoding format occupying the lowest bandwidth among the encoding formats supported by both the first electronic device and the second electronic device.

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

4. The method according to claim 2, characterized in that: Before the first electronic device switches the encoding format used by the first Bluetooth connection from the second encoding format to a third encoding format, the method further includes: It is determined that among the encoding formats supported by both the first electronic device and the second electronic device, there is an encoding format that occupies a lower bandwidth than the second encoding format.

5. The method according to any one of claims 1 to 4, characterized in that: The first coding format and the second coding format are different coding formats; or, the first coding format and the second coding format are the same coding format with different transmission code rates.

6. The method according to any one of claims 1 to 4, characterized in that: The method further comprises: The first electronic device switches the encoding format used on the first Bluetooth connection to the encoding format occupying the lowest bandwidth, and displays a second interface when the re-initiated pairing connection with the third electronic device fails, the second interface comprising: a second control, 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, the encoding format used on the first Bluetooth connection is switched to the first encoding format.

7. The method according to any one of claims 1 to 4, characterized in that: Also includes: When the re-initiated pairing connection with the third electronic device is successful, a third interface is displayed, wherein 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, the encoding format used on the first Bluetooth connection is switched to the first encoding format.

8. The method according to claim 1, characterized in that Before the first electronic device initiates a pairing connection with a 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 coding format over the second Bluetooth connection; Before re-initiating 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 encoding format used on the second Bluetooth connection from the fourth encoding format to the fifth encoding format, and the bandwidth occupied by the fifth encoding format is lower than the bandwidth occupied by the fourth encoding format.

9. The method according to claim 2, characterized in that: Before the first electronic device initiates a pairing connection with a 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 coding format over the second Bluetooth connection; The method further comprises: The first electronic device switches the encoding format used on the first Bluetooth connection to the encoding format occupying the lowest 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 the fifth encoding format, and re-initiates the 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.

10. 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 to the second electronic device using a first coding format over the first Bluetooth connection, so that the second electronic device performs a first functional service according to the data; When it is detected that the second electronic device encounters a freeze while executing the first functional service, the first electronic device switches the encoding format used on the first Bluetooth connection from the first encoding format to the second encoding format, and the first electronic device transmits the data to the second electronic device using the second encoding format on the first Bluetooth connection; the bandwidth occupied by the second encoding format is lower than the bandwidth occupied by the first encoding format.

11. The method according to claim 10, characterized in that After the first electronic device transmits data to the second electronic device using a second encoding format over the first Bluetooth connection, the method further includes: When it is detected that the second electronic device is stuck in executing 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 executes the first function service without lag, or the first electronic device switches the coding format used on the first Bluetooth connection to the coding format occupying the lowest bandwidth, and the second electronic device still executes the first function service with lag, and the coding format occupying the lowest bandwidth is the coding format with the lowest bandwidth among the coding formats supported by both the first electronic device and the second electronic device.

12. The method according to claim 10 or 11, characterized in that: Before the first electronic device switches the encoding format used on the first Bluetooth connection from the first encoding format to a second encoding format, the method further includes: When it is detected that the second electronic device is stuck in executing the first functional service, it is determined that there is a coding format that occupies a lower bandwidth than the first coding format among the coding formats supported by the first electronic device and the second electronic device, and a fourth interface is displayed, wherein the fourth interface includes a fourth control; the fourth control is used to trigger the first electronic device to reduce the coding format used on the first Bluetooth connection; A selection operation for the fourth control is received.

13. The method according to claim 11, characterized in that Before the first electronic device switches the encoding format used on the first Bluetooth connection from the second encoding format to a third encoding format, the method further includes: It is determined that among the encoding formats supported by both the first electronic device and the second electronic device, there is an encoding format that occupies a lower bandwidth than the second encoding format.

14. The method according to any one of claims 10, 11 or 13, characterized in that: The first coding format and the second coding format are different coding formats; or, the first coding format and the second coding format are the same coding format with different transmission code rates.

15. A first electronic device, characterized in that: include: Processor, memory; One or more computer programs are stored in the memory, and the one or more computer programs include instructions, which, when executed by the processor, enable the first electronic device to perform the method according to any one of claims 1 to 14.

16. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, which, when executed on a computer, enables the computer to execute the method according to any one of claims 1 to 14.

17. A computer program product, characterized in that The computer program product comprises a computer program, which, when executed on a computer, enables the computer to execute the method according to any one of claims 1 to 14.

Citation Information

Patent Citations

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

    CN109003618A

  • Bluetooth audio transmission method and device, terminal and readable storage medium

    CN112995963A

  • Bluetooth communication method, Bluetooth communication device and storage medium

    CN115701700A

  • Communication method and electronic equipment

    CN116017614A

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

    CN116055462A