A proxy node connection method, terminal device and storage medium
By selecting multiple proxy nodes in the Bluetooth Mesh network to send and receive messages from terminal devices, the performance bottleneck and stability problems caused by a single proxy node are solved, and the message transmission performance and network access stability of terminal devices are improved.
Patent Information
- Application Number
- CN202210975889.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-08-15
- Publication Date
- 2024-10-15
- Estimated Expiration
- 2042-08-15
AI Technical Summary
In a Bluetooth Mesh network, when a terminal device is connected to a single agent node, there are message transmission performance bottlenecks and stability issues. In particular, the connection is easily disconnected when the device moves, which affects the stability of the access network.
By scanning the candidate node devices in the Bluetooth Mesh network, multiple target node devices at different distances are selected based on signal strength, and GATT connections are established with them to form multiple proxy nodes to send and receive messages.
It improves the message transmission performance of terminal devices in the Bluetooth Mesh network, reduces disconnection interference when the device is moving, and improves the stability of the access network.
Smart Images

Figure CN115515256B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of communication technology, and specifically to a proxy node connection method, a terminal device, and a storage medium. Background Art
[0002] The Bluetooth Mesh (wireless mesh) network is a mesh network that establishes communication between devices based on BLE (Bluetooth Low Energy). It is widely used in smart home, smart office and other device intelligent interconnection scenarios.
[0003] At present, if users need to use terminal devices such as smartphones and tablets to control the node devices that have been configured in the Bluetooth Mesh network, they need to connect the terminal devices to the Bluetooth Mesh network; the terminal devices can establish a GATT (Generic Attribute Profile) connection with the node devices in the Bluetooth Mesh network, thereby using the node devices that establish the GATT connection as proxy nodes, and then the terminal devices can use the proxy nodes to send and receive messages in the Bluetooth Mesh network to enable the terminal devices to access the Bluetooth Mesh network.
[0004] In the above context, how to provide a proxy node connection solution to improve the performance of terminal devices in sending and receiving messages and improve the stability of terminal devices accessing the Bluetooth Mesh network has become a technical problem that technical personnel in this field urgently need to solve. Summary of the invention
[0005] In view of this, an embodiment of the present application provides a proxy node connection method, a terminal device and a storage medium to improve the performance of sending and receiving messages of the terminal device and to improve the stability of the terminal device accessing the Bluetooth Mesh network.
[0006] To achieve the above objectives, the embodiments of the present application provide the following technical solutions.
[0007] In a first aspect, an embodiment of the present application provides a proxy node connection method, which is applied to a terminal device, including:
[0008] Scan the Bluetooth Mesh network for candidate node devices that can serve as proxy nodes;
[0009] Determine the distance of the candidate node relative to the terminal device according to the signal strength of the candidate node device;
[0010] Select multiple target node devices at different distances from the candidate node devices;
[0011] Establish GATT connections with multiple target node devices so that the multiple target node devices become multiple proxy nodes of the terminal device; wherein the terminal device sends and receives messages of the Bluetooth Mesh network through the proxy nodes.
[0012] In a second aspect, an embodiment of the present application provides a terminal device, comprising at least one memory and at least one processor, wherein the memory stores one or more computer executable instructions, and the processor calls the one or more computer executable instructions to execute the proxy node connection method as described in the first aspect above.
[0013] In a third aspect, an embodiment of the present application provides a storage medium, which stores one or more computer-executable instructions. When the one or more computer-executable instructions are executed, the proxy node connection method described in the first aspect above is implemented.
[0014] In a fourth aspect, an embodiment of the present application provides a computer program, which, when executed, implements the proxy node connection method as described in the first aspect above.
[0015] In the proxy node connection method provided in the embodiment of the present application, the terminal device can scan the candidate node devices that can serve as proxy nodes in the Bluetooth Mesh network, thereby selecting multiple target node devices at different distances from the candidate node devices according to the signal strength of the candidate node devices; and then the terminal device can establish a GATT connection with multiple target node devices, so that the multiple target node devices become multiple proxy nodes of the terminal device, so that the terminal device can send and receive messages of the Bluetooth Mesh network through multiple proxy nodes. The embodiment of the present application can establish a GATT connection between the terminal device and multiple target node devices at different distances in the Bluetooth Mesh network through the multi-GATT connection characteristics of the terminal device, so as to realize the terminal device to send and receive messages through multiple proxy nodes. It can be seen that the terminal device can improve the performance of the terminal device in sending and receiving messages through multiple proxy nodes by sending and receiving messages of the Bluetooth Mesh network through multiple proxy nodes, and avoid the performance bottleneck of a single proxy node in sending and receiving messages; at the same time, since the distances of the multiple proxy nodes relative to the terminal device are different, the connection between the terminal device and the proxy node is not easy to disconnect during the movement of the terminal device, which can reduce the disconnection interference during the movement of the terminal device and improve the stability of the terminal device accessing the Bluetooth Mesh network. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying any creative work.
[0017] Figure 1 This is an example diagram of a Bluetooth Mesh network.
[0018] Figure 2 A flowchart of a proxy node connection method provided in an embodiment of the present application.
[0019] Figure 3 An example diagram for selecting a target node device provided in an embodiment of the present application.
[0020] Figure 4 An example diagram of establishing multiple GATT connections for a terminal device provided in an embodiment of the present application.
[0021] Figure 5 A flow chart of a method for performing read and write configuration for multiple proxy nodes provided in an embodiment of the present application.
[0022] Figure 6 A flow chart of a method for configuring a node device provided in an embodiment of the present application.
[0023] Figure 7 A block diagram of a proxy node connection device provided in an embodiment of the present application.
[0024] Figure 8 A block diagram of a terminal device. DETAILED DESCRIPTION
[0025] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0026] Figure 1 An example diagram of a Bluetooth Mesh network is shown as follows: Figure 1 As shown, the Bluetooth Mesh network may include: multiple node devices 1 to N that have been configured, where N is the number of node devices, which may depend on the number of node devices that have been configured in the Bluetooth Mesh network, and the present application embodiment does not limit this. Figure 1As shown, a user can use a terminal device 101 to access a Bluetooth Mesh network, and use the terminal device 101 to configure and control node devices in the Bluetooth Mesh network.
[0027] Since the terminal device 101 does not support the interactive mode of directly sending broadcast packets, the terminal device 101 needs to establish a GATT connection with the node device in the Bluetooth Mesh network, and use the node device that establishes the GATT connection as a proxy node, so that the terminal device 101 can send and receive messages of the Bluetooth Mesh network through the proxy node to achieve the access of the terminal device 101 to the Bluetooth Mesh network. Figure 1 As shown, the terminal device 101 can establish a GATT connection with the node device 1, so that the node device 1 acts as a proxy node of the terminal device 101, and then the terminal device 101 can send and receive messages of the Bluetooth Mesh network through the node device 1 to enable the terminal device 101 to access the Bluetooth Mesh network and configure and control the node devices in the Bluetooth Mesh network.
[0028] It should be noted that the Bluetooth Mesh protocol stack defines the advertising bearer layer and the GATT bearer layer. Since terminal devices such as smartphones and tablets do not support the broadcast bearer layer, the terminal devices need to use a proxy node to perform the bearer layer conversion (conversion from the broadcast bearer layer to the GATT bearer layer), so that terminal devices that do not support the broadcast bearer layer can send and receive messages in the Bluetooth Mesh network through the proxy node. The terminal device referred to in the embodiments of the present application can be, for example, a user device on the user side such as a smartphone or tablet computer. The terminal device can install an APP (application) to achieve device control of the Bluetooth Mesh network. The APP can be an application for Bluetooth Mesh management, such as an APP that provides smart home, smart office and other device smart interconnection services.
[0029] When setting a proxy node for a terminal device, if the terminal device establishes a GATT connection with a single node device in a Bluetooth Mesh network and uses the single node device as a proxy node, the performance of the terminal device sending and receiving messages will be bottlenecked due to the single-point characteristics of the proxy node, and the stability of the terminal device accessing the Bluetooth Mesh network will be poor. To facilitate the explanation of the above problem, the following is an explanation of the above problem from the perspective of some examples.
[0030] In one example, Bluetooth Mesh is widely used in smart home, smart office and other fields due to its cost advantage. The networking scale of Bluetooth Mesh devices is also expanding rapidly, and the control requirements of Bluetooth Mesh devices are also upgraded from single control to group control, scene control, etc. If a terminal device sets a single proxy node, due to the single-point characteristics of the proxy node, the performance bottleneck of the single proxy node when forwarding messages and the easy failure of the single proxy node will lead to a bottleneck in the performance of the terminal device sending and receiving messages. Taking group control as an example, if the terminal device is configured with a single proxy node, the user needs to configure the node devices to be grouped one by one through the single proxy node before group control. When the number of node devices to be grouped is large, it will cause the group configuration to take a long time.
[0031] At the same time, terminal devices such as smartphones have the characteristic of mobility (for example, as the user moves, the location of the terminal device will also move). If a terminal device is set with a single proxy node, then as the terminal device moves, the connection between the terminal device and the proxy node may become unstable or even disconnected, which will cause the terminal device to access the Bluetooth Mesh network with poor stability. As a result, the configuration, control and other operations of the terminal device are likely to be unable to be completed due to the unstable connection between the terminal device and the proxy node.
[0032] Based on the above problems, the embodiments of the present application provide an improved proxy node connection solution to improve the performance of the terminal device in sending and receiving messages, and to improve the stability of the terminal device in accessing the Bluetooth Mesh network. In the embodiments of the present application, based on the characteristic that the terminal device supports multiple GATT connections, the embodiments of the present application can set multiple proxy nodes at different distances for the terminal device, thereby helping the terminal device to send and receive messages of the Bluetooth Mesh network through the multiple proxy nodes at different distances, so as to improve the performance of the terminal device in sending and receiving messages, and to improve the stability of the terminal device in accessing the Bluetooth Mesh network.
[0033] Based on the above ideas, as an optional implementation, Figure 2 The flowchart of the proxy node connection method provided by the embodiment of the present application is exemplarily shown. The method flow can be implemented by the terminal device and the node device; refer to Figure 2 The method flow may include the following steps.
[0034] In step S210, a node device connected to the Bluetooth Mesh network sends a broadcast packet.
[0035] In step S211, the terminal device determines, based on the acquired broadcast packet, a candidate node device that can serve as a proxy node from the node devices that send the broadcast packet.
[0036] After a Bluetooth Mesh device is connected to a Bluetooth Mesh network, it can be used as a node device that has been configured in the Bluetooth Mesh network. The node device in the Bluetooth Mesh network can send broadcast packets in a broadcasting manner. For example, each node device in the Bluetooth Mesh network can send a broadcast packet separately.
[0037] After acquiring the broadcast packet sent by the node device, the terminal device can identify the broadcast packet sent by the node device to determine the candidate node device that can serve as the proxy node from the node device that sent the broadcast packet. In some embodiments, the node device that can serve as the proxy node can carry a proxy feature bit (Proxy Feature Bit) in the feature field of the broadcast packet to indicate that the node device can serve as a proxy node; thus, after acquiring the broadcast packet sent by the node device, the terminal device can identify whether the feature field of the broadcast packet carries the proxy feature bit; if the feature field of the broadcast packet carries the proxy feature bit, it can be determined that the node device that sent the broadcast packet is a candidate node device that can serve as a proxy node. There can be multiple candidate node devices that can serve as proxy nodes in the Bluetooth Mesh network.
[0038] In an example, assuming that there are N configured node devices in the Bluetooth Mesh network, the N node devices can send broadcast packets separately. After the terminal device obtains the broadcast packets sent by the N node devices, if it is identified that the characteristic field of the broadcast packets sent by M of the node devices carries the proxy characteristic bit, then the M node devices can be determined as candidate node devices that can serve as proxy nodes, where M is less than or equal to N.
[0039] It should be noted that step S210 and step S211 can be considered as an optional implementation method for the terminal device to scan the candidate node devices that can serve as proxy nodes in the Bluetooth Mesh network. The embodiments of the present application can also support other methods for the terminal device to scan the candidate node devices, not limited to the method of identifying whether the characteristic field of the broadcast packet carries the proxy characteristic bit. For example, the embodiments of the present application can support the broadcast packet type sent by the candidate node device, which is different from the broadcast packet type sent by the non-candidate node device, so that the terminal device can determine the candidate node device by identifying whether the broadcast packet type sent by the node device matches the broadcast packet type of the candidate node device.
[0040] In step S212, the terminal device determines the distance of the candidate node relative to the terminal device according to the signal strength of the candidate node device.
[0041] In step S213, the terminal device selects a plurality of target node devices at different distances from the candidate node devices.
[0042] The target node device can be considered as a node device that the terminal device needs to establish a GATT connection with and serve as a proxy node. After the terminal device scans the candidate node device that can serve as a proxy node in the Bluetooth Mesh network, in order to reduce the interference of disconnection during the movement of the terminal device, the terminal device can select multiple target node devices at different distances from the candidate node devices as proxy nodes for establishing a GATT connection. In some embodiments, the terminal device can determine the distance of each candidate node device relative to the terminal device based on the signal strength of the broadcast packet sent by each candidate node device, thereby selecting multiple target node devices at different distances from the candidate node devices as proxy nodes for establishing a GATT connection. It should be noted that the distance referred to in the embodiments of the present application may be the distance of the candidate node device relative to the terminal device.
[0043] As an optional implementation, the number of multiple target node devices selected by the terminal device may be determined according to the upper limit number of proxy node connections of the terminal device; for example, the terminal device may select multiple target node devices at different distances from the candidate node devices according to the upper limit number of proxy node connections, and the number of the multiple target node devices selected does not exceed the upper limit number of connections; for example, the number of the multiple target node devices selected corresponds to the upper limit number of connections.
[0044] In some embodiments, when the terminal device selects the multiple target node devices, the number of the selected long-distance target node devices may be less than the number of the short-distance target node devices; that is, the terminal device may select a target node device that is closer and a target node device that is farther away, and the number of selected target node devices that are closer is greater than the number of selected target node devices that are farther away. In other possible implementations, when the terminal device selects the multiple target node devices, the number of the selected long-distance target node devices may also be greater than or equal to the number of short-distance target node devices. The number of long-distance target node devices and the number of short-distance target node devices selected by the terminal device may be determined according to the network structure of the Bluetooth Mesh network and the position of the terminal device in the Bluetooth Mesh network, and the embodiments of the present application are not limited. In a possible example, when the terminal device is at the center of the Bluetooth Mesh network and the Bluetooth Mesh network is a regular network structure (such as a circular network structure), the number of selected target node devices that are closer selected by the terminal device may be less than or equal to the number of selected target node devices that are farther away.
[0045] As an optional implementation, an embodiment of the present application may set a preset distance threshold, thereby selecting a first number of target node devices from candidate node devices whose distance relative to the terminal device is less than the distance threshold, and selecting a second number of target node devices from candidate node devices whose distance relative to the terminal device is greater than the distance threshold, so that the first number of target node devices and the second number of target node devices form a plurality of target node devices selected by the terminal device. Optionally, the first number may be greater than the second number. In one example, the terminal device may select a plurality of target node devices at different distances from the candidate node devices according to the signal strength of the candidate node devices, for example, selecting a candidate node device at a longer distance as the target node device, and selecting a plurality of candidate node devices at a closer distance as the target node devices.
[0046] In a further optional implementation, when selecting a first number of target node devices from candidate node devices whose distance is less than a distance threshold, the terminal device may support randomly selecting the first number of target node devices from candidate node devices whose distance is less than the distance threshold; the terminal device may also support selecting the first number of target node devices at intervals from candidate node devices whose distance is less than the distance threshold in order of distance from near to far or from far to near; the interval referred to here can be considered as, after selecting the previous target node device, selecting the next target node device after an interval of one or more sequences.
[0047] In a further optional implementation, when selecting a second number of target node devices from candidate node devices whose distance is greater than a distance threshold, the terminal device may support randomly selecting a second number of target node devices from candidate node devices whose distance is greater than the distance threshold; the terminal device may also support selecting a second number of target node devices from candidate node devices whose distance is greater than the distance threshold in order of distance from near to far or from far to near.
[0048] In one example, Figure 3 The example diagram of selecting a target node device is shown as an example. Assuming that the terminal device scans M candidate node devices (candidate node devices 1 to M), and the terminal device currently supports connecting K proxy nodes (K is less than M), the terminal device can select K target node devices at different distances from the M candidate node devices according to the signal strength of the M candidate node devices. Figure 3As shown in the example, assuming that among the M candidate node devices, the distance between candidate node devices 1 to S and the terminal device is less than the distance threshold (S is less than M, and S is greater than K), and the distance between candidate node devices S+1 to M and the terminal device is greater than the distance threshold, the terminal device can select K-1 target node devices from candidate node devices 1 to S (randomly select or select in order of distance from near to far or from far to near), and select 1 target node device from candidate node devices S+1 to M, thereby selecting K target node devices as proxy nodes.
[0049] In step S214, the terminal device establishes GATT connections with multiple target node devices, so that the multiple target node devices become multiple proxy nodes of the terminal device.
[0050] After determining multiple target node devices, the terminal device can establish GATT connections with the multiple target node devices, so that the multiple target node devices can be connected through GATT and become multiple proxy nodes of the terminal device, and then the terminal device can send and receive messages of the Bluetooth Mesh network through multiple proxy nodes. It can be understood that the terminal device can improve the performance of sending and receiving messages of the terminal device through multiple proxy nodes, and avoid the performance bottleneck of sending and receiving messages of a single proxy node; at the same time, since the distances of multiple proxy nodes relative to the terminal device are different, the connection between the terminal device and the proxy node is not easy to disconnect during the movement of the terminal device, which can reduce the disconnection interference during the movement of the terminal device and improve the stability of the terminal device accessing the Bluetooth Mesh network.
[0051] In some embodiments, when the embodiments of the present application implement the establishment of GATT connections between a terminal device and multiple target node devices, the terminal device may establish GATT connections with the multiple target node devices in sequence; that is, the terminal device may perform mutually exclusive operations when establishing GATT connections with multiple target node devices, that is, the terminal device may gradually and sequentially establish a GATT connection with each target node device. For example, after the terminal device establishes a GATT connection with the previous target node device, it establishes a GATT connection with the next target node device until the terminal device establishes GATT connections with multiple target node devices.
[0052] As an optional implementation, the terminal device may randomly select a target node device that is currently connected to GATT, and establish a GATT connection with the selected target node device, thereby establishing GATT connections with multiple target node devices in sequence by random selection. For example, the terminal device may randomly select a target node device from target node devices that have not established a GATT connection, and establish a GATT connection with the selected target node device, and in this way, establish GATT connections with multiple target node devices in sequence until there is no target node device that has not established a GATT connection.
[0053] As an optional implementation, the terminal device may establish GATT connections with the target node devices in order from near to far or from far to near, until the terminal device completes establishing GATT connections with multiple target node devices.
[0054] As an example, Figure 4 The example diagram of a terminal device establishing multiple GATT connections is shown exemplarily, which can be used for reference. Figure 4 As shown, the terminal device can connect to K proxy nodes through K GATT connections; for example, the terminal device can connect to the proxy node 41 in the Bluetooth Mesh network through GATT connection 401; the terminal device can connect to the proxy node 42 in the Bluetooth Mesh network through GATT connection 402, and similarly, the terminal device can connect to the proxy node 4K in the Bluetooth Mesh network through GATT connection 40K; thus, the terminal device can connect to K proxy nodes 41 to 4K through K GATT connections 401 to 40K, and then the terminal device can send and receive messages of the Bluetooth Mesh network through K proxy nodes 41 to 4K.
[0055] In the proxy node connection method provided in the embodiment of the present application, the terminal device can scan the candidate node devices that can serve as proxy nodes in the Bluetooth Mesh network, thereby selecting multiple target node devices at different distances from the candidate node devices according to the signal strength of the candidate node devices; and then the terminal device can establish a GATT connection with multiple target node devices, so that the multiple target node devices become multiple proxy nodes of the terminal device, so that the terminal device can send and receive messages of the Bluetooth Mesh network through multiple proxy nodes. The embodiment of the present application can establish a GATT connection between the terminal device and multiple target node devices at different distances in the Bluetooth Mesh network through the multi-GATT connection characteristics of the terminal device, so as to realize the terminal device to send and receive messages through multiple proxy nodes. It can be seen that the terminal device can improve the performance of the terminal device in sending and receiving messages through multiple proxy nodes by sending and receiving messages of the Bluetooth Mesh network through multiple proxy nodes, and avoid the performance bottleneck of a single proxy node in sending and receiving messages; at the same time, since the distances of the multiple proxy nodes relative to the terminal device are different, the connection between the terminal device and the proxy node is not easy to disconnect during the movement of the terminal device, which can reduce the disconnection interference during the movement of the terminal device and improve the stability of the terminal device accessing the Bluetooth Mesh network.
[0056] In some further embodiments, due to the Proxy Relay feature of the Bluetooth Mesh network, after the terminal device is connected to multiple proxy nodes, the multiple proxy nodes may forward messages sent by the same node device in the Bluetooth Mesh network to the terminal device, resulting in the terminal device receiving multiple identical duplicate messages from the same node device through multiple proxy nodes. It should be noted that the relay feature of the Bluetooth Mesh network refers to the relay of messages between node devices to increase the distance of message transmission, thereby adapting to the scale expansion of the Bluetooth Mesh network; when the terminal device has multiple proxy nodes, since multiple proxy nodes realize the message reception and transmission between the terminal device and the node device, and each proxy node has the situation of relaying messages, multiple proxy nodes may pass the messages sent by the same node device to the terminal device through relaying, resulting in the terminal device receiving duplicate messages from the same node device.
[0057] Based on this, when a terminal device receives a message sent by a node device through multiple proxy nodes, it can deduplicate the message. As an optional implementation, when a terminal device receives a message sent by a node device through multiple proxy nodes, it can determine duplicate messages based on the source address (Source Address) and sequence number (Sequence Number) of the message, thereby deduplicating the duplicate messages. For example, when a terminal device receives a message sent by a node device through multiple proxy nodes, multiple messages with the same source address and the same sequence number can be determined as duplicate messages, thereby deduplicating the duplicate messages.
[0058] In some further embodiments, the proxy node has a read data channel and a write data channel; the terminal device can send messages to the Bluetooth Mesh network through the write data channel of the proxy node (that is, through the write data channel of the proxy node, the terminal device can send downlink messages to the node device in the Bluetooth Mesh network); the terminal device can receive messages sent by the Bluetooth Mesh network through the read data channel of the proxy node (that is, through the read data channel of the proxy node, the terminal device can receive uplink messages sent by the node device in the Bluetooth Mesh network); the terminal device sends downlink messages and receives uplink messages through the proxy node, so that the terminal device can send and receive messages in the Bluetooth Mesh network through the proxy node. However, in the case where the terminal device is connected to multiple proxy nodes, if the uplink messages of the Bluetooth Mesh network are all forwarded to the terminal device through multiple proxy nodes, the messages received by the terminal device will be too redundant, and the large number of messages received by the terminal device will occupy a large Bluetooth bandwidth.
[0059] Based on this, in the embodiment of the present application, when a terminal device is connected to multiple proxy nodes, the ability of multiple proxy nodes to read and write data can be dynamically set to avoid multiple proxy nodes forwarding uplink messages of the Bluetooth Mesh network to the terminal device, thereby reducing the redundancy of the terminal device receiving messages and reducing the Bluetooth bandwidth occupancy of the terminal device.
[0060] As an optional implementation, Figure 5 The flowchart of the method for performing read and write configuration for multiple proxy nodes after the terminal device is connected to multiple proxy nodes is shown as an example. The method flow can be implemented by the terminal device and the proxy node. Figure 5 The method flow may include the following steps.
[0061] In step S510, the terminal device selects proxy nodes of the first part from a plurality of proxy nodes.
[0062] In step S511, the terminal device sends an enable command of the notification attribute to the proxy node of the first part.
[0063] In step S512, the proxy node of the first part enables the notification attribute according to the enable command to use the read data channel.
[0064] The proxy node sends the uplink message of the Bluetooth Mesh network to the terminal device through the read data channel. In the embodiment of the present application, when the terminal device is connected to multiple proxy nodes, the read data channels of some proxy nodes can be used, while the read data channels of other proxy nodes are not used, so that the proxy nodes that do not use the read data channels do not send the uplink message of the Bluetooth Mesh network to the terminal device; that is, the terminal device receives the uplink message of the Bluetooth Mesh network by using some proxy nodes of the read data channel, thereby reducing the redundancy of the terminal device receiving the message and reducing the Bluetooth bandwidth occupancy of the terminal device.
[0065] For ease of explanation, in the embodiment of the present application, the proxy nodes that use the read data channel among the multiple proxy nodes connected to the terminal device may be referred to as the proxy nodes of the first part; and the proxy nodes that do not use the read data channel among the multiple proxy nodes connected to the terminal device may be referred to as the proxy nodes of the second part; that is, the proxy nodes of the first part that use the read data channel and the proxy nodes of the second part that do not use the read data channel form the multiple proxy nodes connected to the terminal device.
[0066] In some embodiments, the embodiment of the present application may use half of the proxy nodes among the plurality of proxy nodes as the proxy nodes that use the first part of the read data channel; that is, the proxy nodes in the first part may be half of the proxy nodes among the plurality of proxy nodes connected to the terminal device. For example, assuming that the terminal device is connected to K proxy nodes, the embodiment of the present application may use K / 2 proxy nodes as the proxy nodes that use the first part of the read data channel.
[0067] In other embodiments, the number of proxy nodes in the first part may be smaller than the number of proxy nodes in the second part, or the number of proxy nodes in the first part may be greater than the number of proxy nodes in the second part.
[0068] In some embodiments, the embodiments of the present application may randomly select a proxy node that uses the first part of the read data channel from multiple proxy nodes; or may select a proxy node that uses the first part of the read data channel from multiple proxy nodes based on the distance of the proxy nodes, and the distances of the proxy nodes in the first part are different.
[0069] As an optional implementation, since the proxy nodes of the first part use the read data channel and the proxy nodes of the second part do not use the read data channel, in order to enable the proxy nodes of the first part using the read data channel to send the uplink message to the terminal device as completely as possible and to ensure that the uplink message sent to the terminal device has a low redundancy, the embodiment of the present application can consider the characteristics of the proxy nodes of the first part using the read data channel from the perspective of the node devices radiated by the proxy nodes of the first part and the node devices overlapped and crossed by the proxy nodes of the first part. The node devices radiated by the proxy nodes of the first part can be regarded as node devices in the Bluetooth Mesh network where the uplink message can reach the proxy nodes of the first part; based on multiple proxy nodes of the first part, the node devices overlapped and crossed by the proxy nodes of the first part can be regarded as repeated node devices in the node devices radiated by the proxy nodes of the first part. In an implementation example, the proxy nodes of the first part can have the following characteristics: the proxy nodes of the first part can radiate all the node devices in the Bluetooth Mesh network, and the number of overlapping and crossed node devices in the node devices radiated by the proxy nodes of the first part is less than the number of overlapping and crossed node devices of the proxy nodes of the second part.
[0070] In some embodiments, when the proxy node uses the read data channel, it needs to call the system interface to enable the notification attribute of the device. That is to say, after the notification attribute of the proxy node is enabled, the proxy node can use the read data channel, so that the proxy node can convey the uplink message of the Bluetooth Mesh network to the terminal device through the Notification method. If the proxy node does not call the system interface to enable the notification attribute of the device, the proxy node will not send the uplink message of the Bluetooth Mesh network to the terminal device. Based on this, after the terminal device selects the proxy node of the first part that uses the read data from multiple proxy nodes, the terminal device can send an enable command of the notification attribute to the proxy node of the first part; thus, after the proxy node of the first part obtains the enable command, it can enable the notification attribute of the device according to the enable command, so that the proxy node of the first part uses the read data channel; and then the terminal device can receive the uplink message of the Bluetooth Mesh network by using the proxy node of the first part of the read data channel; at the same time, the proxy node of the second part that does not enable the notification attribute and does not use the read data channel does not send the uplink message of the Bluetooth Mesh network to the terminal device, thereby achieving the effect of reducing the data transmission load of the Bluetooth Mesh network, so that the redundancy of the terminal device receiving the message and the Bluetooth bandwidth occupancy of the terminal device are reduced.
[0071] In one example, Figure 4Taking the example of a terminal device connecting K proxy nodes as an example, the terminal device can select K / 2 proxy nodes to enable the notification attribute of the device, while the other K / 2 proxy nodes do not enable the notification attribute of the device; thus, the K / 2 proxy nodes with the notification attribute enabled can be used as read-write proxy nodes of the terminal device, used to send the uplink message of the Bluetooth Mesh network to the terminal device, and send the downlink message of the terminal device to the Bluetooth Mesh network; the K / 2 proxy nodes without the notification attribute enabled can be used as write proxy nodes of the terminal device, used to send the downlink message of the terminal device to the Bluetooth Mesh network, but not send the uplink message of the Bluetooth Mesh network to the terminal device. In an example, assuming that the terminal device is connected to 3 proxy nodes, the first proxy node can enable the notification attribute of the device and serve as the read-write proxy node of the terminal device, the second proxy node can not enable the notification attribute of the device and serve as the write proxy node of the terminal device, and the third proxy node can enable the notification attribute of the device and serve as the read-write proxy node of the terminal device. Here, the order of the proxy nodes can be sorted from near to far according to the distance of the proxy nodes.
[0072] It should be noted that if the notification attribute of the proxy node is not enabled, the proxy node uses the write data channel to send the downlink message of the terminal device to the node device in the Bluetooth Mesh network, and the proxy node does not use the read data channel and does not send the uplink message of the Bluetooth Mesh network to the terminal device.
[0073] In the case where a terminal device is connected to multiple proxy nodes, the embodiment of the present application can strategically separate read and write of the multiple proxy nodes, so that the proxy nodes of the first part of the multiple proxy nodes send both the downlink message of the terminal device and the uplink message of the Bluetooth Mesh network to the terminal device; at the same time, for the proxy nodes of the second part of the multiple proxy nodes, the proxy nodes of the second part only send the downlink message of the terminal device to the Bluetooth Mesh network, and do not send the uplink message of the Bluetooth Mesh network to the terminal device. Through the above-mentioned read-write separation setting of the proxy node, the embodiment of the present application can reduce the data transmission load of the Bluetooth Mesh network, reduce the message redundancy of the terminal device and the Bluetooth bandwidth occupancy.
[0074] In some further embodiments, after the terminal device is connected to multiple proxy nodes, the configuration of the node device can be performed in parallel through the multiple proxy nodes, thereby improving the configuration speed of the node device. As an optional implementation, Figure 6 The flowchart of the method for configuring the node device after the terminal device is connected to multiple proxy nodes is shown as an example. The method flow can be implemented by the terminal device and the proxy node. Figure 6 The method flow may include the following steps.
[0075] In step S610, the terminal device determines the configuration message of the node device.
[0076] The terminal device can obtain the configuration information of the node device from the cloud server or user operation. The configuration information of the node information can be used for configuration operations of the node device, such as multicast configuration of the node device.
[0077] In step S611, the terminal device records the configuration message in a preset message queue.
[0078] The terminal device may pre-set a message queue, which may be used to uniformly record configuration messages of the node devices. In some embodiments, when a user needs to configure a node device, the terminal device may determine the configuration message of the node device and record the configuration message in a preset message queue.
[0079] In step S612, the terminal device extracts configuration messages from the message queue in sequence.
[0080] The configuration messages recorded in the message queue can be extracted in sequence and sent to multiple proxy nodes connected to the terminal device, so that multiple proxy nodes send the configuration messages to the node devices to realize parallel configuration of the node devices. In some embodiments, the configuration messages in the message queue can be extracted in sequence, for example, according to the order in which the configuration messages are recorded in the message queue, the configuration messages are extracted one by one from the message queue. In other embodiments, the configuration messages in the message queue can be extracted according to the configuration priority, for example, according to the configuration priority order of the configuration messages recorded in the message queue, the embodiment of the present application can extract the configuration messages from the message queue one by one in sequence.
[0081] As an optional implementation, the terminal device may be provided with a message distributor, so that the configuration messages are sequentially extracted from the message queue through the message distributor.
[0082] In step S613, the terminal device sends the extracted configuration message to multiple proxy nodes in a balanced manner.
[0083] In step S614, the proxy node sends the configuration message to the node devices in the Bluetooth Mesh network; wherein the data volume of the configuration messages sent by the multiple proxy nodes is in a balanced state.
[0084] The terminal device can send the extracted configuration message to multiple connected proxy nodes in a balanced manner, so that the proxy node can send the received configuration message to the node device in the Bluetooth Mesh network, so that the node device is configured based on the configuration message. Since the terminal device sends the extracted configuration message to multiple proxy nodes in a balanced manner, and the data volume of the configuration message sent by each proxy node is in a balanced state, multiple proxy nodes can send multiple configuration messages to the node device in a balanced manner, thereby realizing parallel configuration of the node device.
[0085] In some embodiments, the configuration message may carry the device address of the node device to be configured. After obtaining the configuration message sent by the terminal device, the proxy node may send the configuration message to the node device corresponding to the device address according to the device address carried in the configuration message. As an optional implementation, the proxy node may send the configuration message to the Bluetooth Mesh network and forward it between the node devices in the Bluetooth Mesh network; based on the device address carried in the configuration message, when the configuration message is forwarded to the node device corresponding to the device address, the node device may be configured based on the obtained configuration message.
[0086] Taking multicast configuration as an example, after the terminal device records the multicast configuration message in the message queue, if the terminal device extracts the multicast configuration message from the message queue, the terminal device can send the multicast configuration message to the proxy node; the proxy node that receives the multicast configuration message can send the multicast configuration message to the node device in the Bluetooth Mesh network; thus, the multicast configuration message will be forwarded between the node devices in the Bluetooth Mesh network. At the same time, based on the device address carried in the multicast configuration message, when the multicast configuration message is forwarded to the node device corresponding to the device address, the node device can perform multicast configuration based on the obtained multicast configuration message.
[0087] In some embodiments, the embodiments of the present application may consider the load conditions of multiple proxy nodes (the load conditions of the proxy nodes may indicate the data volume of the configuration messages that the proxy nodes have sent down), and balance the amount of configuration messages sent down, so that the data volume of the configuration messages sent down by the multiple proxy nodes is in a balanced state. As an optional implementation, after extracting a configuration message from the message queue, the terminal device may determine the load conditions of each proxy node (for example, determine the data volume of the configuration messages that each proxy node has sent down); thus, the terminal device may select at least one proxy node from the multiple proxy nodes according to the load conditions of each proxy node, and send the extracted configuration message to the at least one proxy node, so that the data volume of the configuration messages sent down by the multiple proxy nodes is in a balanced state. For example, the terminal device may select at least one proxy node with the lowest load condition from the multiple proxy nodes according to the load conditions of each proxy node, and send the extracted configuration message to the at least one proxy node, so that the data volume of the configuration messages sent down by the multiple proxy nodes to which the terminal device is connected is in a balanced state.
[0088] In an example, assuming that a terminal device has multiple configuration messages that need to be sent to a node device, based on the load balancing considerations of multiple proxy nodes, an embodiment of the present application can enable multiple proxy nodes to send configuration messages in a balanced manner, thereby improving the speed and stability of sending configuration messages; stability refers to ensuring that the data volume of the configuration messages sent by each proxy node at the same time is not too large (for example, ensuring that the data volume of the configuration messages sent by each proxy node at the same time is not greater than the data volume threshold), thereby reducing the probability of configuration messages being lost during transmission.
[0089] The embodiment of the present application is based on the multi-GATT connection feature of the terminal device, which enables the terminal device to connect to multiple proxy nodes by establishing multiple GATT connections, so that the terminal device can send and receive messages of the Bluetooth Mesh network through multiple proxy nodes, thereby improving the performance of the terminal device in sending and receiving messages; at the same time, since the distances of the multiple proxy nodes relative to the terminal device are different, the stability of the terminal device accessing the Bluetooth Mesh network can be improved.
[0090] The following is an introduction to the proxy node connection device provided in the embodiment of the present application. The proxy node connection device described below can be considered as a terminal device, which is a functional module required to implement the proxy node connection method provided in the embodiment of the present application. The device content described below can be referenced to the method content described above.
[0091] As an optional implementation, Figure 7 An exemplary block diagram of a proxy node connection device provided in an embodiment of the present application is shown. The device can be applied to a terminal device. Figure 7 , the device may include:
[0092] The scanning module 710 is used to scan candidate node devices that can serve as proxy nodes in the Bluetooth Mesh network;
[0093] A distance determination module 711 is used to determine the distance of the candidate node relative to the terminal device according to the signal strength of the candidate node device;
[0094] A target node determination module 712 is used to select a plurality of target node devices at different distances from the candidate node devices;
[0095] The connection establishment module 713 is used to establish GATT connections with multiple target node devices so that the multiple target node devices become multiple proxy nodes of the terminal device; wherein the terminal device sends and receives messages of the Bluetooth Mesh network through the proxy node.
[0096] In some embodiments, the target node determination module 712, for selecting a plurality of target node devices at different distances from the candidate node devices, comprises:
[0097] Selecting a first number of target node devices from candidate node devices whose distances relative to the terminal device are less than a distance threshold;
[0098] And, selecting a second number of target node devices from candidate node devices whose distance relative to the terminal device is greater than a distance threshold; the first number of target node devices and the second number of target node devices form the multiple target node devices.
[0099] In some embodiments, the target node determination module 712, configured to select a first number of target node devices from candidate node devices whose distances relative to the terminal device are less than a distance threshold, includes:
[0100] A first number of target node devices are randomly selected from candidate node devices whose distance is less than a distance threshold; or a first number of target node devices are selected at intervals from candidate node devices whose distance is less than a distance threshold in an order of distance from near to far or from far to near.
[0101] In some embodiments, the target node determination module 712, configured to select a second number of target node devices from candidate node devices whose distances relative to the terminal device are greater than a distance threshold, includes:
[0102] A second number of target node devices are randomly selected from candidate node devices whose distance is greater than the distance threshold; or, a second number of target node devices are selected from candidate node devices whose distance is greater than the distance threshold in order of distance from near to far or from far to near.
[0103] In some embodiments, the device may also be used to:
[0104] Receive messages sent by node devices of the Bluetooth Mesh network through the multiple proxy nodes;
[0105] Determine multiple messages with the same source address and the same sequence number as duplicate messages;
[0106] De-duplicate duplicate messages.
[0107] In some embodiments, the scanning module 710 is used to scan candidate node devices that can serve as proxy nodes in the Bluetooth Mesh network, including:
[0108] Acquire a broadcast packet sent by a node device of a Bluetooth Mesh network; identify whether a characteristic field of the broadcast packet carries a proxy characteristic bit, where the proxy characteristic bit is used to indicate that the node device sending the broadcast packet can serve as a proxy node; and determine a node device whose characteristic field of the broadcast packet carries the proxy characteristic bit as a candidate node device.
[0109] In some embodiments, the device may also be used to:
[0110] Selecting a first portion of proxy nodes from the plurality of proxy nodes;
[0111] Sending an enable command of a notification attribute to the proxy nodes of the first part, so that the proxy nodes of the first part enable the notification attribute according to the enable command;
[0112] Among them, the first part of the proxy nodes that enable the notification attribute use the read data channel and send the uplink message of the Bluetooth Mesh network to the terminal device; the second part of the proxy nodes that do not enable the notification attribute among the multiple proxy nodes do not use the read data channel and do not send the uplink message of the Bluetooth Mesh network to the terminal device.
[0113] In some embodiments, the device may also be used to:
[0114] Determine the configuration message of the node device and record the configuration message in a preset message queue; extract the configuration message from the message queue in sequence; send the extracted configuration message to multiple proxy nodes in a balanced manner, so that the proxy nodes receiving the configuration message send the configuration message to the node devices in the Bluetooth Mesh network; wherein the data volume of the configuration messages sent by the multiple proxy nodes is in a balanced state.
[0115] In some embodiments, the apparatus for sending the extracted configuration message to multiple proxy nodes in a balanced manner includes:
[0116] Determine the load condition of each proxy node, wherein the load condition of the proxy node indicates the data volume of the configuration message that has been sent by the proxy node; select at least one proxy node from the multiple proxy nodes according to the load condition of each proxy node, and send the extracted configuration message to the at least one proxy node, so that the data volume of the configuration message sent by the multiple proxy nodes is in a balanced state.
[0117] In an optional implementation, the terminal device may be configured with the above-mentioned proxy node connection device to implement the proxy node connection method provided in the embodiment of the present application. Figure 8 An optional block diagram of a terminal device is shown as an example. Figure 8 As shown, the terminal device may include: at least one processor 81, at least one communication interface 82, at least one memory 83 and at least one communication bus 84.
[0118] In the embodiment of the present application, the number of the processor 81 , the communication interface 82 , the memory 83 , and the communication bus 84 is at least one, and the processor 81 , the communication interface 82 , and the memory 83 communicate with each other through the communication bus 84 .
[0119] Optionally, the communication interface 82 may be an interface of a communication module for network communication. Optionally, the processor 81 may be a CPU, a GPU (Graphics Processing Unit), an NPU (embedded neural network processor), an FPGA (Field Programmable Gate Array), a TPU (tensor processing unit), an AI chip, an ASIC (Application Specific Integrated Circuit), or one or more integrated circuits configured to implement the embodiments of the present application.
[0120] The memory 83 may include a high-speed RAM memory, and may also include a non-volatile memory (non-volatile memory), such as at least one disk memory.
[0121] Among them, the memory 83 stores one or more computer-executable instructions, and the processor 81 calls the one or more computer-executable instructions to execute the proxy node connection method provided in the embodiment of the present application.
[0122] An embodiment of the present application also provides a storage medium, which stores one or more computer-executable instructions. When the one or more computer-executable instructions are executed, the proxy node connection method provided in the embodiment of the present application is implemented.
[0123] The embodiment of the present application also provides a computer program, which, when executed, implements the proxy node connection method provided in the embodiment of the present application.
[0124] The above describes multiple embodiments provided by the embodiments of the present application, and each optional method introduced in each embodiment can be combined and cross-referenced with each other without conflict, thereby extending a variety of possible embodiments, which can be considered as embodiments disclosed and disclosed by the embodiments of the present application. Although the embodiments of the present application are disclosed as above, the present application is not limited thereto. Any person skilled in the art can make various changes and modifications without departing from the spirit and scope of the present application, so the scope of protection of the present application should be based on the scope defined by the claims.
Claims
1. A proxy node connection method, in, Applied to terminal equipment, including: Scan the Bluetooth Mesh network for candidate node devices that can serve as proxy nodes; Determine the distance of the candidate node relative to the terminal device according to the signal strength of the candidate node device; Select multiple target node devices at different distances from the candidate node devices; Establishing GATT connections with multiple target node devices so that the multiple target node devices become multiple proxy nodes of the terminal device; wherein the terminal device sends and receives messages of the Bluetooth Mesh network through the proxy nodes; The step of selecting a plurality of target node devices at different distances from the candidate node devices comprises: Selecting a first number of target node devices from candidate node devices whose distances relative to the terminal device are less than a distance threshold; And, selecting a second number of target node devices from candidate node devices whose distance relative to the terminal device is greater than a distance threshold; the first number of target node devices and the second number of target node devices form the multiple target node devices.
2. The method according to claim 1, in, The selecting a first number of target node devices from candidate node devices whose distances relative to the terminal device are less than a distance threshold comprises: Randomly select a first number of target node devices from candidate node devices whose distances are less than a distance threshold; or, from candidate node devices whose distances are less than a distance threshold, select the first number of target node devices at intervals in the order of distance from near to far or from far to near; The selecting a second number of target node devices from the candidate node devices whose distances relative to the terminal device are greater than the distance threshold comprises: A second number of target node devices are randomly selected from candidate node devices whose distance is greater than the distance threshold; or, a second number of target node devices are selected from candidate node devices whose distance is greater than the distance threshold in order of distance from near to far or from far to near.
3. The method according to claim 1, in, Also includes: Receive messages sent by node devices of the Bluetooth Mesh network through the multiple proxy nodes; Determine multiple messages with the same source address and the same sequence number as duplicate messages; De-duplicate duplicate messages.
4. The method according to claim 1, in, The candidate node devices that can be used as proxy nodes in the scanning Bluetooth Mesh network include: Get the broadcast packets sent by the node devices of the Bluetooth Mesh network; Identify whether the characteristic field of the broadcast packet carries a proxy characteristic bit, where the proxy characteristic bit is used to indicate that the node device sending the broadcast packet can serve as a proxy node; A node device whose characteristic field of the broadcast packet carries a proxy characteristic bit is determined as a candidate node device.
5. The method according to claim 1, in, Also includes: Selecting a first portion of proxy nodes from the plurality of proxy nodes; Sending an enable command of a notification attribute to the proxy nodes of the first part, so that the proxy nodes of the first part enable the notification attribute according to the enable command; Among them, the first part of the proxy nodes that enable the notification attribute use the read data channel and send the uplink message of the Bluetooth Mesh network to the terminal device; the second part of the proxy nodes that do not enable the notification attribute among the multiple proxy nodes do not use the read data channel and do not send the uplink message of the Bluetooth Mesh network to the terminal device.
6. The method according to claim 1, in, Also includes: Determine the configuration message of the node device and record the configuration message in a preset message queue; Extract configuration messages from the message queue in sequence; The extracted configuration message is sent to multiple proxy nodes in a balanced manner, so that the proxy node receiving the configuration message sends the configuration message to the node device in the Bluetooth Mesh network; wherein the data volume of the configuration message sent by the multiple proxy nodes is in a balanced state.
7. The method according to claim 6, in, The step of sending the extracted configuration message to multiple proxy nodes in a balanced manner includes: Determine the load condition of each proxy node, wherein the load condition of the proxy node indicates the data volume of the configuration message sent by the proxy node; At least one proxy node is selected from the multiple proxy nodes according to the load conditions of the proxy nodes, and the extracted configuration message is sent to the at least one proxy node, so that the data volume of the configuration messages sent by the multiple proxy nodes is in a balanced state.
8. A terminal device, in, It comprises at least one memory and at least one processor, wherein the memory stores one or more computer executable instructions, and the processor calls the one or more computer executable instructions to execute the proxy node connection method as described in any one of claims 1-7.
9. A storage medium, in, The storage medium stores one or more computer executable instructions, and when the one or more computer executable instructions are executed, the proxy node connection method according to any one of claims 1 to 7 is implemented.
