WO2021082875A1 - Method and apparatus for switching master and slave bluetooth headsets, bluetooth headset, and system - Google Patents

Method and apparatus for switching master and slave bluetooth headsets, bluetooth headset, and system Download PDF

Info

Publication number
WO2021082875A1
WO2021082875A1 PCT/CN2020/119607 CN2020119607W WO2021082875A1 WO 2021082875 A1 WO2021082875 A1 WO 2021082875A1 CN 2020119607 W CN2020119607 W CN 2020119607W WO 2021082875 A1 WO2021082875 A1 WO 2021082875A1
Authority
WO
WIPO (PCT)
Prior art keywords
slave
master
headset
bluetooth
earphone
Prior art date
Application number
PCT/CN2020/119607
Other languages
French (fr)
Chinese (zh)
Inventor
罗广君
邓玉林
Original Assignee
珠海市杰理科技股份有限公司
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 珠海市杰理科技股份有限公司 filed Critical 珠海市杰理科技股份有限公司
Publication of WO2021082875A1 publication Critical patent/WO2021082875A1/en

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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/16Sound input; Sound output
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D30/00Reducing energy consumption in communication networks
    • Y02D30/70Reducing energy consumption in communication networks in wireless communication networks

Definitions

  • the invention relates to the field of Bluetooth communication, in particular to a method and device for switching between a master and a slave Bluetooth headset, a Bluetooth headset, and a system.
  • the penetration rate of Bluetooth earphones is getting higher and higher.
  • the power consumption of the main earphone and the slave earphone is inconsistent, resulting in the main earphone
  • the power consumption rate is higher than the power consumption rate of the slave earphones.
  • the main earphone is often powered off earlier than the slave earphones, resulting in poor user experience.
  • users tend to charge the master and slave headsets at the same time, which will reduce the service life of the slave headsets that do not lack power.
  • Chinese Patent Publication CN109275069A discloses a method for intelligently switching between the main earphone and the auxiliary earphone, the Bluetooth playback device and the Bluetooth earphone.
  • the main earphone sends the power to the auxiliary earphone
  • the auxiliary earphone also sends the power to the main earphone
  • the battery power is relatively high.
  • the headset of is used as the main headset and actively initiates a connection with the Bluetooth playback device (such as a mobile phone), and the headset with lower battery power is used as the secondary headset.
  • the main earphone and the secondary earphone send power information to each other, resulting in excessive link transmission data, occupying audio data transmission bandwidth;
  • this prior art is not introduced in every standard Bluetooth time slot
  • the power is transmitted during the time period for transmitting audio data, that is, no audio data is transmitted in the standard Bluetooth time slot.
  • the audio data is transmitted in the next time slot, which results in slow audio data transmission, which may lead to stuttering.
  • Chinese Patent Publication CN104335642B discloses performing master-slave switching during music pauses or silent periods between songs.
  • this solution depends on the duration of audio playback, that is, the master-slave switch needs to be performed after a period of audio is played, resulting in the untimely master-slave switch, especially during continuous lectures or watching movies.
  • the audio data lasts for a long time, which aggravates the problem of inconsistent power consumption of the two headphones during audio playback.
  • the main purpose of the present invention is to provide a method and device for switching between master and slave Bluetooth headsets, Bluetooth headsets, and systems, which not only achieve the balance of the battery power of the master and slave Bluetooth headsets, improve the battery life, but not It causes the audio playback to freeze and improves the user experience.
  • an embodiment of the present invention discloses a master-slave Bluetooth headset switching method, which is used for a master headset and a slave headset, and the method includes:
  • Step S901 The main earphone receives multiple audio data packets sent by the audio source device according to the Bluetooth communication standard protocol;
  • Step S903 The slave earphone monitors multiple audio data packets sent by the audio source device according to the Bluetooth communication standard protocol;
  • Step S905 The main earphone and the slave earphone Establish a master-slave Bluetooth link to enable the master headset to interact with the slave headset;
  • step S907 the slave headset sends the remaining power of the slave headset to the master headset;
  • step S909 the master headset receives the remaining power of the slave headset sent from the headset;
  • step S911 The master headset judges whether the remaining power of the slave headset and the remaining power of the master headset exceed the preset value;
  • step S913 if the difference between the remaining power of the slave headset and the remaining power of the master headset exceeds the preset value, the master headset Send a master-slave switching request to the slave earphone;
  • step S915 receive the master-slave switching request sent by the master earphone from the
  • a method for switching between master and slave Bluetooth headsets disclosed in the embodiment of the present invention is to send the remaining power of the slave headset to the master headset during the idle period in the standard Bluetooth time slot of the established master-slave Bluetooth link.
  • the master-slave switching request is sent to the slave headset, which not only realizes the timely execution of the master-slave switching operation according to the remaining power of the master-slave headset,
  • the battery power of the master-slave Bluetooth headset is balanced, and the battery life is improved; moreover, since the master-slave switching is performed in one or more steps during the period when the operation of receiving and monitoring audio data packets is not performed, on the one hand, it reduces Receiving and monitoring the bandwidth occupation of audio data packets, that is, reducing the bandwidth loss; on the other hand, it will not affect the normal reception and monitoring of multiple audio data packets according to the Bluetooth communication standard protocol by the master and slave headphones, and then, no audio will be caused.
  • the playback freezes
  • an embodiment of the present invention discloses a method for switching between a master and a slave Bluetooth headset, which is used for a slave headset, and is characterized in that the method includes the following steps:
  • Step S101 Monitor multiple audio data packets sent by the audio source device according to the Bluetooth communication standard protocol, during which the master headset receives multiple audio data packets according to the Bluetooth communication standard protocol;
  • Step S103 Establish a master-slave Bluetooth link with the master headset to communicate with The master headset performs data interaction; step S105: send the remaining power of the slave headset to the master headset; step S107: receive the master-slave switching request sent by the master headset, where the master headset is between the remaining power of the slave headset and the remaining power of the master headset After the difference exceeds the preset value, send a master-slave switching request to the slave headset; step S109: send a master-slave switching response to the master headset according to the master-slave switching request; and step S111: when the master headset 100 receives the master-slave switching response, The master-slave switching operation is performed when the master-slave switching time comes; wherein at least one of steps S105, S107, S109, and S111 is completed in the first idle period, which is the period during which the slave headset
  • a method for switching between master and slave Bluetooth headsets disclosed in the embodiment of the present invention is to send the remaining power of the slave headset to the master headset during the idle period in the standard Bluetooth time slot of the established master-slave Bluetooth link. After the difference between the remaining power of the headset and the remaining power of the master headset exceeds the preset value, the master-slave switching request is sent to the slave headset, which not only realizes the timely execution of the master-slave switching operation according to the remaining power of the master-slave headset, The battery power of the master-slave Bluetooth headset is balanced, which improves the battery life; moreover, since the master-slave switching is performed during the period when the monitoring audio data packet operation is not performed, the master-slave switching is performed in one or more steps.
  • the monitoring audio is reduced
  • the bandwidth occupancy of the data packet is to reduce the bandwidth loss; on the other hand, it will not affect the normal monitoring of multiple audio data packets from the headset according to the Bluetooth communication standard protocol, and then will not cause the audio playback to freeze, which improves the user Experience.
  • the step S105 includes: after the slave earphone monitors the current audio data packet sent by the audio source device, sending an audio monitor success response packet to the master earphone, wherein the audio monitor successfully answers The package contains the remaining power of the slave headset.
  • an audio monitoring success response packet is sent to the main earphone in the most recent first idle period.
  • the method further includes: when the remaining power of the slave headset is less than the power threshold, sending a Bluetooth communication end request to the master headset during the first idle period; when the slave headset receives the master headset sending After completing the Bluetooth communication response, output an instruction to turn off the power of the slave headset to turn off the power of the slave headset.
  • an embodiment of the present invention discloses a master-slave Bluetooth headset switching method for the master headset.
  • the method includes the following steps:
  • Step S501 Receive multiple audio data packets sent by the audio source device according to the Bluetooth communication standard protocol, during which the slave headset monitors multiple audio data packets according to the Bluetooth communication standard protocol;
  • Step S503 Establish a master-slave Bluetooth link with the slave headset to communicate with Perform data interaction from the headset;
  • Step S505 Receive the remaining power of the slave headset sent from the headset;
  • Step S507 Determine whether the difference between the remaining power of the slave headset and the remaining power of the main headset exceeds the preset value;
  • Step S509 If If the remaining power of the slave headset and the remaining power of the master headset exceed the preset value, a master-slave switching request is sent to the slave headset;
  • step S511 receiving a master-slave switching response sent by the slave headset according to the master-slave switching request;
  • step S513 according to the master The slave handover response executes the master-slave handover operation when the master-slave handover time comes; wherein, at least one of step S505, step S507, step S509
  • a method for switching between master and slave Bluetooth headsets disclosed in the embodiment of the present invention is to send the remaining power of the slave headset to the master headset during the idle period in the standard Bluetooth time slot of the established master-slave Bluetooth link.
  • the master-slave switching request is sent to the slave headset, which not only realizes the timely execution of the master-slave switching operation according to the remaining power of the master-slave headset,
  • the battery power of the master-slave Bluetooth headset is balanced, and the battery life is improved; moreover, since the master-slave switching is performed in one or more steps during the period when the operation of receiving and monitoring audio data packets is not performed, on the one hand, it reduces The bandwidth occupancy of receiving audio data packets is reduced; on the other hand, it will not affect the main earphone to receive multiple audio data packets normally according to the Bluetooth communication standard protocol, and then will not cause the audio playback to freeze and improve Improve the user experience.
  • step S505 includes: receiving an audio monitoring success response packet sent from the headset, where the audio monitoring success response packet indicates that the current audio data packet sent by the audio source device is successfully monitored from the headset; and the audio monitoring success response packet is obtained from the headset The remaining battery power.
  • step S509 includes: if the remaining power of the slave headset and the remaining power of the master headset exceed a preset value, sending a master-slave switching request to the slave headset in the nearest second idle period.
  • the method further includes: receiving an end Bluetooth communication request sent from the earphone in the second idle period; sending a response to the end Bluetooth communication request to the slave earphone; and outputting an instruction to turn off the power of the main earphone according to the end Bluetooth communication request to shut down The power supply of the main headset.
  • an embodiment of the present invention discloses a master-slave Bluetooth headset switching device, including:
  • the monitoring module is used to monitor multiple audio data packets sent by the audio source device according to the Bluetooth communication standard protocol. During this period, the main earphone receives multiple audio data packets according to the Bluetooth communication standard protocol; the first establishment module is used to establish a master-slave with the main earphone Bluetooth link for data interaction with the main earphone; power sending module for sending the remaining power of the slave earphone to the main earphone; request receiving module for receiving the master-slave switching request sent by the main earphone, where the main earphone is in the slave After the difference between the remaining power of the headset and the remaining power of the main headset exceeds the preset value, send a master-slave switching request to the slave headset; the response module is used to send a master-slave switching response to the master headset according to the master-slave switching request; and A switching module for performing a master-slave switching operation when the master-slave switching time comes after the master headset receives the master-slave switching response; wherein, at least one of the power sending module, the request receiving
  • a data receiving module configured to receive multiple audio data packets sent by the audio source device according to the Bluetooth communication standard protocol, during which the multiple audio data packets are monitored from the headset according to the Bluetooth communication standard protocol;
  • a second establishment module It is used to establish a master-slave Bluetooth link with the slave headset to interact with the slave headset;
  • the power receiving module is used to receive the remaining power of the slave headset sent from the headset;
  • the power judging module is used to determine the remaining power of the slave headset and Whether the difference between the remaining power of the master earphone exceeds the preset value;
  • the request sending module is used to send the master to the slave earphone if the power judgment module determines that the remaining power of the slave earphone and the remaining power of the master earphone exceed the preset value.
  • the second switching module used to perform the master-slave switching operation when the master-slave switching time comes according to the master-slave switching response
  • at least one of the power sending module, the request receiving module, the answering module and the first switching module is completed in the second idle period
  • the second idle period is the period during which the main headset does not perform the operation of receiving audio data packets
  • the second The idle period is in the same standard Bluetooth time slot as at least part of the data period when an audio data packet is received.
  • an embodiment of the present invention discloses a Bluetooth headset, including a processor, and the processor is configured to implement any method disclosed in the second aspect.
  • an embodiment of the present invention discloses a Bluetooth headset, including a processor, and the processor is configured to implement any method disclosed in the third aspect.
  • an embodiment of the present invention discloses a Bluetooth headset system, including: a slave headset for monitoring and playing multiple audio data packets sent by the audio source device; and a master headset for receiving and playing the audio data packets sent by the audio source device.
  • a plurality of audio data packets; among them, the slave headset and the master headset constitute a Bluetooth headset pair; the slave headset is the Bluetooth headset arbitrarily disclosed in the fifth aspect; the master headset is the Bluetooth headset arbitrarily disclosed in the sixth aspect.
  • an embodiment of the present invention discloses a Bluetooth audio playback system, including:
  • the bluetooth earphone system disclosed in any of the above seventh aspect and the audio source device, which is used to provide a plurality of audio data packets to the bluetooth earphone system.
  • the audio source device may be a mobile phone, a tablet computer, a notebook, an audio-visual player, and other devices that have a Bluetooth communication function and an audio data providing function.
  • an embodiment of the present invention discloses a Bluetooth headset chip with an integrated circuit thereon, and the integrated circuit is used to implement any disclosed method of the above-mentioned second aspect; or/and, used to implement any of the above-mentioned third aspect disclosed Methods.
  • an embodiment of the present invention discloses a computer-readable storage medium on which a computer program is stored, and the computer program stored in the storage medium is used to be executed to implement any method disclosed in the second aspect; or, To implement the method disclosed in the third aspect above.
  • Figure 1 is a schematic diagram of a three-terminal system according to an embodiment of the present invention.
  • Figure 2 is a schematic diagram of a communication time slot according to an embodiment of the present invention.
  • FIG. 3 is a flowchart of a method for switching between master and slave Bluetooth headsets for slave headsets disclosed in an embodiment of the present invention
  • FIG. 4 is a schematic diagram of a remaining power transmission method disclosed in an embodiment of the present invention.
  • FIG. 5 is a flowchart of a method for switching between master and slave Bluetooth headsets for master headsets disclosed in an embodiment of the present invention
  • FIG. 6 is a timing diagram of a method for switching between master and slave Bluetooth headsets disclosed in an embodiment of the present invention
  • FIG. 7 is a schematic diagram of a three-terminal system data receiving and forwarding process disclosed in an embodiment of the present invention.
  • FIG. 8 is a schematic diagram of a master-slave switching process disclosed in an embodiment of the present invention.
  • FIG. 9 is a schematic diagram of a shutdown process of a Bluetooth headset disclosed in an embodiment of the present invention.
  • Figure 10a is a structural diagram of a master-slave Bluetooth headset switching device for slave headsets disclosed in an embodiment of the present invention
  • Fig. 10b is a structural diagram of a master-slave Bluetooth headset switching device for a master headset disclosed in an embodiment of the present invention
  • FIG. 11 is a schematic diagram of the structure of a Bluetooth headset system disclosed in an embodiment of the present invention.
  • Fig. 12 is a schematic structural diagram of a Bluetooth headset chip disclosed in an embodiment of the present invention.
  • the system includes a sound source device (such as a mobile phone), a master Bluetooth headset (such as a master Bluetooth headset 100, hereinafter referred to as a master headset) and a slave Bluetooth headset (such as a slave Bluetooth headset).
  • a sound source device such as a mobile phone
  • a master Bluetooth headset such as a master Bluetooth headset 100, hereinafter referred to as a master headset
  • a slave Bluetooth headset such as a slave Bluetooth headset.
  • the headset 200 hereinafter referred to as the slave headset).
  • a Bluetooth link 1 is established between the mobile phone and the master headset for Bluetooth communication.
  • the mobile phone sends multiple audio data packets to the master headset, and the master headset plays the audio data packets after receiving the audio data packets; another Bluetooth link is established between the master headset and the slave headset Link (that is, the master-slave Bluetooth link), the master headset sends the information of Bluetooth link 1 to the slave headset, so that the slave headset establishes a monitoring Bluetooth link 2 to monitor the audio data packets sent by the mobile phone to the master headset, and the slave headset
  • the earphone can also obtain the audio data packet sent by the mobile phone to the main earphone and play it.
  • the frequency hopping sequence of the mobile phone, the master headset and the slave headset are the same, and the duration of each frequency point is 625 ⁇ s (that is, a Bluetooth standard time slot), for example .
  • the mobile phone sends audio data packet 10
  • the master earphone receives the audio data packet 10 in the time slot of the standard time slot
  • the slave earphone monitors and receives the audio data packet in the time slot 30 of the standard time slot 10
  • the master headset can send data to the mobile phone.
  • the master headset and slave headset successfully receive audio data packets, or the master headset successfully receives audio data packets but the slave headset does not receive audio data packets
  • the mobile phone sends an ACK for successful audio reception.
  • the two earphones serving as the master earphone and the slave earphone are interfered by different signals, and the power consumption is also different. Therefore, in some scenarios, the two earphones need to be switched between master and slave frequently to improve communication quality or increase The power balance of the two earphones.
  • this embodiment provides a master-slave Bluetooth earphone switching method for the slave earphone side. Please refer to FIG. 3, which is disclosed in this embodiment.
  • the master-slave Bluetooth headset switching method includes the following steps:
  • Step S101 Monitor multiple audio data packets sent by the audio source device according to the Bluetooth communication standard protocol.
  • the slave headset 200 monitors multiple audio data packets sent by the audio source device (such as a mobile phone) through the Bluetooth link 2 according to the Bluetooth communication standard protocol; while the slave headset 200 monitors multiple audio data packets, the master headset presses
  • the Bluetooth communication standard protocol receives multiple audio data packets, specifically, multiple audio data packets are received through the Bluetooth link 1.
  • multiple audio data packets sent by the audio source device (such as a mobile phone) constitute an audio file, that is, one audio file (such as a song) contains multiple audio data packets.
  • an audio data packet please refer to FIG. 2.
  • the mobile phone sends an audio data packet 10 to the main earphone, and the slave earphone monitors the audio data packet 10 on the monitoring Bluetooth link 2.
  • Step S103 Establish a master-slave Bluetooth link with the master headset to perform data interaction with the master headset. Please refer to FIG. 1.
  • the data interaction between the master headset and the slave headset is implemented through a master-slave Bluetooth link, for example, forwarding audio data packets, sending a master-slave switching request, and so on.
  • Step S105 Send the remaining power of the slave earphone to the master earphone.
  • the slave headset 200 may collect the remaining power of the battery through its own sampling module or power monitoring module, and send the collected remaining power to the master headset 100 through the master-slave Bluetooth link.
  • the remaining power may be the percentage of the remaining power of the battery to the total battery capacity, or the power itself (for example, xx milliamperes).
  • Step S107 Receive a master-slave switching request sent by the master headset.
  • the slave headset 200 receives the master-slave switching request sent by the master headset 100 through the master-slave Bluetooth link.
  • the master headset 100 may also collect the remaining power of the battery through its own sampling module or power monitoring module. The difference between the remaining power of the master headset 100 and the remaining power of the master headset 200 exceeds a preset value. After the value is set, a master-slave switching request is sent to the slave headset, where the preset value can be determined based on experience. It should be noted that the units of the remaining power of the slave and master headsets should be the same.
  • the remaining power of the slave headset 200 is the percentage of the remaining power of the slave headset 200 to the total battery capacity
  • the remaining power of the master headset 100 should also be the master headset.
  • the remaining power of 100 is the percentage of the total battery capacity; for another example, when the remaining power of the slave headset 200 is the remaining power of the slave headset 200, the remaining power of the master headset 100 should also be the remaining power of the master headset 100 itself.
  • Step S109 Send a master-slave switching response to the master headset according to the master-slave switching request.
  • the slave headset 200 sends a master-slave switching response to the master headset 100 through a master-slave Bluetooth link.
  • the master-slave switching response may be sent to the master headset in the form of an additional package.
  • Step S111 Perform a master-slave switching operation when the master-slave switching time comes.
  • the master-slave switching operation is performed when the master-slave switching time comes.
  • the master-slave relationship of the two headsets is reversed, that is, the Bluetooth headset of the current master headset becomes the slave headset, and the audio data packet sent by the mobile phone is obtained by monitoring; the current Bluetooth headset is the slave headset It becomes the main headset, and obtains the audio data packet sent by the mobile phone by receiving.
  • the two earphones can determine the master-slave switching time according to the protocol; it can also indicate the master-slave switching time when the master-slave switching request is initiated.
  • the first idle period is a period during which the slave headset 200 does not perform the operation of monitoring audio data packets, and the first idle period and the period during which at least part of data of an audio data packet is monitored are in the same standard Bluetooth time slot. It should be noted that each of the above steps can be performed in the idle period, or part of the steps can be performed in the idle period; the first idle period can be a period in a standard Bluetooth time slot, or it can be distributed in different Bluetooth time slots Time period.
  • the slave headset 200 may collect the remaining power in the same first idle period and send it to the master headset 100; the slave headset 200 may also collect the remaining power in the current first idle period, and then collect the remaining power in the next first idle period. The idle period is sent to the main headset 100.
  • each standard time slot can be divided into two parts.
  • the first part of the time period t1 (which can be called the useful time period) is used to send and receive data
  • the latter part of the time period t2 (which can be called It is the idle period) is used to make the Bluetooth device hop to the standard time slot corresponding to the next frequency point in preparation.
  • the time required for the Bluetooth device to hop from one standard time slot to the next standard time slot can be made shorter. Therefore, the master earphone and the slave earphone can be in the idle period t2.
  • the slave headset can send additional packets during the idle period or obtain the remaining power of its own.
  • the first idle period t2 and the period when at least part of the audio data (data in the audio data packet 10) is monitored are in the same standard Bluetooth time slot (the nth time slot).
  • step S105 when step S105 is performed, the remaining power from the headset may be included in the response packet and sent to the main headset, so that the sending and receiving operations can be reduced and the bandwidth utilization rate can be improved.
  • an audio monitoring success response packet is sent to the master earphone 100, where the audio monitoring success response packet contains the remaining power of the slave earphone.
  • the slave earphone 200 monitors the audio data 10 on the monitoring Bluetooth link 2.
  • the audio monitoring success response is sent to the main earphone 100 during the idle period t2 in the standard Bluetooth time slot
  • the package 31 (or called the additional package 31), wherein the monitoring success response package 31 contains the remaining power of the headphone 200 itself.
  • Figure 4 illustrates the interaction process of multiple monitor success response packets (additional package 1-N) of the master and slave earphones: the first monitor success response package (see Figure 4, additional package 1)
  • additional package 1 the first monitor success response package
  • the master earphone 200 receives the monitoring success response packet (as indicated by mark 21 in FIG. 2)
  • the master earphone disassembles the monitoring success response packet 21 (additional package 1 in FIG. 4) to obtain the remaining power of the slave earphone 200.
  • the remaining power is sent through the first idle period t2, which can reduce the occupation of useful bandwidth, thereby reducing the waste of bandwidth resources. Further, by monitoring the success response packet 31 to include the remaining power of the slave headset, the occupation of bandwidth resources can be further reduced.
  • the audio monitoring success response packet may be sent to the master earphone 100 during the first most recent idle period, especially when the remaining power of the slave earphone 200 is difficult to maintain. 200 scenes of normal work.
  • the method for switching between the master and slave Bluetooth headsets further includes: when the remaining power of the slave headset 200 is less than the power threshold, in the first A request to end the Bluetooth communication is sent to the master headset 100 during an idle period; when the slave headset 200 receives the Bluetooth communication termination response sent by the master headset 100, an instruction to turn off the power of the slave headset is output to turn off the power of the slave headset.
  • a method for switching between master and slave Bluetooth headsets disclosed in the embodiment of the present invention is to send the remaining power of the slave headset to the master headset during the idle period in the standard Bluetooth time slot of the established master-slave Bluetooth link. After the difference between the remaining power of the headset and the remaining power of the master headset exceeds the preset value, the master-slave switching request is sent to the slave headset, which not only realizes the timely execution of the master-slave switching operation according to the remaining power of the master-slave headset, The battery power of the master-slave Bluetooth headset is balanced, which improves the battery life; moreover, since the master-slave switching is performed during the period when the monitoring audio data packet operation is not performed, the master-slave switching is performed in one or more steps.
  • the monitoring audio is reduced
  • the bandwidth occupancy of the data packet is to reduce the bandwidth loss; on the other hand, it will not affect the normal monitoring of multiple audio data packets from the headset according to the Bluetooth communication standard protocol, and then will not cause the audio playback to freeze, which improves the user Experience.
  • This embodiment also discloses a master-slave Bluetooth headset switching method, which is used for the master headset 100. Please refer to FIG. 5, which is a flowchart of a master-slave Bluetooth headset switching method disclosed in this embodiment. Including the following steps:
  • Step S501 Receive multiple audio data packets sent by the audio source device according to the Bluetooth communication standard protocol. During this period, the headset monitors multiple audio data packets according to the Bluetooth communication standard protocol. Specifically, please refer to the description of step S101.
  • Step S503 Establish a master-slave Bluetooth link with the slave headset to perform data interaction with the slave headset. Specifically, please refer to the description of step S103.
  • Step S505 Receive the remaining power of the slave earphone sent from the earphone.
  • the remaining power of the slave headset can be received through the master-slave Bluetooth link.
  • the remaining power of the slave headset can be received through the master-slave Bluetooth link.
  • Step S507 Determine whether the difference between the remaining power of the slave earphone and the remaining power of the master earphone exceeds a preset value.
  • the master headset 100 can also collect the remaining power of the battery through its own sampling module or power monitoring module; after receiving the remaining power of the slave headset, it can compare the remaining power of the headset with the remaining power of the master headset. Make a difference to obtain the difference in the remaining power; determine whether the difference exceeds the preset value, if the difference exceeds the preset value, it indicates that the remaining power of the slave headset is too surplus relative to the remaining power of the master headset.
  • step S509 is executed.
  • the preset value can be determined based on experience. For example, when the remaining power is the percentage of the remaining power of the battery to the total battery capacity, the preset value can be set, for example, 5%-10%. It should be noted that The above numerical values are only exemplary descriptions, and the specific numerical values cannot be regarded as a limitation to the solution of the application.
  • Step S509 Send a master-slave switching request to the slave headset.
  • the master headset 100 sends a master-slave switching request to the slave headset 200 via a master-slave Bluetooth link.
  • the master-slave in order to further improve the timeliness of master-slave switching, if the remaining power of the slave headset and the remaining power of the master headset exceed a preset value, the master-slave can be sent to the slave headset 200 during the second most recent idle period.
  • the switching request especially when the difference is too large, indicates that there is a serious power imbalance between the two earphones, and the master-slave switching needs to be performed in a timely manner.
  • Step S511 Receive the master-slave switching response sent by the slave headset according to the master-slave switching request.
  • the master headset 100 receives the master-slave switching response sent by the slave headset 200 according to the master-slave switching request through the master-slave Bluetooth link.
  • the master-slave switch response can be obtained through an additional package.
  • Step S513 Perform a master-slave switching operation when the master-slave switching time comes according to the master-slave switching response. Specifically, please refer to the description of step S511.
  • step S505, step S507, step S509, step S511, and step S513 is completed within the second idle period.
  • the second idle period is a period during which the main headset 100 does not perform the operation of receiving audio data packets, and the second idle period is in the same standard Bluetooth time slot as at least part of the data period during which one audio data packet is received. It should be noted that each of the above steps can be performed in the idle period, or part of the steps can be performed in the idle period; the second idle period can be a period in a standard Bluetooth time slot, or it can be distributed in different standard Bluetooth time slots Time period.
  • the two earphones can determine the master-slave switching time according to the protocol; or when the master-slave switching request is initiated, the master-slave switching time can be indicated.
  • the master-slave switching request is used to indicate the master-slave switching time
  • the time position of the second idle period that carries the master-slave switching request can be used to indicate which time slot is used for the master-slave switching, that is, the second idle period is divided into more times.
  • the master-slave switching request is sent in the small time period.
  • the agreed formula can indicate the corresponding standard time slot for master-slave switching, thereby reducing information transmission and improving bandwidth utilization rate.
  • the second idle period please refer to the example description of the first idle period.
  • the principle is similar; the difference is that the useful period and the mobile phone interact in a different way, with the slave earphone for monitoring and the main earphone for receiving.
  • step S505 when step S505 is performed, the remaining power of the slave earphone can be obtained by disassembling the listening success response packet of the slave earphone, so that the sending and receiving operations can be reduced and the bandwidth utilization rate can be improved.
  • step S505 includes: receiving an audio monitoring success response packet sent from the headset 200, where the audio monitoring success response packet indicates that the current audio data packet sent by the audio source device is successfully monitored from the headset 200; The remaining battery power of the headset. Specifically, please refer to the description of FIG. 2 and FIG. 4 in the above embodiment. After disassembling the remaining power of the slave headset, it can be compared with the remaining power of the master headset collected by the master headset 100 to determine whether it is greater than the preset value. .
  • the master-slave Bluetooth headset switching method further includes: receiving the end Bluetooth communication sent from the headset 200 during the second idle period Request; send and receive a response to the end of the Bluetooth communication request to the slave earphone 200; output an instruction to turn off the power of the main earphone 100 according to the end of the Bluetooth communication request to turn off the power of the main earphone 100.
  • This embodiment discloses a master-slave Bluetooth headset switching method, by receiving the remaining power of the slave headset sent by the slave headset during the idle period in the standard Bluetooth time slot of the established master-slave Bluetooth link, the master headset is After the difference between the remaining power of the headset and the remaining power of the master headset exceeds the preset value, the master-slave switching request is sent to the slave headset, which not only realizes the timely execution of the master-slave switching operation according to the remaining power of the master-slave headset,
  • the battery power of the master-slave Bluetooth headset is balanced, which improves the battery life; moreover, because the master-slave switching is performed in one or more steps during the period when the operation of receiving audio data packets is not performed, on the one hand, the received audio is reduced
  • the bandwidth occupancy of the data packet is to reduce the bandwidth loss; on the other hand, it will not affect the main headset to receive multiple audio data packets normally according to the Bluetooth communication standard protocol, and then will not cause the audio playback to freeze, which improves the user Experience.
  • This embodiment also discloses a master-slave Bluetooth headset switching method. Please refer to FIG. 6, which is a timing diagram of a master-slave Bluetooth headset switching method disclosed in this embodiment.
  • the master-slave Bluetooth headset switching method includes the following steps:
  • Step S901 The main earphone 100 receives multiple audio data packets sent by the audio source device according to the Bluetooth communication standard protocol. Specifically, please refer to the description of the foregoing embodiment, which will not be repeated here.
  • Step S903 monitor multiple audio data packets sent by the audio source device from the headset 200 according to the Bluetooth communication standard protocol. Specifically, please refer to the description of the foregoing embodiment, which will not be repeated here.
  • Step S905 the master headset 100 and the slave headset 200 establish a master-slave Bluetooth link, so that the master headset 100 and the slave headset 200 perform data interaction.
  • the master headset 100 and the slave headset 200 perform data interaction.
  • Step S907 the slave earphone 200 sends the remaining power of the slave earphone to the master earphone 100. Specifically, please refer to the description of the foregoing embodiment, which will not be repeated here.
  • Step S909 the master earphone 100 receives the remaining power of the slave earphone sent from the earphone 200. Specifically, please refer to the description of the foregoing embodiment, which will not be repeated here.
  • Step S911 The master headset 100 determines whether the remaining power of the slave headset and the remaining power of the master headset exceed a preset value. If the difference between the remaining power of the slave earphone and the remaining power of the master earphone exceeds the preset value, step S913 is executed. Specifically, please refer to the description of the foregoing embodiment, which will not be repeated here.
  • Step S913 the master headset 100 sends a master-slave switching request to the slave headset 200.
  • the master headset 100 sends a master-slave switching request to the slave headset 200.
  • Step S915 Receive the master-slave switching request sent by the master headset 100 from the headset 200. Specifically, please refer to the description of the foregoing embodiment, which will not be repeated here.
  • Step S917 The slave headset 200 sends a master-slave switching response to the master headset 100 according to the master-slave switching request. Specifically, please refer to the description of the foregoing embodiment, which will not be repeated here.
  • Step S919 the master headset 100 receives the master-slave switching response. Specifically, please refer to the description of the foregoing embodiment, which will not be repeated here.
  • Step S921 the master headset 100 and the slave headset 200 perform a master-slave switching operation when the master-slave switching time comes. Specifically, please refer to the description of the foregoing embodiment, which will not be repeated here.
  • step S907, S915, step S917, and step S921 is completed within the first idle period.
  • the first idle period is the period during which the slave headset 200 does not perform the operation of monitoring audio data packets, and the first idle period is equal to The period during which at least part of the data of an audio data packet is monitored is in the same standard Bluetooth time slot; in the above steps, at least one of step S909, step S911, step S913, step S919, and step S921 is completed in the second idle period
  • the second idle period is a period during which the main headset 100 does not perform the operation of receiving an audio data packet, and the second idle period and at least part of the data period during which an audio data packet is received are in the same standard Bluetooth time slot. Specifically, please refer to the description of the foregoing embodiment, which will not be repeated here.
  • FIG. 7 is a schematic diagram of the data receiving and forwarding process of a system composed of a mobile phone, a master headset, and a slave headset disclosed in this embodiment.
  • the data packet such as data packet 1
  • the main headset receives the data packet sent by the mobile phone (such as data packet 1 and data packet 2), which means the transmission is successfully received Acknowledge ACK to the mobile phone (for example, as indicated by marker 22 in Figure 2).
  • the master headset communicates with the slave headset.
  • the master headset forwards the data packet 2 that is not received from the headset to the slave headset.
  • the master headset After receiving the data packet 2 from the headset, it sends a monitor success response ACK to the master headset (for example, 2). After receiving the ACK, the master headset sends a forwarding completion message to the slave headset, and the slave headset sends a response ACK to the master headset again. After receiving the ACK, the master headset ends the communication between the master and slave headsets. Communication, the main headset communicates with the mobile phone again to continue receiving audio data.
  • the additional package sent from the headset to the master headset contains the remaining power of the slave headset itself; after the master headset receives the additional package, the additional package is parsed to obtain the slave headset
  • the master headset also obtains the remaining power of its own master headset; the master headset compares the remaining power of the slave headset with the remaining power of the master headset: if the power of the slave headset is more sufficient, the master headset sends a master-slave switching request to the slave headset; If the power of the master headset is more sufficient, the master headset will not send a master-slave switching request.
  • the master headset decides to send a master-slave switching request, the master headset sends a master-slave switching request to the slave headset (for example, as shown by mark 23 in FIG. 2);
  • the slave headset after receiving the master-slave switching request, the slave headset sends an approval request response to the master headset, and the slave headset marks itself as the master headset and keeps the monitoring state. For example, after the slave headset receives the master-slave switching request during the idle period of the standard time slot, it sends an approval request response to the master headset, and the slave headset marks itself as the master headset and keeps the monitoring state;
  • the master headset After the master headset receives the response to the consent request sent from the headset, it marks itself as the slave headset and switches to the monitoring state, and then sends a role switch command (SWITCH START) to the slave headset;
  • SWITCH START role switch command
  • the ACK reply is returned to the main headset, and a Bluetooth communication connection is established with the mobile phone. Since then, the slave headset becomes the main headset.
  • the remaining power of the master headset and the slave headset is as balanced as possible, until the remaining power of any headset reaches the power threshold, and the master headset needs to be turned off at this time. From the headset, and the associated Bluetooth link.
  • the main headset After receiving the command to disconnect the Bluetooth connection, the main headset sends a request to close the baseband link to the mobile phone;
  • the mobile phone After receiving the request to close the baseband link, the mobile phone sends a closed baseband link response to the main headset, and then closes the baseband link;
  • the master earphone After the master earphone receives the response of the closed baseband link, it sends the message that the baseband link has been closed to the slave earphone;
  • the slave headset After receiving the information that the baseband link is closed, the slave headset sends an acknowledgement (ACK) to the master headset, then disconnects the Bluetooth link between the master and slave headsets, and then turns off the power of the slave headset;
  • ACK acknowledgement
  • the main headset After the main headset receives the response, it sends a disconnect message to the mobile phone, and then turns off the power of the main headset.
  • the processing procedure for the slave headset to reach the power threshold can be referred to.
  • FIG. 10a is a schematic structural diagram of a master-slave Bluetooth headset switching device from the headset side disclosed in this embodiment.
  • the device includes: monitor The module 101, the first establishing module 102, the power sending module 103, the request receiving module 104, the answering module 105 and the first switching module 106, wherein:
  • the monitoring module 101 is used to monitor multiple audio data packets sent by the audio source device according to the Bluetooth communication standard protocol. During this period, the main headset receives multiple audio data packets according to the Bluetooth communication standard protocol; the first establishing module 102 is used to establish a master-slave with the main headset Bluetooth link for data interaction with the master headset; the power sending module 103 is used to send the remaining power of the slave headset to the master headset 100; the request receiving module 104 is used to receive the master-slave switching request sent by the master headset, where the master headset is in After the difference between the remaining power of the slave headset and the remaining power of the master headset exceeds a preset value, send a master-slave switching request to the slave headset; the response module 105 is configured to send a master-slave switching response to the master headset 100 according to the master-slave switching request; And the first switching module 106 is configured to perform the master-slave switching operation when the master-slave switching time comes after the master headset 100 receives the master-slave switching response;
  • the first idle period is the period during which the slave earphone 200 does not perform the operation of monitoring audio data packets
  • the first idle period The idle period and the period when at least part of the data of an audio data packet is monitored are in the same standard Bluetooth time slot.
  • FIG. 10b is a schematic structural diagram of a master-slave Bluetooth headset switching device disclosed in this embodiment.
  • the device includes: data The receiving module 107, the second establishing module 108, the power receiving module 109, the power determining module 110, the request sending module 111, the response receiving module 112, and the second switching module 113, wherein:
  • the data receiving module 107 is used to receive multiple audio data packets sent by the audio source device according to the Bluetooth communication standard protocol. During the period, the slave earphone monitors multiple audio data packets according to the Bluetooth communication standard protocol; the second establishing module 108 is used to establish a master with the slave earphone.
  • the slave Bluetooth link is used to interact with the slave headset; the power receiving module 109 is used to receive the remaining power of the slave headset sent from the headset 200; the power determining module 110 is used to determine the remaining power of the slave headset and the remaining power of the master headset.
  • the request sending module 111 is configured to send a master-slave switching request to the slave headset 200 if the power judgment module determines that the remaining power of the slave headset and the remaining power of the master headset exceed the preset value;
  • the receiving module 112 is configured to receive the master-slave switching response sent by the slave headset 200 according to the master-slave switching request; and the second switching module 113 is configured to perform the master-slave switching operation when the master-slave switching time comes according to the master-slave switching response;
  • the second idle period is the period during which the main headset 100 does not perform the operation of receiving audio data packets
  • the second idle period is in the same standard Bluetooth time slot as at least part of the data period of receiving an audio data packet.
  • This embodiment also discloses a Bluetooth headset, including a processor, and the processor is configured to implement the method for slave headset disclosed in any of the foregoing embodiments.
  • This embodiment also discloses a Bluetooth headset, including a processor, and the processor is configured to implement the method for the main headset disclosed in any of the foregoing embodiments.
  • each Bluetooth headset is used to implement the method disclosed in any of the above-mentioned embodiments for the master headset and the slave headset in a time-sharing manner.
  • FIG. 11 is a schematic structural diagram of a Bluetooth headset system disclosed in this embodiment.
  • the Bluetooth headset system includes: a slave headset and a master headset, wherein:
  • the slave earphone is used to monitor and play multiple audio data packets sent by the audio source device; the main earphone is used to receive and play multiple audio data packets sent by the audio source device.
  • the slave headset and the master headset constitute a Bluetooth headset pair; the slave headset is a Bluetooth headset disclosed in any of the above embodiments for implementing the slave headset method; the master headset is a Bluetooth headset disclosed in any of the above embodiments for implementing the master headset method Bluetooth headset.
  • the master-slave relationship between the master headset and the slave headset can be interchanged.
  • This embodiment also discloses a Bluetooth audio playback system, including: an audio source device and the Bluetooth headset system disclosed in the above embodiments, wherein the audio source device is used to provide a plurality of audio data packets to the Bluetooth headset system.
  • the audio source device may be a device with a Bluetooth communication function and audio data providing function, such as a mobile phone, a tablet computer, a notebook, a video player, and the like.
  • This embodiment also discloses a computer-readable storage medium on which a computer program is stored.
  • the computer program stored in the storage medium is used to be executed to implement the method for slave earphones disclosed in any of the above-mentioned embodiments, or to implement The method for the main earphone disclosed in any of the above embodiments.
  • This embodiment also discloses a Bluetooth headset chip with an integrated circuit on it.
  • the integrated circuit is used to implement the method for slave headset disclosed in any of the above embodiments, or/and, to implement the method for slave headset disclosed in any of the above embodiments.
  • the main headset method please refer to Figure 12, which is a schematic structural diagram of a Bluetooth headset chip disclosed in this embodiment.
  • the integrated circuit on it includes a processor 121, a wireless communication module 122, and a power supply module 123. Among them:
  • the processor 121 may be a micro-control chip with certain data processing capabilities, such as a DSP, a single-chip microcomputer, etc.; the processor 121 is used to execute a program to implement the method disclosed in any of the above embodiments, and it may be the method of the slave headset or the master headset. method;
  • the wireless communication module 122 may be a module capable of implementing Bluetooth communication.
  • the wireless communication module 122 is used for communication between master and slave headsets, and for communication between Bluetooth headsets and mobile phones;
  • the power module 123 is used to provide and/or manage power to each functional circuit. It should be noted that in the specific implementation process, the power module 123 may be configured separately for the Bluetooth headset chip or shared with other chips;
  • the integrated circuit in the Bluetooth headset chip may also include an ADC module 124 for power collection; for another example, it may also include a comparator module 125 for comparison of two power levels.
  • the function of the comparator module 125 can also be implemented by the processor 121, and in this case, the comparator module 125 can be omitted.

Abstract

The present invention relates to a method and apparatus for switching master and slave Bluetooth headsets, a Bluetooth headset, and a system. The method comprises: a slave headset sends the remaining power of the slave headset to a master headset; the master headset determines whether the remaining power of the slave headset and the remaining power of the master headset exceed a preset value; if the difference between the remaining power of the slave headset and the remaining power of the master headset exceeds the preset value, the master headset sends a master-slave switching request to the slave headset; the master headset and the slave headset perform a master-slave switching operation when the master-slave switching time arrives, wherein at least one of the steps performed by the two ends is completed in an idle period, the idle period is a period during which the operation for receiving and monitoring audio data packets is not performed, and is in the same standard Bluetooth time slot as at least part of the data of one audio data packet. On the one hand, the bandwidth occupation is reduced, that is, the bandwidth loss is reduced; on the other hand, the normal reception and monitoring of multiple audio data packets will not be affected, and thus audio playback stuttering will not be caused.

Description

主从蓝牙耳机切换的方法及装置、蓝牙耳机、系统Method and device for switching master and slave bluetooth headset, bluetooth headset and system 技术领域Technical field
本发明涉及蓝牙通信领域,具体涉及一种主从蓝牙耳机切换的方法及装置、蓝牙耳机、系统。The invention relates to the field of Bluetooth communication, in particular to a method and device for switching between a master and a slave Bluetooth headset, a Bluetooth headset, and a system.
背景技术Background technique
伴随蓝牙技术的广泛推广和人民生活水平的提高,蓝牙对耳的普及率越来越高,目前,在蓝牙对耳的使用过程中,由于主耳机和从耳机产生的功耗不一致,导致主耳机的耗电速度高于从耳机的耗电速度,在两个耳机充满电后使用,主耳机常常早于从耳机断电,导致用户体验差。同时,在大多数情况下,当主耳机缺电时,用户往往会同时对主从耳机进行充电,这会降低不缺电的从耳机的使用寿命。With the widespread promotion of Bluetooth technology and the improvement of people's living standards, the penetration rate of Bluetooth earphones is getting higher and higher. At present, in the process of using Bluetooth earphones, the power consumption of the main earphone and the slave earphone is inconsistent, resulting in the main earphone The power consumption rate is higher than the power consumption rate of the slave earphones. When the two earphones are used after the two earphones are fully charged, the main earphone is often powered off earlier than the slave earphones, resulting in poor user experience. At the same time, in most cases, when the master headset is short of power, users tend to charge the master and slave headsets at the same time, which will reduce the service life of the slave headsets that do not lack power.
目前在蓝牙耳机播放音频数据的过程中,当主耳机和从耳机根据电量进行主从切换操作时,往往需要停止接收音频数据,也就是在一个标准蓝牙时隙中不再接收手机发送的音频数据,然后再进行主从切换操作,这容易造成音频播放的卡顿,用户体验很差。At present, in the process of playing audio data in Bluetooth headsets, when the master headset and slave headset perform master-slave switching operations according to the power, it is often necessary to stop receiving audio data, that is, no longer receive audio data sent by the mobile phone in a standard Bluetooth time slot. Then perform the master-slave switching operation, which is easy to cause the audio playback to freeze, and the user experience is very poor.
中国专利公开文献CN109275069A公开了主耳机和副耳机智能切换的方法、蓝牙播放设备及蓝牙耳机,其中,主耳机将电量发送给副耳机,而副耳机也将电量发送给主耳机,电池电量较高的耳机作为主耳机并主动发起与蓝牙播放设备(例如手机)的连接,电池电量较低的耳机作为副耳机。Chinese Patent Publication CN109275069A discloses a method for intelligently switching between the main earphone and the auxiliary earphone, the Bluetooth playback device and the Bluetooth earphone. Among them, the main earphone sends the power to the auxiliary earphone, and the auxiliary earphone also sends the power to the main earphone, and the battery power is relatively high. The headset of is used as the main headset and actively initiates a connection with the Bluetooth playback device (such as a mobile phone), and the headset with lower battery power is used as the secondary headset.
在该现有技术中,首先,主耳机和副耳机相互发送电量信息,导致链路传输数据过多,占用音频数据传输带宽;其次,虽然该现有技术没有介绍在每个标准蓝牙时隙中的什么时间段内传输每个耳机发送的电量信息而言,根据本领域的通常做法是,在用于传输音频数据的时间段内传输电量,即在该标准蓝牙时隙不再传输音频数据,而在下一个时隙传输音频数据,从而导致音频数据传输缓慢,进而可能导致卡顿。In this prior art, first, the main earphone and the secondary earphone send power information to each other, resulting in excessive link transmission data, occupying audio data transmission bandwidth; secondly, although this prior art is not introduced in every standard Bluetooth time slot In terms of the time period to transmit the power information sent by each headset, according to the common practice in the field, the power is transmitted during the time period for transmitting audio data, that is, no audio data is transmitted in the standard Bluetooth time slot. The audio data is transmitted in the next time slot, which results in slow audio data transmission, which may lead to stuttering.
另外,为了解决卡顿问题,中国专利公开文献CN104335642B公开了在音乐暂停或者在歌曲之间的静默时间段期间进行主从切换。虽然这种方案可以解决卡顿问题,但其依附于音频播放的时长,也就是需要在一段音频播放后才进 行主从切换,导致主从切换不及时,尤其是在连续听课或看电影期间,音频数据持续较长,使得在播放音频期间加重两个耳机功耗不一致的问题。In addition, in order to solve the lag problem, Chinese Patent Publication CN104335642B discloses performing master-slave switching during music pauses or silent periods between songs. Although this solution can solve the lag problem, it depends on the duration of audio playback, that is, the master-slave switch needs to be performed after a period of audio is played, resulting in the untimely master-slave switch, especially during continuous lectures or watching movies. The audio data lasts for a long time, which aggravates the problem of inconsistent power consumption of the two headphones during audio playback.
综上,如何及时进行主从切换减小两个耳机功耗不一致,并消减音频卡顿现象成为亟待解决的技术问题。In summary, how to perform a master-slave switch in time to reduce the inconsistency of the power consumption of the two headphones and reduce the audio stuttering has become a technical problem that needs to be solved urgently.
发明内容Summary of the invention
基于上述现状,本发明的主要目的在于提供一种主从蓝牙耳机切换的方法及装置、蓝牙耳机、系统,既实现了使主从蓝牙耳机的电池电量均衡,提高了电池使用寿命,又不会造成音频播放的卡顿,提升了用户体验。Based on the above situation, the main purpose of the present invention is to provide a method and device for switching between master and slave Bluetooth headsets, Bluetooth headsets, and systems, which not only achieve the balance of the battery power of the master and slave Bluetooth headsets, improve the battery life, but not It causes the audio playback to freeze and improves the user experience.
为此,根据第一方面,本发明实施例公开了一种主从蓝牙耳机切换方法,用于主耳机和从耳机,该方法包括:To this end, according to the first aspect, an embodiment of the present invention discloses a master-slave Bluetooth headset switching method, which is used for a master headset and a slave headset, and the method includes:
步骤S901:主耳机按蓝牙通信标准协议接收音源设备发送的多个音频数据包;步骤S903:从耳机按蓝牙通信标准协议监听音源设备发送的多个音频数据包;步骤S905:主耳机与从耳机建立主从蓝牙链路,以使主耳机与从耳机进行数据交互;步骤S907:从耳机向主耳机发送从耳机的剩余电量;步骤S909:主耳机接收从耳机发送的从耳机的剩余电量;步骤S911:主耳机判断从耳机的剩余电量与主耳机的剩余电量是否超过预设值;步骤S913:如果从耳机的剩余电量与主耳机的剩余电量之间的差值超过预设值,则主耳机向从耳机发送主从切换请求;步骤S915:从耳机接收主耳机发送的主从切换请求;步骤S917:从耳机根据主从切换请求向主耳机发送主从切换应答;步骤S919:主耳机接收主从切换应答;及步骤S921:当主耳机接收到主从切换应答后,主耳机和从耳机在主从切换时间到来时执行主从切换操作;其中,步骤S907、S915、步骤S917和步骤S921中的至少一个在第一空闲时段内完成,第一空闲时段为从耳机未执行监听音频数据包操作的时段,且第一空闲时段与监听到一个音频数据包的至少部分数据的时段处于同一标准蓝牙时隙内;其中,步骤S909、步骤S911、步骤S913、步骤S919和和步骤S921中的至少一个在第二空闲时段内完成,第二空闲时段为主耳机未执行接收音频数据包操作的时段,且第二空闲时段与接收到一个音频数据包的至少部分数据时段处于同一标准蓝牙时隙内。Step S901: The main earphone receives multiple audio data packets sent by the audio source device according to the Bluetooth communication standard protocol; Step S903: The slave earphone monitors multiple audio data packets sent by the audio source device according to the Bluetooth communication standard protocol; Step S905: The main earphone and the slave earphone Establish a master-slave Bluetooth link to enable the master headset to interact with the slave headset; step S907: the slave headset sends the remaining power of the slave headset to the master headset; step S909: the master headset receives the remaining power of the slave headset sent from the headset; step S911: The master headset judges whether the remaining power of the slave headset and the remaining power of the master headset exceed the preset value; step S913: if the difference between the remaining power of the slave headset and the remaining power of the master headset exceeds the preset value, the master headset Send a master-slave switching request to the slave earphone; step S915: receive the master-slave switching request sent by the master earphone from the earphone; step S917: send a master-slave switching response to the master earphone according to the master-slave switching request; step S919: the master earphone receives the master Slave switching response; and step S921: when the master headset receives the master-slave switching response, the master headset and the slave headset perform the master-slave switching operation when the master-slave switching time comes; among them, steps S907, S915, step S917, and step S921 At least one is completed in the first idle period, the first idle period is the period during which the operation of listening to audio data packets is not performed from the headset, and the first idle period and the period during which at least part of the data of an audio data packet is monitored are in the same standard Bluetooth In the slot; wherein, at least one of step S909, step S911, step S913, step S919, and step S921 is completed in the second idle period, the second idle period is the period during which the main headset does not perform the operation of receiving audio data packets, and The second idle period is in the same standard Bluetooth time slot as at least part of the data period of receiving an audio data packet.
本发明实施例公开的一种主从蓝牙耳机切换方法,通过在已建立的主从蓝 牙链路的标准蓝牙时隙内的空闲时段内,向主耳机发送从耳机的剩余电量,主耳机在从耳机的剩余电量与主耳机的剩余电量之间的差值超过预设值后向从耳机发送主从切换请求,进而,不仅实现了依据主从耳机剩余电量的大小及时地执行主从切换操作,使得主从蓝牙耳机的电池电量均衡,提高了电池使用寿命;而且,由于是在未执行接收、监听音频数据包操作的时段进行主从切换的一步或多步操作,因此,一方面,减小接收、监听音频数据包的带宽占用,也就是减小了带宽损耗;另一方面,不会影响主、从耳机按蓝牙通信标准协议正常接收、监听多个音频数据包,继而,不会造成音频播放的卡顿,提升了用户体验。A method for switching between master and slave Bluetooth headsets disclosed in the embodiment of the present invention is to send the remaining power of the slave headset to the master headset during the idle period in the standard Bluetooth time slot of the established master-slave Bluetooth link. After the difference between the remaining power of the headset and the remaining power of the master headset exceeds the preset value, the master-slave switching request is sent to the slave headset, which not only realizes the timely execution of the master-slave switching operation according to the remaining power of the master-slave headset, The battery power of the master-slave Bluetooth headset is balanced, and the battery life is improved; moreover, since the master-slave switching is performed in one or more steps during the period when the operation of receiving and monitoring audio data packets is not performed, on the one hand, it reduces Receiving and monitoring the bandwidth occupation of audio data packets, that is, reducing the bandwidth loss; on the other hand, it will not affect the normal reception and monitoring of multiple audio data packets according to the Bluetooth communication standard protocol by the master and slave headphones, and then, no audio will be caused. The playback freezes, which improves the user experience.
根据第二方面,本发明实施例公开了一种主从蓝牙耳机切换方法,用于从耳机,其特征在于,所述方法包括如下步骤:According to a second aspect, an embodiment of the present invention discloses a method for switching between a master and a slave Bluetooth headset, which is used for a slave headset, and is characterized in that the method includes the following steps:
步骤S101:按蓝牙通信标准协议监听音源设备发送的多个音频数据包,期间,主耳机按蓝牙通信标准协议接收多个音频数据包;步骤S103:与主耳机建立主从蓝牙链路,以与主耳机进行数据交互;步骤S105:向主耳机发送从耳机的剩余电量;步骤S107:接收主耳机发送的主从切换请求,其中,主耳机在从耳机的剩余电量与主耳机的剩余电量之间的差值超过预设值后向从耳机发送主从切换请求;步骤S109:根据主从切换请求向主耳机发送主从切换应答;及步骤S111:当主耳机100接收到主从切换应答后,在主从切换时间到来时执行主从切换操作;其中,步骤S105、S107、S109和S111中的至少一个在第一空闲时段内完成,第一空闲时段为从耳机未执行监听音频数据包操作的时段,且第一空闲时段与监听到一个音频数据包的至少部分数据的时段处于同一标准蓝牙时隙内。Step S101: Monitor multiple audio data packets sent by the audio source device according to the Bluetooth communication standard protocol, during which the master headset receives multiple audio data packets according to the Bluetooth communication standard protocol; Step S103: Establish a master-slave Bluetooth link with the master headset to communicate with The master headset performs data interaction; step S105: send the remaining power of the slave headset to the master headset; step S107: receive the master-slave switching request sent by the master headset, where the master headset is between the remaining power of the slave headset and the remaining power of the master headset After the difference exceeds the preset value, send a master-slave switching request to the slave headset; step S109: send a master-slave switching response to the master headset according to the master-slave switching request; and step S111: when the master headset 100 receives the master-slave switching response, The master-slave switching operation is performed when the master-slave switching time comes; wherein at least one of steps S105, S107, S109, and S111 is completed in the first idle period, which is the period during which the slave headset does not perform the operation of monitoring audio data packets , And the first idle period is in the same standard Bluetooth time slot as the period when at least part of the data of an audio data packet is monitored.
本发明实施例公开的一种主从蓝牙耳机切换方法,通过在已建立的主从蓝牙链路的标准蓝牙时隙内的空闲时段内,向主耳机发送从耳机的剩余电量,主耳机在从耳机的剩余电量与主耳机的剩余电量之间的差值超过预设值后向从耳机发送主从切换请求,进而,不仅实现了依据主从耳机剩余电量的大小及时地执行主从切换操作,使得主从蓝牙耳机的电池电量均衡,提高了电池使用寿命;而且,由于是在未执行监听音频数据包操作的时段进行主从切换的一步或多步操作,因此,一方面,减小监听音频数据包的带宽占用,也就是减小了带宽损耗;另一方面,不会影响从耳机按蓝牙通信标准协议正常监听多个音频数据包,继而,不会造成音频播放的卡顿,提升了用户体验。A method for switching between master and slave Bluetooth headsets disclosed in the embodiment of the present invention is to send the remaining power of the slave headset to the master headset during the idle period in the standard Bluetooth time slot of the established master-slave Bluetooth link. After the difference between the remaining power of the headset and the remaining power of the master headset exceeds the preset value, the master-slave switching request is sent to the slave headset, which not only realizes the timely execution of the master-slave switching operation according to the remaining power of the master-slave headset, The battery power of the master-slave Bluetooth headset is balanced, which improves the battery life; moreover, since the master-slave switching is performed during the period when the monitoring audio data packet operation is not performed, the master-slave switching is performed in one or more steps. Therefore, on the one hand, the monitoring audio is reduced The bandwidth occupancy of the data packet is to reduce the bandwidth loss; on the other hand, it will not affect the normal monitoring of multiple audio data packets from the headset according to the Bluetooth communication standard protocol, and then will not cause the audio playback to freeze, which improves the user Experience.
可选地,所述步骤S105包括:当所述从耳机监听到所述音源设备发送的当前的音频数据包后,向所述主耳机发送音频监听成功应答包,其中,所述音频监听成功应答包中包含所述从耳机的剩余电量。Optionally, the step S105 includes: after the slave earphone monitors the current audio data packet sent by the audio source device, sending an audio monitor success response packet to the master earphone, wherein the audio monitor successfully answers The package contains the remaining power of the slave headset.
可选地,在最近的第一空闲时段向所述主耳机发送音频监听成功应答包。Optionally, an audio monitoring success response packet is sent to the main earphone in the most recent first idle period.
可选地,还包括:当所述从耳机的剩余电量小于电量阈值后,在所述第一空闲时段向所述主耳机发送结束蓝牙通信请求;当所述从耳机接收到所述主耳机发送的结束蓝牙通信应答后,输出关闭所述从耳机电源的指示,以关闭所述从耳机的电源。Optionally, the method further includes: when the remaining power of the slave headset is less than the power threshold, sending a Bluetooth communication end request to the master headset during the first idle period; when the slave headset receives the master headset sending After completing the Bluetooth communication response, output an instruction to turn off the power of the slave headset to turn off the power of the slave headset.
根据第三方面,本发明实施例公开了一种主从蓝牙耳机切换方法,用于主耳机,所述方法包括如下步骤:According to the third aspect, an embodiment of the present invention discloses a master-slave Bluetooth headset switching method for the master headset. The method includes the following steps:
步骤S501:按蓝牙通信标准协议接收音源设备发送的多个音频数据包,期间,从耳机按蓝牙通信标准协议监听多个音频数据包;步骤S503:与从耳机建立主从蓝牙链路,以与从耳机进行数据交互;步骤S505:接收从耳机发送的从耳机的剩余电量;步骤S507:判断从耳机的剩余电量与主耳机的剩余电量之间的差值是否超过预设值;步骤S509:如果从耳机的剩余电量与主耳机的剩余电量超过预设值,则向从耳机发送主从切换请求;步骤S511:接收从耳机根据主从切换请求发送的主从切换应答;及步骤S513:根据主从切换应答在主从切换时间到来时执行主从切换操作;其中,步骤S505、步骤S507、步骤S509、步骤S511和步骤S513中的至少一个在第二空闲时段内完成,第二空闲时段为主耳机未执行接收音频数据包操作的时段,且第二空闲时段与接收到一个音频数据包的至少部分数据时段处于同一标准蓝牙时隙内。Step S501: Receive multiple audio data packets sent by the audio source device according to the Bluetooth communication standard protocol, during which the slave headset monitors multiple audio data packets according to the Bluetooth communication standard protocol; Step S503: Establish a master-slave Bluetooth link with the slave headset to communicate with Perform data interaction from the headset; Step S505: Receive the remaining power of the slave headset sent from the headset; Step S507: Determine whether the difference between the remaining power of the slave headset and the remaining power of the main headset exceeds the preset value; Step S509: If If the remaining power of the slave headset and the remaining power of the master headset exceed the preset value, a master-slave switching request is sent to the slave headset; step S511: receiving a master-slave switching response sent by the slave headset according to the master-slave switching request; and step S513: according to the master The slave handover response executes the master-slave handover operation when the master-slave handover time comes; wherein, at least one of step S505, step S507, step S509, step S511, and step S513 is completed in the second idle period, and the second idle period is the main The period during which the earphone does not perform the operation of receiving audio data packets, and the second idle period is in the same standard Bluetooth time slot as at least part of the data period during which one audio data packet is received.
本发明实施例公开的一种主从蓝牙耳机切换方法,通过在已建立的主从蓝牙链路的标准蓝牙时隙内的空闲时段内,向主耳机发送从耳机的剩余电量,主耳机在从耳机的剩余电量与主耳机的剩余电量之间的差值超过预设值后向从耳机发送主从切换请求,进而,不仅实现了依据主从耳机剩余电量的大小及时地执行主从切换操作,使得主从蓝牙耳机的电池电量均衡,提高了电池使用寿命;而且,由于是在未执行接收、监听音频数据包操作的时段进行主从切换的一步或多步操作,因此,一方面,减小接收音频数据包的带宽占用,也就是减小了带宽损耗;另一方面,不会影响主耳机按蓝牙通信标准协议正常接收多个音频数据包,继而,不会造成音频播放的卡顿,提升了用户体验。A method for switching between master and slave Bluetooth headsets disclosed in the embodiment of the present invention is to send the remaining power of the slave headset to the master headset during the idle period in the standard Bluetooth time slot of the established master-slave Bluetooth link. After the difference between the remaining power of the headset and the remaining power of the master headset exceeds the preset value, the master-slave switching request is sent to the slave headset, which not only realizes the timely execution of the master-slave switching operation according to the remaining power of the master-slave headset, The battery power of the master-slave Bluetooth headset is balanced, and the battery life is improved; moreover, since the master-slave switching is performed in one or more steps during the period when the operation of receiving and monitoring audio data packets is not performed, on the one hand, it reduces The bandwidth occupancy of receiving audio data packets is reduced; on the other hand, it will not affect the main earphone to receive multiple audio data packets normally according to the Bluetooth communication standard protocol, and then will not cause the audio playback to freeze and improve Improve the user experience.
可选地,步骤S505包括:接收从耳机发送的音频监听成功应答包,音频 监听成功应答包表示从耳机成功监听到音源设备发送的当前的音频数据包;从音频监听成功应答包中获取从耳机的剩余电量。Optionally, step S505 includes: receiving an audio monitoring success response packet sent from the headset, where the audio monitoring success response packet indicates that the current audio data packet sent by the audio source device is successfully monitored from the headset; and the audio monitoring success response packet is obtained from the headset The remaining battery power.
可选地,步骤S509包括:如果从耳机的剩余电量与主耳机的剩余电量超过预设值,则在最近的第二空闲时段向从耳机发送主从切换请求。Optionally, step S509 includes: if the remaining power of the slave headset and the remaining power of the master headset exceed a preset value, sending a master-slave switching request to the slave headset in the nearest second idle period.
可选地,还包括:在第二空闲时段接收从耳机发送的结束蓝牙通信请求;向从耳机发送接收到结束蓝牙通信请求的应答;根据结束蓝牙通信请求输出关闭主耳机电源的指示,以关闭主耳机的电源。Optionally, the method further includes: receiving an end Bluetooth communication request sent from the earphone in the second idle period; sending a response to the end Bluetooth communication request to the slave earphone; and outputting an instruction to turn off the power of the main earphone according to the end Bluetooth communication request to shut down The power supply of the main headset.
根据第四方面,本发明实施例公开了一种主从蓝牙耳机切换装置,包括:According to the fourth aspect, an embodiment of the present invention discloses a master-slave Bluetooth headset switching device, including:
监听模块,用于按蓝牙通信标准协议监听音源设备发送的多个音频数据包,期间,主耳机按蓝牙通信标准协议接收多个音频数据包;第一建立模块,用于与主耳机建立主从蓝牙链路,以与主耳机进行数据交互;电量发送模块,用于向主耳机发送从耳机的剩余电量;请求接收模块,用于接收主耳机发送的主从切换请求,其中,主耳机在从耳机的剩余电量与主耳机的剩余电量之间的差值超过预设值后向从耳机发送主从切换请求;应答模块,用于根据主从切换请求向主耳机发送主从切换应答;及第一切换模块,用于当主耳机接收到主从切换应答后,在主从切换时间到来时执行主从切换操作;其中,电量发送模块、请求接收模块、应答模块和第一切换模块中的至少一个在第一空闲时段内完成,第一空闲时段为从耳机未执行监听音频数据包操作的时段,且第一空闲时段与监听到一个音频数据包的至少部分数据的时段处于同一标准蓝牙时隙内;The monitoring module is used to monitor multiple audio data packets sent by the audio source device according to the Bluetooth communication standard protocol. During this period, the main earphone receives multiple audio data packets according to the Bluetooth communication standard protocol; the first establishment module is used to establish a master-slave with the main earphone Bluetooth link for data interaction with the main earphone; power sending module for sending the remaining power of the slave earphone to the main earphone; request receiving module for receiving the master-slave switching request sent by the main earphone, where the main earphone is in the slave After the difference between the remaining power of the headset and the remaining power of the main headset exceeds the preset value, send a master-slave switching request to the slave headset; the response module is used to send a master-slave switching response to the master headset according to the master-slave switching request; and A switching module for performing a master-slave switching operation when the master-slave switching time comes after the master headset receives the master-slave switching response; wherein, at least one of the power sending module, the request receiving module, the response module, and the first switching module Completed in the first idle period, the first idle period is the period during which the headset does not perform the operation of monitoring audio data packets, and the first idle period and the period during which at least part of the data of an audio data packet is monitored are in the same standard Bluetooth time slot ;
可选地,还包括:数据接收模块,用于按蓝牙通信标准协议接收音源设备发送的多个音频数据包,期间,从耳机按蓝牙通信标准协议监听多个音频数据包;第二建立模块,用于与从耳机建立主从蓝牙链路,以与从耳机进行数据交互;电量接收模块,用于接收从耳机发送的从耳机的剩余电量;电量判断模块,用于判断从耳机的剩余电量与主耳机的剩余电量之间的差值是否超过预设值;请求发送模块,用于如果电量判断模块判断出从耳机的剩余电量与主耳机的剩余电量超过预设值,则向从耳机发送主从切换请求;应答接收模块,用于接收从耳机根据主从切换请求发送的主从切换应答;及第二切换模块,用于根据主从切换应答在主从切换时间到来时执行主从切换操作;其中,电量发送模块、请求接收模块、应答模块和第一切换模块中的至少一个在第二空闲时段内完成,第二空闲时段为主耳机未执行接收音频数据包操作的时段,且第二空闲时段与接收到一个音频数据包的至少部分数据时段处于同一标准蓝牙时隙内。Optionally, it further includes: a data receiving module, configured to receive multiple audio data packets sent by the audio source device according to the Bluetooth communication standard protocol, during which the multiple audio data packets are monitored from the headset according to the Bluetooth communication standard protocol; a second establishment module, It is used to establish a master-slave Bluetooth link with the slave headset to interact with the slave headset; the power receiving module is used to receive the remaining power of the slave headset sent from the headset; the power judging module is used to determine the remaining power of the slave headset and Whether the difference between the remaining power of the master earphone exceeds the preset value; the request sending module is used to send the master to the slave earphone if the power judgment module determines that the remaining power of the slave earphone and the remaining power of the master earphone exceed the preset value. Slave switching request; response receiving module, used to receive the master-slave switching response sent by the slave headset according to the master-slave switching request; and the second switching module, used to perform the master-slave switching operation when the master-slave switching time comes according to the master-slave switching response Wherein, at least one of the power sending module, the request receiving module, the answering module and the first switching module is completed in the second idle period, the second idle period is the period during which the main headset does not perform the operation of receiving audio data packets, and the second The idle period is in the same standard Bluetooth time slot as at least part of the data period when an audio data packet is received.
根据第五方面,本发明实施例公开了一种蓝牙耳机,包括处理器,处理器用于实现上述第二方面任意公开的方法。According to the fifth aspect, an embodiment of the present invention discloses a Bluetooth headset, including a processor, and the processor is configured to implement any method disclosed in the second aspect.
根据第六方面,本发明实施例公开了一种蓝牙耳机,包括处理器,处理器用于实现上述第三方面任意公开的方法。According to the sixth aspect, an embodiment of the present invention discloses a Bluetooth headset, including a processor, and the processor is configured to implement any method disclosed in the third aspect.
根据第七方面,本发明实施例公开了一种蓝牙耳机系统,包括:从耳机,用于监听并播放音源设备发送的多个音频数据包;及主耳机,用于接收并播放音源设备发送的多个音频数据包;其中,从耳机和主耳机构成蓝牙耳机对;从耳机为上述第五方面任意公开的蓝牙耳机;主耳机为上述第六方面任意公开的蓝牙耳机。According to a seventh aspect, an embodiment of the present invention discloses a Bluetooth headset system, including: a slave headset for monitoring and playing multiple audio data packets sent by the audio source device; and a master headset for receiving and playing the audio data packets sent by the audio source device. A plurality of audio data packets; among them, the slave headset and the master headset constitute a Bluetooth headset pair; the slave headset is the Bluetooth headset arbitrarily disclosed in the fifth aspect; the master headset is the Bluetooth headset arbitrarily disclosed in the sixth aspect.
根据第八方面,本发明实施例公开了一种蓝牙音频播放系统,包括:According to the eighth aspect, an embodiment of the present invention discloses a Bluetooth audio playback system, including:
上述第七方面任意公开的蓝牙耳机系统;及音源设备,用于向蓝牙耳机系统提供多个音频数据包。The bluetooth earphone system disclosed in any of the above seventh aspect; and the audio source device, which is used to provide a plurality of audio data packets to the bluetooth earphone system.
可选地,音源设备可以是手机、平板电脑、笔记本、影音播放器等具有蓝牙通信功能和音频数据提供功能的设备。Optionally, the audio source device may be a mobile phone, a tablet computer, a notebook, an audio-visual player, and other devices that have a Bluetooth communication function and an audio data providing function.
根据第九方面,本发明实施例公开了一种蓝牙耳机芯片,其上具有集成电路,集成电路用于实现上述第二方面任意公开的方法;或者/和,用于实现上述第三方面任意公开的方法。According to the ninth aspect, an embodiment of the present invention discloses a Bluetooth headset chip with an integrated circuit thereon, and the integrated circuit is used to implement any disclosed method of the above-mentioned second aspect; or/and, used to implement any of the above-mentioned third aspect disclosed Methods.
根据第十方面,本发明实施例公开了一种计算机可读存储介质,其上存储有计算机程序,存储介质中存储的计算机程序用于被执行实现上述第二方面任意公开的方法;或者,用于实现上述第三方面任意公开的方法。According to the tenth aspect, an embodiment of the present invention discloses a computer-readable storage medium on which a computer program is stored, and the computer program stored in the storage medium is used to be executed to implement any method disclosed in the second aspect; or, To implement the method disclosed in the third aspect above.
附图说明Description of the drawings
以下将参照附图对根据本发明的的优选实施方式进行描述。图中:Hereinafter, preferred embodiments according to the present invention will be described with reference to the accompanying drawings. In the picture:
图1为本发明一种实施例的三端系统示意图;Figure 1 is a schematic diagram of a three-terminal system according to an embodiment of the present invention;
图2是本发明一种实施例的通信时隙示意图;Figure 2 is a schematic diagram of a communication time slot according to an embodiment of the present invention;
图3是本发明实施例公开的一种用于从耳机的主从蓝牙耳机切换方法流程图;FIG. 3 is a flowchart of a method for switching between master and slave Bluetooth headsets for slave headsets disclosed in an embodiment of the present invention;
图4是本发明实施例公开的一种剩余电量传输方式的示意图;4 is a schematic diagram of a remaining power transmission method disclosed in an embodiment of the present invention;
图5是本发明实施例公开的一种用于主耳机的主从蓝牙耳机切换方法流程图;FIG. 5 is a flowchart of a method for switching between master and slave Bluetooth headsets for master headsets disclosed in an embodiment of the present invention;
图6是本发明实施例公开的一种主从蓝牙耳机切换方法时序图;6 is a timing diagram of a method for switching between master and slave Bluetooth headsets disclosed in an embodiment of the present invention;
图7是本发明实施例公开的一种三端系统数据收发、转发流程示意图;FIG. 7 is a schematic diagram of a three-terminal system data receiving and forwarding process disclosed in an embodiment of the present invention;
图8是本发明实施例公开的一种主从切换过程示意图;FIG. 8 is a schematic diagram of a master-slave switching process disclosed in an embodiment of the present invention;
图9是本发明实施例公开的一种蓝牙耳机关机过程示意图;FIG. 9 is a schematic diagram of a shutdown process of a Bluetooth headset disclosed in an embodiment of the present invention;
图10a是本发明实施例公开的一种用于从耳机的主从蓝牙耳机切换装置结构图;Figure 10a is a structural diagram of a master-slave Bluetooth headset switching device for slave headsets disclosed in an embodiment of the present invention;
图10b是本发明实施例公开的一种用于主耳机的主从蓝牙耳机切换装置结构图;Fig. 10b is a structural diagram of a master-slave Bluetooth headset switching device for a master headset disclosed in an embodiment of the present invention;
图11是本发明实施例公开的一种蓝牙耳机系统结构示意图;FIG. 11 is a schematic diagram of the structure of a Bluetooth headset system disclosed in an embodiment of the present invention;
图12是本发明实施例公开的一种蓝牙耳机芯片结构示意图。Fig. 12 is a schematic structural diagram of a Bluetooth headset chip disclosed in an embodiment of the present invention.
具体实施方式Detailed ways
为了使本申请的目的、技术方案和优点更加清楚,下面将结合附图对本申请作进一步地详细描述,显然,所描述的实施例仅仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其它实施例,都属于本申请保护的范围。In order to make the purpose, technical solutions, and advantages of the application more clear, the application will be further described in detail below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the application, rather than all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by those of ordinary skill in the art without creative work shall fall within the protection scope of this application.
现在将详细说明本发明的实施例,其实施例由附图示出,其中,相同的标号始终指的是相同的部件。下面,示例性实施例被描述以参考附图解释本发明。The embodiments of the present invention will now be described in detail. The embodiments are shown in the drawings, in which the same reference numerals always refer to the same parts. In the following, exemplary embodiments are described to explain the present invention with reference to the figures.
如图1所示,是本发明一种实施例的系统图,该系统包括音源设备(例如手机)、主蓝牙耳机(例如主蓝牙耳机100,下简称主耳机)和从蓝牙耳机(例如从蓝牙耳机200,下简称从耳机)。As shown in Figure 1, it is a system diagram of an embodiment of the present invention. The system includes a sound source device (such as a mobile phone), a master Bluetooth headset (such as a master Bluetooth headset 100, hereinafter referred to as a master headset) and a slave Bluetooth headset (such as a slave Bluetooth headset). The headset 200, hereinafter referred to as the slave headset).
手机与主耳机之间建立蓝牙链路1进行蓝牙通信,手机将多个音频数据包发送给主耳机,主耳机接收到音频数据包后进行播放;主耳机与从耳机之间建立了另一条蓝牙链路(即主从蓝牙链路),主耳机再将蓝牙链路1的信息发送给从耳机,以便从耳机建立监听蓝牙链路2,以监听手机发送给主耳机的音频数据包,从而从耳机也可以获取手机发送给主耳机的音频数据包,并进行播放。A Bluetooth link 1 is established between the mobile phone and the master headset for Bluetooth communication. The mobile phone sends multiple audio data packets to the master headset, and the master headset plays the audio data packets after receiving the audio data packets; another Bluetooth link is established between the master headset and the slave headset Link (that is, the master-slave Bluetooth link), the master headset sends the information of Bluetooth link 1 to the slave headset, so that the slave headset establishes a monitoring Bluetooth link 2 to monitor the audio data packets sent by the mobile phone to the master headset, and the slave headset The earphone can also obtain the audio data packet sent by the mobile phone to the main earphone and play it.
如图2所示,当上述三条链路建立起来之后,手机、主耳机和从耳机的跳频序列是相同的,每个频点驻留的时长为625μs(即一个蓝牙的标准时隙),例如,在第n个标准时隙,手机发送音频数据包10,主耳机在该标准时隙内的时段进行接收音频数据包10,而从耳机则在该标准时隙内的时段30内监听 接收该音频数据包10;在下一个n+1标准时隙,主耳机可以向手机发送数据,例如当主耳机和从耳机都成功接收音频数据包,或者主耳机成功接收音频数据包但从耳机没有接收到音频数据包,向手机发送音频接收成功的应答包ACK。As shown in Figure 2, after the above three links are established, the frequency hopping sequence of the mobile phone, the master headset and the slave headset are the same, and the duration of each frequency point is 625μs (that is, a Bluetooth standard time slot), for example , In the nth standard time slot, the mobile phone sends audio data packet 10, the master earphone receives the audio data packet 10 in the time slot of the standard time slot, and the slave earphone monitors and receives the audio data packet in the time slot 30 of the standard time slot 10; In the next n+1 standard time slot, the master headset can send data to the mobile phone. For example, when the master headset and slave headset successfully receive audio data packets, or the master headset successfully receives audio data packets but the slave headset does not receive audio data packets, The mobile phone sends an ACK for successful audio reception.
在通信过程中,分别作为主耳机和从耳机的两个耳机受信号干扰不同,耗电也有所不同,因此,在一些场景中,两个耳机需经常进行主从切换,以改善通信质量或提高两个耳机的电量均衡。During the communication process, the two earphones serving as the master earphone and the slave earphone are interfered by different signals, and the power consumption is also different. Therefore, in some scenarios, the two earphones need to be switched between master and slave frequently to improve communication quality or increase The power balance of the two earphones.
为了及时、有效地实现两个耳机的电量均衡,基于图1的系统,本实施例提供了一种主从蓝牙耳机切换方法,用于从耳机端,请参考图3,为本实施例公开的一种主从蓝牙耳机切换方法流程图,该主从蓝牙耳机切换方法包括如下步骤:In order to achieve the power balance of the two earphones in a timely and effective manner, based on the system of FIG. 1, this embodiment provides a master-slave Bluetooth earphone switching method for the slave earphone side. Please refer to FIG. 3, which is disclosed in this embodiment. A flow chart of a master-slave Bluetooth headset switching method. The master-slave Bluetooth headset switching method includes the following steps:
步骤S101:按蓝牙通信标准协议监听音源设备发送的多个音频数据包。请参考图1,从耳机200通过监听蓝牙链路2按照蓝牙通信标准协议监听音源设备(例如手机)发送的多个音频数据包;在从耳机200监听多个音频数据包的期间,主耳机按蓝牙通信标准协议接收多个音频数据包,具体地,通过蓝牙链路1接收多个音频数据包。本实施例中,音源设备(例如手机)发送的多个音频数据包构成了音频文件,也就是一个音频文件(例如一首歌)中包含多个音频数据包。作为示例一个音频数据包的示例,请参考图2,手机向主耳机发送音频数据包10,从耳机在监听蓝牙链路2上监听该音频数据包10。Step S101: Monitor multiple audio data packets sent by the audio source device according to the Bluetooth communication standard protocol. Referring to Figure 1, the slave headset 200 monitors multiple audio data packets sent by the audio source device (such as a mobile phone) through the Bluetooth link 2 according to the Bluetooth communication standard protocol; while the slave headset 200 monitors multiple audio data packets, the master headset presses The Bluetooth communication standard protocol receives multiple audio data packets, specifically, multiple audio data packets are received through the Bluetooth link 1. In this embodiment, multiple audio data packets sent by the audio source device (such as a mobile phone) constitute an audio file, that is, one audio file (such as a song) contains multiple audio data packets. As an example of an audio data packet, please refer to FIG. 2. The mobile phone sends an audio data packet 10 to the main earphone, and the slave earphone monitors the audio data packet 10 on the monitoring Bluetooth link 2.
步骤S103:与主耳机建立主从蓝牙链路,以与主耳机进行数据交互。请参考图1,本实施例中,主耳机和从耳机之间的数据交互通过主从蓝牙链路来实现,例如,转发音频数据包,发送主从切换请求等。Step S103: Establish a master-slave Bluetooth link with the master headset to perform data interaction with the master headset. Please refer to FIG. 1. In this embodiment, the data interaction between the master headset and the slave headset is implemented through a master-slave Bluetooth link, for example, forwarding audio data packets, sending a master-slave switching request, and so on.
需要说明的是,在具体实施过程中,本领域技术人员清楚步骤S101和步骤S103之间执行的先后顺序。It should be noted that, in the specific implementation process, those skilled in the art are aware of the sequence of execution between step S101 and step S103.
步骤S105:向主耳机发送从耳机的剩余电量。在具体实施例中,从耳机200可以通过自身的采样模块或者电量监测模块来采集电池的剩余电量,将采集得到的剩余电量通过主从蓝牙链路发送给主耳机100。需要说明的是,在具体实施例中,所称剩余电量可以是电池的剩余电量所占电池总容量的百分比,也可以是电量本身(例如xx毫安)。Step S105: Send the remaining power of the slave earphone to the master earphone. In a specific embodiment, the slave headset 200 may collect the remaining power of the battery through its own sampling module or power monitoring module, and send the collected remaining power to the master headset 100 through the master-slave Bluetooth link. It should be noted that, in specific embodiments, the remaining power may be the percentage of the remaining power of the battery to the total battery capacity, or the power itself (for example, xx milliamperes).
步骤S107:接收主耳机发送的主从切换请求。在具体实施例中,从耳机200通过主从蓝牙链路接收主耳机100发送的主从切换请求。本实施例中,主耳机100也可以通过自身的采样模块或者电量监测模块来采集电池的剩余电 量,主耳机100在从耳机200的剩余电量与主耳机的剩余电量之间的差值超过预设值后向从耳机发送主从切换请求,其中,预设值可以根据经验确定。需要说明的是,从、主耳机剩余电量的单位要一致,例如,当从耳机200的剩余电量是从耳机200剩余电量所占电池总容量的百分比时,主耳机100的剩余电量应当也是主耳机100剩余电量所占电池总容量的百分比;又如,当从耳机200的剩余电量是从耳机200剩余电量本身时,主耳机100的剩余电量应当也是主耳机100剩余电量本身。Step S107: Receive a master-slave switching request sent by the master headset. In a specific embodiment, the slave headset 200 receives the master-slave switching request sent by the master headset 100 through the master-slave Bluetooth link. In this embodiment, the master headset 100 may also collect the remaining power of the battery through its own sampling module or power monitoring module. The difference between the remaining power of the master headset 100 and the remaining power of the master headset 200 exceeds a preset value. After the value is set, a master-slave switching request is sent to the slave headset, where the preset value can be determined based on experience. It should be noted that the units of the remaining power of the slave and master headsets should be the same. For example, when the remaining power of the slave headset 200 is the percentage of the remaining power of the slave headset 200 to the total battery capacity, the remaining power of the master headset 100 should also be the master headset. The remaining power of 100 is the percentage of the total battery capacity; for another example, when the remaining power of the slave headset 200 is the remaining power of the slave headset 200, the remaining power of the master headset 100 should also be the remaining power of the master headset 100 itself.
步骤S109:根据主从切换请求向主耳机发送主从切换应答。在具体实施例中,从耳机200通过主从蓝牙链路向主耳机100发送主从切换应答。在可选的实施例中,主从切换应答可以通过附加包的形式发送给主耳机。Step S109: Send a master-slave switching response to the master headset according to the master-slave switching request. In a specific embodiment, the slave headset 200 sends a master-slave switching response to the master headset 100 through a master-slave Bluetooth link. In an alternative embodiment, the master-slave switching response may be sent to the master headset in the form of an additional package.
步骤S111:在主从切换时间到来时执行主从切换操作。本实施例中,当主耳机100接收到主从切换应答后,在主从切换时间到来时执行主从切换操作。在执行主从切换操作后,两个耳机的主从关系对调,也就是当前为主耳机的蓝牙耳机变为从耳机,通过监听的方式获取手机发送的音频数据包;当前为从耳机的蓝牙耳机变为主耳机,通过接收的方式来获取手机发送的音频数据包。具体地,两个耳机可以根据协议确定主从切换的时间;也可以在发起主从切换请求时,指示主从切换时间。Step S111: Perform a master-slave switching operation when the master-slave switching time comes. In this embodiment, after the master headset 100 receives the master-slave switching response, the master-slave switching operation is performed when the master-slave switching time comes. After performing the master-slave switching operation, the master-slave relationship of the two headsets is reversed, that is, the Bluetooth headset of the current master headset becomes the slave headset, and the audio data packet sent by the mobile phone is obtained by monitoring; the current Bluetooth headset is the slave headset It becomes the main headset, and obtains the audio data packet sent by the mobile phone by receiving. Specifically, the two earphones can determine the master-slave switching time according to the protocol; it can also indicate the master-slave switching time when the master-slave switching request is initiated.
本实施例中,上述步骤S105、S107、S109和S111中的至少一个在第一空闲时段内完成。具体地,第一空闲时段为从耳机200未执行监听音频数据包操作的时段,且第一空闲时段与监听到一个音频数据包的至少部分数据的时段处于同一标准蓝牙时隙内。需要说明的是,上述各个步骤可以都在空闲时段执行,也可以部分步骤在空闲时段执行;第一空闲时段可以是在一个标准蓝牙时隙内的时段,也可以是分布在不同蓝牙时隙的时段。例如,在执行步骤S105时,从耳机200可以在同一个第一空闲时段采集剩余电量并发送给主耳机100;从耳机200也可以在当前的第一空闲时段采集剩余电量,并在下一个第一空闲时段发送给主耳机100。In this embodiment, at least one of the above steps S105, S107, S109, and S111 is completed within the first idle period. Specifically, the first idle period is a period during which the slave headset 200 does not perform the operation of monitoring audio data packets, and the first idle period and the period during which at least part of data of an audio data packet is monitored are in the same standard Bluetooth time slot. It should be noted that each of the above steps can be performed in the idle period, or part of the steps can be performed in the idle period; the first idle period can be a period in a standard Bluetooth time slot, or it can be distributed in different Bluetooth time slots Time period. For example, when step S105 is performed, the slave headset 200 may collect the remaining power in the same first idle period and send it to the master headset 100; the slave headset 200 may also collect the remaining power in the current first idle period, and then collect the remaining power in the next first idle period. The idle period is sent to the main headset 100.
为便于本领域技术人员理解,请参考图2,蓝牙协议中,每个标准时隙可分成两部分,前一部分时段t1(可以称之为有用时段)用于收发数据,后一部分时段t2(可以称之为空闲时段)用于让蓝牙设备跳频至下一个频点对应的标准时隙作准备。但是,在本发明中,通过提高硬件的处理速度,可以使得蓝牙设备从一个标准时隙跳频至下一个标准时隙所需的时长更短,因此,主耳机和 从耳机可以在该空闲时段t2上收发数据包或其它操作,例如从耳机可以在该空闲时段上发送附加包或例如获取自身剩余电量的操作。如图2所示,第一空闲时段t2与监听到至少部分音频数据(音频数据包10中的数据)的时段处于同一标准蓝牙时隙(第n个时隙)内。In order to facilitate the understanding of those skilled in the art, please refer to Figure 2. In the Bluetooth protocol, each standard time slot can be divided into two parts. The first part of the time period t1 (which can be called the useful time period) is used to send and receive data, and the latter part of the time period t2 (which can be called It is the idle period) is used to make the Bluetooth device hop to the standard time slot corresponding to the next frequency point in preparation. However, in the present invention, by increasing the processing speed of the hardware, the time required for the Bluetooth device to hop from one standard time slot to the next standard time slot can be made shorter. Therefore, the master earphone and the slave earphone can be in the idle period t2. Sending and receiving data packets or other operations, for example, the slave headset can send additional packets during the idle period or obtain the remaining power of its own. As shown in FIG. 2, the first idle period t2 and the period when at least part of the audio data (data in the audio data packet 10) is monitored are in the same standard Bluetooth time slot (the nth time slot).
在可选的实施例中,在执行步骤S105时,可以将从耳机的剩余电量包含在应答包中发送给主耳机,从而能够减小收发操作,提高带宽利用率。具体地,当从耳机200监听到音源设备发送的当前的音频数据包后,向主耳机100发送音频监听成功应答包,其中,音频监听成功应答包中包含从耳机的剩余电量。请参考图2,从耳机200在监听蓝牙链路2上监听音频数据10,若成功接收到该音频数据10,则在该标准蓝牙时隙内的空闲时段t2向主耳机100发送音频监听成功应答包31(或者称为附加包31),其中该监听成功应答包31内包含从耳机200自身的剩余电量。In an alternative embodiment, when step S105 is performed, the remaining power from the headset may be included in the response packet and sent to the main headset, so that the sending and receiving operations can be reduced and the bandwidth utilization rate can be improved. Specifically, after the current audio data packet sent by the audio source device is monitored from the earphone 200, an audio monitoring success response packet is sent to the master earphone 100, where the audio monitoring success response packet contains the remaining power of the slave earphone. Please refer to Figure 2, the slave earphone 200 monitors the audio data 10 on the monitoring Bluetooth link 2. If the audio data 10 is successfully received, the audio monitoring success response is sent to the main earphone 100 during the idle period t2 in the standard Bluetooth time slot The package 31 (or called the additional package 31), wherein the monitoring success response package 31 contains the remaining power of the headphone 200 itself.
在具体实施过程中,请参考图4,示意了主、从耳机的多个监听成功应答包(附加包1-N)交互过程:以第一个监听成功应答包(如图4附加包1)为例,请参考图2和图4,从耳机200采集自身剩余电量,然后将该剩余电量作为监听成功应答包31的内容(该监听成功应答包还可以包括其他内容)发送给主耳机200,主耳机200接收到该监听成功应答包后(如图2标记21所示),主耳机拆解该监听成功应答包21(如图4附加包1)可以得到从耳机200的剩余电量。In the specific implementation process, please refer to Figure 4, which illustrates the interaction process of multiple monitor success response packets (additional package 1-N) of the master and slave earphones: the first monitor success response package (see Figure 4, additional package 1) As an example, please refer to Figures 2 and 4 to collect its own remaining power from the headset 200, and then use the remaining power as the content of the monitoring success response packet 31 (the monitoring success response packet may also include other content) and send it to the main headset 200. After the master earphone 200 receives the monitoring success response packet (as indicated by mark 21 in FIG. 2), the master earphone disassembles the monitoring success response packet 21 (additional package 1 in FIG. 4) to obtain the remaining power of the slave earphone 200.
本实施例中,通过第一空闲时段t2发送剩余电量,可以减小有用带宽的占用,从而减小带宽资源的浪费。进一步地,通过监听成功应答包31来包含从耳机的剩余电量,可以进一步减小带宽资源的占用。In this embodiment, the remaining power is sent through the first idle period t2, which can reduce the occupation of useful bandwidth, thereby reducing the waste of bandwidth resources. Further, by monitoring the success response packet 31 to include the remaining power of the slave headset, the occupation of bandwidth resources can be further reduced.
在可选的实施例中,为了进一步提高剩余电量发送的及时性,可以在最近的第一空闲时段向主耳机100发送音频监听成功应答包,尤其是当从耳机200的剩余电量难以维持从耳机200正常工作的场景。In an optional embodiment, in order to further improve the timeliness of the remaining power transmission, the audio monitoring success response packet may be sent to the master earphone 100 during the first most recent idle period, especially when the remaining power of the slave earphone 200 is difficult to maintain. 200 scenes of normal work.
在可选的实施例中,当从耳机200的电量不足以维持从耳机200正常工作需要关机时,该主从蓝牙耳机切换方法还包括:当从耳机200的剩余电量小于电量阈值后,在第一空闲时段向主耳机100发送结束蓝牙通信请求;当从耳机200接收到主耳机100发送的结束蓝牙通信应答后,输出关闭从耳机电源的指示,以关闭从耳机的电源。In an optional embodiment, when the power of the slave headset 200 is insufficient to maintain the normal operation of the slave headset 200 and needs to be shut down, the method for switching between the master and slave Bluetooth headsets further includes: when the remaining power of the slave headset 200 is less than the power threshold, in the first A request to end the Bluetooth communication is sent to the master headset 100 during an idle period; when the slave headset 200 receives the Bluetooth communication termination response sent by the master headset 100, an instruction to turn off the power of the slave headset is output to turn off the power of the slave headset.
本发明实施例公开的一种主从蓝牙耳机切换方法,通过在已建立的主从蓝 牙链路的标准蓝牙时隙内的空闲时段内,向主耳机发送从耳机的剩余电量,主耳机在从耳机的剩余电量与主耳机的剩余电量之间的差值超过预设值后向从耳机发送主从切换请求,进而,不仅实现了依据主从耳机剩余电量的大小及时地执行主从切换操作,使得主从蓝牙耳机的电池电量均衡,提高了电池使用寿命;而且,由于是在未执行监听音频数据包操作的时段进行主从切换的一步或多步操作,因此,一方面,减小监听音频数据包的带宽占用,也就是减小了带宽损耗;另一方面,不会影响从耳机按蓝牙通信标准协议正常监听多个音频数据包,继而,不会造成音频播放的卡顿,提升了用户体验。A method for switching between master and slave Bluetooth headsets disclosed in the embodiment of the present invention is to send the remaining power of the slave headset to the master headset during the idle period in the standard Bluetooth time slot of the established master-slave Bluetooth link. After the difference between the remaining power of the headset and the remaining power of the master headset exceeds the preset value, the master-slave switching request is sent to the slave headset, which not only realizes the timely execution of the master-slave switching operation according to the remaining power of the master-slave headset, The battery power of the master-slave Bluetooth headset is balanced, which improves the battery life; moreover, since the master-slave switching is performed during the period when the monitoring audio data packet operation is not performed, the master-slave switching is performed in one or more steps. Therefore, on the one hand, the monitoring audio is reduced The bandwidth occupancy of the data packet is to reduce the bandwidth loss; on the other hand, it will not affect the normal monitoring of multiple audio data packets from the headset according to the Bluetooth communication standard protocol, and then will not cause the audio playback to freeze, which improves the user Experience.
本实施例还公开了一种主从蓝牙耳机切换方法,用于主耳机100,请参考图5,为本实施例公开的一种主从蓝牙耳机切换方法流程图,该主从蓝牙耳机切换方法包括如下步骤:This embodiment also discloses a master-slave Bluetooth headset switching method, which is used for the master headset 100. Please refer to FIG. 5, which is a flowchart of a master-slave Bluetooth headset switching method disclosed in this embodiment. Including the following steps:
步骤S501:按蓝牙通信标准协议接收音源设备发送的多个音频数据包。期间,从耳机按蓝牙通信标准协议监听多个音频数据包。具体地,请参见步骤S101的描述。Step S501: Receive multiple audio data packets sent by the audio source device according to the Bluetooth communication standard protocol. During this period, the headset monitors multiple audio data packets according to the Bluetooth communication standard protocol. Specifically, please refer to the description of step S101.
步骤S503:与从耳机建立主从蓝牙链路,以与从耳机进行数据交互。具体地,请参见步骤S103的描述。Step S503: Establish a master-slave Bluetooth link with the slave headset to perform data interaction with the slave headset. Specifically, please refer to the description of step S103.
需要说明的是,在具体实施过程中,本领域技术人员清楚步骤S501和步骤S503之间执行的先后顺序。It should be noted that in the specific implementation process, those skilled in the art are aware of the sequence of execution between step S501 and step S503.
步骤S505:接收从耳机发送的从耳机的剩余电量。在具体实施例中,可以通过主从蓝牙链路接收从耳机的剩余电量,具体地,请参见步骤S105的描述。Step S505: Receive the remaining power of the slave earphone sent from the earphone. In a specific embodiment, the remaining power of the slave headset can be received through the master-slave Bluetooth link. For details, please refer to the description of step S105.
步骤S507:判断从耳机的剩余电量与主耳机的剩余电量之间的差值是否超过预设值。在具体实施例中,主耳机100也可以通过自身的采样模块或者电量监测模块来采集电池的剩余电量;在接收到从耳机的剩余电量后,可以将从耳机的剩余电量与主耳机的剩余电量作差得到剩余电量差值;判断该差值是否超过预设值,如果该差值超过预设值,则表明从耳机的剩余电量相对于主耳机的剩余电量过于富余,此时,主、从耳机的剩余电量不均衡,则执行步骤S509。如果该差值没有超过预设值,则表明两个耳机的剩余电量相对比较均衡,可以不必做主从切换,此时,可以接收下一次从耳机100发送的剩余电量。在具体实施例中,预设值可以根据经验确定,例如当剩余电量为电池的剩余电量所占电池总容量的百分比时,可以设定预设值为例如5%-10%,需要说明的是,以 上数值仅为示例性描述,具体的数值大小不能视为对本申请方案的限定。Step S507: Determine whether the difference between the remaining power of the slave earphone and the remaining power of the master earphone exceeds a preset value. In a specific embodiment, the master headset 100 can also collect the remaining power of the battery through its own sampling module or power monitoring module; after receiving the remaining power of the slave headset, it can compare the remaining power of the headset with the remaining power of the master headset. Make a difference to obtain the difference in the remaining power; determine whether the difference exceeds the preset value, if the difference exceeds the preset value, it indicates that the remaining power of the slave headset is too surplus relative to the remaining power of the master headset. At this time, the master and the slave If the remaining power of the earphone is not balanced, step S509 is executed. If the difference does not exceed the preset value, it indicates that the remaining power of the two earphones is relatively balanced, and the master-slave switch does not need to be performed. At this time, the remaining power sent from the earphone 100 next time can be received. In a specific embodiment, the preset value can be determined based on experience. For example, when the remaining power is the percentage of the remaining power of the battery to the total battery capacity, the preset value can be set, for example, 5%-10%. It should be noted that The above numerical values are only exemplary descriptions, and the specific numerical values cannot be regarded as a limitation to the solution of the application.
步骤S509:向从耳机发送主从切换请求。在具体实施例中,主耳机100通过主从蓝牙链路向从耳机200发送主从切换请求。Step S509: Send a master-slave switching request to the slave headset. In a specific embodiment, the master headset 100 sends a master-slave switching request to the slave headset 200 via a master-slave Bluetooth link.
在优选的实施例中,为了进一步提高主从切换的及时性,如果从耳机的剩余电量与主耳机的剩余电量超过预设值,则可以在最近的第二空闲时段向从耳机200发送主从切换请求,尤其是当该差值过大时,表明两个耳机之间严重电量不均衡,需要及时地进行主从切换。In a preferred embodiment, in order to further improve the timeliness of master-slave switching, if the remaining power of the slave headset and the remaining power of the master headset exceed a preset value, the master-slave can be sent to the slave headset 200 during the second most recent idle period. The switching request, especially when the difference is too large, indicates that there is a serious power imbalance between the two earphones, and the master-slave switching needs to be performed in a timely manner.
步骤S511:接收从耳机根据主从切换请求发送的主从切换应答。在具体实施例中,主耳机100通过主从蓝牙链路接收从耳机200根据主从切换请求发送的主从切换应答。在可选的实施例中,可以通过附加包得到主从切换应答。Step S511: Receive the master-slave switching response sent by the slave headset according to the master-slave switching request. In a specific embodiment, the master headset 100 receives the master-slave switching response sent by the slave headset 200 according to the master-slave switching request through the master-slave Bluetooth link. In an alternative embodiment, the master-slave switch response can be obtained through an additional package.
步骤S513:根据主从切换应答在主从切换时间到来时执行主从切换操作。具体地,请参见步骤S511的描述。Step S513: Perform a master-slave switching operation when the master-slave switching time comes according to the master-slave switching response. Specifically, please refer to the description of step S511.
本实施例中,上述步骤S505、步骤S507、步骤S509、步骤S511和步骤S513中的至少一个在第二空闲时段内完成。具体地,第二空闲时段为主耳机100未执行接收音频数据包操作的时段,且第二空闲时段与接收到一个音频数据包的至少部分数据时段处于同一标准蓝牙时隙内。需要说明的是,上述各个步骤可以都在空闲时段执行,也可以部分步骤在空闲时段执行;第二空闲时段可以是在一个标准蓝牙时隙内的时段,也可以是分布在不同标准蓝牙时隙的时段。In this embodiment, at least one of the above-mentioned step S505, step S507, step S509, step S511, and step S513 is completed within the second idle period. Specifically, the second idle period is a period during which the main headset 100 does not perform the operation of receiving audio data packets, and the second idle period is in the same standard Bluetooth time slot as at least part of the data period during which one audio data packet is received. It should be noted that each of the above steps can be performed in the idle period, or part of the steps can be performed in the idle period; the second idle period can be a period in a standard Bluetooth time slot, or it can be distributed in different standard Bluetooth time slots Time period.
需要说明的是,在执行步骤S509的过程中,两个耳机可以根据协议确定主从切换的时间;也可以在发起主从切换请求时,指示主从切换时间。当采用主从切换请求来指示主从切换时间时,可以通过第二空闲时段中承载主从切换请求的时间位置来指示第几个时隙进行主从切换,也就是第二空闲时段分了多个小的时间段,在第几个小的时间段发送主从切换请求,通过约定的公式可以表示对应第几个标准时隙进行主从切换,从而,可以减小信息传输,提高了带宽的利用率。It should be noted that in the process of performing step S509, the two earphones can determine the master-slave switching time according to the protocol; or when the master-slave switching request is initiated, the master-slave switching time can be indicated. When the master-slave switching request is used to indicate the master-slave switching time, the time position of the second idle period that carries the master-slave switching request can be used to indicate which time slot is used for the master-slave switching, that is, the second idle period is divided into more times. In a small time period, the master-slave switching request is sent in the small time period. The agreed formula can indicate the corresponding standard time slot for master-slave switching, thereby reducing information transmission and improving bandwidth utilization rate.
需要说明的是,关于第二空闲时段的理解,可以参见第一空闲时段的示例描述,原理类似;不同之处在于,有用时段与手机的交互方式不同,从耳机为监听,主耳机为接收。It should be noted that for the understanding of the second idle period, please refer to the example description of the first idle period. The principle is similar; the difference is that the useful period and the mobile phone interact in a different way, with the slave earphone for monitoring and the main earphone for receiving.
在可选的实施例中,在执行步骤S505时,可以通过拆解从耳机的监听成功应答包的方式来获得从耳机的剩余电量,从而能够减小收发操作,提高带宽 利用率。具体地,步骤S505包括:接收从耳机200发送的音频监听成功应答包,音频监听成功应答包表示从耳机200成功监听到音源设备发送的当前的音频数据包;从音频监听成功应答包中获取从耳机的剩余电量。具体地,请参见上述实施例关于图2和图4的描述,在拆解得到从耳机的剩余电量后,可以与主耳机100自己采集的主耳机的剩余电量进行比较,判断是否大于预设值。In an alternative embodiment, when step S505 is performed, the remaining power of the slave earphone can be obtained by disassembling the listening success response packet of the slave earphone, so that the sending and receiving operations can be reduced and the bandwidth utilization rate can be improved. Specifically, step S505 includes: receiving an audio monitoring success response packet sent from the headset 200, where the audio monitoring success response packet indicates that the current audio data packet sent by the audio source device is successfully monitored from the headset 200; The remaining battery power of the headset. Specifically, please refer to the description of FIG. 2 and FIG. 4 in the above embodiment. After disassembling the remaining power of the slave headset, it can be compared with the remaining power of the master headset collected by the master headset 100 to determine whether it is greater than the preset value. .
在可选的实施例中,当从耳机200的电量不足以维持从耳机200正常工作需要关机时,该主从蓝牙耳机切换方法还包括:在第二空闲时段接收从耳机200发送的结束蓝牙通信请求;向从耳机200发送接收到结束蓝牙通信请求的应答;根据结束蓝牙通信请求输出关闭主耳机100电源的指示,以关闭主耳机100的电源。In an optional embodiment, when the power of the slave headset 200 is insufficient to maintain the normal operation of the slave headset 200 and needs to be shut down, the master-slave Bluetooth headset switching method further includes: receiving the end Bluetooth communication sent from the headset 200 during the second idle period Request; send and receive a response to the end of the Bluetooth communication request to the slave earphone 200; output an instruction to turn off the power of the main earphone 100 according to the end of the Bluetooth communication request to turn off the power of the main earphone 100.
本实施例公开的一种主从蓝牙耳机切换方法,通过在已建立的主从蓝牙链路的标准蓝牙时隙内的空闲时段内,接收从耳机发送的从耳机的剩余电量,主耳机在从耳机的剩余电量与主耳机的剩余电量之间的差值超过预设值后向从耳机发送主从切换请求,进而,不仅实现了依据主从耳机剩余电量的大小及时地执行主从切换操作,使得主从蓝牙耳机的电池电量均衡,提高了电池使用寿命;而且,由于是在未执行接收音频数据包操作的时段进行主从切换的一步或多步操作,因此,一方面,减小接收音频数据包的带宽占用,也就是减小了带宽损耗;另一方面,不会影响主耳机按蓝牙通信标准协议正常接收多个音频数据包,继而,不会造成音频播放的卡顿,提升了用户体验。This embodiment discloses a master-slave Bluetooth headset switching method, by receiving the remaining power of the slave headset sent by the slave headset during the idle period in the standard Bluetooth time slot of the established master-slave Bluetooth link, the master headset is After the difference between the remaining power of the headset and the remaining power of the master headset exceeds the preset value, the master-slave switching request is sent to the slave headset, which not only realizes the timely execution of the master-slave switching operation according to the remaining power of the master-slave headset, The battery power of the master-slave Bluetooth headset is balanced, which improves the battery life; moreover, because the master-slave switching is performed in one or more steps during the period when the operation of receiving audio data packets is not performed, on the one hand, the received audio is reduced The bandwidth occupancy of the data packet is to reduce the bandwidth loss; on the other hand, it will not affect the main headset to receive multiple audio data packets normally according to the Bluetooth communication standard protocol, and then will not cause the audio playback to freeze, which improves the user Experience.
本实施例还公开了一种主从蓝牙耳机切换方法,请参考图6,为本实施例公开的一种主从蓝牙耳机切换方法时序图,该主从蓝牙耳机切换方法包括如下步骤:This embodiment also discloses a master-slave Bluetooth headset switching method. Please refer to FIG. 6, which is a timing diagram of a master-slave Bluetooth headset switching method disclosed in this embodiment. The master-slave Bluetooth headset switching method includes the following steps:
步骤S901:主耳机100按蓝牙通信标准协议接收音源设备发送的多个音频数据包。具体地,请参见上述实施例的描述,在此不再赘述。Step S901: The main earphone 100 receives multiple audio data packets sent by the audio source device according to the Bluetooth communication standard protocol. Specifically, please refer to the description of the foregoing embodiment, which will not be repeated here.
步骤S903:从耳机200按蓝牙通信标准协议监听音源设备发送的多个音频数据包。具体地,请参见上述实施例的描述,在此不再赘述。Step S903: monitor multiple audio data packets sent by the audio source device from the headset 200 according to the Bluetooth communication standard protocol. Specifically, please refer to the description of the foregoing embodiment, which will not be repeated here.
步骤S905:主耳机100与从耳机200建立主从蓝牙链路,以使主耳机100与从耳机200进行数据交互。具体地,请参见上述实施例的描述,在此不再赘述。Step S905: the master headset 100 and the slave headset 200 establish a master-slave Bluetooth link, so that the master headset 100 and the slave headset 200 perform data interaction. Specifically, please refer to the description of the foregoing embodiment, which will not be repeated here.
步骤S907:从耳机200向主耳机100发送从耳机的剩余电量。具体地, 请参见上述实施例的描述,在此不再赘述。Step S907: the slave earphone 200 sends the remaining power of the slave earphone to the master earphone 100. Specifically, please refer to the description of the foregoing embodiment, which will not be repeated here.
步骤S909:主耳机100接收从耳机200发送的从耳机的剩余电量。具体地,请参见上述实施例的描述,在此不再赘述。Step S909: the master earphone 100 receives the remaining power of the slave earphone sent from the earphone 200. Specifically, please refer to the description of the foregoing embodiment, which will not be repeated here.
步骤S911:主耳机100判断从耳机的剩余电量与主耳机的剩余电量是否超过预设值。如果从耳机的剩余电量与主耳机的剩余电量之间的差值超过预设值,则执行步骤S913。具体地,请参见上述实施例的描述,在此不再赘述。Step S911: The master headset 100 determines whether the remaining power of the slave headset and the remaining power of the master headset exceed a preset value. If the difference between the remaining power of the slave earphone and the remaining power of the master earphone exceeds the preset value, step S913 is executed. Specifically, please refer to the description of the foregoing embodiment, which will not be repeated here.
步骤S913:主耳机100向从耳机200发送主从切换请求。具体地,请参见上述实施例的描述,在此不再赘述。Step S913: the master headset 100 sends a master-slave switching request to the slave headset 200. Specifically, please refer to the description of the foregoing embodiment, which will not be repeated here.
步骤S915:从耳机200接收主耳机100发送的主从切换请求。具体地,请参见上述实施例的描述,在此不再赘述。Step S915: Receive the master-slave switching request sent by the master headset 100 from the headset 200. Specifically, please refer to the description of the foregoing embodiment, which will not be repeated here.
步骤S917:从耳机200根据主从切换请求向主耳机100发送主从切换应答。具体地,请参见上述实施例的描述,在此不再赘述。Step S917: The slave headset 200 sends a master-slave switching response to the master headset 100 according to the master-slave switching request. Specifically, please refer to the description of the foregoing embodiment, which will not be repeated here.
步骤S919:主耳机100接收主从切换应答。具体地,请参见上述实施例的描述,在此不再赘述。Step S919: the master headset 100 receives the master-slave switching response. Specifically, please refer to the description of the foregoing embodiment, which will not be repeated here.
步骤S921:主耳机100和从耳机200在主从切换时间到来时执行主从切换操作。具体地,请参见上述实施例的描述,在此不再赘述。Step S921: the master headset 100 and the slave headset 200 perform a master-slave switching operation when the master-slave switching time comes. Specifically, please refer to the description of the foregoing embodiment, which will not be repeated here.
上述步骤中,步骤S907、S915、步骤S917和步骤S921中的至少一个在第一空闲时段内完成,第一空闲时段为从耳机200未执行监听音频数据包操作的时段,且第一空闲时段与监听到一个音频数据包的至少部分数据的时段处于同一标准蓝牙时隙内;上述步骤中,步骤S909、步骤S911、步骤S913、步骤S919和和步骤S921中的至少一个在第二空闲时段内完成,第二空闲时段为主耳机100未执行接收音频数据包操作的时段,且第二空闲时段与接收到一个音频数据包的至少部分数据时段处于同一标准蓝牙时隙内。具体地,请参见上述实施例的描述,在此不再赘述。In the above steps, at least one of steps S907, S915, step S917, and step S921 is completed within the first idle period. The first idle period is the period during which the slave headset 200 does not perform the operation of monitoring audio data packets, and the first idle period is equal to The period during which at least part of the data of an audio data packet is monitored is in the same standard Bluetooth time slot; in the above steps, at least one of step S909, step S911, step S913, step S919, and step S921 is completed in the second idle period The second idle period is a period during which the main headset 100 does not perform the operation of receiving an audio data packet, and the second idle period and at least part of the data period during which an audio data packet is received are in the same standard Bluetooth time slot. Specifically, please refer to the description of the foregoing embodiment, which will not be repeated here.
为便于本领域技术人员理解,请参考图7,为本实施例公开的一种手机、主耳机和从耳机构成的系统数据收发、转发流程示意图,从图3可以看出,从耳机监听到音频数据包(例如数据包1)后,会发送附加包给主耳机,表示从耳机监听到了数据包1;主耳机收到手机发送的数据包(例如数据包1和数据包2)即发送成功接收应答ACK给手机(例如,如图2标记22所示)。在约定的时隙,主耳机和从耳机通信,主耳机将从耳机没有接收到的数据包2转发给从耳机,从耳机收到数据包2后发送监听成功应答ACK给主耳机(例如, 如图2标记31和21所示),主耳机收到该ACK后,发送转发结束信息给从耳机,从耳机再次发送应答ACK给主耳机,主耳机接收到该ACK后结束主从耳机之间的通信,主耳机再次和手机通信,以继续接收音频数据。For ease of understanding by those skilled in the art, please refer to FIG. 7, which is a schematic diagram of the data receiving and forwarding process of a system composed of a mobile phone, a master headset, and a slave headset disclosed in this embodiment. It can be seen from FIG. After the data packet (such as data packet 1), an additional packet will be sent to the main headset, indicating that the data packet 1 is monitored from the headset; the main headset receives the data packet sent by the mobile phone (such as data packet 1 and data packet 2), which means the transmission is successfully received Acknowledge ACK to the mobile phone (for example, as indicated by marker 22 in Figure 2). In the agreed time slot, the master headset communicates with the slave headset. The master headset forwards the data packet 2 that is not received from the headset to the slave headset. After receiving the data packet 2 from the headset, it sends a monitor success response ACK to the master headset (for example, 2). After receiving the ACK, the master headset sends a forwarding completion message to the slave headset, and the slave headset sends a response ACK to the master headset again. After receiving the ACK, the master headset ends the communication between the master and slave headsets. Communication, the main headset communicates with the mobile phone again to continue receiving audio data.
本实施例的主从切换方法,基于上述系统数据流程,从耳机发送给主耳机的附加包包含从耳机自身的剩余电量;主耳机接收到附加包后,对附加包进行解析,从而获得从耳机的剩余电量信息,主耳机还获取自身的主耳机的剩余电量;主耳机比较从耳机剩余电量和主耳机剩余电量:若从耳机的电量更加充足,则主耳机向从耳机发送主从切换请求;若主耳机的电量更加充足,则主耳机不会发送主从切换请求。In the master-slave switching method of this embodiment, based on the above-mentioned system data flow, the additional package sent from the headset to the master headset contains the remaining power of the slave headset itself; after the master headset receives the additional package, the additional package is parsed to obtain the slave headset The master headset also obtains the remaining power of its own master headset; the master headset compares the remaining power of the slave headset with the remaining power of the master headset: if the power of the slave headset is more sufficient, the master headset sends a master-slave switching request to the slave headset; If the power of the master headset is more sufficient, the master headset will not send a master-slave switching request.
若主耳机决定发送主从切换请求,则主耳机向从耳机发送主从切换请求(例如,如图2中标记23所示);If the master headset decides to send a master-slave switching request, the master headset sends a master-slave switching request to the slave headset (for example, as shown by mark 23 in FIG. 2);
如图8所示,从耳机接收到主从切换请求后,向主耳机发送同意请求应答,并且从耳机标记自己为主耳机并保持监听状态。例如,从耳机在该标准时隙的空闲时段内接收到该主从切换请求后,即向主耳机发送同意请求应答,并且从耳机标记自己为主耳机并保持监听状态;As shown in Figure 8, after receiving the master-slave switching request, the slave headset sends an approval request response to the master headset, and the slave headset marks itself as the master headset and keeps the monitoring state. For example, after the slave headset receives the master-slave switching request during the idle period of the standard time slot, it sends an approval request response to the master headset, and the slave headset marks itself as the master headset and keeps the monitoring state;
主耳机接收到从耳机发送的同意请求应答后,标记自己为从耳机并切换为监听状态后,向从耳机发送角色转换命令(SWITCH START);After the master headset receives the response to the consent request sent from the headset, it marks itself as the slave headset and switches to the monitoring state, and then sends a role switch command (SWITCH START) to the slave headset;
从耳机收到切换命令后向主耳机回复ACK答复,并与手机建立蓝牙通信连接,自此,从耳机变成主耳机。After receiving the switching command from the headset, the ACK reply is returned to the main headset, and a Bluetooth communication connection is established with the mobile phone. Since then, the slave headset becomes the main headset.
通过上述方案,通过不断切换主耳机和从耳机的主从角色,使得主耳机和从耳机的剩余电量尽可能均衡,直至当任一耳机的剩余电量达到电量阈值时,此时需要关闭主耳机、从耳机,以及相关的蓝牙链路。Through the above solution, by constantly switching the master and slave roles of the master headset and the slave headset, the remaining power of the master headset and the slave headset is as balanced as possible, until the remaining power of any headset reaches the power threshold, and the master headset needs to be turned off at this time. From the headset, and the associated Bluetooth link.
如图9所示,当从耳机的剩余电量首先达到电量阈值时,包括如下步骤:As shown in Figure 9, when the remaining power of the slave headset first reaches the power threshold, the following steps are included:
从耳机发送断开蓝牙连接(DETACH)命令给主耳机;Send the DETACH command from the headset to the main headset;
主耳机接收到该断开蓝牙连接命令后,向手机发送关闭基带链路请求;After receiving the command to disconnect the Bluetooth connection, the main headset sends a request to close the baseband link to the mobile phone;
手机接收到该关闭基带链路请求后,向主耳机发送已关闭基带链路应答,然后关闭基带链路后;After receiving the request to close the baseband link, the mobile phone sends a closed baseband link response to the main headset, and then closes the baseband link;
主耳机接收到已关闭基带链路应答后,向从耳机发送基带链路已关闭的信息;After the master earphone receives the response of the closed baseband link, it sends the message that the baseband link has been closed to the slave earphone;
从耳机接收到该基带链路已关闭的信息后,向主耳机发送应答(ACK),然后断开主从耳机之间的蓝牙链路,然后关闭从耳机电源;After receiving the information that the baseband link is closed, the slave headset sends an acknowledgement (ACK) to the master headset, then disconnects the Bluetooth link between the master and slave headsets, and then turns off the power of the slave headset;
主耳机收到该应答后,向手机发送断开连接的信息,然后关闭主耳机电源。After the main headset receives the response, it sends a disconnect message to the mobile phone, and then turns off the power of the main headset.
而当主耳机的剩余电量达到电量阈值后,可以参照从耳机达到电量阈值的处理过程。When the remaining power of the master headset reaches the power threshold, the processing procedure for the slave headset to reach the power threshold can be referred to.
本实施例还公开了一种主从蓝牙耳机切换装置,用于从耳机,请参考图10a,为本实施例公开的一种从耳机端主从蓝牙耳机切换装置结构示意图,该装置包括:监听模块101、第一建立模块102、电量发送模块103、请求接收模块104、应答模块105和第一切换模块106,其中:This embodiment also discloses a master-slave Bluetooth headset switching device for slave headsets. Please refer to FIG. 10a, which is a schematic structural diagram of a master-slave Bluetooth headset switching device from the headset side disclosed in this embodiment. The device includes: monitor The module 101, the first establishing module 102, the power sending module 103, the request receiving module 104, the answering module 105 and the first switching module 106, wherein:
监听模块101用于按蓝牙通信标准协议监听音源设备发送的多个音频数据包,期间,主耳机按蓝牙通信标准协议接收多个音频数据包;第一建立模块102用于与主耳机建立主从蓝牙链路,以与主耳机进行数据交互;电量发送模块103用于向主耳机100发送从耳机的剩余电量;请求接收模块104用于接收主耳机发送的主从切换请求,其中,主耳机在从耳机的剩余电量与主耳机的剩余电量之间的差值超过预设值后向从耳机发送主从切换请求;应答模块105用于根据主从切换请求向主耳机100发送主从切换应答;及第一切换模块106用于当主耳机100接收到主从切换应答后,在主从切换时间到来时执行主从切换操作;The monitoring module 101 is used to monitor multiple audio data packets sent by the audio source device according to the Bluetooth communication standard protocol. During this period, the main headset receives multiple audio data packets according to the Bluetooth communication standard protocol; the first establishing module 102 is used to establish a master-slave with the main headset Bluetooth link for data interaction with the master headset; the power sending module 103 is used to send the remaining power of the slave headset to the master headset 100; the request receiving module 104 is used to receive the master-slave switching request sent by the master headset, where the master headset is in After the difference between the remaining power of the slave headset and the remaining power of the master headset exceeds a preset value, send a master-slave switching request to the slave headset; the response module 105 is configured to send a master-slave switching response to the master headset 100 according to the master-slave switching request; And the first switching module 106 is configured to perform the master-slave switching operation when the master-slave switching time comes after the master headset 100 receives the master-slave switching response;
其中,电量发送模块、请求接收模块、应答模块和第一切换模块中的至少一个在第一空闲时段内完成,第一空闲时段为从耳机200未执行监听音频数据包操作的时段,且第一空闲时段与监听到一个音频数据包的至少部分数据的时段处于同一标准蓝牙时隙内。Wherein, at least one of the power sending module, the request receiving module, the answering module, and the first switching module is completed in the first idle period, the first idle period is the period during which the slave earphone 200 does not perform the operation of monitoring audio data packets, and the first idle period The idle period and the period when at least part of the data of an audio data packet is monitored are in the same standard Bluetooth time slot.
本实施例还公开了一种主从蓝牙耳机切换装置,用于主耳机,请参考图10b,为本实施例公开的一种主耳机端主从蓝牙耳机切换装置结构示意图,该装置包括:数据接收模块107、第二建立模块108、电量接收模块109、电量判断模块110、请求发送模块111、应答接收模块112和第二切换模块113,其中:This embodiment also discloses a master-slave Bluetooth headset switching device for the master headset. Please refer to FIG. 10b, which is a schematic structural diagram of a master-slave Bluetooth headset switching device disclosed in this embodiment. The device includes: data The receiving module 107, the second establishing module 108, the power receiving module 109, the power determining module 110, the request sending module 111, the response receiving module 112, and the second switching module 113, wherein:
数据接收模块107用于按蓝牙通信标准协议接收音源设备发送的多个音频数据包,期间,从耳机按蓝牙通信标准协议监听多个音频数据包;第二建立模块108用于与从耳机建立主从蓝牙链路,以与从耳机进行数据交互;电量接收模块109用于接收从耳机200发送的从耳机的剩余电量;电量判断模块110用于判断从耳机的剩余电量与主耳机的剩余电量之间的差值是否超过预设值;请求发送模块111用于如果电量判断模块判断出从耳机的剩余电量与主耳机 的剩余电量超过预设值,则向从耳机200发送主从切换请求;应答接收模块112用于接收从耳机200根据主从切换请求发送的主从切换应答;及第二切换模块113用于根据主从切换应答在主从切换时间到来时执行主从切换操作;The data receiving module 107 is used to receive multiple audio data packets sent by the audio source device according to the Bluetooth communication standard protocol. During the period, the slave earphone monitors multiple audio data packets according to the Bluetooth communication standard protocol; the second establishing module 108 is used to establish a master with the slave earphone. The slave Bluetooth link is used to interact with the slave headset; the power receiving module 109 is used to receive the remaining power of the slave headset sent from the headset 200; the power determining module 110 is used to determine the remaining power of the slave headset and the remaining power of the master headset. Whether the difference between the two exceeds a preset value; the request sending module 111 is configured to send a master-slave switching request to the slave headset 200 if the power judgment module determines that the remaining power of the slave headset and the remaining power of the master headset exceed the preset value; The receiving module 112 is configured to receive the master-slave switching response sent by the slave headset 200 according to the master-slave switching request; and the second switching module 113 is configured to perform the master-slave switching operation when the master-slave switching time comes according to the master-slave switching response;
其中,电量发送模块、请求接收模块、电量判断模块、应答模块和第一切换模块中的至少一个在第二空闲时段内完成,第二空闲时段为主耳机100未执行接收音频数据包操作的时段,且第二空闲时段与接收到一个音频数据包的至少部分数据时段处于同一标准蓝牙时隙内。Wherein, at least one of the power sending module, the request receiving module, the power judgment module, the response module, and the first switching module is completed in the second idle period, and the second idle period is the period during which the main headset 100 does not perform the operation of receiving audio data packets , And the second idle period is in the same standard Bluetooth time slot as at least part of the data period of receiving an audio data packet.
本实施例还公开了一种蓝牙耳机,包括处理器,处理器用于实现上述任意实施例公开的用于从耳机方法。This embodiment also discloses a Bluetooth headset, including a processor, and the processor is configured to implement the method for slave headset disclosed in any of the foregoing embodiments.
本实施例还公开了一种蓝牙耳机,包括处理器,处理器用于实现上述任意实施例公开的用于主耳机方法。This embodiment also discloses a Bluetooth headset, including a processor, and the processor is configured to implement the method for the main headset disclosed in any of the foregoing embodiments.
需要说明的是,在具体实施过程中,各蓝牙耳机的处理器用于分时实现上述用于主耳机和从耳机任意实施例公开的方法。It should be noted that in the specific implementation process, the processor of each Bluetooth headset is used to implement the method disclosed in any of the above-mentioned embodiments for the master headset and the slave headset in a time-sharing manner.
本实施例还公开了一种蓝牙耳机系统,请参考图11,为本实施例公开的一种蓝牙耳机系统结构示意图,该蓝牙耳机系统包括:从耳机和主耳机,其中:This embodiment also discloses a Bluetooth headset system. Please refer to FIG. 11, which is a schematic structural diagram of a Bluetooth headset system disclosed in this embodiment. The Bluetooth headset system includes: a slave headset and a master headset, wherein:
从耳机用于监听并播放音源设备发送的多个音频数据包;主耳机用于接收并播放音源设备发送的多个音频数据包。其中,从耳机和主耳机构成蓝牙耳机对;从耳机为上述任一实施例公开的用于实现从耳机端方法的蓝牙耳机;主耳机为上述任一实施例公开的用于实现主耳机端方法的蓝牙耳机。The slave earphone is used to monitor and play multiple audio data packets sent by the audio source device; the main earphone is used to receive and play multiple audio data packets sent by the audio source device. Among them, the slave headset and the master headset constitute a Bluetooth headset pair; the slave headset is a Bluetooth headset disclosed in any of the above embodiments for implementing the slave headset method; the master headset is a Bluetooth headset disclosed in any of the above embodiments for implementing the master headset method Bluetooth headset.
需要说明的是,在具体实施过程中,主耳机和从耳机的主从关系可以互换。It should be noted that in the specific implementation process, the master-slave relationship between the master headset and the slave headset can be interchanged.
本实施例还公开了一种蓝牙音频播放系统,包括:音源设备及上述实施例公开的蓝牙耳机系统,其中:音源设备用于向蓝牙耳机系统提供多个音频数据包。在可选的实施例中,音源设备可以是手机、平板电脑、笔记本、影音播放器等具有蓝牙通信功能和音频数据提供功能的设备。This embodiment also discloses a Bluetooth audio playback system, including: an audio source device and the Bluetooth headset system disclosed in the above embodiments, wherein the audio source device is used to provide a plurality of audio data packets to the Bluetooth headset system. In an alternative embodiment, the audio source device may be a device with a Bluetooth communication function and audio data providing function, such as a mobile phone, a tablet computer, a notebook, a video player, and the like.
本实施例还公开了一种计算机可读存储介质,其上存储有计算机程序,存储介质中存储的计算机程序用于被执行实现上述任意实施例公开的用于从耳机方法,或者,用于实现上述任意实施例公开的用于主耳机方法。This embodiment also discloses a computer-readable storage medium on which a computer program is stored. The computer program stored in the storage medium is used to be executed to implement the method for slave earphones disclosed in any of the above-mentioned embodiments, or to implement The method for the main earphone disclosed in any of the above embodiments.
本实施例还公开了一种蓝牙耳机芯片,其上具有集成电路,集成电路用于实现上述任意实施例公开的用于从耳机方法,或者/和,用于实现上述任意实施例公开的用于主耳机方法。具体地,请参考图12,为本实施例公开的一种蓝牙耳机芯片结构示意图,其上具有的集成电路包括处理器121、无线通信模 块122和电源模块123,其中:This embodiment also discloses a Bluetooth headset chip with an integrated circuit on it. The integrated circuit is used to implement the method for slave headset disclosed in any of the above embodiments, or/and, to implement the method for slave headset disclosed in any of the above embodiments. The main headset method. Specifically, please refer to Figure 12, which is a schematic structural diagram of a Bluetooth headset chip disclosed in this embodiment. The integrated circuit on it includes a processor 121, a wireless communication module 122, and a power supply module 123. Among them:
处理器121可以是具有一定数据处理能力的微控芯片,例如DSP、单片机等;处理器121用于执行程序实现上述任意实施例公开的方法,可以是从耳机的方法,也可以是主耳机的方法;The processor 121 may be a micro-control chip with certain data processing capabilities, such as a DSP, a single-chip microcomputer, etc.; the processor 121 is used to execute a program to implement the method disclosed in any of the above embodiments, and it may be the method of the slave headset or the master headset. method;
无线通信模块122可以是能够实现蓝牙通信的模块。无线通信模块122用于主从耳机之间的通信,以及用于蓝牙耳机与手机之间的通信;The wireless communication module 122 may be a module capable of implementing Bluetooth communication. The wireless communication module 122 is used for communication between master and slave headsets, and for communication between Bluetooth headsets and mobile phones;
电源模块123用于向各个功能电路提供和/或管理电源,需要说明的是,在具体实施过程中,电源模块123可以是为蓝牙耳机芯片单独配置的,也可以是与其它芯片共享的;The power module 123 is used to provide and/or manage power to each functional circuit. It should be noted that in the specific implementation process, the power module 123 may be configured separately for the Bluetooth headset chip or shared with other chips;
根据上述实施例公开的内容,本领域技术人员应当清楚对上述蓝牙耳机芯片中集成电路的模块做适当删减或集成复用。例如,在一些实施例中,蓝牙耳机芯片中的集成电路还可以包括ADC模块124,用于进行电量采集;再如,还可以包括比较器模块125,用于实现两个电量的比较,当然,在一些实施例中,比较器模块125的功能也可以通过处理器121来实现,此时,便可以省去比较器模块125。Based on the content disclosed in the foregoing embodiments, those skilled in the art should be aware of appropriate deletion or integrated multiplexing of the integrated circuit modules in the foregoing Bluetooth headset chip. For example, in some embodiments, the integrated circuit in the Bluetooth headset chip may also include an ADC module 124 for power collection; for another example, it may also include a comparator module 125 for comparison of two power levels. Of course, In some embodiments, the function of the comparator module 125 can also be implemented by the processor 121, and in this case, the comparator module 125 can be omitted.
应当理解,上述的实施方式仅是示例性的,而非限制性的,在不偏离本发明的基本原理的情况下,本领域的技术人员可以针对上述细节做出的各种明显的或等同的修改或替换,都将包含于本发明的权利要求范围内。It should be understood that the above-mentioned embodiments are only exemplary and not restrictive. Without departing from the basic principles of the present invention, those skilled in the art can make various obvious or equivalent details regarding the above-mentioned details. Modifications or replacements will be included in the scope of the claims of the present invention.

Claims (17)

  1. 一种主从蓝牙耳机切换方法,用于主耳机和从耳机,其特征在于,所述方法包括如下步骤:A method for switching between master and slave Bluetooth headsets, used for a master headset and a slave headset, characterized in that the method includes the following steps:
    步骤S901:主耳机(100)按蓝牙通信标准协议接收音源设备发送的多个音频数据包;Step S901: The main earphone (100) receives multiple audio data packets sent by the audio source device according to the Bluetooth communication standard protocol;
    步骤S903:从耳机(200)按蓝牙通信标准协议监听音源设备发送的多个音频数据包;Step S903: monitor multiple audio data packets sent by the audio source device from the headset (200) according to the Bluetooth communication standard protocol;
    步骤S905:所述主耳机(100)与所述从耳机(200)建立主从蓝牙链路,以使所述主耳机(100)与所述从耳机(200)进行数据交互;Step S905: The master headset (100) and the slave headset (200) establish a master-slave Bluetooth link, so that the master headset (100) and the slave headset (200) perform data interaction;
    步骤S907:所述从耳机(200)向所述主耳机(100)发送所述从耳机的剩余电量;Step S907: The slave earphone (200) sends the remaining power of the slave earphone (100) to the master earphone (100);
    步骤S909:所述主耳机(100)接收所述从耳机(200)发送的所述从耳机的剩余电量;Step S909: The master earphone (100) receives the remaining power of the slave earphone sent by the slave earphone (200);
    步骤S911:所述主耳机(100)判断所述从耳机的剩余电量与所述主耳机的剩余电量是否超过预设值;Step S911: The master headset (100) determines whether the remaining power of the slave headset and the remaining power of the master headset exceed a preset value;
    步骤S913:如果所述从耳机的剩余电量与所述主耳机的剩余电量之间的差值超过预设值,则所述主耳机(100)向所述从耳机(200)发送主从切换请求;Step S913: If the difference between the remaining power of the slave headset and the remaining power of the master headset exceeds a preset value, the master headset (100) sends a master-slave switching request to the slave headset (200) ;
    步骤S915:所述从耳机(200)接收所述主耳机(100)发送的主从切换请求;Step S915: The slave headset (200) receives the master-slave switching request sent by the master headset (100);
    步骤S917:所述从耳机(200)根据所述主从切换请求向所述主耳机(100)发送主从切换应答;Step S917: The slave headset (200) sends a master-slave switching response to the master headset (100) according to the master-slave switching request;
    步骤S919:所述主耳机(100)接收所述主从切换应答;及Step S919: The master headset (100) receives the master-slave switching response; and
    步骤S921:当所述主耳机(100)接收到所述主从切换应答后,所述主耳机(100)和所述从耳机(200)在主从切换时间到来时执行主从切换操作;Step S921: After the master headset (100) receives the master-slave switching response, the master headset (100) and the slave headset (200) perform a master-slave switching operation when the master-slave switching time comes;
    其中,所述步骤S907、S915、步骤S917和步骤S921中的至少一个在第一空闲时段内完成,所述第一空闲时段为所述从耳机(200)未执行监听所述音频数据包操作的时段,且所述第一空闲时段与监听到一个音频数据包的至少部分数据的时段处于同一标准蓝牙时隙内;Wherein, at least one of the steps S907, S915, step S917, and step S921 is completed in a first idle period, and the first idle period is when the slave headset (200) has not performed the operation of monitoring the audio data packet Time period, and the first idle time period and the time period during which at least part of the data of an audio data packet is monitored are in the same standard Bluetooth time slot;
    其中,所述步骤S909、步骤S911、步骤S913、步骤S919和和步骤S921中的至少一个在第二空闲时段内完成,所述第二空闲时段为所述主耳机(100)未执行接收所述音频数据包操作的时段,且所述第二空闲时段与接收到一个音频数据包的至少部分数据时段处于同一标准蓝牙时隙内。Wherein, at least one of step S909, step S911, step S913, step S919, and step S921 is completed in a second idle period, and the second idle period is when the main headset (100) has not performed receiving the The period of audio data packet operation, and the second idle period is in the same standard Bluetooth time slot as at least part of the data period of receiving an audio data packet.
  2. 一种主从蓝牙耳机切换方法,用于从耳机,其特征在于,所述方法包括如下步骤:A method for switching between master and slave Bluetooth headsets, used for slave headsets, characterized in that the method includes the following steps:
    步骤S101:按蓝牙通信标准协议监听音源设备发送的多个音频数据包,期间,主耳机按蓝牙通信标准协议接收所述多个音频数据包;Step S101: Monitor multiple audio data packets sent by the audio source device according to the Bluetooth communication standard protocol, during which the main earphone receives the multiple audio data packets according to the Bluetooth communication standard protocol;
    步骤S103:与所述主耳机建立主从蓝牙链路,以与所述主耳机进行数据交互;Step S103: Establish a master-slave Bluetooth link with the master headset to perform data interaction with the master headset;
    步骤S105:向所述主耳机(100)发送所述从耳机的剩余电量;Step S105: Send the remaining power of the slave earphone to the master earphone (100);
    步骤S107:接收所述主耳机发送的主从切换请求,其中,所述主耳机在所述从耳机的剩余电量与所述主耳机的剩余电量之间的差值超过预设值后向所述从耳机发送主从切换请求;Step S107: Receive a master-slave switching request sent by the master earphone, where the master earphone sends a message to the master earphone after the difference between the remaining power of the slave earphone and the remaining power of the master earphone exceeds a preset value. Send a master-slave switching request from the headset;
    步骤S109:根据所述主从切换请求向所述主耳机(100)发送主从切换应答;及Step S109: Send a master-slave switching response to the master headset (100) according to the master-slave switching request; and
    步骤S111:当所述主耳机(100)接收到所述主从切换应答后,在主从切换时间到来时执行主从切换操作;Step S111: After the master headset (100) receives the master-slave switching response, execute the master-slave switching operation when the master-slave switching time comes;
    其中,所述步骤S105、S107、S109和S111中的至少一个在第一空闲时段内完成,所述第一空闲时段为所述从耳机(200)未执行监听所述音频数据包操作的时段,且所述第一空闲时段与监听到一个音频数据包的至少部分数据的时段处于同一标准蓝牙时隙内。Wherein, at least one of the steps S105, S107, S109, and S111 is completed in a first idle period, and the first idle period is a period during which the slave headset (200) does not perform the operation of monitoring the audio data packet, In addition, the first idle period and the period during which at least part of the data of an audio data packet is monitored are in the same standard Bluetooth time slot.
  3. 如权利要求2所述的主从蓝牙耳机切换方法,其特征在于,所述步骤S105包括:The method for switching between master and slave Bluetooth headsets according to claim 2, wherein the step S105 comprises:
    当所述从耳机(200)监听到所述音源设备发送的当前的音频数据包后,向所述主耳机(100)发送音频监听成功应答包,其中,所述音频监听成功应答包中包含所述从耳机的剩余电量。After the slave earphone (200) monitors the current audio data packet sent by the audio source device, it sends an audio monitoring success response packet to the master earphone (100), wherein the audio monitoring success response packet contains all Describe the remaining power of the headset.
  4. 如权利要求3所述的主从蓝牙耳机切换方法,其特征在于,The method for switching between master and slave Bluetooth headsets according to claim 3, wherein:
    进一步地,为了提高及时性,在最近的第一空闲时段向所述主耳机(100)发送音频监听成功应答包。Further, in order to improve timeliness, an audio monitoring success response packet is sent to the main earphone (100) in the most recent first idle period.
  5. 如权利要求2-4任意一项所述的主从蓝牙耳机切换方法,其特征在于, 还包括:The method for switching between master and slave Bluetooth headsets according to any one of claims 2-4, further comprising:
    当所述从耳机(200)的剩余电量小于电量阈值后,在所述第一空闲时段向所述主耳机(100)发送结束蓝牙通信请求;After the remaining power of the slave headset (200) is less than the power threshold, send a request to end the Bluetooth communication to the master headset (100) in the first idle period;
    当所述从耳机(200)接收到所述主耳机(100)发送的结束蓝牙通信应答后,输出关闭所述从耳机电源的指示,以关闭所述从耳机的电源。After the slave earphone (200) receives the end Bluetooth communication response sent by the master earphone (100), it outputs an instruction to turn off the power of the slave earphone to turn off the power of the slave earphone.
  6. 一种主从蓝牙耳机切换方法,用于主耳机(100),其特征在于,所述方法包括如下步骤:A method for switching a master-slave Bluetooth headset for a master headset (100), characterized in that the method includes the following steps:
    步骤S501:按蓝牙通信标准协议接收音源设备发送的多个音频数据包,期间,从耳机按蓝牙通信标准协议监听所述多个音频数据包;Step S501: Receive multiple audio data packets sent by the audio source device according to the Bluetooth communication standard protocol, during which time the multiple audio data packets are monitored from the headset according to the Bluetooth communication standard protocol;
    步骤S503:与所述从耳机建立主从蓝牙链路,以与所述从耳机进行数据交互;Step S503: Establish a master-slave Bluetooth link with the slave headset to perform data interaction with the slave headset;
    步骤S505:接收所述从耳机(200)发送的所述从耳机的剩余电量;Step S505: receiving the remaining power of the slave earphone (200) sent by the slave earphone (200);
    步骤S507:判断所述从耳机的剩余电量与所述主耳机的剩余电量之间的差值是否超过预设值;Step S507: Determine whether the difference between the remaining power of the slave earphone and the remaining power of the master earphone exceeds a preset value;
    步骤S509:如果所述从耳机的剩余电量与所述主耳机的剩余电量超过预设值,则向所述从耳机(200)发送主从切换请求;Step S509: If the remaining power of the slave headset and the remaining power of the master headset exceed a preset value, send a master-slave switching request to the slave headset (200);
    步骤S511:接收所述从耳机(200)根据所述主从切换请求发送的主从切换应答;及Step S511: receiving the master-slave switching response sent by the slave headset (200) according to the master-slave switching request; and
    步骤S513:根据所述主从切换应答在主从切换时间到来时执行主从切换操作;Step S513: Perform a master-slave switching operation when the master-slave switching time comes according to the master-slave switching response;
    其中,所述步骤S505、步骤S507、步骤S509、步骤S511和步骤S513中的至少一个在第二空闲时段内完成,所述第二空闲时段为所述主耳机(100)未执行接收所述音频数据包操作的时段,且所述第二空闲时段与接收到一个音频数据包的至少部分数据时段处于同一标准蓝牙时隙内。Wherein, at least one of step S505, step S507, step S509, step S511, and step S513 is completed in a second idle period, and the second idle period is when the main headset (100) is not performing receiving the audio The period of data packet operation, and the second idle period is in the same standard Bluetooth time slot as at least part of the data period of receiving an audio data packet.
  7. 如权利要求6所述的主从蓝牙耳机切换方法,其特征在于,所述步骤S505包括:The method for switching between master and slave Bluetooth headsets according to claim 6, wherein the step S505 comprises:
    接收所述从耳机(200)发送的音频监听成功应答包,所述音频监听成功应答包表示所述从耳机(200)成功监听到所述音源设备发送的当前的音频数据包;Receiving the audio monitoring success response packet sent by the slave earphone (200), where the audio monitoring success response packet indicates that the slave earphone (200) has successfully monitored the current audio data packet sent by the audio source device;
    从所述音频监听成功应答包中获取所述从耳机的剩余电量。Obtain the remaining power of the slave earphone from the audio monitoring success response packet.
  8. 如权利要求6或7所述的主从蓝牙耳机切换方法,其特征在于,所述 步骤S509包括:The method for switching between master and slave Bluetooth headsets according to claim 6 or 7, wherein the step S509 comprises:
    如果所述从耳机的剩余电量与所述主耳机的剩余电量超过预设值,则在最近的所述第二空闲时段向所述从耳机(200)发送主从切换请求。If the remaining power of the slave headset and the remaining power of the master headset exceed a preset value, sending a master-slave switching request to the slave headset (200) in the most recent second idle period.
  9. 如权利要求6-8任意一项所述的主从蓝牙耳机切换方法,其特征在于,还包括:The method for switching between master and slave Bluetooth headsets according to any one of claims 6-8, further comprising:
    在所述第二空闲时段接收所述从耳机(200)发送的结束蓝牙通信请求;Receiving the end Bluetooth communication request sent by the slave headset (200) in the second idle period;
    向所述从耳机(200)发送接收到所述结束蓝牙通信请求的应答;Sending to the slave headset (200) a response to the end of the Bluetooth communication request;
    根据所述结束蓝牙通信请求输出关闭所述主耳机(100)电源的指示,以关闭所述主耳机(100)的电源。Outputting an instruction to turn off the power of the main headset (100) according to the end of the Bluetooth communication request to turn off the power of the main headset (100).
  10. 一种主从蓝牙耳机切换装置,其特征在于,包括:A master-slave Bluetooth headset switching device is characterized in that it comprises:
    监听模块,用于按蓝牙通信标准协议监听音源设备发送的多个音频数据包,期间,主耳机按蓝牙通信标准协议接收所述多个音频数据包;The monitoring module is used to monitor multiple audio data packets sent by the audio source device according to the Bluetooth communication standard protocol, during which the main earphone receives the multiple audio data packets according to the Bluetooth communication standard protocol;
    第一建立模块,用于与所述主耳机建立主从蓝牙链路,以与所述主耳机进行数据交互;The first establishment module is configured to establish a master-slave Bluetooth link with the master headset to perform data interaction with the master headset;
    电量发送模块,用于向所述主耳机(100)发送所述从耳机的剩余电量;A power sending module, configured to send the remaining power of the slave earphone to the master earphone (100);
    请求接收模块,用于接收所述主耳机发送的主从切换请求,其中,所述主耳机在所述从耳机的剩余电量与所述主耳机的剩余电量之间的差值超过预设值后向所述从耳机发送主从切换请求;The request receiving module is configured to receive a master-slave switching request sent by the master earphone, wherein the master earphone is after the difference between the remaining power of the slave earphone and the remaining power of the master earphone exceeds a preset value Sending a master-slave switching request to the slave headset;
    应答模块,用于根据所述主从切换请求向所述主耳机(100)发送主从切换应答;及A response module, configured to send a master-slave switching response to the master headset (100) according to the master-slave switching request; and
    第一切换模块,用于当所述主耳机(100)接收到所述主从切换应答后,在主从切换时间到来时执行主从切换操作;The first switching module is configured to perform a master-slave switching operation when the master-slave switching time comes after the master headset (100) receives the master-slave switching response;
    其中,所述电量发送模块、所述请求接收模块、所述应答模块和所述第一切换模块中的至少一个在第一空闲时段内完成,所述第一空闲时段为所述从耳机(200)未执行监听所述音频数据包操作的时段,且所述第一空闲时段与监听到一个音频数据包的至少部分数据的时段处于同一标准蓝牙时隙内。Wherein, at least one of the power sending module, the request receiving module, the response module, and the first switching module is completed in a first idle period, and the first idle period is the slave headset (200 ) The period during which the operation of monitoring the audio data packet is not performed, and the first idle period and the period during which at least part of the data of an audio data packet is monitored are in the same standard Bluetooth time slot.
  11. 如权利要求10所述的主从蓝牙耳机切换装置,其特征在于,所述装置还包括:The device for switching master-slave Bluetooth headsets according to claim 10, wherein the device further comprises:
    数据接收模块,用于按蓝牙通信标准协议接收音源设备发送的多个音频数据包,期间,从耳机按蓝牙通信标准协议监听所述多个音频数据包;The data receiving module is configured to receive multiple audio data packets sent by the audio source device according to the Bluetooth communication standard protocol, during which the multiple audio data packets are monitored from the earphone according to the Bluetooth communication standard protocol;
    第二建立模块,用于与所述从耳机建立主从蓝牙链路,以与所述从耳机进 行数据交互;The second establishment module is used to establish a master-slave Bluetooth link with the slave headset to perform data interaction with the slave headset;
    电量接收模块,用于接收所述从耳机(200)发送的所述从耳机的剩余电量;A power receiving module, configured to receive the remaining power of the slave earphone (200) sent by the slave earphone (200);
    电量判断模块,用于判断所述从耳机的剩余电量与所述主耳机的剩余电量之间的差值是否超过预设值;A power determination module, configured to determine whether the difference between the remaining power of the slave earphone and the remaining power of the master earphone exceeds a preset value;
    请求发送模块,用于如果所述电量判断模块判断出所述从耳机的剩余电量与所述主耳机的剩余电量超过预设值,则向所述从耳机(200)发送主从切换请求;A request sending module, configured to send a master-slave switching request to the slave earphone (200) if the power judgment module determines that the remaining power of the slave earphone and the remaining power of the master earphone exceed a preset value;
    应答接收模块,用于接收所述从耳机(200)根据所述主从切换请求发送的主从切换应答;及A response receiving module, configured to receive the master-slave switching response sent by the slave headset (200) according to the master-slave switching request; and
    第二切换模块,用于根据所述主从切换应答在主从切换时间到来时执行主从切换操作;The second switching module is configured to perform a master-slave switching operation when the master-slave switching time comes according to the master-slave switching response;
    其中,所述电量发送模块、所述请求接收模块、所述电量判断模块、所述应答模块和第一切换模块中的至少一个在第二空闲时段内完成,所述第二空闲时段为所述主耳机(100)未执行接收所述音频数据包操作的时段,且所述第二空闲时段与接收到一个音频数据包的至少部分数据时段处于同一标准蓝牙时隙内。Wherein, at least one of the power sending module, the request receiving module, the power judgment module, the response module, and the first switching module is completed in a second idle period, and the second idle period is the The main earphone (100) does not perform the period during which the audio data packet is received, and the second idle period is in the same standard Bluetooth time slot as at least part of the data period during which one audio data packet is received.
  12. 一种蓝牙耳机,包括处理器,其特征在于,所述处理器用于实现如权利要求2-5任意一项所述的方法。A Bluetooth headset comprising a processor, wherein the processor is used to implement the method according to any one of claims 2-5.
  13. 一种蓝牙耳机,包括处理器,其特征在于,所述处理器用于实现如权利要求6-9任意一项所述的方法。A Bluetooth headset comprising a processor, wherein the processor is used to implement the method according to any one of claims 6-9.
  14. 一种蓝牙耳机系统,其特征在于,包括:A Bluetooth headset system is characterized in that it includes:
    从耳机,用于监听并播放音源设备发送的多个音频数据包;及From the earphone, it is used to monitor and play multiple audio data packets sent by the audio source device; and
    主耳机,用于接收并播放音源设备发送的多个音频数据包;The main earphone is used to receive and play multiple audio data packets sent by the audio source device;
    其中,所述从耳机和所述主耳机构成蓝牙耳机对;所述从耳机为如权利要求12所述的蓝牙耳机;所述主耳机为权利要求13所述的蓝牙耳机。Wherein, the slave headset and the master headset constitute a Bluetooth headset pair; the slave headset is the Bluetooth headset according to claim 12; the master headset is the Bluetooth headset according to claim 13.
  15. 一种蓝牙音频播放系统,其特征在于,包括:A Bluetooth audio playback system is characterized in that it comprises:
    如权利要求14所述的蓝牙耳机系统;及The Bluetooth headset system according to claim 14; and
    音源设备,用于向所述蓝牙耳机系统提供多个音频数据包。The audio source device is used to provide multiple audio data packets to the Bluetooth headset system.
    在可选的实施例中,所述音源设备可以是手机、平板电脑、笔记本、影音播放器等具有蓝牙通信功能和音频数据提供功能的设备。In an alternative embodiment, the audio source device may be a mobile phone, a tablet computer, a notebook, an audio-visual player, and other devices that have a Bluetooth communication function and an audio data providing function.
  16. 一种蓝牙耳机芯片,其上具有集成电路,其特征在于,所述集成电路用于实现如权利要求2-5任意一项所述的方法;或者/和,用于实现如权利要求6-9任意一项所述的方法。A Bluetooth headset chip with an integrated circuit thereon, wherein the integrated circuit is used to implement the method according to any one of claims 2-5; or/and, used to implement the method according to claims 6-9 Any one of the methods.
  17. 一种计算机可读存储介质,其上存储有计算机程序,其特征在于,存储介质中存储的计算机程序用于被执行实现如权利要求2-5任意一项所述的方法;或者,用于实现如权利要求6-9任意一项所述的方法。A computer-readable storage medium with a computer program stored thereon, wherein the computer program stored in the storage medium is used to be executed to implement the method according to any one of claims 2-5; or, to implement The method according to any one of claims 6-9.
PCT/CN2020/119607 2019-10-31 2020-09-30 Method and apparatus for switching master and slave bluetooth headsets, bluetooth headset, and system WO2021082875A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201911051730.3 2019-10-31
CN201911051730.3A CN111436041B (en) 2019-10-31 2019-10-31 Method and device for switching master and slave Bluetooth earphones, bluetooth earphones and system

Publications (1)

Publication Number Publication Date
WO2021082875A1 true WO2021082875A1 (en) 2021-05-06

Family

ID=71580569

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/119607 WO2021082875A1 (en) 2019-10-31 2020-09-30 Method and apparatus for switching master and slave bluetooth headsets, bluetooth headset, and system

Country Status (2)

Country Link
CN (1) CN111436041B (en)
WO (1) WO2021082875A1 (en)

Families Citing this family (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111436041B (en) * 2019-10-31 2022-11-18 珠海市杰理科技股份有限公司 Method and device for switching master and slave Bluetooth earphones, bluetooth earphones and system
CN111988770A (en) * 2020-07-23 2020-11-24 炬芯科技股份有限公司 Control method and system of wireless equipment
CN112437370B (en) * 2020-08-11 2023-02-24 珠海市杰理科技股份有限公司 Link switching method, system, TWS earphone pair, chip and medium
CN112437371B (en) * 2020-08-11 2023-02-21 珠海市杰理科技股份有限公司 BLE link switching method, equipment, earphone pair, chip and medium
CN111988695B (en) * 2020-08-24 2022-11-22 歌尔科技有限公司 Earphone synchronization method, device, equipment and storage medium of wireless earphone
CN112291683B (en) * 2020-10-15 2022-03-18 广州安凯微电子股份有限公司 TWS earphone control method and device
CN112672290B (en) * 2020-12-02 2022-05-31 无锡中感微电子股份有限公司 Method, device and equipment for master-slave switching in wireless communication system
CN113038333B (en) * 2021-04-26 2023-04-28 维沃移动通信有限公司 Bluetooth headset control method and device, electronic equipment and readable storage medium
CN113365257B (en) * 2021-06-04 2023-01-24 华勤技术股份有限公司 Master-slave earphone switching method and device, earphone and readable storage medium
CN114466099B (en) * 2021-08-31 2022-12-20 荣耀终端有限公司 Control method and device of Bluetooth equipment and storage medium
CN113573202A (en) * 2021-09-23 2021-10-29 深圳市外星人创新电子有限公司 Data transmission control method and system of Bluetooth headset
CN115175065B (en) * 2022-09-06 2023-01-17 荣耀终端有限公司 Broadcasting method, TWS headset and storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2013180859A1 (en) * 2012-05-26 2013-12-05 Qualcomm Incorporated Smart battery wear leveling for audio devices
CN107820155A (en) * 2017-11-08 2018-03-20 深圳市沃特沃德股份有限公司 Control method, device and the wireless headset of wireless headset
CN109495867A (en) * 2018-11-22 2019-03-19 重庆物奇科技有限公司 The method of bluetooth equipment, system and the transmission of equipment room information
CN109660906A (en) * 2019-03-12 2019-04-19 恒玄科技(上海)有限公司 Wireless Bluetooth headsets, wireless Bluetooth headsets master-slave swap optimization method
CN110234045A (en) * 2019-06-11 2019-09-13 同响科技股份有限公司 To be wirelessly connected the bluetooth headset of ears
CN111436041A (en) * 2019-10-31 2020-07-21 珠海市杰理科技股份有限公司 Method and device for switching master and slave Bluetooth earphones, Bluetooth earphones and system

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108271090A (en) * 2018-01-10 2018-07-10 深圳市沃特沃德股份有限公司 Bluetooth headset master-slave switching method and device
CN108958696A (en) * 2018-07-02 2018-12-07 Oppo广东移动通信有限公司 Principal and subordinate's earphone method for handover control and Related product
CN109327829A (en) * 2018-11-22 2019-02-12 重庆物奇科技有限公司 The method of bluetooth equipment, Bluetooth communication system and equipment room transmission instruction

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2013180859A1 (en) * 2012-05-26 2013-12-05 Qualcomm Incorporated Smart battery wear leveling for audio devices
CN107820155A (en) * 2017-11-08 2018-03-20 深圳市沃特沃德股份有限公司 Control method, device and the wireless headset of wireless headset
CN109495867A (en) * 2018-11-22 2019-03-19 重庆物奇科技有限公司 The method of bluetooth equipment, system and the transmission of equipment room information
CN109660906A (en) * 2019-03-12 2019-04-19 恒玄科技(上海)有限公司 Wireless Bluetooth headsets, wireless Bluetooth headsets master-slave swap optimization method
CN110234045A (en) * 2019-06-11 2019-09-13 同响科技股份有限公司 To be wirelessly connected the bluetooth headset of ears
CN111436041A (en) * 2019-10-31 2020-07-21 珠海市杰理科技股份有限公司 Method and device for switching master and slave Bluetooth earphones, Bluetooth earphones and system

Also Published As

Publication number Publication date
CN111436041B (en) 2022-11-18
CN111436041A (en) 2020-07-21

Similar Documents

Publication Publication Date Title
WO2021082875A1 (en) Method and apparatus for switching master and slave bluetooth headsets, bluetooth headset, and system
CN108696784B (en) Wireless earphone role switching method, wireless earphone and TWS earphone
US20210219041A1 (en) Voice data transmission method, wireless earphone and tws earphone
US10244468B2 (en) Smart battery wear leveling for audio devices
WO2019237464A1 (en) Method and apparatus for establishing single-line connection, and wireless headset and charging box
WO2019205157A1 (en) Wireless earphones communication method, master earphone, slave earphone, and earphones system
CN111436042B (en) Bluetooth headset and dynamic master-slave switching method, device and system thereof
WO2021129892A1 (en) System and method for switching device primary/secondary roles for use in wireless communications
CN109391926B (en) Data processing method of wireless audio equipment and wireless audio equipment
CN111435844B (en) Method, device, equipment and system for correcting audio data in dual-wireless Bluetooth communication
CN112055349B (en) Wireless communication method and Bluetooth device
CN111436043B (en) Communication method, device, equipment and system of dual-wireless Bluetooth communication network
US11895456B2 (en) Sharing audio from a source device
CN111436046A (en) Bluetooth-based audio data providing method and device, charging equipment and system
CN111988770A (en) Control method and system of wireless equipment
CN113840269B (en) Multimedia data transmission method and device, electronic equipment and storage medium
CN109041141B (en) Transmission link switching control method and related product
CN112291683B (en) TWS earphone control method and device
CN114258003A (en) Audio playing control method, system, device and storage medium
CN109117111B (en) Transmission link switching control method and related product
CN111669679A (en) Method for balanced consumption of battery of true wireless Bluetooth headset
CN114079898A (en) Audio data communication method, device, equipment and system in dual-transmission mode
CN113038317A (en) Earphone control method and device, Bluetooth earphone and storage medium
CN109121172A (en) Transmission link method for handover control and Related product
TWI815165B (en) True wireless stereo headphone component and control method thereof

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20881142

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20881142

Country of ref document: EP

Kind code of ref document: A1

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 07.10.2022)

122 Ep: pct application non-entry in european phase

Ref document number: 20881142

Country of ref document: EP

Kind code of ref document: A1