CN113645072B - Master-slave gateway deployment method and device - Google Patents

Master-slave gateway deployment method and device Download PDF

Info

Publication number
CN113645072B
CN113645072B CN202110915922.5A CN202110915922A CN113645072B CN 113645072 B CN113645072 B CN 113645072B CN 202110915922 A CN202110915922 A CN 202110915922A CN 113645072 B CN113645072 B CN 113645072B
Authority
CN
China
Prior art keywords
gateway
devices
mesh network
equipment
bluetooth mesh
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202110915922.5A
Other languages
Chinese (zh)
Other versions
CN113645072A (en
Inventor
陈鸂
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Sengled Co Ltd
Original Assignee
Sengled Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Sengled Co Ltd filed Critical Sengled Co Ltd
Priority to CN202110915922.5A priority Critical patent/CN113645072B/en
Publication of CN113645072A publication Critical patent/CN113645072A/en
Application granted granted Critical
Publication of CN113645072B publication Critical patent/CN113645072B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/06Management of faults, events, alarms or notifications
    • H04L41/0654Management of faults, events, alarms or notifications using network fault recovery
    • H04L41/0663Performing the actions predefined by failover planning, e.g. switching to standby network elements
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W24/00Supervisory, monitoring or testing arrangements
    • H04W24/04Arrangements for maintaining operational condition
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W4/00Services specially adapted for wireless communication networks; Facilities therefor
    • H04W4/80Services using short range communication, e.g. near-field communication [NFC], radio-frequency identification [RFID] or low energy communication
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D30/00Reducing energy consumption in communication networks
    • Y02D30/70Reducing energy consumption in communication networks in wireless communication networks

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

The embodiment of the application provides a method and a device for deploying a master/slave gateway, which are applied to a Bluetooth Mesh network, wherein the Bluetooth Mesh network comprises a plurality of devices, and the method comprises the following steps: the first device receives a first message sent by a plurality of second devices, wherein the first message comprises device identifiers of the second devices, and the plurality of second devices are other devices except the first device in the plurality of devices. The first device judges whether the first device is a master gateway of the Bluetooth Mesh network. If the first device is a main gateway, the first device determines a standby gateway of the Bluetooth Mesh network in the plurality of second devices according to the first messages sent by the plurality of second devices, and sends the device identification of the main gateway and the device identification of the standby gateway to the plurality of second devices. The main gateway and the standby gateway are simultaneously arranged in the Bluetooth Mesh network, so that the reliability of the Bluetooth Mesh network in accessing to the external network is improved.

Description

Master-slave gateway deployment method and device
Technical Field
The embodiment of the application relates to a communication technology, in particular to a method and a device for deploying a master/slave gateway.
Background
The Bluetooth wireless Mesh network (Mesh network) is based on low-power Bluetooth broadcasting and scanning, expands the point-to-point connection mode of the original low-power Bluetooth and the traditional Bluetooth, and is a flood network with Mesh topology, and is characterized by a multi-hop network.
In the related art, only one device in the bluetooth Mesh network is generally fixed as a gateway device of the bluetooth Mesh network, wherein the gateway device is used to implement connection of the bluetooth Mesh network with an external network.
However, when the gateway device in the bluetooth Mesh network fails, the bluetooth Mesh network cannot access the external network, and can only be used as a local network, so that the problem of low reliability of the access of the bluetooth Mesh network to the external network exists.
Disclosure of Invention
The embodiment of the application provides a method and a device for deploying a master/slave gateway, which are used for solving the problem that the reliability of the Bluetooth Mesh network for accessing an external network is lower.
In a first aspect, an embodiment of the present application provides a method for deploying a primary gateway, which is applied to a bluetooth Mesh network, where the bluetooth Mesh network includes a plurality of devices, and the method includes:
the method comprises the steps that a first device receives a first message sent by a plurality of second devices, wherein the first message comprises a device identifier of the second device, and the plurality of second devices are other devices except the first device in the plurality of devices;
the first device determines whether the first device is
A main gateway of the Bluetooth Mesh network;
if the first device is a main gateway, the first device determines a backup gateway of the Bluetooth Mesh network in the plurality of second devices according to the first messages sent by the plurality of second devices, and sends the device identification of the main gateway and the device identification of the backup gateway to the plurality of second devices.
In one possible design, the determining, by the first device, whether the first device is a primary gateway of the bluetooth Mesh network includes:
the first device judges whether the first device is a main gateway of the Bluetooth Mesh network according to the configuration information; or,
and the first device judges whether the first device is a main gateway of the Bluetooth Mesh network according to the first messages sent by the plurality of second devices.
In one possible design, the first message includes WiFi signal strength and number of neighbor nodes of the second device; the first device judges whether the first device is a main gateway of the bluetooth Mesh network according to first messages sent by the plurality of second devices, and the method comprises the following steps:
the first equipment determines at least one third equipment in the first equipment and a plurality of second equipment according to the WiFi signal intensity of each second equipment and the WiFi signal intensity of the first equipment, wherein the at least one third equipment is the equipment with the maximum WiFi signal intensity in the first equipment and the plurality of second equipment;
the first device judges whether the at least one third device comprises the first device or not;
If yes, judging whether the number of neighbor nodes corresponding to the first equipment is larger than the number of neighbor nodes corresponding to other equipment in the at least one third equipment, if yes, determining that the first equipment is the main gateway, and if not, determining that the first equipment is not the main gateway;
if not, determining that the first device is not the primary gateway.
In one possible design, the first message includes WiFi signal strength and number of neighbor nodes of the second device; the first device determines a standby gateway in the plurality of second devices according to the first messages sent by the plurality of second devices, and the standby gateway comprises:
the first equipment determines at least one fourth equipment from the plurality of second equipment according to the WiFi signal intensity of each second equipment, wherein the fourth equipment is the equipment with the maximum WiFi signal intensity in the plurality of second equipment;
the first device judges whether the number of the fourth devices is 1;
if yes, the first device determines the at least one fourth device as the standby gateway;
if not, the first device determines at least one fifth device in the at least one fourth device according to the number of neighbor nodes of each fourth device, wherein the fifth device is the device with the largest number of neighbor nodes in the at least one fourth device; and determining the standby gateway according to the number of the fifth devices.
In one possible design, the device is identified as a fixed length value; said determining said backup gateway according to the number of said fifth devices comprises:
the first device judges whether the number of the fifth devices is 1;
if yes, the first device determines the at least one fifth device as the standby gateway;
if not, the first device determines the device with the smallest device identifier in the at least one fifth device as the backup gateway.
In one possible design, after the determining a backup gateway in the plurality of second devices and sending the device identifier of the primary gateway and the device identifier of the backup gateway to the plurality of second devices, the method further includes:
the first device judges whether the WiFi signal strength corresponding to the first device is larger than or equal to a first threshold value;
if not, the first device sends a primary and secondary gateway switching instruction to the secondary gateway, wherein the primary and secondary gateway switching instruction is used for indicating that the secondary gateway is switched to be a primary gateway.
In one possible design, after the determining a backup gateway in the plurality of second devices and sending the device identifier of the primary gateway and the device identifier of the backup gateway to the plurality of second devices, the method further includes:
The first device judges whether the WiFi signal strength corresponding to the standby gateway is larger than or equal to a second threshold value;
if not, the first device updates the standby gateway of the Bluetooth Mesh network.
In one possible design, the updating the backup gateway of the bluetooth Mesh network includes:
the first device sends a status information request to the plurality of second devices;
the first device receives second messages sent by the plurality of second devices, wherein the second messages comprise respective device identifiers, wiFi signal strength and the number of neighbor nodes of the second devices;
and according to the second messages sent by the plurality of second devices, the first device updates the standby gateway of the Bluetooth Mesh network.
In a second aspect, an embodiment of the present application provides a primary gateway deployment apparatus applied to a bluetooth Mesh network, where the bluetooth Mesh network includes a plurality of devices, the apparatus includes:
the receiving module is used for receiving first messages sent by a plurality of second devices by the first device, wherein the first messages comprise device identifiers of the second devices, and the plurality of second devices are other devices except the first device in the plurality of devices;
The processing module is used for judging whether the first equipment is a main gateway of the Bluetooth Mesh network or not by the first equipment;
the determining module is configured to determine, if the first device is a primary gateway, a backup gateway of the bluetooth Mesh network in the plurality of second devices according to a first packet sent by the plurality of second devices, and send, to the plurality of second devices, a device identifier of the primary gateway and a device identifier of the backup gateway.
In one possible design, the processing module is specifically configured to:
the first device judges whether the first device is a main gateway of the Bluetooth Mesh network according to the configuration information; or,
and the first device judges whether the first device is a main gateway of the Bluetooth Mesh network according to the first messages sent by the plurality of second devices.
In one possible design, the first message includes WiFi signal strength and number of neighbor nodes of the second device; the processing module is specifically used for:
the first equipment determines at least one third equipment in the first equipment and a plurality of second equipment according to the WiFi signal intensity of each second equipment and the WiFi signal intensity of the first equipment, wherein the at least one third equipment is the equipment with the maximum WiFi signal intensity in the first equipment and the plurality of second equipment;
The first device judges whether the at least one third device comprises the first device or not;
if yes, judging whether the number of neighbor nodes corresponding to the first equipment is larger than the number of neighbor nodes corresponding to other equipment in the at least one third equipment, if yes, determining that the first equipment is the main gateway, and if not, determining that the first equipment is not the main gateway;
if not, determining that the first device is not the primary gateway.
In one possible design, the first message includes WiFi signal strength and number of neighbor nodes of the second device; the determining module is specifically configured to:
the first equipment determines at least one fourth equipment from the plurality of second equipment according to the WiFi signal intensity of each second equipment, wherein the fourth equipment is the equipment with the maximum WiFi signal intensity in the plurality of second equipment;
the first device judges whether the number of the fourth devices is 1;
if yes, the first device determines the at least one fourth device as the standby gateway;
if not, the first device determines at least one fifth device in the at least one fourth device according to the number of neighbor nodes of each fourth device, wherein the fifth device is the device with the largest number of neighbor nodes in the at least one fourth device; and determining the standby gateway according to the number of the fifth devices.
In one possible design, the device is identified as a fixed length value; the determining module is specifically configured to:
the first device judges whether the number of the fifth devices is 1;
if yes, the first device determines the at least one fifth device as the standby gateway;
if not, the first device determines the device with the smallest device identifier in the at least one fifth device as the backup gateway.
In one possible design, the apparatus further comprises an update module, the update module being specifically configured to:
the first device judges whether the WiFi signal strength corresponding to the first device is larger than or equal to a first threshold value;
if not, the first device sends a primary and secondary gateway switching instruction to the secondary gateway, wherein the primary and secondary gateway switching instruction is used for indicating that the secondary gateway is switched to be a primary gateway.
In one possible design, the update module is further configured to:
the first device judges whether the WiFi signal strength corresponding to the standby gateway is larger than or equal to a second threshold value;
if not, the first device updates the standby gateway of the Bluetooth Mesh network.
In one possible design, the update module is specifically configured to:
The first device sends a status information request to the plurality of second devices;
the first device receives second messages sent by the plurality of second devices, wherein the second messages comprise respective device identifiers, wiFi signal strength and the number of neighbor nodes of the second devices;
and according to the second messages sent by the plurality of second devices, the first device updates the standby gateway of the Bluetooth Mesh network.
In a third aspect, an embodiment of the present application provides a primary and backup gateway deployment device, including:
a memory for storing a program;
a processor for executing the program stored in the memory, the processor being adapted to perform the method as described in the first aspect above and any of the various possible designs of the first aspect when the program is executed.
In a fourth aspect, embodiments of the present application provide a computer-readable storage medium comprising instructions which, when run on a computer, cause the computer to perform the method as set forth in the first aspect above and any of the various possible designs of the first aspect.
In a fifth aspect, embodiments of the present application provide a computer program product, the program product comprising: a computer program stored in a readable storage medium, from which it can be read by at least one processor of an electronic device, the at least one processor executing the computer program causing the electronic device to perform the method as described in the first aspect and any of the various possible designs of the first aspect.
The embodiment of the application provides a method and a device for deploying a master/slave gateway, which are applied to a Bluetooth Mesh network, wherein the Bluetooth Mesh network comprises a plurality of devices, and the method comprises the following steps: the first device receives a first message sent by a plurality of second devices, wherein the first message comprises device identifiers of the second devices, and the plurality of second devices are other devices except the first device in the plurality of devices. The first device judges whether the first device is a master gateway of the Bluetooth Mesh network. If the first device is a main gateway, the first device determines a standby gateway of the Bluetooth Mesh network in the plurality of second devices according to the first messages sent by the plurality of second devices, and sends the device identification of the main gateway and the device identification of the standby gateway to the plurality of second devices. The main gateway and the standby gateway are simultaneously arranged in the Bluetooth Mesh network, so that the reliability of the Bluetooth Mesh network in accessing to the external network is improved.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, a brief description will be given below of the drawings that are required for the embodiments or the description of the prior art, and it is obvious that, in the following description, the drawings are some embodiments of the present application, and that, to those skilled in the art, other drawings may be obtained according to these drawings without any inventive effort.
Fig. 1 is a schematic view of an application scenario provided in an embodiment of the present application;
fig. 2 is a flowchart of a primary and backup gateway deployment method provided in an embodiment of the present application;
fig. 3 is a second flowchart of a method for deploying a primary and backup gateway according to an embodiment of the present application;
fig. 4 is a flowchart III of a method for deploying a primary and backup gateway according to an embodiment of the present application;
fig. 5 is a schematic structural diagram of a primary and backup gateway deployment device provided in an embodiment of the present application;
fig. 6 is a schematic hardware structure of a primary and backup gateway deployment device according to an embodiment of the present application.
Detailed Description
For the purposes of making the objects, technical solutions and advantages of the embodiments of the present application more clear, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is apparent that the described embodiments are some embodiments of the present application, but not all embodiments. All other embodiments, based on the embodiments herein, which a person of ordinary skill in the art would obtain without undue burden, are within the scope of protection of the present application.
For the convenience of understanding the technical solutions of the present application, first, related concepts related to the present application will be described:
Bluetooth is an open global specification for wireless data and voice communications, and is a wireless communication technology based on the IEEE802.11 standard protocol. The furthest communication distance between the two devices establishing bluetooth communication is 30 meters.
Because the transmission distance of the Bluetooth communication is short, the wireless Mesh network technology is considered to be introduced into Bluetooth to expand the network coverage range, namely, the Bluetooth Mesh network is formed. It should be emphasized here that bluetooth Mesh is not a wireless communication technology, but a networking technology. The relationship between Bluetooth and Bluetooth Mesh is: bluetooth Mesh networks rely on bluetooth technology, which is a wireless communication protocol stack used by bluetooth Mesh.
Next, the deployment characteristics of the bluetooth Mesh network will be described in detail.
The deployment mode of the bluetooth Mesh network is a gateway and a node (STA), namely, the bluetooth Mesh network is accessed to the network in a bluetooth mode, and the networking equipment comprises a bluetooth gateway and at least one STA. The Bluetooth gateway is a gateway device integrating Bluetooth, wiFi and Ethernet, data of the Bluetooth device connected with the Bluetooth gateway are transmitted to the server in a WiFi or Ethernet mode through the Bluetooth gateway through cross port between the Bluetooth and the WiFi, and data of the server side are transmitted back to the Bluetooth device. STA is a device in a bluetooth Mesh network that includes a bluetooth communication module. Therefore, the Bluetooth Mesh network is formed by a Bluetooth gateway and at least one piece of Internet of things equipment comprising the Bluetooth communication module, so that the Bluetooth Mesh network has the function of accessing an external network.
It should be noted that the bluetooth gateway may be a dedicated bluetooth gateway device, or may be a device including a bluetooth module and capable of being networked, for example, a device including a chip integrating the bluetooth module and the WiFi module.
In the Bluetooth Mesh network, based on the Bluetooth gateway construction, a plurality of STAs join a wireless network formed by the Bluetooth gateways. The networking mode is characterized in that: the Bluetooth gateway is used as the center of the whole Bluetooth Mesh network, other STAs establish Bluetooth communication with the Bluetooth gateway or establish Bluetooth communication with each other, so that the communication coverage range of the Bluetooth Mesh network is continuously extended.
Next, description is given of the prior art and problems existing in the prior art to which the present application relates:
in the related art, in the bluetooth Mesh network, generally only one device fixes a gateway device as the bluetooth Mesh network, wherein the gateway device is used to realize connection of the bluetooth Mesh network with an external network.
However, when the gateway device in the bluetooth Mesh network fails, the bluetooth Mesh network cannot access the external network, and can only be used as a local network, so that the problem of low reliability of the access of the bluetooth Mesh network to the external network exists.
Based on the above existing problems, the present application proposes the following technical concept: in a Bluetooth Mesh network composed of a plurality of pieces of equipment based on WiFi and Bluetooth Mesh dual-mode communication, because each piece of equipment is equipment based on WiFi and Bluetooth Mesh dual-mode communication, when part of pieces of equipment are connected with WiFi and accessed to the Bluetooth Mesh network at the same time, the part of equipment can serve as a gateway to be selected of the Bluetooth Mesh network. And selecting two pieces of Internet of things equipment from the part of Internet of things equipment to serve as a main gateway and a standby gateway of the Bluetooth Mesh network respectively. The main gateway of the Bluetooth Mesh network works as a gateway of the Bluetooth Mesh network; the standby gateway of the Bluetooth Mesh network is used as a candidate gateway in the Bluetooth Mesh network, and one STA used as the Bluetooth Mesh network can normally receive and send information during normal operation. When the main gateway of the Bluetooth Mesh network fails or the WiFi signal intensity is poor, the main gateway of the Bluetooth Mesh network stops working as the gateway of the Bluetooth Mesh network, and the standby gateway of the Bluetooth Mesh network is started to work as the gateway of the Bluetooth Mesh network, so that the connection between the Bluetooth Mesh network and an external network is smoothly realized. Therefore, the reliability of the Bluetooth Mesh network for accessing the external network is improved by arranging the master/slave gateway in the Bluetooth Mesh network.
Next, an application scenario of the embodiment of the present application will be described with reference to fig. 1.
Fig. 1 is a schematic view of an application scenario provided in an embodiment of the present application. The application scene schematic diagram provided by the embodiment of the application comprises the following steps: the Bluetooth Mesh network comprises a WiFi router and a plurality of pieces of Internet of things equipment based on dual-mode communication, wherein the plurality of pieces of Internet of things equipment form the Bluetooth Mesh network. For simplicity of illustration, as shown in fig. 1, in the embodiment of the present application, the devices including 7 pieces of internet of things equipment based on dual-mode communication are respectively STA1, STA2, …, STA7, and the 7 pieces of internet of things equipment are devices based on WiFi and bluetooth Mesh dual-mode communication, that is, each device has a chip including a WiFi module and a bluetooth module. The STA1-STA7 are mutually connected to form a Bluetooth Mesh network, and the STA1, the STA2 and the STA3 are connected with the WiFi router.
It should be noted that, when the internet of things device based on WiFi and bluetooth Mesh dual mode communication is selected as the main gateway of the bluetooth Mesh network, data interaction can be performed between the WiFi module and the bluetooth Mesh module in the internet of things device when the internet of things device works as the gateway. When the device is used as non-gateway equipment, data interaction can not be performed between a WiFi module and a Bluetooth Mesh module in the device.
In the embodiment of the application, two pieces of internet of things equipment based on dual-mode communication are selected from 7 pieces of internet of things equipment based on dual-mode communication forming a Bluetooth Mesh network to serve as a main gateway and a standby gateway of the Bluetooth Mesh network respectively. The Bluetooth Mesh network is connected with the external network through the main gateway.
The technical scheme shown in the application is described in detail below through specific embodiments. It should be noted that the following embodiments may exist alone or in combination with each other, and the description will not be repeated in different embodiments for the same or similar contents.
Based on the technical concept described above, the method for deploying the active/standby gateway provided in the present application is described in detail below with reference to fig. 2 and a specific embodiment, and it should be noted that, an execution body in the embodiment of the present application is each device in the bluetooth Mesh network, and fig. 2 is a flowchart one of the method for deploying the active/standby gateway provided in the embodiment of the present application.
As shown in fig. 2, the method includes:
s201, the first device receives first messages sent by a plurality of second devices, wherein the first messages comprise device identifiers of the second devices, and the plurality of second devices are other devices except the first device.
A plurality of devices are included in the bluetooth Mesh network. Wherein the first device is one of a plurality of devices in the bluetooth Mesh network. The second device is other devices except the first device in the plurality of devices of the Bluetooth Mesh network.
In the embodiment, a plurality of devices in the Bluetooth Mesh network are all internet of things devices for dual-mode communication. Taking an internet of things device with dual-mode communication as an example of the internet of things device based on WiFi and Bluetooth Mesh communication, the method for deploying the master/standby gateway is described. Each device in the Bluetooth Mesh network mutually sends a first message corresponding to each other, wherein the first message comprises a device identifier of the device. For example, the device Identifier may be a Universal Unique Identifier (UUID) of the device. Wherein each device corresponds to a unique UUID and one UUID corresponds to a unique device. Thus, the UUID of a device may be referred to as an identification unique to that device.
Optionally, the first message further includes a WiFi signal strength of the device and the number of neighboring nodes. It should be noted that, whether the device has accessed to the WiFi network is determined according to the strength of the WiFi signal in the first message. For example, if the WiFi signal strength in the first message is 0, it indicates that the device is not connected to the WiFi network; if the WiFi signal strength in the first message is not 0, the device is indicated to be accessed to the WiFi network. In addition, the stronger the WiFi signal strength in the first message, the better the WiFi network state of the device is indicated.
The first device receives first messages sent by a plurality of second devices. For example, through a bluetooth Mesh network, a first device receives a first packet sent by other devices in the bluetooth Mesh network. Specifically, when the first device is directly connected with a part of devices, the first device directly receives a first message sent by other devices; when the first device is not directly connected with other part of devices, the device between the first device and the other part of devices is used as a relay device to realize that the other part of devices send the first message to the first device, so that the first device receives the first message sent by the other part of devices.
S202, the first device judges whether the first device is a master gateway of the Bluetooth Mesh network.
Next, two possible implementations of the first device determining whether the first device is a primary gateway of the bluetooth Mesh network are exemplarily described.
In one possible implementation, the first device determines, according to configuration information of the primary gateway, whether the first device is a primary gateway of the bluetooth Mesh network. The configuration information may be, for example, a UUID of the device. Specifically, whether the first device is the main gateway of the bluetooth Mesh network is determined by judging whether the UUID of the first device is consistent with the UUID of the device corresponding to the main gateway of the bluetooth Mesh network. Under the condition, when the UUID of the first device is consistent with the UUID of the device corresponding to the main gateway of the Bluetooth Mesh network, determining that the first device is the main gateway of the Bluetooth Mesh network; in another case, when the UUID of the first device is inconsistent with the UUID of the device corresponding to the main gateway of the bluetooth Mesh network, it is determined that the first device is not the main gateway of the bluetooth Mesh network.
In another possible implementation manner, the first device determines whether the first device is a primary gateway of the bluetooth Mesh network according to the WiFi signal strength in the first messages sent by the plurality of second devices. The first message includes the strength of the WiFi signal. Specifically, according to the intensity of the WiFi signals in the first messages of the plurality of devices, the device corresponding to the maximum WiFi signal intensity in the first messages is determined to be the main gateway of the Bluetooth Mesh network. If the WiFi signal intensity corresponding to the first device is the device with the maximum WiFi signal intensity in the plurality of devices, the first device can determine that the first device is a main gateway, otherwise, the first device is determined not to be the main gateway of the Bluetooth Mesh network.
In this embodiment, only the specific implementation manner of determining, by the first device, whether the first device is the primary gateway of the bluetooth Mesh network is described as an example, but not limited, and the specific implementation manner of determining, by the first device, whether the first device is the primary gateway of the bluetooth Mesh network may be selected according to actual requirements.
And S203, if the first equipment is a main gateway, the first equipment determines a standby gateway of the Bluetooth Mesh network in the plurality of second equipment according to the first messages sent by the plurality of second equipment, and sends the equipment identification of the main gateway and the equipment identification of the standby gateway to the plurality of second equipment.
In a practical embodiment, when the first device determines that the first device is a primary gateway of the bluetooth Mesh network, the first device determines a backup gateway of the bluetooth Mesh network in a plurality of second devices according to first messages sent by a plurality of devices of the bluetooth Mesh network.
Next, two possible implementation methods of determining the backup gateway of the bluetooth Mesh network in the plurality of second devices according to the first messages sent by the plurality of devices of the bluetooth Mesh network by the first device are exemplarily described.
In one possible implementation, when the first device determines that the first device is a primary gateway of the bluetooth Mesh network according to the configuration information, then the first device determines a backup gateway of the bluetooth Mesh network according to WiFi signal intensities in first messages sent by the plurality of second devices. Specifically, according to the intensity of the WiFi signals in the first messages of the plurality of devices, the device corresponding to the maximum WiFi signal intensity in the first messages is determined to be a standby gateway of the Bluetooth Mesh network.
In another possible implementation manner, when the first device is determined that the first device is the primary gateway of the bluetooth Mesh network according to the first device being the device corresponding to the maximum WiFi signal strength in the bluetooth Mesh network, the first device determines that the WiFi signal strength in the first messages sent by the plurality of second devices in the bluetooth Mesh network is located in the second device, and determines that the first device is the backup gateway of the bluetooth Mesh network.
After the first device determines the backup gateway of the Bluetooth Mesh network in the plurality of second devices, the first device sends the device identifier corresponding to the Bluetooth Mesh master gateway device and the device identifier corresponding to the backup gateway device to the plurality of second devices in the Bluetooth Mesh network.
The method for deploying the master/slave gateway is applied to a Bluetooth Mesh network, wherein the Bluetooth Mesh network comprises a plurality of devices and comprises the following steps: the first device receives a first message sent by a plurality of second devices, wherein the first message comprises device identifiers of the second devices, and the plurality of second devices are other devices except the first device in the plurality of devices. The first device judges whether the first device is a master gateway of the Bluetooth Mesh network. If the first device is a main gateway, the first device determines a standby gateway of the Bluetooth Mesh network in the plurality of second devices according to the first messages sent by the plurality of second devices, and sends the device identification of the main gateway and the device identification of the standby gateway to the plurality of second devices. The main gateway and the standby gateway are simultaneously arranged in the Bluetooth Mesh network, so that the reliability of the Bluetooth Mesh network in accessing to the external network is improved.
On the basis of the above embodiments, the primary and backup gateway deployment methods provided in the present application are further described below in conjunction with a specific embodiment, and are described in conjunction with fig. 3, where fig. 3 is a flow chart two of the primary and backup gateway deployment method provided in the embodiment of the present application.
As shown in fig. 3, the method includes:
s301, a first device receives a first message sent by a plurality of second devices, wherein the first message comprises device identifiers of the second devices, and the plurality of second devices are other devices except the first device in the plurality of devices.
The implementation of step S301 is similar to that of step S201, and will not be described here again.
S302, the first device judges whether the first device is a main gateway of the Bluetooth Mesh network, and if yes, S303 is executed.
Next, two possible implementations of the first device determining whether the first device is a primary gateway of the bluetooth Mesh network are exemplarily described.
In one possible implementation, the first device determines, according to configuration information of the primary gateway, whether the first device is a primary gateway of the bluetooth Mesh network. The configuration information may be, for example, a UUID of the device. Specifically, whether the first device is the main gateway of the bluetooth Mesh network is determined by judging whether the UUID of the first device is consistent with the UUID of the device corresponding to the main gateway of the bluetooth Mesh network. Under the condition, when the UUID of the first device is consistent with the UUID of the device corresponding to the main gateway of the Bluetooth Mesh network, determining that the first device is the main gateway of the Bluetooth Mesh network; in another case, when the UUID of the first device is inconsistent with the UUID of the device corresponding to the main gateway of the bluetooth Mesh network, it is determined that the first device is not the main gateway of the bluetooth Mesh network.
In another possible implementation manner, the first message further includes the WiFi signal strength and the number of neighboring nodes of the second device. The first device judges whether the first device is a main gateway of the Bluetooth Mesh network according to the WiFi signal intensity and the number of neighbor nodes in the first messages sent by the second devices. Specifically, the first device determines at least one third device from among the first device and the plurality of second devices according to the WiFi signal strength of each second device and the WiFi signal strength of the first device. The at least one third device is the device with the highest WiFi signal intensity in the first device and the plurality of second devices. The first device determines whether the first device is included in the at least one third device. If the first device is not included in the at least one third device, it is determined that the first device is not the primary gateway. If the at least one third device comprises the first device, judging whether the number of neighbor nodes corresponding to the first device is larger than the number of neighbor nodes corresponding to other devices in the at least one third device; if the number of the neighbor nodes corresponding to the first equipment is larger than the number of the neighbor nodes corresponding to other equipment in at least one third equipment, determining that the first equipment is a main gateway; and if the number of the neighbor nodes corresponding to the first device is smaller than or equal to the number of the neighbor nodes corresponding to other devices in at least one third device, determining that the first device is not the primary gateway.
S303, the first device determines at least one fourth device from the plurality of second devices according to the WiFi signal intensity of each second device, wherein the fourth device is the device with the highest WiFi signal intensity from the plurality of second devices.
After the first device determines that the first device is the primary gateway of the bluetooth Mesh network based on the above step S302, the first device determines the backup gateway of the bluetooth Mesh network according to steps S303-S309.
In this embodiment, the first device determines, according to the WiFi signal strengths of the second devices, a device corresponding to the maximum WiFi signal strength among the plurality of second devices as a fourth device. Wherein the number of fourth devices is at least one.
S304, the first device judges whether the number of the fourth devices is 1, if yes, S305 is executed, and if not, S306 is executed.
In this embodiment, the first device determines a backup gateway of the bluetooth Mesh network according to the number of fourth devices.
S305, the first device determines at least one fourth device as a standby gateway.
In the embodiment, when the first device determines that the number of the fourth devices is 1, it is indicated that the WiFi signal strength corresponding to the fourth device is the only maximum of the WiFi signal strengths of the plurality of second devices. Thus, the fourth device is determined to be a backup gateway of the bluetooth Mesh network.
S306, the first device determines at least one fifth device in the at least one fourth device according to the number of neighbor nodes of each fourth device, wherein the fifth device is the device with the largest number of neighbor nodes in the at least one fourth device.
In the embodiment, when the first device determines that the number of the fourth devices is not 1, it indicates that the WiFi signal intensities corresponding to the fourth devices are the maximum WiFi signal intensities in parallel among the WiFi signal intensities of the second devices.
And then, the first device determines the standby gateway of the Bluetooth Mesh network in the fourth devices according to the number of the neighbor nodes of each fourth device. Wherein, the neighboring node may further include: primary neighbor nodes, secondary neighbor nodes, tertiary neighbor nodes, etc. The corresponding number of neighbor nodes may include: the number of the primary neighbor nodes, the number of the secondary neighbor nodes, the number of the tertiary neighbor nodes and the like.
In one possible implementation, for example, the standby gateway of the bluetooth Mesh network is determined mainly by the number of primary neighbor nodes. Those skilled in the art will appreciate that the greater the number of primary neighbor nodes of a device, the closer the device is to the center of the bluetooth Mesh network. And the first device determines the device with the largest number of the first-level neighbor nodes in the fourth devices as the fifth device according to the number of the first-level neighbor nodes in the fourth devices. Wherein the number of fifth devices is at least one.
S307, the first device judges whether the number of the fifth devices is 1, if yes, the S308 is executed, and if not, the S309 is executed.
Based on step S306, after the first device determines at least one fifth device among the at least one fourth device, the first device next determines a backup gateway of the bluetooth Mesh network according to the number of the fifth devices.
S308, the first device determines at least one fifth device as a standby gateway.
In the embodiment, when the first device determines that the number of the fifth devices is 1, it is indicated that the number of the first-stage neighbor nodes corresponding to the fifth devices is the only maximum number of the first-stage neighbor nodes of the plurality of second devices. Thus, the fifth device is determined to be a backup gateway of the bluetooth Mesh network.
S309, the first device determines the device with the smallest device identifier in the at least one fifth device as the standby gateway.
The device identity is a fixed length value, e.g. the device identity may be a UUID.
In the embodiment, when the first device determines that the number of the fifth devices is not 1, it indicates that the number of the first-stage neighbor nodes corresponding to the plurality of fifth devices is the largest parallel among the number of the first-stage neighbor nodes of the plurality of fourth devices.
And then, the first device determines a standby gateway of the Bluetooth Mesh network in a plurality of fifth devices according to the device identification of each fifth device. Taking the example that the device identifier is a UUID, the first device determines a device corresponding to the smallest UUID in the plurality of fifth devices as a backup gateway of the bluetooth Mesh network.
S310, the first device sends the device identification of the main gateway and the device identification of the standby gateway to a plurality of second devices.
After the first device determines the main gateway and the standby gateway of the bluetooth Mesh network based on the steps, the first device sends the device identification of the main gateway and the device identification of the standby gateway to a plurality of second devices in the bluetooth Mesh network. The device identifier may be a UUID, for example. Taking the device identifier as a UUID as an example, the first device sends UUIDs of a main gateway and UUIDs of a standby gateway of the Bluetooth Mesh network to a plurality of second devices.
It should be noted that, the standby gateway needs to store the same bluetooth Mesh network node information as the main gateway, and needs to subscribe the same bluetooth Mesh network node application as the main gateway, which is favorable for seamlessly switching the standby gateway into the main network management to work when the standby gateway needs to be switched into the main gateway to work.
The method for deploying the master/slave gateway provided by the embodiment of the application comprises the following steps: the first device receives a first message sent by a plurality of second devices, wherein the first message comprises device identifiers of the second devices, and the plurality of second devices are other devices except the first device in the plurality of devices. The first device judges whether the first device is a master gateway of the Bluetooth Mesh network. If the first device is a main gateway, the first device determines at least one fourth device in the plurality of second devices according to the WiFi signal intensity of each second device, and the fourth device is the device with the maximum WiFi signal intensity in the plurality of second devices. The first device determines whether the number of fourth devices is 1. If yes, the first device determines at least one fourth device as a backup gateway. If not, the first device determines at least one fifth device in the at least one fourth device according to the number of neighbor nodes of each fourth device, wherein the fifth device is the device with the largest number of neighbor nodes in the at least one fourth device. The first device determines whether the number of fifth devices is 1. If yes, the first device determines at least one fifth device as a backup gateway. If not, the first device determines the device with the smallest device identifier in the at least one fifth device as the backup gateway. The first device sends the device identification of the primary gateway and the device identification of the backup gateway to the plurality of second devices. The method for determining the main gateway and the standby gateway in the Bluetooth Mesh network according to the WiFi signal intensity, the number of neighbor nodes and the device identification of a plurality of devices in the Bluetooth Mesh network ensures the WiFi communication quality of the main gateway and the standby gateway in the Bluetooth Mesh network, and simultaneously ensures that the main gateway and the standby gateway are closer to the center of the network, so that unnecessary communication overhead can be reduced.
On the basis of the above embodiment, in order to ensure that the bluetooth Mesh network can normally access the external network, it is necessary to determine whether the primary gateway in the bluetooth Mesh network needs to be switched according to the WiFi signal strength of the first device. The primary and backup gateway deployment method provided by the present application is further described below with reference to a specific embodiment, and is described with reference to fig. 4, where fig. 4 is a flowchart III of the primary and backup gateway deployment method provided by the embodiment of the present application.
As shown in fig. 4, the method includes:
s401, the first device judges whether the WiFi signal strength corresponding to the first device is greater than or equal to a first threshold value, if yes, S402 is executed, and if not, S403 is executed.
In this embodiment, after the first device determines the main gateway and the standby gateway of the bluetooth Mesh network, in order to ensure that the bluetooth Mesh network can normally access to the external network, it is therefore required to determine whether the standby gateway of the bluetooth Mesh network needs to replace the main gateway to operate according to the WiFi signal strength of the first device, so that the bluetooth Mesh network can normally access to the external network.
The first threshold is a value representing the magnitude of the WiFi signal strength.
Specifically, the first device determines whether the WiFi signal strength corresponding to the first device is greater than or equal to a first threshold, if so, S402 is executed, and if not, S403 is executed.
S402, the first device judges whether the WiFi signal strength corresponding to the standby gateway is larger than or equal to a second threshold value, and if not, S404 is executed.
In the embodiment, when the first device determines that the strength of the WiFi signal corresponding to the first device is greater than or equal to the first threshold, it indicates that the first device may still be used as a primary gateway of the bluetooth Mesh network to implement that the bluetooth Mesh network may normally access to the external network.
The second threshold is a value representing the magnitude of the WiFi signal strength.
In order to ensure that the standby gateway of the Bluetooth Mesh network can normally access the external network after being switched to the main gateway. And then, the first device judges whether the standby gateway of the Bluetooth Mesh network needs to be updated according to the WiFi signal strength of the standby gateway device. Specifically, the first device determines whether the strength of the WiFi signal corresponding to the backup gateway is greater than or equal to a second threshold. If not, the standby gateway of the Bluetooth Mesh network needs to be updated.
S403, the first device sends a master/slave gateway switching instruction to the slave gateway, where the master/slave gateway switching instruction is used to instruct switching the slave gateway to the master gateway.
In the embodiment, when the first device determines that the WiFi signal strength corresponding to the first device is smaller than the first threshold, it indicates that the WiFi signal strength of the first device is smaller, and reliability of the bluetooth Mesh network in accessing to the external network cannot be guaranteed. Therefore, the main gateway needs to be stopped, and the standby gateway needs to be operated as a gateway of the bluetooth Mesh.
In one possible implementation, the first device sends a primary and backup gateway switching instruction to the backup gateway. The master/slave gateway switching instruction is used for indicating to switch the slave gateway to the master gateway.
S404, updating the first device to the switched main gateway.
In the embodiment, after the standby gateway receives the main standby gateway switching instruction sent by the first device, the standby gateway switches to the main gateway of the bluetooth Mesh to work, so that the main gateway of the bluetooth Mesh is updated. After the updating is completed, the first device is updated to the switched main gateway, namely the main gateway for indicating the Bluetooth Mesh.
S405, the first device sends a status information request to the plurality of second devices.
In the embodiment, when the first device determines that the standby gateway needs to be updated, the first device sends state information requests to a plurality of second devices in the bluetooth Mesh network to acquire the state information requests of the second devices. Wherein the status information includes: wiFi signal strength, number of neighbor nodes, etc., are not limited.
S406, the first device receives second messages sent by a plurality of second devices, wherein the second messages comprise respective device identifiers, wiFi signal strength and the number of neighbor nodes of the second devices.
S407, according to the second messages sent by the plurality of second devices, the first device updates the standby gateway of the Bluetooth Mesh network.
Next, steps S406 and S407 will be described together.
In the embodiment, when the first device receives the second messages sent by the plurality of second devices. The second message includes the respective device identifier, the WiFi signal strength, and the number of neighbor nodes of the second device.
The specific implementation manner of updating the standby gateway of the bluetooth Mesh network by the first device according to the second messages sent by the plurality of second devices is similar to the implementation manner of steps S303-S309 in the foregoing embodiment, and will not be described herein.
The method for deploying the master/slave gateway provided by the embodiment of the application comprises the following steps: the first device judges whether the WiFi signal strength corresponding to the first device is larger than or equal to a first threshold value. The first device judges whether the WiFi signal strength corresponding to the standby gateway is larger than or equal to a second threshold value. If not, the first device sends a status information request to the plurality of second devices. If not, the first device sends a master/slave gateway switching instruction to the slave gateway, where the master/slave gateway switching instruction is used to instruct switching the slave gateway to the master gateway. The first device receives second messages sent by a plurality of second devices, wherein the second messages comprise respective device identifiers, wiFi signal strength and the number of neighbor nodes of the second devices. And according to the second messages sent by the plurality of second devices, the first device updates the standby gateway of the Bluetooth Mesh network. Whether the backup gateway needs to be updated is determined according to the WiFi signal intensity of the backup gateway in the Bluetooth Mesh network, so that the effectiveness of the master backup gateway is ensured, and the reliability of the Bluetooth Mesh network in accessing to the external network is further improved.
Fig. 5 is a schematic structural diagram of a primary gateway deployment device provided in an embodiment of the present application, where the device is applied to a bluetooth Mesh network, and the bluetooth Mesh network includes a plurality of devices. As shown in fig. 5, the apparatus 500 includes: a receiving module 501, a processing module 502 and a determining module 503.
A receiving module 501, configured to receive, by a first device, a first packet sent by a plurality of second devices, where the first packet includes a device identifier of the second device, and the plurality of second devices are other devices, except for the first device, in the plurality of devices;
the processing module 502 is configured to determine, by the first device, whether the first device is a primary gateway of the bluetooth Mesh network;
a determining module 503, configured to determine, if the first device is a primary gateway, a backup gateway of the bluetooth Mesh network in the plurality of second devices according to the first packets sent by the plurality of second devices, and send, to the plurality of second devices, a device identifier of the primary gateway and a device identifier of the backup gateway.
In one possible design, the processing module 502 is specifically configured to:
the first device judges whether the first device is a main gateway of the Bluetooth Mesh network according to the configuration information; or,
And the first device judges whether the first device is a main gateway of the Bluetooth Mesh network according to the first messages sent by the plurality of second devices.
In one possible design, the first message includes WiFi signal strength and number of neighbor nodes of the second device; the processing module 502 is specifically configured to:
the first equipment determines at least one third equipment in the first equipment and a plurality of second equipment according to the WiFi signal intensity of each second equipment and the WiFi signal intensity of the first equipment, wherein the at least one third equipment is the equipment with the maximum WiFi signal intensity in the first equipment and the plurality of second equipment;
the first device judges whether the at least one third device comprises the first device or not;
if yes, judging whether the number of neighbor nodes corresponding to the first equipment is larger than the number of neighbor nodes corresponding to other equipment in the at least one third equipment, if yes, determining that the first equipment is the main gateway, and if not, determining that the first equipment is not the main gateway;
if not, determining that the first device is not the primary gateway.
In one possible design, the first message includes WiFi signal strength and number of neighbor nodes of the second device; the determining module 503 is specifically configured to:
The first equipment determines at least one fourth equipment from the plurality of second equipment according to the WiFi signal intensity of each second equipment, wherein the fourth equipment is the equipment with the maximum WiFi signal intensity in the plurality of second equipment;
the first device judges whether the number of the fourth devices is 1;
if yes, the first device determines the at least one fourth device as the standby gateway;
if not, the first device determines at least one fifth device in the at least one fourth device according to the number of neighbor nodes of each fourth device, wherein the fifth device is the device with the largest number of neighbor nodes in the at least one fourth device; and determining the standby gateway according to the number of the fifth devices.
In one possible design, the device is identified as a fixed length value; the determining module 503 is specifically configured to:
the first device judges whether the number of the fifth devices is 1;
if yes, the first device determines the at least one fifth device as the standby gateway;
if not, the first device determines the device with the smallest device identifier in the at least one fifth device as the backup gateway.
In one possible design, the apparatus further comprises an update module, the update module being specifically configured to:
the first device judges whether the WiFi signal strength corresponding to the first device is larger than or equal to a first threshold value;
if not, the first device sends a primary and secondary gateway switching instruction to the secondary gateway, wherein the primary and secondary gateway switching instruction is used for indicating that the secondary gateway is switched to be a primary gateway.
In one possible design, the update module is further configured to:
the first device judges whether the WiFi signal strength corresponding to the standby gateway is larger than or equal to a second threshold value;
if not, the first device updates the standby gateway of the Bluetooth Mesh network.
In one possible design, the update module is specifically configured to:
the first device sends a status information request to the plurality of second devices;
the first device receives second messages sent by the plurality of second devices, wherein the second messages comprise respective device identifiers, wiFi signal strength and the number of neighbor nodes of the second devices;
and according to the second messages sent by the plurality of second devices, the first device updates the standby gateway of the Bluetooth Mesh network.
The device provided in this embodiment may be used to implement the technical solution of the foregoing method embodiment, and its implementation principle and technical effects are similar, and this embodiment will not be described in detail here.
Fig. 6 is a schematic hardware structure of a primary and backup gateway deployment device provided in an embodiment of the present application, as shown in fig. 6, a primary and backup gateway deployment device 600 in this embodiment includes: a processor 601 and a memory 602; wherein the method comprises the steps of
A memory 602 for storing computer-executable instructions;
the processor 601 is configured to execute computer-executable instructions stored in the memory to implement the steps performed by the method for deploying a backup gateway in the embodiment described above. See in particular the relevant description in the preceding method examples.
Alternatively, the memory 602 may be separate or integrated with the processor 601.
When the memory 602 is provided independently, the primary gateway deployment device further comprises a bus 603 for connecting said memory 602 and the processor 601.
The embodiment of the application provides a computer readable storage medium, wherein computer execution instructions are stored in the computer readable storage medium, and when a processor executes the computer execution instructions, a master/slave gateway deployment method executed by the master/slave gateway deployment device is realized.
Embodiments of the present application also provide a computer program product comprising: computer program stored in a readable storage medium, the computer program being readable from the readable storage medium by at least one processor of an electronic device, the at least one processor executing the computer program causing the electronic device to perform the solution provided by any of the embodiments described above.
In several examples provided herein, it should be understood that the disclosed apparatus and methods may be implemented in other ways. For example, the device embodiments described above are merely illustrative, e.g., the division of the modules is merely a logical function division, and other manners of division may be practical, e.g., multiple modules may be combined or integrated into a single system, or some features may be omitted, or not performed. In addition, the coupling or direct coupling or communication connection shown or discussed with each other may be through some interface, indirect coupling or communication connection of devices or modules, electrical, mechanical, or other form.
The integrated modules described above, implemented in the form of software functional modules, may be stored in a computer readable storage medium. The software functional module is stored in a storage medium, and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) or a processor (english: processor) to perform part of the steps of the methods described in the embodiments of the present application.
It should be understood that the above-mentioned Processor may be a Central Processing Unit (CPU), a general-purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), or the like. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The steps of a method disclosed in connection with the present invention may be embodied directly in a hardware processor for execution, or in a combination of hardware and software modules in a processor for execution.
The memory may comprise high speed RAM memory and may also include nonvolatile memory NVM, such as at least one magnetic disk memory, and may also be a U-disk, removable hard disk, read only memory, magnetic or optical disk, etc.
The bus may be an Industry Standard Architecture (ISA) bus, an external device interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. The buses may be divided into address buses, data buses, control buses, etc. For ease of illustration, the buses in the drawings of the present application are not limited to only one bus or to one type of bus.
The storage medium may be implemented by any type or combination of volatile or non-volatile memory devices such as Static Random Access Memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic or optical disk. A storage media may be any available media that can be accessed by a general purpose or special purpose computer.
One of ordinary skill in the art can appreciate: all or part of the steps for implementing the above-described method embodiments may be implemented by hardware associated with program instructions. The foregoing program may be stored in a computer readable storage medium. The program, when executed, performs steps including the method embodiments described above; and the storage medium of the foregoing includes: various media such as ROM, RAM, magnetic or optical disks may store the program code.
Finally, it should be noted that: the above embodiments are only for illustrating the technical solution of the present application, and are not limiting thereof; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical scheme recorded in the foregoing embodiments can be modified or some or all of the technical features of the technical scheme can be replaced equivalently; such modifications and substitutions do not depart from the spirit of the corresponding technical solutions from the scope of the technical solutions of the embodiments of the present application.

Claims (10)

1. A method for deploying a backup gateway, the method being applied to a bluetooth Mesh network, the bluetooth Mesh network comprising a plurality of devices, the method comprising:
the method comprises the steps that a first device receives a first message sent by a plurality of second devices, wherein the first message comprises a device identifier of the second device, and the plurality of second devices are other devices except the first device in the plurality of devices;
the first device judges whether the first device is a main gateway of the Bluetooth Mesh network;
if the first device is a main gateway, the first device determines a standby gateway of the Bluetooth Mesh network in the plurality of second devices according to first messages sent by the plurality of second devices, and sends a device identifier of the main gateway and a device identifier of the standby gateway to the plurality of second devices;
the first message comprises the WiFi signal strength and the neighbor node number of the second device; the first device determines a standby gateway in the plurality of second devices according to the first messages sent by the plurality of second devices, and the standby gateway comprises:
the first equipment determines at least one fourth equipment from the plurality of second equipment according to the WiFi signal intensity of each second equipment, wherein the fourth equipment is the equipment with the maximum WiFi signal intensity in the plurality of second equipment;
The first device judges whether the number of the fourth devices is 1;
if yes, the first device determines the at least one fourth device as the standby gateway;
if not, the first device determines at least one fifth device in the at least one fourth device according to the number of neighbor nodes of each fourth device, wherein the fifth device is the device with the largest number of neighbor nodes in the at least one fourth device; and determining the standby gateway according to the number of the fifth devices.
2. The method according to claim 1, wherein the first device determining whether the first device is a primary gateway of the bluetooth Mesh network comprises:
the first device judges whether the first device is a main gateway of the Bluetooth Mesh network according to the configuration information; or,
and the first device judges whether the first device is a main gateway of the Bluetooth Mesh network according to the first messages sent by the plurality of second devices.
3. The method according to claim 2, wherein the first device determining whether the first device is a primary gateway of the bluetooth Mesh network according to the first packets sent by the plurality of second devices includes:
The first equipment determines at least one third equipment in the first equipment and a plurality of second equipment according to the WiFi signal intensity of each second equipment and the WiFi signal intensity of the first equipment, wherein the at least one third equipment is the equipment with the maximum WiFi signal intensity in the first equipment and the plurality of second equipment;
the first device judges whether the at least one third device comprises the first device or not;
if yes, judging whether the number of neighbor nodes corresponding to the first equipment is larger than the number of neighbor nodes corresponding to other equipment in the at least one third equipment, if yes, determining that the first equipment is the main gateway, and if not, determining that the first equipment is not the main gateway;
if not, determining that the first device is not the primary gateway.
4. The method of claim 1, wherein the device is identified as a fixed length value; said determining said backup gateway according to the number of said fifth devices comprises:
the first device judges whether the number of the fifth devices is 1;
if yes, the first device determines the at least one fifth device as the standby gateway;
If not, the first device determines the device with the smallest device identifier in the at least one fifth device as the backup gateway.
5. The method according to any one of claims 1-4, wherein after determining a backup gateway among the plurality of second devices and transmitting the device identifier of the primary gateway and the device identifier of the backup gateway to the plurality of second devices, further comprises:
the first device judges whether the WiFi signal strength corresponding to the first device is larger than or equal to a first threshold value;
if not, the first device sends a primary and secondary gateway switching instruction to the secondary gateway, wherein the primary and secondary gateway switching instruction is used for indicating that the secondary gateway is switched to be a primary gateway.
6. The method according to any one of claims 1-4, wherein after determining a backup gateway among the plurality of second devices and transmitting the device identifier of the primary gateway and the device identifier of the backup gateway to the plurality of second devices, further comprises:
the first device judges whether the WiFi signal strength corresponding to the standby gateway is larger than or equal to a second threshold value;
if not, the first device updates the standby gateway of the Bluetooth Mesh network.
7. The method according to any one of claims 6, wherein updating the backup gateway of the bluetooth Mesh network comprises:
the first device sends a status information request to the plurality of second devices;
the first device receives second messages sent by the plurality of second devices, wherein the second messages comprise respective device identifiers, wiFi signal strength and the number of neighbor nodes of the second devices;
and according to the second messages sent by the plurality of second devices, the first device updates the standby gateway of the Bluetooth Mesh network.
8. A backup gateway deployment apparatus applied to a bluetooth Mesh network, the bluetooth Mesh network comprising a plurality of devices, the apparatus comprising:
the receiving module is used for receiving first messages sent by a plurality of second devices by the first device, wherein the first messages comprise device identifiers of the second devices, and the plurality of second devices are other devices except the first device in the plurality of devices;
the processing module is used for judging whether the first equipment is a main gateway of the Bluetooth Mesh network or not by the first equipment;
the determining module is used for determining a standby gateway of the Bluetooth Mesh network in the plurality of second devices according to a first message sent by the plurality of second devices if the first device is a main gateway, and sending a device identifier of the main gateway and a device identifier of the standby gateway to the plurality of second devices;
The determining module is specifically configured to determine at least one fourth device from the plurality of second devices according to the WiFi signal intensity of each second device, where the fourth device is a device with the maximum WiFi signal intensity in the plurality of second devices; the first device judges whether the number of the fourth devices is 1; if yes, the first device determines the at least one fourth device as the standby gateway; if not, the first device determines at least one fifth device in the at least one fourth device according to the number of neighbor nodes of each fourth device, wherein the fifth device is the device with the largest number of neighbor nodes in the at least one fourth device; and determining the standby gateway according to the number of the fifth devices.
9. A primary and backup gateway deployment apparatus, comprising:
a memory for storing a program;
a processor for executing the program stored in the memory, the processor being adapted to perform the method of any one of claims 1 to 7 when the program is executed.
10. A computer readable storage medium comprising instructions which, when run on a computer, cause the computer to perform the method of any one of claims 1 to 7.
CN202110915922.5A 2021-08-10 2021-08-10 Master-slave gateway deployment method and device Active CN113645072B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110915922.5A CN113645072B (en) 2021-08-10 2021-08-10 Master-slave gateway deployment method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110915922.5A CN113645072B (en) 2021-08-10 2021-08-10 Master-slave gateway deployment method and device

Publications (2)

Publication Number Publication Date
CN113645072A CN113645072A (en) 2021-11-12
CN113645072B true CN113645072B (en) 2023-11-07

Family

ID=78420595

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110915922.5A Active CN113645072B (en) 2021-08-10 2021-08-10 Master-slave gateway deployment method and device

Country Status (1)

Country Link
CN (1) CN113645072B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114884760A (en) * 2022-03-24 2022-08-09 浙江猫精人工智能科技有限公司 Networking method, networking display interface and computer readable storage medium

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104640192A (en) * 2015-01-21 2015-05-20 广州杰赛科技股份有限公司 Transmitting power control method, Mesh node and wireless network-shaped network system
CN108632940A (en) * 2017-03-23 2018-10-09 中国科学院沈阳自动化研究所 Reliable multi-path routing algorithm suitable for photoelectric sensor Wireless MESH network
CN108696387A (en) * 2017-04-12 2018-10-23 费希尔-罗斯蒙特***公司 Predictive connectivity for the wireless mesh network in Process Control System diagnoses
CN110336729A (en) * 2019-08-13 2019-10-15 北京百佑科技有限公司 Star network equilibrium network-building method, device and internet of things equipment
US10750433B1 (en) * 2018-09-14 2020-08-18 Amazon Technologies, Inc. Gateway selection in a mesh network
CN112751937A (en) * 2020-12-30 2021-05-04 广东好太太智能家居有限公司 Distributed edge intelligent Bluetooth Mesh gateway system and implementation method
CN112839310A (en) * 2020-12-29 2021-05-25 杭州涂鸦信息技术有限公司 Wireless communication method and Mesh device
CN112911426A (en) * 2021-01-22 2021-06-04 博为科技有限公司 Network control system, method and device and intelligent optical gateway
CN113132958A (en) * 2019-12-31 2021-07-16 佛山市云米电器科技有限公司 Fusion networking method, device, system and computer readable storage medium

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104640192A (en) * 2015-01-21 2015-05-20 广州杰赛科技股份有限公司 Transmitting power control method, Mesh node and wireless network-shaped network system
CN108632940A (en) * 2017-03-23 2018-10-09 中国科学院沈阳自动化研究所 Reliable multi-path routing algorithm suitable for photoelectric sensor Wireless MESH network
CN108696387A (en) * 2017-04-12 2018-10-23 费希尔-罗斯蒙特***公司 Predictive connectivity for the wireless mesh network in Process Control System diagnoses
US10750433B1 (en) * 2018-09-14 2020-08-18 Amazon Technologies, Inc. Gateway selection in a mesh network
CN110336729A (en) * 2019-08-13 2019-10-15 北京百佑科技有限公司 Star network equilibrium network-building method, device and internet of things equipment
CN113132958A (en) * 2019-12-31 2021-07-16 佛山市云米电器科技有限公司 Fusion networking method, device, system and computer readable storage medium
CN112839310A (en) * 2020-12-29 2021-05-25 杭州涂鸦信息技术有限公司 Wireless communication method and Mesh device
CN112751937A (en) * 2020-12-30 2021-05-04 广东好太太智能家居有限公司 Distributed edge intelligent Bluetooth Mesh gateway system and implementation method
CN112911426A (en) * 2021-01-22 2021-06-04 博为科技有限公司 Network control system, method and device and intelligent optical gateway

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
Service-oriented routing in distributed self-organizing software-defined networks;Yury A等;《AICT》;全文 *
无线Mesh网中基于负载平衡的多路径路由协议;***;;微计算机信息(第02期);全文 *

Also Published As

Publication number Publication date
CN113645072A (en) 2021-11-12

Similar Documents

Publication Publication Date Title
US20220272699A1 (en) Time domain resource format configuration method, communication apparatus, and communication system
EP4017115A1 (en) Routing method and device
CN113794637B (en) SID list processing method and device
EP3381239B1 (en) Interference mitigation in dense mesh networks
CN110913441B (en) Data transmission method and device
JP7413523B2 (en) Executing multipath communication
CN113746585A (en) Time service method and communication device
CN113645072B (en) Master-slave gateway deployment method and device
CN113794618B (en) Redundant network communication method and device based on virtual network card and terminal equipment
CN113645301A (en) Communication method and device
US11095514B2 (en) System and method for propagating anima network objective changes
WO2021197029A1 (en) Listen before talk (lbt) failure indicating method and apparatus
CN114640973A (en) Communication method and device
CN113365325B (en) Data transmission method and device, storage medium and electronic equipment
JP4613967B2 (en) Communication path setting method, communication path setting program, communication terminal, wireless network system
CN112087816A (en) Method for determining safety activation state and related product
WO2024067360A1 (en) Communication method and communication apparatus
US9532332B2 (en) Node device for releasing allocation of the unused channel to the radio interface
US20240179610A1 (en) Routing method and communication apparatus
WO2023016258A1 (en) Terminal access method and apparatus, terminal, and storage medium
CN111565141B (en) Data transmission method, first PE and second PE
WO2024055813A1 (en) User plane function (upf) network element deployment method, signaling processing method, and system
CN115842777A (en) Routing method and related equipment
CN116867023A (en) Route convergence method and processing system of mobile ad hoc network
CN116134881A (en) Method for updating or releasing returned configuration information and related products

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant