Equipment roaming method, equipment roaming system and electronic equipment
By using the signal strength detection and migration request mechanism between the first and second gateway nodes during the BLE device movement process, the problem of unstable connection of the BLE device is solved, and the network connection stability of the device during the mobile process is realized and Switch seamlessly.
Patent Information
- Application Number
- CN202411548218.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-31
- Publication Date
- 2025-02-18
AI Technical Summary
When BLE devices move quickly or cross different signal coverage areas, connections may be instable or even interrupted.
When the first gateway node detects that the signal strength is lower than the threshold, a notification information is sent to the second gateway node to notify it of the second signal strength of the target device. If the second signal strength is greater than the threshold, the second gateway node initiates a migration request to the first gateway node. The first gateway node disconnects from the target device and sends takeover information to the second gateway node to instruct it to establish a connection with the target device. .
The network connection stability of BLE devices during mobile is realized, which reduces data transmission delays, and improves the seamless switching capability of devices between different gateway nodes.
Smart Images

Figure CN119485567A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of communication technology, and in particular to a device roaming method, a device roaming system and an electronic device. Background Art
[0002] With the rapid development of the Internet of Things (IoT) technology, Bluetooth low energy (BLE) devices have been widely used in smart homes, industrial monitoring, medical health and other fields. These devices usually need to move indoors or outdoors and maintain a stable connection with the network during the movement. However, in actual application scenarios, when BLE devices are moving quickly or crossing different signal coverage areas, the connection may be unstable or even interrupted. Summary of the invention
[0003] According to various embodiments of the present application, a device roaming method, a device roaming system, and an electronic device are provided, which can ensure the connection stability of the device during movement.
[0004] In a first aspect, the present application provides a device roaming method, the method comprising:
[0005] Obtain the first signal strength of the target device; when the first signal strength is lower than a first threshold, send a notification message to the second gateway node; the notification message is used to notify the second gateway node to detect the second signal strength of the target device; receive a migration request sent by the second gateway node; the migration request is issued by the second gateway node when it detects that the second signal strength is greater than a second threshold; based on the migration request, send takeover information to the second gateway node and disconnect from the target device; the takeover information is used to instruct the second gateway node to establish a connection with the target device.
[0006] Through the above method, when the signal strength detected by the first gateway node is lower than the preset first threshold, the adjacent second gateway node is notified to detect the signal strength of the target device. When the second gateway node detects that the signal strength of the target device increases and is greater than the preset second threshold, a migration request is initiated to the first gateway node. The first gateway node sends takeover information to the second gateway node based on the migration request. Before performing node roaming switching, information exchange is realized, and after the first gateway node is disconnected from the target device, a seamless connection between the target device and the second gateway node is realized, thereby ensuring the stability of the network connection of the device during movement. The method has strong ease of use and practicality.
[0007] In a possible implementation manner of the first aspect, before acquiring the first signal strength of the target device, the method further includes:
[0008] Obtain the initial signal strength of each gateway node of the target device and the load status of each gateway node; determine the first gateway node that meets the connection conditions based on the initial signal strength and the load status; the first gateway node establishes a connection with the target device; wherein the connection condition is that the initial signal strength is greater than a third threshold and the load status is less than the load threshold of the gateway node.
[0009] In a possible implementation manner of the first aspect, the method further includes:
[0010] Obtain a second signal strength of a target device detected by a second gateway node; determine a movement trend of the target device based on a first change rate of the first signal strength and a second change rate of the second signal strength; and send a takeover notification to a second gateway node corresponding to the movement trend, wherein the takeover notification is used to instruct the second gateway to establish a connection with the target device.
[0011] In a possible implementation manner of the first aspect, the method includes:
[0012] Sending the first signal strength to the second gateway node; when the target device is in a stationary state, receiving a migration request sent by the second gateway node, the migration request being sent by the second gateway node when detecting that the second signal strength is greater than the first signal strength.
[0013] In a possible implementation manner of the first aspect, the migration request includes node status information of the second gateway node and expected connection quality information between the second gateway node and the target device; the takeover information includes device status information and connection information of the target device.
[0014] In a second aspect, the present application provides a device roaming method, applied to a second gateway node, the method comprising:
[0015] Receive notification information sent by the first gateway node; the notification information is sent by the first gateway node when it detects that the first signal strength of the target device is less than the first threshold; detect the second signal strength of the target device according to the notification information; when the second signal strength is greater than the second threshold, send a migration request to the first gateway node; receive takeover information sent by the first gateway node based on the migration request; after the first gateway node is disconnected from the target device, establish a connection with the target device based on the takeover information.
[0016] In a possible implementation manner of the second aspect, sending a migration request to the first gateway node includes:
[0017] Based on the notification information, predict expected connection quality information with the target device; send the expected connection quality information and node status information to the first gateway node; wherein the migration request includes the expected connection quality information and the node status information.
[0018] In a possible implementation manner of the second aspect, establishing a connection with the target device based on the takeover information includes:
[0019] A connection is established with the target device based on the device status information and connection information of the target device in the takeover information.
[0020] In a third aspect, the present application provides a device roaming system, the system comprising: a first gateway node and a second gateway node, the first gateway node and the second gateway node communicate through a preset routing protocol in a WiFi Mesh network, and the first gateway node establishes a connection with a target device;
[0021] The first gateway node is used to obtain a first signal strength of a target device; and send notification information to a second gateway node when the first signal strength is lower than a first threshold;
[0022] The second gateway node is configured to receive the notification information, detect a second signal strength of the target device based on the notification information, and send a migration request to the first gateway node when detecting that the second signal strength is greater than a second threshold;
[0023] The first gateway node is configured to receive a migration request sent by the second gateway node, and based on the migration request, send takeover information to the second gateway node; and disconnect from the target device;
[0024] The second gateway node is used to receive the takeover information and establish a connection with the target device based on the takeover information.
[0025] In a fourth aspect, the present application provides an electronic device, comprising at least one processor and a memory communicatively connected to the at least one processor; wherein the memory stores a computer program executed by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute any one of the methods in the first aspect or the second aspect.
[0026] In a fifth aspect, the present application provides a chip system, which is applied to an electronic device, and the chip system includes one or more processors, and the one or more processors are used to call computer instructions so that the electronic device executes a method as described in any one of the first aspect or the second aspect.
[0027] In a sixth aspect, the present application provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the method described in any one of the first aspect or the second aspect.
[0028] In a seventh aspect, the present application provides a computer program product. When the computer program product runs on an electronic device, the electronic device executes any one of the methods in the first or second aspect above.
[0029] It can be understood that the beneficial effects of the second to seventh aspects mentioned above can be found in the relevant description of the first aspect mentioned above, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] 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 some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0031] Figure 1 A schematic diagram of the system architecture of an application scenario provided in an embodiment of the present application;
[0032] Figure 2 A flowchart of a device roaming method provided in an embodiment of the present application;
[0033] Figure 3 A schematic diagram of the overall process of the device roaming method provided in an embodiment of the present application;
[0034] Figure 4 A flowchart of a device roaming method provided in an embodiment of the present application;
[0035] Figure 5 A schematic diagram of the structure of a device roaming apparatus provided in an embodiment of the present application;
[0036] Figure 6 A schematic diagram of the structure of a device roaming apparatus provided in an embodiment of the present application;
[0037] Figure 7 A structural schematic diagram of an electronic device is provided for an embodiment of the present application. DETAILED DESCRIPTION
[0038] The following embodiments of the technical solution of the present application are described in detail in conjunction with the accompanying drawings. The following embodiments are only used to more clearly illustrate the technical solution of the present application, and are therefore only used as examples, and cannot be used to limit the scope of protection of the present application.
[0039] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by technicians in the technical field to which this application belongs; the terms used herein are only for the purpose of describing specific embodiments and are not intended to limit this application; the terms "including" and "having" in the specification and claims of this application and the above-mentioned figure descriptions and any variations thereof are intended to cover non-exclusive inclusions.
[0040] In the description of the embodiments of the present application, the technical terms "first", "second", etc. are only used to distinguish different objects, and cannot be understood as indicating or implying relative importance or implicitly indicating the number, specific order or primary and secondary relationship of the indicated technical features. In the description of the embodiments of the present application, the meaning of "multiple" is more than two, unless otherwise clearly and specifically defined.
[0041] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.
[0042] In the description of the embodiments of the present application, the term "and / or" is only a description of the association relationship of the associated objects, indicating that there may be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article generally indicates that the associated objects before and after are in an "or" relationship.
[0043] With the rapid development of Internet of Things technology, BLE devices have been widely used in various fields, especially in WiFi mesh networks. The application of BLE devices provides a more flexible, reliable and secure connection method for Internet of Things devices.
[0044] Due to the limited signal coverage of BLE devices, when a BLE device moves to the edge of the signal range, the signal strength weakens, resulting in unstable connection; in addition, when a BLE device switches from one gateway node to another in a WiFi Mesh network, there is a significant delay in the switching process, which affects the real-time requirements of the device. The relevant technical solutions cannot meet the needs of frequent movement of BLE devices and high real-time applications.
[0045] In response to the above technical problems, the present application provides a device roaming method based on the distributed architecture of the WiFi Mesh network and the efficient routing mechanism between gateway nodes to achieve seamless switching of communication connections between BLE devices and different gateway nodes, ensuring that the BLE device is always connected to the gateway node with the best signal during movement, thereby improving the stability of the BLE device connection and reducing the delay of data transmission.
[0046] To facilitate the understanding of the technical solution, the technical terms involved in the embodiments of the present application are explained below.
[0047] 1. WiFi Mesh network: A wireless network architecture that is interconnected through multiple access points (AP) or gateway nodes to form a multi-hop mesh network that provides wide coverage, high bandwidth and self-healing capabilities.
[0048] 2. Bluetooth low energy (BLE): used for short-range wireless communication, with the characteristics of low power consumption, low cost and short delay, and is widely used in Internet of Things devices.
[0049] 3. Received signal strength indicator (RSSI): An indicator used to measure the strength of the received wireless signal, usually expressed in dBm.
[0050] 4. Dynamic roaming: When a device (such as a BLE device or an IoT device) moves within the network coverage area, it can seamlessly switch connections between different access points to maintain the continuity and stability of data transmission.
[0051] 5. Link State Routing Protocol (Optimized Link State Routing, OLSR): used for high-density nodes and frequently changing network environments, optimizing routing by regularly broadcasting link state information and multi-point relays (MPR) gateway nodes.
[0052] 6. Multi-point relays (MPR): In a network, a gateway node is selected as a relay point by its adjacent gateway nodes, responsible for broadcasting all broadcast messages received from the adjacent gateway nodes.
[0053] The following describes the application scenarios of the device roaming method through embodiments.
[0054] like Figure 1As shown, a schematic diagram of the system architecture of the application scenario provided by the embodiment of the present application. The system architecture can be a WiFi Mesh network group composed of multiple gateway nodes interconnected. Among them, the link status broadcast and relay selection are performed between each gateway node in the WiFi Mesh network through the OLSR protocol to form a stable network topology.
[0055] For example, Figure 1 As shown, the topological structure of the WiFi Mesh network group may include: the current gateway node 1, the neighboring gateway nodes adjacent to it (such as neighboring gateway node 1 to neighboring gateway node 4), and other neighboring gateway nodes adjacent to the neighboring gateway node (such as neighboring gateway node 5 and neighboring gateway node 6). Among them, when the current gateway node 1 communicates with the neighboring gateway node 5, the neighboring gateway node 2 or the neighboring gateway node 3 can be used as a relay point to realize the broadcast and transmission of messages in the WiFi Mesh network group.
[0056] Among them, taking the current gateway node 1 as an example, when the current gateway node 1 is connected (such as a long connection) to a BLE device (hereinafter also referred to as a target device or an IoT device), the signal strength (such as RSSI) of the BLE device can be detected in real time. When the BLE device moves, the signal strength detected by the current gateway node 1 may change and then fall below the first threshold. When the current gateway node 1 detects that the signal strength of the BLE device is lower than the signal strength threshold, it sends notification information to the neighboring gateway nodes, for example, sending notification information to the neighboring gateway nodes 1 to 4 respectively, to notify the neighboring gateway nodes to detect the signal strength of the BLE device by scanning. When one of the neighboring gateway nodes (such as the neighboring gateway node 4) detects that the signal strength of the BLE device is continuously increasing, such as Figure 1 As shown, the BLE device moves toward the neighboring gateway node 4, and the neighboring gateway node 4 sends a takeover message to the current gateway node 1, notifying the current gateway node 1 to disconnect and switch to a new gateway node with the best signal strength to connect with the BLE device. This ensures that the BLE device is always connected to the gateway node with the best signal strength during movement, ensuring the stability of the device connection and the low latency of data transmission.
[0057] Based on the above system architecture, the specific implementation process of the device roaming method is described below.
[0058] like Figure 2 As shown, a flow chart of a device roaming method provided in an embodiment of the present application is shown; the device roaming method can be applied to Figure 1Any gateway node in the WiFi Mesh network group shown in . Taking the current gateway node 1 as the first gateway node, and the first gateway node establishing a connection (such as a long connection) with the target device (such as a BLE device) as an example, the method may include the following steps:
[0059] S201: Obtain a first signal strength of a target device.
[0060] In an embodiment of the present application, when the first gateway node establishes a connection with the target device, the first gateway node can detect the signal strength (such as RSSI value) of the target device in real time; for example, the target device sends a Bluetooth broadcast signal at a fixed frequency, and the first gateway node determines the wireless signal strength, that is, the first signal strength, by receiving the Bluetooth broadcast signal.
[0061] In some embodiments, before obtaining the first signal strength of the target device, the method further includes:
[0062] The initial signal strength of the target device for each gateway node and the load status of each gateway node are obtained; a first gateway node that meets the connection conditions is determined according to the initial signal strength and the load status; and the first gateway node establishes a connection with the target device.
[0063] The connection condition is that the initial signal strength is greater than a third threshold and the load state is less than a load threshold of the gateway node.
[0064] Exemplarily, in a WiFi Mesh network, a gateway node joins a WiFi Mesh network group by discovering the WiFi Mesh network. Link status broadcasts can be performed between each gateway node through the OLSR protocol to ensure the latest status of the network topology. Each gateway node can periodically broadcast its link status information, which includes information about neighboring gateway nodes directly connected to it and load status, etc. Among them, the load status is the number of currently connected BLE devices, and the load threshold is the maximum number of BLE devices connected to the gateway node; or, the load status is the amount of data communicated by the gateway node per unit time, and the load threshold is the maximum amount of communication data of the gateway node per unit time.
[0065] Exemplarily, after the target device enters the WiFi Mesh network, before the gateway node establishes a connection with the target device, each gateway node can determine the initial signal strength of the target device by scanning the Bluetooth broadcast signal of the target device. The initial signal strength can be shared between the gateway nodes in the WiFi Mesh network group, that is, the first gateway node can receive the initial signal strength relative to the target device sent by other adjacent gateway nodes. Based on the initial signal strength and load status of each gateway node, the gateway node that can establish a connection with the target device is determined.
[0066] For example, if the signal strength detected by the first gateway node is greater than a preset signal strength threshold, and the load state of the first gateway node is within the range of the load threshold, it is determined that the first gateway node establishes a connection with the target device.
[0067] Exemplarily, the connection condition may also be that the initial signal strength is the maximum value among the signal strengths detected by each gateway node, and the load state is less than the load threshold of the gateway node. For example, if the signal strength detected by the first gateway node is the maximum value among the signal strengths detected by each gateway node in the network group, and the load state is within the load threshold range, it is determined that the first gateway node establishes a connection with the target device.
[0068] Alternatively, based on setting corresponding adjustable weights for the initial signal strength and load status, the sum of the products of the initial signal strength and load status corresponding to each gateway node based on the weights is calculated, and the maximum value of the calculated sum is used as the gateway node for establishing a connection with the target device.
[0069] Correspondingly, after the first gateway node establishes a connection with the target device, the first gateway node is responsible for managing the connection status (such as signal strength), device status, and data transmission of the target device.
[0070] Exemplarily, when there are multiple BLE devices to be connected in the WiFi Mesh network, each BLE device can be distinguished based on a device identifier (such as a device name or address information, etc.) carried in a broadcast signal of each BLE device.
[0071] For example, the signal strength of the broadcast signal 1 scanned by the current gateway node 1 is 60dBm, and the signal strength of the scanned BLE device 2 is 30dBm. The signal strength of the scanned BLE device 1 by the neighboring gateway node 1 is 20dBm, and the signal strength of the scanned BLE device 2 is 55dBm. If the load status of the two gateway nodes is within the load threshold range, then the current gateway node can establish a connection with BLE device 1, and the neighboring gateway node 1 can establish a connection with BLE device 2.
[0072] S202: When the first signal strength is lower than a first threshold, send notification information to the second gateway node; the notification information is used to notify the second gateway node to detect a second signal strength of the target device.
[0073] In the embodiment of the present application, after the first gateway node establishes a connection with the target device, the first gateway node detects the first signal strength of the target device in real time. When the first signal strength is detected to be lower than the first threshold, the target device may move to the network coverage of other gateway nodes; the first gateway node sends notification information to one or more neighboring gateway nodes (i.e., the second gateway node). The notification information includes the device identification of the target device and the currently detected signal strength (or signal strength change rate).
[0074] Exemplarily, other neighboring gateway nodes may include Figure 1 The neighboring gateway nodes 1 to 4 shown in the figure may also include neighboring gateway nodes 5 and 6; after the current gateway node 1 sends notification information to the neighboring gateway nodes 1 to 4, the notification information may be forwarded to the neighboring gateway nodes 5 and 6 respectively through the neighboring gateway nodes 2, 3 or 4.
[0075] Correspondingly, after receiving the notification information, other neighboring gateway nodes start scanning the broadcast signal of the target device based on the notification information and detect the signal strength of the target device.
[0076] S203, receiving a migration request sent by the second gateway node; the migration request is sent by the second gateway node when detecting that the second signal strength is greater than a second threshold.
[0077] In an embodiment of the present application, when the second gateway node detects that the signal strength of the target device is greater than the second threshold, it means that the target device has moved into the network coverage range of the second gateway node and is relatively close to the second gateway node. The second gateway node can send a migration request to the first gateway node.
[0078] Among them, after multiple neighboring node gateways start scanning the signal strength of the target device, the detected signal strength can be shared, and the neighboring gateway node with the largest detected signal strength is determined to send a migration request to the first gateway node. For example, neighboring gateway nodes 1 and 2 do not scan the broadcast signal of the target device, or the signal strength of the scanned broadcast signal is very small, the signal strength a scanned by neighboring gateway node 3 is less than the signal strength b scanned by neighboring gateway node 4, and when the signal strength b is greater than the second threshold, it is determined that neighboring gateway node 4 sends a migration request to the first gateway node.
[0079] In some embodiments, the migration request includes node status information of the second gateway node and expected connection quality information between the second gateway node and the target device.
[0080] The node status information includes node ID, node location, current load, available bandwidth, and node health status. The expected connection quality information includes expected signal strength (expected RSSI), expected latency, expected packet loss rate, and connection stability.
[0081] Exemplarily, the node identifier is used to uniquely identify each gateway node in the Wi-Fi Mesh network, which can be a media access control (MAC) address or other unique identifier; the node location is used to indicate the location of the gateway node in physical space, which can be represented by global positioning system (GPS) coordinates or other location description methods; the current load is used to indicate the connection and data transmission load currently processed by the gateway node, usually expressed as a percentage or the number of connected devices; the available bandwidth is used to indicate the network bandwidth currently available to the gateway node, usually in Mbps; the node health status is used to indicate the overall health status of the gateway node, including hardware status, operating temperature, error rate, etc.
[0082] Exemplarily, the expected signal strength is used to indicate the predicted signal strength between the BLE device and the target node, usually in dBm, and can be predicted based on the rate of change of the signal strength detected for the target device. The expected delay is used to indicate the predicted data transmission delay from the BLE device to the target node, usually in milliseconds (ms). Based on the detected signal strength of the target device, the transmission distance can be determined, and the data transmission delay can be predicted. The expected data packet loss rate is used to indicate the predicted data packet loss rate between the target device and the second gateway node, usually expressed as a percentage, and can be predicted by the transmission distance and the current network uplink or downlink data transmission status. Connection stability is used to indicate the predicted connection stability indicator, which is evaluated based on historical data and current network conditions.
[0083] The above-mentioned signal strength thresholds may be set based on the location of each gateway node and the network coverage of each gateway node in an actual application scenario, and are not specifically limited here.
[0084] In some embodiments, the method also includes: obtaining a second signal strength of the target device detected by the second gateway node; determining a movement trend of the target device based on a first change rate of the first signal strength and a second change rate of the second signal strength; and sending a takeover notification to the second gateway node corresponding to the movement trend, the takeover notification being used to instruct the second gateway to establish a connection with the target device.
[0085] Exemplarily, after receiving the notification information from the first gateway node, the neighboring gateway node (such as the second gateway node) starts to scan the second signal strength of the target device; after scanning the second signal strength, the neighboring gateway node can feedback to the first gateway node. The first gateway node can also calculate the second change rate of the second signal strength corresponding to each neighboring node gateway based on the second signal strength feedback from multiple neighboring gateway nodes within a period of time, and the first gateway node can also calculate the first change rate based on the first signal strength scanned by itself.
[0086] Alternatively, the neighboring gateway node calculates the second change rate based on the second signal strength scanned within a period of time, and feeds back the second change rate to the first gateway node. The first gateway node can determine the movement trend of the target device based on the first change rate and the second change rate. For example, the first gateway node determines that the movement trend of the target device is toward the second gateway node based on the second gateway node whose first change rate is negative and whose second change rate is positive and larger. Figure 1 As shown, the second change rate corresponding to the neighboring gateway node 4 is positive and the largest, and it is determined that the target device moves toward the neighboring network node 4 .
[0087] Accordingly, after determining the movement trend of the target device, the first network node may send a takeover notification to the second gateway node, indicating that the second gateway node (such as the neighboring gateway node 4) is ready to establish a connection (such as a long connection) with the target device. After receiving the takeover notification, the second gateway node may send a migration request to the first gateway node, such as node status information and expected connection quality information.
[0088] In some embodiments, the method further includes: sending the first signal strength to the second gateway node; when the target device is in a stationary state, receiving a migration request sent by the second gateway node, the migration request being issued by the second gateway node when detecting that the second signal strength is greater than the first signal strength.
[0089] For example, in some application scenarios, the signal strength of the target device relative to each gateway node will change when the target device is in a mobile state. When the target device is in a stationary state, the signal strength of the target device relative to each gateway node will also change due to changes in the network environment. Each gateway node in the WiFi Mesh network group detects the signal strength and connection status of the BLE devices within its own network coverage by scanning, and shares the signal strength and connection status between the gateway nodes. For example, the first gateway node can send the first signal strength of the detected target device to the second gateway node.
[0090] Accordingly, when the second gateway node detects that the second signal strength of the target device is greater than the first signal strength, the second gateway node sends a migration request to the first gateway node to request the first gateway node to disconnect from the target device; and after disconnection, the second gateway node establishes a new connection (such as a long connection) with the target device.
[0091] S204, based on the migration request, sending takeover information to the second gateway node, and disconnecting from the target device; the takeover information is used to instruct the second gateway node to establish a connection with the target device.
[0092] In the embodiment of the present application, in order to ensure the consistency of data transmission of the target device, the first gateway node sends takeover information to the second gateway node based on the node identifier in the migration request, and the takeover information includes the device status and connection information of the target device. After receiving the migration request, the first gateway node synchronizes the device status information and connection information of the target device to the second gateway node based on the communication protocol of the WiFi Mesh network.
[0093] Accordingly, after sending the takeover information, the first gateway node immediately disconnects from the target device, so that the second gateway node establishes a new connection with the target device based on the takeover information to ensure the continuity of data transmission. After the second gateway node establishes a connection with the target device, the second gateway node begins to receive and process data packets from the target device to maintain the continuity of data transmission.
[0094] Among them, the device status information includes: device identification (device ID), which is used to indicate the identification of a unique Bluetooth device, such as a MAC address; connection state, which is used to indicate the current connection state, such as connected, disconnected, connected, etc.; battery status, which is used to indicate the battery power of the Bluetooth device, including the current power percentage, battery health status, etc.; signal strength (RSSI), which is used to indicate the RSSI value of the Bluetooth device currently detected by the first gateway node to evaluate the signal quality; device type, which is used to indicate the type of Bluetooth device, such as sensors, smart watches, headphones, etc.; data queue, which is used to indicate the data packet information queued for processing by the Bluetooth device on the current gateway node, such as queue length and data content summary; connection history, which is used to indicate the historical connection records of the Bluetooth device, such as the gateway nodes connected in the past, the connection duration, and the switching frequency.
[0095] The connection information includes: the current session key, which is used to represent the encrypted session key between the Bluetooth device and the current gateway node to ensure the security of data transmission; connection parameters, including connection interval, timeout threshold, data transmission rate and other parameters, to ensure that the new gateway node can seamlessly take over the existing connection; the data summary, which is used to represent the data summary that has been transmitted between the current first gateway node and the Bluetooth device, including the number of data packets, data packet identifier (serial number), etc.; the pending data is used to represent the Bluetooth device data packet information that has not been processed or sent on the current first gateway node to ensure the continuity of data transmission; security authentication information, which is used to represent the authentication information between the Bluetooth device and the current first gateway node, such as device certificate, public key, etc., for the new node to verify the device identity; quality of service (QoS) information, including QoS parameters such as data transmission priority, bandwidth requirements, delay sensitivity, etc., to ensure that the connection quality meets the needs of the target device.
[0096] Exemplarily, when the target device switches from the network of the first gateway node to the second gateway node through roaming, the interaction process of the two gateway nodes may include the following process:
[0097] Initial notification: The current first gateway node (such as node A) notifies the target node (such as node B) to prepare for status synchronization and connection information exchange of BLE devices.
[0098] Transmission of status information: Node A sends the device status information of the BLE device to node B, including device identification, connection status, battery status, signal strength, device type, data queue, connection history, etc.
[0099] Sending of connection information: Node A sends connection information to node B, including the current session key, connection parameters, summary of transmitted data, unprocessed data, security authentication information, QoS information, etc.
[0100] Data verification: After receiving the device status information and connection information, Node B performs data verification to ensure the integrity and correctness of the information.
[0101] Connection switching preparation: Node B prepares to take over the connection of the BLE device based on the received takeover information and configures the corresponding connection parameters and session keys.
[0102] Connection confirmation: Node B confirms to Node A that it is ready to take over the connection.
[0103] Handover execution: Node A disconnects from the BLE device, and Node B starts to establish a connection with the BLE device, taking over data transmission and session management.
[0104] Switching completion notification: Node B notifies Node A that the switching is complete and synchronizes the latest status information.
[0105] like Figure 3 As shown in FIG. 1 , the overall implementation flow chart of the device roaming method provided in the embodiment of the present application is based on the same implementation principle as the above embodiment, which will not be repeated here. The process may include the following steps:
[0106] S30, BLE device initialization.
[0107] S31, WiFi Mesh group is established.
[0108] S32, real-time synchronization of data within the group.
[0109] S33, calculating the optimal gateway node to establish a connection for the first time.
[0110] S34, the first gateway node establishing the connection for the first time detects whether the RSSI value of the BLE device is lower than the first threshold value. If yes, execute step S35, if no, execute S310.
[0111] S35, notifying the neighboring gateway node to scan the signal strength of the BLE device.
[0112] S36, whether there is a neighboring gateway node with a high signal strength. If yes, execute S37; if no, execute S36.
[0113] S37: The second gateway node sends a connection migration request to the first gateway node.
[0114] S38, the first gateway node and the second gateway node perform status synchronization and connection switching.
[0115] S39, the new network management node (second gateway node) establishes a connection with the BLE device.
[0116] S310, stay connected.
[0117] like Figure 4 As shown, a flow chart of a device roaming method provided in an embodiment of the present application is provided. The execution subject of the method may be a second gateway node in a WiFi Mesh network group. Based on the same implementation principle as the above embodiment, it is not repeated here. The method may include the following steps:
[0118] S401, receiving notification information sent by a first gateway node; the notification information is sent by the first gateway node when detecting that the first signal strength of a target device is less than a first threshold.
[0119] S402: Detect a second signal strength of the target device according to the notification information.
[0120] S403: When the second signal strength is greater than a second threshold, send a migration request to the first gateway node.
[0121] S404: Receive takeover information sent by the first gateway node based on the migration request.
[0122] S405, after the first gateway node is disconnected from the target device, establish a connection with the target device based on the takeover information.
[0123] In some embodiments, sending a migration request to the first gateway node includes:
[0124] Based on the notification information, expected connection quality information with the target device is predicted; and the expected connection quality information and node status information are sent to the first gateway node.
[0125] The migration request includes expected connection quality information and node status information.
[0126] In some embodiments, establishing a connection with the target device based on the takeover information includes:
[0127] A connection is established with the target device based on the device status information and connection information of the target device in the takeover information.
[0128] Through the embodiment of the present application, the target device and dynamic routing mechanism are automatically discovered based on the scanning of the WiFi Mesh network, and the seamless switching of the target device between different gateway nodes is realized, ensuring the stability of the device connection during the mobile process. Based on the routing protocol of the WiFi Mesh network (such as the OLSR protocol or the wireless ad hoc network on-demand plane distance vector routing protocol (adhoc on-demand distance vector routing, AODV)), the route selection and load balancing are optimized, the overall network performance is improved, and the overload of a single node can be avoided. During the target device connection migration process, based on the sharing of state information, seamless switching connection can be achieved, the continuity of data transmission and the coherence of the session can be maintained, and the user experience is improved; it has broad application prospects and a wide range of applications, and can be applied to enable home, industrial automation and other application scenarios that require efficient Bluetooth device management.
[0129] It should be understood that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
[0130] Corresponding to the device roaming method provided in the above embodiment, such as Figure 5 As shown, an embodiment of the present application provides a device roaming apparatus. For ease of explanation, only the parts related to the embodiment of the present application are shown.
[0131] The device includes:
[0132] A detection unit 51, configured to obtain a first signal strength of a target device;
[0133] The processing unit 52 is used to send notification information to the second gateway node when the first signal strength is lower than the first threshold; the notification information is used to notify the second gateway node to detect the second signal strength of the target device;
[0134] The receiving unit 53 is configured to receive a migration request sent by the second gateway node; the migration request is sent by the second gateway node when detecting that the second signal strength is greater than a second threshold;
[0135] The sending unit 54 is used to send takeover information to the second gateway node based on the migration request and disconnect from the target device; the takeover information is used to instruct the second gateway node to establish a connection with the target device.
[0136] In a possible implementation, the detection unit 51 is also used to obtain the initial signal strength of the target device for each gateway node and the load status of each gateway node; determine the first gateway node that meets the connection conditions based on the initial signal strength and the load status; the first gateway node establishes a connection with the target device; wherein the connection condition is that the initial signal strength is greater than a third threshold and the load status is less than the load threshold of the gateway node.
[0137] In one possible implementation, the detection unit 51 is further used to obtain a second signal strength of the target device detected by the second gateway node; determine a movement trend of the target device based on a first change rate of the first signal strength and a second change rate of the second signal strength; and send a takeover notification to the second gateway node corresponding to the movement trend, the takeover notification being used to instruct the second gateway to establish a connection with the target device.
[0138] In one possible implementation, the sending unit 54 is further used to send the first signal strength to the second gateway node; the receiving unit 53 is further used to receive a migration request sent by the second gateway node when the target device is in a stationary state, and the migration request is issued by the second gateway node when it detects that the second signal strength is greater than the first signal strength.
[0139] In a possible implementation, the migration request includes node status information of the second gateway node and expected connection quality information between the second gateway node and the target device; the takeover information includes device status information and connection information of the target device.
[0140] Corresponding to the device roaming method provided in the above embodiment, such as Figure 6 As shown, an embodiment of the present application provides a device roaming apparatus. For ease of explanation, only the parts related to the embodiment of the present application are shown.
[0141] The device includes:
[0142] The receiving unit 61 is used to receive notification information sent by the first gateway node; the notification information is sent by the first gateway node when it detects that the first signal strength of the target device is less than the first threshold;
[0143] A detection unit 62, configured to detect a second signal strength of the target device according to the notification information;
[0144] A sending unit 63, configured to send a migration request to the first gateway node when the second signal strength is greater than a second threshold;
[0145] The receiving unit 61 is further configured to receive takeover information sent by the first gateway node based on the migration request;
[0146] The connecting unit 64 is configured to establish a connection with the target device based on the takeover information after the first gateway node is disconnected from the target device.
[0147] In one possible implementation, the detection unit 62 is further used to predict expected connection quality information with the target device based on the notification information; the sending unit 63 is further used to send the expected connection quality information and node status information to the first gateway node; wherein the migration request includes the expected connection quality information and node status information.
[0148] In a possible implementation, the connection unit 64 is further configured to establish a connection with the target device based on the device status information and connection information of the target device in the takeover information.
[0149] Corresponding to the device roaming method provided in the above embodiment, the embodiment of the present application further provides a device roaming system, the system comprising: a first gateway node and a second gateway node, the first gateway node and the second gateway node communicate through a preset routing protocol in a WiFiMesh network, and the first gateway node establishes a connection with a target device;
[0150] The first gateway node is used to obtain a first signal strength of the target device, and send notification information to the second gateway node when the first signal strength is lower than a first threshold;
[0151] The second gateway node is configured to receive the notification information, detect a second signal strength of the target device based on the notification information, and send a migration request to the first gateway node when detecting that the second signal strength is greater than a second threshold;
[0152] The first gateway node is configured to receive a migration request sent by the second gateway node, and based on the migration request, send takeover information to the second gateway node; and disconnect from the target device;
[0153] The second gateway node is used to receive the takeover information and establish a connection with the target device based on the takeover information.
[0154] Through the embodiments of the present application, when the signal strength detected by the first gateway node is lower than a preset first threshold, the adjacent second gateway node is notified to detect the signal strength of the target device. When the second gateway node detects that the signal strength of the target device increases and is greater than the preset second threshold, a migration request is initiated to the first gateway node. The first gateway node sends takeover information to the second gateway node based on the migration request. Before performing node roaming switching, information exchange is achieved. After the first gateway node is disconnected from the target device, a seamless connection is achieved between the target device and the second gateway node, thereby ensuring the stability of the network connection of the device during movement.
[0155] Through the embodiment of the present application, the target device and dynamic routing mechanism are automatically discovered based on the scanning of the WiFi Mesh network, and the seamless switching of the target device between different gateway nodes is realized, ensuring the stability of the device connection during the mobile process. Based on the routing protocol of the WiFi Mesh network (such as the OLSR protocol or the wireless ad hoc network on-demand plane distance vector routing protocol (adhoc on-demand distance vector routing, AODV)), the route selection and load balancing are optimized, the overall network performance is improved, and the overload of a single node can be avoided. During the target device connection migration process, based on the sharing of state information, seamless switching connection can be achieved, the continuity of data transmission and the coherence of the session can be maintained, and the user experience is improved; it has broad application prospects and a wide range of applications, and can be applied to enable home, industrial automation and other application scenarios that require efficient Bluetooth device management.
[0156] Figure 7 A schematic diagram of the hardware structure of the electronic device 7 is shown.
[0157] like Figure 7 As shown, the electronic device 7 of this embodiment includes: at least one processor 70 ( Figure 7 Only one is shown in the figure), a memory 71, in which a computer program 72 that can be run on the processor 70 is stored. When the processor 70 executes the computer program 72, the steps in the above method embodiment are implemented, such as Figure 2 Alternatively, when the processor 70 executes the computer program 72, the functions of the modules / units in the above-mentioned device embodiments are realized.
[0158] It is to be understood that the structure illustrated in the embodiment of the present application does not constitute a specific limitation on the electronic device 7. In other embodiments of the present application, the electronic device 7 may include more or fewer components than shown in the figure, or combine certain components, or separate certain components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.
[0159] The electronic device 7 may include, but is not limited to, a processor 70 and a memory 71. Those skilled in the art will appreciate that Figure 7 It is only an example of the electronic device 7 and does not constitute a limitation of the electronic device 7. It may include more or fewer components than shown in the figure, or a combination of certain components, or different components. For example, the electronic device may also include an input sending device, a network access device, a bus, etc.
[0160] The processor 70 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.
[0161] The processor 70 may also be provided with a memory for storing instructions and data. In some embodiments, the memory in the processor 70 is a cache memory. The memory may store instructions or data that the processor 70 has just used or cyclically used. If the processor 70 needs to use the instruction or data again, it may be directly called from the memory. This avoids repeated access, reduces the waiting time of the processor 70, and thus improves the efficiency of the system.
[0162] In some embodiments, the memory 71 may be an internal storage unit of the electronic device 7, such as a hard disk or memory of the electronic device 7. The memory 71 may also be an external storage device of the electronic device 7, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the electronic device 7. Further, the memory 71 may include both an internal storage unit and an external storage device of the electronic device 7. The memory 71 is used to store an operating system, an application program, a boot loader (BootLoader), data, and other programs, such as program codes of computer programs. The memory 71 may also be used to temporarily store data that has been sent or is to be sent.
[0163] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0164] It should be noted that the structure of the above-mentioned electronic device is only illustrative, and based on different application scenarios, it may also include other physical structures, and the physical structure of the electronic device is not limited here.
[0165] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0166] An embodiment of the present application also provides a chip system, which is applied to an electronic device. The chip system includes one or more processors, and the one or more processors are used to call computer instructions so that the electronic device implements the steps in the above-mentioned method embodiments.
[0167] An embodiment of the present application further provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments can be implemented.
[0168] An embodiment of the present application provides a computer program product. When the computer program product runs on an electronic device, the electronic device can implement the steps in the above-mentioned method embodiments when executing the computer program product.
[0169] If the integrated module / unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present application implements all or part of the process in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. Computer-readable media may include: any entity or device capable of carrying computer program code, recording medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium, etc.
[0170] The devices, electronic devices, chip systems, computer storage media, and computer program products provided in the above-mentioned embodiments of the present application are all used to execute the methods provided above. Therefore, the beneficial effects that can be achieved can refer to the corresponding beneficial effects of the methods provided above, and will not be repeated here.
[0171] It should be understood that the above is only to help those skilled in the art to better understand the embodiments of the present application, rather than to limit the scope of the embodiments of the present application. According to the above examples given, those skilled in the art can obviously make various equivalent modifications or changes. For example, some steps in each embodiment of the above detection method may be unnecessary, or some steps may be newly added. Or a combination of any two or any multiple embodiments of the above. Such modifications, changes or combined schemes also fall within the scope of the embodiments of the present application.
[0172] It should also be understood that the division of the methods, situations, categories and embodiments in the embodiments of the present application is only for the convenience of description and should not constitute a special limitation. The features of various methods, categories, situations and embodiments can be combined without contradiction.
[0173] It should also be understood that in the various embodiments of the present application, unless otherwise specified or there is a logical conflict, the terms and / or descriptions between different embodiments are consistent and can be referenced to each other, and the technical features in different embodiments can be combined to form new embodiments according to their internal logical relationships.
[0174] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0175] In the embodiments provided in the present application, it should be understood that the disclosed devices / network equipment and methods can be implemented in other ways. For example, the device / network equipment embodiments described above are merely schematic. For example, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0176] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0177] The embodiments described above are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, a person skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.
[0178] Finally, it should be noted that the above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions within the technical scope disclosed in the present application should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A device roaming method, characterized in that: Applied to a first gateway node, the first gateway node establishes a connection with a target device; the method comprises: Acquire a first signal strength of the target device; When the first signal strength is lower than a first threshold, sending notification information to a second gateway node; the notification information is used to notify the second gateway node to detect a second signal strength of the target device; receiving a migration request sent by the second gateway node; the migration request is sent by the second gateway node when detecting that the second signal strength is greater than a second threshold; Based on the migration request, takeover information is sent to the second gateway node, and the connection with the target device is disconnected; the takeover information is used to instruct the second gateway node to establish a connection with the target device.
2. The method according to claim 1, characterized in that Before obtaining the first signal strength of the target device, the method further includes: Obtaining an initial signal strength of the target device for each gateway node and a load status of each gateway node; Determining the first gateway node that meets the connection condition according to the initial signal strength and the load status; The first gateway node establishes a connection with the target device; The connection condition is that the initial signal strength is greater than a third threshold, and the load state is less than a load threshold of the gateway node.
3. The method according to claim 1, characterized in that The method further comprises: Acquire a second signal strength detected by the second gateway node for the target device; determining a movement trend of the target device according to a first change rate of the first signal strength and a second change rate of the second signal strength; A takeover notification is sent to the second gateway node corresponding to the movement trend, where the takeover notification is used to instruct the second gateway to establish a connection with the target device.
4. The method according to claim 3, characterized in that The method comprises: sending the first signal strength to the second gateway node; When the target device is in a stationary state, a migration request sent by the second gateway node is received, where the migration request is sent by the second gateway node when detecting that the second signal strength is greater than the first signal strength.
5. The method according to any one of claims 1 to 4, characterized in that: The migration request includes node status information of the second gateway node and expected connection quality information between the second gateway node and the target device; the takeover information includes device status information and connection information of the target device.
6. A device roaming method, characterized in that: Applied to a second gateway node; the method comprises: Receiving notification information sent by the first gateway node; the notification information is sent by the first gateway node when detecting that the first signal strength of the target device is less than a first threshold; Detecting a second signal strength of the target device according to the notification information; When the second signal strength is greater than a second threshold, sending a migration request to the first gateway node; receiving takeover information sent by the first gateway node based on the migration request; After the first gateway node is disconnected from the target device, a connection is established with the target device based on the takeover information.
7. The method according to claim 6, characterized in that Sending a migration request to the first gateway node includes: Based on the notification information, predicting expected connection quality information with the target device; Sending the expected connection quality information and node status information to the first gateway node; The migration request includes the expected connection quality information and the node status information.
8. The method according to claim 6 or 7, characterized in that: The establishing a connection with the target device based on the takeover information includes: A connection is established with the target device based on the device status information and connection information of the target device in the takeover information.
9. A device roaming system, characterized in that: The system includes: a first gateway node and a second gateway node, the first gateway node and the second gateway node communicate with each other through a preset routing protocol in a WiFi Mesh network, and the first gateway node establishes a connection with a target device; The first gateway node is used to obtain a first signal strength of the target device, and send notification information to the second gateway node when the first signal strength is lower than a first threshold; The second gateway node is configured to receive the notification information, detect a second signal strength of the target device based on the notification information, and send a migration request to the first gateway node when detecting that the second signal strength is greater than a second threshold; The first gateway node is configured to receive a migration request sent by the second gateway node, send takeover information to the second gateway node based on the migration request, and disconnect from the target device; The second gateway node is used to receive the takeover information and establish a connection with the target device based on the takeover information.
10. An electronic device, characterized in that: The electronic device includes at least one processor and a memory communicatively connected to the at least one processor; wherein the memory stores a computer program executed by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the method described in any one of claims 1 to 8.