WO2024045877A1 - 设备的连接方法、装置、电子设备以及存储介质 - Google Patents

设备的连接方法、装置、电子设备以及存储介质 Download PDF

Info

Publication number
WO2024045877A1
WO2024045877A1 PCT/CN2023/104970 CN2023104970W WO2024045877A1 WO 2024045877 A1 WO2024045877 A1 WO 2024045877A1 CN 2023104970 W CN2023104970 W CN 2023104970W WO 2024045877 A1 WO2024045877 A1 WO 2024045877A1
Authority
WO
WIPO (PCT)
Prior art keywords
audio data
electronic device
bluetooth
target audio
bluetooth device
Prior art date
Application number
PCT/CN2023/104970
Other languages
English (en)
French (fr)
Inventor
包建全
Original Assignee
Oppo广东移动通信有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Oppo广东移动通信有限公司 filed Critical Oppo广东移动通信有限公司
Publication of WO2024045877A1 publication Critical patent/WO2024045877A1/zh

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W4/00Services specially adapted for wireless communication networks; Facilities therefor
    • H04W4/80Services using short range communication, e.g. near-field communication [NFC], radio-frequency identification [RFID] or low energy communication
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04BTRANSMISSION
    • H04B5/00Near-field transmission systems, e.g. inductive or capacitive transmission systems
    • H04B5/70Near-field transmission systems, e.g. inductive or capacitive transmission systems specially adapted for specific purposes
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04RLOUDSPEAKERS, MICROPHONES, GRAMOPHONE PICK-UPS OR LIKE ACOUSTIC ELECTROMECHANICAL TRANSDUCERS; DEAF-AID SETS; PUBLIC ADDRESS SYSTEMS
    • H04R3/00Circuits for transducers, loudspeakers or microphones
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W76/00Connection management
    • H04W76/10Connection setup
    • H04W76/14Direct-mode setup

Definitions

  • the present application relates to the technical field of electronic equipment, and more specifically, to a device connection method, device, electronic equipment, and storage medium.
  • this application proposes a device connection method, device, electronic device and storage medium to solve the above problems.
  • embodiments of the present application provide a device connection method, which is applied to a first electronic device.
  • the first electronic device establishes a low-power Bluetooth connection with a Bluetooth device.
  • the method includes: When an electronic device plays the first target audio data, the first playback capability information of the Bluetooth device is obtained.
  • the first playback capability information is used to indicate to the first electronic device the audio that the Bluetooth device supports playing. Type; determine a playback strategy for the first target audio data according to the first playback capability information and the audio type of the first target audio data.
  • embodiments of the present application provide a device connection method, which is applied to a Bluetooth device.
  • the Bluetooth device establishes a low-power Bluetooth connection with a first electronic device.
  • the method includes: sending a Bluetooth device's The first playing capability information is sent to the first electronic device, so that when the first electronic device plays the first target audio data, the first playing capability information and the audio of the first target audio data are Type, determine the playback strategy of the first target audio data, wherein the first playback capability information is used to indicate to the first electronic device the audio type that the Bluetooth device supports playback.
  • embodiments of the present application provide a device connection device, which is applied to a first electronic device.
  • the first electronic device establishes a low-power Bluetooth connection with a Bluetooth device.
  • the device includes: obtaining playback capability information. Module, configured to obtain first playback capability information of the Bluetooth device when the first electronic device plays the first target audio data, and the first playback capability information is used to indicate to the first electronic device
  • the Bluetooth device supports audio types played; a playback strategy determination module is configured to determine a playback strategy for the first target audio data based on the first playback capability information and the audio type of the first target audio data.
  • an embodiment of the present application provides a device connection device, which is applied to a Bluetooth device.
  • the Bluetooth device establishes a low-power Bluetooth connection with a first electronic device.
  • the device includes: an information sending module, with Send the first playback capability information of the Bluetooth device to the first electronic device, so that when the first electronic device plays the first target audio data, the first playback capability information and the The audio type of the first target audio data determines the playback strategy of the first target audio data, wherein the first playback capability information is used to indicate to the first electronic device the audio type that the Bluetooth device supports playback.
  • embodiments of the present application provide an electronic device, including a memory and a processor.
  • the memory is coupled to the processor, and the memory stores instructions that are executed when the instructions are executed by the processor.
  • the processor executes the above method.
  • embodiments of the present application provide a computer-readable storage medium, the computer-readable storage medium stores program code, and the program code can be called by a processor to execute the above method.
  • Figure 1 shows a schematic diagram of an application environment that can be used for the connection method of the device provided by the embodiment of the present application
  • Figure 2 shows a schematic diagram of another application environment that can be used for the connection method of the device provided by the embodiment of the present application;
  • Figure 3 shows a schematic flowchart of a device connection method provided by an embodiment of the present application
  • Figure 4 shows a schematic flowchart of a device connection method provided by an embodiment of the present application
  • Figure 5 shows a schematic flowchart of a device connection method provided by an embodiment of the present application
  • Figure 6 shows a schematic flowchart of a device connection method provided by an embodiment of the present application
  • Figure 7 shows an example diagram of a connection method of a device provided by an embodiment of the present application.
  • Figure 8 shows an example diagram of a connection method of a device provided by an embodiment of the present application.
  • Figure 9 shows a schematic flowchart of a device connection method provided by an embodiment of the present application.
  • Figure 10 shows an example diagram of a device connection method provided by an embodiment of the present application
  • Figure 11 shows a schematic flow chart of a device connection method provided by an embodiment of the present application.
  • Figure 12 shows an example diagram of a device connection method provided by an embodiment of the present application
  • Figure 13 shows a module block diagram of a connection device of a device provided by an embodiment of the present application
  • Figure 14 shows a module block diagram of a connection device of a device provided by an embodiment of the present application.
  • Figure 15 shows a block diagram of an electronic device used to perform a device connection method according to an embodiment of the present application
  • Figure 16 shows a storage unit used to save or carry the program code for implementing the connection method of the device according to the embodiment of the present application.
  • Bluetooth devices such as Bluetooth speakers and Bluetooth headsets (such as True Wireless Stereo (TWS)) is also advancing rapidly.
  • TWS True Wireless Stereo
  • BLE Audio Bluetooth Low Energy Audio
  • the Bluetooth device is obtained.
  • the specific device connection method will be described in detail in subsequent embodiments.
  • Figure 1 shows a schematic diagram of an application environment that can be used for the connection method of the device provided by the embodiment of the present application. As shown in Figure 1, it includes a first electronic device 100 and a Bluetooth device 200.
  • the first electronic device 100 may include a smart phone, a tablet computer, a notebook computer, a personal computer, an audio-visual equipment, a wearable electronic device and other sound source devices. , there is no limitation here.
  • the Bluetooth device 200 may include audio playback devices such as Bluetooth speakers and Bluetooth headsets. When the Bluetooth device 200 is a Bluetooth headset, the Bluetooth headset may include one Bluetooth device or a pair of Bluetooth devices. No limitation is made here.
  • a BLE connection can be established between the first electronic device 100 and the Bluetooth device 200. Based on this, information exchange can be performed between the first electronic device 100 and the Bluetooth device 200.
  • Figure 2 shows a schematic diagram of another application environment that can be used for the connection method of the device provided by the embodiment of the present application. As shown in Figure 2, it includes a first electronic device 100, a Bluetooth device 200, and a second electronic device 300.
  • the second electronic device may include a smartphone, a tablet computer, a wearable electronic device, etc., which is not limited here.
  • the Bluetooth device 200 establishes a low-power Bluetooth connection with both the first electronic device 100 and the second electronic device 200. Based on this, the Bluetooth device 200 can interact with the first electronic device 100. Information interaction can also be performed with the second electronic device 300 .
  • the Bluetooth device 200 is a Bluetooth device that supports LE Audio
  • the first electronic device 100 is an electronic device that supports LE Audio
  • the second electronic device 300 is an electronic device that supports LE Audio.
  • the Bluetooth device 200 supports the server role (unicast server) of LE Audio
  • the first electronic device 100 supports the client role (unicast client) of LE Audio
  • the second electronic device 300 supports the client role (unicast client) of LE Audio.
  • unicast client is one of the LE Audio BAP roles. It is mainly used to receive the broadcast of the discovered unicast server and establish a connection with the unicast server.
  • unicast server is another one of the LE Audio BAP roles. It is mainly used to transmit broadcasts and Establish a connection with the unicast client.
  • FIG. 3 is a schematic flowchart of a device connection method provided by an embodiment of the present application.
  • This method is used to obtain the playback capability information of the Bluetooth device by establishing a low-power Bluetooth connection with the Bluetooth device, and determine the audio data for the playback based on the playback capability information and the audio type of the audio data played by itself. Playback strategies can improve the audio playback effect and user experience.
  • the device connection method is applied to the connection device 400 of the device as shown in FIG. 13 and the first electronic device 100 ( FIG. 15 ) configured with the connection device 400 .
  • the following will take the first electronic device as an example to illustrate the specific process of this embodiment.
  • the first electronic device to which this embodiment is applied may include smart phones, tablet computers, wearable electronic devices, etc.
  • the process shown in Figure 3 will be described in detail below.
  • the device connection method may specifically include the following steps:
  • Step S110 When the first electronic device plays the first target audio data, obtain the first playback capability information of the Bluetooth device.
  • the first playback capability information is used to indicate the first playback capability information to the first electronic device.
  • a BLE connection may be established between the first electronic device and the Bluetooth device.
  • the Bluetooth device can be placed in the headphone box. When it is detected that the headphone box is opened, a BLE connection between the first electronic device and the Bluetooth device can be established. As another way, the Bluetooth device can be placed in the headphone box. When it is detected that the Bluetooth device is taken out of the headphone box, a BLE connection between the first electronic device and the Bluetooth device can be established. As another way, the Bluetooth device can be placed in the headphone box. When it is detected that the Bluetooth device is taken out of the headphone box, it can be detected whether the Bluetooth device is in a wearing state. When it is detected that the Bluetooth device is in a wearing state, then A BLE connection between the first electronic device and the Bluetooth device can be established.
  • the first electronic device plays audio data can be detected. If it is detected that the first electronic device plays the first target audio data, the first playback capability information of the Bluetooth device can be obtained. The first playback capability information is used to indicate to the first electronic device the audio types that the Bluetooth device supports playing.
  • the audio types supported by the Bluetooth device may include music media type, conversational type, game type, etc., which are not limited here.
  • the first electronic device can obtain the private protocol parameters of the Bluetooth device. Based on the private protocol parameters, the first electronic device can know the Bluetooth device. The audio types the device supports for playback.
  • the first electronic device can obtain the available audio context (Available Audio Contexts) of the Bluetooth device. Based on the available audio context, the first electronic device The electronic device can know the audio types that the Bluetooth device supports playing.
  • the Bluetooth device can transmit a low-power audio broadcast
  • the first electronic device can receive the low-power audio broadcast transmitted by the Bluetooth device to obtain the Bluetooth address of the Bluetooth device from the low-power audio broadcast. information, and then establish a BLE connection with the Bluetooth device based on the Bluetooth address and other information of the Bluetooth device.
  • the Bluetooth device can be placed in the headphone box. When it is detected that the headphone box is opened, it can transmit a low-power audio broadcast. When the first electronic device receives the low-power audio broadcast, it can respond. Establish a BLE connection with the Bluetooth device in the low-power audio broadcast. As another way, the Bluetooth device can be placed in the headphone box. When it is detected that the Bluetooth device is taken out of the headphone box, the low-power audio broadcast can be transmitted. When the first electronic device receives the low-power audio broadcast , then a BLE connection with the Bluetooth device can be established in response to the low-power audio broadcast. As another way, the Bluetooth device can be placed in the headphone box.
  • the Bluetooth device When it is detected that the Bluetooth device is taken out of the headphone box, it can be detected whether the Bluetooth device is in a wearing state. When it is detected that the Bluetooth device is in a wearing state, then A low-power audio broadcast can be transmitted. When receiving the low-power audio broadcast, the first electronic device can establish a BLE connection with the Bluetooth device in response to the low-power audio broadcast.
  • the first electronic device when the first electronic device establishes a BLE connection with the Bluetooth device, it can read the relevant attributes of the Bluetooth device based on the BLE connection, where the related attributes can include the available audio of the Bluetooth device. The state of the context and audio streaming endpoint.
  • the first electronic device when the first electronic device obtains the status of the available audio context of the Bluetooth device, it can save the status of the available audio context for subsequent reference whether to establish a connection synchronization stream with the Bluetooth device, thereby improving the first
  • the electronic device initiates a synchronous stream connection request rationally, thereby reducing the power consumption of the first electronic device.
  • Step S120 Determine a playback strategy for the first target audio data based on the first playback capability information and the audio type of the first target audio data.
  • the first electronic device when the first electronic device determines the first playback capability of the Bluetooth device, it can determine the first target audio based on the first playback capability information and the audio type of the first target audio data. Data playback strategy.
  • the first electronic device when the first electronic device plays the first target audio data, it can obtain the audio type of the first target audio data, and the first electronic device determines the first playback capability of the Bluetooth device. In this case, you can obtain the audio types supported by the Bluetooth device. Based on this, the first electronic device can compare the audio type supported by the Bluetooth device with the audio type of the first target audio data, obtain the comparison result, and determine the playback strategy of the first audio data based on the comparison result.
  • the first target audio data may not be output through the Bluetooth device; if the comparison result indicates that the Bluetooth device If the audio type that supports playing the first target audio data is used, the first target audio data can be output through the Bluetooth device.
  • a device connection method provided by an embodiment of the present application obtains the first playback capability information of the Bluetooth device when the first electronic device plays the first target audio data, and the first playback capability information is used to provide the first playback capability information to the first electronic device. Instruct the Bluetooth device to support the audio type played, and determine the playback strategy of the first target audio data based on the first playback capability information and the audio type of the first target audio data, thereby establishing a low-power Bluetooth connection with the Bluetooth device. , obtain the playback capability information of the Bluetooth device, and determine the playback strategy for the audio data played based on the playback capability information and the audio type of the audio data it plays, thereby improving the audio playback effect and user experience.
  • FIG. 4 shows a schematic flowchart of a device connection method provided by an embodiment of the present application. This method is applied to the above-mentioned first electronic device. The process shown in Figure 4 will be described in detail below.
  • the connection method of the device may specifically include the following steps:
  • Step S210 When the first electronic device plays the first target audio data, obtain the first playback capability of the Bluetooth device.
  • the first playback capability information is used to indicate to the first electronic device the audio type that the Bluetooth device supports playback.
  • step S210 For the specific description of step S210, please refer to step S110, which will not be described again here.
  • Step S220 If the first playback capability information indicates that the Bluetooth device supports playing the audio type of the first target audio data, send the first target audio data to the Bluetooth device.
  • the first target audio data can be sent to the Bluetooth device to pass the Bluetooth device
  • the first target audio data is output. For example, assuming that the audio type of the first target audio data is "music type" and the first playback capability information indicates that the Bluetooth device supports "music type", the first target audio data can be sent to the Bluetooth device.
  • connection synchronization stream between the first electronic device and the Bluetooth device can be established to pass the connection
  • the synchronization stream sends the first target audio data to the Bluetooth device.
  • the connection synchronization flow may include CIS, BIS, etc., which is not limited here.
  • the first electronic device can initiate a synchronization stream connection request to the Bluetooth device, and the Bluetooth device can In response to the synchronization stream connection request, a connection synchronization stream with the first electronic device is established.
  • the first target audio data of the first electronic device can be sent to the Bluetooth device based on the connection synchronization flow, so as to pass the connection synchronization flow.
  • the Bluetooth device outputs the first target audio data.
  • Step S230 If the first playback capability information indicates that the Bluetooth device does not support playing the audio type of the first target audio data, monitor changes in the first playback capability information of the Bluetooth device.
  • the first target audio data may not be sent to the Bluetooth device and the Bluetooth device may be monitored.
  • the first playback capability information of the Bluetooth device changes. For example, assuming that the audio type of the first target audio data is "music type" and the first playback capability information indicates that the Bluetooth device does not support "music type", the first target audio data may not be sent to the Bluetooth device. , and monitor changes in the first playback capability information of the Bluetooth device.
  • the first target audio data can be played externally and the first playback of the Bluetooth device can be monitored. Changes in capability information.
  • playing the first target audio data externally may include: playing the first target audio data through a speaker of the first electronic device.
  • the first target audio data can be sent to other Bluetooth devices, wherein the first target audio data can be sent to other Bluetooth devices.
  • Electronic devices establish Bluetooth Low Energy connections with other Bluetooth devices.
  • the first electronic device can establish low-power Bluetooth connections with the Bluetooth device and other Bluetooth devices respectively.
  • it can be determined whether the other Bluetooth device supports the audio type for playing the first target audio data. If it is determined that the other Bluetooth device supports the audio type for playing the first target audio data, the first target audio data can be sent to the other Bluetooth device.
  • a Bluetooth device to output the first target audio data through other Bluetooth devices.
  • the first playback capability information may include available audio context, and then the playback of the first target audio data may be determined according to the status information of the audio type corresponding to the audio type of the first target audio data in the available audio context.
  • the electronic device can obtain the "available audio context (such as media, conversational, game, etc.)" and the supported audio stream endpoints (Audio Stream Endpoint, ASE) of Bluetooth devices, including Sink ASE and Source ASE, and the corresponding ASE will be configured to the corresponding state (i.e. QOS Configured state).
  • the corresponding state i.e. QOS Configured state.
  • a connection synchronization stream will be created between them and the ASE state will change to the corresponding state (i.e., Streaming state). After that, audio data can be transmitted in the connection synchronization stream.
  • the "available audio context” of the Bluetooth device When the "available audio context” of the Bluetooth device is “available” (for example: set the media in available audio contexts to “YES”) and sends it to the currently connected electronic device, the currently connected electronic device can establish a connection with the Bluetooth device. Connect synchronous stream; when the "available audio context” of the Bluetooth device is "unavailable” (for example: set the media in available audio contexts to "NO”) and send it to the currently connected electronic device, the electronic device will not communicate with A Bluetooth device establishes a connection synchronization stream.
  • a BLE connection is established between the first electronic device and the Bluetooth device.
  • the first electronic device can obtain relevant information of the Bluetooth device from the Bluetooth device based on the BLE connection.
  • the first electronic device can obtain relevant information of the Bluetooth device based on the BLE connection.
  • the connection obtains from the Bluetooth device the ASE status supported by the Bluetooth device, the status information of the audio type in the available audio context of the Bluetooth device, etc.
  • the available audio context of the Bluetooth device may include multiple audio types, where the multiple audio types may To include the first audio type, the second audio type, the third audio type... the nth audio type.
  • the status information of the audio type in the available audio context of the Bluetooth device may include status information of each audio type in the available audio context of the Bluetooth device. For example, it may include status information of the first audio type, the second audio type, and the status information of the second audio type. Type of status information, status information of the third audio type...status information of the nth audio type.
  • the status information of the audio type in the available audio context is used to indicate whether the audio type in the available audio context is available, that is, the status information of the audio type in the available audio context is "available/YES", then The status information characterizing the audio type in the available audio context is the available state. If the status of the audio type in the available audio context is "unavailable/NO", then the state information characterizing the audio type in the available audio context is the unavailable state. .
  • the first electronic device when the first electronic device determines the audio type of the first target audio data, it may detect the status of the audio type corresponding to the audio type of the first target audio data in the available audio context of the Bluetooth device. information. If it is detected that the status information of the audio type corresponding to the audio type of the first target audio data in the available audio context of the Bluetooth device is in an unavailable state, it can be determined that the audio type of the first target audio data is the Bluetooth device. If the audio data output cannot be provided for the first electronic device, the first electronic device can play the first target audio data externally, pause playback, or play the first target audio data through other Bluetooth devices.
  • the status information of media in the available audio context of the Bluetooth device can be detected. If it is detected that the status information of media in the available audio context of the Bluetooth device is NO, it can be determined that the Bluetooth device cannot provide the output of the first target audio data for the first electronic device, and the first electronic device can externally Play, pause playback, play through other Bluetooth devices, etc. to process the first target audio data.
  • the Bluetooth device while processing the first target audio data by external playback, pausing playback, playing through other Bluetooth devices, etc., you can start to monitor the status changes of the available audio context of the Bluetooth device, that is, you can monitor the available audio context of the Bluetooth device. Monitor changes in the status information of the audio type corresponding to the audio type of the first target audio data in the audio context.
  • the Bluetooth device always maintains a BLE connection with the first electronic device, and the Bluetooth device monitors the status changes of its own available audio context. When it detects that the status of its own available audio context changes, then The state of its own available audio context can be updated, and the updated state of the available audio context can be sent to the first electronic device based on the BLE connection.
  • the first electronic device can be based on the updated state of the available audio context, It is determined whether the status information of the audio type corresponding to the audio type of the first target audio data in the available audio context switches from the unavailable state to the available state.
  • the first electronic device can monitor the status changes of the available audio context in real time, can monitor the status changes of the available audio context at preset time intervals, and can monitor the status changes of the available audio context at preset time points. , or you can monitor the status changes of the available audio context according to other preset rules, etc., which are not limited here.
  • the first electronic device may include a Bluetooth module and an audio module.
  • the Bluetooth module obtains the status of the available audio context of the Bluetooth device, it may transmit the status of the available audio context of the Bluetooth device to Audio module.
  • the audio module can determine the audio type of the first target audio data it plays, and determine whether the status information of the audio type corresponding to the audio type of the first target audio data in the available audio context of the Bluetooth device is available. If it is determined to be In the unavailable state, the audio module plays, pauses, or plays the first target audio data through other Bluetooth devices, and notifies the Bluetooth module to monitor status changes of the available audio context.
  • the status of the audio type corresponding to the first target audio data in the available audio context of the Bluetooth device to the unavailable state may include: the audio type corresponding to the first target audio data in the available audio context of the Bluetooth device.
  • the audio type of the audio type is occupied by the second electronic device.
  • the Bluetooth device can also establish a BLE connection with the second electronic device, and the second electronic device establishes a connection synchronization stream with the Bluetooth device earlier than the first electronic device to transmit the audio of the second electronic device and the first target audio data.
  • the Bluetooth device can update the status of the audio type corresponding to the audio type of the first target audio data in its available audio context from the available status to the unavailable status, and send it to the first electronic device, then the first electronic device will It is considered that the state of the audio type corresponding to the audio type of the first target audio data in the available audio context of the Bluetooth device is an unavailable state.
  • the status of the first audio scene in the available audio context of the Bluetooth device being the unavailable state may include: the audio type corresponding to the audio type of the second target audio data in the available audio context of the Bluetooth device is replaced by the second The electronic device occupies, wherein the priority of the audio type corresponding to the audio type of the second target audio data is higher than the priority of the audio type corresponding to the audio type of the first target audio data.
  • the Bluetooth device can also establish a BLE connection with the second electronic device, and the second electronic device establishes a connection synchronization stream with the Bluetooth device earlier than the first electronic device to transmit the second target audio data of the second electronic device.
  • the Bluetooth device can update the status of the audio type corresponding to the audio type of the second target audio data and the audio type corresponding to the audio type of the first target audio data in its available audio context from the available state to the unavailable state, and Sent to the first electronic device, the first electronic device will consider that the status of the audio type corresponding to the audio type of the first target audio data in the available audio context of the Bluetooth device is an unavailable status.
  • Step S240 If the first playback capability information of the Bluetooth device is monitored to indicate that the Bluetooth device switches from an audio type that does not support playing the first target audio data to an audio type that supports playing the first target audio data, Then send the first target audio data to the Bluetooth device.
  • the first target audio data can be sent to the Bluetooth device to output the first target audio data through the Bluetooth device.
  • the audio type of the first target audio data is "music type”
  • the first playback capability information indicates that the Bluetooth device switches from not supporting "music type” to supporting "music type”
  • the first target audio data can be Audio data is sent to the Bluetooth device.
  • the first electronic device may be established.
  • a connection synchronization flow between the device and the Bluetooth device is used to send the first target audio data to the Bluetooth device through the connection synchronization flow.
  • the first electronic device may include a Bluetooth module and an audio module.
  • the Bluetooth module monitors the status change of the available audio context, and when monitoring the status of the updated available audio context sent by the Bluetooth device based on the BLE connection, then The updated status of the available audio context can be synchronized to the audio module, and the audio module determines whether the updated status of the available audio context represents whether the Bluetooth device switches from an audio type that does not support playing the first target audio data to one that supports playing the first target audio data. The audio type of the target audio data is detected.
  • the Bluetooth module establishes a connection synchronization stream with a Bluetooth device.
  • the first electronic device may initiate a synchronization stream connection request to the Bluetooth device, and the Bluetooth device may respond to the synchronization stream connection request and establish a connection synchronization stream with the first electronic device.
  • the first target audio data of the first electronic device can be sent to the Bluetooth device based on the connection synchronization flow, so as to pass the connection synchronization flow.
  • the Bluetooth device outputs the first target audio data.
  • the first playback capability information of the Bluetooth device is obtained, and the first playback capability information is used to indicate to the first electronic device
  • the Bluetooth device supports the audio type played. If the first playback capability information indicates that the Bluetooth device supports the audio type for playing the first target audio data, the first target audio data is sent to the Bluetooth device. If the first playback capability information indicates that the Bluetooth device does not The audio type that supports playing the first target audio data is monitored for changes in the first playback capability information of the Bluetooth device. If the first playback capability information of the Bluetooth device is monitored, it indicates that the Bluetooth device is an audio type that does not support playing the first target audio data.
  • this embodiment also performs different processing on the audio data according to whether the first playback capability information supports the audio type of the audio data, thereby improving the audio playback effect.
  • FIG. 5 shows a schematic flowchart of a device connection method provided by an embodiment of the present application.
  • This method is used to obtain the playback capability information of the Bluetooth device by establishing a low-power Bluetooth connection with the Bluetooth device, and determine the audio data for the playback based on the playback capability information and the audio type of the audio data played by itself. Playback strategies can improve the audio playback effect and user experience.
  • the device connection method is applied to the device connection device 500 shown in FIG. 14 and the Bluetooth device 200 configured with the device connection device 500 ( FIG. 15 ).
  • the following will take a Bluetooth device as an example to illustrate the specific process of this embodiment.
  • the Bluetooth devices applied in this embodiment may include Bluetooth audio, Bluetooth headsets, etc., which are not limited here.
  • the process shown in Figure 5 will be described in detail below.
  • the device connection method may specifically include the following steps:
  • Step S410 Send the first playback capability information of the Bluetooth device to the first electronic device, so that when the first electronic device plays the first target audio data, the first playback capability information and the The audio type of the first target audio data determines the playback strategy of the first target audio data, wherein the first playback capability information is used to indicate to the first electronic device that the Bluetooth device supports playing audio type.
  • step S410 please refer to step S110 to step S120, which will not be described again here.
  • a device connection method provided by an embodiment of the present application sends the first playback capability information of the Bluetooth device to the first electronic device, so that when the first electronic device plays the first target audio data, the first playback capability information is sent to the first electronic device according to the first playback capability information. and the audio type of the first target audio data to determine the playback strategy of the first target audio data, wherein the first playback capability information is used to indicate to the first electronic device the audio type that the Bluetooth device supports playback, thereby establishing a connection with the Bluetooth device.
  • the low-power Bluetooth connection between the two devices obtains the playback capability information of the Bluetooth device, and determines the playback strategy for the audio data played based on the playback capability information and the audio type of the audio data it plays, thereby improving the audio playback effect. and user experience.
  • FIG. 6 is a schematic flowchart of a device connection method provided by an embodiment of the present application. This method is applied to the above-mentioned Bluetooth device. The process shown in Figure 6 will be described in detail below.
  • the connection method of the device may specifically include the following steps:
  • Step S510 Send the first playback capability information of the Bluetooth device to the first electronic device, so that when the first electronic device plays the first target audio data, the first playback capability information and the The audio type of the first target audio data determines the playback strategy of the first target audio data, wherein the first playback capability information is used to indicate to the first electronic device that the Bluetooth device supports playing audio type.
  • step S510 please refer to step S110 to step S120, which will not be described again here.
  • Step S520 When the Bluetooth device plays the first target audio data, send the second playback capability information of the Bluetooth device to the second electronic device, where the second playback capability information is used to Indicate to the second electronic device the audio type that the Bluetooth device supports playing, and the second playback capability information indicates that the Bluetooth device does not support the audio type playing the first target audio data. type.
  • the Bluetooth device can establish a BLE connection with the first electronic device and establish a BLE connection with the second electronic device.
  • the Bluetooth device can be placed in the headphone box.
  • a BLE connection between the first electronic device and the Bluetooth device can be established, and a BLE connection between the second electronic device and the Bluetooth device can be established.
  • the Bluetooth device can be placed in the headphone box.
  • a BLE connection between the second electronic device and the Bluetooth device can be established, and the second electronic device can be established.
  • the Bluetooth device can be placed in the headphone box.
  • it can be detected whether the Bluetooth device is in a wearing state.
  • a BLE connection between the first electronic device and the Bluetooth device can be established, and a BLE connection between the second electronic device and the Bluetooth device can be established.
  • a Bluetooth device can transmit a low-power audio broadcast, and the second electronic device can receive the low-power audio broadcast transmitted by the Bluetooth device to obtain the Bluetooth address of the Bluetooth device from the low-power audio broadcast, etc. information, and then establish a BLE connection with the Bluetooth device based on the Bluetooth address and other information of the Bluetooth device.
  • the second electronic device can read related attributes of the Bluetooth device based on the BLE connection, where the related attributes can include the status of the available audio context and the audio stream of the Bluetooth device. endpoint.
  • the second electronic device when the second electronic device obtains the status of the available audio context of the Bluetooth device, it can save the status of the available audio context for reference whether to establish a connection synchronization stream with the Bluetooth device in the future, thereby improving the second electronic device.
  • the electronic device initiates a synchronous stream connection request rationally, thereby reducing the power consumption of the second electronic device.
  • the Bluetooth device sets different playback capability information for different electronic devices, where the different playback capability information is used to indicate the audio types that the corresponding electronic device supports playback.
  • the first electronic device is used to indicate to the first playback capability information
  • the second electronic device is configured to indicate to the second electronic device the audio type that the Bluetooth device supports playing.
  • the Bluetooth device when playing the first target audio data, can send the second playback capability information of the Bluetooth device to the second electronic device.
  • the second playback capability information indicates that the Bluetooth device does not support the audio type for playing the first target audio data.
  • the Bluetooth device playing the first target audio data may include: establishing a connection synchronization stream with the first electronic device to receive and play the first target audio data sent by the first electronic device through the connection synchronization stream.
  • the Bluetooth device determines that a connection synchronization stream is established with the first electronic device and receives the first target audio data sent by the first electronic device based on the connection synchronization stream, it can be considered that the Bluetooth device is not connected to the first electronic device. If other electronic devices outside the device (such as a second electronic device) do not support playing the audio type corresponding to the first target audio data, the Bluetooth device can use the "" to indicate that the Bluetooth device does not support playing the first target audio data. The second playback capability information of the audio type is sent to the second electronic device for reference whether the second electronic device subsequently establishes a connection synchronization stream with the Bluetooth device.
  • FIG. 7 shows an example diagram of a device connection method provided by an embodiment of the present application.
  • an example is a scene in which Bluetooth headsets are connected to a first electronic device and a second electronic device respectively, and the first electronic device plays music.
  • Step S530 When the Bluetooth device stops playing the first target audio data, update the second playback capability information to obtain first update information, wherein the first update information is used to provide the second
  • the electronic device indicates that the Bluetooth device supports an audio type for playing the first target audio data.
  • the second playback capability information can be updated to obtain the first update information, where the first update information is used to provide the second electronic device with Indicate that the Bluetooth device supports the audio type for playing the first target audio data.
  • stopping the Bluetooth device from playing the first target audio data may include: disconnecting the connection synchronization stream with the first electronic device to stop playing the first target audio data.
  • the Bluetooth device can support playing the first target audio data for all electronic devices (such as the first electronic device and the second electronic device).
  • audio type then the Bluetooth device can update the second playback capability information (update the second playback capability information from an audio type indicating that the playback of the first target audio data is not supported to an audio type that supports the playback of the first target audio data) to obtain the second playback capability information.
  • An update information sending the first update information to the second electronic device for reference whether the second electronic device subsequently establishes a connection synchronization stream with the Bluetooth device.
  • Step S540 Send the first update information to the second electronic device.
  • the Bluetooth device when it obtains the first update information, it can send the first update information to the second electronic device.
  • the Bluetooth device can send the first update information based on the BLE connection with the second electronic device.
  • the first update information is sent to the second electronic device.
  • the second electronic device needs to play audio data, it can play it through the Bluetooth device.
  • the audio data played by the second electronic device can be sent to the Bluetooth device based on the connection synchronization flow. , to output the audio data of the second electronic device through the Bluetooth device.
  • FIG. 8 shows an example diagram of a device connection method provided by an embodiment of the present application.
  • the example is blue
  • the dental device is connected to the first electronic device and the second electronic device respectively, and the first electronic device plays music first, and the second electronic device plays music later, and the second electronic device cannot preempt the scene of the first electronic device.
  • a device connection method provided by an embodiment of the present application sends the first playback capability information of the Bluetooth device to the first electronic device, so that when the first electronic device plays the first target audio data, the first playback capability information is sent to the first electronic device according to the first playback capability information. and the audio type of the first target audio data, determining the playback strategy of the first target audio data, wherein the first playback capability information is used to indicate to the first electronic device the audio type that the Bluetooth device supports playback, and the first target is played on the Bluetooth device.
  • the second playback capability information of the Bluetooth device is sent to the second electronic device, wherein the second playback capability information indicates that the Bluetooth device does not support playing the audio type of the first target audio data, and the Bluetooth device stops playing the first audio data.
  • this embodiment In the case of target audio data, update the second playback capability information to obtain the first update information, where the first update information is used to indicate to the second electronic device that the Bluetooth device supports the audio type for playing the first target audio data, and send the first update information to the second electronic device.
  • this embodiment also determines the second playback capability information sent to the second electronic device based on the playback of the first target audio data by the Bluetooth device to avoid multiple electronic devices. The preemption of pages of the same type can reduce the power consumption of the second electronic device.
  • FIG. 9 is a schematic flowchart of a device connection method provided by an embodiment of the present application. This method is applied to the above-mentioned Bluetooth device. The process shown in Figure 9 will be described in detail below.
  • the connection method of the device may specifically include the following steps:
  • Step S610 Send the first playback capability information of the Bluetooth device to the first electronic device, so that when the first electronic device plays the first target audio data, the first playback capability information and the The audio type of the first target audio data determines the playback strategy of the first target audio data, wherein the first playback capability information is used to indicate to the first electronic device that the Bluetooth device supports playing audio type.
  • step S610 please refer to step S110 to step S120, which will not be described again here.
  • Step S620 When the Bluetooth device plays the first target audio data, receive a first connection request initiated by the second electronic device, wherein the first connection request is initiated by the second electronic device. Sent when playing the second target audio data, wherein the audio type of the first target audio data is the same as the audio type of the second target audio data.
  • the Bluetooth device can establish a BLE connection with the first electronic device and establish a BLE connection with the second electronic device.
  • the Bluetooth device when the Bluetooth device is playing the first target audio data, if the second electronic device is playing the second target audio data (the audio type of the first target audio data and the audio type of the second target audio data same), and the second electronic device desires to play the second target audio data through the Bluetooth device, the second electronic device can initiate a first connection request to the Bluetooth device, and accordingly, the Bluetooth device can receive the first connection request.
  • the Bluetooth device playing the first target audio data may include: establishing a connection synchronization stream with the first electronic device to receive and play the first target audio data sent by the first electronic device through the connection synchronization stream.
  • the second electronic device when it establishes a BLE connection with the Bluetooth device, it can detect whether to play the second target audio data. If it is detected that it plays the second target audio data, the second electronic device Based on the second audio playback capability information of the Bluetooth device stored therein, it can be determined whether the second audio playback capability information indicates whether the Bluetooth device supports playing the audio type of the second target audio data, wherein, if it is determined that the Bluetooth device supports playing the second audio type, The audio type of the second target audio data (for example, the audio type of the Bluetooth device corresponding to the audio type of the first target audio data is occupied by the first electronic device, and the Bluetooth device does not update its second available audio playback capability information to the second electronic device), Then the audio type for the second target audio data can be determined, the Bluetooth device can provide the output of the audio data for the second electronic device, and the second electronic device can initiate a first connection request to the Bluetooth device.
  • the Bluetooth device can provide the output of the audio data for the second electronic device, and the second electronic device can initiate a first connection
  • Step S630 In response to the first connection request, update the first playback capability information to obtain second update information, wherein the second update information is used to indicate to the first electronic device that the Bluetooth device does not support The audio type of the first target audio data is played.
  • the Bluetooth device when the Bluetooth device receives the first connection request, it can respond to the first connection request by updating the first playback capability information to obtain second update information, where the second update information Used to indicate to the first electronic device that the Bluetooth device does not support the audio type of the first target audio data.
  • the Bluetooth device when receiving a playback request of the second target audio data of the same type initiated by the second electronic device, the Bluetooth device can stop playing the first electronic device's third audio data. If there is a target audio data, the Bluetooth device can update the first playback capability information from an audio type that supports playing the first target audio data to an audio type that does not support playing the first target audio data.
  • Step S640 Send the second update information to the first electronic device to stop playing the first target audio data on the Bluetooth device.
  • the Bluetooth device when it obtains the second update information, it can send the second update information to the first electronic device to stop playing the first target audio data on the Bluetooth device.
  • the Bluetooth device when the Bluetooth device sends the second update information to the first electronic device, the first electronic device can respond to the second update information and disconnect the synchronization stream from the Bluetooth device. At this time, the Bluetooth device does not The first target audio data sent by the first electronic device will continue to be received, that is, the playback of the first target audio data will be stopped.
  • the connection synchronization flow between the Bluetooth device and the second electronic device can be established.
  • the second electronic device can send the third electronic device. 2 target audio data to the Bluetooth device to pass the The Bluetooth device plays the second target audio data.
  • FIG. 10 shows an example diagram of a device connection method provided by an embodiment of the present application.
  • the example is that the Bluetooth device is connected to the first electronic device and the second electronic device respectively, and the first electronic device plays music first, the second electronic device plays music later, and the second electronic device preempts the first electronic device. device scene.
  • a device connection method provided by an embodiment of the present application sends the first playback capability information of the Bluetooth device to the first electronic device, so that when the first electronic device plays the first target audio data, the first playback capability information is sent to the first electronic device according to the first playback capability information. and the audio type of the first target audio data, determining the playback strategy of the first target audio data, wherein the first playback capability information is used to indicate to the first electronic device the audio type that the Bluetooth device supports playback, and the first target is played on the Bluetooth device.
  • the first playback capability information is updated to obtain the second update information, wherein the second update information is used to indicate to the first electronic device that the Bluetooth device does not support playing the first
  • the audio type of the target audio data is sent to the first electronic device to stop playing the first target audio data on the Bluetooth device.
  • FIG. 11 is a schematic flowchart of a device connection method provided by an embodiment of the present application. This method is applied to the above-mentioned Bluetooth device. The process shown in Figure 11 will be described in detail below.
  • the connection method of the device may specifically include the following steps:
  • Step S710 Send the first playback capability information of the Bluetooth device to the first electronic device, so that when the first electronic device plays the first target audio data, the first playback capability information and the The audio type of the first target audio data determines the playback strategy of the first target audio data, wherein the first playback capability information is used to indicate to the first electronic device that the Bluetooth device supports playing audio type.
  • step S710 please refer to step S110 to step S120, which will not be described again here.
  • Step S720 When the Bluetooth device plays the first target audio data, a second connection request initiated by the second electronic device is received, wherein the second connection request is initiated by the second electronic device. Sent when playing the third target audio data, the priority of the audio type of the third target audio data is higher than the priority of the audio type of the first target audio data.
  • the Bluetooth device can establish a BLE connection with the first electronic device and establish a BLE connection with the second electronic device.
  • the Bluetooth device when the Bluetooth device is playing the first target audio data, if the second electronic device is playing the third target audio data (the audio type of the third target audio data has a higher priority than the first target audio
  • the priority of the audio type of the data for example, the audio type of the third target audio data is conversational, the audio type of the first target audio data is media
  • the second electronic device expects to play the third target audio data through a Bluetooth device
  • the second electronic device may initiate a second connection request to the Bluetooth device, and accordingly, the Bluetooth device may receive the second connection request.
  • the Bluetooth device playing the first target audio data may include: establishing a connection synchronization stream with the first electronic device to receive and play the first target audio data sent by the first electronic device through the connection synchronization stream.
  • the second electronic device when it establishes a BLE connection with the Bluetooth device, it can detect whether to play the third target audio data. If it is detected that it plays the third target audio data, the second electronic device Based on the second audio playback capability information of the Bluetooth device stored therein, it can be determined whether the second audio playback capability information indicates whether the Bluetooth device supports playing the audio type of the third target audio data, wherein, if it is determined that the Bluetooth device supports playing the third target audio data, The audio type of the third target audio data can be determined.
  • the Bluetooth device can provide the output of audio data for the second electronic device. Then the second electronic device can initiate a second connection request to the Bluetooth device. .
  • Step S730 In response to the second connection request, stop playing the first target audio data and play the third target audio data.
  • the Bluetooth device when the Bluetooth device receives the second connection request, it can stop playing the first target audio data and play the third target audio data.
  • the Bluetooth device when the Bluetooth device receives the second connection request, it can respond to the second connection request and disconnect the connection synchronization stream with the first electronic device. At this time, the Bluetooth device will not continue to receive the first electronic device.
  • the first target audio data sent by the device is to stop playing the first target audio data.
  • the Bluetooth device when the Bluetooth device receives the second connection request, it can respond to the second connection request and establish connection synchronization with the second electronic device. stream, at this time, the Bluetooth device can receive the third target audio data sent by the second electronic device, that is, play the third target audio data.
  • the Bluetooth device if the Bluetooth device supports playback preemption of the same type of audio data, then when the Bluetooth device determines to play the third audio data, it can update the first playback capability information to obtain the third update information and send it to the third audio data player.
  • the fourth update information is used to indicate to the second electronic device that the Bluetooth device does not support the audio type for playing the first target audio data.
  • the first electronic device can determine that the Bluetooth device cannot support playing the audio type of the first target audio data, but can support playing the audio type of the third target audio data. Based on the second electronic device, In the third updated information, it can be determined that the Bluetooth device cannot support the audio type for playing the first target audio data.
  • the Bluetooth device determines the playback In the case of third audio data, the first playback capability information may be updated to obtain the fifth update information and sent to the first electronic device, and the second playback capability information may be updated to obtain the third update information and sent to the second electronic device, wherein the fifth The update information is used to indicate to the first electronic device that the Bluetooth device does not support playing the audio type of the first target audio data and the audio type of the third target audio data.
  • the first electronic device can determine based on the third update information that the Bluetooth device cannot support the audio type of playing the first target audio data and cannot support the playing of the audio type of the third target audio data.
  • the second electronic device can determine based on the In the third updated information, it can be determined that the Bluetooth device cannot support the audio type for playing the first target audio data.
  • Figure 12 shows an example diagram of a device connection method provided by an embodiment of the present application. As shown in Figure 12, it illustrates a scenario in which Bluetooth headsets are connected to a first electronic device and a second electronic device respectively, and the first electronic device plays music first, and the second electronic device makes a call later.
  • a device connection method provided by an embodiment of the present application sends the first playback capability information of the Bluetooth device to the first electronic device, so that when the first electronic device plays the first target audio data, the first playback capability information is sent to the first electronic device according to the first playback capability information. and the audio type of the first target audio data, determining the playback strategy of the first target audio data, wherein the first playback capability information is used to indicate to the first electronic device the audio type that the Bluetooth device supports playback, and the first target is played on the Bluetooth device.
  • a second connection request initiated by the second electronic device is received, wherein the second connection request is sent by the second electronic device when playing the third target audio data, and the audio type of the third target audio data has priority.
  • the priority of the audio type is higher than that of the first target audio data, and in response to the second connection request, the playback of the first target audio data is stopped and the third target audio data is played.
  • this embodiment realizes preemption of services of different priority types between multiple electronic devices, thereby improving the user experience.
  • Figure 13 shows a block diagram of a connection device of a device provided by an embodiment of the present application.
  • the connection device 400 of the device is applied to the above-mentioned first electronic device.
  • the first electronic device establishes a low-level connection with the Bluetooth device. Power consumption Bluetooth connection will be described below with reference to the block diagram shown in Figure 13.
  • the connection device 400 of the device includes: a playback capability information acquisition module 410 and a playback strategy determination module 420, where:
  • the playback capability information acquisition module 410 is used to obtain the first playback capability information of the Bluetooth device when the first electronic device plays the first target audio data, and the first playback capability information is used to provide the first playback capability information to the Bluetooth device.
  • the first electronic device indicates the audio type that the Bluetooth device supports for playback.
  • the playback strategy determination module 420 is configured to determine a playback strategy for the first target audio data according to the first playback capability information and the audio type of the first target audio data.
  • the playback strategy determination module 420 includes: a first audio data sending sub-module, wherein:
  • a first audio data sending submodule configured to send the first target audio data to the Bluetooth device if the first playback capability information indicates that the Bluetooth device supports the audio type of the first target audio data. equipment.
  • the playback strategy determination module 420 includes: a playback capability information change monitoring submodule and a second audio data sending submodule, wherein:
  • a playback capability information change monitoring submodule configured to monitor the first playback capability information of the Bluetooth device if the first playback capability information indicates that the Bluetooth device does not support playing the audio type of the first target audio data. Variety.
  • the second audio data sending submodule is used to switch the audio type of the Bluetooth device from not supporting playing the first target audio data to supporting playing the first audio data if the first playback capability information of the Bluetooth device is monitored. If the audio type of the target audio data is determined, the first target audio data is sent to the Bluetooth device.
  • the first audio data sending sub-module/the second audio data sending sub-module includes: a connection establishment sub-module, wherein:
  • a connection establishment unit configured to establish a connection synchronization flow with the Bluetooth device to send the first target audio data to the Bluetooth device through the connection synchronization flow.
  • the playback strategy determination module 420 includes: an audio data playing sub-module, an audio data pausing sub-module and a third audio data sending sub-module, wherein:
  • the audio data external playback submodule is configured to externally play the first target audio data if the first playback capability information indicates that the Bluetooth device does not support the audio type for playing the first target audio data.
  • the audio data pause submodule is configured to pause the playback of the first target audio data if the first playback capability information indicates that the Bluetooth device does not support the audio type for playing the first target audio data.
  • the third audio data sending submodule is used to send the first target audio data to other Bluetooth devices if the first playback capability information indicates that the Bluetooth device does not support the audio type for playing the first target audio data.
  • Device wherein the first electronic device establishes a low-power Bluetooth connection with the other Bluetooth device.
  • the first playback capability information includes available audio context
  • the playback strategy determination module 420 includes: a playback strategy determination submodule, wherein:
  • a playback strategy determination submodule configured to determine a playback strategy for the first target audio data based on the status information of the audio type corresponding to the audio type of the first target audio data in the available audio context.
  • FIG. 14 is a schematic flowchart of a device connection method provided by an embodiment of the present application.
  • the device's connection The device 500 is applied to the above-mentioned Bluetooth device.
  • the Bluetooth device establishes a low-power Bluetooth connection with the first electronic device.
  • the process shown in Figure 14 will be described in detail below.
  • the connection device 500 of the device includes: an information sending module 510, of which:
  • the information sending module 510 is configured to send the first playback capability information of the Bluetooth device to the first electronic device, so that when the first electronic device plays the first target audio data, it will
  • the playback capability information and the audio type of the first target audio data determine the playback strategy of the first target audio data, wherein the first playback capability information is used to indicate the Bluetooth device to the first electronic device Supported audio types for playback.
  • the Bluetooth device also establishes a low-power Bluetooth connection with the second electronic device, and the connection device 500 of the device further includes:
  • the second playback capability information sending module is configured to send the second playback capability information of the Bluetooth device to the second electronic device when the Bluetooth device plays the first target audio data, wherein the The second playback capability information is used to indicate to the second electronic device the audio type that the Bluetooth device supports playing.
  • the second playback capability information indicates that the Bluetooth device does not support playing the audio type of the first target audio data. .
  • the Bluetooth device also establishes a low-power Bluetooth connection with the second electronic device.
  • the connection device 500 of the device further includes: a first update information obtaining module and a first update information sending module, wherein:
  • a first update information obtaining module configured to update the second playback capability information to obtain first update information when the Bluetooth device stops playing the first target audio data, wherein the first update information is Instructing the second electronic device that the Bluetooth device supports an audio type for playing the first target audio data.
  • a first update information sending module configured to send the first update information to the second electronic device.
  • the Bluetooth device also establishes a low-power Bluetooth connection with a second electronic device.
  • the connection device 500 of the device further includes: a first connection request receiving module, a second update information obtaining module, and a second update information sending module. module, where:
  • a first connection request receiving module configured to receive a first connection request initiated by the second electronic device when the Bluetooth device plays the first target audio data, wherein the first connection request is initiated by the second electronic device.
  • the second electronic device sends when playing the second target audio data, wherein the audio type of the first target audio data is the same as the audio type of the second target audio data.
  • a second update information obtaining module configured to respond to the first connection request, update the first playback capability information to obtain second update information, wherein the second update information is used to indicate to the first electronic device
  • the Bluetooth device does not support the audio type for playing the first target audio data.
  • a second update information sending module is configured to send the second update information to the first electronic device to stop playing the first target audio data on the Bluetooth device.
  • the Bluetooth device also establishes a low-power Bluetooth connection with a second electronic device.
  • the connection device 500 of the device further includes: a second connection request receiving module and a second connection request response module, wherein:
  • a second connection request receiving module configured to receive a second connection request initiated by the second electronic device when the Bluetooth device plays the first target audio data, wherein the second connection request is The second electronic device sends when playing third target audio data, and the priority of the audio type of the third target audio data is higher than the priority of the audio type of the first target audio data.
  • a second connection request response module configured to stop playing the first target audio data and play the third target audio data in response to the second connection request.
  • connection device 500 of the device also includes: a third update information sending module and a fourth update information sending module, wherein:
  • a third update information sending module is configured to update the first playback capability information to obtain third update information and send it to the first electronic device, and to update the second playback capability information to obtain fourth update information and send it to the first electronic device.
  • Two electronic devices wherein the third update information is used to indicate to the first electronic device that the Bluetooth device does not support playing the audio type of the first target audio data, and the fourth update information is used to indicate to the first electronic device
  • the second electronic device indicates that the Bluetooth device does not support playing the audio type of the first target audio data.
  • the fourth update information sending module is used to update the first playback capability information to obtain the fifth update information and send it to the first electronic device, and update the second playback capability information to obtain the third update information and send it to the first electronic device.
  • the second electronic device wherein the fifth update information is used to indicate to the first electronic device that the Bluetooth device does not support playing the audio type of the first target audio data and the third target audio data. Audio type.
  • connection device 500 of the device also includes: a connection establishment module, wherein:
  • a connection establishment module configured to establish a connection synchronization stream with the first electronic device to receive and play the first target audio data through the connection synchronization stream.
  • 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 one processing module, or each module can exist physically alone, or two or more modules can be integrated into one module.
  • the above integrated modules can be in the form of hardware It can also be implemented in the form of software function modules.
  • FIG. 15 shows a structural block diagram of an electronic device 100 provided by an embodiment of the present application.
  • the electronic device 600 includes the above-mentioned first electronic device 100, and may also include the Bluetooth device 200, which is not limited here.
  • the electronic device 600 in this application may include one or more of the following components: a processor 610, a memory 620, and one or more application programs, wherein one or more application programs may be stored in the memory 620 and configured to be Or multiple processors 610 execute, and one or more programs are configured to execute the method as described in the foregoing method embodiments.
  • the processor 610 may include one or more processing cores.
  • the processor 610 uses various interfaces and lines to connect various parts of the entire electronic device 600, and executes by running or executing instructions, programs, code sets or instruction sets stored in the memory 620, and calling data stored in the memory 620.
  • the processor 610 can 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).
  • the processor 610 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 content to be displayed; and the modem is used to handle wireless communications. It can be understood that the above modem may not be integrated into the processor 610 and may be implemented solely through a communication chip.
  • the memory 620 may include random access memory (RAM) or read-only memory (Read-Only Memory). Memory 620 may be used to store instructions, programs, codes, sets of codes, or sets of instructions.
  • the memory 620 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 electronic device 600 (such as phone book, audio and video data, chat record data), etc.
  • FIG. 16 shows a structural block diagram of a computer-readable storage medium provided by an embodiment of the present application.
  • the computer-readable medium 700 stores program code, which can be called by the processor to execute the method described in the above method embodiment.
  • Computer-readable storage medium 700 may be electronic memory such as flash memory, EEPROM (electrically erasable programmable read-only memory), EPROM, hard disk, or ROM.
  • the computer-readable storage medium 700 includes non-transitory computer-readable storage medium.
  • the computer-readable storage medium 700 has storage space for the program code 710 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 710 may, for example, be compressed in a suitable form.
  • the device connection method, device, electronic device and storage medium can obtain the first playback capability information of the Bluetooth device when the first electronic device plays the first target audio data.
  • the first playback capability information is used to indicate to the first electronic device the audio types that the Bluetooth device supports playback.
  • the playback strategy of the first target audio data is determined, thereby passing Establish a low-power Bluetooth connection with the Bluetooth device, obtain the playback capability information of the Bluetooth device, and determine the playback strategy for the audio data based on the playback capability information and the audio type of the audio data played by itself, so that you can Improve the audio playback effect and user experience.

Landscapes

  • Engineering & Computer Science (AREA)
  • Signal Processing (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Physics & Mathematics (AREA)
  • Acoustics & Sound (AREA)
  • Mobile Radio Communication Systems (AREA)
  • Telephone Function (AREA)

Abstract

本申请公开了一种设备的连接方法、装置、电子设备以及存储介质。第一电子设备与蓝牙设备建立有低功耗蓝牙连接,该方法包括:在第一电子设备播放第一目标音频数据的情况下,获取蓝牙设备的第一播放能力信息,该第一播放能力信息用于向第一电子设备指示蓝牙设备支持播放的音频类型,根据该第一播放能力信息和第一目标音频数据的音频类型,确定第一目标音频数据的播放策略。本申请通过建立与蓝牙设备之间的低功耗蓝牙连接,获取蓝牙设备的播放能力信息,并根据该播放能力信息以及自身播放的音频数据的音频类型,确定针对该播放的音频数据的播放策略,从而可以提升音频播放的效果和用户的使用体验。

Description

设备的连接方法、装置、电子设备以及存储介质
相关申请的交叉引用
本申请要求于2022年08月30日提交的申请号为CN202211058467.2的中国申请的优先权,其在此出于所有目的通过引用将其全部内容并入本文。
技术领域
本申请涉及电子设备技术领域,更具体地,涉及一种设备的连接方法、装置、电子设备以及存储介质。
背景技术
随着科学技术的发展,电子设备的使用越来越广泛,功能越来越多,已经成为人们日常生活中的必备之一。目前,电子设备可以通过蓝牙设备播放其输出的音频数据。
发明内容
鉴于上述问题,本申请提出了一种设备的连接方法、装置、电子设备以及存储介质,以解决上述问题。
第一方面,本申请实施例提供了一种设备的连接方法,应用于第一电子设备,所述第一电子设备与蓝牙设备建立有低功耗蓝牙连接,所述方法包括:在所述第一电子设备播放第一目标音频数据的情况下,获取所述蓝牙设备的第一播放能力信息,所述第一播放能力信息用于向所述第一电子设备指示所述蓝牙设备支持播放的音频类型;根据所述第一播放能力信息和所述第一目标音频数据的音频类型,确定所述第一目标音频数据的播放策略。
第二方面,本申请实施例提供了一种设备的连接方法,应用于蓝牙设备,所述蓝牙设备与第一电子设备建立有低功耗蓝牙连接,所述方法包括:发送所述蓝牙设备的第一播放能力信息至所述第一电子设备,以使所述第一电子设备在播放第一目标音频数据的情况下,根据所述第一播放能力信息和所述第一目标音频数据的音频类型,确定所述第一目标音频数据的播放策略,其中,所述第一播放能力信息用于向所述第一电子设备指示所述蓝牙设备支持播放的音频类型。
第三方面,本申请实施例提供了一种设备的连接装置,应用于第一电子设备,所述第一电子设备与蓝牙设备建立有低功耗蓝牙连接,所述装置包括:播放能力信息获取模块,用于在所述第一电子设备播放第一目标音频数据的情况下,获取所述蓝牙设备的第一播放能力信息,所述第一播放能力信息用于向所述第一电子设备指示所述蓝牙设备支持播放的音频类型;播放策略确定模块,用于根据所述第一播放能力信息和所述第一目标音频数据的音频类型,确定所述第一目标音频数据的播放策略。
第四方面,本申请一实施例提供了一种设备的连接装置,应用于蓝牙设备,所述蓝牙设备与第一电子设备建立有低功耗蓝牙连接,所述装置包括:信息发送模块,用于发送所述蓝牙设备的第一播放能力信息至所述第一电子设备,以使所述第一电子设备在播放第一目标音频数据的情况下,根据所述第一播放能力信息和所述第一目标音频数据的音频类型,确定所述第一目标音频数据的播放策略,其中,所述第一播放能力信息用于向所述第一电子设备指示所述蓝牙设备支持播放的音频类型。
第五方面,本申请实施例提供了一种电子设备,包括存储器和处理器,所述存储器耦接到所述处理器,所述存储器存储指令,当所述指令由所述处理器执行时所述处理器执行上述方法。
第六方面,本申请实施例提供了一种计算机可读取存储介质,所述计算机可读取存储介质中存储有程序代码,所述程序代码可被处理器调用执行上述方法。
附图说明
为了更清楚地说明本申请实施例中的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其它的附图。
图1示出了可用于本申请实施例提供的设备的连接方法的一种应用环境示意图;
图2示出了可用于本申请实施例提供的设备的连接方法的又一种应用环境示意图;
图3示出了本申请一实施例提供的设备的连接方法的流程示意图;
图4示出了本申请一实施例提供的设备的连接方法的流程示意图;
图5示出了本申请一实施例提供的设备的连接方法的流程示意图;
图6示出了本申请一实施例提供的设备的连接方法的流程示意图;
图7示出了本申请一实施例提供的设备的连接方法的示例图;
图8示出了本申请一实施例提供的设备的连接方法的示例图;
图9示出了本申请一实施例提供的设备的连接方法的流程示意图;
图10示出了本申请一实施例提供的设备的连接方法的示例图;
图11示出了本申请一实施例提供的设备的连接方法的流程示意图;
图12示出了本申请一实施例提供的设备的连接方法的示例图;
图13示出了本申请一实施例提供的设备的连接装置的模块框图;
图14示出了本申请一实施例提供的设备的连接装置的模块框图;
图15示出了本申请实施例用于执行根据本申请实施例的设备的连接方法的电子设备的框图;
图16示出了本申请实施例的用于保存或者携带实现根据本申请实施例的设备的连接方法的程序代码的存储单元。
具体实施方式
为了使本技术领域的人员更好地理解本申请方案,下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述。
随着人们生活内容的丰富,用户拥有的电子设备的数量也越来越多,蓝牙设备如蓝牙音响、蓝牙耳机(如真无线蓝牙耳机(True Wireless Stereo,TWS))的技术也跟着快速进步。为了方便用户的工作和生活,目前的蓝牙设备已经可以支持同时连接多个电子设备,如何通过一个蓝牙设备处理多个电子设备的业务切换,是目前对用户体验非常重要的一个问题。同时,随着蓝牙技术的发展,蓝牙低功耗音频(Bluetooth Low Energy Audio,BLE Audio)技术将给人们带来更低功耗、更低成本、更高质量、以及更低延迟的无线音频服务,这就要求支持LE Audio的蓝牙设备也能够同时与多个电子设备连接,且可以在这几个电子设备之间灵活切换。
发明人经过研究发现,即使支持LE Audio的蓝牙设备与电子设备建立低功耗蓝牙连接后,电子设备所播放的音频数据也难以保证持续的传输至蓝牙设备输出,从而导致音频数据的播放效果较差,用户的使用体验不佳。针对上述问题,发明人经过长期的研究发现,并提出了本申请实施例提供的设备的连接方法、装置、电子设备以及存储介质,通过建立与蓝牙设备之间的低功耗蓝牙连接,获取蓝牙设备的播放能力信息,并根据该播放能力信息以及自身播放的音频数据的音频类型,确定针对该播放的音频数据的播放策略,从而可以提升音频播放的效果和用户的使用体验。其中,具体的设备的连接方法在后续的实施例中进行详细的说明。
下面将针对可用于本申请实施例提供的设备的连接方法的应用环境进行说明。
请参阅图1,图1示出了可用于本申请实施例提供的设备的连接方法的一种应用环境示意图。如图1所示,其包括第一电子设备100和蓝牙设备200,其中,第一电子设备100可以包括智能手机、平板电脑、笔记本电脑、个人电脑、影音视听设备、穿戴式电子设备等音源设备,在此不做限定,蓝牙设备200可以包括蓝牙音响、蓝牙耳机等音频播放设备,且在蓝牙设备200为蓝牙耳机时,该蓝牙耳机可以包括一只蓝牙设备,也可以包括一对蓝牙设备,在此不做限定。作为一种方式,第一电子设备100和蓝牙设备200之间可以建立有BLE连接,基于此,第一电子设备100和蓝牙设备200之间可以进行信息交互。
请参阅图2,图2示出了可用于本申请实施例提供的设备的连接方法的又一种应用环境示意图。如图2所示,其包括第一电子设备100、蓝牙设备200以及第二电子设备300,其中,第二电子设备可以包括智能手机、平板电脑、穿戴式电子设备等,在此不做限定。作为一种方式,蓝牙设备200与第一电子设备100和第二电子设备200之间均建立有低功耗蓝牙连接,基于此,蓝牙设备200可以与第一电子设备100之间进行信息交互,也可以与第二电子设备300之间进行信息交互。
其中,蓝牙设备200为支持LE Audio的蓝牙设备,第一电子设备100为支持LE Audio的电子设备,且第二电子设备300为支持LE Audio的电子设备。作为一种方式,蓝牙设备200支持LE Audio的服务端角色(unicast server),第一电子设备100支持LE Audio的客户端角色(unicast client),第二电子设备300支持LE Audio的客户端角色(unicast client)。其中,unicast client为LE Audio BAP角色中的一种,主要用于接收发现unicast server的广播和建立与unicast server的连接,unicast server为LE Audio BAP角色中的另一种,主要用于发射广播和建立与unicast client的连接。
请参阅图3,图3示出了本申请一实施例提供的设备的连接方法的流程示意图。该方法用于通过建立与蓝牙设备之间的低功耗蓝牙连接,获取蓝牙设备的播放能力信息,并根据该播放能力信息以及自身播放的音频数据的音频类型,确定针对该播放的音频数据的播放策略,从而可以提升音频播放的效果和用户的使用体验。在具体的实施例中,该设备的连接方法应用于如图13所示的设备的连接装置400以及配置有连接装置400的第一电子设备100(图15)。下面将以第一电子设备为例,说明本实施例的具体流程,当然,可以理解的,本实施例所应用的第一电子设备可以包括智能手机、平板电脑、穿戴式电子设备等,在此不做限定。下面将针对图3所示的流程进行详细的阐述,所述设备的连接方法具体可以包括以下步骤:
步骤S110:在所述第一电子设备播放第一目标音频数据的情况下,获取所述蓝牙设备的第一播放能力信息,所述第一播放能力信息用于向所述第一电子设备指示所述蓝牙设备支持播放的音频类型。
在本实施例中,第一电子设备与蓝牙设备之间可以建立有BLE连接。
作为一种方式,蓝牙设备可以放置于耳机盒中,当检测到耳机盒开盖时,则可以建立该第一电子设备与蓝牙设备之间的BLE连接。作为又一种方式,蓝牙设备可以放置于耳机盒中,当检测到蓝牙设备从耳机盒中取出时,则可以建立该第一电子设备与蓝牙设备之间的BLE连接。作为再一种方式,蓝牙设备可以放置于耳机盒中,当检测到蓝牙设备从耳机盒中取出时,则可以检测该蓝牙设备是否处于佩戴状态,当检测到该蓝牙设备处于佩戴状态时,则可以建立该第一电子设备与蓝牙设备之间的BLE连接。
在本实施例中,在第一电子设备与蓝牙设备建立有BLE连接的情况下,可以对第一电子设备是否播放音频数据进行检测,其中,若检测到该第一电子设备播放第一目标音频数据,则可以获取该蓝牙设备的第一播放能力信息,该第一播放能力信息用于向第一电子设备指示蓝牙设备支持播放的音频类型。
其中,该蓝牙设备支持播放的音频类型可以包括音乐media类型、通话convercational类型、游戏game类型等,在此不做限定。
作为一种方式,若检测到该第一电子设备播放第一目标音频数据,则第一电子设备可以获取该蓝牙设备的私有协议参数,基于该私有协议参数,该第一电子设备可以知晓该蓝牙设备支持播放的音频类型。
作为又一种方式,若检测到该第一电子设备播放第一目标音频数据,则第一电子设备可以获取该蓝牙设备的可用音频上下文(Available Audio Contexts),基于该可用音频上下文,该第一电子设备可以知晓该蓝牙设备支持播放的音频类型。
在本实施例中,蓝牙设备可以发射低功耗音频广播,第一电子设备可以接收到该蓝牙设备发射的低功耗音频广播,以从低功耗音频广播中获取该蓝牙设备的蓝牙地址等信息,之后,基于该蓝牙设备的蓝牙地址等信息建立与该蓝牙设备BLE连接。
作为一种方式,蓝牙设备可以放置于耳机盒中,当检测到耳机盒开盖时,则可以发射低功耗音频广播,第一电子设备在接收到该低功耗音频广播时,则可以响应于该低功耗音频广播建立与蓝牙设备之间的BLE连接。作为又一种方式,蓝牙设备可以放置于耳机盒中,当检测到蓝牙设备从耳机盒中取出时,则可以发射低功耗音频广播,第一电子设备在接收到该低功耗音频广播时,则可以响应于该低功耗音频广播建立与蓝牙设备之间的BLE连接。作为再一种方式,蓝牙设备可以放置于耳机盒中,当检测到蓝牙设备从耳机盒中取出时,则可以检测该蓝牙设备是否处于佩戴状态,当检测到该蓝牙设备处于佩戴状态时,则可以发射低功耗音频广播,第一电子设备在接收到该低功耗音频广播时,则可以响应于该低功耗音频广播建立与蓝牙设备之间的BLE连接。
在本实施例中,第一电子设备在建立与蓝牙设备的BLE连接的情况下,则可以基于该BLE连接读取该蓝牙设备的相关属性,其中,该相关属性可以包括该蓝牙设备的可用音频上下文的状态以及音频流端点。相应地,第一电子设备在获取到蓝牙设备的可用音频上下文的状态的情况下,则可以保存该可用音频上下文的状态,以供后续是否建立与蓝牙设备的连接同步流做参考,提升第一电子设备发起同步流连接请求的合理性,降低第一电子设备的功耗。
步骤S120:根据所述第一播放能力信息和所述第一目标音频数据的音频类型,确定所述第一目标音频数据的播放策略。
在本实施例中,第一电子设备在确定该蓝牙设备的第一播放能力的情况下,则可以根据该第一播放能力信息和该第一目标音频数据的音频类型,确定该第一目标音频数据的播放策略。
在一些实施方式中,第一电子设备在播放第一目标音频数据的情况下,则可以获取该第一目标音频数据的音频类型,且第一电子设备在确定该蓝牙设备的第一播放能力的情况下,则可以获取该蓝牙设备支持播放的音频类型。基于此,第一电子设备可以将蓝牙设备支持播放的音频类型与第一目标音频数据的音频类型进行对比,并获得对比结果,以及根据该对比结果,确定该第一音频数据的播放策略。
作为一种可实施的方式,若对比结果表征该蓝牙设备不支持播放该第一目标音频数据的音频类型,则可以不通过该蓝牙设备输出该第一目标音频数据;若对比结果表征该蓝牙设备支持播放该第一目标音频数据的音频类型,则可以通过该蓝牙设备输出该第一目标音频数据。
本申请一实施例提供的设备的连接方法,在第一电子设备播放第一目标音频数据的情况下,获取蓝牙设备的第一播放能力信息,该第一播放能力信息用于向第一电子设备指示蓝牙设备支持播放的音频类型,根据该第一播放能力信息和第一目标音频数据的音频类型,确定第一目标音频数据的播放策略,从而通过建立与蓝牙设备之间的低功耗蓝牙连接,获取蓝牙设备的播放能力信息,并根据该播放能力信息以及自身播放的音频数据的音频类型,确定针对该播放的音频数据的播放策略,从而可以提升音频播放的效果和用户的使用体验。
请参阅图4,图4示出了本申请一实施例提供的设备的连接方法的流程示意图。该方法应用于上述第一电子设备,下面将针对图4所示的流程进行详细的阐述,所述设备的连接方法具体可以包括以下步骤:
步骤S210:在所述第一电子设备播放第一目标音频数据的情况下,获取所述蓝牙设备的第一播放能 力信息,所述第一播放能力信息用于向所述第一电子设备指示所述蓝牙设备支持播放的音频类型。
其中,步骤S210的具体描述请参阅步骤S110,在此不再赘述。
步骤S220:若所述第一播放能力信息指示所述蓝牙设备支持播放所述第一目标音频数据的音频类型,则将所述第一目标音频数据发送至所述蓝牙设备。
在本实施例中,若确定该第一播放能力信息指示该蓝牙设备支持播放该第一目标音频数据的音频类型,则可以将该第一目标音频数据发送至该蓝牙设备,以通过该蓝牙设备输出该第一目标音频数据。例如,假设该第一目标音频数据的音频类型为“音乐类型”,且该第一播放能力信息指示该蓝牙设备支持“音乐类型”,则可以将第一目标音频数据发送至该蓝牙设备。
在一些实施方式中,确定该第一播放能力信息指示该蓝牙设备支持播放该第一目标音频数据的音频类型,则可以建立第一电子设备与蓝牙设备之间的连接同步流,以通过该连接同步流将该第一目标音频数据发送至该蓝牙设备。其中,该连接同步流可以包括CIS、BIS等,在此不做限定。
作为一种可实施的方式,若确定该第一播放能力信息指示该蓝牙设备支持播放该第一目标音频数据的音频类型,则第一电子设备可以向蓝牙设备发起同步流连接请求,蓝牙设备可以响应于该同步流连接请求,建立与该第一电子设备之间的连接同步流。在确定已建立蓝牙设备和第一电子设备之间的连接同步流的情况下,则可以基于该连接同步流,将该第一电子设备的第一目标音频数据发送至该蓝牙设备,以通过该蓝牙设备输出该第一目标音频数据。
步骤S230:若所述第一播放能力信息指示所述蓝牙设备不支持播放所述第一目标音频数据的音频类型,则监听所述蓝牙设备的第一播放能力信息的变化。
在本实施例中,若确定该第一播放能力信息指示该蓝牙设备不支持播放该第一目标音频数据的音频类型,则可以不将该第一目标音频数据发送至该蓝牙设备,并监听该蓝牙设备的第一播放能力信息的变化。例如,假设该第一目标音频数据的音频类型为“音乐类型”,且该第一播放能力信息指示该蓝牙设备不支持“音乐类型”,则可以不将第一目标音频数据发送至该蓝牙设备,并监听该蓝牙设备的第一播放能力信息的变化。
作为一种方式,若确定该第一播放能力信息指示该蓝牙设备不支持播放该第一目标音频数据的音频类型,则可以外放该第一目标音频数据,并监听该蓝牙设备的第一播放能力信息的变化。其中,外放该第一目标音频数据可以包括:通过该第一电子设备的扬声器播放该第一目标音频数据。
作为又一种方式,若确定该第一播放能力信息指示该蓝牙设备不支持播放该第一目标音频数据的音频类型,则可以暂停播放该第一目标音频数据,并监听该蓝牙设备的第一播放能力信息的变化。其中,暂停播放该第一目标音频数据可以包括:在第一目标音频数据的当前播放处暂停播放、退出第一音频播放数据的播放等,在此不做限定。
作为再一种方式,若确定该第一播放能力信息指示该蓝牙设备不支持播放该第一目标音频数据的音频类型,则可以将第一目标音频数据发送至其他蓝牙设备,其中,该第一电子设备与其他蓝牙设备建立有低功耗蓝牙连接。其中,第一电子设备可以分别与该蓝牙设备和其他蓝牙设备建立有低功耗蓝牙连接,那么,在确定该第一播放能力信息指示该蓝牙设备不支持播放该第一目标音频数据的音频类型,则可以判断该其他蓝牙设备是否支持播放该第一目标音频数据的音频类型,若确定该其他蓝牙设备支持播放该第一目标音频数据的音频类型,则可以将第一目标音频数据发送至其他蓝牙设备,以通过其他蓝牙设备输出该第一目标音频数据。
在一些实施方式中,第一播放能力信息可以包括可用音频上下文,则可以根据可用音频上下文中的对应第一目标音频数据的音频类型的音频类型的状态信息,确定该第一目标音频数据的播放策略。
其中,在支持LE Audio的蓝牙设备与电子设备建立BLE连接后,电子设备可以通过查询蓝牙设备的服务(service)和属性(characteristic),获取到蓝牙设备的“可用音频上下文(比如media、conversational、game等)”和蓝牙设备的支持的音频流端点(Audio Stream Endpoint,ASE),包括Sink ASE和Source ASE,同时会将对应的ASE配置到对应的状态(即QOS Configured状态)。当电子设备与蓝牙设备有业务进行时,它们之间会创建连接同步流且ASE状态会变成对应的状态(即Streaming状态),此后,就可以在该连接同步流进行音频数据的传输了。在蓝牙设备的“可用音频上下文”为“可用”(比如:将available audio contexts中的media为“YES”),并发送给当前连接的电子设备时,则当前连接的电子设备可以跟蓝牙设备建立连接同步流;在蓝牙设备的“可用音频上下文”为“不可用”(比如:将available audio contexts中的media为“NO”),并发送给当前连接的电子设备时,电子设备就不会与蓝牙设备建立连接同步流。
在本实施例中,第一电子设备与蓝牙设备之间建立有BLE连接,第一电子设备可以基于该BLE连接从蓝牙设备获取该蓝牙设备的相关信息,比如,第一电子设备可以基于该BLE连接从蓝牙设备获取该蓝牙设备支持的ASE情况、该蓝牙设备的可用音频上下文中的音频类型的状态信息等。
在一些实施方式中,蓝牙设备的可用音频上下文中可以包括多个音频类型,其中,该多个音频类型可 以包括第一音频类型、第二音频类型、第三音频类型……第n音频类型。其中,该蓝牙设备的可用音频上下文中的音频类型的状态信息可以包括该蓝牙设备的可用音频上下文中的每个音频类型的状态信息,例如,可以包括第一音频类型的状态信息、第二音频类型的状态信息、第三音频类型的状态信息……第n音频类型的状态信息。于本实施例中,可用音频上下文的中的音频类型的状态信息用于指示可用音频上下文中的音频类型是否可用,即,可用音频上下文中的音频类型的状态信息为“可用/YES”,则表征该可用音频上下文中的音频类型的状态信息为可用状态,可用音频上下文中的音频类型的状态为“不可用/NO”,则表征该可用音频上下文中的音频类型的状态信息为不可用状态。
在一些实施方式中,第一电子设备在确定第一目标音频数据的音频类型的情况下,则可以检测该蓝牙设备的可用音频上下文中的对应第一目标音频数据的音频类型的音频类型的状态信息。其中,若检测到该蓝牙设备的可用音频上下文中的对应第一目标音频数据的音频类型的音频类型的状态信息为不可用状态,则可以确定针对第一目标音频数据的音频类型,该蓝牙设备无法为第一电子设备提供音频数据的输出,则第一电子设备可以外放、暂停播放或者通过其他蓝牙设备播放该第一目标音频数据。
例如,假设该第一目标音频数据的音频类型为media,则可以检测该蓝牙设备的可用音频上下文中的media的状态信息。若检测到该蓝牙设备的可用音频上下文中的media的状态信息为NO,则可以确定针对media,该蓝牙设备无法为第一电子设备提供第一目标音频数据的输出,则第一电子设备可以外放、暂停播放、通过其他蓝牙设备播放等方式处理第一目标音频数据。
在一些实施方式中,在外放、暂停播放、通过其他蓝牙设备播放等方式处理第一目标音频数据的同时,可以开始监听该蓝牙设备的可用音频上下文的状态变化,即,可以对蓝牙设备的可用音频上下文中的对应第一目标音频数据的音频类型的音频类型的状态信息的变化进行监听。作为一种可实施的方式,蓝牙设备与第一电子设备始终保持BLE连接,蓝牙设备会对自身的可用音频上下文的状态变化进行监测,在监测到自身的可用音频上下文的状态发生变化时,则可以更新自身的可用音频上下文的状态,并将更新后的可用音频上下文的状态基于该BLE连接发送至第一电子设备,相应地,第一电子设备可以基于该更新后的可用音频上下文的状态,确定该可用音频上下文中的对应第一目标音频数据的音频类型的音频类型的状态信息是否从不可用状态切换为可用状态。
在一些实施方式中,第一电子设备可以实时监听该可用音频上下文的状态变化,可以按预设时间间隔监听该可用音频上下文的状态变化,可以按预设时间点监听该可用音频上下文的状态变化,或者,可以按其他预设规则监听该可用音频上下文的状态变化等,在此不做限定。
作为一种方式,该第一电子设备可以包括蓝牙模块和音频模块,则蓝牙模块在获取该蓝牙设备的可用音频上下文的状态的情况下,则可以将该蓝牙设备的可用音频上下文的状态传输给音频模块。音频模块可以确定其播放的第一目标音频数据的音频类型,并判断该蓝牙设备的可用音频上下文中的对应第一目标音频数据的音频类型的音频类型的状态信息是否为可用状态,若确定为不可用状态,则音频模块外放、暂停播放或者通过其他蓝牙设备播放该第一目标音频数据,并通知蓝牙模块监听可用音频上下文的状态变化。
在一些实施方式中,蓝牙设备的可用音频上下文中的对应第一目标音频数据的音频类型的音频类型的状态为不可用状态可以包括:蓝牙设备的可用音频上下文中的对应第一目标音频数据的音频类型的音频类型被第二电子设备占用。其中,蓝牙设备还可以与第二电子设备建立有BLE连接,且第二电子设备早于第一电子设备与蓝牙设备建立连接同步流,以传输第二电子设备的与第一目标音频数据的音频类型相同的第三目标音频数据。此时,蓝牙设备可以将其可用音频上下文中的对应第一目标音频数据的音频类型的音频类型的状态从可用状态更新为不可用状态,并发送至第一电子设备,则第一电子设备会认为蓝牙设备的可用音频上下文中的对应第一目标音频数据的音频类型的音频类型的状态为不可用状态。
在一些实施方式中,蓝牙设备的可用音频上下文中的第一音频场景的状态为不可用状态可以包括:蓝牙设备的可用音频上下文中的对应第二目标音频数据的音频类型的音频类型被第二电子设备占用,其中,该对应第二目标音频数据的音频类型的音频类型的优先级高于对应第一目标音频数据的音频类型的音频类型的优先级。其中,蓝牙设备还可以与第二电子设备建立有BLE连接,且第二电子设备早于第一电子设备与蓝牙设备建立连接同步流,以传输第二电子设备的第二目标音频数据。此时,蓝牙设备可以将其可用音频上下文中的对应第二目标音频数据的音频类型的音频类型和对应第一目标音频数据的音频类型的音频类型的状态从可用状态更新为不可用状态,并发送至第一电子设备,则第一电子设备会认为蓝牙设备的可用音频上下文中的对应第一目标音频数据的音频类型的音频类型的状态为不可用状态。
步骤S240:若监听到所述蓝牙设备的第一播放能力信息指示所述蓝牙设备由不支持播放所述第一目标音频数据的音频类型切换为支持播放所述第一目标音频数据的音频类型,则将所述第一目标音频数据发送至所述蓝牙设备。
在本实施例中,在第一电子设备对第一播放能力信息的变化进行监测的过程中,若监听到该第一播放能力信息指示蓝牙设备由不支持播放该第一目标音频数据的音频类型切换为支持播放该第一目标音频数据的音频类型,则可以将第一目标音频数据发送至该蓝牙设备,以通过该蓝牙设备输出该第一目标音频数 据。例如,假设该第一目标音频数据的音频类型为“音乐类型”,且该第一播放能力信息指示该蓝牙设备从不支持“音乐类型”切换为支持“音乐类型”,则可以将第一目标音频数据发送至该蓝牙设备。
在一些实施方式中,确定该第一播放能力信息指示该蓝牙设备从不支持播放该第一目标音频数据的音频类型切换为支持播放该第一目标音频数据的音频类型,则可以建立第一电子设备与蓝牙设备之间的连接同步流,以通过该连接同步流将该第一目标音频数据发送至该蓝牙设备。
作为一种方式,第一电子设备可以包括蓝牙模块和音频模块,蓝牙模块监听到可用音频上下文的状态变化,并在监听到蓝牙设备基于BLE连接发送的更新后的可用音频上下文的状态时,则可以将更新后的可用音频上下文的状态同步给音频模块,音频模块对更新后的可用音频上下文的状态是否表征蓝牙设备从不支持播放该第一目标音频数据的音频类型切换为支持播放该第一目标音频数据的音频类型进行检测,若检测到该可用音频上下文的状态表征蓝牙设备从不支持播放该第一目标音频数据的音频类型切换为支持播放该第一目标音频数据的音频类型,则通知蓝牙模块建立与蓝牙设备的连接同步流。其中,第一电子设备可以向蓝牙设备发起同步流连接请求,蓝牙设备可以响应于该同步流连接请求,建立与该第一电子设备之间的连接同步流。在确定已建立蓝牙设备和第一电子设备之间的连接同步流的情况下,则可以基于该连接同步流,将该第一电子设备的第一目标音频数据发送至该蓝牙设备,以通过该蓝牙设备输出该第一目标音频数据。
本申请一实施例提供的设备的连接方法,在第一电子设备播放第一目标音频数据的情况下,获取蓝牙设备的第一播放能力信息,第一播放能力信息用于向第一电子设备指示蓝牙设备支持播放的音频类型,若第一播放能力信息指示蓝牙设备支持播放第一目标音频数据的音频类型,则将第一目标音频数据发送至蓝牙设备,若第一播放能力信息指示蓝牙设备不支持播放第一目标音频数据的音频类型,则监听蓝牙设备的第一播放能力信息的变化,若监听到蓝牙设备的第一播放能力信息指示蓝牙设备由不支持播放第一目标音频数据的音频类型切换为支持播放第一目标音频数据的音频类型,则将第一目标音频数据发送至所述蓝牙设备。相较于图3所示的设备的连接方法,本实施例还根据第一播放能力信息是否支持音频数据的音频类型的不同情况,对音频数据进行不同的处理,从而可以提升音频播放的效果。
请参阅图5,图5示出了本申请一实施例提供的设备的连接方法的流程示意图。该方法用于通过建立与蓝牙设备之间的低功耗蓝牙连接,获取蓝牙设备的播放能力信息,并根据该播放能力信息以及自身播放的音频数据的音频类型,确定针对该播放的音频数据的播放策略,从而可以提升音频播放的效果和用户的使用体验。在具体的实施例中,该设备的连接方法应用于如图14所示的设备的连接装置500以及配置有设备的连接装置500的蓝牙设备200(图15)。下面将以蓝牙设备为例,说明本实施例的具体流程,当然,可以理解的,本实施例所应用的蓝牙设备可以包括蓝牙音频、蓝牙耳机等,在此不做限定。下面将针对图5所示的流程进行详细的阐述,所述设备的连接方法具体可以包括以下步骤:
步骤S410:发送所述蓝牙设备的第一播放能力信息至所述第一电子设备,以使所述第一电子设备在播放第一目标音频数据的情况下,根据所述第一播放能力信息和所述第一目标音频数据的音频类型,确定所述第一目标音频数据的播放策略,其中,所述第一播放能力信息用于向所述第一电子设备指示所述蓝牙设备支持播放的音频类型。
其中,步骤S410的具体描述请参阅步骤S110-步骤S120,在此不再赘述。
本申请一实施例提供的设备的连接方法,发送蓝牙设备的第一播放能力信息至第一电子设备,以使第一电子设备在播放第一目标音频数据的情况下,根据第一播放能力信息和第一目标音频数据的音频类型,确定第一目标音频数据的播放策略,其中,第一播放能力信息用于向第一电子设备指示蓝牙设备支持播放的音频类型,从而通过建立与蓝牙设备之间的低功耗蓝牙连接,获取蓝牙设备的播放能力信息,并根据该播放能力信息以及自身播放的音频数据的音频类型,确定针对该播放的音频数据的播放策略,从而可以提升音频播放的效果和用户的使用体验。
请参阅图6,图6示出了本申请一实施例提供的设备的连接方法的流程示意图。该方法应用于上述蓝牙设备,下面将针对图6所示的流程进行详细的阐述,所述设备的连接方法具体可以包括以下步骤:
步骤S510:发送所述蓝牙设备的第一播放能力信息至所述第一电子设备,以使所述第一电子设备在播放第一目标音频数据的情况下,根据所述第一播放能力信息和所述第一目标音频数据的音频类型,确定所述第一目标音频数据的播放策略,其中,所述第一播放能力信息用于向所述第一电子设备指示所述蓝牙设备支持播放的音频类型。
其中,步骤S510的具体描述请参阅步骤S110-步骤S120,在此不再赘述。
步骤S520:在所述蓝牙设备播放所述第一目标音频数据的情况下,发送所述蓝牙设备的第二播放能力信息至所述第二电子设备,其中,所述第二播放能力信息用于向所述第二电子设备指示所述蓝牙设备支持播放的音频类型,所述第二播放能力信息指示所述蓝牙设备不支持播放所述第一目标音频数据的音频类 型。
其中,蓝牙设备可以与第一电子设备建立有BLE连接,且与第二电子设备建立有BLE连接。
作为一种方式,蓝牙设备可以放置于耳机盒中,当检测到耳机盒开盖时,则可以建立该第一电子设备与蓝牙设备之间的BLE连接,并建立该第二电子设备与蓝牙设备之间的BLE连接。作为又一种方式,蓝牙设备可以放置于耳机盒中,当检测到蓝牙设备从耳机盒中取出时,则可以建立该第二电子设备与蓝牙设备之间的BLE连接,并建立该第二电子设备的蓝牙设备之间的BLE连接。作为再一种方式,蓝牙设备可以放置于耳机盒中,当检测到蓝牙设备从耳机盒中取出时,则可以检测该蓝牙设备是否处于佩戴状态,当检测到该蓝牙设备处于佩戴状态时,则可以建立该第一电子设备与蓝牙设备之间的BLE连接,并建立第二电子设备与蓝牙设备之间的BLE连接。
在一些实施方式中,蓝牙设备可以发射低功耗音频广播,第二电子设备可以接收到该蓝牙设备发射的低功耗音频广播,以从低功耗音频广播中获取该蓝牙设备的蓝牙地址等信息,之后,基于该蓝牙设备的蓝牙地址等信息建立与该蓝牙设备的BLE连接。第二电子设备在建立与蓝牙设备的BLE连接的情况下,则可以基于该BLE连接读取该蓝牙设备的相关属性,其中,该相关属性可以包括该蓝牙设备的可用音频上下文的状态以及音频流端点。相应地,第二电子设备在获取到蓝牙设备的可用音频上下文的状态的情况下,则可以保存该可用音频上下文的状态,以供后续是否建立与蓝牙设备的连接同步流做参考,提升第二电子设备发起同步流连接请求的合理性,降低第二电子设备的功耗。
其中,在本实施例中,蓝牙设备针对不同的电子设备的设置不同的播放能力信息,其中,不同的播放能力信息用于指示对应的电子设备支持播放的音频类型。作为一种方式,可以设置第一电子设备对应第一播放能力信息,第二电子设备对应第二播放能力信息,即,第一播放能力信息用于向所述第一电子设备指示蓝牙设备支持播放的音频类型,第二电子设备用于向所述第二电子设备指示蓝牙设备支持播放的音频类型。
其中,若蓝牙设备不支持同类型音频数据的播放抢占,那么,在本实施例中,蓝牙设备在播放第一目标音频数据的情况下,可以发送蓝牙设备的第二播放能力信息至第二电子设备,第二播放能力信息指示蓝牙设备不支持播放第一目标音频数据的音频类型。其中,蓝牙设备播放第一目标音频数据可以包括:建立与第一电子设备之间的连接同步流,以通过该连接同步流接收并播放该第一电子设备发送的第一目标音频数据。
其中,蓝牙设备在确定与第一电子设备建立有连接同步流,并基于该连接同步流接收该第一电子设备发送的第一目标音频数据的情况下,可以认为该蓝牙设备对除第一电子设备外的其他电子设备(如第二电子设备)而言,是不支持播放第一目标音频数据对应的音频类型的,则蓝牙设备可以将用于指示蓝牙设备不支持播放第一目标音频数据的音频类型的第二播放能力信息发送至第二电子设备,供第二电子设备后续是否建立与蓝牙设备的连接同步流做参考。
请参阅图7,图7示出了本申请一实施例提供的设备的连接方法的示例图。如图7所示,其示例为蓝牙耳机分别与第一电子设备和第二电子设备连接,且第一电子设备播放音乐的场景。
步骤S530:在所述蓝牙设备停止播放所述第一目标音频数据的情况下,更新所述第二播放能力信息获得第一更新信息,其中,所述第一更新信息用于向所述第二电子设备指示所述蓝牙设备支持播放所述第一目标音频数据的音频类型。
在本实施例中,在蓝牙设备停止播放该第一目标音频数据的情况下,则可以更新该第二播放能力信息获得第一更新信息,其中,该第一更新信息用于向第二电子设备指示该蓝牙设备支持播放该第一目标音频数据的音频类型。其中,蓝牙设备停止播放第一目标音频数据可以包括:断开与第一电子设备之间的连接同步流,以停止播放该第一目标音频数据。
其中,蓝牙设备停止播放第一目标音频数据的情况下,可以认为该蓝牙设备对所有电子设备(如第一电子设备和第二电子设备)而言,都是可以支持播放第一目标音频数据对应的音频类型的,则蓝牙设备可以更新第二播放能力信息(将第二播放能力信息从指示不支持播放第一目标音频数据的音频类型更新为支持播放第一目标音频数据的音频类型)获得第一更新信息,将第一更新信息发送至第二电子设备,供第二电子设备后续是否建立与蓝牙设备的连接同步流做参考。
步骤S540:发送所述第一更新信息至所述第二电子设备。
在本实施例中,蓝牙设备在获得第一更新信息的情况下,则可以发送该第一更新信息至第二电子设备,例如,蓝牙设备可以基于与第二电子设备之间的BLE连接,发送该第一更新信息至第二电子设备,此时,若第二电子设备有播放音频数据的需求,则可以通过该蓝牙设备播放。
在本实施例中,在确定已建立蓝牙设备和第二电子设备之间的连接同步流的情况下,则可以基于该连接同步流,将该第二电子设备播放的音频数据发送至该蓝牙设备,以通过该蓝牙设备输出该第二电子设备的音频数据。
请参阅图8,图8示出了本申请一实施例提供的设备的连接方法的示例图。如图8所示,其示例为蓝 牙设备分别与第一电子设备和第二电子设备连接,且第一电子设备先播放音乐,第二电子设备后播放音乐,且第二电子设备无法抢占第一电子设备的场景。
本申请一实施例提供的设备的连接方法,发送蓝牙设备的第一播放能力信息至第一电子设备,以使第一电子设备在播放第一目标音频数据的情况下,根据第一播放能力信息和第一目标音频数据的音频类型,确定第一目标音频数据的播放策略,其中,第一播放能力信息用于向第一电子设备指示蓝牙设备支持播放的音频类型,在蓝牙设备播放第一目标音频数据的情况下,发送蓝牙设备的第二播放能力信息至第二电子设备,其中,第二播放能力信息指示蓝牙设备不支持播放第一目标音频数据的音频类型,在蓝牙设备停止播放第一目标音频数据的情况下,更新第二播放能力信息获得第一更新信息,其中,第一更新信息用于向第二电子设备指示蓝牙设备支持播放第一目标音频数据的音频类型,发送第一更新信息至第二电子设备。相较于图5所示的设备的连接方法,本实施例还根据蓝牙设备对第一目标音频数据的播放情况,确定发送至第二电子设备的第二播放能力信息,避免多个电子设备之间针对相同类型页面的抢占,可以降低第二电子设备的功耗。
请参阅图9,图9示出了本申请一实施例提供的设备的连接方法的流程示意图。该方法应用于上述蓝牙设备,下面将针对图9所示的流程进行详细的阐述,所述设备的连接方法具体可以包括以下步骤:
步骤S610:发送所述蓝牙设备的第一播放能力信息至所述第一电子设备,以使所述第一电子设备在播放第一目标音频数据的情况下,根据所述第一播放能力信息和所述第一目标音频数据的音频类型,确定所述第一目标音频数据的播放策略,其中,所述第一播放能力信息用于向所述第一电子设备指示所述蓝牙设备支持播放的音频类型。
其中,步骤S610的具体描述请参阅步骤S110-步骤S120,在此不再赘述。
步骤S620:在所述蓝牙设备播放所述第一目标音频数据的情况下,接收所述第二电子设备发起的第一连接请求,其中,所述第一连接请求由所述第二电子设备在播放第二目标音频数据时发送,其中,所述第一目标音频数据的音频类型与所述第二目标音频数据的音频类型相同。
其中,蓝牙设备可以与第一电子设备建立有BLE连接,且与第二电子设备建立有BLE连接。
在本实施例中,蓝牙设备在播放该第一目标音频数据的情况下,若第二电子设备在播放第二目标音频数据(第一目标音频数据的音频类型和第二目标音频数据的音频类型相同),且第二电子设备期望通过蓝牙设备播放该第二目标音频数据,则第二电子设备可以向蓝牙设备发起第一连接请求,相应地,蓝牙设备可以接收该第一连接请求。其中,蓝牙设备播放第一目标音频数据可以包括:建立与第一电子设备之间的连接同步流,以通过该连接同步流接收并播放该第一电子设备发送的第一目标音频数据。
在本实施例中,在第二电子设备与蓝牙设备建立有BLE连接的情况下,可以对是否播放第二目标音频数据进行检测,若检测到其播放第二目标音频数据时,第二电子设备可以基于其保存的蓝牙设备的第二音频播放能力信息,判断该第二音频播放能力信息指示蓝牙设备是否支持播放第二目标音频数据的音频类型,其中,若确定该蓝牙设备蓝牙设备支持播放第二目标音频数据的音频类型(如蓝牙设备对应第一目标音频数据的音频类型的音频类型被第一电子设备占用,且蓝牙设备未更新其第二可用音频播放能力信息至第二电子设备),则可以确定针对第二目标音频数据的音频类型,该蓝牙设备可以为第二电子设备提供音频数据的输出,则第二电子设备可以向蓝牙设备发起第一连接请求。
步骤S630:响应于所述第一连接请求,更新所述第一播放能力信息获得第二更新信息,其中,所述第二更新信息用于向所述第一电子设备指示所述蓝牙设备不支持播放所述第一目标音频数据的音频类型。
在本实施例中,蓝牙设备在接收到该第一连接请求的情况下,则可以响应于该第一连接请求,更新该第一播放能力信息获得第二更新信息,其中,该第二更新信息用于向第一电子设备指示蓝牙设备不支持第一目标音频数据的音频类型。
其中,若蓝牙设备支持同类型音频数据的播放抢占,那么,在接收到第二电子设备发起的同类型的第二目标音频数据的播放请求时,蓝牙设备可以停止播放该第一电子设备的第一目标音频数据,则蓝牙设备可以将第一播放能力信息从支持播放第一目标音频数据的音频类型更新为不支持播放第一目标音频数据的音频类型。
步骤S640:发送所述第二更新信息至所述第一电子设备,以在所述蓝牙设备停止播放所述第一目标音频数据。
在本实施例中,蓝牙设备在获得第二更新信息的情况下,则可以发送该第二更新信息至第一电子设备,以在蓝牙设备停止播放该第一目标音频数据。作为一种方式,蓝牙设备在将第二更新信息发送至第一电子设备时,第一电子设备可以响应于该第二更新信息,断开与蓝牙设备的连接同步流,此时,蓝牙设备不会继续接收到第一电子设备发送的第一目标音频数据,即停止播放该第一目标音频数据。
在一些实施方式中,在确定蓝牙设备断开与第一电子设备的连接同步流的情况下,则可以建立蓝牙设备和第二电子设备的连接同步流,此时,第二电子设备可以发送第二目标音频数据至蓝牙设备,以通过该 蓝牙设备播放该第二目标音频数据。
请参阅图10,图10示出了本申请一实施例提供的设备的连接方法的示例图。如图10所示,其示例为蓝牙设备分别与第一电子设备和第二电子设备连接,且第一电子设备先播放音乐,第二电子设备后播放音乐,且第二电子设备抢占第一电子设备的场景。
本申请一实施例提供的设备的连接方法,发送蓝牙设备的第一播放能力信息至第一电子设备,以使第一电子设备在播放第一目标音频数据的情况下,根据第一播放能力信息和第一目标音频数据的音频类型,确定第一目标音频数据的播放策略,其中,第一播放能力信息用于向第一电子设备指示蓝牙设备支持播放的音频类型,在蓝牙设备播放第一目标音频数据的情况下,接收第二电子设备发起的第一连接请求,其中,第一连接请求由第二电子设备在播放第二目标音频数据时发送,其中,第一目标音频数据的音频类型与第二目标音频数据的音频类型相同,响应于第一连接请求,更新第一播放能力信息获得第二更新信息,其中,第二更新信息用于向第一电子设备指示蓝牙设备不支持播放第一目标音频数据的音频类型,发送第二更新信息至所述第一电子设备,以在蓝牙设备停止播放第一目标音频数据。相较于图5所示的设备的连接方法,本实施例还实现多个电子设备之间相同类型业务的抢占,提升用户的使用体验。
请参阅图11,图11示出了本申请一实施例提供的设备的连接方法的流程示意图。该方法应用于上述蓝牙设备,下面将针对图11所示的流程进行详细的阐述,所述设备的连接方法具体可以包括以下步骤:
步骤S710:发送所述蓝牙设备的第一播放能力信息至所述第一电子设备,以使所述第一电子设备在播放第一目标音频数据的情况下,根据所述第一播放能力信息和所述第一目标音频数据的音频类型,确定所述第一目标音频数据的播放策略,其中,所述第一播放能力信息用于向所述第一电子设备指示所述蓝牙设备支持播放的音频类型。
其中,步骤S710的具体描述请参阅步骤S110-步骤S120,在此不再赘述。
步骤S720:在所述蓝牙设备播放所述第一目标音频数据的情况下,接收到所述第二电子设备发起的第二连接请求,其中,所述第二连接请求由所述第二电子设备在播放第三目标音频数据时发送,所述第三目标音频数据的音频类型的优先级高于所述第一目标音频数据的音频类型的优先级。
其中,蓝牙设备可以与第一电子设备建立有BLE连接,且与第二电子设备建立有BLE连接。
在本实施例中,蓝牙设备在播放该第一目标音频数据的情况下,若第二电子设备在播放第三目标音频数据(第三目标音频数据的音频类型的优先级高于第一目标音频数据的音频类型的优先级,如第三目标音频数据的音频类型为conversational,第一目标音频数据的音频类型为media),且第二电子设备期望通过蓝牙设备播放该第三目标音频数据,则第二电子设备可以向蓝牙设备发起第二连接请求,相应地,蓝牙设备可以接收该第二连接请求。其中,蓝牙设备播放第一目标音频数据可以包括:建立与第一电子设备之间的连接同步流,以通过该连接同步流接收并播放该第一电子设备发送的第一目标音频数据。
在本实施例中,在第二电子设备与蓝牙设备建立有BLE连接的情况下,可以对是否播放第三目标音频数据进行检测,若检测到其播放第三目标音频数据时,第二电子设备可以基于其保存的蓝牙设备的第二音频播放能力信息,判断该第二音频播放能力信息指示蓝牙设备是否支持播放第三目标音频数据的音频类型,其中,若确定该蓝牙设备蓝牙设备支持播放第三目标音频数据的音频类型,则可以确定针对第三目标音频数据的音频类型,该蓝牙设备可以为第二电子设备提供音频数据的输出,则第二电子设备可以向蓝牙设备发起第二连接请求。
步骤S730:响应于所述第二连接请求,停止播放所述第一目标音频数据并播放所述第三目标音频数据。
在本实施例中,蓝牙设备在接收到该第二连接请求的情况下,则可以停止播放该第一目标音频数据,并播放该第三目标音频数据。作为一种方式,蓝牙设备在接收到第二连接请求时,可以响应于该第二连接请求,断开与第一电子设备的连接同步流,此时,蓝牙设备不会继续接收到第一电子设备发送的第一目标音频数据,即停止播放该第一目标音频数据,另外,蓝牙设备在接收到第二连接请求时,可以响应于该第二连接请求,建立与第二电子设备的连接同步流,此时,蓝牙设备可以接收到第二电子设备发送的第三目标音频数据,即播放该第三目标音频数据。
在一些实施方式中,若蓝牙设备支持同类型的音频数据的播放抢占,那么,则蓝牙设备在确定播放第三音频数据的情况下,可以更新第一播放能力信息获得第三更新信息发送至第一电子设备,以及更新第二播放能力信息获得第四更新信息发送至第二电子设备,其中,第三更新信息用于向第一电子设备指示蓝牙设备不支持播放第一目标音频数据的音频类型,第四更新信息用于向第二电子设备指示蓝牙设备不支持播放第一目标音频数据的音频类型。基于此,第一电子设备基于该第三更新信息,可以确定该蓝牙设备无法支持播放第一目标音频数据的音频类型,但可以支持播放第三目标音频数据的音频类型,第二电子设备基于该第三更新信息,可以确定该蓝牙设备无法支持播放第一目标音频数据的音频类型。
在一些实施方式中,若蓝牙设备不支持同类型的音频数据的播放抢占,那么,则蓝牙设备在确定播放 第三音频数据的情况下,可以更新第一播放能力信息获得第五更新信息发送至第一电子设备,以及更新第二播放能力信息获得第三更新信息发送至第二电子设备,其中,第五更新信息用于向第一电子设备指示蓝牙设备不支持播放第一目标音频数据的音频类型和第三目标音频数据的音频类型。基于此,第一电子设备基于该第三更新信息,可以确定该蓝牙设备无法支持播放第一目标音频数据的音频类型,且无法支持播放第三目标音频数据的音频类型,第二电子设备基于该第三更新信息,可以确定该蓝牙设备无法支持播放第一目标音频数据的音频类型。
请参阅图12,图12示出了本申请一实施例提供的设备的连接方法的示例图。如图12所示,其示例蓝牙耳机分别与第一电子设备和第二电子设备连接,且第一电子设备先播放音乐,第二电子设备后进行通话的场景。
本申请一实施例提供的设备的连接方法,发送蓝牙设备的第一播放能力信息至第一电子设备,以使第一电子设备在播放第一目标音频数据的情况下,根据第一播放能力信息和第一目标音频数据的音频类型,确定第一目标音频数据的播放策略,其中,第一播放能力信息用于向第一电子设备指示蓝牙设备支持播放的音频类型,在蓝牙设备播放第一目标音频数据的情况下,接收到第二电子设备发起的第二连接请求,其中,第二连接请求由第二电子设备在播放第三目标音频数据时发送,第三目标音频数据的音频类型的优先级高于第一目标音频数据的音频类型的优先级,响应于第二连接请求,停止播放第一目标音频数据并播放第三目标音频数据。相较于图5所示的设备的连接方法,本实施例以实现多个电子设备之间不同优先级类型业务的抢占,提升用户的使用体验。
请参阅图13,图13示出了本申请一实施例提供的设备的连接装置的模块框图,该设备的连接装置400应用于上述第一电子设备,该第一电子设备与蓝牙设备建立有低功耗蓝牙连接,下面将针对图13所示的框图进行阐述,所述设备的连接装置400包括:播放能力信息获取模块410和播放策略确定模块420,其中:
播放能力信息获取模块410,用于在所述第一电子设备播放第一目标音频数据的情况下,获取所述蓝牙设备的第一播放能力信息,所述第一播放能力信息用于向所述第一电子设备指示所述蓝牙设备支持播放的音频类型。
播放策略确定模块420,用于根据所述第一播放能力信息和所述第一目标音频数据的音频类型,确定所述第一目标音频数据的播放策略。
进一步地,所述播放策略确定模块420包括:第一音频数据发送子模块,其中:
第一音频数据发送子模块,用于若所述第一播放能力信息指示所述蓝牙设备支持播放所述第一目标音频数据的音频类型,则将所述第一目标音频数据发送至所述蓝牙设备。
进一步地,所述播放策略确定模块420包括:播放能力信息变化监测子模块和第二音频数据发送子模块,其中:
播放能力信息变化监测子模块,用于若所述第一播放能力信息指示所述蓝牙设备不支持播放所述第一目标音频数据的音频类型,则监听所述蓝牙设备的第一播放能力信息的变化。
第二音频数据发送子模块,用于若监听到所述蓝牙设备的第一播放能力信息指示所述蓝牙设备由不支持播放所述第一目标音频数据的音频类型切换为支持播放所述第一目标音频数据的音频类型,则将所述第一目标音频数据发送至所述蓝牙设备。
进一步地,所述第一音频数据发送子模块/所述第二音频数据发送子模块包括:连接建立子模块,其中:
连接建立单元,用于建立与所述蓝牙设备之间的连接同步流,以通过所述连接同步流将所述第一目标音频数据发送至所述蓝牙设备。
进一步地,所述播放策略确定模块420包括:音频数据外放子模块、音频数据暂停子模块以及第三音频数据发送子模块,其中:
音频数据外放子模块,用于若所述第一播放能力信息指示所述蓝牙设备不支持播放所述第一目标音频数据的音频类型,则外放所述第一目标音频数据。
音频数据暂停子模块,用于若所述第一播放能力信息指示所述蓝牙设备不支持播放所述第一目标音频数据的音频类型,则暂停播放所述第一目标音频数据。
第三音频数据发送子模块,用于若所述第一播放能力信息指示所述蓝牙设备不支持播放所述第一目标音频数据的音频类型,则将所述第一目标音频数据发送至其他蓝牙设备,其中,所述第一电子设备与所述其他蓝牙设备建立有低功耗蓝牙连接。
进一步地,所述第一播放能力信息包括可用音频上下文,所述播放策略确定模块420包括:播放策略确定子模块,其中:
播放策略确定子模块,用于根据所述可用音频上下文中的对应所述第一目标音频数据的音频类型的音频类型的状态信息,确定所述第一目标音频数据的播放策略。
请参阅图14,图14示出了本申请一实施例提供的设备的连接方法的流程示意图。该设备的连接 装置500应用于上述蓝牙设备,该蓝牙设备与第一电子设备建立有低功耗蓝牙连接,下面将针对图14所示的流程进行详细的阐述,所述设备的连接装置500包括:信息发送模块510,其中:
信息发送模块510,用于发送所述蓝牙设备的第一播放能力信息至所述第一电子设备,以使所述第一电子设备在播放第一目标音频数据的情况下,根据所述第一播放能力信息和所述第一目标音频数据的音频类型,确定所述第一目标音频数据的播放策略,其中,所述第一播放能力信息用于向所述第一电子设备指示所述蓝牙设备支持播放的音频类型。
进一步地,所述蓝牙设备还与第二电子设备建立有低功耗蓝牙连接,所述设备的连接装置500还包括:
第二播放能力信息发送模块,用于在所述蓝牙设备播放所述第一目标音频数据的情况下,发送所述蓝牙设备的第二播放能力信息至所述第二电子设备,其中,所述第二播放能力信息用于向所述第二电子设备指示所述蓝牙设备支持播放的音频类型,所述第二播放能力信息指示所述蓝牙设备不支持播放所述第一目标音频数据的音频类型。
进一步地,所述蓝牙设备还与第二电子设备建立有低功耗蓝牙连接,所述设备的连接装置500还包括:第一更新信息获得模块和第一更新信息发送模块,其中:
第一更新信息获得模块,用于在所述蓝牙设备停止播放所述第一目标音频数据的情况下,更新所述第二播放能力信息获得第一更新信息,其中,所述第一更新信息用于向所述第二电子设备指示所述蓝牙设备支持播放所述第一目标音频数据的音频类型。
第一更新信息发送模块,用于发送所述第一更新信息至所述第二电子设备。
进一步地,所述蓝牙设备还与第二电子设备建立有低功耗蓝牙连接,所述设备的连接装置500还包括:第一连接请求接收模块、第二更新信息获得模块以及第二更新信息发送模块,其中:
第一连接请求接收模块,用于在所述蓝牙设备播放所述第一目标音频数据的情况下,接收所述第二电子设备发起的第一连接请求,其中,所述第一连接请求由所述第二电子设备在播放第二目标音频数据时发送,其中,所述第一目标音频数据的音频类型与所述第二目标音频数据的音频类型相同。
第二更新信息获得模块,用于响应于所述第一连接请求,更新所述第一播放能力信息获得第二更新信息,其中,所述第二更新信息用于向所述第一电子设备指示所述蓝牙设备不支持播放所述第一目标音频数据的音频类型。
第二更新信息发送模块,用于发送所述第二更新信息至所述第一电子设备,以在所述蓝牙设备停止播放所述第一目标音频数据。
进一步地,所述蓝牙设备还与第二电子设备建立有低功耗蓝牙连接,所述设备的连接装置500还包括:第二连接请求接收模块和第二连接请求响应模块,其中:
第二连接请求接收模块,用于在所述蓝牙设备播放所述第一目标音频数据的情况下,接收到所述第二电子设备发起的第二连接请求,其中,所述第二连接请求由所述第二电子设备在播放第三目标音频数据时发送,所述第三目标音频数据的音频类型的优先级高于所述第一目标音频数据的音频类型的优先级。
第二连接请求响应模块,用于响应于所述第二连接请求,停止播放所述第一目标音频数据并播放所述第三目标音频数据。
进一步地,所述设备的连接装置500还包括:第三更新信息发送模块和第四更新信息发送模块,其中:
第三更新信息发送模块,用于更新所述第一播放能力信息获得第三更新信息发送至所述第一电子设备,以及更新所述第二播放能力信息获得第四更新信息发送至所述第二电子设备,其中,所述第三更新信息用于向所述第一电子设备指示所述蓝牙设备不支持播放所述第一目标音频数据的音频类型,所述第四更新信息用于向所述第二电子设备指示所述蓝牙设备不支持播放所述第一目标音频数据的音频类型。
第四更新信息发送模块,用于更新所述第一播放能力信息获得第五更新信息发送至所述第一电子设备,以及更新所述第二播放能力信息获得所述第三更新信息发送至所述第二电子设备,其中,所述第五更新信息用于向所述第一电子设备指示所述蓝牙设备不支持播放所述第一目标音频数据的音频类型和所述第三目标音频数据的音频类型。
进一步地,所述设备的连接装置500还包括:连接建立模块,其中:
连接建立模块,用于建立与所述第一电子设备之间的连接同步流,以通过所述连接同步流接收并播放所述第一目标音频数据。
所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述装置和模块的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。
在本申请所提供的几个实施例中,模块相互之间的耦合可以是电性,机械或其它形式的耦合。
另外,在本申请各个实施例中的各功能模块可以集成在一个处理模块中,也可以是各个模块单独物理存在,也可以两个或两个以上模块集成在一个模块中。上述集成的模块既可以采用硬件的形 式实现,也可以采用软件功能模块的形式实现。
请参阅图15,其示出了本申请实施例提供的一种电子设备100的结构框图。该电子设备600包括上述第一电子设备100,也可以包括蓝牙设备200,在此不做限定。本申请中的电子设备600可以包括一个或多个如下部件:处理器610、存储器620以及一个或多个应用程序,其中一个或多个应用程序可以被存储在存储器620中并被配置为由一个或多个处理器610执行,一个或多个程序配置用于执行如前述方法实施例所描述的方法。
其中,处理器610可以包括一个或者多个处理核。处理器610利用各种接口和线路连接整个电子设备600内的各个部分,通过运行或执行存储在存储器620内的指令、程序、代码集或指令集,以及调用存储在存储器620内的数据,执行电子设备600的各种功能和处理数据。可选地,处理器610可以采用数字信号处理(Digital Signal Processing,DSP)、现场可编程门阵列(Field-Programmable Gate Array,FPGA)、可编程逻辑阵列(Programmable Logic Array,PLA)中的至少一种硬件形式来实现。处理器610可集成中央处理器(Central Processing Unit,CPU)、图形处理器(Graphics Processing Unit,GPU)和调制解调器等中的一种或几种的组合。其中,CPU主要处理操作系统、用户界面和应用程序等;GPU用于负责待显示内容的渲染和绘制;调制解调器用于处理无线通信。可以理解的是,上述调制解调器也可以不集成到处理器610中,单独通过一块通信芯片进行实现。
存储器620可以包括随机存储器(Random Access Memory,RAM),也可以包括只读存储器(Read-Only Memory)。存储器620可用于存储指令、程序、代码、代码集或指令集。存储器620可包括存储程序区和存储数据区,其中,存储程序区可存储用于实现操作系统的指令、用于实现至少一个功能的指令(比如触控功能、声音播放功能、图像播放功能等)、用于实现下述各个方法实施例的指令等。存储数据区还可以存储电子设备600在使用中所创建的数据(比如电话本、音视频数据、聊天记录数据)等。
请参阅图16,其示出了本申请实施例提供的一种计算机可读存储介质的结构框图。该计算机可读介质700中存储有程序代码,所述程序代码可被处理器调用执行上述方法实施例中所描述的方法。
计算机可读存储介质700可以是诸如闪存、EEPROM(电可擦除可编程只读存储器)、EPROM、硬盘或者ROM之类的电子存储器。可选地,计算机可读存储介质700包括非易失性计算机可读介质(non-transitory computer-readable storage medium)。计算机可读存储介质700具有执行上述方法中的任何方法步骤的程序代码710的存储空间。这些程序代码可以从一个或者多个计算机程序产品中读出或者写入到这一个或者多个计算机程序产品中。程序代码710可以例如以适当形式进行压缩。
综上所述,本申请实施例提供的设备的连接方法、装置、电子设备以及存储介质,在第一电子设备播放第一目标音频数据的情况下,获取蓝牙设备的第一播放能力信息,该第一播放能力信息用于向第一电子设备指示蓝牙设备支持播放的音频类型,根据该第一播放能力信息和第一目标音频数据的音频类型,确定第一目标音频数据的播放策略,从而通过建立与蓝牙设备之间的低功耗蓝牙连接,获取蓝牙设备的播放能力信息,并根据该播放能力信息以及自身播放的音频数据的音频类型,确定针对该播放的音频数据的播放策略,从而可以提升音频播放的效果和用户的使用体验。
最后应说明的是:以上实施例仅用以说明本申请的技术方案,而非对其限制;尽管参照前述实施例对本申请进行了详细的说明,本领域的普通技术人员当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不驱使相应技术方案的本质脱离本申请各实施例技术方案的精神和范围。

Claims (20)

  1. 一种设备的连接方法,其特征在于,应用于第一电子设备,所述第一电子设备与蓝牙设备建立有低功耗蓝牙连接,所述方法包括:
    在所述第一电子设备播放第一目标音频数据的情况下,获取所述蓝牙设备的第一播放能力信息,所述第一播放能力信息用于向所述第一电子设备指示所述蓝牙设备支持播放的音频类型;
    根据所述第一播放能力信息和所述第一目标音频数据的音频类型,确定所述第一目标音频数据的播放策略。
  2. 根据权利要求1所述的方法,其特征在于,所述根据所述第一播放能力信息和所述第一目标音频数据的音频类型,确定所述第一目标音频数据的播放策略,包括:
    若所述第一播放能力信息指示所述蓝牙设备支持播放所述第一目标音频数据的音频类型,则将所述第一目标音频数据发送至所述蓝牙设备。
  3. 根据权利要求1所述的方法,其特征在于,所述根据所述第一播放能力信息和所述第一目标音频数据的音频类型,确定所述第一目标音频数据的播放策略,包括:
    若所述第一播放能力信息指示所述蓝牙设备不支持播放所述第一目标音频数据的音频类型,则监听所述蓝牙设备的第一播放能力信息的变化;
    若监听到所述蓝牙设备的第一播放能力信息指示所述蓝牙设备由不支持播放所述第一目标音频数据的音频类型切换为支持播放所述第一目标音频数据的音频类型,则将所述第一目标音频数据发送至所述蓝牙设备。
  4. 根据权利要求2或3所述的方法,其特征在于,所述将所述第一目标音频数据发送至所述蓝牙设备,包括:
    建立与所述蓝牙设备之间的连接同步流,以通过所述连接同步流将所述第一目标音频数据发送至所述蓝牙设备。
  5. 根据权利要求1-3任一项所述的方法,其特征在于,所述根据所述第一播放能力信息和所述第一目标音频数据的音频类型,确定所述第一目标音频数据的播放策略,包括:
    若所述第一播放能力信息指示所述蓝牙设备不支持播放所述第一目标音频数据的音频类型,则外放所述第一目标音频数据;或者
    若所述第一播放能力信息指示所述蓝牙设备不支持播放所述第一目标音频数据的音频类型,则暂停播放所述第一目标音频数据;或者
    若所述第一播放能力信息指示所述蓝牙设备不支持播放所述第一目标音频数据的音频类型,则将所述第一目标音频数据发送至其他蓝牙设备,其中,所述第一电子设备与所述其他蓝牙设备建立有低功耗蓝牙连接。
  6. 根据权利要求1-3任一项所述的方法,其特征在于,所述第一播放能力信息包括可用音频上下文,所述根据所述第一播放能力信息和所述第一目标音频数据的音频类型,确定所述第一目标音频数据的播放策略,包括:
    根据所述可用音频上下文中的对应所述第一目标音频数据的音频类型的音频类型的状态信息,确定所述第一目标音频数据的播放策略。
  7. 根据权利要求1-3任一项所述的方法,其特征在于,所述蓝牙设备放置于耳机盒中,所述方法还包括:
    当检测到所述耳机盒开盖的情况下,建立所述第一电子设备与所述蓝牙设备的低功耗蓝牙连接。
  8. 根据权利要求7所述的方法,其特征在于,所述当检测到所述耳机盒开盖的情况下,建立所述第一电子设备与所述蓝牙设备的低功耗蓝牙连接,包括:
    当检测到所述耳机盒开盖且所述蓝牙设备从所述耳机盒中取出的情况下,建立所述第一电子设备与所述蓝牙设备的低功耗蓝牙连接。
  9. 根据权利要求8所述的方法,其特征在于,所述当检测到所述耳机盒开盖且所述蓝牙设备从所述耳机盒中取出的情况下,建立所述第一电子设备与所述蓝牙设备的低功耗蓝牙连接,包括:
    当检测到所述耳机盒开盖且所述蓝牙设备从所述耳机盒中取出的情况下,检测所述蓝牙设备是否处于佩戴状态;
    当检测到所述蓝牙设备处于佩戴状态的情况下,建立所述第一电子设备与所述蓝牙设备的低功耗蓝牙连接。
  10. 一种设备的连接方法,其特征在于,应用于蓝牙设备,所述蓝牙设备与第一电子设备建立有低功耗蓝牙连接,所述方法包括:
    发送所述蓝牙设备的第一播放能力信息至所述第一电子设备,以使所述第一电子设备在播放第一目 标音频数据的情况下,根据所述第一播放能力信息和所述第一目标音频数据的音频类型,确定所述第一目标音频数据的播放策略,其中,所述第一播放能力信息用于向所述第一电子设备指示所述蓝牙设备支持播放的音频类型。
  11. 根据权利要求10所述的方法,其特征在于,所述蓝牙设备还与第二电子设备建立有低功耗蓝牙连接,所述方法还包括:
    在所述蓝牙设备播放所述第一目标音频数据的情况下,发送所述蓝牙设备的第二播放能力信息至所述第二电子设备,其中,所述第二播放能力信息用于向所述第二电子设备指示所述蓝牙设备支持播放的音频类型,所述第二播放能力信息指示所述蓝牙设备不支持播放所述第一目标音频数据的音频类型。
  12. 根据权利要求11所述的方法,其特征在于,在所述发送所述蓝牙设备的第二播放能力信息至所述第二电子设备之后,还包括:
    在所述蓝牙设备停止播放所述第一目标音频数据的情况下,更新所述第二播放能力信息获得第一更新信息,其中,所述第一更新信息用于向所述第二电子设备指示所述蓝牙设备支持播放所述第一目标音频数据的音频类型;
    发送所述第一更新信息至所述第二电子设备。
  13. 根据权利要求10所述的方法,其特征在于,所述蓝牙设备还与第二电子设备建立有低功耗蓝牙连接,还方法包括:
    在所述蓝牙设备播放所述第一目标音频数据的情况下,接收所述第二电子设备发起的第一连接请求,其中,所述第一连接请求由所述第二电子设备在播放第二目标音频数据时发送,其中,所述第一目标音频数据的音频类型与所述第二目标音频数据的音频类型相同;
    响应于所述第一连接请求,更新所述第一播放能力信息获得第二更新信息,其中,所述第二更新信息用于向所述第一电子设备指示所述蓝牙设备不支持播放所述第一目标音频数据的音频类型;
    发送所述第二更新信息至所述第一电子设备,以在所述蓝牙设备停止播放所述第一目标音频数据。
  14. 根据权利要求11所述的方法,其特征在于,所述蓝牙设备还与第二电子设备建立有低功耗蓝牙连接,所述方法还包括:
    在所述蓝牙设备播放所述第一目标音频数据的情况下,接收到所述第二电子设备发起的第二连接请求,其中,所述第二连接请求由所述第二电子设备在播放第三目标音频数据时发送,所述第三目标音频数据的音频类型的优先级高于所述第一目标音频数据的音频类型的优先级;
    响应于所述第二连接请求,停止播放所述第一目标音频数据并播放所述第三目标音频数据。
  15. 根据权利要求14所述的方法,其特征在于,所述方法还包括:
    更新所述第一播放能力信息获得第三更新信息发送至所述第一电子设备,以及更新所述第二播放能力信息获得第四更新信息发送至所述第二电子设备,其中,所述第三更新信息用于向所述第一电子设备指示所述蓝牙设备不支持播放所述第一目标音频数据的音频类型,所述第四更新信息用于向所述第二电子设备指示所述蓝牙设备不支持播放所述第一目标音频数据的音频类型;或者
    更新所述第一播放能力信息获得第五更新信息发送至所述第一电子设备,以及更新所述第二播放能力信息获得所述第三更新信息发送至所述第二电子设备,其中,所述第五更新信息用于向所述第一电子设备指示所述蓝牙设备不支持播放所述第一目标音频数据的音频类型和所述第三目标音频数据的音频类型。
  16. 根据权利要求11-15任一项所述的方法,其特征在于,所述蓝牙设备播放所述第一目标音频数据,包括:
    建立与所述第一电子设备之间的连接同步流,以通过所述连接同步流接收并播放所述第一目标音频数据。
  17. 一种设备的连接装置,其特征在于,应用于第一电子设备,所述第一电子设备与蓝牙设备建立有低功耗蓝牙连接,所述装置包括:
    播放能力信息获取模块,用于在所述第一电子设备播放第一目标音频数据的情况下,获取所述蓝牙设备的第一播放能力信息,所述第一播放能力信息用于向所述第一电子设备指示所述蓝牙设备支持播放的音频类型;
    播放策略确定模块,用于根据所述第一播放能力信息和所述第一目标音频数据的音频类型,确定所述第一目标音频数据的播放策略。
  18. 一种设备的连接装置,其特征在于,应用于蓝牙设备,所述蓝牙设备与第一电子设备建立有低功耗蓝牙连接,所述装置包括:
    信息发送模块,用于发送所述蓝牙设备的第一播放能力信息至所述第一电子设备,以使所述第一电子设备在播放第一目标音频数据的情况下,根据所述第一播放能力信息和所述第一目标音频数据的音频 类型,确定所述第一目标音频数据的播放策略,其中,所述第一播放能力信息用于向所述第一电子设备指示所述蓝牙设备支持播放的音频类型。
  19. 一种电子设备,其特征在于,包括存储器和处理器,所述存储器耦接到所述处理器,所述存储器存储指令,当所述指令由所述处理器执行时所述处理器执行如权利要求1-16任一项所述的方法。
  20. 一种计算机可读取存储介质,其特征在于,所述计算机可读取存储介质中存储有程序代码,所述程序代码可被处理器调用执行如权利要求1-16任一项所述的方法。
PCT/CN2023/104970 2022-08-30 2023-06-30 设备的连接方法、装置、电子设备以及存储介质 WO2024045877A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202211058467.2A CN117692886A (zh) 2022-08-30 2022-08-30 设备的连接方法、装置、电子设备以及存储介质
CN202211058467.2 2022-08-30

Publications (1)

Publication Number Publication Date
WO2024045877A1 true WO2024045877A1 (zh) 2024-03-07

Family

ID=90100296

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2023/104970 WO2024045877A1 (zh) 2022-08-30 2023-06-30 设备的连接方法、装置、电子设备以及存储介质

Country Status (2)

Country Link
CN (1) CN117692886A (zh)
WO (1) WO2024045877A1 (zh)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109257500A (zh) * 2018-09-30 2019-01-22 Oppo广东移动通信有限公司 音频播放方法、装置、电子设备及存储介质
WO2020155090A1 (zh) * 2019-01-29 2020-08-06 深圳傲智天下信息科技有限公司 音频的蓝牙传输方法、蓝牙收发器及计算机可读存储介质
CN112269557A (zh) * 2020-10-14 2021-01-26 合肥联宝信息技术有限公司 一种音频输出方法及装置
CN114205336A (zh) * 2020-09-01 2022-03-18 华为技术有限公司 跨设备音频播放方法、移动终端、电子设备及存储介质
CN114398020A (zh) * 2019-12-30 2022-04-26 华为技术有限公司 一种音频播放方法及相关设备

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109257500A (zh) * 2018-09-30 2019-01-22 Oppo广东移动通信有限公司 音频播放方法、装置、电子设备及存储介质
WO2020155090A1 (zh) * 2019-01-29 2020-08-06 深圳傲智天下信息科技有限公司 音频的蓝牙传输方法、蓝牙收发器及计算机可读存储介质
CN114398020A (zh) * 2019-12-30 2022-04-26 华为技术有限公司 一种音频播放方法及相关设备
CN114205336A (zh) * 2020-09-01 2022-03-18 华为技术有限公司 跨设备音频播放方法、移动终端、电子设备及存储介质
CN112269557A (zh) * 2020-10-14 2021-01-26 合肥联宝信息技术有限公司 一种音频输出方法及装置

Also Published As

Publication number Publication date
CN117692886A (zh) 2024-03-12

Similar Documents

Publication Publication Date Title
US11962840B2 (en) Services over wireless communication with high flexibility and efficiency
US9906574B2 (en) Method, server, client and system for data presentation in a multiplayer session
CN115314586B (zh) 管理用户设备的连接
CN109379490B (zh) 音频播放方法、装置、电子设备及计算机可读介质
EP3556121B1 (en) Methods and apparatus for managing control data
WO2022017007A1 (zh) 音频数据处理方法、服务器及存储介质
US8970651B2 (en) Integrating audio and video conferencing capabilities
WO2021169472A1 (zh) 语音通话转移方法及电子设备
EP3745813A1 (en) Method for operating a bluetooth device
CN113766477A (zh) 设备连接方法、装置、电子设备及计算机可读介质
WO2022228569A1 (zh) 蓝牙设备控制传输的方法和装置、电子设备
JP2018528653A (ja) 音声呼中のシステムコールを処理する方法、システム、及び装置
JP7500574B2 (ja) スタンドアロンプログラムの実行方法、装置、デバイス及びコンピュータプログラム
CN111049709B (zh) 一种基于蓝牙的互联音箱控制方法、设备及存储介质
WO2022048020A1 (zh) 蓝牙音箱的控制方法及系统、存储介质及移动终端
US10972845B1 (en) Hearing device and systems and methods for communicating with the same
WO2024055738A1 (zh) 音频数据的共享方法、装置、电子设备以及存储介质
WO2024119947A1 (zh) 蓝牙通信方法、装置、电子设备及计算机可读介质
TW202232925A (zh) 可避免聲音中斷的藍牙通信系統及相關的藍牙主控裝置與藍牙設備群
CN118740299A (zh) 显示设备及蓝牙广播切换处理方法
WO2024045877A1 (zh) 设备的连接方法、装置、电子设备以及存储介质
WO2023005880A1 (zh) 音频控制方法、电子设备、音频设备和存储介质
US10122896B2 (en) System and method of managing transmission of data between two devices
WO2024060750A1 (zh) 蓝牙切换方法和装置、蓝牙连接方法和装置及电子设备
WO2024066648A1 (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: 23858915

Country of ref document: EP

Kind code of ref document: A1