CN113207114B - Bluetooth audio master device, bluetooth audio slave device, bluetooth communication method and Bluetooth communication system - Google Patents

Bluetooth audio master device, bluetooth audio slave device, bluetooth communication method and Bluetooth communication system Download PDF

Info

Publication number
CN113207114B
CN113207114B CN202110489177.2A CN202110489177A CN113207114B CN 113207114 B CN113207114 B CN 113207114B CN 202110489177 A CN202110489177 A CN 202110489177A CN 113207114 B CN113207114 B CN 113207114B
Authority
CN
China
Prior art keywords
message
audio
forwarded
bluetooth
serial number
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
CN202110489177.2A
Other languages
Chinese (zh)
Other versions
CN113207114A (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.)
Nanjing Xijueshuo Information Technology Co ltd
Original Assignee
Nanjing Xijueshuo Information Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Nanjing Xijueshuo Information Technology Co ltd filed Critical Nanjing Xijueshuo Information Technology Co ltd
Priority to CN202110489177.2A priority Critical patent/CN113207114B/en
Publication of CN113207114A publication Critical patent/CN113207114A/en
Application granted granted Critical
Publication of CN113207114B publication Critical patent/CN113207114B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

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
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/08Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
    • H04L43/0823Errors, e.g. transmission errors
    • H04L43/0829Packet loss
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W40/00Communication routing or communication path finding
    • H04W40/02Communication route or path selection, e.g. power-based or shortest path routing
    • 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

Abstract

The invention relates to the field of wireless communication, in particular to a Bluetooth audio master device, a Bluetooth audio slave device, a Bluetooth communication method and a Bluetooth communication system. The master equipment has a first working period and a second working period which are synchronously switched with the slave equipment, and in the first working period, the master equipment receives an audio message from the sound source equipment; in the second working period, the master device receives a forwarding request which is sent by the slave device and generated according to the loss condition of the audio message counted in the first working period, determines the audio message to be forwarded based on the forwarding request, and forwards the audio message to be forwarded to the slave device. The invention ensures that the main equipment can acquire the actual packet loss situation according to the forwarding request in the second working period and finish the forwarding of all messages, thereby avoiding the increase of communication traffic caused by initiating the forwarding request for many times, reducing the unavailable time period, shortening the time of packet loss forwarding interaction, reducing the communication delay and further improving the actual available communication bandwidth.

Description

Bluetooth audio master device, bluetooth audio slave device, bluetooth communication method and Bluetooth communication system
Technical Field
The invention relates to the field of wireless communication, in particular to a Bluetooth audio master device, a Bluetooth audio slave device, a Bluetooth communication method and a Bluetooth communication system.
Background
Currently, bluetooth audio devices and related bluetooth audio technology, represented by bluetooth headsets, bluetooth speakers, bluetooth car systems, are changing the way we consume media.
In a stereo bluetooth audio device system supporting spatial distribution, or in a left-and-right ear-separated bluetooth headset, two or more bluetooth audio devices are required to receive an audio stream for playback. At present, the mainstream bluetooth audio playing mode is mainly a forwarding mode or a monitoring mode.
The forwarding mode can only be one of several bluetooth audio devices as a bluetooth audio master device (referred to as a master device for short) and another or other bluetooth audio slave devices (referred to as slave devices for short), the timing and rate of bluetooth communication are determined by the bluetooth audio master device, and meanwhile, when the bluetooth audio master device receives an audio message from an audio source device, the bluetooth audio master device is used as a slave device of the audio source device. However, the audio device (such as a smart phone or a PC providing audio) usually needs to process wireless communication data such as wifi or other more complex tasks, which results in low efficiency of bluetooth communication; and after the bluetooth audio master device receives the audio messages, each message must be forwarded to other bluetooth audio slave devices. This results in high power consumption of the bluetooth audio master device and unbalanced power consumption of the master and slave devices, thereby causing a problem in terms of ease of use.
The listening mode is usually that both the bluetooth audio master device and the bluetooth audio slave device listen to the audio message sent by the audio source device, but only one of the bluetooth audio devices (i.e. the bluetooth audio master device) establishes a real connection with the mobile phone, and the other one or more bluetooth audio devices (i.e. the bluetooth audio slave devices) are in a listening mode. Because the message forwarding from the Bluetooth audio master device to the Bluetooth audio slave device is greatly reduced, the power consumption of the master device can be reduced by the mode; however, if only the monitoring mode is used, the communication between the master device and the slave device is difficult, so that the functions of audio playing synchronization, volume synchronization and the like between the master device and the slave device are difficult to realize; if a communication flow is added between the master device and the slave device, the packet sent by the sound source device cannot be monitored during the communication between the master device and the slave device, so that packet loss is caused, retransmission is triggered, and communication efficiency is reduced or the communication is blocked under the condition that the retransmission is more.
Therefore, the common practice in the industry is to combine the monitoring mode with the forwarding mode, and the message lost by the monitoring mode is obtained by the forwarding mode, so as to fully utilize the advantages of the two modes. According to the scheme, under the scene of synchronous playing of the master equipment and the slave equipment, the time delay of synchronous playing is determined by the time delay of the music message received by the forwarding mode.
According to the specifications of the bluetooth specification, the bluetooth architecture generally includes three major parts, a host, a controller, and an HCI interface (host control interface). The controller is a bottom layer of the whole protocol stack and comprises a Bluetooth Baseband module (Bluetooth Baseband) and a Bluetooth radio frequency module (Bluetooth RF), and the controller is used for receiving and transmitting radio signals; the HCI interface provides a command interface of a baseband and a link manager and an access interface of hardware configuration parameters, and is provided with an HCI buffer queue, and the host is positioned at the upper layer of the HCI interface and comprises a logical link control and adaptation protocol (L2 CAP), an Audio Video Distribution Transmission Protocol (AVDTP), an encryption/decryption protocol (optional), an encoding/decoding protocol and the like, so that the complex functions of the Bluetooth device are realized based on the protocols.
Fig. 1 is a schematic block diagram of a sound source device and a bluetooth audio master device (or bluetooth audio slave device) in the prior art, so as to illustrate a bluetooth audio message transmission and processing process; the audio message sent by the sound source equipment is sent to the outside by a Bluetooth baseband module and a Bluetooth radio frequency module through the HCI interface in a host control and protocol processing unit on the upper layer in sequence through a coding protocol, an encryption protocol, an audio and video distribution transmission protocol, a logic link control and an adaptation protocol, correspondingly, the audio message is received by the Bluetooth audio master equipment (or the Bluetooth audio slave equipment), the reverse process of the process is adopted, and the analyzed audio message is stored in a cache unit after the upper layer protocol analyzes the message. And the Bluetooth audio slave device also judges whether the messages are lost, the number of the lost messages and the serial numbers of the lost messages by calculating whether the serial numbers between two continuous audio messages in the cache unit are continuous, and then sends a forwarding request to the lost messages to request the sound source device or the Bluetooth audio master device to forward the lost audio messages to the slave device.
For the bluetooth audio slave device, because the audio message passes through the HCI buffer queue and the buffer unit twice buffer process after the upper layer protocol is decoded, the whole audio message transmission process has a large delay, so that the playing delay of the audio message is large, and the slave device sends a forwarding request once when finding a packet loss, so that the communication volume of forwarding interaction is large, and the communication efficiency among the sound source device, the bluetooth audio master device and the bluetooth audio slave device is greatly influenced.
Disclosure of Invention
The invention overcomes at least one defect and provides a Bluetooth audio master device, a Bluetooth audio slave device, a Bluetooth communication method and a Bluetooth communication system.
The technical scheme adopted by the invention for solving the technical problem is as follows:
a bluetooth communication method, a master device having a first duty cycle and a second duty cycle that are switched in synchronization with a slave device, wherein:
in the first working period, the master device receives audio messages from the sound source device based on the first piconet;
during the second duty cycle:
the master device receives a forwarding request sent by a slave device based on a second piconet, the forwarding request is generated by the slave device according to the loss condition of the audio message counted in the first work period, the forwarding request comprises a first type parameter and/or a second type parameter, the first type parameter at least comprises the information of the slave device requesting to forward the message, and the second type parameter at least comprises the information of the last audio message received by the slave device,
the main device determines the audio message to be forwarded based on the forwarding request, and the determining includes: the master equipment acquires the serial number of a slave equipment request forwarding message according to the first type of parameter, and/or acquires the serial number of a master equipment reissue message according to the second type of parameter, the master equipment determines the audio message to be forwarded according to the serial number of the slave equipment request forwarding message and/or the serial number of the master equipment reissue message,
and forwarding the audio message to be forwarded to the slave equipment.
Further, the first type parameter may include a serial number of a request for forwarding a packet from a device;
the second type of parameter comprises a serial number of a last audio message received by the slave device;
in the second working period, the acquiring, by the master device, the sequence number of the supplementary message sent by the master device according to the second type of parameter includes: and determining whether one or more audio messages lost by the slave equipment exist after the audio message received by the slave equipment for the last time according to the serial number of the last audio message received by the slave equipment in the second-class parameters and the serial number of the audio message received by the master equipment, and if so, taking the serial numbers of the one or more audio messages as the serial number of the retransmission message of the master equipment.
Further, after receiving the audio message from the sound source device, the master device may further include, based on predetermined message structure information, parsing the audio message to obtain a serial number of the received audio message;
in the second working period, the master device determines the serial number of the message to be forwarded according to the serial number of the message requested to be forwarded by the slave device and/or the serial number of the message reissued by the master device; and acquiring the corresponding audio message as the audio message to be forwarded according to the serial number of the message to be forwarded and the serial number of the received audio message, and forwarding the audio message.
Further, a sequence number table of the forwarded audio message may be stored in the main device; the master device determines the serial number of the message to be forwarded according to the serial number of the message requested to be forwarded by the slave device, specifically, the serial number is
When the forwarding request comprises a first type parameter, the master equipment inquires whether the serial number of the message requested to be forwarded by the slave equipment is in the serial number table of the forwarded audio message, and if not, the master equipment determines that the serial number is the serial number of the message to be forwarded;
when the forwarding request comprises a second type of parameter, inquiring one by one whether N serial numbers after the serial number of the last audio message are in a serial number table of the forwarded audio message, and if not, determining that the N serial numbers are the serial numbers of the messages to be forwarded;
after determining the serial number of the message to be forwarded, the main device adds the serial number of the message to be forwarded to the audio message serial number list;
n is a positive integer.
Further, the determining, by the master device, the audio packet to be forwarded based on the forwarding request may further include: the master device adjusts the working duration of the second working period; in particular, the method comprises the following steps of,
the main equipment determines the data volume of the message to be forwarded based on the forwarding request, and adjusts the working duration of a second working period according to the determined data volume of the message; alternatively, the first and second electrodes may be,
and the master equipment determines the data volume of the message requested to be forwarded by the slave equipment and/or the data volume of the message retransmitted by the master equipment based on the first type parameter and/or the second type parameter in the forwarding request, and adjusts the working duration of a second working period according to the determined data volume of the message.
Further, the master device may adjust a working duration of the second working period according to the determined message data amount based on a preset policy table;
the main device inquires the corresponding planned working time length from the strategy table according to the determined message data volume, and adjusts the current working time length of the second working period to the planned working time length.
Further, the forwarding, by the master device, the audio packet to be forwarded to the slave device may further include that the master device generates a third type of parameter and sends the third type of parameter to the slave device, where the third type of parameter is used to indicate that the master device determined by the master device sends the packet information or the audio packet information to be forwarded additionally.
Further, the master device may have a reference clock identical to the slave device and clock a switching time point of the first duty cycle and the second duty cycle with the reference clock to switch between the first piconet and the second piconet when the switching time point arrives;
the first type of parameters can also comprise the number of the messages requested to be forwarded by the slave equipment and/or the data volume of the messages requested to be forwarded;
the third type of parameter may include at least one of a message serial number, a message number, and a message data amount related to the audio message reissued by the master device or the audio message to be forwarded;
the message structure information can comprise the message structure of the audio message and the position information of each parameter in the message;
the main device can load the third type of parameters in the data head of a preset forwarding message;
the message data volume can be obtained by calculation according to the number of messages, the message length and the communication bandwidth;
the sequence number table of the forwarded audio message has a fixed length, the main device can update the sequence number table in a first-in first-out mode, and the main device adds the sequence number of the newly added message to be forwarded to the tail of the sequence number table when updating the sequence number table.
A bluetooth communication method, a slave device having a first duty cycle and a second duty cycle that are switched in synchronization with a master device, wherein:
in the first working period, the slave device counts the loss condition of the audio message received by the slave device, including:
the slave equipment analyzes a serial number from the received audio message containing the serial number based on the predetermined message structure information, judges whether the message is lost or not based on the serial number, and counts the serial number of the lost message when the message is lost;
during the second duty cycle:
the slave device generates a forwarding request according to the audio message loss condition counted in the first working period, and the forwarding request comprises: when the message is lost, the slave equipment loads the information of the lost message as the serial number of the message requested to be forwarded by the slave equipment to a first class parameter, loads the information of the last audio message received by the slave equipment to a second class parameter, generates a forwarding request containing the first class parameter or/and the second class parameter, when the message is not lost, loads the information of the last audio message received by the slave equipment to the second class parameter, generates a forwarding request containing the second class parameter,
transmitting the forwarding request to the master device based on a second piconet;
and receiving the audio message forwarded by the master device based on the second piconet.
Further, in the first working period, the slave device may receive, based on the first piconet, the audio packet sent by the sound source device to the master device, and count a loss condition of the audio packet received by the slave device in the first working period; alternatively, the first and second electrodes may be,
during the first duty cycle, the slave device may count the loss of audio packets from the master device received by the second piconet during a previous second duty cycle.
Further, in the second work cycle, the slave device may also adjust the work duration of the second work cycle; wherein:
the slave equipment adjusts the working duration of a second working period according to the data volume of the message requested to be forwarded, so that the slave equipment can at least complete the audio message which is received from the master equipment and requested to be forwarded by the slave equipment within the adjusted working duration of the second working period; and/or the presence of a gas in the gas,
the slave equipment acquires the data volume of the messages retransmitted by the master equipment or the data volume of the messages to be forwarded by the master equipment according to the third type of parameters from the master equipment so as to adjust the working time of the second working period, so that the slave equipment can at least finish receiving all the audio messages forwarded by the master equipment within the adjusted working time of the second working period;
the third type of parameter is used for indicating the main equipment determined by the main equipment to resend the message information or the audio message information to be forwarded.
Further, the slave device may adjust a working duration of the second working period according to the acquired packet data amount based on a preset policy table;
the slave device inquires the corresponding planned working time length from the strategy table after acquiring the message data volume, and adjusts the current working time length of the second working period to the planned working time length.
Further, in the first working period, the slave device counts the loss condition of the audio message received by the slave device, and
in the second working period, generating a forwarding request according to the loss condition of the audio message counted in the first working period, and/or analyzing the message from the main equipment to obtain the third type of parameters,
can be realized by a controller module used for carrying out Bluetooth audio bottom layer control based on the slave equipment;
the message data volume can be obtained by calculation according to the number of messages, the message length and the communication bandwidth;
the data volume of the message requested to be forwarded can be calculated by the slave device when the slave device counts the condition of receiving the audio message;
the first type of parameters may include a serial number of a slave device requesting to forward a packet, the number of the slave device requesting to forward the packet, and/or a data volume of the request to forward the packet;
the second type of parameter may include a sequence number of a last audio packet received by the slave device;
the third type of parameter may include at least one of a message serial number, a message number, and a message data amount related to an audio message reissued by the host device or an audio message to be forwarded;
the message structure information may include the message structure of the audio message and the position information of each parameter in the message.
A Bluetooth audio slave device comprises a host module for realizing Bluetooth audio upper layer control and a controller module for carrying out Bluetooth audio bottom layer control and realizing radio signal transceiving based on a Bluetooth wireless communication protocol,
the Bluetooth audio slave device is provided with a first work cycle and a second work cycle which are synchronously switched with the Bluetooth audio master device;
the controller module is further configured to count a loss condition of the received audio packet in the first working period, and the controller module includes a bluetooth audio packet parsing unit, where the bluetooth audio packet parsing unit is configured to parse a serial number from an audio packet including the serial number received by the controller module based on predetermined packet structure information, determine whether the packet is lost based on the serial number, and count the serial number of the lost packet when the packet is lost;
the controller module is further configured to generate a forwarding request according to a loss condition of the received audio packet counted in the first working period in the second working period, and when a packet is lost, the controller module loads information of the lost packet as information of a slave device requesting to forward the packet to a first-class parameter, loads information of a last audio packet obtained by parsing by the bluetooth audio packet parsing unit to a second-class parameter, generates a forwarding request including the first-class parameter and the second-class parameter, and when a packet is not lost, loads information of the last audio packet to the second-class parameter, generates a forwarding request including the second-class parameter, and sends the forwarding request to the bluetooth audio master device;
and receiving the audio message forwarded by the Bluetooth audio master device.
Further, the host module can be used for negotiating with a communication opposite terminal in advance to determine message structure information of the bluetooth audio message;
the Bluetooth audio message analysis unit acquires the message structure information from the host module;
the bluetooth audio message parsing unit may be disposed in a bluetooth baseband module in the controller module.
A Bluetooth audio master device comprises a host module for realizing Bluetooth audio upper layer control and a controller module for carrying out Bluetooth audio bottom layer control and realizing radio signal transceiving based on a Bluetooth wireless communication protocol, and has a first working period and a second working period which are synchronously switched with slave devices, wherein:
in the first working period, the Bluetooth audio master device receives audio messages from sound source devices based on a first piconet;
during the second period of time of the operation,
the Bluetooth audio master device receives a forwarding request sent by a Bluetooth audio slave device based on a second piconet, the forwarding request is generated by the Bluetooth audio slave device based on the loss condition of audio messages received by the Bluetooth audio slave device counted in the first work period, the forwarding request comprises a first type parameter and/or a second type parameter, the first type parameter at least comprises the information of the slave device requesting to forward the messages, and the second type parameter at least comprises the information of the last audio message received by the slave device,
the bluetooth audio master device determines an audio message to be forwarded based on the forwarding request, and the determining includes: the master equipment acquires the serial number of a message requested to be forwarded by the slave equipment according to the first type of parameters, and/or acquires the serial number of a message retransmitted by the master equipment according to the second type of parameters; and the master equipment determines the audio message to be forwarded according to the serial number of the message requested to be forwarded by the slave equipment and/or the serial number of the message retransmitted by the master equipment, and forwards the audio message to be forwarded to the Bluetooth audio slave equipment.
A Bluetooth communication system comprises the Bluetooth audio slave device and the Bluetooth audio master device, wherein the Bluetooth audio slave device and the Bluetooth audio master device communicate based on the Bluetooth communication method.
The Bluetooth communication method, the Bluetooth communication equipment and the Bluetooth communication system provided by the application and the technical scheme provided by the embodiment have the beneficial effects that at least: the slave device counts the message loss condition in the first working period, and sends a primary forwarding request based on the counted message loss condition in the second working period, and the master device can acquire the actual packet loss condition according to the forwarding request in the second working period and complete all message forwarding, thereby avoiding the increase of communication traffic caused by initiating the forwarding request for many times, reducing the unavailable time period, shortening the time of packet loss forwarding interaction, reducing the communication delay and improving the actual available communication bandwidth.
Drawings
FIG. 1 is a schematic block diagram between an audio source device and a Bluetooth audio device;
FIG. 2 is a topology diagram of a Bluetooth system to which the present invention is applied;
fig. 3 is a signaling diagram of bluetooth communication according to a first embodiment of the present invention;
fig. 4 is a signaling diagram of bluetooth communication according to a second embodiment of the present invention;
FIG. 5 is a time slot diagram of a first communication in accordance with an embodiment of the present invention;
FIG. 6 is a time slot diagram of a second communication in accordance with an embodiment of the present invention;
FIG. 7 is a time slot diagram for a third communication in accordance with an embodiment of the present invention;
FIG. 8 is a time slot diagram for a fourth communication in accordance with an embodiment of the present invention;
fig. 9 is a schematic block diagram of a bluetooth audio slave device according to a fourth embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions of the embodiments of the present application will be clearly and completely described below with reference to the drawings of the embodiments of the present application. It should be apparent that the described embodiments are only some of the embodiments of the present application, and not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the described embodiments of the application without making any creative effort, shall fall within the protection scope of the application.
The terms first, second and the like in the description and in the claims of the present application are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It will be appreciated that the data so used may be interchanged under appropriate circumstances such that embodiments of the application may be practiced in sequences other than those illustrated or described herein, and that the terms "first," "second," and the like are generally used herein in a generic sense and do not limit the number of terms, e.g., the first term can be one or more than one. In addition, "and/or" in the specification and claims means at least one of connected objects, a character "/" generally means that a preceding and succeeding related objects are in an "or" relationship.
In addition, the technical features mentioned in the different embodiments of the present application described below may be combined with each other as long as they do not conflict with each other.
The invention provides a Bluetooth communication method, wherein a master device and a slave device both have a first work cycle and a second work cycle which are synchronously switched. In the first working period, the master device receives audio messages from the sound source device based on the first piconet, and the slave device counts the loss condition of the audio messages received by the slave device; in the second working period, the slave device generates a forwarding request according to the loss condition of the received audio message counted in the first working period and sends the forwarding request to the master device based on a second piconet; the master device receives a forwarding request sent by the slave device, determines an audio message to be forwarded, and forwards the audio message to be forwarded to the slave device based on the second piconet. It is understood that the audio messages described herein may be, but are not limited to, music data messages and voice data messages.
In the application of the invention, because the slave device counts the message loss condition in the first working period (namely the working period of the master device and the sound source device based on the first piconet communication), and the forwarding request is generated based on the statistics, the master device and the slave device can complete the forwarding of the audio message only according to one forwarding request, thereby effectively reducing the communication traffic of forwarding interaction and improving the communication efficiency. Certainly, the present invention has other technical advantages compared to the prior art, and for convenience of description, the technical ideas and beneficial effects of the present invention will be described in detail below with reference to specific application scenarios of a more typical listening mode and a forwarding mode in the prior art.
The application scene one: monitoring mode
In some embodiments, the embodiment of the present invention may be applied to a bluetooth system architecture in a listening mode as shown in fig. 2, which includes an audio source device, a master device, and a slave device, where a bluetooth link is established between the audio source device and the master device to form a first piconet (or piconet1, piconet 1), and after the audio source device starts playing audio, the master device receives and replies an audio message sent by the audio source device in the piconet1 to form interactive communication. Establishing a Bluetooth link between a master device and a slave device to form a second Piconet (or: piconet2, piconet 2), wherein the master device forwards link information of the Piconet1 (Piconet 1) to the slave device through the Bluetooth link of the Piconet2 (Piconet 2), and the link information comprises: a bluetooth address of the sound source device, a random number used in an encryption process, an adaptive frequency hopping table parameter (AFH map), a phase difference (intraburst offset), bluetooth clock information (BT clock), and the like; the slave device establishes a shadow Bluetooth link with the sound source device based on the link information, generates a Bluetooth clock of the Bluetooth link based on the Bluetooth clock information of the sound source device and a fixed time interval for transmitting the information, and generates an encryption and decryption parameter, a Bluetooth frequency hopping table and a phase difference according to the link information of the sound source device; thus, the slave device can normally receive the audio message sent from the sound source device to the master device in the piconet1, monitor the communication between the user terminal and the master device, and also can replace the master device to send the message to the sound source device.
The first embodiment is as follows:
the embodiment is a bluetooth communication method, which has a first work period and a second work period that are cyclically repeated: the master device and the slave device work in a first work period T1 in the piconet1 and work in a second work period T2 in the piconet2, and the master device and the slave device are switched from the piconet1 to the piconet2 every time the master device and the slave device complete the first work clock period T1 of the piconet 1; every time a second operating clock period T2 of piconet2 is executed, a switch is made from piconet2 to piconet 1. The master device alternates between piconet1 and piconet2 and the slave device also alternates between piconet1 and piconet 2. The master device and the slave device both preset the same reference clock, for example, both take the clock information of the piconet1 or the piconet2 as the reference clock, and clock the switching time points of the first duty cycle and the second duty cycle with the reference clock, so as to ensure that the master device and the slave device synchronously switch the piconets. In an initial state, the initial operating time lengths of the first and second operating cycles may be set to T1 respectively 0 And T2 0 Wherein T1 0 And T2 0 The value of (c) can be set as desired. T2 0 It can also be set to a relatively short duration, e.g. T2 can be set 0 Less than T1 0 Or alternatively T2 may be set 0 In order to slightly longer than the time length for the slave device to send a forwarding request to the master device and receive a message from the master device, in a specific embodiment, T1 may be set 0 =30ms,T2 0 =20ms。
As shown in fig. 3, is a signaling diagram of the present embodiment.
At an initial operating time of T1 0 In the first work period T1, the audio device and the master device communicate with each other based on the piconet1, and the slave device listens to the communication between the audio device and the master device based on the piconet 1.
S101: in T1, the main equipment receives an audio message from sound source equipment;
s102: in T1, the slave equipment monitors and receives an audio message from the sound source equipment;
s103: the main equipment analyzes the received audio message based on the predetermined message structure information and acquires the serial number of the audio message;
specifically, after receiving the audio message from the sound source device in the first working period, the master device may cache the audio message, and analyze the audio message based on predetermined message structure information to obtain a serial number of the received audio message.
Sequence numbers are often used in the art to identify audio messages to distinguish between different messages. Therefore, the sequence number obtained in this embodiment may be used for performing packet loss analysis, a packet loss condition and a packet forwarding condition in subsequent steps. It is understood that in other embodiments, other information may be provided to implement the corresponding function instead of the serial number.
S104, the slave device counts the loss condition of the audio message received in the T1;
in a specific embodiment, the slave device analyzes all received audio messages based on predetermined message structure information to obtain serial numbers of the audio messages;
in another specific embodiment, the slave device analyzes the serial number of the audio packet from the received audio packet containing the serial number based on the predetermined packet structure information.
The message structure information may include the message structure of the audio message and the position information of each parameter in the message.
The slave device may obtain the position of the sequence number in each message according to the message structure information. If the audio message is transmitted in fragments, the slave device can accordingly determine whether the current fragment contains the sequence number, and obtain the position of the sequence number in each fragment message. The slave device performs limited analysis on the audio message according to the message structure information to obtain the serial number of the audio message, and only the serial number needs to be analyzed, and all the audio messages do not need to be analyzed.
Further, the slave device judges whether a lost message occurs or not based on the serial number, and if the lost message occurs, the serial number of the lost message is counted. In a specific embodiment, the slave device may further count the number of lost messages and/or the data volume of the message requested to be forwarded, where the data volume of the message may be obtained by calculation according to the number of messages, the length of the message, and the communication bandwidth. For example, the amount of packet data requested to be forwarded = number of lost packets × packet length/communication bandwidth.
In a normal message transmission process, the serial numbers used for identifying the sent messages are continuous, and the serial number is increased by 1 when each message is sent, so that whether the lost message occurs or not and the serial number of the lost message can be judged by checking whether the serial numbers are continuous or not one by one. When the master device and the slave device are timed to a preset first work period T1 0 At the switching time point of 30ms, the master and slave devices are synchronously switched to the piconet2 for communication, and the master and slave devices start to enter the second working period T2 0 Timing of (3).
And S105, in T2, the slave device generates a forwarding request according to the loss condition of the audio message counted in the first work period, and sends the forwarding request to the master device based on the piconet 2. The master device receives the forwarding request.
The slave equipment generates a first type parameter containing information of the slave equipment requesting to forward the message and/or a second type parameter containing information of the last audio message received by the slave equipment according to the statistical loss condition of the audio message.
In some specific embodiments, when the slave device loses a packet, at least a sequence number of the lost packet is loaded to the first type of parameter as a sequence number of a packet requested to be forwarded by the slave device to generate a forwarding request including the first type of parameter, so as to request the master device to forward the lost packet statistically obtained by the slave device. In other embodiments, the serial number of the last audio packet received from the device may be loaded to the second type parameter, so as to generate a forwarding request including the first type parameter and the second type parameter, so that the master device may help check whether there is a loss after the last audio packet while requesting to forward the packet, and may reissue the packet when the loss occurs. .
And when the message is not lost, the slave equipment loads the serial number of the last audio message received from the slave equipment to the second type of parameters to generate a forwarding request containing the second type of parameters.
In a specific embodiment, the first type of parameter may further include information such as the number of the request to forward packets, and the data size of the request to forward packets.
In a specific embodiment, the slave device may, based on the controller module for performing bluetooth audio underlying control, implement the step S104 of counting the loss of the audio packets received by the slave device in the first working period, and implement the step S105 of generating a forwarding request in the second working period according to the loss of the audio packets counted by the slave device in the first working period.
S106, the slave device adjusts the current working duration of the second working period T2 according to the data volume of the message requested to be forwarded;
if the slave equipment loses the message in the first working period T1, the slave equipment adjusts the working duration of the second working period according to the message data volume forwarded by the request, so that the slave equipment adjusts the adjusted message data volumeAnd at least receiving the audio message requested to be forwarded from the master device can be completed within the working duration of the second working period. In one embodiment, if T2 is to be determined 0 Setting to a shorter duration, the current duration of T2 is adjusted, primarily in such a way as to extend the duration of operation, e.g. by setting the current duration of operation of the second operating cycle to T2 0 Elongation to T2 1
If the slave device determines that the message is not lost in the first working period T1, the slave device may not adjust the current working duration of the second working period in this step.
S107, the main device determines the audio message to be forwarded based on the forwarding request, and adjusts the current working duration of the second working period T2.
In specific implementation, the forwarding request may include the first type of parameter and the second type of parameter, or may include only the second type of parameter or the first type of parameter. The master device obtains the information (such as a serial number) of the message requested to be forwarded by the slave device according to the first type of parameters, so that the message loss information known by the slave device can be obtained; and acquiring the information of the resending message of the master equipment according to the second type of parameters, and determining the unknown lost message information of the slave equipment. Specifically, the master device determines, according to the serial number of the last audio packet received by the slave device in the second-class parameters and the serial number of the audio packet already received by the master device, whether there are one or more audio packets lost by the slave device after the audio packet received by the slave device last time, and if there are one or more audio packets lost by the slave device, uses the serial number of the one or more audio packets as the serial number of the retransmission packet of the master device.
And the master equipment determines the audio message to be forwarded according to the serial number of the message requested to be forwarded by the slave equipment and/or the serial number of the message reissued by the master equipment.
In a specific embodiment, the master device may use the serial number of the message requested to be forwarded by the slave device and/or the serial number of the message reissued by the master device as the serial number of the message to be forwarded, and obtain a corresponding audio message from an audio message queue cached by the master device as the audio message to be forwarded according to the serial number of the message to be forwarded and the serial number of the audio message received by the master device.
In another specific embodiment, the master device may store a sequence number table of the forwarded audio packet. The sequence number table may have a fixed length, and the master may update the sequence number table in a first-in-first-out manner.
When the forwarding request comprises the first type parameters, the master equipment inquires whether the serial number of the message requested to be forwarded by the slave equipment is in the serial number table of the forwarded audio message, namely, inquires whether the message requested to be forwarded by the slave equipment is already forwarded, and if so, ignores the serial number; if not, the message is used as the serial number of the message to be forwarded;
when the forwarding request includes the second type of parameter, it is queried one by one whether N (N is a positive integer) serial numbers after the serial number of the last audio packet are in the serial number table of the forwarded audio packet, that is, it is queried whether there is a packet that has not been forwarded by the master device after the last audio packet received by the slave device, if yes, the serial number is ignored, and if not, the serial number is used as the serial number of the packet to be forwarded. In some embodiments, it may be found whether 5 audio packets of sequence number +1, sequence number +2, sequence number +3, sequence number +4, and sequence number +5 following the sequence number of the last audio packet received from the device have been forwarded.
After determining the serial number of the packet to be forwarded, the master device may add the serial number to the audio packet serial number table that has been forwarded, for example, to the tail of the serial number table, so as to provide a query for the next time.
The main device can obtain the corresponding audio message from the audio message queue cached by the main device as the audio message to be forwarded according to the serial number of the message to be forwarded and the serial number of the audio message received by the main device, thereby realizing the forwarding of the audio message.
When the current working time of the second working period T2 is adjusted, the master device is also adjusted according to the forwarding request.
In a specific embodiment, the master device may adjust the current operation duration of T2 according to the following condition of forwarding the request:
A. when the first type parameter and the second type parameter are included in the forwarding request,
a1. when determining that no other lost message exists after the last audio message of the slave equipment according to the second type of parameters, determining the data volume of the message requested to be forwarded by the slave equipment according to the first type of parameters, and further determining the T2 of the second working period according to the data volume of the message 0 Adjusted to T2 1
a2. When one or more lost messages exist after the last audio message of the slave equipment is determined according to the second type of parameters, the data volume of the main equipment for transmitting the messages again is obtained; determining the data volume of the message requested to be forwarded by the slave equipment according to the first type of parameters, and setting a second working period T2 according to the data volume of the message requested to be forwarded by the slave equipment and the data volume of the message reissued by the master equipment 0 Adjusted to T2 2
B. When only parameters of the second type are included in the forwarding request,
b1. when determining that no other lost message exists after the last audio message of the slave equipment according to the second type of parameters, ignoring the forwarding request, namely not forwarding the audio message this time and not adjusting the duration of the second working period at T2 of the second working period 0 After the timing is reached, directly entering the next first working period T1;
b2. when one or more lost messages exist after the last audio message of the slave equipment is determined according to the second type of parameters, the data volume of the resending message of the master equipment is obtained, and the second working period T2 is set according to the data volume of the resending message of the master equipment 0 Adjusted to T2 3
As a specific implementation manner, a policy table may be preset on both the master device and the slave device, and the policy table records a corresponding relationship between a plurality of groups of packet data volumes and a scheduled working time of the second working cycle. And the master device and the slave device can both obtain the scheduled working time according to the determined message data volume based on the policy table, so as to adjust the current working time of the second working period to the scheduled working time. Specifically, the master device and the slave device search the planned operating time length of the corresponding second operating period from the policy table according to the determined message data amount, then subtract the currently operating time in the piconet2 from the planned operating time length to obtain the operating time that still needs to be in the piconet2, and update the value into the piconet switching timer, thereby realizing the function of prolonging or shortening the current operating time length of the second operating period on the piconet 2.
And S108, the master device forwards the audio message to be forwarded to the slave device based on the piconet2 until the second working period is finished.
And when the main equipment confirms that the audio message to be forwarded does not exist according to the forwarding request, the main equipment does not forward the message in the current second working period. And when the master equipment confirms that the audio message to be forwarded exists, the audio message to be forwarded is sequentially sent out in the current second working period.
When the master device confirms that one or more packet losses still exist after the last packet received by the slave device according to the second parameter, that is, when the master device determines that a packet loss unknown to the slave device still exists, the data volume of the packet forwarded by the master device may be greater than the data volume of the packet requested to be forwarded by the slave device, and therefore, in a specific embodiment, the master device generates a third type of parameter for indicating the master device determined by the master device to resend the packet information, and sends the third type of parameter to the slave device, so that the slave device can make a corresponding preparation for receiving, and adjust the working duration of the second working period to be consistent with that of the master device.
Specifically, the third type of parameter includes at least one of a message serial number, a message number, and a message data amount related to the audio message reissued by the master device. For example, if the master device confirms that SN3 and SN4 are lost after the last received audio message SN2 from the slave device according to the second type of parameters, sequence numbers 3 and 4 or sequence number 4 and number 2 of messages may be loaded in the third type of parameters.
As a specific implementation manner, when forwarding a message to a slave device, a master device may carry a third type of parameter in a data header of a predetermined forwarding message (e.g., a first forwarded audio message), so as to improve communication efficiency.
The master device completes the forwarding of all audio messages to be forwarded through the piconet2 based on one forwarding request sent by the slave device in the second working period. When the switching time point comes, the piconet1 is switched to again, and the next first duty cycle T1 is entered.
S109, the slave equipment receives the audio message forwarded by the master equipment in a second working period;
and after the slave equipment sends the forwarding request, the slave equipment enters a state of waiting for receiving the audio message.
In a specific embodiment, after receiving the audio message forwarded by the master device, the slave device parses the message for playing. At this time, the slave device can analyze the message completely by using the host module which realizes the upper control of the Bluetooth audio, and the analysis method can be realized by referring to the prior technical scheme.
In a specific embodiment, the slave device, based on the controller module for performing bluetooth audio underlying control, analyzes a packet from the master device to obtain the third type of parameter; at this time, only the third type of parameters can be analyzed, and the message does not need to be completely analyzed, so that the communication delay can be reduced.
The slave device receives the audio message forwarded by the master device, analyzes the audio message, and checks whether a data header of a predetermined forwarding message (such as a first forwarding message) is attached with a third type parameter.
If the third type of parameters are contained, the main equipment resending message information determined by the main equipment is obtained according to the third type of parameters, the main equipment resending message data volume is further obtained, and the working duration of the current second working period is further adjusted according to the main equipment resending message data volume. Specifically, based on the sum of the amount of the reissued message data of the master device and the amount of the message data requested to be forwarded, the corresponding planned working time length may be queried from the policy table, and then the current working time length of the second working cycle may be adjusted to T2 2 Or T2 3
In this way, the slave device receives the messages forwarded by all the master devices in the second working period. Up to the working period T2 of the second working cycle 2 Or T2 3 After the timing is reached, switching to the piconet1, and entering a next first working period T1;
if the third type of parameter is not included, the working duration of the second working period is not adjusted, but is at T2 or T2 1 And receiving the messages forwarded by all the main equipment within the working time. Up to the operating time T2 or T2 of the second operating cycle 1 At the end, the piconet1 is switched to, and the next first duty cycle T1 is entered.
The present embodiment will be described below by taking an actual communication process as an example.
As shown in fig. 5, the master device and the slave device respectively receive audio messages from the sound source device in a first working period T1. In the first working period T1, the slave device receives only the audio messages SN1 and SN2, but does not receive the audio message SN3. After switching to the second working period T2, the slave device recognizes that the sequence numbers of the previously received audio packets are continuous, and determines that there is no packet loss, so only the second type of parameters are sent to the master device. And the master equipment confirms that the audio message SN3 lost by the slave equipment exists after the audio message SN2 received by the slave equipment for the last time according to the second type of parameters, so that the message SN3 is relayed and forwarded to the slave equipment.
As shown in fig. 6, the master device and the slave device respectively receive audio messages from the sound source device in a first working period T1. In the first working period T1, the slave device receives only the audio message SN3, but does not receive the audio messages SN1 and SN2. After switching to the second working period T2, the slave device recognizes that the message loss occurs in the first working period T1, so that the forwarding request sent to the master device includes the first type of parameter and the second type of parameter, the master device learns that the audio messages SN1 and SN2 lost by the slave device according to the first type of parameter, and then confirms that the audio messages SN3 are not lost by the slave device according to the second type of parameter, thereby forwarding the messages SN1 and SN2 to the slave device.
As shown in fig. 7, the master device and the slave device respectively receive audio messages from the sound source device in a first working period T1. In the first working period T1, the slave device receives only the audio message SN1, but does not receive the audio messages SN2 and SN3. After switching to the second working period T2, the slave device considers that there is no packet loss, and therefore only sends the second type of parameters to the master device. And the master equipment confirms that the slave equipment loses the audio messages SN2 and SN3 according to the second type of parameters, so that the messages SN2 and SN3 are relayed to the slave equipment.
From the above three examples, the method of the present invention utilizes the first type of parameters and the second type of parameters contained in one forwarding request, so that the master device can accurately confirm the actual message loss condition of the slave device.
As shown in fig. 8, the master device and the slave device respectively receive audio messages from the sound source device in a first working period T1. The slave device only receives the audio message SN2 in the first working period T1, but does not receive the audio messages SN1 and SN3, and the master device also does not receive the audio message SN3 in the first working period T1. After switching to the second working period T2, the slave device recognizes that a packet loss occurs in the first working period T1, so that the forwarding request sent to the master device includes the first type of parameter and the second type of parameter, the master device learns that the audio packet SN1 is lost by the slave device according to the first type of parameter, and then confirms that the slave device only loses the audio packet SN1 compared with the master device according to the second type of parameter, so that the master device forwards the packet SN1 to the slave device. As for the message SN3, according to the method in the prior art, the master device may retransmit the message SN3 in the next first working period T1 because the master device does not receive the message SN3 and does not feed back the acknowledgement information ACK to the sound source device, so that both the master device and the slave device may receive the SN3 in the next T1.
Example two:
the present embodiment is a bluetooth communication method, which is substantially the same as the first embodiment, and the main difference is the manner in which the slave device extends the operating duration of the second operating period, which can be specifically shown in the signaling diagram of fig. 4:
s201: the main equipment receives an audio message from sound source equipment;
s202: the slave equipment monitors and receives an audio message from the sound source equipment;
s203: the main equipment analyzes the received audio message based on the predetermined message structure information and obtains the serial number of the audio message;
s204, the slave device counts the loss condition of the audio message received in the T1;
s205, the slave device generates a forwarding request according to the loss of the audio packet counted in the first duty cycle, and sends the forwarding request to the master device based on the piconet 2. The master device receives the forwarding request. Steps S201 to S205 are substantially the same as steps S101 to S105 of the first embodiment, and are not described again;
and S206, the main device determines the audio message to be forwarded based on the forwarding request, and adjusts the current working duration of the second working period T2.
Wherein, the master device determines, based on the forwarding request, that the audio packet to be forwarded is substantially the same as S107 in the first embodiment, and details are not repeated.
The difference lies in that: in S206, the main device adjusts the current working duration of T2 according to the data size of the audio packet to be forwarded, so that the main device can complete forwarding the audio packet to be forwarded within the adjusted working duration of the second working period. After determining the audio message or the message serial number to be forwarded, the method can be referred to calculate the corresponding message data volume, and then the planned working duration is inquired and obtained in the policy table, so that the current working duration T2 of the T2 is enabled to be T2 0 Adjusted to T2'.
S207, the master device forwards the audio packet to be forwarded to the slave device based on the piconet2 until the second duty cycle is finished.
The master device also generates a third type parameter for indicating the audio message information to be forwarded, which is determined by the master device, and sends the third type parameter to the slave device, so that the slave device can make a corresponding receiving preparation, and the working duration of the second working period is adjusted to be consistent with that of the master device.
The third type of parameter includes at least one of a message serial number, a message number, and a message data volume related to the audio message to be forwarded.
As a specific implementation manner, when forwarding a message to a slave device, the master device may carry a third type parameter in a data header of a predetermined forwarding message (e.g. a first forwarded audio message). As another specific implementation, the master device may send a data packet including the third type parameter to the slave device, and then send an audio packet to be forwarded to the slave device.
S208, the slave equipment receives the audio message forwarded by the master equipment in a second working period, and adjusts the working duration of the second working period;
when the slave equipment receives the third type parameter from the master equipment, the slave equipment acquires the information of the audio message to be forwarded by the master equipment according to the third type parameter, further acquires the data volume of the message to be forwarded, and adjusts the working time length T2 of the current second working cycle according to the data volume 0 To T2'.
And the slave device receives all the messages forwarded by the master device in the second working period, and switches to the piconet1 until the timing of T2' is reached, and enters the next first working period T1.
Of course, when the master device determines that the slave device does not have the lost packet, T2 will not be adjusted 0 . Accordingly, the third type parameter may not be generated. The slave device does not adjust the working time of the T2 because the slave device does not receive the third type of parameter, or learns that the master device does not forward the packet in the current T2 according to the third type of parameter. The master and the slave are all timed to T2 0 Upon arrival the synchronization switches to piconet 1.
Application scenario two: forwarding mode
In some embodiments, the embodiments of the present invention may be applied to a conventional bluetooth system architecture in a pure forwarding manner, similar to fig. 2, and include an audio source device, a master device, and a slave device, where a bluetooth link is established between the audio source device and the master device to form a first piconet (piconet 1 ), and after the audio source device starts playing audio, the master device receives and replies to an audio message sent by the audio source device in the piconet1 to form interactive communication. The master device establishes a bluetooth link with the slave device to form a second piconet (piconet 2 ), which differs from fig. 2 in that the slave device only receives audio messages from the master device. Thus, only the master needs to alternate switching between piconet1 and piconet 2.
Example three:
the embodiment is a bluetooth communication method, which has a first duty cycle and a second duty cycle that are cyclically repeated in an initial state: the master device operates in a first duty cycle T1 in the piconet1 and operates in a second duty cycle T2 in the piconet2, and the master device is switched from the piconet1 to the piconet2 every time the master device performs the first duty clock cycle T1 of the piconet 1; every time a second duty cycle T2 of piconet2 is performed, a switch is made from piconet2 to piconet 1. The master device cyclically alternates switching between piconet1 and piconet 2. The slave device operates only in piconet2 but it also has a first duty cycle and a second duty cycle which switch synchronously with the master device. The master device and the slave device both preset the same reference clock, for example, both take the clock information of the piconet1 or the piconet2 as the reference clock, and clock the switching time point of the first duty cycle and the second duty cycle with the reference clock, so as to ensure the synchronization of the master device and the slave device.
In the bluetooth communication method of the present embodiment, the operation process of the master device is basically the same as that of the foregoing embodiment. The working process of the slave device is different from the foregoing embodiment in that, in the first working period T1, the slave device counts the loss of the audio message from the master device received in the previous second working period. And then by forwarding the request, the master device can acquire the message which is known to be lost by the slave device in the previous second working period according to the first type of parameters, and can further determine the message which is unknown to be lost by the slave device in the previous second working period according to the second type of parameters, so that the loss of the packet which is lost by the slave device in the previous second working period is made up. In addition, the master device can also take the audio message newly received by the master device in the first working period as the message to be forwarded according to the audio message queue cached by the master device and the sequence number table of the forwarded audio message, and forward the audio message to the slave device in the current second working period, so that the Bluetooth communication in a pure forwarding mode is realized.
Other detailed implementation steps of this embodiment can be implemented with reference to the foregoing embodiment, and thus are not described in detail.
In the above embodiment, the master device and the slave device may specifically be a master earphone and a slave earphone in a stereo bluetooth headset, and the sound source device may be an Audio source device such as a mobile phone and a computer that supports a bluetooth A2DP protocol or a BLE Audio. In addition, the master device and the slave device may also be two or more different types of bluetooth audio devices, such as a bluetooth speaker as the master device and a plurality of bluetooth headsets as the slave devices; or two or more bluetooth audio devices of the same type, such as a plurality of bluetooth speakers, where one speaker is the master device and the other speakers are slave devices.
Example four:
the present embodiment is a bluetooth audio slave device, as shown in fig. 9, which is a schematic block diagram of the present embodiment, and includes a host module for implementing bluetooth audio upper layer control and a controller module for implementing bluetooth audio lower layer control and implementing radio signal transceiving based on a bluetooth wireless communication protocol.
The host module is responsible for upper layer control of protocol processing, voice coding and decoding, encryption/decryption and the like of the Bluetooth audio slave device, and can output processed sound signals to an audio playing unit (not shown in the figure) of the slave device to realize audio playing. Which comprises the following steps:
host control and protocol processing unit: the host module is used for realizing upper layer protocol processing and controlling other units in the host module;
HCI interface: the command interface is used for providing a host control and protocol processing unit and an access interface for hardware configuration parameters;
a decoding unit: the Bluetooth audio message processing unit is used for negotiating with the opposite communication terminal in advance to determine message structure information and related decoding rules of the audio message based on the host control and protocol processing unit, decoding the Bluetooth audio message processed by the host control and protocol processing unit and obtaining the audio message;
a cache unit: the buffer unit is used for buffering the audio message queue obtained by decoding of the decoding unit.
The controller module further comprises a Bluetooth radio frequency module, an HCI module and a Bluetooth baseband module, wherein:
a Bluetooth radio frequency module for receiving and transmitting radio frequency signals,
the Bluetooth baseband module is used for carrying out bottom data processing and link control of Bluetooth communication;
and the HCI interface is used for providing a command interface for accessing the controller module to the host module at the upper layer.
The bluetooth audio slave device can be used to implement the bluetooth communication method in the foregoing embodiments. The Bluetooth audio slave device has a first work cycle and a second work cycle which are synchronously switched with the Bluetooth audio master device; the controller module is used for counting the loss condition of the received audio message in the first working period; the controller module is further configured to generate a forwarding request according to the loss condition of the received audio packet counted in the first working period in the second working period, and send the forwarding request to the bluetooth audio master device; and receiving the audio message forwarded by the Bluetooth audio master device.
In this embodiment, a bluetooth audio message parsing unit is disposed in the controller module.
The Bluetooth audio message analysis unit is used for analyzing a serial number from the audio message containing the serial number received by the controller module based on the Bluetooth audio message structure information; judging whether the message is lost or not based on the serial number, and counting the serial number of the lost message when the message is lost;
when a lost message occurs, the controller module loads information of the lost message, such as a serial number, serving as information of a request for forwarding the message from the equipment to a first type of parameter, loads information of a last audio message, such as the serial number, obtained by analysis of the Bluetooth audio message analysis unit to a second type of parameter, and generates a forwarding request containing the first type of parameter and the second type of parameter; and when the message is not lost, loading the information of the last audio message, such as the serial number, into the second type of parameters, and generating a forwarding request containing the second type of parameters.
When the bluetooth audio message analysis unit analyzes the serial number, the message structure information is acquired from the host module in advance, for example, the message structure information is acquired from the decoding unit through the HCI interface, or the decoding unit updates the message structure information of the bluetooth audio message analysis unit through the HCI interface after acquiring new message structure information.
In some specific embodiments, the control module may further include a storage unit, configured to store a serial number, a preset policy table, message structure information, and the like obtained by parsing by the bluetooth audio message parsing unit.
In some embodiments, the bluetooth audio packet parsing unit and the storage unit may be both disposed in the bluetooth baseband module. Namely: the Bluetooth baseband module comprises a baseband and Link Controller unit (Link Controller), a Link Manager Protocol unit (Link Manager Protocol), a Bluetooth modulation and demodulation unit (Bluetooth Modem), and further comprises a Bluetooth audio message analysis unit and a storage unit.
The Bluetooth audio message analysis unit is used for carrying out validity judgment on a Bluetooth data block analyzed by the Bluetooth modulation and demodulation unit and the baseband and link control unit, if the Bluetooth data block is judged to be valid audio data, the message serial number is analyzed according to the position of the serial number in the message, message structure information such as whether the message is fragmented or not, and the serial number is stored in the storage unit after the analysis; after the next packet is received, the process is repeated, the serial number is compared with the analyzed serial number at the last time, the process of de-overturning and the like is carried out, and two parameters of whether the packet is lost or not and the serial number of the lost packet are obtained. And then, the baseband and link control unit obtains the serial number of the last received message, the parameter of whether the packet is lost and the serial number of the lost message based on the Bluetooth audio message analysis unit in the second working period T2, generates a forwarding request and sends the forwarding request through the Bluetooth radio frequency module.
The bluetooth audio slave device in this embodiment is directly in a bottom controller of the device, such as an audio packet serial number parsed from a bluetooth audio packet parsing unit, and performs packet loss judgment based on the parsed audio packet serial number, so that it is not necessary to perform packet loss judgment by waiting for a host module through two packet caches as in the prior art, and it is also unnecessary to parse the entire audio packet, thereby saving the time of 2 times of cache processes of HCI interface access and packet parsing of a decoding unit, and ensuring timeliness; meanwhile, the message loss condition is counted in the first working period, and a forwarding request is sent once and all lost messages are forwarded in the second working period, so that the interaction time of packet loss detection and forwarding is short, and the communication delay is reduced.
Example five:
this embodiment is a bluetooth audio master device, including the host computer module that is used for realizing bluetooth audio upper strata control and the controller module that is used for carrying out bluetooth audio bottom control and realizes the radio signal receiving and dispatching based on bluetooth wireless communication protocol, it has first duty cycle and the second duty cycle that switches with the slave unit synchronization, wherein:
in the first working period, the Bluetooth audio master device receives an audio message from an audio source device based on a first piconet;
during the second period of time of the said second operation,
the Bluetooth audio master device receives a forwarding request sent by a Bluetooth audio slave device based on a second piconet, wherein the forwarding request is generated by the Bluetooth audio slave device based on the loss condition of audio messages received by the Bluetooth audio slave device counted in the first working period;
and the Bluetooth audio master device determines an audio message to be forwarded based on the forwarding request, and forwards the audio message to be forwarded to the Bluetooth audio slave device.
The Bluetooth audio master device is preset with a message sequence number table, a policy table and the like.
Other working principles of the bluetooth audio master device are similar to those of the previous embodiments, and are not described herein again.
Example six:
this embodiment provides a bluetooth communication system, which includes a bluetooth audio slave device as described in embodiment four and a bluetooth audio master device as described in embodiment five, where the bluetooth audio slave device and the bluetooth audio master device communicate with each other by the bluetooth communication method in the foregoing embodiments.
As can be seen from the above description, the bluetooth communication method, device and system provided by the present application avoid an increase in communication traffic caused by initiating a forwarding request for multiple times, reduce an unavailable time period, shorten a packet loss forwarding interaction time, and reduce a communication delay, thereby improving an actual available communication bandwidth.
Furthermore, the master device and the slave device can synchronously and dynamically adjust the time of the second working period, so that the actual communication bandwidth under the adverse condition is dynamically increased, and the possibility of packet loss is reduced.
Furthermore, the slave device utilizes the bluetooth bottom module to realize the limited analysis of the serial number, the packet loss judgment and the transmission request containing the first type of parameters and the second type of parameters, so that the packet loss detection consumes short time and has small delay.
By adopting the technical scheme of the application, the low packet loss rate and the low communication time delay can be still achieved under the condition of common interference environment or a slightly long communication distance, so that the low playing time delay and the good playing effect are achieved. Compared with the prior art, the technical scheme of the application has obvious advantages in video application and game application scenes which are sensitive to sound playing delay.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solutions of the present application may be embodied in the form of a software product, which is stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal (such as a mobile phone, a computer, a server, an air conditioner, or a network device) to execute the method according to the embodiments of the present application.
It should be understood that the above examples are only for clarity of illustration and are not intended to limit the embodiments. Other variations and modifications will be apparent to persons skilled in the art in light of the above description. And are neither required nor exhaustive of all embodiments. And obvious variations or modifications of the invention are intended to be covered by the present invention.

Claims (17)

1. A method of bluetooth communication, characterized by: the master device has a first duty cycle and a second duty cycle that switch synchronously with the slave device, wherein:
in the first working period, the master device receives audio messages from the sound source device based on the first piconet;
during the second duty cycle:
the master device receives a forwarding request sent by a slave device based on a second piconet, the forwarding request is generated by the slave device according to the loss condition of the audio message counted in the first work period, the forwarding request comprises a first type parameter and/or a second type parameter, the first type parameter at least comprises the information of the slave device requesting to forward the message, and the second type parameter at least comprises the information of the last audio message received by the slave device,
the main device determines the audio message to be forwarded based on the forwarding request, and the determining includes: the master equipment acquires the serial number of a slave equipment request forwarding message according to the first type of parameter, and/or acquires the serial number of a master equipment reissue message according to the second type of parameter, the master equipment determines the audio message to be forwarded according to the serial number of the slave equipment request forwarding message and/or the serial number of the master equipment reissue message,
and forwarding the audio message to be forwarded to the slave equipment.
2. The bluetooth communication method according to claim 1, wherein the first type parameter comprises a serial number of a slave device requesting to forward a packet;
the second type of parameter comprises a serial number of a last audio message received by the slave device;
in the second working period, the acquiring, by the master device, the sequence number of the supplementary message sent by the master device according to the second type of parameter includes: and determining whether one or more audio messages lost by the slave equipment exist after the audio message received by the slave equipment for the last time according to the serial number of the last audio message received by the slave equipment in the second-class parameters and the serial number of the audio message received by the master equipment, and if so, taking the serial numbers of the one or more audio messages as the serial number of the retransmission message of the master equipment.
3. The bluetooth communication method according to claim 2, wherein: after receiving the audio message from the sound source equipment, the main equipment also analyzes the audio message based on the predetermined message structure information to obtain the serial number of the received audio message;
in the second working period, the master device determines the serial number of the message to be forwarded according to the serial number of the message requested to be forwarded by the slave device and/or the serial number of the message reissued by the master device; and acquiring the corresponding audio message as the audio message to be forwarded according to the serial number of the message to be forwarded and the serial number of the received audio message, and forwarding the audio message.
4. The bluetooth communication method according to claim 3, wherein: the main device stores a sequence number table of the forwarded audio message; the master device determines the serial number of the message to be forwarded according to the serial number of the message requested to be forwarded by the slave device, specifically to determine that the message to be forwarded is the serial number of the message to be forwarded
When the forwarding request comprises a first type parameter, the master equipment inquires whether the serial number of the message requested to be forwarded by the slave equipment is in the serial number table of the forwarded audio message, and if not, the master equipment determines that the serial number is the serial number of the message to be forwarded;
when the forwarding request comprises a second type of parameter, inquiring one by one whether N serial numbers after the serial number of the last audio message are in a serial number table of the forwarded audio message, and if not, determining that the N serial numbers are the serial numbers of the messages to be forwarded;
after determining the serial number of the message to be forwarded, the main device adds the serial number of the message to be forwarded to the audio message serial number list;
n is a positive integer.
5. The bluetooth communication method according to one of the claims 1 to 4, characterized in that: the main device determines the audio message to be forwarded based on the forwarding request, and further includes: the master equipment adjusts the working duration of the second working period; in particular, the method comprises the following steps of,
the main equipment determines the data volume of the message to be forwarded based on the forwarding request, and adjusts the working duration of a second working period according to the determined data volume of the message; alternatively, the first and second electrodes may be,
and the master equipment determines the data volume of the message requested to be forwarded by the slave equipment and/or the data volume of the message retransmitted by the master equipment based on the first type parameter and/or the second type parameter in the forwarding request, and adjusts the working duration of a second working period according to the determined data volume of the message.
6. The bluetooth communication method according to claim 5, wherein: the master device adjusts the working duration of a second working period according to the determined message data volume based on a preset strategy table;
the main device inquires the corresponding planned working time length from the strategy table according to the determined message data volume, and adjusts the current working time length of the second working period to the planned working time length.
7. The bluetooth communication method according to one of claims 1 to 4, characterized in that: the master device forwards the audio message to be forwarded to the slave device, and the method further includes that the master device generates a third type of parameter and sends the third type of parameter to the slave device, and the third type of parameter is used for indicating the master device determined by the master device to resend the message information or the audio message information to be forwarded.
8. The bluetooth communication method according to claim 7, wherein:
the master device has a reference clock consistent with the slave device and clocks switching time points of the first duty cycle and the second duty cycle with the reference clock to switch between the first piconet and the second piconet when the switching time points are reached;
the first type of parameters also comprise the number of messages requested to be forwarded by the slave equipment and/or the data volume of the messages requested to be forwarded;
the third type of parameter comprises at least one of a message serial number, a message number and a message data volume related to the audio message reissued by the main equipment or the audio message to be forwarded;
the message structure information comprises the message structure of the audio message and the position information of each parameter in the message;
the main equipment loads the third type of parameters in the data head of a preset forwarding message;
the message data volume is obtained by calculation according to the number of messages, the message length and the communication bandwidth;
the sequence number list of the forwarded audio message has a fixed length, the main device updates the sequence number list in a first-in first-out mode, and the main device adds the sequence number of the newly added message to be forwarded to the tail of the sequence number list when updating the sequence number list.
9. A method of bluetooth communication, comprising: the slave device has a first duty cycle and a second duty cycle that switch synchronously with the master device, wherein:
in the first working period, the slave device counts the loss condition of the audio message received by the slave device, including:
the slave equipment analyzes a serial number from the received audio message containing the serial number based on predetermined message structure information, judges whether the message is lost or not based on the serial number, and counts the serial number of the lost message when the message is lost;
during the second duty cycle:
the slave device generates a forwarding request according to the audio message loss condition counted in the first working period, and the forwarding request comprises: when the message is lost, the slave device loads the information of the lost message as the serial number of the message requested to be forwarded by the slave device to a first class parameter, loads the information of the last audio message received by the slave device to a second class parameter, generates a forwarding request containing the first class parameter or/and the second class parameter, and when the message is not lost, loads the information of the last audio message received by the slave device to the second class parameter, generates a forwarding request containing the second class parameter,
transmitting the forwarding request to the master device based on a second piconet,
and receiving the audio message forwarded by the master device based on the second piconet.
10. The bluetooth communication method according to claim 9, wherein: in the first working period, the slave device receives the audio message sent to the master device by the sound source device based on the first piconet, and counts the loss condition of the audio message received by the slave device in the first working period; alternatively, the first and second electrodes may be,
during the first work period, the slave device counts the loss of the audio message from the master device received by the second piconet during the previous second work period.
11. The bluetooth communication method according to claim 9, wherein: during the second work period, the slave device also adjusts the work duration of the second work period; wherein:
the slave equipment adjusts the working duration of a second working period according to the data volume of the message requested to be forwarded, so that the slave equipment can at least complete the audio message which is received from the master equipment and requested to be forwarded by the slave equipment within the adjusted working duration of the second working period; and/or the presence of a gas in the gas,
the slave equipment acquires the data volume of the messages retransmitted by the master equipment or the data volume of the messages to be forwarded by the master equipment according to the third type of parameters from the master equipment so as to adjust the working time of the second working period, so that the slave equipment can at least finish receiving all the audio messages forwarded by the master equipment within the adjusted working time of the second working period;
the third type of parameter is used for indicating the main equipment determined by the main equipment to resend the message information or the audio message information to be forwarded.
12. The bluetooth communication method according to claim 11, wherein: the slave device adjusts the working duration of a second working period according to the acquired message data volume based on a preset strategy table;
the slave device inquires the corresponding planned working time length from the strategy table after acquiring the message data volume, and adjusts the current working time length of the second working period to the planned working time length.
13. The bluetooth communication method according to one of claims 11, 12, characterized in that:
in the first working period, the slave device counts the loss condition of the audio message received by the slave device, and
in the second working period, generating a forwarding request according to the loss condition of the audio message counted in the first working period, and/or analyzing the message from the main equipment to obtain the third type of parameters,
the controller module is used for performing Bluetooth audio bottom layer control on the basis of the slave equipment;
the message data volume is obtained by calculation according to the number of messages, the message length and the communication bandwidth;
the data volume of the message requested to be forwarded is obtained by calculation when the slave device counts the condition of receiving the audio message;
the first type of parameters comprise a serial number of a message requested to be forwarded by the slave equipment, the number of the messages requested to be forwarded by the slave equipment and/or the data volume of the message requested to be forwarded;
the second type of parameter comprises a serial number of a last audio message received by the slave device;
the third type of parameter comprises at least one of a message serial number, a message number and a message data volume related to the audio message reissued by the main equipment or the audio message to be forwarded;
the message structure information comprises the message structure of the audio message and the position information of each parameter in the message.
14. The utility model provides a bluetooth audio frequency slave unit, includes the host computer module that is used for realizing bluetooth audio frequency upper control and is used for carrying out bluetooth audio frequency bottom control and realize the controller module of radio signal receiving and dispatching based on bluetooth wireless communication agreement which characterized in that:
the Bluetooth audio slave device is provided with a first work cycle and a second work cycle which are synchronously switched with the Bluetooth audio master device;
the controller module is further configured to count a loss condition of the received audio packet in the first working period, and the controller module includes a bluetooth audio packet parsing unit, where the bluetooth audio packet parsing unit is configured to parse a serial number from an audio packet including the serial number received by the controller module based on predetermined packet structure information, determine whether the packet is lost based on the serial number, and count the serial number of the lost packet when the packet is lost;
the controller module is further configured to generate a forwarding request according to a loss condition of the received audio packet counted in the first working period in the second working period, and when a packet is lost, the controller module loads information of the lost packet as information of a slave device requesting for forwarding the packet to a first-class parameter, loads information of a last audio packet obtained by parsing by the bluetooth audio packet parsing unit to a second-class parameter, generates a forwarding request including the first-class parameter and the second-class parameter, and when a packet is not lost, loads information of the last audio packet to the second-class parameter, generates a forwarding request including the second-class parameter, and sends the forwarding request to the bluetooth audio master device;
and receiving the audio message forwarded by the Bluetooth audio master device.
15. The bluetooth audio slave device of claim 14, wherein: the host module is used for negotiating with the communication opposite terminal in advance to determine the message structure information of the Bluetooth audio message;
the Bluetooth audio message analysis unit acquires the message structure information from the host module;
the Bluetooth audio message analysis unit is arranged in a Bluetooth baseband module in the controller module.
16. The utility model provides a bluetooth audio master, is including the host computer module that is used for realizing bluetooth audio upper strata control and the controller module that is used for carrying out bluetooth audio bottom control and realizes radio signal receiving and dispatching based on bluetooth wireless communication agreement, its characterized in that: having a first duty cycle and a second duty cycle that switch synchronously with the slave device, wherein:
in the first working period, the Bluetooth audio master device receives audio messages from sound source devices based on a first piconet;
during the second period of time of the said second operation,
the Bluetooth audio master device receives a forwarding request sent by a Bluetooth audio slave device based on a second piconet, the forwarding request is generated by the Bluetooth audio slave device based on the loss condition of audio messages received by the Bluetooth audio slave device counted in the first work period, the forwarding request comprises a first type parameter and/or a second type parameter, the first type parameter at least comprises the information of the slave device requesting to forward the messages, and the second type parameter at least comprises the information of the last audio message received by the slave device,
the bluetooth audio master device determines an audio message to be forwarded based on the forwarding request, and the determining includes: the master device obtains the serial number of the message requested to be forwarded by the slave device according to the first type of parameters, and/or the master device obtains the serial number of the message reissued by the master device according to the second type of parameters, the master device determines the audio message to be forwarded according to the serial number of the message requested to be forwarded by the slave device and/or the serial number of the message reissued by the master device,
and forwarding the audio message to be forwarded to the Bluetooth audio slave device.
17. A bluetooth communication system, characterized by: comprising a bluetooth audio slave device as claimed in one of claims 14 to 15 and a bluetooth audio master device as claimed in claim 16, the bluetooth audio slave device and the bluetooth audio master device communicating based on the bluetooth communication method as claimed in one of claims 1 to 13.
CN202110489177.2A 2021-05-06 2021-05-06 Bluetooth audio master device, bluetooth audio slave device, bluetooth communication method and Bluetooth communication system Active CN113207114B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110489177.2A CN113207114B (en) 2021-05-06 2021-05-06 Bluetooth audio master device, bluetooth audio slave device, bluetooth communication method and Bluetooth communication system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110489177.2A CN113207114B (en) 2021-05-06 2021-05-06 Bluetooth audio master device, bluetooth audio slave device, bluetooth communication method and Bluetooth communication system

Publications (2)

Publication Number Publication Date
CN113207114A CN113207114A (en) 2021-08-03
CN113207114B true CN113207114B (en) 2022-10-18

Family

ID=77028480

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110489177.2A Active CN113207114B (en) 2021-05-06 2021-05-06 Bluetooth audio master device, bluetooth audio slave device, bluetooth communication method and Bluetooth communication system

Country Status (1)

Country Link
CN (1) CN113207114B (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102170679A (en) * 2011-05-28 2011-08-31 西安电子科技大学 Multimachine Bluetooth group communication method based on Android system
CN112205014A (en) * 2020-08-26 2021-01-08 深圳市中科蓝讯科技股份有限公司 Communication method of wireless device, device and computer readable storage medium

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111435844B (en) * 2019-11-06 2021-11-23 珠海市杰理科技股份有限公司 Method, device, equipment and system for correcting audio data in dual-wireless Bluetooth communication
CN111436044B (en) * 2019-11-06 2023-06-23 珠海市杰理科技股份有限公司 Method, device and system for processing packet loss data of dual-wireless Bluetooth communication network

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102170679A (en) * 2011-05-28 2011-08-31 西安电子科技大学 Multimachine Bluetooth group communication method based on Android system
CN112205014A (en) * 2020-08-26 2021-01-08 深圳市中科蓝讯科技股份有限公司 Communication method of wireless device, device and computer readable storage medium

Also Published As

Publication number Publication date
CN113207114A (en) 2021-08-03

Similar Documents

Publication Publication Date Title
KR101971183B1 (en) A source device that broadcasts synchronization information associated with a Bluetooth isochronous channel
US10477474B2 (en) Arbitrating a low power mode for multiple applications running on a device
JP6625641B2 (en) Traffic Advertisement in Neighbor Aware Network (NAN) Data Path
CN112313977B (en) Low latency audio streaming with communication coexistence
US9973903B2 (en) Traffic advertisement in a network
JP6633077B2 (en) Traffic advertisement in Neighbor Aware Network (NAN) data path
JP6419971B2 (en) Traffic advertisement in the neighbor aware network (NAN) data path
EP2416508A2 (en) Synchronization for data transfer between physical layers
TW201633829A (en) Traffic advertisement in neighbor aware network (NAN) data path (1)
CN111491284B (en) Bluetooth BLE time delay optimization method, equipment and storage medium
US20160277522A1 (en) Detecting playback buffer underrun at sink device to improve streaming media quality over bluetooth
US11374623B2 (en) Connected isochronous stream swapping
WO2023146565A1 (en) Wireless microphone synchronization for btoip tws earbuds
JP2017076956A (en) Method for exchanging data packages of different sizes between first portable communication device and second portable communication device
CN113207114B (en) Bluetooth audio master device, bluetooth audio slave device, bluetooth communication method and Bluetooth communication system
EP4142359A1 (en) Method, device, and computer program for selecting channel in wireless communication system, and recording medium therefor
JP6887769B2 (en) How to exchange data packages between a first portable communication device and a second portable communication device using the preferred frequency band
CN106656434B (en) Method for exchanging data packets between a first portable communication device and a second portable communication device
CN114079898A (en) Audio data communication method, device, equipment and system in dual-transmission mode
EP2066085A1 (en) Bluetooth stack processor with QOS
WO2023192751A1 (en) Bluetooth low energy coexistence link configuration
TW202339527A (en) Btoip low power design with adaptive low power mode and data burst interval
CN117412107A (en) Data transmission method, data receiving method, device, storage medium and 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