Relay selection method and device, electronic device, and storage medium for Mesh network
By sending and listening to broadcast messages in the Mesh network, obtaining the communication status of devices and selectively enabling the relay function, the problem of misjudgment caused by unclear topology structure in the Mesh network is solved, and the reliability and stability of the network are improved.
Patent Information
- Application Number
- CN202211550131.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-05
- Publication Date
- 2025-09-30
- Estimated Expiration
- 2042-12-05
AI Technical Summary
In large-capacity and dense Mesh networks, existing technologies cannot effectively obtain the topology of Mesh devices during the relay process, resulting in misjudgment and reducing the reliability of Mesh networking.
By sending and listening to broadcast messages, the communication status of each device is obtained, the relay function is selectively enabled, and the target device is selected as the relay node to form a stable topology structure.
It improves the reliability of Mesh networking, reduces the probability of misjudgment, and achieves stable communication between devices.
Smart Images

Figure CN116132301B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of Mesh networks, and more specifically, to a method and device for selecting a relay for a Mesh network, an electronic device, and a storage medium. Background Art
[0002] Currently, mesh (wireless mesh) networks are based on flood management. Messages are transmitted via broadcast signals, and mesh nodes that receive messages are able to forward them. This allows for progressively longer-range message transmission. However, in high-capacity, dense mesh networks, if all mesh devices have relay features enabled, the number of messages relayed within the mesh network can be excessive, leading to congestion in the broadcast channel and even resolution failures.
[0003] To address the aforementioned technical issues, the related art provides the following solution: A mesh device in a mesh network automatically detects the number of other mesh devices with relay features enabled within its communication range. If the number is below a lower threshold, the relay feature is enabled for the local mesh device. If the number is above an upper threshold, the relay feature is disabled for the local mesh device.
[0004] During the implementation of the embodiments of the present disclosure, it was found that at least the following problems exist in the related art:
[0005] The technical solution adopted by the related technology cannot know the topological structure of the Mesh device during the relay process, resulting in the Mesh device that should turn on the relay feature not turning on the relay, and the Mesh device that does not need to turn on the relay feature turning on the relay. There is a possibility of misjudgment, which reduces the reliability of the Mesh network.
[0006] It should be noted that the information disclosed in the above background technology section is only used to enhance the understanding of the background of this application, and therefore may include information that does not constitute prior art known to ordinary technicians in this field. Summary of the Invention
[0007] In order to provide a basic understanding of some aspects of the disclosed embodiments, a brief summary is given below. The summary is not an extensive review, nor is it intended to identify key / critical elements or delineate the scope of protection of these embodiments, but rather serves as a prelude to the detailed description that follows.
[0008] The embodiments of the present disclosure provide a method and apparatus for selecting a relay for a Mesh network, an electronic device, and a storage medium, so as to obtain the topology of the Mesh network during the relay process and improve the reliability of the Mesh network.
[0009] In some embodiments, the method includes: sending a broadcast message of the present device and listening to broadcast messages sent by other devices; when the present device is a relay node, obtaining the communication status of each device; when there is a device whose communication status meets the preset stable communication conditions, selecting a target device, and sending a relay function activation instruction to the target device to make the target device a relay node.
[0010] In some embodiments, each broadcast message includes a field indicating the communication status of the device sending the broadcast message; wherein the field includes: a quantity field for indicating the number of communication relay nodes of the device; and a status field for indicating the relay status of the device.
[0011] In some embodiments, a device whose communication status satisfies a preset stable communication condition includes a device whose relay status is a non-relay node and the number of communication relay nodes is 1.
[0012] In some embodiments, the method further includes: when the device is a non-relay node, updating the communication status of the device according to broadcast messages sent by other devices.
[0013] In some embodiments, updating the communication status of the device includes: counting the number of devices in relay status as relay nodes within the coverage area of the device in the received broadcast message; and updating the number of communication relay nodes of the device based on the number of devices.
[0014] In some embodiments, updating the communication status of the device includes: upon receiving a relay function activation instruction, updating the relay status of the device to a relay node.
[0015] In some embodiments, the selecting of the target device includes: among the broadcast messages sent by the other devices, taking the broadcast message with a signal strength less than a strength threshold as the target broadcast message; and taking the device sending the target broadcast as the target device.
[0016] In some embodiments, after sending the relay function activation instruction to the target device, it also includes: continuing to monitor the broadcast messages sent by other devices of this device to obtain the communication status of each device; in the absence of a device whose communication status meets the preset stable communication conditions, sending a relay selection instruction to the target device to enable the target device to activate the relay selection function.
[0017] In some embodiments, the method further includes: if there is no device whose communication status satisfies the preset stable communication condition, stopping selecting the target device from the other devices.
[0018] In some embodiments, the method further includes: setting the device as a relay node in response to a relay selection instruction; or setting the device as a relay node in response to a relay start instruction.
[0019] In some embodiments, the apparatus includes: a processor and a memory storing program instructions, wherein the processor is configured to execute the aforementioned method for selecting a relay for a Mesh network when running the program instructions.
[0020] In some embodiments, the electronic device includes: a selection relay device for a Mesh network as described above.
[0021] In some embodiments, the storage medium stores program instructions, and when the program instructions are run, the program instructions execute the aforementioned method for selecting a relay for a Mesh network.
[0022] The relay selection method and device, electronic device, and storage medium for a Mesh network provided by the embodiments of the present disclosure can achieve the following technical effects:
[0023] This device sends broadcast messages while listening to broadcast messages sent by other devices. In the case that this device is a relay node, it has a relay function, so that other devices are located within the coverage area of a relay node. At the same time, this device continuously determines whether there is a device among other devices whose communication status meets the preset stable communication conditions by listening to broadcast messages. If so, the target device is selected and made to have a relay function. In this way, other devices can be located within the coverage area of two relay nodes at the same time to achieve stable communication. Therefore, this device learns about the communication status of each device by listening to broadcast messages, and with the assistance of the target device with the relay function turned on, triggers other devices to be located within the coverage area of at least two relay nodes to meet stable communication.
[0024] In summary, this application obtains the communication status of the device by monitoring broadcast messages, and selectively enables the relay function according to the communication status of the device, thereby indirectly obtaining the topological structure of other devices in the relay selection process, reducing the probability of misjudgment, and improving the reliability of Mesh networking.
[0025] The above general description and the following description are exemplary and explanatory only and are not intended to limit the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0027] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0028] Figure 1 is a schematic diagram of a Mesh network system environment according to an embodiment of the present application;
[0029] Figure 2 is a schematic diagram of a method for selecting a relay for a Mesh network provided by an embodiment of the present disclosure;
[0030] Figure 3 is a schematic diagram of another method for selecting a relay for a Mesh network provided by an embodiment of the present disclosure;
[0031] Figure 4 is a schematic diagram of another method for selecting a relay for a Mesh network provided by an embodiment of the present disclosure;
[0032] Figure 5 is a schematic diagram of another method for selecting a relay for a Mesh network provided by an embodiment of the present disclosure;
[0033] Figure 6 is a schematic diagram of another method for selecting a relay for a Mesh network provided by an embodiment of the present disclosure;
[0034] Figure 7 is a schematic diagram of another method for selecting a relay for a Mesh network provided by an embodiment of the present disclosure;
[0035] Figure 8 is a schematic diagram of another method for selecting a relay for a Mesh network provided by an embodiment of the present disclosure;
[0036] Figure 9 is a schematic diagram of another method for selecting a relay for a Mesh network provided by an embodiment of the present disclosure;
[0037] Figure 10-1 A schematic diagram showing a topological structure of the electronic device 1;
[0038] Figure 10-2 express Figure 10-1 Communication status of broadcast messages of electronic devices in different areas of the communicable coverage area S;
[0039] Figure 11-1 Another schematic diagram showing a topological structure of the electronic device 1;
[0040] Figure 11-2 express Figure 11-1The communication status of the broadcast message of the electronic device within the communicable coverage area S;
[0041] Figure 12-1 Another schematic diagram showing a topological structure of the electronic device 1;
[0042] Figure 12-2 express Figure 12-1 Communication status of broadcast messages of electronic devices in different areas of the communicable coverage area S;
[0043] Figure 13 A schematic diagram showing an application of an embodiment of the present disclosure;
[0044] Figure 14 A schematic diagram showing a relay device selection method for a Mesh network according to an embodiment of the present disclosure;
[0045] Figure 15 A schematic diagram showing another method for selecting a relay device for a Mesh network provided by an embodiment of the present disclosure. DETAILED DESCRIPTION
[0046] In order to enable those skilled in the art to better understand the present invention, the following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments in the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts should fall within the scope of protection of this application.
[0047] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequential order. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in a sequence other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0048] The above-mentioned network may include the embodiments of the present disclosure, and smart home appliances refer to home appliances formed by introducing microprocessors, sensor technology, and network communication technology into home appliances, which have the characteristics of intelligent control, intelligent perception, and intelligent application. The operation process of smart home appliances often relies on the application and processing of modern technologies such as the Internet of Things, the Internet, and electronic chips. For example, smart home appliances can realize remote control and management of smart home appliances by users by connecting to electronic devices.
[0049] The aforementioned network includes, but is not limited to, at least one of the following: a wired network and a wireless network. The aforementioned wired network may include, but is not limited to, at least one of the following: a wide area network, a metropolitan area network, and a local area network. The aforementioned wireless network may include, but is not limited to, at least one of the following: Wi-Fi (Wireless Fidelity) and Bluetooth. The terminal device 102 may be, but is not limited to, a PC, a mobile phone, a tablet computer, a smart air conditioner, a smart range hood, a smart refrigerator, a smart oven, a smart stove, a smart washing machine, a smart water heater, a smart washing machine, a smart dishwasher, a smart projection device, a smart TV, a smart clothes drying rack, smart curtains, smart audio and video, a smart socket, a smart speaker, a smart fresh air device, smart kitchen and bathroom equipment, smart bathroom equipment, a smart sweeping robot, a smart window cleaning robot, a smart mopping robot, a smart air purifier, a smart steamer, a smart microwave oven, a smart kitchen treasure, a smart purifier, a smart water dispenser, a smart door lock, etc.
[0050] In the embodiments of the present disclosure, electronic devices include network devices and smart home appliances. Network devices include switches, routers, firewalls, bridges, hubs, gateways, etc.
[0051] Figure 1 A schematic diagram of the Mesh network system environment provided by the embodiment of the present disclosure is shown. Figure 1 As shown, the Mesh network includes multiple electronic devices. The multiple electronic devices are of the same type and have approximately the same RF performance. That is, the transmit power and receive sensitivity of each electronic device are substantially equal.
[0052] In the embodiments of the present disclosure, any electronic device is configured with its communicable coverage area. As an example, the communicable coverage area of a certain electronic device is represented as a substantially circular area centered on the electronic device. It is understood that the shape of the communicable coverage area corresponding to any electronic device is not specifically limited.
[0053] In the embodiment of the present disclosure, the communication environment of any electronic device is as follows: taking two electronic devices as an example, when electronic device 1 sends a broadcast message and electronic device 2 also sends a broadcast message, electronic device 2 can stably receive the broadcast message sent by electronic device 1 and electronic device 1 can also stably receive the broadcast message sent by electronic device 2.
[0054] In the embodiment of the present disclosure, the signal strength characterizes the stability of communication. The signal strength can be reflected by RSSI (Received Signal Strength Indicator). The signal strength and device type can be referred to Table 1. The device type characterizes the type of stable communication of the device. In the case where the device type is a proximal device, a second proximal device, and a stable remote device, it indicates that the device is an electronic device with stable communication. In the case where the device type is an unstable remote communication, it indicates that the device is an electronic device with unstable communication. Therefore, the embodiment of the present disclosure can determine the device type based on the signal strength RSSI of the received broadcast message.
[0055] Taking electronic device 1 as an example, in the coverage area where electronic device 1 can communicate, electronic device 1 listens for broadcast messages sent by other devices. When the signal strength RSSI of the received broadcast message is less than the strength threshold, it indicates that the electronic device sending the broadcast message is an electronic device with unstable communication. When the signal strength RSSI of the received broadcast message is greater than or equal to the strength threshold, it indicates that the electronic device sending the broadcast message is an electronic device with stable communication. The strength threshold can be determined based on the communication performance of the electronic device and the communication reliability of the Mesh network. As an example, the value of the strength threshold is greater than or equal to -85dBm and less than or equal to -80dBm.
[0056] Table 1 Comparison table of signal strength and device type
[0057]
[0058]
[0059] In the disclosed embodiments, all electronic devices transmit broadcast messages within their respective communication coverage areas and monitor broadcast messages transmitted by other devices within their respective communication coverage areas. Each broadcast message includes a field indicating the communication status of the device transmitting the broadcast message. These fields include a quantity field and a status field. The quantity field indicates the number of communication relay nodes associated with the device. The status field indicates the relay status of the device.
[0060] By configuring the quantity and status fields in broadcast messages, electronic devices can switch their communication status based on received relay selection and activation commands, allowing management devices to obtain real-time information about the communication status of other devices. Furthermore, while monitoring broadcast messages, management devices can learn about the communication status of other devices, providing accurate data for subsequent communication stability assessments.
[0061] The relay status includes relay node or non-relay node. If the relay status of the device is a relay node, the status field is 1. If the relay status of the device is a non-relay node, the status field is 0. A communication relay node represents a relay node that can reliably communicate with the device. As an example, if electronic device 1 is simultaneously within the communication coverage area of electronic device 2 and electronic device 3, and electronic device 2 and electronic device 3 are both relay nodes, the broadcast message sent by electronic device 1 includes a quantity field of 2.
[0062] It should be noted that, when all electronic devices send broadcast messages within their respective communicable coverage areas, the initial value of the quantity field is 0, and the initial value of the status field is 0.
[0063] In the disclosed embodiments, Table 2 shows a table of electronic device roles. As shown in Table 2, based on the type of command being responded to, the electronic devices include broadcast devices, relay devices, and management devices. Broadcast devices, relay devices, and management devices all continuously send broadcast messages and update the device's communication status.
[0064] The broadcasting device refers to an electronic device that has not received a relay selection instruction and has not received a relay start instruction.
[0065] The management device refers to an electronic device that the broadcasting device sets as a relay node in response to a relay selection instruction.
[0066] The relay device refers to an electronic device that is set as a relay node in response to a relay start instruction sent by a management device.
[0067] The relay selection command is used to enable the relay selection function and the relay function. The relay enable command is used to enable the relay function.
[0068] Table 2 Functions of electronic equipment
[0069]
[0070] In Table 2, when the column attributes are "Send Broadcast Message" and "Update Communication Status," a √ indicates execution, and an "X" indicates non-execution. When the column attributes are "Relay Enable Function" and "Relay Select Function," a √ indicates availability. When the column attribute is "Update Communication Status," a √ indicates availability, and an "X" indicates non-availability.
[0071] It should be noted that, in response to the relay selection instruction, the broadcast device may respond to the relay selection instruction sent by the user. Correspondingly, the broadcast device that responds to the relay selection instruction sent by the user is the first management device with a relay function and the first management device with a relay selection function, hereinafter referred to as the first-round management device. In addition, the management device with a relay selection function and a relay function after the first-round management device is referred to as the second-round management device. Optionally, before the broadcast device responds to the relay selection instruction sent by the user, it also includes: the broadcast device is connected to the terminal device associated with the user through Bluetooth GATT (Generic Attribute Profile). Alternatively, before the broadcast device responds to the relay selection instruction sent by the user, it also includes: the broadcast device monitors the broadcast message sent by the terminal device associated with the user, and the broadcast message includes the relay selection instruction. Wherein, the user is located at any location in the Mesh network.
[0072] In response to the relay selection instruction, the relay device may also switch the device to a management device in response to the relay selection instruction sent by the management device. The management device that sends the relay selection instruction includes a first-round management device or a second-round management device. The relay device switches the device to a management device, including: the relay device switches the device to a second-round management device. It can be understood that the second-round management device can be generated by the relay device in response to the relay selection instruction sent by the first-round management device, or can be generated by the relay device in response to the relay selection instruction sent by the second-round management device.
[0073] In addition, the first round of management devices is generated by the broadcasting device in response to the relay selection instruction sent by the user. The second round of management devices is generated by the relay device in response to the relay selection instruction sent by the first round of management devices or the second round of management devices. The difference between the second round of management devices and the first round of management devices is:
[0074] First, the main body of the equipment is different: the main body of the equipment for the first round of management is the broadcasting equipment, while the main body of the equipment for the second round of management is the relay equipment.
[0075] Second, the sources of relay selection instructions are different: the instruction source of the first-round management device is the user, and the instruction source of the second-round management device is the first-round management device or the second-round management device.
[0076] The broadcasting device continues to send broadcast messages unless it receives a relay selection command or a relay enable command. Upon receiving a relay enable command from the management device, the broadcasting device configures itself as a relay node and switches to a relay device. After switching to a relay device, the broadcasting device switches to a management device upon receiving a relay selection command from the management device.
[0077] As shown in Table 3, the functions of the relay device and the broadcast device are switched as shown in Table 3.
[0078] Table 3 Function switching table
[0079]
[0080] In the table, √ indicates the existence of the above situation, and / indicates the non-existence of the above situation. Taking the first row of data corresponding to the response to the relay activation instruction in Table 3 as an example, / indicates that the relay device does not respond to the relay activation instruction. Taking the first row of data corresponding to the response to the relay selection instruction sent by the user in Table 3 as an example, / indicates that the relay device does not respond to the relay selection instruction sent by the user.
[0081] Based on the above Mesh network system, combined with Figure 2 As shown, the embodiment of the present disclosure provides a method for selecting a relay for a Mesh network, including:
[0082] S01: The management device sends a broadcast message from this device and monitors broadcast messages from other devices. In this step, "other devices" refers to electronic devices other than the management device itself. The management device monitors broadcast messages from other devices, including monitoring broadcast messages from other devices at a preset period. The management device sends broadcast messages from this device at a broadcast period. The preset period can be a multiple of the management device's broadcast period. The multiple is greater than 1. This ensures that the management device can monitor as many broadcast devices as possible within the communication coverage area of this device.
[0083] S02: The management device obtains the communication status of each device when the management device is a relay node.
[0084] In this step, the device is determined to be a relay node in the following manner:
[0085] In response to the relay selection instruction sent by the user, the management device updates the device from a non-relay node to a relay node and updates the status field indicating the relay status of the device. The management device is the first management device with both relay functionality and relay selection functionality.
[0086] Alternatively, the relay device maintains a status field indicating the relay status of the device in response to the relay selection instruction sent by the management device. It is understandable that since the relay status of the relay device is that of a relay node, the relay device maintains the status field indicating the relay status of the device after responding to the relay selection instruction sent by the management device.
[0087] S03 , when there is a device whose communication status satisfies the preset stable communication condition, the management device selects a target device and sends a relay function activation instruction to the target device to make the target device a relay node.
[0088] Using the relay selection method for Mesh networks provided by the embodiment of the present disclosure, this device sends broadcast messages while listening to broadcast messages sent by other devices. In the case where this device is a relay node, it has a relay function, so that other devices are located within the coverage area of a relay node. At the same time, this device continuously determines whether there is a device among other devices whose communication status meets the preset stable communication conditions by monitoring broadcast messages. If so, the target device is selected and made to have a relay function. In this way, other devices can be located within the coverage area of two relay nodes at the same time to achieve stable communication. Therefore, this device obtains the communication status of each device by monitoring broadcast messages, and with the assistance of the target device with the relay function turned on, triggers other devices to be located within the coverage area of at least two relay nodes to meet stable communication.
[0089] In summary, this application obtains the communication status of the device by monitoring broadcast messages, and selectively enables the relay function according to the communication status of the device, thereby indirectly obtaining the topological structure of other devices in the relay selection process, reducing the probability of misjudgment, and improving the reliability of Mesh networking.
[0090] It should be noted that the execution subject of the embodiment of the present disclosure is a management device, which can be a first-round management device or a second-round management device. The above definition of the execution subject also applies to the embodiments disclosed below.
[0091] Optionally, the device whose communication status satisfies a preset stable communication condition includes:
[0092] A device whose relay status is a non-relay node and the number of communication relay nodes is 1.
[0093] In this way, when the management device determines that there is a broadcast message in which the relay state is a non-relay node status field and the number of communication relay nodes is 1 in the broadcast message received by the management device from other devices, it indicates that there is a device within the coverage area of the management device that has not turned on the relay and is only located within the coverage area of the management device. However, if the electronic device is located within the coverage area of a relay node, the stable communication of the electronic device cannot be guaranteed. Therefore, the embodiment of the present disclosure can determine whether the device sending the broadcast message meets the preset stable communication conditions through the status field and quantity field included in the received broadcast message.
[0094] Combine Figure 3 As shown, the embodiment of the present disclosure also provides a method for selecting a relay for a Mesh network, including:
[0095] S11, the electronic device sends a broadcast message of the device and monitors the broadcast messages sent by other devices. In this step, other devices refer to other electronic devices except the electronic device.
[0096] S12: When the electronic device is a relay node, the electronic device obtains the communication status of each device.
[0097] S13 , when there is a device whose communication status satisfies the preset stable communication condition, the management device selects a target device and sends a relay function activation instruction to the target device to make the target device a relay node.
[0098] S14: When the broadcasting device or relay device is not a relay node, the broadcasting device or relay device updates the communication status of the device according to the broadcast message sent by other devices. In this step, other devices refer to other electronic devices except the broadcasting device.
[0099] By adopting the relay selection method for Mesh network provided by the embodiment of the present disclosure, when the broadcast message is a non-relay node, the communication status of the device is updated according to the broadcast messages sent by other devices, so that the management device can monitor the broadcast messages that reflect the communication status of the broadcast device in real time, and thus know whether the device sending the broadcast message can communicate stably based on the broadcast message.
[0100] It should be noted that the steps of updating the communication status of a broadcasting device or relay device based on broadcast messages sent by other devices are performed simultaneously with the steps of the electronic device sending its own broadcast message and monitoring broadcast messages sent by other devices. This allows the management device to monitor broadcast messages that accurately reflect the communication status of the broadcast message, improving the accuracy and reliability of the judgment of the stable communication of the device sending the broadcast message.
[0101] Combine Figure 4 As shown, the embodiment of the present disclosure also provides a method for selecting a relay for a Mesh network, including:
[0102] S21, the management device sends a broadcast message of the device and monitors the broadcast messages sent by other devices.
[0103] S22: When the management device is a relay node, the management device obtains the communication status of each device.
[0104] S23 , when there is a device whose communication status satisfies the preset stable communication condition, the management device selects a target device and sends a relay function activation instruction to the target device to make the target device a relay node.
[0105] S24 , when the broadcasting device is a non-relay node, the broadcasting device counts the number of devices in the coverage area of the device that are in relay state as relay nodes in the received broadcast messages.
[0106] S25, the broadcasting device updates the number of communication relay nodes of the device according to the number of devices.
[0107] In the relay selection method for a mesh network provided in the embodiments of the present disclosure, a broadcast device counts the number of devices in the coverage area of the broadcast device that are in relay node status within the received broadcast message, allowing the management device to monitor the broadcast message, which reflects the real-time number of broadcast devices. Since the number of communication relay nodes greater than one indicates that the electronic device is simultaneously within the coverage area of two relay nodes, enabling stable communication, the method of updating the number of communication relay nodes of the device in the broadcast message in the embodiments of the present disclosure helps improve the reliability of the management device's judgment of the stable communication of the device sending the broadcast message.
[0108] Optionally, the broadcasting device updates the number of communication relay nodes of the device according to the number of devices, including:
[0109] When the number of devices is p, the number of communication relay nodes that update this device is p. p>1 and is an integer.
[0110] Combine Figure 5 As shown, the embodiment of the present disclosure also provides a method for selecting a relay for a Mesh network, including:
[0111] S31, the management device sends a broadcast message of the device and monitors the broadcast messages sent by other devices.
[0112] S32: When the management device is a relay node, the management device obtains the communication status of each device.
[0113] S33 , when there is a device whose communication status satisfies the preset stable communication condition, the management device selects a target device and sends a relay function activation instruction to the target device to make the target device a relay node.
[0114] S34: When the broadcasting device is a non-relay node and receives a relay function activation instruction, the broadcasting device updates the relay status of the device to a relay node. In this step, the broadcasting device switches the device to a relay device.
[0115] Using the relay selection method for Mesh networks provided by the embodiment of the present disclosure, the broadcasting device updates the relay status of the device to relay when the device is a non-relay node and receives a relay function activation instruction. At this time, the broadcasting device has a relay function. On this basis, the broadcasting device switches to a relay device so that other devices except the device and the management device can be located in the coverage area of the two relay nodes of the device (the broadcasting device switched to a relay device) and the management device at the same time. When other devices are located in the coverage area of the two relay nodes of the device (the broadcasting device switched to a relay device) and the management device at the same time, their quantity fields are updated, thereby updating their communication status, so that the management device can monitor the broadcast message that reflects the device quantity field in real time, thereby improving the reliability of the management device's judgment on the stable communication of the device sending the broadcast message.
[0116] Combine Figure 6 As shown, the embodiment of the present disclosure also provides a method for selecting a relay for a Mesh network, including:
[0117] S41, the management device sends a broadcast message of the device and monitors the broadcast messages sent by other devices.
[0118] S42: When the management device is a relay node, the management device obtains the communication status of each device.
[0119] S43 , when there is a device whose communication status satisfies the preset stable communication condition, the management device selects a target device and sends a relay function activation instruction to the target device to make the target device a relay node.
[0120] S44: When the broadcasting device is a non-relay node and receives a relay function activation instruction, the broadcasting device updates the relay status of the device to a relay node. In this step, the broadcasting device switches the device to a relay device.
[0121] In step S45, the relay device (the relay device indicated in step S44) performs a relay selection operation in response to the relay selection instruction. In this step, after the broadcast device in step S44 switches to the relay device, it switches to the secondary management device upon receiving the relay selection instruction sent by the primary management device.
[0122] Using the relay selection method for a mesh network provided by the disclosed embodiments, a broadcasting device that has switched to a relay device switches again to a secondary management device. This secondary management device now has both relay selection and relay functions, allowing it to determine the communication stability of broadcasting devices within its coverage area. This allows relay selection to be performed gradually within the mesh network, ultimately achieving reliable mesh networking.
[0123] Optionally, combined Figure 7 As shown, the management device selects the target device, including:
[0124] S51: The management device uses, among the broadcast messages sent by other devices, a broadcast message with a signal strength less than a strength threshold as a target broadcast message.
[0125] S52: The management device takes the device that sends the target broadcast as the target device.
[0126] Since the strength threshold represents the critical value between electronic devices with stable communication and those with unstable communication, the management device selects broadcast messages with signal strengths less than the strength threshold as target broadcast messages and the device that sent the target broadcast message as the target device. In this way, the disclosed embodiment can select reliable target devices.
[0127] Optionally, when there are multiple broadcast messages with signal strengths less than a strength threshold, the management device determines a target broadcast message in the following manner:
[0128] Randomly select one of them as the target broadcast message.
[0129] In this case, the management device may receive multiple target broadcast messages. In this case, the management device randomly selects one of them as the target broadcast message, thereby covering all electronic devices in the Mesh network as much as possible.
[0130] Combine Figure 8 As shown, the embodiment of the present disclosure also provides a method for selecting a relay for a Mesh network, including:
[0131] S61: The management device sends a broadcast message of the device itself and monitors broadcast messages sent by other devices.
[0132] S62: When the management device is a relay node, the management device obtains the communication status of each device.
[0133] S63 , when there is a device whose communication status satisfies the preset stable communication condition, the management device selects a target device and sends a relay function activation instruction to the target device to make the target device a relay node.
[0134] In this step, the number of times the management device selects a target device is theoretically determined by the characteristics of the mesh network. If the mesh network is a dense nonlinear mesh network, the number of target device selections is greater than or equal to 3 and less than or equal to 6. If the mesh network is a linear mesh network, the number of target device selections can be 1 or 2.
[0135] S64: The management device continues to monitor the broadcast messages sent by other devices to obtain the communication status of each device. In this step, after selecting the target device and turning on the relay function of the target device, the management device returns to the step of monitoring the broadcast messages sent by other devices in step S61.
[0136] S65 , when there is no device whose communication status satisfies the preset stable communication condition, the management device sends a relay selection instruction to the target device, so that the target device activates a relay selection function.
[0137] In this step, there is no device whose communication status meets the preset stable communication conditions, including:
[0138] There is no device whose relay state is a non-relay node and the number of communication relay nodes is 1.
[0139] It should be noted that the absence of a device whose communication status meets the preset stable communication conditions is determined in the following manner: a device whose relay status is a relay node, or a device whose number of communication relay nodes is greater than or equal to 2. In this way, when the management device determines that a device is a relay node in a broadcast message received from other devices, it indicates that the electronic device is capable of stable communication. Alternatively, when the management device determines that the number of communication relay nodes in a broadcast message received from other devices is greater than or equal to 2, it indicates that the electronic device is simultaneously located in the coverage area of at least two relay nodes and is capable of stable communication. In any of the above cases, the management device has determined that all devices within the coverage area of this device are simultaneously located in the coverage area of at least two relay nodes, and therefore terminates the step of selecting the target device.
[0140] Using the relay selection method for a Mesh network provided by an embodiment of the present disclosure, the management device selects a target device and turns on the relay function of the target device when there is a device whose communication status meets the preset stable communication conditions. The management device continues to monitor the broadcast messages sent by other devices and obtains the communication status of each device. In the absence of a device whose communication status meets the preset stable communication conditions, it means that all devices in the coverage area of this device are simultaneously located in the coverage area of at least two relay nodes, and stable communication can be achieved. At this time, the management device sends a relay selection instruction to the target device, causing the target device to turn on the relay selection function, so that the relay selection operation in the Mesh network is gradually executed, and finally all electronic devices in the Mesh network are networked.
[0141] Combine Figure 9 As shown, the embodiment of the present disclosure also provides a method for selecting a relay for a Mesh network, including:
[0142] S71, the management device sends a broadcast message of the device and monitors the broadcast messages sent by other devices.
[0143] S72: When the management device is a relay node, the management device obtains the communication status of each device.
[0144] S73 , when there is a device whose communication status satisfies the preset stable communication condition, the management device selects a target device and sends a relay function activation instruction to the target device to make the target device a relay node.
[0145] S74: If there is no device whose communication status satisfies the preset stable communication condition, the management device stops selecting the target device from other devices.
[0146] In the mesh network relay selection method provided by the embodiments of the present disclosure, if no device exists whose communication status meets the preset stable communication conditions, the target device selection from other devices is stopped. This terminates the target device selection step. At this point, the management device relay selection is complete.
[0147] Optionally, after the management device stops selecting the target device from other devices, the following steps are further included:
[0148] The management sends a notification message to the server associated with the device to notify the server that the device stops relay selection.
[0149] In this way, the server is notified of the present device in real time to complete the relay selection operation.
[0150] Optionally, the method further includes:
[0151] The broadcasting device sets the device as a relay node in response to the relay selection instruction; or
[0152] The broadcasting device sets itself as a relay node in response to the relay start instruction.
[0153] In this way, the broadcasting device responds to the relay selection instruction, sets itself as a relay node, and switches to a management device. In response to the relay start instruction, the broadcasting device responds to the relay start instruction, sets itself as a relay node, and switches to a relay device.
[0154] In a practical application, Figure 13 As shown, the user is located at any location in the Mesh network. The user carries a terminal device. The terminal device is directly connected to a broadcasting device via Bluetooth GATT and sends a relay selection instruction to the broadcasting device directly connected to the device. The broadcast message sent by the broadcasting device includes a quantity field n0 and a status field m0. The broadcast message sent by other devices includes a quantity field n0 and a status field m0. i And the status field m j Among them, the initial value of n0 is 0, and the initial value of m0 is 0. j The initial value is 0, mj The initial value is 0. i=1,2,...,N.
[0155] The relay selection method for a mesh network performs the following steps:
[0156] S101, multiple broadcast devices in the Mesh network send broadcast messages and listen to broadcast messages sent by other devices. The broadcast message includes a quantity field n i And the status field m j .
[0157] S102 , a broadcasting device responds to a relay selection instruction sent by a user, turns on the relay state and relay selection function of the node, and switches to a management device; updates the state field; n0=0, m0 is updated to 1.
[0158] S103, the number field n in the broadcast message of other broadcast devices located in the communication coverage area of the management device (the management device in step S102) j Update to 1, j=1,2.
[0159] S104: When the management device is a relay node, it obtains the communication status of other devices, that is, it obtains a broadcast message with n1=1 and m1=0, and obtains a broadcast message with n2=1 and m2=0, and determines the communication status of the two devices.
[0160] S105, the management device determines whether there is a sending n i =1 and m i = 0, it is determined that there is a device whose communication status meets the preset stable communication condition, and S106 is executed.
[0161] S106 , when there are multiple broadcast messages with signal strengths less than a strength threshold, the management device randomly selects one of them as a target broadcast message, and selects the broadcast device that sends the target broadcast as the target device.
[0162] S107, the management device sends a relay start instruction to the target device.
[0163] S108 , the state field m1 of the broadcasting device receiving the relay start instruction is updated to 1, and the broadcasting device continues to send broadcast messages to update the communication state and switches to a relay device; wherein n1=1, m1=1.
[0164] S109, the broadcasting device that has not received the relay start instruction is located in the coverage area where the management device and the relay device can communicate at the same time, n2 is updated to 2; and continues to send broadcast messages to update the communication status; wherein n2=2, m2=0.
[0165] S110, the management device determines whether n j =1 and m j = 0 broadcast message; determine that there is a communication state that meets the preset stable communication conditions of the device, execute S111; if there is, continue to receive broadcast messages sent by other devices.
[0166] S111 , when there are multiple broadcast messages with signal strengths less than a strength threshold, the management device randomly selects one of them as a target broadcast message, and selects the broadcast device that sends the target broadcast as a target device.
[0167] S112, the management device sends a relay start instruction to the target device.
[0168] S113: The state field m2 of the broadcasting device receiving the relay start instruction is updated to 1, and the broadcasting device continues to send broadcast messages to update the communication state and switches to a relay device.
[0169] S114, the management device determines whether n j =1 and m j = 0 broadcast message; if it is determined that there is no device whose communication state meets the preset stable communication condition, then execute S115. If it is determined that there is, then continue to receive broadcast messages sent by other devices and repeat S111.
[0170] S115: The management device stops selecting the target device from other devices.
[0171] S116: The management device sends a relay selection instruction to the target device in step S107.
[0172] S117 , the target device in step S107 responds to the relay selection instruction, performs a relay selection operation, and switches to a second-round management device.
[0173] S118: The management device sends a relay selection instruction to the target device in S112. This step and step S116 are executed in no particular order.
[0174] S119 , the target device in step S112 responds to the relay selection instruction, performs a relay selection operation, and switches to a second-round management device.
[0175] S120: The management device sends a notification message to the server to notify the server that the device stops relay selection. This step and step S115 are executed in no particular order.
[0176] In another practical application, Figure 1 A schematic diagram of the Mesh network system environment provided by the embodiment of the present disclosure is shown. Figure 1As shown, the Mesh network includes multiple electronic devices. The multiple electronic devices are of the same type and have approximately the same radio frequency performance. In the disclosed embodiment, any electronic device is configured with its communication coverage area.
[0177] Figure 10-1 Schematic diagram showing the topological structure of the electronic device 1 after adopting the relay selection method for the Mesh network of the present application. Figure 10-2 Indicates the communication status of the electronic device's broadcast message within different areas of the coverage area S where the electronic device 1 can communicate. In practical applications, the coverage area where the electronic device can communicate is approximately circular. In this example, a regular circle is used for illustration to illustrate the update of the communication status of this application.
[0178] like Figure 10-1 As shown, electronic device 1 responds to the relay selection instruction and performs multiple target device selection operations as a management device. Electronic device 2, electronic device 3 and electronic device 4 are the first target device, second target device and third target device selected by electronic device 1 respectively.
[0179] like Figure 10-2 As shown, the broadcast messages sent by the electronic devices located in the areas A1, A2, and A3 include the same quantity field, and the broadcast messages sent by the electronic devices located in the areas A1, A2, and A3 include the same communication field.
[0180] Taking area A1 as an example, if the electronic devices in area A1 are both within the communicable coverage areas of relay nodes 1 and 2, the broadcast message sent by the electronic devices in area A1 includes a quantity field (hereinafter referred to as the quantity field) of 2. The broadcast message sent by the electronic devices in area A1 includes a status field (hereinafter referred to as the status field) indicating that the device is a non-relay node.
[0181] Taking area A2 as an example, the electronic devices in area A2 are both located in the communicable coverage areas of relay nodes 1 and 3, and the quantity field is 2. The status field of the electronic devices in area A2 is non-relay node.
[0182] The broadcast messages sent by the electronic devices in the areas B1, B2, and B3 include the same quantity field, and the broadcast messages sent by the electronic devices in the areas B1, B2, and B3 include the same communication field.
[0183] Taking area B2 as an example, the electronic devices in area B2 are simultaneously located in the communicable coverage areas of relay nodes 1, 3, and 4, and the quantity field is 3. The status field of the electronic devices in area B2 is non-relay node.
[0184] Taking area B3 as an example, the electronic devices in area B3 are simultaneously located in the communicable coverage areas of relay nodes 1, 2, and 4, and the quantity field is 3. The status field of the electronic devices in area B3 is non-relay node.
[0185] In another practical application, Figure 11-1 Schematic diagram showing the topological structure of the electronic device 1 after adopting the relay selection method for the Mesh network of the present application. Figure 11-2 Indicates the communication status of the broadcast message of the electronic device in different areas of the coverage area S where the electronic device 1 can communicate. Figure 11-1 As shown, electronic device 1 responds to the relay selection instruction and performs multiple target device selection operations as a management device. Electronic device 2, electronic device 3, electronic device 4 and electronic device 5 are the first target device, second target device, third target device and fourth target device selected by electronic device 1 respectively.
[0186] like Figure 11-2 As shown, the broadcast messages sent by electronic devices located in areas C1, C2, C3, and C4 include the same quantity field, and the broadcast messages sent by electronic devices located in areas C1, C2, C3, and C4 include the same communication field.
[0187] Taking area C1 as an example, the electronic devices in area C1 are both located in the communicable coverage areas of relay nodes 1 and 2, and the quantity field is 2. The status field of the electronic devices in area C1 is non-relay node.
[0188] Taking area C2 as an example, the electronic devices in area C2 are both located in the communicable coverage areas of relay nodes 1 and 3, and the quantity field is 2. The status field of the electronic devices in area C2 is non-relay node.
[0189] The broadcast messages sent by electronic devices located in areas D1, D2, D3, and D4 include the same quantity field, and the broadcast messages sent by electronic devices located in areas D1, D2, D3, and D4 include the same communication field.
[0190] Taking area D2 as an example, the electronic devices in area D2 are simultaneously located in the communicable coverage areas of relay nodes 1, 2, and 3, and the quantity field is 3. The status field of the electronic devices in area D2 is non-relay node.
[0191] Taking area D4 as an example, the electronic devices in area D4 are simultaneously located in the communicable coverage areas of relay nodes 1, 4, and 5, and the quantity field is 3. The status field of the electronic devices in area D4 is non-relay node.
[0192] In another practical application, Figure 12-1Schematic diagram showing the topological structure of the electronic device 1 after adopting the relay selection method for the Mesh network of the present application. Figure 12-2 Indicates the communication status of the broadcast message of the electronic device in different areas of the coverage area S where the electronic device 1 can communicate. In response to the relay selection instruction, the electronic device 1 performs multiple target device selection operations as a management device. The electronic device 2, the electronic device 3, the electronic device 4, the electronic device 5, the electronic device 6 and the electronic device 5 are respectively the first target device, the second target device, the third target device, the fourth target device, the fifth target device, the sixth target device and the seventh target device selected by the electronic device 1. Figure 12-1 and Figure 12-2 As shown, the broadcast messages sent by electronic devices located in areas E1, E2, E3, E4, E5, and E6 include equal quantity fields, and the broadcast messages sent by electronic devices located in areas E1, E2, E3, E4, E5, and E6 include the same communication fields.
[0193] Taking area E1 as an example, the electronic devices in area E1 are simultaneously located in the communicable coverage areas of relay nodes 1, 2, and 7, and the quantity field is 3. The status field of the electronic devices in area E1 is non-relay node.
[0194] Taking area E5 as an example, the electronic devices in area E5 are simultaneously located in the communicable coverage areas of relay nodes 1, 5, and 6, and the quantity field is 3. The status field of the electronic devices in area E5 is non-relay node.
[0195] The broadcast messages sent by electronic devices located in areas F1, F2, F3, F4, F5, and F6 include the same quantity fields, and the broadcast messages sent by electronic devices located in areas F1, F2, F3, F4, F5, and F6 include the same communication fields.
[0196] Taking area F2 as an example, the electronic devices in area F2 are simultaneously located in the communicable coverage areas of relay nodes 1, 2, 3, and 4, and the quantity field is 4. The status field of the electronic devices in area F2 is non-relay node.
[0197] Taking area F6 as an example, the electronic devices in area F6 are simultaneously located in the communicable coverage areas of relay nodes 1, 2, 6, and 7, and the quantity field is 4. The status field of the electronic devices in area F6 is non-relay node.
[0198] Combine Figure 14As shown, the embodiment of the present disclosure provides a relay selection device for a Mesh network, comprising an acquisition module 201, a determination module 202, and an execution module 203. The acquisition module 201 is configured to send a broadcast message of the device itself and listen to broadcast messages sent by other devices; the determination module 202 is configured to obtain the communication status of each device when the device itself is a relay node; and the execution module 203 is configured to select a target device when there is a device whose communication status meets a preset stable communication condition, and send a relay function activation instruction to the target device to make the target device a relay node.
[0199] The relay selection device for a Mesh network provided by the embodiment of the present disclosure obtains the communication status of a device by monitoring broadcast messages, and selectively enables the relay function according to the communication status of the device, thereby indirectly obtaining the topological structure of other devices during the relay selection process, reducing the probability of misjudgment, and improving the reliability of the Mesh network.
[0200] Combine Figure 15 As shown, an embodiment of the present disclosure provides a relay selection device for a Mesh network, including a processor 100 and a memory 101. Optionally, the device may further include a communication interface 102 and a bus 103. The processor 100, the communication interface 102, and the memory 101 may communicate with each other via the bus 103. The communication interface 102 may be used for information transmission. The processor 100 may call the logic instructions in the memory 101 to execute the relay selection method for the Mesh network of the above embodiment.
[0201] In addition, the logic instructions in the memory 101 can be implemented in the form of software functional units and can be stored in a computer-readable storage medium when sold or used as an independent product.
[0202] Memory 101, as a computer-readable storage medium, can be used to store software programs and computer-executable programs, such as program instructions / modules corresponding to the methods in the embodiments of the present disclosure. Processor 100 executes the program instructions / modules stored in memory 101 to execute functional applications and data processing, thereby implementing the relay selection method for a mesh network in the above-described embodiments.
[0203] The memory 101 may include a program storage area and a data storage area. The program storage area may store an operating system and at least one application required for a function; the data storage area may store data generated based on the use of the terminal device. Furthermore, the memory 101 may include high-speed random access memory and non-volatile memory.
[0204] An embodiment of the present disclosure provides an electronic device, comprising: a device body, and the above-mentioned selection relay device for the Mesh network. The selection relay device for the Mesh network is installed on the device body. The installation relationship described here is not limited to placement inside the product, but also includes installation connections with other components of the product, including but not limited to physical connections, electrical connections or signal transmission connections. It can be understood by those skilled in the art that the selection relay device for the Mesh network can be adapted to a feasible product body, thereby realizing other feasible embodiments.
[0205] An embodiment of the present disclosure provides a computer-readable storage medium storing computer-executable instructions, wherein the computer-executable instructions are configured to execute the above-mentioned method for selecting a relay for a Mesh network.
[0206] The aforementioned computer-readable storage medium may be a transient computer-readable storage medium or a non-transitory computer-readable storage medium.
[0207] The technical solution of the embodiments of the present disclosure may be embodied in the form of a software product, which is stored in a storage medium and includes one or more instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method described in the embodiments of the present disclosure. The aforementioned storage medium may be a non-transitory storage medium, including: a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and other media that can store program code, or a transient storage medium.
[0208] The above description and accompanying drawings sufficiently illustrate the embodiments of the present disclosure to enable those skilled in the art to practice them. Other embodiments may include structural, logical, electrical, process and other changes. The embodiments represent only possible variations. Unless expressly required, individual components and functions are optional, and the order of operations may vary. Portions and features of some embodiments may be included in or replace portions and features of other embodiments. Moreover, the terms used in this application are only used to describe the embodiments and are not used to limit the claims. As used in the description of the embodiments and claims, the singular forms "a", "an" and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. Similarly, the term "and / or" as used in this application refers to any and all possible combinations of one or more of the associated listings. In addition, when used in this application, the term "including" refers to any and all possible combinations of one or more of the associated listings.
[0209] "comprise" and its variations "comprises" and / or comprising refer to the presence of stated features, wholes, steps, operations, elements, and / or components, but do not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or groups thereof. In the absence of further restrictions, an element defined by the sentence "comprises a..." does not exclude the presence of other identical elements in the process, method or device that includes the element. In this article, each embodiment may focus on the differences from other embodiments, and the same and similar parts between the various embodiments can be referenced to each other. For the methods, products, etc. disclosed in the embodiments, if they correspond to the method part disclosed in the embodiments, then the relevant parts can be found in the description of the method part.
[0210] Those skilled 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 may depend on the specific application and design constraints of the technical solution. The technicians may 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 the embodiments of the present disclosure. The technicians will clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0211] In the embodiments disclosed herein, the disclosed methods and products (including but not limited to devices, equipment, etc.) can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of the units can be merely a logical functional division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between each other shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, and can be electrical, mechanical or other forms. 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 they may be distributed on multiple network units. Some or all of the units may be selected to implement this embodiment according to actual needs. In addition, the functional units in the embodiments of the present disclosure may be integrated into a processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0212] The flowcharts and block diagrams in the accompanying drawings show the possible implementation architectures, functions and operations of the systems, methods and computer program products according to the embodiments of the present disclosure. In this regard, each box in the flowchart or block diagram can represent a module, program segment or part of the code, and the module, program segment or part of the code contains one or more executable instructions for implementing the specified logical functions. In some alternative implementations, the functions marked in the box can also occur in an order different from that marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, or they can sometimes be executed in the opposite order, which can depend on the functions involved. In the descriptions corresponding to the flowcharts and block diagrams in the accompanying drawings, the operations or steps corresponding to different boxes can also occur in an order different from that disclosed in the description, and sometimes there is no specific order between different operations or steps. For example, two consecutive operations or steps can actually be executed substantially in parallel, or they can sometimes be executed in the opposite order, which can depend on the functions involved. Each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, may be implemented by a dedicated hardware-based system that performs the specified function or action, or may be implemented by a combination of dedicated hardware and computer instructions.
[0213] The above is only a preferred embodiment of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.
Claims
1. A method for selecting a relay in a wireless mesh network, characterized in that: include: Send broadcast messages from this device and listen to broadcast messages from other devices; When the device is a relay node, obtain the communication status of each device; When there is a device whose communication status meets the preset stable communication conditions, a target device is selected, and a relay function activation instruction is sent to the target device to make the target device a relay node, so that other devices are located within the coverage area of at least two relay nodes; wherein, the device whose communication status meets the preset stable communication conditions includes: a device whose relay status is a non-relay node and the number of communication relay nodes is 1.
2. The method according to claim 1, characterized in that Each broadcast message includes a field indicating the communication status of the device sending the broadcast message; wherein the field includes: The quantity field is used to indicate the number of communication relay nodes of the device; The Status field indicates the relay status of the device.
3. The method according to claim 2, characterized in that Also includes: When the device is not a relay node, it updates the communication status of the device based on the broadcast messages sent by other devices.
4. The method according to claim 3, characterized in that Updates the communication status of the device, including: In the received broadcast messages, count the number of devices in the coverage area that are in relay node state; According to the number of devices, the number of communication relay nodes of the device is updated.
5. The method according to claim 3, characterized in that Updates the communication status of the device, including: When receiving the relay function enable command, the relay status of the device is updated to a relay node.
6. The method according to claim 1, characterized in that The selecting a target device includes: Among the broadcast messages sent by the other devices, a broadcast message having a signal strength less than a strength threshold is used as a target broadcast message; The device that sends the target broadcast is used as the target device.
7. The method according to any one of claims 1 to 6, characterized in that After sending the relay function enable command to the target device, it also includes: Continue to monitor the broadcast messages sent by other devices to obtain the communication status of each device; In the case that there is no device whose communication state meets the preset stable communication condition, a relay selection instruction is sent to the target device to enable the target device to enable a relay selection function.
8. The method according to any one of claims 1 to 6, characterized in that Also includes: If there is no device whose communication status satisfies the preset stable communication condition, then the selection of the target device from the other devices is stopped.
9. The method according to any one of claims 1 to 6, characterized in that Also includes: In response to the relay selection instruction, setting the device as a relay node; or, In response to the relay start instruction, the device is set as a relay node.
10. A relay selection device for a Mesh network, comprising a processor and a memory storing program instructions, characterized in that: The processor is configured to execute the method for selecting a relay for a Mesh network according to any one of claims 1 to 9 when running the program instructions.
11. An electronic device, characterized in that: include: The relay selection device for a Mesh network as claimed in claim 10.
12. A storage medium storing program instructions, characterized in that: When the program instructions are executed, the method for selecting a relay for a Mesh network according to any one of claims 1 to 9 is executed.
Citation Information
Patent Citations
Communication method based on Bluetooth network, node thereof and communication system
CN113259916A
Relay node determination method, device and equipment, and readable storage medium
CN113676980A