A TWS Bluetooth earphone playing control method and system
Patent Information
- Application Number
- CN202611155387.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-31
- Publication Date
- 2026-09-22
AI Technical Summary
[0003]现有TWS蓝牙耳机主从角色分配多采用静态或单因素策略,一类方案为固定某只耳机为主机,仅在该耳机电量耗尽时被动触发切换,该方案下主机长期承担高负载任务,易导致双耳功耗差异过大,整体续航时间缩短,且固定主机信号被遮挡时无法快速切换,易出现音频断流卡顿;另一类方案仅参考接收信号强度指示RSSI单因素判断切换条件,未考虑用户佩戴习惯、电量均衡、运动状态等其他影响因素,无法适配复杂动态使用场景,易出现用户行走或运动时切换逻辑混乱、单耳佩戴时播放中断、主从切换过程中音频不同步导致卡顿、杂音等问题,严重影响用户使用体验
针对TWS蓝牙耳机采用静态或单因素策略的主从角色分配导致降低用户使用体验的问题,本发明通过用户适配、连接稳定、功耗均衡、状态趋势四个维度的量化得分,能够分别从用户佩戴习惯与主观偏好、耳机与音频源之间的通信链路质量、左右耳机电量及历史负载均衡程度、耳机当前运动及佩戴稳定状态等方面表征每个耳机作为主机的适配基础,避免仅依据固定主机、电量或RSSI单一因素进行主从角色判断所造成的决策片面性;根据两个耳机用户适配得分、连接稳定得分、功耗均衡得分以及状态趋势得分的差异,得到用户意图紧迫度、连接稳定紧迫度以及系统状态紧迫度,能够根据当前场景中用户需求差异、通信稳定风险以及功耗或运动状态异常程度,动态确定影响主机选择的主导因素,使主从切换策略在用户手动指定、链路质量下降、电量差异扩大或佩戴状态波动增强等不同场景下具有自适应调整能力;对用户适配得分、连接稳定得分以及系统状态得分进行加权求和,得到每个耳机的主机适配分数,能够将耳机的用户适配程度、连接可靠性以及系统运行状态统一映射为主机选择依据,使主机选择结果更加贴合当前实际使用场景,减少不必要的频繁切换、信号遮挡导致的播放卡顿以及单侧耳机长期高负载造成的续航失衡。通过主机适配分数进行TWS蓝牙耳机的主从耳机策略切换,提高了用户使用体验。
Smart Images

Figure CN122802834A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of wireless audio device control technology, specifically to a TWS Bluetooth headset playback control method and system. Background Technology
[0002] TWS (True Wireless Stereo) Bluetooth earbuds, with their advantages of being free from physical cables, portable design, and supporting binaural stereo playback, have become one of the fastest-growing product categories in the consumer electronics field, widely used in music playback, voice calls, and fitness tracking. One of the core technologies of TWS earbuds is the master-slave role management mechanism: in normal operation, one earbud acts as the master, directly connecting to an audio source device such as a mobile phone or tablet, responsible for receiving, decoding, and forwarding audio data to the slave earbud. The slave earbud only receives the audio signal forwarded by the master to complete playback.
[0003] Current TWS Bluetooth earbuds mostly employ static or single-factor strategies for master-slave role allocation. One approach designates a single earbud as the master, passively triggering a switch only when that earbud's battery is depleted. In this approach, the master earbud bears a high load for extended periods, easily leading to significant power consumption differences between the two earbuds, shortening overall battery life. Furthermore, when the master earbud's signal is blocked, it cannot switch quickly, resulting in audio interruptions and stuttering. Another approach relies solely on the Received Signal Strength Index (RSSI) to determine the switching condition, neglecting other influencing factors such as user wearing habits, battery balance, and activity levels. This approach cannot adapt to complex and dynamic usage scenarios, easily leading to issues such as confusing switching logic when the user is walking or exercising, playback interruptions when wearing only one earbud, and audio asynchrony during master-slave switching causing stuttering and noise, severely impacting the user experience. Summary of the Invention
[0004] To address the technical problem of reduced user experience caused by static or single-factor strategy master-slave role allocation in TWS Bluetooth earphones, the present invention aims to provide a TWS Bluetooth earphone playback control method and system, the specific technical solution of which is as follows: This invention provides a playback control method for TWS Bluetooth earphones, the method comprising: Acquire wearing status data for each earphone; the wearing status data includes the current continuous wearing time, the earphone priority set by the user, RSSI value, bit error rate, environmental interference value, battery level, historical usage time, historical host time, user-specified host identifier, and acceleration value; Based on the continuous wearing time of each earphone and the earphone priority set by the user, a user adaptation score is obtained for each earphone; based on the RSSI value, bit error rate, and environmental interference value of each earphone, a connection stability score is obtained for each earphone; based on the battery level, historical usage time, and historical host time of each earphone, a power consumption balance score is obtained for each earphone; based on the fluctuation of the acceleration value of each earphone, a state trend score is obtained for each earphone. Combined with the power consumption balance score, a system state score is obtained. Based on the differences in user compatibility scores, connection stability scores, power consumption balance scores, and status trend scores between the two headsets, the urgency of user intent, connection stability, and system status are obtained. Combining the user compatibility scores, connection stability scores, and system status scores, the host compatibility score for each headset is obtained. The master-slave strategy for TWS Bluetooth earbuds is switched based on the master-slave compatibility score of the two earbuds.
[0005] Furthermore, the specific method for obtaining a user adaptation score for each earphone based on the continuous wearing time of each earphone and the earphone priority set by the user includes: For any earphone, obtain the ratio of the continuous wearing time of the earphone to the wearing stability threshold, and take the minimum value between the ratio and 1 as the wearing stability score of the earphone. For any earphone, obtain the priority set by the user through the earphone app or touch gestures. If the earphone is low priority, the user priority score of the earphone is set to the first score; if the earphone is medium priority, the user priority score of the earphone is set to the second score; if the earphone is high priority, the user priority score of the earphone is set to the third score. The user compatibility score of the headphones is obtained by weighting and summing the wearing stability score and the user priority score.
[0006] Furthermore, the specific method for obtaining the connection stability score for each earphone based on its RSSI value, bit error rate, and environmental interference value is as follows: For any earphone, the average value of the earphone's RSSI within a preset time window is recorded as the current RSSI representation value of the earphone. Obtain the difference between the current RSSI value of the earphone and the preset worst threshold. The ratio of this difference to the preset theoretical allowable fluctuation range is recorded as the initial RSSI score of the earphone. The initial RSSI score of the earphone is then used as the linear normalized result of the maximum value among 0 and 0. The difference between 1 and the bit error rate is recorded as the bit error rate score. The inversely proportional normalized result of the environmental interference value of the headphone is recorded as the environmental interference score of the headphone. For any given earphone, the connection stability score is obtained by weighted summing of its RSSI score, bit error rate score, and environmental interference score.
[0007] Furthermore, the method for obtaining a power consumption balance score for each earphone based on its battery level, historical usage time, and historical host usage time includes the following specific steps: For any earphone, obtain the difference between the battery percentage of the earphone and the battery percentage of the other earphone, obtain the ratio of this difference to 2, and record the sum of this ratio and 0.5 as the battery score of the earphone. The difference between the usage time of the earphone within a preset cumulative time and the host time of the earphone within a preset cumulative time is obtained. The ratio of this difference to the usage time of the earphone within the preset cumulative time is recorded as the historical host time score of the earphone. The power consumption balance score of the headset is obtained by weighting and summing the headset's battery score and historical host duration score.
[0008] Furthermore, the specific method for obtaining the state trend score for each earphone based on the fluctuation of its acceleration value includes: Establish a state analysis window with a preset analysis length, ending at the current time. For any given headphone, the inversely proportional normalized result of the standard deviation of the headphone's acceleration values at all times within the state analysis window is recorded as the headphone's state trend score.
[0009] Furthermore, the specific method for obtaining the system state score by combining the power consumption balancing score is as follows: For any given headset, the average of its power consumption balance score and state trend score is used as the system state score for that headset.
[0010] Furthermore, the specific method for obtaining the user intent urgency, connection stability urgency, and system state urgency based on the differences in user adaptation scores, connection stability scores, power consumption balance scores, and state trend scores between the two headphones includes: The absolute value of the difference between the user adaptation scores of the two headphones is recorded as the user adaptation difference degree; The absolute value of the difference between the connection stability scores of the two headphones is recorded as the connection stability difference. The absolute value of the difference between the power consumption balance scores of the two headphones is recorded as the power consumption balance difference degree; the absolute value of the difference between the state trend scores of the two headphones is recorded as the state trend difference degree; the average of the power consumption balance difference degree and the state trend difference degree is recorded as the system optimization difference degree. If the user manually specifies the host via APP or touch, the user intent urgency is set to the preset maximum value; otherwise, the product of the user adaptation difference and the preset intent ratio threshold is recorded as the user intent urgency. Get the average connection stability score of the two headphones. If the average score is less than the preset safety threshold, get the difference between the preset safety threshold and the average score. The sum of the product of the difference and the preset stability amplification coefficient and 1 is recorded as the connection stability urgency. If the average score is greater than or equal to the preset safety threshold, the product of the connection stability difference and the preset stability ratio threshold is recorded as the connection stability urgency. Get the power difference between the two earphones. If the power difference between the two earphones is greater than the preset power threshold, or if the acceleration standard deviation of one earphone is greater than the preset acceleration threshold, then take the maximum value between the power difference between the two earphones minus the preset power threshold and 0. Multiply the maximum value by the preset power amplification factor and record it as the power contribution urgency. The maximum value of the difference between the maximum standard deviation of acceleration of the two headphones and the preset acceleration threshold is taken as the maximum value of the difference and 0. The product of this maximum value and the preset acceleration amplification factor is recorded as the acceleration contribution urgency. The sum of the battery contribution urgency, the acceleration contribution urgency and 1 is recorded as the system status urgency. If the difference in battery level between the two earphones is less than or equal to a preset battery level threshold, and the standard deviation of acceleration of each earphone is less than or equal to a preset acceleration threshold, then the product of the system optimization difference degree and the preset system proportion threshold is recorded as the system state urgency degree.
[0011] Furthermore, the method for obtaining the host compatibility score for each headset by combining the user adaptation score, connection stability score, and system status score includes: For any headset, the urgency of user intent, the urgency of connection stability, and the urgency of system status are weighted and normalized. The normalized results are then used as weights for the headset's user compatibility score, connection stability score, and system status score, respectively, and summed to obtain the headset's host compatibility score.
[0012] Furthermore, the specific method for switching the master-slave earphone strategy of TWS Bluetooth earphones based on the master adaptation score of the two earphones includes: If the user manually specifies the host, the switch will be triggered directly; If the user does not manually specify, obtain the difference between the host adaptation scores of the two headphones. If the difference is greater than the preset master-slave switching threshold, the headphone with the highest host adaptation score will be used as the master. If the difference is less than or equal to the preset master-slave switching threshold, the current master-slave strategy will remain unchanged.
[0013] The present invention also proposes a TWS Bluetooth headset playback control system, which includes a memory, a processor, and a computer program stored in the memory and running on the processor, wherein the processor executes the computer program to implement the steps of the above method.
[0014] The present invention has the following beneficial effects: To address the issue of reduced user experience caused by static or single-factor strategies in master-slave role allocation for TWS Bluetooth earbuds, this invention employs quantitative scores across four dimensions: user compatibility, connection stability, power consumption balance, and state trend. These scores characterize each earbud's compatibility as a master based on factors such as user wearing habits and subjective preferences, communication link quality between the earbuds and the audio source, battery level and historical load balancing of the left and right earbuds, and current movement and wearing stability. This avoids the biased decision-making caused by relying solely on fixed master, battery level, or RSSI as the sole factor for master-slave role determination. Based on the differences in user compatibility scores, connection stability scores, power consumption balance scores, and state trend scores between the two earbuds, the urgency of user intent, the urgency of connection stability, and system performance can be determined. The urgency level assessment dynamically determines the dominant factors influencing host selection based on differences in user needs, communication stability risks, and abnormal power consumption or motion states in the current scenario. This allows the master-slave switching strategy to adaptively adjust under different scenarios, such as user manual specification, degraded link quality, increased battery differences, or enhanced fluctuations in wearing status. A weighted sum of user compatibility score, connection stability score, and system status score is used to obtain a host compatibility score for each earbud. This unifies the earbud's user compatibility, connection reliability, and system operating status as the host selection criterion, making the host selection result more closely aligned with the actual usage scenario. This reduces unnecessary frequent switching, playback stuttering caused by signal obstruction, and battery life imbalance caused by prolonged high load on one earbud. Using the host compatibility score to switch master and slave earbud strategies for TWS Bluetooth earbuds improves the user experience. Attached Figure Description
[0015] To more clearly illustrate the technical solutions and advantages in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0016] Figure 1 This is a flowchart illustrating the steps of a TWS Bluetooth headset playback control method according to an embodiment of the present invention. Detailed Implementation
[0017] To further illustrate the technical means and effects adopted by the present invention to achieve its intended purpose, the following, in conjunction with the accompanying drawings and preferred embodiments, details the specific implementation, structure, features, and effects of a TWS Bluetooth headset playback control method and system proposed according to the present invention. In the following description, different "one embodiment" or "another embodiment" do not necessarily refer to the same embodiment. Furthermore, specific features, structures, or characteristics in one or more embodiments can be combined in any suitable form.
[0018] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains.
[0019] The following description, in conjunction with the accompanying drawings, details a specific solution for a TWS Bluetooth headset playback control method and system provided by the present invention.
[0020] An embodiment of a TWS Bluetooth headset playback control method: Please see Figure 1 The diagram illustrates a flowchart of a TWS Bluetooth headset playback control method according to an embodiment of the present invention. Figure 1 As shown, the method specifically includes the following steps: Step S1: Obtain the wearing status data for each earphone.
[0021] It should be noted that in order to adjust the master-slave role allocation strategy of TWS Bluetooth earphones, it is first necessary to accurately identify the earphone wearing status through hardware sensors, quickly determine the initial master-slave role, provide a basis for subsequent dynamic decision-making, and avoid playback abnormalities caused by misjudgment.
[0022] It should be further explained that the infrared sensor built into the TWS earphone can detect whether the earphone is obstructing the ear, and the capacitive sensor can detect the contact value with human skin.
[0023] Specifically, the system collects data from the infrared sensor and the capacitive sensor once every 100ms. At any given moment, if the infrared sensor occlusion rate is greater than 90% or the capacitive sensor contact value is greater than 300fF, it is determined that a wearing signal has been detected at that moment; if a wearing signal is detected for three consecutive moments, it is determined that the headphones are in a wearing state; if a wearing signal is not detected for three consecutive moments, it is determined that the headphones are not in a wearing state. If only one of the left or right earbuds is being worn, it is considered a single-ear wearing scenario; In a single-ear scenario, the earphone being worn is directly set as the host and establishes a direct connection with the audio source. The earphone not being worn enters a low-power sleep state, disables the high-power Bluetooth transmission function, and switches the infrared sensor or capacitive sensor to a low-frequency sampling mode, retaining only the low-power wear detection wake-up function. If both earbuds are being worn, it is determined to be a binaural wearing scenario. In the binaural wearing scenario, the system maintains the current master-slave connection relationship. If there is no established master-slave connection relationship, a temporary host is determined based on the most recent successful connection record. If there is no historical connection record, the left earbud is the default temporary host. The temporary host is only used to maintain the initial communication link and is not used as the final host selection result.
[0024] In a binaural wearing scenario, wearing status data for the left and right earbuds are collected separately. Specifically, for any earbud, the duration of continuous wearing is recorded as the current continuous wearing time; the earbud priority set by the user via the earbud app or touch gestures is read; the RSSI value between the earbud and the audio source device within a preset time window is collected via the Bluetooth chip, and the bit error rate is obtained based on the number of erroneous data packets in the received data packets and the total number of received data packets; the current Bluetooth working channel and adjacent channels are scanned via the Bluetooth chip, and the environmental interference value is obtained based on the signal energy strength, channel occupancy time, and the number of non-local Bluetooth broadcast packets or data packets; the current battery percentage of the earbud is collected via the battery detection circuit; the historical usage time and historical host time of the earbud within a preset cumulative time are read from the earbud storage module; the acceleration value sequence within a preset analysis length is collected via the accelerometer; the manually specified host identifier input by the user via the earbud app or touch gestures is read; if the user does not manually specify a host, the manually specified host identifier is set to empty.
[0025] Step S2: Based on the continuous wearing time of each earphone and the earphone priority set by the user, obtain the user adaptation score for each earphone; based on the RSSI value, bit error rate, and environmental interference value of each earphone, obtain the connection stability score for each earphone; based on the battery level, historical usage time, and historical host duration of each earphone, obtain the power consumption balance score for each earphone; based on the fluctuation of the acceleration value of each earphone, obtain the state trend score for each earphone; and combine the power consumption balance score to obtain the system state score.
[0026] It should be noted that the selection of the main unit for TWS Bluetooth earphones is affected by the user's actual wearing habits, the communication quality between the mobile phone and the earphones, the difference in battery level and historical load between the left and right earphones, as well as changes in the user's exercise posture. Therefore, it is necessary to quantify and standardize the scoring of the left and right earphones based on four core factors: user compatibility, connection stability, power consumption balance, and status trend.
[0027] It should be further explained that the user compatibility score reflects how well the headphones fit the user's usage habits. Higher wearing stability and higher user-specified priority indicate stronger compatibility as the main unit and a better fit for the user's habits. A longer continuous wearing time indicates higher wearing stability. Higher priority settings, achieved through the headphone app or touch gestures, indicate higher user priority for the headphones.
[0028] Specifically, for any earphone, the ratio of the continuous wearing time to the wearing stability threshold is obtained, and the minimum value between this ratio and 1 is taken as the wearing stability score of the earphone; where the wearing stability threshold is... Let's take an example to illustrate.
[0029] As an example, the wearing stability score of this headset is calculated as follows: In the formula, Score the wearing stability of the headphones; This refers to the duration of continuous wear. For wearing stability threshold; It is a minimum value function.
[0030] It should be noted that when the continuous wearing time exceeds the wearing stability threshold, that is... Greater than or equal to When the wearing stability of the headphones is perfect, the continuous wearing time is less than the wearing stability threshold. Less than At that time, the wearing stability of the headphones was scored proportionally.
[0031] Furthermore, for any earphone, the priority set by the user through the earphone app or touch gestures is obtained. If the earphone is of low priority, the user priority score of the earphone is set to the first score; if the earphone is of medium priority, the user priority score of the earphone is set to the second score; if the earphone is of high priority, the user priority score of the earphone is set to the third score. The first score is less than the second score, and the second score is less than the third score. The first score is described as 0.25, the second score as 0.5, and the third score as 0.75. The user compatibility score of the headphones is obtained by weighting and summing the wearing stability score and the user priority score.
[0032] As an example, the user compatibility score for this headset is calculated as follows: In the formula, A score for user compatibility with this headset; Score the wearing stability of the headphones; Assign a user priority score to this headset.
[0033] It should be noted that the user fit score is calculated by weighting the wearing stability score and the user priority score. The wearing stability score has a higher weight than the user priority score because stable wearing is the basis for the continuous operation of the host. If the headphones are not worn stably, they may fall off at any time. Even if the user sets the priority to high, they are not suitable as the host for a long time.
[0034] It should be noted that the main unit of TWS Bluetooth earphones needs to establish a Bluetooth communication link directly with the mobile phone and undertake tasks such as audio data reception, playback control, and forwarding audio data to the slave unit. RSSI signal strength can reflect the attenuation of the wireless signal between the earphones and the mobile phone. The stronger the signal, the less distance, obstruction, and path loss there is.
[0035] Specifically, for any earphone, the average value of the earphone's RSSI within a preset adjacent time window is recorded as the current RSSI representation value of the earphone; the length of the preset adjacent time window is described using 10 seconds as an example. Obtain the difference between the current RSSI value of the earphone and the preset worst threshold. The ratio of this difference to the preset theoretical allowable fluctuation range is recorded as the initial RSSI score of the earphone. The initial RSSI score of the earphone is then normalized to the maximum value of 0, and the result is taken as the RSSI score of the earphone. The preset worst threshold is described using -80 as an example and the preset theoretical allowable fluctuation range is described using 30 as an example.
[0036] As an example, the RSSI score of this headset is calculated as follows: In the formula, Assign an RSSI score to the headphones; This indicates the current RSSI value of the headphones; To preset the worst threshold, This is based on a pre-defined theoretical allowable fluctuation range; This is a linear normalization function, and the object of normalization is all the data in the headphone's historical time series. .
[0037] It should be noted that in this embodiment, the RSSI range is from -80dBm to -50dBm, where -80dBm is the worst value of RSSI and -50dBm is the best value of RSSI.
[0038] It should be further explained that the bit error rate of data packets can directly reflect the proportion of errors that occur in audio data during transmission. The higher the bit error rate, the higher the risk of data retransmission or audio anomalies.
[0039] Specifically, the difference between 1 and the bit error rate is recorded as the bit error rate score.
[0040] It should be further noted that the environmental interference value reflects the degree to which the current Bluetooth channel is affected by other wireless devices, human bodies, or complex electromagnetic environments. The stronger the interference, the more unstable the communication quality.
[0041] Specifically, the inversely proportional normalized result of the environmental interference value of the headphones is recorded as the environmental interference score of the headphones.
[0042] As an example, the environmental interference score for this headset is calculated as follows: In the formula, Score the environmental interference for this headphone; This represents the environmental interference value of the headphones. It is a linear normalization function, which normalizes the environmental interference values of the headphones at all historical moments.
[0043] It should be further explained that after obtaining the RSSI score, bit error rate score, and environmental interference score of the headphones, since a single indicator is difficult to fully reflect the actual communication status between the headphones and the audio source device, it is necessary to integrate the above three scores so that the connection stability score can reflect not only the strength of the signal received by the headphones, but also the error risk in the data transmission process and the impact of the surrounding wireless environment on the link stability, thereby accurately obtaining the connection stability of the headphones.
[0044] Specifically, for any given earphone, the connection stability score of the earphone is obtained by weighted summing of its RSSI score, bit error rate score, and environmental interference score.
[0045] As an example, the connection stability score is calculated as follows: In the formula, Score the connection stability of the headphones; Assign an RSSI score to the headphones; Score the bit error rate of the headset; The environmental interference score is given to the headphones; RSSI is the core indicator of connection quality and has the highest weight; bit error rate and environmental interference directly affect the reliability of data transmission and each has a secondary weight, which comprehensively reflect the stability of the connection.
[0046] It should be noted that a higher connection stability score indicates a more stable communication link between the headset and the audio source device, stronger received signal, lower risk of bit error, and less impact from environmental interference. When the headset acts as the host, it is more capable of reliably completing tasks such as audio data reception, playback control, and forwarding audio data to slave devices.
[0047] It should be noted that because TWS Bluetooth earbuds typically handle more communication and processing tasks during playback, such as maintaining a Bluetooth connection with the phone, receiving audio data, maintaining playback control, and forwarding audio data to the slave earbuds, the power consumption rate of the master earbud is usually higher than that of the slave earbud. If the current battery level of one earbud is significantly higher than that of the other earbud, then that earbud is more suitable to take on the role of the master earbud in subsequent playback to avoid the low-battery earbud continuing to work under high load.
[0048] Specifically, for any one earphone, the difference between the battery percentage of that earphone and the battery percentage of the other earphone is obtained. The ratio of this difference to 2 is obtained. The sum of this ratio and 0.5 is recorded as the battery score of that earphone. The battery percentage is a normalized battery value, ranging from 0 to 1.
[0049] As an example, the battery score for this headset is calculated as follows: In the formula, Score the battery level of the headphones; This represents the battery percentage of the headphones. This represents the battery percentage of the other earphone.
[0050] It should be noted that constants The base score is 2, and the denominator 2 is used to map the battery difference to a reasonable scoring range. This formula converts the battery difference between the two earphones into a relative score. The earphone with more battery will receive a bonus of more than 0.5, and the earphone with less battery will have the corresponding score deducted.
[0051] It should be noted that if the cumulative time a certain earphone has been used as the main unit in a recent period is relatively short, it indicates that the historical load of that earphone is low. Appropriately increasing its main unit working time in the future will help balance the long-term battery consumption of both earphones.
[0052] Furthermore, for any earphone, the difference between the usage time of the earphone within a preset cumulative time and the host time of the earphone within a preset cumulative time is obtained, and the ratio of the difference to the usage time of the earphone within the preset cumulative time is recorded as the historical host time score of the earphone; wherein, the preset cumulative time is described using 7 days as an example; The historical host duration score for this headset is calculated as follows: In the formula, Score the historical host duration of this headset; This refers to the usage time within the preset cumulative time limit; This refers to the duration of the headset's main unit operation within the preset cumulative duration.
[0053] It should be noted that if the usage time of the earphone within the preset cumulative time is equal to 0, it means that there is no valid historical usage record of the earphone within the preset cumulative time. Therefore, the division operation with the above usage time as the denominator is not performed, and the historical host time score of the earphone is set as the preset baseline initial value. The preset baseline initial value is described for example as 0.5.
[0054] Furthermore, the power consumption balance score is calculated as follows: In the formula, Score for power consumption balance; Score the battery level of the headphones; Score based on the duration of the historical host session.
[0055] It should be noted that the power consumption balance score of the left and right earphones is obtained according to this method. The higher the power consumption balance score, the more suitable it is as a host to balance power consumption.
[0056] It should be further explained that during actual playback, TWS Bluetooth earbuds will experience changes in posture and movement state as the user's head turns, body moves, vibrates while running, and the position of the phone changes. The main earbud not only needs to maintain stable communication with the mobile phone, but also needs to continuously complete the audio reception and forwarding tasks under dynamic movement. If the acceleration fluctuation of the earbud is small in a recent period of time, it indicates that the user's movement amplitude is low or the earbud on that side is worn more stably, and the main link is not prone to sudden changes due to shaking, obstruction, or changes in fit.
[0057] Specifically, a state analysis window with a preset analysis length is established, ending with the current moment; the preset analysis length is described using 10 seconds as an example. For any given headphone, the inversely proportional normalized result of the standard deviation of the headphone's acceleration values at all times within the state analysis window is recorded as the headphone's state trend score.
[0058] It should be noted that the higher the state trend score of the headphones, the smaller the range of motion of the headphones, and the more stable the headphones are when worn. The higher the state trend score, the more suitable the headphones are as a host device.
[0059] Furthermore, for any given earphone, the average of its power consumption balance score and state trend score is used as the system state score for that earphone.
[0060] Step S3: Based on the differences in user adaptation score, connection stability score, power consumption balance score, and state trend score between the two headphones, obtain the urgency of user intent, connection stability, and system state. Combine the user adaptation score, connection stability score, and system state score to obtain the host adaptation score for each headphone.
[0061] It should be noted that after obtaining the user adaptation score, connection stability score, power consumption balance score, and state trend score, it is necessary to determine the factors that dominate the selection of the host in the current scenario. The greater the difference in scores between the left and right earphones in each dimension, the more significant the impact of that dimension on the master-slave decision. Power consumption balance and state trend are merged into a system optimization dimension, and the difference is calculated uniformly.
[0062] Specifically, the absolute value of the difference between the user adaptation scores of the two headphones is recorded as the user adaptation difference degree; The absolute value of the difference between the connection stability scores of the two headphones is recorded as the connection stability difference. The absolute value of the difference between the power consumption balance scores of the two headphones is recorded as the power consumption balance difference; the absolute value of the difference between the state trend scores of the two headphones is recorded as the state trend difference; and the average of the power consumption balance difference and the state trend difference is recorded as the system optimization difference.
[0063] It should be further explained that the priority of requirements varies in different scenarios. For example, when the user manually specifies the host, it should be given absolute priority; when the connection quality is poor, stability should be prioritized; and when the system status is abnormal, power consumption should be balanced or the system should be stabilized.
[0064] Specifically, if the user manually specifies the host via APP or touch, the user intent urgency is set to the preset maximum value; otherwise, the user intent urgency is recorded as the product of the user adaptation difference and the preset intent ratio threshold. The preset maximum value is described using 1 as an example and the preset intent ratio threshold is described using 0.8 as an example. The average connection stability score of the two headphones is obtained. If the average score is less than the preset safety threshold, the difference between the preset safety threshold and the average score is obtained. The sum of the product of the difference and the preset stability amplification factor and 1 is recorded as the connection stability urgency. If the average score is greater than or equal to the preset safety threshold, the product of the connection stability difference and the preset stability ratio threshold is recorded as the connection stability urgency. The preset safety threshold is described as 0.6, the preset stability amplification factor is described as 5, and the preset stability ratio threshold is described as 0.5.
[0065] Get the power difference between the two earphones. If the power difference between the two earphones is greater than the preset power threshold, or if the acceleration standard deviation of one earphone is greater than the preset acceleration threshold, then take the maximum value between the power difference between the two earphones minus the preset power threshold and 0. Multiply the maximum value by the preset power amplification factor and record it as the power contribution urgency. The maximum value of the difference between the maximum standard deviation of acceleration of the two headphones and the preset acceleration threshold is taken as the maximum value of the difference and 0. The product of this maximum value and the preset acceleration amplification factor is recorded as the acceleration contribution urgency. The sum of the battery contribution urgency, the acceleration contribution urgency and 1 is recorded as the system status urgency. If the difference in battery level between the two earphones is less than or equal to a preset battery level threshold, and the standard deviation of acceleration of each earphone is less than or equal to a preset acceleration threshold, then the product of the system optimization difference degree and the preset system ratio threshold is recorded as the system state urgency. The preset battery level threshold is described using 0.2 as an example, the preset acceleration threshold is 8 as an example, the preset battery level amplification factor is 2 as an example, the preset acceleration amplification factor is 5 as an example, and the preset system ratio threshold is 0.4 as an example.
[0066] It should be noted that the higher the urgency of each dimension—user intent urgency, connection stability urgency, and system state urgency—the higher the decision priority for that dimension.
[0067] Furthermore, for any headset, the urgency of user intent, the urgency of connection stability, and the urgency of system status are weighted and normalized. The normalized results are then used as weights for the headset's user compatibility score, connection stability score, and system status score, respectively, and summed to obtain the headset's host compatibility score. If the sum of the urgency of user intent, the urgency of connection stability, and the urgency of system status is 0, the weights of the user compatibility score, the connection stability score, and the system status score are set to preset default weights. The preset default weights are described for example as 0.3, 0.4, and 0.3.
[0068] It should be noted that the higher the host compatibility score of the headset, the stronger the compatibility of the headset as a host in the current state.
[0069] Step S4: Switch the master-slave strategy of the TWS Bluetooth earphones based on the master adaptation scores of the two earphones.
[0070] It should be noted that in order to avoid frequent switching and affect user experience, a switching threshold needs to be set to switch between master and slave when necessary. At the same time, it is important to ensure timely switching when there is a large difference in the host adaptation score to ensure connection stability or power consumption balance.
[0071] Specifically, if the user manually specifies the host, the switch will be triggered directly; If the user does not manually specify, the difference between the host adaptation scores of the two headphones is obtained. If the difference is greater than the preset master-slave switching threshold, the headphone with the highest host adaptation score is selected as the host. If the difference is less than or equal to the preset master-slave switching threshold, the current master-slave strategy remains unchanged. The preset master-slave switching threshold is described using 0.15 as an example.
[0072] Another embodiment of the present invention provides a TWS Bluetooth headset playback control system, the system including a memory, a processor, and a computer program stored in the memory and running on the processor. When the processor executes the computer program, it implements the above method steps S1 to S4.
[0073] It should be noted that the order of the above embodiments of the present invention is merely for descriptive purposes and does not represent the superiority or inferiority of the embodiments. The processes depicted in the accompanying drawings do not necessarily require a specific or sequential order to achieve the desired result. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0074] The various embodiments in this specification are described in a progressive manner. The same or similar parts between the various embodiments can be referred to each other. Each embodiment focuses on describing the differences from other embodiments.
Claims
1. A playback control method for TWS Bluetooth earphones, characterized in that, The method includes: Acquire wearing status data for each earphone; the wearing status data includes the current continuous wearing time, the earphone priority set by the user, RSSI value, bit error rate, environmental interference value, battery level, historical usage time, historical host time, user-specified host identifier, and acceleration value; Based on the continuous wearing time of each earphone and the earphone priority set by the user, a user adaptation score is obtained for each earphone; based on the RSSI value, bit error rate, and environmental interference value of each earphone, a connection stability score is obtained for each earphone; based on the battery level, historical usage time, and historical host time of each earphone, a power consumption balance score is obtained for each earphone; based on the fluctuation of the acceleration value of each earphone, a state trend score is obtained for each earphone. Combined with the power consumption balance score, a system state score is obtained. Based on the differences in user compatibility scores, connection stability scores, power consumption balance scores, and status trend scores between the two headsets, the urgency of user intent, connection stability, and system status are obtained. Combining the user compatibility scores, connection stability scores, and system status scores, the host compatibility score for each headset is obtained. The master-slave strategy for TWS Bluetooth earbuds is switched based on the master-slave compatibility score of the two earbuds.
2. The TWS Bluetooth headset playback control method according to claim 1, characterized in that, The method for obtaining a user compatibility score for each earphone based on its continuous wearing time and the user-set earphone priority includes: For any earphone, obtain the ratio of the continuous wearing time of the earphone to the wearing stability threshold, and take the minimum value between the ratio and 1 as the wearing stability score of the earphone. For any earphone, obtain the priority set by the user through the earphone app or touch gestures. If the earphone is low priority, the user priority score of the earphone is set to the first score; if the earphone is medium priority, the user priority score of the earphone is set to the second score; if the earphone is high priority, the user priority score of the earphone is set to the third score. The user compatibility score of the headphones is obtained by weighting and summing the wearing stability score and the user priority score.
3. The TWS Bluetooth headset playback control method according to claim 1, characterized in that, The method for obtaining a connection stability score for each earphone based on its RSSI value, bit error rate, and environmental interference value includes the following: For any earphone, the average value of the earphone's RSSI within a preset time window is recorded as the current RSSI representation value of the earphone. Obtain the difference between the current RSSI value of the headphone and the preset worst threshold, and record the ratio of this difference to the preset theoretical allowable fluctuation range as the initial RSSI score of the headphone. The initial RSSI score of the earphone is obtained by taking the linearly normalized result of the maximum value of 0 and using it as the RSSI score of the earphone. The difference between 1 and the bit error rate is recorded as the bit error rate score. The inversely proportional normalized result of the environmental interference value of the headphone is recorded as the environmental interference score of the headphone. For any given earphone, the connection stability score is obtained by weighted summing of its RSSI score, bit error rate score, and environmental interference score.
4. The TWS Bluetooth headset playback control method according to claim 1, characterized in that, The method for obtaining a power consumption balance score for each earphone based on its battery level, historical usage time, and historical host usage time includes the following: For any earphone, obtain the difference between the battery percentage of the earphone and the battery percentage of the other earphone, obtain the ratio of this difference to 2, and record the sum of this ratio and 0.5 as the battery score of the earphone. The difference between the usage time of the earphone within a preset cumulative time and the host time of the earphone within a preset cumulative time is obtained. The ratio of this difference to the usage time of the earphone within the preset cumulative time is recorded as the historical host time score of the earphone. The power consumption balance score of the headset is obtained by weighting and summing the headset's battery score and historical host duration score.
5. The TWS Bluetooth headset playback control method according to claim 1, characterized in that, The method for obtaining a state trend score for each earphone based on the fluctuation of its acceleration value includes: Establish a state analysis window with a preset analysis length, ending at the current time. For any given headphone, the inversely proportional normalized result of the standard deviation of the headphone's acceleration values at all times within the state analysis window is recorded as the headphone's state trend score.
6. The TWS Bluetooth headset playback control method according to claim 1, characterized in that, The specific method for obtaining the system state score by combining the power consumption balancing score is as follows: For any given headset, the average of its power consumption balance score and state trend score is used as the system state score for that headset.
7. The TWS Bluetooth headset playback control method according to claim 1, characterized in that, The method for obtaining user intent urgency, connection stability urgency, and system state urgency based on the differences in user compatibility scores, connection stability scores, power consumption balance scores, and state trend scores between the two headsets includes the following specific methods: The absolute value of the difference between the user adaptation scores of the two headphones is recorded as the user adaptation difference degree; The absolute value of the difference between the connection stability scores of the two headphones is recorded as the connection stability difference. The absolute value of the difference between the power consumption balance scores of the two headphones is recorded as the power consumption balance difference degree; the absolute value of the difference between the state trend scores of the two headphones is recorded as the state trend difference degree; the average of the power consumption balance difference degree and the state trend difference degree is recorded as the system optimization difference degree. If the user manually specifies the host via APP or touch, the user intent urgency is set to the preset maximum value; otherwise, the product of the user adaptation difference and the preset intent ratio threshold is recorded as the user intent urgency. Get the average connection stability score of the two headphones. If the average score is less than the preset safety threshold, get the difference between the preset safety threshold and the average score. The sum of the product of the difference and the preset stability amplification coefficient and 1 is recorded as the connection stability urgency. If the average score is greater than or equal to the preset safety threshold, the product of the connection stability difference and the preset stability ratio threshold is recorded as the connection stability urgency. Get the power difference between the two earphones. If the power difference between the two earphones is greater than the preset power threshold, or if the acceleration standard deviation of one earphone is greater than the preset acceleration threshold, then take the maximum value between the power difference between the two earphones minus the preset power threshold and 0. Multiply the maximum value by the preset power amplification factor and record it as the power contribution urgency. The maximum value of the difference between the maximum standard deviation of acceleration of the two headphones and the preset acceleration threshold is taken as the maximum value of the difference and 0. The product of this maximum value and the preset acceleration amplification factor is recorded as the acceleration contribution urgency. The sum of the battery contribution urgency, the acceleration contribution urgency and 1 is recorded as the system status urgency. If the difference in battery level between the two earphones is less than or equal to a preset battery level threshold, and the standard deviation of acceleration of each earphone is less than or equal to a preset acceleration threshold, then the product of the system optimization difference degree and the preset system proportion threshold is recorded as the system state urgency degree.
8. The TWS Bluetooth headset playback control method according to claim 1, characterized in that, The method for obtaining the host adaptation score for each headset by combining user adaptation score, connection stability score, and system status score includes: For any headset, the urgency of user intent, the urgency of connection stability, and the urgency of system status are weighted and normalized. The normalized results are then used as weights for the headset's user compatibility score, connection stability score, and system status score, respectively, and summed to obtain the headset's host compatibility score.
9. A TWS Bluetooth headset playback control method according to claim 1, characterized in that, The specific method for switching the master-slave earphone strategy of TWS Bluetooth earphones based on the master-slave adaptation score of the two earphones includes: If the user manually specifies the host, the switch will be triggered directly; If the user does not manually specify, obtain the difference between the host adaptation scores of the two headphones. If the difference is greater than the preset master-slave switching threshold, the headphone with the highest host adaptation score will be used as the host. If the difference is less than or equal to the preset master-slave switching threshold, the current master-slave strategy remains unchanged.
10. A TWS Bluetooth headset playback control system, characterized in that, The device includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the steps of the TWS Bluetooth headset playback control method as described in any one of claims 1 to 9.