CN112235677A - Master-slave switching method of wireless earphone, wireless earphone and readable storage medium - Google Patents

Master-slave switching method of wireless earphone, wireless earphone and readable storage medium Download PDF

Info

Publication number
CN112235677A
CN112235677A CN202011074655.5A CN202011074655A CN112235677A CN 112235677 A CN112235677 A CN 112235677A CN 202011074655 A CN202011074655 A CN 202011074655A CN 112235677 A CN112235677 A CN 112235677A
Authority
CN
China
Prior art keywords
earphone
link
master
slave
signal strength
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202011074655.5A
Other languages
Chinese (zh)
Other versions
CN112235677B (en
Inventor
褚夫环
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Goertek Techology Co Ltd
Original Assignee
Goertek Techology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Goertek Techology Co Ltd filed Critical Goertek Techology Co Ltd
Priority to CN202011074655.5A priority Critical patent/CN112235677B/en
Publication of CN112235677A publication Critical patent/CN112235677A/en
Application granted granted Critical
Publication of CN112235677B publication Critical patent/CN112235677B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04RLOUDSPEAKERS, MICROPHONES, GRAMOPHONE PICK-UPS OR LIKE ACOUSTIC ELECTROMECHANICAL TRANSDUCERS; DEAF-AID SETS; PUBLIC ADDRESS SYSTEMS
    • H04R1/00Details of transducers, loudspeakers or microphones
    • H04R1/10Earpieces; Attachments therefor ; Earphones; Monophonic headphones
    • H04R1/1041Mechanical or electronic switches, or control elements
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04RLOUDSPEAKERS, MICROPHONES, GRAMOPHONE PICK-UPS OR LIKE ACOUSTIC ELECTROMECHANICAL TRANSDUCERS; DEAF-AID SETS; PUBLIC ADDRESS SYSTEMS
    • H04R3/00Circuits for transducers, loudspeakers or microphones
    • H04R3/12Circuits for transducers, loudspeakers or microphones for distributing signals to two or more loudspeakers
    • 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

Landscapes

  • Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Acoustics & Sound (AREA)
  • Signal Processing (AREA)
  • Health & Medical Sciences (AREA)
  • General Health & Medical Sciences (AREA)
  • Otolaryngology (AREA)
  • Headphones And Earphones (AREA)
  • Telephone Function (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

The invention discloses a master-slave switching method of a wireless earphone, the wireless earphone and a readable storage medium, wherein the master-slave switching method of the wireless earphone comprises the following steps: the method comprises the steps that a main earphone obtains a first link quality standard deviation and a first signal intensity mean value of a first link between the main earphone and an audio playing device within a preset time interval; receiving a second link quality standard deviation and a second signal strength mean value of a second link sent by a slave earphone within the preset time interval, wherein the second link is a communication link between the slave earphone and the audio playing device; when the first link quality standard deviation, the first signal strength mean value, the second link quality standard deviation and the second signal strength mean value meet a preset switching condition, sending a first switching instruction to the slave earphone so that the slave earphone switches the master earphone; and the main earphone is switched to the slave earphone, so that the reliability of the wireless earphone is improved.

Description

Master-slave switching method of wireless earphone, wireless earphone and readable storage medium
Technical Field
The present invention relates to the field of wireless headset technology, and in particular, to a master-slave switching method for a wireless headset, a wireless headset and a readable storage medium.
Background
The existing wireless earphone is provided with a master earphone and a slave earphone when leaving a factory, and when the master earphone cannot be used due to various reasons (such as too far distance between equipment and the master earphone, and the master earphone breaks down, so that the equipment and the master earphone are abnormally disconnected), the slave earphone cannot be used, so that the reliability of the wireless earphone is low.
The above is only for the purpose of assisting understanding of the technical aspects of the present invention, and does not represent an admission that the above is prior art.
Disclosure of Invention
The invention mainly aims to provide a master-slave switching method of a wireless earphone, the wireless earphone and a readable storage medium, aiming at improving the reliability of the wireless earphone.
In order to achieve the above object, the present invention provides a master-slave switching method for a wireless headset, which is applied to a master headset, and the master-slave switching method for the wireless headset comprises the following steps:
the method comprises the steps that a main earphone obtains a first link quality standard deviation and a first signal intensity mean value of a first link between the main earphone and an audio playing device within a preset time interval;
receiving a second link quality standard deviation and a second signal strength mean value of a second link sent by a slave earphone within the preset time interval, wherein the second link is a communication link between the slave earphone and the audio playing device;
when the first link quality standard deviation, the first signal strength mean value, the second link quality standard deviation and the second signal strength mean value meet a preset switching condition, sending a first switching instruction to the slave earphone so that the slave earphone switches the master earphone; and
the master earphone is switched to be the slave earphone.
Optionally, the preset handover condition includes that a difference between the second signal strength mean value and the first signal strength mean value is greater than a first preset threshold, and a difference between the first link quality standard deviation and the second link quality standard deviation is greater than a second preset threshold.
Optionally, the step of the master earphone periodically acquiring a first link quality standard deviation and a first signal strength mean value of a first link between the master earphone and the audio playing device within a preset time interval includes:
acquiring a preset number of first data packets in a first link within the preset time interval;
acquiring a first link quality and a first signal strength corresponding to each first data packet, wherein the first link quality is the link quality when the first data packet is received, and the first signal strength is the signal strength when the first data packet is received;
obtaining the first link quality standard deviation according to each first link quality;
and acquiring the mean value of the first signal strength according to each first signal strength.
Optionally, before the step of obtaining a first link quality standard deviation and a first signal strength mean value of a first link between the master earphone and the audio playing device within a preset time interval, the method further includes:
after the master earphone is started, a third link between the master earphone and the slave earphone is established;
performing handshake with the audio playing device;
after the handshake is successful, establishing a first link with the audio playing device, and entering a communication mode to communicate with the audio playing device through the first link; and
and sending connection information to the slave earphone through the third link so that the slave earphone establishes a second link with the audio playing device according to the connection information.
Optionally, the step of switching the master earphone to the slave earphone comprises:
the master earpiece enters a listening mode.
In addition, in order to achieve the above object, the present invention further provides a master-slave switching method for a wireless headset, which is applied to a slave headset, and the master-slave switching method for the wireless headset includes the following steps:
acquiring a second link quality standard deviation and a second signal intensity mean value of a second link between the earphone and the audio playing device within a preset time interval;
sending the second link quality standard deviation and the second signal strength mean value to a master earphone so that the master earphone judges whether the current Bluetooth communication quality meets a preset switching condition according to the second link instruction standard deviation and the second signal strength mean value;
and when a first switching instruction sent by the master earphone is received, the slave earphone is switched to the master earphone.
Optionally, the step of obtaining, from the headset, a second link quality standard deviation and a second signal strength mean value of a second link between the headset and the audio playing device within a preset time interval includes:
acquiring a preset number of second data packets in a second link within a preset time interval;
acquiring a second link quality and a second signal strength corresponding to each second data packet, wherein the second link quality is the link quality when the second data packet is received, and the second signal strength is the signal strength when the second data packet is received;
obtaining the second link quality standard deviation according to each second link quality;
and acquiring the second signal intensity mean value according to each second signal intensity.
Optionally, before the step of obtaining, from the headset, a second link quality standard deviation and a second signal strength mean value of a second link between the headset and the audio playing device within a preset time interval, the method further includes:
after the slave earphone is started, a third link between the slave earphone and the master earphone is established;
when connection information sent by the main earphone through the third link is received, a second link of the audio playing device corresponding to the connection information is established according to the connection information;
the slave earpiece enters a listening mode.
Optionally, the first switching instruction is to control the slave earphone to enter a communication mode, and when receiving the first switching instruction sent by the master earphone, the step of switching the slave earphone to the master earphone includes:
and when a first switching instruction sent by the master earphone is received, the slave earphone enters a communication mode.
In addition, to achieve the above object, the present invention further provides a wireless headset, including: the master-slave switching program of the wireless headset realizes the steps of the master-slave switching method of the wireless headset when being executed by the processor.
In addition, in order to achieve the above object, the present invention further provides a readable storage medium, where a master-slave switching program of a wireless headset is stored, and when the master-slave switching program of the wireless headset is executed by a processor, the steps of the master-slave switching method of the wireless headset are implemented.
According to the master-slave switching method of the wireless earphone, the wireless earphone and the readable storage medium provided by the embodiment of the invention, the master earphone acquires a first link quality standard deviation and a first signal intensity mean value of a first link between the master earphone and the audio playing equipment within a preset time interval; receiving a second link quality standard deviation and a second signal strength mean value of a second link sent by a slave earphone within the preset time interval, wherein the second link is a communication link between the slave earphone and the audio playing device; when the first link quality standard deviation, the first signal strength mean value, the second link quality standard deviation and the second signal strength mean value meet a preset switching condition, sending a first switching instruction to the slave earphone so that the slave earphone switches the master earphone; and the master earphone is switched to the slave earphone, so that master-slave switching between the wireless earphones is realized, and the reliability of the wireless earphones is improved.
Drawings
Fig. 1 is a schematic diagram of a hardware architecture of a wireless headset according to an embodiment of the present invention;
fig. 2 is a flowchart illustrating a first embodiment of a master-slave switching method of a wireless headset according to the present invention;
fig. 3 is a flowchart illustrating a master-slave switching method of a wireless headset according to a fourth embodiment of the present invention.
The implementation, functional features and advantages of the objects of the present invention will be further explained with reference to the accompanying drawings.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
The existing wireless earphone is provided with a master earphone and a slave earphone when leaving a factory, and when the master earphone cannot be used due to various reasons (such as too far distance between equipment and the master earphone, and the master earphone breaks down, so that the equipment and the master earphone are abnormally disconnected), the slave earphone cannot be used, so that the reliability of the wireless earphone is low.
In order to solve the above-mentioned drawbacks, an embodiment of the present invention provides a master-slave switching method for a wireless headset, a wireless headset and a readable storage medium, where the master-slave switching method for a wireless headset is applied to a master headset, and mainly includes the following steps:
the method comprises the steps that a main earphone obtains a first link quality standard deviation and a first signal intensity mean value of a first link between the main earphone and an audio playing device within a preset time interval;
receiving a second link quality standard deviation and a second signal strength mean value of a second link sent by a slave earphone within the preset time interval, wherein the second link is a communication link between the slave earphone and the audio playing device;
when the first link quality standard deviation, the first signal strength mean value, the second link quality standard deviation and the second signal strength mean value meet a preset switching condition, sending a first switching instruction to the slave earphone so that the slave earphone switches the master earphone; and
the master earphone is switched to be the slave earphone.
The master-slave switching method of the wireless earphone is applied to the slave earphone and mainly comprises the following steps:
acquiring a second link quality standard deviation and a second signal intensity mean value of a second link between the earphone and the audio playing device within a preset time interval;
sending the second link quality standard deviation and the second signal strength mean value to a master earphone so that the master earphone judges whether the current Bluetooth communication quality meets a preset switching condition according to the second link instruction standard deviation and the second signal strength mean value;
and when a first switching instruction sent by the master earphone is received, the slave earphone is switched to the master earphone.
The method comprises the steps that a main earphone obtains a first link quality standard deviation and a first signal intensity mean value of a first link between the main earphone and an audio playing device within a preset time interval; receiving a second link quality standard deviation and a second signal strength mean value of a second link sent by a slave earphone within the preset time interval, wherein the second link is a communication link between the slave earphone and the audio playing device; when the first link quality standard deviation, the first signal strength mean value, the second link quality standard deviation and the second signal strength mean value meet a preset switching condition, sending a first switching instruction to the slave earphone so that the slave earphone switches the master earphone; and the master earphone is switched to the slave earphone, so that master-slave switching between the wireless earphones is realized, and the reliability of the wireless earphones is improved.
As shown in fig. 1, fig. 1 is a schematic diagram of a hardware architecture of a wireless headset according to an embodiment of the present invention.
As shown in fig. 1, the wireless headset may include: a processor 1001, such as a CPU, a user interface 1003, a network interface 1004, a memory 1005, a communication bus 1002. Wherein a communication bus 1002 is used to enable connective communication between these components. The user interface 1003 may comprise a Display screen (Display), an input unit such as a keyboard, etc., and the optional user interface 1003 may also comprise a standard wired interface, a wireless interface. The network interface 1004 may optionally include a standard wired interface, a wireless interface (e.g., WI-FI interface). The memory 1005 may be a high-speed RAM memory or a non-volatile memory (e.g., a magnetic disk memory). The memory 1005 may alternatively be a storage device separate from the processor 1001.
Those skilled in the art will appreciate that the hardware architecture of the wireless headset shown in fig. 1 does not constitute a limitation of the wireless headset and may include more or fewer components than shown, or some components in combination, or a different arrangement of components.
As shown in fig. 1, a memory 1005, which is a kind of computer storage medium, may include therein an operating system, a network communication module, a user interface module, and a master-slave switching program of a wireless headset.
In the wireless headset shown in fig. 1, the network interface 1004 is mainly used for connecting with a background server and performing data communication with the background server; the processor 1001 may be configured to invoke a master-slave switching procedure for the wireless headset stored in the memory 1005 and perform the following operations:
the method comprises the steps that a main earphone obtains a first link quality standard deviation and a first signal intensity mean value of a first link between the main earphone and an audio playing device within a preset time interval;
receiving a second link quality standard deviation and a second signal strength mean value of a second link sent by a slave earphone within the preset time interval, wherein the second link is a communication link between the slave earphone and the audio playing device;
when the first link quality standard deviation, the first signal strength mean value, the second link quality standard deviation and the second signal strength mean value meet a preset switching condition, sending a first switching instruction to the slave earphone so that the slave earphone switches the master earphone; and
the master earphone is switched to be the slave earphone.
Further, the processor 1001 may be configured to invoke a master-slave switching procedure for the wireless headset stored in the memory 1005, and further perform the following operations:
acquiring a preset number of first data packets in a first link within the preset time interval;
acquiring a first link quality and a first signal strength corresponding to each first data packet, wherein the first link quality is the link quality when the first data packet is received, and the first signal strength is the signal strength when the first data packet is received;
obtaining the first link quality standard deviation according to each first link quality;
and acquiring the mean value of the first signal strength according to each first signal strength.
Further, the processor 1001 may be configured to invoke a master-slave switching procedure for the wireless headset stored in the memory 1005, and further perform the following operations:
after the master earphone is started, a third link between the master earphone and the slave earphone is established;
performing handshake with the audio playing device;
after the handshake is successful, establishing a first link with the audio playing device, and entering a communication mode to communicate with the audio playing device through the first link; and
and sending connection information to the slave earphone through the third link so that the slave earphone establishes a second link with the audio playing device according to the connection information.
Further, the processor 1001 may be configured to invoke a master-slave switching procedure for the wireless headset stored in the memory 1005, and further perform the following operations:
the master earpiece enters a listening mode.
Further, the processor 1001 may be configured to invoke a master-slave switching procedure for the wireless headset stored in the memory 1005, and further perform the following operations:
acquiring a second link quality standard deviation and a second signal intensity mean value of a second link between the earphone and the audio playing device within a preset time interval;
sending the second link quality standard deviation and the second signal strength mean value to a master earphone so that the master earphone judges whether the current Bluetooth communication quality meets a preset switching condition according to the second link instruction standard deviation and the second signal strength mean value;
and when a first switching instruction sent by the master earphone is received, the slave earphone is switched to the master earphone.
Further, the processor 1001 may be configured to invoke a master-slave switching procedure for the wireless headset stored in the memory 1005, and further perform the following operations:
acquiring a preset number of second data packets in a second link within a preset time interval;
acquiring a second link quality and a second signal strength corresponding to each second data packet, wherein the second link quality is the link quality when the second data packet is received, and the second signal strength is the signal strength when the second data packet is received;
obtaining the second link quality standard deviation according to each second link quality;
and acquiring the second signal intensity mean value according to each second signal intensity.
Further, the processor 1001 may be configured to invoke a master-slave switching procedure for the wireless headset stored in the memory 1005, and further perform the following operations:
after the slave earphone is started, a third link between the slave earphone and the master earphone is established;
when connection information sent by the main earphone through the third link is received, a second link of the audio playing device corresponding to the connection information is established according to the connection information;
the slave earpiece enters a listening mode.
Further, the processor 1001 may be configured to invoke a master-slave switching procedure for the wireless headset stored in the memory 1005, and further perform the following operations:
and when a first switching instruction sent by the master earphone is received, the slave earphone enters a communication mode.
As shown in fig. 2, fig. 2 is a first embodiment of a master-slave switching method of a wireless headset according to the present invention, applied to a master headset, where the master-slave switching method of the wireless headset includes the following steps:
step S110, a main earphone acquires a first link quality standard deviation and a first signal intensity mean value of a first link between the main earphone and an audio playing device within a preset time interval;
step S120, receiving a second link quality standard deviation and a second signal strength mean value of a second link sent by a slave earphone within the preset time interval, where the second link is a communication link between the slave earphone and the audio playing device;
step S130, when the first link quality standard deviation, the first signal strength mean value, the second link quality standard deviation and the second signal strength mean value meet preset switching conditions, sending a first switching instruction to the slave earphone so that the slave earphone switches the master earphone; and
and step S140, switching the master earphone into the slave earphone.
In this embodiment, the Wireless headset is a bluetooth headset, and specifically, may be a TWS (True Wireless Stereo) headset; correspondingly, the audio playing device is a terminal device with a Bluetooth communication function; the first link is a Bluetooth link between the main earphone and the audio playing equipment; the second link is a Bluetooth link between the slave earphone and the audio playing equipment; the first switching instruction is a control instruction for controlling the slave earphone to be switched to the master earphone.
The first link quality standard deviation is the standard deviation of the quality of each first link within a preset time interval; the first link quality is a Link Quality Indicator (LQI) of the first link, which indicates energy and quality of a received data frame; the first signal intensity mean value is the mean value of all first signal intensities within a preset time interval; the first Signal Strength is a Received Signal Strength Indication (RSSI) of the first link, and is used for determining link quality. The second link quality standard deviation is the standard deviation of the quality of each second link within a preset time interval; the second link quality is a Link Quality Indicator (LQI) of the second link, which indicates energy and quality of a received data frame; the second signal intensity mean value is the mean value of all second signal intensities within a preset time interval; the second Signal Strength is a Received Signal Strength Indication (RSSI) of the first link, and is used for determining link quality.
Specifically, the preset handover condition includes that a difference between the second signal strength mean value and the first signal strength mean value is greater than a first preset threshold, and a difference between the first link quality standard deviation and the second link quality standard deviation is greater than a second preset threshold.
The method comprises the steps that a master earphone obtains a first link quality standard deviation and a first signal strength mean value of a first link in a preset time interval, and receives a second link quality standard deviation and a second signal strength mean value of a second link in the preset time interval, wherein the second link quality standard deviation and the second signal strength mean value are sent by a slave earphone; then acquiring a first difference value between the second signal intensity mean value and the first signal intensity mean value; when the first difference value is larger than a first preset threshold value, acquiring a second difference value between the first link quality standard deviation and the second link quality standard deviation; when the second difference value is larger than a second preset threshold value, judging that the first link quality standard deviation, the first signal intensity mean value, the second link quality standard deviation and the second signal intensity mean value meet a preset switching condition, then generating a first switching instruction, and sending the first switching instruction to the slave earphone through a Bluetooth link between the master earphone and the slave earphone so as to switch the slave earphone into the master earphone; and simultaneously, the master earphone is switched to be the slave earphone.
And when the first difference value is smaller than or equal to a first preset threshold value or the second difference value is smaller than or equal to a second preset threshold value, the main earphone judges that the first link quality standard deviation, the first signal intensity mean value, the second link quality standard deviation and the second signal intensity mean value do not meet preset switching conditions.
In the technical scheme disclosed in this embodiment, the communication quality of the first link and the second link is obtained, whether the current communication quality meets a preset switching condition is judged, and when the preset switching condition is met, a first switching instruction is sent to the slave earphone, so that the slave earphone is switched to the master earphone; meanwhile, the master earphone is switched to the slave earphone, so that master-slave switching between the wireless earphones is realized, and the reliability of the wireless earphones is improved.
Optionally, based on the first embodiment, in a second embodiment of the master-slave switching method of the wireless headset of the present invention, the step S110 is executed periodically, and the step S110 further includes:
step S111, acquiring a preset number of first data packets in a first link within the preset time interval;
step S112, obtaining a first link quality and a first signal strength corresponding to each first data packet, where the first link quality is a link quality when the first data packet is received, and the first signal strength is a signal strength when the first data packet is received;
step S113, obtaining the first link quality standard deviation according to each first link quality;
step S114, obtaining the first signal intensity mean value according to each first signal intensity.
In this embodiment, the first data packet is a communication data packet for performing bluetooth communication between the master earphone and the audio playing device through a first link, and specifically, the first data packet may be a communication data packet received by the master earphone through the first link; the first link quality can be directly obtained from a structural body of a received first data packet, or can be obtained through a register of a data packet reading chip of the main earphone; the first signal strength can also be obtained by a register of a data packet reading chip of the main earphone.
In a preset time interval, the main earphone acquires a preset number of first data packets, then acquires first link quality and first signal strength when the main earphone receives each first data packet according to the first data packets, then acquires the average value of all the first link quality and the number of the first link quality, and acquires a first link quality standard deviation according to all the first link quality, the average value of the first link quality, the number of the first link quality and a standard deviation calculation formula; and all first signal strength means are obtained.
Illustratively, the calculation formula may be
Figure BDA0002715600210000101
Wherein σ is the standard deviation of the first link quality, n is the number of the first link quality, and XiIs the first link quality, and μ is the mean of the first link quality.
In this embodiment, the master earphone obtains a preset number of first data packets, obtains the first link quality and the first signal strength of each first data packet, and obtains the communication quality between the master earphone and the audio playback device according to all the first link qualities and the first signal strengths, so as to improve the reliability of the obtained communication quality, that is, by increasing the number of the first link qualities and the number of the first signal strengths, the accuracy of the calculation result is improved.
Optionally, based on the first embodiment, in a third embodiment of the method for switching between master and slave of a wireless headset according to the present invention, before the step S110, the method further includes:
s150, after the master earphone is started, establishing a third link with the slave earphone;
s160, performing handshake with the audio playing equipment;
s170, after the handshake is successful, establishing a first link with the audio playing device, and entering a communication mode to communicate with the audio playing device through the first link; and
and S180, sending connection information to the slave earphone through the third link, so that the slave earphone establishes a second link with the audio playing device according to the connection information.
In this embodiment, the third link is a bluetooth link between the master earphone and the slave earphone; the connection information is connection information between the main earphone and the audio playing device, and specifically may be a communication address and device information of the audio playing device.
And after the master earphone is started, the communication address of the slave earphone is acquired, and a Bluetooth link between the master earphone and the slave earphone is established according to the communication address of the slave earphone.
The method comprises the steps that after receiving a Bluetooth matching request broadcast by audio playing equipment, a main earphone is in handshake with the audio playing equipment; or broadcasting a Bluetooth matching request in a Bluetooth transmission range, and then performing handshaking with the audio playing equipment; after the handshake with the audio playing equipment is successful, a first link is established with the audio playing equipment, and a communication mode is entered, and the main earphone is in Bluetooth communication with the audio playing equipment through the first link; meanwhile, the communication address and the device information of the audio playing device can be acquired, connection information is generated, and the connection information is sent to the slave earphone through the third link, so that the slave earphone establishes a second link with the audio playing device according to the received connection information.
In this embodiment, the communication connection between the master earphone and the slave earphone and the audio playing device is realized by establishing a bluetooth link between the master earphone and the slave earphone and between the master earphone and the audio playing device.
Optionally, when the master earphone is switched to the slave earphone, the master earphone may be controlled to enter a listening mode, so that the master earphone is switched to the slave earphone. Specifically, when the wireless headset enters the listening mode, the quality of communication between the wireless headset and the audio playing device is monitored, but the wireless headset does not perform bluetooth communication with the audio playing device, that is, the wireless headset is used as a slave headset of another wireless headset.
In this embodiment, the master earphone is switched to the slave earphone by controlling the master earphone to enter the monitoring mode, so that master-slave switching between the master earphone and the slave earphone is realized.
As shown in fig. 3, fig. 3 is a fourth embodiment of a master-slave switching method of a wireless headset according to the present invention, applied to a slave headset, where the master-slave switching method of the wireless headset includes the following steps:
step S210, acquiring a second link quality standard deviation and a second signal intensity mean value of a second link between the earphone and the audio playing device within a preset time interval;
step S220, sending the second link quality standard deviation and the second signal strength mean value to a master earphone so that the master earphone judges whether the current Bluetooth communication quality meets a preset switching condition or not according to the second link instruction standard deviation and the second signal strength mean value;
step S230, when receiving the first switching instruction sent by the master earphone, the slave earphone is switched to the master earphone.
In this embodiment, the slave earphone acquires a second link quality standard deviation and a second signal strength mean value of the second link within a preset time interval, and sends the second link quality standard deviation and the second signal strength mean value to the master earphone.
And when the slave earphone receives the first switching instruction, the slave earphone is switched to the master earphone.
In the technical scheme disclosed in this embodiment, when a first switching instruction sent by the master earphone is received, the slave earphone is switched to the master earphone, so that master-slave switching between the wireless earphones is realized, and master-slave switching between the wireless earphones is realized, thereby improving the reliability of the wireless earphones.
Optionally, based on the fourth embodiment, in a fifth embodiment of the master-slave switching method of the wireless headset of the present invention, the step S210 is executed periodically, and the step S210 further includes:
step S211, acquiring a preset number of second data packets in a second link within a preset time interval;
step S212, obtaining a second link quality and a second signal strength corresponding to each second data packet, where the second link quality is a link quality when the second data packet is received, and the second signal strength is a signal strength when the second data packet is received;
step S213, obtaining the second link quality standard deviation according to each second link quality;
step S214, obtaining the second signal strength mean value according to each second signal strength.
In this embodiment, the second data packet is a communication data packet for performing bluetooth communication from the headset to the audio playing device through the second link, and specifically, may be a communication data packet received from the headset through the second link; the second link quality can be obtained directly from a structural body of the received second data packet, or can be obtained by reading a register of a chip from a data packet of the earphone; the second signal strength may also be obtained by reading a register of the chip from a data packet of the headset.
Within a preset time interval, obtaining a preset number of second data packets from the earphone, then obtaining second link quality and second signal strength when each second data packet is received from the earphone according to the second data packets, then obtaining the mean value of all the second link qualities and the number of the second link qualities, and obtaining a second link quality standard deviation according to the mean value of the second link qualities, the number of the second link qualities and a standard deviation calculation formula; and all second signal strength means are obtained.
In this embodiment, the slave earphone obtains a preset number of second packets, obtains the second link quality and the second signal strength of each second packet, and obtains the communication quality between the slave earphone and the audio playback device according to all the second link qualities and the second signal strengths, so as to improve the reliability of the obtained communication quality, that is, by increasing the number of the second link qualities and the number of the second signal strengths, the accuracy of the calculation result is improved.
Optionally, based on the fourth embodiment, in a sixth embodiment of the method for switching between master and slave of a wireless headset according to the present invention, before the step S210, the method further includes:
s240, after the slave earphone is started, establishing a third link with the master earphone;
s250, when connection information sent by the main earphone through the third link is received, establishing a second link of the audio playing device corresponding to the connection information according to the connection information;
and S260, the slave earphone enters a monitoring mode.
In this embodiment, after the slave earphone is started, the communication address of the master earphone is obtained, and the bluetooth link between the master earphone and the slave earphone is established according to the communication address of the master earphone.
And when the slave earphone receives the connection information sent by the master earphone through the third link, establishing a second link between the slave earphone and the audio playing equipment according to the communication address and the equipment information of the audio playing equipment carried in the connection information, and enabling the slave earphone to enter a monitoring mode.
In this embodiment, the communication connection between the master earphone and the slave earphone and the audio playing device is realized by establishing a bluetooth link between the master earphone and the slave earphone and between the master earphone and the audio playing device.
Alternatively, when the slave earphone is switched to the master earphone, the slave earphone may be controlled to enter a communication mode to switch the slave earphone to the master earphone. Specifically, when the wireless headset enters a communication mode, communication is performed through a bluetooth link between the wireless headset and the audio playing device.
In this embodiment, the slave earphone is switched to the master earphone by controlling the slave earphone to enter the communication mode, so that master-slave switching between the master earphone and the slave earphone is realized.
In addition, an embodiment of the present invention further provides a wireless headset, where the wireless headset includes a memory, a processor, and a master-slave switching program of the wireless headset, where the master-slave switching program of the wireless headset is stored in the memory and can be run on the processor, and when the master-slave switching program of the wireless headset is executed by the processor, the steps of the master-slave switching method of the wireless headset according to the above embodiments are implemented.
In addition, an embodiment of the present invention further provides a readable storage medium, where a master-slave switching program of a wireless headset is stored on the readable storage medium, and when the master-slave switching program of the wireless headset is executed by a processor, the steps of the master-slave switching method of the wireless headset according to the above embodiments are implemented.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or system. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or system that comprises the element.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on this understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium (e.g. ROM/RAM, magnetic disk, optical disk) as described above and includes instructions for causing a pair of wireless headsets (which may be TWS headsets, etc.) to perform the method according to the embodiments of the present invention.
The above description is only a preferred embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes, which are made by using the contents of the present specification and the accompanying drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.

Claims (11)

1. A master-slave switching method of a wireless earphone is characterized by being applied to a master earphone, and comprising the following steps:
the method comprises the steps that a main earphone obtains a first link quality standard deviation and a first signal intensity mean value of a first link between the main earphone and an audio playing device within a preset time interval;
receiving a second link quality standard deviation and a second signal strength mean value of a second link sent by a slave earphone within the preset time interval, wherein the second link is a communication link between the slave earphone and the audio playing device;
when the first link quality standard deviation, the first signal strength mean value, the second link quality standard deviation and the second signal strength mean value meet a preset switching condition, sending a first switching instruction to the slave earphone so that the slave earphone switches the master earphone; and
the master earphone is switched to be the slave earphone.
2. The method of claim 1, wherein the predetermined handover conditions include a difference between the second signal strength mean and the first signal strength mean being greater than a first predetermined threshold, and a difference between the first link quality standard deviation and the second link quality standard deviation being greater than a second predetermined threshold.
3. The method for master-slave switching of wireless headphones as claimed in claim 1, wherein the step of the master headphone periodically acquiring the first link quality standard deviation and the first signal strength mean value of the first link with the audio playing device within a preset time interval, and the step of the master headphone acquiring the first link quality standard deviation and the first signal strength mean value of the first link with the audio playing device within the preset time interval comprises:
acquiring a preset number of first data packets in a first link within the preset time interval;
acquiring a first link quality and a first signal strength corresponding to each first data packet, wherein the first link quality is the link quality when the first data packet is received, and the first signal strength is the signal strength when the first data packet is received;
obtaining the first link quality standard deviation according to each first link quality;
and acquiring the mean value of the first signal strength according to each first signal strength.
4. The method for master-slave switching of wireless headphones as claimed in claim 1, wherein the step of the master headphone acquiring the first link quality standard deviation and the first signal strength mean value of the first link with the audio playback device within a preset time interval is preceded by the further steps of:
after the master earphone is started, a third link between the master earphone and the slave earphone is established;
performing handshake with the audio playing device;
after the handshake is successful, establishing a first link with the audio playing device, and entering a communication mode to communicate with the audio playing device through the first link; and
and sending connection information to the slave earphone through the third link so that the slave earphone establishes a second link with the audio playing device according to the connection information.
5. The method of claim 4, wherein the step of switching the master earphone to the slave earphone comprises:
the master earpiece enters a listening mode.
6. A master-slave switching method of a wireless earphone is applied to a slave earphone, and the master-slave switching method of the wireless earphone comprises the following steps:
acquiring a second link quality standard deviation and a second signal intensity mean value of a second link between the earphone and the audio playing device within a preset time interval;
sending the second link quality standard deviation and the second signal strength mean value to a master earphone so that the master earphone judges whether the current Bluetooth communication quality meets a preset switching condition according to the second link instruction standard deviation and the second signal strength mean value;
and when a first switching instruction sent by the master earphone is received, the slave earphone is switched to the master earphone.
7. The method for master-slave switching of wireless headphones as claimed in claim 6, wherein the step of obtaining the second link quality standard deviation and the second signal strength mean value of the second link between the headphones and the audio playing device within a preset time interval from the timing of the headphones comprises:
acquiring a preset number of second data packets in a second link within a preset time interval;
acquiring a second link quality and a second signal strength corresponding to each second data packet, wherein the second link quality is the link quality when the second data packet is received, and the second signal strength is the signal strength when the second data packet is received;
obtaining the second link quality standard deviation according to each second link quality;
and acquiring the second signal intensity mean value according to each second signal intensity.
8. The method for master-slave switching of wireless headphones as claimed in claim 6, wherein the step of obtaining the second link quality standard deviation and the second signal strength mean value of the second link between the headphone and the audio playing device within a preset time interval is preceded by the further steps of:
after the slave earphone is started, a third link between the slave earphone and the master earphone is established;
when connection information sent by the main earphone through the third link is received, a second link of the audio playing device corresponding to the connection information is established according to the connection information;
the slave earpiece enters a listening mode.
9. The method as claimed in claim 8, wherein the first switching command is for controlling the slave earphone to enter a communication mode, and the step of switching the slave earphone to the master earphone when receiving the first switching command sent by the master earphone comprises:
and when a first switching instruction sent by the master earphone is received, the slave earphone enters a communication mode.
10. A wireless headset, comprising: memory, processor and a master-slave switching program for a wireless headset stored on the memory and executable on the processor, the master-slave switching program for a wireless headset implementing the steps of the master-slave switching method for a wireless headset according to any of claims 1 to 9 when executed by the processor.
11. A readable storage medium, characterized in that the readable storage medium has stored thereon a master-slave switching program of a wireless headset, which when executed by a processor implements the steps of the master-slave switching method of the wireless headset according to any one of claims 1 to 9.
CN202011074655.5A 2020-10-09 2020-10-09 Master-slave switching method of wireless earphone, wireless earphone and readable storage medium Active CN112235677B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011074655.5A CN112235677B (en) 2020-10-09 2020-10-09 Master-slave switching method of wireless earphone, wireless earphone and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011074655.5A CN112235677B (en) 2020-10-09 2020-10-09 Master-slave switching method of wireless earphone, wireless earphone and readable storage medium

Publications (2)

Publication Number Publication Date
CN112235677A true CN112235677A (en) 2021-01-15
CN112235677B CN112235677B (en) 2022-09-20

Family

ID=74120670

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011074655.5A Active CN112235677B (en) 2020-10-09 2020-10-09 Master-slave switching method of wireless earphone, wireless earphone and readable storage medium

Country Status (1)

Country Link
CN (1) CN112235677B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112954527A (en) * 2021-02-08 2021-06-11 歌尔科技有限公司 Wireless earphone, audio synchronization method, system, equipment and computer medium
CN114501239A (en) * 2022-02-25 2022-05-13 Oppo广东移动通信有限公司 Master-slave switching method and device of earphone, Bluetooth earphone and storage medium

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107885478A (en) * 2017-09-21 2018-04-06 广东思派康电子科技有限公司 Computer-readable recording medium, communication system
WO2020019848A1 (en) * 2018-07-27 2020-01-30 Oppo广东移动通信有限公司 Method for performing switching with respect to primary earpiece, mobile terminal, and computer readable storage medium
CN110913375A (en) * 2019-11-27 2020-03-24 南京中感微电子有限公司 Wireless communication system and equipment
CN110995326A (en) * 2019-12-23 2020-04-10 无锡中感微电子股份有限公司 Communication method of wireless earphone, wireless earphone and wireless earplug
CN111107463A (en) * 2019-12-30 2020-05-05 广州由我科技股份有限公司 Wireless earphone switching method and device, wireless earphone and medium
CN111372228A (en) * 2020-02-24 2020-07-03 维沃移动通信有限公司 Audio control method and electronic equipment
US20200252993A1 (en) * 2019-01-31 2020-08-06 Qualcomm Incorporated Fast role switch between bluetooth true wireless stereo (tws) earbuds

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107885478A (en) * 2017-09-21 2018-04-06 广东思派康电子科技有限公司 Computer-readable recording medium, communication system
WO2020019848A1 (en) * 2018-07-27 2020-01-30 Oppo广东移动通信有限公司 Method for performing switching with respect to primary earpiece, mobile terminal, and computer readable storage medium
US20200252993A1 (en) * 2019-01-31 2020-08-06 Qualcomm Incorporated Fast role switch between bluetooth true wireless stereo (tws) earbuds
CN110913375A (en) * 2019-11-27 2020-03-24 南京中感微电子有限公司 Wireless communication system and equipment
CN110995326A (en) * 2019-12-23 2020-04-10 无锡中感微电子股份有限公司 Communication method of wireless earphone, wireless earphone and wireless earplug
CN111107463A (en) * 2019-12-30 2020-05-05 广州由我科技股份有限公司 Wireless earphone switching method and device, wireless earphone and medium
CN111372228A (en) * 2020-02-24 2020-07-03 维沃移动通信有限公司 Audio control method and electronic equipment

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112954527A (en) * 2021-02-08 2021-06-11 歌尔科技有限公司 Wireless earphone, audio synchronization method, system, equipment and computer medium
CN112954527B (en) * 2021-02-08 2023-01-24 歌尔科技有限公司 Wireless earphone, audio synchronization method, system, equipment and computer medium
CN114501239A (en) * 2022-02-25 2022-05-13 Oppo广东移动通信有限公司 Master-slave switching method and device of earphone, Bluetooth earphone and storage medium
CN114501239B (en) * 2022-02-25 2024-05-10 Oppo广东移动通信有限公司 Master-slave switching method and device of earphone, bluetooth earphone and storage medium

Also Published As

Publication number Publication date
CN112235677B (en) 2022-09-20

Similar Documents

Publication Publication Date Title
EP3826342B1 (en) Pairing method and system for wireless headset
CN110996405B (en) Earphone connection method, terminal, earphone box and computer readable storage medium
WO2021121289A1 (en) Data receiving method and apparatus for bluetooth headset, device, and storage medium
CN112235677B (en) Master-slave switching method of wireless earphone, wireless earphone and readable storage medium
CN113490218B (en) Pairing method, pairing device, bluetooth remote controller, intelligent device and storage medium
CN109151212B (en) Equipment control method and device and electronic equipment
WO2011145314A1 (en) Short-range wireless communication apparatus
CN111132111B (en) BLE-based audio sharing method, system and computer readable storage medium
KR20210020541A (en) Electronic device for retransmitting data in bluetooth network environment and method thereof
KR20200106742A (en) Electronic device for transmitting response message in bluetooth network environment and method thereof
CN113348685B (en) Method and device for establishing Bluetooth data channel
CN112203179B (en) TWS earphone, automatic reconnection method and device thereof, and computer storage medium
US20210345081A1 (en) Extended connection method and extended connection system for bluetooth devices
CN111629366B (en) Interaction method and device between Bluetooth devices, storage medium and electronic device
CN110891296A (en) Method and system for dynamic access point selection in a coordinated access point group
EP3917273A1 (en) Electronic device for transmitting response message in bluetooth network environment and method therefor
CN111278165A (en) Connection establishing method, terminal equipment and network equipment
CN114500730B (en) Popup function control method, popup function control device and computer readable storage medium
US20200213844A1 (en) Communication method, communication apparatus and electronic device
CN115119190A (en) Bluetooth connection method and device, computer equipment and readable storage medium
CN111586521A (en) Auxiliary playing device, control method and control device thereof, and readable storage medium
CN111356089B (en) Data communication method, system, electronic device, chip and storage medium
CN113498045A (en) Communication equipment pairing connection method, communication terminal and device with storage function
WO2021098015A1 (en) Earphone upgrade method, earphone assembly, upgrade device and readable storage medium
CN114500495B (en) Equipment control method and equipment control system

Legal Events

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