CN115884142A - Bluetooth connection method and electronic equipment - Google Patents

Bluetooth connection method and electronic equipment Download PDF

Info

Publication number
CN115884142A
CN115884142A CN202111157938.0A CN202111157938A CN115884142A CN 115884142 A CN115884142 A CN 115884142A CN 202111157938 A CN202111157938 A CN 202111157938A CN 115884142 A CN115884142 A CN 115884142A
Authority
CN
China
Prior art keywords
target
bluetooth
electronic device
bluetooth connection
connection
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202111157938.0A
Other languages
Chinese (zh)
Inventor
王文学
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Huawei Technologies Co Ltd
Original Assignee
Huawei Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to CN202111157938.0A priority Critical patent/CN115884142A/en
Publication of CN115884142A publication Critical patent/CN115884142A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Mobile Radio Communication Systems (AREA)

Abstract

The application discloses a Bluetooth connection method and electronic equipment, relates to the technical field of electronics, and can solve the problem that when the number of the electronic equipment connected through Bluetooth reaches a certain number, other equipment cannot perform data interaction with the electronic equipment through Bluetooth. The method comprises the following steps: first, a first electronic device receives a first Bluetooth connection request sent by a second electronic device, wherein the first connection request is used for requesting to establish a first Bluetooth connection, and the first Bluetooth connection comprises a Bluetooth physical link connection and a Bluetooth service link connection; and then when the number of the first target devices is larger than a first threshold value, the first electronic device executes a first operation, wherein the first operation comprises the steps of converting a first Bluetooth connection between the first target devices and a second target device in the first target devices into a second Bluetooth connection and establishing the first Bluetooth connection with the second electronic device, the first target device is a device for establishing the first Bluetooth connection with the first electronic device, and the second Bluetooth connection comprises a Bluetooth service link connection.

Description

Bluetooth connection method and electronic equipment
Technical Field
The present application relates to the field of electronic technologies, and in particular, to a bluetooth connection method and an electronic device.
Background
Bluetooth is a radio technology that supports short-range communication between devices. With the development of science and technology, more and more electronic devices with bluetooth function appear in people's daily life. In a full-scene intelligent connection scene, one electronic device may be connected to multiple devices via bluetooth.
However, when the number of devices connected to the electronic device through bluetooth reaches a certain number, a plurality of devices may seize the bluetooth link of the electronic device, so that other devices may no longer perform data interaction with the electronic device through bluetooth.
Disclosure of Invention
The application provides a Bluetooth connection method and electronic equipment, which can solve the problem that when the number of the electronic equipment connected through Bluetooth reaches a certain number, other equipment cannot perform data interaction with the electronic equipment through Bluetooth. In order to achieve the purpose, the technical scheme is as follows:
in a first aspect, the present application provides a bluetooth connection method, including: firstly, a first electronic device receives a first Bluetooth connection request sent by a second electronic device, wherein the first connection request is used for requesting to establish a first Bluetooth connection, and the first Bluetooth connection comprises 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 executes a first operation, where the first operation includes converting the first bluetooth connection with a second target device in the first target devices into a second bluetooth connection and establishing the first bluetooth connection with the second electronic device, the first target device is a device that establishes the first bluetooth connection with the first electronic device, and the second bluetooth connection includes a bluetooth service link connection.
Compared with the prior art, when the number of the devices connected through the bluetooth physical link is larger than a certain number, the electronic device cannot provide an idle bluetooth physical link to establish a new bluetooth connection because the bluetooth physical link is occupied, and therefore the electronic device rejects a subsequently received bluetooth connection request and notifies a connection initiator of connection failure. In the bluetooth connection method provided by the present application, when the number of devices connected through the bluetooth physical link is greater than the first threshold, and after subsequently receiving a bluetooth connection request sent by the second electronic device, the first electronic device reserves a bluetooth service link of the second target device connected through the bluetooth physical link and disconnects the bluetooth physical link, thereby releasing the bluetooth physical link through which the first electronic device and the second electronic device can establish a bluetooth connection. The service of the second target device keeps the state synchronization, so that the problem that when the number of the devices connected through the Bluetooth of the electronic device reaches a certain number, other devices cannot perform data interaction with the electronic device through the Bluetooth is solved, and the user experience is improved.
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.
In one possible implementation, the converting the first bluetooth connection with a second target device to 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.
In another possible implementation manner, the converting the first bluetooth connection with the second target device to a second bluetooth connection includes: determining the second target device from the first target device; disconnecting the Bluetooth physical link with the second target device and reserving the Bluetooth physical link with the second target device.
Optionally, the second target device is a first target device with the longest idle duration in the first target device or a first target device with the lowest service priority in the first target device, and the idle duration is a duration between a time when bluetooth service interaction is performed with the first electronic device last time and a current time.
In one possible implementation, the determining the second target device from the first target device includes: determining a third target device from the first target device, wherein the third target device is a device supporting a second Bluetooth connection; and determining the second target equipment from the third target equipment, wherein the second target equipment is the third target equipment with the longest idle time length in the third target equipment or the third target equipment with the lowest service priority in the third target equipment, and the idle time length is the time length between the time of performing the bluetooth service interaction with the first electronic equipment last time and the current time.
In one possible implementation, after converting the first bluetooth connection with a second target device to a second bluetooth connection, the method further comprises: when a target service exists, sending a first indication to the second target device, where the target service is a bluetooth service related to the second target device, and the first indication is used to indicate the second target device to establish a bluetooth physical link connection with the first electronic device.
In another possible implementation, after converting the first bluetooth connection with a second target device to a second bluetooth connection, the method further includes: and when the target service exists, sending a second Bluetooth connection request to the second target equipment, wherein the second Bluetooth request is used for requesting to establish a Bluetooth physical link.
In one possible implementation manner, when the first number of target devices is greater than a first threshold, the first electronic device performs a first operation, including: when the number of the first target devices is larger than the first threshold and the idle time of the first target devices is not smaller than a third threshold, the first electronic device executes the first operation; when the number of the first target devices is greater than the first threshold value and the idle time of the first target devices is less than the third threshold value, the first electronic device sends a second indication to the second electronic device, the second indication is used for indicating the second electronic device to establish a first bluetooth connection with the first electronic device through a fourth target device, and the first target device comprises the fourth target device.
It can be understood that the number of bluetooth physical links of the first electronic device is limited and the first bluetooth connection with the first electronic device needs to be established by occupying the bluetooth physical link of the first electronic device, so that the first electronic device needs to determine whether there is a currently idle (unoccupied) bluetooth physical link for establishing the first bluetooth connection according to the relationship between the number of the first target devices and the first threshold size when receiving the first connection request.
And under the condition that no idle Bluetooth physical link exists (namely the number of the first target devices is greater than a first threshold), the second target device is enabled to establish the first Bluetooth connection with the first electronic device by indicating the second target device to connect a fourth target device which has already established the first Bluetooth connection with the first electronic device, and the fourth target device is used as a relay agent. Therefore, the second electronic device and the fourth target device share one Bluetooth physical link to be connected with the first electronic device through the first Bluetooth, an additional Bluetooth physical link is not needed, a plurality of devices can be connected with the first electronic device through the Bluetooth through one Bluetooth physical link, the problem that when the number of the devices connected with the electronic device through the Bluetooth reaches a certain number, other devices cannot perform data interaction with the electronic device through the Bluetooth is solved, and user experience is improved.
In the presence of an idle bluetooth physical link (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 over the idle bluetooth physical link.
In one possible implementation, the method further includes: and when the number of the first target devices is greater than the first threshold value and the idle time of the first target devices is less than the third threshold value, the first electronic device sends a third indication to the fourth target device, wherein the third indication is used for indicating the fourth target device to establish a first Bluetooth connection with the second electronic device.
Optionally, the fourth target device is a device with the minimum number of connected devices or the maximum number of connected devices in the first target device.
In one possible implementation, the method further includes: and when the number of the first target devices is smaller than a first threshold value or the number of the connectable devices is larger than a second threshold value, sending a fourth indication to the second electronic device, wherein the fourth indication is used for indicating the second electronic device to be disconnected from the fourth target devices and sending a first Bluetooth connection request to the first electronic device.
It can be understood that, when the first electronic device has an available bluetooth physical link, switching the connection mode between the second electronic device and the first electronic device from relay proxy connection to direct connection may reduce communication delay between the first electronic device and the second electronic device, and improve communication speed between the first electronic device and the second electronic device, thereby further improving user experience.
In one possible implementation, the method further includes: and when the current electric quantity of the fourth target equipment is smaller than a fifth threshold value, disconnecting the first Bluetooth connection with the fourth target equipment and indicating the second electronic equipment to send a first Bluetooth connection request to the first electronic equipment.
It can be understood that, when the fourth target device is insufficient in power, the first electronic device indicates that the second electronic device is not connected with the first electronic device through the fourth target device, but directly connected with the first electronic device, thereby avoiding that the shutdown due to insufficient power of the fourth target device can cause the disconnection between the second electronic device and the first electronic device, which are connected through the first bluetooth established between the fourth target device and the first electronic device, and the bluetooth connection between the first electronic device and the second electronic device is interrupted, and further improving the user experience.
In one possible implementation, after disconnecting the first bluetooth connection with the fourth target device, the method further includes: and when the current electric quantity of the fourth target equipment is larger than a fifth threshold value, disconnecting the first Bluetooth connection with the second electronic equipment and indicating the fourth target equipment to send a first Bluetooth connection request to the first electronic equipment.
In one possible implementation, the method further includes: and identifying connected equipment according to the connection state of fifth target equipment, wherein the fifth target equipment is equipment which establishes a first Bluetooth connection or a second Bluetooth connection with the first electronic equipment, and the fifth target equipment in different connection states corresponds to different identifications.
Optionally, the identifier includes at least one of a text, a color, or an icon.
For example, the text identifier of the bluetooth connection may be used for a device directly establishing the first bluetooth connection with the first electronic device, the text identifier of the virtual bluetooth connection may be used for a device establishing the second bluetooth connection with the first electronic device, and the text identifier of the relay bluetooth connection or the proxy bluetooth connection may be used for a device establishing the first bluetooth connection with the first electronic device through another device.
It can be understood that, the connected device is identified by the connection state of the connected device, so that the user can quickly know the connection state of the connected device through the identification of the connected device to facilitate subsequent operations of the user, thereby further improving the user experience.
In a second aspect, the present application further provides an electronic device, which includes a processing unit and a storage unit coupled to the processing unit, wherein the processing unit is configured to: receiving a first Bluetooth connection request sent by second electronic equipment, wherein the first connection request is used for requesting to establish a first Bluetooth connection, and the first Bluetooth connection comprises a Bluetooth physical link connection and a Bluetooth service link connection; when the number of first target devices is larger than a first threshold value, executing a first operation, wherein the first operation comprises the steps of converting the first Bluetooth connection between the first target devices and second target devices into a second Bluetooth connection and establishing the first Bluetooth connection with the second electronic devices, the first target devices are devices establishing the first Bluetooth connection with the electronic devices, the first target devices comprise the second target devices, and the second Bluetooth connection comprises Bluetooth service link connection.
In one possible implementation, the processing unit is further configured to: when the number of connectable devices is less than a second threshold, the first operation is performed.
In a possible implementation manner, the processing unit is specifically configured to: determining the second target device from the first target device; and disconnecting the Bluetooth physical link connection with the second target device.
In another possible implementation manner, the processing unit is specifically configured to: determining the second target device from the first target device; disconnecting the Bluetooth physical link with the second target device and reserving the Bluetooth physical link with the second target device.
In a possible implementation manner, the processing unit is specifically configured to: determining a third target device from the first target device, wherein the third target device is a device supporting a second Bluetooth connection; and determining the second target equipment from the third target equipment, wherein the second target equipment is the third target equipment with the longest idle time length in the third target equipment or the third target equipment with the lowest service priority in the third target equipment, and the idle time length is the time length between the time of performing the bluetooth service interaction with the electronic equipment last time and the current time.
In one possible implementation, after the first bluetooth connection with the second target device is converted into a second bluetooth connection, the processing unit is further configured to: when a target service exists, sending a first indication to the second target device, where the target service is a bluetooth service related to the second target device, and the first indication is used to indicate the second target device to establish a bluetooth physical link connection with the electronic device.
In another possible implementation manner, after the first bluetooth connection with the second target device is converted into the second bluetooth connection, the processing unit is further configured to: and when the target service exists, sending a second Bluetooth connection request to the second target equipment, wherein the second Bluetooth request is used for requesting to establish a Bluetooth physical link.
In a possible implementation manner, the processing unit is specifically configured to: when the number of the first target devices is larger than the first threshold and the idle time of the first target devices is not smaller than a third threshold, executing the first operation; when the number of the first target devices is larger than the first threshold value and the idle time of the first target devices is smaller than the third threshold value, sending a second indication to the second electronic device, where the second indication is used to indicate that the second electronic device establishes a first bluetooth connection with the electronic device through a fourth target device, and the first target device includes the fourth target device.
In one possible implementation, the processing unit is further configured to: and when the number of the first target devices is greater than the first threshold value and the idle time of the first target devices is less than the third threshold value, sending a third indication to the fourth target device, wherein the third indication is used for indicating the fourth target device to establish a first Bluetooth connection with the second electronic device.
Optionally, the fourth target device is a device with the minimum number of connected devices or the maximum number of connected devices in the first target device.
In one possible implementation, the processing unit is further configured to: and when the number of the first target devices is smaller than a first threshold value or the number of the connectable devices is larger than a second threshold value, sending a fourth indication to the second electronic device, wherein the fourth indication is used for indicating that the second electronic device is disconnected from the fourth target devices and sending a first Bluetooth connection request to the electronic device.
In one possible implementation, the processing unit is further configured to: and when the current electric quantity of the fourth target equipment is smaller than a fifth threshold value, disconnecting the first Bluetooth connection with the fourth target equipment and indicating the second electronic equipment to send a first Bluetooth connection request to the electronic equipment.
In one possible implementation manner, after disconnecting the first bluetooth connection with the fourth target device, the processing unit is further configured to: and when the current electric quantity of the fourth target equipment is larger than a fifth threshold value, disconnecting the first Bluetooth connection with the second electronic equipment and indicating the fourth target equipment to send a first Bluetooth connection request to the electronic equipment.
In one possible implementation, the processing unit is further configured to: identifying connected equipment according to the connection state of fifth target equipment, wherein the fifth target equipment is equipment which establishes a first Bluetooth connection or a second Bluetooth connection with the first electronic equipment, and the fifth target equipment in different connection states corresponds to different identifications.
Optionally, the identifier includes at least one of a text, a color, or an icon.
In a third aspect, the present application further provides an electronic device, including: at least one processor configured to implement the method of the first aspect or any possible implementation thereof when the at least one processor executes program code or instructions.
Optionally, the electronic device may further comprise at least one memory for storing the program code or instructions.
In a fourth aspect, the present application further provides a chip, including: input interface, output interface, at least one processor. Optionally, the chip further comprises a memory. The at least one processor is configured to execute the 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 manner thereof.
Optionally, the chip may also be an integrated circuit.
In a fifth aspect, the present application further provides a terminal, where the terminal includes the electronic device or the chip.
In a sixth aspect, the present application further provides a computer-readable storage medium for storing a computer program comprising instructions for implementing the method described in the first aspect or any possible implementation manner thereof.
In a seventh aspect, the present application further provides a computer program product containing instructions which, when run on a computer, cause the computer to implement the method described in the above first aspect or any possible implementation manner thereof.
The electronic device, the computer storage medium, the computer program product, and the chip provided in this embodiment are all configured to execute the bluetooth connection method provided above, and therefore, the beneficial effects achieved by the electronic device, the computer storage medium, the computer program product, and the chip may refer to the beneficial effects in the bluetooth connection method provided above, and are not described herein again.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the description below are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings without creative efforts.
Fig. 1 is a schematic structural diagram of an electronic device according to an embodiment of the present disclosure;
fig. 2 is a schematic diagram of a software structure of an electronic device according to an embodiment of the present application;
fig. 3 is a schematic flowchart of a bluetooth connection method according to an embodiment of the present application;
FIG. 4 is a diagram illustrating a Bluetooth connection provided in an embodiment of the present application;
fig. 5 is a flowchart illustrating another bluetooth connection method according to an embodiment of the present application
Fig. 6 is a flowchart illustrating another bluetooth connection method according to an embodiment of the present application;
fig. 7 is a schematic interface diagram of an electronic device according to an embodiment of the present disclosure;
FIG. 8 is a schematic diagram of an apparatus according to an embodiment of the present disclosure;
FIG. 9 is a schematic structural diagram of another apparatus provided in an embodiment of the present application;
fig. 10 is a schematic structural diagram of a chip according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
The term "and/or" herein is merely an association describing an associated object, meaning that three relationships may exist, e.g., a and/or B, may mean: a exists alone, A and B exist simultaneously, and B exists alone.
The terms "first" and "second" and the like in the description and drawings of the present application are used for distinguishing different objects or for distinguishing different processes for the same object, and are not used for describing a specific order of the objects.
Furthermore, the terms "including" and "having," and any variations thereof, as referred to in the description of the present application, are intended to cover a non-exclusive inclusion. For example, a process, method, system, article, or apparatus that comprises a list of steps or elements is not limited to only those steps or elements recited, but may alternatively include other steps or elements not recited, or may alternatively include other steps or elements inherent to such process, method, article, or apparatus.
It should be noted that in the description of the embodiments, words such as "exemplary" or "for example" are used to indicate examples, illustrations or illustrations. Any embodiment or design described herein as "exemplary" or "such as" is not necessarily to be construed as preferred or advantageous over other embodiments or designs. Rather, use of the word "exemplary" or "such as" is intended to present concepts related in a concrete fashion.
In the description of the present application, the meaning of "a plurality" means two or more unless otherwise specified.
First, some terms in the present application are explained so as to be easily understood by those skilled in the art.
The bluetooth physical link is a data connection channel of a physical layer between bluetooth devices, and data streams can be transmitted between the bluetooth devices through the bluetooth physical link. Bluetooth physical links include, but are not limited to, bluetooth Low Energy (BLE) and classic Bluetooth Rate (BR).
The Bluetooth service link is a data connection channel between the Bluetooth devices and the internal service layer of the Bluetooth devices, and service data streams can be transmitted between the Bluetooth devices or in the Bluetooth devices through the Bluetooth service link. The bluetooth service link includes, but is not limited to, a bluetooth audio distribution profile (A2 DP), a bluetooth-free profile (HFP), a bluetooth-compliant profile (HSP), and an audio/video remote control profile (AVRCP).
The bluetooth connection method provided by the embodiment of the application can be applied to electronic devices such as a mobile phone, a tablet personal computer, a wearable device, a vehicle-mounted device, an Augmented Reality (AR)/Virtual Reality (VR) device, a notebook computer, an ultra-mobile personal computer (UMPC), a netbook, a Personal Digital Assistant (PDA), and the like, and the embodiment of the application does not limit the specific type of the electronic device at all.
Fig. 1 is a schematic structural diagram of an example of an electronic device 100 according to an embodiment of the present disclosure. The electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a Universal Serial Bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a key 190, a motor 191, an indicator 192, a camera 193, a display screen 194, a Subscriber Identity Module (SIM) card interface 195, and the like. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, and the like.
It is to be understood that the illustrated structure of the embodiment of the present application does not specifically limit the electronic device 100. In other embodiments of the present application, electronic device 100 may include more or fewer components than shown, or some components may be combined, some components may be split, or a different arrangement of components. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
Processor 110 may include one or more processing units, such as: the processor 110 may include an Application Processor (AP), a modem processor, a Graphics Processing Unit (GPU), an Image Signal Processor (ISP), a controller, a memory, a video codec, a Digital Signal Processor (DSP), a baseband processor, and/or a neural-Network Processing Unit (NPU), etc. The different processing units may be separate devices or may be integrated into one or more processors.
Wherein the controller may be a neural center and a command center of the electronic device 100. The controller can generate an operation control signal according to the instruction operation code and the timing signal to complete the control of instruction fetching and instruction execution.
A memory may also be provided in the processor 110 for storing instructions and data. In some embodiments, processor 110 may include one or more interfaces. The interface may include an integrated circuit (I2C) interface, an integrated circuit built-in audio (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.
The I2C interface is a bidirectional synchronous serial bus, and the processor 110 may be coupled to the touch sensor 180K through the I2C interface, so that the processor 110 and the touch sensor 180K communicate through the I2C bus interface, thereby implementing the touch function of the electronic device 100. The MIPI interface may be used to connect the processor 110 with peripheral devices such as the display screen 194, the camera 193, and the like. The MIPI interface includes a Camera Serial Interface (CSI), a Display Serial Interface (DSI), and the like. In some embodiments, processor 110 and camera 193 communicate through a CSI interface to implement the capture functionality of electronic device 100. The processor 110 and the display screen 194 communicate through the DSI interface to implement the display function of the electronic device 100.
It should be understood that the interface connection relationship between the modules illustrated in the embodiments of the present application is only an illustration, and does not limit the structure of the electronic device 100. In other embodiments of the present application, the electronic device 100 may also adopt different interface connection manners or a combination of multiple interface connection manners in the above embodiments.
The charging management module 140 is configured to receive a charging input from a charger. The charger may be a wireless charger or a wired charger. The power management module 141 is used to connect the battery 142, the charging management module 140 and the processor 110. The power management module 141 receives input from the battery 142 and/or the charge management module 140 and provides power to the processor 110, the internal memory 121, the external memory, the display 194, the camera 193, the wireless communication module 160, and the like.
The electronic device 100 implements display functions via the GPU, the display screen 194, and the application processor. The GPU is a microprocessor for image processing, and is connected to the display screen 194 and an application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 may include one or more GPUs that execute program instructions to generate or alter display information.
The display screen 194 is used to display images, video, and the like. The display screen 194 includes a display panel. The display panel may adopt a Liquid Crystal Display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (active-matrix organic light-emitting diode, AMOLED), a flexible light-emitting diode (FLED), a miniature, a Micro-oeld, a quantum dot light-emitting diode (QLED), and the like. In some embodiments, the electronic device 100 may include 1 or N display screens 194, N being a positive integer greater than 1.
The electronic device 100 may implement a photographing function through the ISP, the camera 193, the touch sensor, the video codec, the GPU, the display screen 194, and the application processor, etc.
The ISP is used for processing data fed back by the camera 193. For example, when a photo is taken, the shutter is opened, light is transmitted to the camera photosensitive element through the lens, the optical signal is converted into an electrical signal, and the camera photosensitive element transmits the electrical signal to the ISP for processing and converting into an image visible to naked eyes. The ISP can also carry out algorithm optimization on the noise, brightness and skin color of the image. The ISP can also optimize parameters such as exposure, color temperature and the like of a shooting scene. In some embodiments, the ISP may be provided in camera 193.
The camera 193 is used to capture still images or video. The object generates an optical image through the lens and projects the optical image to the photosensitive element. The photosensitive element may be a Charge Coupled Device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the optical signal into an electrical signal, and then transmits the electrical signal to the ISP to be converted into a digital image signal. And the ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into an image signal in a standard RGB format, a YUV format, and the like, and it should be understood that, in the description of the embodiment of the present application, an image in an RGB format is taken as an example for description, and the embodiment of the present application does not limit the format of the image. In some embodiments, electronic device 100 may include 1 or N cameras 193, N being a positive integer greater than 1.
The digital signal processor is used for processing digital signals, and can process digital image signals and other digital signals. For example, when the electronic device 100 selects a frequency bin, the digital signal processor is used to perform fourier transform or the like on the frequency bin energy.
Video codecs are used to compress or decompress digital video. The electronic device 100 may support one or more video codecs. In this way, the electronic device 100 may play or record video in a variety of encoding formats, such as: moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, MPEG4, and the like.
The external memory interface 120 may be used to connect an external memory card, such as a Micro SD card, to extend the storage capability of the electronic device 100. The internal memory 121 may be used to store computer-executable program code, which includes instructions. The processor 110 executes various functional applications of the electronic device 100 and data processing by executing instructions stored in the internal memory 121. The internal memory 121 may include a program storage area and a data storage area.
The electronic device 100 may implement audio functions via the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the headphone interface 170D, and the application processor. Such as music playing, recording, etc.
The pressure sensor 180A is used for sensing a pressure signal, and can convert the pressure signal into an electrical signal. The gyro sensor 180B may be used to determine the motion attitude of the electronic device 100. The air pressure sensor 180C is used to measure air pressure. The magnetic sensor 180D includes a hall sensor. The electronic device 100 may detect the opening and closing of the flip holster using the magnetic sensor 180D. The acceleration sensor 180E may detect the magnitude of acceleration of the electronic device 100 in various directions (typically three axes). A distance sensor 180F for measuring a distance. The electronic device 100 may measure the distance by infrared or laser. In some embodiments, taking a picture of a scene, electronic device 100 may utilize range sensor 180F to range for fast focus. The proximity light sensor 180G may include, for example, a Light Emitting Diode (LED) and a light detector, such as a photodiode. The ambient light sensor 180L is used to sense the ambient light level. Electronic device 100 may adaptively adjust the brightness of display screen 194 based on the perceived ambient light level. The ambient light sensor 180L may also be used to automatically adjust the white balance when taking a picture. The fingerprint sensor 180H is used to collect a fingerprint. The electronic device 100 can utilize the collected fingerprint characteristics to unlock the fingerprint, access the application lock, photograph the fingerprint, answer an incoming call with the fingerprint, and so on. The temperature sensor 180J is used to detect temperature. The touch sensor 180K is also referred to as a "touch panel". The touch sensor 180K may be disposed on the display screen 194, and the touch sensor 180K and the display screen 194 form a touch screen, which is also called a "touch screen". The touch sensor 180K is used to detect a touch operation acting thereon or nearby. The bone conduction sensor 180M may acquire a vibration signal. The audio module 170 may analyze a voice signal based on the vibration signal of the bone block vibrated by the sound part obtained by the bone conduction sensor 180M, so as to implement a voice function.
The keys 190 include a power-on key, a volume key, and the like. The keys 190 may be mechanical keys. Or may be touch keys. The electronic apparatus 100 may receive a key input, and generate a key signal input related to user setting and function control of the electronic apparatus 100. The motor 191 may generate a vibration cue. The motor 191 may be used for incoming call vibration prompts as well as for touch vibration feedback. For example, touch operations applied to different applications (e.g., photographing, audio playing, etc.) may correspond to different vibration feedback effects. The motor 191 may also respond to different vibration feedback effects for touch operations applied to different areas of the display screen 194. Indicator 192 may be an indicator light that may be used to indicate a state of charge, a change in charge, or a message, missed call, notification, etc. The SIM card interface 195 is used to connect a SIM card.
The software system of the electronic device 100 may employ a layered architecture, an event-driven architecture, a micro-core architecture, a micro-service architecture, or a cloud architecture. The embodiment of the present application takes an Android system with a layered architecture as an example, and exemplarily illustrates a software structure of the electronic device 100.
Fig. 2 is a block diagram of a software structure of the electronic device 100 according to the embodiment of the present application. The layered architecture divides the software into several layers, each layer having a clear role and division of labor. The layers communicate with each other through a software interface. In some embodiments, the Android system is divided into four layers, an application layer, an application framework layer, an Android runtime (Android runtime) and system library, and a kernel layer from top to bottom.
The application layer may include a series of application packages. As shown in FIG. 2, the application packages may include camera, photo album, music, settings, etc. applications.
The application framework layer provides an Application Programming Interface (API) and a programming framework for the application program of the application layer. The application framework layer includes a number of predefined functions. As shown in FIG. 2, the application framework layers may include a window manager, content provider, view system, resource manager, notification manager, and the like.
The window manager is used for managing window programs. The window manager can obtain the size of the display screen, judge whether a status bar exists, lock the screen, intercept the screen and the like.
Content providers are used to store and retrieve data and make it accessible to applications. The data may include video, images, audio, calls made and received, browsing history and bookmarks, phone books, etc.
The view system includes visual controls such as controls to display text, controls to display pictures, and the like. The view system may be used to build applications. The display interface may be composed of one or more views. For example, the display interface including the short message notification icon may include a view for displaying text and a view for displaying pictures.
The resource manager provides various resources for the application, such as localized strings, icons, pictures, layout files, video files, and the like.
The notification manager enables the application to display notification information in the status bar, which may be used to convey notification type messages, and the notification information displayed in the status bar may disappear automatically after a short dwell, such as a message alert to notify the user that the download is complete. The notification manager may also be a notification that appears in the form of a chart or scroll bar text at the top status bar of the system, such as a notification of a background running application, or a notification that appears on the screen in the form of a dialog window. For example, to prompt a text message in the status bar, or the notification manager may also sound a prompt such as a vibration of the electronic device, flashing of an indicator light, etc.
The Android runtime comprises a core library and a virtual machine. The Android runtime is responsible for scheduling and managing an Android system. The core library comprises two parts: one part is a function which needs to be called by java language, and the other part is a core library of android.
The application layer and the application framework layer run in a virtual machine. And executing java files of the application program layer and the application program framework layer into a binary file by the virtual machine. The virtual machine is used for performing the functions of object life cycle management, stack management, thread management, safety and exception management, garbage collection and the like.
The system library may include a plurality of functional modules. For example: surface managers (surface managers), media libraries (media libraries), three-dimensional graphics processing libraries (e.g., openGL ES), 2D graphics engines (e.g., SGL), and the like.
The surface manager is used to manage the display subsystem and provide fusion of 2D and 3D layers for multiple applications.
The media library supports a variety of commonly used audio, video format playback and recording, and still image files, among others. The media library may support a variety of audio-video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.
The three-dimensional graphic processing library is used for realizing three-dimensional graphic drawing, image rendering, synthesis, layer processing and the like. The 2D graphics engine is a drawing engine for 2D drawing.
The kernel layer is a layer between hardware and software. The kernel layer may include a hardware driver module, such as a display driver, a camera driver, a sensor driver, and the like, and the application framework layer may call the hardware driver module of the kernel layer.
For convenience of understanding, the following embodiments of the present application will describe a photographing process of an electronic device by taking the electronic device having the structure shown in fig. 1 and 2 as an example.
The technical solutions in the following embodiments may be implemented in the electronic device 100 having the hardware architecture and the software architecture described above.
When a user uses the mobile phone, the user can often connect other devices through the Bluetooth of the mobile phone. If the mobile phone is connected with the tablet personal computer for data transmission, the mobile phone remotely controls the intelligent household appliance through the Bluetooth, and the mobile phone is connected with the Bluetooth sound box through the Bluetooth to play music and the like. However, when the number of devices connected through bluetooth of the mobile phone reaches a certain number, multiple devices occupy the bluetooth link of the mobile phone, so that other devices cannot perform data interaction with the mobile phone through bluetooth. If the number of connected mobile phones through Bluetooth reaches 7, when a user operates other equipment to set up the mobile phone through Bluetooth, the screen of the other equipment displays text prompts that the equipment cannot be connected, cannot be connected or fails to be connected, or the mobile phone displays a non-connectable state in a Bluetooth list of the other equipment. Therefore, the embodiment of the application provides a bluetooth connection method, which can solve the problem that when the number of devices connected by the electronic device through bluetooth reaches a certain number, other devices cannot perform data interaction with the electronic device through bluetooth any more.
The following describes in detail a bluetooth connection method provided in an embodiment of the present application with reference to the accompanying drawings, as shown in fig. 3, the bluetooth connection method provided in the embodiment of the present application includes:
s301, the first electronic device receives a first Bluetooth request sent by the second electronic device.
Wherein the first connection request is for requesting establishment of a first bluetooth connection. The first bluetooth connection includes a bluetooth physical link connection and a bluetooth traffic link connection.
Illustratively, a user wants to listen to music played by a mobile phone (a first electronic device) through a bluetooth headset (a second electronic device), and the user sends a first bluetooth request to the mobile phone by operating the bluetooth headset, and accordingly the mobile phone receives the first bluetooth request sent by the bluetooth headset.
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 for requesting to establish Bluetooth physical link connection, and the second sub-connection request is used for requesting to establish Bluetooth service link connection. For example, the first electronic device may receive the first sub-connection request sent by the second electronic device first, and then receive the second sub-connection request sent by the second electronic device.
S302, the first electronic device determines whether the number of the first target devices is greater than a first threshold? If yes, executing S303; if not, go to step S304.
The first target device is a device which establishes a first Bluetooth connection with the first electronic device.
Alternatively, the first threshold may be 6.
It should be noted that, the number of bluetooth physical links of the first electronic device is limited, and the first bluetooth connection established with the first electronic device needs to occupy the bluetooth physical link of the first electronic device, so that the first electronic device needs to determine whether there is an idle (unoccupied) bluetooth physical link for establishing the first bluetooth connection according to the relationship between the number of the first target devices and the first threshold when receiving the first connection request.
In the absence of an idle bluetooth physical link (i.e., the number of first target devices is greater than the first threshold), a bluetooth physical link is released for the first electronic device to establish the first bluetooth connection with the second electronic device by converting the first bluetooth connection with the second target device in the first target devices into the second bluetooth connection.
In the presence of an idle bluetooth physical link (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 over the idle bluetooth physical link.
Exemplarily, the first electronic device may determine whether the number of the first target devices is greater than 6 by the protocol stack? If yes, executing S303; if not, go to step S304. That is, the first electronic device performs S303 when the first target device number is 0, 1, 2, 3, 4, 5, 6, and performs S304 when the first target device number is the remaining number.
In a possible implementation manner, the first device may also determine whether the number of connectable devices is smaller than the second threshold, if so, perform S303, and if not, perform S304.
Exemplarily, the first electronic device may determine whether the number of connectable devices is less than 1 by the protocol stack? If yes, executing S303; if not, go to step S304. That is, the first electronic device performs S303 when the number of connectable devices is 0, and performs S304 when the number of connectable devices is not 0.
In another possible implementation manner, the first electronic device may determine whether the number of currently available channels (i.e., the number of currently available physical channels or the number of currently idle channels) is 0? If so, go to step S303, otherwise, go to step S304.
In yet another possible implementation manner, the first electronic device may also determine that the number of currently occupied channels is greater than the fourth threshold? If so, go to step S303, otherwise, go to step S304. Wherein the fourth threshold may be 6.
S303, the first electronic device converts the first Bluetooth connection between the first electronic device and the second target device into a second Bluetooth connection.
Wherein the first target device comprises a second target device and the second bluetooth connection comprises a bluetooth traffic link connection.
Illustratively, the first electronic device may transmit a Bluetooth Low Energy (BLE) broadcast packet to the second target device instructing the second target device to convert the current first bluetooth connection to the second bluetooth connection.
Optionally, after the first electronic device and the second target device establish the second bluetooth connection, the first electronic device and the second target device may broadcast the synchronization status and the message through Ble.
In one possible implementation, converting the first bluetooth connection with the second target device to the second bluetooth connection may include: firstly, determining a second target device from first target devices; the bluetooth physical link connection with the second target device is then broken. Wherein, the second target device may be the first target device with the longest idle duration (i.e. idle time or traffic idle time) in the first target devices or the first target device with the lowest traffic priority in the first target devices, and the idle duration is a duration between the time when the first electronic device last performs bluetooth service interaction and the current time (e.g. the time 14 when the first electronic device last performs bluetooth service interaction is 50.
In another possible implementation manner, converting the first bluetooth connection with the second target device to the second bluetooth connection may include: firstly, determining a second target device from first target devices; the bluetooth physical link connection with the second target device is then broken and the bluetooth traffic link connection with the second target device is reserved.
It should be noted that, a specific method for the first electronic device to determine the second target device from the first target device may be processed by any method that can occur to those skilled in the art, and this is not limited in this embodiment of the present application.
For example, the first electronic device may determine, as the second target device, the first target device having the longest idle duration (i.e., idle time or business idle time) among the first target devices. The idle duration is a duration between the time of last bluetooth service interaction with the first electronic device and the current time (if the first target device and the first electronic device last bluetooth service (excluding the keep-alive service) interact at time 14, 00, the current time is 14.
For another example, the first electronic device may determine a first target device with the lowest priority of traffic among the first target devices as the second target device.
For another example, the first electronic device may determine a score of the first target device according to various parameters of the first target device (such as a connection number, a connection duration, a service priority, and the like), and then determine a first target device with a lowest score in the first target device as the second target device.
For example, the first electronic device may obtain the priority queue list shown in table 1 in the order from small to large of the idle duration of the first target device, then determine the first target device (i.e., device 7) with the largest idle duration in the priority queue list as the second target device, and then disconnect the bluetooth physical link connection with the device 7.
TABLE 1
Device Idle time duration
Device 1 00:00:30
Device 2 00:00:50
Device 3 00:01:00
Device 4 00:01:10
Device 5 00:03:00
Device 6 00:05:00
Device 7 00:12:00
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 device, wherein the third target device is a device supporting second Bluetooth connection; a second target device is determined from the third target devices. The second target device may be a third target device with the longest idle time of the third target device or a third target device with the lowest service priority of the third target devices.
It should be noted that, a specific method for the first electronic device to determine the third target device from the first target device may be processed by any method that can occur to those skilled in the art, and this is not specifically limited in this embodiment of the present application.
For example, the first electronic device may determine whether the first target device supports the second bluetooth connection based on a model, a brand, etc. of the first target device.
For another example, the first electronic device may send test signaling 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.
Compared with the prior art, when the number of the devices connected through the bluetooth physical link is larger than a certain number, the electronic device cannot provide an idle bluetooth physical link to establish a new bluetooth connection because the bluetooth physical link is occupied, and therefore the electronic device can reject a subsequently received bluetooth connection request and notify a connection initiator of connection failure. In the bluetooth connection method provided in this embodiment of the present application, when the number of devices connected through the bluetooth physical link is greater than the first threshold, and after subsequently receiving a bluetooth connection request sent by the second electronic device, the first electronic device reserves the bluetooth service link of the second target device connected through the bluetooth physical link and disconnects the bluetooth physical link, thereby releasing the bluetooth physical link through which the first electronic device and the second electronic device can establish bluetooth connection. The service of the second target device keeps the state synchronization, so that the problem that when the number of the devices connected through the Bluetooth of the electronic device reaches a certain number, other devices cannot perform data interaction with the electronic device through the Bluetooth is solved, and the user experience is improved.
S304, the first electronic device and the second electronic device establish a first Bluetooth connection.
In a possible implementation manner, if the target service exists, the first electronic device sends a first indication to the second target device. The target service is a Bluetooth service related to a second target device, and the first indication is used for indicating the second target device to establish Bluetooth physical link connection with the first electronic device.
In another possible implementation manner, if the target service exists, the first electronic device may also send a second bluetooth connection request to the second target device. Wherein the second bluetooth request is for requesting establishment of a bluetooth physical link.
As shown in fig. 4 (a), the first bluetooth connection includes a bluetooth physical link connection and a bluetooth traffic link connection. The upper layer service of the device can exchange service data flow with the Bluetooth physical link port of the device through a Bluetooth service link, and the Bluetooth physical link port of the device can exchange service data flow with the Bluetooth physical link port of the opposite device through the Bluetooth physical link. As shown in fig. 4 (b), in the case of disconnecting the bluetooth physical link connection between the device 1 and the device 2 and reserving the bluetooth service link connection, since the bluetooth service link connection is reserved, the upper layer service of the device 1 or the device 2 may still exchange service data streams to the bluetooth physical link port of the device through the bluetooth service link. Therefore, after the first electronic device converts the first bluetooth connection with the second target device into the second bluetooth connection, the upper layer service of the first electronic device may still interact with the target service (i.e. the service data stream of the bluetooth service related to the second target device) through the bluetooth service link and the bluetooth physical link port of the first electronic device, and the first electronic device may determine whether the target service exists through the bluetooth physical link port of the first electronic device, and if the target service exists, the bluetooth physical link needs to be established to transmit the data stream of the target service. Therefore, in the presence of the target service, the first electronic device sends a first indication to the second target device, the first indication indicating that the second target device establishes a bluetooth physical link connection with the first electronic device, and indicates that the second target device sends 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, in the presence of the target service, the first electronic device may also directly send the first bluetooth request to the second target device to establish the first bluetooth connection between the first electronic device and the second target device.
It should be noted that, a specific method for the first electronic device to send the first instruction to the second target device may be processed by any method that can occur to those skilled in the art, and this is not particularly limited in this embodiment of the application.
For example, in the presence of the target service, the first electronic device may send, to the second target device through Ble broadcast, a first indication indicating that the second target device establishes 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.
It can be understood that the second target device may also determine whether the target service exists through a bluetooth physical link port of the second target device, and in a case that the target service exists, send a second indication for indicating that the first electronic device establishes a bluetooth physical link connection with the second target device to the first electronic device, and indicate that the first electronic device sends 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, or in a case that the target service exists, the second target device may also directly send the first bluetooth request to the first electronic device to establish the first bluetooth connection between the first electronic device and the second target device.
When a user uses the mobile phone, the user can often connect other devices through the Bluetooth of the mobile phone. However, when the number of devices connected through bluetooth of the mobile phone reaches a certain number, multiple devices occupy the bluetooth link of the mobile phone, so that other devices cannot perform data interaction with the mobile phone through bluetooth. If the number of connected mobile phones through Bluetooth reaches 7, when a user operates other equipment to set up the mobile phone through Bluetooth, the screen of the other equipment displays text prompts that the equipment cannot be connected, cannot be connected or fails to be connected, or the mobile phone displays a non-connectable state in a Bluetooth list of the other equipment. Therefore, another bluetooth connection method is provided in the embodiments of the present application, which can solve the problem that when the number of devices connected by the electronic device through bluetooth reaches a certain number, other devices cannot perform data interaction with the electronic device through bluetooth any more.
Referring to the drawings, another bluetooth connection method provided in the embodiment of the present application is described in detail below, and as shown in fig. 5, the another bluetooth connection method provided in the embodiment of the present application includes:
s501, the first electronic device receives a first Bluetooth request sent by the second electronic device.
Wherein the first connection request is for requesting establishment of a first bluetooth connection. The first bluetooth connection includes a bluetooth physical link connection and a bluetooth traffic link connection.
Illustratively, the user wants to connect with the bluetooth of the air conditioner through the bluetooth of the mobile phone (second electronic device) to adjust the temperature of the air conditioner, and then the user sends a first bluetooth request to the air conditioner by operating the mobile phone, and accordingly the air conditioner receives the sent first bluetooth request.
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 for requesting to establish Bluetooth physical link connection, and the second sub-connection request is used for requesting to establish Bluetooth service link connection. For example, the first electronic device may receive the first sub-connection request sent by the second electronic device first, and then receive the second sub-connection request sent by the second electronic device.
S502, the first electronic device determines whether the number of the first target devices is greater than a first threshold? If yes, go to S503; if not, go to S504.
The first target device is a device which establishes a first Bluetooth connection with a first electronic device.
Alternatively, the first threshold may be 6.
It should be noted that, the number of bluetooth physical links of the first electronic device is limited, and the first bluetooth connection established with the first electronic device needs to occupy the bluetooth physical link of the first electronic device, so that when receiving the first connection request, the first electronic device needs to determine whether there is an idle (unoccupied) bluetooth physical link for establishing the first bluetooth connection according to the relationship between the number of the first target devices and the first threshold.
And under the condition that no idle Bluetooth physical link exists (namely the number of the first target devices is greater than a first threshold), the second target device is enabled to establish the first Bluetooth connection with the first electronic device by indicating the second target device to connect a fourth target device which has already established the first Bluetooth connection with the first electronic device, and the fourth target device is used as a relay agent. Therefore, the second electronic device and the fourth target device share one Bluetooth physical link to be connected with the first electronic device through the first Bluetooth, an additional Bluetooth physical link is not needed, a plurality of devices can be connected with the first electronic device through the Bluetooth through one Bluetooth physical link, the problem that when the number of the devices connected with the electronic device through the Bluetooth reaches a certain number, other devices cannot perform data interaction with the electronic device through the Bluetooth is solved, and user experience is improved.
In the presence of an idle bluetooth physical link (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 over the idle bluetooth physical link.
Exemplarily, the first electronic device may determine whether the number of the first target devices is greater than 6 by the protocol stack? If yes, go to S503; if not, go to S504. That is, the first electronic device performs S503 when the first target device number is 0, 1, 2, 3, 4, 5, 6, and performs S504 when the first target device number is the remaining number.
In a possible implementation manner, the first device may also determine whether the number of connectable devices is smaller than the second threshold, if so, perform S503, and if not, perform S504.
Exemplarily, the first electronic device may determine whether the number of connectable devices is less than 1 by the protocol stack? If yes, go to S503; if not, go to S504. That is, the first electronic device performs S503 when the number of connectable devices is 0, and performs S504 when the number of connectable devices is not 0.
In one possible implementation manner, the first electronic device may determine whether the number of currently available channels (i.e., the number of currently available physical channels or the number of currently idle channels) is 0? If yes, go to S503, otherwise go to S50.
In another possible implementation manner, the first electronic device may also determine that the number of currently occupied channels is greater than the fourth threshold? If yes, go to S503, otherwise go to S504. Wherein the fourth threshold may be 6.
S503, the first electronic device sends a second instruction to the second electronic device to indicate the second electronic device to establish the first Bluetooth connection with the first electronic device through a fourth target device in the first target device.
In one possible implementation, the sending, by the first electronic device, the second indication to the second electronic device may include: the first electronic device determines a fourth target device from the first target devices, and then sends a second instruction to the second electronic device.
It should be noted that, a specific method for the first electronic device to determine the fourth target device from the first target device may be processed by any method that can occur to those skilled in the art, and this is not specifically limited in this embodiment of the present application.
For example, the first electronic device may first acquire the number of connected devices (the number of connected devices through bluetooth) of each first target device, and then determine the device with the smallest number of connected devices in the first target devices as the fourth target device.
For example, the first electronic device may obtain the number of connected devices of each first target device by sending a obtaining instruction to each first target device, then obtain the first target device information table shown in table 2 in the order from small to large of the number of connected devices of the first target device, and then determine the first target device (i.e., device 4) with the number of connected devices in table 2 as the fourth target device. Of course, the first electronic device may also determine any first target device with the number of connected devices smaller than the first threshold as the fourth target device.
TABLE 2
Equipment (MAC) Channel identifier Service (UUID) Number of connected devices
Device 4 A_B Service 1 0
Device 2 DLC Service (UUID) 2
Device 1 DLC Service (UUID) 3
Device 3 DLC Service (UUID) 3
Device 5 DLC Service (UUID) 4
Device 6 DLC Service (UUID) 5
Device 7 DLC Service (UUID) 6
Alternatively, the acquisition instruction for acquiring the number of connected devices may be a hiecho instruction. Table 3 shows the format of the hi ech o instruction, and as shown in Table 3, the command id field of the hi ech instruction can be used to add a definition instruction type, and the payload field of the hi ech instruction can be used to deposit data.
TABLE 3
header service id command id payload mic
In a possible implementation manner, the first electronic device may also send a third indication to the fourth target device to instruct the fourth target device to establish the first bluetooth connection with the second electronic device as a relay agent.
Compared with the prior art, when the number of the devices connected through the bluetooth physical link is larger than a certain number, the electronic device cannot provide an idle bluetooth physical link to establish a new bluetooth connection because the bluetooth physical link is occupied, and therefore the electronic device can reject a subsequently received bluetooth connection request and notify a connection initiator of connection failure. In the bluetooth connection method provided in this embodiment of the present application, when the number of devices connected through the bluetooth physical link is greater than the first threshold, and after subsequently receiving a bluetooth connection request sent by the second electronic device, the first electronic device may establish the first bluetooth connection with the first electronic device by instructing the second target device to connect a fourth target device that has already established the first bluetooth connection with the first electronic device, and using the fourth target device as a relay agent. Therefore, the second electronic device and the fourth target device share one Bluetooth physical link to be connected with the first electronic device through the first Bluetooth, an additional Bluetooth physical link is not needed, a plurality of devices can be connected with the first electronic device through the Bluetooth through one Bluetooth physical link, the problem that when the number of the devices connected with the electronic device through the Bluetooth reaches a certain number, other devices cannot perform data interaction with the electronic device through the Bluetooth is solved, and user experience is improved.
It should be noted that the bluetooth protocol supports different service interactions through different DLC on the same bluetooth physical link, so that the second electronic device and the fourth target device can perform service interactions with the first electronic device through different DLC using the same bluetooth physical link.
For example, if a first electronic device sends a service data stream to a second electronic device, the first electronic device may obtain information of connected devices of each first target device, then obtain a connected device information table as shown in table 4, then determine that a DLC used by the second electronic device is B _4 according to the connected device information table, then send a service data stream with the DLC being B _4 to a fourth target device, and after receiving the service data stream, the fourth target device determines, according to the DLC of the service data stream or the MAC of the service data stream and the DLC lookup table 4, that the DLC of the data stream is not a _ B used for interaction between the first electronic device and the fourth target device, but is B _4 used by the first electronic device and the second electronic device, and then transmit the data stream to the second electronic device through a bluetooth physical link between the fourth target device and the second electronic device.
TABLE 4
Figure BDA0003289008250000161
It can be understood that, after receiving the service data flow sent by the fourth target device, the first electronic device may also determine the sender of the service data flow through the DLC of the service data flow or the MAC and DLC look-up table 4 of the service data flow.
When a user uses the mobile phone, the user can often connect other devices through the Bluetooth of the mobile phone. However, when the number of devices connected through bluetooth of the mobile phone reaches a certain number, multiple devices occupy the bluetooth link of the mobile phone, so that other devices cannot perform data interaction with the mobile phone through bluetooth. If the number of connected mobile phones through Bluetooth reaches 7, when a user operates other equipment to set up the mobile phone through Bluetooth, the screen of the other equipment displays text prompts that the mobile phone cannot be connected, cannot be connected with the equipment or fails to connect, or the mobile phone displays a non-connectable state in the Bluetooth list of the other equipment. Therefore, another bluetooth connection method is provided in the embodiments of the present application, which can solve the problem that when the number of devices connected by the electronic device through bluetooth reaches a certain number, other devices cannot perform data interaction with the electronic device through bluetooth any more.
Referring to the drawings, a detailed description is given below of another bluetooth connection method provided in the embodiment of the present application, and as shown in fig. 6, the another bluetooth connection method provided in the embodiment of the present application includes:
s601, the first electronic device receives a first Bluetooth request sent by the second electronic device.
Wherein the first connection request is for requesting establishment of a first bluetooth connection. The first bluetooth connection includes a bluetooth physical link connection and a bluetooth traffic link connection.
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 for requesting to establish Bluetooth physical link connection, and the second sub-connection request is used for requesting to establish Bluetooth service link connection. For example, the first electronic device may receive the first sub-connection request sent by the second electronic device first, and then receive the second sub-connection request sent by the second electronic device.
S602, the first electronic device determines whether the number of the first target devices is greater than a first threshold? If yes, executing S603; if not, go to S605.
S603, the first electronic device determines whether the idle durations of the first target device are all smaller than a third threshold, if so, then S606 is executed, and if not, then S604 is executed.
It should be noted that, whether the service interaction between the first target device and the first electronic device is frequent may be determined according to a relationship between the idle time of the first target device and the size of the third threshold. When the idle time of each first target device is less than the third threshold, it means that each first target device and the first electronic device frequently perform service interaction, and if S604 is executed to convert the first bluetooth connection of a certain first target device into the second bluetooth connection, the service interaction between the first target device and the first electronic device is affected, and S606 is executed to select a certain first target device as a relay agent, i.e., the first bluetooth connection between the first electronic device and the second electronic device can be established without affecting the service interaction between the first target device and the first electronic device.
When the idle durations of the first target devices are not all smaller than the third threshold, it is indicated that there is a first target device in the first target device that has business interaction with the first electronic device that is not frequent, the first bluetooth connection of the first target device may be converted into a second bluetooth connection conversion by executing S604, so as to release the bluetooth physical connection occupied by the first target device for the first bluetooth connection between the first electronic device and the second electronic device.
It may be understood that, in the case that whether the number of the first target devices is greater than the first threshold, the first electronic device may also determine to execute S604 or S606 by using other determination conditions, which is not limited in this embodiment of the present invention.
For example, the first electronic device may determine whether to perform S604 or 606 according to the priority of the second electronic device. When the priority of the second electronic device is high (i.e., greater than the priority threshold), the second electronic device establishes the first bluetooth connection with the first electronic device through the separate bluetooth physical link by performing S604. When the priority of the second electronic device is low (i.e., less than the priority threshold), the second electronic device and the fourth target device share the bluetooth physical link to establish the first bluetooth connection with the first electronic device by performing S606.
For another example, the first electronic device may score the second electronic device according to information (e.g., device type, connection times, service type, service priority, etc.) of the second electronic device, and when the obtained score is higher than the score threshold, the second electronic device may establish the first bluetooth connection with the first electronic device through a separate bluetooth physical link by performing S604. When the obtained score is lower than the score threshold, the second electronic device and the fourth target device share the bluetooth physical link to establish the first bluetooth connection with the first electronic device by executing S606.
S604, the first electronic device converts the first Bluetooth connection between the first electronic device and a second target device in the first target device into a second Bluetooth connection.
S605, the first electronic device and the second electronic device establish a first Bluetooth connection.
S606, the first electronic device sends a second instruction to the second electronic device to indicate the second electronic device to establish the first Bluetooth connection with the first electronic device through a fourth target device in the first target device.
In a possible implementation manner, after the second electronic device establishes the first bluetooth connection with the first electronic device through a fourth target device in the first target device, the first electronic device may further send, to the second electronic device, a fourth indication to indicate that the second electronic device is disconnected from the fourth target device and send the first bluetooth connection request to the first electronic device, when the number of connected devices is smaller than a first threshold or the number of connectable devices is larger than a second threshold, and the like.
It can be understood that, when the first electronic device has an available bluetooth physical link, switching the connection mode between the second electronic device and the first electronic device from relay proxy connection to direct connection may reduce communication delay between the first electronic device and the second electronic device, and improve communication speed between the first electronic device and the second electronic device, thereby further improving user experience.
In another possible implementation manner, after the second electronic device establishes the first bluetooth connection with the first electronic device through a fourth target device in the first target device, the first electronic device may further disconnect the first bluetooth connection with the fourth target device and instruct the second electronic device to establish the 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 under the condition that the current electric quantity of the fourth target device is smaller than a fifth threshold.
It can be understood that, when the fourth target device is insufficient in power, the first electronic device indicates that the second electronic device is not connected with the first electronic device through the fourth target device, but directly connected with the first electronic device, thereby avoiding that the shutdown due to insufficient power of the fourth target device can cause the disconnection between the second electronic device and the first electronic device, which are connected through the first bluetooth established between the fourth target device and the first electronic device, and the bluetooth connection between the first electronic device and the second electronic device is interrupted, and further improving the user experience.
In yet another possible implementation manner, after the fourth target device disconnects the first bluetooth connection from the first electronic device because the current power is less than the fifth threshold, the fourth target device charges, and when the current power of the fourth target device is greater than the fifth threshold, the first electronic device may disconnect the first bluetooth connection from the second electronic device and instruct the fourth target device to establish the first bluetooth connection with the first electronic device or instruct the fourth target device to send the first bluetooth connection request to the first electronic device, and then send the second instruction to the second electronic device to instruct the second electronic device to establish the first bluetooth connection with the first electronic device through the fourth target device in the first target device.
In a possible implementation manner, the first electronic device may further identify the connected device according to a connection state of the fifth target device. The fifth target device is a device which establishes a first bluetooth connection or a second bluetooth connection with the first electronic device, and the fifth target devices in different connection states correspond to different identifiers.
Optionally, the identifier includes at least one of a text, a color, or an icon.
It should be noted that, a specific method for identifying a connected device according to the connection state of the fifth target device may be processed by any method that can occur to those skilled in the art, and this is not specifically limited in this embodiment of the application.
For example, the text identifier of the bluetooth connection may be used for a device that directly establishes the first bluetooth connection with the first electronic device, the text identifier of the virtual bluetooth connection may be used for a device that establishes the second bluetooth connection with the first electronic device, and the text identifier of the relay bluetooth connection or the proxy bluetooth connection may be used for a device that establishes the first bluetooth connection with the first electronic device through another device.
For another example, a device that directly establishes the first bluetooth connection with the first electronic device may be identified by blue, a device that establishes the second bluetooth connection with the first electronic device may be identified by gray, and a device that establishes the first bluetooth connection with the first electronic device may be identified by white.
Illustratively, the electronic devices 1 to 7 directly establish a first bluetooth connection with the first electronic device, the electronic device 8 establishes a second bluetooth connection with the first electronic device, and the electronic device 9 establishes a first bluetooth connection with the first electronic device through the electronic device 5. Fig. 7 (a) illustrates the bluetooth device list of the first electronic device, such as the bluetooth device list illustrated in fig. 7 (a), the electronic devices 1 to 7 are identified by the characters connected by bluetooth, the electronic device 8 is identified by the characters connected by virtual bluetooth, and the electronic device 9 is identified by the characters connected by relay.
Also exemplarily, the electronic devices 1 to 7 establish a first bluetooth connection directly with the first electronic device, the electronic device 8 establishes a second bluetooth connection with the first electronic device, and the electronic device 9 establishes a first bluetooth connection with the first electronic device through the electronic device 5. Fig. 7 (b) illustrates the bluetooth device list of the first electronic device, and the electronic devices 1 to 7 are identified by white, the electronic device 8 is identified by gray, and the electronic device 9 is identified by black in the bluetooth device list illustrated in fig. 7 (b).
It can be understood that, the connected device is identified by the connection state of the connected device, so that the user can quickly know the connection state of the connected device through the identification of the connected device to facilitate subsequent operations of the user, thereby further improving the user experience.
An electronic device for performing the above-described bluetooth connection method will be described with reference to fig. 8 and 9.
It will be appreciated that the electronic device, in order to implement the above-described functions, comprises corresponding hardware and/or software modules for performing the respective functions. The present application is capable of being implemented in hardware or a combination of hardware and computer software in conjunction with the exemplary algorithm steps described in connection with the embodiments disclosed herein. Whether a function is performed in hardware or computer software drives hardware depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, with the embodiment described in connection with the particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
In the embodiment of the present application, the electronic device may be divided into the functional modules according to the method example, for example, each functional module may be divided corresponding to each function, or two or more functions may be integrated into one processing module. The integrated module may be implemented in the form of hardware. It should be noted that the division of the modules in this embodiment is schematic, and is only a logic function division, and there may be another division manner in actual implementation.
In the case of dividing each functional module according to corresponding functions, fig. 8 shows a schematic diagram of a possible composition of the electronic device related to the foregoing embodiment, and as shown in fig. 8, the apparatus 800 may include: a transceiver unit 801 and a processing unit 802, which processing unit 802 may implement the methods performed by the electronic device in the above-described method embodiments, and/or other processes for the techniques described herein.
It should be noted that all relevant contents of each step related to the above method embodiment may be referred to the functional description of the corresponding functional module, and are not described herein again.
In case an integrated unit is employed, the apparatus 800 may comprise a processing unit, a storage unit and a communication unit. The processing unit may be configured to control and manage operations of the apparatus 800, and for example, may be configured to support the apparatus 800 to execute steps executed by the above units. The memory unit may be used to support the apparatus 800 for executing stored program code, and/or data, etc. The communication unit may be used to support the communication of the apparatus 800 with other devices.
Wherein the processing unit may be a processor or a controller. Which may implement or execute the various illustrative logical blocks, modules, and circuits described in connection with the disclosure herein. A processor may also be a combination of computing functions, e.g., a combination of one or more microprocessors, a Digital Signal Processing (DSP) and a microprocessor, or the like. The storage unit may be a memory. The communication unit may specifically be a radio frequency circuit, a bluetooth chip, a Wi-Fi chip, or other devices that interact with other electronic devices.
In one possible implementation manner, an electronic device according to the embodiment of the present application may be an apparatus 900 having a structure shown in fig. 9, where the apparatus 900 includes a processor 901 and a transceiver 902. The relevant functions implemented by the transceiving unit 801 and the processing unit 802 in fig. 8 may be implemented by the processor 901.
Optionally, the apparatus 900 may further comprise a memory 903, and the processor 901 and the memory 903 communicate with each other through an internal connection path. The associated functions implemented by the memory unit in fig. 8 may be implemented by the memory 903.
The embodiment of the present application further provides a computer storage medium, where a computer instruction is stored in the computer storage medium, and when the computer instruction runs on an electronic device, the electronic device is enabled to execute the relevant method steps to implement the bluetooth connection method in the foregoing embodiment.
The embodiment of the present application further provides a computer program product, which when running on a computer, causes the computer to execute the above related steps to implement the bluetooth connection method in the above embodiment.
The embodiment of the application also provides an electronic device, and the device can be specifically a chip, an integrated circuit, a component or a module. In particular, the apparatus may comprise a processor and a memory coupled to store instructions, or the apparatus may comprise at least one processor configured to retrieve instructions from an external memory. When the device runs, the processor can execute the instructions to enable the chip to execute the Bluetooth connection method in the above-mentioned method embodiments.
Fig. 10 shows a schematic structural diagram of a chip 1000. Chip 1000 includes one or more processors 1001 and interface circuits 1002. Optionally, the chip 1000 may further include a bus 1003.
The processor 1001 may be an integrated circuit chip having signal processing capabilities. In implementation, the steps of the bluetooth connection method may be implemented by an integrated logic circuit of hardware in the processor 1001 or instructions in the form of software.
Alternatively, the processor 1001 may be a general-purpose processor, a Digital Signal Processing (DSP) device, an integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic device, discrete gate or transistor logic device, or discrete hardware components. The methods, steps disclosed in the embodiments of the present application may be implemented or performed. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The interface circuit 1002 may be used to transmit or receive data, instructions, or information, and the processor 1001 may perform processing by using the data, instructions, or other information received by the interface circuit 1002, and may transmit the processing completion information through the interface circuit 1002.
Optionally, the chip further comprises a memory, which may include read only memory and random access memory, and provides operating instructions and data to the processor. The portion of memory may also include non-volatile random access memory (NVRAM).
Optionally, the memory stores executable software modules or data structures, and the processor may perform corresponding operations by calling the operation instructions stored in the memory (the operation instructions may be stored in an operating system).
Alternatively, the chip may be used in the electronic device or DOP according to the embodiment of the present application. Optionally, the interface circuit 1002 may be configured to output the execution result of the processor 1001. Reference may be made to the foregoing embodiments for a bluetooth connection method provided in one or more embodiments of the present application, which are not described herein again.
It should be noted that the functions corresponding to the processor 1001 and the interface circuit 1002 may be implemented by hardware design, software design, or a combination of hardware and software, which is not limited herein.
The electronic device, the computer storage medium, the computer program product, or the chip provided in this embodiment are all configured to execute the corresponding method provided above, and therefore, the beneficial effects that can be achieved by the electronic device, the computer storage medium, the computer program product, or the chip may refer to the beneficial effects in the corresponding method provided above, and are not described herein again.
It should be understood that, in the various embodiments of the present application, the sequence numbers of the above-mentioned processes do not mean the execution sequence, and the execution sequence of each process should be determined by its function and inherent logic, and should not constitute any limitation to the implementation process of the embodiments of the present application.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described systems, apparatuses and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the several embodiments provided in the present application, it should be understood that the disclosed system, apparatus and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the above-described units is only one type of logical functional division, and other divisions may be realized in practice, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one position, or may be distributed on multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit.
The above functions, if implemented in the form of software functional units and sold or used as a separate product, may be stored in a computer-readable storage medium. Based on such understanding, the technical solution of the present application or portions thereof that substantially contribute to the prior art may be embodied in the form of a software product stored in a storage medium and including instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the above-described method according to the embodiments of the present application. And the aforementioned storage medium includes: various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
The above description is only for the specific embodiments of the present application, but the scope of the present application is not limited thereto, and any person skilled in the art can easily think of the changes or substitutions within the technical scope of the present application, and shall be covered by the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (35)

1. A method of bluetooth connectivity, the method comprising:
the method comprises the steps that first electronic equipment receives a first Bluetooth connection request sent by second electronic equipment, wherein the first connection request is used for requesting to establish a first Bluetooth connection, and the first Bluetooth connection comprises a Bluetooth physical link connection and a Bluetooth service link connection;
when the number of first target devices is larger than a first threshold value, the first electronic device executes a first operation, the first operation comprises converting the first Bluetooth connection between the first target device and a second target device into a second Bluetooth connection and establishing the first Bluetooth connection with the second electronic device, the first target device is a device establishing the first Bluetooth connection with the first electronic device, the first target device comprises the second target device, and the second Bluetooth connection comprises a Bluetooth service link connection.
2. The method of claim 1, further comprising:
when the number of connectable devices is less than a second threshold, the first electronic device performs the first operation.
3. The method of claim 1 or 2, wherein said converting the first bluetooth connection with a second target device to a second bluetooth connection comprises:
determining the second target device from the first target device;
and disconnecting the Bluetooth physical link connection with the second target device.
4. The method of claim 1 or 2, wherein said converting the first bluetooth connection with a second target device to a second bluetooth connection comprises:
determining the second target device from the first target device;
disconnecting the Bluetooth physical link connection with the second target device and reserving the Bluetooth physical link connection with the second target device.
5. The method according to claim 3 or 4, wherein the second target device is a first target device with the longest idle duration in the first target device or a first target device with the lowest priority of the first target device, and the idle duration is a duration between a time when the first electronic device last performs bluetooth service interaction and a current time.
6. The method of claim 3 or 4, wherein the determining the second target device from the first target device comprises:
determining a third target device from the first target device, wherein the third target device is a device supporting a second Bluetooth connection;
and determining the second target equipment from the third target equipment, wherein the second target equipment is the third target equipment with the longest idle time length in the third target equipment or the third target equipment with the lowest service priority in the third target equipment, and the idle time length is the time length between the time of performing the bluetooth service interaction with the first electronic equipment last time and the current time.
7. The method of any of claims 1-6, wherein after converting the first Bluetooth connection with a second target device to a second Bluetooth connection, the method further comprises:
when a target service exists, sending a first indication to the second target device, where the target service is a bluetooth service related to the second target device, and the first indication is used to indicate the second target device to establish a bluetooth physical link connection with the first electronic device.
8. The method of any of claims 1-6, wherein after converting the first Bluetooth connection with a second target device to a second Bluetooth connection, the method further comprises:
and when the target service exists, sending a second Bluetooth connection request to the second target equipment, wherein the second Bluetooth request is used for requesting to establish a Bluetooth physical link.
9. The method of any of claims 1-8, wherein when the first number of target devices is greater than a first threshold, the first electronic device performs a first operation comprising:
when the number of the first target devices is larger than the first threshold and the idle time of the first target devices is not smaller than a third threshold, the first electronic device executes the first operation;
when the number of the first target devices is greater than the first threshold value and the idle time of the first target devices is less than the third threshold value, the first electronic device sends a second indication to the second electronic device, the second indication is used for indicating the second electronic device to establish a first bluetooth connection with the first electronic device through a fourth target device, and the first target device comprises the fourth target device.
10. The method of claim 9, further comprising:
and when the number of the first target devices is greater than the first threshold value and the idle time of the first target devices is less than the third threshold value, the first electronic device sends a third indication to the fourth target device, wherein the third indication is used for indicating the fourth target device to establish a first Bluetooth connection with the second electronic device.
11. The method according to claim 9 or 10, wherein the fourth target device is a device with the least number of connected devices or the most number of connected devices in the first target device.
12. The method according to any one of claims 9 to 11, further comprising:
and when the number of the first target devices is smaller than a first threshold value or the number of the connectable devices is larger than a second threshold value, sending a fourth indication to the second electronic device, wherein the fourth indication is used for indicating the second electronic device to be disconnected from the fourth target devices and sending a first Bluetooth connection request to the first electronic device.
13. The method according to any one of claims 9 to 12, further comprising:
and when the current electric quantity of the fourth target equipment is smaller than a fifth threshold value, disconnecting the first Bluetooth connection with the fourth target equipment and indicating the second electronic equipment to send a first Bluetooth connection request to the first electronic equipment.
14. The method of claim 13, wherein after disconnecting the first bluetooth connection with the fourth target device, the method further comprises:
and when the current electric quantity of the fourth target equipment is larger than a fifth threshold value, disconnecting the first Bluetooth connection with the second electronic equipment and indicating the fourth target equipment to send a first Bluetooth connection request to the first electronic equipment.
15. The method according to any one of claims 1 to 14, further comprising:
identifying connected equipment according to the connection state of fifth target equipment, wherein the fifth target equipment is equipment which establishes a first Bluetooth connection or a second Bluetooth connection with the first electronic equipment, and the fifth target equipment in different connection states corresponds to different identifications.
16. The method of claim 15, wherein the indicia comprises at least one of text, color, or icons.
17. An electronic device comprising a processing unit and a memory unit coupled to the processing unit, the processing unit configured to:
receiving a first Bluetooth connection request sent by second electronic equipment, wherein the first connection request is used for requesting to establish a first Bluetooth connection, and the first Bluetooth connection comprises a Bluetooth physical link connection and a Bluetooth service link connection;
when the number of first target devices is larger than a first threshold value, executing a first operation, wherein the first operation comprises the steps of converting the first Bluetooth connection between the first target devices and second target devices into a second Bluetooth connection and establishing the first Bluetooth connection between the first target devices and the second electronic devices, the first target devices are devices establishing the first Bluetooth connection with the electronic devices, the first target devices comprise the second target devices, and the second Bluetooth connection comprises Bluetooth service link connection.
18. The electronic device of claim 17, wherein the processing unit is further configured to:
when the number of connectable devices is less than a second threshold, the first operation is performed.
19. The electronic device according to claim 17 or 18, wherein the processing unit is specifically configured to:
determining the second target device from the first target device;
and disconnecting the Bluetooth physical link connection with the second target device.
20. The electronic device according to claim 17 or 19, wherein the processing unit is specifically configured to:
determining the second target device from the first target device;
disconnecting the Bluetooth physical link with the second target device and reserving the Bluetooth physical link with the second target device.
21. The electronic device according to claim 19 or 20, wherein the second target device is a first target device with the longest idle duration in the first target device or a first target device with the lowest priority of the first target device, and the idle duration is a duration between a time when the electronic device last performs bluetooth service interaction and a current time.
22. The electronic device according to claim 19 or 20, wherein the processing unit is specifically configured to:
determining a third target device from the first target device, wherein the third target device is a device supporting a second Bluetooth connection;
and determining the second target equipment from the third target equipment, wherein the second target equipment is the third target equipment with the longest idle time length in the third target equipment or the third target equipment with the lowest service priority in the third target equipment, and the idle time length is the time length between the time of performing the bluetooth service interaction with the electronic equipment last time and the current time.
23. The electronic device of any of claims 17-22, wherein after converting the first bluetooth connection with a second target device to a second bluetooth connection, the processing unit is further configured to:
when a target service exists, sending 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 for indicating the second target device to establish bluetooth physical link connection with the electronic device.
24. The electronic device of any of claims 17-22, wherein after converting the first bluetooth connection with a second target device to a second bluetooth connection, the processing unit is further configured to:
and when the target service exists, sending a second Bluetooth connection request to the second target equipment, wherein the second Bluetooth request is used for requesting to establish a Bluetooth physical link.
25. The electronic device according to any of claims 17 to 24, wherein the processing unit is specifically configured to:
when the number of the first target devices is larger than the first threshold and the idle time of the first target devices is not smaller than a third threshold, executing the first operation;
when the number of the first target devices is larger than the first threshold value and the idle time of the first target devices is smaller than the third threshold value, sending a second indication to the second electronic device, where the second indication is used to indicate that the second electronic device establishes a first bluetooth connection with the electronic device through a fourth target device, and the first target device includes the fourth target device.
26. The electronic device of claim 25, wherein the processing unit is further configured to:
and when the number of the first target devices is greater than the first threshold value and the idle time of the first target devices is less than the third threshold value, sending a third indication to the fourth target device, wherein the third indication is used for indicating the fourth target device to establish a first Bluetooth connection with the second electronic device.
27. The electronic device according to claim 25 or 26, wherein the fourth target device is a device with the least number of connected devices or the most number of connected devices in the first target device.
28. The electronic device of any of claims 25-27, wherein the processing unit is further configured to:
and when the number of the first target devices is smaller than a first threshold value or the number of the connectable devices is larger than a second threshold value, sending a fourth indication to the second electronic device, wherein the fourth indication is used for indicating the second electronic device to be disconnected from the fourth target devices and sending a first Bluetooth connection request to the electronic device.
29. The electronic device of any of claims 25-28, wherein the processing unit is further configured to:
and when the current electric quantity of the fourth target equipment is smaller than a fifth threshold value, disconnecting the first Bluetooth connection with the fourth target equipment and indicating the second electronic equipment to send a first Bluetooth connection request to the electronic equipment.
30. The electronic device of claim 29, wherein after disconnecting the first bluetooth connection with the fourth target device, the processing unit is further configured to:
and when the current electric quantity of the fourth target equipment is larger than a fifth threshold value, disconnecting the first Bluetooth connection with the second electronic equipment and indicating the fourth target equipment to send a first Bluetooth connection request to the electronic equipment.
31. The electronic device of any of claims 17-30, wherein the processing unit is further configured to: identifying connected equipment according to the connection state of fifth target equipment, wherein the fifth target equipment is equipment which establishes a first Bluetooth connection or a second Bluetooth connection with the electronic equipment, and the fifth target equipment in different connection states corresponds to different identifications.
32. The electronic device of claim 31, wherein the indicia comprises at least one of text, color, or icons.
33. An electronic device comprising at least one processor and interface circuitry, the at least one processor and the interface circuitry coupled, wherein the at least one processor executes programs or instructions stored in a memory to cause the data exchange apparatus to implement the method of any of claims 1 to 16.
34. A computer-readable storage medium for storing a computer program, characterized in that the computer program comprises instructions for implementing the method of any of the preceding claims 1 to 16.
35. A computer program product comprising instructions which, when run on a computer or processor, cause the computer or processor to carry out the method of any one of claims 1 to 16.
CN202111157938.0A 2021-09-30 2021-09-30 Bluetooth connection method and electronic equipment Pending CN115884142A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111157938.0A CN115884142A (en) 2021-09-30 2021-09-30 Bluetooth connection method and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111157938.0A CN115884142A (en) 2021-09-30 2021-09-30 Bluetooth connection method and electronic equipment

Publications (1)

Publication Number Publication Date
CN115884142A true CN115884142A (en) 2023-03-31

Family

ID=85756586

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111157938.0A Pending CN115884142A (en) 2021-09-30 2021-09-30 Bluetooth connection method and electronic equipment

Country Status (1)

Country Link
CN (1) CN115884142A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116828588A (en) * 2023-08-25 2023-09-29 荣耀终端有限公司 Communication method, readable medium, and electronic device

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116828588A (en) * 2023-08-25 2023-09-29 荣耀终端有限公司 Communication method, readable medium, and electronic device
CN116828588B (en) * 2023-08-25 2023-11-21 荣耀终端有限公司 Communication method, readable medium, and electronic device

Similar Documents

Publication Publication Date Title
US11989482B2 (en) Split-screen projection of an image including multiple application interfaces
EP4024193A1 (en) Data transmission method and related devices
EP4084486B1 (en) Cross-device content projection method, and electronic device
CN112399390B (en) Bluetooth connection method and related device
EP4109891A1 (en) Device interaction method and electronic device
WO2021175300A1 (en) Data transmission method and apparatus, electronic device, and readable storage medium
US12045446B2 (en) Display interaction system, and display method and device
WO2021190344A1 (en) Multi-screen display electronic device, and multi-screen display method for electronic device
CN116055786B (en) Method for displaying multiple windows and electronic equipment
EP4192058A1 (en) Bluetooth communication method, terminal device, and computer-readable storage medium
CN113254120A (en) Data processing method and related device
EP4130955A1 (en) Method for managing application window, and terminal device and computer-readable storage medium
WO2021031865A1 (en) Call method and apparatus
EP4152782B1 (en) Message pushing method and apparatus
CN112130788A (en) Content sharing method and device
EP4407453A1 (en) Application running method and related device
WO2021218544A1 (en) Wireless connection providing system, method, and electronic apparatus
EP4106238A1 (en) Wireless communication system and method
WO2023088209A1 (en) Cross-device audio data transmission method and electronic devices
US20240303024A1 (en) Display method, electronic device, and system
CN115884142A (en) Bluetooth connection method and electronic equipment
CN115811719A (en) Bluetooth connection method and electronic equipment
WO2023280160A1 (en) Channel switching method and apparatus
CN116744106B (en) Control method of camera application and terminal equipment
US20240201932A1 (en) Display method, electronic device, and system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination