Frequency adjustment method, device, Bluetooth earphone, storage medium, and program product

The frequency adjustment method and device for Bluetooth earphones address asynchronous playback by synchronizing the clock frequencies of master and slave earphones through phase compensation, effectively reducing audible synchronization issues.

JP2025540300APending Publication Date: 2025-12-11GUANGZHOU ANYKA MICROELECTRONICS CO LTD
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
JP2025533336
Authority / Receiving Office
JP · JP
Patent Type
Applications
Current Assignee / Owner
Priority Date
2022-12-08
Filing Date
2023-10-27
Publication Date
2025-12-11

AI Technical Summary

Technical Problem

Bluetooth earphones experience asynchronous playback due to natural deviations in the crystal vibration frequencies of the master and slave earphones, leading to audible synchronization issues over time.

Method used

A frequency adjustment method and device for Bluetooth earphones that involve a slave earphone receiving signaling packets from a master earphone, calculating phase differences, and performing fast phase compensation and subsequent adjustments to synchronize the clock frequencies of the earphones.

Benefits of technology

The method and device effectively synchronize the clock frequencies of master and slave earphones, reducing relative phase differences and preventing asynchronous playback, ensuring synchronized audio playback.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 2025540300000001_ABST
    Figure 2025540300000001_ABST
Patent Text Reader

Abstract

This application relates to a frequency adjustment method, an apparatus, a Bluetooth earphone, a storage medium, and a program product. The method includes: receiving a signaling packet periodically transmitted from a master earphone, the signaling packet including a target sample point identifier, and acquiring the Bluetooth clock of the corresponding slave earphone; calculating a difference between the Bluetooth clock of the master earphone and the Bluetooth clock of the slave earphone as a first phase difference; determining the first phase difference between the Bluetooth clock of the slave earphone and the Bluetooth clock of the master earphone; and, if the first phase difference satisfies a phase compensation condition, performing a fast phase compensation process on the clock frequency of the slave earphone based on the first phase difference; after performing the adjustment process on the clock frequency of the slave earphone, re-determining a second phase difference between the Bluetooth clock of the slave earphone and the Bluetooth clock of the master earphone; and performing a re-adjustment process on the clock frequency of the slave earphone based on the first phase difference and the second phase difference. This method accurately synchronizes playback between dual earphones in a Bluetooth earphone system.
Need to check novelty before this filing date? Find Prior Art

Description

[Technical Field]

[0001] CROSS-REFERENCE TO RELATED APPLICATIONS This application claims priority to a Chinese patent application filed with the State Intellectual Property Office of China on December 8, 2022, bearing application number 2022115723652 and entitled "Frequency Adjustment Method, Apparatus, Bluetooth® Earphone, Storage Medium and Program Product," the entire contents of which are incorporated herein by reference. The present application relates to the technical field of electronic equipment, and in particular to a frequency adjustment method, an apparatus, a Bluetooth earphone, a storage medium and a program product. [Background technology]

[0002] Bluetooth earphones are currently commonly used electronic devices, and typically include two earphones: a master earphone and a slave earphone. In the dual-earphone transmission mode of Bluetooth earphones, the relative phase of audio playback between the master earphone and the slave earphone must meet a certain index requirement, i.e., be smaller than a certain threshold, otherwise it will cause playback asynchronism that can be audibly perceived by a user. Summary of the Invention [Problem to be solved by the invention]

[0003] However, there is a natural deviation between the crystal vibration frequencies of the crystal vibration elements of the master earphone and the slave earphone, and the relative phase between them inevitably increases over time, causing asynchronous playback that can be audibly perceived by users. Therefore, there is an urgent need to solve the asynchronous playback problem between the master earphone and the slave earphone of Bluetooth earphones. [Means for solving the problem]

[0004] In view of the above technical problems, a frequency adjustment method, a device, a Bluetooth earphone, a storage medium and a program product are provided to solve the problem of asynchronous playback between dual earphones in a Bluetooth earphone.

[0005] In a first aspect, the present application provides a frequency adjustment method, the frequency adjustment method being used in a slave earphone of a Bluetooth earphone set including a master earphone and a slave earphone, receiving a signaling packet periodically transmitted from the master earphone at intervals of a first time period, the signaling packet including a target sample point identifier and a Bluetooth clock of the master earphone corresponding to the target sample point identifier; obtaining, based on the target sample point identifier, the Bluetooth clock of the slave earphone corresponding to the target sample point identifier; calculating a difference between the Bluetooth clock of the master earphone and the Bluetooth clock of the slave earphone as a first phase difference; if the first phase difference satisfies a phase compensation condition, performing a fast phase compensation process on a clock frequency of the slave earphone based on the first phase difference, the fast phase compensation process including determining that the first phase difference is equal to or greater than a predetermined threshold; after performing an adjustment process on the clock frequency of the slave earphone, redetermining a second phase difference between the Bluetooth clock of the slave earphone and the Bluetooth clock of the master earphone; and performing an adjustment process on the clock frequency of the slave earphone again based on the first phase difference and the second phase difference.

[0006] In one embodiment, performing high-speed phase compensation on the clock frequency of the slave earphone based on the first phase difference includes: determining a first time adjustment interval, and obtaining a clock frequency difference based on the first time adjustment interval and the first phase difference; obtaining a first update frequency based on the clock frequency of the slave earphone and the clock frequency difference; and adjusting the clock frequency of the slave earphone to the first update frequency, wherein the first time adjustment interval is a time interval during which the slave earphone adjusts its clock frequency to the first update frequency.

[0007] In one embodiment, determining the first time adjustment interval comprises: determining a maximum frequency adjustment value based on a clock frequency of the slave earphone; and calculating the first time adjustment interval based on the first phase difference and the maximum frequency adjustment value.

[0008] In one embodiment, determining the first time adjustment interval comprises: This includes setting a preset time adjustment interval as the first time adjustment interval, or setting the first time period as the first time adjustment interval.

[0009] In one embodiment, the frequency adjustment method further includes: if the first time adjustment interval is greater than the first time period, not calculating an updated phase difference between the master earphone and the slave earphone if the signaling packet is received within the first time adjustment interval, and calculating an updated phase difference between the master earphone and the slave earphone if the signaling packet is received outside the first time adjustment interval.

[0010] In one embodiment, performing a readjustment process on the clock frequency of the slave earphone based on the first phase difference and the second phase difference includes: the method includes: calculating a target difference value between the first phase difference and the second phase difference when the second phase difference is smaller than a preset threshold; obtaining a frequency deviation based on the target difference value and a second time adjustment interval obtained by the difference between the time corresponding to the second phase difference and the time corresponding to the first phase difference; performing a frequency synchronization adjustment process on the clock frequency of the slave earphone based on the frequency deviation when the frequency deviation is equal to or greater than a preset frequency adjustment step; and performing a cumulative phase fine adjustment process on the clock frequency of the slave earphone based on a minimum frequency step when the frequency deviation is smaller than the preset frequency adjustment step, wherein performing the frequency synchronization adjustment process on the clock frequency of the slave earphone based on the frequency deviation includes obtaining a second update frequency based on the frequency deviation and the clock frequency of the slave earphone, and adjusting the clock frequency of the slave earphone to the second update frequency within the first time period.

[0011] In one embodiment, performing a cumulative phase fine adjustment process on the clock frequency of the slave earphone based on the minimum frequency step includes: if the Bluetooth clock corresponding to the master earphone leads the Bluetooth clock corresponding to the slave earphone, adjusting the clock frequency of the slave earphone within the first time period to a first clock frequency value that is the clock frequency of the slave earphone plus one minimum frequency step; and if the Bluetooth clock corresponding to the master earphone lags behind the Bluetooth clock corresponding to the slave earphone, adjusting the clock frequency of the slave earphone to a second clock frequency value, which is the clock frequency of the slave earphone minus one minimum frequency step, within the first time period.

[0012] In one embodiment, the frequency adjusting method further comprises: determining whether a phase divergence condition is satisfied based on the first phase difference and the second phase difference, where the phase divergence condition includes that a product of the first phase difference and the second phase difference is greater than zero and that the absolute value of the first phase difference is greater than the absolute value of the second phase difference; if the phase divergence condition is satisfied, determining a target frequency adjustment value and sending the target frequency adjustment value to the master earphone, where the target frequency adjustment value is for instructing the master earphone to adjust its own clock frequency based on the target frequency adjustment value; if the phase divergence condition is not satisfied and the second phase difference is greater than the preset threshold, performing a high-speed phase compensation process on the clock frequency of the slave earphone based on the second phase difference.

[0013] In one embodiment, the slave earphone stores a plurality of sets of correspondence relationships between phase difference intervals and frequency adjustment values, and determining the target frequency adjustment value includes determining a target difference value between the first phase difference and the second phase difference, determining a target phase difference interval to which the target difference value belongs based on the target difference value, and setting the frequency adjustment value corresponding to the target phase difference interval as the target frequency adjustment value.

[0014] In a second aspect, the present application further provides a frequency adjusting device, the frequency adjusting device being used in a slave earphone of a Bluetooth earphone set including a master earphone and a slave earphone, the device comprising: a receiving module configured to receive a signaling packet periodically transmitted from the master earphone at intervals of a first time period, the signaling packet including a target sample point identifier and a Bluetooth clock of the master earphone corresponding to the target sample point identifier; an acquisition module for acquiring a Bluetooth clock of the slave earphone corresponding to the target sample point identifier according to the target sample point identifier; a calculation module for calculating a difference between a Bluetooth clock of the master earphone and a Bluetooth clock of the slave earphone as a first phase difference; a first adjustment module that performs high-speed phase compensation processing on the clock frequency of the slave earphone based on the first phase difference when the first phase difference satisfies a phase compensation condition, including determining that the first phase difference is equal to or greater than a preset threshold; a determining module for re-determining a second phase difference between the Bluetooth clock of the slave earphone and the Bluetooth clock of the master earphone after performing an adjustment process on the clock frequency of the slave earphone; and a second adjustment module that performs an adjustment process on the clock frequency of the slave earphone again based on the first phase difference and the second phase difference.

[0015] In one embodiment, the first adjustment module specifically includes: configured to determine a first time adjustment interval, obtain a clock frequency difference based on the first time adjustment interval and the first phase difference, obtain a first update frequency based on the clock frequency of the slave earphone and the clock frequency difference, and adjust the clock frequency of the slave earphone to the first update frequency, wherein the first time adjustment interval is a time interval during which the slave earphone adjusts its clock frequency to the first update frequency.

[0016] In one embodiment, the first adjustment module specifically includes: It is configured to determine a maximum frequency adjustment value based on a clock frequency of the slave earphone, and calculate the first time adjustment interval based on the first phase difference and the maximum frequency adjustment value.

[0017] In one embodiment, the first adjustment module specifically includes: A preset time adjustment interval is set as the first time adjustment interval, or the first time period is set as the first time adjustment interval.

[0018] In one embodiment, the apparatus further comprises: and a phase calculation module that, if the first time adjustment interval is greater than the first time period, does not calculate the latest phase difference between the master earphone and the slave earphone if the signaling packet is received within the first time adjustment interval, but calculates the latest phase difference between the master earphone and the slave earphone if the signaling packet is received outside the first time adjustment interval.

[0019] In one embodiment, the second adjustment module specifically includes: If the second phase difference is smaller than a preset threshold, calculate a target difference value between the first phase difference and the second phase difference; obtain a frequency deviation based on the target difference value and a second time adjustment interval obtained by the difference between a time corresponding to the second phase difference and a time corresponding to the first phase difference; if the frequency deviation is equal to or greater than a preset frequency adjustment step, perform a frequency synchronization adjustment process on the clock frequency of the slave earphone based on the frequency deviation; if the frequency deviation is smaller than the preset frequency adjustment step, perform a cumulative phase fine adjustment process on the clock frequency of the slave earphone based on a minimum frequency step; performing a frequency synchronization adjustment process on the clock frequency of the slave earphone based on the frequency deviation includes obtaining a second update frequency based on the frequency deviation and the clock frequency of the slave earphone, and adjusting the clock frequency of the slave earphone to the second update frequency within the first time period.

[0020] In one embodiment, the second adjustment module specifically includes: The Bluetooth earphone is configured to adjust, within the first time period, the clock frequency of the slave earphone to a first clock frequency value that is the clock frequency of the slave earphone plus one minimum frequency step if the Bluetooth clock corresponding to the master earphone leads the Bluetooth clock corresponding to the slave earphone, and to adjust, within the first time period, the clock frequency of the slave earphone to a second clock frequency value that is the clock frequency of the slave earphone minus one minimum frequency step if the Bluetooth clock corresponding to the master earphone lags the Bluetooth clock corresponding to the slave earphone.

[0021] In one embodiment, the apparatus further comprises: a divergence determination module that determines whether a phase divergence condition is met based on the first phase difference and the second phase difference, where the phase divergence condition includes that a product of the first phase difference and the second phase difference is greater than zero and the absolute value of the first phase difference is greater than the absolute value of the second phase difference; if the phase divergence condition is met, determine a target frequency adjustment value and send the target frequency adjustment value to the master earphone, where the target frequency adjustment value instructs the master earphone to adjust its clock frequency based on the target frequency adjustment value; if the phase divergence condition is not met and the second phase difference is greater than the preset threshold, perform a high-speed phase compensation process on the clock frequency of the slave earphone based on the second phase difference.

[0022] In one embodiment, the slave earphone stores a plurality of pairs of correspondence relationships between phase difference intervals and frequency adjustment values, and the divergence determination module specifically: A target difference value between the first phase difference and the second phase difference is determined, a target phase difference interval to which the target difference value belongs is determined based on the target difference value, and a frequency adjustment value corresponding to the target phase difference interval is set as the target frequency adjustment value.

[0023] In a third aspect, the present application further provides a Bluetooth earphone including a master earphone and a slave earphone, the slave earphone including a memory and a processor, wherein a computer program is stored in the memory, and the steps of the method according to any one of the first aspects are implemented when the processor executes the computer program.

[0024] In a fourth aspect, the present application further provides a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, causes the steps of the method of any one of the first aspects above to be implemented.

[0025] In a fifth aspect, the present application further provides a computer program product, the computer program product comprising a computer program which, when running on a processor, causes the steps of the method of any one of the first aspects above to be implemented.

[0026] (Effects of the Invention) The above-mentioned frequency adjustment method, device, Bluetooth earphone, storage medium, and program product can be used in a slave earphone in a Bluetooth earphone set including a master earphone and a slave earphone. The slave earphone can receive a signaling packet periodically transmitted from the master earphone, the signaling packet including a target sample point identifier and the Bluetooth clock of the master earphone corresponding to the target sample point identifier, and obtain the Bluetooth clock of the slave earphone corresponding to the target sample point identifier based on the target sample point identifier. The slave earphone can calculate a difference between the Bluetooth clock of the master earphone and the Bluetooth clock of the slave earphone as a first phase difference. By determining the first phase difference between the Bluetooth clock of the slave earphone and the Bluetooth clock of the master earphone, if the first phase difference satisfies a phase compensation condition, the slave earphone can perform a fast phase compensation process on the clock frequency of the slave earphone based on the first phase difference. After performing an adjustment process on the clock frequency of the slave earphone, the slave earphone can re-determine a second phase difference between the Bluetooth clock of the slave earphone and the Bluetooth clock of the master earphone, and re-adjust the clock frequency of the slave earphone based on the first phase difference and the second phase difference. In this way, when it is determined that the first phase difference satisfies the phase compensation condition, it can be determined that the playback between the master earphone and the slave earphone is asynchronous. Furthermore, by performing high-speed phase compensation processing on the clock frequency of the slave earphone, the clock frequencies of the master earphone and the slave earphone are substantially synchronized, and phase compensation of the slave earphone is realized, thereby quickly reducing the relative phase between the master earphone and the slave earphone and quickly tracking the playback frequency.Considering that there always exists a deviation between the crystal oscillation frequencies of the master earphone and the slave earphone, after performing an adjustment process on the clock frequency of the slave earphone based on the first phase difference, subsequently determine a second phase difference, and perform an adjustment process on the clock frequency of the slave earphone again based on the first phase difference and the second phase difference, thereby accurately synchronizing the clock frequencies of the master earphone and the slave earphone, avoiding asynchronous playback that is auditorily perceptible to the user when the two earphones play audio, and ensuring the synchronization of playback between the two earphones.

[0027] In order to more clearly explain the embodiments of the present invention or the technical solutions of the prior art, the drawings necessary for describing the embodiments or the prior art will be briefly described. The drawings described below are only shown in the embodiments of the present invention, and it is clear that those skilled in the art can obtain drawings of other embodiments based on these drawings without any creative efforts. [Brief explanation of the drawings]

[0028] [Figure 1] FIG. 2 is a diagram illustrating an application environment of a frequency adjustment method according to an embodiment. [Figure 2] FIG. 1 is a schematic diagram of a flowchart of a frequency adjustment method according to an embodiment. [Figure 3] FIG. 10 is a schematic diagram of a flowchart for adjusting a clock frequency according to an embodiment. [Figure 4] FIG. 10 is a schematic diagram of a flowchart for determining a first time adjustment interval according to an embodiment. [Figure 5] FIG. 10 is a schematic diagram of a flowchart for adjusting another clock frequency according to an embodiment. [Figure 6] FIG. 10 is a schematic diagram of a flowchart for determining a target frequency adjustment value according to one embodiment. [Figure 7] FIG. 10 is a schematic diagram of a flowchart of a readjustment process according to an embodiment. [Figure 8] FIG. 1 is a schematic diagram of a flow chart of frequency synchronization for dual earphones according to an embodiment. [Figure 9]FIG. 1 is a schematic diagram of frequency alignment according to one embodiment. [Figure 10] 10A and 10B are schematic diagrams illustrating the effect of adjusting the phase difference of a dual earphone according to an embodiment. [Figure 11] FIG. 1 is a block diagram of a frequency adjustment device according to an embodiment. [Figure 12] FIG. 2 is a diagram illustrating the internal configuration of a computer device according to an embodiment. DETAILED DESCRIPTION OF THE INVENTION

[0029] The technical solutions in the embodiments of the present application will be described below clearly and completely with reference to the drawings in the embodiments of the present application. However, it is clear that the described embodiments are only a part of the embodiments of the present application, and do not represent all of the embodiments. Other embodiments that can be obtained by a person skilled in the art based on the embodiments of the present application without requiring creative efforts also fall within the scope of protection of the present application. Furthermore, the specific embodiments described in this specification are merely for the purpose of interpreting the present application, and are not intended to limit the present application.

[0030] Bluetooth earphones are currently a commonly used electronic device. Generally, a Bluetooth earphone includes two earphones: a master earphone and a slave earphone.

[0031] In Bluetooth dual earphone transmission mode, the relative phase of the audio playback between the master earphone and the slave earphone must meet certain index requirements; otherwise, audible asynchronous playback will occur. However, there is a natural deviation in the crystal oscillation frequencies of the clocks of the master earphone and the slave earphone, which will inevitably result in significant differences in the relative phase over time. Therefore, it is necessary to solve the asynchronous playback problem between the master earphone and the slave earphone in Bluetooth earphones.

[0032] In view of this, the embodiments of the present application provide a frequency adjustment method for Bluetooth earphones, thereby solving the problem of the master earphone and the slave earphone being out of synchronization in Bluetooth earphones.

[0033] The frequency adjustment method provided in the embodiments of the present application can be applied to the application environment shown in Figure 1. The Bluetooth earphones include a master earphone 101 and a slave earphone 102. During use, the master earphone 101 is connected to a terminal 103 and establishes a first link, thereby transmitting audio data, control data, etc. The master earphone 101 is connected to a slave earphone 102 and establishes a second link, thereby realizing information exchange between the two earphones, such as transmitting signaling packets, etc. The slave earphone 102 is connected to the terminal 103 and establishes a third link, thereby transmitting audio data, control data, etc. It should be noted that the master earphone and the slave earphone in the embodiments of the present application are relative concepts. The Bluetooth earphones include two earphones, and the master earphone 101 may be one of the two earphones, and the slave earphone 102 may be the other of the two earphones; however, the embodiments of the present application do not specifically limit this. The terminal 103 may be an electronic device capable of establishing a connection with a Bluetooth earphone, such as, but not limited to, various personal computers, laptops, smartphones, tablet computers, Internet of Things devices, and portable wearable devices. The Internet of Things devices may be smart speakers, smart TVs, smart air conditioners, smart car devices, etc. The portable wearable devices may be smart watches, smart bracelets, head-mounted devices, etc., but the embodiments of the present application are not specifically limited thereto.

[0034] In one embodiment, a frequency adjustment method is provided as shown in FIG. 2 , and is described by taking the application of the frequency adjustment method to the slave earphone 102 shown in FIG. 1 as an example. The frequency adjustment method includes the following steps:

[0035] In step 201, a signaling packet including a target sample point identifier and the Bluetooth clock of the master earphone corresponding to the target sample point identifier is received, the signaling packet being periodically transmitted from the master earphone at intervals of a first time period.

[0036] To achieve synchronous tracking, the master earphone needs to send playback synchronization information to the slave earphone. Accordingly, the master earphone can periodically send a signaling packet to the slave earphone, the signaling packet including a target sample point identifier and the Bluetooth clock of the master earphone. The Bluetooth clock of the master earphone in the signaling packet corresponds to the target sample point identifier. Different sample point data can correspond to different sample point identifiers, which are used to mark the sample point data. As can be understood, the target sample point identifier is an identifier for marking the target sample point data.

[0037] In this way, the slave earphone can determine, based on the target sample point identifier, its own Bluetooth clock corresponding to the target sample point identifier, i.e., the Bluetooth clock of the slave earphone.

[0038] Optionally, the length of the period during which the master earphone transmits the signaling packet is a first time period, and the first time period may be determined based on the DAC (Digital to Analog Converter) frequency deviation of the audio playback of the master earphone and the slave earphone, that is, when the DAC frequency deviation of the audio playback of the master earphone and the slave earphone is different, the length of the period during which the corresponding master earphone transmits the signaling packet is different, under the requirement that the phase difference between them does not exceed one sampling point.

[0039] For example, if the DAC frequency deviation between the master earphone and the slave earphone is 1 ppm, and the phase deviation between the master earphone and the slave earphone can reach one sampling point in an accumulation of 22.65 seconds, the first time period in which the master earphone transmits a signaling packet should be less than 22.65 seconds, e.g., 22 seconds. ppm stands for parts per million, and when used to represent frequency deviation, it represents the amount of deviation allowed at a particular center frequency.

[0040] Table 1 shows the corresponding required times for different DAC frequency deviations between the master earphone and the slave earphone to exceed one sampling point. Therefore, by setting a specific value of the corresponding first time period based on the corresponding relationship shown in Table 1, it is possible to ensure that the phase deviation between the master earphone and the slave earphone does not exceed one sampling point.

[0041] [Table 1]

[0042] Optionally, if the DAC frequency deviation between the master earphone and the slave earphone is less than or equal to 10 ppm, the first time period for exchanging signaling packets between the master earphone and the slave earphone may be set to any value between 1 and 3 seconds.

[0043] In step 202, based on the target sample point identifier, obtain the Bluetooth clock of the slave earphone corresponding to the target sample point identifier.

[0044] To enable the slave earphone to obtain the Bluetooth clock of the slave earphone corresponding to the target sample point identifier, the embodiments of the present application provide multiple methods for the master earphone and the slave earphone to store the correspondence between different sampling point identifiers and Bluetooth clocks, thereby ensuring that the slave earphone can accurately obtain the Bluetooth clock of the corresponding slave earphone.

[0045] In one alternative embodiment, the master earphone and the slave earphone can store corresponding sampling point identifiers and corresponding Bluetooth clocks at the same sampling point period. For example, the master earphone and the slave earphone both store corresponding Bluetooth clocks at a period of 40,000 sampling point data, i.e., the master earphone and the slave earphone store a correspondence between the sampling point identifiers and the Bluetooth clocks corresponding to one sampling point data every 40,000 sampling point data.

[0046] In a second alternative embodiment, the master earphone and the slave earphone can store corresponding sampling point identifiers with the same Bluetooth clock period. For example, the master earphone and the slave earphone both store corresponding sampling point identifiers with a period of 1 second, i.e., the interval between Bluetooth clock 1 corresponding to sampling point identifier 1 and Bluetooth clock 2 corresponding to sampling point identifier 2 is 1 second. Optionally, the Bluetooth clock period time may be other values, which are not specifically limited herein.

[0047] In the third alternative embodiment, the master earphone and the slave earphone respectively store Bluetooth clocks corresponding to different sampling point identifiers. Thus, after the slave earphone receives a signaling packet, if the sampling point identifier corresponding to the currently played sampling point data is different from the sampling point identifier in the signaling packet sent by the master earphone, the slave earphone needs to perform a conversion to determine the Bluetooth clock of the slave earphone corresponding to the same sampling point identifier.

[0048] For example, at time t1 before transmitting the signaling packet, the master earphone reads the sampling point identifier corresponding to the currently played sampling point data and the master earphone's Bluetooth clock, and defines the master earphone's Bluetooth clock as PD(N)_main, where N is the sampling point identifier of the sampling point data currently played by the master earphone. When the slave earphone receives the signaling packet at time t2, the slave earphone reads the sampling point identifier of the currently played sampling point data and the corresponding slave earphone's Bluetooth clock, and defines the slave earphone's Bluetooth clock as PD(M)_sub, where M is the sampling point identifier of the currently played sampling point data by the slave earphone. In this way, the slave earphone can calculate and obtain the master earphone's Bluetooth clock PD(M)_main = PD(N)_main + (M-N) / SR corresponding to the sampling point identifier M.

[0049] At this time, since PD(M)_main and PD(M)_sub are both Bluetooth clocks corresponding to the sampling point identifier M, the phase difference between the master earphone and the slave earphone, for example, the first phase difference described below, can be calculated based on PD(M)_main and PD(M)_sub.

[0050] Optionally, the slave earphone may calculate the Bluetooth clock PD(N)_sub of the slave earphone corresponding to sampling point identifier N based on the difference between M and N, SR and PD(N)_main, and calculate the phase difference between them based on PD(N)_main and PD(N)_sub.

[0051] SR refers to the DAC sampling rate of the audio, and the value of SR can be transmitted by the terminal to the slave earphone via the third link.

[0052] In step 203, calculate the difference between the Bluetooth clock of the master earphone and the Bluetooth clock of the slave earphone as a first phase difference.

[0053] In the process of the Bluetooth earphone and the terminal establishing a Bluetooth connection and playing audio data, the terminal can transmit the audio data to be played to the master earphone and the slave earphone respectively, and optionally, the master earphone can transmit synchronous playback start information to the slave earphone, so that both earphones play the audio data simultaneously.

[0054] The master earphone and the slave earphone each use their own crystal oscillator to play the audio data. During playback, the clock frequencies at which the master earphone and the slave earphone play the audio data differ due to the different frequencies of their respective crystal oscillators. This may lead to a persistent accumulation of a relative phase difference between the master earphone and the slave earphone over time, which may cause the master earphone and the slave earphone to be unable to play the audio data in sync. Therefore, it is necessary to determine the phase difference between the master earphone and the slave earphone, i.e., the first phase difference. Based on the first phase difference, it is determined whether the difference in clock frequency between the master earphone and the slave earphone is large, and then the clock frequency is adjusted accordingly.

[0055] The sound to be played in both the master earphone and the slave earphone can be divided into multiple sampling point data, each sampling point data corresponding to a different Bluetooth clock, i.e., the sampling point data is played at a time corresponding to a different Bluetooth clock. Therefore, the master earphone can obtain its own Bluetooth clock corresponding to the target sample point data and send it to the slave earphone, so that the slave earphone can obtain its own Bluetooth clock corresponding to the target sample point data, and obtain the first phase difference based on the Bluetooth clock of the master earphone and the Bluetooth clock of the slave earphone corresponding to the same target sample point data.

[0056] Alternatively, the target sample point data may be the Bluetooth clock corresponding to the sampling point data currently being played by the master earphone, or may be the Bluetooth clock corresponding to any sampling point data in the master earphone, and is not specifically limited here.

[0057] After obtaining the Bluetooth clock of the master earphone and the Bluetooth clock of the slave earphone corresponding to the target sample point identifier, the slave earphone can determine the difference between the Bluetooth clock of the master earphone and the Bluetooth clock of the slave earphone to obtain a first phase difference.

[0058] As can be appreciated, the first phase difference may optionally be obtained by subtracting the Bluetooth clock of the slave earphone from the Bluetooth clock of the master earphone, where a first phase difference greater than zero means that the Bluetooth clock of the master earphone leads the Bluetooth clock of the slave earphone, and a first phase difference less than zero means that the Bluetooth clock of the master earphone lags the Bluetooth clock of the slave earphone.

[0059] Alternatively, the first phase difference may be obtained by subtracting the Bluetooth clock of the master earphone from the Bluetooth clock of the slave earphone, where a first phase difference greater than zero means that the Bluetooth clock of the master earphone lags behind the Bluetooth clock of the slave earphone, and a first phase difference less than zero means that the Bluetooth clock of the master earphone leads the Bluetooth clock of the slave earphone.

[0060] In step 204, if the first phase difference satisfies the phase compensation condition, perform a fast phase compensation process on the clock frequency of the slave earphone based on the first phase difference.

[0061] Because there is a correspondence between the phase and the clock frequency, determining whether the first phase difference satisfies the phase compensation condition determines whether an adjustment process needs to be performed on the clock frequency of the slave earphone, thereby reducing the difference in clock frequency between the master earphone and the slave earphone. Correspondingly, adjusting the clock frequency of the slave earphone also reduces the relative phase difference between the master earphone and the slave earphone.

[0062] In an embodiment of the present application, whether the clock frequency of the slave earphone needs to be adjusted is determined by detecting whether the first phase difference satisfies a phase compensation condition. The phase compensation condition includes the first phase difference being equal to or greater than a predetermined threshold. In other words, the frequency adjustment method further includes, after determining the first phase difference, detecting whether the first phase difference is equal to or greater than a predetermined threshold, and determining that the first phase difference satisfies the phase compensation condition if the first phase difference is equal to or greater than the predetermined threshold.

[0063] If the first phase difference is greater than or equal to a preset threshold, the relative phase difference between the master earphone and the slave earphone is large, and the slave earphone's clock frequency needs to be adjusted to ensure immediate synchronized playback. The slave earphone can then adjust its clock frequency based on the first phase difference to achieve phase compensation. The first phase difference may be expressed as the absolute value of the difference between the Bluetooth clock of the master earphone and the Bluetooth clock of the slave earphone. Thus, the preset threshold may be greater than zero, thereby quickly determining whether the first phase difference between the master earphone and the slave earphone satisfies the phase compensation condition. The value of the preset threshold may be determined according to actual circumstances and is not specifically limited herein.

[0064] In step 205, after performing an adjustment process on the clock frequency of the slave earphone, re-determine a second phase difference between the Bluetooth clock of the slave earphone and the Bluetooth clock of the master earphone.

[0065] After performing an adjustment process on the clock frequency of the slave earphone based on the first phase difference, the relative phase difference between the master earphone and the slave earphone is reduced, and basic synchronization can be achieved between the master earphone and the slave earphone. However, as mentioned above, due to a natural deviation in the crystal oscillation frequencies of the master earphone and the slave earphone, after performing the adjustment process based on the first phase difference, the clock frequency of the slave earphone needs to be adjusted again based on the second phase difference to ensure more accurate synchronization between the master earphone and the slave earphone.

[0066] Alternatively, the master earphone can periodically send a Bluetooth clock corresponding to different sample point data to the slave earphone, so that after performing an adjustment process on the clock frequency of the slave earphone, the slave earphone can determine a second phase difference based on the Bluetooth clock of the master earphone corresponding to another target sample point data recently received by the master earphone and the Bluetooth clock of the slave earphone corresponding to the other target sample point data, and then adjust its clock frequency again based on the first phase difference and the second phase difference.

[0067] In step 206, the clock frequency of the slave earphone is adjusted again based on the first phase difference and the second phase difference.

[0068] The slave earphone determines a frequency deviation based on the difference between the first phase difference and the second phase difference, and then, based on the relationship between the frequency deviation and the preset adjustment step, adjusts the clock frequency of the slave earphone again based on the frequency deviation, or adjusts the clock frequency of the slave earphone again based on the preset minimum frequency adjustment step, thereby accurately synchronizing the frequencies of the two.

[0069] The frequency adjustment method determines a first phase difference between the Bluetooth clock of the slave earphone and the Bluetooth clock of the master earphone. If the first phase difference satisfies a phase compensation condition, the method performs a fast phase compensation process on the clock frequency of the slave earphone based on the first phase difference. After performing an adjustment process on the clock frequency of the slave earphone, the method re-determines a second phase difference between the Bluetooth clock of the slave earphone and the Bluetooth clock of the master earphone, and performs another adjustment process on the clock frequency of the slave earphone based on the first and second phase differences. In this way, if it is determined that the first phase difference satisfies the phase compensation condition, it is determined that the playback between the master earphone and the slave earphone is asynchronous. By performing an adjustment process on the clock frequency of the slave earphone, the clock frequencies of the master earphone and the slave earphone are nearly synchronized, thereby achieving phase compensation for the slave earphone, rapidly reducing the relative phase between the master earphone and the slave earphone and quickly tracking the playback frequency. Considering that there always exists a deviation between the crystal oscillation frequencies of the master earphone and the slave earphone, after performing an adjustment process on the clock frequency of the slave earphone based on the first phase difference, subsequently determine a second phase difference, and perform an adjustment process on the clock frequency of the slave earphone again based on the first phase difference and the second phase difference, thereby accurately synchronizing the clock frequencies of the master earphone and the slave earphone, avoiding asynchronous playback that is auditorily perceptible to the user when the two earphones play audio, and ensuring the synchronization of playback between the two earphones.

[0070] In an embodiment of the present application, the master earphone periodically transmits signaling packets to the slave earphone, and the slave earphone calculates a first phase difference between the two based on the signaling packets to determine whether the clock frequency of the slave earphone needs to be adjusted, thereby ensuring frequency synchronization between the two and realizing immediate phase compensation. Because the phase deviation corresponding to the period in which the master earphone transmits signaling packets does not exceed one sampling point, the relative phase of the dual earphones can be rapidly reduced and the clock frequency can be rapidly tracked, while maintaining the relative phase difference between the two to be no more than one audio sampling point. This prevents the master earphone and the slave earphone from becoming out of sync with each other, ensuring the normal use of the Bluetooth earphones.

[0071] In an embodiment of the present application, if the first phase difference satisfies the phase compensation condition, the clock frequency of the slave earphone is adjusted based on the first phase difference. That is, during the process of the master earphone and the slave earphone exchanging signaling packets, the absolute value of the relative phase difference between them is calculated, and if the absolute value of the relative phase difference is equal to or greater than a preset threshold, the slave earphone is subjected to fast phase compensation to reduce the relative phase difference between them. This fast phase compensation process uses one frequency adjustment value to directly adjust the clock frequency of the slave earphone once within the next time interval Δt, thereby achieving complete phase compensation of the slave earphone and quickly reducing the relative phase difference between the dual earphones. The process of adjusting the clock frequency of the slave earphone based on the first phase difference is described below.

[0072] Referring to FIG. 3 , a schematic diagram of a flowchart for adjusting a clock frequency provided by an embodiment of the present application is shown, where performing fast phase compensation processing on the clock frequency of the slave earphone based on the first phase difference includes the following steps:

[0073] In step 301, a first time adjustment interval is determined, and a clock frequency difference is obtained based on the first time adjustment interval and a first phase difference.

[0074] The first time adjustment interval is the time period during which the slave earphone adjusts its clock frequency to the first update frequency, that is, the time interval Δt described above.

[0075] In one alternative embodiment of the present application, a schematic diagram of a flow chart for determining a first time adjustment interval is shown, as shown in Figure 4. Determining the first time adjustment interval includes the following steps:

[0076] In step 401, a maximum frequency adjustment value is determined based on the clock frequency of the slave earphone.

[0077] In step 402, a first time adjustment interval is calculated based on the first phase difference and the maximum frequency adjustment value.

[0078] The clock frequency of the slave earphone is the current clock frequency that the slave earphone needs to adjust. Optionally, based on the current clock frequency of the slave earphone, determine in real time the maximum deviation amount that the clock frequency of the slave earphone can be adjusted, and set the maximum deviation amount as the maximum frequency adjustment value Δf max Optionally, the value of this maximum offset may be preset in the slave earphone, so that this maximum offset is the maximum frequency adjustment value.

[0079] As a result, as can be seen from the relationship between clock frequency and phase, θ0 = Δf max *Δt, where θ is the first phase difference and Δt is the first time adjustment interval. Correspondingly, the first time adjustment interval Δt=θ / Δf max That is, the first time adjustment interval value can be obtained by dividing the first phase difference by the maximum frequency adjustment value.

[0080] In another optional embodiment of the present application, determining the first time adjustment interval includes setting a preset time adjustment interval as the first time adjustment interval, or setting a first time period as the first time adjustment interval.

[0081] The preset time adjustment interval may be a specific adjustment interval value preset in the slave earphone, and the slave earphone directly uses the preset time adjustment interval as the first time adjustment interval to improve calculation efficiency. Alternatively, the slave earphone may directly use the first time period as the first time adjustment interval. For example, after the slave earphone receives a first signaling packet, it receives a second signaling packet after a first time period has elapsed. When the slave earphone receives the first signaling packet, it directly determines a first phase difference and a first update frequency based on the first signaling packet, thereby achieving an adjustment to the clock frequency of the slave earphone before receiving the second signaling packet, i.e., within the first time period.

[0082] In another optional embodiment of the present application, at time t1, the master earphone sends a signaling packet to the slave earphone, including a Bluetooth clock p1 of the master earphone corresponding to a target sample point identifier, and the slave earphone determines that the Bluetooth clock of the slave earphone corresponding to the target sample point identifier is q1. After receiving the signaling packet sent by the master earphone, the slave earphone can calculate a first phase difference θ0, for example, θ0 = q1 - p1. Let t2 be the time at which the slave earphone plays the sampling point data next to the sampling point data corresponding to the target sample point identifier. Optionally, the first time adjustment interval Δt may be t2 - t1. Optionally, the first time adjustment interval Δt may be approximately equal to the value of t2 - t1, which is not specifically limited herein.

[0083] In step 302, obtain a first updated frequency based on the clock frequency of the slave earphone and the clock frequency difference.

[0084] Furthermore, the goal of fast phase compensation is to complete the compensation of the first phase difference θ within the first time adjustment interval Δt, i.e., ΔF*Δt=θ. Based on this, the clock frequency difference ΔF can be obtained based on the first time adjustment interval and the first phase difference, i.e., ΔF=θ / Δt. The unit of the clock frequency difference ΔF is ppm.

[0085] In step 303, the clock frequency of the slave earphone is adjusted to the first update frequency.

[0086] The clock frequency of the slave earphone is the current clock frequency F that the slave earphone needs to adjust, and then the first update frequency F_new can be obtained based on the difference between the clock frequency of the slave earphone that currently needs to be adjusted and the clock frequency difference, i.e., F_new=F-ΔF. Furthermore, by adjusting the clock frequency F of the slave earphone to F_new, phase compensation is realized.

[0087] In alternative embodiments of the present application, the adjustment may be relative to the clock frequency of the slave earphone, or relative to the DAC frequency of the slave earphone, or relative to another clock crystal frequency of the slave earphone (e.g., a 48 MHz crystal frequency).

[0088] When adjusting for the DAC frequency, F is the DAC sampling frequency of the current slave earphone, and the difference in clock frequency is ΔF'. ΔF' is obtained by converting ΔF to the DAC sampling frequency value. For example, if the DAC sampling rate is 44.1 kHz, then ΔF' = ΔF * 44.1 kHz. Also, when adjusting for a 48 MHz crystal oscillation frequency, then ΔF' = ΔF * 48 MHz.

[0089] For ease of understanding, one specific example will be given below for explanation, but it is not intended to limit the present application.

[0090] Assume that the accuracy of the Bluetooth clock is 0.25 μs. At time t1, the Bluetooth clock p1 of the master earphone corresponding to the target sample point identifier of the master earphone is 1000, and the Bluetooth clock q1 of the slave earphone corresponding to the target sample point identifier of the slave earphone is 1100. Then, the first phase difference is 100*0.25 μs=25 μs.

[0091] For example, if Δt1 = 1 second, then ΔF = 25 μs / 1 s = 25 ppm. Then, ΔF' = β * ΔF, where β is a scaling factor. When adjusting for the DAC frequency, β is the DAC sampling frequency, e.g., 44.1 kHz. That is, ΔF' = 44.1 kHz * 25 / 106 = 1.1025 Hz.

[0092] If the current DAC frequency F is 44.1kHz, then F_new = F - ΔF´ = 44.1kHz - 1.1025 Hz = 44.0988975Hz, so the DAC frequency of the slave earphone should be adjusted to 44.0988975Hz.

[0093] Note that the above-described accurate calculation is merely an example, and in the embodiment of the present application, a balance between computational resources and effectiveness is achieved using simplified approximate calculations.

[0094] Here, the preset time adjustment interval is set as a first time adjustment interval, and the clock frequency difference is calculated based on the first time adjustment interval, and the first update frequency is obtained. The clock frequency of the slave earphone is adjusted based on the obtained first update frequency. If the clock frequency of the slave earphone cannot be adjusted to match the clock frequency value of the master earphone in one go, the phase difference between the clock frequency of the master earphone and the clock frequency of the slave earphone calculated next time still satisfies the phase compensation condition. Therefore, a new first update frequency is determined next time, and the current clock frequency of the slave earphone is adjusted to match the clock frequency values ​​of the two earphones, so that the playback is nearly synchronized.

[0095] In an embodiment of the present application, a clock frequency difference is obtained based on the first time adjustment interval and the first phase difference, a first update frequency is obtained based on the clock frequency of the slave earphone and the clock frequency difference, and the clock frequency of the slave earphone is adjusted to the first update frequency. In this way, the clock frequency of the slave earphone can be adjusted to the first update frequency within the first time adjustment interval, and the master earphone and the slave earphone can be phase-matched and synchronously played when playing the sampling point data after the first time adjustment interval.

[0096] In one embodiment, the frequency adjustment method further includes: if the first time adjustment interval is greater than the first time period, not calculating an updated phase difference between the master earphone and the slave earphone if a signaling packet is received within the first time adjustment interval, and calculating an updated phase difference between the master earphone and the slave earphone if a signaling packet is received outside the first time adjustment interval.

[0097] Each time the slave earphone receives a signaling packet sent from the master earphone, it can determine the Bluetooth clock of the corresponding slave earphone based on the target sample point identifier in the signaling packet, and then calculate the current phase difference between the master earphone and the slave earphone based on the Bluetooth clock of the master earphone and the Bluetooth clock of the slave earphone. However, before receiving the next signaling packet, i.e., within the first time adjustment interval, the slave earphone needs to perform the clock frequency adjustment operation described above. Before the clock frequency adjustment is completed, there is no need to calculate the latest phase difference between the two. Based on this, in an embodiment of the present application, in order to reduce unnecessary processing and the calculation complexity of the slave earphone, if the first time adjustment interval is greater than the first time period, the slave earphone may have received the latest signaling packet before the clock frequency adjustment is completed. If the signaling packet is received within the first time adjustment interval, the slave earphone does not calculate the latest phase difference between the master earphone and the slave earphone; if the clock frequency adjustment is completed, that is, if the signaling packet is received outside the first time adjustment interval, the slave earphone calculates the latest phase difference between the master earphone and the slave earphone, and determines the next adjustment processing plan based on the calculated latest phase difference.

[0098] Optionally, after the absolute value of the relative phase difference between the dual earphones decreases to be smaller than a preset threshold, the embodiment of the present application further adopts a frequency synchronization method to achieve precise synchronization of the clock frequencies between them.

[0099] During the fast phase compensation, one possible case is that the clock frequency of the master earphone is within the adjustable range of the clock frequency of the slave earphone, i.e., the slave earphone can synchronize with the clock frequency of the master earphone by adjusting its clock frequency to the first updated frequency. Another possible case is that the clock frequency of the master earphone is outside the adjustable range of the clock frequency of the slave earphone, i.e., after adjusting its clock frequency to the first updated frequency, the slave earphone still cannot synchronize with the clock frequency of the master earphone, and the phase difference between them is still greater than the preset threshold.

[0100] In the latter case, in the embodiment of the present application, the slave earphone sends a target frequency adjustment value to the master earphone, and the master earphone actively adjusts its own clock frequency to achieve synchronization between the two. The following describes this process.

[0101] Referring to FIG. 5, another flowchart diagram of adjusting a clock frequency provided by an embodiment of the present application is shown, and the frequency adjusting method further includes the following steps:

[0102] In step 501, it is determined whether a phase divergence condition is met based on the first phase difference and the second phase difference.

[0103] The phase divergence condition includes that the product of the first phase difference and the second phase difference is greater than zero and the absolute value of the first phase difference is greater than the absolute value of the second phase difference.

[0104] The second phase difference is obtained based on the Bluetooth clock of the master earphone and the Bluetooth clock of the slave earphone in the signaling packet received by the master earphone after the slave earphone adjusts its clock frequency based on the first phase difference.

[0105] The phase divergence condition is satisfied when the product of the first phase difference and the second phase difference is greater than zero and the absolute value of the first phase difference is greater than the absolute value of the second phase difference. The phase divergence condition is satisfied if, at time t1 corresponding to the first phase difference, the playback time of the slave earphone is not synchronized with that of the master earphone, and the absolute value of the first phase difference is greater than zero; after fast phase compensation, at time t2 corresponding to the second phase difference, the playback time of the slave earphone is still not synchronized with that of the master earphone, and the absolute value of the second phase difference is greater than zero, and possibly the absolute value of the second phase difference is greater than the absolute value of the first phase difference, and both are greater than zero, i.e., the slave earphone still cannot synchronize with the clock frequency of the master earphone even after adjusting its own clock frequency. In this case, the slave earphone can notify the master earphone to adjust its own clock frequency through signaling exchange.

[0106] In step 502, if the phase divergence condition is met, determine a target frequency adjustment value and send the target frequency adjustment value to the master earphone, which is used to instruct the master earphone to adjust its clock frequency based on the target frequency adjustment value.

[0107] Specifically, if the phase divergence condition is met, the slave earphone needs to determine a target frequency adjustment value and send the target frequency adjustment value to the master earphone, so that the master earphone adjusts its clock frequency based on the target frequency adjustment value. Optionally, the slave earphone can send a signaling packet including the target frequency adjustment value to the master earphone to achieve the transmission of the target frequency adjustment value.

[0108] In one alternative embodiment of the present application, a specific frequency step can be defined based on test data, and the specific frequency step is sent to the master earphone as a target frequency adjustment. For the master earphone, if the Bluetooth clock of the master earphone leads the Bluetooth clock of the slave earphone, the master earphone determines a target update frequency value based on the difference between the target frequency adjustment and its own current clock frequency, and adjusts its own current Bluetooth clock to the target update frequency value. Correspondingly, if the Bluetooth clock of the master earphone lags the Bluetooth clock of the slave earphone, the master earphone determines a target update frequency value based on the sum of the target frequency adjustment and its own current clock frequency, and adjusts its own current Bluetooth clock to the target update frequency value.

[0109] In another optional embodiment of the present application, the slave earphone can determine the target frequency adjustment value from a plurality of frequency steps based on the first phase difference and the second phase difference, specifically as follows:

[0110] Referring to FIG. 6, a flowchart of determining a target frequency adjustment value according to an embodiment of the present application is shown. The determining a target frequency adjustment value includes the following steps:

[0111] In step 601, a target difference value between the first phase difference and the second phase difference is determined.

[0112] In step 602, a target phase difference interval to which the target difference value belongs is determined based on the target difference value.

[0113] In step 603, the frequency adjustment value corresponding to the target phase difference interval is set as the target frequency adjustment value.

[0114] The target difference value is the absolute value of the difference between the first phase difference and the second phase difference. The slave earphone stores a plurality of pairs of correspondence relationships between phase difference intervals and frequency adjustment values. The target difference value should belong to a target difference value interval among the plurality of pairs of phase difference intervals. Correspondingly, the frequency adjustment value corresponding to the target difference value interval can be transmitted to the master earphone as the target frequency adjustment value.

[0115] Alternatively, the slave earphone may store multiple pairs of correspondence relationships between phase differences and frequency adjustment values, and the slave earphone may set the frequency adjustment value corresponding to the phase difference equal to the target difference value as the target frequency adjustment value. Referring to Table 2, Table 2 shows multiple pairs of correspondence relationships between phase differences and frequency adjustment values, and the values ​​F_step_1 to F_step_n monotonically increase or decrease.

[0116] [Table 2]

[0117] Note that, when determining the target frequency adjustment value based on Table 2, as described above, the first phase difference θ0 and the second phase difference θ1 have the same sign, i.e., their product is greater than zero. Furthermore, if the Bluetooth clock of the master earphone leads the Bluetooth clock of the slave earphone, a negative frequency adjustment value in Table 2 is taken as the target frequency adjustment value, so that the master earphone decreases its own clock frequency based on the target frequency adjustment value. If the Bluetooth clock of the master earphone lags the Bluetooth clock of the slave earphone, a positive frequency adjustment value in Table 2 is taken as the target frequency adjustment value, so that the master earphone increases its own clock frequency based on the target frequency adjustment value, so that the two earphones are synchronized. Alternatively, if θ1 > θ0 > 0, the sign of the frequency adjustment value in Table 2 is “-”, if θ1 < θ0 < 0, the sign of the frequency adjustment value in Table 2 is “+”, if θ1 = θ0, if θ1 > 0, the sign is “-”, and if θ1 < 0, the sign is “+”.

[0118] In step 503, if the phase divergence condition is not met and the second phase difference is greater than the preset threshold, perform a fast phase compensation process on the clock frequency of the slave earphone according to the second phase difference.

[0119] The process of performing high-speed phase compensation on the clock frequency of the slave earphone based on the second phase difference is identical to the process of performing high-speed phase compensation on the clock frequency of the slave earphone based on the first phase difference, as described above, i.e., determining a new first time adjustment interval, obtaining a new clock frequency difference based on the new first time adjustment interval and the second phase difference, obtaining a new first update frequency based on the clock frequency of the slave earphone and the new clock frequency difference, and adjusting the clock frequency of the slave earphone to the new first update frequency, where the new first time adjustment interval is the time interval during which the slave earphone adjusts its clock frequency to the new first update frequency. Correspondingly, the process of determining the new first time adjustment interval can be referred to the process of determining the first time adjustment interval as described above.

[0120] Furthermore, after performing the fast phase compensation process on the clock frequency of the slave earphone based on the second phase difference, if it is again detected that the third phase difference between the master earphone and the slave earphone is smaller than the preset threshold, it will accordingly perform an adjustment process on the clock frequency of the slave earphone again based on the second phase difference and the third phase difference, where the adjustment process may be a frequency synchronization adjustment process on the clock frequency of the slave earphone based on the frequency deviation, or an adjustment process on the clock frequency of the slave earphone based on the minimum frequency step.

[0121] In an embodiment of the present application, a target difference value between the first phase difference and the second phase difference is determined, and a target phase difference section to which the target difference value belongs is determined based on the target difference value. The slave earphone takes the frequency adjustment value corresponding to the target phase difference section as the target frequency adjustment value, thereby determining a target frequency adjustment value that is relatively suitable for the current frequency difference between the master earphone and the slave earphone from among multiple frequency adjustment values, and adjusting the clock frequency of the master earphone based on the target frequency adjustment value, thereby improving the accuracy and reliability of the adjustment and realizing a fast reduction in the relative phase of the dual earphones and a fast tracking of the playback frequency.

[0122] As described above, the slave earphone adjusts its clock frequency based on the first phase difference, or the master earphone adjusts its clock frequency based on the target frequency adjustment value, so that the relative phase difference between the master earphone and the slave earphone can be reduced to within the preset threshold, i.e., the phases of the two earphones are nearly synchronized. Then, to ensure accurate synchronization between the two earphones, the slave earphone can undergo subsequent frequency synchronization adjustment, i.e., the clock frequency of the slave earphone is adjusted again. The process of adjusting the clock frequency of the slave earphone again is described below.

[0123] Referring to FIG. 7, a schematic flowchart of the readjustment process provided by the embodiment of the present application is shown, where performing the readjustment process on the clock frequency of the slave earphone based on the first phase difference and the second phase difference includes the following steps:

[0124] In step 701, if the second phase difference is smaller than a preset threshold, a target difference value between the first phase difference and the second phase difference is calculated.

[0125] In step 702, a frequency deviation is obtained based on a target difference value and a second time adjustment interval.

[0126] In step 703, if the frequency deviation is equal to or greater than the preset frequency adjustment step, perform a frequency synchronization adjustment process on the clock frequency of the slave earphone based on the frequency deviation.

[0127] The second phase difference being smaller than the preset threshold may mean that the absolute value of the second phase difference is smaller than the preset threshold, which indicates that the relative phase difference between the master earphone and the slave earphone is relatively small, as a result of the slave earphone adjusting its own clock frequency or the master earphone adjusting its own clock frequency as described above, and in this case, further frequency synchronization adjustment may be performed.

[0128] The second time adjustment interval is obtained by the difference between the time corresponding to the second phase difference and the time corresponding to the first phase difference. Note that the second phase difference is a relative concept. If the relative phase difference between the master earphone and the slave earphone is smaller than a preset threshold after the slave earphone adjusts its clock frequency based on the first phase difference, the second phase difference is a second difference calculated based on the Bluetooth clock transmitted by the master earphone and the Bluetooth clock of the corresponding slave earphone after the slave earphone adjusts its clock frequency. If the relative phase difference between the master earphone and the slave earphone is still larger than the preset threshold after the slave earphone adjusts its clock frequency based on the first phase difference, the master earphone needs to adjust its clock frequency based on the aforementioned target frequency adjustment value. The second phase difference is a third difference calculated based on the Bluetooth clock of the master earphone transmitted by the master earphone and the Bluetooth clock of the corresponding slave earphone after the master earphone adjusts its clock frequency.

[0129] For example, at a sampling point identifier k2 (corresponding to time t2) where a signaling packet is exchanged after Δt1, the slave earphone calculates a first phase difference θ1. At this time, the value of θ1 can decrease until it becomes smaller than a preset threshold. At sampling point identifier k3 (corresponding to time t3), the slave earphone calculates a second phase difference θ2. Then, the target difference value Δθ2 = θ2 - θ1. Δθ2 represents the difference between the two phase differences.

[0130] Then, the frequency deviation Δf2 between the corresponding master earphone and slave earphone is Δf2=Δθ2 / Δt2, where Δt2 is the second time adjustment interval and Δt2=t3−t2. The unit of Δθ2 may be microseconds (μs), the unit of Δt2 may be seconds (s), and the unit of Δf2 may be ppm correspondingly.

[0131] Based on the frequency deviation, in the embodiment of the present application, a preset frequency adjustment step is defined, and if the frequency deviation is equal to or greater than the preset frequency adjustment step, it means that the current phase difference between the master earphone and the slave earphone is smaller than the preset threshold but still greater than the threshold corresponding to the preset frequency adjustment step, and the clock frequency still needs to be further adjusted.

[0132] In one embodiment, performing a frequency synchronization adjustment process on the clock frequency of the slave earphone based on the frequency deviation includes obtaining a second updated frequency based on the frequency deviation and the clock frequency of the slave earphone, and adjusting the clock frequency of the slave earphone to the second updated frequency within the first time period.

[0133] If the slave earphone lags behind the master earphone, the second update frequency F_new2 is equal to the slave earphone's current clock frequency F plus the frequency deviation Δf2. If the slave earphone leads the master earphone, the second update frequency F_new2 is equal to the slave earphone's current clock frequency F minus the frequency deviation Δf2. The current clock frequency of the slave earphone is adjusted to the second update frequency F_new2 within the next adjustment period, i.e., the phase difference between the master earphone and the slave earphone is reduced as quickly as possible to be smaller than the preset frequency adjustment step, thereby achieving maximum frequency synchronization. The next adjustment period may be the first time period, thus achieving a quick adjustment to the slave earphone's clock frequency before receiving the next signaling packet and calculating the phase difference therebetween.

[0134] Alternatively, as described above, when adjusting for other clock crystal frequencies, the corresponding frequency deviation can be determined based on Δf2 and a scaling factor, i.e., F' is equal to β*Δf2.

[0135] To reduce the difficulty of implementation, the clock frequency of the slave earphone can be adjusted triggered using a minimum step method: if the minimum step requirement is met, adjust; otherwise, do not adjust. Alternatively, the exact calculation in the embodiment of this application is merely an example, and a simplified approximate calculation may be used, thereby achieving a balance between computational resources and effectiveness.

[0136] In step 704, if the frequency deviation is smaller than the preset frequency adjustment step, perform a cumulative phase fine adjustment process on the clock frequency of the slave earphone based on the minimum frequency step.

[0137] If the frequency deviation is smaller than the preset frequency adjustment step, it means that the difference between the phase of the master earphone and the current phase of the slave earphone is small, and the frequencies of the two are nearly synchronized. However, since a small frequency deviation can cause a large phase difference due to long-term accumulation, the slave earphone's clock frequency is continuously subjected to cumulative phase adjustment based on the defined minimum frequency step to maintain the most accurate synchronization between them.

[0138] In one embodiment, the cumulative phase fine-adjustment process performs a cumulative phase fine-adjustment process on the clock frequency of the slave earphone based on the minimum frequency step, wherein the cumulative phase fine-adjustment process adjusts the clock frequency of the slave earphone to a first clock frequency value, the first clock frequency value being the clock frequency of the slave earphone plus one minimum frequency step, within a first time period if the Bluetooth clock corresponding to the master earphone leads the Bluetooth clock corresponding to the slave earphone, and adjusts the clock frequency of the slave earphone to a second clock frequency value, the second clock frequency value being the clock frequency of the slave earphone minus one minimum frequency step, within the first time period if the Bluetooth clock corresponding to the master earphone lags the Bluetooth clock corresponding to the slave earphone.

[0139] In an embodiment of the present application, a minimum frequency step may be defined. If the frequency deviation is smaller than the preset frequency adjustment step, the master earphone and the slave earphone are considered to be nearly identical in frequency. At this time, the clock frequency of the slave earphone can be fine-tuned based on the current phase difference between the master earphone and the slave earphone.

[0140] If the main Bluetooth clock corresponding to the master earphone leads the sub-Bluetooth clock corresponding to the slave earphone, the clock frequency of the slave earphone is adjusted to increase by one minimum frequency step, i.e., the clock frequency of the slave earphone is adjusted to the sum of the slave earphone's clock frequency and the minimum frequency step. If the main Bluetooth clock corresponding to the master earphone lags the sub-Bluetooth clock corresponding to the slave earphone, the clock frequency of the slave earphone is adjusted to decrease by one minimum frequency step, i.e., the clock frequency of the slave earphone is adjusted to the difference between the slave earphone's clock frequency and the minimum frequency step.

[0141] In the embodiment of the present application, the clock frequency of the slave earphone is adjusted again within the first time period based on the first phase difference and the second phase difference, thereby achieving accurate synchronization of the audio playback between the master earphone and the slave earphone, with a synchronization error smaller than one playback sampling point. From the perspective of system implementation, this process has good stability, simple processing logic, and good implementation efficiency.

[0142] The following provides a specific dual earphone frequency synchronization method to describe the master earphone and slave earphone frequency synchronization adjustment process in the embodiment of the present application.Referring to Figure 8, this figure shows a schematic diagram of the dual earphone frequency synchronization flow chart provided by the embodiment of the present application.

[0143] First, the master earphone establishes a Bluetooth first link connection with the smart device, then the master earphone establishes a second link connection with the slave earphone, and the slave earphone establishes a third link connection (monitoring link) with the smart device. The master earphone periodically transmits a signaling packet containing playback sampling point information to the slave earphone, and the playback sampling point information includes a sampling point ID and Bluetooth clock information.

[0144] When the slave earphone receives the signaling packet, it calculates the phase difference θ0 between the Bluetooth clock of the master earphone and the Bluetooth clock of the slave earphone corresponding to the same sampling point ID, and determines whether the absolute value abs(θ0) of θ0 is greater than or equal to a first threshold θ_Thre1. If the absolute value abs(θ0) is greater than or equal to the first threshold θ_Thre1, it executes a fast phase compensation algorithm, i.e., determines a first update frequency based on the phase difference θ0, and adjusts the current clock frequency of the slave earphone to the first update frequency. If the absolute value abs(θ0) is less than the first threshold θ_Thre1, it continues to receive the signaling packet sent from the master earphone, calculates a new phase difference θ2 between the Bluetooth clock of the master earphone and the Bluetooth clock of the slave earphone, calculates a phase deviation Δθ2 based on θ0 and θ2, and obtains a frequency deviation Δf based on the phase deviation.

[0145] After executing the phase compensation algorithm, i.e., adjusting the clock frequency of the slave earphone, the phase difference θ1 between the Bluetooth clock of the master earphone and the Bluetooth clock of the slave earphone is calculated again to determine whether θ1 converges (i.e., whether θ1 diverges). The method for determining whether θ1 converges is to determine whether the following two conditions are simultaneously met: (1) θ0 and θ1 have the same sign (θ1 * θ0 > 0), and (2) θ1 ≥ θ0 > 0 or θ1 ≤ θ0 < 0.

[0146] If the above two conditions are met, θ1 does not converge, that is, θ1 diverges, meaning that after the slave earphone adjusts its clock frequency, the phase difference between it and the master earphone is still greater than the first threshold. The slave earphone sends a signaling packet containing a target frequency adjustment value to the master earphone, so that the master earphone adjusts its clock frequency based on the target frequency adjustment value. After adjusting its clock frequency, the master earphone continues to periodically send a signaling packet containing a sampling point ID and a corresponding Bluetooth clock to the slave earphone.

[0147] If the above two conditions are not met, θ1 converges, that is, θ1 does not diverge, which means that after the slave earphone adjusts its clock frequency, the phase difference between it and the master earphone is still smaller than the first threshold. In this case, it continues to receive signaling packets sent from the master earphone, calculates a new phase difference θ2 between the Bluetooth clock of the master earphone and the Bluetooth clock of the slave earphone, calculates a phase deviation Δθ2 based on θ0 and θ2, and obtains a frequency deviation Δf based on the phase deviation.

[0148] If the phase difference between the master earphone and the slave earphone is smaller than the first threshold, calculate the frequency deviation Δf, determine whether the frequency deviation Δf is equal to or greater than the minimum frequency step F_minstep, and if so, execute the frequency synchronization adjustment algorithm, i.e., perform an adjustment process on the clock frequency of the slave earphone again based on the phase differences θ0 and θ2.

[0149] By executing the frequency synchronization adjustment algorithm, the clock frequency of the master earphone and the clock frequency of the slave earphone are aligned, so that the master earphone and the slave earphone can play sampling point data corresponding to the same sampling point ID at the same time. For example, refer to FIG. 9, which shows a schematic diagram of frequency alignment provided by an embodiment of the present application. Δt1 to Δtn-1 represent different time intervals, k1 to kn are sampling point IDs corresponding to the sampling point data, p1 to pn are the Bluetooth clocks of the master earphone corresponding to each sampling point ID, respectively, and q1 to qn are the Bluetooth clocks of the slave earphone corresponding to each sampling point ID, respectively. As can be seen, sampling point k1 corresponds to the Bluetooth clock p1 of the master earphone and the Bluetooth clock q1 of the slave earphone.

[0150] Also, if the frequency deviation Δf is smaller than the minimum frequency step F_minstep, a cumulative phase fine-tuning operation needs to be performed. For example, if the phase difference θ between them is greater than zero (the master earphone lags the slave earphone), the clock frequency F of the slave earphone is adjusted to decrease by one step, and if the phase difference θ between them is less than or equal to zero (the master earphone leads the slave earphone), the clock frequency F of the slave earphone is adjusted to increase by one step.

[0151] Alternatively, if the phase difference θ between the slave earphone and the master earphone is determined to be greater than or equal to the second threshold θ_Three2 before adjusting the clock frequency F of the slave earphone to increase or decrease it by one step, the clock frequency F of the slave earphone is adjusted to increase or decrease by one step, and if the phase difference θ between the slave earphone and the master earphone is determined to be less than the second threshold θ_Three2, the clock frequency F of the slave earphone is not adjusted. Note that during this process, the master earphone periodically sends signaling packets to the slave earphone.

[0152] Specifically, taking the first threshold θ_Thre1 as an example, and the signaling exchange period in which the master earphone sends signaling packets as 1 second, the above-described dual earphone frequency synchronization method can be used to obtain the schematic diagram of the effect of phase difference adjustment for the dual earphones shown in Figure 10. As can be seen, if the initial phase difference is greater than the first threshold θ_Thre1, the phase difference is directly reduced to within 5 μs within the next adjustment period using a fast phase compensation method. In the subsequent phase monitoring process, if the phase difference between the master earphone and the slave earphone is smaller than the first threshold θ_Thre1, the frequency synchronization method is used to achieve frequency synchronization for the dual earphones, and the phase difference between the dual earphones is small.

[0153] In the embodiment of the present application, based on the above-mentioned dual earphone frequency synchronization method, the relative phase of the dual earphones can be quickly reduced, the playback frequency can be quickly tracked, and the relative phase difference can be maintained at no more than one audio sampling point, thereby achieving accurate synchronization of the audio playback of the master earphone and the slave earphone. From the perspective of system implementation, this method has good stability, simple processing logic, and good effectiveness.

[0154] It should be understood that although the steps in the flowcharts according to the above embodiments are displayed in order according to the direction of the arrows, these steps are not necessarily executed in the order according to the direction of the arrows. Unless explicitly stated otherwise in this specification, the execution of these steps is not limited to a strict order, and these steps may be executed in other orders. Furthermore, at least some of the steps in the flowcharts according to the above embodiments may include multiple steps or multiple stages, and these steps or stages may not necessarily be executed at the same time but may be executed at different times. The order in which these steps or stages are executed is also not necessarily sequential, and they may be executed in order or alternately with other steps or at least some of the steps or stages in other steps.

[0155] Based on the same inventive idea, the embodiments of the present application further provide a frequency adjustment device for implementing the above-described frequency adjustment method. The means for solving the problem provided by the device are similar to those described in the above-described method, so that the specific limitations of one or more embodiments of the frequency adjustment device provided in the embodiments can be referred to the limitations of the above-described frequency adjustment method and will not be repeated here.

[0156] In one embodiment, a frequency adjusting device is provided, as shown in Figure 11, where the frequency adjusting device 1100 is used in a slave earphone of a Bluetooth earphone, where the Bluetooth earphone includes a master earphone and a slave earphone, and the frequency adjusting device 1100 includes a receiving module 1101, an obtaining module 1102, a calculating module 1103, a first adjusting module 1104, a determining module 1105, and a second adjusting module 1106.

[0157] The receiving module 1101 receives a signaling packet periodically transmitted from the master earphone at intervals of a first time period, the signaling packet including a target sample point identifier and a Bluetooth clock of the master earphone corresponding to the target sample point identifier.

[0158] The obtaining module 1102 obtains, based on the target sample point identifier, the Bluetooth clock of the slave earphone corresponding to the target sample point identifier.

[0159] The calculation module 1103 determines the difference between the Bluetooth clock of the master earphone and the Bluetooth clock of the slave earphone to obtain a first phase difference.

[0160] The first adjustment module 1104 performs a high-speed phase compensation process on the clock frequency of the slave earphone based on the first phase difference if the first phase difference satisfies a phase compensation condition, and the phase compensation condition includes that the first phase difference is greater than or equal to a preset threshold.

[0161] The determining module 1105 re-determines a second phase difference between the Bluetooth clock of the slave earphone and the Bluetooth clock of the master earphone after performing an adjustment process on the clock frequency of the slave earphone.

[0162] The second adjustment module 1106 performs an adjustment process again on the clock frequency of the slave earphone based on the first phase difference and the second phase difference.

[0163] In one embodiment, the first adjustment module 1104 specifically: determine a first time adjustment interval, obtain a clock frequency difference based on the first time adjustment interval and the first phase difference, obtain a first update frequency based on the clock frequency of the slave earphone and the clock frequency difference, and adjust the clock frequency of the slave earphone to the first update frequency, the first time adjustment interval being a time interval during which the slave earphone adjusts its own clock frequency to the first update frequency;

[0164] In one embodiment, the first adjustment module 1104 specifically: A maximum frequency adjustment value is determined based on a clock frequency of the slave earphone, and the first time adjustment interval is calculated based on the first phase difference and the maximum frequency adjustment value.

[0165] In one embodiment, the first adjusting module 1104 specifically sets a preset time adjustment interval as the first time adjustment interval, or sets the first time period as the first time adjustment interval.

[0166] In one embodiment, the apparatus further comprises a phase calculation module; If the first time adjustment interval is greater than the first time period, the phase calculation module does not calculate the latest phase difference between the master earphone and the slave earphone if the signaling packet is received within the first time adjustment interval, but calculates the latest phase difference between the master earphone and the slave earphone if the signaling packet is received outside the first time adjustment interval.

[0167] In one embodiment, the second adjustment module 1106 specifically: If the second phase difference is smaller than a predetermined threshold, a target difference value between the first phase difference and the second phase difference is calculated, and a frequency deviation is obtained based on the target difference value and a second time adjustment interval, the second time adjustment interval being obtained by calculating the difference between the time corresponding to the second phase difference and the time corresponding to the first phase difference; if the frequency deviation is equal to or greater than a predetermined frequency adjustment step, a frequency synchronization adjustment process is performed on the clock frequency of the slave earphone based on the frequency deviation; if the frequency deviation is smaller than the predetermined frequency adjustment step, a cumulative phase fine adjustment process is performed on the clock frequency of the slave earphone based on a minimum frequency step; and a frequency synchronization adjustment process is performed on the clock frequency of the slave earphone based on the frequency deviation;

[0168] In one embodiment, the second adjustment module 1106 specifically: If the Bluetooth clock corresponding to the master earphone leads the Bluetooth clock corresponding to the slave earphone, adjust the clock frequency of the slave earphone to a first clock frequency value within the first time period, the first clock frequency value being the clock frequency of the slave earphone plus one minimum frequency step; if the Bluetooth clock corresponding to the master earphone lags the Bluetooth clock corresponding to the slave earphone, adjust the clock frequency of the slave earphone to a second clock frequency value within the first time period, the second clock frequency value being the clock frequency of the slave earphone minus one minimum frequency step.

[0169] In one embodiment, the apparatus further comprises a divergence determination module; The divergence determination module determines whether a phase divergence condition is met based on the first phase difference and the second phase difference, where the phase divergence condition includes that a product of the first phase difference and the second phase difference is greater than zero and the absolute value of the first phase difference is greater than the absolute value of the second phase difference. If the phase divergence condition is met, determine a target frequency adjustment value and send the target frequency adjustment value to the master earphone, where the target frequency adjustment value is for instructing the master earphone to adjust its clock frequency based on the target frequency adjustment value. If the phase divergence condition is not met and the second phase difference is greater than a preset threshold, perform a fast phase compensation process on the clock frequency of the slave earphone based on the second phase difference.

[0170] In one embodiment, the slave earphone stores a plurality of pairs of correspondence relationships between phase difference intervals and frequency adjustment values, and the divergence determination module specifically: A target difference value between the first phase difference and the second phase difference is determined, and a target phase difference interval to which the target difference value belongs is determined based on the target difference value, and a frequency adjustment value corresponding to the target phase difference interval is set as the target frequency adjustment value.

[0171] All or part of the modules in the frequency adjustment device may be realized by software, hardware, or a combination thereof. Each module may be built into a processor in a computer device in the form of hardware, or may be independent, or may be stored in a memory in a computer device in the form of software so that the processor can call and execute operations corresponding to each module.

[0172] In one embodiment, a computer device is provided, the internal configuration of which is shown in FIG. 12. The computer device includes a processor, a memory, an input / output interface (I / O), and a communication interface. The processor, memory, and I / O interface are connected via a system bus, and the communication interface is connected to the system bus via the I / O interface. The processor of the computer device is for providing calculation and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. An operating system, a computer program, and a database are stored in the non-volatile storage medium. The internal memory provides an environment for the execution of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is for storing frequency adjustment data. The I / O interface of the computer device is for the processor to exchange information with an external device. The communication interface of the computer device is for communicating with an external terminal via a network connection. A frequency adjustment method is implemented when the computer program runs on the processor.

[0173] As will be understood by those skilled in the art, the configuration shown in FIG. 12 is merely a block diagram of some configurations related to the technical solution of the present application, and does not limit the computer device to which the technical solution of the present application is applied; a specific computer device may include more or fewer components than those shown in the figure, may combine some components, or may have a different component arrangement.

[0174] In one embodiment, a Bluetooth earphone is provided, the Bluetooth earphone including a master earphone and a slave earphone, the slave earphone including a processor and a memory storing a computer program, the processor executing the computer program implementing the steps of each of the method embodiments.

[0175] In one embodiment, a computer-readable storage medium is provided, which stores a computer program that, when executed by a processor, implements the steps of each of the method embodiments described above.

[0176] In one embodiment, a computer program product is provided, the computer program product including a computer program that, when executed by a processor, implements the steps of each of the method embodiments described above.

[0177] As will be understood by those skilled in the art, all or part of the processes in the methods described above can be achieved by instructing relevant hardware using a computer program. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, the computer program can include the processes of the methods described above. Any reference to memory, database, or other medium used in the embodiments provided herein can include at least one of non-volatile and volatile memory. Non-volatile memory may include read-only memory (ROM), tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM®), phase change memory (PCM), graphene memory, etc. Volatile memory may include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, the RAM may be in various forms, such as, for example, static random access memory (SRAM) or dynamic random access memory (DRAM). The database according to each embodiment of the present application may include at least one of a relational database and a non-relational database. The non-relational database may include, but is not limited to, a distributed database based on blockchain. The processor according to each embodiment of the present application may be, but is not limited to, a general-purpose processor, a central processor, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc.

[0178] The technical features of the above-described embodiments can be combined in any manner. For the sake of brevity, not all combinations of the technical features in the above-described embodiments are described, but any combination of these technical features should be considered within the scope of the present specification unless there is a contradiction.

[0179] The above examples merely illustrate some embodiments of the present application, and although the descriptions are specific and detailed, they should not be construed as limiting the scope of protection of the invention. Those skilled in the art may make minor modifications and improvements without departing from the spirit of the present application, and all of these modifications and improvements are within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined in accordance with the claims.

Claims

1. A frequency adjustment method, comprising: The frequency adjusting method is used for a slave earphone of a Bluetooth earphone set, which includes a master earphone and a slave earphone; The frequency adjustment method includes: receiving a signaling packet periodically transmitted from the master earphone at intervals of a first time period, the signaling packet including a target sample point identifier and a Bluetooth clock of the master earphone corresponding to the target sample point identifier; According to the target sample point identifier, obtain a Bluetooth clock of the slave earphone corresponding to the target sample point identifier; calculating a difference between a Bluetooth clock of the master earphone and a Bluetooth clock of the slave earphone as a first phase difference; If the first phase difference satisfies a phase compensation condition, performing a high-speed phase compensation process on a clock frequency of the slave earphone based on the first phase difference, including the first phase difference being equal to or greater than a preset threshold value; redetermining a second phase difference between the Bluetooth clock of the slave earphone and the Bluetooth clock of the master earphone after performing an adjustment process on the clock frequency of the slave earphone; and and performing a re-adjustment process on the clock frequency of the slave earphone based on the first phase difference and the second phase difference.

2. performing high-speed phase compensation processing on the clock frequency of the slave earphone based on the first phase difference, determining a first time adjustment interval and obtaining a clock frequency difference based on the first time adjustment interval and the first phase difference; Obtaining a first update frequency based on a clock frequency of the slave earphone and a difference between the clock frequencies; adjusting a clock frequency of the slave earphone to the first update frequency; 2. The frequency adjusting method according to claim 1, wherein the first time adjustment interval is a time interval during which the slave earphone adjusts its clock frequency to the first update frequency.

3. Determining the first time adjustment interval comprises: determining a maximum frequency adjustment value based on a clock frequency of the slave earphone; and 3. The frequency adjustment method of claim 2, further comprising: calculating the first time adjustment interval based on the first phase difference and the maximum frequency adjustment value.

4. Determining the first time adjustment interval comprises: A preset time adjustment interval is set as the first time adjustment interval, or 4. The method of claim 3, further comprising: setting the first time period to the first time adjustment interval.

5. The frequency adjusting method further includes:

5. The frequency adjustment method of claim 4, further comprising: if the first time adjustment interval is greater than the first time period, not calculating the latest phase difference between the master earphone and the slave earphone if the signaling packet is received within the first time adjustment interval, and calculating the latest phase difference between the master earphone and the slave earphone if the signaling packet is received outside the first time adjustment interval.

6. performing a readjustment process on the clock frequency of the slave earphone based on the first phase difference and the second phase difference, If the second phase difference is smaller than a preset threshold, calculating a target difference value between the first phase difference and the second phase difference; acquiring a frequency deviation based on the target difference value and a second time adjustment interval obtained by a difference between a time corresponding to the second phase difference and a time corresponding to the first phase difference; If the frequency deviation is equal to or greater than a predetermined frequency adjustment step, performing a frequency synchronization adjustment process on the clock frequency of the slave earphone based on the frequency deviation; If the frequency deviation is smaller than the preset frequency adjustment step, performing a cumulative phase fine adjustment process on the clock frequency of the slave earphone based on a minimum frequency step; performing a frequency synchronization adjustment process on the clock frequency of the slave earphone based on the frequency deviation, 2. The frequency adjusting method of claim 1, further comprising: obtaining a second updated frequency based on the frequency deviation and the clock frequency of the slave earphone; and adjusting the clock frequency of the slave earphone to the second updated frequency within the first time period.

7. performing a cumulative phase fine adjustment on the clock frequency of the slave earphone based on the minimum frequency step; if the Bluetooth clock corresponding to the master earphone leads the Bluetooth clock corresponding to the slave earphone, adjusting the clock frequency of the slave earphone to a first clock frequency value that is the clock frequency of the slave earphone plus one minimum frequency step within the first time period; and adjusting, within the first time period, the clock frequency of the slave earphone to a second clock frequency value that is the clock frequency of the slave earphone minus one minimum frequency step if the Bluetooth clock corresponding to the master earphone lags the Bluetooth clock corresponding to the slave earphone.

8. The frequency adjusting method further includes: determining whether a phase divergence condition is satisfied based on the first phase difference and the second phase difference, the phase divergence condition including that a product of the first phase difference and the second phase difference is greater than zero and that an absolute value of the first phase difference is greater than an absolute value of the second phase difference; if the phase divergence condition is satisfied, determine a target frequency adjustment value, and send the target frequency adjustment value to the master earphone, the target frequency adjustment value being for instructing the master earphone to adjust its clock frequency based on the target frequency adjustment value; 2. The frequency adjusting method of claim 1, further comprising: if the phase divergence condition is not satisfied and the second phase difference is greater than the preset threshold, performing a high-speed phase compensation process on the clock frequency of the slave earphone based on the second phase difference.

9. a plurality of sets of correspondence relationships between phase difference intervals and frequency adjustment values ​​are stored in the slave earphone; determining the target frequency adjustment value determining a target difference value between the first phase difference and the second phase difference; determining a target phase difference section to which the target difference value belongs based on the target difference value; 9. The frequency adjustment method according to claim 8, further comprising: setting a frequency adjustment value corresponding to the target phase difference interval as the target frequency adjustment value.

10. A frequency adjustment device, The frequency adjusting device is used in a slave earphone of a Bluetooth earphone set including a master earphone and a slave earphone, The device comprises: a receiving module configured to receive a signaling packet periodically transmitted from a master earphone at intervals of a first time period, the signaling packet including a target sample point identifier and a Bluetooth clock of the master earphone corresponding to the target sample point identifier; an acquisition module for acquiring a Bluetooth clock of the slave earphone corresponding to the target sample point identifier according to the target sample point identifier; a calculation module for calculating a difference between a Bluetooth clock of the master earphone and a Bluetooth clock of the slave earphone as a first phase difference; a first adjustment module that performs high-speed phase compensation processing on a clock frequency of the slave earphone based on the first phase difference when the first phase difference satisfies a phase compensation condition, the high-speed phase compensation processing including determining whether the first phase difference is equal to or greater than a preset threshold; a determining module for re-determining a second phase difference between the Bluetooth clock of the slave earphone and the Bluetooth clock of the master earphone after performing an adjustment process on the clock frequency of the slave earphone; and a second adjustment module that performs a second adjustment process on the clock frequency of the slave earphone based on the first phase difference and the second phase difference.

11. The first adjustment module specifically includes: determining a first time adjustment interval; and obtaining a clock frequency difference based on the first time adjustment interval and the first phase difference; Obtain a first update frequency based on the clock frequency of the slave earphone and a difference between the clock frequencies; configured to adjust a clock frequency of the slave earphone to the first update frequency; 11. The frequency adjustment device according to claim 10, wherein the first time adjustment interval is a time period during which the slave earphone adjusts its clock frequency to the first update frequency.

12. The first adjustment module specifically includes: determining a maximum frequency adjustment value based on a clock frequency of the slave earphone; 12. The frequency adjustment device of claim 11, configured to calculate the first time adjustment interval based on the first phase difference and the maximum frequency adjustment value.

13. The first adjustment module specifically includes: A preset time adjustment interval is set as the first time adjustment interval, or 13. The frequency adjustment device of claim 12, configured to make the first time period the first time adjustment interval.

14. The apparatus further comprises:

14. The frequency adjustment device of claim 13, further comprising: a phase calculation module that, when the first time adjustment interval is greater than the first time period, does not calculate an updated phase difference between the master earphone and the slave earphone if the signaling packet is received within the first time adjustment interval, but calculates an updated phase difference between the master earphone and the slave earphone if the signaling packet is received outside the first time adjustment interval.

15. The second adjustment module specifically includes: If the second phase difference is smaller than a preset threshold, calculating a target difference value between the first phase difference and the second phase difference; acquiring a frequency deviation based on the target difference value and a second time adjustment interval obtained by a difference between a time corresponding to the second phase difference and a time corresponding to the first phase difference; If the frequency deviation is equal to or greater than a predetermined frequency adjustment step, perform a frequency synchronization adjustment process on the clock frequency of the slave earphone based on the frequency deviation; configured to perform a cumulative phase fine-adjustment process on the clock frequency of the slave earphone based on a minimum frequency step when the frequency deviation is smaller than the preset frequency adjustment step; performing a frequency synchronization adjustment process on the clock frequency of the slave earphone based on the frequency deviation, 11. The frequency adjusting device of claim 10, further comprising: obtaining a second updated frequency based on the frequency deviation and the clock frequency of the slave earphone; and adjusting the clock frequency of the slave earphone to the second updated frequency within the first time period.

16. The second adjustment module specifically includes: if the Bluetooth clock corresponding to the master earphone leads the Bluetooth clock corresponding to the slave earphone, adjust the clock frequency of the slave earphone to a first clock frequency value, which is the clock frequency of the slave earphone plus one minimum frequency step, within the first time period; 16. The frequency adjusting device of claim 15, configured to adjust the clock frequency of the slave earphone to a second clock frequency value that is the clock frequency of the slave earphone minus one minimum frequency step, within the first time period, if the Bluetooth clock corresponding to the master earphone lags behind the Bluetooth clock corresponding to the slave earphone.

17. The apparatus further comprises: a divergence determination module that determines whether a phase divergence condition is satisfied based on the first phase difference and the second phase difference; the phase divergence condition includes that a product of the first phase difference and the second phase difference is greater than zero and the absolute value of the first phase difference is greater than the absolute value of the second phase difference; if the phase divergence condition is satisfied, determine a target frequency adjustment value and send the target frequency adjustment value to the master earphone, the target frequency adjustment value being for instructing the master earphone to adjust its clock frequency based on the target frequency adjustment value; 11. The frequency adjustment device of claim 10, wherein, when the phase divergence condition is not satisfied and the second phase difference is greater than the preset threshold, high-speed phase compensation processing is performed on the clock frequency of the slave earphone based on the second phase difference.

18. A Bluetooth earphone, The Bluetooth earphones include a master earphone and a slave earphone; the slave earphone includes a memory and a processor; a computer program stored in the memory; A Bluetooth earphone, characterized in that, when the processor executes the computer program, the steps of the method according to any one of claims 1 to 9 are implemented.

19. A computer-readable storage medium, comprising: The computer-readable storage medium stores a computer program; A computer-readable storage medium, comprising the computer program, which, when executed by a processor, implements the steps of the method according to any one of claims 1 to 9.

20. 1. A computer program product comprising: the computer program product includes a computer program; A computer program product, characterized in that the steps of the method according to any one of claims 1 to 9 are implemented when the computer program runs on a processor.

Citation Information

Patent Citations

  • TWS earphone audio synchronous playing method and system and TWS earphone

    CN111817811A

  • Bluetooth equipment and Bluetooth clock calibration method and system thereof

    CN114697923A

  • Fast same-frequency and same-phase adjustment method and device for Bluetooth clock

    CN115038162A

  • A headset with multiple wirelessly linked earpieces.

    JP2010523018A

  • Communication system, master device, slave device and clock signal quality monitoring method

    JP2014045288A