Broadcast packet transmission control method, terminal device, Bluetooth Mesh device and storage medium
By introducing a packet transmission interval control package into the Bluetooth Mesh network, dynamically adjusting the packet transmission interval time of Bluetooth Mesh devices, solving the problem of low connection success rate between terminal devices and Bluetooth Mesh devices in large-scale Bluetooth Mesh networks, achieving higher connection success rate and lower signal interference.
Patent Information
- Application Number
- CN202210973908.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-08-15
- Publication Date
- 2025-03-18
- Estimated Expiration
- 2042-08-15
AI Technical Summary
In large-scale Bluetooth Mesh networks, the connection success rate between terminal devices and Bluetooth Mesh devices is low, mainly due to signal interference and the high frequency of connecting broadcast packets.
By introducing a packet transmission interval control packet between the terminal device and the Bluetooth Mesh device, the packet transmission interval time of the Bluetooth Mesh device sending a connection broadcast packet is dynamically adjusted, so that the packet transmission interval time of the target Bluetooth Mesh device is smaller than the packet transmission interval time of the non-target Bluetooth Mesh device, thereby reducing signal interference and improving the connection success rate.
It effectively improves the connection success rate between the terminal device and the target Bluetooth Mesh device, reduces signal interference, and ensures that the terminal device can quickly discover and connect to the target Bluetooth Mesh device.
Smart Images

Figure CN115442916B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of communication technology and specifically to a broadcast packet sending control method, a terminal device, a Bluetooth Mesh device, and a storage medium. Background Art
[0002] Bluetooth Mesh (wireless mesh) network is a mesh network that establishes inter-device communication based on BLE (Bluetooth Low Energy). It is widely used in smart home, smart office and other equipment intelligent interconnection scenarios. At present, after Bluetooth Mesh devices are powered on, they need to periodically send connection broadcast packets in a broadcasting manner so that terminal devices such as smartphones and tablets can discover Bluetooth Mesh devices and establish connections between terminal devices and Bluetooth Mesh devices. In this context, how to improve the connection success rate between terminal devices and Bluetooth Mesh devices is particularly important. Summary of the invention
[0003] In view of this, an embodiment of the present application provides a broadcast packet sending control method, a terminal device, a Bluetooth Mesh device and a storage medium to improve the connection success rate between the terminal device and the Bluetooth Mesh device.
[0004] To achieve the above objectives, the embodiments of the present application provide the following technical solutions.
[0005] In a first aspect, an embodiment of the present application provides a broadcast packet sending control method, which is applied to a terminal device, and the method includes:
[0006] Acquire a connection broadcast packet sent by the Bluetooth Mesh device at a set first packet sending interval, where the connection broadcast packet is used by the terminal device to discover the Bluetooth Mesh device so that the terminal device can establish a connection with the Bluetooth Mesh device;
[0007] Determine the target Bluetooth Mesh device to be connected from the Bluetooth Mesh devices that send the connection broadcast packet;
[0008] Generate a packet transmission interval control packet according to the target Bluetooth Mesh device; the packet transmission interval control packet is used to control the packet transmission interval time of the target Bluetooth Mesh device to be less than the packet transmission interval time of the non-target Bluetooth Mesh device to send the connection broadcast packet;
[0009] Send the packet transmission interval control packet to the Bluetooth Mesh device.
[0010] In a second aspect, an embodiment of the present application provides a broadcast packet sending control method, which is applied to a Bluetooth Mesh device, and the method includes:
[0011] Sending a connection broadcast packet at a set first packet sending interval, where the connection broadcast packet is used for a terminal device to discover the Bluetooth Mesh device so that the terminal device can establish a connection with the Bluetooth Mesh device;
[0012] Obtaining a packet transmission interval control packet sent by the terminal device;
[0013] According to the packet transmission interval control packet, the packet transmission interval time of sending the connection broadcast packet is adjusted so that the packet transmission interval time of sending the connection broadcast packet by the target Bluetooth Mesh device to be connected by the terminal device is less than the packet transmission interval time of sending the connection broadcast packet by the non-target Bluetooth Mesh device.
[0014] In a third 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 broadcast packet sending control method as described in the first aspect above.
[0015] In a fourth aspect, an embodiment of the present application provides a Bluetooth Mesh device, wherein the Bluetooth Mesh device is configured with one or more computer executable instructions, and when the one or more computer executable instructions are executed, the broadcast packet sending control method described in the second aspect above is implemented.
[0016] In a fifth 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 broadcast packet sending control method as described in the first aspect above is implemented, or the broadcast packet sending control method as described in the second aspect above is implemented.
[0017] In a sixth aspect, an embodiment of the present application provides a computer program, which, when executed, implements the broadcast packet sending control method as described in the first aspect above, or the broadcast packet sending control method as described in the second aspect above.
[0018] In the broadcast packet sending control method provided in the embodiment of the present application, the Bluetooth Mesh device may send a connection broadcast packet at a set first packet sending interval by default, and the connection broadcast packet is used for the terminal device to discover the Bluetooth Mesh device so that the terminal device can establish a connection with the Bluetooth Mesh device; when the terminal device currently needs to connect to the Bluetooth Mesh device, the terminal device can determine the target Bluetooth Mesh device to be connected from the Bluetooth Mesh device that sends the connection broadcast packet, thereby generating a packet sending interval control packet according to the target Bluetooth Mesh device, and sending the packet sending interval control packet to the Bluetooth Mesh device. The packet transmission interval control packet generated by the terminal device can be used to control the packet transmission interval time of the target Bluetooth Mesh device to send the connection broadcast packet, which is less than the packet transmission interval time of the non-target Bluetooth Mesh device to send the connection broadcast packet; thus, after receiving the packet transmission interval control packet, the Bluetooth Mesh device can adjust the packet transmission interval time according to the packet transmission interval control packet, so that the target Bluetooth Mesh device and the non-target Bluetooth Mesh device send the connection broadcast packet at different times, and the target Bluetooth Mesh device can send the connection broadcast packet at a higher frequency than the non-target Bluetooth Mesh device; furthermore, there may be connection broadcast packets corresponding to the target Bluetooth Mesh device broadcast at a higher frequency in the Bluetooth Mesh network, and the signal interference caused by the connection broadcast packets broadcast by the non-target Bluetooth Mesh device can be reduced. Based on this, the terminal device can quickly discover the current target Bluetooth Mesh device to be connected, and quickly establish a connection with the target Bluetooth Mesh device, thereby improving the connection success rate between the terminal device and the target Bluetooth Mesh device. It can be seen that the broadcast packet transmission control method provided in the embodiment of the present application can improve the connection success rate between the terminal device and the target Bluetooth Mesh device while ensuring that the terminal device quickly discovers the target Bluetooth Mesh device to be connected. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] 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.
[0020] Figure 1 This is an example diagram of a Bluetooth Mesh network.
[0021] Figure 2 A flowchart of a broadcast packet sending control method provided in an embodiment of the present application.
[0022] Figure 3A Example image of a page being scanned for a device.
[0023] Figure 3B This is an example of the node list page.
[0024] Figure 4 Another flowchart of the broadcast packet sending control method provided in an embodiment of the present application.
[0025] Figure 5 Another flowchart of the broadcast packet sending control method provided in an embodiment of the present application.
[0026] Figure 6 A block diagram of a broadcast packet sending control device provided in an embodiment of the present application.
[0027] Figure 7 A block diagram of a terminal device.
[0028] Figure 8 Another block diagram of the broadcast packet sending control device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0029] 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.
[0030] 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 101 that have been configured. Figure 1 As shown, the Bluetooth Mesh gateway 102 and the terminal device 103 act as control devices. In addition to configuring and controlling the provisioned node devices, they can also add the unprovisioned device 104 to the Bluetooth Mesh network through the Provisioning process.
[0031] Among them, the node device 101 can be regarded as a Bluetooth Mesh device that has joined the Bluetooth Mesh network; the unprovisioned device 104 can be regarded as a Bluetooth Mesh device that has not yet joined the Bluetooth Mesh network; the Bluetooth Mesh gateway 102 can be, for example, a smart speaker, a multi-mode gateway, etc. with Bluetooth communication capabilities and Internet connection capabilities. In addition to the configuration and control functions of the node device 101, the Bluetooth Mesh gateway 102 can also serve as a springboard for connecting the node device 101 to the Internet to achieve remote control of the node device; the terminal device 103 can be a user-side device such as a smart phone or tablet computer used by the user, which has the configuration and control functions of the node device 101, as well as the function of controlling the node device 101 through the Bluetooth Mesh gateway 102; in the configuration process of adding the unprovisioned device 104 to the Bluetooth Mesh network, the Bluetooth Mesh gateway or terminal device that performs Provisioning can be called a Provisioner (starting configuration device).
[0032] In a Bluetooth Mesh network, a Bluetooth Mesh gateway and Bluetooth Mesh devices (including networked node devices and unconfigured networked devices) can interact by directly sending broadcast packets. However, since terminal devices such as smartphones and tablets do not support the interaction method of directly sending broadcast packets, the terminal devices need to establish a proxy connection with the node devices in the Bluetooth Mesh network, so that the node devices acting as the proxy forward the broadcast packets to other node devices in the Bluetooth Mesh network. For example, the Bluetooth Mesh protocol stack defines the advertising bearer layer (Advertising Bearer) and the GATT (Generic Attribute Profile) bearer layer. Since terminal devices such as smartphones and tablets do not support the advertising bearer layer, the terminal devices need to perform the bearer layer conversion (conversion from the advertising bearer layer to the GATT bearer layer) through the node devices acting as the proxy, so that the terminal devices that do not support the advertising bearer layer can send and receive Bluetooth messages through the GATT connection.
[0033] Based on this, terminal devices such as smartphones and tablets need to establish a connection (such as establishing a GATT connection) with Bluetooth Mesh devices (including networked node devices and unprovisioned devices); in order for the terminal device to establish a connection with the Bluetooth Mesh device, the Bluetooth Mesh device needs to periodically send connection broadcast packets (such as GATT connection broadcast packets) after power-on, so that the terminal device can discover the Bluetooth Mesh device. In one example, for unprovisioned devices, after power-on, the unprovisioned devices can periodically broadcast PB (Provisioning Bearer, network configuration bearer mode)-GATT broadcast packets, so that the terminal device can discover the unprovisioned devices and establish a GATT connection; for configured node devices, after power-on, the node devices need to periodically broadcast Proxy broadcast packets, so that the terminal device can discover the node devices and establish a GATT connection.
[0034] In order to enable terminal devices to quickly discover Bluetooth Mesh devices and quickly establish connections, Bluetooth Mesh devices can periodically send connection broadcast packets with a shorter packet sending interval. In an example, Bluetooth Mesh devices can periodically send connection broadcast packets with a packet sending interval of 100 milliseconds, so that terminal devices such as smartphones can quickly discover Bluetooth Mesh devices and quickly establish connections.
[0035] However, in a large-scale Bluetooth Mesh network, if each Bluetooth Mesh device periodically sends connection broadcast packets at a short packet interval (for example, unconfigured devices periodically broadcast PB-GATT broadcast packets at a packet interval of 100 milliseconds; node devices periodically broadcast Proxy broadcast packets at a packet interval of 100 milliseconds), then there will be a large number of connection broadcast packets in the Bluetooth Mesh network, which will make it difficult for terminal devices to establish a connection with Bluetooth Mesh devices, affecting the connection success rate. Specifically, when each Bluetooth Mesh device sends a connection broadcast packet at a short packet interval, the large number of connection broadcast packets broadcast in the Bluetooth Mesh network will cause signal interference, thereby prolonging the time it takes for terminal devices to establish a connection with Bluetooth Mesh devices, making it difficult to establish a connection, and thus affecting the connection success rate.
[0036] On the other hand, if the packet transmission interval of the Bluetooth Mesh device is simply extended just to reduce the number of connection broadcast packets in the Bluetooth Mesh network, the speed at which the terminal device discovers the Bluetooth Mesh device will be slowed down, resulting in a longer time for the terminal device to establish a connection with the Bluetooth Mesh device.
[0037] It can be seen that, while ensuring that the terminal device can quickly discover the Bluetooth Mesh device, how to improve the connection success rate between the terminal device and the Bluetooth Mesh device is particularly important. Based on this, the embodiment of the present application dynamically adjusts the packet sending interval of the Bluetooth Mesh device sending the connection broadcast packet through an improved technical solution, so that the packet sending interval of the target Bluetooth Mesh device to be connected by the terminal device is less than the packet sending interval of the non-target Bluetooth Mesh device to which the terminal device is currently not connected, thereby staggering the time for the target Bluetooth Mesh device and the non-target Bluetooth Mesh device to send the connection broadcast packet, avoiding the existence of a large number of connection broadcast packets in the Bluetooth Mesh network at the same time, and then when the terminal device quickly discovers the target Bluetooth Mesh device to be connected, it can quickly establish a connection with the target Bluetooth Mesh device, thereby improving the connection success rate.
[0038] Based on the above ideas, Figure 2 The optional flow chart of the broadcast packet transmission control method provided in the embodiment of the present application is exemplarily shown. The method flow can be implemented by a terminal device and a Bluetooth Mesh device, wherein the Bluetooth Mesh device can include a node device that has been networked and an unnetworked device that has not been networked. Figure 2 The method flow may include the following steps.
[0039] In step S210, the Bluetooth Mesh device periodically sends a connection broadcast packet at a set first packet sending interval.
[0040] The connection broadcast packet referred to in the embodiment of the present application can be used for a terminal device to discover a Bluetooth Mesh device so that the terminal device can establish a connection with the Bluetooth Mesh device. Optionally, the connection broadcast packet may include a GATT connection broadcast packet, which is used by the terminal device to discover the Bluetooth Mesh device so that the terminal device can establish a GATT connection with the Bluetooth Mesh device. For example, when the Bluetooth Mesh device is an unconfigured device, the GATT connection broadcast packet may be a PB-GATT broadcast packet, which is used by the terminal device to discover the unconfigured device so that the terminal device can establish a GATT connection with the unconfigured device. For another example, when the Bluetooth Mesh device is a configured node device, the GATT connection broadcast packet may be a Proxy broadcast packet, which is used by the terminal device to discover the node device so that the terminal device can establish a GATT connection with the node device.
[0041] In some embodiments, after the Bluetooth Mesh device is powered on, it can periodically send connection broadcast packets at a set first packet sending interval so that the terminal device can discover the Bluetooth Mesh device. The first packet sending interval can be the default packet sending interval for the Bluetooth Mesh device to send connection broadcast packets set in the embodiment of the present application. The default packet sending interval of the Bluetooth Mesh device can be obtained through testing, and the specific value can be determined according to the actual test situation, and the embodiment of the present application is not limited. As an example, the default packet sending interval can be 160 milliseconds. For example, the Bluetooth Mesh device defaults to 160 milliseconds as the packet sending interval and periodically sends connection broadcast packets.
[0042] In step S211, the terminal device determines a target Bluetooth Mesh device to be connected from the Bluetooth Mesh devices that send the connection broadcast packet.
[0043] After the Bluetooth Mesh device periodically sends a connection broadcast packet at a first packet transmission interval, the terminal device can obtain the connection broadcast packet sent at the first packet transmission interval; thus, the terminal device can determine the target Bluetooth Mesh device to be connected from the Bluetooth Mesh device that sends the connection broadcast packet (the number of target Bluetooth Mesh devices can be one or more). In some embodiments, the target Bluetooth Mesh device can include a target unconfigured device to be connected that is not configured for the network, and can also include a target node device that is already configured for the network to be connected.
[0044] In some embodiments, the terminal device can scan the surrounding Bluetooth Mesh devices that send connection broadcast packets and display them on the APP (application) page, so that the user can select one or more target Bluetooth Mesh devices to be connected from the Bluetooth Mesh devices displayed on the page, so that the terminal device can determine the target Bluetooth Mesh device to be connected. It should be noted that the APP referred to in the embodiments of the present application can be an application for Bluetooth Mesh management, such as an APP that provides smart home, smart office and other equipment intelligent interconnection services.
[0045] As an optional implementation, if the target Bluetooth Mesh device is an unprovisioned target unprovisioned device, the terminal device can establish a connection with the target unprovisioned device (such as a GATT connection) to add the target unprovisioned device to the Bluetooth Mesh network. For example, the terminal device can scan the surrounding unprovisioned devices that send PB-GATT broadcast packets, and display the scanned unprovisioned devices through the device scanning page of the APP (application); so that the user can select the target unprovisioned device to be connected from the unprovisioned devices displayed on the device scanning page, and then the terminal device can establish a connection with the selected target unprovisioned device to add the target unprovisioned device to the Bluetooth Mesh network. In one example, Figure 3AAn example diagram of a device scanning page is shown as follows: Figure 3A As shown, the device scanning page can display the unprovisioned devices 311 to 31n in the surrounding area that send PB-GATT broadcast packets scanned by the terminal device. The user can select the currently connected target unprovisioned device from the unprovisioned devices 311 to 31n (the number of target unprovisioned devices can be one or more). Assuming that the user selects the unprovisioned device 312 as the target unprovisioned device, the terminal device can establish a connection with the unprovisioned device 312, thereby adding the unprovisioned device 312 to the Bluetooth Mesh network.
[0046] As an optional implementation, if the target Bluetooth Mesh device is a configured target node device, the terminal device can establish a connection with the target node device (such as a GATT connection) to use the target node device as a proxy node device. For example, the terminal device can display the configured node devices in the Bluetooth Mesh network through the node list page of the APP (application); so that the user can select the target node device to be connected from the node devices displayed on the node list page, and then the terminal device can establish a connection with the selected target node device, so as to use the target node device as a proxy node device. In one example, Figure 3B An example diagram of a node list page is shown as follows: Figure 3B As shown, the node list page can display the node devices 321 to 32m that have been configured in the Bluetooth Mesh network. The user can select the currently connected target node device from the node devices 321 to 32m (the number of target node devices can be one or more). Assuming that the user selects node device 322 as the target node device, the terminal device can establish a connection with node device 322, thereby using node device 322 as a proxy node device.
[0047] It should be noted that the above method of selecting the target Bluetooth Mesh device by the user is only an optional implementation method of determining the target Bluetooth Mesh device to be connected from the Bluetooth Mesh device that sends the connection broadcast packet in the embodiment of the present application. The embodiment of the present application can also support the terminal device to actively determine the target Bluetooth Mesh device from the Bluetooth Mesh device that sends the connection broadcast packet according to a certain strategy. As an optional implementation, the terminal device can determine the target Bluetooth Mesh device from the Bluetooth Mesh device that sends the connection broadcast packet according to the distance, signal strength and other properties of the Bluetooth Mesh device that sends the connection broadcast packet relative to the terminal device.
[0048] In one example, if the target Bluetooth Mesh device is an unprovisioned target unprovisioned device, the terminal device may select the target unprovisioned device based on the distance of the unprovisioned device that sends the PB-GATT broadcast packet relative to the terminal device (for example, selecting the target unprovisioned device in order of distance from near to far or from far to near); in another example, the terminal device may select the target unprovisioned device based on the signal strength of the unprovisioned device that sends the PB-GATT broadcast packet relative to the terminal device (for example, selecting the target unprovisioned device in order of signal strength from high to low or from low to high).
[0049] In other possible examples, if the target Bluetooth Mesh device is a target node device that has been networked, the terminal device can select the target node device according to the distance or signal strength of the node device relative to the terminal device. For example, the terminal device can select target node devices at different distances according to the distance of the node device relative to the terminal device; or the terminal device can select target node devices with different signal strengths according to the signal strength of the node device relative to the terminal device.
[0050] The embodiments of the present application do not limit the method of determining the target Bluetooth Mesh device to be connected from the Bluetooth Mesh device that sends the connection broadcast packet. The possible methods described above are only examples for ease of understanding.
[0051] In step S212, the terminal device generates a packet transmission interval control packet according to the target Bluetooth Mesh device.
[0052] In step S213, the terminal device sends the packet transmission interval control packet to the Bluetooth Mesh device.
[0053] In order to make the packet sending interval of the target Bluetooth Mesh device shorter than the packet sending interval of the non-target Bluetooth Mesh device, the terminal device can generate a packet sending interval control packet based on the determined target Bluetooth Mesh device, and send the packet sending interval control packet to the Bluetooth Mesh device so that the Bluetooth Mesh device adjusts the packet sending interval of sending the connection broadcast packet according to the packet sending interval control packet.
[0054] In some embodiments, the terminal device can reduce the packet sending interval of the target Bluetooth Mesh device and increase the packet sending interval of the non-target Bluetooth Mesh device through the packet sending interval control packet, thereby controlling the packet sending interval of the target Bluetooth Mesh device to be less than the packet sending interval of the non-target Bluetooth Mesh device.
[0055] In other embodiments, the terminal device can increase the packet sending interval of the non-target Bluetooth Mesh device through the packet sending interval control packet, while the packet sending interval of the target Bluetooth Mesh device is maintained at the set first packet sending interval, thereby controlling the packet sending interval of the target Bluetooth Mesh device to be less than the packet sending interval of the non-target Bluetooth Mesh device.
[0056] In some further embodiments, the terminal device may reduce the packet sending interval of the target Bluetooth Mesh device by sending a packet interval control packet, while maintaining the packet sending interval of the non-target Bluetooth Mesh device at the set first packet sending interval, thereby controlling the packet sending interval of the target Bluetooth Mesh device to be less than the packet sending interval of the non-target Bluetooth Mesh device.
[0057] In the above-mentioned different implementation methods, the packet sending interval of the target Bluetooth Mesh device is reduced, and the packet sending interval of the non-target Bluetooth Mesh device is increased. This can lengthen the staggered time for the target Bluetooth Mesh device and the non-target Bluetooth Mesh device to send the connection broadcast packet, which can better reduce the signal interference in the Bluetooth Mesh network and better improve the connection success rate between the terminal device and the target Bluetooth Mesh device. The other two implementation methods can also achieve a packet sending interval of the target Bluetooth Mesh device that is shorter than the packet sending interval of the non-target Bluetooth Mesh device, but these two implementation methods are to simply increase the packet sending interval of the non-target Bluetooth Mesh device, or to simply reduce the packet sending interval of the target Bluetooth Mesh device. Therefore, the staggered time for the target Bluetooth Mesh device and the non-target Bluetooth Mesh device to send connection broadcast packets needs to be based on the amplitude of the increase in the packet sending interval of the non-target Bluetooth Mesh device, or the amplitude of the reduction in the packet sending interval of the target Bluetooth Mesh device; based on this, the embodiments of the present application can select the amplitude of the reduction in the packet sending interval of the target Bluetooth Mesh device and the amplitude of the increase in the packet sending interval of the non-target Bluetooth Mesh device according to actual conditions, thereby ensuring the effect of reducing signal interference in the Bluetooth Mesh network.
[0058] As an optional implementation, when the Bluetooth Mesh device broadcasts the connection broadcast packet at the first packet transmission interval set by default, the embodiment of the present application can set a second packet transmission interval that is less than the first packet transmission interval, and a third packet transmission interval that is greater than the first packet transmission interval, so that when the packet transmission interval of the target Bluetooth Mesh device is reduced, the packet transmission interval of the target Bluetooth Mesh device is reduced to the second packet transmission interval; when the packet transmission interval of the non-target Bluetooth Mesh device is increased, the packet transmission interval of the non-target Bluetooth Mesh device is increased to the third packet transmission interval. Among them, the values of the second packet transmission interval and the third packet transmission interval can be determined according to actual conditions, and the embodiment of the present application is not limited.
[0059] Furthermore, if the second packet sending interval time after adjustment of the target Bluetooth Mesh device is set too small, or the third packet sending interval time after adjustment of the non-target Bluetooth Mesh device is set too large, it may also cause abnormal connection establishment between the terminal device and the Bluetooth Mesh device. Therefore, the embodiment of the present application may also set an adjustment lower limit for the second packet sending interval time and an adjustment upper limit for the third packet sending interval time, so as to avoid the second packet sending interval time being adjusted too small and the third packet sending interval time being adjusted too large.
[0060] As an optional implementation, the embodiment of the present application may set the difference between the second packet sending interval and the first packet sending interval to be smaller than the difference between the third packet sending interval and the first packet sending interval; thereby, when the Bluetooth Mesh device sends a connection broadcast packet with the default shorter first packet sending interval, the frequency of the target Bluetooth Mesh device sending the connection broadcast packet is increased by using the second packet sending interval having a smaller difference with the first packet sending interval, and / or, the frequency of the non-target Bluetooth Mesh device sending the connection broadcast packet is reduced by using the third packet sending interval having a larger difference with the first packet sending interval, thereby enabling the target Bluetooth Mesh device to send the connection broadcast packet at a faster frequency than the non-target Bluetooth Mesh device, thereby ensuring that the time for the target Bluetooth Mesh device and the non-target Bluetooth Mesh device to send the connection broadcast packet is staggered.
[0061] In one example, assuming that the default first packet transmission interval of the Bluetooth Mesh device is 160 milliseconds, the embodiment of the present application can set the second packet transmission interval to 100 milliseconds (for example, after adjusting the packet transmission interval, the target Bluetooth Mesh device sends connection broadcast packets with a packet transmission interval of 100 milliseconds), and set the third packet transmission interval to 1 second (for example, after adjusting the packet transmission interval, the non-target Bluetooth Mesh device sends connection broadcast packets with a packet transmission interval of 1 second). Thus, based on the default first packet transmission interval, the frequency of the target Bluetooth Mesh device sending connection broadcast packets is increased by using the second packet transmission interval with a smaller time difference, and / or the frequency of the non-target Bluetooth Mesh device sending connection broadcast packets is reduced by using the third packet transmission interval with a larger time difference. It should be noted that the specific values of the first packet transmission interval, the second packet transmission interval, and the third packet transmission interval shown in this paragraph are only an optional example.
[0062] In step S214, the Bluetooth Mesh device adjusts the packet sending interval of sending the connection broadcast packets according to the packet sending interval control packet, so that the packet sending interval of sending the connection broadcast packets by the target Bluetooth Mesh device is less than the packet sending interval of sending the connection broadcast packets by the non-target Bluetooth Mesh device.
[0063] After receiving the packet transmission interval control packet sent by the terminal device, the Bluetooth Mesh device can adjust the packet transmission interval according to the instruction of the packet transmission interval control packet, so that the packet transmission interval of the target Bluetooth Mesh device is less than the packet transmission interval of the non-target Bluetooth Mesh device, thereby achieving the effect of staggering the time for the target Bluetooth Mesh device and the non-target Bluetooth Mesh device to send connection broadcast packets; thereby, the connection broadcast packets corresponding to the target Bluetooth Mesh device that are broadcast at a higher frequency exist in the Bluetooth Mesh network, and the signal interference caused by the connection broadcast packets broadcast by the non-target Bluetooth Mesh device is reduced, so that the terminal device can quickly discover the target Bluetooth Mesh device to be connected, and quickly establish a connection with the target Bluetooth Mesh device, thereby improving the connection success rate between the terminal device and the target Bluetooth Mesh device.
[0064] In some embodiments, if the packet transmission interval control packet is used to indicate that the packet transmission interval of the target Bluetooth Mesh device is reduced and the packet transmission interval of the non-target Bluetooth Mesh device is increased, the Bluetooth Mesh device receiving the packet transmission interval control packet can determine whether it is the target Bluetooth Mesh device; if so, the target Bluetooth Mesh device is reduced; if not, the packet transmission interval is increased. Optionally, in the case where the packet transmission interval control packet indicates a reduced second packet transmission interval and an increased third packet transmission interval, if the Bluetooth Mesh device determines that it is the target Bluetooth Mesh device, the packet transmission interval can be adjusted to the second packet transmission interval; if the Bluetooth Mesh device determines that it is a non-target Bluetooth Mesh device, the packet transmission interval can be adjusted to the third packet transmission interval.
[0065] In other embodiments, if the packet transmission interval control packet is used to indicate an increase in the packet transmission interval of a non-target Bluetooth Mesh device, the Bluetooth Mesh device receiving the packet transmission interval control packet can determine whether it is a target Bluetooth Mesh device; if so, maintain the set first packet transmission interval; if not, increase the packet transmission interval. Optionally, in the case where the packet transmission interval control packet indicates an increased third packet transmission interval, if the Bluetooth Mesh device determines that it is a target Bluetooth Mesh device, maintain the set first packet transmission interval; if the Bluetooth Mesh device determines that it is a non-target Bluetooth Mesh device, the packet transmission interval can be adjusted to the third packet transmission interval.
[0066] In some further embodiments, if the packet transmission interval control packet is used to indicate the reduction of the packet transmission interval of the target Bluetooth Mesh device, the Bluetooth Mesh device receiving the packet transmission interval control packet can determine whether it is the target Bluetooth Mesh device; if so, the packet transmission interval is reduced; if not, the set first packet transmission interval is maintained. Optionally, in the case where the packet transmission interval control packet indicates a reduced second packet transmission interval, if the Bluetooth Mesh device determines that it is the target Bluetooth Mesh device, the packet transmission interval is adjusted to the second packet transmission interval; if the Bluetooth Mesh device determines that it is a non-target Bluetooth Mesh device, the set first packet transmission interval is maintained.
[0067] In a further optional implementation, in order to enable the Bluetooth Mesh device to determine whether it is the target Bluetooth Mesh device based on the packet interval control packet, the packet interval control packet sent by the terminal device should indicate the device identifier corresponding to the target Bluetooth Mesh device, and / or the device identifier corresponding to the non-target Bluetooth Mesh device. Since the number of target Bluetooth Mesh devices to be connected by the terminal device is less than the number of non-target Bluetooth Mesh devices, the embodiment of the present application may carry the device identifier corresponding to the target Bluetooth Mesh device in the packet interval control packet, so that the Bluetooth Mesh device can determine whether it is the target Bluetooth Mesh device by matching the device identifier. For ease of explanation, the embodiment of the present application may refer to the device identifier corresponding to the target Bluetooth Mesh device as the target device identifier. If the device identifier of the Bluetooth Mesh device matches the target device identifier carried by the packet interval control packet, the Bluetooth Mesh device can be determined to be the target Bluetooth Mesh device; if the device identifier of the Bluetooth Mesh device does not match the target device identifier, the Bluetooth Mesh device can be determined to be a non-target Bluetooth Mesh device.
[0068] As an optional implementation, the target device identifier corresponding to the target Bluetooth Mesh device can be determined by the terminal device from the connection broadcast packet broadcasted by the target Bluetooth Mesh device when determining the target Bluetooth Mesh device. In one example, the device identifier of the Bluetooth Mesh device can be the MAC (Media Access Control) address of the Bluetooth Mesh device. After the terminal device obtains the connection broadcast packet (such as a GATT connection broadcast packet) sent by the Bluetooth Mesh device, it can obtain the MAC address from the device information carried in the connection broadcast packet; thus, for the target Bluetooth Mesh device determined by the terminal device, the terminal device can obtain the corresponding target MAC address from the device information of the connection broadcast packet sent by the target Bluetooth Mesh device, so as to determine the target device identifier corresponding to the target Bluetooth Mesh device and carry it in the packet transmission interval control packet. In one example, the device information carried by the connection broadcast packet can be, for example, Device UUID (Universally Unique Identifier), and the terminal device can determine the MAC address of the Bluetooth Mesh device from the Device UUID.
[0069] In a further optional implementation, in order to reduce the space occupied by the target MAC address in the packet transmission interval control packet, the embodiment of the present application may use the lowest byte of the Mac address of the target Bluetooth Mesh device as the target MAC address corresponding to the target Bluetooth Mesh device.
[0070] In a further optional implementation, the packet transmission interval control packet may also carry a reduced packet transmission interval time (e.g., a second packet transmission interval time) and / or an increased packet transmission interval time (e.g., a third packet transmission interval time), so that the target Bluetooth Mesh device reduces the packet transmission interval time based on the instruction of the packet transmission interval control packet, and / or the non-target Bluetooth Mesh device increases the packet transmission interval time based on the instruction of the packet transmission interval control packet.
[0071] In a further optional implementation, in addition to carrying the target device identifier (such as the target MAC address), the second packet interval time, and the third packet interval time, the packet interval control packet may further carry a target verification identifier, which can be used to perform data legitimacy verification on the Bluetooth Mesh device; further, after receiving the packet interval control packet, the subsequent Bluetooth Mesh device may perform data legitimacy verification based on the target verification identifier carried by the packet interval control packet; after the data legitimacy verification passes, the Bluetooth Mesh device may determine whether it is the target Bluetooth Mesh device based on the target device identifier carried by the packet interval control packet; thereby, when the Bluetooth Mesh device is the target Bluetooth Mesh device, the Bluetooth Mesh device may adjust the packet interval time based on the second packet interval time carried by the packet interval control packet; when the Bluetooth Mesh device is a non-target Bluetooth Mesh device, the Bluetooth Mesh device may adjust the packet interval time based on the third packet interval time carried by the packet interval control packet.
[0072] As an optional implementation, for networked node devices, the target verification identifier for data legitimacy verification can be the target NID (Net ID, network identification number); for unconfigured devices that are not networked, the target verification identifier for data legitimacy verification can be the target PID (Product ID, product identification code).
[0073] In a further optional implementation, the terminal device may generate a packet transmission interval control packet when determining the target Bluetooth Mesh device to be connected; for example, each time the terminal device needs to connect to a Bluetooth Mesh device, it adjusts the packet transmission interval of the target Bluetooth Mesh device and / or the non-target Bluetooth Mesh device through the generated packet transmission interval control packet. In other possible implementations, the terminal device may also establish a connection with the target Bluetooth Mesh device after determining the target Bluetooth Mesh device to be connected, so that if a connection difficulty is detected during the connection establishment process, a packet transmission interval control packet is generated to adjust the packet transmission interval of the target Bluetooth Mesh device and / or the non-target Bluetooth Mesh device. In one example, as long as the terminal device makes a GATT connection once, a packet transmission interval control packet can be generated. It is only an optional implementation method that the terminal device first connects to the target Bluetooth Mesh device and generates a packet transmission interval control packet when a connection difficulty is detected. The embodiment of the present application does not limit the conditions for the terminal device to generate a packet transmission interval control packet, which can be determined according to actual conditions.
[0074] In the broadcast packet sending control method provided in the embodiment of the present application, the Bluetooth Mesh device may send a connection broadcast packet at a set first packet sending interval by default, and the connection broadcast packet is used for the terminal device to discover the Bluetooth Mesh device so that the terminal device can establish a connection with the Bluetooth Mesh device; when the terminal device currently needs to connect to the Bluetooth Mesh device, the terminal device can determine the target Bluetooth Mesh device to be connected from the Bluetooth Mesh device that sends the connection broadcast packet, thereby generating a packet sending interval control packet according to the target Bluetooth Mesh device, and sending the packet sending interval control packet to the Bluetooth Mesh device. The packet transmission interval control packet generated by the terminal device can be used to control the packet transmission interval time of the target Bluetooth Mesh device to send the connection broadcast packet, which is less than the packet transmission interval time of the non-target Bluetooth Mesh device to send the connection broadcast packet; thus, after receiving the packet transmission interval control packet, the Bluetooth Mesh device can adjust the packet transmission interval time according to the packet transmission interval control packet, so that the target Bluetooth Mesh device and the non-target Bluetooth Mesh device send the connection broadcast packet at different times, and the target Bluetooth Mesh device can send the connection broadcast packet at a higher frequency than the non-target Bluetooth Mesh device; furthermore, there may be connection broadcast packets corresponding to the target Bluetooth Mesh device broadcast at a higher frequency in the Bluetooth Mesh network, and the signal interference caused by the connection broadcast packets broadcast by the non-target Bluetooth Mesh device can be reduced. Based on this, the terminal device can quickly discover the current target Bluetooth Mesh device to be connected, and quickly establish a connection with the target Bluetooth Mesh device, thereby improving the connection success rate between the terminal device and the target Bluetooth Mesh device. It can be seen that the broadcast packet transmission control method provided in the embodiment of the present application can improve the connection success rate between the terminal device and the target Bluetooth Mesh device while ensuring that the terminal device quickly discovers the target Bluetooth Mesh device to be connected.
[0075] In the case where the Bluetooth Mesh device sends a connection broadcast packet at the default first packet transmission interval, the following takes the packet transmission interval control packet used to control the packet transmission interval of the target Bluetooth Mesh device to be adjusted to the second packet transmission interval, and the packet transmission interval of the non-target Bluetooth Mesh device to be adjusted to the third packet transmission interval as an example to introduce the broadcast packet sending control method provided in an embodiment of the present application.
[0076] As an optional implementation, Figure 4 Another optional flow chart of the broadcast packet sending control method provided by the embodiment of the present application is shown as an example. Figure 4 The method flow may include the following steps.
[0077] In step S410, the Bluetooth Mesh device periodically sends a connection broadcast packet at a set first packet sending interval.
[0078] In step S411, the terminal device determines a target Bluetooth Mesh device to be connected from the Bluetooth Mesh devices that send the connection broadcast packet.
[0079] In step S412, the terminal device establishes a connection with the target Bluetooth Mesh device.
[0080] In step S413, the terminal device determines whether it is difficult to establish a connection with the target Bluetooth Mesh device. If not, step S414 is executed. If so, step S415 is executed.
[0081] In some embodiments, during the process of establishing a connection with a target Bluetooth Mesh device, the terminal device may detect the time taken to establish a connection and / or the connection stability, and the connection stability may at least indicate whether a reconnection with a connection error occurs between the terminal device and the target Bluetooth Mesh device; if the time taken to establish a connection between the terminal device and the target Bluetooth Mesh device is greater than a preset time threshold, and / or the connection stability is poor (for example, a reconnection with a connection error occurs between the terminal device and the target Bluetooth Mesh device), it may be considered that it is difficult for the terminal device to establish a connection with the target Bluetooth Mesh device. This may be due to the fact that there are currently many Bluetooth Mesh devices sending connection broadcast packets, resulting in signal interference in the Bluetooth Mesh network, making it difficult for the terminal device to connect to the Bluetooth Mesh device. When the terminal device detects that it is difficult to establish a connection with the target Bluetooth Mesh device, it may execute S415 to generate a packet transmission interval control packet.
[0082] On the other hand, if the time taken for the terminal device to establish a connection with the target Bluetooth Mesh device is less than a preset time threshold, and no reconnection due to connection errors occurs, it can be determined that it is not difficult for the terminal device to establish a connection with the target Bluetooth Mesh device; at this time, the terminal device can complete the connection with the target Bluetooth Mesh device, and maintain the Bluetooth Mesh device to send connection broadcast packets at the set first packet interval time (i.e., cancel the step of generating a packet interval control packet).
[0083] In step S414, the connection with the target Bluetooth Mesh device is established.
[0084] In step S415, a target verification identifier and a target device identifier corresponding to the target Bluetooth Mesh device are determined, and a packet transmission interval control packet carrying at least the target device identifier, the target verification identifier, the second packet transmission interval time, and the third packet transmission interval time is generated.
[0085] In some embodiments, when the terminal device generates a packet transmission interval control packet, in order to enable the packet transmission interval control packet to indicate the target Bluetooth Mesh device, the terminal device can determine the target MAC address from the Device UUID in the connection broadcast packet sent by the target Bluetooth Mesh device, thereby serving as the target device identifier corresponding to the target Bluetooth Mesh device. Furthermore, the terminal device can also carry a target verification identifier (such as target NID, target PID) for data legitimacy verification, a reduced second packet transmission interval time, and an increased third packet transmission interval time in the packet transmission interval control packet, so that the subsequent target Bluetooth Mesh device and non-target Bluetooth Mesh device can adjust the packet transmission interval time accordingly based on the instructions of the packet transmission interval control packet.
[0086] It should be noted that carrying the second packet transmission interval and the third packet transmission interval in the packet transmission interval control packet is only an optional implementation method. The embodiment of the present application can also preset the second packet transmission interval and the third packet transmission interval in the Bluetooth Mesh device; so that when the subsequent Bluetooth Mesh device determines that it is a target Bluetooth Mesh device based on the packet transmission interval control packet, it can further adjust the packet transmission interval according to the preset second packet transmission interval; when the Bluetooth Mesh device determines that it is a non-target Bluetooth Mesh device based on the packet transmission interval control packet, it can further adjust the packet transmission interval according to the preset third packet transmission interval. It should be further noted that carrying the target verification identifier in the packet transmission interval control packet is only an optional implementation, and the embodiment of the present application can also support the process of not performing data legitimacy verification.
[0087] As an optional implementation, taking the device identifier as a MAC address, the verification identifier as an NID (for a node device that has been networked) and a PID (for an unconfigured device) as an example, the embodiment of the present application can define a packet transmission interval control packet carrying a target MAC address, a target NID, a target PID, a second packet transmission interval time, and a third packet transmission interval time through a manufacturer-defined format (ManufacturerSpecificData). As an example, the format of the packet transmission interval control packet can be referred to as shown in the following Table 1.
[0088]
[0089]
[0090] Table 1
[0091] In step S416, the terminal device sends the packet transmission interval control packet to the Bluetooth Mesh device.
[0092] In step S417, the Bluetooth Mesh device performs a data validity check according to the target verification identifier carried in the packet transmission interval control packet.
[0093] In some embodiments, if the Bluetooth Mesh device receiving the packet transmission interval control packet is a node device that has been configured, the Bluetooth Mesh device may match the target NID carried by the packet transmission interval control packet with the NID of the Bluetooth Mesh device; if the match succeeds, it can be determined that the Bluetooth Mesh device has passed the data legitimacy check; if the match fails, it can be determined that the Bluetooth Mesh device has failed the data legitimacy check.
[0094] In other embodiments, if the Bluetooth Mesh device receiving the packet transmission interval control packet is an unconfigured device, the Bluetooth Mesh device may match the target PID carried by the packet transmission interval control packet with the PID of the Bluetooth Mesh device; if the match succeeds, it can be determined that the Bluetooth Mesh device has passed the data legitimacy check; if the match fails, it can be determined that the Bluetooth Mesh device has failed the data legitimacy check.
[0095] After the Bluetooth Mesh device passes the data validity check, the Bluetooth Mesh device can execute step S418 to determine whether the Bluetooth Mesh device is the target Bluetooth Mesh device to be connected to the terminal device. When the Bluetooth Mesh device fails the data validity check, the embodiment of the present application can end the process.
[0096] In step S418, if the Bluetooth Mesh device passes the data legitimacy check, the Bluetooth Mesh device determines whether the device identifier matches the target device identifier carried by the packet transmission interval control packet; if so, execute step S419; if not, execute step S420.
[0097] In step S419, the Bluetooth Mesh device adjusts the packet transmission interval according to the second packet transmission interval carried in the packet transmission interval control packet.
[0098] In step S420, the Bluetooth Mesh device adjusts the packet transmission interval according to the third packet transmission interval carried in the packet transmission interval control packet.
[0099] In some embodiments, after the Bluetooth Mesh device passes the data legitimacy check, the Bluetooth Mesh device can match its own MAC address with the target MAC address carried in the packet interval control packet to determine whether the Bluetooth Mesh device is the target Bluetooth Mesh device. When the Bluetooth Mesh device is the target Bluetooth Mesh device, the Bluetooth Mesh device can adjust the packet interval to the second packet interval after the packet interval is reduced based on the instruction of the packet interval control packet; when the Bluetooth Mesh device is a non-target Bluetooth Mesh device, the Bluetooth Mesh device can adjust the packet interval to the third packet interval after the packet interval is increased based on the instruction of the packet interval control packet, so as to achieve the packet interval of the target Bluetooth Mesh device sending the connection broadcast packet, which is less than the packet interval of the non-target Bluetooth Mesh device sending the connection broadcast packet.
[0100] In some further embodiments, after the Bluetooth Mesh device adjusts the packet transmission interval time according to the packet transmission interval control packet, the Bluetooth Mesh device can restore the packet transmission interval time to the set first packet transmission interval time. For example, the target Bluetooth Mesh device can restore the packet transmission interval time to the set first packet transmission interval time after adjusting the packet transmission interval time to the set time of the second packet transmission interval time; the non-target Bluetooth Mesh device can restore the packet transmission interval time to the set first packet transmission interval time after adjusting the packet transmission interval time to the set time of the third packet transmission interval time. As an optional implementation, the Bluetooth Mesh device can set a recovery timer. When the Bluetooth Mesh device adjusts the packet transmission interval time to the second packet transmission interval time or the third packet transmission interval time, the Bluetooth Mesh device can start the recovery timer, so that when the recovery timer reaches the set time, the Bluetooth Mesh device can resume periodically sending connection broadcast packets with the set first packet transmission interval time.
[0101] The value of the set time can be determined according to actual conditions, and the embodiments of the present application are not limited thereto. In one example, the set time can be 1 minute; for example, the Bluetooth Mesh device adjusts the packet sending interval time according to the packet sending interval control packet, and restores the packet sending interval time to the default 160 milliseconds 1 minute later.
[0102] The embodiment of the present application restores the packet sending interval of the Bluetooth Mesh device to the default first packet sending interval at the set time after adjusting the packet sending interval, mainly to make the terminal device compatible with other third-party apps, and to ensure that other third-party apps can quickly establish a connection with the Bluetooth Mesh device when the packet sending interval adjustment scheme of the embodiment of the present application is not executed.
[0103] As an implementation example, taking the default first packet sending interval of 160 milliseconds, the reduced second packet sending interval of 100 milliseconds, and the increased third packet sending interval of 1 second as an example, the broadcast packet sending control method provided in the embodiment of the present application is explained. Figure 5 Another optional flowchart of the broadcast packet sending control method provided in the embodiment of the present application is shown as an example. Figure 5 The method flow may include the following steps.
[0104] In step S510, after being powered on, the Bluetooth Mesh device periodically sends GATT connection advertising packets at a default interval of 160 milliseconds.
[0105] For example, after powering on, an unconfigured device periodically sends PB-GATT advertising packets with a packet sending interval of 160 milliseconds; after powering on, a configured node device periodically sends Proxy advertising packets with a default packet sending interval of 160 milliseconds.
[0106] In step S511, the terminal device determines a target Bluetooth Mesh device to be connected, and establishes a GATT connection with the target Bluetooth Mesh device.
[0107] The target Bluetooth Mesh device includes a target unprovisioned device to be connected and a target node device.
[0108] In step S512, the terminal device detects that it is difficult to establish a GATT connection with the target Bluetooth Mesh device, and determines the target MAC, target PID, and target NID of the target Bluetooth Mesh device.
[0109] In step S513, the terminal device generates a packet interval control packet carrying the target PID (such as the PID corresponding to the target unconfigured device), the target NID (such as the network ID where the target node device is located), the target MAC address, the second packet interval time (100 milliseconds), and the third packet interval time (1 second).
[0110] When the terminal device is establishing a GATT connection with the target Bluetooth Mesh device, if it detects that there are too many Bluetooth Mesh devices in the surrounding area and it is difficult to establish a GATT connection (due to too many GATT connection broadcast packets broadcast in the Bluetooth Mesh network, it is difficult for the terminal device to establish a GATT connection with the Bluetooth Mesh device), a packet transmission interval control packet can be generated to dynamically adjust the packet transmission interval of the Bluetooth Mesh device; for example, the packet transmission interval of the target Bluetooth Mesh device to be connected is reduced to 100 milliseconds, while the packet transmission interval of other Bluetooth Mesh devices in the surrounding area that do not need to be connected temporarily is increased to 1 second.
[0111] In this implementation example, the packet transmission interval control packet can carry the target MAC address (for example, the target MAC address of the target unconfigured device, the target MAC address of the target node device), the target PID (for the unconfigured device to verify the data legitimacy), the target NID (for the node device to verify the data legitimacy), the second packet transmission interval time adjusted to 100 milliseconds, and the third packet transmission interval time adjusted to 1 second. The format of the packet transmission interval control packet and possible alternative implementations can be referred to the description of the corresponding part of the previous text, which will not be expanded here.
[0112] In step S514, the terminal device sends the packet transmission interval control packet to the Bluetooth Mesh device.
[0113] In step S515, the Bluetooth Mesh device performs a data legitimacy check according to the target PID or target NID, and determines that the MAC address matches the target MAC address, and adjusts the packet transmission interval to 100 milliseconds.
[0114] In step S516, the Bluetooth Mesh device periodically sends GATT connection broadcast packets at a packet transmission interval of 100 milliseconds.
[0115] For the Bluetooth Mesh device to be connected (the terminal device can support establishing GATT connections with multiple Bluetooth Mesh devices at the same time, and the Bluetooth Mesh device to be connected can be one or more), after receiving the packet transmission interval control packet, if the Bluetooth Mesh device is an unconfigured device, the Bluetooth Mesh device can perform data legitimacy verification according to the target PID carried in the packet transmission interval control packet (for example, matching the PID of the unconfigured device with the target PID); if the Bluetooth Mesh device is a configured node device, the Bluetooth Mesh device can perform data legitimacy verification according to the target NID carried in the packet transmission interval control packet (for example, matching the NID of the node device with the target PID).
[0116] For the Bluetooth Mesh device to be connected, after the Bluetooth Mesh device passes the data legitimacy check, it can match its own MAC address with the target MAC address carried in the packet interval control packet; if the MAC address matches, it means that the terminal device currently needs to connect to the Bluetooth Mesh device. The Bluetooth Mesh device can adjust the packet interval to 100 milliseconds according to the second packet interval (100 milliseconds) carried in the packet interval control packet, thereby using the 100 millisecond packet interval to periodically send GATT connection broadcast packets.
[0117] In step S517, the Bluetooth Mesh device starts a recovery timer when adjusting the packet transmission interval to 100 milliseconds.
[0118] In step S518, when the recovery timer reaches 1 minute, the Bluetooth Mesh device resumes sending GATT connection broadcast packets periodically with a packet transmission interval of 160 milliseconds.
[0119] For the Bluetooth Mesh device to be connected, when the Bluetooth Mesh device adjusts the packet sending interval to 100 milliseconds, it can start the recovery timer. When the recovery timer reaches 1 minute, the Bluetooth Mesh device can restore the packet sending interval to the default 160 milliseconds.
[0120] In step S519, the Bluetooth Mesh device performs a data validity check based on the target PID or target NID, but determines that the MAC address does not match the target MAC address, and adjusts the packet sending interval to 1 second.
[0121] In step S520, the Bluetooth Mesh device periodically sends GATT connection broadcast packets with a packet transmission interval of 1 second.
[0122] For Bluetooth Mesh devices that terminal devices do not need to connect to, the Bluetooth Mesh device can perform data legitimacy verification after receiving the packet interval control packet; if the Bluetooth Mesh device passes the data legitimacy verification, it can match its own MAC address with the target MAC address carried in the packet interval control packet; if the MAC address match fails, it means that the terminal device does not currently need to connect to the Bluetooth Mesh device. The Bluetooth Mesh device can adjust the packet interval time to 1 second according to the third packet interval time (1 second) carried by the packet interval control packet, thereby using the 1-second packet interval time to periodically send GATT connection broadcast packets.
[0123] In step S521, when the Bluetooth Mesh device adjusts the packet transmission interval to 1 second, it starts the recovery timer. When the timer reaches 1 minute, it resumes to periodically send GATT connection advertising packets with a packet transmission interval of 160 milliseconds.
[0124] Similarly, for Bluetooth Mesh devices that terminal devices do not need to connect to, the Bluetooth Mesh device can start the recovery timer when the packet sending interval is adjusted to 1 second; when the recovery timer is set to 1 minute, the Bluetooth Mesh device can resume sending GATT connection broadcast packets periodically with a packet sending interval of 160 milliseconds.
[0125] The embodiment of the present application provides a broadcast packet sending control scheme, which can dynamically adjust the packet sending interval of the GATT connection broadcast packet sent by the Bluetooth Mesh device in a large-scale Bluetooth Mesh network, so that the packet sending interval of the target Bluetooth Mesh device to be connected by the terminal device is shorter than the packet sending interval of the non-target Bluetooth Mesh device that the terminal device does not need to connect to, thereby solving the problem that it is difficult for the terminal device to establish multiple GATT connections with the Bluetooth Mesh device in a large-scale Bluetooth Mesh network, and will not cause the terminal device to take too long to establish the GATT connection with the Bluetooth Mesh device. It can enable the terminal device to quickly establish a GATT connection with the target Bluetooth Mesh device when quickly discovering the current target Bluetooth Mesh device to be connected, thereby improving the GATT connection success rate.
[0126] The following is an introduction to the broadcast packet sending control device provided in the embodiment of the present application. The device content described below can be considered as the functional modules that the terminal device needs to set in order to implement the broadcast packet sending control method provided in the embodiment of the present application. The content described below can be referenced to the content described above.
[0127] As an optional implementation, Figure 6 An optional block diagram of a broadcast packet sending control device provided in an embodiment of the present application is exemplarily shown. The device can be applied to a terminal device. Figure 6 , the device may include:
[0128] The broadcast packet acquisition module 610 is used to acquire a connection broadcast packet sent by the Bluetooth Mesh device at a set first packet sending interval, wherein the connection broadcast packet is used by the terminal device to discover the Bluetooth Mesh device so that the terminal device can establish a connection with the Bluetooth Mesh device;
[0129] A target device determination module 611 is used to determine a target Bluetooth Mesh device to be connected from the Bluetooth Mesh devices that send the connection broadcast packet;
[0130] The control packet generation module 612 is used to generate a packet transmission interval control packet according to the target Bluetooth Mesh device; the packet transmission interval control packet is used to control the packet transmission interval time of the target Bluetooth Mesh device to be less than the packet transmission interval time of the non-target Bluetooth Mesh device to send the connection broadcast packet;
[0131] The control packet sending module 613 is used to send the packet sending interval control packet to the Bluetooth Mesh device.
[0132] In some embodiments, the packet transmission interval control packet is specifically used to: adjust the packet transmission interval of the target Bluetooth Mesh device to a second packet transmission interval, and adjust the packet transmission interval of the non-target Bluetooth Mesh device to a third packet transmission interval; the second packet transmission interval is less than the first packet transmission interval, and the third packet transmission interval is greater than the first packet transmission interval.
[0133] In some embodiments, the control packet generation module 612 is used to generate a packet transmission interval control packet according to the target Bluetooth Mesh device, including:
[0134] At least determine a target device identifier corresponding to the target Bluetooth Mesh device, where the target device identifier is used to identify the target Bluetooth Mesh device;
[0135] Generate a packet transmission interval control packet that carries at least the target device identifier, the second packet transmission interval time, and the third packet transmission interval time.
[0136] In some further embodiments, the control packet generation module 612 is used to generate a packet transmission interval control packet according to the target Bluetooth Mesh device, and further includes:
[0137] Determine a target verification identifier, where the target verification identifier is used to perform data legitimacy verification on the Bluetooth Mesh device;
[0138] The target verification identifier is carried in the packet sending interval control packet.
[0139] In some further embodiments, the device is also used for:
[0140] After determining the target Bluetooth Mesh device to be connected, establishing a connection with the target Bluetooth Mesh device and determining whether it is difficult to establish a connection with the target Bluetooth Mesh device;
[0141] If the judgment result is yes, the control packet generation module is enabled to enter the step of generating a packet transmission interval control packet according to the target Bluetooth Mesh device;
[0142] If the judgment result is no, the control packet generation module cancels the step of generating a packet transmission interval control packet according to the target Bluetooth Mesh device.
[0143] In some embodiments, the apparatus is used to determine whether it is difficult to establish a connection with the target Bluetooth Mesh device, including:
[0144] Detecting the time taken to establish a connection and / or the connection stability, wherein the connection stability at least indicates whether a reconnection due to a connection error occurs between the terminal device and the target Bluetooth Mesh device;
[0145] If it is detected that the time taken to establish the connection is greater than a preset time threshold, and / or a reconnection with a target Bluetooth Mesh device due to a connection error occurs, it is determined that it is difficult to establish a connection with the target Bluetooth Mesh device;
[0146] If it is detected that the time taken to establish the connection is less than a preset time threshold, and there is no reconnection with the target Bluetooth Mesh device due to a connection error, it is determined that it is not difficult to establish a connection with the target Bluetooth Mesh device.
[0147] The embodiment of the present application also provides a terminal device, which can implement the broadcast packet sending control method provided in the embodiment of the present application by setting the broadcast packet sending control device described above. As an optional implementation, Figure 7 An optional block diagram of a terminal device is shown as an example. Figure 7 As shown, the terminal device may include: at least one processor 71, at least one communication interface 72, at least one memory 73 and at least one communication bus 74.
[0148] In the embodiment of the present application, the number of the processor 71 , the communication interface 72 , the memory 73 , and the communication bus 74 is at least one, and the processor 71 , the communication interface 72 , and the memory 73 communicate with each other through the communication bus 74 .
[0149] Optionally, the communication interface 72 may be an interface of a communication module for performing network communication.
[0150] Optionally, the processor 71 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 Application Specific Integrated Circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present application.
[0151] The memory 73 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.
[0152] Among them, the memory 73 stores one or more computer-executable instructions, and the processor 71 calls the one or more computer-executable instructions to execute the broadcast packet sending control method executed by the terminal device in the embodiment of the present application.
[0153] 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, a broadcast packet sending control method executed by a terminal device as in an embodiment of the present application is implemented.
[0154] The embodiment of the present application also provides a computer program, which, when executed, implements the broadcast packet sending control method executed by the terminal device in the embodiment of the present application.
[0155] The following is an introduction to the broadcast packet transmission control device provided in the embodiment of the present application from the perspective of the Bluetooth Mesh device. The device content described below can be considered as the functional module that the Bluetooth Mesh device needs to set in order to implement the broadcast packet transmission control method provided in the embodiment of the present application. The content described below can be referenced to the content described above.
[0156] As an optional implementation, Figure 8 Another optional block diagram of the broadcast packet sending control device provided in an embodiment of the present application is exemplarily shown, and the device can be applied to a Bluetooth Mesh device, referring to Figure 8 , the device may include:
[0157] A broadcast packet sending module 810 is used to send a connection broadcast packet at a set first packet sending interval, where the connection broadcast packet is used for a terminal device to discover the Bluetooth Mesh device so that the terminal device can establish a connection with the Bluetooth Mesh device;
[0158] The control packet acquisition module 811 is used to acquire the packet transmission interval control packet sent by the terminal device;
[0159] The packet sending interval adjustment module 812 is used to adjust the packet sending interval time of sending the connection broadcast packet according to the packet sending interval control packet, so that the packet sending interval time of sending the connection broadcast packet by the target Bluetooth Mesh device to be connected by the terminal device is less than the packet sending interval time of sending the connection broadcast packet by the non-target Bluetooth Mesh device.
[0160] In some embodiments, the packet transmission interval adjustment module 812 is used to adjust the packet transmission interval of sending the connection broadcast packet according to the packet transmission interval control packet, so that the packet transmission interval of the target Bluetooth Mesh device to be connected by the terminal device is less than the packet transmission interval of the non-target Bluetooth Mesh device sending the connection broadcast packet, including:
[0161] According to the packet transmission interval control packet, determining whether the Bluetooth Mesh device is a target Bluetooth Mesh device;
[0162] If yes, adjust the packet sending interval of the Bluetooth Mesh device to a second packet sending interval, where the second packet sending interval is less than the first packet sending interval;
[0163] If not, the packet sending interval of the Bluetooth Mesh device is adjusted to a third packet sending interval, and the third packet sending interval is greater than the first packet sending interval.
[0164] In some embodiments, the packet transmission interval control packet carries the second packet transmission interval time, the third packet transmission interval time, a target verification identifier, and a target device identifier corresponding to the target Bluetooth Mesh device; the device can also be used to: perform data legitimacy verification on the Bluetooth Mesh device according to the target verification identifier carried by the packet transmission interval control packet.
[0165] In some further embodiments, the packet transmission interval adjustment module 812 is used to determine whether the Bluetooth Mesh device is a target Bluetooth Mesh device according to the packet transmission interval control packet, including: after the Bluetooth Mesh device passes the data legitimacy check, determining whether the device identifier of the Bluetooth Mesh device matches the target device identifier carried by the packet transmission interval control packet;
[0166] The packet transmission interval adjustment module 812 is configured to adjust the packet transmission interval of the Bluetooth Mesh device to the second packet transmission interval, including: if the device identifier of the Bluetooth Mesh device matches the target device identifier, adjusting the packet transmission interval of the Bluetooth Mesh device to the second packet transmission interval according to the second packet transmission interval carried by the packet transmission interval control packet;
[0167] The packet sending interval adjustment module 812 is used to adjust the packet sending interval of the Bluetooth Mesh device to the third packet sending interval, including: if the device identifier of the Bluetooth Mesh device does not match the target device identifier, according to the third packet sending interval carried by the packet sending interval control packet, adjusting the packet sending interval of the Bluetooth Mesh device to the third packet sending interval.
[0168] In some further embodiments, the device may also be used to: at a set time after adjusting the packet sending interval, restore the packet sending interval to the set first packet sending interval.
[0169] An embodiment of the present application also provides a Bluetooth Mesh device, which can be configured with one or more computer-executable instructions. When the one or more computer-executable instructions are executed, a broadcast packet sending control method as executed by the Bluetooth Mesh device in the embodiment of the present application is implemented.
[0170] 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, a broadcast packet sending control method performed by a Bluetooth Mesh device as in an embodiment of the present application is implemented.
[0171] An embodiment of the present application also provides a computer program, which, when executed, implements the broadcast packet sending control method performed by the Bluetooth Mesh device as in the embodiment of the present application.
[0172] The above describes multiple implementation schemes provided by the embodiments of the present application. The various optional methods introduced in each implementation scheme can be combined and cross-referenced with each other without conflict, thereby extending a variety of possible implementation schemes, which can all be considered as implementation schemes disclosed and open in the embodiments of the present application.
[0173] Although the embodiments of the present application are disclosed above, the present application is not limited thereto. Any person skilled in the art may make various changes and modifications without departing from the spirit and scope of the present application. Therefore, the scope of protection of the present application shall be subject to the scope defined by the claims.
Claims
1. A method for controlling broadcast packet transmission, wherein: Applied to a terminal device, the method comprises: Acquire a connection broadcast packet sent by the Bluetooth Mesh device at a set first packet sending interval, where the connection broadcast packet is used by the terminal device to discover the Bluetooth Mesh device so that the terminal device can establish a connection with the Bluetooth Mesh device; Determine the target Bluetooth Mesh device to be connected from the Bluetooth Mesh devices that send the connection broadcast packet; Generate a packet transmission interval control packet according to the target Bluetooth Mesh device; the packet transmission interval control packet is used to control the packet transmission interval time of the target Bluetooth Mesh device to be less than the packet transmission interval time of the non-target Bluetooth Mesh device to send the connection broadcast packet; The packet sending interval control packet is sent to the Bluetooth Mesh device, so that the Bluetooth Mesh device adjusts the packet sending interval of sending the connection broadcast packet according to the packet sending interval control packet; wherein the packet sending interval control packet is specifically used to adjust the packet sending interval of the target Bluetooth Mesh device to the second packet sending interval, and adjust the packet sending interval of the non-target Bluetooth Mesh device to the third packet sending interval; the second packet sending interval is less than the first packet sending interval, and the third packet sending interval is greater than the first packet sending interval.
2. The method according to claim 1, wherein: The generating a packet transmission interval control packet according to the target Bluetooth Mesh device includes: At least determine a target device identifier corresponding to the target Bluetooth Mesh device, where the target device identifier is used to identify the target Bluetooth Mesh device; Generate a packet transmission interval control packet that carries at least the target device identifier, the second packet transmission interval time, and the third packet transmission interval time.
3. The method according to claim 2, wherein: The generating a packet transmission interval control packet according to the target Bluetooth Mesh device further includes: Determine a target verification identifier, where the target verification identifier is used to perform data legitimacy verification on the Bluetooth Mesh device; The target verification identifier is carried in the packet sending interval control packet.
4. The method according to any one of claims 1 to 3, wherein: The method further comprises: After determining the target Bluetooth Mesh device to be connected, establishing a connection with the target Bluetooth Mesh device and determining whether it is difficult to establish a connection with the target Bluetooth Mesh device; If the judgment result is yes, then enter the step of generating a packet transmission interval control packet according to the target Bluetooth Mesh device; If the judgment result is no, the step of generating a packet transmission interval control packet according to the target Bluetooth Mesh device is canceled.
5. The method according to claim 4, wherein: The determination of whether it is difficult to establish a connection with the target Bluetooth Mesh device includes: Detecting the time taken to establish a connection and / or the connection stability, wherein the connection stability at least indicates whether a reconnection due to a connection error occurs between the terminal device and the target Bluetooth Mesh device; If it is detected that the time taken to establish the connection is greater than a preset time threshold, and / or a reconnection with a target Bluetooth Mesh device due to a connection error occurs, it is determined that it is difficult to establish a connection with the target Bluetooth Mesh device; If it is detected that the time taken to establish the connection is less than a preset time threshold, and there is no reconnection with the target Bluetooth Mesh device due to a connection error, it is determined that it is not difficult to establish a connection with the target Bluetooth Mesh device.
6. A method for controlling broadcast packet transmission, wherein: Applied to a Bluetooth Mesh device, the method comprises: Sending a connection broadcast packet at a set first packet sending interval, where the connection broadcast packet is used for a terminal device to discover the Bluetooth Mesh device so that the terminal device can establish a connection with the Bluetooth Mesh device; Obtaining a packet transmission interval control packet sent by the terminal device; According to the packet transmission interval control packet, adjust the packet transmission interval of the connection broadcast packet so that the packet transmission interval of the target Bluetooth Mesh device to be connected by the terminal device is less than the packet transmission interval of the connection broadcast packet sent by the non-target Bluetooth Mesh device; Among them, adjusting the packet sending interval of sending the connection broadcast packet according to the packet sending interval control packet so that the packet sending interval of the target Bluetooth Mesh device to be connected by the terminal device is less than the packet sending interval of the connection broadcast packet sent by the non-target Bluetooth Mesh device includes: According to the packet transmission interval control packet, determining whether the Bluetooth Mesh device is a target Bluetooth Mesh device; If yes, adjust the packet sending interval of the Bluetooth Mesh device to a second packet sending interval, where the second packet sending interval is less than the first packet sending interval; If not, the packet sending interval of the Bluetooth Mesh device is adjusted to a third packet sending interval, and the third packet sending interval is greater than the first packet sending interval.
7. The method according to claim 6, wherein: The packet transmission interval control packet carries the second packet transmission interval time, the third packet transmission interval time, a target verification identifier, and a target device identifier corresponding to the target Bluetooth Mesh device; The method further includes: performing data legitimacy verification on the Bluetooth Mesh device according to a target verification identifier carried by the packet transmission interval control packet; The determining, according to the packet transmission interval control packet, whether the Bluetooth Mesh device is a target Bluetooth Mesh device comprises: after the Bluetooth Mesh device passes the data legitimacy check, determining whether the device identifier of the Bluetooth Mesh device matches the target device identifier carried in the packet transmission interval control packet; The adjusting the packet transmission interval of the Bluetooth Mesh device to the second packet transmission interval includes: if the device identifier of the Bluetooth Mesh device matches the target device identifier, adjusting the packet transmission interval of the Bluetooth Mesh device to the second packet transmission interval according to the second packet transmission interval carried by the packet transmission interval control packet; The adjusting the packet sending interval of the Bluetooth Mesh device to the third packet sending interval includes: if the device identifier of the Bluetooth Mesh device does not match the target device identifier, adjusting the packet sending interval of the Bluetooth Mesh device to the third packet sending interval according to the third packet sending interval carried by the packet sending interval control packet.
8. The method according to any one of claims 6 to 7, wherein: The method further comprises: At a set time after adjusting the packet sending interval, the packet sending interval is restored to the set first packet sending interval.
9. A terminal device, wherein: 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 broadcast packet sending control method according to any one of claims 1-5.
10. A Bluetooth Mesh device, wherein: The Bluetooth Mesh device is configured with one or more computer executable instructions, and when the one or more computer executable instructions are executed, the broadcast packet sending control method as described in any one of claims 6 to 8 is implemented.
11. A storage medium, wherein: The storage medium stores one or more computer executable instructions, and when the one or more computer executable instructions are executed, the broadcast packet sending control method as described in any one of claims 1-5, or the broadcast packet sending control method as described in any one of claims 6-8 is implemented.
Citation Information
Patent Citations
Method and apparatus for establishing connection between devices
CN104812094A
Equipment network access method based on Bluetooth Mesh network and device thereof and storage medium
CN111641997A