CN111132111B - BLE-based audio sharing method, system and computer readable storage medium - Google Patents

BLE-based audio sharing method, system and computer readable storage medium Download PDF

Info

Publication number
CN111132111B
CN111132111B CN201911387711.8A CN201911387711A CN111132111B CN 111132111 B CN111132111 B CN 111132111B CN 201911387711 A CN201911387711 A CN 201911387711A CN 111132111 B CN111132111 B CN 111132111B
Authority
CN
China
Prior art keywords
ble
audio data
host
target slave
data packet
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
CN201911387711.8A
Other languages
Chinese (zh)
Other versions
CN111132111A (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 Inc
Original Assignee
Goertek Inc
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 Inc filed Critical Goertek Inc
Priority to CN201911387711.8A priority Critical patent/CN111132111B/en
Publication of CN111132111A publication Critical patent/CN111132111A/en
Application granted granted Critical
Publication of CN111132111B publication Critical patent/CN111132111B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W4/00Services specially adapted for wireless communication networks; Facilities therefor
    • H04W4/80Services using short range communication, e.g. near-field communication [NFC], radio-frequency identification [RFID] or low energy communication
    • 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
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W76/00Connection management
    • H04W76/10Connection setup
    • H04W76/14Direct-mode setup
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D30/00Reducing energy consumption in communication networks
    • Y02D30/70Reducing energy consumption in communication networks in wireless communication networks

Landscapes

  • Engineering & Computer Science (AREA)
  • Signal Processing (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Physics & Mathematics (AREA)
  • Acoustics & Sound (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

The invention discloses an audio sharing method, a system and a computer readable storage medium based on Bluetooth low energy BLE, wherein the method comprises the following steps: after one or more slaves scan the broadcast signal sent by the BLE master, the slaves scanned with the broadcast signal are determined as target slaves, and the target slaves are connected with the BLE master and receive the audio data packets. After the target slave is connected to the BLE host, the audio data packet is decompressed and the audio data is played in a preset mode and proportion, so that the situation that the BLE host is directly connected in a scanning mode without pairing to obtain the played audio data is realized. Meanwhile, a plurality of target slaves can be connected with the BLE master at the same time to play audio data, so that audio sharing is realized. In addition, the target slave and the BLE host are in communication connection through BLE, and the power consumption of the target slave is lower than that of TWS earphone or classical Bluetooth earphone.

Description

BLE-based audio sharing method, system and computer readable storage medium
Technical Field
The invention relates to the field of wireless Bluetooth headphones, in particular to a BLE-based audio sharing method, a BLE-based audio sharing system and a computer-readable storage medium.
Background
With development and modern development of bluetooth technology and manufacturing process, pursuit of people for light and fast life is becoming higher, and the problem that traditional earphone wires are always wound together and occupy a larger space is solved by the appearance of wireless bluetooth earphone, so that use of wireless bluetooth earphone is becoming wider and wider. At present, the wireless Bluetooth headset is mainly a TWS headset, and is also called a true wireless Bluetooth headset, and the problem of high transmission power consumption exists; moreover, the TWS earphone can only realize one-to-one connection, namely, one Bluetooth terminal device can only connect a pair of Bluetooth earphones. Therefore, the wireless Bluetooth headset in the current market has the problems that only a single user is supported to be connected with Bluetooth terminal equipment to play audio, a plurality of users are not allowed to be simultaneously connected with the same terminal to play audio, and audio sharing cannot be realized besides high transmission power consumption.
Disclosure of Invention
The invention mainly aims to provide a BLE-based audio sharing method, a BLE-based audio sharing system and a BLE-based audio sharing computer readable storage medium, and aims to solve the technical problems that the existing Bluetooth headset has higher power consumption in the process of data transmission and can only realize that one Bluetooth terminal device is connected with a pair of Bluetooth headsets at the same time, and the audio sharing of audio playing of a plurality of pairs of headsets is not allowed.
In order to achieve the above object, the present invention provides a bluetooth low energy BLE-based audio sharing method, which includes the following steps:
when a target slave machine which scans a broadcast signal sent by a BLE host machine exists in a plurality of slave machines, the target slave machine is connected with the BLE host machine and receives an audio data packet sent by the BLE host machine;
the target slave machine decompresses the audio data packet based on a preset mode and a preset proportion to generate audio data;
the target slave plays the audio data.
Preferably, when there is a target slave among the plurality of slaves that scans to a broadcast signal transmitted by a BLE master, the step of connecting the target slave to the BLE master includes:
scanning a preset channel by a plurality of slaves, and detecting whether any one of the slaves receives a broadcast signal which is sent by the BLE host and carries a preset mark;
and if any slave receives the broadcast signal, judging that a target slave which scans the broadcast signal sent by the BLE host exists in the plurality of slaves.
Preferably, the step of the target slave connected to the BLE host and receiving the audio data packet sent by the BLE host includes:
the target slave displays a device name corresponding to the preset mark on a display screen of the target slave, wherein the device name is the name of the BLE host;
when the target slave receives a connection request instruction sent based on the displayed equipment name, connection between the target slave and the BLE host is established, and an audio data packet sent by the BLE host is received.
Preferably, the target slave comprises a left earphone and a right earphone; the step of establishing connection between the target slave and the BLE host when the target slave receives a connection request instruction sent based on the displayed device name includes:
when the target slave receives a connection request instruction sent based on the displayed equipment name, judging the earphone attribute in the connection request instruction;
if the earphone attribute in the connection request instruction is a left ear attribute, establishing connection between the left earphone and the BLE host;
and if the earphone attribute in the connection request instruction is a right ear attribute, establishing connection between the right earphone and the BLE host.
Preferably, the step of receiving the audio data packet sent by the BLE host includes:
and the target slave acquires the address of the BLE host and receives the audio data packet sent by the BLE host in the broadcast signal according to the address.
Preferably, the step of decompressing the audio data packet by the target slave based on a preset manner and a preset ratio, and generating audio data includes:
the target slave judges whether the receiving of the audio data packet is completed or not;
and if the receiving of the audio data packet is completed, decompressing the audio data packet based on the preset mode and the preset proportion to generate audio data.
In order to achieve the above object, the present invention further provides a BLE-based audio sharing method, which includes the steps of:
when the BLE host receives original audio data, compressing the original audio data into an audio data packet based on a preset mode and a preset proportion;
the BLE host transmits the audio data packet to a plurality of slaves.
Preferably, the step of the BLE host transmitting the audio data packet to a plurality of slaves includes:
and the BLE host transmits the audio data packet to a plurality of slaves based on a broadcast signal according to a preset broadcast interval.
In order to achieve the above object, the present invention further provides a BLE-based audio sharing system, which includes a BLE master and a plurality of slaves, and includes a processor and a memory, where the memory stores a control program, and the control program is executed by the processor and implements the steps of the above-mentioned BLE-based audio sharing method.
In addition, to achieve the above object, the present invention also provides a computer readable storage medium storing a control program for a processor to execute and implement the steps of the BLE-based audio sharing method.
According to the BLE-based audio sharing method, system and computer-readable storage medium provided by the embodiment of the invention, after one or more slaves scan broadcast signals sent by a BLE host alone, the slaves scanned with the broadcast signals are judged as target slaves, and the target slaves are connected with the BLE host and receive audio data packets. After the target slave is connected to the BLE host, the audio data packet is decompressed and the audio data is played in a preset mode and proportion, so that the situation that the BLE host is directly connected in a scanning mode without pairing to obtain the played audio data is realized. Meanwhile, a plurality of target slaves can be connected with the BLE master at the same time to play audio data, so that audio sharing is realized. In addition, the target slave and the BLE host are in communication connection through BLE, and the power consumption of the target slave is lower than that of TWS earphone or classical Bluetooth earphone.
Drawings
FIG. 1 is a schematic diagram of the internal architecture of an audio sharing system of a hardware operating environment according to an embodiment of the present invention;
fig. 2 is a flowchart illustrating a first embodiment of a BLE-based audio sharing method according to the present invention;
fig. 3 is a flowchart illustrating a second embodiment of a BLE-based audio sharing method according to the present invention;
fig. 4 is a flowchart illustrating a third embodiment of a BLE-based audio sharing method according to the present invention;
fig. 5 is a flow chart of a security verification mechanism according to a fourth embodiment of the BLE-based audio sharing method of the present invention.
The achievement of the objects, functional features and advantages of the present invention will be further described with reference to the accompanying drawings, in conjunction with the embodiments.
Detailed Description
It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the invention.
The main solutions of the embodiments of the present invention are: after one or more slaves scan the broadcast signal sent by the BLE master, the slaves scanned with the broadcast signal are determined as target slaves, and the target slaves are connected with the BLE master and receive the audio data packets. After the target slave is connected to the BLE host, the audio data packet is decompressed and the audio data is played in a preset mode and proportion, so that the situation that the BLE host is directly connected in a scanning mode without pairing to obtain the played audio data is realized. Meanwhile, a plurality of target slaves can be connected with the BLE master at the same time to play audio data, so that audio sharing is realized. In addition, the target slave and the BLE host are in communication connection through BLE, and the power consumption of the target slave is lower than that of TWS earphone or classical Bluetooth earphone.
Referring to fig. 1, fig. 1 is a schematic diagram of internal structural connection of a BLE-based audio sharing system of a hardware running environment according to an embodiment of the present invention.
As shown in fig. 1, the slave may include: a processor 1001, such as a CPU, a network interface 1004, a user interface 1003, a memory 1005, a communication bus 1002. Wherein the communication bus 1002 is used to enable connected communication between these components. The user interface 1003 may include a Display, an input unit such as a Keyboard (Keyboard), and the optional user interface 1003 may further include a standard wired interface, a wireless interface. The network interface 1004 may optionally include a standard wired interface, a wireless interface (e.g., WI-FI interface). The memory 1005 may be a high-speed RAM memory or a stable memory (non-volatile memory), such as a disk memory. The memory 1005 may also optionally be a storage device separate from the processor 1001 described above.
Those skilled in the art will appreciate that the BLE-based audio sharing system internal structure shown in fig. 1 does not constitute a limitation of the BLE-based audio sharing system, and may include more or fewer components than shown, or may combine certain components, or a different arrangement of components.
As shown in fig. 1, an operating system, a network communication module, a user interface module, and a control program may be included in the memory 1005, which is a type of computer storage medium.
In the terminal shown in fig. 1, the network interface 1004 is mainly used for connecting to a background server and performing data communication with the background server; the user interface 1003 is mainly used for connecting a client (user side) and performing data communication with the client; and the processor 1001 may be configured to call a control program stored in the memory 1005 and perform the following operations:
when a target slave machine which scans a broadcast signal sent by a BLE host machine exists in a plurality of slave machines, the target slave machine is connected with the BLE host machine and receives an audio data packet sent by the BLE host machine;
the target slave machine decompresses the audio data packet based on a preset mode and a preset proportion to generate audio data;
the target slave plays the audio data.
Further, when there is a target slave among the plurality of slaves that scans to the broadcast signal transmitted by the BLE master, before the step of connecting the target slave to the BLE master, the processor 1001 may be configured to call the control program stored in the memory 1005 and perform the following operations:
scanning a preset channel by a plurality of slaves, and detecting whether any one of the slaves receives a broadcast signal which is sent by the BLE host and carries a preset mark;
and if any slave receives the broadcast signal, judging that a target slave which scans the broadcast signal sent by the BLE host exists in the plurality of slaves.
Further, the step of the target slave being connected to the BLE host and receiving the audio data packet sent by the BLE host includes:
the target slave displays a device name corresponding to the preset mark on a display screen of the target slave, wherein the device name is the name of the BLE host;
when the target slave receives a connection request instruction sent based on the displayed equipment name, connection between the target slave and the BLE host is established, and an audio data packet sent by the BLE host is received.
Further, the target slave comprises a left earphone and a right earphone; the step of establishing connection between the target slave and the BLE host when the target slave receives a connection request instruction sent based on the displayed device name includes:
when the target slave receives a connection request instruction sent based on the displayed equipment name, judging the earphone attribute in the connection request instruction;
if the earphone attribute in the connection request instruction is a left ear attribute, establishing connection between the left earphone and the BLE host;
and if the earphone attribute in the connection request instruction is a right ear attribute, establishing connection between the right earphone and the BLE host.
Further, the step of receiving the audio data packet sent by the BLE host includes:
and the target slave acquires the address of the BLE host and receives the audio data packet sent by the BLE host in the broadcast signal according to the address.
Further, the target slave machine decompresses the audio data packet based on a preset mode and a preset proportion, and the step of generating audio data includes:
the target slave judges whether the receiving of the audio data packet is completed or not;
and if the receiving of the audio data packet is completed, decompressing the audio data packet based on the preset mode and the preset proportion to generate audio data.
Further, the processor 1001 may call a control program stored in the memory 1005 to perform the following operations:
when the BLE host receives original audio data, compressing the original audio data into an audio data packet based on a preset mode and a preset proportion;
the BLE host transmits the audio data packet to a plurality of slaves.
Further, the step of the BLE host transmitting the audio data packet to a plurality of slaves includes:
and the BLE host transmits the audio data packet to a plurality of slaves based on a broadcast signal according to a preset broadcast interval.
In order that the above-described aspects may be better understood, exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be embodied in various forms and should not be 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 scope of the disclosure to those skilled in the art.
In order to better understand the above technical solutions, the following detailed description will refer to the accompanying drawings and specific embodiments.
Referring to fig. 2, fig. 2 is a flow chart of a BLE-based audio sharing method according to a first embodiment of the present invention. In this embodiment, the audio sharing method includes the steps of:
step S10, when a target slave machine which scans a broadcast signal sent by a BLE host machine exists in a plurality of slave machines, the target slave machine is connected with the BLE host machine and receives an audio data packet sent by the BLE host machine;
the audio sharing method based on BLE in this embodiment is applied to a system composed of a BLE host and a plurality of slaves, where the BLE host is a hardware terminal that can receive original audio data and transmit the data in a broadcast signal after processing, the hardware terminal has a receiving port for connecting terminals such as a computer and a network television, and can transmit the broadcast signal to use BLE for communication connection after the slaves scan, and the slaves are a pair of bluetooth headphones. The BLE host computer and the slaves are both provided with BLE (Bluetooth Low Energy, bluetooth low power consumption) modules for supporting the communication connection, and the BLE host computer and the slaves are in communication connection through BLE, so that the function of sharing the audio of the BLE host computer among the slaves is achieved.
Further, the slave comprises a receiving antenna module, which is used for scanning the broadcast signal sent by the BLE host; the slave also comprises a display screen which is applied to the display of the earphone information and the sent message. The BLE host computer uses a transmitting antenna module arranged inside the BLE host computer to transmit broadcast signals to a plurality of slaves based on a preset broadcast interval; wherein the channel transmitted is preset by the bluetooth protocol, preferably 37, 38 and 39 channels. A plurality of slaves scan in 37, 38 and 39 channels specified by the Bluetooth protocol based on internally arranged receiving antenna modules; in addition, the broadcast signal sent by the BLE host carries a BLE host device name, which can be identified by a device identification flag, such as device identification flag a. After a plurality of slaves start scanning, judging whether a broadcast signal scanned by the slaves to the name of the BLE host computer equipment containing the equipment identification mark A exists in the slaves, and when the fact that the slaves scan to the broadcast signal carrying the name of the BLE host computer equipment containing the equipment identification mark A exists is detected, judging the slaves scanned to the broadcast signal as target slaves. The target slave displays the BLE host machine equipment name containing the equipment identification mark A on a display screen so that a user can select the equipment name. When receiving a connection request instruction sent by a user selecting a device name, the target slave establishes connection with the BLE host and receives audio data sent by the BLE host.
Step S20, the target slave machine decompresses the audio data packet based on a preset mode and a preset proportion to generate audio data;
furthermore, the BLE host and the target slave are both provided with audio codecs, which are respectively applied to compress the received audio data and decompress the audio data packets. The audio codec may be an OPUS audio codec, or may be an AAC (Advanced Audio Coding ) audio codec, but compared to an AAC audio codec, the OPUS codec has a lower damage degree to audio data during compression, and can make the audio data decompressed from the audio data packet more similar to the original audio data, so that the OPUS audio codec is preferred in this embodiment. In addition, the preset ratio for compression and decompression is set in advance according to the requirement, and may be nine-to-one, ten-to-one, eleven-to-one, etc., and the present embodiment is preferably ten-to-one because the ten-to-one ratio produces better benefits in the compression and decompression process than the other ratios.
It is understandable that, in order to ensure the integrity of the target slave to decompress the audio data packet, before decompressing according to the preset mode and the preset proportion, it is determined whether the receiving of the audio data packet is completed, and if the receiving is completed, the decompression is performed. Specifically, when the OPUS audio codec decompresses the received audio data packet, the preset ratio is called to decompress the audio data packet by the preset ratio, so as to generate audio data that can be played.
Step S30, the target slave plays the audio data;
further, the target slave is provided with a built-in power amplifier module for playing the audio data. In addition, the target slave machine is also provided with a control switch module, specifically, the control switch module comprises a button switch, when the button switch is pressed, the playing of the audio data is paused, when the button switch is pressed in the paused state, the playing of the audio data is resumed, and the playing state of the audio data is controlled.
Furthermore, in order to realize better audio playing, the target slave is further provided with an audio processor module, so that the audio data decompressed by the audio codec is processed by input gain control, input equalization adjustment, input end delay adjustment, input polarity conversion and the like, and higher playing tone quality is obtained, so that a user has better listening experience.
In this embodiment, after one or more slaves scan a broadcast signal sent by a BLE master, the slaves that scan the broadcast signal are determined as target slaves, and the target slaves connect to the BLE master and receive audio packets. After the target slave is connected to the BLE host, the audio data packet is decompressed and the audio data is played in a preset mode and proportion, so that the situation that the BLE host is directly connected in a scanning mode without pairing to obtain the played audio data is realized. Meanwhile, a plurality of target slaves can be connected with the BLE master at the same time to play audio data, so that audio sharing is realized. In addition, the target slave and the BLE host are in communication connection through BLE, and the power consumption of the target slave is lower than that of TWS earphone or classical Bluetooth earphone.
Further, referring to fig. 3, a first embodiment of a BLE-based audio sharing method according to the present invention is provided, in which the target slave is connected to the BLE host, and the step of receiving an audio data packet sent by the BLE host includes:
step S11, the target slave displays a device name corresponding to the preset mark on a display screen of the target slave, wherein the device name is the name of the BLE host;
in step S12, when the target slave receives the connection request instruction sent based on the displayed device name, the connection between the target slave and the BLE host is established, and an audio data packet sent by the BLE host is received.
In this embodiment, when a broadcast signal is scanned, the target slave displays the device name with the preset flag on the display screen, where the device name is the name set by the BLE host, so that the user can select the device name through display on the display screen, and send a connection request instruction to connect the target slave and the BLE host. And once the target slave receives a connection request instruction selected to be sent by a user, establishing connection with the BLE host and receiving an audio data packet. It should be noted that, the target slave includes a left earphone and a right earphone, and can be connected with the BLE host independently, so that when the target slave receives a connection request instruction sent based on the displayed device name, the step of establishing connection between the target slave and the BLE host includes:
step S121, when the target slave receives a connection request instruction sent based on the displayed equipment name, judging the earphone attribute in the connection request instruction;
step S122, if the earphone attribute in the connection request instruction is a left ear attribute, establishing connection between the left earphone and the BLE host;
step S123, if the earphone attribute in the connection request instruction is a right ear attribute, establishing connection between the right earphone and the BLE host.
Further, the left earphone and the right earphone included in the target slave are both provided with earphone attributes, specifically, the left earphone attribute contains a recognition mark L of the left earphone, and the right earphone attribute contains a right earphone recognition mark R. And when the target slave receives a connection request instruction sent based on the displayed equipment name, judging the earphone attribute in the connection request instruction. If the earphone attribute in the connection request instruction contains a recognition mark L of the left earphone, establishing connection between the left earphone and the BLE host; if the earphone attribute in the connection request instruction contains the identification mark R of the right earphone, the connection between the right earphone and the BLE host is established. After the target slave establishes a connection with the BLE host, the left earphone and the right earphone in the target slave will display an icon L and an icon R on the display screen, respectively, indicating that a connection has been established with the BLE host.
Further, after connection is established, the target slave acquires the address of the BLE host, and the subsequent target slave only receives an audio data packet sent by the BLE host through the address in a broadcast signal; when the BLE host reads and receives updated audio data from the terminal device, the target slave will automatically receive updated audio data packets.
In the embodiment, the left earphone and the right earphone of the slave are respectively and independently connected with the BLE host, so that in order to ensure that the right earphone and the left earphone have selected correct attributes, a user can select attribute information with earphone identification marks, and the same frequency of the right earphone and the left earphone is realized; specifically, when a connection request instruction sent based on a displayed device name is received, the earphone attribute in the connection request instruction of the target slave is judged, so that the BLE host can accurately connect to the left earphone and the right earphone. After connection with the BLE host is established, the target slave acquires the address of the BLE host, and only the audio data packet sent by the BLE host through broadcast signals is received through the address, so that repeated scanning and receiving actions are avoided.
Further, referring to fig. 4, fig. 4 is a flow chart of a BLE-based audio sharing method according to a third embodiment of the present invention. In this embodiment, the audio sharing method includes the steps of:
step S40, when the BLE host receives the original audio, the original audio is compressed into an audio data packet based on a preset mode and a preset proportion;
in this embodiment, a receiving port is set in the BLE host, the BLE host is connected with a terminal device such as a computer and a network television through the receiving port, and is used for reading and receiving original audio data in the terminal device, after the BLE host completes the receiving work of the original audio data, the received original audio data is compressed by using an OPUS audio codec set by the BLE host according to a preset proportion, and an audio data packet is generated.
Step S50, the BLE host transmits the audio data packet to a plurality of slaves;
the BLE host includes a transmitting antenna module, specifically, applied to transmitting broadcast signals; based on a preset broadcast interval, the BLE host uses a transmitting antenna module arranged by the BLE host to transmit broadcast signals to a plurality of slaves in 37, 38 and 39 channels specified by a Bluetooth protocol, wherein the broadcast signals consist of audio data packets and BLE host equipment names containing FLAG marks which are convenient for users to identify, so that the slaves scan the broadcast signals in the channels at different times, receive the audio data packets and realize sharing.
In this embodiment, when the BLE host receives the original audio data, the original audio data is compressed into an audio data packet according to a preset ratio based on an OPUS codec; the BLE host transmits the audio data packet to a plurality of slaves in the form of a broadcast signal, so that low-power transmission of the BLE-based audio sharing system is realized. The BLE host transmits the audio data packet to a plurality of slaves, and the slaves can be simultaneously connected with the BLE host to play the audio data.
Referring to fig. 5, fig. 5 is a first embodiment and a second embodiment of a BLE-based audio sharing method according to the present invention, and a fourth embodiment of the BLE-based audio sharing method according to the present invention is proposed, in which, to ensure the security of operation, a security verification mechanism is introduced, and the execution of the security verification mechanism includes the following:
when the display screen of the target slave receives a wake-up instruction for waking up the display screen, detecting an execution main body of the wake-up instruction to judge whether the execution main body is a conductor, namely a substance which is easy to conduct current, and if the execution main body is the conductor, performing the next judgment; otherwise, refusing to execute the wake-up instruction. After the execution main body is judged to be a conductor, judging the wake-up instruction sent by the display screen of the target slave machine again, and executing the wake-up instruction for waking up the display screen if the wake-up instruction is continuously executed twice within 2 seconds or continuously executed for 3 seconds or more; otherwise, the received wake-up instruction is determined to be the false touch operation, and execution of the wake-up instruction is refused.
The target slave is internally provided with an administrator information input interface for identifying an administrator. When a user enters the manager information input interface of the target slave machine for the first time, the target slave machine displays information prompting the user to input fingerprints on a display screen; after the first fingerprint input operation instruction of the user is received, information for reminding the user to input the fingerprint again is displayed on a display screen, and when the second fingerprint input operation instruction of the user is received, the user is identified as a manager of the target slave machine. In the subsequent use process, in order to prevent the malicious disconnection of the target slave machine and the BLE host machine, which are executed by a non-manager, when the target slave machine receives a disconnection instruction for connecting the target slave machine and the BLE host machine based on the display screen display, judging whether a user sending the instruction is a manager, specifically judging that the fingerprint of the user belongs to the user, if the fingerprint of the user belongs to the manager, executing the disconnection instruction, and disconnecting the target slave machine and the BLE host machine; otherwise, refusing to execute the disconnection instruction.
Further, when the target slave receives the instruction selected by the user to send, judging the duration of executing the instruction, if the duration of executing the instruction is more than or equal to 8 seconds, executing the shutdown instruction, otherwise, executing the instruction selected by the user to send based on the display screen.
According to the embodiment, the information verification is prompted to the operator by judging the wake-up and other operation instructions sent by the display screen of the target slave machine, so that the situation of operation performed by a non-manager and the generation of false touch instructions are avoided, and the safe use of all the target slave machines by the manager is facilitated.
Furthermore, the present invention provides a computer readable storage medium storing a control program for execution by a processor and implementing the steps of the BLE-based audio sharing method as described in all the embodiments above.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or system. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or system that comprises the element.
The foregoing embodiment numbers of the present invention are merely for the purpose of description, and do not represent the advantages or disadvantages of the embodiments.
From the above description of the embodiments, it will be clear to those skilled in the art that the above-described embodiment method may be implemented by means of software plus a necessary general hardware platform, but of course may also be implemented by means of hardware, but in many cases the former is a preferred embodiment. Based on such understanding, the technical solution of the present invention may be embodied essentially or in a part contributing to the prior art in the form of a software product stored in a storage medium (e.g. ROM/RAM, magnetic disk, optical disk) as described above, comprising instructions for causing a terminal device (which may be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to perform the method according to the embodiments of the present invention.
The foregoing description is only of the preferred embodiments of the present invention, and is not intended to limit the scope of the invention, but rather is intended to cover any equivalents of the structures or equivalent processes disclosed herein or in the alternative, which may be employed directly or indirectly in other related arts.
It will be appreciated by those skilled in the art that embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
It should be noted that in the claims, any reference signs placed between parentheses shall not be construed as limiting the claim. The word "comprising" does not exclude the presence of elements or steps not listed in a claim. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. The invention may be implemented by means of hardware comprising several distinct elements, and by means of a suitably programmed computer. In the unit claims enumerating several means, several of these means may be embodied by one and the same item of hardware. The use of the words first, second, third, etc. do not denote any order. These words may be interpreted as names.
While preferred embodiments of the present invention have been described, additional variations and modifications in those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. It is therefore intended that the following claims be interpreted as including the preferred embodiments and all such alterations and modifications as fall within the scope of the invention.
It will be apparent to those skilled in the art that various modifications and variations can be made to the present invention without departing from the spirit or scope of the invention. Thus, it is intended that the present invention also include such modifications and alterations insofar as they come within the scope of the appended claims or the equivalents thereof.

Claims (7)

1. The Bluetooth low energy BLE-based audio sharing method is characterized by comprising the following steps of:
when a target slave machine which scans to a broadcast signal carrying a BLE host machine equipment name containing an equipment identification mark A exists in a plurality of slave machines, the target slave machine is connected with the BLE host machine through BLE communication, and an audio data packet sent by the BLE host machine is received through a BLE communication connection mode;
the OPUS audio codec set by the BLE host compresses the original audio data according to a preset proportion to generate an audio data packet;
the target slave machine decompresses the audio data packet based on a preset mode and a preset proportion to generate audio data;
the target slave plays the audio data;
the target slave machine is connected with the BLE host machine through BLE communication, and the receiving of the audio data packet sent by the BLE host machine through the BLE communication connection mode comprises the following steps:
the target slave displays a device name corresponding to the preset mark on a display screen of the target slave, wherein the device name is the name of the BLE host;
when the target slave receives a connection request instruction sent based on the displayed equipment name, establishing connection between the target slave and the BLE host, acquiring an address of the BLE host by the target slave, and receiving the audio data packet sent by the BLE host in the broadcasting signal according to the address;
wherein the connection request instruction is a connection request instruction transmitted based on a BLE host set name selected by a user on a display screen.
2. The BLE-based audio sharing method of claim 1, wherein the target slave comprises a left earpiece and a right earpiece; the step of establishing connection between the target slave and the BLE host when the target slave receives a connection request instruction sent based on the displayed device name includes:
when the target slave receives a connection request instruction sent based on the displayed equipment name, judging the earphone attribute in the connection request instruction;
if the earphone attribute in the connection request instruction is a left ear attribute, establishing connection between the left earphone and the BLE host;
and if the earphone attribute in the connection request instruction is a right ear attribute, establishing connection between the right earphone and the BLE host.
3. The BLE-based audio sharing method according to any one of claims 1-2, wherein an OPUS audio codec set by a BLE host compresses raw audio data at a preset ratio to generate an audio data packet, and the target slave decompresses the audio data packet based on a preset manner and a preset ratio, and the generating audio data step includes:
the target slave judges whether the receiving of the audio data packet is completed or not;
and if the receiving of the audio data packet is completed, decompressing the audio data packet based on the preset mode and the preset proportion to generate audio data.
4. A BLE-based audio sharing method, wherein the steps of the BLE-based audio sharing method include:
when the BLE host receives original audio data, compressing the original audio data into an audio data packet based on a preset mode and a preset proportion;
the BLE host transmits the audio data packet to a plurality of slaves in a BLE communication connection mode;
the slave displays a device name corresponding to the preset mark on a display screen of the slave, wherein the device name is the name of the BLE host;
when the slave receives a connection request instruction sent based on the displayed equipment name, establishing connection between the slave and the BLE host, acquiring an address of the BLE host by the slave, and receiving the audio data packet sent by the BLE host by the broadcasting signal according to the address;
wherein the connection request instruction is a connection request instruction transmitted based on a BLE host set name selected by a user on a display screen.
5. The BLE-based audio sharing method of claim 4, wherein the step of the BLE host transmitting the audio data packets to a plurality of slaves comprises:
and the BLE host transmits the audio data packet to a plurality of slaves based on a broadcast signal according to a preset broadcast interval.
6. A BLE-based audio sharing system, comprising a BLE master and a plurality of slaves, comprising a processor, a memory storing a control program, the control program being executed by the processor and implementing the steps of the BLE-based audio sharing method according to any of claims 1-5.
7. A computer readable storage medium storing a control program for execution by a processor and implementing the steps of the BLE-based audio sharing method according to any one of claims 1-5.
CN201911387711.8A 2019-12-26 2019-12-26 BLE-based audio sharing method, system and computer readable storage medium Active CN111132111B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911387711.8A CN111132111B (en) 2019-12-26 2019-12-26 BLE-based audio sharing method, system and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911387711.8A CN111132111B (en) 2019-12-26 2019-12-26 BLE-based audio sharing method, system and computer readable storage medium

Publications (2)

Publication Number Publication Date
CN111132111A CN111132111A (en) 2020-05-08
CN111132111B true CN111132111B (en) 2023-12-22

Family

ID=70505995

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911387711.8A Active CN111132111B (en) 2019-12-26 2019-12-26 BLE-based audio sharing method, system and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN111132111B (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112423053B (en) * 2020-11-06 2024-04-09 歌尔科技有限公司 Audio sharing method, system, remote controller and computer readable storage medium
CN112689320B (en) * 2020-12-25 2023-04-11 杭州当贝网络科技有限公司 Power consumption optimization method and system for 2.4G wireless audio system and readable storage medium
CN113301544B (en) * 2021-04-09 2022-05-03 荣耀终端有限公司 Method and equipment for voice intercommunication between audio equipment
CN113645573B (en) * 2021-07-22 2023-06-09 深圳市冠旭电子股份有限公司 Headset configuration data sharing method, headset and storage medium
CN115278624A (en) * 2022-07-21 2022-11-01 Oppo广东移动通信有限公司 Information updating method and device, audio sharing method and system and electronic equipment
CN115665671A (en) * 2022-09-16 2023-01-31 Oppo广东移动通信有限公司 Audio data sharing method and device, electronic equipment and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2018169380A1 (en) * 2017-03-17 2018-09-20 엘지전자(주) Method and apparatus for processing audio signal by using bluetooth technology
CN109474969A (en) * 2018-12-19 2019-03-15 苏芯物联技术(南京)有限公司 Mixed communication method and system based on IEEE 802.15.4 and low-power consumption bluetooth dual stack
CN109547946A (en) * 2018-11-02 2019-03-29 南京中感微电子有限公司 A kind of voice data communication method
WO2019108782A1 (en) * 2017-12-01 2019-06-06 Bose Corporation Wireless low-latency audio content sharing
CN110149568A (en) * 2019-05-30 2019-08-20 歌尔科技有限公司 A kind of bluetooth headset and communication means, system, electronic equipment, computer media

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105101148A (en) * 2014-05-05 2015-11-25 中兴通讯股份有限公司 Screen and operation control sharing method, system and main sharing end
US9693127B2 (en) * 2014-05-14 2017-06-27 Samsung Electronics Co., Ltd Method and apparatus for communicating audio data
US20170208639A1 (en) * 2016-01-15 2017-07-20 Lg Electronics Inc. Method and apparatus for controlling a device using bluetooth technology
CN108111953B (en) * 2017-12-21 2020-04-07 广东小天才科技有限公司 Audio sharing method and system based on TWS earphone and TWS earphone
US10299300B1 (en) * 2018-05-16 2019-05-21 Bose Corporation Secure systems and methods for establishing wireless audio sharing connection

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2018169380A1 (en) * 2017-03-17 2018-09-20 엘지전자(주) Method and apparatus for processing audio signal by using bluetooth technology
WO2019108782A1 (en) * 2017-12-01 2019-06-06 Bose Corporation Wireless low-latency audio content sharing
CN109547946A (en) * 2018-11-02 2019-03-29 南京中感微电子有限公司 A kind of voice data communication method
CN109474969A (en) * 2018-12-19 2019-03-15 苏芯物联技术(南京)有限公司 Mixed communication method and system based on IEEE 802.15.4 and low-power consumption bluetooth dual stack
CN110149568A (en) * 2019-05-30 2019-08-20 歌尔科技有限公司 A kind of bluetooth headset and communication means, system, electronic equipment, computer media

Also Published As

Publication number Publication date
CN111132111A (en) 2020-05-08

Similar Documents

Publication Publication Date Title
CN111132111B (en) BLE-based audio sharing method, system and computer readable storage medium
CN108174457B (en) Charging box, communication system and communication method of Bluetooth headset
CN107911437B (en) Screen sharing method and device, electronic equipment and storage medium
CN109445741B (en) Data transmission method and device, electronic equipment and storage medium
US10567900B2 (en) Audio system, audio device, and audio device setting method
US10425758B2 (en) Apparatus and method for reproducing multi-sound channel contents using DLNA in mobile terminal
CN109450851B (en) Device connection method, electronic device, and computer-readable medium
CN110830970B (en) Audio transmission method, device, equipment and storage medium between Bluetooth equipment
EP2995089B1 (en) Unpaired devices
CN109379490B (en) Audio playing method and device, electronic equipment and computer readable medium
CN111462746B (en) TWS earphone-based control method, system, device and equipment
WO2023284454A1 (en) Bluetooth connection prompting method and apparatus, device, storage medium, and program product
US10306366B2 (en) Audio system, audio device, and audio signal playback method
CN113470668B (en) Display device adjusting Bluetooth method for setting A2DP (analog to digital) codes
CN111199743A (en) Audio coding format determining method and device, storage medium and electronic equipment
CN114786139A (en) Connection establishing method, device, equipment, storage medium and program product
CN107948904A (en) The method, apparatus and computer-readable recording medium of speaker degradation
CN115915081A (en) Audio output channel switching control method, intelligent terminal and storage medium
CN115884186A (en) Wireless intercom system
CN108353255B (en) PTT communication method and apparatus through multiple PTT channels
CN115665671A (en) Audio data sharing method and device, electronic equipment and storage medium
WO2014180233A1 (en) Method and device for realizing resource sharing and terminal
CN113407147A (en) Audio playing method, device, equipment and storage medium
CN115209510B (en) Wireless network connection method and device, electronic equipment and storage medium
CN116489629B (en) Bluetooth audio data transmission method, device, equipment and 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