Bluetooth networking methods, systems, devices, and media based on BLE

By scanning Bluetooth nodes and updating the adjacency list, combined with the breadth-first search algorithm to optimize data paths, the problems of high connection quantity and fast power consumption in Bluetooth networking are solved, achieving an efficient Bluetooth mesh topology and intelligent device allocation.

CN115175158BActive Publication Date: 2025-10-31SHANGHAI PYTES ENERGY CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210883623.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-07-26
Publication Date
2025-10-31
Estimated Expiration
2042-07-26

AI Technical Summary

Technical Problem

Existing Bluetooth networking has a limited number of connections, low-power Bluetooth networking consumes power quickly, and the high communication pressure on nodes leads to information reception delays.

Method used

The first Bluetooth node scans surrounding Bluetooth nodes to obtain a device list, randomly selects an initial node and determines its link idleness, selects the optimal node to connect to based on the scan response packet, updates the adjacency list information, and uses a breadth-first search algorithm to select a path for data transmission when the communication idleness is high.

Benefits of technology

A large-scale Bluetooth mesh topology was implemented, which improved data transmission efficiency, avoided data transmission delays caused by busy Bluetooth links and CPUs, and enhanced communication fluency and intelligent device allocation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115175158B_ABST
    Figure CN115175158B_ABST
Patent Text Reader

Abstract

This invention discloses a Bluetooth networking method, system, device, and medium based on BLE. The method involves a first Bluetooth node scanning to obtain a list of Bluetooth node devices within a preset range. A node is randomly selected from this list as an initial Bluetooth node. If the link idle time of the initial Bluetooth node does not exceed a first threshold, an optimal second Bluetooth node is selected based on the device information in the scan response packets returned by each Bluetooth node connected to the initial Bluetooth node. The adjacency list information of this second Bluetooth node is then obtained, and the adjacency list information of the first Bluetooth node is updated. When transmitting data, if the communication idle time of the first Bluetooth node exceeds a second preset threshold, a breadth-first search algorithm is used to select the optimal path for targeted data transmission. This achieves a large-scale Bluetooth mesh topology and improves data transmission efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of Bluetooth networking, and more particularly to a Bluetooth networking method, system, device, and medium based on BLE. Background Technology

[0002] Currently, due to the limited number of Bluetooth connections, Bluetooth applications are often limited to point-to-point connections and star topologies with fewer than 7 connections. While BLE mesh, which utilizes BLE technology, can form a network, it requires continuous scanning to minimize missing any broadcast packets, resulting in rapid power consumption. To save power, low-power Bluetooth nodes require additional friend nodes to store information, which delays message reception. Summary of the Invention

[0003] The technical problem to be solved by the present invention is to overcome the shortcomings of existing technologies, such as the limited number of connections that can be made in ordinary Bluetooth networking, the fast power consumption of low-power Bluetooth networking, and the information reception delay caused by the high communication pressure of nodes. The invention provides a Bluetooth networking method, system, device and medium based on BLE.

[0004] The present invention solves the above-mentioned technical problems through the following technical solution:

[0005] Firstly, a Bluetooth networking method based on BLE is provided, the Bluetooth networking method comprising:

[0006] The first Bluetooth node scans surrounding Bluetooth nodes to obtain a list of Bluetooth node devices within a preset range. After the network node obtains the arbitration right, it randomly selects a Bluetooth node from the device list as the initial Bluetooth node and determines whether the link idleness of the initial Bluetooth node exceeds a first preset threshold. If it does not exceed the threshold, it sends a query broadcast packet to all connected Bluetooth nodes of the initial Bluetooth node and receives scan response packets from all connected Bluetooth nodes.

[0007] Based on the device information in the received scan response packet, the optimal second Bluetooth node is selected for connection and the adjacency list information of the second Bluetooth node is obtained.

[0008] The adjacency list information of the first Bluetooth node is updated based on the adjacency list information of the second Bluetooth node.

[0009] The data transmission method is determined based on whether the communication idleness of the first Bluetooth node exceeds the second preset threshold. If the communication idleness exceeds the second threshold, the current optimal path is selected by breadth-first traversal algorithm.

[0010] Send data to the second Bluetooth node.

[0011] The Bluetooth networking method based on BLE of the present invention scans a list of Bluetooth node devices within a preset range using a first Bluetooth node. After the network node obtains arbitration rights, a node is randomly selected from the list of Bluetooth node devices as the initial Bluetooth node. If the link idle time of the initial Bluetooth node does not exceed a first threshold, the optimal second Bluetooth node is selected for connection based on the device information in the scan response packets returned by each Bluetooth node connected to the initial Bluetooth node, and the adjacency list information of the connected node is obtained. The adjacency list information of the first Bluetooth node is then updated. When transmitting data, if the communication idle time of the first Bluetooth node exceeds a second preset threshold, the optimal path is selected for targeted data transmission using a breadth-first search algorithm. This achieves a large-scale Bluetooth mesh topology and improves the efficiency of data transmission.

[0012] Preferably, if the arbitration power is not transferred to the network node, the method further includes:

[0013] Select a Bluetooth node from the list of Bluetooth node devices within the preset range and connect to it.

[0014] The transfer of arbitration rights specifically refers to transferring the right to select Bluetooth nodes to an APP that has the aforementioned Bluetooth node selection function. If the arbitration rights are transferred to the APP, the APP can select the most suitable node for connection in the network according to the settings. If the arbitration rights are not transferred to the APP, the user can manually select a specified node for connection directly in the Bluetooth network.

[0015] Preferably, if the link idle time of the initial Bluetooth node exceeds a first preset threshold, the method further includes:

[0016] Directly select the initial Bluetooth node to connect.

[0017] Preferably, the device information includes Bluetooth device type, Bluetooth device status, and node link idle time.

[0018] Preferably, when the communication idle time of the first Bluetooth node does not exceed the second preset threshold, the method further includes:

[0019] The data transmission method is determined to be non-directional, that is, data is sent to all Bluetooth connection nodes in the adjacency list of the first Bluetooth node.

[0020] Secondly, a Bluetooth networking system based on BLE is provided, the Bluetooth networking system comprising:

[0021] The scanning module is used by the first Bluetooth node to scan surrounding Bluetooth nodes and obtain a list of Bluetooth node devices within a preset range;

[0022] The threshold determination module is used to determine whether the link idle time of an initial Bluetooth node randomly selected from the Bluetooth node device list exceeds a first preset threshold.

[0023] The information transceiver module is used to send query broadcast packets to all connected Bluetooth nodes of the initial Bluetooth node and receive scan response packets from all connected Bluetooth nodes.

[0024] The optimal connection module is used to select the optimal second Bluetooth node for connection based on the device information in the received scan response packet, and to obtain the adjacency list information of the second Bluetooth node.

[0025] The information update module is used to update the adjacency list information of the first Bluetooth node based on the adjacency list information of the second Bluetooth node.

[0026] The path comparison module is used to determine the data transmission method by whether the communication idleness of the first Bluetooth node exceeds a second preset threshold. If the communication idleness exceeds the second threshold, the current optimal path is selected by breadth-first traversal algorithm.

[0027] The data transmission module is used to send data to the second Bluetooth node.

[0028] The Bluetooth networking system based on BLE of this invention achieves the connection of large network topologies through the cooperation between various modules. By judging the link idle time, communication idle time and CPU idle time of each Bluetooth node, the Bluetooth devices that want to access the network are automatically assigned to more spare areas / nodes, thereby improving data transmission efficiency and avoiding data transmission delays caused by busy Bluetooth links or busy CPUs.

[0029] Preferably, if the arbitration power is not transferred to the network node, the system further includes:

[0030] The selection module is used to select a Bluetooth node from the list of Bluetooth node devices within the preset range for connection.

[0031] Preferably, the Bluetooth networking system further includes:

[0032] The connection unit is used to determine whether the link idleness of the initial Bluetooth node exceeds a first preset threshold. If the link idleness of the initial Bluetooth node exceeds the first preset threshold, the initial Bluetooth node is directly selected for connection.

[0033] Preferably, the Bluetooth networking system further includes:

[0034] An evaluation unit is used to evaluate the device information of the connected node, which includes Bluetooth device type, Bluetooth device status, and node link idle time.

[0035] Preferably, the Bluetooth networking system further includes:

[0036] The second judgment unit is used to determine whether the communication idleness of the first Bluetooth node exceeds the second preset threshold. If it does not exceed the threshold, the data transmission method is determined to be non-directional, that is, data is sent to all connected Bluetooth nodes in the adjacency list of the first Bluetooth node.

[0037] Thirdly, an electronic device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement any of the Bluetooth networking methods described above.

[0038] Fourthly, a storage medium is provided that stores computer instructions thereon, which, when executed by a processor, implement any of the Bluetooth networking methods described above.

[0039] The positive and progressive effects of this invention are as follows:

[0040] The Bluetooth networking method based on BLE of this invention stores Bluetooth node information through an adjacency list, solving the problem of limited devices caused by the star topology or point-to-point usage mode of traditional low-power Bluetooth devices. It can form a relatively large mesh topology. By judging the link idleness, communication idleness and CPU idleness of each Bluetooth node, the method automatically allocates Bluetooth devices that want to join the network to more available areas / nodes. It can choose to plan the path through the breadth-first algorithm or distribute messages in a divergent manner to avoid Bluetooth link busy or CPU busy situations, making the message transmission process smoother. It makes reasonable use of channels while ensuring communication efficiency and low pressure, making it more intelligent. Attached Figure Description

[0041] Figure 1 This is a flowchart illustrating a Bluetooth networking method based on BLE provided in Embodiment 1 of the present invention.

[0042] Figure 2 The specific content of the broadcast packet in a Bluetooth networking method based on BLE provided in Embodiment 1 of the present invention;

[0043] Figure 3 The specific content of the scanning response packet in a Bluetooth networking method based on BLE provided in Embodiment 1 of the present invention;

[0044] Figure 4 This is a schematic diagram illustrating the application of a Bluetooth networking method based on BLE provided in Embodiment 1 of the present invention in smart homes.

[0045] Figure 5This is a schematic diagram illustrating the application of a Bluetooth networking method based on BLE provided in Embodiment 1 of the present invention in a vegetable greenhouse.

[0046] Figure 6 This is a schematic diagram of a Bluetooth networking system based on BLE provided in Embodiment 2 of the present invention;

[0047] Figure 7 This is a schematic diagram of the structure of an electronic device provided in Embodiment 3 of the present invention. Detailed Implementation

[0048] The present invention will be further illustrated by way of embodiments below, but the present invention is not limited to the scope of the embodiments described herein.

[0049] Example 1

[0050] This embodiment provides a Bluetooth networking method based on BLE. Figure 1 This is a flowchart illustrating a Bluetooth networking method based on BLE provided in this embodiment, as shown below. Figure 1 As shown, the Bluetooth networking method based on BLE includes:

[0051] 101. Scan for nearby Bluetooth nodes to obtain a list of Bluetooth node devices within a preset range;

[0052] In this step, the first Bluetooth node is the node to be connected. It scans surrounding Bluetooth nodes to obtain a list of all Bluetooth node devices within a preset range. All devices are powered on, and relevant hardware parameters are configured, including various Bluetooth parameters such as broadcast interval, scan window, and connect interval. An Addr is generated and stored. Software parameters are configured, such as TTL=0 and sequence=0. TTL stands for Time To Live, which is the lifespan of a message. Its initial value is a non-zero value. Each time a message is forwarded through a node, the TTL is decremented by 1. When the TTL reaches 0, the message disappears and is no longer transmitted in the network. This flag is used to prevent message storms in the network. It is usually set to be greater than the number of nodes in the entire network, but not too large, otherwise it would be meaningless. The Addr is the device address. Its generation method is arbitrary; it can be a unique device serial number, represent a device type, or be repeated, depending on the actual scenario.

[0053] 102. Determine whether the link idleness of the randomly selected initial Bluetooth node exceeds the first preset threshold. If it does not exceed the threshold, send a query broadcast packet to all connected Bluetooth nodes of the initial Bluetooth node and receive scan response packets from all connected Bluetooth nodes.

[0054] In this step, assuming arbitration rights are obtained, a Bluetooth node is randomly selected from a pre-defined list of Bluetooth node devices as the initial Bluetooth node. The link idleness of the initial Bluetooth node is then checked to see if it exceeds a first pre-defined threshold. Link idleness refers to the number of remaining connectable links for each node; a minimum of 4 connectable links is considered optimal and takes effect when the node connects to the network. The system then checks if the desired node has available links. If the initial node's link idleness is insufficient, a query broadcast packet is sent to all nodes connected to it. The system then receives scan response packets from all connected Bluetooth nodes. Both types of packets also need to include device information and other data for identification purposes in the application. The general padding format for broadcast packets and scan response packets is defined by the BLE protocol stack, specifically as length / flag / information, where length is the length of flag + information, and the actual length is one more than this. This structure can be repeated within a broadcast packet, corresponding to different flags. The maximum length of a broadcast packet / scan response packet is 31 bytes, so the node to be connected can receive 62 bytes of information at a time. Figure 2 The specific content of the broadcast packet in this embodiment is as follows: Figure 3 This describes the specific content of the scan response packet in this embodiment.

[0055] In this step, if node A attempts to access the network from node Address1, which has an idle level of 0, when the idle level of a node in the network is less than 2 (e.g., node Address1), it will actively collect information about nodes within a certain number of layers around it through network topology, and plan an optimal replacement node (e.g., Device2 for Address1). The link weight between them is 2, which may be determined by RSSI value, device type, or other factors. Address1 will include the replacement node information in a broadcast packet or scan response packet to inform surrounding devices of the relevant information. In this way, after receiving the data in the broadcast packet, device A can connect to the optimal replacement node, reducing the communication pressure on a single node. It is important to note that when Address1 has an idle level of 0, it sends an unconnectable broadcast packet; even if other devices receive Address1's broadcast packet, they cannot connect to it.

[0056] 103. Select the optimal Bluetooth node to connect to based on the device information and obtain the adjacency list information of connected Bluetooth node 2;

[0057] In this step, the optimal node is selected for connection based on the device information in the scan response packets returned by each connection node. The device information includes Bluetooth device type, Bluetooth device status, and node link idle time. After successful connection, the adjacency list information of the selected Bluetooth node and the second Bluetooth node is obtained. This is a data structure stored in the flash memory of the Bluetooth chip and serves as the basis for tracing from one node to another. It occupies much less flash space than a typical array. The topology is mesh-like and logically transformed into a graph-like data structure.

[0058] 104. Update the adjacency list information of the first Bluetooth node;

[0059] In this step, after the first Bluetooth node connects to the selected second Bluetooth node, it needs to update its own adjacency list information. That is, after the access node A connects from the selected Bluetooth node, its idle time decreases by 1, and its own adjacency list is updated. The adjacency list can be understood as a network map stored in the chip flash of each node. It is the basis for node tracking when sending messages, so this behavior is necessary. The update message will be eliminated when it encounters a node that has already been updated, so it will not cause a network storm.

[0060] 105. The data transmission method is determined based on whether the communication idleness of the first Bluetooth node exceeds the second preset threshold. If the communication idleness exceeds the second threshold, the current optimal path is selected by breadth-first traversal algorithm.

[0061] In this step, the data transmission method is determined based on the communication idleness of the connected Bluetooth nodes. Communication idleness refers to the channel's BT Credits, which is fixed at 10. It takes effect when communication occurs between nodes after the nodes connect to the network, determining whether the channel still has spare capacity to send data. Communication idleness is generally represented by BT Credits, which is a data point provided by the underlying Bluetooth protocol stack. When BT Credits are less than 1, the Bluetooth device cannot send new messages. When the communication idleness exceeds 10, the optimal path needs to be selected using a breadth-first search algorithm. The average time complexity of the breadth-first search algorithm for a graph is O(n+e), and the space complexity is O(n), where n is the number of nodes and e is the number of links.

[0062] When the communication idle time of the first Bluetooth node does not exceed the second preset threshold, the data transmission method is non-directional, that is, data is sent to all Bluetooth connected nodes in the adjacency list of the first Bluetooth node. Another non-directional data transmission method exists where CPU idle time is represented by a ready flag provided by the MCU framework or OS. When the ready flag is false, it indicates that the device is busy and has no spare capacity for path planning. In this case, a divergent message transmission method is used, meaning that if a message is sent to all nodes, the target node will always receive the message. Compared to Bluetooth link congestion, this is a relatively less likely extreme case.

[0063] 106. Send data to the second Bluetooth node.

[0064] In this step, after determining the optimal link using the breadth-first traversal algorithm, data transmission can proceed. The connection data packet is the data packet used to transmit data after a link is formed between two nodes. In addition to transmitting the valid data that a node wants to transmit to another node, it also needs to contain some flag bits used to determine the behavior of the node. The maximum length of the connection data is 247 bytes.

[0065] The Bluetooth networking method based on BLE in this embodiment involves scanning a list of Bluetooth nodes within a preset range by a first Bluetooth node. After the network node obtains arbitration rights, a node is randomly selected from the list of Bluetooth nodes as the initial Bluetooth node. If the link idle time of the initial Bluetooth node does not exceed a first threshold, the optimal second Bluetooth node is selected based on the device information in the scan response packets returned by each Bluetooth node connected to the initial Bluetooth node. The adjacency list information of the connected node is then obtained, and the adjacency list information of the first Bluetooth node is updated. When transmitting data, if the communication idle time of the first Bluetooth node exceeds a second preset threshold, the optimal path is selected through a breadth-first search algorithm for targeted data transmission. This achieves a large-scale Bluetooth mesh topology and improves the efficiency of data transmission.

[0066] In step 102, if the arbitration right is not transferred to the network node, the first Bluetooth node directly selects a Bluetooth node from the Bluetooth node device list within the preset range for connection.

[0067] In an optional implementation, step 102 further includes:

[0068] If the link idle time of the initial Bluetooth node exceeds the first preset threshold, then the initial Bluetooth node is directly selected for connection.

[0069] In an alternative implementation, Bluetooth nodes can also form networks within their respective areas, and these networks can connect to each other. For example... Figure 4The diagram illustrates the network connection between an indoor smart home network and an outdoor electric bicycle. In the indoor smart home network, H1 is the smart TV, H2 is the smart curtains, H3 is the smart panel, H4 is the remote control, and H5 is the door lock. This network can be expanded to include other home appliances. An electric bicycle can also form a simple small network. P represents a mobile device node outside the network, such as a mobile phone, which can also connect to either the indoor network or the electric bicycle's small network. These two networks can interconnect, and there is a method for connecting and disconnecting the networks to ensure relative independence after separation. The bicycle network, initially connected to the indoor network, loses this connection after the bicycle starts moving away, yet it can still function as a self-contained network. Similarly, the bicycle, initially connected to the front door node, can still access the building's network and function normally after the link is broken when approaching from the back door or side. This demonstrates the practical application of the network.

[0070] In an alternative implementation, this Bluetooth networking method can also be used in agricultural vegetable greenhouses. For example... Figure 5 The diagram shows a network connection between two vegetable greenhouses. D1 is the main controller for the greenhouse, D2 is a thermometer, D3 is a sprinkler, D4 is a thermometer covering another part of the greenhouse, and D5 is other equipment inside the greenhouse. Greenhouse 1 and Greenhouse 2 are two independent networks, but they can be connected through the controller D1, enabling unified management and control of multiple greenhouses and improving production efficiency.

[0071] This embodiment achieves intelligent Bluetooth networking by rationally utilizing channels while ensuring communication efficiency and minimizing pressure. It breaks away from the traditional star topology or point-to-point usage of low-power Bluetooth devices, enabling the formation of a relatively large mesh topology. By limiting the number of connectable links for each node and utilizing BTCredits data provided in the Bluetooth protocol stack, devices wishing to access the network can be automatically assigned to more available areas / nodes. It can avoid Bluetooth link congestion or CPU overload by planning paths or distributing messages in a divergent manner, making message transmission smoother. Other solutions use tree diagrams to store nodes when defining the tracking method, failing to consider the bidirectional communication between nodes or the possibility of loops in the graph for nodes that can connect to multiple devices. This results in a more complex structure than a tree diagram, and simply using a tree diagram for storage is insufficient to meet practical needs.

[0072] Example 2

[0073] This embodiment provides a Bluetooth networking system based on BLE. Figure 6 This embodiment provides a schematic diagram of a Bluetooth networking system based on BLE, as shown below. Figure 6As shown, a BLE-based Bluetooth networking system includes:

[0074] Scanning module 1 is used by the first Bluetooth node to scan surrounding Bluetooth nodes and obtain a list of Bluetooth node devices within a preset range;

[0075] Threshold determination module 2 is used to determine whether the link idle degree of an initial Bluetooth node randomly selected from the Bluetooth node device list exceeds a first preset threshold.

[0076] Information transceiver module 3 is used to send query broadcast packets to all connected Bluetooth nodes of the initial Bluetooth node and receive scan response packets from all connected Bluetooth nodes;

[0077] The optimal connection module 4 is used to select the optimal second Bluetooth node for connection based on the device information in the received scan response packet, and to obtain the adjacency table information of the second Bluetooth node.

[0078] Information update module 5 is used to update the adjacency list information of the first Bluetooth node based on the adjacency list information of the second Bluetooth node;

[0079] The path comparison module 6 is used to determine the data transmission method by whether the communication idleness of the first Bluetooth node exceeds a second preset threshold. If the communication idleness exceeds the second threshold, the current optimal path is selected by breadth-first traversal algorithm.

[0080] Data transmission module 7 is used to send data to the second Bluetooth node.

[0081] In an optional implementation, if the arbitration authority is not transferred to the network node, the Bluetooth networking system further includes:

[0082] Selection module 8 is used to select a Bluetooth node from the list of Bluetooth node devices within the preset range for connection.

[0083] In an optional implementation, the threshold determination module 2 further includes:

[0084] The connection unit 21 is used to determine whether the link idleness of the initial Bluetooth node exceeds a first preset threshold. If the link idleness of the initial Bluetooth node exceeds the first preset threshold, the initial Bluetooth node is directly selected for connection.

[0085] In an optional implementation, the preferred connection module 4 further includes:

[0086] Evaluation unit 41 is used to evaluate the device information of the connected node, the device information including at least one of Bluetooth device type, Bluetooth device status, and node link idleness.

[0087] In an optional implementation, the path comparison module 6 further includes:

[0088] The judgment unit 61 is used to determine whether the communication idleness of the first Bluetooth node exceeds the second preset threshold. If it does not exceed the threshold, the data transmission method is determined to be non-directional, that is, data is sent to all Bluetooth connected Bluetooth nodes in the adjacency list of the first Bluetooth node.

[0089] This embodiment achieves the connection of a large network topology through the cooperation between various modules. By judging the link idle time, communication idle time and CPU idle time of each Bluetooth node, the Bluetooth devices that want to access the network are automatically assigned to more spare areas / nodes, thereby improving data transmission efficiency and avoiding data transmission delays caused by busy Bluetooth links or busy CPUs.

[0090] Example 3

[0091] This embodiment provides an electronic device. Figure 7 This is a schematic diagram of the structure of an electronic device provided in this embodiment. The electronic device includes a memory, a processor, and a computer program stored in the memory and capable of running on the processor. When the processor executes the computer program, it implements the Bluetooth networking method based on BLE in Embodiment 1 above. Figure 7 The electronic device 80 shown is merely an example and should not be construed as limiting the functionality or scope of the embodiments of the present invention. Figure 7 As shown, the electronic device 80 can be manifested as a general-purpose computing device, such as a server device. The components of the electronic device 80 may include, but are not limited to: at least one processor 81, at least one memory 82, and a bus 83 connecting different system components (including memory 82 and processor 81).

[0092] Bus 83 includes a data bus, an address bus, and a control bus.

[0093] The memory 82 may include volatile memory, such as random access memory (RAM) 821 and / or cache memory 822, and may further include read-only memory (ROM) 823.

[0094] The memory 82 may also include a program tool 825 (or utility) having a set (at least one) program module 824, including but not limited to: an operating system, one or more application programs, other program modules, and program data, each or some combination of these examples may include an implementation of a network environment.

[0095] The processor 81 executes various functional applications and data processing by running computer programs stored in the memory 82, such as the Bluetooth networking method based on BLE in Embodiment 1 above.

[0096] Electronic device 80 can also communicate with one or more external devices 84. This communication can be performed via input / output (I / O) interface 85. Furthermore, the model-generated electronic device 80 can also communicate with one or more networks (e.g., local area network (LAN), wide area network (WAN), and / or public networks, such as the Internet) via network adapter 86. Figure 5 As shown, network adapter 86 communicates with other modules of electronic device 80 via bus 83. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with electronic device 80, including but not limited to: microcode, device drivers, redundant processors, external disk drive arrays, RAID (disk array) systems, tape drives, and data backup storage systems.

[0097] It should be noted that although several units / modules or sub-units / modules of the electronic device have been mentioned in the detailed description above, this division is merely exemplary and not mandatory. In fact, according to embodiments of the present invention, the features and functions of two or more units / modules described above can be embodied in one unit / module. Conversely, the features and functions of one unit / module described above can be further divided and embodied by multiple units / modules.

[0098] Example 4

[0099] This embodiment provides a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the Bluetooth networking method based on BLE in Embodiment 1 above.

[0100] The readable storage medium may be more specifically adopted, including but not limited to: portable disk, hard disk, random access memory, read-only memory, erasable programmable read-only memory, optical storage device, magnetic storage device, or any suitable combination thereof.

[0101] In a possible implementation, the present invention can also be implemented as a program product comprising program code, which, when the program product is run on a terminal device, causes the terminal device to perform the steps of implementing the BLE-based Bluetooth networking method in Embodiment 1 above.

[0102] The program code for executing the present invention can be written in any combination of one or more programming languages. The program code can be executed entirely on the user device, partially on the user device, as a standalone software package, partially on the user device and partially on a remote device, or entirely on a remote device.

[0103] While specific embodiments of the present invention have been described above, those skilled in the art should understand that these are merely illustrative examples, and the scope of protection of the present invention is defined by the appended claims. Those skilled in the art can make various changes or modifications to these embodiments without departing from the principles and essence of the present invention, but all such changes and modifications fall within the scope of protection of the present invention.

Claims

1. A Bluetooth networking method based on BLE, characterized in that, Includes the following steps: The first Bluetooth node scans surrounding Bluetooth nodes to obtain a list of Bluetooth node devices within a preset range; After the first Bluetooth node obtains the arbitration right, a Bluetooth node is randomly selected from the Bluetooth node device list as the initial Bluetooth node. It is determined whether the link idleness of the initial Bluetooth node exceeds a first preset threshold. If it does not exceed the threshold, a query broadcast packet is sent to all connected Bluetooth nodes of the initial Bluetooth node and a scan response packet is received from all connected Bluetooth nodes. The link idleness is the number of remaining connectable paths of the Bluetooth node. Based on the device information in the received scan response packet, the optimal second Bluetooth node is selected for connection and the adjacency list information of the second Bluetooth node is obtained. The adjacency list information of the first Bluetooth node is updated based on the adjacency list information of the second Bluetooth node. The data transmission method is determined based on whether the communication idleness of the first Bluetooth node exceeds the second preset threshold. If the communication idleness exceeds the second preset threshold, the current optimal path is selected by breadth-first traversal algorithm. The communication idleness is the channel's BT Credits. Send data to the second Bluetooth node.

2. The Bluetooth networking method according to claim 1, characterized in that, The method further includes: If the arbitration right is not transferred to the first Bluetooth node, a Bluetooth node can be selected directly from the list of Bluetooth node devices within the preset range for connection.

3. The Bluetooth networking method according to claim 1, characterized in that, If the link idle time of the initial Bluetooth node exceeds a first preset threshold, the method further includes: Directly select the initial Bluetooth node to connect.

4. The Bluetooth networking method according to claim 1, characterized in that, The device information includes Bluetooth device type, Bluetooth device status, and node link idle time.

5. The Bluetooth networking method according to claim 1, characterized in that, When the communication idle time of the first Bluetooth node does not exceed the second preset threshold, the method further includes: The data transmission method is determined to be non-directional, that is, data is sent to all Bluetooth connection nodes in the adjacency list of the first Bluetooth node.

6. A Bluetooth networking system based on BLE, characterized in that, The Bluetooth networking system includes: The scanning module is used by the first Bluetooth node to scan surrounding Bluetooth nodes and obtain a list of Bluetooth node devices within a preset range; The threshold judgment module is used to determine whether the link idleness of the initial Bluetooth node randomly selected from the Bluetooth node device list exceeds a first preset threshold after the first Bluetooth node obtains the arbitration right. The link idleness is the number of remaining connectable paths of the Bluetooth node. The information transceiver module is used to send query broadcast packets to all connected Bluetooth nodes of the initial Bluetooth node and receive scan response packets from all connected Bluetooth nodes. The optimal connection module is used to select the optimal second Bluetooth node for connection based on the device information in the received scan response packet, and to obtain the adjacency list information of the second Bluetooth node. The information update module is used to update the adjacency list information of the first Bluetooth node based on the adjacency list information of the second Bluetooth node. The path comparison module is used to determine the data transmission method by whether the communication idleness of the first Bluetooth node exceeds a second preset threshold. If the communication idleness exceeds the second preset threshold, the current optimal path is selected by breadth-first traversal algorithm. The communication idleness is the BT Credits of the channel. The data transmission module is used to send data to the second Bluetooth node.

7. The Bluetooth networking system according to claim 6, characterized in that, The Bluetooth networking system also includes: The selection module is used to select a Bluetooth node from the list of Bluetooth node devices within the preset range for connection without transferring the arbitration right to the first Bluetooth node.

8. The Bluetooth networking system according to claim 6, characterized in that, The Bluetooth networking system also includes: The connection unit is used to determine whether the link idleness of the initial Bluetooth node exceeds a first preset threshold. If the link idleness of the initial Bluetooth node exceeds the first preset threshold, the initial Bluetooth node is directly selected for connection.

9. The Bluetooth networking system according to claim 6, characterized in that, The Bluetooth networking system also includes: The evaluation unit is used to evaluate the device information of the connected node, which includes Bluetooth device type, Bluetooth device status, and node link idle time.

10. The Bluetooth networking system according to claim 6, characterized in that, The Bluetooth networking system also includes: The second judgment unit is used to determine whether the communication idleness of the first Bluetooth node exceeds the second preset threshold. If it does not exceed the threshold, the data transmission method is determined to be non-directional, that is, data is sent to all Bluetooth connected Bluetooth nodes in the adjacency list of the first Bluetooth node.

11. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the Bluetooth networking method based on BLE as described in any one of claims 1 to 5.

12. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the Bluetooth networking method based on BLE as described in any one of claims 1 to 5.

Citation Information

Patent Citations

  • A Bluetooth networking method and system based on BLE

    CN111787550A

  • Bluetooth device multi-connection networking method and system based on BLE broadcast

    CN112822643A