CN113329387B - Bluetooth headset communication method and device - Google Patents
Bluetooth headset communication method and device Download PDFInfo
- Publication number
- CN113329387B CN113329387B CN202110682602.XA CN202110682602A CN113329387B CN 113329387 B CN113329387 B CN 113329387B CN 202110682602 A CN202110682602 A CN 202110682602A CN 113329387 B CN113329387 B CN 113329387B
- Authority
- CN
- China
- Prior art keywords
- bluetooth
- connection
- headset
- earphone
- data
- 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
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W4/00—Services specially adapted for wireless communication networks; Facilities therefor
- H04W4/80—Services using short range communication, e.g. near-field communication [NFC], radio-frequency identification [RFID] or low energy communication
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04R—LOUDSPEAKERS, MICROPHONES, GRAMOPHONE PICK-UPS OR LIKE ACOUSTIC ELECTROMECHANICAL TRANSDUCERS; DEAF-AID SETS; PUBLIC ADDRESS SYSTEMS
- H04R1/00—Details of transducers, loudspeakers or microphones
- H04R1/10—Earpieces; Attachments therefor ; Earphones; Monophonic headphones
- H04R1/1041—Mechanical or electronic switches, or control elements
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W36/00—Hand-off or reselection arrangements
- H04W36/0005—Control or signalling for completing the hand-off
- H04W36/0011—Control or signalling for completing the hand-off for data sessions of end-to-end connection
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W36/00—Hand-off or reselection arrangements
- H04W36/24—Reselection being triggered by specific parameters
- H04W36/30—Reselection being triggered by specific parameters by measured or perceived connection quality data
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W76/00—Connection management
- H04W76/10—Connection setup
Landscapes
- Engineering & Computer Science (AREA)
- Signal Processing (AREA)
- Computer Networks & Wireless Communication (AREA)
- Physics & Mathematics (AREA)
- Acoustics & Sound (AREA)
- Telephone Function (AREA)
- Mobile Radio Communication Systems (AREA)
Abstract
The invention provides a communication method and a device of a Bluetooth headset, wherein the method comprises the following steps: controlling the mobile terminal to establish a first Bluetooth connection with the Bluetooth headset and a second Bluetooth connection with the headset box respectively; transmitting first Bluetooth data between the mobile terminal and the Bluetooth headset based on the first Bluetooth connection; detecting a first packet loss rate of first Bluetooth data in a transmission process, and when the first packet loss rate is greater than a first preset threshold value, acquiring first signal intensity of a first Bluetooth connection, second signal intensity of a second Bluetooth connection and third signal intensity of a Bluetooth signal between an earphone box and a Bluetooth earphone; when the second signal intensity and the third signal intensity are both greater than the first signal intensity, disconnecting the first Bluetooth connection, and establishing a third Bluetooth connection between the Bluetooth earphone and the earphone box; transmitting second Bluetooth data between the mobile terminal and the Bluetooth headset based on the second Bluetooth connection and the third Bluetooth connection; the data transmission range when the Bluetooth headset is used is enlarged.
Description
Technical Field
The invention relates to the technical field of Bluetooth headset communication, in particular to a Bluetooth headset communication method and device.
Background
Bluetooth headset is a kind of electronic equipment that is now common, because its structure is small and exquisite, pleasing to the eye, advantage such as portable, is liked by the user deeply. However, the existing bluetooth headset is limited by the use environment, the small size (affecting the antenna performance) or the small battery capacity (affecting the transmission power), and the like, so that the problem that the bluetooth headset can only perform data transmission in a short distance range or is easily interfered is caused, and the user experience is affected.
Disclosure of Invention
In view of the problems in the prior art, an object of the present invention is to provide a communication method and apparatus for a bluetooth headset, which increases the data transmission range when the bluetooth headset is used.
In order to achieve the above object, the present invention provides a bluetooth headset communication method, comprising the steps of:
s110, controlling the mobile terminal to establish a first Bluetooth connection with the Bluetooth headset and a second Bluetooth connection with the headset box respectively; transmitting first Bluetooth data between the mobile terminal and the Bluetooth headset based on the first Bluetooth connection;
s120, detecting a first packet loss rate of the first Bluetooth data in a transmission process, and when the first packet loss rate is greater than a first preset threshold value, acquiring a first signal intensity of the first Bluetooth connection, a second signal intensity of the second Bluetooth connection, and a third signal intensity of a Bluetooth signal between an earphone box and a Bluetooth earphone; and
s130, when the second signal strength and the third signal strength are both greater than the first signal strength, disconnecting the first Bluetooth connection, and establishing a third Bluetooth connection between the Bluetooth headset and the headset box; second Bluetooth data is transmitted between the mobile terminal and the Bluetooth headset based on the second Bluetooth connection and the third Bluetooth connection.
Optionally, step S110 includes:
and after detecting that the Bluetooth earphone is taken out of the earphone box, controlling the mobile terminal to establish first Bluetooth connection with the Bluetooth earphone and establish second Bluetooth connection with the earphone box respectively.
Optionally, the method further comprises the step of:
s140, continuously monitoring a second packet loss rate and the first signal strength of the second bluetooth data during transmission, and when the second packet loss rate is greater than a second preset threshold and the first signal strength is greater than a third preset threshold, disconnecting the third bluetooth connection and reestablishing the first bluetooth connection.
Optionally, the bluetooth headset has a first storage module for storing a data cache file, where the data cache file is used for caching data to be played; the data amount cached by the data caching file is equal to a fourth preset threshold;
the step S130 includes:
and after the first Bluetooth connection is disconnected, the Bluetooth headset analyzes the data in the data cache file and plays the data until the Bluetooth headset receives the second Bluetooth data and analyzes and plays the data.
Optionally, a second storage module is disposed in the earphone box, and step S120 includes:
monitoring a first signal intensity of the first Bluetooth connection and a third signal intensity of a Bluetooth signal between the earphone box and the Bluetooth earphone in real time based on a preset data packet; monitoring second signal intensity of the second Bluetooth connection in real time based on an audio stream data packet sent to the earphone box by the mobile terminal; the audio stream data packet is an audio stream with a preset data volume behind the audio stream currently played by the Bluetooth headset;
storing the audio stream data packet in a second storage module, and keeping the audio stream data packet updated;
the step S130 includes:
after the first Bluetooth connection is disconnected, the earphone box sends the audio stream data packet stored in the second storage module to the Bluetooth earphone, and the Bluetooth earphone analyzes the audio stream data packet and plays the audio stream data packet; and meanwhile, the earphone box continues to receive the audio stream data packet from the mobile terminal.
Optionally, the earphone box includes a first bluetooth module and a second bluetooth module, and a fourth bluetooth connection is established between the first bluetooth module and the second bluetooth module;
the working state of the Bluetooth headset comprises a connection mode and a monitoring mode; in the connection mode, data transmission is carried out with a connection object; in a monitoring mode, detecting and receiving Bluetooth signals in an external environment within a preset range; the step S130 includes:
when the first Bluetooth connection is disconnected, the working state of the Bluetooth headset is switched from a connection mode to a monitoring mode;
the mobile terminal transmits signals to a first Bluetooth module of the earphone box through the second Bluetooth connection, and the first Bluetooth module transmits the received signals to the second Bluetooth module through the fourth Bluetooth connection;
the Bluetooth headset acquires a signal transmitted between the first Bluetooth module and the second Bluetooth module based on a monitoring mode, and analyzes and plays the signal; and switching the working state of the Bluetooth earphone from a monitoring mode to a connection mode until a third Bluetooth connection is established between the Bluetooth earphone and the earphone box.
Optionally, the earphone box includes a first bluetooth module and a second bluetooth module, and the first bluetooth module and the second bluetooth module establish a wired connection via a data line; the working state of the Bluetooth headset comprises a connection mode and a monitoring mode; in the connection mode, data transmission is carried out with a connection object; in a monitoring mode, detecting and receiving Bluetooth signals in an external environment within a preset range; the step S130 includes:
after the first Bluetooth connection is disconnected, the working state of the Bluetooth headset is switched from a connection mode to a monitoring mode;
the mobile terminal transmits signals to a first Bluetooth module of the earphone box through the second Bluetooth connection, and the first Bluetooth module transmits the received signals to the second Bluetooth module through the data line;
the second Bluetooth module broadcasts the received signal outwards, and the Bluetooth headset acquires the broadcast signal and analyzes and plays the broadcast signal after detecting the broadcast signal based on a monitoring mode; and switching the working state of the Bluetooth earphone from a monitoring mode to a connection mode until a third Bluetooth connection is established between the Bluetooth earphone and the earphone box.
Optionally, step S110 includes:
and after detecting that the mobile terminal starts the preset function, controlling the mobile terminal to establish a first Bluetooth connection with the Bluetooth earphone and a second Bluetooth connection with the earphone box respectively.
Optionally, step S110 includes:
controlling the mobile terminal to establish a first Bluetooth connection with the Bluetooth headset and a second Bluetooth connection with the headset box respectively;
the mobile terminal obtains the residual electric quantity of the earphone box;
and when the residual electric quantity is smaller than a fifth preset threshold value, the mobile terminal closes the preset function.
Optionally, the method further comprises the step of:
and when the earphone is detected to be put back into the earphone box, the first Bluetooth connection, the second Bluetooth connection and the third Bluetooth connection are disconnected.
The invention also provides a Bluetooth headset communication device, which is used for realizing the Bluetooth headset communication method and comprises the following steps:
the initialization module is used for controlling the mobile terminal to establish first Bluetooth connection with the Bluetooth headset and second Bluetooth connection with the headset box respectively; transmitting first Bluetooth data between the mobile terminal and the Bluetooth headset based on the first Bluetooth connection;
the signal detection module is used for detecting a first packet loss rate of the first Bluetooth data in a transmission process, and acquiring first signal intensity of the first Bluetooth connection, second signal intensity of the second Bluetooth connection and third signal intensity of Bluetooth signals between the earphone box and the Bluetooth earphone when the first packet loss rate is greater than a first preset threshold value; and
the relay connection module is used for disconnecting the first Bluetooth connection and establishing a third Bluetooth connection between the Bluetooth headset and the headset box when the second signal strength and the third signal strength are both greater than the first signal strength; second bluetooth data is transmitted between the mobile terminal and the bluetooth headset based on the second bluetooth connection and the third bluetooth connection.
The invention also provides a bluetooth headset communication device, comprising:
a processor;
a memory having stored therein an executable program of the processor;
wherein the processor is configured to perform the steps of any of the above-described bluetooth headset communication methods via execution of the executable program.
Compared with the prior art, the invention has the following advantages and prominent effects:
according to the Bluetooth headset communication method and device, when the fact that the stability that the Bluetooth headset directly transmits data to the mobile terminal is poor is detected, meanwhile, the signal intensity of connection after relay through the headset box is larger than the signal intensity of direct connection, the headset box is adopted for relay transmission, signals received by the Bluetooth headset are enhanced, a user can use the Bluetooth headset in a larger distance range, and the use convenience is improved.
Drawings
Other features, objects and advantages of the present invention will become more apparent upon reading of the detailed description of non-limiting embodiments thereof, with reference to the following drawings.
Fig. 1 is a schematic diagram of a communication method of a bluetooth headset according to an embodiment of the present invention;
fig. 2 is a schematic diagram of a bluetooth headset communication method according to another embodiment of the present invention;
fig. 3 is a schematic flowchart illustrating a step S130 in a bluetooth headset communication method according to another embodiment of the present invention;
fig. 4 is a schematic flowchart illustrating a step S130 in a bluetooth headset communication method according to another embodiment of the present invention;
fig. 5 is a schematic structural diagram of a bluetooth headset communication device according to an embodiment of the present invention;
fig. 6 is a schematic structural diagram of a bluetooth headset communication device according to another embodiment of the present invention;
Detailed Description
Example embodiments will now be described more fully with reference to the accompanying drawings. Example embodiments may, however, be embodied in many different forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the concept of example embodiments to those skilled in the art. The same reference numerals in the drawings denote the same or similar structures, and thus, a repetitive description thereof will be omitted.
As shown in fig. 1, an embodiment of the present invention discloses a bluetooth headset communication method, which includes the following steps:
s110, the mobile terminal is controlled to establish a first Bluetooth connection with the Bluetooth headset and a second Bluetooth connection with the headset box respectively. And transmitting first Bluetooth data between the mobile terminal and the Bluetooth headset based on the first Bluetooth connection. Specifically, the bluetooth headsets in the present application are all TWS (True Wireless Stereo) bluetooth headsets. The earphone box is used for containing earphones when the earphones are not used, and can have a function of charging the Bluetooth earphones.
And S120, detecting a first packet loss rate of the first Bluetooth data in a transmission process, and when the first packet loss rate is greater than a first preset threshold value, acquiring a first signal intensity of the first Bluetooth connection, a second signal intensity of the second Bluetooth connection, and a third signal intensity of a Bluetooth signal between the earphone box and the Bluetooth earphone. Specifically, the first packet loss rate is a ratio between a data volume difference and a data volume sent by the mobile terminal, where the data volume difference is a difference between the data volume sent by the mobile terminal and the data volume received by the bluetooth headset. The first Signal Strength, the second Signal Strength, and the third Signal Strength may be obtained based on an RSSI (Received Signal Strength) value recorded in a bluetooth protocol (BLE protocol stack) used. The first preset threshold may be 10%.
S130, when the second signal strength and the third signal strength are both greater than the first signal strength, disconnecting the first bluetooth connection, and establishing a third bluetooth connection between the bluetooth headset and the headset case; and transmitting second Bluetooth data between the mobile terminal and the Bluetooth headset based on the second Bluetooth connection and the third Bluetooth connection. That is, the step is performed under the condition that the second signal strength is greater than the first signal strength, and the third signal strength is greater than the first signal strength.
In this step, that is, when it is detected that the data signal directly transmitted between the mobile terminal and the bluetooth headset is poor, in order to increase the transmission range of the bluetooth signal, the bluetooth data transmission is performed between the mobile terminal and the bluetooth headset based on the headset box as a relay device. Therefore, the user does not need to carry the mobile terminal to move along with the Bluetooth headset in order to pursue signals, and the user experience is favorably improved.
Another embodiment of the present invention discloses another bluetooth headset communication method, which replaces the step S110 with the following step S111 on the basis of any of the above embodiments, and the other steps remain unchanged:
and S111, after the Bluetooth headset is taken out of the headset box, controlling the mobile terminal to establish first Bluetooth connection with the Bluetooth headset and establish second Bluetooth connection with the headset box respectively. Specifically, it is a necessary prerequisite that the method provided in the present application is established that the bluetooth headset is taken out of the headset box, and belongs to an application scenario of the present application. Only when it is detected that the bluetooth headset is taken out of the headset box this action takes place will the following steps be performed. This is beneficial for saving the power of the mobile terminal and the earphone box.
The method for detecting and judging the action of the Bluetooth headset taken out of the headset box can be realized by referring to the prior art. For example, the determination may be made by whether the charging contact of the bluetooth headset is conducted with the charging contact of the headset case, and when the two charging contacts are switched from the conducting state to the non-conducting state, it is indicated that the bluetooth headset is taken out. Of course, the present application is not limited thereto, and those skilled in the art may set other determination methods as needed to implement the above detection.
Another embodiment of the present invention discloses another bluetooth headset communication method, as shown in fig. 2, on the basis of any of the above embodiments, the embodiment further includes the steps of:
s140, continuously monitoring a second packet loss rate and the first signal strength of the second bluetooth data during transmission, and disconnecting the third bluetooth connection and reestablishing the first bluetooth connection when the second packet loss rate is greater than a second preset threshold and the first signal strength is greater than a third preset threshold. Specifically, when the communication signal is continuously detected to be poor when the earphone box is used as the relay device for relay transmission, and the signal intensity of the direct connection is greater than a threshold value, the relay connection is cancelled, and the direct connection is established between the mobile terminal and the Bluetooth earphone. Therefore, the connection mode with better signals can be switched in time, the signal transmission effect is ensured, and the user experience is favorably improved.
The second preset threshold may be 5%, and the third preset threshold may be-95 dBm. The present application is not limited thereto.
Another embodiment of the present invention discloses another bluetooth headset communication method, which is based on any of the above embodiments, and replaces the step S110 with the following step S112, and the other steps remain unchanged:
and S112, after detecting that the preset function of the mobile terminal is started, controlling the mobile terminal to respectively establish a first Bluetooth connection with the Bluetooth headset and a second Bluetooth connection with the headset box. That is, the subsequent steps can only be executed when the mobile terminal is detected to be started with the preset function. This is beneficial for saving the power of the mobile terminal and the earphone box. The preset function may be a signal enhancement function.
Another embodiment of the present invention discloses another bluetooth headset communication method, where in the embodiment, on the basis of the foregoing embodiment, step S112 includes:
s1121, after detecting that the mobile terminal starts the preset function, controlling the mobile terminal to establish a first Bluetooth connection with the Bluetooth headset and a second Bluetooth connection with the headset box respectively.
S1122, the mobile terminal obtains the remaining power of the earphone box. And
s1123, when the remaining power is greater than a fifth preset threshold, transmitting first bluetooth data between the mobile terminal and the bluetooth headset based on the first bluetooth connection; otherwise, the mobile terminal closes the preset function. Therefore, the electric quantity of the earphone box is saved, the earphone box is guaranteed to meet basic requirements of charging and the like in the using process preferentially, and user experience is improved.
The fifth preset threshold may be 30%. The present application is not limited thereto.
Another embodiment of the present invention discloses another bluetooth headset communication method, which is based on any of the above embodiments, and replaces the step S110 with the following step S113, and the other steps remain unchanged:
s113, after the mobile terminal is detected to start the preset function and the Bluetooth headset is detected to be taken out of the headset box, the mobile terminal is controlled to establish first Bluetooth connection with the Bluetooth headset and establish second Bluetooth connection with the headset box respectively. That is, the present application performs the subsequent steps only when the above two conditions are satisfied. This is beneficial for saving the power of the mobile terminal and the earphone box. The preset function may be a signal enhancement function.
In another embodiment of the present invention, on the basis of any of the above embodiments, the step S130 is replaced with the following step S150, and other steps remain unchanged. In this embodiment, the bluetooth headset has a first storage module for storing a data cache file. The data cache file is used for caching data to be played. And the data amount cached by the data caching file is equal to a fourth preset threshold value. That is, the data buffer file is audio data whose data frame amount is a fourth preset threshold value from the next frame of the currently played data frame.
S150, when the second signal intensity and the third signal intensity are both greater than the first signal intensity, disconnecting the first Bluetooth connection and establishing a third Bluetooth connection between the Bluetooth headset and the headset box; transmitting second bluetooth data between the mobile terminal and the bluetooth headset based on the second bluetooth connection and the third bluetooth connection; when the first Bluetooth connection is disconnected, simultaneously executing: and the Bluetooth headset analyzes and plays the data in the data cache file until the Bluetooth headset receives the second Bluetooth data and analyzes and plays the second Bluetooth data.
Wherein, the start frame for playing the audio data based on the second bluetooth data is: and when the Bluetooth earphone receives the second Bluetooth data, the Bluetooth earphone stops playing the next frame of the current data frame when the data in the data cache file is played. Therefore, the problem of short pause generated in the audio data playing process before the third Bluetooth connection is established is solved, continuous and stable playing is realized, and the user experience is favorably improved.
The fourth preset threshold may be a data amount satisfying the audio data playing within a time period. The time period is any time length which is more than or equal to the time required for establishing the third Bluetooth connection.
Another embodiment of the present invention discloses another bluetooth headset communication method, in which on the basis of any of the above embodiments, a second storage module is disposed in the headset case, and step S120 includes:
s121, detecting a first packet loss rate of the first Bluetooth data in the transmission process.
S122, when the first packet loss rate is lower than a first preset threshold, monitoring a first signal strength of the first bluetooth connection and a third signal strength of a bluetooth signal between the earphone box and the bluetooth earphone in real time based on a preset data packet; and monitoring the second signal intensity of the second Bluetooth connection in real time based on an audio stream data packet sent to the earphone box by the mobile terminal. The audio stream data packet is an audio stream with a preset data volume after the audio stream currently played by the bluetooth headset. That is, the audio stream currently played by the bluetooth headset and the audio stream data packet may be combined to form a continuous data stream for an audio file. For example, if the currently played audio stream is the data frames of the audio file from the 3 rd to the 6 th seconds (including the 6 th second), the audio stream packet may include the data frames of the audio file from the 7 th to the 10 th seconds. Therefore, the audio data can be continuously played in the process of switching the Bluetooth connection. And
and S123, storing the audio stream data packet in a second storage module, and keeping updating the audio stream data packet. That is, the audio stream data packet needs to be updated in real time along with the progress of the currently played audio stream, for example, if the previous audio stream data packet corresponds to the data frames from the 7 th second to the 10 th second in the audio file, and the currently played audio stream has been played to the 10 th second, the audio stream data packet needs to be updated to the data frames from the 11 th second to the 14 th second in the stored audio file.
The step S130 includes:
and when the second signal strength and the third signal strength are both greater than the first signal strength, disconnecting the first Bluetooth connection.
After the first Bluetooth connection is disconnected, the earphone box sends the audio stream data packet stored in the second storage module to the Bluetooth earphone, and the Bluetooth earphone analyzes the audio stream data packet and plays the audio stream data packet; and meanwhile, the earphone box continues to receive the audio stream data packet from the mobile terminal. And
establishing a third Bluetooth connection between the Bluetooth headset and the headset box; and transmitting second Bluetooth data between the mobile terminal and the Bluetooth headset based on the second Bluetooth connection and the third Bluetooth connection.
Therefore, the audio data packet of the next time period can be used as a test data packet for testing the signal intensity between two devices, the signal intensity is detected, the multiplexing of the audio data packet is realized, and the storage space is saved; and the prepositive cache of the audio data stream can be realized in the process of switching the Bluetooth connection, the problem of short pause generated in the audio data playing process before the third Bluetooth connection is established is solved, the continuous and stable playing is realized, and the user experience is favorably improved.
In another embodiment of the present invention, based on any of the above embodiments, the earphone box includes a first bluetooth module and a second bluetooth module, and a fourth bluetooth connection is established between the first bluetooth module and the second bluetooth module, that is, the connection between the first bluetooth module and the second bluetooth module is a wireless connection.
The working state of the Bluetooth headset comprises a connection mode and a monitoring mode. In the connection mode, data transmission is carried out with a connection object; and in the monitoring mode, detecting and receiving Bluetooth signals in the external environment within a preset range. In this embodiment, the step S130 includes:
s131, after the first Bluetooth connection is disconnected, the working state of the Bluetooth headset is switched from a connection mode to a monitoring mode.
And S132, the mobile terminal transmits Bluetooth signals to the first Bluetooth module of the earphone box through the second Bluetooth connection, and the first Bluetooth module transmits the received Bluetooth signals to the second Bluetooth module through the fourth Bluetooth connection.
S133, after the Bluetooth headset detects a Bluetooth signal transmitted between the first Bluetooth module and the second Bluetooth module based on a monitoring mode, acquiring the Bluetooth signal and analyzing and playing the Bluetooth signal; and switching the working state of the Bluetooth earphone into a connection mode from a monitoring mode until a third Bluetooth connection is established between the Bluetooth earphone and the earphone box.
Therefore, the problem of short pause generated in the audio data playing process before the third Bluetooth connection is established is solved, continuous and stable playing is realized, and the improvement of user experience is facilitated.
The preset range can be a range with the radius of 10 meters and the Bluetooth headset as a center. This is not limited by the present application.
The invention discloses another Bluetooth headset communication method in another embodiment. In this embodiment, on the basis of any of the above embodiments, the earphone box includes a third bluetooth module and a fourth bluetooth module, and the third bluetooth module and the fourth bluetooth module establish a wired connection via a data line. The operating state of the bluetooth headset also includes a connection mode and a listening mode. In the connection mode, data transmission is carried out with a connection object; and in the monitoring mode, detecting and receiving Bluetooth signals in the external environment within a preset range. In this embodiment, step S130 includes:
s134, after the first bluetooth connection is disconnected, the working state of the bluetooth headset is switched from the connection mode to the monitoring mode.
And S135, the mobile terminal transmits Bluetooth signals to a third Bluetooth module of the earphone box through the second Bluetooth connection, and the third Bluetooth module transmits the received Bluetooth signals to the fourth Bluetooth module through the data line.
S136, the fourth Bluetooth module broadcasts the received Bluetooth signal outwards, and the Bluetooth headset acquires the broadcast signal and analyzes and plays the broadcast signal after detecting the broadcast signal based on a monitoring mode; and switching the working state of the Bluetooth earphone into a connection mode from a monitoring mode until a third Bluetooth connection is established between the Bluetooth earphone and the earphone box.
Therefore, the problem of short pause generated in the audio data playing process before the third Bluetooth connection is established is solved, continuous and stable playing is realized, and the user experience is favorably improved.
Another embodiment of the present invention discloses another bluetooth headset communication method, which is based on any of the above embodiments, and further includes the steps of:
and after the earphone box is placed back to the earphone is detected, the first Bluetooth connection, the second Bluetooth connection and the third Bluetooth connection are disconnected. Therefore, the user stops using the Bluetooth headset, all Bluetooth connections are disconnected, and the electric quantity of the mobile terminal and the headset box is saved.
The method for detecting that the earphone is put back into the earphone box can be implemented by referring to the method for detecting whether the charging contact is conducted or not, which is disclosed in the above embodiments, and the application is not limited thereto.
It should be noted that, in the present application, since the fourth bluetooth module of the above-mentioned headset box needs to use a broadcast function of bluetooth, a bluetooth standard adopted by the fourth bluetooth module is at least 5.2 standard, or above 5.2 standard, that is, the fourth bluetooth module supports a bluetooth core _ v5.2 protocol. The mobile terminal can be a mobile phone.
Meanwhile, all the embodiments of the application can be freely combined, and the technical scheme obtained after combination is within the protection scope of the application.
As shown in fig. 5, an embodiment of the present invention further discloses a bluetooth headset communication device 5, which includes:
the initialization module 51 controls the mobile terminal to establish a first Bluetooth connection with the Bluetooth headset and a second Bluetooth connection with the headset box respectively; and transmitting first Bluetooth data between the mobile terminal and the Bluetooth headset based on the first Bluetooth connection.
The signal detection module 52 detects a first packet loss rate of the first bluetooth data in a transmission process, and when the first packet loss rate is greater than a first preset threshold, obtains a first signal strength of the first bluetooth connection, a second signal strength of the second bluetooth connection, and a third signal strength of a bluetooth signal between the earphone box and the bluetooth earphone. And
the relay connection module 53, when both the second signal strength and the third signal strength are greater than the first signal strength, disconnects the first bluetooth connection, and establishes a third bluetooth connection between the bluetooth headset and the headset box; second Bluetooth data is transmitted between the mobile terminal and the Bluetooth headset based on the second Bluetooth connection and the third Bluetooth connection.
It is understood that the bluetooth headset communication device of the present invention may further include other existing functional modules that support the operation of the bluetooth headset communication device. The bluetooth headset communication device shown in fig. 5 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present invention.
The bluetooth headset communication device in this embodiment is used to implement the above method for bluetooth headset communication, so for the specific implementation steps of the bluetooth headset communication device, reference may be made to the above description of the method for bluetooth headset communication, and details are not repeated here.
The embodiment of the invention also discloses a Bluetooth headset communication device, which comprises a processor and a memory, wherein the memory stores the executable program of the processor; the processor is configured to perform the steps in the above-described bluetooth headset communication method via execution of the executable program. Fig. 6 is a schematic structural diagram of a bluetooth headset communication device disclosed in the present invention. An electronic device 600 according to this embodiment of the invention is described below with reference to fig. 6. The electronic device 600 shown in fig. 6 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present invention.
As shown in fig. 6, the electronic device 600 is embodied in the form of a general purpose computing device. The components of the electronic device 600 may include, but are not limited to: at least one processing unit 610, at least one memory unit 620, a bus 630 connecting the different platform components (including the memory unit 620 and the processing unit 610), a display unit 640, and the like.
Wherein the memory unit stores program code that can be executed by the processing unit 610 such that the processing unit 610 performs the steps according to various exemplary embodiments of the present invention as described in the above-mentioned bluetooth headset communication method section of the present specification. For example, processing unit 610 may perform the steps as shown in fig. 1.
The storage unit 620 may include readable media in the form of volatile memory units, such as a random access memory unit (RAM)6201 and/or a cache memory unit 6202, and may further include a read-only memory unit (ROM) 6203.
The memory unit 620 may also include a program/utility 6204 having a set (at least one) of program modules 6205, such program modules 6205 including, but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which, or some combination thereof, may comprise an implementation of a network environment.
The electronic device 600 may also communicate with one or more external devices 700 (e.g., keyboard, pointing device, bluetooth device, etc.), with one or more devices that enable a user to interact with the electronic device 600, and/or with any device (e.g., router, modem, etc.) that enables the electronic device 600 to communicate with one or more other computing devices. Such communication may occur via an input/output (I/O) interface 650. Also, the electronic device 600 may communicate with one or more networks (e.g., a Local Area Network (LAN), a Wide Area Network (WAN), and/or a public network such as the Internet) via the network adapter 660. The network adapter 660 may communicate with other modules of the electronic device 600 via the bus 630. It should be understood that although not shown in the figures, other hardware and/or software modules may be used in conjunction with the electronic device 600, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage platforms, to name a few.
According to the Bluetooth headset communication method and device, when the fact that stability of data transmission between the Bluetooth headset and the mobile terminal is poor is detected, and meanwhile, the signal intensity of connection after relay through the headset box is larger than that of the signal intensity of direct connection, the headset box is adopted for relay transmission, signals received by the Bluetooth headset are enhanced, a user can use the Bluetooth headset in a larger distance range, and use convenience is improved.
The foregoing is a more detailed description of the invention in connection with specific preferred embodiments and it is not intended that the invention be limited to these specific details. For those skilled in the art to which the invention pertains, several simple deductions or substitutions can be made without departing from the spirit of the invention, and all shall be considered as belonging to the protection scope of the invention.
Claims (11)
1. A communication method of a Bluetooth headset is characterized by comprising the following steps:
s110, controlling the mobile terminal to respectively establish first Bluetooth connection with a Bluetooth headset and second Bluetooth connection with a headset box; transmitting first Bluetooth data between the mobile terminal and the Bluetooth headset based on the first Bluetooth connection;
s120, detecting a first packet loss rate of the first Bluetooth data in a transmission process, and when the first packet loss rate is greater than a first preset threshold value, acquiring a first signal intensity of the first Bluetooth connection, a second signal intensity of the second Bluetooth connection, and a third signal intensity of a Bluetooth signal between an earphone box and a Bluetooth earphone; and
s130, when the second signal strength and the third signal strength are both greater than the first signal strength, disconnecting the first Bluetooth connection, and establishing a third Bluetooth connection between the Bluetooth headset and the headset box; transmitting second Bluetooth data between the mobile terminal and the Bluetooth headset based on the second Bluetooth connection and the third Bluetooth connection;
a second storage module is arranged in the earphone box, and step S120 includes:
monitoring a first signal intensity of the first Bluetooth connection and a third signal intensity of a Bluetooth signal between the earphone box and the Bluetooth earphone in real time based on a preset data packet; monitoring second signal intensity of the second Bluetooth connection in real time based on an audio stream data packet sent to the earphone box by the mobile terminal; the audio stream data packet is an audio stream with a preset data volume behind the audio stream currently played by the Bluetooth headset; the audio stream data packet is used as a test data packet for testing the signal strength between the mobile terminal and the earphone box, so that the multiplexing of the audio data packet is realized;
storing the audio stream data packet in a second storage module, and keeping the audio stream data packet updated;
the step S130 includes:
after the first Bluetooth connection is disconnected, the earphone box sends the audio stream data packet stored in the second storage module to the Bluetooth earphone, and the Bluetooth earphone analyzes the audio stream data packet and plays the audio stream data packet; and meanwhile, the earphone box continues to receive the audio stream data packet from the mobile terminal.
2. The bluetooth headset communication method according to claim 1, wherein the step S110 comprises:
and after detecting that the Bluetooth earphone is taken out of the earphone box, controlling the mobile terminal to establish first Bluetooth connection with the Bluetooth earphone and establish second Bluetooth connection with the earphone box respectively.
3. The bluetooth headset communication method of claim 1, wherein the method further comprises the steps of:
s140, continuously monitoring a second packet loss rate and the first signal strength of the second bluetooth data during transmission, and when the second packet loss rate is greater than a second preset threshold and the first signal strength is greater than a third preset threshold, disconnecting the third bluetooth connection and reestablishing the first bluetooth connection.
4. The bluetooth headset communication method according to claim 1, wherein the bluetooth headset has a first storage module for storing a data cache file for caching data to be played; the data amount cached by the data caching file is equal to a fourth preset threshold;
the step S130 includes:
and after the first Bluetooth connection is disconnected, the Bluetooth headset analyzes and plays the data in the data cache file until the Bluetooth headset receives and analyzes the second Bluetooth data.
5. The bluetooth headset communication method according to claim 1, wherein the headset case comprises a first bluetooth module and a second bluetooth module, and a fourth bluetooth connection is established between the first bluetooth module and the second bluetooth module;
the working state of the Bluetooth headset comprises a connection mode and a monitoring mode; in the connection mode, data transmission is carried out with a connection object; in a monitoring mode, detecting and receiving Bluetooth signals in an external environment within a preset range; the step S130 includes:
when the first Bluetooth connection is disconnected, the working state of the Bluetooth headset is switched from a connection mode to a monitoring mode;
the mobile terminal transmits signals to a first Bluetooth module of the earphone box through the second Bluetooth connection, and the first Bluetooth module transmits the received signals to the second Bluetooth module through the fourth Bluetooth connection;
the Bluetooth headset acquires a signal transmitted between the first Bluetooth module and the second Bluetooth module based on a monitoring mode, and analyzes and plays the signal; and switching the working state of the Bluetooth headset from a monitoring mode to a connection mode until a third Bluetooth connection is established between the Bluetooth headset and the headset box.
6. The bluetooth headset communication method according to claim 1, wherein the headset case includes a first bluetooth module and a second bluetooth module, the first bluetooth module and the second bluetooth module establishing a wired connection via a data line; the working state of the Bluetooth headset comprises a connection mode and a monitoring mode; in the connection mode, data transmission is carried out with a connection object; in a monitoring mode, detecting and receiving Bluetooth signals in an external environment within a preset range; the step S130 includes:
after the first Bluetooth connection is disconnected, the working state of the Bluetooth headset is switched from a connection mode to a monitoring mode;
the mobile terminal transmits signals to a first Bluetooth module of the earphone box through the second Bluetooth connection, and the first Bluetooth module transmits the received signals to the second Bluetooth module through the data line;
the second Bluetooth module broadcasts the received signal outwards, and the Bluetooth headset acquires the broadcast signal and analyzes and plays the broadcast signal after detecting the broadcast signal based on a monitoring mode; and switching the working state of the Bluetooth earphone from a monitoring mode to a connection mode until a third Bluetooth connection is established between the Bluetooth earphone and the earphone box.
7. The bluetooth headset communication method according to claim 1, wherein the step S110 comprises:
and after detecting that the mobile terminal starts the preset function, controlling the mobile terminal to respectively establish a first Bluetooth connection with the Bluetooth earphone and a second Bluetooth connection with the earphone box.
8. The bluetooth headset communication method according to claim 7, wherein the step S110 comprises:
controlling the mobile terminal to establish a first Bluetooth connection with the Bluetooth headset and a second Bluetooth connection with the headset box respectively;
the mobile terminal acquires the residual electric quantity of the earphone box;
and when the residual electric quantity is smaller than a fifth preset threshold value, the mobile terminal closes the preset function.
9. The bluetooth headset communication method of claim 1, wherein the method further comprises the steps of:
and when the earphone is detected to be put back into the earphone box, the first Bluetooth connection, the second Bluetooth connection and the third Bluetooth connection are disconnected.
10. A bluetooth headset communication apparatus for implementing the bluetooth headset communication method according to claim 1, the apparatus comprising:
the initialization module is used for controlling the mobile terminal to establish first Bluetooth connection with the Bluetooth headset and second Bluetooth connection with the headset box respectively; transmitting first Bluetooth data between the mobile terminal and the Bluetooth headset based on the first Bluetooth connection;
the signal detection module is used for detecting a first packet loss rate of the first Bluetooth data in a transmission process, and acquiring first signal intensity of the first Bluetooth connection, second signal intensity of the second Bluetooth connection and third signal intensity of Bluetooth signals between the earphone box and the Bluetooth earphone when the first packet loss rate is greater than a first preset threshold value; and
the relay connection module is used for disconnecting the first Bluetooth connection and establishing a third Bluetooth connection between the Bluetooth headset and the headset box when the second signal strength and the third signal strength are both greater than the first signal strength; second Bluetooth data is transmitted between the mobile terminal and the Bluetooth headset based on the second Bluetooth connection and the third Bluetooth connection.
11. A bluetooth headset communication device, comprising:
a processor;
a memory having stored therein an executable program of the processor;
wherein the processor is configured to perform the steps of the bluetooth headset communication method of any one of claims 1 to 9 via execution of the executable program.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110682602.XA CN113329387B (en) | 2021-06-18 | 2021-06-18 | Bluetooth headset communication method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110682602.XA CN113329387B (en) | 2021-06-18 | 2021-06-18 | Bluetooth headset communication method and device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN113329387A CN113329387A (en) | 2021-08-31 |
CN113329387B true CN113329387B (en) | 2022-09-23 |
Family
ID=77424096
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110682602.XA Active CN113329387B (en) | 2021-06-18 | 2021-06-18 | Bluetooth headset communication method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113329387B (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113825126B (en) * | 2021-09-30 | 2024-06-18 | 联想(北京)有限公司 | Control method and device |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106131728A (en) * | 2016-08-03 | 2016-11-16 | 广东金润和科技股份有限公司 | Intelligent integrated form Bluetooth earphone device |
WO2019214501A1 (en) * | 2018-05-11 | 2019-11-14 | 维沃移动通信有限公司 | Wireless communication methods and apparatuses, and network device |
CN112703746A (en) * | 2020-10-23 | 2021-04-23 | 万魔声学股份有限公司 | Method and device for processing signal, Bluetooth headset and storage medium |
Family Cites Families (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106101991A (en) * | 2016-08-01 | 2016-11-09 | 宇龙计算机通信科技(深圳)有限公司 | A kind of method being connected with terminal foundation and earphone |
CN108900945A (en) * | 2018-09-29 | 2018-11-27 | 上海与德科技有限公司 | Bluetooth headset box and audio recognition method, server and storage medium |
CN109347581B (en) * | 2018-09-30 | 2020-11-27 | Oppo广东移动通信有限公司 | Bluetooth headset connection method and device, electronic equipment and storage medium |
CN109618258A (en) * | 2018-12-10 | 2019-04-12 | 深圳市友杰智新科技有限公司 | A kind of the voice real time translating method and system of bluetooth headset |
CN110166994B (en) * | 2019-05-24 | 2020-01-14 | 深圳市烁讯电子有限公司 | Data time-sharing transmission interoperability method, system, mobile terminal and storage medium |
CN210351670U (en) * | 2019-05-24 | 2020-04-17 | 深圳市小瑞科技股份有限公司 | System for increasing transmission distance of Bluetooth headset |
TWI752568B (en) * | 2019-08-01 | 2022-01-11 | 新加坡商聯發科技(新加坡)私人有限公司 | Bluetooth communication method and communication device |
CN112055280B (en) * | 2020-09-18 | 2022-11-15 | 恒玄科技(上海)股份有限公司 | Wireless communication method for earphone and intelligent devices and wireless earphone assembly |
-
2021
- 2021-06-18 CN CN202110682602.XA patent/CN113329387B/en active Active
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106131728A (en) * | 2016-08-03 | 2016-11-16 | 广东金润和科技股份有限公司 | Intelligent integrated form Bluetooth earphone device |
WO2019214501A1 (en) * | 2018-05-11 | 2019-11-14 | 维沃移动通信有限公司 | Wireless communication methods and apparatuses, and network device |
CN112703746A (en) * | 2020-10-23 | 2021-04-23 | 万魔声学股份有限公司 | Method and device for processing signal, Bluetooth headset and storage medium |
Also Published As
Publication number | Publication date |
---|---|
CN113329387A (en) | 2021-08-31 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN111436041B (en) | Method and device for switching master and slave Bluetooth earphones, bluetooth earphones and system | |
CN108924805B (en) | Bluetooth connection method, medium, first electronic device, second electronic device and computing device | |
US20210219041A1 (en) | Voice data transmission method, wireless earphone and tws earphone | |
CN108684029B (en) | Bluetooth pairing connection method and system, Bluetooth device and terminal | |
CN105847168B (en) | data transmission method, network server, user terminal and system | |
CN108810696B (en) | Electric quantity prompting method, TWS earphone and earphone charging equipment | |
CN109768596B (en) | Electric quantity display method, earphone charging device and earphone | |
US10574316B1 (en) | Antenna switching for device with multiple antennas | |
CN114143397A (en) | Bluetooth headset connection control method, system, device and storage medium | |
US9967687B2 (en) | Audio reproduction apparatus and audio reproduction system | |
CN113099026A (en) | Voice switching method and device, electronic equipment and storage medium | |
CN113329387B (en) | Bluetooth headset communication method and device | |
CN111683358A (en) | Control method, control device, mobile terminal, storage medium and wireless headset | |
CN114258003A (en) | Audio playing control method, system, device and storage medium | |
WO2020082387A1 (en) | Method for changing audio channel, and related device | |
CN105260159A (en) | Audio play method and apparatus | |
CN113038317B (en) | Earphone control method and device, bluetooth earphone and storage medium | |
CN110248347B (en) | Call abnormity detection method, device, equipment and storage medium | |
CN111601290B (en) | Bluetooth sound box, earphone, bluetooth audio playing device, bluetooth sound box system and Bluetooth audio switching method | |
CN111669679A (en) | Method for balanced consumption of battery of true wireless Bluetooth headset | |
CN114866998B (en) | Bluetooth connection method and Bluetooth device | |
CN115022766B (en) | Audio data playing method and equipment | |
CN113825126B (en) | Control method and device | |
US20180324572A1 (en) | Methods and apparatus for providing access to emergency service providers | |
CN109743715B (en) | Processing method and system and electronic equipment |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |