Sound synchronization method and device for bluetooth earphone in weak connection state and electronic equipment
By dynamically designating master and slave earphones and establishing a collaborative mode in Bluetooth headsets, and calibrating audio latency in real time, the problems of sound synchronization imbalance and data instability under weak connection are solved, realizing synchronized playback of the left and right earphones and improving the user experience.
Patent Information
- Application Number
- CN202611434080.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-15
- Publication Date
- 2026-11-24
AI Technical Summary
In weak connection scenarios, traditional Bluetooth headphones suffer from problems such as unbalanced sound synchronization, unstable data transmission, and lack of dynamic compensation mechanisms, which makes them unable to meet user needs, especially in scenarios requiring high-precision audio synchronization.
By determining whether the Bluetooth headset is in a weak connection state, the master and slave headsets are dynamically designated to establish a master-slave collaborative mode. The audio latency difference is detected and calibrated in real time. The master headset generates latency compensation instructions and synchronization playback instructions to achieve audio playback timing synchronization between the left and right headsets.
In a weak connection state, the sound of the left and right earphones can be played synchronously, which improves the stability of audio data transmission and user experience, eliminates the problems of sound desynchronization and stuttering, and adapts to the power consumption requirements of different connection scenarios.
Smart Images

Figure CN123164533A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of Bluetooth headset technology, and in particular to a method, apparatus, and electronic device for synchronizing Bluetooth headset sound under weak connection conditions. Background Technology
[0002] With the development of wireless audio technology, TWS Bluetooth earbuds have been widely used in music listening, calls, and audio-visual entertainment due to their portability. Their traditional working mechanism is as follows: each earbud independently establishes a Bluetooth communication link with a terminal (such as a mobile phone or tablet), and the terminal transmits audio data to both earbuds to achieve stereo playback.
[0003] However, in weak connection scenarios (such as when the distance between the headphones and the terminal exceeds 10 meters, there are walls / metal obstructions, or there is interference from multiple Bluetooth devices), the traditional independent connection mechanism has obvious shortcomings: 1) Sound synchronization imbalance: There are differences in the Bluetooth signal strength and transmission rate between the left and right earphones and the terminal, which causes the audio data to arrive at the two earphones at different times (usually up to 50-200ms). The human ear can clearly perceive the "left and right sound are out of sync", which seriously affects the listening experience, especially when watching videos or playing games, where the audio is out of sync with the picture / operation rhythm.
[0004] 2) Unstable data transmission: In a weak connection state, data packet loss and retransmission are prone to occur in a single earphone, causing the sound of that earphone to stutter or disconnect, while the other earphone plays normally, forming a "one-sided audio" problem. This problem cannot be quickly repaired through the terminal and requires the user to manually reset the earphone connection.
[0005] 3) No dynamic compensation mechanism: Traditional Bluetooth audio transmission relies solely on one-way data transmission from the terminal to the headphones. It does not have real-time calibration logic designed for latency differences under weak connection conditions. When connection quality fluctuates, it cannot automatically adjust the playback sequence of the headphones. Users can only manually disconnect and reconnect, which is cumbersome and has limited effect.
[0006] In addition, although some existing Bluetooth headphones use "master-slave switching" technology, it is only used to optimize connection stability. It does not design a delay calibration and data backup mechanism for the sound synchronization problem under weak connection. It still cannot solve the problem of the left and right headphones being out of sync. Especially in scenarios with high requirements for audio synchronization accuracy (such as professional audio-visual and gaming competitions), traditional solutions can no longer meet user needs.
[0007] The above problems urgently need to be addressed. Summary of the Invention
[0008] The purpose of this invention is to at least partially solve one of the technical problems existing in the prior art.
[0009] Therefore, one objective of this invention is to provide a Bluetooth headset audio synchronization method in a weak connection state. This method enables synchronized audio playback between the left and right headsets in a weak connection scenario, thereby improving the user experience.
[0010] Another objective of this invention is to provide a Bluetooth headset audio synchronization device in a weak connection state.
[0011] To achieve the above-mentioned technical objectives, the technical solutions adopted in the embodiments of the present invention include: On one hand, embodiments of the present invention provide a method for synchronizing the sound of Bluetooth headphones in a weak connection state, including the following steps: Determine if the Bluetooth headset is in a weak connection state; When the Bluetooth headset is in a weak connection state, the master and slave headsets are determined based on the Bluetooth signal strength of the left and right headsets and historical connection data, and the Bluetooth headsets are switched to master-slave collaborative mode. By receiving terminal audio data through the main earphone and the slave earphone respectively, it is determined whether the slave earphone has lost packets, and the data reception delay between the main earphone and the slave earphone is determined; When the slave earphone does not lose packets, and the data reception delay is greater than a preset first time threshold and less than or equal to a preset second time threshold, a delay compensation instruction is generated through the master earphone, and the audio playback timing of the master earphone and the slave earphone is synchronized according to the delay compensation instruction; When the slave earphone loses packets, or the data reception delay exceeds the second time threshold, the master earphone synchronizes the terminal audio data to the slave earphone via the master-slave BLE secondary link, and generates a synchronization playback command, thereby synchronizing the audio playback timing of the master earphone and the slave earphone according to the synchronization playback command.
[0012] Furthermore, in one embodiment of the present invention, determining whether the Bluetooth headset is in a weak connection state specifically includes: The Bluetooth signal strength, transmission rate, and packet loss rate of the left and right earphones are obtained respectively. If at least one of the left and right earbuds has a Bluetooth signal strength less than or equal to a preset signal strength threshold, a transmission rate less than or equal to a preset rate threshold, or a packet loss rate greater than or equal to a preset packet loss rate threshold, the Bluetooth earbuds are determined to be in a weak connection state.
[0013] Furthermore, in one embodiment of the present invention, determining the master and slave earphones based on the Bluetooth signal strength and historical connection data of the left and right earphones specifically includes: The signal strength difference is determined based on the Bluetooth signal strength of the left and right earphones; When the absolute value of the signal strength difference is greater than or equal to a preset difference threshold, the earphone with the higher Bluetooth signal strength is determined to be the master earphone, and the earphone with the lower Bluetooth signal strength is determined to be the slave earphone. When the absolute value of the signal strength difference is less than the difference threshold, the historical connection stability of the left and right earphones is determined based on the historical connection data, and then the earphone with higher historical connection stability is determined to be the master earphone, and the earphone with lower historical connection stability is determined to be the slave earphone.
[0014] Furthermore, in one embodiment of the present invention, determining the data reception delay between the main earphone and the slave earphone specifically includes: When the main earphone receives the terminal audio data sent by the terminal, it records the corresponding first timestamp; When the terminal audio data is received from the headphones and sent by the terminal, the corresponding second timestamp is recorded; The second timestamp is obtained from the slave earphone through the master earphone, and the data reception delay is determined based on the difference between the second timestamp and the first timestamp.
[0015] Furthermore, in one embodiment of the present invention, the step of generating a delay compensation command through the main earphone and synchronizing the audio playback timing of the main earphone and the slave earphone according to the delay compensation command specifically includes: The main earphone determines the first playback delay of the terminal audio data based on the data reception delay, and generates a corresponding delay compensation instruction based on the first playback delay, so that the main earphone adjusts the audio playback timing of the terminal audio data according to the first playback delay.
[0016] Furthermore, in one embodiment of the present invention, the step of synchronizing the terminal audio data to the slave earphone via the master earphone based on the master-slave BLE secondary link and generating a synchronization playback command, and then synchronizing the audio playback timing of the master earphone and the slave earphone according to the synchronization playback command, specifically includes: When the slave earpiece loses packets, the lost fragmented data is determined, and the fragmented data is sent back to the slave earpiece through the master earpiece based on the master-slave BLE secondary link; When the data reception delay is greater than the second time threshold, the data transmission link between the slave earphone and the terminal is interrupted, and the complete audio data of the terminal is sent to the slave earphone through the master earphone based on the master-slave BLE secondary link; Determine the third timestamp of the segmented data or the terminal audio data received from the earphone from the main earphone; The main earphone determines the playback time of the terminal audio data based on the third timestamp, and generates a corresponding synchronous playback instruction based on the playback time, so that the main earphone and the slave earphone adjust the audio playback sequence of the terminal audio data according to the playback time.
[0017] Furthermore, in one embodiment of the present invention, the Bluetooth headset sound synchronization method in the weak connection state further includes the following steps: Monitor whether the Bluetooth headset has exited the weak connection state; When the Bluetooth headset exits the weak connection state, it switches from the master-slave collaborative mode back to the independent connection mode.
[0018] On the other hand, embodiments of the present invention provide a Bluetooth headset sound synchronization device in a weak connection state, comprising: The connection status determination module is used to determine whether the Bluetooth headset is in a weak connection state; The mode switching module is used to determine the master and slave earphones based on the Bluetooth signal strength of the left and right earphones and historical connection data when the Bluetooth earphones are in a weak connection state, and switch the Bluetooth earphones to master-slave collaborative mode. The packet loss and delay determination module is used to receive terminal audio data through the main earphone and the slave earphone respectively, determine whether the slave earphone has lost packets, and determine the data reception delay between the main earphone and the slave earphone; The delay compensation module is used to generate a delay compensation instruction through the main earphone when the slave earphone does not lose packets and the data reception delay is greater than a preset first time threshold and less than or equal to a preset second time threshold, and synchronize the audio playback timing of the main earphone and the slave earphone according to the delay compensation instruction; The data synchronization module is used to synchronize terminal audio data from the master earphone to the slave earphone via the master-slave BLE secondary link when the slave earphone loses packets or the data reception delay is greater than the second time threshold, and generate a synchronization playback instruction, and then synchronize the audio playback timing of the master earphone and the slave earphone according to the synchronization playback instruction.
[0019] On the other hand, embodiments of the present invention provide an electronic device, the electronic device including a memory, a processor, a computer program stored in the memory and executable on the processor, and a data bus for implementing connection communication between the processor and the memory, wherein the computer program, when executed by the processor, implements the Bluetooth headset sound synchronization method in a weak connection state as described above.
[0020] On the other hand, embodiments of the present invention also provide a storage medium, which is a computer-readable storage medium for computer-readable storage. The storage medium stores one or more computer programs, which can be executed by one or more processors to implement the Bluetooth headset sound synchronization method in a weak connection state as described above.
[0021] On the other hand, embodiments of the present invention also provide a computer program product, including a computer program that, when executed by a processor, implements the Bluetooth headset sound synchronization method under weak connection conditions as described above.
[0022] The advantages and beneficial effects of the present invention will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention: This invention determines whether the Bluetooth headset is in a weak connection state. When the Bluetooth headset is in a weak connection state, the master and slave headsets are determined based on the Bluetooth signal strength of the left and right headsets and historical connection data. The Bluetooth headsets are then switched to master-slave collaborative mode. The master and slave headsets receive terminal audio data respectively. It is determined whether the slave headset loses packets and the data reception delay between the master and slave headsets is determined. When the slave headset does not lose packets and the data reception delay is greater than a preset first time threshold and less than or equal to a preset second time threshold, the master headset generates a delay compensation command and synchronizes the audio playback sequence of the master and slave headsets according to the delay compensation command. When the slave headset loses packets or the data reception delay is greater than the second time threshold, the master headset synchronizes terminal audio data to the slave headset based on the master-slave BLE secondary link and generates a synchronization playback command. Then, the audio playback sequence of the master and slave headsets is synchronized according to the synchronization playback command. This invention dynamically designates a master earphone and establishes a master-slave BLE secondary link when the Bluetooth earphone is in a weak connection state. Based on the packet loss and latency of the slave earphone, it performs playback delay compensation and audio data synchronization between the master and slave earphones, improving the transmission stability of audio data and realizing synchronized sound playback between the left and right earphones in weak connection scenarios, thus improving the user experience. Attached Figure Description
[0023] To more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings used in the embodiments of the present invention are described below. It should be understood that the drawings described below are only for the convenience of clearly describing some embodiments of the technical solutions of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0024] Figure 1 A flowchart illustrating the steps of a Bluetooth headset audio synchronization method under weak connection conditions provided in an embodiment of the present invention; Figure 2 A flowchart of step S101 provided in an embodiment of the present invention; Figure 3 A flowchart of step S102 provided in an embodiment of the present invention; Figure 4 A flowchart of step S103 provided in an embodiment of the present invention; Figure 5 A flowchart of step S104 provided in an embodiment of the present invention; Figure 6 A flowchart of step S105 provided in an embodiment of the present invention; Figure 7 Another flowchart of the Bluetooth headset sound synchronization method under weak connection state provided in the embodiment of the present invention; Figure 8 This is a schematic diagram of the structure of a Bluetooth headset audio synchronization device in a weak connection state provided in an embodiment of the present invention; Figure 9 A schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present invention; Figure 10 This is a schematic diagram of the structure of the storage medium provided in an embodiment of the present invention. Detailed Implementation
[0025] The embodiments of the present invention are described in detail below. Examples of these embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain this application, and should not be construed as limiting this application. It should be noted that although functional modules are divided in the system schematic diagram and a logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in a different order than the module division in the system schematic diagram or the order in the flowchart. The step numbers in the following embodiments are only set for ease of explanation and do not limit the order between steps. The execution order of each step in the embodiments can be adaptively adjusted according to the understanding of those skilled in the art.
[0026] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein is for the purpose of describing embodiments of this application only and is not intended to limit this application.
[0027] The following describes some of the terms used in the embodiments of the present invention.
[0028] Weak connection state: This refers to a connection state where the Bluetooth signal strength between the Bluetooth headset and the terminal (such as a mobile phone) is lower than a preset threshold (usually lower than -70dBm), or there is physical obstruction between the headset and the terminal, or between the headsets, resulting in a decrease in data transmission rate and an increase in packet loss rate. At this time, sound delay, stuttering or desynchronization problems are likely to occur.
[0029] Master-slave headset collaboration mechanism: In a pair of Bluetooth headsets, one is designated as the "master headset" and the other as the "slave headset" according to preset rules. The master headset prioritizes maintaining stable communication with the terminal and obtaining audio data, while also undertaking the responsibility of audio synchronization control. The slave headset receives synchronization instructions and audio compensation data by establishing a secondary communication link with the master headset.
[0030] Sound delay calibration: By detecting the audio transmission delay between the master and slave headphones and the terminal in real time, the delay difference between the two is calculated. The master headphone sends a delay compensation command to the slave headphone to adjust the audio playback timing of the slave headphone, so that the time deviation of the sound output of the left and right headphones is controlled within the range imperceptible to the human ear (usually ≤20ms).
[0031] Audio data backup transmission: When the main earphone receives audio data from the terminal, it simultaneously backs up and encrypts the data. When the slave earphone experiences data loss or excessive latency due to weak connection, the main earphone directly resends the complete audio segment to the slave earphone, replacing the unstable communication link between the slave earphone and the terminal and ensuring the integrity of the audio data.
[0032] TWS (True Wireless Stereo): Usually translated as "true wireless stereo" in Chinese, it is currently the mainstream Bluetooth headset (especially wireless headset). BLE (Bluetooth Low Energy): It is a low-cost, low-power Bluetooth communication standard launched by the Bluetooth Special Interest Group (SIG).
[0033] The Bluetooth headset audio synchronization method provided in this application under weak connection conditions can be applied to a terminal, a server, or software running on a terminal or server. In some embodiments, the terminal can be a smartphone, tablet, laptop, desktop computer, smart speaker, smartwatch, or in-vehicle terminal, but is not limited to these. The server can be configured as an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms. The server can also be a node server in a blockchain network. The software can be an application implementing a driver status monitoring method based on machine vision, but is not limited to the above forms.
[0034] This application can be used in a wide variety of general-purpose or special-purpose computer system environments or configurations. Examples include: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronics, network PCs, minicomputers, mainframe computers, and distributed computing environments including any of the above systems or devices. This application can be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc., that perform specific tasks or implement specific abstract data types. This application can also be practiced in distributed computing environments where tasks are performed by remote processing devices connected via a communication network. In distributed computing environments, program modules can reside in local and remote computer storage media, including storage devices.
[0035] It should be noted that in all specific embodiments of this application, when processing data related to user identity or characteristics, such as user information, user behavior data, user historical data, and user location information, user permission or consent is obtained first. Furthermore, the collection, use, and processing of this data comply with relevant laws, regulations, and standards of the relevant countries and regions. In addition, when embodiments of this application require access to sensitive personal information of users, separate permission or consent from the user is obtained through pop-ups or redirects to confirmation pages. Only after obtaining the user's separate permission or consent is the necessary user-related data for the proper functioning of the embodiments of this application obtained.
[0036] like Figure 1 The diagram shows a flowchart of a Bluetooth headset audio synchronization method under weak connection conditions according to an embodiment of the present invention. Figure 1 This invention provides a method for synchronizing the sound of Bluetooth headphones in a weak connection state, specifically including the following steps: S101. Determine if the Bluetooth headset is in a weak connection state; S102. When the Bluetooth headset is in a weak connection state, determine the master and slave headsets based on the Bluetooth signal strength of the left and right headsets and historical connection data, and switch the Bluetooth headsets to master-slave collaborative mode. S103. Receive terminal audio data through the main earphone and the slave earphone respectively, determine whether the slave earphone has lost packets, and determine the data reception delay between the main earphone and the slave earphone. S104. When there is no packet loss in the slave earphone and the data reception delay is greater than a preset first time threshold and less than or equal to a preset second time threshold, a delay compensation instruction is generated through the master earphone, and the audio playback sequence of the master earphone and slave earphone is synchronized according to the delay compensation instruction. S105. When the slave earphone loses packets or the data reception delay exceeds the second time threshold, the master earphone synchronizes terminal audio data to the slave earphone via the master-slave BLE secondary link and generates a synchronization playback command, and then synchronizes the audio playback timing of the master earphone and slave earphone according to the synchronization playback command.
[0037] Specifically, addressing the audio synchronization problem of traditional Bluetooth headsets in weak connection states, the audio synchronization method for Bluetooth headsets in weak connection states of this invention establishes a master-slave headset collaboration mechanism to detect and calibrate the audio delay difference between the left and right headsets in real time, controlling the audio synchronization deviation within a range imperceptible to the human ear, and eliminating problems such as "left and right asynchrony" and "single-sided stuttering" under weak connection states. When the slave headset experiences significant delay, the audio data is backed up and transmitted from the master headset to the slave headset, replacing the weak communication link between the slave headset and the terminal, reducing data packet loss and retransmission, avoiding "single-sided audio" and "audio disconnection," and improving audio continuity in weak connection scenarios. It supports automatic switching between "independent connection" and "master-slave collaboration" modes based on Bluetooth signal strength. In strong connection states, it maintains traditional independent transmission to reduce the power consumption of the master headset, while in weak connection states, it automatically starts synchronization calibration and backup transmission, balancing power consumption and synchronization effect. It does not require disruptive modifications to the existing hardware of Bluetooth headsets (such as Bluetooth chips, microphones, and speakers), but only optimizes the Bluetooth communication protocol and software algorithm to achieve the function, reducing the R&D and production costs for manufacturers and facilitating rapid deployment and promotion.
[0038] It can be recognized that, in the embodiments of the present invention, when the Bluetooth headset is in a weak connection state, the master headset is dynamically designated and a master-slave BLE secondary link is established. This allows for playback delay compensation and audio data synchronization between the master and slave headsets based on packet loss and latency of the slave headset, thereby improving the transmission stability of audio data and enabling synchronized playback of sound from the left and right headsets in weak connection scenarios, thus improving the user experience.
[0039] like Figure 2 The diagram shown is a flowchart of step S101 provided in an embodiment of the present invention. (Refer to...) Figure 2 As an optional implementation, determining whether the Bluetooth headset is in a weak connection state specifically includes: S1011. Obtain the Bluetooth signal strength, transmission rate, and packet loss rate of the left and right earphones respectively; S1012. When at least one of the left and right earphones has a Bluetooth signal strength less than or equal to a preset signal strength threshold, a transmission rate less than or equal to a preset rate threshold, or a packet loss rate greater than or equal to a preset packet loss rate threshold, the Bluetooth earphone is determined to be in a weak connection state.
[0040] Specifically, a connection status monitoring module is deployed between the left and right earbuds and the terminal to collect real-time Bluetooth signal strength (RSSI), transmission rate, and packet loss rate data between the left and right earbuds and the terminal. If at least one of the left or right earbuds has a Bluetooth signal strength less than or equal to a preset signal strength threshold, a transmission rate less than or equal to a preset rate threshold, or a packet loss rate greater than or equal to a preset packet loss rate threshold, the Bluetooth earbuds are determined to be in a weak connection state. For example, if either earbud detects a signal strength ≤ -70dBm, a packet loss rate ≥ 5%, or a transmission rate ≤ 2Mbps, it is determined to be in a weak connection state and immediately sends a weak connection warning signal to the terminal and the other earbud.
[0041] like Figure 3 The diagram shown is a flowchart of step S102 provided in an embodiment of the present invention. (Refer to...) Figure 3 As an optional implementation, the master and slave earphones are determined based on the Bluetooth signal strength and historical connection data of the left and right earphones, specifically including: S1021. Determine the signal strength difference based on the Bluetooth signal strength of the left and right earphones; S1022. When the absolute value of the signal strength difference is greater than or equal to the preset difference threshold, the earphone with the higher Bluetooth signal strength is determined to be the master earphone, and the earphone with the lower Bluetooth signal strength is determined to be the slave earphone. S1023. When the absolute value of the signal strength difference is less than the difference threshold, the historical connection stability of the left and right earphones is determined based on historical connection data. Then, the earphone with higher historical connection stability is determined to be the master earphone, and the earphone with lower historical connection stability is determined to be the slave earphone.
[0042] Specifically, when the Bluetooth headset is in a weak connection state, this embodiment of the invention dynamically determines the master and slave headsets based on the Bluetooth signal strength of the left and right headsets and historical connection data.
[0043] Specifically, when the signal strength difference between the left and right earphones is greater than or equal to a preset difference threshold (e.g., 3dBm), the earphone with the stronger signal strength is set as the main earphone; if the signal strengths of the left and right earphones are similar, the terminal determines the historical connection stability of the left and right earphones based on historical connection data, and designates the earphone with higher historical connection stability as the main earphone.
[0044] like Figure 4 The diagram shown is a flowchart of step S103 provided in an embodiment of the present invention. (Refer to...) Figure 4 As an optional implementation, the data reception delay between the master earphone and the slave earphone is determined, specifically including: S1031. When the main earphone receives terminal audio data sent by the terminal, it records the corresponding first timestamp; S1032. When receiving terminal audio data sent by the terminal from the headset, record the corresponding second timestamp; S1033. Obtain the second timestamp from the slave earphone through the master earphone, and determine the data reception delay based on the difference between the second timestamp and the first timestamp.
[0045] Specifically, in the weak connection state, the main earphone receives the complete audio data stream sent by the terminal, and at the same time establishes secondary communication with the slave earphone through the Bluetooth Low Energy (BLE) link; the main earphone records the first timestamp (T1) of the audio data received from the terminal in real time, and sends a "delay detection command" to the slave earphone to obtain the second timestamp (T2) of the audio data received from the terminal by the slave earphone, and determines the data reception delay ΔT=T2-T1 based on the difference between the second timestamp and the first timestamp.
[0046] In addition, the main earphone also sends a "packet loss detection command" to the slave earphone to obtain the packet loss information of the slave earphone.
[0047] like Figure 5 The diagram shown is a flowchart of step S104 provided in an embodiment of the present invention. (Refer to...) Figure 5 As an optional implementation, a delay compensation command is generated through the main earphone, and the audio playback timing of the main earphone and the slave earphone is synchronized according to the delay compensation command, specifically as follows: S1041. The main earphone determines the first playback delay of the terminal audio data based on the data reception delay, and generates a corresponding delay compensation instruction based on the first playback delay, so that the main earphone adjusts the audio playback sequence of the terminal audio data according to the first playback delay.
[0048] Specifically, when there is no packet loss in the slave earphone and the data reception delay is greater than a preset first time threshold and less than or equal to a preset second time threshold, a delay compensation command is generated through the master earphone to adjust the audio playback timing of the master earphone and the slave earphone.
[0049] Specifically, when there is no packet loss in the slave earphone and the data reception delay ΔT > 20ms and ΔT ≤ 50ms, it indicates that there is no data packet loss or excessive transmission delay in the slave earphone. However, the data reception delay between the master and slave earphones has reached a level that is perceptible to the human ear. At this time, the master earphone determines the first playback delay of the corresponding audio data based on the second timestamp of the audio data received from the slave earphone, and then generates a corresponding delay compensation instruction. Based on the delay compensation instruction, the audio playback sequence of the master earphone is adjusted so that the terminal audio data of the master earphone is delayed by the corresponding duration, thereby achieving the purpose of synchronizing the audio playback sequence of the master earphone and the slave earphone.
[0050] like Figure 6 The diagram shown is a flowchart of step S105 provided in an embodiment of the present invention. (Refer to...) Figure 6 As an optional implementation, the main earphone synchronizes terminal audio data to the slave earphone via a master-slave BLE secondary link and generates a synchronization playback command. Then, the audio playback sequence of the main and slave earphones is synchronized according to the synchronization playback command. Specifically, this includes: S1051. When packet loss occurs in the slave headset, determine the lost fragmented data in the slave headset and send the fragmented data to the slave headset through the master headset based on the master-slave BLE secondary link. S1052. When the data reception delay is greater than the second time threshold, the data transmission link between the earphone and the terminal is interrupted, and the complete terminal audio data is sent to the earphone through the master earphone based on the master-slave BLE secondary link. S1053. Determine the third timestamp of the segmented data or terminal audio data received from the earphone from the main earphone; S1054. The main earphone determines the playback time of the terminal audio data based on the third timestamp, and generates a corresponding synchronous playback instruction based on the playback time, so that the main earphone and the slave earphone adjust the audio playback sequence of the terminal audio data according to the playback time.
[0051] Specifically, both left and right earpieces are equipped with audio data backup modules. In a weak connection state, the main earpiece's audio data backup module is activated. When receiving audio data from the terminal, the main earpiece performs real-time encryption (e.g., AES-128) and fragmented backup storage (each fragment being 100ms of audio data). When the slave earpiece loses packets, the lost fragments are identified and sent back to the slave earpiece via the main earpiece using the master-slave BLE secondary link. When the data reception delay exceeds a second time threshold (e.g., 50ms), the data transmission link between the slave earpiece and the terminal is interrupted, and the data is sent back to the slave earpiece via the master-slave BLE secondary link. The earphone sends complete terminal audio data to replace the unstable link between the earphone and the terminal, ensuring the integrity of the earphone's audio data. After the master earphone sends fragmented data or terminal audio data to the slave earphone, it receives the third timestamp of receiving the data returned by the slave earphone. Based on the third timestamp, it determines the playback time of the terminal audio data (for example, by delaying it by a fixed duration to allow the slave earphone to decode the audio data). Then, it generates a synchronous playback instruction and sends the synchronous playback instruction to the slave earphone, so that both the master and slave earphones play the corresponding audio data based on the playback time, thereby synchronizing the audio playback timing of the master and slave earphones.
[0052] like Figure 7 The diagram shown is another step flowchart of the Bluetooth headset sound synchronization method under weak connection state provided by an embodiment of the present invention. (Refer to...) Figure 7 As an optional implementation, the Bluetooth headset sound synchronization method in a weak connection state further includes the following steps: S106. Monitor whether the Bluetooth headset has exited the weak connection state; S107. When the Bluetooth headset exits the weak connection state, switch the Bluetooth headset back from the master-slave collaborative mode to the independent connection mode.
[0053] Specifically, after determining that the Bluetooth headset is in a weak connection state, the connection status of the Bluetooth headset is continuously monitored, and it is determined to exit the weak connection state when a preset condition is met. For example, when the Bluetooth signal strength is ≥-65dBm, the packet loss rate is ≤2% and lasts for more than 3 seconds, it is determined to exit the weak connection state. When the Bluetooth headset exits the weak connection state, the master-slave collaborative control module and audio data backup module of the main headset are automatically turned off, and the left and right headsets resume the traditional independent connection mode, reducing the power consumption of the main headset.
[0054] In addition, the Bluetooth headset also supports manual switching of modes on the terminal (such as users can force the master-slave collaboration mode to be enabled in the game scenario), which improves the flexibility of use.
[0055] In some optional embodiments, if the secondary communication link between the master and slave earphones is interrupted (e.g., due to excessive distance), or if there is still a significant sound playback delay after delay compensation, the earphones send a synchronization error signal to the terminal. The terminal then prompts the user with a pop-up window, vibration, or voice message: "Earphone synchronization error, please adjust the usage distance." At the same time, the terminal automatically reduces the audio transmission bitrate (e.g., switching from AAC to SBC) to improve data transmission stability and assist in restoring synchronization between the master and slave earphones.
[0056] In some optional embodiments, for scenarios where users connect to multiple terminals such as mobile phones and tablets simultaneously, a terminal priority determination step is added during master-slave collaborative control. Based on the user's current usage scenario (such as making a phone call or watching a movie on a tablet), a high-priority terminal is designated. The master earpiece only receives audio data from the high-priority terminal and synchronizes it to the slave earpiece, avoiding synchronization disorder caused by data interference from multiple terminals.
[0057] In some optional embodiments, a delay trend prediction step is added during master-slave collaborative control. By analyzing the delay difference change trend over a period of time using AI algorithms, the delay difference for the next second can be predicted in advance and a compensation command can be sent in advance to reduce the lag of real-time calibration. This is especially suitable for scenarios where signal strength fluctuates rapidly (such as when the distance between the headphones and the fixed terminal changes frequently while the user is walking).
[0058] The following describes the complete implementation process of the present invention using Bluetooth headset synchronization in a game scenario under weak connection as an example.
[0059] User Xiao Wang used TWS Bluetooth earphones to connect to a terminal and participate in offline competitive games. During the game, he needed to move his body frequently, and the distance between the earphones and the terminal gradually increased (due to the presence of walls), causing the connection to weaken.
[0060] First, connection status detection and master / slave determination are performed: the left earphone detects that the Bluetooth signal strength and packet loss rate meet the weak connection determination conditions, and the right earphone's detection data also meets the weak connection standard; the left and right earphones send the detection data to the terminal, and the terminal, according to the "stronger signal strength" rule, designates the right earphone as the master earphone and the left earphone as the slave earphone, and sends a "master-slave collaborative start command" to both earphones.
[0061] Then, master-slave collaboration and latency calibration are performed: the master headset (right) receives the game audio data stream sent by the terminal and records the timestamp of the first frame of audio data received, T1=1000ms; at the same time, the master headset sends a "latency detection command" to the slave headset (left) through the BLE link. The slave headset responds with the timestamp of the audio data received from the terminal, T2=1035ms. The master headset calculates ΔT=35ms (exceeding the normal range of human hearing); the master headset immediately generates a latency compensation command, delaying the playback of the corresponding frame of audio data by 35ms, so as to achieve synchronous output of game sound effects by the master and slave headsets.
[0062] During the game, two audio data packets were lost in the left earphone due to signal obstruction, and a "data retransmission request" was sent to the main earphone. The main earphone called the audio data backup module, extracted the encrypted backup data of the two corresponding packets, and retransmitted it to the left earphone through the secondary link. After the left earphone received the data, it reported "data ready" to the main earphone. The main earphone sent a "synchronous playback command", and the left earphone seamlessly connected when the main earphone played the corresponding segment, without any sound stuttering or disconnection.
[0063] Xiao Wang moves to the vicinity of the terminal (without obstruction). The connection status detection module detects that the signal strength and packet loss rate of both the left and right earphones have returned to the normal range and have remained so for a certain period of time, and determines that the weak connection state has been exited. The master-slave collaborative control module and the data backup module are turned off, the left and right earphones resume independent connection mode, the power consumption of the master earphone is significantly reduced, and the audio playback remains normal.
[0064] The implementation process of the present invention has been described above. It is understood that, in embodiments of the present invention, when the Bluetooth headset is in a weak connection state, the master headset is dynamically designated and a master-slave BLE secondary link is established. This allows for playback delay compensation and audio data synchronization between the master and slave headsets based on packet loss and latency issues in the slave headset, improving the stability of audio data transmission and enabling synchronized audio playback between the left and right headsets in weak connection scenarios, thus enhancing the user experience.
[0065] Compared with the prior art, the embodiments of the present invention also have the following advantages: 1) Completely solve the problem of weak connection sound synchronization: Through master-slave collaborative calibration and data backup transmission, the sound synchronization deviation of the left and right headphones is controlled within the range imperceptible to the human ear, eliminating the pain points of "asynchrony" and "stuttering" of traditional Bluetooth headphones under weak connection, especially improving the user experience in gaming and audio-visual scenarios.
[0066] 2) Improve audio transmission stability: Backup data transmission from the main earphone to the slave earphone replaces the weak link between the slave earphone and the terminal, significantly reducing the data packet loss rate and avoiding the "one-sided audio" problem. At the same time, the system automatically completes synchronization and repair without user intervention, greatly improving the ease of operation.
[0067] 3) Balancing power consumption and scenario adaptability: Supports dynamic switching between "weak connection master-slave collaboration" and "strong connection independent transmission". It ensures synchronization in the case of weak connection and reduces headphone power consumption in the case of strong connection, adapting to different usage scenarios; it also supports manual mode switching to meet users' personalized needs.
[0068] 4) Low cost and compatibility with existing hardware: The function is implemented by optimizing the Bluetooth communication protocol and software algorithm. There is no need to replace the existing hardware such as the Bluetooth headset chip and antenna. Manufacturers can quickly implement the product through firmware upgrades, which significantly reduces R&D costs and facilitates large-scale promotion and application.
[0069] like Figure 8 The diagram shown is a structural schematic of a Bluetooth headset audio synchronization device in a weak connection state according to an embodiment of the present invention. (Refer to...) Figure 8 This invention provides a Bluetooth headset audio synchronization device in a weak connection state, comprising: The connection status determination module is used to determine whether the Bluetooth headset is in a weak connection state; The mode switching module is used to determine the master and slave earphones based on the Bluetooth signal strength and historical connection data of the left and right earphones when the Bluetooth earphones are in a weak connection state, and switch the Bluetooth earphones to master-slave collaborative mode. The packet loss and delay determination module is used to receive terminal audio data through the main earphone and the slave earphone respectively, determine whether the slave earphone has lost packets, and determine the data reception delay between the main earphone and the slave earphone. The delay compensation module is used to generate a delay compensation command through the main earphone when there is no packet loss in the slave earphone and the data reception delay is greater than a preset first time threshold and less than or equal to a preset second time threshold, and synchronize the audio playback timing of the main earphone and the slave earphone according to the delay compensation command. The data synchronization module is used to synchronize terminal audio data from the master earphone to the slave earphone via the master-slave BLE secondary link when the slave earphone loses packets or the data reception delay exceeds the second time threshold, and generate a synchronization playback command, and then synchronize the audio playback timing of the master earphone and the slave earphone according to the synchronization playback command.
[0070] It is understood that the content of the above method embodiments is applicable to the present device embodiments. The specific functions implemented by the present device embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.
[0071] This invention also provides an electronic device, comprising: a memory, a processor, a program stored in the memory and executable on the processor, and a data bus for communication between the processor and the memory. When the program is executed by the processor, it implements the aforementioned Bluetooth headset audio synchronization method under weak connection conditions. This electronic device can be any smart terminal, including tablet computers, in-vehicle computers, etc.
[0072] like Figure 9 The diagram shown is a hardware structure schematic of an electronic device provided in an embodiment of the present invention. (Refer to...) Figure 9 This invention provides an electronic device, comprising: The processor 901 can be implemented using a general-purpose CPU (Central Processing Unit), microprocessor, application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of the present invention. The memory 902 can be implemented as a read-only memory (ROM), static storage device, dynamic storage device, or random access memory (RAM). The memory 902 can store the operating system and other applications. When the technical solutions provided in the embodiments of this specification are implemented through software or firmware, the relevant program code is stored in the memory 902 and is called by the processor 901 to execute the Bluetooth headset sound synchronization method in a weak connection state according to the embodiments of this invention. The input / output interface 903 is used to implement information input and output; The communication interface 904 is used to enable communication and interaction between this device and other devices. Communication can be achieved through wired means (such as USB, Ethernet cable, etc.) or wireless means (such as mobile network, WIFI, Bluetooth, etc.). Bus 905 transmits information between various components of the device (e.g., processor 901, memory 902, input / output interface 903, and communication interface 904); The processor 901, memory 902, input / output interface 903, and communication interface 904 are connected to each other within the device via bus 905.
[0073] It is understood that the content of the above method embodiments is applicable to this device embodiment. The specific functions implemented by this device embodiment are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.
[0074] like Figure 10 The diagram shown is a structural schematic of the storage medium provided in an embodiment of the present invention. (Refer to...) Figure 10 The present invention also provides a storage medium, which is a computer-readable storage medium for computer-readable storage. The storage medium stores one or more programs 1001, which can be executed by one or more processors to implement the above-described Bluetooth headset sound synchronization method in a weak connection state.
[0075] It is understood that the content of the above method embodiments is applicable to this storage medium embodiment. The specific functions implemented in this storage medium embodiment are the same as those in the above method embodiments, and the beneficial effects achieved are also the same as those achieved in the above method embodiments.
[0076] This invention also discloses a computer program product, including a computer program that, when executed by a processor, implements the above-described method for synchronizing Bluetooth headset audio in a weak connection state.
[0077] It is understood that the content of the above method embodiments is applicable to the embodiments of this program product. The specific functions implemented by the embodiments of this program product are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.
[0078] Memory, as a non-transitory computer-readable storage medium, can be used to store non-transitory software programs and non-transitory computer-executable programs. Furthermore, memory may include high-speed random access memory, and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid-state storage device. In some embodiments, memory may optionally include memory remotely located relative to the processor, and these remote memories can be connected to the processor via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.
[0079] The embodiments described in this invention are for the purpose of more clearly illustrating the technical solutions of the embodiments of this invention, and do not constitute a limitation on the technical solutions provided by the embodiments of this invention. As those skilled in the art will know, with the evolution of technology and the emergence of new application scenarios, the technical solutions provided by the embodiments of this invention are also applicable to similar technical problems.
[0080] The terms "first," "second," "third," "fourth," etc. (if present) in the specification and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0081] In some alternative embodiments, the functions / operations mentioned in the block diagrams may not occur in the order shown in the operation diagrams. For example, depending on the functions / operations involved, two consecutively shown blocks may actually be executed substantially simultaneously, or the aforementioned blocks may sometimes be executed in reverse order. Furthermore, the embodiments presented and described in the flowcharts of this invention are provided by way of example to provide a more comprehensive understanding of the technology. The disclosed methods are not limited to the operations and logic flows presented herein. Alternative embodiments are contemplated in which the order of various operations is changed and sub-operations described as part of a larger operation are executed independently.
[0082] Furthermore, although the invention has been described in the context of functional modules, it should be understood that, unless otherwise stated, one or more of the aforementioned functions and / or features may be integrated into a single physical device and / or software module, or one or more functions and / or features may be implemented in a separate physical device or software module. It is also understood that a detailed discussion of the actual implementation of each module is unnecessary for understanding the invention. Rather, given the properties, functions, and internal relationships of the various functional modules in the apparatus disclosed herein, the actual implementation of the module will be understood within the scope of conventional skill of an engineer. Therefore, those skilled in the art can implement the invention as set forth in the claims using ordinary techniques without excessive experimentation. It is also understood that the specific concepts disclosed are merely illustrative and not intended to limit the scope of the invention, which is determined by the full scope of the appended claims and their equivalents.
[0083] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this invention, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0084] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as a sequenced list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by, or in conjunction with, an instruction execution system, apparatus, or device (such as a computer-based system, a processor-including system, or other system that can fetch and execute instructions from, an instruction execution system, apparatus, or device). For the purposes of this specification, "computer-readable medium" can be any means that can contain, store, communicate, propagate, or transmit programs for use by, or in conjunction with, an instruction execution system, apparatus, or device.
[0085] More specific examples (a non-exhaustive list) of computer-readable media include: electrical connections (electronic devices) having one or more wires, portable computer disk drives (magnetic devices), random access memory (RAM), read-only memory (ROM), erasable and editable read-only memory (EPROM or flash memory), fiber optic devices, and portable optical disc read-only memory (CDROM). Furthermore, computer-readable media can even be paper or other suitable media on which the aforementioned program can be printed, because the aforementioned program can be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, interpreting, or otherwise processing as necessary, and then stored in computer memory.
[0086] It should be understood that various parts of the present invention can be implemented in hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented in software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, it can be implemented using any one or a combination of the following techniques known in the art: discrete logic circuits having logic gates for implementing logical functions on data signals, application-specific integrated circuits (ASICs) having suitable combinational logic gates, programmable gate arrays (PGAs), field-programmable gate arrays (FPGAs), etc.
[0087] In the foregoing description of this specification, references to terms such as "one embodiment," "another embodiment," or "some embodiments" indicate that a specific feature, structure, material, or characteristic described in connection with an embodiment or example is included in at least one embodiment or example of the present invention. In this specification, illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples.
[0088] Although embodiments of the invention have been shown and described, those skilled in the art will understand that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the claims and their equivalents.
[0089] The above is a detailed description of the preferred embodiments of the present invention. However, the present invention is not limited to the above embodiments. Those skilled in the art can make various equivalent modifications or substitutions without departing from the spirit of the present invention. All such equivalent modifications or substitutions are included within the scope defined by the claims of this application.
Claims
1. A Bluetooth earphone sound synchronization method in a weak connection state, characterized in that, Includes the following steps: Determine if the Bluetooth headset is in a weak connection state; When the Bluetooth headset is in a weak connection state, the master and slave headsets are determined based on the Bluetooth signal strength of the left and right headsets and historical connection data, and the Bluetooth headsets are switched to master-slave collaborative mode. By receiving terminal audio data through the main earphone and the slave earphone respectively, it is determined whether the slave earphone has lost packets, and the data reception delay between the main earphone and the slave earphone is determined; When the slave earphone does not lose packets, and the data reception delay is greater than a preset first time threshold and less than or equal to a preset second time threshold, a delay compensation instruction is generated through the master earphone, and the audio playback timing of the master earphone and the slave earphone is synchronized according to the delay compensation instruction; When the slave earphone loses packets, or the data reception delay exceeds the second time threshold, the master earphone synchronizes the terminal audio data to the slave earphone via the master-slave BLE secondary link, and generates a synchronization playback command, thereby synchronizing the audio playback timing of the master earphone and the slave earphone according to the synchronization playback command.
2. The method of claim 1, wherein the method further comprises: The determination of whether the Bluetooth headset is in a weak connection state specifically includes: The Bluetooth signal strength, transmission rate, and packet loss rate of the left and right earphones are obtained respectively. If at least one of the left and right earbuds has a Bluetooth signal strength less than or equal to a preset signal strength threshold, a transmission rate less than or equal to a preset rate threshold, or a packet loss rate greater than or equal to a preset packet loss rate threshold, the Bluetooth earbuds are determined to be in a weak connection state.
3. The method of claim 1, wherein the method further comprises: The process of determining the master and slave earphones based on the Bluetooth signal strength and historical connection data of the left and right earphones specifically includes: The signal strength difference is determined based on the Bluetooth signal strength of the left and right earphones; When the absolute value of the signal strength difference is greater than or equal to a preset difference threshold, the earphone with the higher Bluetooth signal strength is determined to be the master earphone, and the earphone with the lower Bluetooth signal strength is determined to be the slave earphone. When the absolute value of the signal strength difference is less than the difference threshold, the historical connection stability of the left and right earphones is determined based on the historical connection data, and then the earphone with higher historical connection stability is determined to be the master earphone, and the earphone with lower historical connection stability is determined to be the slave earphone.
4. The Bluetooth headset audio synchronization method under weak connection state according to claim 1, characterized in that, Determining the data reception delay between the main earphone and the slave earphone specifically includes: When the main earphone receives the terminal audio data sent by the terminal, it records the corresponding first timestamp; When the terminal audio data is received from the headphones and sent by the terminal, the corresponding second timestamp is recorded; The second timestamp is obtained from the slave earphone through the master earphone, and the data reception delay is determined based on the difference between the second timestamp and the first timestamp.
5. The Bluetooth headset audio synchronization method under weak connection state according to claim 1, characterized in that, The step of generating a delay compensation command through the main earphone and synchronizing the audio playback timing of the main earphone and the slave earphone according to the delay compensation command specifically includes: The main earphone determines the first playback delay of the terminal audio data based on the data reception delay, and generates a corresponding delay compensation instruction based on the first playback delay, so that the main earphone adjusts the audio playback timing of the terminal audio data according to the first playback delay.
6. The Bluetooth headset audio synchronization method under weak connection state according to claim 1, characterized in that, The process of synchronizing terminal audio data from the main earphone to the slave earphone via a master-slave BLE secondary link and generating a synchronization playback command, and then synchronizing the audio playback sequence of the main earphone and the slave earphone according to the synchronization playback command, specifically includes: When the slave earpiece loses packets, the lost fragmented data is determined, and the fragmented data is sent back to the slave earpiece through the master earpiece based on the master-slave BLE secondary link; When the data reception delay is greater than the second time threshold, the data transmission link between the slave earphone and the terminal is interrupted, and the complete audio data of the terminal is sent to the slave earphone through the master earphone based on the master-slave BLE secondary link; Determine the third timestamp of the segmented data or the terminal audio data received from the earphone from the main earphone; The main earphone determines the playback time of the terminal audio data based on the third timestamp, and generates a corresponding synchronous playback instruction based on the playback time, so that the main earphone and the slave earphone adjust the audio playback sequence of the terminal audio data according to the playback time.
7. A method for synchronizing Bluetooth headset audio in a weak connection state according to any one of claims 1 to 6, characterized in that, The Bluetooth headset audio synchronization method under weak connection conditions also includes the following steps: Monitor whether the Bluetooth headset has exited the weak connection state; When the Bluetooth headset exits the weak connection state, it switches from the master-slave collaborative mode back to the independent connection mode.
8. A Bluetooth headset audio synchronization device in a weak connection state, characterized in that, include: The connection status determination module is used to determine whether the Bluetooth headset is in a weak connection state; The mode switching module is used to determine the master and slave earphones based on the Bluetooth signal strength of the left and right earphones and historical connection data when the Bluetooth earphones are in a weak connection state, and switch the Bluetooth earphones to master-slave collaborative mode. The packet loss and delay determination module is used to receive terminal audio data through the main earphone and the slave earphone respectively, determine whether the slave earphone has lost packets, and determine the data reception delay between the main earphone and the slave earphone; The delay compensation module is used to generate a delay compensation instruction through the main earphone when the slave earphone does not lose packets and the data reception delay is greater than a preset first time threshold and less than or equal to a preset second time threshold, and synchronize the audio playback timing of the main earphone and the slave earphone according to the delay compensation instruction; The data synchronization module is used to synchronize terminal audio data from the master earphone to the slave earphone via the master-slave BLE secondary link when the slave earphone loses packets or the data reception delay is greater than the second time threshold, and generate a synchronization playback instruction, and then synchronize the audio playback timing of the master earphone and the slave earphone according to the synchronization playback instruction.
9. An electronic device, characterized in that, The electronic device includes a memory, a processor, a computer program stored in the memory and executable on the processor, and a data bus for enabling communication between the processor and the memory. When the computer program is executed by the processor, it implements the Bluetooth headset sound synchronization method in a weak connection state as described in any one of claims 1 to 7.
10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by the processor, it implements the Bluetooth headset sound synchronization method in a weak connection state as described in any one of claims 1 to 7.
