CN115175159B - Bluetooth headset playing method and equipment - Google Patents

Bluetooth headset playing method and equipment Download PDF

Info

Publication number
CN115175159B
CN115175159B CN202211081583.6A CN202211081583A CN115175159B CN 115175159 B CN115175159 B CN 115175159B CN 202211081583 A CN202211081583 A CN 202211081583A CN 115175159 B CN115175159 B CN 115175159B
Authority
CN
China
Prior art keywords
electronic device
master
connection
earpiece
earplug
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202211081583.6A
Other languages
Chinese (zh)
Other versions
CN115175159A (en
Inventor
张勇
王福凯
胡晓慧
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Honor Device Co Ltd
Original Assignee
Honor Device Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Honor Device Co Ltd filed Critical Honor Device Co Ltd
Priority to CN202211081583.6A priority Critical patent/CN115175159B/en
Publication of CN115175159A publication Critical patent/CN115175159A/en
Application granted granted Critical
Publication of CN115175159B publication Critical patent/CN115175159B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

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
    • H04RLOUDSPEAKERS, MICROPHONES, GRAMOPHONE PICK-UPS OR LIKE ACOUSTIC ELECTROMECHANICAL TRANSDUCERS; DEAF-AID SETS; PUBLIC ADDRESS SYSTEMS
    • H04R5/00Stereophonic arrangements
    • H04R5/033Headphones for stereophonic communication
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W12/00Security arrangements; Authentication; Protecting privacy or anonymity
    • H04W12/03Protecting confidentiality, e.g. by encryption
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W12/00Security arrangements; Authentication; Protecting privacy or anonymity
    • H04W12/06Authentication
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W56/00Synchronisation arrangements
    • H04W56/001Synchronization between nodes
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W76/00Connection management
    • H04W76/10Connection setup
    • H04W76/14Direct-mode setup

Landscapes

  • Engineering & Computer Science (AREA)
  • Signal Processing (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Computer Security & Cryptography (AREA)
  • Physics & Mathematics (AREA)
  • Acoustics & Sound (AREA)
  • Telephone Function (AREA)

Abstract

The application provides a Bluetooth headset playing method and equipment, which are applied to the technical field of Bluetooth and can solve the problem that when part of headsets are connected with electronic equipment which does not support AG function, the playing sound of the headsets is delayed. The method comprises the following steps: after the main earplug and the electronic equipment establish an asynchronous connection-oriented ACL link, the main earplug receives an advanced audio distribution configuration file A2DP connection request from the electronic equipment; in response to the A2DP connection request, the main earpiece establishes an A2DP connection with the electronic device; after the master earplug and the slave earplug are connected, the master earplug judges whether the electronic equipment supports the AG function; if the master earplug determines that the electronic equipment does not support the AG function, the master earplug sends first connection information of A2DP connection to the slave earplug; the first connection information is used for monitoring and playing data transmitted to the main earplug by the electronic equipment through A2DP connection from the earplug; the main earphone receives and plays the audio data sent by the electronic equipment through the A2DP connection.

Description

Bluetooth headset playing method and equipment
Technical Field
The present application relates to the field of bluetooth technologies, and in particular, to a method and an apparatus for playing a bluetooth headset.
Background
A True Wireless Stereo (TWS) earphone is an intelligent wearable product produced by applying TWS technology to the field of Bluetooth earphones. The basic working principle of the TWS earphone is that the electronic equipment is connected with a main earplug, and then the main earplug is connected with a slave earplug in a Bluetooth wireless mode to form a stereo system, so that real Bluetooth left and right sound channels are separated wirelessly for use.
Generally, in the process of actively connecting the TWS headset, the electronic device needs to establish each bluetooth protocol connection with the main earpiece of the TWS headset in turn. The master earpiece of some TWS headsets will synchronize data with the slave earpiece only after all basic bluetooth protocol connections are established with the electronic device. Instead of synchronizing directly with the slave earpiece, the master earpiece typically waits for a period of time before such earpieces establish all of the underlying bluetooth protocol connections with the electronic device.
However, some do not support an electronic device that is an Audio Gateway (AG) device connected as a Hands Free Profile (HFP) without actively sending an HFP connection request to the master earpiece. In this scenario, the primary earpiece may wait for an HFP connection request from the electronic device for a period of time during which the TWS headset will not play audio data if the electronic device transmits the audio data to the primary earpiece. This situation causes a delay for the user in the TWS headset playing the sound.
Disclosure of Invention
The embodiment of the application provides a Bluetooth headset playing method and equipment, which are used for solving the problem that when part of headsets are connected with electronic equipment which does not support an AG function, the playing sound of the headsets is delayed.
In order to achieve the above purpose, the embodiments of the present application adopt the following technical solutions:
in a first aspect, a method for playing a bluetooth headset is provided, which is applied to a TWS headset, the TWS headset includes a master earplug and a slave earplug; the method comprises the following steps:
after the master ear bud establishes an asynchronous connection-oriented ACL link with the electronic device, the master ear bud receives an A2DP connection request from the electronic device; in response to the A2DP connection request, the main earpiece establishes an A2DP connection with the electronic device. The master earpiece establishes a connection with the slave earpiece and then the master earpiece determines whether the electronic device supports the audio gateway AG function. If not, the master earplug sends the first connection information of the A2DP connection to the slave earplug. The master earpiece then receives and plays the audio data sent by the electronic device over the A2DP connection. The slave ear plug can also monitor the A2DP connection according to the first connection information, and receive and play audio data sent by the electronic device to the master ear plug through the A2DP connection.
Thus, if the electronic device does not support the AG function, the master earplug may send connection information of the A2DP connection to the slave earplug after establishing the A2DP connection with the electronic device, and may play audio data sent by the electronic device through the A2DP connection; instead of playing the audio data from the electronic device after waiting for the HFP connection request from the electronic device for a while, the waste of time caused by the waiting of the main earpiece and the possibility of the TWS headset playing sound being delayed can be avoided.
In a possible embodiment, if the master earpiece determines that the electronic device does not support the AG function, the master earpiece sends the first connection information of the A2DP connection to the slave earpiece, which may specifically be: if the master earplug determines that the electronic device does not support the AG function, the master earplug directly sends first connection information of A2DP connection to the slave earplug without waiting for a hands-free profile HFP connection request of the electronic device; wherein the HFP connection request is for the electronic device to establish an HFP connection with the primary earpiece.
In this way, if the electronic device does not support the AG function, the master earpiece transmits the connection information of the A2DP connection to the slave earpiece after establishing the A2DP connection with the electronic device, which can avoid the waste of time caused by the master earpiece waiting for the HFP connection request of the electronic device and the possibility of delay of the TWS headset playing sound.
In some possible embodiments, the method further comprises: if the master earpiece determines that the electronic device supports the AG functionality, the master earpiece waits for a preset period of time. If the main earphone receives the HFP connection request from the electronic device within the preset time period, the main earphone and the electronic device are connected with HFP. After the master ear plug is connected with the electronic device in HFP, the master ear plug sends first connection information and second connection information of HFP connection to the slave ear plug; the master ear-bud receives and plays audio data sent by the electronic device over the HFP connection. The slave ear-bud can also listen and play the data transmitted by the electronic device to the master ear-bud through the HFP connection according to the second connection information.
Therefore, when the electronic equipment plays audio data through the TWS earphone, the master earplug and the slave earplug can be ensured to play synchronously, and the condition that only one earplug has sound or the sound of the two earplugs is not synchronous is avoided.
In some possible embodiments, the main earpiece determines whether the electronic device supports the audio gateway AG function, which may specifically be: the master earplug sends a query request to the electronic equipment; the master earpiece receives inquiry response information from the electronic device and determines whether the electronic device supports the AG function according to the inquiry response information. Wherein the query request is used for querying whether the electronic device supports the AG function. In this way, the electronic device is actively queried by the master earpiece as to whether the AG function is supported, so that the master earpiece determines whether to send connection information to the slave earpiece after establishing an A2DP connection with the electronic device according to whether the electronic device supports the AG function.
In some possible embodiments, the main earpiece determines whether the electronic device supports the audio gateway AG function, which may specifically be: the master earpiece receiving device identification information from the electronic device; the master earpiece determines whether the electronic device supports AG functionality from the device identification information. In this way, the master earpiece may determine whether the electronic device supports the AG function according to the device identification information transmitted by the electronic device, so that the master earpiece determines whether to transmit the connection information to the slave earpiece after establishing the A2DP connection with the electronic device according to whether the electronic device supports the AG function.
In some possible embodiments, the method further comprises: if the main earpiece receives audio data from the electronic device through the A2DP connection before receiving the HFP connection within the preset time period, the main earpiece does not play the audio data. Wherein if the master earpiece determines that the electronic device supports the AG function, the master earpiece may wait for a preset time period; it is determined whether an HFP connection request from the electronic apparatus is received for a preset period of time. The first connection information and the HFP connected second connection information are transmitted to the slave ear set if the master ear set receives the HFP connection request from the electronic device for a preset time period. Thus, in this embodiment, the master ear-bud does not synchronize the first connection information to the slave ear-bud before the master ear-bud receives the HFP connection within the preset time period. In this way, if the master ear-set receives and plays the audio data before receiving the HFP connection request within the preset time period, the slave ear-set cannot listen to the audio data and play the audio data according to the first connection information.
By adopting the embodiment, the synchronous playing of the master earplug and the slave earplug can be ensured when the electronic equipment plays audio data through the TWS earphone, and the condition that only one earplug has sound or the sound of the two earplugs is not synchronous can be avoided.
In a second aspect, a bluetooth headset playing method is provided, where the method is applied to an electronic device, and the method includes: after establishing an ACL link with a main earplug of the TWS earphone, the electronic equipment sends an A2DP connection request to the main earplug, wherein the A2DP connection request is used for requesting to establish an A2DP connection with the main earplug; the electronic device sends device identification information to the master earplug; the equipment identification information is used for the main earplug to determine whether the electronic equipment supports the AG function or not according to the equipment identification information; the method comprises the steps that whether the electronic equipment supports an AG function or not is used for determining whether to synchronize first connection information of A2DP connection to a slave earplug after a hands-free profile HFP connection request from the electronic equipment is received or not after the A2DP connection is established between a master earplug and the electronic equipment; wherein the first connection information is used for the slave ear plugs to listen and play data transmitted by the electronic device to the master ear plug through the A2DP connection.
And if the electronic equipment does not support the AG function, the electronic equipment actively sends equipment identification information to the main earplug so as to inform the main earplug that the electronic equipment does not support the AG function. This avoids the waste of time caused by the waiting of the main earpiece and the possibility of delays in the TWS earpiece playing sound.
In a third aspect, there is provided a true wireless stereo TWS headset, the TWS headset comprising a master earpiece and a slave earpiece, the master earpiece comprising: the device comprises a processor, a memory, a Bluetooth module, a receiver and a microphone; the memory, the Bluetooth module, the receiver and the microphone are coupled with the processor; the memory has stored therein computer program code comprising computer instructions which, when executed by the processor, cause the master ear plug to perform the bluetooth headset playing method of any of the possible embodiments of the first aspect described above.
In a fourth aspect, an electronic device is provided, comprising: a processor and a memory; the memory is configured to store computer-executable instructions, and when the electronic device is running, the processor executes the computer-executable instructions stored in the memory, so as to enable the electronic device to execute the bluetooth headset playing method in any one of the possible embodiments of the second aspect.
In a fifth aspect, a computer-readable storage medium is provided, which stores instructions that, when executed on a computer, enable the computer to execute the bluetooth headset playing method of any one of the above first aspects.
A sixth aspect provides a computer program product containing instructions which, when run on an electronic device, enable the electronic device to perform the bluetooth headset playing method of any of the above first aspects.
In a seventh aspect, an apparatus (e.g., the apparatus may be a system-on-a-chip) is provided, which includes a processor for enabling an electronic device to implement the functions referred to in the first aspect, such as bluetooth headset playing. In one possible design, the apparatus further includes a memory for storing program instructions and data necessary for the electronic device. When the device is a chip system, the device may be composed of a chip, or may include a chip and other discrete devices.
For technical effects brought by any one of the design manners in the fourth aspect to the seventh aspect, reference may be made to technical effects brought by different design manners in the first aspect, and details are not described here.
Drawings
Fig. 1 is a schematic structural diagram of a communication system according to an embodiment of the present application;
fig. 2 is a schematic flowchart of a bluetooth headset playing method in the related art;
FIG. 3 is a schematic structural diagram of an earplug of a TWS earphone according to an embodiment of the present application;
FIG. 4 is a schematic diagram illustrating an example product form of a TWS headset according to an embodiment of the present application;
fig. 5 is a schematic structural diagram of an electronic device according to an embodiment of the present application;
fig. 6 is a schematic flowchart of a bluetooth headset playing method according to an embodiment of the present application;
fig. 7 is a schematic flowchart of another bluetooth headset playing method according to an embodiment of the present application;
fig. 8 is a schematic flowchart of another bluetooth headset playing method according to an embodiment of the present application;
fig. 9 is a schematic flowchart of another bluetooth headset playing method according to an embodiment of the present application;
fig. 10 is a schematic structural diagram of a chip system according to an embodiment of the present disclosure.
Detailed Description
The method comprises the steps that only a main earplug of a TWS earphone is connected with electronic equipment through Bluetooth, and after the main earplug is connected with the electronic equipment through the Bluetooth, connection information of the established Bluetooth connection is obtained. After the connection between the master ear piece and the slave ear piece is established, connection information of the bluetooth connection established between the master ear piece and the electronic device is transmitted to the slave ear piece by the master ear piece. Therefore, the slave earplug can monitor and play the audio data sent to the master earplug by the slave electronic equipment through the Bluetooth connection according to the connection information. As shown in fig. 1, the TWS headset 10 includes a master earpiece 11 and a slave earpiece 12. Wherein the master earpiece 11 can establish a connection with the slave earpiece 12, and the master earpiece 11 can also establish a bluetooth connection with the electronic device 20.
Generally, when the electronic device is actively connected to a main earpiece of a TWS headset, after the electronic device establishes an Asynchronous Connection Link (ACL) with the main earpiece, it needs to establish respective basic bluetooth protocol connections with the main earpiece in turn, such as an advanced audio distribution profile (A2 DP) connection, an HFP connection, and the like. For the master earpiece of some TWS headsets, the connection information between the electronic device and the master earpiece is typically sent to the slave earpiece only after all the underlying bluetooth protocol connections to be established with the electronic device have been successfully established. Before the master earplug successfully establishes all the basic bluetooth protocol connections with the electronic device, the master earplug waits for a period of time (such as a preset time period), and if all the bluetooth protocol connections to be established are not successfully established within the preset time period, the master earplug sends connection information of the established bluetooth connections between the master earplug and the electronic device to the slave earplug after the preset time period is over. That is, in the embodiments of the present application, the master earpiece of the TWS headset needs to satisfy the requirement that the connection information of the established connection is synchronized to the slave earpiece after each basic bluetooth protocol connection is established with the electronic device.
If the electronic device does not establish all the basic bluetooth protocol connections with the master ear plug within the preset time period, the master ear plug receives the audio data sent by the electronic device through the established bluetooth protocol connections, and the audio data will not be played. But rather, the audio data from the electronic device will be played after all the underlying bluetooth protocol connections have been established, or after a preset period of time, after sending connection information of the bluetooth connection that the master earpiece has established with the electronic device to the slave earpiece. Thus, for an electronic device that does not support AG functionality, if audio data is sent to the primary earpiece for the preset period of time described above, the user will hear the TWS headset delayed playing sound.
Exemplary electronic devices may be cell phones, tablet computers, desktop, laptop, handheld computers, notebook computers, smart watches, ultra-mobile personal computers (UMPCs), netbooks, and cellular phones, personal Digital Assistants (PDAs), augmented Reality (AR) \ Virtual Reality (VR) devices, media players, televisions, and the like.
Illustratively, the primary earpiece 11 by default requires all basic bluetooth protocol connections established with the electronic device 20, including A2DP connections and HFP connections.
For an electronic device 20 that supports an AG device in HFP connection, such as a mobile phone having a call function and a media playing function, after establishing an ACL link with the master ear plug 11, the mobile phone typically actively transmits an A2DP connection request and an HFP connection request to the master ear plug. The master ear plug 11 establishes A2DP connection and HFP connection with the cellular phone after receiving the A2DP connection request and HFP connection request from the cellular phone, respectively. At this time, the master ear plug 11 considers that all the basic bluetooth protocol connections are established with the cellular phone, and the master ear plug 11 transmits connection information of the A2DP connection and the HFP connection to the slave ear plug 12. Then, the master earphone 11 and the slave earphone 12 can receive and play the audio data transmitted from the mobile phone to the master earphone 11 through the above-mentioned A2DP connection and/or HFP connection. In this way, the sound heard by the user through the TWS headset is not delayed.
For some electronic devices that do not support AG devices in HFP connection (i.e., do not support AG functionality), such as smartwatches that do not support AG functionality, the HFP connection request is not sent to the primary earpiece of the TWS headset while such smartwatches are actively connected to the TWS headset.
Taking the above-mentioned electronic device 20 as an example of a smart watch that does not support AG functions, as shown in fig. 2, after the ACL link is established between the smart watch and the master earplug, the authentication between the smart watch and the master earplug is encrypted. Then the smart watch sends an A2DP connection request to the main earplug, and the main earplug and the smart watch establish an A2DP connection. In this embodiment, since the smart watch does not support the AG function, the smart watch does not transmit the HFP connection request to the master ear plug. Whereas in the related art, the master earplug waits for a predetermined period of time (e.g., 10 s). After 10s the master ear bud still does not receive the HFP connection request from the smart watch, the master ear bud sends the connection information of the established A2DP connection to the slave ear bud after establishing the connection with the slave ear bud. It will be appreciated that if the smart watch sends audio data to the master earpiece within the above 10s, the master earpiece will not play the audio data in synchronization with the slave earpiece until 10s has ended and the connection information of the A2DP connection is sent to the slave earpiece. In this way, the sound heard by the user through the TWS headset is delayed.
Based on this, the application provides a bluetooth headset playing method, which is applied to a TWS headset. Wherein, the main earphone of the TWS earphone is connected with the electronic equipment after establishing ACL link and A2 DP. After the master earplug establishes a connection with the slave earplug, the master earplug determines whether the electronic device supports the AG function. If yes, the master earplug sends connection information of the A2DP connection to the slave earplug, and the connection information is used for the slave earplug to monitor and play data transmitted to the master earplug by the electronic device through the A2DP connection. In addition, the master ear bud receives and plays audio data from the electronic device sent over the A2DP connection.
In the technical scheme provided by the application, when receiving a connection request from an electronic device, a master earplug determines whether the electronic device supports an AG function, and if it is determined that the electronic device does not support the AG function, the master earplug sends connection information of the established A2DP connection to a slave earplug after establishing a connection with the slave earplug. Therefore, the problem that when the electronic equipment does not support the AG function, the main earplug delays the playing sound of the TWS earphone due to waiting for the preset time period can be avoided.
Please refer to fig. 3, which is a schematic structural diagram of an earplug (a master earplug or a slave earplug) of a TWS earphone according to an embodiment of the present application. As shown in fig. 3, the earplugs of the TWS headset may include: a processor 301, a memory 302, a sensor 303, a wireless communication module 304, at least one microphone 305, at least one microphone 306, and a power source 307.
The memory 302 may be used, among other things, to store application code, such as for establishing a bluetooth connection with another earpiece of a TWS headset, and for enabling pairing of the earpiece with the electronic device 20 as described above. The processor 301 may control execution of the above-mentioned application program code to implement the functionality of the earpieces of the TWS headset in the embodiments of the present application.
The memory 302 may also have stored therein a bluetooth address for uniquely identifying the earpiece and a bluetooth address of another earpiece of the TWS headset. In addition, the memory 302 may also store connection data with an electronic device that the earplug has successfully paired before. For example, the connection data may be a bluetooth address of the electronic device that was successfully paired with the earpiece. Based on the connection data, the ear bud can be automatically paired with the electronic device without having to configure a connection therewith, such as for legitimacy verification or the like. The bluetooth address may be a Media Access Control (MAC) address.
The sensor 303 may be a distance sensor or a proximity light sensor. The processor 301 of the ear bud may determine whether it is being worn by the user via the sensor 303. For example, the processor 301 of the ear bud may determine whether the ear bud is being worn by the user by using a proximity light sensor to detect whether an object is near the ear bud. Upon determining that the earpiece is worn, the processor 301 of the earpiece may turn on the receiver 305. In some embodiments, the earplug may further include a bone conduction sensor incorporated into a bone conduction earpiece. The bone conduction sensor can acquire a vibration signal of a vibration bone block of a sound part, and the processor 301 analyzes the voice signal to realize a control function corresponding to the voice signal. In other embodiments, the ear tip may further comprise a touch sensor or a pressure sensor for detecting a touch operation and a press operation of the user, respectively. In other embodiments, the ear bud may further include a fingerprint sensor for detecting a user's fingerprint, identifying the user's identity, and the like. In other embodiments, the earplug may further comprise an ambient light sensor, and the processor 301 of the earplug may adaptively adjust parameters, such as volume, according to the brightness of the ambient light sensed by the ambient light sensor.
A wireless communication module 304 for supporting short-range data interaction between two earpieces of the TWS headset, and between the earpieces and various electronic devices, such as the electronic device 20 described above. In some embodiments, the wireless communication module 304 may be a bluetooth transceiver. The earplugs of the TWS headset may establish a bluetooth connection with the electronic device 20 via the bluetooth transceiver to enable short-range data interaction therebetween.
The receiver 305, which may also be referred to as a "handset," may be used to convert audio electrical signals into sound signals and play them. For example, when the earpieces of the TWS headset are used as the audio output device of the electronic device 20, the receiver 305 may convert the received audio electric signal into a sound signal and play the sound signal.
The microphone 306, which may also be referred to as a "microphone," is used to convert sound signals into electrical audio signals. For example, when the earpieces of the TWS headset are used as the audio input device of the electronic device 20, the microphone 306 may capture the user's voice signal and convert it to an audio electrical signal when the user speaks (e.g., speaks or sends a voice message). The audio electrical signal is audio data in the embodiment of the present application.
A power supply 307 may be used to supply power to the various components contained in the earplugs of the TWS headset. In some embodiments, the power source 307 may be a battery, such as a rechargeable battery.
Typically, a TWS headset will be equipped with a headset case (e.g., 401 shown in fig. 4). As shown in fig. 4, the earphone box 401 may include a cavity 401-1 and a box cover 401-2. The cavity 401-1 may be used to receive two earplugs of a TWS headset. As shown in fig. 4 in conjunction with fig. 1, the cavity 401-1 of the earphone box 401 may be used to house the master and slave earpieces 11, 12 of the TWS earphone. In addition, the headset case 401 may also charge both earpieces of the TWS headset. Accordingly, in some embodiments, the above TWS headset earplugs may further comprise: an input/output interface 308.
The input/output interface 308 may be used to provide any wired connection between the earplugs of the TWS headset and a headset case, such as the cavity 401-1 of the headset case 401 described above. In some embodiments, the input/output interface 308 may be an electrical connector. For example, when the earplugs of the TWS headset are disposed in the cavity 401-1 of the headset case 401, the earplugs of the TWS headset may be electrically connected to the headset case 401 (e.g., to the input/output interface of the headset case 401) via the electrical connector. After this electrical connection is established, the headset case 401 may charge the power supply 307 of the earplugs of the TWS headset. The earpieces of the TWS headset may also be in data communication with the headset case 401 after the electrical connection is established. For example, the processor 401 of the earpieces of the TWS headset may receive pairing instructions from the headset case 401 over the electrical connection. The pairing command is used to instruct the processor 401 of the earpieces of the TWS headset to turn on the wireless communication module 304 so that the earpieces of the TWS headset may be paired with the electronic device 20 using a corresponding wireless communication protocol, such as bluetooth.
Of course, the earplugs of the TWS headset described above may also not include the input/output interface 308. In this case, the ear bud may implement a charging or data communication function based on the bluetooth connection established with the earphone box 401 through the above-described wireless communication module 304.
Additionally, in some embodiments, the earphone cartridges (e.g., earphone cartridge 401 described above) may also include a processor, memory, etc. The memory may be used to store application program code and be controlled to be executed by the processor of the headset case 401 to implement the functionality of the headset case 401. For example. When the user opens the lid 401-2 of the earphone box 401, the processor of the earphone box 401 may send a pairing command or the like to the earplugs of the TWS headset in response to the user opening the lid 401-2 by executing application code stored in the memory.
It is to be understood that the illustrated structure of the embodiments of the present application does not constitute a specific limitation of the earplug of the TWS headset. It may have more or fewer components than shown in fig. 3, may combine two or more components, or may have a different configuration of components. For example, the earplug may further include an indicator light (which may indicate the status of the earplug, such as power), a dust screen (which may be used with the earpiece), and the like. The various components shown in fig. 3 may be implemented in hardware, software, or a combination of hardware and software, including one or more signal processing or application specific integrated circuits.
It should be noted that the left and right earplugs of the TWS headset may be identical in structure. For example, both the left and right earplugs of a TWS headset may include the components shown in FIG. 3. Alternatively, the left and right earplugs of the TWS headset may be of different configurations. For example, one earpiece (e.g., the right earpiece) of a TWS headset may include the components shown in FIG. 3, while another earpiece (e.g., the left earpiece) may include other components in FIG. 3 in addition to the microphone 306.
Fig. 5 is a schematic structural diagram of an electronic device 100 according to an embodiment of the present disclosure. The electronic device 100 may be the electronic device 20 described above. As shown in fig. 5, the electronic device 100 may include: the mobile terminal includes a processor 110, an internal memory 120, a Universal Serial Bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, a display screen 180, a sensor module 190, and the like.
It is to be understood that the illustrated structure of the embodiment of the present application does not specifically limit the electronic device 20. In other embodiments of the present application, the electronic device 20 may include more or fewer components than shown, or combine certain components, or split certain components, or a different arrangement of components. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
Processor 110 may include one or more processing units, such as: the processor 110 may include an Application Processor (AP), a modem processor, a Graphics Processing Unit (GPU), an Image Signal Processor (ISP), a controller, a memory, a video codec, a Digital Signal Processor (DSP), a baseband processor, and/or a neural-Network Processing Unit (NPU), etc. The different processing units may be separate devices or may be integrated into one or more processors.
The controller may be, among other things, a neural center and a command center of the electronic device 20. The controller can generate an operation control signal according to the instruction operation code and the timing signal to complete the control of instruction fetching and instruction execution.
A memory may also be provided in processor 110 for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may hold instructions or data that have just been used or recycled by the processor 110.
In some embodiments, processor 110 may include one or more interfaces. The interface may include an integrated circuit (I2C) interface, an integrated circuit built-in audio (I2S) interface, a Pulse Code Modulation (PCM) interface, a universal asynchronous receiver/transmitter (UART) interface, a mobile industry processor interface (mobile industry processor interface, MIPI), a general-purpose-input/output (GPIO) interface, a Subscriber Identity Module (SIM) interface, and/or a Universal Serial Bus (USB) interface, etc.
It should be understood that the interface connection relationship between the modules illustrated in the present embodiment is only an exemplary illustration, and does not constitute a structural limitation for the electronic device 20. In other embodiments, the electronic device 20 may also adopt different interface connection manners or a combination of interface connection manners in the above embodiments.
The charging management module 140 is configured to receive a charging input from a charger. The charging management module 140 may also supply power to the electronic device through the power management module 141 while charging the battery 142.
The power management module 141 is used to connect the battery 142, the charging management module 140 and the processor 110. The power management module 141 receives input from the battery 142 and/or the charge management module 140 and provides power to the processor 110, the internal memory 120, the external memory, the display 180, the camera 192, the wireless communication module 160, and the like. The power management module 141 may also be used to monitor parameters such as battery capacity, battery cycle count, battery state of health (leakage, impedance), etc. In other embodiments, the power management module 141 may be disposed in the processor 110. In other embodiments, the power management module 141 and the charging management module 140 may be disposed in the same device.
The wireless communication function of the electronic device 20 may be implemented by the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, a modem processor, a baseband processor, and the like.
The antennas 1 and 2 are used for transmitting and receiving electromagnetic wave signals. The mobile communication module 150 may provide a solution including 2G/3G/4G/5G wireless communication applied on the electronic device 20. The mobile communication module 150 may include at least one filter, a switch, a power amplifier, a Low Noise Amplifier (LNA), and the like. The mobile communication module 150 may receive the electromagnetic wave from the antenna 1, filter, amplify, etc. the received electromagnetic wave, and transmit the electromagnetic wave to the modem processor for demodulation. The mobile communication module 150 may also amplify the signal modulated by the modem processor, and convert the signal into electromagnetic wave through the antenna 1 to radiate the electromagnetic wave. In some embodiments, at least some of the functional modules of the mobile communication module 150 may be disposed in the processor 110. In some embodiments, at least some of the functional modules of the mobile communication module 150 may be provided in the same device as at least some of the modules of the processor 110.
The modem processor may include a modulator and a demodulator. In some embodiments, the modem processor may be a stand-alone device. In other embodiments, the modem processor may be provided in the same device as the mobile communication module 150 or other functional modules, independent of the processor 110.
The wireless communication module 160 may provide a solution for wireless communication applied to the electronic device 20, including Wireless Local Area Networks (WLANs) (e.g., wireless fidelity (Wi-Fi) networks), bluetooth (BT), global Navigation Satellite System (GNSS), frequency Modulation (FM), NFC, infrared (IR), and the like. The wireless communication module 160 may be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, performs frequency modulation and filtering processing on electromagnetic wave signals, and transmits the processed signals to the processor 110. The wireless communication module 160 may also receive a signal to be transmitted from the processor 110, perform frequency modulation and amplification on the signal, and convert the signal into electromagnetic waves through the antenna 2 to radiate the electromagnetic waves.
In some embodiments, antenna 1 of electronic device 20 is coupled to mobile communication module 150 and antenna 2 is coupled to wireless communication module 160 so that electronic device 20 can communicate with networks and other devices via wireless communication techniques. The wireless communication technology may include global system for mobile communications (GSM), general Packet Radio Service (GPRS), code Division Multiple Access (CDMA), wideband Code Division Multiple Access (WCDMA), time division code division multiple access (time-division multiple access, TD-SCDMA), long term evolution (long term evolution, LTE), BT, GNSS, WLAN, NFC, FM, and/or IR technologies, among others. GNSS may include Global Positioning System (GPS), global navigation satellite system (GLONASS), beidou satellite navigation system (BDS), quasi-zenith satellite system (QZSS), and/or Satellite Based Augmentation System (SBAS). For example, in the embodiment of the present application, the electronic device 20 may utilize the wireless communication module 160 to establish a bluetooth connection with the tablet pc 3 through a wireless communication technology, such as Bluetooth (BT). Based on the established bluetooth connection, the electronic device 20 may send audio data to the tablet pc 3 and may also receive audio data from the tablet pc 3. For another example, in the embodiment of the present application, the electronic device 20 may further utilize the wireless communication module 160 to establish a Wi-Fi connection with the tablet computer 3 through a wireless communication technology, such as a Wireless Local Area Network (WLAN). Based on the established Wi-Fi connection, electronic device 20 may send audio data to tablet computer 3 and receive audio data from tablet computer 3.
The electronic device 20 implements display functions via the GPU, the display screen 180, and the application processor, etc. The GPU is a microprocessor for image processing, connected to the display screen 180 and the application processor. The processor 110 may include one or more GPUs that execute program instructions to generate or alter display information.
The display screen 180 is used to display images, video, and the like. The display screen 180 includes a display panel. The display panel may adopt a Liquid Crystal Display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (active-matrix organic light-emitting diode, AMOLED), a flexible light-emitting diode (FLED), a miniature, a Micro-oeld, a quantum dot light-emitting diode (QLED), and the like. In some embodiments, the electronic device 20 may include 1 or N display screens 180, N being a positive integer greater than 1.
Internal memory 120 may be used to store computer-executable program code, which includes instructions. The processor 110 executes various functional applications of the electronic device 20 and data processing by executing instructions stored in the internal memory 120. For example, in the embodiment of the present application, the processor 110 may establish a bluetooth connection with the tablet pc 3 through the wireless communication module 160 by executing the instructions stored in the internal memory 120, and perform short-distance data interaction with the tablet pc 3, so as to implement functions such as conversation through the tablet pc 3. The internal memory 120 may include a program storage area and a data storage area. The storage program area may store an operating system, an application program (such as a sound playing function, an image playing function, etc.) required by at least one function, and the like. The data storage area may store data created during use of the electronic device 20 (e.g., audio data, a phonebook, etc.), and the like. In addition, the internal memory 120 may include a high speed random access memory, and may also include a non-volatile memory, such as at least one magnetic disk storage device, a flash memory device, a Universal Flash Storage (UFS), and the like. In the embodiment of the present application, after the electronic device 20 establishes the bluetooth connection with the tablet pc 3 by using the wireless communication technology, such as bluetooth, the electronic device 20 may store the bluetooth address of the tablet pc 3 in the internal memory 120.
The electronic device 20 may implement audio functions through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, and the application processor. Such as music playing, recording, etc.
The audio module 170 is used to convert digital audio information into an analog audio signal output and also to convert an analog audio input into a digital audio signal. The audio module 170 may also be used to encode and decode audio signals. In some embodiments, the audio module 170 may be disposed in the processor 110, or some functional modules of the audio module 170 may be disposed in the processor 110.
The speaker 170A, also called a "horn", is used to convert the audio electrical signal into an acoustic signal. The electronic device 20 can listen to music through the speaker 170A or listen to a hands-free conversation.
The receiver 170B, also called "earpiece", is used to convert the electrical audio signal into an acoustic signal. When the electronic device 20 receives a call or voice information, it can receive the voice by placing the receiver 170B close to the ear of the person.
The microphone 170C, also referred to as a "microphone," is used to convert sound signals into electrical signals. When making a call or sending voice information, the user can input a voice signal to the microphone 170C by uttering a voice signal close to the microphone 170C through the mouth of the user. The electronic device 20 may be provided with at least one microphone 170C. In other embodiments, the electronic device 20 may be provided with two microphones 170C to achieve noise reduction functions in addition to collecting sound signals. In other embodiments, the electronic device 20 may further include three, four or more microphones 170C to collect sound signals, reduce noise, identify sound sources, perform directional recording, and so on.
The sensor module 190 may include a pressure sensor, a gyroscope sensor, an air pressure sensor, a magnetic sensor, an acceleration sensor, a distance sensor, a proximity light sensor, a fingerprint sensor, a temperature sensor, a touch sensor, an ambient light sensor, a bone conduction sensor, and the like.
The bluetooth headset playing method in the following embodiments may be implemented in the earpiece or the electronic device 100 of the TWS headset having the above hardware structure.
The playing method of the Bluetooth headset provided by the application can be applied to a TWS headset 10, wherein the TWS headset 10 comprises a master earplug 11 and a slave earplug 12. When the TWS headset 10 establishes a connection with the electronic device 20, only the primary earpiece 11 is directly connected with the electronic device 201. After the connection between the master ear-bud 11 and the electronic device 20 is established, connection information of the established connection between the master ear-bud 11 and the electronic device 20 is transmitted to the slave ear-bud 12. The slave ear bud 12 monitors the connection between the master ear bud 11 and the electronic device 20 according to the received connection information, and acquires and plays the audio data transmitted by the electronic device 20 through the connection. Also, in the related art, the master earpiece 11 of the TWS headset 10 described above transmits the connection information to the slave earpiece 12 by default after the A2DP connection and the HFP connection are established with the electronic device 20.
In the playing method of the bluetooth headset provided by the application, after the A2DP connection is established between the master earphone and the electronic device, and after the connection is established between the master earphone and the slave earphone, it is determined whether the electronic device supports HFP connection. If it is determined that the electronic device 20 does not support the AG function, the master earpiece 11 will directly transmit the connection information of the currently established A2DP connection to the slave earpiece 12 without waiting for the HFP connection request from the electronic device 20. In this way, it is possible to avoid the problem that the main earpiece 11 waits for the HFP connection request from the electronic device 20 when the electronic device 20 does not support the AG function, resulting in a waste of time and possibly causing a delay in the playback sound of the headphone.
Technical words that may be involved in the embodiments of the present application are explained below.
ACL is an asynchronous connection-oriented link, mainly used for packet data transfer, through which bluetooth operation commands are transmitted. The bluetooth communication between the TWS headset and the electronic device first needs to establish a physical connection, and in this embodiment of the present application, the physical connection established between the TWS headset and the electronic device is an ACL link.
A2DP is a bluetooth audio application protocol that specifies protocols and procedures for high quality audio distribution over ACL channels. Based on the A2DP connection, stereo audio data, such as high-quality music, can be transmitted between two Bluetooth devices in a Bluetooth mode to achieve high definition of sound.
HFP is a bluetooth telephony service protocol. The method adds some expansion functions on the basis of a cell phone configuration file (HSP), and can enable the vehicle-mounted hand-free device to control the cell phone, such as answering a call, hanging up the call, rejecting the call, dialing a voice and the like. HFP can also be used in scenarios where a personal computer is used as an output device, such as a speaker, of a cell phone.
The HFP connection of the mobile phone is specifically divided into two roles of AG and HF, wherein: the AG is an audio device input/output gateway, such as a mobile phone, a tablet computer, and the like. HF, hands Free, as an audio gateway remote input output device and may provide remote control functions such as bluetooth car, bluetooth headset, etc.
The serial linear simulation Protocol (RFCOMM) provides serial (9-pin RS 232) simulation based on the Logical Link Control and Adaptation Protocol (L2 CAP). A communication connection between two bluetooth devices can be supported while maintaining up to 60 channels. The purpose of RFCOMM is to guarantee a complete communication path between applications on two different devices.
The present embodiment takes the electronic device 20 actively connected to the main earpiece 11 of the TWS headset 10 as an example, and describes a process of establishing an ACL link between the electronic device 20 and the main earpiece 11. After the electronic device 20 and the master earpiece 11 both start the bluetooth function, the electronic device 20 may start paging the master earpiece 11 in a frequency hopping manner. The master earpiece 11 will scan for external pages at regular intervals. The page is responded to when the master earpiece 11 scans for an external page from the electronic device 20. In this way, an ACL link can be established between the electronic device 20 and the main earpiece 11. The electronic device 20 may start paging the master ear plug 11 after the ACL connection request is triggered by the user, or may start paging the master ear plug 11 automatically after the bluetooth function is activated by the electronic device 20. Further, in some possible embodiments, after the ACL link is first established between the electronic device 20 and the main earpiece 11, both electronic devices may automatically connect when they are within a certain range and bluetooth enabled.
Fig. 6 is a schematic flow chart of a bluetooth headset playing method according to an embodiment of the present application. The method is applied to a TWS headset comprising a master earpiece and a slave earpiece. The method includes S600-S610. Wherein:
s600. The master ear piece 11 establishes an ACL link with the electronic device.
The specific procedure for establishing the ACL link between the main earpiece 11 and the electronic device 20 can be described above for the ACL link, and is not described herein again.
After the ACL link is established between the main earpiece 11 and the electronic device 20, authentication encryption is also performed between the main earpiece 11 and the electronic device 20.
S601. The electronic device 20 sends an A2DP connection request to the master ear bud 11.
S602. The master ear bud 11 receives an A2DP connection request from the electronic device 20.
After establishing the ACL link between the master ear piece 11 and the electronic device 20, the electronic device 20 may send an A2DP connection request to the master ear piece 11 over the ACL link.
S603. In response to the A2DP connection request, the main earpiece 11 establishes an A2DP connection with the electronic device 20.
In some embodiments, after the main earpiece 11 establishes the A2DP connection with the electronic device 20, connection information of the A2DP connection may be acquired.
S604. The master 11 and slave 12 earplugs establish a connection.
It should be noted that the connection between the master earplug 11 and the slave earplug may be performed before S600.
In some embodiments, a bluetooth connection may be established between the master 11 and slave 12 earpieces.
Further, after S604, i.e., after the connection between the master earplug 11 and the slave earplug 12 is established, the master earplug 11 may perform S605.
S605. The master earpiece 11 determines whether the electronic device 20 supports an AG function.
The main earpiece 11 determines whether the electronic device 20 supports the AG function, specifically, the main earpiece 11 actively sends an inquiry request to the electronic device 20; the main earpiece 11 determines whether the electronic device 20 supports the AG function from information returned by the electronic device 20 to the main earpiece 11 based on the inquiry request. Alternatively, the master earpiece 11 determines whether the electronic device 20 supports the AG function, or the electronic device 20 may send device identification information to the master earpiece 11, and the master earpiece 11 determines whether the electronic device 20 supports the AG function according to the device identification information.
Illustratively, as shown in fig. 7, S605 may specifically include S701-S704.
S701. The master ear-bud 11 sends a query request to the electronic device 20.
Wherein the inquiry request is for inquiring whether the electronic device 20 supports the AG function. In some embodiments, the master earpiece 11 may send the inquiry request to the electronic device 20 over a bluetooth channel established between the master earpiece 11 and the electronic device 20. In some embodiments, after the main earpiece 11 and the electronic device 20 establish the ACL link, the electronic device 20 also establishes an RFCOMM channel with the main earpiece 11. Illustratively, the master earpiece 11 may send the query request over the RFCOMM channel. The specific process of establishing the RFCOMM channel between the main earpiece 11 and the electronic device 20 can refer to the description in the related art, and is not described in detail in the embodiments of the present application.
S702. The electronic device 20 receives a query request from the main earpiece 11.
After the electronic device 20 receives the inquiry request, it may be determined whether the electronic device 20 supports the AG function by inquiring device information of the electronic device 20. Then, the electronic device 20 generates inquiry response information according to the inquiry result and feeds back the inquiry response information to the main earpiece 11 as by S703.
S703. The electronic device 20 sends an inquiry response message to the primary earpiece 11.
S704, the master ear bud 11 receives the query response information from the electronic device 20, and determines whether the electronic device 20 supports the AG function according to the query response information.
In some embodiments, the inquiry response message sent by the electronic device 20 to the main earpiece 11 carries a preset field, which is used to indicate whether the electronic device 20 supports the AG function. Illustratively, a preset field of 1 indicates that the electronic device 20 supports the AG function, and a preset field of 0 indicates that the electronic device 20 does not support the AG function. Or in other embodiments, the information of the inquiry response information sent by the electronic device 20 to the main earpiece 11 directly indicates whether the electronic device 20 supports the AG function. For example, the inquiry response information being 1 indicates that the electronic apparatus 20 supports the AG function, and the inquiry response information being 0 indicates that the electronic apparatus 20 does not support the AG function. It is understood that the above embodiments are only some examples, and in other embodiments, the inquiry response information sent by the electronic device 20 to the main earpiece 11 may indicate whether the electronic device 20 supports the AG function in other manners.
In the technical solution provided in the embodiment of the present application, after the master earpiece 11 establishes a connection with the slave earpiece 12, it actively sends an inquiry request to the electronic device 20 to inquire whether the electronic device 20 supports the AG function. So that the master earpiece 11 determines whether to transmit connection information to the slave earpiece 12 after establishing an A2DP connection with the electronic device 20, depending on whether the electronic device 20 supports the AG function.
In other embodiments, as shown in fig. 8, S605 may specifically include S801 and S802.
S801. The electronic device 20 sends device identification information to the master ear-bud 11.
In the embodiment of the present application, the electronic device 20 actively transmits device identification information to the master earpiece 11, where the device identification information is used to instruct the master earpiece 11 to determine whether the electronic device 20 supports the AG function according to the device identification information. The master earpiece 11, in conjunction with whether the electronic device 20 supports AG functionality, determines whether to synchronize the first connection information for A2DP connection to the slave earpiece 12 after waiting to receive an HFP connection request from the electronic device 20.
S802, the master earpiece 11 receives the device identification information sent from the electronic device 20, and determines whether the electronic device 20 supports the AG function according to the device identification information.
In some embodiments, the device identification information sent by the electronic device 20 to the main earpiece 11 includes a preset field for indicating whether the electronic device 20 supports the AG function. In this embodiment, after receiving the device identification information, the master earpiece 11 may determine whether the electronic device 20 supports the AG function by parsing the device identification information into a preset field.
In other embodiments, the device identification information sent by the electronic device 20 to the primary earpiece 11 is used to uniquely identify the electronic device. Meanwhile, a first preset list is stored in the master earpiece 11, wherein the first preset list stores device information of a plurality of electronic devices and whether each electronic device supports an AG function. In this embodiment, after receiving the device identification information from the electronic device 20, the master earpiece 11 may determine whether the electronic device 20 corresponding to the device identification information supports the AG function by querying the first preset list. In some embodiments, if the device identification information of the electronic device 20 is not stored in the first preset list, i.e. the main earpiece 11 cannot query the first preset list for the device identification information of the electronic device 20, the main earpiece 11 defaults that the electronic device 20 supports the AG function.
In other embodiments, the device identification information sent by the electronic device 20 to the primary earpiece 11 is used to uniquely identify the electronic device. Meanwhile, a second preset list is stored in the master earpiece 11, wherein the second preset list stores device information of a plurality of electronic devices that do not support the AG function. In this embodiment, the master earpiece 11 may, after receiving the device identification information from the electronic device 20, look up the device identification information in the second preset list. It should be understood that if the master earpiece 11 finds the device information of the electronic device 20 in the second preset list, it is determined that the electronic device 20 does not support the AG function; if the device information of the electronic device 20 is not found in the second preset list by the primary earpiece 11, it is determined that the electronic device 20 supports the AG function. It will be appreciated that the second predetermined list may also store device information of a plurality of AG-capable electronic devices, and that the main earpiece 11 may determine whether the electronic device 20 supports AG functions by looking up the second predetermined list.
In other embodiments, the master earpiece may determine whether the electronic device 20 supports the AG function according to the device identification information of the electronic device 20 in other manners.
It should be noted that, in the embodiment shown in fig. 8, S801 may be executed at any time after S600 and before S605. I.e. the electronic device 20 may send device identification information to the main ear-bud 11 upon establishing an ACL link with the main ear-bud 11.
In the technical solution provided in the embodiment of the present application, the electronic device 20 actively sends device identification information indicating whether the electronic device supports the AG function to the master earpiece, so that the master earpiece 11 can know whether the electronic device 20 supports the AG function, and thus determine whether to send the connection information to the slave earpiece 12 after establishing an A2DP connection with the electronic device 20.
In some embodiments, after the primary earpiece 11 determines whether the electronic device supports AG functionality, the primary earpiece may perform S606-S610 if the primary earpiece 11 determines that the electronic device does not support AG functionality.
S606. The master earpiece 11 sends the first connection information of the A2DP connection to the slave earpiece 12.
Wherein the first connection information of the A2DP connection is used for the slave 12 to listen and play the audio data transmitted by the electronic device 20 to the master 11 via the A2DP connection according to the first connection information.
In some embodiments, if the master earbud 11 determines that the electronic device 20 does not support the AG function in S606, the master earbud 11 directly transmits the first connection information to the slave earbud 12 without waiting for HFP connection information from the electronic device 20.
The connection information of the A2DP connection and the HFP connection needs to be transmitted to the slave earbud 12 after the master earbud 11 establishes the connection with the slave earbud 12 and the A2DP connection and the HFP connection with the electronic device 20 in order to synchronize data with the slave earbud 12 in the related art. In the embodiment of the present application, after the master earplug 11 establishes the connection with the slave earplug 12, the master earplug 11 determines whether the electronic device 20 supports the AG function by sending an inquiry request to the electronic device 20 or according to the device information of the electronic device 20, and if it can be determined that the electronic device 20 does not support the AG function, the master earplug 11 sends the connection information of the established A2DP connection to the slave earplug 12 after the master earplug 11 establishes the A2DP connection with the electronic device 20, so as to synchronize data with the slave earplug 12. Thus, if the electronic device 20 does not support the AG function, the main earpiece 11 does not wait for the HFP connection request from the electronic device, and it is possible to avoid waste of time caused by the main earpiece 11 waiting in this case. And the master earpiece 11 determines that the electronic device 20 does not support the AG function, and synchronizes connection information to the slave earpiece 12 immediately after the A2DP connection is established, so that the problem of delay of the TWS headset played sound due to the master earpiece 11 waiting for the HFP connection request in the above-described case can also be avoided.
S607. The slave earplug 12 receives the first connection information from the master earplug 11.
S608, the electronic device 20 sends audio data to the main earpiece 11 over the A2DP connection.
And S609, the main earplug 11 receives and plays the audio data sent by the electronic equipment 20 through the A2DP connection.
And S610, the slave earplug 12 monitors the A2DP connection according to the first connection information, acquires and plays the audio information sent by the electronic device 20 to the master earplug 11 through the A2DP connection.
The specific implementation process of the slave earpiece 12 monitoring the A2DP connection according to the first connection information, and acquiring and playing the audio information sent by the electronic device 20 to the master earpiece 11 through the A2DP connection may refer to the description in the related art, and is not described in detail in this embodiment.
In the technical solution provided in the embodiment of the present application, if the electronic device 20 does not support the AG function, the master earpiece 11 may send the connection information to the slave earpiece 12 after establishing an A2DP connection with the electronic device 20, and may play audio data sent by the electronic device through the A2DP connection; instead of playing the audio data from the electronic device after waiting for the HFP connection request from the electronic device for a while, the waste of time caused by the main earpiece 11 waiting and the possibility of delay in the TWS headset playing sound can be avoided.
In other embodiments, after S605, if the main earpiece 11 determines that the electronic device 20 supports the AG function, the electronic device 20 will normally actively send HFP connection to the main earpiece 11 to establish HFP connection with the main earpiece 11. In this embodiment, the master ear bud 11 may wait a preset period of time to wait for HFP connection from the electronic device 20. Illustratively, as shown in fig. 9, the method further includes, after S605, if the main earplug 11 determines that the electronic device supports the AG function, S901-S909, wherein:
s901. The master earplug 11 waits a preset time period.
The preset time period may be set according to time conditions, for example, may be set to 5 seconds(s), 8s, 10s, and so on.
As will be understood in conjunction with the above embodiments, the main earpiece 11 has established an A2DP connection with the electronic device 20 before S901. However, since the master earpiece 11 has not transmitted the first connection information of the A2DP connection to the slave earpiece 12, the slave earpiece 12 cannot listen to the A2DP connection based on the first connection information. If the audio data transmitted by the electronic device 20 through the A2DP connection is received and played before the HFP connection request is received by the master earphone 11 within the preset time period, the slave earphone 12 cannot listen to the audio data and play the audio data according to the first connection information. Therefore, if the main earpiece 11 receives the audio data transmitted by the electronic device 20 through the A2DP connection within the above-mentioned preset time period, in order to avoid the main earpiece from playing sound and the slave earpiece from not playing sound, the main earpiece 11 will not play the audio data transmitted by the electronic device 20 through the A2DP connection.
S902. The electronic device 20 sends an HFP connection request to the master ear bud 11 for a preset period of time.
S903. The master ear bud 11 receives an HFP connection request from the electronic device 20.
S904. In response to the HFP connection request, the main earpiece 11 establishes HFP connection with the electronic device 20.
Since the electronic device 20 transmits the HFP connection request to the main earpiece 11 within a preset time period, the main earpiece 11 establishes HFP connection with the electronic device 20.
S905. The master ear plug 11 transmits the first connection information and the HFP-connected second connection information to the slave ear plug 12.
Wherein the second connection information is used for listening and playing the audio data transmitted from the earphone 12 to the main earphone 11 through the HFP connection by the electronic device 20.
S906. Receiving the first connection information and the second connection information from the earplug 12.
S907. The electronic device 20 transmits audio data to the master ear bud 11 over the HFP connection.
S908, the master ear bud 11 receives and plays the audio data sent by the electronic device 20 through the HFP connection.
S909, the slave ear plug 12 monitors HFP connection according to the second connection information, and acquires and plays the audio information transmitted from the electronic device 20 to the master ear plug 11 through HFP connection.
It should be noted that, in the embodiment shown in fig. 9, after S905, the master earpiece 11 may also receive and play the audio data sent by the electronic device 20 through the A2DP connection, and similarly, the slave earpiece 12 may also monitor the A2DP connection according to the first connection information, and receive and play the audio data sent by the electronic device 20 to the master earpiece 11 through the A2DP connection, which is not shown in the figure.
In other embodiments, after S901, if the electronic device 20 does not transmit HFP connection to the master ear bud 11 within the preset time period, i.e., the master ear bud 11 does not receive HFP connection request within the preset time period, the master ear bud 11 transmits only the first connection information of the A2DP connection to the slave ear bud 12. This situation may be a problem for the electronic device 20, where the master earpiece 11 sends the first connection information of the A2DP connection to the slave earpiece 12, ensuring that the TWS headset can normally receive and play audio data sent by the electronic device to the master earpiece 11 over the A2DP connection.
In other embodiments, if the master earbud 11 does not receive the HFP connection request within the preset time period, the master earbud 11 may establish HFP connection with the electronic device 20 after the master earbud 11 transmits the first connection information of A2DP connection to the slave earbud 12 and the master earbud 11 receives the HFP connection request from the electronic device 20. The master ear plug 11 then transmits the HFP-connected second connection information to the slave ear plug 12.
In the embodiment of the present application, if the master ear plug 11 determines that the electronic device 20 supports the AG function, the master ear plug 11 waits for a period of time to receive the HFP connection request and establish HFP connection with the electronic device 20, and then synchronizes the first connection information of the A2DP connection and the second connection information of the HFP connection with the slave ear plug 12. In this way, it can be ensured that when the electronic device plays audio data through the TWS headset, the master earpiece 11 and the slave earpiece 12 play synchronously, and the situation where only one earpiece has sound or the two earpieces do not have sound synchronization can be avoided.
The above embodiments describe the case where the master earplug 11 is connected to the slave earplug 12, and in actual cases, the master earplug 11 may not be connected to the slave earplug 12. For example, the user merely takes the main earplug 11 out of the earphone box 401 as shown in fig. 4, while the secondary earplug 12 remains stowed in the earphone box 401. As another example, the master earplug 11 and the slave earplug 12 are both taken out from the earphone box 401, but the distance between the master earplug 11 and the slave earplug 12 is relatively long, so that the connection between the master and the slave earplugs cannot be established. Alternatively, the master earplug 11 or the slave earplug 12 may be out of charge, which may cause the master earplug 11 and the slave earplug 12 to be unable to establish a connection.
In this case, since the master earphone 11 and the slave earphone 12 are not connected, there is no connection information that the master earphone 11 needs to send the connection between the master earphone 11 and the electronic device 20 to the slave earphone 12, and there is no waste of time caused by waiting for HFP connection and no delay of sound played by the TWS headset caused by waiting for HFP connection. Thus, in some embodiments, in the case where the master ear bud 11 and the slave ear bud 12 do not establish a connection, the master ear bud 11 may play the audio data directly after establishing the A2DP connection with the electronic device 20 if the master ear bud 11 receives the audio data sent by the electronic device 20 over the A2DP connection. If the HFP connection request transmitted from the electronic device 20 is received at the master ear plug 11, the master ear plug 11 establishes HFP connection with the electronic device 20. That is, after the master earbud 11 establishes the A2DP connection with the electronic device 20, if the master earbud 11 does not establish a connection with the slave earbud 12, the master earbud 11 does not need to determine whether the electronic device 20 supports the AG function, nor does it need to perform a step of waiting for a preset period of time, playing audio data if audio data transmitted through the A2DP connection is received, and establishing the HFP connection with the electronic device 20 if an HFP connection request is received.
Some embodiments of the present application provide a TWS headset, the earplugs of which may include: one or more processors, memory, communication interfaces, receivers, microphones, and one or more computer programs, which may be connected by one or more communication buses. Wherein the one or more computer programs are stored in the memory and configured to be executed by the one or more processors, the one or more computer programs comprising instructions which may be used to perform the steps as performed by the primary earpiece of the TWS headset in the respective embodiments of fig. 6-9. Of course, the ear plug of the TWS headset may further include other devices such as a sensor, and the embodiments of the present application do not limit this. The earplug structure of the TWS headset may refer to the structure of the earplugs shown in fig. 3.
Other embodiments of the present application provide an electronic device that is the electronic device 20 (e.g., a smart watch) described above. The electronic device may include: a memory, a bluetooth module, and one or more processors. The memory, bluetooth module and processor are coupled. The Bluetooth module is used for short-distance communication with other electronic equipment. The memory is for storing computer program code comprising computer instructions. When the processor executes the computer instructions, the electronic device may perform the various functions or steps performed by the electronic device 20 in the above-described method embodiments. The structure of the electronic device may refer to the structure of the electronic device 100 shown in fig. 5.
The embodiment of the present application further provides a chip system, as shown in fig. 10, the chip system 100 includes at least one processor 1001 and at least one interface circuit 1002. The processor 1001 and the interface circuit 1002 may be interconnected by wires. For example, the interface circuit 1002 may be used to receive signals from other devices (e.g., a memory of an electronic device). Also for example, the interface circuit 1002 may be used to send signals to other devices, such as the processor 1001. Illustratively, the interface circuit 1002 may read instructions stored in the memory and send the instructions to the processor 1001. The instructions, when executed by the processor 1001, may cause the electronic device to perform the various steps in the embodiments described above. Of course, the chip system may further include other discrete devices, which is not specifically limited in this embodiment of the present application.
Embodiments of the present application also provide a computer readable storage medium, which includes computer instructions, when the computer instructions are executed on the main earpiece 11 or the electronic device 20 of the TWS headset 10, cause the electronic device to perform the functions or steps performed by the main earpiece 11 or the electronic device 20 in the above method embodiments.
The embodiments of the present application also provide a computer program product, which when run on a computer causes the computer to perform the functions or steps performed by the main earpiece 11 or the electronic device 20 in the above-mentioned method embodiments. The computer may be the main earpiece 11 or the electronic device 20 of the TWS headset 10.
Through the description of the above embodiments, it is clear to those skilled in the art that, for convenience and simplicity of description, the foregoing division of the functional modules is merely used as an example, and in practical applications, the above function distribution may be completed by different functional modules according to needs, that is, the internal structure of the device may be divided into different functional modules to complete all or part of the above described functions.
In the several embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the above-described embodiments of the apparatus are merely illustrative, and for example, a module or a unit may be divided into only one logic function, and may be implemented in other ways, for example, a plurality of units or components may be combined or integrated into another apparatus, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
Units described as separate parts may or may not be physically separate, and parts displayed as units may be one physical unit or a plurality of physical units, may be located in one place, or may be distributed to a plurality of different places. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a readable storage medium. Based on such understanding, the technical solutions of the embodiments of the present application, or portions of the technical solutions that substantially contribute to the prior art, or all or portions of the technical solutions may be embodied in the form of a software product, where the software product is stored in a storage medium and includes several instructions to enable a device (which may be a single chip, a chip, or the like) or a processor (processor) to execute all or part of the steps of the methods of the embodiments of the present application. And the aforementioned storage medium includes: various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
The above description is only an embodiment of the present application, but the scope of the present application is not limited thereto, and any changes or substitutions within the technical scope disclosed in the present application should be covered within the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (9)

1. A Bluetooth headset playing method is characterized in that the method is applied to a True Wireless Stereo (TWS) headset, wherein the TWS headset comprises a master earplug and a slave earplug; the method comprises the following steps:
after the main earplug establishes an asynchronous connection-oriented ACL link with an electronic device, the main earplug receives an advanced audio distribution profile A2DP connection request from the electronic device;
in response to the A2DP connection request, the main earpiece establishes an A2DP connection with the electronic device;
after the master earplug and the slave earplug are connected, the master earplug judges whether the electronic equipment supports an Audio Gateway (AG) function;
if the master earpiece determines that the electronic device does not support the AG function, the master earpiece directly sends first connection information of the A2DP connection to the slave earpiece without waiting for a handsfree profile HFP connection request of the electronic device; the first connection information is used for the slave earplug to monitor and play data transmitted by the electronic equipment to the master earplug through the A2DP connection; wherein the HFP connection request is for the electronic device to establish an HFP connection with the primary earpiece;
and the master earplug receives and plays audio data sent by the electronic equipment through the A2DP connection.
2. The method of claim 1, further comprising:
if the main earplug determines that the electronic equipment supports the AG function, the main earplug waits for a preset time period;
if the main ear plug receives an HFP connection request from the electronic device within the preset time period, the main ear plug and the electronic device are connected by the HFP;
after the master ear-set establishes the HFP connection with the electronic device, the master ear-set transmits the first connection information and the HFP connection second connection information to the slave ear-set;
the main earplug receives and plays audio data sent by the electronic equipment through the HFP connection;
wherein the second connection information is used for the slave ear buds to monitor and play data transmitted by the electronic device to the master ear buds through the HFP connection.
3. The method of claim 1 or 2, wherein the determining, by the master earpiece, whether the electronic device supports Audio Gateway (AG) functionality comprises:
the master earpiece sending a query request to the electronic device; the query request is used for querying whether the electronic equipment supports an AG function;
the master earpiece receives inquiry response information from the electronic device and determines whether the electronic device supports the AG function according to the inquiry response information.
4. The method of claim 1 or 2, wherein the determining, by the master earpiece, whether the electronic device supports Audio Gateway (AG) functionality comprises:
the master earpiece receiving device identification information from the electronic device;
the master earpiece determines whether the electronic device supports the AG function from the device identification information.
5. The method of claim 2, further comprising:
if the main earphone receives the audio data from the electronic device through the A2DP connection before receiving the HFP connection within the preset time period, the main earphone does not play the audio data.
6. A Bluetooth headset playing method is applied to electronic equipment and comprises the following steps:
the electronic equipment sends an A2DP connection request to a main earplug of a TWS earphone after establishing an ACL link with the main earplug, wherein the A2DP connection request is used for requesting to establish an A2DP connection with the main earplug;
the electronic device sending device identification information to the master ear bud; the equipment identification information is used for the main earplug to determine whether the electronic equipment supports AG function according to the equipment identification information;
wherein, whether the electronic device supports an AG function is used to synchronize the first connection information of the A2DP connection to the slave earpiece after the master earpiece establishes the A2DP connection with the electronic device and determines whether to wait for receiving a handsfree profile HFP connection request from the electronic device; wherein the first connection information is used for the slave ear plug to monitor and play data transmitted by the electronic device to the master ear plug through the A2DP connection;
wherein the electronic device does not support an AG function, and is configured to synchronize the first connection information directly to the slave ear bud without waiting for the HFP connection request from the electronic device after the master ear bud establishes the A2DP connection with the electronic device.
7. A true wireless stereo TWS headset, the TWS headset comprising a master earpiece and a slave earpiece, the master earpiece comprising: the Bluetooth mobile phone comprises a processor, a memory, a Bluetooth module, a receiver and a microphone; wherein the memory, the Bluetooth module, the headphones, and the microphone are coupled with the processor; stored in the memory is computer program code comprising computer instructions which, when executed by the processor, cause the master ear plug to perform the method of any one of claims 1-5.
8. An electronic device, characterized in that the electronic device comprises: the device comprises a processor, a memory and a Bluetooth module; wherein the memory, the Bluetooth module, and the processor are coupled; the memory has stored therein computer program code comprising computer instructions which, when executed by the processor, cause the electronic device to perform the method of claim 6.
9. A computer readable storage medium comprising computer instructions which, when executed on an electronic device, cause the electronic device to perform the method of any of claims 1-6.
CN202211081583.6A 2022-09-06 2022-09-06 Bluetooth headset playing method and equipment Active CN115175159B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211081583.6A CN115175159B (en) 2022-09-06 2022-09-06 Bluetooth headset playing method and equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211081583.6A CN115175159B (en) 2022-09-06 2022-09-06 Bluetooth headset playing method and equipment

Publications (2)

Publication Number Publication Date
CN115175159A CN115175159A (en) 2022-10-11
CN115175159B true CN115175159B (en) 2023-01-13

Family

ID=83482239

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211081583.6A Active CN115175159B (en) 2022-09-06 2022-09-06 Bluetooth headset playing method and equipment

Country Status (1)

Country Link
CN (1) CN115175159B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117119614A (en) * 2023-01-28 2023-11-24 荣耀终端有限公司 Bluetooth connection method, device and system

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110166988A (en) * 2018-02-13 2019-08-23 盛微先进科技股份有限公司 A kind of wireless communication system and its method
CN110519742A (en) * 2019-09-16 2019-11-29 安徽华米信息科技有限公司 A kind of audio sync playback method, device and TWS bluetooth headset
CN111132377A (en) * 2019-12-27 2020-05-08 昱兆微电子科技(上海)有限公司 Data transmission method and system for terminal and earphone
CN113099428A (en) * 2021-03-02 2021-07-09 北京小米移动软件有限公司 Audio information transmission method, audio information transmission device, and storage medium
WO2021223243A1 (en) * 2020-05-08 2021-11-11 深圳市汇顶科技股份有限公司 Audio data transmission method and apparatus, chip, and electronic device
US11240586B1 (en) * 2020-11-05 2022-02-01 Shenzhen Goodix Technology Co Ltd. Method, apparatus and device for synchronously playing audio
CN114079892A (en) * 2020-08-12 2022-02-22 华为技术有限公司 Bluetooth communication method, wearable device and system
CN114679665A (en) * 2022-03-16 2022-06-28 深圳市冠旭电子股份有限公司 Bluetooth headset audio and video synchronization method and device, electronic equipment and storage medium

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107124674B (en) * 2017-06-20 2019-11-08 歌尔科技有限公司 A kind of audio-frequency inputting method of bluetooth headset, device and bluetooth headset
CN113382397B (en) * 2019-04-18 2023-12-08 华为技术有限公司 Bluetooth connection method, device and system
CN111556476B (en) * 2020-04-17 2021-01-19 炬力(珠海)微电子有限公司 Data transmission method between Bluetooth TWS (two way communication) devices and Bluetooth TWS devices
CN114885251A (en) * 2021-02-05 2022-08-09 深圳市三诺数字科技有限公司 TWS earphone system low-delay transmission method, device, equipment and storage medium

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110166988A (en) * 2018-02-13 2019-08-23 盛微先进科技股份有限公司 A kind of wireless communication system and its method
CN110519742A (en) * 2019-09-16 2019-11-29 安徽华米信息科技有限公司 A kind of audio sync playback method, device and TWS bluetooth headset
CN111132377A (en) * 2019-12-27 2020-05-08 昱兆微电子科技(上海)有限公司 Data transmission method and system for terminal and earphone
WO2021223243A1 (en) * 2020-05-08 2021-11-11 深圳市汇顶科技股份有限公司 Audio data transmission method and apparatus, chip, and electronic device
CN114079892A (en) * 2020-08-12 2022-02-22 华为技术有限公司 Bluetooth communication method, wearable device and system
US11240586B1 (en) * 2020-11-05 2022-02-01 Shenzhen Goodix Technology Co Ltd. Method, apparatus and device for synchronously playing audio
CN113099428A (en) * 2021-03-02 2021-07-09 北京小米移动软件有限公司 Audio information transmission method, audio information transmission device, and storage medium
CN114679665A (en) * 2022-03-16 2022-06-28 深圳市冠旭电子股份有限公司 Bluetooth headset audio and video synchronization method and device, electronic equipment and storage medium

Also Published As

Publication number Publication date
CN115175159A (en) 2022-10-11

Similar Documents

Publication Publication Date Title
CN112789867B (en) Bluetooth connection method and equipment
CN112868244B (en) Point-to-multipoint data transmission method and device
WO2021008614A1 (en) Method for establishing communication connection and wearable device
WO2020133183A1 (en) Audio data synchronization method and device
CN112042212B (en) Audio data transmission method and electronic equipment
US20220039041A1 (en) Point-to-Multipoint Data Transmission Method and Electronic Device
US20220078541A1 (en) Audio data transmission method applied to switching between single-earbud mode and double-earbud mode of tws headset and device
CN112913321B (en) Method, equipment and system for carrying out call by using Bluetooth headset
CN114499587B (en) Audio synchronization communication method, system, wireless earphone, terminal and storage medium
CN113039822B (en) Method and equipment for establishing data channel
CN114679710A (en) TWS earphone connection method and equipment
CN115175159B (en) Bluetooth headset playing method and equipment
WO2022213689A1 (en) Method and device for voice communicaiton between audio devices
CN112771828B (en) Audio data communication method and electronic equipment
WO2022160967A1 (en) Communication method, mobile device, electronic device, and computer-readable storage medium
CN113709906B (en) Wireless audio system, wireless communication method and equipment
CN114696961B (en) Multimedia data transmission method and equipment
WO2023029938A1 (en) Tws earphone decoupling and sharing method and apparatus, and device and storage medium
CN118158598A (en) Audio playing method, audio playing device and storage medium
CN116074986A (en) Bluetooth connection method, device and system
CN116866472A (en) Volume control method and electronic equipment

Legal Events

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