CN112203179B - TWS earphone, automatic reconnection method and device thereof, and computer storage medium - Google Patents

TWS earphone, automatic reconnection method and device thereof, and computer storage medium Download PDF

Info

Publication number
CN112203179B
CN112203179B CN202011007617.8A CN202011007617A CN112203179B CN 112203179 B CN112203179 B CN 112203179B CN 202011007617 A CN202011007617 A CN 202011007617A CN 112203179 B CN112203179 B CN 112203179B
Authority
CN
China
Prior art keywords
earphone
terminal equipment
connection
reconnection
headset
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202011007617.8A
Other languages
Chinese (zh)
Other versions
CN112203179A (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 CN202011007617.8A priority Critical patent/CN112203179B/en
Publication of CN112203179A publication Critical patent/CN112203179A/en
Application granted granted Critical
Publication of CN112203179B publication Critical patent/CN112203179B/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
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04BTRANSMISSION
    • H04B5/00Near-field transmission systems, e.g. inductive loop type
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04RLOUDSPEAKERS, MICROPHONES, GRAMOPHONE PICK-UPS OR LIKE ACOUSTIC ELECTROMECHANICAL TRANSDUCERS; DEAF-AID SETS; PUBLIC ADDRESS SYSTEMS
    • H04R5/00Stereophonic arrangements
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04RLOUDSPEAKERS, MICROPHONES, GRAMOPHONE PICK-UPS OR LIKE ACOUSTIC ELECTROMECHANICAL TRANSDUCERS; DEAF-AID SETS; PUBLIC ADDRESS SYSTEMS
    • H04R5/00Stereophonic arrangements
    • H04R5/04Circuit arrangements, e.g. for selective connection of amplifier inputs/outputs to loudspeakers, for loudspeaker detection, or for adaptation of settings to personal preferences or hearing impairments
    • 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

Abstract

The invention discloses a TWS earphone, an automatic reconnection method, a device and a computer storage medium thereof, wherein the TWS earphone comprises a first earphone and a second earphone, and the automatic reconnection method of the TWS earphone comprises the following steps: when the first earphone detects that the first earphone is disconnected with the terminal equipment, the first earphone is connected back with the terminal equipment; when failure of the return connection is detected, judging whether the first earphone is a main earphone or not; and if the first earphone is not the main earphone, sending a connection instruction back to the second earphone so that the second earphone can be connected back with the terminal equipment based on the connection instruction. The invention can realize the automatic back connection of the TWS earphone when the master earphone and the slave earphone of the TWS earphone are switched in roles.

Description

TWS earphone, automatic reconnection method and device thereof, and computer storage medium
Technical Field
The invention relates to the technical field of portable listening equipment, in particular to a TWS earphone, an automatic reconnection method and device thereof, and a computer readable storage medium.
Background
A TWS (True Wireless Stereo) headset is widely used because it is Wireless and easy to carry. The TWS earphone can be in communication connection with the terminal device to receive audio sent by the terminal device for playing or carrying out voice call. In the use process of the TWS earphone, the master earphone and the slave earphone of the TWS earphone can be disconnected with the terminal equipment and then return to the connection range, at the moment, the automatic reconnection of the master earphone and the slave earphone is realized, and the use experience of a user can be improved. However, in the prior art, only the main earphone can be automatically connected back to the terminal device, and when the main earphone is removed or put into an earphone box or the like and the main earphone and the auxiliary earphone are switched in roles, the automatic connection back of the TWS earphone cannot be realized. Therefore, how to implement automatic connection of TWS earphones when the master earphone and the slave earphone have role switching is a problem that needs to be solved at present.
Disclosure of Invention
The invention mainly aims to provide a TWS earphone, an automatic reconnection method and device thereof, and a computer storage medium, and aims to solve the technical problem that automatic reconnection cannot be realized when a master earphone and a slave earphone of the TWS earphone are subjected to role switching in the prior art.
In order to achieve the above object, the present invention provides an automatic reconnection method for a TWS headset, the TWS headset including a first headset and a second headset, the automatic reconnection method including the steps of:
the first earphone is connected back with the terminal equipment when detecting that the first earphone is disconnected with the terminal equipment;
when failure of the return connection is detected, whether the first earphone is a main earphone is judged;
and if the first earphone is not the main earphone, sending a connection instruction back to the second earphone so that the second earphone can be connected back with the terminal equipment based on the connection instruction.
Optionally, when the first headset detects that the first headset is disconnected from the terminal device, the step of performing a loopback connection with the terminal device includes:
when the first earphone detects that the first earphone is disconnected from the terminal equipment, timing is started;
and when the timing duration reaches a first preset duration, carrying out back connection with the terminal equipment.
Optionally, when the first headset detects that the first headset is disconnected from the terminal device, the step of performing a loopback connection with the terminal device includes:
when the first earphone is detected to be disconnected with the terminal equipment, acquiring the distance between the first earphone and the terminal equipment in real time, and detecting whether the distance is within a preset range;
and when the distance is detected to be within a preset range, carrying out loop connection with the terminal equipment.
Optionally, after the step of determining whether the first earphone is the main earphone when the failure to return to the connection is detected, the method further includes:
if the first earphone is a main earphone, acquiring a disconnection time length, and judging whether the disconnection time length exceeds a second preset time length;
and if the disconnection time length exceeds a second preset time length, canceling the reconnection with the terminal equipment.
Optionally, the step of sending a connection instruction back to the second headset so that the second headset connects back with the terminal device based on the connection instruction includes:
and acquiring the current timing duration, and sending the current timing duration and the reconnection instruction to the second earphone so as to realize reconnection between the second earphone and the terminal equipment based on the current timing duration and the reconnection instruction.
Optionally, when the first headset detects that the first headset is disconnected from the terminal device, the step of performing a loopback connection with the terminal device includes:
when the first earphone detects that the first earphone is disconnected with the terminal equipment, a handshaking request is sent to the terminal equipment based on a telephone control software (HFP) protocol so as to be connected back with the terminal equipment;
if the HFP protocol is detected to be connected, judging that the connection back is successful;
if the HFP protocol is detected not to be connected, the failure of the connection is determined.
Optionally, when the first headset detects that the first headset is disconnected from the terminal device, the step of performing a loopback connection with the terminal device includes:
when the first earphone detects that the first earphone is disconnected with the terminal equipment, a Bluetooth connection request is sent to the terminal equipment so as to be connected back with the terminal equipment;
if the Bluetooth connection is successfully established, judging that the connection is successful;
if the Bluetooth connection establishment is detected to be failed, judging that the connection back is failed.
Further, to achieve the above object, the present invention provides an automatic reconnection apparatus for a TWS headset including a first headset and a second headset, the automatic reconnection apparatus for a TWS headset including:
the back connection module is used for carrying out back connection with the terminal equipment when the first earphone is detected to be disconnected with the terminal equipment;
the first judgment module is used for judging whether the first earphone is a main earphone or not when the loop loss is detected;
and the sending module is used for sending a connection instruction back to the second earphone if the first earphone is not the main earphone, so that the second earphone can be connected with the terminal equipment based on the connection instruction.
Further, to achieve the above object, the present invention also provides a TWS headset, including: a memory, a processor and an automatic callback program stored on the memory and executable on the processor, the automatic callback program when executed by the processor implementing the steps of the automatic callback method of a TWS headset as described above.
Further, to achieve the above object, the present invention also provides a computer readable storage medium having stored thereon an automatic callback program, which when executed by a processor, implements the steps of the automatic callback method of the TWS headset according to any one of the above.
According to the TWS earphone and the automatic reconnection method, device and computer storage medium thereof provided by the embodiment of the invention, when a first earphone (namely a primary earphone before disconnection) in the TWS earphone detects that the first earphone is disconnected with the terminal equipment, the first earphone can automatically realize reconnection with the terminal equipment, when disconnection failure of the reconnection is detected, whether the first earphone is the primary earphone or not is judged, if the first earphone is not the primary earphone at the moment, master-slave switching is performed on the primary earphone in the TWS earphone, and if the second earphone is the primary earphone at the moment, a connection instruction is sent back to the second earphone, so that the second earphone can realize reconnection with the terminal equipment based on the connection instruction. In the invention, when the back connection failure of the main earphone (namely the first earphone) disconnected with the terminal equipment is detected, whether role switching occurs is further determined by detecting whether the first earphone is the main earphone, and then when the first earphone is detected to be not the main earphone, namely the role switching occurs and becomes the slave earphone, a connection instruction is sent back to the current main earphone, namely the second earphone, so that the current main earphone continues back connection. By the mode, when the master earphone and the slave earphone of the TWS earphone are switched in roles, the automatic connection of the TWS earphone is realized, and therefore the use experience of a user can be improved.
Drawings
Fig. 1 is a schematic terminal structure diagram of a hardware operating environment according to an embodiment of the present invention;
FIG. 2 is a flowchart illustrating a first embodiment of an automatic reconnection method for a TWS headset according to the present invention;
FIG. 3 is a functional block diagram of a TWS earphone auto-reconnecting device according to a first embodiment of the present invention.
The implementation, functional features and advantages of the present invention will be further described 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 do not limit the invention.
As shown in fig. 1, fig. 1 is a schematic terminal structure diagram of a hardware operating environment according to an embodiment of the present invention.
The terminal of the embodiment of the invention can be a TWS (True Wireless Stereo) earphone.
As shown in fig. 1, the terminal may include: a processor 1001, such as a CPU (Central Processing Unit), a communication bus 1002, and a memory 1003. The communication bus 1002 is used to implement connection communication among these components. The memory 1003 may be a high-speed RAM memory or a non-volatile memory (e.g., a disk memory). The memory 1003 may alternatively be a storage device separate from the processor 1001.
Those skilled in the art will appreciate that the terminal structure shown in fig. 1 is not intended to be limiting and may include more or fewer components than those shown, or some components may be combined, or a different arrangement of components.
As shown in fig. 1, a memory 1003 as a kind of computer storage medium may include a network communication module and an automatic callback program therein.
In the terminal shown in fig. 1, the processor 1001 may be configured to call the automatic callback program stored in the memory 1003, and perform the following operations:
the first earphone is connected back with the terminal equipment when detecting that the first earphone is disconnected with the terminal equipment;
when failure of the return connection is detected, whether the first earphone is a main earphone is judged;
and if the first earphone is not the main earphone, sending a connection instruction back to the second earphone so that the second earphone can be connected back with the terminal equipment based on the connection instruction.
Further, processor 1001 may invoke an automatic callback program stored in memory 1003, and also perform the following operations:
when the first earphone detects that the first earphone is disconnected from the terminal equipment, timing is started;
and when the timing duration reaches a first preset duration, carrying out back connection with the terminal equipment.
Further, processor 1001 may invoke an automatic callback program stored in memory 1003, and also perform the following operations:
when the first earphone is detected to be disconnected with the terminal equipment, acquiring the distance between the first earphone and the terminal equipment in real time, and detecting whether the distance is within a preset range;
and when the distance is detected to be within a preset range, carrying out back connection with the terminal equipment.
Further, processor 1001 may invoke an automatic callback program stored in memory 1003, and also perform the following operations:
if the first earphone is a main earphone, acquiring a disconnection time length, and judging whether the disconnection time length exceeds a second preset time length;
and if the disconnection time length exceeds a second preset time length, canceling the back connection with the terminal equipment.
Further, processor 1001 may invoke an automatic callback program stored in memory 1003, and also perform the following operations:
and acquiring the current timing duration, and sending the current timing duration and the reconnection instruction to the second earphone so that the second earphone performs reconnection with the terminal equipment based on the current timing duration and the reconnection instruction.
Further, processor 1001 may invoke an automatic callback program stored in memory 1003, and also perform the following operations:
when the first earphone detects that the first earphone is disconnected from the terminal equipment, a handshake request is sent to the terminal equipment based on a telephone control software (HFP) protocol so as to be connected back to the terminal equipment;
if the HFP protocol is detected to be connected, judging that the connection back is successful;
if the HFP protocol is detected not to be connected, the failure of the connection is determined.
Further, processor 1001 may invoke an automatic callback program stored in memory 1003, and also perform the following operations:
when the first earphone detects that the first earphone is disconnected with the terminal equipment, a Bluetooth connection request is sent to the terminal equipment so as to be connected back with the terminal equipment;
if the Bluetooth connection is successfully established, judging that the connection is successful;
and if the Bluetooth connection establishment is failed, judging that the connection back is failed.
Based on the above hardware structure, various embodiments of the automatic reconnection method for the TWS headset of the present invention are proposed.
The invention provides an automatic reconnection method of a TWS earphone.
Referring to fig. 2, fig. 2 is a flowchart illustrating a first embodiment of an automatic TWS headset reconnection method according to the present invention.
In this embodiment, the TWS headset includes a first headset and a second headset, and the automatic reconnection method of the TWS headset includes:
step S10, when the first earphone is detected to be disconnected with the terminal equipment, the first earphone is connected back with the terminal equipment;
in this embodiment, the automatic reconnection method for TWS headphones is applied to a first one of the TWS headphones, wherein the first one is a current primary one of the TWS headphones when disconnected from the terminal device.
And when the first earphone detects that the TWS earphone is disconnected from the terminal equipment, the first earphone is connected back to the terminal equipment. Wherein, terminal equipment can be for having bluetooth connection function's such as smart mobile phone, panel computer equipment.
As an embodiment, step S10 may include:
step a11, when detecting disconnection with a terminal device, the first earphone sends a handshake request to the terminal device based on an HFP protocol to perform loop connection with the terminal device;
when the first headset detects that the first headset is disconnected from the terminal device, the HFP (phone-free Profile, i.e. software for controlling a phone by a bluetooth device) protocol is also disconnected, and the TWS headset cannot receive audio sent by the terminal device and cannot perform call connection. At this time, the first headset may transmit a handshake request to the terminal device based on the HFP protocol to perform a back connection with the terminal device, and correspondingly, the terminal device establishes a connection with the first headset upon receiving the handshake request, at which time the HFP protocol is connected.
Certainly, in a specific implementation, the first earphone may detect in real time whether there is a handshake request sent by the terminal device, and if so, receive the handshake request sent by the terminal device, so as to complete the connection based on the HFP protocol.
Step a12, if detecting that the HFP protocol is connected, judging that the connection is successful;
and a step a13, if detecting that the HFP protocol is not connected, judging that the connection is failed.
If the HFP protocol is detected to be connected, judging that the connection back is successful; if it is detected that the HFP protocol is not connected, it is determined that the connection is lost.
As another embodiment, step S10 may further include:
step a14, when detecting that the first earphone is disconnected with the terminal equipment, the first earphone sends a Bluetooth connection request to the terminal equipment so as to be connected back with the terminal equipment;
when the first earphone detects that the first earphone is disconnected with the terminal equipment, the Bluetooth connection is disconnected, the TWS earphone cannot receive audio sent by the terminal equipment and cannot conduct call connection, at the moment, the first earphone can send a Bluetooth connection request to the terminal equipment so as to be connected back with the terminal equipment, correspondingly, when the terminal equipment receives the Bluetooth request, the terminal equipment is connected with the first earphone, and at the moment, the Bluetooth is connected.
Certainly, in specific implementation, the first headset may search in real time whether there is a bluetooth connection request sent by the terminal device, and if there is a bluetooth connection request, connect with the terminal device based on the bluetooth connection request.
Step a15, if the Bluetooth connection is successfully established, judging that the connection is successful;
step a16, if the failure of establishing the Bluetooth connection is detected, judging that the connection back is failed.
If the Bluetooth connection is successfully established, judging that the connection is successful; and if the Bluetooth connection establishment is failed, judging that the connection back is failed.
Step S20, when failure of reconnection is detected, whether the first earphone is a main earphone is judged;
in this embodiment, when failure of reconnection is detected, it is determined whether the first earphone is a master earphone.
And step S30, if the first earphone is not the main earphone, sending a connection instruction back to the second earphone so that the second earphone can be connected back with the terminal equipment based on the connection instruction.
If the first earphone is not the primary earphone, it is indicated that the primary earphone in the TWS earphone is subjected to master-slave switching, and the second earphone in the current TWS earphone is the primary earphone, at this time, a connection instruction is sent back to the second earphone, so that the second earphone is connected back with the terminal device based on the connection instruction.
Correspondingly, when the second earphone performs the reconnection, a handshake request may be sent to the terminal device based on the HFP protocol to perform the reconnection with the terminal device, if it is detected that the HFP protocol is connected, it is determined that the reconnection is successful, and if it is detected that the HFP protocol is not connected, it is determined that the reconnection is failed; or a Bluetooth connection request can be sent to the terminal equipment so as to carry out reconnection with the terminal equipment, and if the Bluetooth connection establishment is detected to be successful, the reconnection is judged to be successful; and if the Bluetooth connection establishment is failed, judging that the connection back is failed. The specific connection method may refer to the connection method of the first earphone, which is not described herein again.
Further, if the first earphone is the main earphone, the loop connection with the terminal equipment can be continued. Through the mode, automatic reconnection with the terminal equipment can be achieved without user operation, and the use experience of a user can be improved. Further, in the process of continuing to connect back, when failure of the connection back is detected, whether the first earphone is the main earphone or not is judged, and if not, the first earphone continues to be connected back with the terminal equipment; if so, the first earphone sends a connection instruction back to the second earphone so that the second earphone can be connected back with the terminal equipment based on the connection instruction.
The embodiment of the invention provides an automatic reconnection method of TWS earphones, which is characterized in that when a first earphone (namely a primary earphone before disconnection) in the TWS earphones detects that the first earphone is disconnected with terminal equipment, the automatic reconnection method can automatically realize reconnection with the terminal equipment, when the disconnection failure is detected, whether the first earphone is the primary earphone or not is judged, if the first earphone is not the primary earphone at the moment, master-slave switching of the primary earphone in the TWS earphones is carried out, and if a second earphone in the TWS earphones is the primary earphone at the moment, a connection instruction is sent back to the second earphone, so that the second earphone can realize reconnection with the terminal equipment based on the connection instruction. In the embodiment of the invention, when the reconnection failure of the main earphone (namely the first earphone) disconnected with the terminal equipment is detected, whether role switching occurs is further determined by detecting whether the first earphone is the main earphone, and then when the first earphone is detected to be not the main earphone, namely the role switching occurs and is changed into the slave earphone, a connection instruction is sent back to the current main earphone (namely the second earphone), so that the current main earphone continues reconnection. By the mode, when the master earphone and the slave earphone of the TWS earphone have role switching, automatic connection of the TWS earphone is achieved, and therefore use experience of a user can be improved.
Further, based on the above first embodiment, a second embodiment of the automatic reconnection method for a TWS headset of the present invention is proposed.
In the present embodiment, step S10 includes:
step a17, when the first earphone detects that the first earphone is disconnected with the terminal equipment, timing is started;
in this embodiment, the first earphone may start timing by a timer when detecting disconnection from the terminal device.
And a18, when the timing duration reaches a first preset duration, performing loop connection with the terminal equipment.
And then, when the timing duration is detected to reach the first preset duration, the terminal equipment is connected back. The first preset time period can be flexibly set according to actual needs, and for example, can be set to a value between 20 and 180 seconds.
In this embodiment, the first earphone and the terminal device are disconnected to a first preset duration in a timing manner, and then the disconnection is performed. By the mode, the electric quantity loss caused by repeated reconnection immediately after disconnection can be avoided, and the cruising ability of the TWS earphone can be improved.
Further, based on the above first embodiment, a third embodiment of the automatic reconnection method for a TWS headset of the present invention is proposed.
In this embodiment, step S10 may further include:
step a19, when the first earphone is detected to be disconnected with the terminal equipment, acquiring the distance between the first earphone and the terminal equipment in real time, and detecting whether the distance between the TWS earphone and the terminal equipment is within a preset range;
in this embodiment, when it is detected that the first earphone is disconnected from the terminal device, the distance between the first earphone and the terminal device is obtained in real time, and it is detected whether the distance between the TWS earphone and the terminal device is within a preset range. The distance can be determined according to the strength of the Bluetooth signal by the distance acquisition mode, and the preset range can be flexibly set according to actual needs. It can be understood that, when detecting whether the distance between the TWS headset and the terminal device is within the preset range, if the bluetooth signal transmitted by the terminal device is not detected, the distance between the TWS headset and the terminal device is not within the preset range.
Step a20, when the distance is detected to be within a preset range, carrying out back connection with the terminal equipment.
And when the detected distance is within the preset range, carrying out loop connection with the terminal equipment.
In this embodiment, after detecting that first earphone is connected with terminal equipment, through obtaining the distance between the two in real time to carry out the reconnection in certain distance within range, through above-mentioned mode, can improve the accuracy of reconnection result, promote user's use and experience, avoid simultaneously because of carrying out the electric quantity loss that the reconnection led to the fact at once after disconnected repeatedly, improve the duration of TWS earphone.
Further, based on the first embodiment described above, a fourth embodiment of the automatic reconnection method of the present invention is proposed.
In this embodiment, after the step S20, the automatic reconnection method further includes:
step A, if the first earphone is a main earphone, acquiring a disconnection time length, and judging whether the disconnection time length exceeds a second preset time length;
in this embodiment, if the first earphone is the master earphone, it is described that the role switching does not occur in the master earphone and the slave earphone of the TWS earphone, and at this time, a disconnection duration is obtained, where the disconnection duration is obtained based on the timing of the timer of the first earphone and is a duration between the failure of disconnecting the first earphone from the terminal device and the current reconnection.
Then, whether the disconnection time length exceeds a second preset time length is judged, wherein the second preset time length is preset and is a set longest reconnection time length, and the second preset time length can be flexibly set according to actual needs, such as 10min, 0.5h and the like.
And step B, if the disconnection time length exceeds a second preset time length, the reconnection with the terminal equipment is cancelled.
And if the disconnection time length exceeds a second preset time length, canceling the reconnection with the terminal equipment.
In this embodiment, when the disconnection duration is detected to exceed the second preset duration, the reconnection with the terminal device is cancelled, so that the loss of the electric quantity caused by the fact that the first earphone is in the reconnection state for a long time can be avoided, and the electric quantity of the first earphone can be saved.
Further, based on the above-described first embodiment, a fifth embodiment of the automatic reconnection method of the present invention is proposed.
In this embodiment, the step S30 may include:
step a31, obtaining a current timing duration, and sending the current timing duration and a reconnection instruction to the second earphone, so that the second earphone performs reconnection with the terminal device based on the current timing duration and the reconnection instruction.
In this embodiment, when the reconnection fails, if it is detected that the first earphone is the master earphone, the current timing duration is obtained, where the current timing duration is obtained based on timing of a timer of the first earphone and is a duration between disconnection between the first earphone and the terminal device and the current time.
And then, sending the current timing duration and the reconnection instruction to a second earphone so that the second earphone performs reconnection with the terminal equipment based on the current timing duration and the reconnection instruction. Correspondingly, after receiving the current timing duration and the reconnection instruction sent by the first earphone, the second earphone continues to reconnect with the terminal equipment based on the reconnection instruction, in addition, the timing can be continued according to the current timing duration, and when the second earphone detects that the timing duration reaches a second preset duration, the second earphone cancels the reconnection with the terminal equipment, so that the loss of electric quantity caused by the fact that the second earphone is in the reconnection state for a long time is avoided, and the electric quantity of the second earphone can be saved.
The invention also provides an automatic connecting device of the TWS earphone.
Referring to fig. 3, fig. 3 is a schematic diagram illustrating functional modules of a first embodiment of an automatic reconnection device for a TWS headset according to the present invention.
As shown in fig. 3, the automatic reconnection device for a TWS headset includes:
the reconnection module 10 is used for performing reconnection with the terminal equipment when the first earphone detects that the first earphone is disconnected from the terminal equipment;
the first judging module 20 is configured to, when failure of reconnection is detected, judge whether the first earphone is a main earphone;
a sending module 30, configured to send a connection instruction back to the second headset if the first headset is not the primary headset, so that the second headset performs a connection back with the terminal device based on the connection back instruction.
Further, the back-connecting module 10 includes:
the timing unit is used for starting timing when the first earphone detects that the first earphone is disconnected with the terminal equipment;
and the first reconnection unit is used for performing reconnection with the terminal equipment when the timing duration reaches a first preset duration.
Further, the back-connecting module 10 includes:
the detection unit is used for acquiring the distance between the first earphone and the terminal equipment in real time when the first earphone is detected to be disconnected with the terminal equipment, and detecting whether the distance is within a preset range;
and the second reconnection unit is used for performing reconnection with the terminal equipment when the distance is detected to be within a preset range.
Further, the automatic reconnecting device further includes:
the second judgment module is used for acquiring the disconnection time length if the first earphone is the main earphone and judging whether the disconnection time length exceeds a second preset time length;
and the reconnection canceling module is used for canceling reconnection with the terminal equipment if the disconnection time length exceeds a second preset time length.
Further, the sending module 30 is further configured to:
and acquiring the current timing duration, and sending the current timing duration and the reconnection instruction to the second earphone so that the second earphone performs reconnection with the terminal equipment based on the current timing duration and the reconnection instruction.
Further, the back-connecting module 10 includes:
the first sending unit is used for sending a handshake request to the terminal equipment based on an HFP protocol to carry out back connection with the terminal equipment when the first earphone detects disconnection with the terminal equipment;
a first determination unit configured to determine that the connection back is successful if it is detected that the HFP protocol is connected;
the first determination unit is further configured to determine that the connection is lost if it is detected that the HFP protocol is not connected.
Further, the back-connecting module 10 includes:
the second sending unit is used for sending a Bluetooth connection request to the terminal equipment when the first earphone detects that the first earphone is disconnected from the terminal equipment so as to be connected back with the terminal equipment;
the second judgment unit is used for judging that the connection back is successful if the Bluetooth connection is successfully established;
the second determination unit is further configured to determine that the reconnection fails if it is detected that the bluetooth connection establishment fails.
The function implementation of each module in the automatic reconnection device for the TWS headset corresponds to each step in the automatic reconnection method for the TWS headset, and the function and implementation process are not described in detail herein.
The present invention also provides a computer readable storage medium having stored thereon an automatic reconnecting program which, when executed by a processor, implements the steps of the automatic reconnecting method of the TWS headset according to any one of the above embodiments.
The specific embodiment of the computer readable storage medium of the present invention is substantially the same as the embodiments of the automatic reconnection method for a TWS headset described above, and will not be described herein again.
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 phrases "comprising one of 8230; \8230;" 8230; "does not exclude the presence of additional 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 only for description, and do not represent the advantages and disadvantages 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 such 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 enabling a terminal device (e.g., a mobile phone, a computer, a server, an air conditioner, or a network device) to execute the method according to the embodiments of the present invention.
The above description is only a preferred embodiment of the present invention, and is not intended to limit the scope of the present invention, and all equivalent structures or equivalent processes performed by the present invention or directly or indirectly applied to other related technical fields are also included in the scope of the present invention.

Claims (8)

1. A TWS headset automatic reconnection method, characterized in that the real wireless stereo TWS headset comprises a first headset and a second headset, the TWS headset automatic reconnection method comprises the following steps:
the first earphone is connected back with the terminal equipment when detecting that the first earphone is disconnected with the terminal equipment;
when failure of the return connection is detected, judging whether the first earphone is a main earphone or not;
if the first earphone is not the main earphone, sending a connection instruction back to the second earphone so that the second earphone can be connected back with the terminal equipment based on the connection instruction;
when the first earphone detects that the first earphone is disconnected from the terminal equipment, the step of connecting back with the terminal equipment comprises the following steps:
the first earphone starts timing when detecting disconnection with the terminal equipment;
when the timing duration reaches a first preset duration, carrying out back connection with the terminal equipment;
the step of sending a connection instruction back to the second earphone so that the second earphone makes a connection back with the terminal device based on the connection back instruction comprises:
and acquiring the current timing duration, and sending the current timing duration and the reconnection instruction to the second earphone so that the second earphone performs reconnection with the terminal equipment based on the current timing duration and the reconnection instruction.
2. The method of claim 1, wherein the step of the first headset making a connection back with the terminal device upon detecting a disconnection from the terminal device comprises:
when the first earphone is detected to be disconnected with the terminal equipment, acquiring the distance between the first earphone and the terminal equipment in real time, and detecting whether the distance is within a preset range;
and when the distance is detected to be within a preset range, carrying out back connection with the terminal equipment.
3. The method for automatic reconnection of a TWS headset according to claim 1, wherein said step of determining whether said first headset is a primary headset when loss of reconnection is detected further comprises:
if the first earphone is a main earphone, acquiring a disconnection time length, and judging whether the disconnection time length exceeds a second preset time length;
and if the disconnection time length exceeds a second preset time length, canceling the reconnection with the terminal equipment.
4. The automatic reconnect method of TWS headphones according to any one of claims 1 to 3, wherein the step of the first headphone, upon detecting a disconnection from a terminal device, reconnecting with the terminal device comprises:
when the first earphone detects that the first earphone is disconnected with the terminal equipment, a handshaking request is sent to the terminal equipment based on a telephone control software (HFP) protocol so as to be connected back with the terminal equipment;
if the HFP protocol is detected to be connected, judging that the connection back is successful;
and if the HFP protocol is detected not to be connected, judging that the connection is failed.
5. The automatic reconnect method of TWS headphones according to any one of claims 1 to 3, wherein the step of the first headphone, upon detecting a disconnection from a terminal device, reconnecting with the terminal device comprises:
when the first earphone detects that the first earphone is disconnected with the terminal equipment, a Bluetooth connection request is sent to the terminal equipment so as to be connected back with the terminal equipment;
if the Bluetooth connection is successfully established, judging that the connection is successful;
and if the Bluetooth connection establishment is failed, judging that the connection back is failed.
6. An automatic reconnection device for a TWS headset, the TWS headset comprising a first headset and a second headset, the automatic reconnection device for a TWS headset comprising:
the back connection module is used for carrying out back connection with the terminal equipment when the first earphone detects that the first earphone is disconnected with the terminal equipment;
when the first earphone detects that the first earphone is disconnected with the terminal equipment, the step of carrying out loop connection with the terminal equipment comprises the following steps:
when the first earphone detects that the first earphone is disconnected from the terminal equipment, timing is started;
when the timing duration reaches a first preset duration, carrying out back connection with the terminal equipment;
the first judgment module is used for judging whether the first earphone is a main earphone or not when failure of reconnection is detected;
a sending module, configured to send a connection instruction back to the second headset if the first headset is not a main headset, so that the second headset performs a reconnection with the terminal device based on the reconnection instruction;
the step of sending a connection instruction back to the second earphone so that the second earphone makes a connection back with the terminal device based on the connection back instruction comprises:
and acquiring the current timing duration, and sending the current timing duration and the reconnection instruction to the second earphone so that the second earphone performs reconnection with the terminal equipment based on the current timing duration and the reconnection instruction.
7. A TWS headset, comprising: memory, a processor and an automatic back-up program stored on the memory and executable on the processor, which when executed by the processor implements the steps of the automatic back-up method of a TWS headset of any of claims 1 to 6.
8. A computer readable storage medium, characterized in that the computer readable storage medium has stored thereon an automatic callback program, which when executed by a processor, implements the steps of the automatic callback method of a TWS headset according to any of claims 1 to 5.
CN202011007617.8A 2020-09-22 2020-09-22 TWS earphone, automatic reconnection method and device thereof, and computer storage medium Active CN112203179B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011007617.8A CN112203179B (en) 2020-09-22 2020-09-22 TWS earphone, automatic reconnection method and device thereof, and computer storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011007617.8A CN112203179B (en) 2020-09-22 2020-09-22 TWS earphone, automatic reconnection method and device thereof, and computer storage medium

Publications (2)

Publication Number Publication Date
CN112203179A CN112203179A (en) 2021-01-08
CN112203179B true CN112203179B (en) 2022-10-18

Family

ID=74016058

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011007617.8A Active CN112203179B (en) 2020-09-22 2020-09-22 TWS earphone, automatic reconnection method and device thereof, and computer storage medium

Country Status (1)

Country Link
CN (1) CN112203179B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110225499A (en) * 2019-04-30 2019-09-10 努比亚技术有限公司 Communication connecting method, communication equipment and storage medium
CN112839303B (en) * 2021-04-12 2021-08-31 荣耀终端有限公司 Method and related device for device reconnection
CN115967927A (en) * 2021-10-13 2023-04-14 Oppo广东移动通信有限公司 Bluetooth connection method and device, earphone and storage medium
CN114422919A (en) * 2021-12-27 2022-04-29 东莞市阿尔法电子科技有限公司 Master-slave switching method and device, TWS (two way communication system) headset and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106878921A (en) * 2017-01-04 2017-06-20 佳禾智能科技股份有限公司 Earphone, earphone and voice signal send the method and device connected between equipment
CN108900939A (en) * 2018-06-07 2018-11-27 广东思派康电子科技有限公司 A kind of TWS earphone and computer readable storage medium being able to achieve master-slave swap
US10412567B1 (en) * 2018-09-29 2019-09-10 Bestechnic (Shanghai) Co., Ltd. Short-range wireless communication based on indirect transmission of communication parameters
CN110677767A (en) * 2019-10-31 2020-01-10 歌尔科技有限公司 Wireless headset control method and system and TWS headset

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108419226B (en) * 2012-09-27 2020-12-25 华为终端有限公司 Method for connecting Bluetooth devices and Bluetooth devices

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106878921A (en) * 2017-01-04 2017-06-20 佳禾智能科技股份有限公司 Earphone, earphone and voice signal send the method and device connected between equipment
CN108900939A (en) * 2018-06-07 2018-11-27 广东思派康电子科技有限公司 A kind of TWS earphone and computer readable storage medium being able to achieve master-slave swap
US10412567B1 (en) * 2018-09-29 2019-09-10 Bestechnic (Shanghai) Co., Ltd. Short-range wireless communication based on indirect transmission of communication parameters
CN110677767A (en) * 2019-10-31 2020-01-10 歌尔科技有限公司 Wireless headset control method and system and TWS headset

Also Published As

Publication number Publication date
CN112203179A (en) 2021-01-08

Similar Documents

Publication Publication Date Title
CN112203179B (en) TWS earphone, automatic reconnection method and device thereof, and computer storage medium
CN111246441B (en) Method, system and storage medium for connecting Bluetooth headset and terminal
JP5273214B2 (en) Near field communication device
JP5011424B2 (en) In-vehicle terminal device and wireless connection program for in-vehicle terminal device
KR101543161B1 (en) Method for controlling bluetooth connection
JP5153893B2 (en) Communication device, communication system, and inter-device connection method
WO2011145314A1 (en) Short-range wireless communication apparatus
US8731473B2 (en) Short range wireless communication apparatus
US9106309B2 (en) Vehicular communication system, vehicular communication apparatus and portable terminal apparatus
CN111757307B (en) Wireless earphone control method, wireless earphone and readable storage medium
CN111131966A (en) Mode control method, headphone system, and computer-readable storage medium
CN110602683B (en) Bluetooth control method, device, mobile terminal and storage medium
CN111885571A (en) Bluetooth device pairing method, device and storage medium
CN112235677B (en) Master-slave switching method of wireless earphone, wireless earphone and readable storage medium
CN110944313B (en) Bluetooth connection method, device, storage medium and terminal
CN110908687B (en) Earphone upgrading method, earphone assembly, upgrading device and readable storage medium
CN114257922A (en) Earphone mixed loading identification method, system, equipment and computer readable storage medium
KR101567278B1 (en) Method for controlling bluetooth connection
CN111988695A (en) Earphone synchronization method, device, equipment and storage medium of wireless earphone
CN115022957B (en) State synchronization method and device of earphone device, earphone device and storage medium
CN111614384B (en) Device with storage function, Bluetooth device and control method and system thereof
CN114866896A (en) Earphone pairing method, equipment and computer readable storage medium
CN113395688A (en) Voice data processing method, device and computer readable storage medium
CN116193305A (en) Wireless earphone connection method and device, electronic equipment and readable storage medium
CN114615588A (en) Earphone communication method, equipment and computer readable storage medium

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