Audio playing control method and device, equipment and storage medium
By receiving device requests and setting the target data transmission channel through the audio device, the low efficiency of TWS earphones when switching between multiple devices is solved, and efficient device switching and audio data transmission are achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- DONGGUAN ELF EDUCATIONAL SOFTWARE CO LTD
- Filing Date
- 2024-11-07
- Publication Date
- 2026-05-08
AI Technical Summary
In scenarios where multiple audio devices are connected, TWS earbuds need to be manually disconnected from the smart device when switching devices, resulting in low switching efficiency.
The audio device receives a target request from the device, determines whether the target device has permission to use it based on the request, and sets the target data transmission channel to a usable state, through which it receives and plays audio data.
It improves the efficiency of switching between multiple audio devices, simplifies the user operation process, enhances interoperability between devices and the stability of audio data transmission, and optimizes resource usage and battery life.
Smart Images

Figure CN121996192A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of audio playback technology, and includes, but is not limited to, an audio playback control method, apparatus, device, and storage medium. Background Technology
[0002] Currently, in related technologies, for devices that integrate smart devices and audio devices, such as devices that integrate smart devices and true wireless stereo (TWS) earphones, after the TWS earphones are connected to the smart device, when switching devices, the TWS earphones need to be manually disconnected from the smart device before other smart devices can continue to connect and use the TWS earphones. In scenarios where multiple devices are connected to the audio device, switching between devices is relatively complicated and inefficient.
[0003] Therefore, improving the efficiency of switching between multiple audio devices in scenarios where multiple devices are connected to the audio device is an urgent problem to be solved. Summary of the Invention
[0004] In view of this, the audio playback control method, apparatus, device, and storage medium provided in the embodiments of this application can improve the efficiency of switching between multiple audio devices in scenarios where multiple devices are connected to the audio device. The audio playback control method, apparatus, device, and storage medium provided in the embodiments of this application are implemented as follows:
[0005] The audio playback control method provided in this application is applied to an audio device, which is communicatively connected to a first device. The first device includes a storage compartment for storing the audio device. The method includes: receiving a target request from the first device or a second device, the target request requesting the target device to obtain usage rights for the audio device, the target device including at least one of the first device and the second device; setting a target data transmission channel between the audio device and the target device to an available state according to the target request; and receiving and playing audio data sent by the target device through the target data transmission channel.
[0006] In some embodiments, setting the target data transmission channel between the audio device and the target device to an available state according to the target request includes: determining whether the target device has obtained usage rights to the audio device according to the target request; and setting the target data transmission channel between the audio device and the target device to an available state if the target device has obtained usage rights to the audio device.
[0007] In some embodiments, determining whether the target device has obtained permission to use the audio device based on the target request includes: determining whether the target device has obtained permission to use the audio device based on the target request and the current playback state of the audio device, wherein the current playback state includes at least one of the audio device being in a state of not playing audio and a state of playing audio.
[0008] In some embodiments, determining whether the target device has obtained permission to use the audio device based on the target request includes: when there are multiple target requests, sending a first confirmation request to the first device to display confirmation interfaces for target requests from different devices on the first device; receiving a first instruction, the first instruction being triggered by a user's operation on the first device based on the first confirmation request; and determining whether the target device has obtained permission to use the audio device based on the first instruction.
[0009] In some embodiments, the audio device receives a target request from the second device, the target device being the second device, which includes a device having a pairing record with the audio device and a device establishing a classic Bluetooth BT connection with the audio device. Determining whether the target device has obtained access to the audio device based on the target request and the current playback state of the audio device includes: determining whether the second device has obtained access to the audio device based on the target request when the audio device is currently in a state of not playing audio.
[0010] In some embodiments, the audio device receives a target request from the first device, wherein the target device is the first device, and determining whether the target device has obtained permission to use the audio device based on the target request and the current playback state of the audio device includes: if the audio device is currently in a state of not playing audio, determining that the first device has obtained permission to use the audio device based on the target request.
[0011] In some embodiments, the audio device receives a target request from the first device, the target device being the second device; determining whether the target device has obtained usage rights to the audio device based on the target request and the current playback state of the audio device includes: if the audio device is currently in a state of not playing audio, determining, based on the target request, that the second device has obtained usage rights to the audio device.
[0012] In some embodiments, the target request includes a data type requested for playback, with different data types having different priorities. Determining whether the target device has obtained access to the audio device based on the target request and the current playback state of the audio device includes: if the current playback state of the audio device is that audio is being played, obtaining the data type of the currently playing audio; if the priority of the data type of the currently playing audio is lower than the priority of the data type requested for playback in the target request, determining that the target device has obtained access to the audio device, and setting the target data transmission channel between the audio device and the target device to an available state; if the priority of the data type of the currently playing audio is higher than the priority of the data type requested for playback in the target request, determining that the device currently using the audio device has access to the audio device.
[0013] In some embodiments, the method further includes: sending a second confirmation request to the first device if the priority of the data type of the audio being played is equal to the priority of the data type requested to be played in the target request; the second confirmation request is used to request the user to confirm whether to allow the target device to obtain access to the audio device; receiving a second instruction, the second instruction being triggered by a first operation performed by the user on the first device according to the second confirmation request, the first operation instructing the user to allow the target device to obtain access to the audio device; and determining, according to the second instruction, that the target device has obtained access to the audio device.
[0014] In some embodiments, the data type includes music data and call data, with the call data having a higher priority than the music data.
[0015] In some embodiments, before receiving a target request sent by a target device, the method further includes: completing Bluetooth Low Energy (BLE) pairing and Bluetooth BT pairing with the first device, and Bluetooth BT pairing with the second device; and, if the audio device is detected to be in a non-storage state, establishing a BLE connection and a Bluetooth BT connection with the first device, and a Bluetooth BT connection with the second device, wherein the audio device includes a storage state and the non-storage state, and the storage state is the state in which the audio device is stored in the storage compartment.
[0016] In some embodiments, receiving a target request sent by a target device includes: establishing a BT connection with the target device when the audio device is in a stored state and a target request is received from the target device; and determining, based on the target request, whether the target device has obtained permission to use the audio device when the audio device is in an unstored state and a target request is received from the target device.
[0017] In some embodiments, the method further includes: if the audio device is in the stored state and a BT connection is established with the target device, and it is detected that the audio device is in the unstored state, then determining that the target device has obtained the right to use the audio device.
[0018] In some embodiments, the method further includes: if the audio device is detected to be in the non-stored state when the audio device is in the stored state and has not established a BT connection with any device, then determining that the first device has obtained the right to use the audio device.
[0019] In some embodiments, the method further includes: if the audio device is disconnected from the device that is using the audio device, switching the access rights of the audio device to the device that last established a BT connection with the audio device.
[0020] The audio playback control method provided in this application embodiment is applied to a first device, which is communicatively connected to an audio device. The first device includes a storage compartment for storing the audio device. The method includes sending a target request to the audio device, wherein the target request requests a target device to obtain usage rights to the audio device, and the target device includes at least one of the first device and a second device.
[0021] In some embodiments, the method further includes: when there are multiple target requests, receiving a first confirmation request from the audio device and displaying confirmation interfaces for target requests from different devices; and receiving user operations on the first device based on the first confirmation request.
[0022] The audio playback control device provided in this application embodiment is applied to an audio device. The audio device is communicatively connected to a first device, which includes a storage compartment for storing the audio device. The device includes: a receiving module for receiving a target request from the first device or a second device, the target request requesting the target device to obtain usage rights for the audio device, the target device including at least one of the first device and the second device; a setting module for setting a target data transmission channel between the audio device and the target device to an available state according to the target request; and a processing module for receiving audio data sent by the target device through the target data transmission channel and playing the audio data.
[0023] The audio playback control device provided in this application embodiment is applied to a first device. The first device is communicatively connected to an audio device. The first device includes a storage compartment for storing the audio device. The device includes a sending module for sending a target request to the audio device. The target request is used to request a target device to obtain usage rights of the audio device. The target device includes at least one of the first device and a second device.
[0024] The computer device provided in this application includes a memory and a processor. The memory stores a computer program that can run on the processor. When the processor executes the program, it implements the audio playback control method described in this application.
[0025] The computer-readable storage medium provided in this application embodiment stores a computer program thereon, which, when executed by a processor, implements the audio playback control method provided in this application embodiment.
[0026] The computer program product provided in this application includes a computer program that, when executed by a processor, implements the audio playback control method provided in this application.
[0027] In the audio playback control method, apparatus, device, and storage medium provided in this application embodiment, the audio device receives a target request from a first device or a second device. The target request requests the target device to obtain usage rights for the audio device. The target device includes at least one of the first device and the second device. Then, according to the target request, the target data transmission channel between the audio device and the target device is set to an available state. Finally, the audio data sent by the target device is received and played through the target data transmission channel. In this audio playback control method, the audio device sets the target data transmission channel between the audio device and the target device to an available state according to the target request, thereby receiving and playing the audio data from the target device. This can improve the efficiency of the audio device switching between multiple devices in scenarios where multiple devices are connected to the audio device, and solve the technical problems mentioned in the background art. Attached Figure Description
[0028] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with this application and, together with the specification, serve to explain the technical solutions of this application.
[0029] Figure 1 A structural schematic diagram of a watch with built-in earphones provided in one embodiment of this application;
[0030] Figure 2 A schematic diagram illustrating the implementation flow of an audio playback control method provided in one embodiment of this application;
[0031] Figure 3 A schematic diagram illustrating the implementation flow of an audio playback control method provided in another embodiment of this application;
[0032] Figure 4 This is a schematic diagram of a pairing record list provided in one embodiment of this application;
[0033] Figure 5 A schematic diagram of the interface display of a watch screen provided in one embodiment of this application;
[0034] Figure 6 This is a schematic diagram of the interface display of a first device provided in one embodiment of this application;
[0035] Figure 7 A schematic diagram of the interface display of a first device provided in another embodiment of this application;
[0036] Figure 8 A schematic diagram illustrating the implementation flow of an audio playback control method provided in yet another embodiment of this application;
[0037] Figure 9A structural schematic diagram of an audio playback control device provided in one embodiment of this application;
[0038] Figure 10 A structural schematic diagram of an audio playback control device provided in another embodiment of this application;
[0039] Figure 11 This is a structural schematic diagram of a computer device provided in one embodiment of this application. Detailed Implementation
[0040] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the specific technical solutions of this application will be further described in detail below with reference to the accompanying drawings of the embodiments of this application. The following embodiments are used to illustrate this application, but are not intended to limit the scope of this application.
[0041] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein is for the purpose of describing embodiments of this application only and is not intended to limit this application.
[0042] In the following description, references are made to “some embodiments,” which describe a subset of all possible embodiments. However, it is understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.
[0043] It should be noted that the terms "first, second, third" used in the embodiments of this application are used to distinguish similar or different objects and do not represent a specific order of objects. It can be understood that "first, second, third" can be interchanged in a specific order or sequence where permitted, so that the embodiments of this application described herein can be implemented in an order other than that illustrated or described herein.
[0044] With the development of communication technology, connecting smartphones, smartwatches and other smart terminals to true wireless stereo (TWS) earphones for audio and call experiences has become an indispensable part of users' daily interactions. Users often need to carry smartphones, watches, TWS earphones and other devices when they go out, which poses a challenge to storage and portability.
[0045] Currently, there are solutions in related technologies that integrate smart devices with audio devices, such as combining a smartwatch and TWS earbuds. However, after TWS earbuds are connected to a smart device, switching between devices requires manually disconnecting from the smart device and then operating the TWS earbuds in the charging case to enter pairing broadcast mode before other smart devices can continue to connect and use the TWS earbuds. Alternatively, multiple devices may need to exchange data to complete the switching between TWS earbuds. Therefore, in scenarios where multiple devices are connected to audio devices, device switching is relatively complex and inefficient.
[0046] Therefore, improving the efficiency of switching between multiple audio devices in scenarios where multiple devices are connected to the audio device is an urgent problem to be solved.
[0047] In view of this, embodiments of this application provide an audio playback control method. This method is applied to an audio device and specifically includes: an audio device receiving a target request from a first device or a second device, the target request requesting the target device to obtain usage permission for the audio device, the target device including at least one of the first device and the second device; then, based on the target request, determining whether the target device has obtained usage permission for the audio device; if the target device has obtained usage permission, setting the target data transmission channel between the audio device and the target device to a usable state; and finally, receiving and playing audio data sent by the target device through the target data transmission channel. In this audio playback control method, the audio device sets the target data transmission channel between the audio device and the target device to a usable state according to the target request, thereby receiving and playing audio data from the target device. This can improve the efficiency of switching between multiple devices in scenarios where multiple devices are connected to the audio device.
[0048] It should be understood that the first device involved in the embodiments of this application can be a smart terminal device such as a watch with built-in earphones or a hearing aid with built-in earphones. The built-in method includes the smart terminal device including a storage compartment for the audio device or the audio device having its own storage compartment, and the storage compartment can be magnetically attached to the smart terminal device, etc.; the audio device can be earphones, and the second device can be a mobile phone, tablet computer, laptop computer, PDA, mobile internet device (MID), wearable device, virtual reality (VR) device, augmented reality (AR) device, etc., and the embodiments of this application are not limited to this. In the embodiments of this application, a watch with built-in earphones is used as an example for illustration.
[0049] For example, Figure 1This is a structural diagram illustrating the form factor of a watch with a built-in earphone, provided as an embodiment of this application. Figure 1 As shown, the watch includes an earphone case 101, a left earphone 102, a right earphone 103, a screen 104, and a watch strap 105. The left earphone 102 and right earphone 103 are in a stored state. The earphone case 101 is used to store the left earphone 102 and right earphone 103. The earphone case 101 is located on the top and bottom of the watch, and the earphones are placed and removed using a magnetic structure. The watch can be based on an Android system with built-in software content. The screen 104 is used to display the software content and detect user operations. The watch strap 105 is for convenient wearing. The left earphone 102 and right earphone 103 are open-back earphones, distinguishing between left and right ears. However, considering the habits of elderly users, their placement is not differentiated; both earphones can be placed in the earphone case from any top or bottom position. The earphones support a wear detection function.
[0050] To make the objectives and technical solutions of this application clearer and more intuitive, the audio playback control method, apparatus, device, and storage medium provided in the embodiments of this application will be described in detail below with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are merely illustrative of this application and are not intended to limit this application.
[0051] Please refer to Figure 2 This is a schematic diagram illustrating the implementation flow of an audio playback control method provided in one embodiment of this application. This method can be applied to, for example... Figure 1 The earphones shown, namely the left earphone 102 and the right earphone 103, can also be applied to other types of audio devices. This application does not limit this application. Figure 2 As shown, the method may include the following steps 201 to 203:
[0052] Step 201: Receive a target request from a first device or a second device. The target request is used to request the target device to obtain permission to use the audio device. The target device includes at least one of the first device and the second device.
[0053] It should be noted that the audio device is communicatively connected to the first device, which includes a storage compartment for storing the audio device. The storage compartment may be built into the first device or magnetically attached to the first device; this application does not limit this.
[0054] In some embodiments, the target request may include a device identifier of the target device and the data type of the request. Accordingly, the audio device may be equipped with a monitoring module for receiving target requests from a first device or a second device.
[0055] In some embodiments, the audio device can maintain connections with multiple devices simultaneously, i.e., establish data transmission channels. These data transmission channels can be configured with different states, such as an available state and an unavailable state. When a target device has permission to use the audio device, the data transmission channel between the target device and the audio device is in an available state.
[0056] Step 202: Based on the target request, set the target data transmission channel between the audio device and the target device to a usable state.
[0057] In some embodiments, the audio device may first initialize the target data transmission channel on the target device, selecting an appropriate initialization method according to different audio standards; then, according to the target request, the target data transmission channel between the audio device and the target device is set to a usable state. This is usually achieved by modifying the relevant system configuration or using application programming interface (API) instructions to activate the channel, etc., which is not limited in this application.
[0058] Step 203: Receive and play the audio data sent by the target device through the target data transmission channel.
[0059] In some embodiments, the audio device selects an appropriate transmission protocol based on the data type to be transmitted, receives audio data sent by the target device through the target data transmission channel, and converts the received audio data into a playable format for playback.
[0060] Optionally, the audio device can also add error handling logic to deal with possible network problems or data format errors, while performing status monitoring to ensure timely response to user operations and network changes during reception and playback.
[0061] In this embodiment, the audio device receives a target request from a first device or a second device. The target request requests the target device to obtain usage rights for the audio device. The target device includes at least one of the first device and the second device. Then, according to the target request, the target data transmission channel between the audio device and the target device is set to an available state. Finally, the audio data sent by the target device is received and played through the target data transmission channel. In the audio playback control method of this application, the audio device sets the target data transmission channel between the audio device and the target device to an available state according to the target request, thereby receiving and playing the audio data from the target device. This can improve the efficiency of the audio device switching between multiple devices in scenarios where multiple devices are connected to the audio device.
[0062] Based on the above embodiments, Figure 3A schematic diagram illustrating the implementation flow of an audio playback control method provided in another embodiment of this application is shown below. Figure 3 As shown, the method may include the following steps 301 to 304:
[0063] Step 301: Receive a target request from a first device or a second device. The target request is used to request the target device to obtain permission to use the audio device. The target device includes at least one of the first device and the second device.
[0064] In some embodiments, the target request may include a device identifier of the target device and the data type of the request. Accordingly, the audio device may be equipped with a monitoring module for receiving target requests from a first device or a second device.
[0065] In some embodiments, the audio device can maintain connections with multiple devices simultaneously, i.e., establish data transmission channels. These data transmission channels can be configured with different states, such as an available state and an unavailable state. When a target device has permission to use the audio device, the data transmission channel between the target device and the audio device is in an available state.
[0066] Step 302: Based on the target request, determine whether the target device has obtained the right to use the audio device.
[0067] In one possible implementation, the audio device can determine whether the target device has obtained the right to use the audio device based on the target request and the current playback state of the audio device. The current playback state includes at least one of the following: the audio device is currently in a state of not playing audio and the audio device is currently playing audio.
[0068] Optionally, the audio device can determine whether the target device has permission to use the audio device based on the target request and its current playback status, such as whether the audio device is idle or playing audio; or after receiving the target request, the audio device can send a judgment message to the first device, allowing the user to choose whether to allow the target device to obtain permission to use the audio device; or the audio device may receive multiple target requests, in which case the audio device can send a confirmation message to the first device, allowing the user to select the target device, etc. This application does not limit this.
[0069] In some embodiments, if an audio device receives a target request from a second device, and the target device is the second device, the second device includes a device with a pairing record with the audio device and a device that has established a classic Bluetooth (BT) connection with the audio device. In this case, if the audio device is currently not playing audio, the second device is determined to have access to the audio device based on the target request.
[0070] For example, assuming the first device is a watch with a built-in audio device and the audio device is headphones, if the user actively clicks to connect to the headphones on a terminal device that has a pairing record with the headphones, a BitTorrent connection is established between the headphones and that terminal device, and that terminal device has access to the headphones. The watch and other terminal devices can maintain a connection with the headphones. If the user selects to use the headphones on a terminal device that has a connection with the headphones, that is, sends a target request to the headphones, then the terminal device being operated on has access to the headphones, and the watch and other terminal devices can maintain a connection with the headphones. In this maintaining connection state, a data transmission channel is established, but the channel status of the data transmission channel is unusable.
[0071] In other embodiments, if the audio device receives a target request from a first device, and the target device is the first device, then if the audio device is currently in a state where it is not playing audio, the first device is determined to have obtained the right to use the audio device based on the target request.
[0072] For example, assuming the first device is a watch with a built-in audio device and the audio device is headphones, if the audio device receives a target request from the watch when the headphones are not currently playing audio, and the watch is requesting to play audio data, then the watch has the right to use the headphones.
[0073] It should be noted that, generally, the first device can be configured to have priority access to the audio device. Optionally, the first device may also have a physical switch to determine whether other terminal devices are allowed to access the audio device. If the switch is on, meaning the first device allows other terminal devices to access the audio device, then the method in this embodiment is used to further determine whether the target device has access to the audio device. If the switch is off, meaning the first device does not allow other terminal devices to access the audio device, then the access to the audio device belongs solely to the first device.
[0074] In some other embodiments, if the audio device receives a target request from a first device, and the target device is a second device, then if the audio device is currently not playing audio, the second device is determined to have obtained the right to use the audio device based on the target request.
[0075] For example, assuming the first device is a watch with a built-in audio device, and the audio device is headphones, if the user selects a terminal device from the headphone pairing list on the watch when the headphones are not currently playing audio, then the selected terminal device will have access to the headphones. The headphone pairing list includes terminal devices that are paired with the headphones, terminal devices that are connected to the headphones, and terminal devices that are currently using the headphones. For example, the watch screen may display something like... Figure 4 The pairing record list shown is as follows: Device 1, in use; Device 2, connected; Device 3, connected; Device 4, paired; for users to select.
[0076] Furthermore, if the user selects a terminal device to use from the pairing record list of the earphones on the watch, the watch sends a target request to the earphones. The target request includes the device identifier of the selected terminal device. In response to the target request, the earphones actively establish a connection with the terminal device, or transmit audio data.
[0077] In one possible implementation, the target request includes the data type to be played, with different data types having different priorities. If the audio device is currently playing audio, the data type of the playing audio is obtained. If the priority of the playing audio data type is lower than the priority of the data type requested in the target request, it is determined that the target device has obtained access to the audio device, and the target data transmission channel between the audio device and the target device is set to an available state. If the priority of the playing audio data type is higher than the priority of the data type requested in the target request, it is determined that the device currently using the audio device has access to the audio device.
[0078] Furthermore, if the priority of the data type of the currently playing audio is equal to the priority of the data type requested to be played in the target request, a second confirmation request is sent to the first device. This second confirmation request requests user confirmation on whether to allow the target device to access the audio device. If the user grants permission, a second instruction is sent to the audio device. The audio device receives the second instruction and, based on it, determines that the target device has obtained permission to use the audio device. The data types include music data and call data, with call data having a higher priority than music data.
[0079] For example, assuming the first device is a watch with a built-in audio device, and the audio device is an earphone, if a terminal device sends a target request requesting the playback of call data while the earphone is currently playing music data, the earphone determines that the terminal device has obtained the earphone's usage permission because call data has higher priority than music data. At this time, the earphone can play the incoming call ringtone of the terminal device and update connection status and other data to the watch via Bluetooth. At the same time, it sends the name of the incoming terminal device and the incoming call request flag to the watch. After receiving the information, the watch displays the incoming call information on the screen. Furthermore, the user can answer or hang up the call on the watch. When the user chooses to answer, the earphone's usage permission is still with the terminal device that made the call request; when the user chooses to hang up or fails to answer the call within the specified time, the earphone releases the usage permission of the terminal device that made the call request, and the usage permission returns to the previous terminal device.
[0080] For example, if a terminal device sends a target request that requests music data, and since the data being played by the headphones and the data requested by the terminal device have the same priority, the headphones can send the Bluetooth name of the terminal device sending the target request and the music playback request flag to the watch. The watch will then display a pop-up window on its screen asking the user whether to switch audio. For example, the watch screen might display something like... Figure 5 The message displayed reads: "Terminal device A requests to use the headset, do you agree?" and includes "Yes" and "No" buttons. If the user clicks "Agree," the terminal device gains permission to use the headset, and the previous terminal device with permission enters a keep-connected state.
[0081] For example, assuming the first device is a watch with a built-in audio device and the audio device is an earphone, if a terminal device sends a target request and the target request requests to play music data while the earphone is currently playing call data, the earphone retains the access rights of the terminal device currently using the earphone for the call because call data has higher priority than music data.
[0082] If a terminal device sends a target request that requests call data, and since the data being played by the headset and the data requested by the terminal device have the same priority, the headset can send the Bluetooth name and call playback request flag of the terminal device that sent the target request to the watch. The watch will then display a pop-up window asking the user if they want to switch audio. If the user agrees to grant the terminal device that sent the target request access, that terminal device will have access to the headset, and the previously accessed terminal device will enter a keep-connected state. At this time, the headset can play the ringtone of the terminal device that sent the target request and update connection status and other data to the watch via Bluetooth. It will also send the name of the incoming call terminal device and the call request flag to the watch. After receiving the information, the watch will display the call information on its screen. Furthermore, the user can answer or hang up the call on the watch. When the user chooses to answer, the headset access is still held by the terminal device that sent the target request; when the user chooses to hang up or fails to answer within the specified time, the headset releases the access of the terminal device that sent the call request, and the access reverts to the previously accessed terminal device.
[0083] It's important to note that the protocol used for transmitting call data is typically the Hands-Free Profile (HFP) protocol, which supports audio transmission and control between wireless hands-free devices, such as Bluetooth headsets and in-vehicle hands-free systems, and devices like mobile phones. The protocol used for transmitting music data is typically the Bluetooth Advanced Audio Distribution Profile (A2DP) protocol, which enables high-quality wireless audio transmission and supports stereo audio streaming.
[0084] Optionally, if the audio device is currently playing audio and receives a target request from the target device that requests audio playback, the audio device may directly switch the access permission from the currently used device to the target device.
[0085] In one possible implementation, when there are multiple target requests, the audio device can send a first confirmation request to the first device to display confirmation interfaces for the target requests from different devices on the first device; for example, please refer to Figure 6 This is a schematic diagram of the interface display of a first device provided in one embodiment of this application, as shown below. Figure 6 As shown, the screen of the first device displays: phone A requests to play audio A, phone B requests to play audio B, and phone C requests to play audio C. The user can click on any of the requests to enter the confirmation interface. For example, clicking on the request "phone A requests to play audio A" will further display the following... Figure 7The confirmation screen shown indicates that phone A is requesting to play audio A, and asks whether to allow it, with options to allow or disallow, for the user to choose from.
[0086] Furthermore, after the user operates on the first device according to the first confirmation request, the first device sends a first instruction to the audio device. Accordingly, the audio device receives the first instruction and determines whether the target device has obtained the right to use the audio device based on the first instruction.
[0087] Step 303: If the target device obtains permission to use the audio device, set the target data transmission channel between the audio device and the target device to a usable state.
[0088] In some embodiments, when the audio device confirms that the target device has obtained the right to use the audio device, the target data transmission channel can be initialized on the target device first, and an appropriate initialization method can be selected according to different audio standards; then the target data transmission channel between the audio device and the target device can be set to a usable state. The implementation method is usually to modify the relevant system configuration or use API instructions to activate the channel, etc., which is not limited in this application.
[0089] Step 304: Receive and play the audio data sent by the target device through the target data transmission channel.
[0090] In some embodiments, the audio device selects an appropriate transmission protocol based on the data type to be transmitted, receives audio data sent by the target device through the target data transmission channel, and converts the received audio data into a playable format for playback.
[0091] Optionally, the audio device can also add error handling logic to deal with possible network problems or data format errors, while performing status monitoring to ensure timely response to user operations and network changes during reception and playback.
[0092] In this embodiment, the audio device first receives a target request from a first device or a second device. Then, based on the target request, it determines whether the target device has obtained permission to use the audio device. If the target device has obtained permission, the target data transmission channel between the audio device and the target device is set to an available state. The audio device then receives and plays audio data sent by the target device through this target data transmission channel. This audio playback control method ensures that only authorized devices can access the audio device by judging the target request and the current playback state, thereby improving system security and reliability. The audio device can flexibly connect and communicate with different devices based on requests from the first or second device, enhancing interoperability between devices. By setting an available data transmission channel, it ensures that audio data can be transmitted quickly and stably, improving the real-time performance and smoothness of audio playback. When switching devices, users do not need to perform complex operations; the audio device can automatically identify requests and perform corresponding permission management, thereby simplifying the user's operation process and improving the overall user experience. Meanwhile, the audio device can dynamically adjust its receiving and playback strategies based on the current playback status, ensuring that audio data is received at the appropriate time, thereby avoiding playback interruptions or delays. It can also reduce resource waste and optimize performance and battery life by effectively managing the audio device's access permissions and data transmission channels. Furthermore, when multiple devices request connections, the audio device can effectively manage connection priorities, reducing interference between devices and improving audio transmission quality. Additionally, when the target device has obtained access permissions, the audio device can receive and play audio data from the target device, improving the efficiency of switching between multiple connected devices in scenarios.
[0093] Based on the above embodiments, Figure 8 This is a schematic diagram illustrating the implementation flow of an audio playback control method provided in another embodiment of this application, as shown below. Figure 8 As shown, the method may include the following steps 801 to 805:
[0094] Step 801: Complete Bluetooth Low Energy (BLE) pairing and Bluetooth BT pairing with the first device, and complete Bluetooth BT pairing with the second device.
[0095] In some embodiments, firstly, ensure that the Bluetooth functions of both the audio device and the first device are enabled and in pairing mode. Further, the audio device initiates a Bluetooth Low Energy (BLE) scan to discover a pairable first device and completes BLE pairing. Alternatively, the audio device completes the security verification required for pairing with both the first and second devices (such as a PIN code or pairing code) to complete classic Bluetooth BT pairing.
[0096] Step 802: If the audio device is detected to be in an unstored state, establish a BLE connection and a BT connection with the first device, and a BT connection with the second device.
[0097] The audio device includes a stored state and a non-stored state. The stored state refers to the state in which the audio device is stored in the storage compartment.
[0098] In some embodiments, the storage compartment includes a sensor that can detect whether the audio device is in a stored or unstored state by sensing the voltage of the sensor. Alternatively, a built-in sensor, such as a contact sensor or accelerometer, can be used to detect whether the audio device is in an unstored state; the sensor sends a signal when the audio device is removed or moved.
[0099] Furthermore, upon detecting that the audio device is not in its stored state, the Bluetooth module is triggered to start. The Bluetooth module begins scanning for connectable devices and searches for a paired first device for both BLE and BT connections, as well as a second device for a BT connection. Once a connection is successful, the audio device can provide feedback on the connection status through voice prompts or a light-emitting diode (LED) indicator. If the connection fails, the user can be prompted to retry or check the device settings. Additionally, when not in use, the audio device enters a low-power mode after a period of time to extend battery life. These steps ensure that the audio device can quickly and reliably establish a connection with the terminal device when the user removes it, thereby improving the user experience.
[0100] Optionally, the audio device only establishes a BLE connection with the first device. The BLE connection is primarily used for exchanging audio device pairing records, connection status, and related data. The pairing record shows which terminal devices the audio device has paired with. Once the first device obtains the pairing record, it displays it on its screen, such as the negative one screen. The connection status indicates which terminal devices the audio device is currently connected to. The audio device can maintain connections with multiple terminal devices, but it can only transmit large amounts of data with one terminal device at a time. Specifically, if the audio device has a pairing record but is not connected, it displays "Paired"; if it is connected but not in use, it displays "Connected"; and if it is connected and in use, it displays "In Use". Related data includes the audio device's battery level and other interactive data, which the first device also displays.
[0101] Optionally, BT connections are primarily used for data transmission of large amounts of data, such as audio and file transfers. File transfer, as an extension, includes audio files such as mp3 and wav.
[0102] In some embodiments, the audio device can be paired and connected with terminal devices including mobile phones, tablets, watches, etc. The pairing method may be to place the audio device in the storage compartment of the first device, and the first device sends a pairing broadcast mode command to the audio device through electrodes, and then the audio device is searched for and connected to in the Bluetooth settings interface of other terminals.
[0103] As an example, suppose the audio device is headphones, the first device is a watch, and the second device consists of multiple terminal devices, such as terminal device A, terminal device B, and terminal device C. Please refer to [reference needed]. Figure 8 This is a schematic diagram illustrating the connection between an audio device and multiple devices according to one embodiment of this application. Figure 8 As shown, the earphones and watch establish BLE and BT connections. The earphones can establish BT connections with terminal devices A, B, and C respectively.
[0104] Step 803: When the audio device is in a non-storage state and a target request is received from the target device, determine whether the target device has obtained the right to use the audio device based on the target request.
[0105] In some embodiments, the audio device may determine whether the target device has permission to use the audio device based on the target request and its current playback state, such as whether the audio device is idle or playing audio; or the audio device may send a judgment message to the first device after receiving the target request, allowing the user to choose whether to allow the target device to obtain permission to use the audio device; or the audio device may receive multiple target requests, in which case the audio device may send a confirmation message to the first device, allowing the user to select the target device, etc. This application does not limit this.
[0106] In one possible implementation, if the audio device is in a stored state and a target request is received from the target device, a BT connection with the target device is established; further, if the audio device is detected to be in an unstored state, it is determined that the target device has obtained the right to use the audio device.
[0107] For example, suppose the first device is a watch with a built-in audio device, and the audio device is an earphone. The earphone is paired with terminal device A and establishes a Bluetooth connection while in the watch's storage case. At this time, the earphone is only connected to terminal A. In order to reduce power consumption, the earphone will disconnect all Bluetooth connections after being put into the case. While in the case, the earphone can be operated to pair with terminal devices. If the earphone is not removed and used for more than a set threshold time after successful pairing and connection in the case, it will automatically enter a sleep state. When the earphone is removed, it will automatically initiate a connection with the terminal device in the pairing record and send the connection status to the watch via BLE connection to update the interface display. Since the earphone has established a Bluetooth connection with terminal device A while in the storage case, terminal device A will automatically obtain the right to use the audio device after the earphone is removed.
[0108] In another possible implementation, if the audio device is detected to be in an unstored state when it is in a stored state and has not established a BT connection with any device, it is determined that the first device has obtained the right to use the audio device.
[0109] For example, assuming the first device is a watch with a built-in audio device, and the audio device is an earphone, and the earphone is not paired with any terminal device while it is in the watch's storage compartment, after the earphone is removed from the compartment, the earphone automatically initiates a connection with the terminal device in the pairing record, and at this time the watch has the right to use the earphone. Other terminal devices that can be connected will maintain a connection with the earphone, while terminal devices that cannot be connected will still be in a paired state.
[0110] Step 804: If the target device obtains permission to use the audio device, set the target data transmission channel between the audio device and the target device to a usable state.
[0111] In some embodiments, when the audio device confirms that the target device has obtained the right to use the audio device, the target data transmission channel can be initialized on the target device first, and an appropriate initialization method can be selected according to different audio standards; then the target data transmission channel between the audio device and the target device can be set to a usable state.
[0112] Step 805: Receive audio data sent by the target device through the target data transmission channel and play the audio data.
[0113] In some embodiments, the audio device selects an appropriate transmission protocol based on the data type to be transmitted, receives audio data sent by the target device through the target data transmission channel, and converts the received audio data into a playable format for playback.
[0114] Optionally, the audio device can also add error handling logic to deal with possible network problems or data format errors, while performing status monitoring to ensure timely response to user operations and network changes during reception and playback.
[0115] In one possible implementation, if the audio device disconnects from the device currently using it, the access rights for the audio device are switched to the device that last established a BitTorrent (BT) connection with it. That is, the pairing list of audio devices is sorted in order of most recent use, with priority given to currently in use, then those in a persistent connection, and then those already paired; the audio devices are displayed in this order. When the terminal device currently in use disconnects from the audio device, or disconnects from the terminal device currently in use from the pairing list of the first device, the headphones will switch access rights to the highest priority among the persistent connections, i.e., the terminal device that last maintained a persistent connection.
[0116] In this embodiment, the audio device first completes Bluetooth Low Energy (BLE) and Bluetooth Bit-Based (BT) pairing with a first device, and BT pairing with a second device. Then, when the audio device is detected to be in an unstored state, it establishes BLE and BT connections with the first and second devices. Further, while the audio device is in an unstored state and receives a target request from the target device, it determines whether the target device has obtained permission to use the audio device based on the target request. Finally, if the target device has obtained permission, the target data transmission channel between the audio device and the target device is set to an available state, and audio data sent by the target device is received and played through the target data transmission channel. Through BLE and BT pairing, the audio device can quickly establish connections with multiple devices, saving pairing time and enhancing the user experience. Using BLE technology allows the audio device to maintain low power consumption when not in use, extending battery life and meeting the design requirements of portable devices. Through the target request mechanism, the audio device can intelligently manage access permissions for different devices, ensuring that only authorized devices can use the audio device, thus enhancing system security. After the target device gains access to the audio device, the target data transmission channel is dynamically configured to be usable, ensuring the immediacy and flexibility of the data channel to meet the needs of different application scenarios. Through the established connection, the audio device can stably receive audio data from the target device, ensuring smooth and high-quality audio playback. Because the audio device can connect to and flexibly switch between multiple devices, it adapts to the usage needs of different scenarios, improving the functionality, security, and user experience of the audio device, enabling it to work efficiently and stably in multi-device environments. It also improves the efficiency of switching between multiple devices in scenarios where the audio device is connected to multiple devices, enhancing the user's interactive experience. Furthermore, interactive function development only needs to be completed on the first device and the audio device, reducing development difficulty and data interaction complexity, and improving operational reliability.
[0117] It should be understood that although the steps in the above flowcharts are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the above flowcharts may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the sub-steps or stages of other steps.
[0118] Based on the foregoing embodiments, this application provides an audio playback control device, which includes various modules and units included in each module, and can be implemented by a processor; of course, it can also be implemented by specific logic circuits; in the implementation process, the processor can be a central processing unit, a microprocessor, a digital signal processor or a field-programmable gate array, etc.
[0119] Figure 9 This is a structural schematic diagram of an audio playback control device provided in one embodiment of this application, as shown below. Figure 9 As shown, the audio playback control device 900 includes a receiving module 901, a setting module 902, and a processing module 903, wherein:
[0120] The receiving module 901 is configured to receive a target request from the first device or the second device, the target request being used to request the target device to obtain usage rights of the audio device, the target device including at least one of the first device and the second device; the setting module 902 is configured to set the target data transmission channel between the audio device and the target device to a usable state according to the target request; the processing module 903 is configured to receive audio data sent by the target device through the target data transmission channel and play the audio data.
[0121] In some embodiments, the setting module 902 is specifically configured to: determine whether the target device has obtained the right to use the audio device according to the target request; and, if the target device has obtained the right to use the audio device, set the target data transmission channel between the audio device and the target device to a usable state.
[0122] In some embodiments, the apparatus further includes a determining module. The determining module is specifically configured to: determine, based on the target request and the current playback state of the audio device, whether the target device has obtained permission to use the audio device, wherein the current playback state includes at least one of a state where the audio device is currently not playing audio and a state where audio is being played.
[0123] In some embodiments, the determining module is specifically configured to: send a first confirmation request to the first device when there are multiple target requests, so as to display confirmation interfaces of target requests from different devices through the first device; receive a first instruction, the first instruction being triggered by the user's operation on the first device based on the first confirmation request; and determine, based on the first instruction, whether the target device has obtained the right to use the audio device.
[0124] In some embodiments, the audio device receives a target request from the second device, the target device being the second device, which includes a device with a pairing record with the audio device and a device that has established a classic Bluetooth BT connection with the audio device. The determining module is specifically configured to: determine, based on the target request, that the second device has obtained permission to use the audio device when the audio device is currently in a state of not playing audio.
[0125] In some embodiments, the audio device receives a target request from the first device, wherein the target device is the first device, and the determining module is specifically configured to: determine, based on the target request, that the first device has obtained permission to use the audio device when the audio device is currently in a state of not playing audio.
[0126] In some embodiments, the audio device receives a target request from the first device, the target device being the second device; the determining module is specifically configured to: when the audio device is currently in a state of not playing audio, determine, based on the target request, that the second device has obtained permission to use the audio device.
[0127] In some embodiments, the target request includes a data type to be played, with different data types having different priorities; the determining module is specifically configured to: when the current playback state of the audio device is the state of playing audio, obtain the data type of the audio being played; when the priority of the data type of the audio being played is lower than the priority of the data type to be played in the target request, determine that the target device has obtained the right to use the audio device, and set the target data transmission channel between the audio device and the target device to a usable state; when the priority of the data type of the audio being played is higher than the priority of the data type to be played in the target request, determine that the device currently using the audio device has the right to use the audio device.
[0128] In some embodiments, the apparatus further includes: a sending module. The sending module is configured to send a second confirmation request to the first device when the priority of the data type of the playing audio is equal to the priority of the data type requested to be played in the target request. The second confirmation request is used to request user confirmation on whether to allow the target device to obtain access to the audio device. The receiving module 901 is further configured to receive a second instruction triggered by a first operation performed by the user on the first device based on the second confirmation request. The first operation instructs the user to allow the target device to obtain access to the audio device. The determining module is further configured to determine, based on the second instruction, that the target device has obtained access to the audio device.
[0129] In some embodiments, the data type includes music data and call data, with the call data having a higher priority than the music data.
[0130] In some embodiments, the device further includes a pairing module and an establishment module. The pairing module is used to perform Bluetooth Low Energy (BLE) pairing and Bluetooth Transmission (BT) pairing with the first device, and BT pairing with the second device; the establishment module is used to establish BLE and BT connections with the first device, and BT connections with the second device, when the audio device is detected to be in an unstored state. The audio device includes a stored state and an unstored state, wherein the stored state is the state in which the audio device is stored in the storage compartment.
[0131] In some embodiments, the receiving module 901 is specifically configured to: establish a BT connection with the target device when the audio device is in a stored state and a target request is received from the target device; and determine, based on the target request, whether the target device has obtained the right to use the audio device when the audio device is in an unstored state and a target request is received from the target device.
[0132] In some embodiments, the determining module is further configured to: if the audio device is detected to be in the non-stored state when the audio device is in the stored state and a BT connection is established with the target device, determine that the target device has obtained the right to use the audio device.
[0133] In some embodiments, the determining module is further configured to: if the audio device is detected to be in the non-stored state when the audio device is in the stored state and has not established a BT connection with any device, determine that the first device has obtained the right to use the audio device.
[0134] In some embodiments, the apparatus further includes a switching module. The switching module is configured to, in the event that the audio device is disconnected from the device currently using the audio device, switch the access rights of the audio device to the device that last established a BT connection with the audio device.
[0135] The descriptions of the above device embodiments are similar to those of the above method embodiments, and have similar beneficial effects. For technical details not disclosed in the device embodiments of this application, please refer to the descriptions of the method embodiments of this application for understanding.
[0136] Figure 10 A structural schematic diagram of an audio playback control device provided in another embodiment of this application, as shown below. Figure 10 As shown, the audio playback control device 1000 includes a sending module 1001, wherein:
[0137] The sending module 1001 is used to send a target request to the audio device. The target request is used to request a target device to obtain the right to use the audio device. The target device includes at least one of the first device and the second device.
[0138] In some embodiments, the apparatus further includes a receiving module. The receiving module is configured to, when there are multiple target requests, receive a first confirmation request from the audio device and display confirmation interfaces for the target requests from different devices; the receiving module is also configured to receive user operations on the first device based on the first confirmation request.
[0139] It should be noted that, in the embodiments of this application... Figure 9 and Figure 10 The module division of the audio playback control device shown is illustrative and represents only one logical functional division; in actual implementation, other division methods may be used. Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, exist as separate physical units, or be integrated into one unit with two or more units. The integrated units can be implemented in hardware, as software functional units, or a combination of both.
[0140] It should be noted that, in the embodiments of this application, if the above-described methods are implemented as software functional modules and sold or used as independent products, they can also be stored in a computer-readable storage medium. Based on this understanding, the technical solutions of the embodiments of this application, or the parts that contribute to related technologies, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause an electronic device to execute all or part of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), magnetic disks, or optical disks. Thus, the embodiments of this application are not limited to any specific hardware and software combination.
[0141] This application provides a computer device, which may be a server, and its internal structure diagram may be as follows: Figure 11 As shown, the computer device includes a processor, memory, and a network interface connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The database stores data. The network interface communicates with external terminals via a network connection. When the computer program is executed by the processor, it implements the methods described above.
[0142] This application provides a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the steps of the method provided in the above embodiments.
[0143] This application provides a computer program product containing instructions that, when run on a computer, cause the computer to perform the steps in the method provided in the above-described method embodiments.
[0144] Those skilled in the art will understand that Figure 11 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0145] In one embodiment, the audio playback control device provided in this application can be implemented as a computer program, and the computer program can be implemented as follows: Figure 11The device operates on the computer device shown. The memory of the computer device can store the various program modules that make up the above-described apparatus. The computer program, composed of the various program modules, causes the processor to execute the steps of the methods in the various embodiments of this application described in this specification.
[0146] It should be noted that the descriptions of the storage medium and device embodiments above are similar to the descriptions of the method embodiments above, and have similar beneficial effects. For technical details not disclosed in the storage medium, storage medium, and device embodiments of this application, please refer to the descriptions of the method embodiments of this application for understanding.
[0147] It should be understood that the phrases "one embodiment," "an embodiment," or "some embodiments" mentioned throughout the specification mean that a specific feature, structure, or characteristic related to an embodiment is included in at least one embodiment of this application. Therefore, "in one embodiment," "in one embodiment," or "in some embodiments" appearing throughout the specification do not necessarily refer to the same embodiment. Furthermore, these specific features, structures, or characteristics can be combined in any suitable manner in one or more embodiments. It should be understood that in the various embodiments of this application, the sequence numbers of the above-described processes do not imply a sequential order of execution; the execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application. The sequence numbers of the above-described embodiments are merely for descriptive purposes and do not represent the superiority or inferiority of the embodiments. The descriptions of the various embodiments above tend to emphasize the differences between the various embodiments; their similarities or commonalities can be referred to mutually, and for the sake of brevity, they will not be repeated here.
[0148] In this article, the term "and / or" is merely a description of the relationship between related objects, indicating that there can be three kinds of relationships. For example, object A and / or object B can represent three situations: object A exists alone, object A and object B exist simultaneously, and object B exists alone.
[0149] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.
[0150] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. The embodiments described above are merely illustrative. For example, the division of modules is only a logical functional division, and in actual implementation, there may be other division methods, such as: multiple modules or components can be combined, or integrated into another system, or some features can be ignored or not executed. In addition, the coupling, direct coupling, or communication connection between the various components shown or discussed can be through some interfaces, and the indirect coupling or communication connection between devices or modules can be electrical, mechanical, or other forms.
[0151] The modules described above as separate components may or may not be physically separate. The components shown as modules may or may not be physical modules. They may be located in one place or distributed across multiple network units. Some or all of the modules may be selected to achieve the purpose of this embodiment according to actual needs.
[0152] In addition, each functional module in the various embodiments of this application can be integrated into one processing unit, or each module can be a separate unit, or two or more modules can be integrated into one unit; the integrated modules can be implemented in hardware or in the form of hardware plus software functional units.
[0153] Those skilled in the art will understand that all or part of the steps of the above method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it performs the steps of the above method embodiments. The aforementioned storage medium includes various media that can store program code, such as mobile storage devices, read-only memory (ROM), magnetic disks, or optical disks.
[0154] Alternatively, if the integrated units described above are implemented as software functional modules and sold or used as independent products, they can also be stored in a computer-readable storage medium. Based on this understanding, the technical solutions of the embodiments of this application, or the parts that contribute to related technologies, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause an electronic device to execute all or part of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as mobile storage devices, ROMs, magnetic disks, or optical disks.
[0155] The methods disclosed in the several method embodiments provided in this application can be arbitrarily combined without conflict to obtain new method embodiments.
[0156] The features disclosed in the several product embodiments provided in this application can be arbitrarily combined without conflict to obtain new product embodiments.
[0157] The features disclosed in the several method or device embodiments provided in this application can be arbitrarily combined without conflict to obtain new method or device embodiments.
Claims
1. A method for controlling audio playback, characterized in that, Applied to an audio device, the audio device being communicatively connected to a first device, the first device including a storage compartment for storing the audio device, the method comprising: Receive a target request from the first device or the second device, the target request being used to request the target device to obtain usage rights of the audio device, the target device including at least one of the first device and the second device; According to the target request, the target data transmission channel between the audio device and the target device is set to a usable state; The audio data sent by the target device is received through the target data transmission channel and played.
2. The method according to claim 1, characterized in that, The step of setting the target data transmission channel between the audio device and the target device to a usable state according to the target request includes: Based on the target request, determine whether the target device has obtained permission to use the audio device; If the target device obtains permission to use the audio device, the target data transmission channel between the audio device and the target device is set to a usable state.
3. The method according to claim 2, characterized in that, The step of determining whether the target device has obtained access to the audio device based on the target request includes: Based on the target request and the current playback state of the audio device, it is determined whether the target device has obtained the right to use the audio device. The current playback state includes at least one of the following: the audio device is currently in a state of not playing audio and a state of playing audio.
4. The method according to claim 2, characterized in that, The step of determining whether the target device has obtained access to the audio device based on the target request includes: In the case of multiple target requests, a first confirmation request is sent to the first device to display confirmation interfaces for target requests from different devices through the first device; Receive a first instruction, which is triggered by the user's operation on the first device based on the first confirmation request; Based on the first instruction, determine whether the target device has obtained permission to use the audio device.
5. The method according to claim 3, characterized in that, The audio device receives a target request from the second device, the target device being the second device, which includes devices with a pairing history with the audio device and devices that have established a classic Bluetooth BT connection with the audio device. The step of determining whether the target device has obtained access to the audio device based on the target request and the current playback state of the audio device includes: If the audio device is currently in a state where no audio is being played, the second device is determined to obtain access to the audio device based on the target request.
6. The method according to claim 3, characterized in that, The audio device receives a target request from the first device, where the target device is the first device. The step of determining whether the target device has obtained usage rights to the audio device based on the target request and the current playback state of the audio device includes: If the audio device is currently in a state where no audio is being played, the first device is determined to have access to the audio device based on the target request.
7. The method according to claim 3, characterized in that, The audio device receives a target request from the first device, where the target device is the second device; determining whether the target device has obtained usage rights to the audio device based on the target request and the current playback state of the audio device includes: If the audio device is currently in a state where no audio is being played, the second device is determined to have access to the audio device based on the target request.
8. The method according to claim 3, characterized in that, The target request includes the data type requested for playback, and different data types have different priorities; The step of determining whether the target device has obtained access to the audio device based on the target request and the current playback status of the audio device includes: If the current playback state of the audio device is the state where audio is being played, obtain the data type of the audio being played; If the priority of the data type of the audio being played is lower than the priority of the data type requested to be played in the target request, it is determined that the target device has obtained the right to use the audio device, and the target data transmission channel between the audio device and the target device is set to a usable state; If the priority of the data type of the audio being played is higher than the priority of the data type requested to be played in the target request, it is determined that the device currently using the audio device has the right to use the audio device.
9. The method according to claim 8, characterized in that, The method further includes: If the priority of the data type of the currently playing audio is equal to the priority of the data type requested to be played in the target request, a second confirmation request is sent to the first device. The second confirmation request is used to request the user to confirm whether to allow the target device to obtain the right to use the audio device. Receive a second instruction, which is triggered by a first operation performed by the user on the first device in accordance with the second confirmation request, wherein the first operation instructs the user to allow the target device to obtain access to the audio device; According to the second instruction, it is determined that the target device has obtained the right to use the audio device.
10. The method according to claim 8, characterized in that, The data types include music data and call data, with call data having a higher priority than music data.
11. The method according to claim 1, characterized in that, Before receiving the target request sent by the target device, the method further includes: Complete Bluetooth Low Energy (BLE) pairing and Bluetooth BT pairing with the first device, and complete Bluetooth BT pairing with the second device; When the audio device is detected to be in an unstored state, a BLE connection and a BT connection are established with the first device, and a BT connection is established with the second device. The audio device includes a stored state and an unstored state. The stored state is the state in which the audio device is stored in the storage compartment.
12. The method according to claim 11, characterized in that, The receiving of the target request sent by the target device includes: When the audio device is in a stored state and a target request is received from the target device, a BT connection is established with the target device. When the audio device is in an unstored state and a target request is received from the target device, it is determined whether the target device has obtained permission to use the audio device based on the target request.
13. The method according to claim 12, characterized in that, The method further includes: If the audio device is in the stored state and a BT connection is established with the target device, and it is detected that the audio device is in the unstored state, then it is determined that the target device has obtained the right to use the audio device.
14. The method according to claim 12, characterized in that, The method further includes: If the audio device is in the stored state and has not established a BT connection with any device, and it is detected that the audio device is in the unstored state, then it is determined that the first device has obtained the right to use the audio device.
15. The method according to claim 1, characterized in that, The method further includes: If the audio device is disconnected from the device that is using the audio device, the access rights of the audio device will be switched to the device that last established a BT connection with the audio device.
16. A method for controlling audio playback, characterized in that, Applied to a first device, the first device being communicatively connected to an audio device, the first device including a storage compartment for storing the audio device, the method comprising: A target request is sent to the audio device, the target request being used to request a target device to obtain usage rights to the audio device, the target device including at least one of the first device and the second device.
17. The method according to claim 16, characterized in that, The method further includes: If there are multiple target requests, a first confirmation request is received from the audio device, and confirmation interfaces for target requests from different devices are displayed. Receive user operations on the first device based on the first confirmation request.
18. A control device for audio playback, characterized in that, An audio device is applied to an audio device that is communicatively connected to a first device, the first device including a storage compartment for storing the audio device. The device includes: A receiving module is configured to receive a target request from the first device or the second device, the target request being used to request the target device to obtain usage rights of the audio device, the target device including at least one of the first device and the second device; The setting module is used to set the target data transmission channel between the audio device and the target device to a usable state according to the target request; The processing module is used to receive audio data sent by the target device through the target data transmission channel and play the audio data.
19. A control device for audio playback, characterized in that, Applied to a first device, the first device being communicatively connected to an audio device, the first device including a storage compartment for storing the audio device, the device comprising: A sending module is configured to send a target request to the audio device, the target request being used to request a target device to obtain usage rights to the audio device, the target device including at least one of the first device and the second device.
20. A computer device comprising a memory and a processor, the memory storing a computer program executable on the processor, characterized in that, When the processor executes the program, it implements the steps of the method according to any one of claims 1 to 15 or 16 to 17.
21. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the method as described in any one of claims 1 to 15 or 16 to 17.