A kind of bluetooth headset based on BLE agreement
Technical field
The invention belongs to bluetooth headset technical fields, are related to a kind of bluetooth headset based on BLE agreement.
Background technique
Current ears bluetooth (TWS bluetooth headset) has begun slowly with universal, the reality of current classical TWS bluetooth headset
Existing technology is mainly classical bluetooth realization and the implementation of APPLE, and current classical bluetooth is deposited when transmitting audio data
The problem of audio is asynchronous, easy disconnection, people are reduced to the experience effect of audio sound quality.
Summary of the invention
The purpose of the present invention is to provide the bluetooth headset based on BLE agreement, solve existing bluetooth headset, there are sounds
Frequently the problem of asynchronous, easy disconnection, greatly reduces the experience effect of the audio sound quality of user.
The purpose of the present invention can be achieved through the following technical solutions:
A kind of bluetooth headset based on BLE agreement, including the first bluetooth headset and the second bluetooth headset, two bluetooth headsets are equal
Including power module, audio collection and processing module, audio output module, electrostatic protection module, main control module, classical bluetooth mould
Block and BLE bluetooth module;
First bluetooth headset passes through classical bluetooth module and connect with mobile communication, and the first bluetooth headset and the second bluetooth ear
It is connected between machine by BLE bluetooth module;
Main control module respectively with power module, audio collection and processing module, audio output module, electrostatic protection module,
Classical bluetooth module is connected with BLE bluetooth module;
Power module is connect with main control module, for providing working power for main control module;
Audio collection and processing module include audio collection device and audio coding decoding chip, the language for real-time collector
The voice messaging of acquisition is simultaneously carried out coded treatment by message breath, and the voice messaging after coded treatment is sent to main control module;
Audio output module is speech player, for carrying out the output of voice;
Electrostatic protection module is connect with main control module, for electrostatic generated on earphone to be carried out elimination protection;
Classical bluetooth module is used to carry out the communication connection between main control module and mobile phone, for receiving the audio of mobile phone transmission
Data packet, and received packets of audio data is sent to main control module;
BLE bluetooth module is used to carry out the communication connection between two earphones, and the earphone for will connect with mobile communication connects
The packets of audio data of receipts is sent to another earphone, realizes the transmission of audio data;
Mobile phone passes through the main control module in classical bluetooth module transmission packets of audio data to the first bluetooth headset, main control module
Packets of audio data is received, and received packets of audio data is sent to through BLE bluetooth module to the master control mould on the second bluetooth headset
Block, the main control module on the second bluetooth headset receive packets of audio data and received packets of audio data is anti-through BLE bluetooth module
The main control module being fed on the first bluetooth headset, the audio that the main control module on the first bluetooth headset sends classical bluetooth module
Data packet and BLE bluetooth module feedback packets of audio data carry out packets of audio data whether loss detection, if lose, abandon this
Packets of audio data receives new packets of audio data again, conversely, then the main control module on the first bluetooth headset sends audio broadcasting
It instructs to the main control module on the second bluetooth headset.
Further, the main control module carry out packets of audio data whether packet loss detection, specifically includes the following steps:
Main control module on S1, the first bluetooth headset receives the packets of audio data that classical bluetooth module is sent, and will receive
Packets of audio data be sent on the main control module on the second bluetooth headset through BLE bluetooth module;
The received packets of audio data of main control module on S2, the second bluetooth headset feeds back to the first indigo plant through BLE bluetooth module
Main control module on tooth earphone;
Main control module on S3, the first bluetooth headset is by the packets of audio data sent through classical bluetooth module and BLE bluetooth
The packets of audio data that module is sent carries out difference project content detection;
If it is poor that the packets of audio data that packets of audio data and BLE bluetooth module that S4, classical bluetooth module are sent are sent exists
It is different, S5 is thened follow the steps, otherwise, executes step S6;
Main control module on S5, the first bluetooth headset receives the main control module on the second bluetooth headset through BLE bluetooth again
The packets of audio data of module feedback, using the packets of audio data of the main control module received on the second bluetooth headset again feedback as most
The packets of audio data of new feedback, and step S4 is executed, if the packets of audio data detected twice has differences, the first bluetooth
Main control module on earphone and the second bluetooth headset abandons the packets of audio data, continues to mobile phone through classical bluetooth
The new packets of audio data that module is sent;
Main control module on S6, the first bluetooth headset sends audio by the retardation time of setting and plays control instruction to audio
Output module, and send audio and play the main control module that control instruction is sent on the second bluetooth headset through BLE bluetooth module, the
Main control module on two bluetooth headsets receives the control instruction that the main control module on the first bluetooth headset is sent, the second bluetooth headset
On main control module send audio and play control instruction to audio output module, realize that two earphones are synchronous and carry out broadcasting for voice messaging
It puts.
Further, the difference contents of a project of packets of audio data detection include the size of packets of audio data, packets of audio data
Format and packets of audio data type.
Further, the retardation time set sends control instruction to the second indigo plant as the main control module on the first bluetooth headset
Main control module on tooth earphone, and the main control module on the second bluetooth headset receives the control instruction of the first bluetooth headset transmission
Time.
Beneficial effects of the present invention:
A kind of bluetooth headset based on BLE agreement provided by the invention, by between BLE bluetooth module two bluetooth headsets of progress
Communications, realize the transmission of audio data, and by the main control module on bluetooth headset to the packets of audio data of transmission into
The detection of row Wireless Losses judges the data integrity in the packets of audio data of transmission, and guarantees the synchronism that audio plays, significantly
The effect that audio data plays is improved, the satisfaction that user uses is improved.
Detailed description of the invention
In order to illustrate the technical solution of the embodiments of the present invention more clearly, will be described below to embodiment required
Attached drawing is briefly described, it should be apparent that, drawings in the following description are only some embodiments of the invention, for ability
For the those of ordinary skill of domain, without creative efforts, it can also be obtained according to these attached drawings other attached
Figure.
Fig. 1 is a kind of schematic diagram of the bluetooth headset based on BLE agreement in the present invention.
Specific embodiment
Following will be combined with the drawings in the embodiments of the present invention, and technical solution in the embodiment of the present invention carries out clear, complete
Site preparation description, it is clear that described embodiments are only a part of the embodiments of the present invention, instead of all the embodiments.It is based on
Embodiment in the present invention, it is obtained by those of ordinary skill in the art without making creative efforts all other
Embodiment shall fall within the protection scope of the present invention.
Refering to Figure 1, a kind of bluetooth headset based on BLE agreement, including the first bluetooth headset and the second bluetooth ear
Machine, each bluetooth headset include power module, audio collection and processing module, audio output module, electrostatic protection module, master
Control module, classical bluetooth module and BLE bluetooth module;
First bluetooth headset passes through classical bluetooth module and connect with mobile communication, and the first bluetooth headset and the second bluetooth ear
It is connected between machine by BLE bluetooth module;
Main control module respectively with power module, audio collection and processing module, audio output module, electrostatic protection module,
Classical bluetooth module is connected with BLE bluetooth module;
Power module is connect with main control module, for providing working power for main control module, guarantees that main control module continues just
Normal work, and then working power is provided for bluetooth headset;
Audio collection and processing module include audio collection device and audio coding decoding chip, the language for real-time collector
The voice messaging of acquisition is simultaneously carried out coded treatment by message breath, and the voice messaging after coded treatment is sent to main control module;
Audio output module is speech player, for carrying out the output of voice;
Electrostatic protection module is connect with main control module, for eliminating electrostatic generated on earphone, realizes earphone
Electrostatic protection;
Classical bluetooth module is used to carry out the communication connection between main control module and mobile phone, for receiving the audio of mobile phone transmission
Data packet, and received packets of audio data is sent to main control module;
BLE bluetooth module is used to carry out the communication connection between two earphones, and the earphone for will connect with mobile communication connects
The packets of audio data of receipts is sent to another earphone, realizes the transmission of audio data;
Mobile phone passes through the main control module in classical bluetooth module transmission packets of audio data to the first bluetooth headset, main control module
Packets of audio data is received, and received packets of audio data is sent to through BLE bluetooth module to the master control mould on the second bluetooth headset
Block, the main control module on the second bluetooth headset receive packets of audio data and received packets of audio data is anti-through BLE bluetooth module
The main control module being fed on the first bluetooth headset, the audio that the main control module on the first bluetooth headset sends classical bluetooth module
Data packet and BLE bluetooth module feedback packets of audio data carry out packets of audio data whether loss detection, if lose, abandon this
Packets of audio data receives new packets of audio data again, conversely, then the main control module on the first bluetooth headset sends audio broadcasting
It instructs to the main control module on the second bluetooth headset.
Wherein, main control module carry out packets of audio data whether packet loss detection, specifically includes the following steps:
Main control module on S1, the first bluetooth headset receives the packets of audio data that classical bluetooth module is sent, and will receive
Packets of audio data be sent on the main control module on the second bluetooth headset through BLE bluetooth module;
The received packets of audio data of main control module on S2, the second bluetooth headset feeds back to the first indigo plant through BLE bluetooth module
Main control module on tooth earphone;
Main control module on S3, the first bluetooth headset is by the packets of audio data sent through classical bluetooth module and BLE bluetooth
The packets of audio data that module is sent carries out difference project content detection, and the difference contents of a project of detection include the big of packets of audio data
Small, packets of audio data format and the type of packets of audio data etc.;
If it is poor that the packets of audio data that packets of audio data and BLE bluetooth module that S4, classical bluetooth module are sent are sent exists
It is different, S5 is thened follow the steps, otherwise, executes step S6;
Main control module on S5, the first bluetooth headset receives the main control module on the second bluetooth headset through BLE bluetooth again
The packets of audio data of module feedback, using the packets of audio data of the main control module received on the second bluetooth headset again feedback as most
The packets of audio data of new feedback, and step S4 is executed, if the packets of audio data detected twice has differences, the first bluetooth
Main control module on earphone and the second bluetooth headset abandons the packets of audio data, continues to mobile phone through classical bluetooth
The new packets of audio data that module is sent;
Main control module on S6, the first bluetooth headset sends audio by the retardation time of setting and plays control instruction to audio
Output module, and send audio and play the main control module that control instruction is sent on the second bluetooth headset through BLE bluetooth module, the
Main control module on two bluetooth headsets receives the control instruction that the main control module on the first bluetooth headset is sent, the second bluetooth headset
On main control module send audio and play control instruction to audio output module, realize that two earphones are synchronous and carry out broadcasting for voice messaging
It puts, wherein the retardation time set sends in control instruction to the second bluetooth headset as the main control module on the first bluetooth headset
Main control module, and the main control module on the second bluetooth headset receive the first bluetooth headset transmission control instruction time.
Bluetooth headset provided by the invention based on BLE agreement, by logical between BLE bluetooth module two bluetooth headsets of progress
Letter transmission realizes the transmission of audio data, and carries out nothing by packets of audio data of the main control module on bluetooth headset to transmission
Line packet loss detection judges the data integrity in the packets of audio data of transmission, and guarantees the synchronism that audio plays, and greatly improves
The effect that audio data plays, improves the satisfaction that user uses.
The above content is just an example and description of the concept of the present invention, affiliated those skilled in the art
It makes various modifications or additions to the described embodiments or is substituted in a similar manner, without departing from invention
Design or beyond the scope defined by this claim, be within the scope of protection of the invention.