WO2024060750A1 - 蓝牙切换方法和装置、蓝牙连接方法和装置及电子设备 - Google Patents
蓝牙切换方法和装置、蓝牙连接方法和装置及电子设备 Download PDFInfo
- Publication number
- WO2024060750A1 WO2024060750A1 PCT/CN2023/103173 CN2023103173W WO2024060750A1 WO 2024060750 A1 WO2024060750 A1 WO 2024060750A1 CN 2023103173 W CN2023103173 W CN 2023103173W WO 2024060750 A1 WO2024060750 A1 WO 2024060750A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- bluetooth
- bluetooth connection
- connection
- electronic device
- established
- Prior art date
Links
- 238000000034 method Methods 0.000 title claims abstract description 128
- 230000005540 biological transmission Effects 0.000 claims description 144
- 238000004891 communication Methods 0.000 claims description 88
- 230000004044 response Effects 0.000 claims description 17
- 230000008569 process Effects 0.000 description 25
- 238000010586 diagram Methods 0.000 description 15
- 238000012545 processing Methods 0.000 description 12
- 230000006870 function Effects 0.000 description 11
- 230000001960 triggered effect Effects 0.000 description 8
- 238000005516 engineering process Methods 0.000 description 7
- 238000004590 computer program Methods 0.000 description 4
- 230000008859 change Effects 0.000 description 3
- 210000005069 ears Anatomy 0.000 description 3
- 230000003993 interaction Effects 0.000 description 3
- 230000008901 benefit Effects 0.000 description 2
- 230000008878 coupling Effects 0.000 description 2
- 238000010168 coupling process Methods 0.000 description 2
- 238000005859 coupling reaction Methods 0.000 description 2
- 230000007547 defect Effects 0.000 description 2
- 238000001514 detection method Methods 0.000 description 2
- 230000009977 dual effect Effects 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 238000006467 substitution reaction Methods 0.000 description 2
- 238000012546 transfer Methods 0.000 description 2
- 230000004913 activation Effects 0.000 description 1
- 238000013500 data storage Methods 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 230000007774 longterm Effects 0.000 description 1
- 238000007726 management method Methods 0.000 description 1
- 230000007246 mechanism Effects 0.000 description 1
- 238000012544 monitoring process Methods 0.000 description 1
- 230000008447 perception Effects 0.000 description 1
- 238000003672 processing method Methods 0.000 description 1
- 238000009877 rendering Methods 0.000 description 1
- 238000011160 research Methods 0.000 description 1
- 238000004904 shortening Methods 0.000 description 1
- 230000001360 synchronised effect Effects 0.000 description 1
- 230000007704 transition Effects 0.000 description 1
- 230000000007 visual effect Effects 0.000 description 1
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W36/00—Hand-off or reselection arrangements
- H04W36/34—Reselection control
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W4/00—Services specially adapted for wireless communication networks; Facilities therefor
- H04W4/80—Services using short range communication, e.g. near-field communication [NFC], radio-frequency identification [RFID] or low energy communication
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W48/00—Access restriction; Network selection; Access point selection
- H04W48/08—Access restriction or access information delivery, e.g. discovery data delivery
- H04W48/10—Access restriction or access information delivery, e.g. discovery data delivery using broadcasted information
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W76/00—Connection management
- H04W76/10—Connection setup
- H04W76/14—Direct-mode setup
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W76/00—Connection management
- H04W76/10—Connection setup
- H04W76/15—Setup of multiple wireless link connections
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W76/00—Connection management
- H04W76/10—Connection setup
- H04W76/19—Connection re-establishment
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W76/00—Connection management
- H04W76/30—Connection release
Definitions
- the present application relates to the field of Bluetooth technology, and more specifically, to a Bluetooth switching method and device, a Bluetooth connection method and device, and electronic equipment.
- Bluetooth communication technology is also advancing rapidly.
- an electronic device can be connected to an external device via Bluetooth, and the Bluetooth connection may have more than one communication mode.
- This application proposes a Bluetooth switching method and device, a Bluetooth connection method and device, and electronic equipment.
- embodiments of the present application provide a Bluetooth switching method, which is applied to electronic devices and/or Bluetooth devices.
- the method includes: establishing a first Bluetooth connection between the electronic device and the Bluetooth device.
- a second Bluetooth connection between the electronic device and the Bluetooth device is established; after the second Bluetooth connection is successfully established, the first Bluetooth connection is disconnected.
- embodiments of the present application also provide a Bluetooth connection method, which is applied to electronic devices and/or Bluetooth devices.
- the method includes: when the electronic device establishes a Bluetooth connection with the Bluetooth device, establish the Another Bluetooth connection between the electronic device and the Bluetooth device, wherein the two Bluetooth connections correspond to different Bluetooth communication modes; after the connection information of the target Bluetooth connection in the two Bluetooth connections is determined, disconnect the target Bluetooth connection, wherein the target Bluetooth connection is at least one of the two Bluetooth connections.
- embodiments of the present application also provide a Bluetooth switching device, which is characterized in that it is applied to electronic equipment and/or Bluetooth devices, and the device includes: a connection unit and a first disconnection unit.
- a connection unit configured to establish a second Bluetooth connection between the electronic device and the Bluetooth device when a first Bluetooth connection has been established between the electronic device and the Bluetooth device; a first disconnecting unit , used to disconnect the first Bluetooth connection after the second Bluetooth connection is successfully established.
- embodiments of the present application also provide a Bluetooth connection device, which is characterized in that it is applied to electronic equipment and/or Bluetooth devices, and the device includes: an establishment unit and a second disconnection unit.
- An establishment unit configured to establish another Bluetooth connection between the electronic device and the Bluetooth device when the electronic device and the Bluetooth device establish a Bluetooth connection, wherein the two Bluetooth connections correspond to different Bluetooth communication modes;
- the second disconnecting unit is configured to disconnect the target Bluetooth connection after the connection information of the target Bluetooth connection among the two Bluetooth connections is determined, wherein the target Bluetooth connection is the target Bluetooth connection among the two Bluetooth connections. At least one.
- embodiments of the present application further provide an electronic device, including: one or more processors; a memory; and one or more application programs, wherein the one or more application programs are stored in the memory and configured to be executed by the one or more processors, so that the electronic device implements the above method.
- an embodiment of the present application further provides a computer-readable storage medium, wherein the readable storage medium stores a program code executable by a processor, and the program code implements the above method when executed by the processor.
- Figure 1 shows a schematic diagram of a Bluetooth mode switching process provided by an embodiment of the present application
- Figure 2 shows a schematic diagram of a Bluetooth mode switching process provided by another embodiment of the present application.
- Figure 3 shows a method flow chart of a Bluetooth switching method provided by an embodiment of the present application
- Figure 4 shows a schematic diagram of a Bluetooth setting interface provided by an embodiment of the present application
- Figure 5 shows a schematic diagram of a Bluetooth mode switching process provided by yet another embodiment of the present application.
- Figure 6 shows a method flow chart of a Bluetooth switching method provided by another embodiment of the present application.
- Figure 7 shows a schematic diagram of a Bluetooth mode switching process provided by yet another embodiment of the present application.
- Figure 8 shows a module block diagram of a Bluetooth switching device provided by an embodiment of the present application.
- Figure 9 shows a module block diagram of a Bluetooth switching method provided by yet another embodiment of the present application.
- FIG10 shows a module block diagram of a Bluetooth switching device provided by another embodiment of the present application.
- Figure 11 shows a structural block diagram of an electronic device provided by an embodiment of the present application.
- Figure 12 shows a storage unit used to save or carry the program code for implementing the image display method according to the embodiment of the present application
- Figure 13 shows a module block diagram of a computer product provided by an embodiment of the present application.
- the Internet of Things is a network concept that extends and expands the user end of the "Internet concept" to any objects for information exchange and communication.
- IOT Internet of Things
- some scenarios can be configured in the IoT system.
- multiple smart devices may be involved, and multiple smart devices have a certain linkage relationship and can work together.
- the configured scenarios may include that when one device is close to another device, at least one of the two devices will perform a specified operation. Or when a device performs an operation, part of the data of the operation is processed by itself, and the other part of the data is processed by another device.
- an electronic device can be connected to an external device via Bluetooth so that the user can control the electronic device to send data to the connected device.
- the electronic device can be a smart phone, tablet computer, e-book, wireless audio player, display, etc., which has a Bluetooth module inside and can establish a Bluetooth connection with other Bluetooth devices and exchange data.
- the wireless audio player can include a Bluetooth headset or a Bluetooth speaker, etc.
- the Bluetooth protocol supports multiple Bluetooth communication modes, which may include classic Bluetooth mode and low-power audio Bluetooth mode (LE Audio).
- the classic Bluetooth mode includes three modes: basic rate (BR), enhanced rate (EDR) and high speed (HS).
- Basic rate (BR) is also called Bluetooth 1.0
- enhanced rate (EDR) can also be called Bluetooth 2.0
- high speed can also be called Bluetooth 3.0.
- Low-power audio Bluetooth mode is a Bluetooth audio transmission mode that works in low-power Bluetooth (BLE) mode.
- the low-power audio Bluetooth mode will use a new low complexity communication codec (Low Complexity Communication Codec, LC3).
- LC3 coding efficiency and quality have been greatly improved, which makes LE Audio have greater technology than the classic Bluetooth audio technology Advantage.
- connection method shown in Figure 1 has the following shortcomings because the current operating system defaults to disconnecting the existing Bluetooth link before connecting a new Bluetooth link.
- LE Audio connection also called LE Audio Bluetooth connection
- the mobile phone will first actively disconnect the classic Bluetooth connection with the headset. Then, initiate a connection with LE Audio on the headphone side, and vice versa.
- this mechanism of disconnecting and then reconnecting has the risk of instability. For example, after the classic Bluetooth connection is disconnected, the LE Audio connection with the headset cannot be successfully established, or the connection cannot be established after disconnecting the LE Audio connection.
- classic Bluetooth connection the headset will end up in a disconnected mode from the mobile phone due to the failure to connect to the desired Bluetooth communication mode, affecting the user's actual experience.
- the mobile phone plays audio data through the wireless headset, such as music playback, phone calls, etc. If the mobile phone needs to switch from a classic Bluetooth connection to a LE Audio connection, as shown in Figure 2, the mobile phone disconnects the classic Bluetooth connection and then establishes a LE Audio connection with both ears, and then establishes a connection with the Connected Isochronous Steam (CIS) ) for streaming playback under LE Audio and vice versa. Not only does the whole process take a long time, the Bluetooth communication mode switching will be silent for a long time, and there may also be a situation where the phone's external headphones are silent due to the inability to connect to LE Audio, and the entire user experience is poor.
- CIS Connected Isochronous Steam
- embodiments of the present application provide a Bluetooth switching method, device, electronic device and computer-readable medium, which can maintain the established communication mode when switching the Bluetooth communication mode between the electronic device and the Bluetooth device.
- the Bluetooth link to the new Bluetooth link is established and then disconnected, which improves the user experience.
- this application provides a Bluetooth switching method, which is applied to a communication system.
- the communication system includes an electronic device and a Bluetooth device.
- the electronic device can be the aforementioned smart phone, and the Bluetooth device can be the aforementioned wireless device. earphones.
- the execution subject of this method may be an electronic device or a Bluetooth device, or the electronic device and the Bluetooth device may be interactively executed, and the details are not limited here.
- the Bluetooth switching method includes: S301 to S303.
- S301 When a first Bluetooth connection has been established between the electronic device and the Bluetooth device, establish a second Bluetooth connection between the electronic device and the Bluetooth device.
- the Bluetooth connection may include a Bluetooth communication link established based on the Bluetooth communication protocol.
- establishing a Bluetooth connection may include establishing a Bluetooth physical link; in some embodiments, establishing a Bluetooth connection may include establishing a Bluetooth logical link, such as ACL (Asychronous Connection Oriented); in some embodiments, establishing a Bluetooth connection
- the connection may also include establishing an audio transmission protocol or other data transmission protocol based on the aforementioned link, such as Bluetooth audio transmission model protocol (Advanced Audio Distribution Profile, A2dp) and hands-free protocol (Hands-free Profile, HFP).
- Bluetooth audio transmission model protocol Advanced Audio Distribution Profile, A2dp
- hands-free protocol Hand-free Protocol
- the completion of Bluetooth connection establishment does not include establishing certain audio transmission channels, such as Synchronous Connection Oriented (SCO) and CIS, etc., but only when relevant audio services are available or under preset conditions.
- Establish audio transmission channels such as SCO or CIS. That is to say, when establishing a Bluetooth connection, the audio transmission channel will not be established immediately. Instead, the corresponding audio transmission channel will be established after a business is triggered to transmit related services.
- the Bluetooth protocols applicable to different Bluetooth communication modes may be different, so the corresponding established communication links and related transmission protocols may be different. You can refer to the regulations of the relevant Bluetooth standards, and some processes in the relevant Bluetooth connections can also refer to the relevant The provisions of the Bluetooth standard may also change as relevant standards change.
- disconnecting the Bluetooth connection may correspond to establishing the Bluetooth connection.
- the Bluetooth connection in the two may also have different meanings.
- establishing a Bluetooth connection may mean establishing a logical link such as an ACL, but disconnecting a Bluetooth connection may mean disconnecting the logical link and upper-layer communication protocol.
- disconnecting the Bluetooth connection may be understood as disconnecting all Bluetooth communication links between the two devices.
- disconnecting the Bluetooth connection can also be understood as disconnecting the upper layer protocol.
- disconnecting the Bluetooth connection means that point-to-point transmission between two devices based on the Bluetooth link is not possible.
- the first Bluetooth connection and the second Bluetooth connection correspond to different Bluetooth communication modes.
- the Bluetooth communication mode of one of the first Bluetooth connection and the second Bluetooth connection is the classic Bluetooth mode
- the Bluetooth communication mode of the other is the low-power audio Bluetooth mode (ie, the aforementioned LE Audio mode).
- the Bluetooth communication mode corresponding to the first Bluetooth connection is the classic Bluetooth mode.
- the first Bluetooth connection is the classic Bluetooth connection
- the Bluetooth communication mode corresponding to the second Bluetooth connection is the low-power audio Bluetooth mode.
- the second Bluetooth connection is a low-power audio Bluetooth connection.
- the Bluetooth communication mode corresponding to the first Bluetooth connection is the low-power audio Bluetooth mode
- the Bluetooth communication mode corresponding to the second Bluetooth connection is the classic Bluetooth mode.
- an electronic device and a Bluetooth device may simultaneously establish two Bluetooth connections with different Bluetooth communication modes, then the Bluetooth connection established first can be used as the first Bluetooth connection.
- the other Bluetooth connection can be used as the second Bluetooth connection, that is, when the first Bluetooth connection has been established between the electronic device and the Bluetooth device, the second Bluetooth connection between the electronic device and the Bluetooth device is established.
- the electronic device or the Bluetooth device can perform a Bluetooth switching operation based on a request, that is, when the first Bluetooth connection has been established between the electronic device and the Bluetooth device, a specified request is determined; in response to the specified request, a second Bluetooth connection between the electronic device and the Bluetooth device is established.
- the specified request is used to indicate the establishment of the second Bluetooth connection between the electronic device and the Bluetooth device.
- the specified request can also be understood as being used to trigger the switching of Bluetooth modes.
- the specified request can be input by the user based on the electronic device, can be input based on the Bluetooth device, or can be automatically triggered and generated under the preset application scenario.
- the specified request can be a specific instruction generated based on the user operation or according to the preset application scenario, wherein the preset application scenario can be a game application scenario, a video playback scenario or other preset scenario, which is not limited to this.
- the user taking the specified request as user input as an example, the user can input the specified request based on the electronic device, or can input the specified request based on the Bluetooth device.
- the specified request can be determined by the electronic device, and the electronic device can display a Bluetooth setting interface, which can include switches for different Bluetooth communication modes to turn on or off the corresponding Bluetooth communication mode.
- the Bluetooth setting interface can include a first switch 501 corresponding to the first Bluetooth communication mode and a second switch 502 included in the second Bluetooth communication mode, and the first switch is set to be in an on state, thereby requesting to establish a Bluetooth connection corresponding to the first Bluetooth communication mode, and the second switch is set to be in an on state, thereby requesting to establish a Bluetooth connection corresponding to the second Bluetooth communication mode between the electronic device and the Bluetooth device.
- a designated switch may be set in the Bluetooth setting interface, and the default Bluetooth mode between the electronic device and the Bluetooth device is the first Bluetooth communication mode.
- the designated switch When the designated switch is in the switched state, a second Bluetooth connection is established between the electronic device and the Bluetooth device based on the second Bluetooth communication mode.
- a first Bluetooth connection is established between the electronic device and the Bluetooth device based on the first Bluetooth communication mode. Therefore, a designated request can be input through the aforementioned second switch 502 or the designated switch.
- the specified request can be determined by the Bluetooth device. If the Bluetooth device has a screen, the Bluetooth device can also be similar to an electronic device, that is, the Bluetooth setting interface is used to obtain the specified request. If the Bluetooth device does not have a screen or the screen does not meet the display requirements of the Bluetooth device interface, the specified request can be determined by other methods, and the other methods can include at least one of gesture detection and voice detection.
- the implementation of establishing the second Bluetooth connection between the electronic device and the Bluetooth device is: while the first Bluetooth connection is kept in the connected state between the electronic device and the Bluetooth device, the Bluetooth device continues to send preset messages. Assume a broadcast, and the preset broadcast is used for establishing the second Bluetooth connection.
- the electronic device scans the preset broadcast sent by the Bluetooth device, and establishes a second Bluetooth connection between the electronic device and the Bluetooth device based on the preset broadcast.
- the broadcast carries the Bluetooth address of the Bluetooth device.
- the electronic device parses the broadcast to obtain the Bluetooth address of the Bluetooth device, and establishes a second Bluetooth connection based on the Bluetooth address.
- the Bluetooth communication mode of one of the first Bluetooth connection and the second Bluetooth connection is the classic Bluetooth mode
- the Bluetooth communication mode of the other one is the low-power audio Bluetooth mode.
- the Bluetooth communication mode corresponding to the first Bluetooth connection is the classic Bluetooth mode
- the Bluetooth communication mode corresponding to the second Bluetooth connection is the low-power audio Bluetooth mode
- the electronic device is a mobile phone
- the Bluetooth device is a Bluetooth headset
- the Bluetooth headset can be a real Wireless smart (True Wireless Stereo, TWS) headphones.
- TWS Truste Wireless Stereo
- the Bluetooth headset exchanges communication information with the device requesting connection.
- the communication information includes the communication address and other information used to establish the connection. Data, therefore, for new devices, only when the Bluetooth headset enters inquiry scan, can it be scanned by other devices, then paired with other devices, and then complete the Bluetooth connection with other devices.
- the headset that establishes a classic Bluetooth connection with the electronic device in the TWS headset is the main headset, and the main headset can be used as the Bluetooth device in this application to perform the methods in some embodiments of this application.
- the TWS headset can also be regarded as a whole.
- the classic Bluetooth connection can be understood as being established between the main headset and the electronic device
- the LE Audio Bluetooth connection can be understood as the two earphones of the TWS headset establishing connections with the electronic device respectively.
- the LE Audio Bluetooth connection may also use listening
- the master earphone can establish a classic Bluetooth connection and/or LE Audio Bluetooth connection with an electronic device, and the slave earphone can establish the aforementioned classic Bluetooth connection or LE Audio Bluetooth connection through monitoring.
- the Bluetooth headset when the Bluetooth headset enters the pairing state, the Bluetooth headset can be in the page scan state in the pairing state.
- the pairing state can also be a situation where both page scan and inquiry scan are turned on.
- the mobile phone Send the page packet, and the Bluetooth headset scans the page request sent by the mobile phone to perform a classic Bluetooth connection between the Bluetooth device and the mobile phone.
- the mobile phone can detect that the LE Audio switch is in the on state.
- the LE Audio switch is the second switch 502 of the above interface.
- the first request is triggered. (can be understood as an example of a designated request), the first request is used to indicate the establishment of a LE Audio Bluetooth connection between the electronic device and the Bluetooth device (for example, corresponding to the second Bluetooth connection), where the LE Audio Bluetooth connection can Understood as a Bluetooth connection established based on the LE Audio Bluetooth protocol, the mobile phone starts scanning the LE Audio broadcast sent by the headset based on the specified request (for example, the LE Aduio broadcast can be a low-power Bluetooth broadcast used to establish a LE Audio Bluetooth connection).
- the LE Audio broadcast can include the access address of the low-power audio Bluetooth mode of the headset, such as the BLE address. Then, the mobile phone establishes a LE Audio connection with the headset based on the LE Audio broadcast. For example, for a dual-mode Bluetooth headset, the Bluetooth headset It can also be divided into master earphones and slave earphones based on the connection relationship with electronic devices (such as mobile phones) in classic Bluetooth. The mobile phone scans the LE Audio broadcast sent by the master earphone and the LE Audio broadcast sent by the slave earphone respectively, and establishes the relationship between the mobile phone and the slave earphone respectively. The LE Audio connection between the master earphones and the LE Audio connection between the mobile phone and the slave earphones.
- the Bluetooth connection between the mobile phone and the Bluetooth headset is a LE Audio connection.
- the classic Bluetooth connection can be understood as a Bluetooth connection established based on the classic Bluetooth protocol
- the LE Audio Bluetooth connection can be understood as a Bluetooth connection established based on the LE Audio Bluetooth protocol.
- the Bluetooth connection between the mobile phone and the Bluetooth headset is an LE Audio connection
- the second request (for example, corresponding to a specified request) is detected at this time, And the second request is used to instruct to establish a classic Bluetooth connection between the electronic device (such as a mobile phone) and the Bluetooth device.
- the mobile phone establishes a classic Bluetooth connection between the mobile phone and the Bluetooth headset.
- the mobile phone connects back to BT.
- the mobile phone can generate a connection record.
- the connection record can include the Bluetooth address, pairing key, etc. of the Bluetooth headset, so that the mobile phone can directly use the Bluetooth address next time.
- reconnection can refer to directly making a Bluetooth connection with a previously connected device without performing steps such as inquiry or pairing.
- the headset sends a page (paging) packet to the Bluetooth headset to request the establishment of a classic Bluetooth connection.
- the execution subject of this method is an electronic device
- the electronic device when the first Bluetooth connection has been established between the electronic device and the Bluetooth device, the electronic device triggers a designated request, and the electronic device responds to the designated request and Establish a second Bluetooth connection between the electronic device and the Bluetooth device, the electronic device maintains the first Bluetooth connection between the electronic device and the Bluetooth device, and then, after the second Bluetooth connection is successfully established, the electronic device will The first Bluetooth connection is lost.
- the electronic device Trigger a specified request. For example, the user operates the LE Audio switch on the electronic device to input the first request.
- the electronic device Based on the first request, the electronic device starts scanning the LE Audio broadcast sent by the Bluetooth device so that the LE Audio connection can be established after scanning the broadcast. In addition, , it is also necessary to maintain the classic Bluetooth connection between the two, and then, after confirming that the LE Audio connection is successfully established, the electronic device actively disconnects the classic Bluetooth connection between the electronic device and the Bluetooth device.
- taking the first Bluetooth connection as an LE Audio connection and the second Bluetooth connection as a classic Bluetooth connection as an example, when an LE Audio connection has been established between the electronic device and the Bluetooth device, the user When the electronic device operates the LE Audio switch to input the second request, the electronic device connects back to BT and maintains the LE Audio connection between the two. After confirming that the classic Bluetooth connection is successfully established, the electronic device actively connects the electronic device and the Bluetooth device. LE Audio connection disconnected.
- the execution subject of the method is a Bluetooth device
- the Bluetooth device triggers a specified request
- the Bluetooth device responds to the specified request and establishes a second Bluetooth connection between the electronic device and the Bluetooth device
- the Bluetooth device maintains the first Bluetooth connection between the electronic device and the Bluetooth device
- the Bluetooth device disconnects the first Bluetooth connection.
- the Bluetooth device triggers a specified request, for example, the user inputs the first request by operating the Bluetooth device through voice or gesture, and the Bluetooth device starts sending LE Audio broadcasts based on the first request, so that an LE Audio connection is established after the electronic device scans the LE Audio broadcast, and in addition, the classic Bluetooth connection between the two needs to be maintained, and then, after determining that the LE Audio connection is successfully established, the Bluetooth device actively disconnects the classic Bluetooth connection between the electronic device and the Bluetooth device.
- a specified request for example, the user inputs the first request by operating the Bluetooth device through voice or gesture
- the Bluetooth device starts sending LE Audio broadcasts based on the first request, so that an LE Audio connection is established after the electronic device scans the LE Audio broadcast, and in addition, the classic Bluetooth connection between the two needs to be maintained, and then, after determining that the LE Audio connection is successfully established, the Bluetooth device actively disconnects the classic Bluetooth connection between the electronic device and the Bluetooth device.
- the Bluetooth device when an LE Audio connection has been established between the electronic device and the Bluetooth device, the user operates the LE Audio switch on the Bluetooth device to input the second request, The Bluetooth device reconnects to BT and maintains the LE Audio connection between the two. After determining that the classic Bluetooth connection is successfully established, the Bluetooth device actively disconnects the LE Audio connection between the electronic device and the Bluetooth device.
- the execution subject of this method is an electronic device and a Bluetooth device, that is, the method is an interaction process between the electronic device and the Bluetooth device
- the first Bluetooth connection has been established between the electronic device and the Bluetooth device.
- the electronic device triggers the designated request and sends the designated request to the Bluetooth device
- the Bluetooth device responds to the designated request and establishes a second Bluetooth connection between the electronic device and the Bluetooth device
- the Bluetooth device maintains the electronic device.
- a first Bluetooth connection between the electronic device and the Bluetooth device and then, after the second Bluetooth connection is successfully established, the electronic device disconnects the first Bluetooth connection.
- the execution subject of this method is an electronic device and a Bluetooth device, in addition to the aforementioned interaction process, other methods can also be used, as long as the aforementioned method can be executed through interaction.
- the functions may vary depending on the Bluetooth protocol or Bluetooth standard used to establish the Bluetooth connection, and are not limited here.
- the Bluetooth communication mode corresponding to the first Bluetooth connection can also be the low-power audio Bluetooth mode
- the Bluetooth communication mode corresponding to the second Bluetooth connection is the classic Bluetooth mode.
- connection method please refer to the above description. Here No longer.
- the embodiment of the present application can establish a second Bluetooth connection between the electronic device and the Bluetooth device when the first Bluetooth connection has been established between the electronic device and the Bluetooth device.
- the first Bluetooth connection is disconnected. That is to say, the first Bluetooth connection can be maintained during the process of establishing the second Bluetooth connection.
- the first Bluetooth connection can be disconnected. Disconnecting the first Bluetooth connection can reduce the lag when switching the first Bluetooth connection to the second Bluetooth connection, and can also avoid excessive power consumption when the first Bluetooth connection and the second Bluetooth connection are maintained at the same time. Bandwidth usage is too large.
- a data transmission channel can be established based on the second Bluetooth connection, and data can be transmitted between the electronic device and the Bluetooth device through the data transmission channel.
- the data transmission channel please refer to the description of subsequent embodiments.
- the electronic device and the Bluetooth device are transmitting data through the first Bluetooth connection, it is necessary to consider whether the data will cause lag when the Bluetooth connection is switched, and to reasonably select the disconnection time of the first Bluetooth connection.
- the first Bluetooth connection data is not transmitted between the electronic device and the Bluetooth device through the first Bluetooth connection, then the second Bluetooth connection can be successfully established and the first Bluetooth connection has been established.
- the first Bluetooth connection is disconnected. That is to say, after the second Bluetooth connection is successfully established, a data transmission channel is established on the established second Bluetooth connection. In this case, disconnect the first Bluetooth connection.
- the data transmission channel of the second Bluetooth connection can be established in advance, so that when the second Bluetooth connection is subsequently used to transmit data, the data transmission channel does not need to be established and the established data transmission channel can be directly used.
- the second Bluetooth connection has more advantages than the first Bluetooth connection in terms of stability and transmission quality of data transmission, then although the first Bluetooth connection is not used to transmit data between the electronic device and the Bluetooth device, when the second Bluetooth connection is established, it can be considered that there is a high probability that the second Bluetooth connection will be used to transmit data between the electronic device and the Bluetooth device.
- the data transmission channel can be established in advance, and the first Bluetooth connection can be disconnected after the establishment of the data transmission channel, thereby completing the operation of switching the first Bluetooth connection to the second Bluetooth connection.
- the first Bluetooth connection can be disconnected. open. That is, in the case where the first Bluetooth connection does not transmit preset data, the implementation of disconnecting the first Bluetooth connection after the second Bluetooth connection is successfully established is to disconnect the first Bluetooth connection after the second Bluetooth connection is successfully established. After establishment, the first Bluetooth connection is disconnected before a data transmission channel is established on the second Bluetooth connection.
- this application provides a Bluetooth switching method, which is applied to a communication system.
- the communication system includes an electronic device and a Bluetooth device.
- the electronic device can be the aforementioned smart phone, and the Bluetooth device can be the aforementioned wireless device.
- Headphones in some embodiments, the execution subject of this method may be an electronic device, or a Bluetooth device, or the electronic device and the Bluetooth device may be executed interactively, which is not limited here.
- the Bluetooth switching method includes: S601 to S603.
- S601 When the first Bluetooth connection has been established between the electronic device and the Bluetooth device and the first Bluetooth connection is used to transmit the preset data, continue to use the first Bluetooth connection to transmit the preset data, establish the A second Bluetooth connection between the electronic device and the Bluetooth device.
- the preset data may be data that the electronic device needs to send to the Bluetooth device through Bluetooth communication between the electronic device and the Bluetooth device, and the Bluetooth device performs preset processing (such as music data, call data, voice data wait).
- the preset processing may include operations such as storage and playback.
- the Bluetooth device can process the preset data while acquiring and processing it, that is, the electronic device and the Bluetooth device transmit and process the preset data in real time.
- the Bluetooth device also processes the preset data.
- the data processing method may not be real-time, that is, it may be transmitted first, and then the transmitted data will be processed after the amount of transmitted data meets a preset threshold. Therefore, in order to avoid the interruption of data transmission, which will cause the Bluetooth device to interrupt the processing of the preset data, the stability and continuity of Bluetooth communication need to be maintained between the electronic device and the Bluetooth device.
- the connection between the electronic device and the Bluetooth device may be established based on the aforementioned specified request.
- a second Bluetooth connection between said Bluetooth devices is determined, and in response to the designated request, the first Bluetooth connection is continued to be used for transmission.
- the preset data establishes a second Bluetooth connection between the electronic device and the Bluetooth device.
- the preset data cannot be transmitted before the second Bluetooth connection is established, so it is necessary to continue
- the first Bluetooth connection is used to transmit the preset data. If the first Bluetooth connection is a LE Audio Bluetooth connection, taking the preset data as music data or call data as an example, then continuing to use the first Bluetooth connection to transmit the preset data can be understood as A CIS link is established based on the first Bluetooth connection, and preset data is transmitted based on the CIS link.
- the first Bluetooth connection is a classic Bluetooth connection and the preset data is call data
- continuing to use the first Bluetooth connection to transmit the preset data can be understood as establishing an SCO link based on the first Bluetooth connection and transmitting based on the SCO link.
- the corresponding transmission link for the preset data can be determined according to the type of the preset data, the Bluetooth mode used, and the relevant provisions of the Bluetooth standard.
- the electronic device may continue to use the first Bluetooth connection to transmit the preset data and establish a connection between the electronic device and the Bluetooth device while the first Bluetooth connection remains connected. to ensure that the user can still listen to the audio during the process of establishing the second Bluetooth connection.
- the second Bluetooth connection data transmission channel can transmit the preset data between the electronic device and the Bluetooth device through this data transmission channel.
- other data that can be supported by the data transmission channel can also be transmitted, which will not be discussed here. limited.
- the SCO link can be used to transmit the data in classic Bluetooth
- the CIS link is used for transmission in LE Audio Bluetooth
- the ACL link can be used in classic Bluetooth and transmitted based on the A2DP protocol
- the CIS link can be used in LE Audio Bluetooth.
- the provisions of the relevant Bluetooth standards For some links, such as SCO or CIS, they may be established only when there is a business demand.
- the SCO link when there is a call service in classic Bluetooth, the SCO link will be established, and the SCO link will be disconnected after the service is completed, which saves power consumption to a certain extent.
- the corresponding CIS link when there is a playback service such as music or call in LE Aduio Bluetooth, the corresponding CIS link will be triggered to be established, and the CIS will be disconnected after the service is completed. It takes a certain amount of time to establish audio transmission channels such as SCO or CIS.
- the first Bluetooth connection can be disconnected when an audio transmission channel (such as SCO or CIS) is established on the basis of the second Bluetooth connection, so that the audio transmission can be quickly switched to the second Bluetooth connection, reducing the interruption felt by the user due to switching Bluetooth modes, thereby improving the user experience.
- the second Bluetooth connection is a classic Bluetooth mode
- the preset data is music data or other data transmitted based on an ACL link
- the first Bluetooth connection can be disconnected when the second Bluetooth connection is established, wherein the second Bluetooth connection may include an ACL link and an A2DP protocol connection.
- establishing the second Bluetooth connection can also be understood as establishing the ACL link and establishing data transmission.
- the channel is understood to establish the A2DP protocol based on the ACL, so that the first Bluetooth connection can be disconnected after the A2DP protocol is established.
- some preset data may need to establish a data transmission channel when business occurs. Therefore, in order to avoid disconnecting the first Bluetooth connection and then establishing the data transmission channel of the second Bluetooth connection, which will cause the user to perceive a longer playback time. Interrupted, the control is to disconnect the first Bluetooth connection after the data transmission channel of the second Bluetooth connection is established. The user experience is better. Furthermore, the transmission of the preset data can be switched to the data transmission channel of the second Bluetooth connection. Disconnecting the first Bluetooth connection further reduces the user's perception of interruption when switching, and disconnecting the first Bluetooth connection can save bandwidth and further ensure the stability of data transmission by the second Bluetooth connection, thereby ensuring the stability of playback.
- the second Bluetooth connection can be used as a physical link between the electronic device and the Bluetooth device. If it is necessary to transmit the preset based on the second Bluetooth connection data, a logical channel for data transmission needs to be established based on the physical link. For example, for the classic Bluetooth mode, electronic A classic Bluetooth link is established between the device and the Bluetooth device. The classic Bluetooth link can be a physical link between the electronic device and the Bluetooth device. A logical link can be established on the physical link and data can be established based on the logical link. transmission channel.
- the data transmission channel for the classic Bluetooth communication mode may be the above-mentioned A2DP protocol and/or SCO link
- the data transmission channel for the low-power audio Bluetooth mode may be the aforementioned CIS audio transmission channel. Therefore, after the second Bluetooth connection between the electronic device and the Bluetooth device is successfully established, and after the data transmission channel is successfully established based on the second Bluetooth connection, the electronic device can transfer the preset data based on the data transmission channel. Sent to Bluetooth device.
- the second Bluetooth link may correspond to multiple moments, and the multiple moments are respectively the first moment, the second moment and the third moment, wherein the first moment is between the electronic device and the Bluetooth device.
- the moment when the second Bluetooth connection is successfully established the second moment is the moment when the electronic device starts to perform the operation of establishing a data transmission channel based on the established second Bluetooth link
- the third moment is the moment when the data transmission channel is successfully established.
- each of the aforementioned moments may be a preset time range of the precise time node at which the event corresponding to each moment occurs. That is to say, it may be that the electronic device knows the third communication between the aforementioned electronic device and the Bluetooth device. 2.
- Each moment when the Bluetooth link is successfully established the operation of establishing a data transmission channel is started, and the data transmission channel is successfully established.
- the first Bluetooth connection in response to the specified request, while the first Bluetooth connection remains connected, continue to use the first Bluetooth connection to transmit the preset data, and establish the relationship between the electronic device and the Bluetooth device. After the second Bluetooth connection between the two parties, the first Bluetooth connection can be disconnected based on any of the above-mentioned first moment, second moment and third moment, which will be explained separately below.
- this embodiment of the present application can disconnect the first Bluetooth connection at the moment when the electronic device determines that the second Bluetooth link between the electronic device and the Bluetooth device has been successfully established, that is, the first moment.
- the time consumed in establishing the data transmission channel may be relatively small, it is not necessary to wait until the data transmission channel is successfully established before disconnecting the first Bluetooth connection. Instead, it is possible to confirm that the electronic device and the Bluetooth device When the second Bluetooth link between them has been successfully established, the first Bluetooth connection is disconnected.
- the first Bluetooth connection may be disconnected when it is determined that the second Bluetooth link is successfully established. For example, after the second Bluetooth connection is successfully established, it is detected whether the second Bluetooth connection needs to be used to transmit the preset data; if it is necessary to use the second Bluetooth connection to transmit the preset data, after the second Bluetooth connection has been established, Establish a data transmission channel on the second Bluetooth connection and disconnect the first Bluetooth connection. If there is no need to use the second Bluetooth connection to transmit the preset data, when the second Bluetooth connection has been successfully established, disconnect the first Bluetooth connection.
- the implementation method of determining whether the second Bluetooth connection needs to be used to transmit the preset data may be to determine the remaining transmission time of the preset data.
- the method of determining the remaining transmission time is to determine the remaining data of the preset data that is not currently transmitted, Determine the time required for the electronic device to send the remaining data to the Bluetooth device based on the first Bluetooth connection, record it as the remaining time, and use the time interval between the first moment and the third moment as the preset time, and the preset time It can represent the time required to successfully establish the second Bluetooth connection between the electronic device and the Bluetooth device and establish the data transmission channel of the second Bluetooth connection. If the remaining time is less than or equal to the preset time, it is determined that there is no need to use the third Bluetooth connection.
- the second Bluetooth connection transmits the preset data. That is to say, when the data transmission channel of the second Bluetooth connection is successfully established, the preset data has been transmitted through the first Bluetooth connection. If the remaining time is greater than the preset time, Then it is determined that the second Bluetooth connection needs to be used to transmit the preset data.
- the electronic device after receiving the specified request, it is determined whether the electronic device establishes the second Bluetooth connection for transmitting preset data. For example, the electronic device uses the first Bluetooth connection to transmit the preset data, and at this time, the transmission object of the first Bluetooth connection is the preset data. After detecting the specified request, keep the electronic device to continue to use the first Bluetooth connection to transmit preset data, and determine whether a switching request is detected before the electronic device successfully establishes the second Bluetooth connection. The data switching request is used to request switching between the electronic device and the second Bluetooth connection. Data transmitted between Bluetooth devices. As an implementation method, the input of the data switching request can be determined based on the activation of a specified function detected by the electronic device. The specified function may not be used to transmit preset data but to transmit other data. Function.
- the designation request may include a switching request. That is to say, the designation request may be used to indicate establishing a second Bluetooth connection between the electronic device and the Bluetooth device and trigger switching between the electronic device and the Bluetooth device. data transferred between.
- the electronic device and the Bluetooth device when the electronic device and the Bluetooth device have established a first Bluetooth connection and the user uses the Bluetooth device to play a song, the electronic device and the Bluetooth device transmit the data of the song through the first Bluetooth connection.
- the user triggers the electronic device Voice call function Yes, it is possible to request a real-time voice call using a Bluetooth device.
- the electronic device and the Bluetooth device intend to transmit the voice data generated during the voice call through the second Bluetooth connection. Therefore, the transmission object corresponding to the first Bluetooth connection and the transmission corresponding to the second Bluetooth connection The objects are different, and it can be determined that there is no need to use the second Bluetooth connection to transmit the preset data. Otherwise, the transmission object corresponding to the first Bluetooth connection is the same as the transmission object corresponding to the second Bluetooth connection, and it can be determined that the second Bluetooth connection needs to be used.
- the connection transmits the preset data.
- the embodiment of the present application can start the operation of establishing a data transmission channel based on the second Bluetooth connection after the electronic device knows that the second Bluetooth link between the electronic device and the Bluetooth device has been successfully established. That is, at the second moment, the first Bluetooth connection is disconnected.
- the time consumed in establishing the data transmission channel may be relatively small, it is not necessary to wait until the data transmission channel is successfully established before disconnecting the first Bluetooth connection. Instead, it may be determined that the electronic device starts to establish data.
- the first Bluetooth connection is disconnected at the moment of transmission channel.
- this embodiment of the present application may also disconnect the first Bluetooth connection when the electronic device determines that the data transmission channel has been successfully established, that is, at the third moment.
- the method may be executed after it is determined that the electronic device needs to use the second Bluetooth connection to transmit the preset data. For example, after the second Bluetooth connection is successfully established, it is detected whether the second Bluetooth connection needs to be used to transmit the preset data; if it is necessary to use the second Bluetooth connection to transmit the preset data, after the second Bluetooth connection has been established, Establish a data transmission channel on the Bluetooth connection. If the data transmission channel is successfully established, disconnect the first Bluetooth connection, or establish a data transmission channel on the established second Bluetooth connection. If it is determined that the second Bluetooth connection has been used Connect the corresponding data transmission channel to transmit the preset data, and then disconnect the first Bluetooth connection.
- a designated part of the preset data may be sent to the Bluetooth device through the data transmission channel, wherein the designated part of the data is in the first Part of the preset data that is not transmitted when a Bluetooth connection is disconnected.
- the Bluetooth device is a Bluetooth headset
- the first Bluetooth connection is a classic Bluetooth connection.
- the audio stream playback operation is performed. That is, the electronic device sends audio data to the Bluetooth headset through the classic Bluetooth connection, and the Bluetooth headset plays the audio data.
- the mobile phone can detect that the LE Audio switch is on.
- the LE Audio switch It is the second switch 502 of the above interface.
- the first request is triggered. The first request is used to instruct the establishment of the LE Audio connection between the electronic device and the Bluetooth device (i.e.
- the mobile phone starts scanning the LE Audio broadcast sent by the headset based on the specified request.
- the LE Audio broadcast includes the access address of the low-power audio Bluetooth mode of the headset. For example, if the first request is triggered by the mobile phone , the mobile phone sends the first request to the headset through the first Bluetooth connection, and the headset starts sending LE Audio broadcast in response to the first request.
- the headset can also send LE Audio broadcasts based on user triggers. For example, the user triggers the first request on the mobile phone side and triggers the headset on the headset side to send LE Audio broadcast. It can also be that the first request is triggered by the headset.
- the headset sends the LE Audio broadcast based on the first request.
- the headset sends the first request to the mobile phone through the first Bluetooth connection.
- the mobile phone starts scanning the LE Audio broadcast. After successfully obtaining the LE Audio A connection request is initiated after Audio broadcast.
- the headset establishes a LE Audio connection with the headset based on the LE Audio broadcast.
- the Bluetooth headset includes a master headset and a slave headset.
- the mobile phone scans and obtains the LE Audio broadcast sent by the master headset and the LE Audio broadcast sent by the slave headset, respectively.
- the phone then disconnects the classic Bluetooth connection between the phone and the headset (e.g. the main headset).
- the Bluetooth connection between the mobile phone and the Bluetooth headset is a LE Audio connection.
- the mobile phone establishes a CIS channel, which is a data transmission channel, based on the LE Audio connection.
- a CIS channel which is a data transmission channel
- the mobile phone can use the CIS to continue transmitting the audio data corresponding to the aforementioned audio stream playback operation.
- the Bluetooth connection between the mobile phone and the Bluetooth headset is a LE Audio connection
- the LE Audio switch is switched to the off state
- the second request is detected at this time, and the second request is used to indicate A classic Bluetooth connection is established between the electronic device and the Bluetooth device.
- the mobile phone establishes a classic Bluetooth connection between the electronic device and the Bluetooth headset. For example, the mobile phone connects back to BT.
- the embodiment of the present application is aimed at detecting a request indicating the establishment of a second Bluetooth connection between the electronic device and the Bluetooth device when the first Bluetooth connection is being used to transmit data. Afterwards, when it is determined that the second Bluetooth connection is successfully established, a data transmission channel is started to be established based on the second Bluetooth connection, or the data transmission channel is successfully established, the first Bluetooth connection is disconnected to reduce the risk of interruption of data transmission. Negative impact.
- the Bluetooth switching device 800 may include: a connection unit 801 and a first disconnection unit 802.
- the connection unit 801 is configured to establish a second Bluetooth connection between the electronic device and the Bluetooth device when a first Bluetooth connection has been established between the electronic device and the Bluetooth device.
- the first disconnecting unit 802 is configured to disconnect the first Bluetooth connection after the second Bluetooth connection is successfully established.
- connection unit 801 is also used when a first Bluetooth connection has been established between the electronic device and the Bluetooth device.
- the designation request is determined, and in response to the designation request, a second Bluetooth connection is established between the electronic device and the Bluetooth device.
- a first Bluetooth connection has been established between the electronic device and the Bluetooth device.
- preset data is transmitted between the electronic device and the Bluetooth device; the connection unit 801 is also configured to respond to the specified request and continue to use the first Bluetooth connection when the first Bluetooth connection remains connected.
- the first Bluetooth connection transmits the preset data and establishes a second Bluetooth connection between the electronic device and the Bluetooth device.
- connection unit 801 is further configured to, in response to the specified request, scan the preset broadcast sent by the Bluetooth device while the first Bluetooth connection remains connected; establish the electronic communication based on the preset broadcast. A second Bluetooth connection between the device and the Bluetooth device.
- first disconnecting unit 802 is also configured to establish a data transmission channel on the established second Bluetooth connection and disconnect the first Bluetooth connection after the second Bluetooth connection is successfully established.
- the data transmission channel is used to transmit the preset data
- the first disconnecting unit 802 is also configured to detect whether the second Bluetooth connection needs to be used to transmit the preset data after the second Bluetooth connection is successfully established; if it is necessary to use the second Bluetooth connection to transmit the preset data, data, establish a data transmission channel on the established second Bluetooth connection, and disconnect the first Bluetooth connection.
- the first disconnection unit 802 is also configured to, after the second Bluetooth connection is successfully established, if no data transmission is established on the second Bluetooth connection. Before the channel, disconnect the first Bluetooth connection.
- first disconnecting unit 802 is also configured to disconnect the first Bluetooth connection when the second Bluetooth connection is successfully established if the second Bluetooth connection is not needed to transmit the preset data.
- the first disconnecting unit 802 is also configured to establish a data transmission channel on the established second Bluetooth connection; if the data transmission channel is successfully established, disconnect the first Bluetooth connection.
- the first disconnecting unit 802 is also configured to, if the data transmission channel is successfully established, after disconnecting the first Bluetooth connection, send the specified part of the preset data to the data transmission channel through the data transmission channel.
- Bluetooth device wherein the specified partial data is the partial data in the preset data that is not transmitted when the first Bluetooth connection is disconnected.
- Figure 9 shows a Bluetooth connection method provided by an embodiment of the present application. It can be applied to electronic devices, Bluetooth devices, and a system composed of electronic devices and Bluetooth devices.
- the Bluetooth Connection methods include: S901 to S902.
- S902 After the connection information of the target Bluetooth connection among the two Bluetooth connections is determined, disconnect the target Bluetooth connection, wherein the target Bluetooth connection is at least one of the two Bluetooth connections.
- Bluetooth connection When a Bluetooth connection is established between the electronic device and the Bluetooth device, another Bluetooth connection is established between the electronic device and the Bluetooth device, where the two Bluetooth connections correspond to different Bluetooth communication modes.
- electronic devices and Bluetooth devices can be devices that support multi-mode Bluetooth, which means that they can support different Bluetooth communication modes, such as classic Bluetooth communication, LE Audio Bluetooth communication, and of course other Bluetooth communications. Way. For example, one of the Bluetooth connections corresponds to the classic Bluetooth connection, and the other Bluetooth connection corresponds to the LE Audio Bluetooth connection.
- connection process may occur during the first connection between the electronic device and the Bluetooth device, such as the pairing connection with the electronic device after the headset is opened for the first time, or the pairing connection with the mobile phone after the headset is restored to factory settings.
- the connection information of the two Bluetooth connections such as Bluetooth addresses, pairing information, etc., to facilitate subsequent Bluetooth connections.
- another Bluetooth connection between the electronic device and the Bluetooth device is established.
- the process of establishing a Bluetooth connection between the electronic device and the Bluetooth device may be after establishing a classic Bluetooth communication link (such as an ACL link).
- the connection information of another Bluetooth connection such as the Bluetooth address, can be obtained during the establishment process of the Bluetooth connection, thereby speeding up the establishment of the other Bluetooth connection.
- another Bluetooth connection between the electronic device and the Bluetooth device is established.
- another Bluetooth connection is established. For example, after the upper layer transmission protocol is established on the basis of the established communication link, another Bluetooth connection is established.
- the target Bluetooth connection is disconnected.
- one of the two Bluetooth connections can be set as the target Bluetooth connection.
- the LE Audio Bluetooth connection can be set as the target Bluetooth connection.
- the target Bluetooth connection can be a factory default setting or can be set by the user.
- a Bluetooth connection can be used to represent the Bluetooth connection that needs to be disconnected after the electronic device and the Bluetooth device establish a Bluetooth connection and obtain the connection information of the target Bluetooth connection when there is no connection information (such as Bluetooth address, pairing information, etc.) (such as restoring factory settings or pairing for the first time).
- connection information may mean that there is no connection information such as pairing information in the electronic device and/or the Bluetooth device, so that the Bluetooth connection cannot be established through reconnection, and re-pairing is required.
- connection information in order to ensure that subsequent use does not require pairing to increase the switching speed between two Bluetooth connections and simplify user operations, you can first obtain the corresponding information of the two Bluetooth connections by establishing two Bluetooth connections. Connection information. Since the non-target Bluetooth connection among the two Bluetooth connections will not be disconnected by default after the first connection, the connection information corresponding to the non-target Bluetooth connection will definitely be obtained eventually. When disconnecting the target Bluetooth connection, you need to consider whether to obtain it.
- the act of establishing the target Bluetooth connection this time may be meaningless. For example, you can disconnect the target Bluetooth connection immediately after determining the connection information of the target Bluetooth connection, or you can disconnect it after the target Bluetooth connection is established, or you can disconnect it only when there is a playback service request, because when the playback service is executed , maintaining two Bluetooth connections at the same time may affect bandwidth and thus playback.
- the two Bluetooth connections include a first Bluetooth connection and a second Bluetooth connection, where the second Bluetooth connection is the target Bluetooth connection, and the first Bluetooth connection and the second Bluetooth connection correspond to different Bluetooth communication modes; for example, the first Bluetooth connection
- the Bluetooth connection corresponds to the LE Audio Bluetooth connection
- the second Bluetooth connection corresponds to the classic Bluetooth connection.
- the electronic device may establish a first Bluetooth connection with the Bluetooth device when the electronic device establishes a second Bluetooth connection with the Bluetooth device.
- connection information for subsequent connections by establishing two Bluetooth connections for the first time it is also necessary to store the first Bluetooth connection information and the first Bluetooth connection information of the first Bluetooth connection on the electronic device side and/or the Bluetooth device side. Second Bluetooth connection information of the second Bluetooth connection.
- disconnecting the target Bluetooth connection can be understood as:
- the second Bluetooth connection is disconnected.
- a second Bluetooth connection is established between the electronic device and the Bluetooth device; when the electronic device establishes a second Bluetooth connection with the Bluetooth device, the electronic device establishes a second Bluetooth connection with the Bluetooth device.
- the first Bluetooth connection That is to say, the user can establish two Bluetooth connections at the same time with only one operation, thus facilitating the user's operation.
- the electronic device can obtain the LE Audio Bluetooth address of the Bluetooth device (such as BLE address), and then upon receiving the LE Audio Bluetooth broadcast with the LE Audio Bluetooth address, initiate a LE Audio Bluetooth connection with the Bluetooth device, so that the user does not need to trigger the connection twice when establishing a dual Bluetooth connection for the first time, but Two Bluetooth connections can be achieved with one trigger.
- the CSIP protocol in the Bluetooth standard can be used to complete the connection of a group of Bluetooth devices.
- the CSIP protocol in the Bluetooth standard can be used to complete the connection of a group of Bluetooth devices.
- the user connection operation can be performed on an electronic device or a Bluetooth device.
- the electronic device such as a mobile phone, tablet, computer, TV, etc.
- a Bluetooth display interface such as a Bluetooth setting interface, a Bluetooth device, etc.
- Management APP interface such as a Bluetooth setting interface, a Bluetooth device, etc.
- connection pop-up interface the user can select the corresponding Bluetooth device in the Bluetooth display interface and click the connect button to trigger the Bluetooth connection.
- the Bluetooth device is a device with a display, such as a visual speaker, TV, etc., you can also refer to the electronic device
- the Bluetooth device is a headset, it can feedback the user's selection through voice and other methods, and the user can trigger the connection by controlling the controls on the headset.
- the above Bluetooth connection method can be combined with the relevant embodiments of the previous Bluetooth switching method to combine technical features, technical means or embodiments, that is to say, first obtain the connection information of the two Bluetooth connections through the above Bluetooth connection method, and then Keep one Bluetooth connection, and there is no need to pair it when switching to another Bluetooth connection. For example, you can connect back directly, thereby reducing the time for establishing a Bluetooth connection, increasing the switching speed, and making it convenient for users.
- the Bluetooth connection method further includes (the following part can also be understood as a Bluetooth switching method):
- the specified request can be generated on an electronic device or on a Bluetooth device.
- the user touches a control on the Bluetooth device to trigger the generation of the specified request.
- the specified request can also refer to the aforementioned Bluetooth device. Descriptions in relevant embodiments of the switching method.
- the first Bluetooth connection is disconnected.
- the communication link may include a physical link or a logical link.
- the probability of successful connection becomes higher after the communication link is established. Therefore, it may be considered to disconnect the first Bluetooth connection after the communication link is established.
- a first implementation manner when the physical link connection of the second Bluetooth connection is determined, disconnect the first Bluetooth connection.
- Second implementation manner when it is determined that the logical link of the second Bluetooth connection is established, disconnect the first Bluetooth connection.
- the above logical link may be an ACL link.
- the first Bluetooth connection when it is determined that the audio transmission protocol of the second Bluetooth connection is established, the first Bluetooth connection is disconnected. It can be understood that if the second Bluetooth connection is a classic Bluetooth connection, the audio transmission protocol may be the A2dp protocol, HFP protocol, etc. of classic Bluetooth.
- the fourth implementation manner when it is determined that the audio transmission channel of the second Bluetooth connection is established, disconnect the first Bluetooth connection. It can be understood that if the second Bluetooth connection is a classic Bluetooth connection, the audio transmission channel may be SCO; if the second Bluetooth connection is a LE Audio Bluetooth connection, the audio transmission channel may be CIS.
- the fifth implementation manner after determining to use the second Bluetooth connection to transmit audio data, disconnect the first Bluetooth connection. It is understandable that the first Bluetooth connection can be disconnected only when the transmission of audio data is completely switched to the second Bluetooth connection, thereby reducing the interruption time caused by the Bluetooth communication mode switching.
- the execution subject of the above embodiments may be an electronic device or a Bluetooth device.
- ACL electronic device
- SCO SCO
- CIS CIS
- A2dp Bluetooth device
- HFP Bluetooth standard protocol
- the above implementation can also be used as a feasible implementation of "disconnecting the first Bluetooth connection after the second Bluetooth connection is successfully established" in the aforementioned Bluetooth switching method.
- switching can be performed according to any of the above implementations.
- the method further includes:
- the first Bluetooth connection is disconnected after it is determined that the first audio transmission protocol of the second Bluetooth connection is established; or, the first Bluetooth connection is disconnected after it is determined that the first service is performed based on the second Bluetooth connection.
- the first service may be an audio playback service that requires high sound quality, such as a music playback service, or the first service may be an audio playback service that does not require high real-time performance, such as a voice message playback service.
- the Bluetooth connection information of the first Bluetooth connection and the second Bluetooth connection has been stored, the second Bluetooth connection is established directly through a back-to-back connection.
- the first service does not need to establish a SCO audio transmission channel. It only needs to establish the first audio transmission protocol (such as the A2dp protocol) and then transmit audio data based on the ACL link.
- the first service when the first service is in progress To switch the Bluetooth communication mode, you can first use the first Bluetooth connection to perform the first service, and then disconnect the first Bluetooth connection after the second Bluetooth connection has the ability to transmit audio data. Furthermore, it is also possible to wait until the audio data of the first service is switched to the second Bluetooth connection for transmission before disconnecting the first Bluetooth connection, thereby further reducing the interruption time caused by the switching.
- the method further includes: performing a second service on the electronic device In the case of, in response to the specified request, when the second service is performed through the first Bluetooth connection, a second Bluetooth connection between the electronic device and the Bluetooth device is established.
- the second service can be an audio service with high real-time requirements, such as a call service, a voice call service or a video call service.
- a second audio transmission channel (such as SCO) needs to be established for the second service. ) can be played. Therefore, the following strategy can be used to disconnect the first Bluetooth connection.
- the first Bluetooth connection can be disconnected after it is determined that the second audio transmission protocol of the second Bluetooth connection is established; it can be understood that in classic Bluetooth, the second audio transmission protocol can be the HFP protocol, and the HFP protocol is established Disconnecting the first Bluetooth connection can shorten the interruption time to a certain extent, and further trigger the establishment of the SCO channel.
- the first Bluetooth connection is disconnected; it can be understood that since the second service needs to be transmitted on the SCO channel of the classic Bluetooth connection, therefore, after determining that the second Bluetooth connection Disconnecting the first Bluetooth connection after the connected first audio transmission channel (such as SCO) is established can further shorten the interruption time caused by switching the Bluetooth communication mode.
- the first Bluetooth connection is disconnected after it is determined that the second service is performed based on the second Bluetooth connection. It can be understood that after the classic Bluetooth SCO is established and the audio data of the second service is transferred from the first Bluetooth connection to the second Bluetooth connection for transmission, disconnecting the first Bluetooth connection can further shorten the above-mentioned interruption time.
- the electronic device can directly page the page to connect back to the Bluetooth device, or the Bluetooth device can directly page the page to connect back to the electronic device.
- the method further includes: when the electronic device performs a third service Next, in response to the specified request, when the third service is performed through the first Bluetooth connection, establish a second Bluetooth connection between the electronic device and the Bluetooth device;
- the third service can be an audio transmission service, which can include the business scenarios exemplified in the above-mentioned first service and second service.
- the second audio transmission channel in this embodiment may be a CIS or BIS channel. After the second audio transmission channel is established, the audio transmission data of the third service may be switched to the second Bluetooth connection for transmission and then disconnected.
- the first Bluetooth connection further reduces audio playback interruption time caused by switching Bluetooth communication modes.
- the first service, the second service, and the third service may correspond to the preset data in the related embodiments of the aforementioned Bluetooth switching method.
- the Bluetooth device can also be set to start playing LE Audio Bluetooth broadcasts when it receives a specified request. If the user is on an electronic device To enable LE Audio triggered by the terminal, you can send instructions (such as specified requests or other instructions) to the Bluetooth device through the first Bluetooth connection to trigger the Bluetooth device to turn on LE Audio Bluetooth broadcast. After receiving the LE Audio Bluetooth broadcast, the electronic device initiates the establishment of LE Audio. Audio Bluetooth connection request, and then establish LE Audio Bluetooth connection. During the process of establishing the second Bluetooth connection, the first Bluetooth connection is still used to perform the first service, thus shortening the switching time perceived by the user and improving the user experience.
- instructions such as specified requests or other instructions
- FIG. 10 shows a structural block diagram of a Bluetooth switching device provided by an embodiment of the present application.
- the Bluetooth switching device 1000 may include: an establishment unit 1001 and a second disconnection unit 1002.
- Establishing unit 1001 configured to establish another Bluetooth connection between the electronic device and the Bluetooth device when the electronic device and the Bluetooth device establish a Bluetooth connection, wherein the two Bluetooth connections correspond to different Bluetooth communication modes. .
- the second disconnecting unit 1002 is configured to disconnect the target Bluetooth connection after the connection information of the target Bluetooth connection in the two Bluetooth connections is determined, wherein the target Bluetooth connection is one of the two Bluetooth connections. of at least one.
- the two Bluetooth connections include a first Bluetooth connection and a second Bluetooth connection, wherein the second Bluetooth connection is the target Bluetooth connection, and the first Bluetooth connection and the second Bluetooth connection correspond to different
- the establishment unit 1001 is also configured to establish the first Bluetooth connection between the electronic device and the Bluetooth device when the electronic device establishes the second Bluetooth connection.
- the second disconnecting unit 1002 is also configured to disconnect the second Bluetooth connection after determining the connection information of the second Bluetooth connection; or, after determining the connection information of the first Bluetooth connection and the second Bluetooth connection, After connecting the connection information, disconnect the second Bluetooth connection; or, after determining that the first Bluetooth connection is established, disconnect the second Bluetooth connection; or, after determining that the first Bluetooth connection and the After the establishment of the second Bluetooth connection is completed, the second Bluetooth connection is disconnected.
- the second disconnecting unit 1002 is also configured to store the first Bluetooth connection information of the first Bluetooth connection and the second Bluetooth connection information of the second Bluetooth connection after disconnecting the second Bluetooth connection.
- the establishment unit 1001 is also configured to establish a second Bluetooth connection between the electronic device and the Bluetooth device in response to a connection operation; in the case where the electronic device establishes a second Bluetooth connection with the Bluetooth device, the The electronic device establishes the first Bluetooth connection with the Bluetooth device.
- the second disconnecting unit 1002 is also configured to, after disconnecting the second Bluetooth connection, when a first Bluetooth connection has been established between the electronic device and the Bluetooth device, establish a connection between the electronic device and the Bluetooth device.
- the second Bluetooth connection between the Bluetooth devices controls the first Bluetooth connection to remain connected; after the communication link of the second Bluetooth connection is successfully established, the first Bluetooth connection is disconnected.
- the communication link may include a physical link or a logical link.
- the second disconnecting unit 1002 is configured to disconnect the first Bluetooth connection after determining the physical link connection of the second Bluetooth connection.
- Bluetooth connection or, the second disconnecting unit 1002 is configured to disconnect the first Bluetooth connection after determining the logical link connection of the second Bluetooth connection; or, after determining the audio transmission protocol of the second Bluetooth connection After establishment, disconnect the first Bluetooth connection; or, after determining that the audio transmission channel of the second Bluetooth connection is established, disconnect the first Bluetooth connection; or, after determining to use the second Bluetooth connection for transmission After receiving the audio data, disconnect the first Bluetooth connection.
- the first Bluetooth connection is a LE Audio Bluetooth connection
- the second Bluetooth connection is a classic Bluetooth connection
- the second disconnecting unit 1002 is used to disconnect the second Bluetooth connection through the third Bluetooth connection.
- a Bluetooth connection performs the first service, establish a second Bluetooth connection between the electronic device and the Bluetooth device; disconnect all the connections after determining that the first audio transmission protocol of the second Bluetooth connection is established. the first Bluetooth connection; or, disconnect the first Bluetooth connection after determining to perform the first service based on the second Bluetooth connection.
- the first service includes a music playing service or a voice message playing service.
- the first Bluetooth connection is a LE Audio Bluetooth connection
- the second Bluetooth connection is a classic Bluetooth connection
- the second disconnecting unit 1002 is also used to perform the second service through the first Bluetooth connection.
- establishing a second Bluetooth connection between the electronic device and the Bluetooth device disconnecting the first Bluetooth connection after determining that the second audio transmission protocol of the second Bluetooth connection is established; or, after determining that the second audio transmission protocol of the second Bluetooth connection is established; After the first audio transmission channel of the second Bluetooth connection is established, the first Bluetooth connection is disconnected; or, after it is determined that the second service is performed based on the second Bluetooth connection, the first Bluetooth connection is disconnected.
- the second service includes a call service, a voice call service or a video call service.
- the first Bluetooth connection is a classic Bluetooth connection
- the second Bluetooth connection is an LE Audio Bluetooth connection.
- the second disconnection unit 1002 is further used to, after disconnecting the second Bluetooth connection, establish a second Bluetooth connection between the electronic device and the Bluetooth device while executing the third service through the first Bluetooth connection; disconnect the first Bluetooth connection after determining that the second audio transmission channel of the second Bluetooth connection is established; or disconnect the first Bluetooth connection after determining that the third service is executed based on the second Bluetooth connection.
- the coupling between modules may be electrical, mechanical or other forms of coupling.
- each functional module in each embodiment of the present application can be integrated into a processing module, or each module can exist physically separately, or two or more modules can be integrated into one module.
- the above integrated modules can be implemented in the form of hardware or software functional modules.
- the electronic device 100 may be an electronic device capable of running applications, such as a smart phone, a tablet computer, an e-book, etc.
- the electronic device 100 in the present application may include one or more of the following components: a processor 110, a memory 120, and one or more applications, wherein one or more applications may be stored in the memory 120 and configured to be executed by one or more processors 110, and one or more programs are configured to execute the method described in the aforementioned method embodiment.
- Processor 110 may include one or more processing cores.
- the processor 110 uses various interfaces and lines to connect various parts of the entire electronic device 100, and executes by running or executing instructions, programs, code sets or instruction sets stored in the memory 120, and calling data stored in the memory 120.
- Various functions and processing data of the electronic device 100 may use at least one of digital signal processing (Digital Signal Processing, DSP), field-programmable gate array (Field-Programmable Gate Array, FPGA), and programmable logic array (Programmable Logic Array, PLA).
- DSP Digital Signal Processing
- FPGA field-programmable gate array
- PROM programmable logic array
- the processor 110 may integrate one or a combination of a central processing unit (Central Processing Unit, CPU), a graphics processor (Graphics Processing Unit, GPU), a modem, etc.
- CPU Central Processing Unit
- GPU Graphics Processing Unit
- modem etc.
- the CPU mainly handles the operating system, user interface, and applications; the GPU is responsible for rendering and drawing the display content; and the modem is used to handle wireless communications. It can be understood that the above-mentioned modem may not be integrated into the processor 110 and may be implemented solely through a communication chip.
- the memory 120 may include random access memory (RAM) or read-only memory (Read-Only Memory). Memory 120 may be used to store instructions, programs, codes, sets of codes, or sets of instructions.
- the memory 120 may include a program storage area and a data storage area, where the program storage area may store instructions for implementing an operating system and instructions for implementing at least one function (such as a touch function, a sound playback function, an image playback function, etc.) , instructions for implementing each of the following method embodiments, etc.
- the storage data area can also store data created during use of the terminal 100 (such as phone book, audio and video data, chat record data), etc.
- FIG. 12 shows a structural block diagram of a computer-readable storage medium provided by an embodiment of the present application.
- Program code is stored in the computer-readable medium 1200, and the program code can be called by the processor to execute the method described in the above method embodiment.
- Computer-readable storage medium 1200 may be electronic memory such as flash memory, EEPROM (electrically erasable programmable read-only memory), EPROM, hard disk, or ROM.
- computer-readable storage media 1200 includes non-volatile computer-readable media (non-transitory computer-readable storage medium).
- the computer-readable storage medium 1200 has storage space for the program code 1210 that performs any method steps in the above-mentioned methods. These program codes can be read from or written into one or more computer program products.
- Program code 1210 may, for example, be compressed in a suitable form.
- FIG. 13 shows a structural block diagram 1300 of a computer program product provided by an embodiment of the present application.
- the computer program product 1300 includes a computer program/instruction 1310, which implements the steps of the above method when executed by a processor.
- a designation request is detected, and the designation request is used to indicate the establishment of the connection between the electronic device and the Bluetooth device.
- a second Bluetooth connection between devices in response to the specified request, while the first Bluetooth connection remains connected, establish a second Bluetooth connection between the electronic device and the Bluetooth device, in the After the second Bluetooth connection is successfully established, the first Bluetooth connection is disconnected. Therefore, before disconnecting the first Bluetooth connection, first ensure that the second Bluetooth connection is successfully established, which can avoid the failure between the electronic device and the Bluetooth device due to the fact that the second Bluetooth connection has not been successfully established when the first Bluetooth connection is disconnected. Normal Bluetooth communication can also prevent the user from waiting too long due to the long establishment time of the second Bluetooth connection between the electronic device and the Bluetooth device when the electronic device and the Bluetooth device cannot communicate.
- the target mode For scenarios with business playback, first connect to the target mode and establish the audio transmission channel of this mode and then disconnect the current mode.
- the current user uses BT to transmit data and switches from BT to BLE Audio.
- the mobile phone first communicates with the dual mode. Connect the earphones to BLE Audio and establish a CIS audio transmission channel with the earphones respectively, then stop the audio transmission under BT and disconnect the BT.
- the user can switch again.
- the audio transmission channel in the target mode has not been successfully established, the user's current use is completely useless. Affected.
- the entire switching time is very short, and there will be no long-term silence/output, etc., giving the user the feeling that the switching time is very fast and the transition is natural.
- it also avoids the situation where the audio is played out due to the failure of the connection target mode, thereby improving the experience of switching between BT and LE Audio between the entire TWS headset and the mobile phone.
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Computer Security & Cryptography (AREA)
- Mobile Radio Communication Systems (AREA)
Abstract
蓝牙切换方法和装置、蓝牙连接方法和装置及电子设备,涉及蓝牙技术领域,方法包括:在电子设备与蓝牙设备之间已建立第一蓝牙连接的情况下,建立电子设备与蓝牙设备之间的第二蓝牙连接;在第二蓝牙连接成功建立之后,将第一蓝牙连接断开。
Description
相关申请的交叉引用
本申请要求于2022年09月22日提交中国专利局的申请号为CN202211160261.0、名称为“蓝牙切换方法和装置、蓝牙连接方法和装置及电子设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
本申请涉及蓝牙技术领域,更具体地,涉及一种蓝牙切换方法和装置、蓝牙连接方法和装置及电子设备。
随着人们生活内容的丰富,用户拥有的电子设备也越来越多,蓝牙通信的技术也跟着快速进步。目前,为了方便用户工作和生活,某个电子设备可以与外部设备蓝牙连接,蓝牙连接的通信模式可能不止一种。
发明内容
本申请提出了一种蓝牙切换方法和装置、蓝牙连接方法和装置及电子设备。
第一方面,本申请实施例提供了一种蓝牙切换方法,应用于电子设备和/或蓝牙设备,所述方法包括:在所述电子设备与所述蓝牙设备之间已建立第一蓝牙连接的情况下,建立所述电子设备与所述蓝牙设备之间的第二蓝牙连接;在所述第二蓝牙连接成功建立之后,将所述第一蓝牙连接断开。
第二方面,本申请实施例还提供了一种蓝牙连接方法,应用于电子设备和/或蓝牙设备,所述方法包括:在所述电子设备与蓝牙设备建立一条蓝牙连接的情况下,建立所述电子设备与所述蓝牙设备的另一条蓝牙连接,其中,两条蓝牙连接对应不同的蓝牙通信模式;在所述两条蓝牙连接中的目标蓝牙连接的连接信息确定后,断开所述目标蓝牙连接,其中,所述目标蓝牙连接为所述两条蓝牙连接中的至少一条。
第三方面,本申请实施例还提供了一种蓝牙切换装置,其特征在于,应用于电子设备和/或蓝牙设备,所述装置包括:连接单元和第一断开单元。连接单元,用于在所述电子设备与所述蓝牙设备之间已建立第一蓝牙连接的情况下,建立所述电子设备与所述蓝牙设备之间的第二蓝牙连接;第一断开单元,用于在所述第二蓝牙连接成功建立之后,将所述第一蓝牙连接断开。
第四方面,本申请实施例还提供了一种蓝牙连接装置,其特征在于,应用于电子设备和/或蓝牙设备,所述装置包括:建立单元和第二断开单元。建立单元,用于在所述电子设备与蓝牙设备建立一条蓝牙连接的情况下,建立所述电子设备与所述蓝牙设备的另一条蓝牙连接,其中,两条蓝牙连接对应不同的蓝牙通信模式;第二断开单元,用于在所述两条蓝牙连接中的目标蓝牙连接的连接信息确定后,断开所述目标蓝牙连接,其中,所述目标蓝牙连接为所述两条蓝牙连接中的至少一条。
第五方面,本申请实施例还提供了一种电子设备,包括:一个或多个处理器;存储器;一个或多个应用程序,其中所述一个或多个应用程序被存储在所述存储器中并被配置为由所述一个或多个处理器执行,以使得电子设备实现上述方法。
第六方面,本申请实施例还提供了一种计算机可读介质,所述可读存储介质存储有处理器可执行的程序代码,所述程序代码被所述处理器执行时实现上述方法。
为了更清楚地说明本申请实施例中的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。
图1示出了本申请一实施例提供的蓝牙模式切换流程的示意图;
图2示出了本申请另一实施例提供的蓝牙模式切换流程的示意图;
图3示出了本申请一实施例提供的蓝牙切换方法的方法流程图;
图4示出了本申请一实施例提供的蓝牙设置界面的示意图;
图5示出了本申请又一实施例提供的蓝牙模式切换流程的示意图;
图6示出了本申请另一实施例提供的蓝牙切换方法的方法流程图;
图7示出了本申请再一实施例提供的蓝牙模式切换流程的示意图;
图8示出了本申请一实施例提供的蓝牙切换装置的模块框图;
图9示出了本申请又一实施例提供的蓝牙切换方法的模块框图;
图10示出了本申请另一实施例提供的蓝牙切换装置的模块框图;
图11示出了本申请实施例提供的电子设备的结构框图;
图12示出了本申请实施例的用于保存或者携带实现根据本申请实施例的图像显示方法的程序代码的存储单元;
图13示出了本申请实施例提供的计算机产品的模块框图。
为了使本技术领域的人员更好地理解本申请方案,下面将结合本申请实施例中附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本申请一部分实施例,而不是全部的实施例。通常在此处附图中描述和示出的本申请实施例的组件可以以各种不同的配置来布置和设计。因此,以下对在附图中提供的本申请的实施例的详细描述并非旨在限制要求保护的本申请的范围,而是仅仅表示本申请的选定实施例。基于本申请的实施例,本领域技术人员在没有做出创造性劳动的前提下所获得的所有其他实施例,都属于本申请保护的范围。
应注意到:相似的标号和字母在下面的附图中表示类似项,因此,一旦某一项在一个附图中被定义,则在随后的附图中不需要对其进行进一步定义和解释。同时,在本申请的描述中,术语“第一”、“第二”等仅用于区分描述,而不能理解为指示或暗示相对重要性。本申请中的实施例、实施方式及技术特征在不冲突的情况下可以相互组合。
物联网(Internet Of Things,IOT)是在“互联网概念”的基础上,将其用户端延伸和扩展到任何物品与物品之间,进行信息交换和通信的一种网络概念。随着物联网技术的发展,在物联网系统中可以配置一些场景。对于配置的场景,可以涉及到多个智能设备,而且多个智能设备之间具有一定的联动关系,能够协同工作。例如,所配置的场景可以包括,当一个设备靠近另一个设备的时候,两个设备中的至少一个会执行指定操作。或者一个设备在执行某个操作的时候,该操作的一部分数据自己处理,另一部分数据交由另一个设备处理。
随着人们生活内容的丰富,用户拥有的电子设备也越来越多,蓝牙通信的技术也跟着快速进步。目前,为了方便用户工作和生活,某个电子设备可以与外部设备蓝牙连接,以便用户能够控制该电子设备向所连接的设备发送数据。该电子设备可以是智能手机、平板电脑、电子书、无线音频播放设备、显示器等内部设置有蓝牙模块且能够与其他蓝牙设备建立蓝牙连接并交互数据的设备,该无线音频播放设备可以包括蓝牙耳机或蓝牙音箱等。
目前,蓝牙协议支持多种蓝牙通信模式,该多种蓝牙通信模式可以包括经典蓝牙模式和低功耗音频蓝牙模式(LE Audio)。其中,经典蓝牙模式包括基础速率(BR)、增强速率(EDR)以及高速(HS)三个模式,基础速率(BR)也称为蓝牙1.0,增强速率(EDR)也可以称为蓝牙2.0,高速(HS)也可以称为蓝牙3.0。低功耗音频蓝牙模式是工作于低功耗蓝牙(BLE)模式下的蓝牙音频传输模式,低功耗音频蓝牙模式将采用全新的低复杂性通信编解码器(Low Complexity Communication Codec,LC3),以提供实现更高的音质和更低的功耗,相较于经典蓝牙音频编码SBC,LC3编码效率和质量都有了较大的提高,这使得LE Audio比经典蓝牙音频技术拥有更大的技术优势。
然而,发明人在研究中发现,由于设备之间的蓝牙通信支持多种蓝牙模式,那么在各种模式之间切换的时候,容易造成卡顿、等待时间过久或蓝牙通信中断的情况。具体地,如图1所示,以手机和无线耳机之间的蓝牙连接为例,说明二者之间在多种蓝牙模式切换的情况下,可能存在上述缺陷。相关技术中,在耳机与手机端建立经典蓝牙连接的情况下,当用户打开手机蓝牙设置界面的LE Audio开关时,手机端会先将当前与耳机连接的经典蓝牙(BT)连接主动断掉,同时发起对耳机的LE Audio连接请求,手机端扫描到耳机双耳发送的LE广播后,完成与耳机之间的LE Audio连接。当用户关闭LE Audio的开关,手机端会先将当前与双耳的LE Audio连接断开,随即开始回连耳机的BT,完成BT的连线,以此实现BT与LE Audio之间动态切换的功能。
然而图1所示的连接方式,由于目前的操作系统默认是在连接新的蓝牙链路之前需要在断开已经存在的蓝牙链路,所以,存在以下缺点:一种情况,如果手机需要从经典蓝牙连接切换为LE Audio连接(也可以称为LE Audio蓝牙连接),手机会先主动断掉与耳机的经典蓝牙连接。然后,再发起与耳机端的LE Audio的连接,反之亦然。但这种断掉后再去连的机制存在不稳定的风险,如经典蓝牙连接断开后会出现无法成功与耳机之间建立LE Audio连接的情况,或者,断开LE Audio的连接后连接不上经典蓝牙连接的情况,这样会存在因连接不上期望使用的蓝牙通信模式而导致最终耳机与手机处于断开的模式,影响用户的实际体验。另一种情况,若当前手机已使用已经建立连接的蓝牙链路发送数据,假设,手机已经与无线耳机之间建立经典蓝牙连接,并且手机通过无线耳机播放音频数据,如音乐播放,电话等。如果手机需要从经典蓝牙连接切换为LE Audio连接,如图2所示,手机端断开经典蓝牙连接后再去与双耳建立LE Audio连接,随后再建立连接等时流(Connected Isochronous Steam,CIS)进行LE Audio下的流播放,反之亦然。整个过程不仅耗时较长,蓝牙通信模式的切换会出现长时间无声而且还可能存在因连接不上LE Audio而导致手机外放耳机无声的情况,整个用户体验都较差。
因此,为了解决上述缺陷,本申请实施例提供了一种蓝牙切换方法、装置、电子设备及计算机可读介质,能够在电子设备与蓝牙设备之间的蓝牙通信模式切换的时候,保持已建立的蓝牙链路至新的蓝牙链路被建立之后再断开,提高了用户体验。
如图3所示,本申请提供了一种蓝牙切换方法,应用于通信系统,所述通信系统包括电子设备和蓝牙设备,该电子设备可以是前述的智能手机,该蓝牙设备可以是前述的无线耳机,另外,该方法的执行主体可以是电子设备,也可以是蓝牙设备,还可以是电子设备和蓝牙设备交互执行,具体在此不做限定。该蓝牙切换方法包括:S301至S303。
S301:在所述电子设备与所述蓝牙设备之间已建立第一蓝牙连接的情况下,建立所述电子设备与所述蓝牙设备之间的第二蓝牙连接。
需要说明的是,本申请的一些实施例中,蓝牙连接可以包括基于蓝牙通信协议建立的蓝牙通信链路。在一些实施例中,建立蓝牙连接可以包括建立蓝牙物理链路;在一些实施例中,建立蓝牙连接可以包括建立蓝牙逻辑链路,例如ACL(Asychronous Connection Oriented);在一些实施例中,建立蓝牙连接也可以包括在前述链路的基础上建立音频传输协议或其他的数据传输协议,例如蓝牙音频传输模型协定(Advanced Audio Distribution Profile,A2dp)和免提协议(Hands-free Profile,HFP)等。在一些实施例中,蓝牙连接建立完成不包括建立某些音频传输通道,例如,同步面向连接链路(Synchronous Connection Oriented,SCO)和CIS等,而是有相关音频业务时或预设条件下才建立SCO或CIS等音频传输通道,也就是说,建立蓝牙连接时不会立马建立音频传输通道,而是等待有业务触发时才建立相应的音频传输通道以进行相关业务的传输。可以理解的,不同的蓝牙通信模式适用的蓝牙协议可能不同,因此对应建立的通信链路和相关传输协议可能会存在差异,可以参考相关蓝牙标准的规定,相关蓝牙连接中一些过程也可以参考相关蓝牙标准的规定,也可以随相关标准的变化发生改变。可以理解的,在一些实施例中,断开蓝牙连接可以与建立蓝牙连接相对应,在一些实施例中,二者中的蓝牙连接也可以有不同的含义。例如,建立蓝牙连接可以是建立ACL等逻辑链路,但是断开蓝牙连接可能是断开逻辑链路和上层通信协议。一般来说,断开底层链路后上层协议也会断开。在一些实施例中,断开蓝牙连接可以理解为断开两个设备之间的所有蓝牙通信链路。在一些实施例中,断开蓝牙连接也可以理解为断开上层协议。在一些实施例中,断开蓝牙连接意味着两个设备之间不能基于蓝牙链路进行点对点的传输。所述第一蓝牙连接和所述第二蓝牙连接对应不同的蓝牙通信模式。示例性地,第一蓝牙连接和第二蓝牙连接其中之一的蓝牙通信模式为经典蓝牙模式,另一个的蓝牙通信模式为低功耗音频蓝牙模式(即前述的LE Audio模式)。例如,第一蓝牙连接对应的蓝牙通信模式为经典蓝牙模式,在一些实施例中,可以理解为第一蓝牙连接为经典蓝牙连接,第二蓝牙连接对应的蓝牙通信模式为低功耗音频蓝牙模式,在一些实施例中,可以理
解为第二蓝牙连接为低功耗音频蓝牙连接,还可以是,第一蓝牙连接对应的蓝牙通信模式为低功耗音频蓝牙模式,第二蓝牙连接对应的蓝牙通信模式为经典蓝牙模式。
作为一个示例,电子设备与蓝牙设备可能会同时建立两种不同蓝牙通信模式的蓝牙连接,则先建立的蓝牙连接可以作为第一蓝牙连接,在此情况下,在第一蓝牙连接已经建立的情况下,另一个蓝牙连接还在建立的过程中,则另一个蓝牙连接可以作为第二蓝牙连接,也就是说,在所述电子设备与所述蓝牙设备之间已建立第一蓝牙连接的情况下,建立所述电子设备与所述蓝牙设备之间的第二蓝牙连接。作为另一个示例,在所述电子设备与所述蓝牙设备之间已建立第一蓝牙连接的情况下,电子设备或蓝牙设备可以基于一请求执行蓝牙切换操作,也就是说,在所述电子设备与所述蓝牙设备之间已建立第一蓝牙连接的情况下,确定指定请求;响应于所述指定请求,建立所述电子设备与所述蓝牙设备之间的第二蓝牙连接。其中,该指定请求用于指示建立所述电子设备与所述蓝牙设备之间的第二蓝牙连接。在一些实施中,指定请求也可以理解为用于触发切换蓝牙模式。
需要说明的是,该指定请求可以是用户基于电子设备输入的,也可以是基于蓝牙设备输入的,还可以是在处于预设应用场景之下自动触发生成的,该指定请求可以是基于用户操作或者根据预设应用场景生成的特定指令,其中,该预设应用场景可以是游戏应用场景、视频播放场景或其他预设场景,对此不作限定。于本申请实施例中,以该指定请求为用户输入为例,用户可以基于通过电子设备输入指定请求,也可以是基于蓝牙设备输入指定请求。在一些实施例中,可以由电子设备来确定指定请求,电子设备可以显示蓝牙设置界面,该蓝牙设置界面可以包括不同的蓝牙通信模式的开关,以便打开或关闭对应的蓝牙通信模式,如图4所示,该蓝牙设置界面可以包括第一蓝牙通信模式对应的第一开关501和第二蓝牙通信模式包括的第二开关502,设置第一开关处于开启状态,从而请求建立该第一蓝牙通信模式对应的蓝牙连接,设置第二开关处于开启状态,从而请求建立所述电子设备与所述蓝牙设备之间的第二蓝牙通信模式对应的蓝牙连接。另外,也可以是在该蓝牙设置界面内设置一个指定开关,电子设备与蓝牙设备之间的默认蓝牙模式为第一蓝牙通信模式,在该指定开关处于开关状态的时候,电子设备与所述蓝牙设备之间基于第二蓝牙通信模式建立第二蓝牙连接,在该指定开关处于关闭状态的时候,电子设备与所述蓝牙设备之间基于第一蓝牙通信模式建立第一蓝牙连接,因此,通过前述的第二开关502或该指定开关能够输入指定请求。
在一些实施例中,可以由蓝牙设备来确定指定请求,则如果该蓝牙设备具有屏幕,那么蓝牙设备也可以与电子设备相似,即采用蓝牙设置界面获取指定请求,如果该蓝牙设备不具有屏幕或者屏幕不满足该蓝牙设备界面的显示需求,则可以通过其他的方式确定指定请求,该其他的方式可以包括手势检测和语音检测的至少一种。
S302:在所述第二蓝牙连接成功建立之后,将所述第一蓝牙连接断开。
需要说明的是,在建立电子设备与蓝牙设备之间的第二蓝牙连接的过程中,电子设备与蓝牙设备之间的第一蓝牙连接保持连接。示例地,建立所述电子设备与所述蓝牙设备之间的第二蓝牙连接的实施方式为,在电子设备与蓝牙设备之间保持第一蓝牙连接处于连接状态的情况下,蓝牙设备持续发送预设广播,该预设广播用于第二蓝牙连接的建立。电子设备扫描所述蓝牙设备发送的预设广播,基于所述预设广播建立所述电子设备与所述蓝牙设备之间的第二蓝牙连接。示例性地,该广播内携带有蓝牙设备的蓝牙地址,电子设备解析该广播得到蓝牙设备的蓝牙地址,基于该蓝牙地址建立第二蓝牙连接。
第一蓝牙连接和第二蓝牙连接其中之一的蓝牙通信模式为经典蓝牙模式,另一个的蓝牙通信模式为低功耗音频蓝牙模式。假设第一蓝牙连接对应的蓝牙通信模式为经典蓝牙模式,第二蓝牙连接对应的蓝牙通信模式为低功耗音频蓝牙模式,电子设备是手机,蓝牙设备是蓝牙耳机,且该蓝牙耳机可以是真无线智能(True Wireless Stereo,TWS)耳机。示例的,针对经典蓝牙模式,蓝牙耳机可处于配对状态,在蓝牙耳机处于配对状态的情况下,蓝牙耳机能够被其他设备发现,其他设备在未与蓝牙耳机曾建立蓝牙连接的情况下,或者其他设备未预先获取蓝牙耳机的蓝牙地址的情况下,需要与蓝牙耳机配对,即通过配对的方式,蓝牙耳机与请求连接的设备之间交换通信信息,该通信信息包括通信地址等用于建立连接的数据,所以,对于新设备,只有在蓝牙耳机进入查询扫描(inquiry scan)的情况下,才能够被其他设备扫描到,进而与其他设备配对,进而完成与其他设备的蓝牙连接。
在一些实施例中,TWS耳机中与电子设备建立经典蓝牙连接的耳机为主耳机,可以由主耳机作为本申请中的蓝牙设备执行本申请一些实施例中的方法。在一些实施例中,也可以将TWS耳机作为一个整体,经典蓝牙连接可以理解由主耳机与电子设备之间建立,LE Audio蓝牙连接可以理解由TWS耳机的两个耳机分别与电子设备建立连接。在一些实施例中,LE Audio蓝牙连接也可以采用监听的
方式,例如,主耳机可与电子设备建立经典蓝牙连接和/或LE Audio蓝牙连接,从耳机通过监听的方式建立前述经典蓝牙连接或LE Audio蓝牙连接。
如图5所示,在蓝牙耳机进入配对状态的情况下,蓝牙耳机在配对状态下可以处于page scan状态,在一些实施例中,配对状态也可以是page scan和inquiry scan都开启的情况,手机发送page包,蓝牙耳机扫描到手机发送的page请求以进行蓝牙设备和手机之间的经典蓝牙连接。
当用户打开LE Audio开关的时候,手机能够检测到该LE Audio开关处于打开状态,例如,该LE Audio开关为上述界面的第二开关502,当该LE Audio开关被打开的时候,触发第一请求(可以理解为指定请求的一种示例),第一请求用于指示建立所述电子设备与所述蓝牙设备之间的LE Audio蓝牙连接(例如对应第二蓝牙连接),其中LE Audio蓝牙连接可以理解为基于LE Audio蓝牙协议建立的蓝牙连接,手机基于该指定请求开始扫描耳机发送的LE Audio广播(示例的,LE Aduio广播可以是用于建立LE Audio蓝牙连接的低功耗蓝牙广播),该LE Audio广播内可以包括耳机的低功耗音频蓝牙模式的接入地址,如BLE地址,然后,手机基于该LE Audio广播与耳机建立LE Audio连接,示例的,对于双模蓝牙耳机,该蓝牙耳机还可以基于经典蓝牙中与电子设备(例如手机)的连接关系等分为主耳机和从耳机,手机分别扫描得到主耳机发送的LE Audio广播以及从耳机发送的LE Audio广播,并分别建立手机与主耳机之间的LE Audio连接以及手机与从耳机之间的LE Audio连接,示例的,在LE Audio蓝牙模式下可以没有主耳机和从耳机的区分。然后,手机断开手机与耳机之间的经典蓝牙连接。此时,手机与蓝牙耳机之间的蓝牙连接为LE Audio连接。
可以理解的,在一些实施例中,经典蓝牙连接可以理解为基于经典蓝牙协议建立的蓝牙连接,LE Audio蓝牙连接可以理解为基于LE Audio蓝牙协议建立的蓝牙连接。
在一些实施例中,在手机与蓝牙耳机之间的蓝牙连接为LE Audio连接的情况下,如果该LE Audio开关被切换为关闭状态,则此时检测到第二请求(例如对应指定请求),且该第二请求为用于指示建立所述电子设备(例如手机)与所述蓝牙设备之间的经典蓝牙连接。从而,手机建立手机与所述蓝牙耳机之间的经典蓝牙连接,示例地,手机回连BT。可以理解的,在手机与蓝牙耳机首次建立经典蓝牙连接之后,手机可以生成连接记录,该连接记录内可以包括蓝牙耳机的蓝牙地址、配对密钥等,以便手机下次能够基于该蓝牙地址等直接与蓝牙耳机回连。其中,回连可以指无需进行inquiry等步骤,无需进行配对(pair)等直接与之前已经建立连接的设备进行蓝牙连接,例如耳机发送page(寻呼)包至蓝牙耳机,以请求建立经典蓝牙连接,回连步骤也可以参考相关蓝牙标准的规定。
示例性地,若本方法的执行主体是电子设备,则在所述电子设备与所述蓝牙设备之间已建立第一蓝牙连接的情况下,电子设备触发指定请求,电子设备响应该指定请求并建立所述电子设备与所述蓝牙设备之间的第二蓝牙连接,电子设备保持所述电子设备和蓝牙设备之间的第一蓝牙连接,然后,在第二蓝牙连接成功建立之后,电子设备将第一蓝牙连接断开。在一些实施例中,以第一蓝牙连接为经典蓝牙连接,第二蓝牙连接为LE Audio连接为例,在所述电子设备与所述蓝牙设备之间已建立经典蓝牙连接的情况下,电子设备触发指定请求,例如,用户在电子设备操作LE Audio开关输入第一请求,电子设备基于该第一请求开始扫描蓝牙设备发送的LE Audio广播,以便在扫描到该广播之后能够建立LE Audio连接,另外,还需保持二者之间的经典蓝牙连接,然后,在确定LE Audio连接成功建立之后,电子设备主动将电子设备与蓝牙设备之间的经典蓝牙连接断开。在另一些实施例中,以第一蓝牙连接为LE Audio连接,第二蓝牙连接为经典蓝牙连接为例,在所述电子设备与所述蓝牙设备之间已建立LE Audio连接的情况下,用户在电子设备操作LE Audio开关输入第二请求,电子设备回连BT,且保持二者之间的LE Audio连接,在确定经典蓝牙连接成功建立之后,电子设备主动将电子设备与蓝牙设备之间的LE Audio连接断开。
示例性地,若本方法的执行主体是蓝牙设备,则在所述电子设备与所述蓝牙设备之间已建立第一蓝牙连接的情况下,蓝牙设备触发指定请求,蓝牙设备响应该指定请求并建立所述电子设备与所述蓝牙设备之间的第二蓝牙连接,蓝牙设备保持所述电子设备和蓝牙设备之间的第一蓝牙连接,然后,在第二蓝牙连接成功建立之后,蓝牙设备将第一蓝牙连接断开。在一些实施例中,以第一蓝牙连接为经典蓝牙连接,第二蓝牙连接为LE Audio连接为例,在所述电子设备与所述蓝牙设备之间已建立经典蓝牙连接的情况下,蓝牙设备触发指定请求,例如,用户通过语音或手势操作蓝牙设备而输入第一请求,蓝牙设备基于该第一请求开始发送LE Audio广播,以便在电子设备扫描到该LE Audio广播之后建立LE Audio连接,另外,还需保持二者之间的经典蓝牙连接,然后,在确定LE Audio连接成功建立之后,蓝牙设备主动将电子设备与蓝牙设备之间的经典蓝牙连接断开。在另一些实施例中,以第一蓝牙连接为LE Audio连接,第二蓝牙连接为经典蓝牙连接为例,在所述电子设备与所述蓝牙设备之间已建立LE Audio连接的情况下,用户在蓝牙设备操作LE Audio开关输入第二请求,
蓝牙设备回连BT,且保持二者之间的LE Audio连接,在确定经典蓝牙连接成功建立之后,蓝牙设备主动将电子设备与蓝牙设备之间的LE Audio连接断开。
示例性地,若本方法的执行主体是电子设备和蓝牙设备,即该方法为电子设备和蓝牙设备的交互过程,则在所述电子设备与所述蓝牙设备之间已建立第一蓝牙连接的情况下,电子设备触发指定请求并将该指定请求发送至蓝牙设备,蓝牙设备响应该指定请求并建立所述电子设备与所述蓝牙设备之间的第二蓝牙连接,蓝牙设备保持所述电子设备和蓝牙设备之间的第一蓝牙连接,然后,在第二蓝牙连接成功建立之后,电子设备将第一蓝牙连接断开。需要说明的是,若本方法的执行主体是电子设备和蓝牙设备,除了前述的交互过程还可以是其他的方式,只要通过交互的方式能够执行前述方法即可,可能随着电子设备和蓝牙设备具备的功能不同或者建立蓝牙连接采用的蓝牙协议或蓝牙标准不同而发生变化,在此不做限定。
需要说明的是,第一蓝牙连接对应的蓝牙通信模式也可以是低功耗音频蓝牙模式,第二蓝牙连接对应的蓝牙通信模式为经典蓝牙模式,则具体的连接方式可以参考前述描述,在此不再赘述。
因此,本申请实施例能够在在所述电子设备与所述蓝牙设备之间已建立第一蓝牙连接的情况下,建立所述电子设备与所述蓝牙设备之间的第二蓝牙连接,在所述第二蓝牙连接成功建立之后,将所述第一蓝牙连接断开,也就是说,可以在建立第二蓝牙连接的过程中,保持第一蓝牙连接,在第二蓝牙连接成功建立之后,再将所述第一蓝牙连接断开,能够降低第一蓝牙连接切换至第二蓝牙连接时的卡顿,也能够避免同时保持第一蓝牙连接和第二蓝牙连接的情况下,功耗过大且带宽占用过大。需要说明的是,在第二蓝牙连接的基础上可以建立数据传输通道,电子设备与蓝牙设备之间可以通过该数据传输通道传输数据,该数据传输通道可以参考后续实施例的说明。则针对电子设备与蓝牙设备之间是否在通过第一蓝牙连接传输数据的情况下,需要考虑该数据在蓝牙连接切换的时候是否会造成卡顿,而合理的选择第一蓝牙连接的断开时机。示例性地,如果在所述第一蓝牙连接的情况下,电子设备和蓝牙设备之间未通过该第一蓝牙连接传输数据,则可以在第二蓝牙连接成功建立且在已建立的所述第二蓝牙连接上建立数据传输通道的情况下,将第一蓝牙连接断开,也就是说,在所述第二蓝牙连接成功建立,且在已建立的所述第二蓝牙连接上建立数据传输通道的情况下,将第一蓝牙连接断开。如此,不仅能够提前将第二蓝牙连接的数据传输通道建立,以便在后续使用第二蓝牙连接传输数据的时候,不必再建立该数据传输通道而可以直接使用已建立的数据传输通道。而且,如果电子设备与蓝牙设备之间选择第二蓝牙连接的目的是为了传输数据,例如,该第二蓝牙连接在传输数据的稳定性和传输质量上相比第一蓝牙连接更具有优势,则虽然电子设备和蓝牙设备之间未使用第一蓝牙连接传输数据,则当第二蓝牙连接建立完成的时候,可以认为电子设备和蓝牙设备之间的有较高的概率会使用第二蓝牙连接传输数据,则可以提前将该数据传输通道建立,并且在该数据传输通道建立完成后将第一蓝牙连接断开,由此,就完成第一蓝牙连接切换至第二蓝牙连接的操作。
作为另一种实施方式,如果在所述第一蓝牙连接的情况下,电子设备和蓝牙设备之间未通过该第一蓝牙连接传输数据,也就是说,在第二蓝牙连接的切换的时候,也可以不担心会导致第一蓝牙接连传输的数据卡顿,那么,可以在所述第二蓝牙连接成功建立之后,所述第二蓝牙连接上未建立数据传输通道之前,将第一蓝牙连接断开。即,在所述第一蓝牙连接未传输预设数据的情况下,在所述第二蓝牙连接成功建立之后将所述第一蓝牙连接断开的实施方式为,在所述第二蓝牙连接成功建立之后,所述第二蓝牙连接上未建立数据传输通道之前,将第一蓝牙连接断开。也就是说,在确定第二蓝牙连接不必接替第一蓝牙连接继续传输数据的情况下,那么也可以不必等到确定在第二蓝牙连接上成功建立数据传输通道的情况下,再将第一蓝牙连接断开。
再者,针对在所述第一蓝牙连接的情况下,电子设备和蓝牙设备之间通过该第一蓝牙连接传输数据的情况下,可以参考图6所示的蓝牙切换方法。
如图6所示,本申请提供了一种蓝牙切换方法,应用于通信系统,所述通信系统包括电子设备和蓝牙设备,该电子设备可以是前述的智能手机,该蓝牙设备可以是前述的无线耳机,在一些实施例中,该方法的执行主体可以是电子设备,也可以是蓝牙设备,还可以是电子设备和蓝牙设备交互执行,具体在此不做限定。该蓝牙切换方法包括:S601至S603。
S601:在所述电子设备与所述蓝牙设备之间已建立第一蓝牙连接且使用第一蓝牙连接传输预设数据的情况下,继续使用第一蓝牙连接传输所述预设数据,建立所述电子设备与所述蓝牙设备之间的第二蓝牙连接。
需要说明的是,该预设数据可以是电子设备需要通过电子设备与蓝牙设备之间的蓝牙通信发送至蓝牙设备,并且由蓝牙设备执行预设处理的数据(例如音乐数据、通话数据、语音数据等)。示例
地,该预设处理可以包括存储、播放等操作。作为一种实施方式,该蓝牙设备对该预设数据的处理方式可以为边获取边处理,即电子设备与蓝牙设备之间实时传输该预设数据并处理,当然,该蓝牙设备对该预设数据的处理方式也可以不是实时的,即也可以是先传输,传输的数据量满足预设阈值之后,再处理该传输得到的数据。所以,为了避免数据传输的中断而导致蓝牙设备对该预设数据的处理中断,电子设备与蓝牙设备之间需要保持蓝牙通信的稳定性和持续性。
示例性地,在所述电子设备与所述蓝牙设备之间已建立第一蓝牙连接且使用第一蓝牙连接传输预设数据的情况下,可以基于前述的指定请求,建立所述电子设备与所述蓝牙设备之间的第二蓝牙连接。则在所述电子设备与所述蓝牙设备之间已建立第一蓝牙连接且使用第一蓝牙连接传输预设数据的情况下,确定指定请求,响应于该指定请求,继续使用第一蓝牙连接传输所述预设数据,建立所述电子设备与所述蓝牙设备之间的第二蓝牙连接。
作为一种实施方式,由于响应指定请求后,会建立第二蓝牙连接,而在第一蓝牙连接有预设数据传输时,在第二蓝牙连接未建立前无法传输该预设数据,因此需要继续采用第一蓝牙连接来传输预设数据,如果第一蓝牙连接为LE Audio蓝牙连接,以预设数据为音乐数据或通话数据为例,那么继续使用第一蓝牙连接传输预设数据可以理解为在第一蓝牙连接的基础上建立了CIS链路,基于CIS链路传输预设数据。如果第一蓝牙连接为经典蓝牙连接,预设数据为通话数据,那么继续使用第一蓝牙连接传输预设数据可以理解为在第一蓝牙连接的基础上建立了SCO链路,基于SCO链路传输预设数据,可以根据预设数据的类型以及使用的蓝牙模式,对应蓝牙标准的相关规定来确定对应的传输链路。电子设备可以在接收到该指定请求的时候,在所述第一蓝牙连接保持连接的情况下,继续使用第一蓝牙连接传输所述预设数据,并建立所述电子设备与所述蓝牙设备之间的第二蓝牙连接,从而保障在建立第二蓝牙连接的过程中,用户仍然可以收听到音频。
S602:在第二蓝牙连接成功建立,且在已建立的第二蓝牙连接上建立数据传输通道的情况下,将第一蓝牙连接断开,数据传输通道用于传输预设数据。
在所述电子设备与所述蓝牙设备之间传输通过第一蓝牙连接传输预设数据的情况下,如果需要使用电子设备和蓝牙设备之间的第二蓝牙连接传输该预设数据,则可以建立第二蓝牙连接的数据传输通道,电子设备和蓝牙设备之间可以通过该数据传输通道传输该预设数据,当然,也可以传输其他的能够被该数据传输通道支持传输的数据,在此不做限定。
可以理解的,预设数据可能有多种类型,例如音乐数据、通话数据、语音数据等等,不同的蓝牙模式对于上述不同类型的预设数据采用的传输链路可能存在差异,例如对于通话数据等实时性要求高的数据,在经典蓝牙中,可以采用的是SCO链路来传输该数据,而在LE Audio蓝牙中,则采用CIS链路来传输,又例如,对于音乐数据等播放音质要求高的数据,在经典蓝牙中,可以采用ACL链路并基于A2DP协议进行传输,在LE Audio蓝牙中,则可以采用CIS链路来传输,可参考相关蓝牙标准的规定。而对于一些链路,例如SCO或CIS,可能在有业务需求时才会建立,例如在经典蓝牙中有通话业务时,才会建立SCO链路,业务结束后SCO链路就断开了,一定程度上节省了功耗,类似的,在LE Aduio蓝牙中有音乐或通话等播放业务发生时,才会触发建立对应的CIS链路,业务结束后就断开CIS。而建立SCO或CIS等音频传输通道需要一定的时间。因此,在通过第一蓝牙连接传输预设数据的情况下,可以控制在第二蓝牙连接的基础上建立了音频传输通道(例如SCO或CIS)的情况下再断开第一蓝牙连接,这样可以快速的将音频传输切换到基于第二蓝牙连接上,减少因切换蓝牙模式让用户感受到的中断,从而提升用户体验。在一些实施例中,如果第二蓝牙连接为经典蓝牙模式,预设数据为音乐数据等基于ACL链路传输的数据,则可以在建立了第二蓝牙连接的情况下就可以断开第一蓝牙连接,其中第二蓝牙连接可以包括ACL链路以及A2DP协议连接。
在一些实施例中,如果第二蓝牙连接为经典蓝牙模式,预设数据为音乐数据等基于ACL链路传输的数据,也可以将建立第二蓝牙连接理解为建立了ACL链路,建立数据传输通道理解为在ACL的基础上建立A2DP协议,从而可以在建立A2DP协议后断开第一蓝牙连接。
可以理解的,有的预设数据可能需要在有业务发生是才建立数据传输通道,因此为了避免先断开第一蓝牙连接再建立第二蓝牙连接的数据传输通道导致用户感知较长时间的播放中断,则控制在第二蓝牙连接的数据传输通道建立后再断开第一蓝牙连接用户体验更好,进一步的,可以在预设数据的传输切换到第二蓝牙连接的数据传输通道上后再断开第一蓝牙连接,进一步缩小切换给用户的中断感知,并且断开第一蓝牙连接可以节省带宽,进一步保障第二蓝牙连接传输数据的稳定性,从而保障播放的稳定性。作为一种实施方式,电子设备与蓝牙设备之间建立第二蓝牙连接之后,该第二蓝牙连接可以作为电子设备与蓝牙设备之间的物理链路,如果需要基于该第二蓝牙连接传输预设数据,需要在该物理链路的基础上建立用于数据传输的逻辑通道,例如,针对经典蓝牙模式,电子
设备与蓝牙设备之间建立经典蓝牙链路,该经典蓝牙链路可以是电子设备与蓝牙设备之间的物理链路,在该物理链路上可以建立逻辑链路并且基于该逻辑链路建立数据传输通道。作为一种实施方式,针对经典蓝牙通信模式的数据传输通道可以是上述的A2DP协议和/或SCO链路,针对低功耗音频蓝牙模式的数据传输通道可以是前述的CIS音频传输通道。因此,在电子设备与蓝牙设备之间的第二蓝牙连接成功建立之后,并且在该第二蓝牙连接的基础上也成功建立数据传输通道之后,电子设备就可以基于该数据传输通道将预设数据发送至蓝牙设备。
需要说明的是,针对该第二蓝牙链路可对应有多个时刻,该多个时刻分别为第一时刻、第二时刻和第三时刻,其中,第一时刻为电子设备与蓝牙设备之间的第二蓝牙连接成功建立的时刻,第二时刻为电子设备在已建立的第二蓝牙链路的基础上开始执行建立数据传输通道的操作的时刻,第三时刻为成功建立数据传输通道的时刻,需要说明的是,前述的每个时刻可以是每个时刻对应的事件发生的精确时间节点的预设时间范围,也就是说,可以是电子设备知晓前述的电子设备与蓝牙设备之间的第二蓝牙链路成功建立、开始执行建立数据传输通道的操作以及成功建立数据传输通道的各个时刻。
作为一种实施方式,响应于所述指定请求,在所述第一蓝牙连接保持连接的情况下,继续使用第一蓝牙连接传输所述预设数据,并建立所述电子设备与所述蓝牙设备之间的第二蓝牙连接之后,可以基于上述的第一时刻、第二时刻和第三时刻的任意时刻将第一蓝牙连接断开,下面将分情况分别阐述。
第一种实施方式,本申请实施例可以在电子设备确定电子设备与蓝牙设备之间的第二蓝牙链路已经成功建立的时刻,即第一时刻,将第一蓝牙连接断开。于本申请实施中,考虑到数据传输通道的建立所消耗的时间可能比较少,则可以不必等到数据传输通道成功建立之后再将第一蓝牙连接断开,而是可以在确定电子设备与蓝牙设备之间的第二蓝牙链路已经成功建立的情况下就将第一蓝牙连接断开。
示例性地,考虑到电子设备不需要使用第二蓝牙链路传输预设数据的情况下,可以在确定第二蓝牙链路成功建立的情况下,就将第一蓝牙连接断开。示例地,在所述第二蓝牙连接成功建立之后,检测是否需要使用第二蓝牙连接传输所述预设数据;若需要使用第二蓝牙连接传输所述预设数据,在已建立的所述第二蓝牙连接上建立数据传输通道,将第一蓝牙连接断开,若不需要使用第二蓝牙连接传输所述预设数据,在第二蓝牙连接已经成功建立时,将第一蓝牙连接断开。其中,确定是否需要使用第二蓝牙连接传输所述预设数据的实施方式可以是,确定预设数据的剩余传输时间,确定剩余传输时间的方式为,确定预设数据当前未传输的剩余数据,确定电子设备基于第一蓝牙连接将该剩余数据发送至蓝牙设备所需要的时长,记为剩余时长,将上述的第一时刻和第三时刻之间的时间间隔作为预设时长,该预设时长能表征在电子设备与蓝牙设备之间成功建立第二蓝牙连接至建立该第二蓝牙连接的数据传输通道所需的时长,如果该剩余时长小于或等于该预设时长,则判定不需要使用第二蓝牙连接传输所述预设数据,也就是说,在第二蓝牙连接的数据传输通道成功建立的时候,预设数据已经通过第一蓝牙连接完成传输,如果该剩余时长大于该预设时长,则判定需要使用第二蓝牙连接传输所述预设数据。
又示例性地,在接收到指定请求之后,确定电子设备建立第二蓝牙连接的用途是否是用于传输预设数据。示例地,电子设备使用第一蓝牙连接传输预设数据,此时第一蓝牙连接的传输对象为预设数据。在检测到指定请求之后,保持电子设备继续使用第一蓝牙连接传输预设数据,确定在电子设备成功建立第二蓝牙连接之前是否检测到切换请求,所述数据切换请求用于请求切换电子设备与蓝牙设备之间传输的数据,作为一种实施方式,该数据切换请求的输入可以基于电子设备检测到的指定功能被启动而确定,该指定功能可以是不用于传输预设数据而传输其他数据的功能。如果检测到数据切换请求,则可以确定电子设备与蓝牙设备之间需要传输的数据已经从预设数据变为新的数据即目标数据,这也就表示,不需要使用第二蓝牙连接传输预设数据,那么蓝牙连接的切换不会对预设数据的传输造成影响,所以,可以在确定电子设备成功建立第二蓝牙连接的时候,就断开第一蓝牙连接,那么电子设备可以使用第二蓝牙连接传输该目标数据。需要说明的是,在预设时间段内内检测是否获取到切换请求,该预设时间段可以是获取到指定请求至前述第一时刻之间的时间长度。作为一种实施方式,该指定请求可以包括切换请求,也就是说,该指定请求可以用于指示建立所述电子设备与所述蓝牙设备之间的第二蓝牙连接并且触发切换电子设备与蓝牙设备之间传输的数据。
例如,在电子设备与蓝牙设备已建立第一蓝牙连接的情况下,用户使用蓝牙设备播放歌曲,则电子设备与蓝牙设备之间通过第一蓝牙连接传输该歌曲的数据,在用户触发电子设备的语音通话功
能,请求使用蓝牙设备实时语音通话,电子设备与蓝牙设备之间拟通过第二蓝牙连接传输语音通话时产生的语音数据,所以,第一蓝牙连接对应的传输对象与第二蓝牙连接对应的传输对象是不同的,进而可以确定不需要使用第二蓝牙连接传输所述预设数据,否则,第一蓝牙连接对应的传输对象与第二蓝牙连接对应的传输对象相同,可以确定需要使用第二蓝牙连接传输所述预设数据。
第二种实施方式,本申请实施例可以在电子设备知晓电子设备与蓝牙设备之间的第二蓝牙链路已经成功建立之后,开始基于该第二蓝牙连接执行建立数据传输通道的操作的时刻,即第二时刻,将第一蓝牙连接断开。于本申请实施中,考虑到数据传输通道的建立所消耗的时间可能比较少,则可以不必等到数据传输通道成功建立之后再将第一蓝牙连接断开,而是可以在确定电子设备开始建立数据传输通道的时刻就将第一蓝牙连接断开。
第三种实施方式,本申请实施例还可以是在电子设备确定该数据传输通道已经成功建立的时候,即第三时刻,将第一蓝牙连接断开。
需要说明的是,针对第二种和第三种实施方式,可以是在确定电子设备需要使用第二蓝牙连接传输预设数据的情况下,再执行。例如,在所述第二蓝牙连接成功建立之后,检测是否需要使用第二蓝牙连接传输所述预设数据;若需要使用第二蓝牙连接传输所述预设数据,在已建立的所述第二蓝牙连接上建立数据传输通道,若所述数据传输通道成功建立,将第一蓝牙连接断开,或者,在已建立的所述第二蓝牙连接上建立数据传输通道,若确定已使用第二蓝牙连接对应的数据传输通道传输该预设数据,则将第一蓝牙连接断开。如果需要通过第二蓝牙连接继续传输预设数据,则可以将所述预设数据的指定部分数据通过所述数据传输通道发送至所述蓝牙设备,其中,所述指定部分数据为在所述第一蓝牙连接断开时所述预设数据中未传输的部分数据。
如图7所述,假设电子设备为手机,蓝牙设备为蓝牙耳机,该第一蓝牙连接为经典蓝牙连接,在手机与蓝牙耳机之间已经建立经典蓝牙连接的情况下,执行音频流播放操作,即电子设备通过经典蓝牙连接将音频数据发送至蓝牙耳机,由蓝牙耳机播放该音频数据,当用户打开LE Audio开关的时候,手机能够检测到该LE Audio开关处于打开状态,例如,该LE Audio开关为上述界面的第二开关502,当该LE Audio开关被打开的时候,触发第一请求,第一请求用于指示建立所述电子设备与所述蓝牙设备之间的LE Audio连接(即第二蓝牙连接),手机基于该指定请求开始扫描耳机发送的LE Audio广播,该LE Audio广播内包括耳机的低功耗音频蓝牙模式的接入地址,示例性地,如果该第一请求是由手机触发的,则手机通过第一蓝牙连接将该第一请求发送至耳机,耳机响应该第一请求开始发送LE Audio广播。另外,耳机也可以基于用户触发发送LE Audio广播。例如,用户在手机侧触发第一请求,在耳机侧触发耳机发送LE Audio广播。还可以是,该第一请求是耳机触发的,耳机基于该第一请求发送LE Audio广播,耳机将第一请求通过第一蓝牙连接发送至手机,手机开始扫描LE Audio广播,在成功获取到LE Audio广播之后发起连接请求。
耳机基于该LE Audio广播与耳机建立LE Audio连接,需要说明的是,该蓝牙耳机包括主耳机和从耳机,手机分别扫描得到主耳机发送的LE Audio广播以及从耳机发送的LE Audio广播,并分别建立手机与主耳机之间的LE Audio连接以及手机与从耳机之间的LE Audio连接。然后,手机断开手机与耳机(例如主耳机)之间的经典蓝牙连接。此时,手机与蓝牙耳机之间的蓝牙连接为LE Audio连接。
然后,手机在该LE Audio连接的基础上建立CIS通道即数据传输通道,当数据传输通道成功建立之后,手机可以使用该CIS继续传输前述的音频流播放操作对应的音频数据。同理,在手机与蓝牙耳机之间的蓝牙连接为LE Audio连接的情况下,如果该LE Audio开关被切换为关闭状态,则此时检测到第二请求,且该第二请求为用于指示建立所述电子设备与所述蓝牙设备之间的经典蓝牙连接。从而,手机建立电子设备与所述蓝牙耳机之间的经典蓝牙连接,示例地,手机回连BT。
因此,本申请实施例针对电子设备与蓝牙设备之间正在使用第一蓝牙连接传输数据的情况下,检测到用于指示建立所述电子设备与所述蓝牙设备之间的第二蓝牙连接的请求之后,在确定第二蓝牙连接成功建立、开始基于该第二蓝牙连接建立数据传输通道或者该数据传输通道成功建立的情况下,再将第一蓝牙连接断开,降低数据传输的中断带来的负面影响。
请参阅图8,其示出了本申请实施例提供的一种蓝牙切换装置的结构框图。该蓝牙切换装置800可以包括:连接单元801和第一断开单元802。
连接单元801,用于在所述电子设备与所述蓝牙设备之间已建立第一蓝牙连接的情况下,建立所述电子设备与所述蓝牙设备之间的第二蓝牙连接。
第一断开单元802,用于在所述第二蓝牙连接成功建立之后,将所述第一蓝牙连接断开。
进一步的,连接单元801还用于在所述电子设备与所述蓝牙设备之间已建立第一蓝牙连接的情
况下,确定指定请求,响应于所述指定请求,建立所述电子设备与所述蓝牙设备之间的第二蓝牙连接进一步的,在所述电子设备与所述蓝牙设备之间已建立第一蓝牙连接的情况下,所述电子设备与所述蓝牙设备之间传输预设数据;连接单元801还用于响应于所述指定请求,在所述第一蓝牙连接保持连接的情况下,继续使用第一蓝牙连接传输所述预设数据,并建立所述电子设备与所述蓝牙设备之间的第二蓝牙连接。
进一步的,连接单元801还用于响应于所述指定请求,在所述第一蓝牙连接保持连接的情况下,扫描所述蓝牙设备发送的预设广播;基于所述预设广播建立所述电子设备与所述蓝牙设备之间的第二蓝牙连接。
进一步的,第一断开单元802还用于在所述第二蓝牙连接成功建立之后,在已建立的所述第二蓝牙连接上建立数据传输通道,并将第一蓝牙连接断开,所述数据传输通道用于传输所述预设数据
进一步的,第一断开单元802还用于在所述第二蓝牙连接成功建立之后,检测是否需要使用第二蓝牙连接传输所述预设数据;若需要使用第二蓝牙连接传输所述预设数据,在已建立的所述第二蓝牙连接上建立数据传输通道,并将第一蓝牙连接断开。
进一步的,在所述第一蓝牙连接未传输预设数据的情况下,第一断开单元802还用于在所述第二蓝牙连接成功建立之后,所述第二蓝牙连接上未建立数据传输通道之前,将第一蓝牙连接断开。
进一步的,第一断开单元802还用于若不需要使用第二蓝牙连接传输所述预设数据,在成功建立所述第二蓝牙连接时,将第一蓝牙连接断开。
进一步的,第一断开单元802还用于在已建立的所述第二蓝牙连接上建立数据传输通道;若所述数据传输通道成功建立,将第一蓝牙连接断开。
进一步的,第一断开单元802还用于若所述数据传输通道成功建立,将第一蓝牙连接断开之后,将所述预设数据的指定部分数据通过所述数据传输通道发送至所述蓝牙设备,其中,所述指定部分数据为在所述第一蓝牙连接断开时所述预设数据中未传输的部分数据。
请参阅图9,图9示出了本申请实施例提供的一种蓝牙连接方法,可以应用于电子设备,也可以应用于蓝牙设备,还可以应用于电子设备和蓝牙设备组成的系统,该蓝牙连接方法包括:S901至S902。
S901:在所述电子设备与蓝牙设备建立一条蓝牙连接的情况下,建立所述电子设备与所述蓝牙设备的另一条蓝牙连接,其中,两条蓝牙连接对应不同的蓝牙通信模式。
S902:在所述两条蓝牙连接中的目标蓝牙连接的连接信息确定后,断开所述目标蓝牙连接,其中,所述目标蓝牙连接为所述两条蓝牙连接中的至少一条。
在电子设备与蓝牙设备建立一条蓝牙连接的情况下,建立所述电子设备与所述蓝牙设备的另一条蓝牙连接,其中,两条蓝牙连接对应不同的蓝牙通信模式。
可以理解的,电子设备和蓝牙设备可以是支持多模蓝牙的设备,也就是说可以支持不同蓝牙通信模式,例如可以支持经典蓝牙通信,也可以支持LE Audio蓝牙通信,当然还可以是其他蓝牙通信方式。示例的,其中的一条蓝牙连接对应经典蓝牙连接,另一条蓝牙连接对应LE Audio蓝牙连接。
可以理解的,上述连接过程可以发生在电子设备与蓝牙设备的首次连接中,例如耳机首次开盖后与电子设备的配对连接中,也可以是耳机恢复出厂设置后与手机的配对连接中。首次配对通过建立两条蓝牙连接的过程可以获取到两条蓝牙连接的连接信息,例如蓝牙地址、配对信息等,从而方便后续进行蓝牙连接。
在一些实施例中,在电子设备和蓝牙设备在建立一条蓝牙连接的过程中,建立电子设备与蓝牙设备的另一条蓝牙连接。示例的,若上述一条蓝牙连接为经典蓝牙连接,则在电子设备和蓝牙设备在建立一条蓝牙连接的过程中,可以是在建立经典蓝牙的通信链路(例如ACL链路)后。可以理解的,在建立一条蓝牙连接的过程中,可以在该蓝牙连接的建立过程中获取另一条蓝牙连接的连接信息,例如蓝牙地址,从而加快另一条蓝牙连接的建立速度。
在一些实施例中,在电子设备与蓝牙设备建立了一条蓝牙连接之后,建立电子设备与蓝牙设备的另一条蓝牙连接。示例的,可以在建立了通信链路的基础上建立上层传输协议等完成蓝牙连接后,再建立另一条蓝牙连接。
在一些实施例中,在两条蓝牙连接中的目标蓝牙连接的连接信息确定后,断开所述目标蓝牙连接。
可以理解的,上述两条蓝牙连接中可以设置一条为目标蓝牙连接,例如可以设置LE Audio蓝牙连接为目标蓝牙连接,目标蓝牙连接可以是出厂前默认设置的,也可以通过用户来设置,目标蓝
牙连接可以用于表征在没有连接信息(例如蓝牙地址、配对信息等)的情况下(例如恢复出厂设置或者首次配对时),电子设备和蓝牙设备之间通过建立蓝牙连接获取了目标蓝牙连接的连接信息后,需要断开的那个蓝牙连接。
需要说明的是,没有连接信息可以是电子设备和/或蓝牙设备中没有了配对信息等连接信息,从而不能通过回连的方式进行蓝牙连接的建立,并且需要重新配对等。在没有连接信息的情况下,为了保障后续的使用不用再配对以提升两条蓝牙连接之间的切换速度,并简化用户操作,因此可以先通过建立两条蓝牙连接获取到两条蓝牙连接对应的连接信息,由于两条蓝牙连接中的非目标蓝牙连接在首次连接后不会默认断开,因此最终肯定会获取到非目标蓝牙连接对应的连接信息,而断开目标蓝牙连接则需要考虑是否获取到目标蓝牙连接的连接信息,从而需要在目标蓝牙连接的连接信息确定后,才断开所述目标蓝牙连接,否则此次建立目标蓝牙连接的行为可能失去意义。示例的,可以在确定目标蓝牙连接的连接信息后立马断开目标蓝牙连接,也可以是目标蓝牙连接建立完成后再断开,也可以是有播放业务请求时才断开,因为执行播放业务时,同时保持两条蓝牙连接可能会影响带宽,进而影响播放。
在一些实施例中,两条蓝牙连接包括第一蓝牙连接和第二蓝牙连接,其中第二蓝牙连接为目标蓝牙连接,第一蓝牙连接和第二蓝牙连接对应不同的蓝牙通信模式;例如第一蓝牙连接对应LE Audio蓝牙连接;第二蓝牙连接对应经典蓝牙连接。
在一些实施例中,可以在电子设备与蓝牙设备建立了第二蓝牙连接的情况下,电子设备与蓝牙设备建立第一蓝牙连接。
在一些实施例中,为了在首次通过建立两条蓝牙连接获取到连接信息供后续连接使用,还需要在电子设备端和/或蓝牙设备端存储所述第一蓝牙连接的第一蓝牙连接信息和所述第二蓝牙连接的第二蓝牙连接信息。
在一些实施例中,在两条蓝牙连接中的目标蓝牙连接的连接信息确定后,断开目标蓝牙连接,可以理解为:
在确定第二蓝牙连接的连接信息后,断开第二蓝牙连接;或者,
在确定第一蓝牙连接的连接信息和第二蓝牙连接的连接信息后,断开第二蓝牙连接;或者,
在确定第一蓝牙连接建立完成后,断开第二蓝牙连接;或者,
在确定第一蓝牙连接和第二蓝牙连接建立完成后,断开第二蓝牙连接。
为了方便用户操作,在一些实施例中,响应于用户连接操作,建立电子设备与蓝牙设备的第二蓝牙连接;在电子设备与蓝牙设备建立第二蓝牙连接的情况下,电子设备与蓝牙设备建立所述第一蓝牙连接。也就是说用户可以只操作一次就同时建立两条蓝牙连接,从而方便用户的操作,示例的,电子设备可以通过与蓝牙设备建立经典蓝牙连接的过程中,获得蓝牙设备的LE Audio蓝牙地址(如BLE地址),然后在接收到具有该LE Audio蓝牙地址的LE Audio蓝牙广播的情况下,发起与蓝牙设备的LE Audio蓝牙连接,从而用户在首次建立双蓝牙连接时无需两次触发连接,而是通过一次触发就能够实现两条蓝牙连接。在一些实施例中,可以利用蓝牙标准中的CSIP协议来完成一组蓝牙设备的连接,当然还有其他的方式,此外,先进行LE Audio蓝牙连接,再进行经典蓝牙连接等,都属于本申请的保护范围。
需要说明的,用户连接操作可以是在电子设备上进行,也可以是在蓝牙设备上进行,例如电子设备(例如手机、平板、电脑、电视等)上具有蓝牙显示界面(例如蓝牙设置界面、蓝牙管理APP界面、连接弹窗界面),用户可以选择蓝牙显示界面中对应的蓝牙设备点击连接按键触发蓝牙连接,蓝牙设备如果是具有显示屏的设备,例如可视化音箱、电视等,也可以参照电子设备的方式进行,蓝牙设备如果是耳机,则可以通过语音等方式反馈用户选择,用户可以通过控制耳机上的控件来触发连接。
可以理解的,以上蓝牙连接方法可以与前面的蓝牙切换方法的相关实施例进行技术特征、技术手段或实施例的组合,也就是说先通过上述蓝牙连接方法获取两条蓝牙连接的连接信息,然后保留一条蓝牙连接,后续切换另一条蓝牙连接时无需再配对,例如可以直接回连,从而减少蓝牙连接建立的时间,提升切换速度,方便用户使用。
在一些实施例中,在断开第二蓝牙连接之后,所述蓝牙连接方法还包括(以下部分也可以理解为蓝牙切换的方法):
在电子设备与蓝牙设备之间已建立第一蓝牙连接的情况下,响应于指定请求,在第一蓝牙连接保持连接的情况下,建立电子设备与蓝牙设备之间的所述第二蓝牙连接;
可以理解的,在断开第二蓝牙连接之后,电子设备与蓝牙设备之间还存在第一蓝牙连接,在做
蓝牙通信模式切换时,例如用户想采用LE Audio蓝牙协议来传输音频数据,用户可以打开电子设备上显示的LE Audio开关,触发指定请求。响应于指定请求,在第一蓝牙连接保持连接的情况下,建立电子设备与蓝牙设备之间的第二蓝牙连接可以避免第一蓝牙连接断开了,第二蓝牙连接又连接不上的情况,而影响用户使用蓝牙设备。
需要说明的是,指定请求可以是在电子设备上产生的,也可以是在蓝牙设备上产生的,例如用户触控蓝牙设备上的某个控件触发生成指定请求,该指定请求也可以参考前述蓝牙切换方法相关实施例中的描述。
在一些实施例中,在第二蓝牙连接的通信链路成功建立之后,将第一蓝牙连接断开。
可以理解的,通信链路可以包括物理链路或者逻辑链路等,一般建立了通信链路后连接成功概率变高,因此可以考虑在建立了通信链路的情况下再断开第一蓝牙连接。示例的,可以有以下几种方式:
第一种实施方式:在确定所述第二蓝牙连接的物理链路连接的情况下,断开所述第一蓝牙连接。
第二种实施方式:在确定所述第二蓝牙连接的逻辑链路建立的情况下,断开所述第一蓝牙连接。上述逻辑链路可以是ACL链路。
第三种实施方式,在确定所述第二蓝牙连接的音频传输协议建立的情况下,断开所述第一蓝牙连接。可以理解的,若所述第二蓝牙连接为经典蓝牙连接,则上述音频传输协议可以是经典蓝牙的A2dp协议、HFP协议等。
第四种实施方式:在确定所述第二蓝牙连接的音频传输通道建立的情况下,断开所述第一蓝牙连接。可以理解的,如果第二蓝牙连接为经典蓝牙连接,则音频传输通道可以是SCO;如果第二蓝牙连接为LE Audio蓝牙连接,则音频传输通道可以是CIS。
第五种实施方式:在确定使用所述第二蓝牙连接传输音频数据后,断开所述第一蓝牙连接。可以理解的,也可以在音频数据的传输完全切换到第二蓝牙连接上时才断开第一蓝牙连接,从而减低因蓝牙通信模式切换导致的中断时间。
需要说明的,以上实施方式的执行主体可以是电子设备也可以是也可以是蓝牙设备。上述ACL、SCO、CIS、A2dp、HFP的具体定义可以参考蓝牙标准协议的相关规定。以上实施方式也可以作为前述蓝牙切换方法中“在第二蓝牙连接成功建立之后,将第一蓝牙连接断开”的可行实施方式。
在一些实施例中,没有音频传输业务在执行的情况下(例如没有播放业务需求的情况下),可以按照以上任一种实施方式进行切换。
在一些实施例中,若第一蓝牙连接为LE Audio蓝牙连接,第二蓝牙连接为经典蓝牙连接,在断开第二蓝牙连接之后,所述方法还包括:
在电子设备进行第一业务的情况下,响应于指定请求,在通过第一蓝牙连接执行第一业务的情况下,建立电子设备与蓝牙设备之间的第二蓝牙连接;
进一步的,在确定第二蓝牙连接的第一音频传输协议建立后断开第一蓝牙连接;或,在确定基于第二蓝牙连接执行第一业务后断开第一蓝牙连接。
可以理解的,第一业务可以是对音质要求较高的音频播放业务,例如音乐播放业务,第一业务也可以是对实时性要求不高的音频播放业务,例如语音消息播放业务。由于已经存储了第一蓝牙连接和第二蓝牙连接的蓝牙连接信息,因此建立第二蓝牙连接直接通过回连的方式建立。由于在经典蓝牙中,第一业务无须建立SCO音频传输通道,只需要建立第一音频传输协议(如A2dp协议)后基于ACL链路即可传输音频数据,因此在有第一业务进行的情况下进行蓝牙通信模式切换,则可以先采用第一蓝牙连接执行第一业务,在第二蓝牙连接具备传输音频数据的能力后再断开第一蓝牙连接。进一步的,也可以等第一业务的音频数据切换到第二蓝牙连接上进行传输时再断开第一蓝牙连接,从而进一步降低了切换引起的中断时间。
在一些实施例中,若第一蓝牙连接为LE Audio蓝牙连接,第二蓝牙连接为经典蓝牙连接,在断开所述第二蓝牙连接之后,所述方法还包括:在电子设备进行第二业务的情况下,响应于指定请求,在通过第一蓝牙连接执行第二业务的情况下,建立电子设备与蓝牙设备之间的第二蓝牙连接。
可以理解的,第二业务可以是对实时性要求较高的音频业务,例如通话业务、语音通话业务或视频通话业务,在经典蓝牙中,对于第二业务需要建立第二音频传输通道(如SCO)才能进行播放,因此,可以有以下断开第一蓝牙连接的策略。
在一些实施例中,可以在确定第二蓝牙连接的第二音频传输协议建立后断开第一蓝牙连接;可以理解的,在经典蓝牙中第二音频传输协议可以是HFP协议,建立了HFP协议再断开第一蓝牙连接,可以一定程度上缩小中断时间,进一步的可触发建立SCO通道。
示例的,在确定第二蓝牙连接的第一音频传输通道建立后断开第一蓝牙连接;可以理解的,由于第二业务需要在经典蓝牙连接的SCO通道上传输,因此,在确定第二蓝牙连接的第一音频传输通道(如SCO)建立后断开第一蓝牙连接可以进一步缩短因切换蓝牙通信模式引起的中断时间。
在一些实施例中,在确定基于第二蓝牙连接执行第二业务后断开第一蓝牙连接。可以理解的,在经典蓝牙的SCO建立完成后并且将第二业务的音频数据从第一蓝牙连接转移到第二蓝牙连接上传输后,再断开第一蓝牙连接可以进一步缩短上述中断时间。
可以理解的,从LE Audio蓝牙连接切换为经典蓝牙连接时,可以是电子设备直接寻呼page以回连蓝牙设备,也可以是蓝牙设备直接寻呼page以回连电子设备。
在一些实施例中,若第一蓝牙连接为经典蓝牙连接,第二蓝牙连接为LE Audio蓝牙连接,在断开第二蓝牙连接之后,所述方法还包括:在电子设备进行第三业务的情况下,响应于指定请求,在通过第一蓝牙连接执行第三业务的情况下,建立电子设备与蓝牙设备之间的第二蓝牙连接;
在确定第二蓝牙连接的第二音频传输通道建立后断开第一蓝牙连接;或,在确定基于第二蓝牙连接执行第三业务后断开第一蓝牙连接。
可以理解的,由于LE Audio蓝牙中的音频传输需要基于CIS或BIS通道进行,因此第三业务可以为音频传输业务,可以包括上述第一业务和第二业务中举例的业务场景。本实施例中的第二音频传输通道可以是CIS或BIS通道,在建立第二音频传输通道以后,进一步的可以在将第三业务的音频传输数据切换至第二蓝牙连接上传输后再断开第一蓝牙连接,进一步减少切换蓝牙通信模式导致的音频播放中断时间。
需要说明的,在一些实施例中,第一业务、第二业务、第三业务可以对应前述蓝牙切换方法的相关实施例中的预设数据。
在一些实施例中,如果第二蓝牙连接为LE Audio蓝牙连接,则为了降低功耗,也可以设置蓝牙设备在收到指定请求时蓝牙设备才开始打LE Audio蓝牙广播,如果用户是在电子设备端触发的开启LE Audio,则可以通过第一蓝牙连接向蓝牙设备发送指令(例如指定请求或其他指令)以触发蓝牙设备开启LE Audio蓝牙广播,电子设备在接收到LE Audio蓝牙广播后发起建立LE Audio蓝牙连接的请求,进而建立LE Audio蓝牙连接。在建立第二蓝牙连接的过程中,第一蓝牙连接仍用于执行第一业务,因此缩短了用户能够感知的切换时间,提升了用户体验。
需要说明的是,上述各实施例中的技术特征在不冲突的情况下可以相互引用以及相互组合,例如蓝牙切换方法和蓝牙连接方法中相关的实施例、实施方式及相关技术特征可以相互引用、相互解释、相互组合。一些技术特征及专业名词,如蓝牙连接的具体方式等可以参考蓝牙标准的相关规定,可能会随着相关标准的变化而变化,不再赘述。请参阅图10,其示出了本申请实施例提供的一种蓝牙切换装置的结构框图。该蓝牙切换装置1000可以包括:建立单元1001和第二断开单元1002。
建立单元1001,用于在所述电子设备与蓝牙设备建立一条蓝牙连接的情况下,建立所述电子设备与所述蓝牙设备的另一条蓝牙连接,其中,两条蓝牙连接对应不同的蓝牙通信模式。
第二断开单元1002,用于在所述两条蓝牙连接中的目标蓝牙连接的连接信息确定后,断开所述目标蓝牙连接,其中,所述目标蓝牙连接为所述两条蓝牙连接中的至少一条。
进一步的,所述两条蓝牙连接包括第一蓝牙连接和第二蓝牙连接,其中所述第二蓝牙连接为所述目标蓝牙连接,所述第一蓝牙连接和所述第二蓝牙连接对应不同的蓝牙通信模式,建立单元1001还用于在所述电子设备与所述蓝牙设备建立所述第二蓝牙连接的情况下,所述电子设备与所述蓝牙设备建立所述第一蓝牙连接。第二断开单元1002还用于在确定所述第二蓝牙连接的连接信息后,断开所述第二蓝牙连接;或者,在确定所述第一蓝牙连接的连接信息和所述第二蓝牙连接的连接信息后,断开所述第二蓝牙连接;或者,在确定所述第一蓝牙连接建立完成后,断开所述第二蓝牙连接;或者,在确定所述第一蓝牙连接和所述第二蓝牙连接建立完成后,断开所述第二蓝牙连接。
进一步的,第二断开单元1002还用于断开所述第二蓝牙连接之后,存储所述第一蓝牙连接的第一蓝牙连接信息和所述第二蓝牙连接的第二蓝牙连接信息。
进一步的,建立单元1001还用于响应于连接操作,建立所述电子设备与所述蓝牙设备的第二蓝牙连接;在所述电子设备与所述蓝牙设备建立第二蓝牙连接的情况下,所述电子设备与所述蓝牙设备建立所述第一蓝牙连接。进一步的,第二断开单元1002还用于断开所述第二蓝牙连接之后,在所述电子设备与所述蓝牙设备之间已建立第一蓝牙连接的情况下,建立所述电子设备与所述蓝牙设备之间的第二蓝牙连接,控制所述第一蓝牙连接保持连接;在所述第二蓝牙连接的通信链路成功建立之后,将所述第一蓝牙连接断开。示例性地,通信链路可以包括物理链路或者逻辑链路等,示例地,第二断开单元1002用于在确定所述第二蓝牙连接的物理链路连接后,断开所述第一蓝牙连
接;或者,第二断开单元1002用于在确定所述第二蓝牙连接的逻辑链路连接后,断开所述第一蓝牙连接;或者,在确定所述第二蓝牙连接的音频传输协议建立后,断开所述第一蓝牙连接;或者,在确定所述第二蓝牙连接的音频传输通道建立后,断开所述第一蓝牙连接;或者,在确定使用所述第二蓝牙连接传输音频数据后,断开所述第一蓝牙连接。
进一步的,第一蓝牙连接为LE Audio蓝牙连接,所述第二蓝牙连接为经典蓝牙连接,第二断开单元1002用于在所述断开所述第二蓝牙连接之后,在通过所述第一蓝牙连接执行所述第一业务的情况下,建立所述电子设备与所述蓝牙设备之间的第二蓝牙连接;在确定所述第二蓝牙连接的第一音频传输协议建立后断开所述第一蓝牙连接;或,在确定基于所述第二蓝牙连接执行所述第一业务后断开所述第一蓝牙连接。示例性地,所述第一业务包括音乐播放业务或语音消息播放业务。
进一步的,第一蓝牙连接为LE Audio蓝牙连接,所述第二蓝牙连接为经典蓝牙连接,第二断开单元1002还用于在通过所述第一蓝牙连接执行所述第二业务的情况下,建立所述电子设备与所述蓝牙设备之间的第二蓝牙连接;在确定所述第二蓝牙连接的第二音频传输协议建立后断开所述第一蓝牙连接;或,在确定所述第二蓝牙连接的第一音频传输通道建立后断开所述第一蓝牙连接;或,在确定基于所述第二蓝牙连接执行所述第二业务后断开所述第一蓝牙连接。示例性地,所述第二业务包括通话业务、语音通话业务或视频通话业务。
进一步的,第一蓝牙连接为经典蓝牙连接,所述第二蓝牙连接为LE Audio蓝牙连接,第二断开单元1002还用于在所述断开所述第二蓝牙连接之后,在通过所述第一蓝牙连接执行所述第三业务的情况下,建立所述电子设备与所述蓝牙设备之间的第二蓝牙连接;在确定所述第二蓝牙连接的第二音频传输通道建立后断开所述第一蓝牙连接;或,在确定基于所述第二蓝牙连接执行所述第三业务后断开所述第一蓝牙连接。
所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述装置和模块的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。
在本申请所提供的几个实施例中,模块相互之间的耦合可以是电性,机械或其它形式的耦合。
另外,在本申请各个实施例中的各功能模块可以集成在一个处理模块中,也可以是各个模块单独物理存在,也可以两个或两个以上模块集成在一个模块中。上述集成的模块既可以采用硬件的形式实现,也可以采用软件功能模块的形式实现。
请参考图11,其示出了本申请实施例提供的一种电子设备的结构框图。该电子设备100可以是智能手机、平板电脑、电子书等能够运行应用程序的电子设备。本申请中的电子设备100可以包括一个或多个如下部件:处理器110、存储器120、以及一个或多个应用程序,其中一个或多个应用程序可以被存储在存储器120中并被配置为由一个或多个处理器110执行,一个或多个程序配置用于执行如前述方法实施例所描述的方法。
处理器110可以包括一个或者多个处理核。处理器110利用各种接口和线路连接整个电子设备100内的各个部分,通过运行或执行存储在存储器120内的指令、程序、代码集或指令集,以及调用存储在存储器120内的数据,执行电子设备100的各种功能和处理数据。可选地,处理器110可以采用数字信号处理(Digital Signal Processing,DSP)、现场可编程门阵列(Field-Programmable Gate Array,FPGA)、可编程逻辑阵列(Programmable Logic Array,PLA)中的至少一种硬件形式来实现。处理器110可集成中央处理器(Central Processing Unit,CPU)、图像处理器(Graphics Processing Unit,GPU)和调制解调器等中的一种或几种的组合。其中,CPU主要处理操作系统、用户界面和应用程序等;GPU用于负责显示内容的渲染和绘制;调制解调器用于处理无线通信。可以理解的是,上述调制解调器也可以不集成到处理器110中,单独通过一块通信芯片进行实现。
存储器120可以包括随机存储器(Random Access Memory,RAM),也可以包括只读存储器(Read-Only Memory)。存储器120可用于存储指令、程序、代码、代码集或指令集。存储器120可包括存储程序区和存储数据区,其中,存储程序区可存储用于实现操作系统的指令、用于实现至少一个功能的指令(比如触控功能、声音播放功能、图像播放功能等)、用于实现下述各个方法实施例的指令等。存储数据区还可以存储终端100在使用中所创建的数据(比如电话本、音视频数据、聊天记录数据)等。
请参考图12,其示出了本申请实施例提供的一种计算机可读存储介质的结构框图。该计算机可读介质1200中存储有程序代码,所述程序代码可被处理器调用执行上述方法实施例中所描述的方法。
计算机可读存储介质1200可以是诸如闪存、EEPROM(电可擦除可编程只读存储器)、EPROM、硬盘或者ROM之类的电子存储器。可选地,计算机可读存储介质1200包括非易失性计算机可读介质
(non-transitory computer-readable storage medium)。计算机可读存储介质1200具有执行上述方法中的任何方法步骤的程序代码1210的存储空间。这些程序代码可以从一个或者多个计算机程序产品中读出或者写入到这一个或者多个计算机程序产品中。程序代码1210可以例如以适当形式进行压缩。
请参考图13,其示出了本申请实施例提供的一种计算机程序产品的结构框图1300。该计算机程序产品1300中包括计算机程序/指令1310,该计算机程序/指令1310被处理器执行时实现上述方法的步骤。
综上所述,本申请实施例在所述电子设备与所述蓝牙设备之间已建立第一蓝牙连接的情况下,检测到指定请求,指定请求用于指示建立所述电子设备与所述蓝牙设备之间的第二蓝牙连接,响应于所述指定请求,在所述第一蓝牙连接保持连接的情况下,建立所述电子设备与所述蓝牙设备之间的第二蓝牙连接,在所述第二蓝牙连接成功建立之后,将所述第一蓝牙连接断开。因此,在断开第一蓝牙连接之前,先确保第二蓝牙连接成功建立,能够避免在断开第一蓝牙连接的时候,由于第二蓝牙连接尚未成功建立,导致电子设备与蓝牙设备之间无法正常蓝牙通信,也能够避免在电子设备与蓝牙设备之间无法蓝牙通信的情况下,电子设备与蓝牙设备之间的第二蓝牙连接的建立时间过长而导致用户等待时间过长。
针对无业务播放的场景,通过先连上目标模式后再断掉当前模式的方式,如从BT切BLE Audio,先连上BLE Audio后再去断掉BT连接。这样使得手机再进行模式切换时,始终能保持当前至少有一种模式是处于连接状态,防止出现先断开当前模式后连不上目标模式的情况,导致最终手机与耳机出现没有任何蓝牙连接的情况,给用户造成使用上的困扰。以此保证了连接以及切换过程的稳定性。
针对有业务播放的场景,通过先连上目标模式且建立该模式的音频传输通道后再断掉当前模式的方式,如当前用户使用BT进行传数据,从BT切BLE Audio,手机端先与双耳连上BLE Audio且分别与耳机建立了CIS音频传输通道,然后再去停止BT下的音频传输,断掉BT的连接。通过先连上目标模式且建立目标模式下的音频传输通道再去断掉当前模式连接的方式,使得用户再切换过程,当目标模式的音频传输通道还未建立成功时,用户当前的使用完全不受影响。且目标模式连上后进行切换,整个切换时间很短,中间不会出现长时间的无声/外放等现象,给用户的感觉是切换时间很快,过渡很自然的感觉。同时也避免出现连接目标模式失败而出现音频外放的情况,进而提升整个TWS耳机与手机进行BT与LE Audio切换的体验。
最后应说明的是:以上实施例仅用以说明本申请的技术方案,而非对其限制;尽管参照前述实施例对本申请进行了详细的说明,本领域的普通技术人员当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不驱使相应技术方案的本质脱离本申请各实施例技术方案的精神和范围。
Claims (23)
- 一种蓝牙切换方法,其特征在于,应用于电子设备和/或蓝牙设备,所述方法包括:在所述电子设备与所述蓝牙设备之间已建立第一蓝牙连接的情况下,建立所述电子设备与所述蓝牙设备之间的第二蓝牙连接;在所述第二蓝牙连接成功建立之后,将所述第一蓝牙连接断开。
- 根据权利要求1所述的方法,其特征在于,在所述第一蓝牙连接传输预设数据的情况下;所述建立所述电子设备与所述蓝牙设备之间的第二蓝牙连接,包括:继续使用第一蓝牙连接传输所述预设数据,建立所述电子设备与所述蓝牙设备之间的第二蓝牙连接。
- 根据权利要求1或2所述的方法,其特征在于,所述在所述第二蓝牙连接成功建立之后,将所述第一蓝牙连接断开,包括:在所述第二蓝牙连接成功建立,且在已建立的所述第二蓝牙连接上建立数据传输通道的情况下,将所述第一蓝牙连接断开,所述数据传输通道用于传输预设数据。
- 根据权利要求1所述的方法,其特征在于,在所述第一蓝牙连接未传输预设数据的情况下,所述在所述第二蓝牙连接成功建立之后,将所述第一蓝牙连接断开,包括:在所述第二蓝牙连接成功建立之后,所述第二蓝牙连接上未建立数据传输通道之前,将第一蓝牙连接断开。
- 根据权利要求1所述的方法,其特征在于,在所述电子设备与所述蓝牙设备之间已建立第一蓝牙连接的情况下,建立所述电子设备与所述蓝牙设备之间的第二蓝牙连接,包括:在所述电子设备与所述蓝牙设备之间已建立第一蓝牙连接的情况下,确定指定请求;响应于所述指定请求,建立所述电子设备与所述蓝牙设备之间的第二蓝牙连接。
- 根据权利要求3所述的方法,其特征在于,所述预设数据为音频数据,所述数据传输通道为音频传输通道。
- 根据权利要求1所述的方法,其特征在于,所述建立所述电子设备与所述蓝牙设备之间的第二蓝牙连接,包括:在所述第一蓝牙连接保持连接的情况下,扫描所述蓝牙设备发送的预设广播;基于所述预设广播建立所述电子设备与所述蓝牙设备之间的第二蓝牙连接。
- 根据权利要求1所述的方法,其特征在于,所述第一蓝牙连接和第二蓝牙连接其中之一的蓝牙通信模式为经典蓝牙模式,另一个的蓝牙通信模式为低功耗音频蓝牙模式。
- 一种蓝牙连接方法,其特征在于,应用于电子设备和/或蓝牙设备,所述方法包括:在所述电子设备与蓝牙设备建立一条蓝牙连接的情况下,建立所述电子设备与所述蓝牙设备的另一条蓝牙连接,其中,两条蓝牙连接对应不同的蓝牙通信模式;在所述两条蓝牙连接中的目标蓝牙连接的连接信息确定后,断开所述目标蓝牙连接,其中,所述目标蓝牙连接为所述两条蓝牙连接中的至少一条。
- 根据权利要求9所述的方法,其特征在于,所述两条蓝牙连接包括第一蓝牙连接和第二蓝牙连接,其中所述第二蓝牙连接为所述目标蓝牙连接,所述第一蓝牙连接和所述第二蓝牙连接对应不同的蓝牙通信模式;所述在所述电子设备与蓝牙设备建立一条蓝牙连接的情况下,建立所述电子设备与所述蓝牙设备的另一条蓝牙连接,包括:在所述电子设备与所述蓝牙设备建立所述第二蓝牙连接的情况下,所述电子设备与所述蓝牙设备建立所述第一蓝牙连接;所述在所述两条蓝牙连接中的目标蓝牙连接的连接信息确定后,断开所述目标蓝牙连接,包括:在确定所述第二蓝牙连接的连接信息后,断开所述第二蓝牙连接;或者,在确定所述第一蓝牙连接的连接信息和所述第二蓝牙连接的连接信息后,断开所述第二蓝牙连接;或者,在确定所述第一蓝牙连接建立完成后,断开所述第二蓝牙连接;或者,在确定所述第一蓝牙连接和所述第二蓝牙连接建立完成后,断开所述第二蓝牙连接。
- 根据权利要求9或10所述的方法,其特征在于,所述断开所述第二蓝牙连接之后,还包括:存储所述第一蓝牙连接的第一蓝牙连接信息和所述第二蓝牙连接的第二蓝牙连接信息。
- 根据权利要求9或10所述的方法,其特征在于,所述在所述电子设备与所述蓝牙设备建立第二蓝牙连接的情况下,所述电子设备与所述蓝牙设备建立所述第一蓝牙连接,包括:响应于连接操作,建立所述电子设备与所述蓝牙设备的第二蓝牙连接;在所述电子设备与所述蓝牙设备建立第二蓝牙连接的情况下,所述电子设备与所述蓝牙设备建立所述第一蓝牙连接。
- 根据权利要求9或10所述的方法,其特征在于,在所述断开所述第二蓝牙连接之后,所述方法还包括:在所述电子设备与所述蓝牙设备之间已建立第一蓝牙连接的情况下,建立所述电子设备与所述蓝牙设备之间的第二蓝牙连接,控制所述第一蓝牙连接保持连接;在所述第二蓝牙连接的通信链路成功建立之后,将所述第一蓝牙连接断开。
- 根据权利要求13所述的方法,其特征在于,所述在所述第二蓝牙连接的通信链路成功建立之后,将所述第一蓝牙连接断开,包括:在确定所述第二蓝牙连接的物理链路建立的情况下,断开所述第一蓝牙连接;或者,在确定所述第二蓝牙连接的逻辑链路建立的情况下,断开所述第一蓝牙连接;或者,在确定所述第二蓝牙连接的音频传输协议建立的情况下,断开所述第一蓝牙连接;或者,在确定所述第二蓝牙连接的音频传输通道建立的情况下,断开所述第一蓝牙连接;或者,在确定使用所述第二蓝牙连接传输音频数据的情况下,断开所述第一蓝牙连接。
- 根据权利要求10所述的方法,其特征在于,所述第一蓝牙连接为LE Audio蓝牙连接,所述第二蓝牙连接为经典蓝牙连接,在所述断开所述第二蓝牙连接之后,所述方法还包括:在通过所述第一蓝牙连接执行所述第一业务的情况下,建立所述电子设备与所述蓝牙设备之间的第二蓝牙连接;在确定所述第二蓝牙连接的第一音频传输协议建立的情况下断开所述第一蓝牙连接;或,在确定基于所述第二蓝牙连接执行所述第一业务的情况下断开所述第一蓝牙连接。
- 根据权利要求15所述的方法,其特征在于,所述第一业务包括音乐播放业务或语音消息播放业务。
- 根据权利要求10所述的方法,其特征在于,所述第一蓝牙连接为LE Audio蓝牙连接,所述第二蓝牙连接为经典蓝牙连接,在所述断开所述第二蓝牙连接之后,所述方法还包括:在通过所述第一蓝牙连接执行所述第二业务的情况下,建立所述电子设备与所述蓝牙设备之间的第二蓝牙连接;在确定所述第二蓝牙连接的第二音频传输协议建立的情况下断开所述第一蓝牙连接;或,在确定所述第二蓝牙连接的第一音频传输通道建立的情况下断开所述第一蓝牙连接;或,在确定基于所述第二蓝牙连接执行所述第二业务的情况下断开所述第一蓝牙连接。
- 根据权利要求17所述的方法,其特征在于,所述第二业务包括通话业务、语音通话业务或视频通话业务。
- 根据权利要求10所述的方法,其特征在于,所述第一蓝牙连接为经典蓝牙连接,所述第二蓝牙连接为LE Audio蓝牙连接,在所述断开所述第二蓝牙连接之后,所述方法还包括:在通过所述第一蓝牙连接执行所述第三业务的情况下,建立所述电子设备与所述蓝牙设备之间的第二蓝牙连接;在确定所述第二蓝牙连接的第二音频传输通道建立后断开所述第一蓝牙连接;或,在确定基于所述第二蓝牙连接执行所述第三业务后断开所述第一蓝牙连接。
- 一种蓝牙切换装置,其特征在于,应用于电子设备和/或蓝牙设备,所述装置包括:连接单元,用于在所述电子设备与所述蓝牙设备之间已建立第一蓝牙连接的情况下,建立所述电子设备与所述蓝牙设备之间的第二蓝牙连接;第一断开单元,用于在所述第二蓝牙连接成功建立之后,将所述第一蓝牙连接断开。
- 一种蓝牙连接装置,其特征在于,应用于电子设备和/或蓝牙设备,所述装置包括:建立单元,用于在所述电子设备与蓝牙设备建立一条蓝牙连接的情况下,建立所述电子设备与所述蓝牙设备的另一条蓝牙连接,其中,两条蓝牙连接对应不同的蓝牙通信模式;第二断开单元,用于在所述两条蓝牙连接中的目标蓝牙连接的连接信息确定后,断开所述目标蓝牙连接,其中,所述目标蓝牙连接为所述两条蓝牙连接中的至少一条。
- 一种电子设备,其特征在于,包括:一个或多个处理器;存储器;一个或多个应用程序,其中所述一个或多个应用程序被存储在所述存储器中并被配置为由所述 一个或多个处理器执行,以使得所述电子设备实现如权利要求1-8或9-19任一项所述的方法。
- 一种计算机可读介质,其特征在于,所述计算机可读介质存储有处理器可执行的程序代码,所述程序代码被所述处理器执行时实现权利要求1-8或9-19任一项所述方法。
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211160261.0A CN117793837A (zh) | 2022-09-22 | 2022-09-22 | 蓝牙切换方法和装置、蓝牙连接方法和装置及电子设备 |
CN202211160261.0 | 2022-09-22 |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2024060750A1 true WO2024060750A1 (zh) | 2024-03-28 |
Family
ID=90386022
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2023/103173 WO2024060750A1 (zh) | 2022-09-22 | 2023-06-28 | 蓝牙切换方法和装置、蓝牙连接方法和装置及电子设备 |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN117793837A (zh) |
WO (1) | WO2024060750A1 (zh) |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105472542A (zh) * | 2015-12-16 | 2016-04-06 | 深圳智能表芯科技有限公司 | 一种基于低功耗蓝牙标准的智能穿戴设备与移动终端数据传输方法及系统 |
US20180152979A1 (en) * | 2015-05-14 | 2018-05-31 | Lg Electronics Inc. | Method and device for connecting alternative communication means using bluetooth low energy technology |
CN109688570A (zh) * | 2018-12-20 | 2019-04-26 | 惠州Tcl移动通信有限公司 | 蓝牙连接方法、系统和存储介质 |
CN110572803A (zh) * | 2019-07-25 | 2019-12-13 | 华为技术有限公司 | 蓝牙切换方法及蓝牙设备 |
CN110933614A (zh) * | 2019-10-12 | 2020-03-27 | 阿里巴巴集团控股有限公司 | 通信处理方法、装置及电子设备 |
-
2022
- 2022-09-22 CN CN202211160261.0A patent/CN117793837A/zh active Pending
-
2023
- 2023-06-28 WO PCT/CN2023/103173 patent/WO2024060750A1/zh unknown
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20180152979A1 (en) * | 2015-05-14 | 2018-05-31 | Lg Electronics Inc. | Method and device for connecting alternative communication means using bluetooth low energy technology |
CN105472542A (zh) * | 2015-12-16 | 2016-04-06 | 深圳智能表芯科技有限公司 | 一种基于低功耗蓝牙标准的智能穿戴设备与移动终端数据传输方法及系统 |
CN109688570A (zh) * | 2018-12-20 | 2019-04-26 | 惠州Tcl移动通信有限公司 | 蓝牙连接方法、系统和存储介质 |
CN110572803A (zh) * | 2019-07-25 | 2019-12-13 | 华为技术有限公司 | 蓝牙切换方法及蓝牙设备 |
CN110933614A (zh) * | 2019-10-12 | 2020-03-27 | 阿里巴巴集团控股有限公司 | 通信处理方法、装置及电子设备 |
Also Published As
Publication number | Publication date |
---|---|
CN117793837A (zh) | 2024-03-29 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
WO2018032455A1 (zh) | 一种蓝牙通信的方法及终端 | |
WO2019090726A1 (zh) | 选择蓝牙设备的方法、终端和系统 | |
WO2020132839A1 (zh) | 应用于tws耳机单双耳切换的音频数据传输方法及设备 | |
WO2020063066A1 (zh) | 数据传输方法、装置、电子设备及存储介质 | |
WO2023087793A1 (zh) | 音频业务处理方法、装置、电子设备及存储介质 | |
CN113766477A (zh) | 设备连接方法、装置、电子设备及计算机可读介质 | |
WO2020063069A1 (zh) | 音频播放方法、装置、电子设备及计算机可读介质 | |
CN101631156A (zh) | 一种终端控制蓝牙耳机有序连接的方法及系统 | |
JP2023514585A (ja) | 複数のイヤホンアーキテクチャ間の切換え | |
WO2024055494A1 (zh) | 基于蓝牙耳机的通话方法、装置及存储介质 | |
WO2024119947A1 (zh) | 蓝牙通信方法、装置、电子设备及计算机可读介质 | |
WO2021239032A1 (zh) | 蓝牙协议连接方法、装置、存储介质及相关设备 | |
WO2023061127A1 (zh) | 通信方法、装置、耳机组及计算机可读介质 | |
WO2022237609A1 (zh) | 通信控制方法、电子设备和耳机 | |
TW202232925A (zh) | 可避免聲音中斷的藍牙通信系統及相關的藍牙主控裝置與藍牙設備群 | |
WO2024060777A1 (zh) | 蓝牙切换方法、装置、蓝牙设备及计算机可读介质 | |
WO2024055738A1 (zh) | 音频数据的共享方法、装置、电子设备以及存储介质 | |
CN110602683A (zh) | 蓝牙控制方法、装置、移动终端及存储介质 | |
WO2024016885A1 (zh) | 蓝牙连接方法、装置、电子设备及计算机可读存储介质 | |
WO2024060750A1 (zh) | 蓝牙切换方法和装置、蓝牙连接方法和装置及电子设备 | |
WO2023202131A1 (zh) | 设备互联方法、装置、电子设备及存储介质 | |
WO2023045784A1 (zh) | 通话控制方法、装置、电子设备及计算机可读存储介质 | |
WO2022252928A1 (zh) | 投屏方法、装置、无线终端、投屏设备及存储介质 | |
CN114885261A (zh) | 耳机组件、无线音频播放系统及其通信方法 | |
CN114844736A (zh) | 一种设备及通话控制方法 |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 23867045 Country of ref document: EP Kind code of ref document: A1 |