A method for managing a Bluetooth device connection, an electronic device, and a computer medium
By establishing five state models and priority management for Bluetooth audio source devices, the problem of repeated device connection and disconnection in Bluetooth connection management is solved, achieving a stable and consistent user experience and low-power Bluetooth device management.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- SHANGHAI UNDERSTAND TECHNOLOGY CO LTD
- Filing Date
- 2026-06-08
- Publication Date
- 2026-07-14
AI Technical Summary
Existing Bluetooth connection management solutions lack dynamic sensing capabilities in complex multi-device collaborative scenarios, leading to repeated establishment and disconnection of connections between devices, causing audio stuttering and vibration, and lacking protection for core communication services, thus affecting user experience.
Five state models (offline, connected, standby, active, disconnected) are established for each Bluetooth audio source device. The state is dynamically adjusted by signal strength and time threshold. Combined with priority and radio frequency resource management, automatic connection and smooth transition are achieved to ensure communication stability and service continuity.
It enables seamless switching and automatic management of Bluetooth devices in complex environments, avoids repeated connection and disconnection of devices, ensures the continuity of user auditory experience and communication reliability, reduces operating power consumption, and prevents interruption of core services.
Smart Images

Figure CN122395750A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of Bluetooth connectivity, and more particularly to a method for managing Bluetooth device connectivity, an electronic device, and a computer medium. Background Technology
[0002] With the development of wireless communication technology, Bluetooth audio devices are becoming increasingly common in daily office and life applications. Modern users typically own multiple Bluetooth audio source devices such as smartphones, tablets, and personal computers, and frequently switch between them in different usage scenarios. In this context, Bluetooth connection management technology plays a crucial role in the multi-device interaction ecosystem. Excellent connection management not only needs to ensure the physical stability of audio signal transmission but also needs to intelligently assess the spatial distance and communication status between devices. This allows for seamless switching and dynamic scheduling between multiple audio sources within limited underlying radio frequency resources, providing a coherent and immersive acoustic interaction experience.
[0003] However, existing Bluetooth connection management solutions have significant limitations when dealing with complex multi-device collaborative scenarios. Current management methods often rely on users manually selecting devices from a list or blindly reconnecting based solely on recent connection records, lacking dynamic awareness of environmental changes. While some solutions attempt to incorporate signal strength to assist connection judgment, the lack of robust state transition mechanisms and anti-jitter logic makes them prone to repeated link establishment and disconnection when the user is in a critical communication zone, causing severe audio stuttering and oscillations. Furthermore, existing technologies handle multi-device resource conflicts in a simplistic and crude manner, easily creating abrupt acoustic breaks during connection switching and lacking underlying protection barriers for core communication services. This often results in real-time voice interactions being forcibly interrupted by unexpected detection by other devices, severely compromising product communication reliability.
[0004] In summary, how to overcome the rigid limitations of existing mechanisms and achieve a connection management mechanism that can intelligently sense physical movement, smoothly transition radio frequency resources, and absolutely ensure that core communication services are not interrupted in complex radio environments and multi-device concurrent scenarios has become a critical technical challenge that urgently needs to be solved in the current Bluetooth audio technology field. Summary of the Invention
[0005] In order to overcome the above-mentioned technical defects, the purpose of this invention is to provide a management method for Bluetooth device connection, an electronic device, and a computer medium.
[0006] This invention discloses a connection management method for Bluetooth devices, comprising: Each Bluetooth audio source device that has been paired with the receiving device is assigned a communication state model, which includes five states: offline, connected, standby, active, and disconnected. Based on the state characteristics of the Bluetooth audio source device, the state of the corresponding communication state model is adjusted or maintained at a preset time frequency to perform connection, disconnection and maintenance operations on the paired Bluetooth audio source device. The adjustment of the corresponding communication state model includes: When the Bluetooth audio source device has no signal or the signal strength is less than the disconnection threshold, it is assigned an offline status. When the signal strength of an offline Bluetooth audio source device is greater than the connection threshold and the preset connection conditions are met, it is assigned a "connecting" status. When a Bluetooth audio source device in a connected state successfully establishes an asynchronous connectionless link, it is given a standby state. When a Bluetooth audio source device in standby mode transmits an audio signal to a receiving device, it is given an active state; When the signal strength of a Bluetooth audio source device in standby or active state is less than the disconnect threshold and the preset disconnect conditions are met, it is assigned a disconnect state. Once the disconnection process of a Bluetooth audio source device in the disconnection state is completed, it is assigned an offline status.
[0007] Preferably, the signal strength of the Bluetooth audio source device remains greater than the connection threshold for a first preset time. The preset disconnection condition is: the signal strength of the Bluetooth audio source device remains below the disconnection threshold for a period of time that reaches the second preset time.
[0008] Preferably, when the signal strength of an offline Bluetooth audio source device is greater than the connection threshold and the preset connection conditions are met, it is assigned a connected state, including: When the signal strength of an offline Bluetooth audio source device is greater than -70dBm and remains so for more than 3 seconds, it is given a connected status. When the signal strength of a Bluetooth audio source device in standby or active state is less than the disconnect threshold and the preset disconnect conditions are met, it is assigned a disconnected state, including: If the signal strength of a Bluetooth audio source device in standby or active state is less than -85dBm and remains so for more than 10 seconds, it will be assigned a disconnected state.
[0009] Preferably, the preset connection conditions further include: the receiving device has an available radio frequency slot; Adjusting the state of the corresponding communication state model also includes: When no available RF slots are available, the priority of the Bluetooth audio source device whose current signal strength is greater than the connection threshold and meets the preset connection conditions is obtained, and the lowest priority among the Bluetooth audio source devices in standby or active states is obtained. When the priority of a Bluetooth audio source device that has a current signal strength greater than the connection threshold and meets the preset connection conditions is greater than the lowest priority, the Bluetooth audio source device in standby or active state that has the lowest priority will be assigned to the disconnected state, and its corresponding available RF slot will be allocated to the Bluetooth audio source device whose current signal strength is greater than the connection threshold and meets the preset connection conditions.
[0010] Preferably, assigning a disconnected Bluetooth audio source device to a standby or active state further includes: when the current signal strength is greater than the connection threshold and the priority of the Bluetooth audio source device that meets the preset connection conditions is greater than the lowest priority. Determine whether the Bluetooth audio source device with the lowest priority is in a call state; If not in a voice call state, the Bluetooth audio source device with the lowest priority will be assigned a disconnected state. If the device is in a voice call state, it will be prevented from being assigned a disconnected state, and Bluetooth audio source devices with a current signal strength greater than the connection threshold and meeting the preset connection conditions will be added to the waiting queue until the voice call state ends and the priority acquisition step is re-executed.
[0011] Preferably, the disconnection process includes: The audio data transmitted to the corresponding device is linearly reduced to zero; Pause the Audio / Video Distribution Transport Protocol (AVDTP) stream and disconnect the asynchronous connectionless link.
[0012] Preferably, adjusting or maintaining the state of the corresponding communication state model at a preset time frequency to perform connection, disconnection, and maintenance operations on the paired Bluetooth audio source device includes: When no active Bluetooth audio source device is available, the first scanning interval is used; The second scanning interval is used when at least one active Bluetooth audio source device is present; When there is a Bluetooth audio source device that has just completed the disconnection process, the third scanning interval is used within the preset time window; The third scan interval is smaller than the first scan interval, and the first scan interval is smaller than the second scan interval.
[0013] Preferably, when the receiving device includes multiple radio frequency front-ends, the method further includes: When it is necessary to assign an RF front-end to a Bluetooth audio source device that is in a connected state, the RF front-end with the lowest current load should be selected for assignment first. When one RF front-end is overloaded and another RF front-end has idle capability, the connection of the Bluetooth audio source device in standby mode will be migrated to the RF front-end with idle capability.
[0014] A second aspect of this application provides an electronic device including a memory and a processor, wherein the memory and the processor are communicatively connected. The memory stores a computer program, and when the processor executes the program, it implements a Bluetooth device connection management method as described above.
[0015] A third aspect of this application provides a computer-readable storage medium having a computer program stored thereon that, when executed by a processor, implements a Bluetooth device connection management method as described in any of the foregoing.
[0016] Compared with existing technologies, the above technical solution has the following advantages: 1. By establishing a communication state model covering offline, connected, standby, active, and disconnected states for each Bluetooth audio source device paired with the receiving device, the system overcomes the limitations of existing technologies where Bluetooth devices are fixedly connected or require manual switching. The system can dynamically drive the device to automatically transition between these five states in real time based on characteristics such as the signal strength of the Bluetooth audio source device. When a device meets specific thresholds and conditions, it sequentially completes the establishment of the underlying link, data stream transmission, and release. This underlying state machine mechanism allows for automatic management and seamless transition of multiple Bluetooth audio source device connections without user intervention when moving between different physical locations. 2. Based on the communication state model transition, this solution constructs a dual anti-shake and smooth transition mechanism at the underlying technology level, taking into account both spatial and temporal dimensions. By setting an asymmetric, wide hysteresis range and forcing the signal state to remain continuously for a specific preset time, it effectively filters out instantaneous signal fluctuations caused by location movement and avoids the oscillation phenomenon of repeated establishment and disconnection of devices at critical communication distances. Simultaneously, addressing the auditory pain point when a device disconnects, the system sequentially executes a step-by-step exit mechanism: linear fading of audio data, pausing streaming transmission, and then cutting off the underlying link. This not only masks the abruptness of physical link disconnection but also ensures the ultimate continuity and naturalness of the user's auditory experience in complex radio environments and during device handover processes. 3. Furthermore, this application constructs a dynamic allocation architecture based on priority and multi-RF front-end scheduling. When available RF slots are limited, the system automatically compares and forcibly releases the slot of the lowest priority device, ensuring that limited resources are always tilted towards core devices. In the case of multiple hardware communication nodes, it can also smoothly migrate the connection of standby devices to a front-end with idle capacity to achieve load balancing. More importantly, the system sets up an absolute protection barrier for voice call status before triggering resource preemption. If the underlying link is carrying real-time voice interaction, the priority replacement process is forcibly suspended, completely eliminating the risk of core communication service interruption caused by automatic device scheduling or resource preemption. 4. Finally, to achieve the optimal balance between ultra-fast connection response and hardware power consumption, the system establishes an adaptive time-frequency adjustment mechanism highly linked to the communication state model. Based on the presence of currently active devices or the progress of the disconnection process, it dynamically switches between scanning intervals of varying spans, allocating computing power and radio frequency resources as needed, significantly reducing overall power consumption without sacrificing agility. Furthermore, the complex communication state transitions, priority scheduling, and anti-jitter control algorithms described above are encapsulated into an executable computer program. Leveraging the processor and storage media of electronic devices, this provides a physical carrier and software distribution capability for this advanced Bluetooth scheduling scheme, realizing the industrialization and standardization of the technology. Attached Figure Description
[0017] Figure 1 A schematic diagram illustrating the transformation relationship of the communication state model for the Bluetooth device connection management method provided in this application. Detailed Implementation
[0018] The advantages of the present invention will be further illustrated below with reference to the accompanying drawings and specific embodiments.
[0019] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numerals in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this disclosure. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this disclosure as detailed in the appended claims.
[0020] The terminology used in this disclosure is for the purpose of describing particular embodiments only and is not intended to be limiting of the disclosure. The singular forms “a,” “the,” and “the” as used in this disclosure and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used herein refers to and includes any and all possible combinations of one or more of the associated listed items.
[0021] It should be understood that although the terms first, second, third, etc., may be used in this disclosure to describe various information, such information should not be limited to these terms. These terms are used only to distinguish information of the same type from one another. For example, without departing from the scope of this disclosure, first information may also be referred to as second information, and similarly, second information may also be referred to as first information. Depending on the context, the word "if" as used herein may be interpreted as "when," "when," or "in response to determination."
[0022] In the description of this invention, it should be understood that the terms "longitudinal", "lateral", "up", "down", "front", "rear", "left", "right", "vertical", "horizontal", "top", "bottom", "inner", "outer", etc., indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings. They are only for the convenience of describing this invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limitations on this invention.
[0023] In the description of this invention, unless otherwise specified and limited, it should be noted that the terms "installation", "connection" and "linking" should be interpreted broadly. For example, they can refer to mechanical or electrical connections, or internal connections between two components. They can be direct connections or indirect connections through an intermediate medium. Those skilled in the art can understand the specific meaning of the above terms according to the specific circumstances.
[0024] In the following description, suffixes such as "module," "part," or "unit" used to denote elements are used only for the convenience of the description of the invention and have no specific meaning in themselves. Therefore, "module" and "part" can be used interchangeably.
[0025] Please see Figure 1 , Figure 1 A schematic diagram illustrating the transformation relationship of the communication state model for the Bluetooth device connection management method provided in this application.
[0026] like Figure 1 As shown, this invention discloses a connection management method for a Bluetooth device, comprising: Each Bluetooth audio source device that has been paired with the receiving device is assigned a communication state model, which includes five states: offline, connected, standby, active, and disconnected. Based on the state characteristics of the Bluetooth audio source device, the state of the corresponding communication state model is adjusted or maintained at a preset time frequency to perform connection, disconnection and maintenance operations on the paired Bluetooth audio source device. The adjustment of the corresponding communication state model includes: When the Bluetooth audio source device has no signal or the signal strength is less than the disconnection threshold, it is assigned an offline status. When the signal strength of an offline Bluetooth audio source device is greater than the connection threshold and the preset connection conditions are met, it is assigned a "connecting" status. When a Bluetooth audio source device in a connected state successfully establishes an asynchronous connectionless link, it is given a standby state. When a Bluetooth audio source device in standby mode transmits an audio signal to a receiving device, it is given an active state; When the signal strength of a Bluetooth audio source device in standby or active state is less than the disconnect threshold and the preset disconnect conditions are met, it is assigned a disconnect state. Once the disconnection process of a Bluetooth audio source device in the disconnection state is completed, it is assigned an offline status.
[0027] This can be understood as follows: The Bluetooth device connection management method provided in this application establishes a communication state model covering offline, connected, standby, active, and disconnected states for each Bluetooth audio source device paired with the receiving device. This breaks the limitations of existing technologies where Bluetooth devices are fixedly connected or require manual switching. The system can dynamically drive the device to automatically switch between the five states in real time based on characteristics such as the signal strength of the Bluetooth audio source device. When the device meets specific thresholds and conditions, it sequentially completes the establishment of an asynchronous connectionless link, data stream transmission, and release of the underlying link. This underlying state machine mechanism allows for automatic management and seamless switching of multiple Bluetooth audio source device connections without intervention when the user moves between different physical locations.
[0028] The above is an explanation of the basic concept of this application. The specific implementation methods of each step will be explained below.
[0029] In one possible implementation, the signal strength of the Bluetooth audio source device remains greater than the connection threshold for a first preset time. The preset disconnection condition is: the signal strength of the Bluetooth audio source device remains below the disconnection threshold for a period of time that reaches the second preset time.
[0030] By introducing time-dimensional decision-making logic based on the communication state model, the preset connection and disconnection conditions not only depend on whether the signal strength crosses a threshold, but also require that the signal strength state be maintained for a specific first preset time or a second preset time. This underlying anti-jitter mechanism, with dual constraints of time and signal space, effectively filters out instantaneous signal fluctuations caused by environmental obstructions or brief positional movements, avoiding repeated establishment and disconnection oscillations of Bluetooth audio source devices at critical communication distances, and greatly improving the overall robustness of the multi-device connection architecture.
[0031] Those skilled in the art will understand that the specific setting times for the connection threshold, disconnection threshold, first preset time, and second preset time are not limited, and those skilled in the art can design them as needed. This application does not impose any restrictions here.
[0032] For example, in one possible implementation, when the signal strength of an offline Bluetooth audio source device is greater than a connection threshold and a preset connection condition is met, assigning it a connected state includes: When the signal strength of an offline Bluetooth audio source device is greater than -70dBm and remains so for more than 3 seconds, it is given a connected status. When the signal strength of a Bluetooth audio source device in standby or active state is less than the disconnect threshold and the preset disconnect conditions are met, it is assigned a disconnected state, including: If the signal strength of a Bluetooth audio source device in standby or active state is less than -85dBm and remains so for more than 10 seconds, it will be assigned a disconnected state.
[0033] The specific execution scale of state transitions is further refined. By setting a connection threshold higher than the disconnection threshold, and ensuring that the duration required to enter the connected state is significantly shorter than the duration required to trigger the disconnection state, an asymmetric, broad hysteresis range is constructed for signal strength judgment. This solution adheres to the underlying principle of easy connection and cautious disconnection, ensuring that even in complex radio environments where the Bluetooth audio source device's signal is in an edge attenuation zone, the existing stable interaction state will not be easily broken, thus guaranteeing the continuity of the user's auditory experience in boundary scenarios where connection interruptions are most likely to occur.
[0034] Furthermore, in one possible implementation, the preset connection condition also includes: the receiving device has an available radio frequency slot; Adjusting the state of the corresponding communication state model also includes: When no available RF slots are available, the priority of the Bluetooth audio source device whose current signal strength is greater than the connection threshold and meets the preset connection conditions is obtained, and the lowest priority among the Bluetooth audio source devices in standby or active states is obtained. When the priority of a Bluetooth audio source device that has a current signal strength greater than the connection threshold and meets the preset connection conditions is greater than the lowest priority, the Bluetooth audio source device in standby or active state that has the lowest priority will be assigned to the disconnected state, and its corresponding available RF slot will be allocated to the Bluetooth audio source device whose current signal strength is greater than the connection threshold and meets the preset connection conditions.
[0035] To address the hardware bottleneck of limited available RF slots in receiving devices, a priority-based dynamic resource preemption and allocation mechanism was developed. When the system detects that no available RF slots exist and a new device meeting the connection requirements joins the network, it automatically compares the new device with the lowest priority among the Bluetooth audio source devices currently in standby or active states. By forcibly switching the lowest priority device to a disconnected state, the system can intelligently release and transfer RF hardware resources. This technique ensures that in high-concurrency scenarios with multiple devices, the limited available RF slots are always allocated to the most critical and important Bluetooth audio source devices designated by the user.
[0036] However, the above is a general case. In some special circumstances, low-priority Bluetooth audio source devices may also be performing critical call functions. Therefore, in one possible implementation, when the current signal strength is greater than the connection threshold and the priority of the Bluetooth audio source device that meets the preset connection conditions is greater than the lowest priority, assigning the disconnected state to the Bluetooth audio source device in standby or active state also includes: Determine whether the Bluetooth audio source device with the lowest priority is in a call state; If not in a voice call state, the Bluetooth audio source device with the lowest priority will be assigned a disconnected state. If the device is in a voice call state, it will be prevented from being assigned a disconnected state, and Bluetooth audio source devices with a current signal strength greater than the connection threshold and meeting the preset connection conditions will be added to the waiting queue until the voice call state ends and the priority acquisition step is re-executed.
[0037] As a key supplement to the priority preemption mechanism, an absolute protection barrier tailored to the nature of communication services is introduced. Before triggering resource swapping between high and low priority devices, the system first detects whether the target device is in a voice call. If the underlying link is carrying a voice call, the priority swapping process is forcibly suspended, and the high-priority Bluetooth audio source device requesting connection is placed in a waiting queue. This dynamic protection strategy, which transcends static priorities, ensures that any reallocation of available RF slots will not interrupt the user's ongoing real-time voice interaction, completely eliminating the risk of core communication service interruption caused by automatic device scheduling.
[0038] The above is a detailed explanation of the implementation of the automatic connection and automatic disconnection functions in the Bluetooth device connection management method provided in this application.
[0039] Secondly, the aforementioned disconnection process is also not limited.
[0040] In one possible implementation, the disconnection process includes: The audio data transmitted to the corresponding device is linearly reduced to zero; Pause the Audio / Video Distribution Transport Protocol (AVDTP) stream and disconnect the asynchronous connectionless link.
[0041] To address the auditory pain points experienced by users when devices disconnect, the disconnection process underwent a refined software and underlying protocol co-design. Instead of abruptly severing the RF link when unavailable RF slots are stripped or signal attenuation triggers disconnection, the system sequentially performs a fade-out process where audio data linearly decreases to zero, followed by pausing the AVDTP (Audio-Video Distributed Transport Protocol) stream, and finally disconnecting the underlying asynchronous connectionless link. This step-by-step, smooth disconnection mechanism masks the abruptness of physical link disconnection, providing users with an extremely natural and acoustically seamless transition experience when switching between different Bluetooth audio source devices.
[0042] Furthermore, there are no restrictions on the specific method for setting the scanning interval.
[0043] In one possible implementation, adjusting or maintaining the state of the corresponding communication state model at a preset time frequency to perform connection, disconnection, and maintenance operations on the paired Bluetooth audio source device includes: When no active Bluetooth audio source device is available, the first scanning interval is used; The second scanning interval is used when at least one active Bluetooth audio source device is present; When there is a Bluetooth audio source device that has just completed the disconnection process, the third scanning interval is used within the preset time window; The third scan interval is smaller than the first scan interval, and the first scan interval is smaller than the second scan interval.
[0044] To achieve the optimal balance between ultra-fast response and hardware power consumption, an adaptive time-frequency adjustment mechanism highly integrated with the communication state model was established. The system dynamically switches between three different scan intervals based on the presence of an active Bluetooth audio source device or whether the device has just completed a disconnection process. Extremely short scan intervals are used within time windows where high-frequency switching is anticipated to ensure seamless connection, while longer scan intervals are used when the connection is stable or completely offline. This on-demand allocation of computing and RF resources significantly reduces the overall power consumption of the receiving device without sacrificing automatic connection agility.
[0045] Those skilled in the art will understand that the specific time settings for each of the above scanning intervals are not limited. In one possible implementation, the first scanning interval is 15s, the second scanning interval is 5s, and the third scanning interval is 1s, with a time window of 100ms for each of the above scanning intervals. Those skilled in the art can also design their own intervals as needed, which will not be elaborated here.
[0046] Finally, in one possible implementation, when the receiving device includes multiple radio frequency front-ends, the method further includes: When it is necessary to assign an RF front-end to a Bluetooth audio source device that is in a connected state, the RF front-end with the lowest current load should be selected for assignment first. When one RF front-end is overloaded and another RF front-end has idle capability, the connection of the Bluetooth audio source device in standby mode will be migrated to the RF front-end with idle capability.
[0047] In the complex hardware architecture of the receiving device equipped with multiple RF front-ends, a load balancing and dynamic routing mechanism for multiple RF units is further introduced. When allocating underlying communication resources to newly joined Bluetooth audio source devices, the system prioritizes anchoring to the RF front-end with the lowest load. Simultaneously, when a local RF front-end faces concurrent overload pressure, it can smoothly migrate connections of devices in standby mode without audio transmission pressure to RF front-ends with idle capacity. By intelligently scheduling connections among multiple RF front-ends, the throughput potential of the multi-chip hardware combination is maximized, avoiding congestion and crashes of a single communication node.
[0048] The above is a complete description of the connection management method for Bluetooth devices provided in this application.
[0049] A second aspect of this application provides an electronic device including a memory and a processor, wherein the memory and the processor are communicatively connected. The memory stores a computer program, and when the processor executes the program, it implements a Bluetooth device connection management method as described above.
[0050] By integrating processors and memory within electronic devices, complex communication state models, hysteresis stabilization control, and priority scheduling algorithms are encapsulated into executable computer programs, providing a physical carrier for this connection management method. This enables it to be directly and stably deployed in various practical smart audio terminals.
[0051] A third aspect of this application provides a computer-readable storage medium having a computer program stored thereon that, when executed by a processor, implements a Bluetooth device connection management method as described in any of the foregoing.
[0052] By embedding the execution logic of the core connectivity management method in a computer-readable storage medium, this underlying Bluetooth scheduling solution has the ability to distribute software independently of specific hardware. This facilitates large-scale deployment through online system upgrades or firmware flashing, realizing the industrialization and standardization of advanced communication scheduling technology.
[0053] The above is a complete description of a Bluetooth device connection management method, electronic device, and computer medium provided in this application. Several embodiments will be provided below to help those skilled in the art better understand the technical solution and technical effects of this application.
[0054] Example 1: Normal scene switching.
[0055] The user moves the device of this invention from the office to their home. The device is paired with 5 audio sources: mobile phone (P=1), office computer (P=2), office tablet (P=3), home computer (P=4), and laptop computer (P=5).
[0056] The device has 3 RF slots.
[0057] (1) In the office, the RSSI of the three devices, namely mobile phone, office computer and office tablet, is higher than R_connect, and all three slots are occupied.
[0058] (2) The user leaves the office. The RSSI of the office computer gradually decreases from -65dBm. When the RSSI drops below -85dBm and remains below it for 10 seconds, the device triggers a smooth disconnect: audio fades out for 200ms → AVDTPSuspend → ACLDisconnect. The office tablet is handled similarly.
[0059] (3) During the process, the mobile phone remains connected. The device enters fast scan mode (1 second interval), and after 30 seconds if no new devices are found, it resumes normal scan (5 second interval).
[0060] (4) Upon arrival home, the RSSI of the home computer gradually increases from -90dBm. After the RSSI remains above -70dBm for 3 seconds, the device establishes a connection in an empty slot. Laptops are processed similarly.
[0061] (5) Final state: mobile phone (P=1) + home computer (P=4) + laptop (P=5), no operation required by the user.
[0062] Example 2: Priority preemption.
[0063] The user is at home, currently connected to: mobile phone (P=1) + home computer (P=4) + laptop (P=5). At this moment, the user's friend arrives with a paired Bluetooth speaker (P=3).
[0064] (1) The Bluetooth speaker enters the range and the RSSI remains above -70dBm for 3 seconds. The device has detected that all 3 slots are full.
[0065] (2) The Bluetooth speaker has a priority of P=3, which is higher than the laptop's priority of P=5. The laptop is not currently in a call.
[0066] (3) The device performs a smooth disconnect process on the laptop (200ms fade-out → pause → disconnect) and allocates the freed slot to the Bluetooth speaker.
[0067] (4) New state: mobile phone (P=1) + Bluetooth speaker (P=3) + home computer (P=4).
[0068] Example 3: Call protection.
[0069] The same scenario as in Example 2, but a video call is in progress on the laptop (HFPSCO link is active).
[0070] (1) When the Bluetooth speaker enters the range, a preemption assessment is triggered.
[0071] (2) Although the laptop has the lowest priority (P=5), it is in a call state. Call protection rule CP1 is in effect, and the laptop connection cannot be released.
[0072] (3) The Bluetooth speaker is added to the waiting queue.
[0073] (4) The video call on the laptop ends (SCO link is closed), and the device is re-evaluated: the Bluetooth speaker is still in range and the RSSI is still up to standard. Perform a smooth disconnection from the laptop and a connection to the Bluetooth speaker.
[0074] It should be noted that the embodiments of the present invention have better implementability and are not intended to limit the present invention in any way. Any person skilled in the art may use the above-disclosed technical content to change or modify it into equivalent effective embodiments. However, any modifications or equivalent changes and modifications made to the above embodiments based on the technical essence of the present invention without departing from the content of the technical solution of the present invention shall still fall within the scope of the technical solution of the present invention.
Claims
1. A connection management method for a Bluetooth device, characterized in that, The connection management method includes the following steps: Each Bluetooth audio source device that has been paired with the receiving device is assigned a communication state model, which includes five states: offline state, connected state, standby state, active state, and disconnected state. Based on the state characteristics of the Bluetooth audio source device, the state of the corresponding communication state model is adjusted or maintained at a preset time frequency to perform connection, disconnection and maintenance operations on the paired Bluetooth audio source device. The adjustment of the corresponding communication state model includes: When the Bluetooth audio source device has no signal or the signal strength is less than the disconnection threshold, it is assigned an offline status. When the signal strength of the Bluetooth audio source device in the offline state is greater than the connection threshold and the preset connection conditions are met, it is given a connected state. When the Bluetooth audio source device in the connected state successfully establishes an asynchronous connectionless link, it is given a standby state. When the Bluetooth audio source device in standby mode transmits an audio signal to the receiving device, it is given an active state; When the signal strength of the Bluetooth audio source device in standby or active state is less than the disconnection threshold and the preset disconnection condition is met, it is assigned a disconnection state. Once the disconnection process of the Bluetooth audio source device in the disconnection state is completed, it is assigned an offline state.
2. The connection management method for a Bluetooth device as described in claim 1, characterized in that, The preset connection condition is: the signal strength of the Bluetooth audio source device is continuously greater than the connection threshold for a first preset time. The preset disconnection condition is: the signal strength of the Bluetooth audio source device is continuously less than the disconnection threshold for a period of time that reaches a second preset time.
3. The connection management method for a Bluetooth device as described in claim 2, characterized in that, The step of assigning a connected state to the Bluetooth audio source device when its signal strength in the offline state is greater than the connection threshold and meets the preset connection conditions includes: When the signal strength of the Bluetooth audio source device in the offline state is greater than -70dBm and remains so for more than 3 seconds, it is given a connected state. The step of assigning a disconnected state to the Bluetooth audio source device when the signal strength in standby or active state is less than the disconnect threshold and the preset disconnect conditions are met includes: When the signal strength of the Bluetooth audio source device in standby or active state is less than -85dBm and remains so for more than 10 seconds, it is given a disconnected state.
4. The connection management method for a Bluetooth device as described in claim 2, characterized in that, The preset connection conditions also include: the receiving device has available radio frequency slots; The adjustment of the state of the corresponding communication state model also includes: When no available RF slots are available, the priority of the Bluetooth audio source device whose current signal strength is greater than the connection threshold and meets the preset connection conditions is obtained, and the lowest priority among the Bluetooth audio source devices in standby or active states is obtained. When the priority of the Bluetooth audio source device that has a current signal strength greater than the connection threshold and meets the preset connection conditions is greater than the lowest priority, the Bluetooth audio source device in standby or active state that has the lowest priority will be assigned to the disconnected state, and its corresponding available RF slot will be allocated to the Bluetooth audio source device that has a current signal strength greater than the connection threshold and meets the preset connection conditions.
5. The connection management method for a Bluetooth device as described in claim 4, characterized in that, The step of assigning a disconnected Bluetooth audio source device, which is in standby or active state, to a disconnected state when the current signal strength is greater than the connection threshold and the priority of the Bluetooth audio source device that meets the preset connection conditions is greater than the lowest priority also includes: Determine whether the Bluetooth audio source device corresponding to the lowest priority is in a call state; If the device is not in the voice call state, the Bluetooth audio source device with the lowest priority will be assigned a disconnected state. If the device is in a voice call state, it is prohibited from being assigned a disconnected state, and the Bluetooth audio source device whose current signal strength is greater than the connection threshold and meets the preset connection conditions is added to the waiting queue until the voice call state ends and the priority acquisition step is re-executed.
6. The connection management method for a Bluetooth device as described in claim 1, characterized in that, The disconnection process includes: The audio data transmitted to the corresponding device is linearly reduced to zero; Pause the Audio / Video Distribution Transport Protocol (AVDTP) stream and disconnect the asynchronous connectionless link.
7. The connection management method for a Bluetooth device as described in claim 1, characterized in that, The step of adjusting or maintaining the state of the corresponding communication state model at a preset time frequency to perform connection, disconnection, and maintenance operations on the paired Bluetooth audio source device includes: When no active Bluetooth audio source device is available, the first scanning interval is used; The second scanning interval is used when at least one active Bluetooth audio source device is present; When there is a Bluetooth audio source device that has just completed the disconnection process, a third scanning interval is used within a preset time window; Wherein, the third scanning interval is less than the first scanning interval, and the first scanning interval is less than the second scanning interval.
8. The connection management method for a Bluetooth device as described in claim 1, characterized in that, When the receiving device includes multiple radio frequency front-ends, the method further includes: When it is necessary to allocate an RF front-end to a Bluetooth audio source device that is in the connected state, the RF front-end with the lowest current load shall be selected for allocation first. When one of the radio frequency front-ends is overloaded and the other radio frequency front-end has idle capability, the connection of the Bluetooth audio source device in the standby state is migrated to the radio frequency front-end with idle capability.
9. An electronic device, characterized in that, It includes a memory and a processor, the memory and the processor being communicatively connected; The memory stores a computer program, and when the processor executes the program, it implements the connection management method for a Bluetooth device as described in any one of claims 1 to 8.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When executed by the processor, the program implements the connection management method for a Bluetooth device as described in any one of claims 1 to 8.