Frequency adjustment method, device, Bluetooth headset, storage medium and program product
By receiving the signaling packets of the main ear and calculating the phase difference, adjusting the clock frequency of the slave ear, the problem of playback out of synchronization caused by the frequency deviation between the main ear and the slave ear in Bluetooth ear is solved, and synchronous playback of the audio is realized.
Patent Information
- Application Number
- CN202211572365.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-08
- Publication Date
- 2024-12-17
- Estimated Expiration
- 2042-12-08
AI Technical Summary
There is a deviation in the crystal oscillator frequency of the main ear and the slave ear in Bluetooth headphones, which causes the audio playback to be out of synchronization and causes the user's auditory inconsistency.
By receiving the signaling packet sent by the master ear, the Bluetooth clock of the slave ear is obtained and the phase difference is calculated. If the phase difference meets certain conditions, a fast phase compensation process is performed and the clock frequency of the slave ear is adjusted to realize the master ear and slave ear. The clock frequency is synchronized between them.
It effectively solves the problem of the out-of-sync between the main and slave ear playback of Bluetooth headphones, ensures the synchronization of audio playback, and reduces the user's sense of hearing inconsistency.
Smart Images

Figure CN115987478B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of electronic equipment, and in particular to a frequency adjustment method, device, Bluetooth headset, storage medium and program product. Background Art
[0002] Bluetooth headsets are currently common electronic devices, and usually include two earphones, a master earphone and a slave earphone. In the ear-to-ear transmission mode of Bluetooth headsets, the relative phase of the audio playback between the master ear and the slave ear must meet certain index requirements, that is, less than a certain threshold, otherwise it will cause the user to hear the playback asynchrony that is noticeable.
[0003] However, since there is a natural deviation in the crystal frequency of the crystal oscillator elements of the master ear and the slave ear, the relative phase between the two will inevitably be larger over time, causing the user to hear the playback asynchrony. Therefore, the problem of playback asynchrony between the master ear and the slave ear of Bluetooth headsets needs to be solved urgently. Summary of the invention
[0004] Based on this, it is necessary to provide a frequency adjustment method, device, Bluetooth headset, storage medium and program product that can solve the problem of asynchronous playback of Bluetooth headsets to ears in response to the above technical problems.
[0005] In a first aspect, the present application provides a frequency adjustment method for a slave ear of a Bluetooth headset, the Bluetooth headset comprising a master ear and a slave ear, the method comprising:
[0006] A signaling packet is received that is periodically sent by the master ear at intervals of a first time period, wherein the signaling packet includes a target sample point identifier and a Bluetooth clock of the master ear corresponding to the target sample point identifier; according to the target sample point identifier, the Bluetooth clock of the slave ear corresponding to the target sample point identifier is acquired; the Bluetooth clock of the master ear is subtracted from the Bluetooth clock of the slave ear to obtain a first phase difference; if the first phase difference satisfies a phase compensation condition, a fast phase compensation process is performed on the clock frequency of the slave ear according to the first phase difference; the phase compensation condition includes that the first phase difference is greater than or equal to a preset threshold value; after adjusting the clock frequency of the slave ear, a second phase difference between the Bluetooth clock of the slave ear and the Bluetooth clock of the master ear is determined again; and the clock frequency of the slave ear is adjusted again according to the first phase difference and the second phase difference.
[0007] In one embodiment, the fast phase compensation processing is performed on the clock frequency of the slave ear according to the first phase difference, including:
[0008] Determine a first time adjustment interval, and obtain a differential clock frequency 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 ear and the differential clock frequency; adjust the clock frequency of the slave ear to the first update frequency; wherein the first time adjustment interval is the time interval during which the slave ear adjusts its own clock frequency to the first update frequency.
[0009] In one embodiment, determining the first time adjustment interval includes:
[0010] A maximum frequency adjustment value is determined according to the clock frequency of the slave ear; and a first time adjustment interval is calculated according to the first phase difference and the maximum frequency adjustment value.
[0011] In one embodiment, determining the first time adjustment interval includes:
[0012] The preset time adjustment interval is used as the first time adjustment interval; or the first time period is used as the first time adjustment interval.
[0013] In one of the embodiments, the method further includes: if the first time adjustment interval is greater than the first time period, then when the signaling packet is received within the first time adjustment interval, the latest phase difference between the master ear and the slave ear is not calculated, and when the signaling packet is received outside the first time adjustment interval, the latest phase difference between the master ear and the slave ear is calculated.
[0014] In one embodiment, the clock frequency of the slave ear is adjusted again according to the first phase difference and the second phase difference, including:
[0015] If the second phase difference is less than the preset threshold value, the target difference between the first phase difference and the second phase difference is calculated; the frequency deviation is obtained according to the target difference and the second time adjustment interval; the second time adjustment interval is obtained by subtracting the moment corresponding to the second phase difference from the moment corresponding to the first phase difference; when the frequency deviation is not less than the preset frequency adjustment step, the clock frequency of the slave ear is subjected to frequency synchronization adjustment processing according to the frequency deviation; when the frequency deviation is less than the preset frequency adjustment step, the clock frequency of the slave ear is subjected to cumulative phase fine-tuning processing according to the minimum frequency step; wherein, the frequency synchronization adjustment processing of the clock frequency of the slave ear according to the frequency deviation includes: obtaining a second update frequency according to the frequency deviation and the clock frequency of the slave ear, and adjusting the clock frequency of the slave ear to the second update frequency within the first time period.
[0016] In one embodiment, the cumulative phase fine-tuning process is performed on the clock frequency of the slave ear according to the minimum frequency step, comprising:
[0017] If the Bluetooth clock corresponding to the master ear is ahead of the Bluetooth clock corresponding to the slave ear, the clock frequency of the slave ear is adjusted to a first clock frequency value within the first time period, and the first clock frequency value is a value obtained by increasing the clock frequency of the slave ear by a minimum frequency step; if the Bluetooth clock corresponding to the master ear lags behind the Bluetooth clock corresponding to the slave ear, the clock frequency of the slave ear is adjusted to a second clock frequency value within the first time period, and the second clock frequency value is a value obtained by reducing the clock frequency of the slave ear by a minimum frequency step.
[0018] In one embodiment, the method further comprises:
[0019] Whether a phase divergence condition is satisfied is determined according to the first phase difference and the second phase difference; the phase divergence condition includes: 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; if the phase divergence condition is satisfied, a target frequency adjustment value is determined and sent to the master ear, and the target frequency adjustment value is used to instruct the master ear to adjust its own clock frequency according to the target frequency adjustment value; if the phase divergence condition is not satisfied and the second phase difference is greater than the preset threshold value, a fast phase compensation process is performed on the clock frequency of the slave ear according to the second phase difference.
[0020] In one of the embodiments, the slave ear stores a plurality of sets of correspondences between phase difference intervals and frequency adjustment values; determining the target frequency adjustment value includes: determining a target difference between the first phase difference and the second phase difference; determining a target phase difference interval to which the target difference belongs based on the target difference; and using the frequency adjustment value corresponding to the target phase difference interval as the target frequency adjustment value.
[0021] In a second aspect, the present application further provides a frequency adjustment device. Used in a slave ear of a Bluetooth headset, the Bluetooth headset comprising a master ear and a slave ear, the device comprising:
[0022] A receiving module, configured to receive a signaling packet periodically sent by the master ear at intervals of a first time period, the signaling packet including a target sample point identifier and a Bluetooth clock of the master ear corresponding to the target sample point identifier;
[0023] An acquisition module, used for acquiring the Bluetooth clock of the slave ear corresponding to the target sample point identifier according to the target sample point identifier;
[0024] A calculation module, used for calculating the difference between the Bluetooth clock of the master ear and the Bluetooth clock of the slave ear to obtain a first phase difference;
[0025] A first adjustment module, configured to perform fast phase compensation processing on the clock frequency of the slave ear according to the first phase difference if the first phase difference satisfies a phase compensation condition; the phase compensation condition includes that the first phase difference is greater than or equal to a preset threshold value;
[0026] a determination module, configured to determine again a second phase difference between the Bluetooth clock of the slave ear and the Bluetooth clock of the master ear after adjusting the clock frequency of the slave ear;
[0027] The second adjustment module is used to adjust the clock frequency of the slave ear again according to the first phase difference and the second phase difference.
[0028] In one embodiment, the first adjustment module is specifically used to:
[0029] Determine a first time adjustment interval, and obtain a differential clock frequency 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 ear and the differential clock frequency; adjust the clock frequency of the slave ear to the first update frequency; wherein the first time adjustment interval is the time interval during which the slave ear adjusts its own clock frequency to the first update frequency.
[0030] In one embodiment, the first adjustment module is specifically used to:
[0031] A maximum frequency adjustment value is determined according to the clock frequency of the slave ear; and a first time adjustment interval is calculated according to the first phase difference and the maximum frequency adjustment value.
[0032] In one embodiment, the first adjustment module is specifically used to:
[0033] The preset time adjustment interval is used as the first time adjustment interval; or the first time period is used as the first time adjustment interval.
[0034] In one embodiment, the device further comprises:
[0035] A phase calculation module is used for not calculating the latest phase difference between the master ear and the slave ear when the signaling packet is received within the first time adjustment interval if the first time adjustment interval is greater than the first time period, and for calculating the latest phase difference between the master ear and the slave ear when the signaling packet is received outside the first time adjustment interval.
[0036] In one embodiment, the second adjustment module is specifically used to:
[0037] If the second phase difference is less than the preset threshold value, the target difference between the first phase difference and the second phase difference is calculated; the frequency deviation is obtained according to the target difference and the second time adjustment interval; the second time adjustment interval is obtained by subtracting the moment corresponding to the second phase difference from the moment corresponding to the first phase difference; when the frequency deviation is not less than the preset frequency adjustment step, the clock frequency of the slave ear is subjected to frequency synchronization adjustment processing according to the frequency deviation; when the frequency deviation is less than the preset frequency adjustment step, the clock frequency of the slave ear is subjected to cumulative phase fine-tuning processing according to the minimum frequency step; wherein, the frequency synchronization adjustment processing of the clock frequency of the slave ear according to the frequency deviation includes: obtaining a second update frequency according to the frequency deviation and the clock frequency of the slave ear, and adjusting the clock frequency of the slave ear to the second update frequency within the first time period.
[0038] In one embodiment, the second adjustment module is specifically used to:
[0039] If the Bluetooth clock corresponding to the master ear is ahead of the Bluetooth clock corresponding to the slave ear, the clock frequency of the slave ear is adjusted to a first clock frequency value within the first time period, and the first clock frequency value is a value obtained by increasing the clock frequency of the slave ear by a minimum frequency step; if the Bluetooth clock corresponding to the master ear lags behind the Bluetooth clock corresponding to the slave ear, the clock frequency of the slave ear is adjusted to a second clock frequency value within the first time period, and the second clock frequency value is a value obtained by reducing the clock frequency of the slave ear by a minimum frequency step.
[0040] In one embodiment, the device further comprises:
[0041] A divergence judgment module is used to judge whether a phase divergence condition is met according to the first phase difference and the second phase difference; the phase divergence condition includes: 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; if the phase divergence condition is met, a target frequency adjustment value is determined and sent to the master ear, and the target frequency adjustment value is used to instruct the master ear to adjust its own clock frequency according to the target frequency adjustment value; if the phase divergence condition is not met and the second phase difference is greater than a preset threshold value, a fast phase compensation processing is performed on the clock frequency of the slave ear according to the second phase difference.
[0042] In one embodiment, the slave ear stores a plurality of sets of correspondences between phase difference intervals and frequency adjustment values; the divergence judgment module is specifically used to:
[0043] Determine a target difference between the first phase difference and the second phase difference; determine a target phase difference interval to which the target difference belongs based on the target difference; and use a frequency adjustment value corresponding to the target phase difference interval as the target frequency adjustment value.
[0044] In a third aspect, the present application further provides a Bluetooth headset, comprising a master ear and a slave ear, the slave ear comprising a memory and a processor, the memory storing a computer program, and the processor implementing the steps of any one of the methods described in the first aspect above when executing the computer program.
[0045] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of any one of the methods described in the first aspect above.
[0046] In a fifth aspect, the present application further provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, the steps of any one of the methods described in the first aspect are implemented.
[0047] The above-mentioned frequency adjustment method, device, Bluetooth headset, storage medium and program product can be used in a slave ear of a Bluetooth headset including a master ear and a slave ear, wherein the slave ear can obtain the Bluetooth clock of the slave ear corresponding to the target sample point identifier according to the target sample point identifier by receiving a signaling packet periodically sent by the master ear including a target sample point identifier and the Bluetooth clock of the master ear corresponding to the target sample point identifier; and make a difference between the Bluetooth clock of the master ear and the Bluetooth clock of the slave ear to obtain a first phase difference; by determining the first phase difference between the Bluetooth clock of the slave ear and the Bluetooth clock of the master ear; if the first phase difference meets the phase compensation condition, performing fast phase compensation processing on the clock frequency of the slave ear according to the first phase difference; after adjusting the clock frequency of the slave ear, determining the second phase difference between the Bluetooth clock of the slave ear and the Bluetooth clock of the master ear again; and adjusting the clock frequency of the slave ear again according to the first phase difference and the second phase difference. In this way, it can be determined that the master ear and the slave ear are not playing synchronously when it is determined that the first phase difference satisfies the phase compensation condition, and the clock frequency of the slave ear is quickly phase compensated so that the clock frequencies of the master ear and the slave ear are basically synchronized, so as to achieve phase compensation for the slave ear, so that the relative phase between the master ear and the slave ear is quickly reduced and the playback frequency is quickly tracked. Considering that the deviation of the crystal oscillator frequency of the master ear and the slave ear always exists, after adjusting the clock frequency of the slave ear based on the first phase difference, the second phase difference is further determined, and the clock frequency of the slave ear is adjusted again according to the first phase difference and the second phase difference, so that the clock frequencies of the master ear and the slave ear can be accurately synchronized, avoiding the user's auditory asynchronism when the two play audio, and ensuring the synchronization of the two playbacks. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] Figure 1 A diagram showing an application environment of a frequency adjustment method in an embodiment;
[0049] Figure 2 is a flow chart of a frequency adjustment method in one embodiment;
[0050] Figure 3 A schematic diagram of a process for adjusting a clock frequency in one embodiment;
[0051] Figure 4 A schematic diagram of a process for determining a first time adjustment interval in an embodiment;
[0052] Figure 5 A schematic diagram of another process of adjusting the clock frequency in one embodiment;
[0053] Figure 6 A schematic diagram of a process for determining a target frequency adjustment value according to an embodiment;
[0054] Figure 7 A schematic diagram of a flow chart of readjustment processing for an embodiment;
[0055] Figure 8 A schematic diagram of a process for synchronizing ear frequencies according to an embodiment;
[0056] Fig. 9 A schematic diagram of frequency alignment according to an embodiment;
[0057] Fig.10 A schematic diagram of the effect of adjusting the ear phase difference according to an embodiment;
[0058] Fig.11 is a structural block diagram of a frequency adjustment device in one embodiment;
[0059] Fig.12 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0060] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0061] Bluetooth headsets are currently common electronic devices. Bluetooth headsets usually include two earphones, a master earphone and a slave earphone. In the Bluetooth ear-to-ear transmission mode, the relative phase of the audio playback between the master ear and the slave ear must meet certain index requirements, otherwise it will cause auditory perceptible playback asynchrony. However, since the clock crystal oscillator frequencies of the master ear and the slave ear naturally have a certain deviation, the relative phase difference will inevitably be large over time. Therefore, the problem of asynchrony between the master ear and the slave ear of Bluetooth headsets needs to be solved urgently.
[0062] In view of this, an embodiment of the present application provides a frequency adjustment method, which is applied to a Bluetooth headset to solve the problem of a master ear and a slave ear being out of sync in the Bluetooth headset.
[0063] The frequency adjustment method provided in the embodiment of the present application can be applied to Figure 1 In the application environment shown. Among them, the Bluetooth headset includes a master ear 101 and a slave ear 102. During the use of the Bluetooth headset, the master ear 101 is connected to the terminal 103 to establish a first link to transmit audio data, control data, etc.; the master ear 101 is connected to the slave ear 102 to establish a second link to achieve information interaction between the ears, such as transmitting signaling packets, etc.; the slave ear 102 is connected to the terminal 103 to establish a third link to transmit audio data, control data, etc. It should be noted that the master ear and the slave ear in the embodiment of the present application are relative concepts. The Bluetooth headset includes two earphones. The master ear 101 can be one of the two earphones, and the slave ear 102 can be the other of the two earphones. The embodiment of the present application does not specifically limit this. The terminal 103 can be, but is not limited to, various personal computers, laptops, smart phones, tablet computers, Internet of Things devices, portable wearable devices, and other electronic devices that can establish a connection with the Bluetooth headset. Among them, the Internet of Things device can be a smart speaker, a smart TV, a smart air conditioner, a smart car device, etc. The portable wearable device may be a smart watch, a smart bracelet, a head-mounted device, etc., and the embodiments of the present application do not specifically limit this.
[0064] In one embodiment, Figure 2 As shown, a frequency adjustment method is provided, which is applied to Figure 1 Taking the slave ear 102 in the example as an example, the method includes the following steps:
[0065] Step 201: receiving a signaling packet periodically sent by a master ear at intervals of a first time period, wherein the signaling packet includes a target sample point identifier and a Bluetooth clock of the master ear corresponding to the target sample point identifier.
[0066] In order to achieve synchronous following, the master ear needs to send the information of playback synchronization to the slave ear. Therefore, the master ear can periodically send a signaling packet including a target sample point identifier and the Bluetooth clock of the master ear to the slave ear. Among them, the Bluetooth clock of the master ear in the signaling packet corresponds to the target sample point identifier. Different sample point data can correspond to different sample point identifiers to mark the sample point data. It can be understood that the target sample point identifier is the identifier used to mark the above-mentioned target sample point data.
[0067] In this way, the slave ear can determine the Bluetooth clock corresponding to the target sample point identifier in itself based on the target sample point identifier, that is, the Bluetooth clock of the slave ear.
[0068] Optionally, the period duration of the signaling packet sent by the master ear is a first time period, and the first time period can be determined based on the DAC (Digital to Analog Converter) frequency deviation of the audio playback of the master ear and the slave ear. That is, when the DAC frequency deviation of the audio playback of the master ear and the slave ear is different, under the requirement that the phase difference between the two does not exceed 1 sample point, the corresponding period duration of the signaling packet sent by the master ear is different.
[0069] For example, if the DAC frequency deviation between the master ear and the slave ear is 1ppm, the phase deviation between the master ear and the slave ear can reach 1 sample point after 22.65 seconds of accumulation. Then, the first time period for the master ear to send a signaling packet should be less than 22.65 seconds, for example, 22 seconds. Wherein, ppm means parts per million, and when used to represent frequency deviation, it means the value of the allowable deviation at a specific center frequency.
[0070] As shown in Table 1, it shows the corresponding time required for the phase deviation between the master ear and the slave ear to exceed 1 sample point. Therefore, based on the corresponding relationship in Table 1, the corresponding specific value of the first time period can be set to ensure that the phase deviation between the master ear and the slave ear does not exceed one sample point.
[0071] (Table 1)
[0072]
[0073] Optionally, if the DAC frequency deviation between the master ear and the slave ear is less than or equal to 10 ppm, the first time period for the signaling packet interaction between the master ear and the slave ear can be set to any value between 1 and 3 seconds.
[0074] Step 202: Acquire the Bluetooth clock of the slave ear corresponding to the target sample point identifier according to the target sample point identifier.
[0075] In order to enable the slave ear to obtain the Bluetooth clock of the slave ear corresponding to the target sample point identifier, the embodiments of the present application provide multiple methods for storing the correspondence between different sample point identifiers and Bluetooth clocks in the master ear and the slave ear to ensure that the slave ear can accurately obtain the corresponding Bluetooth clock of the slave ear.
[0076] In a first optional manner, the master ear and the slave ear may store the corresponding sample point identifier and the corresponding Bluetooth clock at the same sampling point period. For example, the master ear and the slave ear both store the corresponding Bluetooth clock at a period of 40,000 sample point data, that is, the master ear and the slave ear store the corresponding relationship between the sample point identifier and the Bluetooth clock corresponding to a sample point data every 40,000 sample point data.
[0077] In a second optional manner, the master ear and the slave ear may store the corresponding sample point identifiers in the same Bluetooth clock cycle. For example, the master ear and the slave ear both store the corresponding sample point identifiers in a cycle of 1 second, that is, the interval between the Bluetooth clock 1 corresponding to the sample point identifier 1 and the Bluetooth clock 2 corresponding to the sample point identifier 2 is 1 second. Optionally, the Bluetooth clock cycle duration may also be other values, which are not specifically limited here.
[0078] In the third optional mode, the master ear and the slave ear respectively store the Bluetooth clocks corresponding to different sample point identifiers. In this way, after the slave ear receives the signaling packet, if the sample point identifier corresponding to the currently played sample data is different from the sample point identifier in the signaling packet sent by the master ear, the slave ear needs to perform conversion to determine the Bluetooth clock of the slave ear corresponding to the same sample point identifier.
[0079] For example, the master ear reads the sample point identifier corresponding to the currently played sample point data and the Bluetooth clock of the master ear at the time t1 before sending the signaling packet, and records the Bluetooth clock of the master ear as PD(N)_master; wherein N represents the sample point identifier of the sample point data currently played by the master ear. The slave ear receives the signaling packet at time t2, and at this time the slave ear reads the sample point identifier of the sample point data currently played by itself and the corresponding Bluetooth clock of the slave ear, and records the Bluetooth clock of the slave ear as PD(M)_slave, wherein M is the sample point identifier of the sample point data currently played by the slave ear. In this way, the slave ear can calculate the Bluetooth clock of the master ear corresponding to the sample point identifier M: PD(M)_master=PD(N)_master+(MN) / SR.
[0080] At this time, since PD(M)_Master and PD(M)_Slave are both Bluetooth clocks corresponding to the sample point identifier M, the phase difference between the master ear and the slave ear can be calculated based on PD(M)_Master and PD(M)_Slave, such as the first phase difference mentioned below.
[0081] Optionally, the slave ear may also calculate the Bluetooth clock PD(N)_slave of the slave ear corresponding to the sample point identifier N based on the difference between M and N, SR and PD(N)_master, and calculate the phase difference between the two based on PD(N)_master and PD(N)_slave.
[0082] Here, SR refers to the audio DAC sampling rate, and the value of SR can be sent by the terminal to the slave ear through the third link.
[0083] Step 203: Subtract the Bluetooth clock of the master ear from the Bluetooth clock of the slave ear to obtain a first phase difference.
[0084] When the Bluetooth headset and the terminal establish a Bluetooth connection for playing audio data, the terminal can send the audio data to be played to the master ear and the slave ear respectively. Optionally, the master ear can send a synchronous start playback message to the slave ear so that the two can play the audio data at the same time.
[0085] The master ear and the slave ear play the audio data based on their respective crystal oscillators. During the playback process, due to the different frequencies of the respective crystal oscillators, the clock frequencies of the master ear and the slave ear when playing the audio data are different. As time accumulates, the relative phase between the two continues to accumulate, which may cause the two to be unable to play the audio data synchronously. Therefore, it is necessary to determine the phase difference between the master ear and the slave ear, that is, the first phase difference, and determine whether the clock frequency difference between the two is large based on the first phase difference, so as to further adjust the clock frequency.
[0086] The master ear and the slave ear can divide the played audio into multiple sample data, each sample data corresponds to a different Bluetooth clock, that is, the sample data is played at the time corresponding to the different Bluetooth clocks. Therefore, the master ear can obtain the Bluetooth clock corresponding to the target sample data in itself and send it to the slave ear, so that the slave ear can obtain the Bluetooth clock corresponding to the target sample data in itself, and based on the Bluetooth clock of the master ear and the Bluetooth clock of the slave ear corresponding to the same target sample data, the first phase difference can be obtained.
[0087] Optionally, the target sample data may be a Bluetooth clock corresponding to the sample data currently played by the master ear, or may be a Bluetooth clock corresponding to any sample data in the master ear, which is not specifically limited here.
[0088] After obtaining the Bluetooth clock of the master ear and the Bluetooth clock of the slave ear corresponding to the target sample point identifier, the slave ear may perform a difference between the Bluetooth clock of the master ear and the Bluetooth clock of the slave ear to obtain a first phase difference.
[0089] It can be understood that, optionally, the first phase difference can be obtained by subtracting the Bluetooth clock of the slave ear from the Bluetooth clock of the master ear. At this time, if the first phase difference is greater than zero, it means that the Bluetooth clock of the master ear is ahead of the Bluetooth clock of the slave ear; if the first phase difference is less than zero, it means that the Bluetooth clock of the master ear lags behind the Bluetooth clock of the slave ear.
[0090] Alternatively, the first phase difference may be obtained by subtracting the Bluetooth clock of the master ear from the Bluetooth clock of the slave ear. In this case, if the first phase difference is greater than zero, it means that the Bluetooth clock of the master ear lags behind the Bluetooth clock of the slave ear; if the first phase difference is less than zero, it means that the Bluetooth clock of the master ear is ahead of the Bluetooth clock of the slave ear.
[0091] Step 204: If the first phase difference satisfies the phase compensation condition, a fast phase compensation process is performed on the clock frequency of the slave ear according to the first phase difference.
[0092] Since the phase and the clock frequency have a corresponding relationship, by determining whether the first phase difference satisfies the phase compensation condition, it is determined whether the clock frequency of the slave ear needs to be adjusted to reduce the difference in clock frequency between the master ear and the slave ear. Correspondingly, by adjusting the clock frequency of the slave ear, the relative phase difference between the master ear and the slave ear will also be reduced.
[0093] In the embodiment of the present application, whether the clock frequency of the slave ear needs to be adjusted is determined by detecting whether the first phase difference satisfies the phase compensation condition. The phase compensation condition includes that the first phase difference is greater than or equal to a preset threshold value. In other words, the method further includes, after determining the first phase difference, detecting whether the first phase difference is greater than or equal to a preset threshold value; if the first phase difference is greater than or equal to the preset threshold value, determining that the first phase difference satisfies the phase compensation condition.
[0094] If the first phase difference is greater than or equal to the preset threshold value, then the relative phase difference between the master ear and the slave ear is large, and the clock frequency of the slave ear needs to be adjusted to ensure the synchronous playback of the two. Then, the slave ear can adjust its own clock frequency according to the first phase difference to achieve phase compensation. It should be noted that the first phase difference can be represented by the absolute value of the difference between the Bluetooth clock of the master ear and the Bluetooth clock of the slave ear. In this way, the preset threshold value can be a value greater than zero, so as to quickly determine whether the first phase difference between the master ear and the slave ear meets the phase compensation condition. It should be noted that the value of the preset threshold value can be determined according to the actual situation and is not specifically limited here.
[0095] Step 205: After adjusting the clock frequency of the slave ear, determine again the second phase difference between the Bluetooth clock of the slave ear and the Bluetooth clock of the master ear.
[0096] After adjusting the clock frequency of the slave ear by the first phase difference, the relative phase difference between the master ear and the slave ear is reduced, and the master ear and the slave ear can be basically synchronized. However, as mentioned above, there is a natural deviation in the crystal frequency between the master ear and the slave ear. Therefore, after adjusting based on the first phase difference, in order to ensure more accurate synchronization between the master ear and the slave ear, the clock frequency of the slave ear needs to be adjusted again based on the second phase difference.
[0097] Optionally, the master ear may periodically send Bluetooth clocks corresponding to different sample point data to the slave ear. Therefore, after adjusting the clock frequency of the slave ear, the slave ear may determine a second phase difference based on the Bluetooth clock of the master ear corresponding to another target sample point data recently received from the master ear and the Bluetooth clock of the slave ear corresponding to the other target sample point data, so as to adjust the clock frequency again based on the first phase difference and the second phase difference.
[0098] Step 206: adjust the clock frequency of the slave ear again according to the first phase difference and the second phase difference.
[0099] Among them, the slave ear can determine the frequency deviation according to the difference between the first phase difference and the second phase difference, and based on the relationship between the frequency deviation and the preset adjustment step, adjust the clock frequency of the slave ear again based on the frequency deviation or adjust the clock frequency of the slave ear again based on the preset minimum frequency adjustment step to ensure the precise synchronization of the frequencies between the two.
[0100] The above frequency adjustment method determines the first phase difference between the Bluetooth clock of the slave ear and the Bluetooth clock of the master ear; if the first phase difference meets the phase compensation condition, the clock frequency of the slave ear is quickly phase compensated according to the first phase difference; after adjusting the clock frequency of the slave ear, the second phase difference between the Bluetooth clock of the slave ear and the Bluetooth clock of the master ear is determined again; the clock frequency of the slave ear is adjusted again according to the first phase difference and the second phase difference. In this way, it can be determined that the master ear and the slave ear are not playing synchronously when it is determined that the first phase difference meets the phase compensation condition, and the clock frequency of the slave ear is adjusted so that the clock frequencies of the master ear and the slave ear are basically synchronized, so as to achieve phase compensation for the slave ear, so that the relative phase between the master ear and the slave ear is quickly reduced and the playback frequency is quickly tracked. Taking into account that there is always a deviation in the crystal frequency of the master ear and the slave ear, after the clock frequency of the slave ear is adjusted based on the first phase difference, the second phase difference is determined, and the clock frequency of the slave ear is adjusted again based on the first phase difference and the second phase difference, so that the clock frequencies of the master ear and the slave ear can be accurately synchronized, avoiding the user's auditory asynchrony when the two play audio, thereby ensuring the synchronization of the two playbacks.
[0101] In the embodiment of the present application, the master ear periodically sends a signaling packet to the slave ear, so that the slave ear can calculate the first phase difference between the two based on the signaling packet to determine whether the clock frequency of the slave ear needs to be adjusted, to ensure frequency synchronization between the two, and to achieve phase compensation in a timely manner. Since the period corresponding to the phase deviation of the master ear sending the signaling packet does not exceed one sample point, while achieving rapid reduction of the relative phase of the counterpart ear and rapid tracking of the clock frequency, the relative phase difference between the two can be maintained at no more than 1 audio sample point. At this time, there will be no user-perceivable asynchronism between the master ear and the slave ear, ensuring the normal use of the Bluetooth headset.
[0102] In the embodiment of the present application, if the first phase difference satisfies the phase compensation condition, the clock frequency of the slave ear is adjusted according to the first phase difference, that is, the absolute value of the relative phase difference between the master ear and the slave ear is calculated during the process of exchanging signaling packets. If the absolute value of the relative phase difference is greater than or equal to the preset threshold value, the slave ear is quickly phase compensated to reduce the relative phase difference between the two. The process of the fast phase compensation can be to directly adjust the clock frequency of the slave ear by using a frequency adjustment value within the next time interval Δt, so as to achieve complete compensation of the phase of the slave ear and reduce the relative phase difference between the ears as quickly as possible. The process of adjusting the clock frequency of the slave ear according to the first phase difference is described below.
[0103] Please refer to Figure 3 , which shows a schematic diagram of a process of adjusting the clock frequency provided by an embodiment of the present application, and performs fast phase compensation processing on the clock frequency of the slave ear according to the first phase difference, including:
[0104] Step 301: determine a first time adjustment interval, and obtain a differential clock frequency according to the first time adjustment interval and a first phase difference.
[0105] The first time adjustment interval is the time interval during which the ear adjusts its own clock frequency to the first update frequency, that is, the time interval Δt mentioned above.
[0106] In an optional embodiment of the present application, Figure 4 As shown, a flow chart of determining a first time adjustment interval is provided. Determining the first time adjustment interval includes:
[0107] Step 401, determining a maximum frequency adjustment value according to the clock frequency of the slave ear.
[0108] Step 402: Calculate a first time adjustment interval according to the first phase difference and the maximum frequency adjustment value.
[0109] The clock frequency of the slave ear refers to the current clock frequency that the slave ear needs to adjust. Optionally, the maximum offset that the clock frequency of the slave ear can be adjusted can be determined in real time according to the current clock frequency of the slave ear, and the maximum offset is used as the maximum frequency adjustment value Δf max Optionally, the maximum offset value may also be preset in the ear so as to use the maximum offset as the maximum frequency adjustment value.
[0110] Therefore, based on the relationship between clock frequency and phase, we know that: θ0 = Δf max *Δt; where θ0 is the first phase difference and Δt is the first time adjustment interval. Accordingly, the first time adjustment interval Δt=θ0 / Δf max, that is, the value of the first time adjustment interval can be obtained by dividing the first phase difference by the maximum frequency adjustment value.
[0111] In another optional embodiment of the present application, determining the first time adjustment interval includes: using a preset adjustment interval as the first time adjustment interval, or using a first time period as the first time adjustment interval.
[0112] The preset adjustment interval may be a fixed adjustment interval value pre-set in the slave ear, and the slave ear may also directly use the preset adjustment interval as the first time adjustment interval to improve calculation efficiency. Alternatively, the slave ear may also directly use the first time period as the first time adjustment interval. For example, after the slave ear receives the first signaling packet, a second signaling packet is received after the first time period. When the first signaling packet is received, the first phase difference and the first update frequency are directly determined according to the first signaling packet, so that before the second signaling packet is received, that is, within the first time period, the adjustment of the slave ear clock frequency is achieved.
[0113] In another optional embodiment of the present application, the master ear sends a signaling packet containing the Bluetooth clock p1 of the master ear corresponding to the target sample point identifier to the slave ear at time t1, and the slave ear determines that the Bluetooth clock of the slave ear corresponding to the target sample point identifier is q1. After the slave ear receives the signaling packet sent by the master ear, the first phase difference θ0 can be calculated, for example, θ0=q1-p1. The time when the slave ear plays the next adjacent sample data of the sample data corresponding to the target sample point identifier is t2, then, optionally, the first time adjustment interval Δt can be t2-t1. Optionally, the first time adjustment interval Δt can be approximately equal to the value of t2-t1, which is not specifically limited here.
[0114] Step 302, obtaining a first update frequency according to the clock frequency of the slave ear and the difference clock frequency.
[0115] Furthermore, the goal of the phase fast compensation is to complete the compensation of the first phase difference θ0 within the first time adjustment interval Δt1, that is, ΔF*Δt1=θ0. Based on this, the difference clock frequency ΔF can be obtained according to the first time adjustment interval and the first phase difference, that is, ΔF=θ0 / Δt1. The unit of the difference clock frequency ΔF is ppm.
[0116] Step 303: adjust the clock frequency of the slave ear to the first update frequency.
[0117] The clock frequency of the slave ear refers to the current clock frequency F that needs to be adjusted by the slave ear, so the first update frequency F_new can be obtained by subtracting the clock frequency of the slave ear that needs to be adjusted and the difference clock frequency, that is, F_new = F-ΔF. Then, by adjusting the clock frequency F of the slave ear to F_new, phase compensation is achieved.
[0118] In an optional embodiment of the present application, the clock frequency of the slave ear may be adjusted, or the DAC frequency of the slave ear may be adjusted, or other clock crystal frequencies of the slave ear (for example, a 48 MHz crystal frequency) may be adjusted.
[0119] If the DAC frequency is adjusted, then F is the current DAC sampling frequency of the slave, and the difference clock frequency is ΔF', which is obtained by converting ΔF to the value of the DAC sampling frequency. For example, if the DAC sampling rate is 44.1kHz, then ΔF'=ΔF*44.1KHz. For another example, if the 48MHz crystal frequency is adjusted, then ΔF'=ΔF*48MHz.
[0120] For ease of understanding, a specific example is used below to illustrate, but it is not intended to limit the present application.
[0121] The Bluetooth clock precision is 0.25us. At time t1, the Bluetooth clock p1 of the master ear corresponding to the target sample point identifier in the master ear is 1000; the Bluetooth clock q1 of the slave ear corresponding to the target sample point identifier in the slave ear is 1100. Then the first phase difference is 100*0.25us=25us.
[0122] Take Δt1 = 1 second as an example, then ΔF = 25us / 1s = 25ppm. Then ΔF' = β*ΔF, where β is the conversion factor. If the DAC frequency is adjusted, β is the DAC sampling frequency, such as 44.1kHz. That is: ΔF' = 44.1kHz*25 / 106 = 1.1025Hz.
[0123] If the current DAC frequency F is 44.1 kHz, then F_new = F - ΔF' = 44.1 kHz - 1.1025 Hz = 44.0988975 Hz, and the DAC frequency of the slave ear should be adjusted to 44.0988975 Hz.
[0124] It should be noted that the above precise calculation is only used as an example. In the embodiments of the present application, simplified approximate calculation can also be used to achieve a balance between computing resources and effects.
[0125] It should be noted that if the preset adjustment interval is used as the first time adjustment interval, and the difference clock frequency is calculated based on the first time adjustment interval to further obtain the first update frequency, then, if the clock frequency of the slave ear is adjusted according to the obtained first update frequency, the clock frequency of the slave ear cannot be adjusted to align with the clock frequency value of the master ear at one time. In the next calculation, the phase difference between the clock frequency of the master ear and the clock frequency of the slave ear still meets the phase compensation condition. Therefore, the new first update frequency can be determined next time to continue to adjust the current clock frequency of the slave ear so that the clock frequency values of the two are aligned to achieve basic playback synchronization.
[0126] In an embodiment of the present application, a differential clock frequency is obtained according to the first time adjustment interval and the first phase difference, a first update frequency is obtained according to the clock frequency of the slave ear and the differential clock frequency, and the clock frequency of the slave ear is adjusted to the first update frequency. In this way, the clock frequency of the slave ear can be adjusted to the first update frequency within the first time adjustment interval, and when the master ear and the slave ear play the sample data after the first time adjustment interval, phase alignment and synchronous playback can be achieved.
[0127] In one embodiment, the method further includes: if the first time adjustment interval is greater than the first time period, then when a signaling packet is received within the first time adjustment interval, the latest phase difference between the master ear and the slave ear is not calculated, and when a signaling packet is received outside the first time adjustment interval, the latest phase difference between the master ear and the slave ear is calculated.
[0128] Among them, each time the slave ear receives a signaling packet sent by the master ear, it can determine the corresponding slave ear's Bluetooth clock according to the target sample point identifier in the signaling packet, and further calculate the current phase difference between the master ear and the slave ear based on the master ear's Bluetooth clock and the slave ear's Bluetooth clock. However, before receiving the next signaling packet, that is, within the first time adjustment interval, the slave ear needs to perform the above-mentioned clock frequency adjustment action. Before the clock frequency adjustment is completed, there is no need to calculate the latest phase difference between the two. Based on this, in the embodiment of the present application, in order to reduce useless processing and reduce the calculation complexity of the slave ear, if the above-mentioned first time adjustment interval is greater than the first time period, the slave ear may receive the latest signaling packet before the clock frequency adjustment is completed. In the case of receiving the signaling packet within the first time adjustment interval, the slave ear does not calculate the latest phase difference between the master ear and the slave ear; instead, when the clock frequency adjustment is completed, that is, when the signaling packet is received outside the first time adjustment interval, the latest phase difference between the master ear and the slave ear is calculated, and the next adjustment processing plan is determined according to the latest calculated phase difference.
[0129] Optionally, when the absolute value of the relative phase difference between the two ears decreases to less than a preset threshold value, in an embodiment of the present application, a frequency synchronization method can be further adopted to achieve precise alignment of the clock frequencies between the two.
[0130] In the case of fast phase compensation, in one possible case, the clock frequency of the master ear is within the adjustable range of the clock frequency of the slave ear, that is, the slave ear can synchronize with the clock frequency of the master ear by adjusting its own clock frequency to the first update frequency. In another possible case, the clock frequency of the master ear is outside the adjustable range of the clock frequency of the slave ear, that is, after the slave ear adjusts its own clock frequency to the first update frequency, it still cannot synchronize with the clock frequency of the master ear, and the phase difference between the two is still greater than the preset threshold value.
[0131] In the latter case, the embodiment of the present application sends the target frequency adjustment value to the master ear by the slave ear, so that the master ear actively adjusts its own clock frequency to achieve synchronization between the two. The process will be described below.
[0132] Please refer to Figure 5 , which shows another flow chart of adjusting the clock frequency provided by an embodiment of the present application, the method further includes:
[0133] Step 501: determine whether a phase divergence condition is satisfied according to the first phase difference and the second phase difference.
[0134] The phase divergence condition includes: 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.
[0135] The second phase difference is obtained by the slave ear adjusting the clock frequency of the slave ear according to the first phase difference and receiving a signaling packet sent again by the master ear according to the master ear Bluetooth clock and the slave ear Bluetooth clock in the signaling packet.
[0136] If 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, then the phase divergence condition is met. Meeting the phase divergence condition means that at the moment t1 corresponding to the first phase difference, the playback time of the slave ear is not synchronized with the playback time of the master ear, and the absolute value of the first phase difference is greater than zero, and after fast phase compensation, at the moment t2 corresponding to the second phase difference, the playback time of the slave ear is still not synchronized with the playback time of the master ear, and the absolute value of the second phase difference is greater than zero, and, if possible, 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, that is, it indicates that the slave ear cannot align with the clock frequency of the master ear by adjusting its own clock frequency. At this time, the slave ear can notify the master ear to adjust its own clock frequency through signaling interaction.
[0137] Step 502: If the phase divergence condition is met, a target frequency adjustment value is determined and sent to the master ear. The target frequency adjustment value is used to instruct the master ear to adjust its own clock frequency according to the target frequency adjustment value.
[0138] Specifically, if the phase divergence condition is met, the slave ear needs to determine a target frequency adjustment value and send the target frequency adjustment value to the master ear, so that the master ear adjusts its own clock frequency according to the target frequency adjustment value. Optionally, the slave ear may send a signaling packet containing the target frequency adjustment value to the master ear to achieve transmission of the target frequency adjustment value.
[0139] In an optional embodiment of the present application, a fixed frequency step can be defined based on test data, and the fixed frequency step can be sent to the master ear as a target frequency adjustment value. For the master ear, if the Bluetooth clock of the master ear is ahead of the Bluetooth clock of the slave ear, the master ear determines the target update frequency value based on the difference between the target frequency adjustment value and its current clock frequency, and adjusts its current Bluetooth clock to the target update frequency value. Correspondingly, if the Bluetooth clock of the master ear lags behind the Bluetooth clock of the slave ear, the master ear determines the target update frequency value based on the sum of the target frequency adjustment value and its current clock frequency, and adjusts its current Bluetooth clock to the target update frequency value.
[0140] In another optional embodiment of the present application, the slave may determine the target frequency adjustment value from a plurality of frequency steps based on the first phase difference and the second phase difference, as follows.
[0141] Please refer to Figure 6 , which shows a schematic diagram of a process for determining a target frequency adjustment value provided by an embodiment of the present application, wherein determining the target frequency adjustment value includes:
[0142] Step 601: determine a target difference between a first phase difference and a second phase difference.
[0143] Step 602: Determine, according to the target difference, the target phase difference interval to which the target difference belongs.
[0144] Step 603: Use the frequency adjustment value corresponding to the target phase difference interval as the target frequency adjustment value.
[0145] The target difference refers to the absolute value of the difference between the first phase difference and the second phase difference. The slave ear stores a plurality of corresponding relationships between phase difference intervals and frequency adjustment values. The target difference should belong to a target difference interval in the plurality of phase difference intervals, and accordingly, the frequency adjustment value corresponding to the target difference interval can be sent to the master ear as the target frequency adjustment value.
[0146] Optionally, the slave ear may store a plurality of sets of correspondences between phase difference values and frequency adjustment values, and the slave ear may use the frequency adjustment value corresponding to the phase difference value equal to the target difference value as the target frequency adjustment value. Please refer to Table 2, which shows the correspondences between the plurality of sets of phase difference values and frequency adjustment values, wherein the values of F_step_1 to F_step_n are monotonically increasing or monotonically decreasing.
[0147] (Table 2)
[0148]
[0149]
[0150] It should be noted that when determining the target frequency adjustment value based on Table 2, as mentioned above, the first phase difference θ0 and the second phase difference θ1 have the same sign, that is, the product of the two is greater than zero. Further, if the Bluetooth clock of the master ear is ahead of the Bluetooth clock of the slave ear, the negative frequency adjustment value in Table 2 is taken as the target frequency adjustment value, so that the master ear reduces its own clock frequency based on the target frequency adjustment value. If the Bluetooth clock of the master ear lags behind the Bluetooth clock of the slave ear, the positive frequency adjustment value in Table 2 is taken as the target frequency adjustment value, so that the master ear increases its own clock frequency based on the target frequency adjustment value to achieve alignment between the two. In other words, if θ1>θ0>0, the value sign of the frequency adjustment value in Table 2 is "-", if θ1<θ0<0, the value sign of the frequency adjustment value in Table 2 is "+", if θ1=θ0, then θ1>0, the value is "-", and the value is "+" when θ1<0.
[0151] Step 503: If the phase divergence condition is not met and the second phase difference is greater than a preset threshold value, a fast phase compensation process is performed on the clock frequency of the slave ear according to the second phase difference.
[0152] The process of performing fast phase compensation processing on the clock frequency of the slave ear according to the second phase difference is consistent with the process of performing fast phase compensation on the clock frequency of the slave ear according to the first phase difference mentioned above, that is, a new first time adjustment interval can be determined, and a new difference clock frequency can be obtained according to the new first time adjustment interval and the second phase difference; a new first update frequency can be obtained according to the clock frequency of the slave ear and the new difference clock frequency; the clock frequency of the slave ear is adjusted to the new first update frequency; wherein the new first time adjustment interval is the time interval in which the slave ear adjusts its own clock frequency to the new first update frequency. Accordingly, the process of determining the new first time adjustment interval can refer to the process of determining the first time adjustment interval mentioned above.
[0153] In addition, after the clock frequency of the slave ear is quickly phase compensated according to the second phase difference, if the third phase difference between the master ear and the slave ear is detected again to be less than the preset threshold value, the clock frequency of the slave ear is adjusted again according to the second phase difference and the third phase difference. The adjustment process may be a frequency synchronization adjustment process of the clock frequency of the slave ear according to the frequency deviation, or an adjustment process of the clock frequency of the slave ear according to the minimum frequency step.
[0154] In the embodiment of the present application, by determining the target difference between the first phase difference and the second phase difference, and based on the target difference, determining the target phase difference interval to which the target difference belongs, the slave ear uses the frequency adjustment value corresponding to the target phase difference interval as the target frequency adjustment value, thereby determining a target frequency adjustment value that is more in line with the frequency difference between the current master ear and the slave ear from among multiple frequency adjustment values, and adjusting the clock frequency of the master ear based on the target frequency adjustment value, thereby improving the accuracy and reliability of the adjustment, and achieving rapid reduction of the relative phase of the slave ear and rapid tracking of the playback frequency.
[0155] Based on the above, the slave ear adjusts its own clock frequency according to the first phase difference or the master ear adjusts its own clock frequency according to the target frequency adjustment value, so that the relative phase difference between the master ear and the slave ear can be reduced to within the preset threshold value, that is, the phases of the two are basically aligned. On this basis, in order to ensure the precise alignment and synchronization of the two, the slave ear can continue to perform frequency synchronization adjustment, that is, adjust the clock frequency of the slave ear again. The process of adjusting the clock frequency of the slave ear again is described below.
[0156] Please refer to Figure 7 , which shows a schematic diagram of a flow chart of a re-adjustment process provided by an embodiment of the present application, and re-adjusts the clock frequency of the slave ear according to the first phase difference and the second phase difference, including:
[0157] Step 701: If the second phase difference is less than a preset threshold value, a target difference between the first phase difference and the second phase difference is calculated.
[0158] Step 702: Obtain a frequency deviation according to the target difference and the second time adjustment interval.
[0159] Step 703: When the frequency deviation is not less than the preset frequency adjustment step, frequency synchronization adjustment processing is performed on the clock frequency of the slave ear according to the frequency deviation.
[0160] The second phase difference being less than the preset threshold value may refer to an absolute value of the second phase difference being less than the preset threshold value. If the second phase difference is less than the preset threshold value, it means that the relative phase difference between the master ear and the slave ear is already small through the slave ear adjusting its own clock frequency or the master ear adjusting its own clock frequency, and at this point, further frequency synchronization adjustment may be performed.
[0161] The second time adjustment interval is obtained by subtracting the moment corresponding to the second phase difference from the moment corresponding to the first phase difference. It should be noted that the second phase difference is a relative concept. If the relative phase difference between the master ear and the slave ear can be less than the preset threshold value after the slave ear adjusts its own clock frequency based on the first phase difference, the second phase difference refers to the second difference calculated based on the Bluetooth clock sent by the master ear and the corresponding Bluetooth clock of the slave ear after the clock frequency of the slave ear is adjusted. If the relative phase difference between the master ear and the slave ear is still greater than the preset threshold value after the slave ear adjusts its own clock frequency based on the first phase difference, it is necessary to adjust the clock frequency of the master ear based on the target frequency adjustment value above. Then the second phase difference refers to the third difference calculated based on the master ear Bluetooth clock sent again by the master ear and the corresponding Bluetooth clock of the slave ear after the clock frequency of the master ear is adjusted.
[0162] For example, at a certain sample point identifier k2 (corresponding to time t2) of the signaling packet interaction after Δt1, the first phase difference θ1 is calculated from the ear; at this time, the value of θ1 can be reduced to less than the preset threshold value; at the sample point identifier k3 (corresponding to time t3), the second phase difference θ2 is calculated from the ear. Then the target difference Δθ2 = θ2 – θ1. Among them, Δθ2 represents the differential of the two phase differences.
[0163] Then the frequency deviation Δf2 between the master ear and the slave ear is: Δf2=Δθ2 / Δt2, where Δt2 is the second time adjustment interval, and Δt2=t3-t2. The unit of Δθ2 can be microseconds (us), the unit of Δt2 can be seconds (s), and the unit of Δf2 can be ppm.
[0164] Based on the frequency deviation, in an embodiment of the present application, a preset frequency adjustment step is defined. If the frequency deviation is not less than the preset frequency adjustment step, it means that although the current phase difference between the master ear and the slave ear is less than the preset threshold value, it is still greater than the threshold corresponding to the preset frequency adjustment step, and the clock frequency still needs to be further adjusted.
[0165] In one embodiment, frequency synchronization adjustment processing is performed on the clock frequency of the slave ear according to the frequency deviation, including: obtaining a second update frequency according to the frequency deviation and the clock frequency of the slave ear, and adjusting the clock frequency of the slave ear to the second update frequency within a first time period.
[0166] If the slave ear lags behind the master ear, the second update frequency F_new2 is equal to the current clock frequency F of the slave ear plus the frequency deviation Δf2; if the slave ear is ahead of the master ear, the second update frequency F_new2 is equal to the current clock frequency F of the slave ear minus the frequency deviation Δf2. In the next adjustment cycle, the current clock frequency of the slave ear is adjusted to the second update frequency F_new2, so that the phase difference between the master ear and the slave ear can be reduced to less than the preset frequency adjustment step as soon as possible, and the maximum frequency synchronization can be achieved. The next adjustment cycle can be the first time period, so that the clock frequency of the slave ear can be quickly adjusted before the next signaling packet is received and the phase difference between the two is calculated.
[0167] Optionally, as mentioned above, if adjustments are made to other clock crystal oscillator frequencies, the corresponding frequency deviation can be determined according to Δf2 and the conversion factor, that is, F' is equal to β*Δf2.
[0168] In order to reduce the difficulty of implementation, the minimum step method can be used to trigger the adjustment of the clock frequency of the slave ear. When the minimum step requirement is met, the adjustment is made; otherwise, no adjustment is made. Optionally, the precise calculation in the embodiment of the present application is only used as an example, and it can also be a simplified approximate calculation to achieve a balance between computing resources and effects.
[0169] Step 704: When the frequency deviation is less than the preset frequency adjustment step, perform cumulative phase fine adjustment processing on the clock frequency of the slave ear according to the minimum frequency step.
[0170] If the frequency deviation is less than the preset frequency adjustment step, it means that the current phase difference between the master ear and the slave ear is small, and the basic frequencies of the two are synchronized. However, considering that a small frequency deviation will cause a large phase difference after long-term accumulation, the clock frequency of the slave ear can continue to be cumulatively adjusted based on the defined minimum frequency step to maintain the maximum degree of accurate synchronization between the two.
[0171] In one embodiment, the clock frequency of the slave ear is cumulatively fine-tuned according to the minimum frequency step, including: if the Bluetooth clock corresponding to the master ear is ahead of the Bluetooth clock corresponding to the slave ear, then the clock frequency of the slave ear is adjusted to a first clock frequency value within a first time period, and the first clock frequency value is a value obtained by increasing the clock frequency of the slave ear by a minimum frequency step; if the Bluetooth clock corresponding to the master ear lags behind the Bluetooth clock corresponding to the slave ear, then the clock frequency of the slave ear is adjusted to a second clock frequency value within the first time period, and the second clock frequency value is a value obtained by reducing the clock frequency of the slave ear by a minimum frequency step.
[0172] In the embodiment of the present application, a minimum frequency step can be defined. When the frequency deviation is less than the preset frequency adjustment step, it can be considered that the frequencies of the master and slave ears are basically consistent. At this time, the clock frequency of the slave ear can be fine-tuned according to the current phase difference between the master ear and the slave ear.
[0173] If the master Bluetooth clock corresponding to the master ear is ahead of the slave Bluetooth clock corresponding to the slave ear, the clock frequency of the slave ear is adjusted to increase by a minimum frequency step, that is, the clock frequency of the slave ear is adjusted to the sum of the clock frequency of the slave ear and the minimum frequency step. If the master Bluetooth clock corresponding to the master ear lags behind the slave Bluetooth clock corresponding to the slave ear, the clock frequency of the slave ear is adjusted to decrease by a minimum frequency step, that is, the clock frequency of the slave ear is adjusted to the difference between the clock frequency of the slave ear and the minimum frequency step.
[0174] In the embodiment of the present application, based on the first phase difference and the second phase difference, the clock frequency of the slave ear is adjusted again within the first time period to achieve accurate synchronization of audio playback between the master ear and the slave ear, and the synchronization error can be less than 1 playback sample point. From the perspective of system implementation, the process has good stability, simple processing logic, and good implementation effect.
[0175] A specific method for synchronizing the frequencies of the two ears is given below to illustrate the adjustment process of synchronizing the frequencies of the master ear and the slave ear in the embodiment of the present application. Figure 8 , which shows a schematic diagram of a process of ear frequency synchronization provided by an embodiment of the present application.
[0176] First, the master ear establishes a Bluetooth first link connection with the smart device; the master ear establishes a second link connection with the slave ear; the slave ear establishes a third link connection (monitoring link) with the smart device. The master ear periodically sends a signaling packet carrying playback sample point information to the slave ear, where the playback sample point information includes a sample point ID and Bluetooth clock information.
[0177] After receiving the signaling packet, the slave ear calculates the phase difference θ0 between the Bluetooth clock of the master ear and the Bluetooth clock of the slave ear corresponding to the same sample ID, and determines whether the absolute value abs(θ0) of θ0 is greater than or equal to the first threshold value θ_Thre1. If it is greater than or equal to, the fast phase compensation algorithm is executed, that is, the first update frequency is determined based on the phase difference θ0, and the current clock frequency of the slave ear is adjusted to the first update frequency. If it is less than, the signaling packet sent by the master ear is continued to be received, and the phase difference θ2 between the new Bluetooth clock of the master ear and the Bluetooth clock of the slave ear is calculated, and the phase deviation Δθ2 is calculated based on θ0 and θ2, and the frequency deviation Δf is obtained according to the phase deviation calculation.
[0178] After executing the phase compensation algorithm, that is, adjusting the clock frequency of the slave ear, the phase difference θ1 between the Bluetooth clock of the master ear and the Bluetooth clock of the slave ear is calculated again, and it is determined whether θ1 converges (that is, whether θ1 diverges). The method for determining whether it converges is whether the following two conditions are met at the same time: (1) θ0 and θ1 have the same sign (θ1*θ0>0); (2) θ1≥θ0>0 or θ1≤θ0<0.
[0179] If the above two conditions are met, θ1 does not converge, that is, θ1 diverges, which means that the phase difference between the slave ear and the slave ear after adjusting the clock frequency is still greater than the first threshold value. Then the slave ear sends a signaling packet including the target frequency adjustment value to the master ear, so that the master ear adjusts its own clock frequency according to the target frequency adjustment value, and the master ear continues to periodically send a signaling packet including the sample point ID and the corresponding Bluetooth clock to the slave ear after adjusting its own clock frequency.
[0180] If the above two conditions are not met, θ1 converges, that is, θ1 does not diverge; it means that the phase difference between the slave ear and the slave ear after adjusting the clock frequency is less than the first threshold value, then the signaling packet sent by the master ear continues to be received, and the phase difference θ2 between the new master ear's Bluetooth clock and the slave ear's Bluetooth clock is calculated, and the phase deviation Δθ2 is calculated based on θ0 and θ2, and the frequency deviation Δf is calculated based on the phase deviation.
[0181] When the phase difference between the master ear and the slave ear is less than the first threshold value, the frequency deviation Δf is calculated. It is determined whether the frequency deviation Δf is greater than or equal to the minimum frequency step F_minstep. If so, the frequency synchronization adjustment algorithm is executed, that is, the clock frequency of the slave ear is adjusted again according to the phase differences θ0 and θ2.
[0182] By executing the frequency synchronization adjustment algorithm, the clock frequency of the master ear can be aligned with the clock frequency of the slave ear, and the master ear and the slave ear can play the sample data corresponding to the same sample ID at the same time. For example, please refer to Fig. 9 , which shows a frequency alignment schematic diagram provided by an embodiment of the present application. Δt1 to Δtn-1 represent different time intervals; k1 to kn are the sample point IDs corresponding to the sample point data; p1 to pn are the Bluetooth clocks of the master ear corresponding to the sample point IDs; q1 to qn are the Bluetooth clocks of the slave ear corresponding to the sample point IDs. It can be seen that sample point k1 corresponds to the Bluetooth clock p1 of the master ear and the Bluetooth clock q1 of the slave ear.
[0183] In addition, if the frequency deviation Δf is less than the minimum frequency step F_minstep, it is necessary to perform cumulative phase fine-tuning. For example, if the phase difference θ between the two is greater than zero (the master ear lags behind the slave ear), the clock frequency F of the slave ear is adjusted to decrease by one step step; if the phase difference θ between the two is not greater than zero (the master ear leads the slave ear), the clock frequency F of the slave ear is adjusted to increase by one step step.
[0184] Optionally, before adjusting the clock frequency F of the slave ear to increase or decrease by a step step, if it is determined that the phase difference θ between the two is greater than or equal to the second threshold value θ_Thre2, the clock frequency F of the slave ear is adjusted to increase or decrease by a step step; if it is determined that the phase difference θ between the two is less than the second threshold value θ_Thre2, no adjustment is made. It should be noted that in this process, the master ear periodically sends a signaling packet to the slave ear.
[0185] Specifically, taking the first threshold value θ_Thre1 as 5us and the signaling interaction period of the master ear sending the signaling packet as 1 second as an example, based on the above-mentioned method for synchronizing the frequency of the ear, the following can be obtained: Fig.10 The schematic diagram of the effect of adjusting the phase difference between the two ears is shown. It can be seen that when the initial phase difference is greater than the first threshold value θ_Thre1, in the next adjustment cycle, the fast phase compensation method is used to directly reduce the phase difference to less than 5us. In the subsequent phase monitoring process, the phase difference between the master ear and the slave ear is less than the first threshold value θ_Thre1, and the frequency synchronization method is used to achieve frequency synchronization between the two ears, and the phase difference between the two ears is small.
[0186] In the embodiment of the present application, through the above-mentioned ear frequency synchronization method, the relative phase of the ear can be quickly reduced and the playback frequency can be quickly tracked. The relative phase difference can be kept at no more than 1 audio sample point, and the audio playback of the master ear and the slave ear can be accurately synchronized. From the perspective of system implementation, this method has good stability, simple processing logic and good effect.
[0187] It should be understood that, although the steps in the flowcharts involved in the above embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps is not strictly limited in order, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above embodiments may include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0188] Based on the same inventive concept, the embodiment of the present application also provides a frequency adjustment device for implementing the frequency adjustment method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more frequency adjustment device embodiments provided below can refer to the limitations on the frequency adjustment method above, and will not be repeated here.
[0189] In one embodiment, Fig.11 As shown, a frequency adjustment device is provided, and the frequency adjustment device 1100 is used in a slave ear of a Bluetooth headset, and the Bluetooth headset includes a master ear and a slave ear. The frequency adjustment device 1100 includes a receiving module 1101, an acquisition module 1102, a calculation module 1103, a first adjustment module 1104, a determination module 1105, and a second adjustment module 1106:
[0190] The receiving module 1101 is configured to receive a signaling packet periodically sent by the master ear at intervals of a first time period, where the signaling packet includes a target sample point identifier and a Bluetooth clock of the master ear corresponding to the target sample point identifier;
[0191] An acquisition module 1102 is used to acquire the Bluetooth clock of the slave ear corresponding to the target sample point identifier according to the target sample point identifier;
[0192] A calculation module 1103 is used to calculate the difference between the Bluetooth clock of the master ear and the Bluetooth clock of the slave ear to obtain a first phase difference;
[0193] A first adjustment module 1104 is configured to perform fast phase compensation processing on the clock frequency of the slave ear according to the first phase difference if the first phase difference satisfies a phase compensation condition; the phase compensation condition includes that the first phase difference is greater than or equal to a preset threshold value;
[0194] A determination module 1105, configured to determine again a second phase difference between the Bluetooth clock of the slave ear and the Bluetooth clock of the master ear after adjusting the clock frequency of the slave ear;
[0195] The second adjustment module 1106 is used to adjust the clock frequency of the slave ear again according to the first phase difference and the second phase difference.
[0196] In one embodiment, the first adjustment module 1104 is specifically configured to:
[0197] Determine a first time adjustment interval, and obtain a differential clock frequency 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 ear and the differential clock frequency; adjust the clock frequency of the slave ear to the first update frequency; wherein the first time adjustment interval is the time interval during which the slave ear adjusts its own clock frequency to the first update frequency.
[0198] In one embodiment, the first adjustment module 1104 is specifically configured to:
[0199] A maximum frequency adjustment value is determined according to the clock frequency of the slave ear; and a first time adjustment interval is calculated according to the first phase difference and the maximum frequency adjustment value.
[0200] In one embodiment, the first adjustment module 1104 is specifically configured to: use a preset time adjustment interval as the first time adjustment interval; or use the first time period as the first time adjustment interval.
[0201] In one embodiment, the apparatus further comprises:
[0202] A phase calculation module is used for not calculating the latest phase difference between the master ear and the slave ear when the signaling packet is received within the first time adjustment interval if the first time adjustment interval is greater than the first time period, and for calculating the latest phase difference between the master ear and the slave ear when the signaling packet is received outside the first time adjustment interval.
[0203] In one embodiment, the second adjustment module 1106 is specifically configured to:
[0204] If the second phase difference is less than the preset threshold value, the target difference between the first phase difference and the second phase difference is calculated; the frequency deviation is obtained according to the target difference and the second time adjustment interval; the second time adjustment interval is obtained by subtracting the moment corresponding to the second phase difference from the moment corresponding to the first phase difference; when the frequency deviation is not less than the preset frequency adjustment step, the clock frequency of the slave ear is subjected to frequency synchronization adjustment processing according to the frequency deviation; when the frequency deviation is less than the preset frequency adjustment step, the clock frequency of the slave ear is subjected to cumulative phase fine-tuning processing according to the minimum frequency step; wherein, the frequency synchronization adjustment processing of the clock frequency of the slave ear according to the frequency deviation includes: obtaining a second update frequency according to the frequency deviation and the clock frequency of the slave ear, and adjusting the clock frequency of the slave ear to the second update frequency within the first time period.
[0205] In one embodiment, the second adjustment module 1106 is specifically configured to:
[0206] If the Bluetooth clock corresponding to the master ear is ahead of the Bluetooth clock corresponding to the slave ear, the clock frequency of the slave ear is adjusted to a first clock frequency value within the first time period, and the first clock frequency value is a value obtained by increasing the clock frequency of the slave ear by a minimum frequency step; if the Bluetooth clock corresponding to the master ear lags behind the Bluetooth clock corresponding to the slave ear, the clock frequency of the slave ear is adjusted to a second clock frequency value within the first time period, and the second clock frequency value is a value obtained by reducing the clock frequency of the slave ear by a minimum frequency step.
[0207] In one embodiment, the apparatus further comprises:
[0208] A divergence judgment module is used to judge whether a phase divergence condition is met according to the first phase difference and the second phase difference; the phase divergence condition includes: 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; if the phase divergence condition is met, a target frequency adjustment value is determined and sent to the master ear, and the target frequency adjustment value is used to instruct the master ear to adjust its own clock frequency according to the target frequency adjustment value; if the phase divergence condition is not met and the second phase difference is greater than a preset threshold value, a fast phase compensation processing is performed on the clock frequency of the slave ear according to the second phase difference.
[0209] In one embodiment, the slave ear stores a plurality of sets of correspondences between phase difference intervals and frequency adjustment values; the divergence judgment module is specifically used to:
[0210] Determine a target difference between the first phase difference and the second phase difference; determine a target phase difference interval to which the target difference belongs based on the target difference; and use a frequency adjustment value corresponding to the target phase difference interval as the target frequency adjustment value.
[0211] Each module in the above frequency adjustment device can be implemented in whole or in part by software, hardware and a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can 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 above.
[0212] In one embodiment, a computer device is provided, whose internal structure diagram can be as follows: Fig.12As shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. The processor, the memory and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store frequency adjustment data. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a frequency adjustment method is implemented.
[0213] Those skilled in the art will understand that Fig.12 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0214] In one embodiment, a Bluetooth headset is provided, which includes a master ear and a slave ear. The slave ear includes a memory and a processor. The memory stores a computer program. When the processor executes the computer program, the steps in the above method embodiments are implemented.
[0215] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above method embodiments are implemented.
[0216] In one embodiment, a computer program product is provided, including a computer program, which implements the steps in the above method embodiments when executed by a processor.
[0217] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic 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 can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.
[0218] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0219] The above embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A frequency adjustment method, It is characterized in that Used in a slave ear of a Bluetooth headset, the Bluetooth headset includes a master ear and a slave ear, and the method includes: receiving a signaling packet periodically sent by the master ear at intervals of a first time period, wherein the signaling packet includes a target sample point identifier and a Bluetooth clock of the master ear corresponding to the target sample point identifier; According to the target sample point identifier, acquiring the Bluetooth clock of the slave ear corresponding to the target sample point identifier; Subtracting the Bluetooth clock of the master ear from the Bluetooth clock of the slave ear to obtain a first phase difference; If the first phase difference satisfies the phase compensation condition, a fast phase compensation process is performed on the clock frequency of the slave ear according to the first phase difference; the phase compensation condition includes that the first phase difference is greater than or equal to a preset threshold value; the fast phase compensation process is performed on the clock frequency of the slave ear according to the first phase difference, including: determining a first time adjustment interval, and obtaining a differential clock frequency according to the first time adjustment interval and the first phase difference; obtaining a first update frequency according to the clock frequency of the slave ear and the differential clock frequency; adjusting the clock frequency of the slave ear to the first update frequency; wherein the first time adjustment interval is a time interval in which the slave ear adjusts its own clock frequency to the first update frequency; After adjusting the clock frequency of the slave ear, determining again a second phase difference between the Bluetooth clock of the slave ear and the Bluetooth clock of the master ear; The clock frequency of the slave ear is adjusted again according to the first phase difference and the second phase difference; the adjusting again according to the first phase difference and the second phase difference comprises: if the second phase difference is less than a preset threshold value, calculating a target difference between the first phase difference and the second phase difference; obtaining a frequency deviation according to the target difference and a second time adjustment interval; the second time adjustment interval is obtained by subtracting a moment corresponding to the second phase difference from a moment corresponding to the first phase difference; when the frequency deviation is not less than a preset frequency adjustment step, performing frequency synchronization adjustment on the clock frequency of the slave ear according to the frequency deviation; when the frequency deviation is less than the preset frequency adjustment step, performing cumulative phase fine-tuning on the clock frequency of the slave ear according to a minimum frequency step; wherein, the frequency synchronization adjustment on the clock frequency of the slave ear according to the frequency deviation comprises: obtaining a second update frequency according to the frequency deviation and the clock frequency of the slave ear, and adjusting the clock frequency of the slave ear to the second update frequency within the first time period.
2. The method according to claim 1, It is characterized in that The determining of the first time adjustment interval includes: determining a maximum frequency adjustment value according to the clock frequency of the slave ear; The first time adjustment interval is calculated according to the first phase difference and the maximum frequency adjustment value.
3. The method according to claim 2, It is characterized in that The determining of the first time adjustment interval includes: Using a preset time adjustment interval as the first time adjustment interval; or, The first time period is used as the first time adjustment interval.
4. The method according to claim 3, It is characterized in that The method further comprises: If the first time adjustment interval is greater than the first time period, then when the signaling packet is received within the first time adjustment interval, the latest phase difference between the master ear and the slave ear is not calculated, and when the signaling packet is received outside the first time adjustment interval, the latest phase difference between the master ear and the slave ear is calculated.
5. The method according to claim 1, It is characterized in that The cumulative phase fine-tuning process of the clock frequency of the slave ear according to the minimum frequency step comprises: If the Bluetooth clock corresponding to the master ear is ahead of the Bluetooth clock corresponding to the slave ear, adjusting the clock frequency of the slave ear to a first clock frequency value within the first time period, where the first clock frequency value is a value obtained by increasing the clock frequency of the slave ear by a minimum frequency step; If the Bluetooth clock corresponding to the master ear lags behind the Bluetooth clock corresponding to the slave ear, the clock frequency of the slave ear is adjusted to a second clock frequency value within the first time period, and the second clock frequency value is a value obtained by reducing the clock frequency of the slave ear by a minimum frequency step.
6. The method according to claim 1, It is characterized in that The method further comprises: Determining whether a phase divergence condition is satisfied according to the first phase difference and the second phase difference; the phase divergence condition includes: 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; If the phase divergence condition is met, a target frequency adjustment value is determined, and the target frequency adjustment value is sent to the master ear, where the target frequency adjustment value is used to instruct the master ear to adjust its own clock frequency according to the target frequency adjustment value; If the phase divergence condition is not met and the second phase difference is greater than the preset threshold value, a fast phase compensation process is performed on the clock frequency of the slave ear according to the second phase difference.
7. The method according to claim 6, It is characterized in that The slave ear stores a plurality of sets of correspondences between phase difference intervals and frequency adjustment values; Determining the target frequency adjustment value includes: determining a target difference between the first phase difference and the second phase difference; According to the target difference, determining a target phase difference interval to which the target difference belongs; The frequency adjustment value corresponding to the target phase difference interval is used as the target frequency adjustment value.
8. A frequency adjustment device, It is characterized in that Used in a slave ear of a Bluetooth headset, the Bluetooth headset includes a master ear and a slave ear, and the device includes: A receiving module, configured to receive a signaling packet periodically sent by the master ear at intervals of a first time period, wherein the signaling packet includes a target sample point identifier and a Bluetooth clock of the master ear corresponding to the target sample point identifier; An acquisition module, configured to acquire the Bluetooth clock of the slave ear corresponding to the target sample point identifier according to the target sample point identifier; a calculation module, configured to calculate a difference between the Bluetooth clock of the master ear and the Bluetooth clock of the slave ear to obtain a first phase difference; A first adjustment module is configured to perform fast phase compensation processing on the clock frequency of the slave ear according to the first phase difference if the first phase difference satisfies a phase compensation condition; the phase compensation condition includes that the first phase difference is greater than or equal to a preset threshold value; the first adjustment module is specifically configured to: determine a first time adjustment interval, and obtain a differential clock frequency according to the first time adjustment interval and the first phase difference; obtain a first update frequency according to the clock frequency of the slave ear and the differential clock frequency; adjust the clock frequency of the slave ear to the first update frequency; wherein the first time adjustment interval is a time interval in which the slave ear adjusts its own clock frequency to the first update frequency; a determination module, configured to determine again a second phase difference between the Bluetooth clock of the slave ear and the Bluetooth clock of the master ear after adjusting the clock frequency of the slave ear; a second adjustment module, configured to adjust the clock frequency of the slave ear again according to the first phase difference and the second phase difference; the second adjustment module, specifically configured to: if the second phase difference is less than a preset threshold value, calculate a target difference between the first phase difference and the second phase difference; obtain a frequency deviation according to the target difference and a second time adjustment interval; the second time adjustment interval is obtained by subtracting a moment corresponding to the second phase difference from a moment corresponding to the first phase difference; when the frequency deviation is not less than a preset frequency adjustment step, perform frequency synchronization adjustment on the clock frequency of the slave ear according to the frequency deviation; when the frequency deviation is less than the preset frequency adjustment step, perform cumulative phase fine-tuning on the clock frequency of the slave ear according to a minimum frequency step; wherein, the frequency synchronization adjustment on the clock frequency of the slave ear according to the frequency deviation includes: obtaining a second update frequency according to the frequency deviation and the clock frequency of the slave ear, and adjusting the clock frequency of the slave ear to the second update frequency within the first time period.
9. A Bluetooth headset, comprising a master ear and a slave ear, wherein the slave ear comprises a memory and a processor, wherein the memory stores a computer program, It is characterized in that When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium having a computer program stored thereon, It is characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.
11. A computer program product comprising a computer program, It is characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
Method for realizing accurate synchronous playing of Bluetooth headset
CN108337595A
Method for achieving precise and synchronous playing function of wireless Bluetooth earphone
CN108415685A
Cited By
Frequency adjustment method and apparatus, bluetooth earphones, storage medium, and program product
EP4622163A1
