Bluetooth connection methods and electronic devices

By switching the Bluetooth connection method of already connected devices, the physical link is freed up for new devices to connect, which solves the problem of data interaction failure caused by too many devices, improves user experience and reduces communication latency.

CN115884142BActive Publication Date: 2026-03-10HUAWEI TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-09-30
Publication Date
2026-03-10

Smart Images

  • Figure CN115884142B_ABST
    Figure CN115884142B_ABST
Patent Text Reader

Abstract

This application discloses a Bluetooth connection method and an electronic device, relating to the field of electronic technology. It addresses the problem that when the number of devices connected to an electronic device via Bluetooth reaches a certain number, other devices can no longer interact with the electronic device via Bluetooth. The method includes: firstly, a first electronic device receives a first Bluetooth connection request sent by a second electronic device. The first connection request is used to request the establishment of a first Bluetooth connection, which includes a Bluetooth physical link connection and a Bluetooth service link connection. Then, when the number of first target devices exceeds a first threshold, the first electronic device performs a first operation, which includes converting the first Bluetooth connection with a second target device among the first target devices into a second Bluetooth connection and establishing a first Bluetooth connection with the second electronic device. The first target device is the device that has established a first Bluetooth connection with the first electronic device, and the second Bluetooth connection includes a Bluetooth service link connection.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of electronic technology, and in particular to Bluetooth connection methods and electronic devices. Background Technology

[0002] Bluetooth is a wireless technology that enables short-range communication between devices. With technological advancements, more and more electronic devices with Bluetooth functionality are appearing in people's daily lives. In a fully connected smart environment, one electronic device can connect to multiple devices via Bluetooth.

[0003] However, when the number of devices connected to an electronic device via Bluetooth reaches a certain number, multiple devices will compete for the Bluetooth link of that electronic device, causing other devices to be unable to interact with the electronic device via Bluetooth. Summary of the Invention

[0004] This application provides a Bluetooth connection method and an electronic device, which solves the problem that when the number of devices connected to an electronic device via Bluetooth reaches a certain number, other devices will no longer be able to interact with the electronic device via Bluetooth. To achieve the above objective, this application adopts the following technical solution:

[0005] In a first aspect, this application provides a Bluetooth connection method, the method comprising: firstly, a first electronic device receiving a first Bluetooth connection request sent by a second electronic device, the first connection request being used to request the establishment of a first Bluetooth connection, the first Bluetooth connection including a Bluetooth physical link connection and a Bluetooth service link connection; then, when the number of first target devices is greater than a first threshold, the first electronic device performing a first operation, the first operation including converting the first Bluetooth connection with a second target device among the first target devices into a second Bluetooth connection and establishing a first Bluetooth connection with the second electronic device, the first target device being a device that has established a first Bluetooth connection with the first electronic device, the second Bluetooth connection including a Bluetooth service link connection.

[0006] Compared to existing technologies, when the number of devices connected to an electronic device via a Bluetooth physical link exceeds a certain threshold, the electronic device cannot establish new Bluetooth connections because all Bluetooth physical links are occupied. Therefore, the electronic device rejects subsequent Bluetooth connection requests and notifies the connection initiator of connection failure. However, in the Bluetooth connection method provided in this application, when the number of devices connected to the first electronic device via the Bluetooth physical link exceeds a first threshold, upon receiving a Bluetooth connection request from the second electronic device, the first electronic device retains the Bluetooth service link of the second target device already connected via the Bluetooth physical link and disconnects the Bluetooth physical link, thereby releasing the Bluetooth physical link available for the first and second electronic devices to establish a Bluetooth connection. The service state of the second target device remains synchronized, thus solving the problem that when the number of devices connected to an electronic device via Bluetooth reaches a certain threshold, other devices will no longer be able to interact with the electronic device via Bluetooth, improving the user experience.

[0007] In one possible implementation, the method may further include: when the number of connectable devices is less than a second threshold, the first electronic device performs the first operation.

[0008] In one possible implementation, converting the first Bluetooth connection with the second target device into a second Bluetooth connection includes: determining the second target device from the first target device; and disconnecting the Bluetooth physical link connection with the second target device.

[0009] In another possible implementation, converting the first Bluetooth connection with the second target device into a second Bluetooth connection includes: determining the second target device from the first target device; disconnecting the Bluetooth physical link connection with the second target device while maintaining the Bluetooth physical link with the second target device.

[0010] Optionally, the second target device is the first target device with the longest idle time among the first target devices or the first target device with the lowest service priority among the first target devices, and the idle time is the duration between the last time the device last interacted with the first electronic device via Bluetooth and the current time.

[0011] In one possible implementation, determining the second target device from the first target device includes: determining a third target device from the first target device, the third target device being a device that supports a second Bluetooth connection; determining the second target device from the third target device, the second target device being either the third target device with the longest idle time or the third target device with the lowest service priority, wherein the idle time is the duration between the last time the device interacted with the first electronic device via Bluetooth and the current time.

[0012] In one possible implementation, after converting the first Bluetooth connection with the second target device into a second Bluetooth connection, the method further includes: when a target service exists, sending a first indication to the second target device, the target service being a Bluetooth service related to the second target device, the first indication being used to instruct the second target device to establish a Bluetooth physical link connection with the first electronic device.

[0013] In another possible implementation, after converting the first Bluetooth connection with the second target device into a second Bluetooth connection, the method further includes: when a target service exists, sending a second Bluetooth connection request to the second target device, the second Bluetooth request being used to request the establishment of a Bluetooth physical link.

[0014] In one possible implementation, the step of the first electronic device performing a first operation when the number of first target devices is greater than a first threshold includes: when the number of first target devices is greater than the first threshold and the idle time of the first target devices is not all less than a third threshold, the first electronic device performs the first operation; when the number of first target devices is greater than the first threshold and the idle time of the first target devices is all less than the third threshold, the first electronic device sends a second instruction to the second electronic device, the second instruction being used to instruct the second electronic device to establish a first Bluetooth connection with the first electronic device through a fourth target device, the first target device including the fourth target device.

[0015] It is understandable that the number of Bluetooth physical links of the first electronic device is limited and establishing a first Bluetooth connection with the first electronic device requires occupying the Bluetooth physical links of the first electronic device. Therefore, when the first electronic device receives the first connection request, it needs to determine whether there are any idle (unoccupied) Bluetooth physical links available for establishing the first Bluetooth connection by using the relationship between the number of first target devices and the size of the first threshold.

[0016] In the absence of an idle Bluetooth physical link (i.e., the number of first target devices exceeds a first threshold), the second target device is instructed to connect to a fourth target device that has already established a first Bluetooth connection with the first electronic device. This allows the second target device to establish a first Bluetooth connection with the first electronic device via the fourth target device acting as a relay proxy. In this way, the second electronic device and the fourth target device share a single Bluetooth physical link to establish the first Bluetooth connection with the first electronic device, eliminating the need for an additional Bluetooth physical link. A single Bluetooth physical link can allow multiple devices to connect to the first electronic device via Bluetooth. This solves the problem that when the number of devices connected to an electronic device via Bluetooth reaches a certain threshold, other devices will no longer be able to interact with the electronic device via Bluetooth, thus improving the user experience.

[0017] When an idle Bluetooth physical link exists (i.e., the number of first target devices is not greater than the first threshold), the first electronic device establishes a first Bluetooth connection with the second electronic device through the idle Bluetooth physical link.

[0018] In one possible implementation, the method further includes: when the number of the first target devices is greater than the first threshold, and the idle time of the first target devices is less than the third threshold, the first electronic device sends a third instruction to the fourth target device, wherein the third instruction is used to instruct the fourth target device to establish a first Bluetooth connection with the second electronic device.

[0019] Optionally, the fourth target device is the device with the fewest connected devices or the device with the most connectable devices among the first target devices.

[0020] In one possible implementation, the method further includes: when the number of first target devices is less than a first threshold or the number of connectable devices is greater than a second threshold, sending a fourth instruction to the second electronic device, the fourth instruction being used to instruct the second electronic device to disconnect from the fourth target device and send a first Bluetooth connection request to the first electronic device.

[0021] Understandably, when a usable Bluetooth physical link exists for the first electronic device, switching the connection method between the second electronic device and the first electronic device from a relay proxy connection to a direct connection can reduce the communication latency between the first and second electronic devices, improve the communication speed between the first and second electronic devices, and thus further enhance the user experience.

[0022] In one possible implementation, the method further includes: when the current battery level of the fourth target device is less than a fifth threshold, disconnecting the first Bluetooth connection from the fourth target device and instructing the second electronic device to send a first Bluetooth connection request to the first electronic device.

[0023] Understandably, when the fourth target device has insufficient power, the first electronic device instructs the second electronic device to no longer connect to the first electronic device through the fourth target device but to connect directly to the first electronic device. This avoids the second electronic device, which has established a first Bluetooth connection with the first electronic device through the fourth target device, from disconnecting when the fourth target device shuts down due to insufficient power, thus interrupting the Bluetooth connection between the first and second electronic devices and further improving the user experience.

[0024] In one possible implementation, after disconnecting the first Bluetooth connection from the fourth target device, the method further includes: when the current battery level of the fourth target device is greater than a fifth threshold, disconnecting the first Bluetooth connection from the second electronic device and instructing the fourth target device to send a first Bluetooth connection request to the first electronic device.

[0025] In one possible implementation, the method further includes: identifying a connected device based on the connection status of a fifth target device, wherein the fifth target device is a device that has established a first Bluetooth connection or a second Bluetooth connection with the first electronic device, and different identifiers correspond to different connection statuses of the fifth target device.

[0026] Optionally, the aforementioned identifier may include at least one of text, color, or icon.

[0027] For example, a device that directly establishes a first Bluetooth connection with the first electronic device can be identified by a Bluetooth connection text label, a device that establishes a second Bluetooth connection with the first electronic device can be identified by a virtual Bluetooth connection text label, and a device that establishes a first Bluetooth connection with the first electronic device through another device can be identified by a relay Bluetooth connection or a proxy Bluetooth connection text label.

[0028] Understandably, identifying connected devices by their connection status allows users to quickly ascertain the connection status of connected devices, facilitating subsequent operations and thus further enhancing the user experience.

[0029] Secondly, this application also provides an electronic device, which includes a processing unit and a storage unit coupled to the processing unit. The processing unit is configured to: receive a first Bluetooth connection request sent by a second electronic device, the first connection request being used to request the establishment of a first Bluetooth connection, the first Bluetooth connection including a Bluetooth physical link connection and a Bluetooth service link connection; and when the number of first target devices is greater than a first threshold, perform a first operation, the first operation including converting the first Bluetooth connection with the second target device into a second Bluetooth connection and establishing a first Bluetooth connection with the second electronic device, the first target device being a device that establishes a first Bluetooth connection with the electronic device, the first target device including the second target device, and the second Bluetooth connection including a Bluetooth service link connection.

[0030] In one possible implementation, the processing unit is further configured to: perform the first operation when the number of connectable devices is less than a second threshold.

[0031] In one possible implementation, the processing unit is specifically configured to: determine the second target device from the first target device; and disconnect the Bluetooth physical link connection with the second target device.

[0032] In another possible implementation, the processing unit is specifically configured to: determine the second target device from the first target device; disconnect the Bluetooth physical link connection with the second target device while maintaining the Bluetooth physical link with the second target device.

[0033] In one possible implementation, the processing unit is specifically configured to: determine a third target device from the first target device, the third target device being a device that supports a second Bluetooth connection; determine a second target device from the third target device, the second target device being either the third target device with the longest idle time or the third target device with the lowest service priority, wherein the idle time is the duration between the last time the electronic device last interacted with the Bluetooth service and the current time.

[0034] In one possible implementation, after converting the first Bluetooth connection with the second target device into a second Bluetooth connection, the processing unit is further configured to: when a target service exists, send a first indication to the second target device, wherein the target service is a Bluetooth service related to the second target device, and the first indication is used to instruct the second target device to establish a Bluetooth physical link connection with the electronic device.

[0035] In another possible implementation, after converting the first Bluetooth connection with the second target device into a second Bluetooth connection, the processing unit is further configured to: when a target service exists, send a second Bluetooth connection request to the second target device, the second Bluetooth request being used to request the establishment of a Bluetooth physical link.

[0036] In one possible implementation, the processing unit is specifically configured to: perform the first operation when the number of the first target devices is greater than the first threshold and the idle time of the first target devices is not less than the third threshold; and send a second instruction to the second electronic device when the number of the first target devices is greater than the first threshold and the idle time of the first target devices is less than the third threshold, the second instruction being used to instruct the second electronic device to establish a first Bluetooth connection with the electronic device through a fourth target device, wherein the first target device includes the fourth target device.

[0037] In one possible implementation, the processing unit is further configured to: when the number of the first target devices is greater than the first threshold, and the idle time of the first target devices is less than the third threshold, send a third instruction to the fourth target device, wherein the third instruction is used to instruct the fourth target device to establish a first Bluetooth connection with the second electronic device.

[0038] Optionally, the fourth target device is the device with the fewest connected devices or the device with the most connectable devices among the first target devices.

[0039] In one possible implementation, the processing unit is further configured to: when the number of first target devices is less than a first threshold or the number of connectable devices is greater than a second threshold, send a fourth instruction to the second electronic device, the fourth instruction being used to instruct the second electronic device to disconnect from the fourth target device and send a first Bluetooth connection request to the electronic device.

[0040] In one possible implementation, the processing unit is further configured to: disconnect the first Bluetooth connection from the fourth target device and instruct the second electronic device to send a first Bluetooth connection request to the electronic device when the current battery level of the fourth target device is less than a fifth threshold.

[0041] In one possible implementation, after disconnecting the first Bluetooth connection with the fourth target device, the processing unit is further configured to: disconnect the first Bluetooth connection with the second electronic device and instruct the fourth target device to send a first Bluetooth connection request to the electronic device when the current battery level of the fourth target device is greater than a fifth threshold.

[0042] In one possible implementation, the processing unit is further configured to: identify a connected device based on the connection status of the fifth target device, wherein the fifth target device is a device that has established a first Bluetooth connection or a second Bluetooth connection with the first electronic device, and different identifiers correspond to different connection statuses of the fifth target device.

[0043] Optionally, the aforementioned identifier may include at least one of text, color, or icon.

[0044] Thirdly, this application also provides an electronic device comprising: at least one processor, which, when executing program code or instructions, implements the method described in the first aspect or any possible implementation thereof.

[0045] Optionally, the electronic device may also include at least one memory for storing the program code or instructions.

[0046] Fourthly, this application also provides a chip, including: an input interface, an output interface, and at least one processor. Optionally, the chip further includes a memory. The at least one processor is used to execute code in the memory, and when the at least one processor executes the code, the chip implements the method described in the first aspect or any possible implementation thereof.

[0047] Alternatively, the chip described above can also be an integrated circuit.

[0048] Fifthly, this application also provides a terminal, which includes the aforementioned electronic device or the aforementioned chip.

[0049] Sixthly, this application also provides a computer-readable storage medium for storing a computer program that includes methods for implementing the first aspect above or any possible implementation thereof.

[0050] In a seventh aspect, this application also provides a computer program product containing instructions that, when run on a computer, cause the computer to implement the method described in the first aspect or any possible implementation thereof.

[0051] The electronic device, computer storage medium, computer program product, and chip provided in this embodiment are all used to execute the Bluetooth connection method provided above. Therefore, the beneficial effects they can achieve can be referred to the beneficial effects in the Bluetooth connection method provided above, and will not be repeated here. Attached Figure Description

[0052] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

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

[0054] Figure 2 A schematic diagram of the software structure of an electronic device provided in an embodiment of this application;

[0055] Figure 3 A flowchart illustrating a Bluetooth connection method provided in an embodiment of this application;

[0056] Figure 4 A schematic diagram of a Bluetooth connection provided in an embodiment of this application;

[0057] Figure 5 A flowchart illustrating another Bluetooth connection method provided in this application embodiment.

[0058] Figure 6 A flowchart illustrating yet another Bluetooth connection method provided in an embodiment of this application;

[0059] Figure 7 A schematic diagram of the interface of an electronic device provided in an embodiment of this application;

[0060] Figure 8 This is a schematic diagram of the structure of a device provided in an embodiment of this application;

[0061] Figure 9 A schematic diagram of another device provided in an embodiment of this application;

[0062] Figure 10 This is a schematic diagram of the structure of a chip provided in an embodiment of this application. Detailed Implementation

[0063] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0064] In this article, the term "and / or" is merely a description of the relationship between related objects, indicating that there can be three relationships. For example, A and / or B can represent three situations: A exists alone, A and B exist simultaneously, and B exists alone.

[0065] The terms "first" and "second," etc., used in the specification and drawings of this application are used to distinguish different objects or to distinguish different treatments of the same object, rather than to describe a specific order of objects.

[0066] Furthermore, the terms “comprising” and “having”, and any variations thereof, used in the description of this application are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or apparatus that includes a series of steps or units is not limited to the steps or units listed, but may optionally include other steps or units not listed, or may optionally include other steps or units inherent to such processes, methods, products, or apparatus.

[0067] It should be noted that in the description of the embodiments of this application, the words "exemplarily" or "for example" are used to indicate examples, illustrations, or explanations. Any embodiment or design scheme described as "exemplarily" or "for example" in the embodiments of this application should not be construed as being more preferred or advantageous than other embodiments or design schemes. Specifically, the use of the words "exemplarily" or "for example" is intended to present the relevant concepts in a specific manner.

[0068] In the description of this application, unless otherwise stated, "a plurality of" means two or more.

[0069] First, some of the terms used in this application will be explained to facilitate understanding by those skilled in the art.

[0070] The Bluetooth physical link is the physical layer data connection channel between Bluetooth devices, through which Bluetooth devices can transmit data streams. Bluetooth physical links include, but are not limited to, Bluetooth Low Energy (BLE) and Basic Rate (BR).

[0071] Bluetooth service links are data connection channels between Bluetooth devices and within the service layer of Bluetooth devices. Service data streams can be transmitted between or within Bluetooth devices via Bluetooth service links. Bluetooth service links include, but are not limited to, the Bluetooth Advanced Audio Distribution Profile (A2DP), the Bluetooth Hands-Free Profile (HFP), the Bluetooth Headset Profile (HSP), and the Audio / Video Remote Control Profile (AVRCP).

[0072] The Bluetooth connection method provided in this application embodiment can be applied to electronic devices such as mobile phones, tablets, wearable devices, in-vehicle devices, augmented reality (AR) / virtual reality (VR) devices, laptops, ultra-mobile personal computers (UMPCs), netbooks, and personal digital assistants (PDAs). This application embodiment does not impose any restrictions on the specific type of electronic device.

[0073] For example, Figure 1 This is a schematic diagram of the structure of an electronic device 100 provided in an embodiment of this application. The electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, a headphone jack 170D, a sensor module 180, buttons 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, a barometric pressure sensor 180C, a magnetic sensor 180D, an accelerometer sensor 180E, a distance sensor 180F, a proximity 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.

[0074] It is understood that the structures illustrated in the embodiments of this application do not constitute a specific limitation on the electronic device 100. In other embodiments of this application, the electronic device 100 may include more or fewer components than illustrated, or combine some components, or split some components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.

[0075] Processor 110 may include one or more processing units, such as: application processor (AP), modem processor, graphics processing unit (GPU), image signal processor (ISP), controller, memory, video codec, digital signal processor (DSP), baseband processor, and / or neural network processing unit (NPU), etc. Different processing units may be independent devices or integrated into one or more processors.

[0076] The controller can be the nerve center and command center of the electronic device 100. The controller can generate operation control signals according to the instruction opcode and timing signals to complete the control of fetching and executing instructions.

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

[0078] The I2C interface is a bidirectional synchronous serial bus. The processor 110 can couple with the touch sensor 180K through the I2C interface, enabling communication between the processor 110 and the touch sensor 180K via the I2C bus interface, thus realizing the touch function of the electronic device 100. The MIPI interface can be used to connect the processor 110 with peripheral devices such as the display screen 194 and the camera 193. The MIPI interface includes a camera serial interface (CSI) and a display serial interface (DSI). In some embodiments, the processor 110 and the camera 193 communicate through the CSI interface to realize the shooting function of the electronic device 100. The processor 110 and the display screen 194 communicate through the DSI interface to realize the display function of the electronic device 100.

[0079] It is understood that the interface connection relationships between the modules illustrated in the embodiments of this application are merely illustrative and do not constitute a structural limitation on the electronic device 100. In other embodiments of this application, the electronic device 100 may also employ different interface connection methods or combinations of multiple interface connection methods as described in the above embodiments.

[0080] The charging management module 140 receives charging input from a charger, which can be either a wireless or wired charger. The power management module 141 connects to 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, providing power to the processor 110, internal memory 121, external memory, display 194, camera 193, and wireless communication module 160, etc.

[0081] Electronic device 100 implements display functions through a GPU, a display screen 194, and an application processor. The GPU is a microprocessor for image processing, connected to the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations and for graphics rendering. Processor 110 may include one or more GPUs, which execute program instructions to generate or modify display information.

[0082] Display screen 194 is used to display images, videos, etc. Display screen 194 includes a display panel. The display panel may be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), a miniature LED, a microLED, a quantum dot light-emitting diode (QLED), etc. In some embodiments, electronic device 100 may include one or N displays 194, where N is a positive integer greater than 1.

[0083] Electronic device 100 can perform shooting functions through ISP, camera 193, touch sensor, video codec, GPU, display 194 and application processor.

[0084] The ISP (Image Signal Processor) is used to process data fed back from the camera 193. For example, when taking a picture, the shutter is opened, and light is transmitted through the lens to the camera's photosensitive element. The light signal is converted into an electrical signal, and the camera's photosensitive element transmits the electrical signal to the ISP for processing, transforming it into an image visible to the naked eye. The ISP can also perform algorithmic optimization on image noise, brightness, and skin tone. The ISP can also optimize parameters such as exposure and color temperature of the shooting scene. In some embodiments, the ISP can be set in the camera 193.

[0085] Camera 193 is used to capture still images or videos. An object is projected onto a photosensitive element by generating an optical image through the lens. The photosensitive element can be a charge-coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the light signal into an electrical signal, which is then transmitted to an ISP for conversion into a digital image signal. The ISP outputs the digital image signal to a DSP for processing. The DSP converts the digital image signal into a standard RGB, YUV, or other format image signal. It should be understood that the description of the embodiments in this application uses an RGB format image as an example, and the image format is not limited in this application. In some embodiments, the electronic device 100 may include one or N cameras 193, where N is a positive integer greater than 1.

[0086] Digital signal processors (DSPs) are used to process digital signals. Besides digital image signals, they can also process other digital signals. For example, when electronic device 100 selects a frequency, the DSP can perform Fourier transforms on the frequency energy.

[0087] Video codecs are used to compress or decompress digital video. Electronic device 100 may support one or more video codecs. Thus, electronic device 100 can play or record videos in various encoding formats, such as Moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, MPEG4, etc.

[0088] The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100. The internal memory 121 can be used to store computer executable program code, which includes instructions. The processor 110 executes various functional applications and data processing of the electronic device 100 by running the instructions stored in the internal memory 121. The internal memory 121 may include a program storage area and a data storage area.

[0089] Electronic device 100 can implement audio functions, such as music playback and recording, through audio module 170, speaker 170A, receiver 170B, microphone 170C, headphone jack 170D, and application processor.

[0090] A pressure sensor 180A is used to sense pressure signals and convert them into electrical signals. A gyroscope sensor 180B can be used to determine the motion posture of the electronic device 100. A barometric pressure sensor 180C is used to measure barometric pressure. A magnetic sensor 180D includes a Hall effect sensor. The electronic device 100 can use the magnetic sensor 180D to detect the opening and closing of the flip cover. An accelerometer 180E can detect the magnitude of the acceleration of the electronic device 100 in various directions (generally three axes). A distance sensor 180F is used to measure distance. The electronic device 100 can measure distance using infrared or laser. In some embodiments, during a shooting scene, the electronic device 100 can use the distance sensor 180F to measure distance for fast focusing. A proximity sensor 180G may include, for example, a light-emitting diode (LED) and a photodetector, such as a photodiode. An ambient light sensor 180L is used to sense ambient light brightness. The electronic device 100 can adaptively adjust the brightness of the display screen 194 according to the sensed ambient light brightness. The ambient light sensor 180L can also be used to automatically adjust the white balance when taking a picture. A fingerprint sensor 180H is used to collect fingerprints. Electronic device 100 can utilize the collected fingerprint characteristics to achieve fingerprint unlocking, application access lock, fingerprint photography, fingerprint answering of calls, etc. Temperature sensor 180J is used to detect temperature. Touch sensor 180K, also known as a "touch panel," can be placed on display screen 194. The touch sensor 180K and display screen 194 together form a touchscreen, also known as a "touch screen." Touch sensor 180K is used to detect touch operations applied to or near it. Bone conduction sensor 180M can acquire vibration signals. Audio module 170 can analyze the voice signal based on the vibration signal of the acoustic vibration bone block acquired by the bone conduction sensor 180M to realize voice functionality.

[0091] Buttons 190 include a power button, volume buttons, etc. Buttons 190 can be mechanical buttons or touch buttons. Electronic device 100 can receive button inputs and generate key signal inputs related to user settings and function control of electronic device 100. Motor 191 can generate vibration alerts. Motor 191 can be used for incoming call vibration alerts or for touch vibration feedback. For example, touch operations applied to different applications (such as taking photos, playing audio, etc.) can correspond to different vibration feedback effects. Touch operations applied to different areas of the display screen 194 can also correspond to different vibration feedback effects from motor 191. Indicator 192 can be an indicator light, used to indicate charging status, battery level changes, or to indicate messages, missed calls, notifications, etc. SIM card interface 195 is used to connect a SIM card.

[0092] The software system of electronic device 100 can adopt a layered architecture, event-driven architecture, microkernel architecture, microservice architecture, or cloud architecture. This application embodiment uses the layered architecture Android system as an example to exemplify the software structure of electronic device 100.

[0093] Figure 2 This is a software structure block diagram of an electronic device 100 according to an embodiment of this application. The layered architecture divides the software into several layers, each with a clear role and function. Layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into four layers, from top to bottom: the application layer, the application framework layer, the Android runtime and system libraries, and the kernel layer.

[0094] The application layer can include a series of application packages. For example... Figure 2 As shown, the application package can include applications such as camera, photo album, music, and settings.

[0095] The application framework layer provides application programming interfaces (APIs) and a programming framework for applications in the application layer. The application framework layer includes some predefined functions. For example... Figure 2 As shown, the application framework layer may include a window manager, content provider, view system, resource manager, notification manager, etc.

[0096] The window manager is used to manage windowed applications. It can retrieve screen size, determine the presence of a status bar, lock the screen, and capture screenshots, among other things.

[0097] Content providers store and retrieve data, making that data accessible to applications. This data may include videos, images, audio, made and received phone calls, browsing history and bookmarks, phone books, etc.

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

[0099] The file explorer provides applications with various resources, such as localized strings, icons, images, layout files, video files, and more.

[0100] The notification manager allows applications to display notifications in the status bar. These notifications can be used to deliver informational messages and can disappear automatically after a short pause, such as a notification that a download is complete. The notification manager can also display notifications as icons or scrolling text in the top status bar, such as notifications from background applications, or as dialog boxes on the screen. For example, it can display text messages in the status bar, or emit sounds, such as vibrations or flashing indicator lights.

[0101] The Android runtime consists of the core libraries and the virtual machine. The Android runtime is responsible for scheduling and managing the Android system. The core libraries comprise two parts: one part contains the functionalities that the Java language needs to call, and the other part contains the core Android libraries.

[0102] The application layer and application framework layer run in a virtual machine. The virtual machine executes the Java files of the application layer and application framework layer as binary files. The virtual machine is used to perform functions such as object lifecycle management, stack management, thread management, security and exception management, and garbage collection.

[0103] System libraries can include multiple functional modules. For example: surface manager, media libraries, 3D graphics processing libraries (e.g., OpenGL ES), 2D graphics engines (e.g., SGL), etc.

[0104] The Surface Manager is used to manage the display subsystem and provides the blending of 2D and 3D layers for multiple applications.

[0105] The media library supports playback and recording of various common audio and video formats, as well as still image files. It supports multiple audio and video encoding formats, such as MPEG4, H.264, MP3, AAC, AMR, JPG, and PNG.

[0106] 3D graphics processing libraries are used to implement 3D graphics drawing, image rendering, compositing, and layer processing. 2D graphics engines are drawing engines for 2D graphics.

[0107] The kernel layer is the layer between hardware and software. It can contain hardware driver modules, such as display drivers, camera drivers, and sensor drivers. The application framework layer can call these kernel layer hardware driver modules.

[0108] For ease of understanding, the following embodiments of this application will be described using the following methods: Figure 1 and Figure 2Taking the electronic device with the structure shown as an example, the process of taking pictures with the electronic device is introduced.

[0109] The technical solutions involved in the following embodiments can all be implemented in the electronic device 100 having the above-described hardware and software architecture.

[0110] When using a mobile phone, users frequently connect to other devices via Bluetooth. This includes data transfer with a tablet, remote control of smart home appliances, and music playback from a Bluetooth speaker. However, when a certain number of devices are connected to the phone via Bluetooth, multiple devices may compete for the phone's Bluetooth link, preventing other devices from interacting with the phone. For example, if a phone is connected to seven devices via Bluetooth, other devices attempting to connect to it via Bluetooth may display messages such as "Unable to join connection," "Unable to connect to device," or "Connection failed," or the phone may appear as unconnectable in other devices' Bluetooth lists. Therefore, this application provides a Bluetooth connection method that solves the problem of other devices being unable to interact with the electronic device via Bluetooth when the number of devices connected to it reaches a certain threshold.

[0111] The Bluetooth connection method provided in the embodiments of this application will be described in detail below with reference to the accompanying drawings. Figure 3 As shown, the Bluetooth connection method provided in this application embodiment includes:

[0112] S301, The first electronic device receives the first Bluetooth request sent by the second electronic device.

[0113] The first connection request is used to request the establishment of a first Bluetooth connection. The first Bluetooth connection includes a Bluetooth physical link connection and a Bluetooth service link connection.

[0114] For example, if a user wants to listen to music played on a mobile phone (first electronic device) through a Bluetooth headset (second electronic device), the user sends a first Bluetooth request to the mobile phone by operating the Bluetooth headset, and the mobile phone receives the first Bluetooth request sent by the Bluetooth headset.

[0115] Optionally, the first connection request may include a first sub-connection request and a second sub-connection request. The first sub-connection request is used to request the establishment of a Bluetooth physical link connection, and the second sub-connection request is used to request the establishment of a Bluetooth service link connection. For example, the first electronic device may first receive the first sub-connection request sent by the second electronic device, and then receive the second sub-connection request sent by the second electronic device.

[0116] S302. Does the first electronic device determine whether the number of the first target devices is greater than the first threshold? If yes, then execute S303; if no, then execute S304.

[0117] The first target device is the device that establishes a first Bluetooth connection with the first electronic device.

[0118] Optionally, the first threshold can be 6.

[0119] It should be noted that the number of Bluetooth physical links of the first electronic device is limited, and establishing the first Bluetooth connection with the first electronic device requires occupying the Bluetooth physical links of the first electronic device. Therefore, when the first electronic device receives the first connection request, it needs to determine whether there are any idle (unoccupied) Bluetooth physical links available for establishing the first Bluetooth connection by using the relationship between the number of the first target devices and the size of the first threshold.

[0120] In the absence of an idle Bluetooth physical link (i.e., the number of first target devices is greater than the first threshold), the Bluetooth physical link is freed up by converting the first Bluetooth connection with the second target device among the first target devices into a second Bluetooth connection, so that the first electronic device and the second electronic device can establish a first Bluetooth connection.

[0121] When an idle Bluetooth physical link exists (i.e., the number of first target devices is not greater than the first threshold), the first electronic device establishes a first Bluetooth connection with the second electronic device through the idle Bluetooth physical link.

[0122] For example, the first electronic device can determine whether the number of the first target devices is greater than 6 through the protocol stack. If yes, it executes S303; if no, it executes S304. That is, the first electronic device executes S303 when the number of the first target devices is 0, 1, 2, 3, 4, 5, or 6, and executes S304 when the number of the first target devices is any other value.

[0123] In one possible implementation, the first device can also determine whether the number of connectable devices is less than a second threshold. If yes, then S303 is executed; otherwise, S304 is executed.

[0124] For example, the first electronic device can determine whether the number of connectable devices is less than 1 through the protocol stack. If yes, it executes S303; if no, it executes S304. That is, the first electronic device executes S303 when the number of connectable devices is 0, and executes S304 when the number of connectable devices is not 0.

[0125] In another possible implementation, the first electronic device can determine whether the current number of available channels (i.e., the current number of available physical channels or the current number of idle channels) is 0. If yes, then execute S303; otherwise, execute S304.

[0126] In another possible implementation, the first electronic device can also determine whether the number of currently occupied channels is greater than the fourth threshold. If yes, then execute S303; otherwise, execute S304. The fourth threshold can be 6.

[0127] S303, the first electronic device converts the first Bluetooth connection with the second target device into a second Bluetooth connection.

[0128] The first target device includes the second target device, and the second Bluetooth connection includes the Bluetooth service link connection.

[0129] For example, the first electronic device may send a Bluetooth Low Energy (BLE) broadcast packet to the second target device, instructing the second target device to switch the current first Bluetooth connection to a second Bluetooth connection.

[0130] Optionally, after the first electronic device and the second target device establish a second Bluetooth connection, the first electronic device and the second target device can synchronize status and messages through Ble broadcast.

[0131] In one possible implementation, converting the first Bluetooth connection with the second target device into a second Bluetooth connection may include: firstly identifying the second target device from among the first target devices; and then disconnecting the Bluetooth physical link connection with the second target device. The second target device may be the first target device with the longest idle time (i.e., idle period or service idle time) or the first target device with the lowest service priority. The idle time is the duration between the last Bluetooth service interaction with the first electronic device and the current time (e.g., if the last Bluetooth service interaction with the first electronic device was at 14:50:00 and the current time is 14:53:00, then the idle time is 00:03:00).

[0132] In another possible implementation, converting the first Bluetooth connection with the second target device into a second Bluetooth connection may include: first identifying the second target device from the first target device; then disconnecting the Bluetooth physical link connection with the second target device while retaining the Bluetooth service link connection with the second target device.

[0133] It should be noted that the specific method by which the first electronic device determines the second target device from the first target device can be any method that can be conceived by those skilled in the art, and the embodiments of this application do not specifically limit this method.

[0134] For example, the first electronic device can identify the first target device with the longest idle time (i.e., idle time or service idle time) among the first target devices as the second target device. The idle time is the duration between the last time the first target device interacted with the first electronic device via Bluetooth and the current time (e.g., if the last time the first target device interacted with the first electronic device via Bluetooth (excluding keep-alive service) was 14:50:00, and the current time is 14:53:00, then the idle time is 00:03:00).

[0135] For example, the first electronic device can identify the first target device with the lowest service priority among the first target devices as the second target device.

[0136] For example, the first electronic device can determine the score of the first target device based on various parameters of the first target device (such as the number of connections, connection duration, service priority, etc.), and then determine the first target device with the lowest score among the first target devices as the second target device.

[0137] For example, the first electronic device can obtain a priority list as shown in Table 1 according to the idle time of the first target device in ascending order, and then determine the first target device (i.e. device 7) with the longest idle time in the priority list as the second target device, and then disconnect the Bluetooth physical link connection with device 7.

[0138] Table 1

[0139] equipment Free time Equipment 1 00:00:30 Equipment 2 00:00:50 Equipment 3 00:01:00 Equipment 4 00:01:10 Equipment 5 00:03:00 Equipment 6 00:05:00 Equipment 7 00:12:00

[0140] In one possible implementation, determining the second target device from the first target devices may include: determining a third target device from the first target devices, wherein the third target device is a device that supports the second Bluetooth connection; and determining the second target device from the third target devices. The second target device may be the third target device with the longest idle time or the third target device with the lowest service priority.

[0141] It should be noted that the specific method by which the first electronic device determines the third target device from the first target device can be any method that can be conceived by those skilled in the art, and the embodiments of this application do not specifically limit this method.

[0142] For example, the first electronic device can determine whether the first target device supports the second Bluetooth connection based on parameters such as the model and brand of the first target device.

[0143] For example, the first electronic device can send a test signaling message to the first target device to test whether the device supports the second Bluetooth connection to determine whether the first target device supports the second Bluetooth connection.

[0144] Compared to existing technologies, when an electronic device has more than a certain number of devices connected via Bluetooth physical links, the Bluetooth physical links are all occupied, preventing the electronic device from establishing new Bluetooth connections. Therefore, the electronic device rejects subsequent Bluetooth connection requests and notifies the connection initiator of connection failure. However, in the Bluetooth connection method provided in this application, when the number of devices connected via Bluetooth physical links to the first electronic device exceeds a first threshold, upon receiving a Bluetooth connection request from the second electronic device, the first electronic device retains the Bluetooth service link of the second target device already connected via Bluetooth physical links and disconnects the Bluetooth physical link, thereby releasing the Bluetooth physical link available for the first and second electronic devices to establish a Bluetooth connection. The service state of the second target device remains synchronized, thus solving the problem that when the number of devices connected to an electronic device via Bluetooth reaches a certain number, other devices will no longer be able to interact with the electronic device via Bluetooth, improving the user experience.

[0145] S304. The first electronic device establishes a first Bluetooth connection with the second electronic device.

[0146] In one possible implementation, if a target service exists, the first electronic device sends a first instruction to the second target device. The target service is a Bluetooth service related to the second target device, and the first instruction instructs the second target device to establish a Bluetooth physical link connection with the first electronic device.

[0147] In another possible implementation, if a target service exists, the first electronic device can also send a second Bluetooth connection request to the second target device. This second Bluetooth request is used to request the establishment of a Bluetooth physical link.

[0148] like Figure 4 As shown in (a), the first Bluetooth connection includes a Bluetooth physical link connection and a Bluetooth service link connection. The device's upper-layer services can interact with the device's Bluetooth physical link port via the Bluetooth service link to exchange service data streams, and the device's Bluetooth physical link port can exchange service data streams with the Bluetooth physical link port of the peer device. For example... Figure 4As shown in (b), when the Bluetooth physical link connection between Device 1 and Device 2 is disconnected but the Bluetooth service link connection is maintained, the upper-layer services of Device 1 or Device 2 can still interact with the Bluetooth physical link port of this device through the Bluetooth service link because the Bluetooth service link connection is maintained. Therefore, after the first electronic device converts the first Bluetooth connection with the second target device into a second Bluetooth connection, the upper-layer services of the first electronic device can still interact with the target service (i.e., the service data stream of the Bluetooth service related to the second target device) with the Bluetooth physical link port of the first electronic device through the Bluetooth service link. The first electronic device can determine whether the target service exists through the Bluetooth physical link port of the first electronic device. If the target service exists, a Bluetooth physical link needs to be established to transmit the data stream of the target service. Therefore, when the target service exists, the first electronic device sends a first instruction to the second target device to instruct the second target device to establish a Bluetooth physical link connection with the first electronic device, instructing the second target device to send a first Bluetooth request to the first electronic device to establish a first Bluetooth connection between the first electronic device and the second target device. Of course, when the target service exists, the first electronic device can also directly send a first Bluetooth request to the second target device to establish a first Bluetooth connection between the first electronic device and the second target device.

[0149] It should be noted that the specific method by which the first electronic device sends the first instruction to the second target device can be any method that can be conceived by those skilled in the art, and the embodiments of this application do not specifically limit this.

[0150] For example, in the presence of a target service, the first electronic device can send a first instruction to the second target device via BLE broadcast to instruct the second target device to establish a Bluetooth physical link connection with the first electronic device, and instruct the second target device to send a first Bluetooth request to the first electronic device to establish a first Bluetooth connection between the first electronic device and the second target device.

[0151] Understandably, the second target device can also determine whether a target service exists through its Bluetooth physical link port. If a target service exists, it can send a second instruction to the first electronic device to instruct the first electronic device to establish a Bluetooth physical link connection with the second target device. This instruction instructs the first electronic device to send a first Bluetooth request to establish a first Bluetooth connection between the first electronic device and the second target device. Alternatively, if a target service exists, the second target device can also directly send a first Bluetooth request to the first electronic device to establish a first Bluetooth connection between the first electronic device and the second target device.

[0152] When using a mobile phone, users often connect to other devices via Bluetooth. However, when the number of devices connected to the phone via Bluetooth reaches a certain level, multiple devices may compete for the phone's Bluetooth link, preventing other devices from interacting with the phone via Bluetooth. For example, if the phone is connected to seven devices via Bluetooth, when the user tries to connect other devices to the phone via Bluetooth, the other devices' screens may display messages such as "Unable to join connection," "Unable to connect to device," or "Connection failed," or the phone may appear as unconnectable in the other devices' Bluetooth lists. Therefore, this application provides an alternative Bluetooth connection method that solves the problem of other devices being unable to interact with the electronic device via Bluetooth when the number of devices connected to the electronic device via Bluetooth reaches a certain level.

[0153] The following describes in detail another Bluetooth connection method provided by the embodiments of this application with reference to the accompanying drawings, such as... Figure 5 As shown, another Bluetooth connection method provided in this application embodiment includes:

[0154] S501, The first electronic device receives the first Bluetooth request sent by the second electronic device.

[0155] The first connection request is used to request the establishment of a first Bluetooth connection. The first Bluetooth connection includes a Bluetooth physical link connection and a Bluetooth service link connection.

[0156] For example, if a user wants to connect to the air conditioner via Bluetooth on their mobile phone (a second electronic device) to adjust the air conditioner's temperature, the user sends a first Bluetooth request to the air conditioner by operating the mobile phone, and the air conditioner receives the first Bluetooth request accordingly.

[0157] Optionally, the first connection request may include a first sub-connection request and a second sub-connection request. The first sub-connection request is used to request the establishment of a Bluetooth physical link connection, and the second sub-connection request is used to request the establishment of a Bluetooth service link connection. For example, the first electronic device may first receive the first sub-connection request sent by the second electronic device, and then receive the second sub-connection request sent by the second electronic device.

[0158] S502. Does the first electronic device determine whether the number of the first target devices is greater than the first threshold? If yes, then execute S503; if no, then execute S504.

[0159] The first target device is the device that establishes a first Bluetooth connection with the first electronic device.

[0160] Optionally, the first threshold can be 6.

[0161] It should be noted that the number of Bluetooth physical links of the first electronic device is limited, and establishing the first Bluetooth connection with the first electronic device requires occupying the Bluetooth physical links of the first electronic device. Therefore, when the first electronic device receives the first connection request, it needs to determine whether there are any idle (unoccupied) Bluetooth physical links available for establishing the first Bluetooth connection by using the relationship between the number of the first target devices and the size of the first threshold.

[0162] In the absence of an idle Bluetooth physical link (i.e., the number of first target devices exceeds a first threshold), the second target device is instructed to connect to a fourth target device that has already established a first Bluetooth connection with the first electronic device. This allows the second target device to establish a first Bluetooth connection with the first electronic device via the fourth target device acting as a relay proxy. In this way, the second electronic device and the fourth target device share a single Bluetooth physical link to establish the first Bluetooth connection with the first electronic device, eliminating the need for an additional Bluetooth physical link. A single Bluetooth physical link can allow multiple devices to connect to the first electronic device via Bluetooth. This solves the problem that when the number of devices connected to an electronic device via Bluetooth reaches a certain threshold, other devices will no longer be able to interact with the electronic device via Bluetooth, thus improving the user experience.

[0163] When an idle Bluetooth physical link exists (i.e., the number of first target devices is not greater than the first threshold), the first electronic device establishes a first Bluetooth connection with the second electronic device through the idle Bluetooth physical link.

[0164] For example, the first electronic device can determine whether the number of the first target devices is greater than 6 through the protocol stack. If yes, it executes S503; otherwise, it executes S504. That is, the first electronic device executes S503 when the number of the first target devices is 0, 1, 2, 3, 4, 5, or 6, and executes S504 when the number of the first target devices is any other value.

[0165] In one possible implementation, the first device can also determine whether the number of connectable devices is less than a second threshold. If so, S503 is executed; otherwise, S504 is executed.

[0166] For example, the first electronic device can determine whether the number of connectable devices is less than 1 through the protocol stack. If yes, it executes S503; if no, it executes S504. That is, the first electronic device executes S503 when the number of connectable devices is 0, and executes S504 when the number of connectable devices is not 0.

[0167] In one possible implementation, the first electronic device can determine whether the current number of available channels (i.e., the current number of available physical channels or the current number of idle channels) is 0. If yes, then execute S503; otherwise, execute S50.

[0168] In another possible implementation, the first electronic device can also determine whether the number of currently occupied channels is greater than the fourth threshold. If yes, then execute S503; otherwise, execute S504. The fourth threshold can be 6.

[0169] S503, the first electronic device sends a second instruction to the second electronic device to instruct the second electronic device to establish a first Bluetooth connection with the first electronic device through the fourth target device in the first target device.

[0170] In one possible implementation, the first electronic device sending a second instruction to the second electronic device may include: the first electronic device first determining a fourth target device from the first target device, and then sending the second instruction to the second electronic device.

[0171] It should be noted that the specific method by which the first electronic device first determines the fourth target device from the first target device can be any method that can be conceived by those skilled in the art, and the embodiments of this application do not specifically limit this.

[0172] For example, the first electronic device can first obtain the number of connected devices (the number of devices connected via Bluetooth) of each first target device, and then determine the device with the fewest connected devices among the first target devices as the fourth target device.

[0173] For example, the first electronic device can obtain the number of connected devices for each first target device by sending an acquisition command to each first target device. Then, it can obtain a first target device information table as shown in Table 2 according to the order of the number of connected devices of the first target devices in ascending order. After that, the first target device (i.e., device 4) with the number of connected devices in Table 2 is determined as the fourth target device. Of course, the first electronic device can also determine any first target device with a number of connected devices less than a first threshold as the fourth target device.

[0174] Table 2

[0175] Device (MAC) Channel identifier Business (UUID) Number of connected devices Equipment 4 A_B Business 1 0 Equipment 2 DLC Business (UUID) 2 Equipment 1 DLC Business (UUID) 3 Equipment 3 DLC Business (UUID) 3 Equipment 5 DLC Business (UUID) 4 Equipment 6 DLC Business (UUID) 5 Equipment 7 DLC Business (UUID) 6

[0176] Optionally, the acquisition indicator used to obtain the number of connected devices can be a hiecho command. Table 3 shows the format of the hiecho command. As shown in Table 3, the command id field of the hiecho command can be used to add and define the command type, and the payload field of the hiecho command can be used to store data.

[0177] Table 3

[0178] header service id command id payload mic

[0179] In one possible implementation, the first electronic device may also send a third instruction to the fourth target device to instruct the fourth target device to establish a first Bluetooth connection with the second electronic device as a relay agent.

[0180] Compared to existing technologies, when an electronic device has more than a certain number of devices connected via a Bluetooth physical link, the link is often occupied, preventing the device from establishing new Bluetooth connections. Consequently, the device rejects subsequent Bluetooth connection requests and notifies the connection initiator of connection failure. However, in the Bluetooth connection method provided in this application, when the number of devices connected via a Bluetooth physical link to the first electronic device exceeds a first threshold, upon receiving a Bluetooth connection request from the second electronic device, the first electronic device instructs the second target device to connect to a fourth target device that has already established a first Bluetooth connection with the first electronic device. This allows the second target device to establish a first Bluetooth connection with the first electronic device via the fourth target device acting as a relay proxy. In this way, the second electronic device and the fourth target device share a single Bluetooth physical link to establish the first Bluetooth connection, eliminating the need for an additional Bluetooth physical link. One Bluetooth physical link can be used by multiple devices to connect to the first electronic device via Bluetooth, thus solving the problem that when the number of devices connected to an electronic device via Bluetooth reaches a certain threshold, other devices will no longer be able to interact with the electronic device via Bluetooth, improving the user experience.

[0181] It should be noted that the Bluetooth protocol supports different service interactions through different DLCs on the same Bluetooth physical link. Therefore, the second electronic device and the fourth target device can use the same Bluetooth physical link to interact with the first electronic device through different DLCs.

[0182] For example, when a first electronic device sends a service data stream to a second electronic device, the first electronic device can obtain information about the connected devices of each first target device, and then obtain a connected device information table as shown in Table 4. Based on the connected device information table, the first electronic device determines that the DLC used by the second electronic device is B_4, and then sends a service data stream with DLC B_4 to a fourth target device. After receiving the service data stream, the fourth target device looks up Table 4 based on the DLC of the service data stream or the MAC and DLC of the service data stream to determine that the DLC of the data stream is not A_B used for the interaction between the first electronic device and the fourth target device, but B_4 used by the first electronic device and the second electronic device. Then, the fourth target device transmits the data stream to the second electronic device through the Bluetooth physical link between the fourth target device and the second electronic device.

[0183] Table 4

[0184]

[0185] It is understandable that after receiving the service data stream sent by the fourth target device, the first electronic device can also determine the sender of the data stream by looking up table 4 using the DLC of the service data stream or the MAC and DLC of the service data stream.

[0186] When using a mobile phone, users often connect to other devices via Bluetooth. However, when the number of devices connected to the phone via Bluetooth reaches a certain number, multiple devices may compete for the phone's Bluetooth link, preventing other devices from interacting with the phone via Bluetooth. For example, if the phone is connected to seven devices via Bluetooth, when the user tries to connect other devices to the phone via Bluetooth, the other devices' screens may display messages such as "Unable to join connection," "Unable to connect to device," or "Connection failed," or the phone may appear as unconnectable in the other devices' Bluetooth lists. Therefore, this application provides another Bluetooth connection method that solves the problem of other devices being unable to interact with the electronic device via Bluetooth when the number of devices connected to the electronic device via Bluetooth reaches a certain number.

[0187] The following describes in detail, with reference to the accompanying drawings, another Bluetooth connection method provided in the embodiments of this application, such as... Figure 6 As shown, another Bluetooth connection method provided in this application embodiment includes:

[0188] S601, The first electronic device receives a first Bluetooth request sent by the second electronic device.

[0189] The first connection request is used to request the establishment of a first Bluetooth connection. The first Bluetooth connection includes a Bluetooth physical link connection and a Bluetooth service link connection.

[0190] Optionally, the first connection request may include a first sub-connection request and a second sub-connection request. The first sub-connection request is used to request the establishment of a Bluetooth physical link connection, and the second sub-connection request is used to request the establishment of a Bluetooth service link connection. For example, the first electronic device may first receive the first sub-connection request sent by the second electronic device, and then receive the second sub-connection request sent by the second electronic device.

[0191] S602. Does the first electronic device determine whether the number of the first target devices is greater than the first threshold? If yes, then execute S603; if no, then execute S605.

[0192] S603. The first electronic device determines whether the idle time of the first target device is less than the third threshold. If yes, then execute S606; otherwise, execute S604.

[0193] It should be noted that the frequency of service interactions between the first target device and the first electronic device can be determined by the relationship between the idle time of the first target device and the third threshold. When the idle time of each first target device is less than the third threshold, it indicates that each first target device and the first electronic device frequently engage in service interactions. In this case, if S604 is executed to convert the first Bluetooth connection of a certain first target device to a second Bluetooth connection, it will affect the service interactions between that first target device and the first electronic device. However, executing S606 to select a certain first target device as a relay agent can establish a first Bluetooth connection between the first electronic device and the second electronic device without affecting the service interactions between the first target device and the first electronic device.

[0194] If the idle time of the first target device is not less than the third threshold, it indicates that there is a first target device that does not frequently interact with the first electronic device. By executing S604, the first Bluetooth connection of the first target device can be converted to the second Bluetooth connection to release the Bluetooth physical connection occupied by the first target device for the first electronic device and the second electronic device to establish the first Bluetooth connection.

[0195] It is understood that, in the case of whether the number of the first target devices is greater than the first threshold, the first electronic device may also determine whether to execute S604 or 606 through other judgment conditions, and this application embodiment does not limit this.

[0196] For example, the first electronic device can determine whether to execute S604 or S606 based on the priority of the second electronic device. When the priority of the second electronic device is higher (i.e., greater than the priority threshold), executing S604 enables the second electronic device to establish a first Bluetooth connection with the first electronic device through a separate Bluetooth physical link. When the priority of the second electronic device is lower (i.e., less than the priority threshold), executing S606 enables the second electronic device to share the Bluetooth physical link with the fourth target device to establish a first Bluetooth connection with the first electronic device.

[0197] For example, the first electronic device can score the second electronic device based on information such as device type, number of connections, service type, and service priority. When the score is higher than a threshold, S604 is executed to enable the second electronic device to establish a first Bluetooth connection with the first electronic device through a separate Bluetooth physical link. When the score is lower than the threshold, S606 is executed to enable the second electronic device to share a Bluetooth physical link with the fourth target device to establish a first Bluetooth connection with the first electronic device.

[0198] S604, the first electronic device converts the first Bluetooth connection with the second target device in the first target device into a second Bluetooth connection.

[0199] S605, The first electronic device establishes a first Bluetooth connection with the second electronic device.

[0200] S606, The first electronic device sends a second instruction to the second electronic device to instruct the second electronic device to establish a first Bluetooth connection with the first electronic device through the fourth target device in the first target device.

[0201] In one possible implementation, after the second electronic device establishes a first Bluetooth connection with the first electronic device through the fourth target device in the first target device, the first electronic device may also send a fourth instruction to the second electronic device to instruct the second electronic device to disconnect from the fourth target device and send a first Bluetooth connection request to the first electronic device if the number of connected devices is less than a first threshold or the number of connectable devices is greater than a second threshold.

[0202] Understandably, when a usable Bluetooth physical link exists for the first electronic device, switching the connection method between the second electronic device and the first electronic device from a relay proxy connection to a direct connection can reduce the communication latency between the first and second electronic devices, improve the communication speed between the first and second electronic devices, and thus further enhance the user experience.

[0203] In another possible implementation, after the second electronic device establishes a first Bluetooth connection with the first electronic device through the fourth target device in the first target device, the first electronic device may also disconnect the first Bluetooth connection with the fourth target device and instruct the second electronic device to establish a first Bluetooth connection with the first electronic device or instruct the second electronic device to send a first Bluetooth connection request to the first electronic device if the current battery level of the fourth target device is less than a fifth threshold.

[0204] Understandably, when the fourth target device has insufficient power, the first electronic device instructs the second electronic device to no longer connect to the first electronic device through the fourth target device but to connect directly to the first electronic device. This avoids the second electronic device, which has established a first Bluetooth connection with the first electronic device through the fourth target device, from disconnecting when the fourth target device shuts down due to insufficient power, thus interrupting the Bluetooth connection between the first and second electronic devices and further improving the user experience.

[0205] In another possible implementation, after the fourth target device disconnects from the first electronic device due to its current battery level being less than the fifth threshold, the fourth target device starts charging. When the current battery level of the fourth target device is greater than the fifth threshold, the first electronic device can disconnect from the first Bluetooth connection with the second electronic device and instruct the fourth target device to establish a first Bluetooth connection with the first electronic device or instruct the fourth target device to send a first Bluetooth connection request to the first electronic device. Then, it sends a second instruction to the second electronic device to instruct the second electronic device to establish a first Bluetooth connection with the first electronic device through the fourth target device in the first target device.

[0206] In one possible implementation, the first electronic device can further identify the connected device based on the connection status of the fifth target device. The fifth target device is a device that has established a first Bluetooth connection or a second Bluetooth connection with the first electronic device, and different connection statuses correspond to different identifiers for the fifth target device.

[0207] Optionally, the aforementioned identifier may include at least one of text, color, or icon.

[0208] It should be noted that the specific method for identifying the connected device based on the connection status of the fifth target device can be any method that can be conceived by those skilled in the art, and the embodiments of this application do not specifically limit this.

[0209] For example, a device that establishes a first Bluetooth connection directly with the first electronic device can be identified by the text label of Bluetooth connection; a device that establishes a second Bluetooth connection with the first electronic device can be identified by the text label of virtual Bluetooth connection; and a device that establishes a first Bluetooth connection with the first electronic device through other devices can be identified by the text label of relay Bluetooth connection or proxy Bluetooth connection.

[0210] For example, a device that directly establishes a first Bluetooth connection with the first electronic device can be identified in blue, a device that establishes a second Bluetooth connection with the first electronic device can be identified in gray, and a device that establishes a first Bluetooth connection with the first electronic device through other devices can be identified in white.

[0211] For example, electronic devices 1 to 7 directly establish a first Bluetooth connection with the first electronic device, electronic device 8 establishes a second Bluetooth connection with the first electronic device, and electronic device 9 establishes a first Bluetooth connection with the first electronic device through electronic device 5. Figure 7 Figure (a) shows the first electronic device in the Bluetooth device list, such as Figure 7 In the Bluetooth device list shown in Figure (a), electronic devices 1 to 7 are identified by the text indicating Bluetooth connection, electronic device 8 is identified by the text indicating virtual Bluetooth connection, and electronic device 9 is identified by the text indicating relay connection.

[0212] For example, electronic devices 1 to 7 directly establish a first Bluetooth connection with the first electronic device, electronic device 8 establishes a second Bluetooth connection with the first electronic device, and electronic device 9 establishes a first Bluetooth connection with the first electronic device through electronic device 5. Figure 7 Figure (b) shows the first electronic device in the Bluetooth device list, as shown below. Figure 7 In the Bluetooth device list shown in Figure (b), electronic devices 1 to 7 are marked in white, electronic device 8 is marked in gray, and electronic device 9 is marked in black.

[0213] Understandably, identifying connected devices by their connection status allows users to quickly ascertain the connection status of connected devices, facilitating subsequent operations and thus further enhancing the user experience.

[0214] The following will combine Figure 8 and Figure 9 An electronic device for performing the Bluetooth connection method described above is introduced.

[0215] It is understood that, in order to achieve the above-mentioned functions, electronic devices include hardware and / or software modules that perform the respective functions. Based on the algorithmic steps of the examples described in the embodiments disclosed herein, this application can be implemented in hardware or a combination of hardware and computer software. Whether a function is executed by hardware or by computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application in conjunction with the embodiments, but such implementation should not be considered beyond the scope of this application.

[0216] This application embodiment can divide the electronic device into functional modules according to the above method example. For example, each function can be divided into its own functional module, or two or more functions can be integrated into one processing module. The integrated module can be implemented in hardware. It should be noted that the module division in this embodiment is illustrative and only represents one logical functional division. In actual implementation, there may be other division methods.

[0217] When dividing each function into modules according to its corresponding function. Figure 8 A schematic diagram of a possible composition of the electronic device involved in the above embodiments is shown, such as... Figure 8 As shown, the device 800 may include a transceiver unit 801 and a processing unit 802, which can implement the methods performed by the electronic device in the above method embodiments, and / or other processes used in the technology described herein.

[0218] It should be noted that all relevant content of each step involved in the above method embodiments can be referenced from the functional description of the corresponding functional module, and will not be repeated here.

[0219] When using integrated units, device 800 may include a processing unit, a storage unit, and a communication unit. The processing unit can be used to control and manage the operation of device 800, for example, to support device 800 in executing the steps performed by the aforementioned units. The storage unit can be used to support device 800 in executing stored program code and / or data. The communication unit can be used to support communication between device 800 and other devices.

[0220] The processing unit can be a processor or a controller. It can implement or execute various exemplary logic blocks, modules, and circuits described in conjunction with the disclosure of this application. The processor can also be a combination of functions, such as a combination of one or more microprocessors, a combination of digital signal processing (DSP) and a microprocessor, etc. The storage unit can be a memory. The communication unit can specifically be a radio frequency circuit, a Bluetooth chip, a Wi-Fi chip, or other devices that interact with other electronic devices.

[0221] In one possible implementation, the electronic device involved in the embodiments of this application can be a device having Figure 9 The apparatus 900 shown includes a processor 901 and a transceiver 902. Figure 8 The functions implemented by the transceiver unit 801 and the processing unit 802 can be implemented by the processor 901.

[0222] Optionally, the device 900 may also include a memory 903, and the processor 901 and the memory 903 communicate with each other through an internal connection path. Figure 8 The relevant functions implemented by the storage unit in the memory can be implemented by the memory 903.

[0223] This application also provides a computer storage medium storing computer instructions. When the computer instructions are executed on an electronic device, the electronic device performs the aforementioned method steps to implement the Bluetooth connection method in the above embodiments.

[0224] This application also provides a computer program product that, when run on a computer, causes the computer to perform the aforementioned steps to implement the Bluetooth connection method described in the above embodiments.

[0225] This application also provides an electronic device, which may specifically be a chip, integrated circuit, component, or module. Specifically, the device may include a connected processor and a memory for storing instructions, or the device may include at least one processor for fetching instructions from external memory. When the device is running, the processor can execute instructions to cause the chip to perform the Bluetooth connection methods described in the above method embodiments.

[0226] Figure 10 A schematic diagram of a chip 1000 is shown. The chip 1000 includes one or more processors 1001 and interface circuits 1002. Optionally, the chip 1000 may also include a bus 1003.

[0227] The processor 1001 may be an integrated circuit chip with signal processing capabilities. In implementation, each step of the Bluetooth connection method described above can be completed through integrated logic circuits in the processor 1001 or through software instructions.

[0228] Optionally, the processor 1001 described above may be a general-purpose processor, a digital signal processing (DSP) processor, an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the various methods and steps disclosed in the embodiments of this application. The general-purpose processor may be a microprocessor or any conventional processor.

[0229] The interface circuit 1002 can be used to send or receive data, instructions or information. The processor 1001 can use the data, instructions or other information received by the interface circuit 1002 to process the data, instructions or other information, and can send the processed information out through the interface circuit 1002.

[0230] Optionally, the chip may also include memory, which may include read-only memory and random access memory, and provide operation instructions and data to the processor. A portion of the memory may also include non-volatile random access memory (NVRAM).

[0231] Optionally, the memory stores executable software modules or data structures, and the processor can execute corresponding operations by calling the operation instructions stored in the memory (which may be stored in the operating system).

[0232] Optionally, the chip can be used in the electronic device or DOP involved in the embodiments of this application. Optionally, the interface circuit 1002 can be used to output the execution result of the processor 1001. For details regarding the Bluetooth connection method provided by one or more embodiments of this application, please refer to the foregoing embodiments, which will not be repeated here.

[0233] It should be noted that the functions of the processor 1001 and the interface circuit 1002 can be implemented through hardware design, software design, or a combination of hardware and software; no restrictions are imposed here.

[0234] In this embodiment, the electronic device, computer storage medium, computer program product or chip are all used to execute the corresponding method provided above. Therefore, the beneficial effects that can be achieved can be referred to the beneficial effects of the corresponding method provided above, and will not be repeated here.

[0235] It should be understood that in the various embodiments of this application, the order of the above-mentioned processes does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.

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

[0237] Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.

[0238] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of the units described above is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed between the units may be through some interfaces; the indirect coupling or communication connection between the apparatuses or units may be electrical, mechanical, or other forms.

[0239] The units described above as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0240] In addition, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.

[0241] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0242] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

Claims

1. A Bluetooth connection method, characterized by, The method comprises: The first electronic device receives a first Bluetooth connection request sent by a second electronic device, the first Bluetooth connection request being used to request to establish a first Bluetooth connection, the first Bluetooth connection comprising a Bluetooth physical link connection and a Bluetooth service link connection; When the number of first target devices is greater than a first threshold value, and the idle time of the first target devices is not all less than a third threshold value, the first electronic device performs a first operation, the first operation comprising converting the first Bluetooth connection with a second target device into a second Bluetooth connection and establishing a first Bluetooth connection with the second electronic device, the first target device being a device that establishes a first Bluetooth connection with the first electronic device, the first target device comprising the second target device, the second Bluetooth connection comprising a Bluetooth service link connection; When the number of first target devices is greater than the first threshold value, and the idle time of the first target devices is all less than the third threshold value, the first electronic device sends a second indication to the second electronic device and a third indication to a fourth target device, the second indication being used to instruct the second electronic device to establish a first Bluetooth connection with the first electronic device through the fourth target device, the first target device comprising the fourth target device, and the third indication being used to instruct the fourth target device to establish a first Bluetooth connection with the second electronic device.

2. The method of claim 1, wherein, The method further comprises: When the number of connectable devices is less than a second threshold value, the first electronic device performs the first operation.

3. The method of claim 1, wherein, The conversion of the first Bluetooth connection with the second target device into the second Bluetooth connection comprises: Determining the second target device from the first target devices; Disconnecting the Bluetooth physical link connection with the second target device.

4. The method of claim 1, wherein, The conversion of the first Bluetooth connection with the second target device into the second Bluetooth connection comprises: Determining the second target device from the first target devices; Disconnecting the Bluetooth physical link connection with the second target device and retaining the Bluetooth physical link with the second target device.

5. The method according to claim 3 or 4, characterized in that, The second target device is a first target device with the longest idle time among the first target devices or a first target device with the lowest service priority among the first target devices, and the idle time is a time length between a time of last Bluetooth service interaction with the first electronic device and a current time.

6. The method according to claim 3 or 4, characterized in that, The determination of the second target device from the first target devices comprises: Determining a third target device from the first target devices, the third target device being a device supporting the second Bluetooth connection; Determining the second target device from the third target devices, the second target device being a third target device with the longest idle time among the third target devices or a third target device with the lowest service priority among the third target devices, and the idle time being a time length between a time of last Bluetooth service interaction with the first electronic device and a current time.

7. The method according to any one of claims 1 to 4, characterized in that, After the conversion of the first Bluetooth connection with the second target device into the second Bluetooth connection, the method further comprises: When there is target service, a first indication is sent to the second target device, the target service is a Bluetooth service related to the second target device, and the first indication is used to instruct the second target device to establish a Bluetooth physical link connection with the first electronic device.

8. The method according to any one of claims 1 to 4, characterized in that, After the first Bluetooth connection between the second target device is converted into the second Bluetooth connection, the method further includes: When there is target service, a second Bluetooth connection request is sent to the second target device, and the second Bluetooth request is used to request to establish a Bluetooth physical link.

9. The method of claim 1, wherein, The fourth target device is a device with the least number of connected devices or the largest number of connectable devices among the first target devices.

10. The method according to any one of claims 1 to 4, 9, characterized in that, The method further includes: When the number of first target devices is less than a first threshold or the number of connectable devices is greater than a second threshold, a fourth indication is sent to the second electronic device, and the fourth indication is used to instruct the second electronic device to disconnect from the fourth target device and send a first Bluetooth connection request to the first electronic device.

11. The method according to any one of claims 1 to 4, 9, characterized in that, The method further includes: When the current power of the fourth target device is less than a fifth threshold, the first Bluetooth connection with the fourth target device is disconnected, and the second electronic device is instructed to send a first Bluetooth connection request to the first electronic device.

12. The method of claim 10, wherein, After the first Bluetooth connection with the fourth target device is disconnected, the method further includes: When the current power of the fourth target device is greater than the fifth threshold, the first Bluetooth connection with the second electronic device is disconnected, and the fourth target device is instructed to send a first Bluetooth connection request to the first electronic device.

13. The method according to any one of claims 1 to 4, 12, characterized in that, The method further includes: According to the connection state of the fifth target device, a connected device is identified, the fifth target device is a device that has established a first Bluetooth connection or a second Bluetooth connection with the first electronic device, and different connection states of the fifth target device correspond to different identifications.

14. The method of claim 13, wherein, The identification includes at least one of text, color, or icon.

15. An electronic device, comprising: A processing unit and a storage unit coupled to the processing unit are included, and the processing unit is used to: Receive a first Bluetooth connection request sent by a second electronic device, the first Bluetooth connection request is used to request to establish a first Bluetooth connection, and the first Bluetooth connection includes a Bluetooth physical link connection and a Bluetooth service link connection; When the number of first target devices is greater than a first threshold, and the idle time of the first target devices is not all less than a third threshold, a first operation is performed, the first operation includes converting the first Bluetooth connection between the second target device into a second Bluetooth connection and establishing a first Bluetooth connection with the second electronic device, the first target device is a device that establishes a first Bluetooth connection with the electronic device, the first target device includes the second target device, and the second Bluetooth connection includes a Bluetooth service link connection; when the first target device quantity is greater than the first threshold value and the idle time length of the first target device is less than the third threshold value, sending a second indication to the second electronic device and a third indication to a fourth target device, the second indication being used to instruct the second electronic device to establish a first Bluetooth connection with the electronic device through the fourth target device, the first target device including the fourth target device, and the third indication being used to instruct the fourth target device to establish a first Bluetooth connection with the second electronic device.

16. The electronic device of claim 15, wherein, The processing unit is further configured to: when the connectable device quantity is less than the second threshold value, performing the first operation.

17. The electronic device of claim 15, wherein, The processing unit is specifically configured to: determining the second target device from the first target device; disconnecting the Bluetooth physical link connection between the second target device.

18. The electronic device of claim 15, wherein, The processing unit is specifically configured to: determining the second target device from the first target device; disconnecting the Bluetooth physical link connection between the second target device and retaining the Bluetooth physical link connection between the second target device.

19. The electronic device of claim 17 or 18, wherein, The second target device is a first target device with the longest idle time length in the first target device or a first target device with the lowest service priority in the first target device, and the idle time length is a time length between a time when the electronic device last performs Bluetooth service interaction and a current time.

20. The electronic device of claim 17 or 18, wherein, The processing unit is specifically configured to: determining a third target device from the first target device, the third target device being a device supporting a second Bluetooth connection; determining the second target device from the third target device, the second target device being a third target device with the longest idle time length in the third target device or a third target device with the lowest service priority in the third target device, and the idle time length being a time length between a time when the electronic device last performs Bluetooth service interaction and a current time.

21. The electronic device of any of claims 15-18, wherein, After converting the first Bluetooth connection with the second target device into the second Bluetooth connection, the processing unit is further configured to: when there is a target service, sending a first indication to the second target device, the target service being a Bluetooth service related to the second target device, and the first indication being used to instruct the second target device to establish a Bluetooth physical link connection with the electronic device.

22. The electronic device of any of claims 15-18, wherein, After converting the first Bluetooth connection with the second target device into the second Bluetooth connection, the processing unit is further configured to: when there is a target service, sending a second Bluetooth connection request to the second target device, the second Bluetooth request being used to request establishing a Bluetooth physical link.

23. The electronic device of any of claims 15-18, wherein, The fourth target device is a device with the least connected device quantity or the most connectable device quantity in the first target device.

24. The electronic device of any of claims 15-18, wherein, The processing unit is further configured to: when the first target device quantity is less than the first threshold value or the connectable device quantity is greater than the second threshold value, sending a fourth indication to the second electronic device, the fourth indication being used to instruct the second electronic device to disconnect from the fourth target device and send a first Bluetooth connection request to the electronic device.

25. The electronic device of any of claims 15-18, wherein, The processing unit is further configured to: When the fourth target device has a current power less than a fifth threshold, disconnecting the first Bluetooth connection with the fourth target device and instructing the second electronic device to send a first Bluetooth connection request to the electronic device.

26. The electronic device of claim 25, wherein, After disconnecting the first Bluetooth connection with the fourth target device, the processing unit is further configured to: When the fourth target device has a current power greater than the fifth threshold, disconnecting the first Bluetooth connection with the second electronic device and instructing the fourth target device to send a first Bluetooth connection request to the electronic device.

27. The electronic device of any of claims 15-18, 26, wherein, The processing unit is further configured to identify a connected device according to a connection state of a fifth target device, the fifth target device being a device that has established a first Bluetooth connection or a second Bluetooth connection with the electronic device, and different connection states of the fifth target device corresponding to different identifications.

28. The electronic device of claim 27, wherein, The identification includes at least one of a word, a color, or an icon.

29. An electronic device comprising at least one processor and interface circuitry, the at least one processor and the interface circuitry coupled, characterized in that, The at least one processor executes programs or instructions stored in the memory, so that the electronic device implements the method of any one of claims 1-14.

30. A computer readable storage medium for storing a computer program, characterized in that, The computer program includes instructions for implementing the method of any one of claims 1-14.

31. A computer program product, the computer program product comprising instructions embodied therein, wherein When the instructions run on the computer or the processor, the computer or the processor implements the method of any one of claims 1-14.

Citation Information

Patent Citations

  • Bluetooth connection method, device and system

    CN113225693A

  • In-vehicle device, system for vehicle, and method for managing terminal connection

    US20210264691A1