A Bluetooth device connection method, system, electronic device, and storage medium

Through custom device level fields and intelligent broadcast scanning technology, the BLE device connection strategy is dynamically adjusted, which solves the problem of unclear device level information, and realizes more efficient and flexible device connection management, improving device connection efficiency and user experience.

CN118843095BActive Publication Date: 2025-07-22深圳开鸿数字产业发展有限公司
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411057142.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-08-02
Publication Date
2025-07-22
Estimated Expiration
2044-08-02

AI Technical Summary

Technical Problem

There is no priority among multiple devices in the existing BLE device connection management, which makes it impossible to dynamically adjust according to actual needs, and the device level information is not clear enough to provide differentiated services.

Method used

Through custom device level fields and intelligent broadcast scanning technology, connectivity policies are dynamically adjusted according to device level information, priority is given to high-level devices, and policy adjustments are performed cyclically to adapt to changes in device connection management.

Benefits of technology

It improves the efficiency and flexibility of BLE equipment connection management, provides differentiated services for equipment of different levels, optimizes broadcast signal scanning efficiency, and reduces equipment connection delay.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118843095B_ABST
    Figure CN118843095B_ABST
Patent Text Reader

Abstract

The present application discloses a Bluetooth device connection method, system, electronic device, and storage medium. The method includes: identifying multiple Bluetooth devices within a preset range; obtaining the respective level information of the multiple Bluetooth devices, and establishing connections with the multiple Bluetooth devices according to the multiple level information; obtaining the device connection information of the connected devices, and determining the device connection strategy of the devices to be connected according to the device connection information and the multiple level information; wherein, the connected devices are the connected Bluetooth devices, and the devices to be connected are the Bluetooth devices to be connected; and managing the connection of the devices to be connected according to the device connection strategy. The present application realizes more efficient and flexible BLE device connection management and improves the device connection efficiency by adjusting the device connection strategy according to the priority in cooperation with the current device connection situation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the technical field of Bluetooth device connection, and particularly to a Bluetooth device connection method, system, electronic device and storage medium. Background Art

[0002] The connection management of traditional BLE devices (Bluetooth devices supporting low-power Bluetooth technology) usually adopts a fixed strategy and cannot be dynamically adjusted according to actual requirements and device status. Moreover, in the existing BLE device connection management, the device level information may not be clear enough, resulting in the inability to provide differentiated services for devices of different levels.

[0003] Therefore, the existing technology still needs to be improved and developed. Summary of the Invention

[0004] The main purpose of this application is to provide a Bluetooth device connection method, system, electronic device and storage medium, aiming to solve the problem in the existing BLE device connection management that there is no priority among multiple devices, resulting in the inability to dynamically adjust the multiple devices for connection management according to actual requirements.

[0005] In the first aspect of an embodiment of this application, a Bluetooth device connection method is provided. The Bluetooth device connection method includes the following steps: identifying multiple Bluetooth devices within a preset range; obtaining the level information of each of the multiple Bluetooth devices, and establishing connections with the multiple Bluetooth devices according to the multiple level information; obtaining the device connection information of the connected devices, and determining the device connection strategy of the devices to be connected according to the device connection information and the multiple level information; where the connected devices are the connected Bluetooth devices, and the devices to be connected are the Bluetooth devices to be connected; and managing the connection of the devices to be connected according to the device connection strategy.

[0006] Optionally, in an embodiment of this application, the identifying multiple Bluetooth devices within a preset range specifically includes: receiving multiple data packets sent by multiple Bluetooth devices in a broadcast channel within the preset range; screening the multiple data packets to determine multiple target data packets; and determining the multiple Bluetooth devices corresponding to the multiple target data packets.

[0007] Optionally, in an embodiment of the present application, the Bluetooth device includes a first response device and a second response device, and the level information includes the device level of the first response device and the device level of the second response device; the step of obtaining the level information of each of the multiple Bluetooth devices and establishing connections with the multiple Bluetooth devices according to the multiple level information specifically includes: if the device level of the first response device is greater than the device level of the second response device, then establish a connection with the first response device preferentially; after establishing a connection with the first response device, establish a connection with the second response device.

[0008] Optionally, in an embodiment of the present application, the step of determining the device connection strategy of the device to be connected according to the device connection information and the multiple level information specifically includes: determining the broadcast level of the device to be connected according to the multiple level information; when the device connection information meets the preset requirements, then set it as the direct connection device strategy; when the device connection information does not meet the preset requirements, if the broadcast level meets the level connection requirements, then set it as the connection device strategy after deletion, and if the broadcast level does not meet the level connection requirements, then set it as the non-connection device strategy.

[0009] Optionally, in an embodiment of the present application, the device connection information includes a first category corresponding to the first response device and a second category corresponding to the second response device, and obtain a first quantity corresponding to the first response device and a second quantity corresponding to the second response device; the step of setting it as the direct connection device strategy when the device connection information meets the preset requirements specifically includes: if the first quantity exceeds the preset threshold and the second quantity is less than the preset quantity, then set the strategy of preferentially connecting to the low-level device; if the first quantity is less than the preset threshold, then set the strategy of preferentially connecting to the high-level device; wherein, the high-level device is the device corresponding to the first category, and the low-level device is the device corresponding to the second category.

[0010] Optionally, in an embodiment of the present application, the step of performing connection management on the device to be connected according to the device connection strategy specifically is: establish a connection with the Bluetooth device corresponding to the second category according to the strategy of preferentially connecting to the low-level device; or establish a connection with the Bluetooth device corresponding to the first category according to the strategy of preferentially connecting to the high-level device.

[0011] Optionally, in an embodiment of the present application, the Bluetooth device connection method further includes: obtaining the connection broadcast information of the Bluetooth device; evaluating the connection broadcast information to obtain an evaluation result; if the evaluation result is to update the connection strategy, then update the device connection strategy until the evaluation result is qualified, and perform connection management on the device to be connected according to the updated device connection strategy.

[0012] In the second aspect of the embodiments of the present application, a Bluetooth device connection system is further provided. Among them, the Bluetooth device connection system includes:

[0013] A device identification module, configured to identify a plurality of Bluetooth devices within a preset range;

[0014] A Bluetooth connection module, configured to obtain the respective level information of the plurality of Bluetooth devices via Bluetooth, and establish connections with the plurality of Bluetooth devices according to the plurality of level information;

[0015] A policy determination module, configured to obtain the device connection information of the connected devices, and determine the device connection policy of the devices to be connected according to the device connection information and the plurality of level information; wherein, the connected devices are the connected Bluetooth devices, and the devices to be connected are the Bluetooth devices to be connected;

[0016] A connection management module, configured to perform connection management on the devices to be connected according to the device connection policy.

[0017] In the third aspect of the embodiments of the present application, an electronic device is further provided. Among them, the electronic device includes: a memory, a processor, and a Bluetooth device connection program stored on the memory and executable on the processor. When the Bluetooth device connection program is executed by the processor, the steps of the above-mentioned Bluetooth device connection method are implemented.

[0018] In the fourth aspect of the embodiments of the present application, a computer-readable storage medium is further provided. Among them, the computer-readable storage medium stores a Bluetooth device connection program. When the Bluetooth device connection program is executed by a processor, the steps of the above-mentioned Bluetooth device connection method are implemented.

[0019] Beneficial effects: The present application provides a Bluetooth device connection method, system, electronic device, and storage medium. In this method, by adjusting the device connection policy according to the current device connection situation and in cooperation with the priority, more efficient and flexible BLE device connection management is realized, the device connection efficiency is improved, and differentiated services are provided for devices of different levels. Description of the Drawings

[0020] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the drawings in the following description are only some embodiments recorded in the present application. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.

[0021] Figure 1It is a flowchart of a preferred embodiment of the Bluetooth device connection method of the present application;

[0022] Figure 2 It is a schematic structural diagram of a preferred embodiment of the Bluetooth device connection system of the present application;

[0023] Figure 3 It is a schematic structural diagram of a preferred embodiment of the electronic device of the present application.

[0024] Description of reference numerals:

[0025] 10. Bluetooth device connection system; 100. Device identification module; 200. Bluetooth connection module; 300. Policy determination module; 400. Connection management module. Detailed implementation manners

[0026] To make the objectives, technical solutions and effects of the present application clearer and more definite, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present application. The described embodiments are only possible technical implementations of the present application, not all possible implementations. Based on the embodiments in the present application, those skilled in the art can completely obtain other embodiments by combining the embodiments of the present application without creative labor, and these embodiments are also within the protection scope of the present application.

[0027] In related technologies, some existing connection management solutions for BLE devices (Bluetooth devices supporting low-power Bluetooth technology) adopt preset and fixed connection strategies, such as fixed channel allocation or fixed connection priorities. Such fixed strategies lack flexibility and cannot be dynamically adjusted according to the actual device type, status and requirements, which may lead to insufficient resource utilization or unfair device connections.

[0028] In addition, traditional device connection management usually relies on signal strength to locate devices and decide whether to connect. This method is simple and direct, but not accurate enough and is easily interfered by environmental factors. That is, the signal strength is susceptible to the influence of obstacles and electromagnetic interference, resulting in inaccurate positioning, thus affecting the effectiveness of connection decisions. For a dynamically changing device environment, such a strategy may not be able to adapt in real time, affecting the overall network performance.

[0029] First, the nouns involved in the embodiments of the present application are introduced:

[0030] The level field is an important part of the BLE broadcast data, which allows the manufacturer to assign a level to the device, and this level can be encoded and transmitted in the broadcast signal. In the BLE protocol, the broadcast data of the device contains one or more AD (advertising) structures, each of which consists of length, type, and value. The level field can be one of these AD structures, and its type may be a specific value defined by the manufacturer to represent the level information of the device. Specifically, the type (AD Type) of the level field may indicate that this field is used to convey the information of the device level or category. The data part (AD Data) contains the level itself, which may be a numerical value representing the position or performance level of the device in the manufacturer's product sequence. By parsing this advertising data, the central device can understand the basic functions and performance of the peripheral device, and thus make appropriate connection and interaction decisions.

[0031] Master: The master plays a "central role" or "management role" in the BLE communication framework. As the initiator and manager of BLE communication, the master is responsible for scanning the broadcast signals in the surrounding environment and selecting and establishing connections with one or more slave devices according to the application requirements. This centralized management ensures the effective utilization of resources and the orderly progress of communication. Functional analysis: The master has the ability to selectively connect. Through intelligent broadcast scanning technology, the master can identify the broadcast signals from different slave devices and decide which slave devices to connect to based on specific application logic; this process optimizes the resource allocation and connection quality of the network. The master is also responsible for managing the slave devices with established connections, including controlling data transmission, synchronization, and disconnection of the connections. This management ensures the efficient operation and low-power characteristics of the network.

[0032] Slave: The slave can be regarded as an "endpoint role" or "responder". They announce their existence and functions by sending broadcast signals and wait for the connection request from the master. Once selected and connected by the master, the slave can exchange data with the master. Functional analysis: The main function of the slave is to provide information and services. They inform the outside world of their status, identity, and services that can be provided through broadcast packets, which enables the master to understand and select appropriate slave devices for connection. In addition, after establishing a connection with the master, the slave can perform data exchange, which is the basis for realizing BLE applications such as health monitoring and smart home control.

[0033] The Bluetooth device connection method of the embodiment of this application is applied to the Master (i.e., the management device), and the Bluetooth device is the Slave (i.e., the responding device).

[0034] In this embodiment, a custom device level field is defined: To solve the problem of unclear device level information, a custom device level field is defined in the BLE broadcast signal to provide differentiated services for devices of different levels in device connection management. Intelligent broadcast scanning on the BLE master side: To improve the efficiency of broadcast signal scanning, the BLE master side can use intelligent algorithms for broadcast signal scanning, such as optimizing based on factors like signal strength and distance. Adjust the device connection strategy according to the current device connection situation: To solve the problem of inflexible device connection management, the device connection strategy can be dynamically adjusted according to the current device connection situation, such as restricting the connection of low-level devices and giving priority to ensuring the connection of high-level devices. Loop through the above steps: To ensure the continuous optimization of device connection management, the above steps can be looped through to continuously adjust the device connection strategy and improve the device connection efficiency.

[0035] This application can improve the efficiency and flexibility of BLE device connection management, provide differentiated services for devices of different levels, optimize the broadcast signal scanning efficiency, reduce the device connection delay, and adjust the device connection strategy in a timely manner.

[0036] The following describes the Bluetooth device connection method, system, electronic device, and storage medium according to the embodiments of the present application with reference to the accompanying drawings. Aiming at the problem in the related art that there is no priority among multiple devices in BLE device connection management, resulting in the inability to dynamically adjust the multiple devices in connection management according to actual needs, the present application provides a Bluetooth device connection method. In this method, by cooperating with adjusting the device connection strategy according to the priority based on the current device connection situation, a more efficient and flexible BLE device connection management is achieved, and the device connection efficiency is improved. Thus, the technical problem in the related art that there is no priority among multiple devices in BLE device connection management, resulting in the inability to dynamically adjust the multiple devices in connection management according to actual needs, is solved.

[0037] The following uses specific embodiments to elaborate on the technical solution of the present application in detail. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments.

[0038] The Bluetooth device connection method according to the preferred embodiment of the present application, as Figure 1 shown, the Bluetooth device connection method includes the following steps:

[0039] In step S101, identify multiple Bluetooth devices within a preset range.

[0040] In a possible implementation, multiple data packets sent by multiple Bluetooth devices in a preset range of broadcast channels are received; the multiple data packets are screened to determine multiple target data packets; and multiple Bluetooth devices corresponding to the multiple target data packets are determined.

[0041] Specifically, in the process of listening to, filtering, and processing broadcast signals to identify Bluetooth devices. Initialization scan: The Master device needs to initialize the BLE scan operation. This is usually achieved by calling the system API. For example, in the Android system, the startScan method of the BluetoothLeScanner class can be used to start the BLE scan; during the initialization process, scan parameters can be set, such as scan mode (low power, balanced, low latency), matching mode (active, sticky), and filters (filter by device name or manufacturer ID). These parameters determine the accuracy of the scan behavior and results. Listening to broadcasts: BLE devices (slave devices) will periodically send broadcast data packets on the broadcast channel, and the Master side (master device) needs to listen to these broadcast data packets to discover surrounding BLE devices. The broadcast data packets contain device information, such as device name, service UUID, etc. These information help the Master device identify the type and function of the broadcast source device. Filtering scan: During the scan process, the Master device may receive broadcast signals from multiple devices. Through the set filtering conditions, the Master device can screen out specific devices for further operations. For example, if there are multiple broadcast signals from devices of the same type in a certain area, intelligent scanning can prioritize the processing of certain devices according to the signal strength or device level. Processing broadcasts: Once the Master device scans a broadcast signal that meets the filtering conditions, it will process these results through a callback function, which may include recording device information, sending a connection request, or directly communicating with the device on the broadcast channel; for the identified devices, the Master device can decide whether to establish a connection or take other actions according to the device level information in its custom fields.

[0042] That is to say, through reasonable setting of scan parameters and dynamic adjustment of scan strategies in the embodiments of the present application, the Master device can efficiently manage the connections of multiple BLE devices, thereby improving the operation efficiency and user experience of the entire system.

[0043] In step S102, the respective level information of the multiple Bluetooth devices is obtained, and connections with the multiple Bluetooth devices are established according to the multiple level information.

[0044] In a possible implementation, the Bluetooth device includes a first response device and a second response device, and the level information includes the device level of the first response device and the device level of the second response device. If the device level of the first response device is greater than the device level of the second response device, a connection with the first response device is preferentially established; after establishing a connection with the first response device, a connection with the second response device is established. It should be noted that the custom device level field can be specifically defined by the service, and the directed connectable broadcast or ad field defines the level.

[0045] Specifically, during the process of customizing the device level field. Determine the device level information: Define different device levels according to the categories, functions, performance, etc. of its own products (slave devices), which can be represented by one or more parameters, such as the capabilities of the device, intended use, safety level, etc. Add a device level field to the broadcast data: In the BLE broadcast data structure, customize the data and add it to the broadcast packet, which is usually achieved by adding custom service UUIDs, device information data, etc. to the Manufacturer SpecificData field of the broadcast data. Encode the device level information: Encode the determined device level information into an available broadcast data format. For example, the device level can be encoded as a specific numerical value, string, or other identifiable form to ensure that this data can be accurately sent during broadcasting. Integrate it into the BLE broadcast data: During the BLE broadcast initialization process, add the custom data structure containing the device level information to the broadcast data. In this way, whenever the device broadcasts, it will include this level information for other devices to scan and read. Dynamically adjust and read the device level: During the actual operation of the device, the device level field in the broadcast can be dynamically adjusted according to needs (if supported). At the same time, the master device (such as a smartphone or a central controller) can read this custom device level information for implementing corresponding device management policies.

[0046] That is to say, the embodiments of the present application enable BLE devices (Bluetooth devices, slave devices) to not only provide differentiated services according to the level, but also enable the master device to quickly identify and process connection requests of devices with different levels in a dense device environment, improving the operating efficiency and user experience of the entire system.

[0047] Specifically, intelligent management: According to the current device connection situation and preset policies, the Master device can dynamically adjust its scanning behavior. For example, when a high-level device appears within the scanning range, the Master can automatically stop scanning low-level devices and focus on connecting to high-level devices. This intelligent scanning strategy can improve the flexibility and efficiency of device connection management and ensure that important devices can be processed quickly.

[0048] In step S103, the device connection information of the connected device is obtained, and the device connection strategy of the device to be connected is determined according to the device connection information and the multiple level information; wherein the connected device is the connected Bluetooth device, and the device to be connected is the Bluetooth device to be connected.

[0049] In a possible implementation manner, a first category corresponding to the first responding device and a second category corresponding to the second responding device are obtained, and a first number corresponding to the first responding device and a second number corresponding to the second responding device are obtained.

[0050] In one possible implementation, the broadcast level of the device to be connected is determined based on multiple level information; when the device connection information meets the preset requirements, it is set as a direct device connection strategy; when the device connection information does not meet the preset requirements, if the broadcast level meets the level connection requirements, it is set as a device connection strategy after deletion; if the broadcast level does not meet the level connection requirements, it is set as a device non-connection strategy.

[0051] It is worth noting that based on the current device load situation (i.e., whether the current load that the main device can bear is sufficient as determined by the device connection information) and the priority level of the broadcasting device, it is determined whether to directly initiate a connection (direct connection device strategy), delete the connection and then add a connection (connection device strategy after deletion) or not connect (no connection device strategy), thereby achieving the purpose of ensuring the timeliness and stability of high-priority connections (similar to VIP heart data) and ensuring the timely communication of high-priority data.

[0052] In one possible implementation, if the first number exceeds a preset threshold and the second number is less than a preset number, a strategy of prioritizing connection to low-level devices is set; wherein the low-level devices are devices corresponding to the second category; if the first number is less than a preset threshold, a strategy of prioritizing connection to high-level devices is set; wherein the high-level devices are devices corresponding to the first category.

[0053] Specifically, collect information: collect information about connected devices, including device level, current working status, resource usage, etc.; at the same time, constantly listen to the broadcast signals of new devices to obtain relevant information of new devices. Analyze device requirements: evaluate the connection priority of each device according to the device level and preset priority rules; at the same time, consider the current network load status, such as the number of connections, bandwidth usage, etc., to determine whether it is conducive to the connection of new devices. Formulate adjustment strategies: formulate or adjust device connection strategies based on the analysis results of device requirements and network conditions, for example, prioritize high-level devices when the network load is low, or limit the connection of low-level devices when resources are tight.

[0054] That is to say, the embodiments of the present application optimize the device connection efficiency and the use of wireless resources through dynamic adjustment strategies, can effectively manage a large number of BLE devices, and improve the operation efficiency of the entire system and the user experience.

[0055] In step S104, connection management is performed on the device to be connected according to the device connection strategy.

[0056] In a possible implementation manner, a connection is directly initiated for the device to be connected (slave device, Bluetooth device) according to the direct connection device strategy; according to the connection device deletion strategy, the devices with lower priorities among the connected devices are deleted from the connection, and then a connection is initiated for the device to be connected; according to the non-connection device strategy, no connection operation is performed with the device to be connected.

[0057] In a possible implementation manner, a connection is established with the Bluetooth device corresponding to the second category according to the strategy of preferentially connecting low-level devices; or a connection is established with the Bluetooth device corresponding to the first category according to the strategy of preferentially connecting high-level devices.

[0058] Specifically, policy execution: Apply the adjusted strategy to the device connection process, such as achieving the policy objectives by adjusting the broadcast interval, connection parameters, etc.

[0059] In a possible implementation manner, obtain the connection broadcast information of the Bluetooth device; evaluate the connection broadcast information to obtain an evaluation result; if the evaluation result is to update the connection strategy, update the device connection strategy until the evaluation result is qualified, and perform connection management on the device to be connected according to the updated device connection strategy.

[0060] Specifically, continuous monitoring and optimization: Continuously monitor the status of the connected devices and new devices to timely detect changes in the network environment. Further optimize the device connection strategy according to the monitoring results to ensure the effective utilization of wireless resources and the fairness of device connections. Feedback mechanism: Collect feedback information from the device operating status and network performance to evaluate the actual effect of the current strategy. Perform fine-tuning of the strategy according to the feedback information to adapt to changes in device requirements and network conditions. Policy update: Regularly update the device connection strategy as the types and quantities of devices increase to adapt to the new devices and network environment.

[0061] That is to say, the embodiments of the present application continuously collect information, analyze requirements, formulate strategies, monitor and optimize, and update strategies to ensure the efficiency of device connections and the reasonable utilization of wireless resources.

[0062] The above Bluetooth device connection method of the present application is further described below through specific embodiments:

[0063] K1, Custom device level field: Define your own device level field to identify specific attributes or functions of the device. This can help users better understand the performance and applicability of the device.

[0064] K2, Intelligent broadcast scanning on the BLE master side: In BLE communication, there is a master device and one or more slave devices. The master device is responsible for initiating connection requests and managing connections. Intelligent broadcast scanning means that the master device can scan and identify broadcast signals from different slave devices and select the slave device to connect to as needed.

[0065] K3, Adjust the device connection strategy according to the current device connection status: The device connection strategy can be dynamically adjusted according to factors such as the number of currently connected devices, device types, and network load. For example, when the network load is high, the system can choose to only allow certain types of devices to connect or limit the number of connections.

[0066] K4, Loop through K1, K2, K3: The above steps are continuously repeated to ensure the effectiveness and flexibility of device connection management. By continuously monitoring and adjusting the device connection strategy, the system can adapt to different usage scenarios and requirements.

[0067] Next, a Bluetooth device connection system according to an embodiment of the present application will be described with reference to the accompanying drawings.

[0068] Figure 2 It is a block diagram of a Bluetooth device connection system according to an embodiment of the present application.

[0069] As Figure 2 shown, the Bluetooth device connection system 10 includes: a device identification module 100, a Bluetooth connection module 200, a policy determination module 300, and a connection management module 400.

[0070] Specifically, the device identification module 100 is used to identify multiple Bluetooth devices within a preset range;

[0071] The Bluetooth connection module 200 is used to obtain the level information of each of the multiple Bluetooth devices via Bluetooth, and establish connections with the multiple Bluetooth devices according to the multiple level information;

[0072] The policy determination module 300 is used to obtain the device connection information of the connected devices, and determine the device connection strategy of the devices to be connected according to the device connection information and the multiple level information; wherein, the connected devices are the connected Bluetooth devices, and the devices to be connected are the Bluetooth devices to be connected;

[0073] The connection management module 400 is used to perform connection management on the devices to be connected according to the device connection strategy.

[0074] Figure 3 The structural schematic diagram of the electronic device provided by the embodiment of the present application. The electronic device may include:

[0075] A memory 501, a processor 502, and a computer program stored on the memory 501 and executable on the processor 502.

[0076] When the processor 502 executes the program, it implements the Bluetooth device connection method provided in the above embodiment.

[0077] Furthermore, the electronic device further includes:

[0078] A communication interface 503 for communication between the memory 501 and the processor 502.

[0079] The memory 501 is used to store a computer program executable on the processor 502.

[0080] The memory 501 may include a high-speed RAM memory, and may also include a non-volatile memory, such as at least one disk memory.

[0081] If the memory 501, the processor 502, and the communication interface 503 are independently implemented, the communication interface 503, the memory 501, and the processor 502 can be interconnected through a bus and communicate with each other. The bus may be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. For the sake of representation, Figure 3 only a thick line is used to represent it in the figure, but it does not mean that there is only one bus or one type of bus.

[0082] Optionally, in a specific implementation, if the memory 501, the processor 502, and the communication interface 503 are integrated on a chip, the memory 501, the processor 502, and the communication interface 503 can communicate with each other through an internal interface.

[0083] The processor 502 may be a Central Processing Unit (CPU), or an Application Specific Integrated Circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present application.

[0084] This embodiment also provides a computer-readable storage medium, on which a computer program is stored. When the program is executed by a processor, the above Bluetooth device connection method is implemented.

[0085] An embodiment of the present application provides a computer program product, including a computer program, where the computer program, when executed by a processor, implements the Bluetooth device connection method provided in any of the embodiments corresponding to the present application Figure 1 as described in the embodiments.

[0086] In the description of this specification, the descriptions with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples", etc. mean that the specific features, structures, materials, or characteristics described in connection with the embodiment or example are included in at least one embodiment or example of the present application. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials, or characteristics described may be combined in any one or N embodiments or examples in a suitable manner. In addition, without contradiction, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of different embodiments or examples.

[0087] In addition, the terms "first" and "second" are only used for descriptive purposes and cannot be understood as indicating or implying relative importance or implicitly indicating the quantity of the indicated technical features. Thus, the features defined with "first" and "second" may explicitly or implicitly include at least one of the features. In the description of the present application, the meaning of "N" is at least two, such as two, three, etc., unless otherwise specifically defined.

[0088] Any process or method description shown in a flowchart or described in other ways herein may be understood as representing a module, segment, or part of code including one or N executable instructions for implementing a customized logic function or process. The scope of the preferred embodiments of the present application includes additional implementations, where the functions may be executed in a substantially simultaneous manner or in a reverse order according to the involved functions, rather than in the order shown or discussed, which should be understood by those skilled in the art to which the embodiments of the present application belong.

[0089] The logic and / or steps represented in the flowchart or otherwise described herein can, for example, be considered as a definable sequence list of executable instructions for implementing logical functions, and can be specifically implemented in any computer-readable storage medium for use by an instruction execution system, apparatus, or device (such as a computer-based system, a system including a processor, or other systems that can fetch and execute instructions from the instruction execution system, apparatus, or device), or used in combination with these instruction execution systems, apparatus, or devices. For the purposes of this specification, a "computer-readable storage medium" can be any device that can contain, store, communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. More specific examples (non-exhaustive list) of computer-readable storage media include the following: an electrical connection part (electronic device) having one or N wirings, a portable computer disk cartridge (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disc read-only memory (CDROM). Additionally, the computer-readable storage medium can even be paper or other suitable media on which the program can be printed, because the program can be obtained electronically by optically scanning the paper or other media, followed by editing, interpretation, or otherwise processing as appropriate, and then stored in a computer memory.

[0090] It should be understood that various parts of the present application can be implemented using hardware, software, firmware, or combinations thereof. In the above-described embodiments, the N steps or methods can be implemented using software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented using hardware, as in another embodiment, any one or a combination of the following techniques well known in the art can be used: discrete logic circuits having logic gate circuits for implementing logical functions on data signals, application-specific integrated circuits having appropriate combinational logic gate circuits, programmable gate arrays (PGAs), field-programmable gate arrays (FPGAs), etc.

[0091] Those of ordinary skill in the art of this technology can understand that all or part of the steps carried out in implementing the methods of the above embodiments can be completed by instructing relevant hardware through a program, and the said program can be stored in a computer-readable storage medium. When the program is executed, it includes one or a combination of the steps of the method embodiments.

[0092] In addition, in each embodiment of the present application, each functional unit can be integrated into a processing module, or each unit can exist physically alone, or two or more units can be integrated into one module. The above-mentioned integrated module can be implemented in the form of hardware or in the form of a software functional module. When the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it can also be stored in a computer-readable storage medium.

[0093] The above-mentioned storage medium can be a read-only memory, a magnetic disk, an optical disc, etc. Although the embodiments of the present application have been shown and described above, it can be understood that the above embodiments are exemplary and should not be construed as limiting the present application. Those of ordinary skill in the art can make changes, modifications, substitutions, and variations to the above embodiments within the scope of the present application.

[0094] It should be understood that the application of the present application is not limited to the above examples. For those of ordinary skill in the art, improvements or transformations can be made according to the above description, and all such improvements and transformations should fall within the protection scope of the appended claims of the present application.

[0095] Finally, it should be noted that: the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them; although the present application has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions recorded in the foregoing embodiments, or perform equivalent substitutions for some or all of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present application.

Claims

1. A method for connecting a Bluetooth device, characterized in that, The Bluetooth device connection method includes: Identifying multiple Bluetooth devices within a preset range; Obtaining the respective level information of the multiple Bluetooth devices, and establishing connections with the multiple Bluetooth devices according to the multiple level information; Obtaining the device connection information of the connected devices, and determining the device connection strategy of the device to be connected according to the device connection information and the multiple level information; wherein, the connected devices are the connected Bluetooth devices, and the device to be connected is the Bluetooth device to be connected; Performing connection management on the device to be connected according to the device connection strategy; The Bluetooth device includes a first response device and a second response device, and the level information includes the device level of the first response device and the device level of the second response device; If the device level of the first response device is greater than the device level of the second response device, then establish a connection with the first response device preferentially; After establishing a connection with the first response device, establish a connection with the second response device; The determining the device connection strategy of the device to be connected according to the device connection information and the multiple level information specifically includes: Determining the broadcast level of the device to be connected according to the multiple level information; When the device connection information meets the preset requirements, then set it as the direct connection device strategy; When the device connection information does not meet the preset requirements, if the broadcast level meets the level connection requirements, then set it as the connection device strategy after deletion, and if the broadcast level does not meet the level connection requirements, then set it as the non-connection device strategy; The device connection information includes the first category corresponding to the first response device and the second category corresponding to the second response device, and obtain the first quantity corresponding to the first response device and the second quantity corresponding to the second response device; The when the device connection information meets the preset requirements, then set it as the direct connection device strategy specifically includes: If the first quantity exceeds the preset threshold and the second quantity is less than the preset threshold, then set the preferential connection to low-level device strategy; If the first quantity is less than the preset threshold, then set the preferential connection to high-level device strategy; Wherein, the high-level device is the device corresponding to the first category, and the low-level device is the device corresponding to the second category; The Bluetooth device connection method further includes: Customizing a device level field in the broadcast signal to obtain the level information of the corresponding Bluetooth device according to the customized device level field, and dynamically adjusting the device connection strategy according to the current device connection situation; The Bluetooth device connection method further includes: Obtaining the connection broadcast information of the Bluetooth device; Evaluating the connection broadcast information to obtain an evaluation result; If the evaluation result is to update the connection strategy, then update the device connection strategy until the evaluation result is qualified, and perform connection management on the device to be connected according to the updated device connection strategy.

2. The method for connecting a Bluetooth device according to claim 1, wherein The performing connection management on the device to be connected according to the device connection strategy specifically is: Establishing a connection with the Bluetooth device corresponding to the second category according to the preferential connection to low-level device strategy; or Establish a connection with the Bluetooth device corresponding to the first category according to the strategy of preferentially connecting high-level devices; or Delete the connection of the device with a lower priority among the connected devices according to the strategy of deleting connected devices after pruning, and then initiate a connection to the device to be connected; or Do not perform a connection operation with the device to be connected according to the strategy of not connecting devices.

3. The Bluetooth device connection method according to claim 1, wherein, The identification of multiple Bluetooth devices within a preset range specifically includes: Receive multiple data packets sent by multiple Bluetooth devices in the broadcast channel within the preset range; Screen the multiple data packets to determine multiple target data packets; Determine multiple Bluetooth devices corresponding to the multiple target data packets.

4. A Bluetooth device connection system, characterized in that, The Bluetooth device connection system is applied to the Bluetooth device connection method according to any one of claims 1-3; the Bluetooth device connection system includes: A device identification module for identifying multiple Bluetooth devices within a preset range; A Bluetooth connection module for obtaining the respective level information of the multiple Bluetooth devices and establishing connections with the multiple Bluetooth devices according to the multiple level information; A policy determination module for obtaining the device connection information of the connected devices and determining the device connection policy of the device to be connected according to the device connection information and the multiple level information; wherein, the connected devices are the connected Bluetooth devices, and the device to be connected is the Bluetooth device to be connected; A connection management module for performing connection management on the device to be connected according to the device connection policy.

5. An electronic device, characterized in that, The electronic device includes: a memory, a processor, and a Bluetooth device connection program stored on the memory and executable on the processor. When the Bluetooth device connection program is executed by the processor, the steps of the Bluetooth device connection method according to any one of claims 1-3 are implemented.

6. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a Bluetooth device connection program. When the Bluetooth device connection program is executed by a processor, the steps of the Bluetooth device connection method according to any one of claims 1-3 are implemented.

Citation Information

Patent Citations

  • Bluetooth device automatic connection method and device, equipment and storage medium

    CN113395690A

  • Equipment control method and device, electronic equipment and storage medium

    CN115866569A