CN113645072A - Main/standby gateway deployment method and device - Google Patents

Main/standby gateway deployment method and device Download PDF

Info

Publication number
CN113645072A
CN113645072A CN202110915922.5A CN202110915922A CN113645072A CN 113645072 A CN113645072 A CN 113645072A CN 202110915922 A CN202110915922 A CN 202110915922A CN 113645072 A CN113645072 A CN 113645072A
Authority
CN
China
Prior art keywords
gateway
devices
mesh network
bluetooth mesh
equipment
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.)
Granted
Application number
CN202110915922.5A
Other languages
Chinese (zh)
Other versions
CN113645072B (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

Images

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 gateway and a standby 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 main gateway of the Bluetooth Mesh network. If the first device is the 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 a device identifier of the main gateway and a device identifier of the standby gateway to the plurality of second devices. The main gateway and the standby gateway are arranged in the Bluetooth Mesh network at the same time, so that the reliability of the Bluetooth Mesh network accessing to an external network is improved.

Description

Main/standby gateway deployment method and device
Technical Field
The embodiment of the application relates to communication technologies, and in particular, to a method and an apparatus for deploying a master gateway and a standby 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, is a Mesh flooding network in topology, and is characterized by a multi-hop network.
In the related art, only one device is usually fixed in the bluetooth Mesh network as a gateway device of the bluetooth Mesh network, wherein the gateway device is used for connecting the bluetooth Mesh network with an external network.
However, when a gateway device in the bluetooth Mesh network fails, the bluetooth Mesh network cannot access an external network and can only serve as a local network, and there is a problem that the reliability of the bluetooth Mesh network accessing the external network is low.
Disclosure of Invention
The embodiment of the application provides a method and a device for deploying a master gateway and a slave gateway, which are used for solving the problem of low reliability of a Bluetooth Mesh network accessing an external network.
In a first aspect, an embodiment of the present application provides a method for deploying a master gateway and a standby gateway, where the method is applied to a bluetooth Mesh network, where the bluetooth Mesh network includes multiple devices, and the method includes:
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;
the first equipment judges whether the first equipment is used or not
The master gateway of the Bluetooth Mesh network;
if the first device is a master 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 a device identifier of the master gateway and a device identifier of the standby gateway to the plurality of second devices.
In one possible design, the determining, by the first device, whether the first device is a master gateway of the bluetooth Mesh network includes:
the first equipment judges whether the first equipment is a main gateway of the Bluetooth Mesh network or not according to configuration information; or,
and the first equipment judges whether the first equipment is a main gateway of the Bluetooth Mesh network or not according to the first messages sent by the plurality of second equipment.
In one possible design, the first packet includes WiFi signal strength of the second device and the number of neighbor nodes; the determining, by the first device, whether the first device is a master gateway of the bluetooth Mesh network according to the first packet sent by the plurality of second devices includes:
the first device determines at least one third device from 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, wherein the at least one third device is the device with the largest WiFi signal strength from the first device and the plurality of second devices;
the first device judges whether the at least one third device comprises the first device;
if so, 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 so, determining that the first device is the main gateway, and if not, determining that the first device is not the main gateway;
if not, determining that the first device is not the primary gateway.
In one possible design, the first packet includes WiFi signal strength of the second device and the number of neighbor nodes; the determining, by the first device, a standby gateway in the plurality of second devices according to the first packet sent by the plurality of second devices includes:
the first device determines at least one fourth device in the plurality of second devices according to the WiFi signal strength of each second device, wherein the fourth device is the device with the largest WiFi signal strength in the plurality of second devices;
the first equipment judges whether the number of the fourth equipment is 1 or not;
if so, 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 from 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 equipment.
In one possible design, the device identification is a fixed length number; determining the standby gateway according to the number of the fifth devices includes:
the first equipment judges whether the number of the fifth equipment is 1;
if so, the first device determines the at least one fifth device as the standby gateway;
if not, the first device determines the device with the minimum device identifier in the at least one fifth device as the standby gateway.
In one possible design, after determining a standby gateway in the plurality of second devices and sending the device identifier of the main gateway and the device identifier of the standby gateway to the plurality of second devices, the method further includes:
the first equipment judges whether the WiFi signal strength corresponding to the first equipment is greater than or equal to a first threshold value;
if not, the first device sends a master/slave gateway switching instruction to the slave gateway, wherein the master/slave gateway switching instruction is used for indicating that the slave gateway is switched to the master gateway.
In one possible design, after determining a standby gateway in the plurality of second devices and sending the device identifier of the main gateway and the device identifier of the standby gateway to the plurality of second devices, the method further includes:
the first equipment judges whether the WiFi signal strength corresponding to the standby gateway is larger than or equal to a second threshold value or not;
and if not, the first equipment updates the standby gateway of the Bluetooth Mesh network.
In one possible design, the updating the standby gateway of the bluetooth Mesh network includes:
the first device sending a status information request to the plurality of second devices;
the first equipment receives second messages sent by the plurality of second equipment, wherein the second messages comprise respective equipment identifications, WiFi signal strength and the number of neighbor nodes of the second equipment;
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 device for deploying a master gateway and a standby gateway, where the device is applied to a bluetooth Mesh network, where the bluetooth Mesh network includes a plurality of devices, and the device includes:
a receiving module, 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 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;
a determining module, configured to determine, by the first device according to the first packet sent by the multiple second devices, a standby gateway of the bluetooth Mesh network in the multiple second devices if the first device is a master gateway, and send a device identifier of the master gateway and a device identifier of the standby gateway to the multiple second devices.
In one possible design, the processing module is specifically configured to:
the first equipment judges whether the first equipment is a main gateway of the Bluetooth Mesh network or not according to configuration information; or,
and the first equipment judges whether the first equipment is a main gateway of the Bluetooth Mesh network or not according to the first messages sent by the plurality of second equipment.
In one possible design, the first packet includes WiFi signal strength of the second device and the number of neighbor nodes; the processing module is specifically configured to:
the first device determines at least one third device from 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, wherein the at least one third device is the device with the largest WiFi signal strength from the first device and the plurality of second devices;
the first device judges whether the at least one third device comprises the first device;
if so, 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 so, determining that the first device is the main gateway, and if not, determining that the first device is not the main gateway;
if not, determining that the first device is not the primary gateway.
In one possible design, the first packet includes WiFi signal strength of the second device and the number of neighbor nodes; the determining module is specifically configured to:
the first device determines at least one fourth device in the plurality of second devices according to the WiFi signal strength of each second device, wherein the fourth device is the device with the largest WiFi signal strength in the plurality of second devices;
the first equipment judges whether the number of the fourth equipment is 1 or not;
if so, 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 from 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 equipment.
In one possible design, the device identification is a fixed length number; the determining module is specifically configured to:
the first equipment judges whether the number of the fifth equipment is 1;
if so, the first device determines the at least one fifth device as the standby gateway;
if not, the first device determines the device with the minimum device identifier in the at least one fifth device as the standby gateway.
In one possible design, the apparatus further includes an update module, and the update module is specifically configured to:
the first equipment judges whether the WiFi signal strength corresponding to the first equipment is greater than or equal to a first threshold value;
if not, the first device sends a master/slave gateway switching instruction to the slave gateway, wherein the master/slave gateway switching instruction is used for indicating that the slave gateway is switched to the master gateway.
In one possible design, the update module is further to:
the first equipment judges whether the WiFi signal strength corresponding to the standby gateway is larger than or equal to a second threshold value or not;
and if not, the first equipment updates the standby gateway of the Bluetooth Mesh network.
In one possible design, the update module is specifically configured to:
the first device sending a status information request to the plurality of second devices;
the first equipment receives second messages sent by the plurality of second equipment, wherein the second messages comprise respective equipment identifications, WiFi signal strength and the number of neighbor nodes of the second equipment;
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 an active/standby gateway deployment device, including:
a memory for storing a program;
a processor for executing the program stored by the memory, the processor being adapted to perform the method as described above in the first aspect and any one 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 executed on a computer, cause the computer to perform the method as described above in the first aspect and any one of the various possible designs of the first aspect.
In a fifth aspect, an embodiment of the present application provides a computer program product, where the program product includes: a computer program stored in a readable storage medium, from which at least one processor of an electronic device can read the computer program, execution of the computer program by the at least one processor causing the electronic device to perform the method as set forth in the first aspect above and any one of the various possible designs of the first aspect.
The embodiment of the application provides a method and a device for deploying a master gateway and a standby 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 main gateway of the Bluetooth Mesh network. If the first device is the 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 a device identifier of the main gateway and a device identifier of the standby gateway to the plurality of second devices. The main gateway and the standby gateway are arranged in the Bluetooth Mesh network at the same time, so that the reliability of the Bluetooth Mesh network accessing to an 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, the drawings needed to be used in the description of the embodiments or the prior art will be briefly introduced below, and it is obvious that the drawings in the following description are some embodiments of the present application, and for those skilled in the art, other drawings can be obtained according to these drawings without inventive exercise.
Fig. 1 is a schematic view of an application scenario provided in an embodiment of the present application;
fig. 2 is a first flowchart of a method for deploying an active/standby gateway according to an embodiment of the present application;
fig. 3 is a second flowchart of a method for deploying an active/standby gateway according to an embodiment of the present application;
fig. 4 is a flowchart of a method for deploying an active/standby gateway according to an embodiment of the present application;
fig. 5 is a schematic structural diagram of an active/standby gateway deployment device according to an embodiment of the present application;
fig. 6 is a schematic diagram of a hardware structure of an active/standby gateway deployment device according to an embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, 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 obvious that the described embodiments are some embodiments of the present application, but not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
In order to facilitate understanding of the technical solutions of the present application, first, related concepts related to the present application are introduced:
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 maximum communication distance between 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 the Bluetooth to expand the network coverage, namely the Bluetooth Mesh network is formed. It should be emphasized 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, details of the deployment features of the bluetooth Mesh network will be described.
The deployment mode of the bluetooth Mesh network is gateway and node (STA), namely, the network is accessed by the bluetooth mode, and the networking device comprises a bluetooth gateway and at least one STA. The Bluetooth gateway is gateway equipment integrating Bluetooth, WiFi and Ethernet, data of the Bluetooth equipment connected with the Bluetooth gateway are transmitted to the server in a WiFi or Ethernet mode through the Bluetooth gateway through a serial port between the Bluetooth and the WiFi, and the data of the server side are transmitted back to the Bluetooth equipment. The STA is a device including a bluetooth communication module in the bluetooth Mesh network. Therefore, the Bluetooth Mesh network is formed by one Bluetooth gateway and at least one Internet of things device comprising a 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 network-enabled device including a bluetooth module, for example, a device including a chip integrating a bluetooth module and a WiFi module.
In the Bluetooth Mesh network, based on the Bluetooth gateway establishment, a plurality of STAs are added into a wireless network formed by the Bluetooth gateway. The networking mode has the characteristics that: the Bluetooth gateway is used as the center of the whole Bluetooth Mesh network, and other STAs establish Bluetooth communication with the Bluetooth gateway or establish Bluetooth communication among other STAs, so that the communication coverage of the Bluetooth Mesh network is continuously extended.
The following describes the prior art and problems of the prior art to which the present application relates:
in the related art, in the bluetooth Mesh network, only one device is usually fixed as a gateway device of the bluetooth Mesh network, wherein the gateway device is used for connecting the bluetooth Mesh network with an external network.
However, when a gateway device in the bluetooth Mesh network fails, the bluetooth Mesh network cannot access an external network and can only serve as a local network, and there is a problem that the reliability of the bluetooth Mesh network accessing the external network is low.
Based on the existing problems, the application provides the following technical concepts: in the Bluetooth Mesh network formed by a plurality of Internet of things devices based on WiFi and Bluetooth Mesh dual-mode communication, each Internet of things device is a device based on WiFi and Bluetooth Mesh dual-mode communication, so when part of Internet of things devices are connected with WiFi and accessed into the Bluetooth Mesh network simultaneously, the part of Internet of things devices can be used as candidate gateways of the Bluetooth Mesh network. Two pieces of Internet of things equipment are selected from the part of Internet of things equipment and are respectively used as a main gateway and a standby gateway of the Bluetooth Mesh network. The master gateway of the Bluetooth Mesh network is used as a gateway of the Bluetooth Mesh network to work; the standby gateway of the Bluetooth Mesh network is used as a candidate gateway in the Bluetooth Mesh network, and is used as an STA of the Bluetooth Mesh network to normally receive and send information during normal work. When the main gateway of the Bluetooth Mesh network fails or the WiFi signal intensity of the main gateway of the Bluetooth Mesh network 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 accessing to the external network is improved by setting the main gateway and the standby gateway in the Bluetooth Mesh network.
Next, an application scenario of the embodiment of the present application is 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 system comprises a WiFi router and a plurality of Internet of things devices based on dual-mode communication, wherein the plurality of Internet of things devices form a Bluetooth Mesh network. For simplification of illustration, as shown in fig. 1, the embodiment of the present application is described by taking as an example that 7 pieces of internet-of-things devices based on dual-mode communication are STA1, STA2, …, and STA7, respectively, and the 7 pieces of internet-of-things devices are devices based on WiFi and bluetooth Mesh dual-mode communication, that is, each device has a chip including both a WiFi module and a bluetooth module. STA1-STA7 are connected to each other to form a bluetooth Mesh network, and STA1, STA2 and STA3 are all connected to a WiFi router.
It should be noted that, after 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, when the internet of things device works as the gateway, data interaction can be performed between the WiFi module and the bluetooth Mesh module in the internet of things device. When the device is used as a non-gateway device, data interaction cannot be carried out between the WiFi module and the Bluetooth Mesh module in the device.
In the embodiment of the application, two pieces of internet of things equipment are selected from 7 pieces of internet of things equipment based on dual-mode communication, which form a bluetooth Mesh network, and are respectively used as a main gateway and a standby gateway of the bluetooth Mesh network. The connection between the Bluetooth Mesh network and an external network is realized through a main gateway in the Bluetooth Mesh network.
The technical means shown in the present application will be described in detail below with reference to specific examples. It should be noted that the following embodiments may exist alone or in combination with each other, and description of the same or similar contents is not repeated in different embodiments.
Based on the technical concept introduced above, the method for deploying active/standby gateways provided by 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 main body in the embodiment of the present application is each device in the bluetooth Mesh network, and fig. 2 is a first flowchart of the method for deploying active/standby gateways provided by the embodiment of the present application.
As shown in fig. 2, the method includes:
s201, a first device receives a first message sent by a plurality of second devices, where the first message includes a device identifier of the second device, and the plurality of second devices are other devices except the first device.
In a bluetooth Mesh network a plurality of devices are included. The first device is one of a plurality of devices in a Bluetooth Mesh network. The second device is a device other than the first device among the plurality of devices of the bluetooth Mesh network.
In this embodiment, a plurality of devices in the bluetooth Mesh network are all internet of things devices for dual-mode communication. The master-standby gateway deployment method provided by the application is described by taking an internet of things device with dual-mode communication as an example, the internet of things device is based on WiFi and bluetooth Mesh communication. Each device in the bluetooth Mesh network sends a corresponding first message to each other, wherein the first message includes a device identifier of the device. For example, the device Identifier may be a Universally Unique Identifier (UUID) of the device. Wherein each device corresponds to a unique UUID and one UUID corresponds to a unique device. Thus, a device's UUID can be said to be an identification unique to that device.
Optionally, the first packet further includes WiFi signal strength of the device and the number of neighbor nodes. It should be noted that, whether the device has accessed 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 does not access the WiFi network; if the WiFi signal strength in the first message is not 0, it indicates that the device has accessed the WiFi network. In addition, the stronger the WiFi signal strength in the first message, the better the WiFi network status 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 message sent by other devices in the bluetooth Mesh network. Specifically, when the first device is directly connected with part of the devices, the first device directly receives a first message sent by other devices; when the first device is not directly connected with other parts of devices, the devices between the first device and other parts of devices are used as relay devices to realize that other parts of devices send the first message to the first device, so that the first device receives the first message sent by other parts of devices.
S202, the first equipment judges whether the first equipment is a main gateway of the Bluetooth Mesh network.
Two possible implementation manners of the first device determining whether the first device is the master gateway of the bluetooth Mesh network are exemplarily described below.
In a possible implementation manner, according to the configuration information of the master gateway, the first device determines whether the first device is the master 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 master 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 master gateway of the bluetooth Mesh network. In one case, 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, the first device is determined to be 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 master gateway of the bluetooth Mesh network, it is determined that the first device is not the master gateway of the bluetooth Mesh network.
In another possible implementation manner, the first device determines whether the first device is a master gateway of the bluetooth Mesh network according to WiFi signal strength in a first message sent by a plurality of second devices. The first message comprises WiFi signal strength. Specifically, according to the WiFi signal strength in the first message of the multiple devices, the device corresponding to the first message with the largest WiFi signal strength is determined as the master gateway of the bluetooth Mesh network. If the WiFi signal strength corresponding to the first device is the device with the largest WiFi signal strength among the multiple devices, the first device may determine that the first device is the master gateway, otherwise, determine that the first device is not the master gateway of the bluetooth Mesh network.
In this embodiment, a specific implementation manner of the first device determining whether the first device is the master gateway of the bluetooth Mesh network is only exemplarily described, but a specific implementation manner of the first device determining whether the first device is the master gateway of the bluetooth Mesh network is not limited, and a specific implementation manner of the first device determining whether the first device is the master gateway of the bluetooth Mesh network may be selected according to actual requirements.
S203, if the first device is the 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.
In this embodiment, when the first device determines that the first device is a master gateway of the bluetooth Mesh network, the first device determines a standby gateway of the bluetooth Mesh network in the plurality of second devices according to a first message sent by the plurality of devices of the bluetooth Mesh network.
Next, two possible implementation methods for determining a standby gateway of a bluetooth Mesh network in a plurality of second devices by a first device according to a first packet sent by a plurality of devices of the bluetooth Mesh network are exemplarily described.
In a possible implementation manner, when the first device determines that the first device is a master gateway of the bluetooth Mesh network according to the configuration information, then the first device determines a standby gateway of the bluetooth Mesh network according to WiFi signal strength in a first message sent by a plurality of second devices. Specifically, according to the strength of the WiFi signal in the first message of the multiple devices, the device corresponding to the maximum WiFi signal strength in the multiple first messages is determined as the standby gateway of the bluetooth Mesh network.
In another possible implementation manner, when the first device determines that the first device is a master gateway of the bluetooth Mesh network according to that the first device is a device corresponding to the maximum WiFi signal strength in the bluetooth Mesh network, the first device determines that the WiFi signal strength in a first message sent by a plurality of second devices in the bluetooth Mesh network is located in a second device, and the second device is a standby gateway of the bluetooth Mesh network.
After the first device determines a standby gateway of the bluetooth Mesh network in the plurality of second devices, the first device sends a device identifier corresponding to a main gateway device of the bluetooth Mesh network and a device identifier corresponding to a standby gateway device to the plurality of second devices in the bluetooth Mesh network.
The method for deploying the active and standby gateways provided by the embodiment of the application is applied to a bluetooth Mesh network, and 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 main gateway of the Bluetooth Mesh network. If the first device is the 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 a device identifier of the main gateway and a device identifier of the standby gateway to the plurality of second devices. The main gateway and the standby gateway are arranged in the Bluetooth Mesh network at the same time, so that the reliability of the Bluetooth Mesh network accessing to an external network is improved.
Based on the foregoing embodiment, the following further introduces the active/standby gateway deployment method provided in this application with reference to a specific embodiment, and with reference to fig. 3, fig. 3 is a second flowchart of the active/standby gateway deployment method provided in this embodiment.
As shown in fig. 3, the method includes:
s301, a first device receives 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 the first device.
The implementation manner of step S301 is similar to that of step S201, and is not described herein again.
S302, the first device judges whether the first device is a main gateway of the Bluetooth Mesh network, if so, S303 is executed.
Two possible implementation manners of the first device determining whether the first device is the master gateway of the bluetooth Mesh network are exemplarily described below.
In a possible implementation manner, according to the configuration information of the master gateway, the first device determines whether the first device is the master 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 master 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 master gateway of the bluetooth Mesh network. In one case, 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, the first device is determined to be 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 master gateway of the bluetooth Mesh network, it is determined that the first device is not the master gateway of the bluetooth Mesh network.
In another possible implementation manner, the first message further includes WiFi signal strength of the second device and the number of neighbor nodes. The first device judges whether the first device is a main gateway of the Bluetooth Mesh network or not according to the WiFi signal strength and the number of neighbor nodes in the first message sent by the plurality of second devices. Specifically, the first device determines at least one third device from 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 a device with the largest WiFi signal strength 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, determining 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 device is larger than the number of the neighbor nodes corresponding to other devices in the at least one third device, determining that the first device is a main gateway; and if the number of the neighbor nodes corresponding to the first device is less than or equal to the number of the neighbor nodes corresponding to other devices in the at least one third device, determining that the first device is not the primary gateway.
And S303, the first device determines at least one fourth device in the plurality of second devices according to the WiFi signal strength of each second device, wherein the fourth device is the device with the largest WiFi signal strength in the plurality of second devices.
After the first device determines that the first device is the master gateway of the bluetooth Mesh network based on the step S302, the first device determines the standby gateway of the bluetooth Mesh network according to the steps S303 to S309.
In this embodiment, the first device determines, as the fourth device, a device corresponding to the maximum WiFi signal strength in the plurality of second devices according to the WiFi signal strength of the second devices. Wherein the number of the fourth devices is at least one.
S304, the first device determines whether the number of the fourth devices is 1, if so, performs S305, and if not, performs S306.
In this embodiment, the first device determines the standby gateway of the bluetooth Mesh network according to the number of the fourth devices.
S305, the first device determines at least one fourth device as a standby gateway.
In this embodiment, when the first device determines that the number of the fourth devices is 1, it indicates that the WiFi signal strength corresponding to the fourth device is the only maximum WiFi signal strength of the plurality of second devices. Thus, the fourth device is determined to be a standby gateway of the bluetooth Mesh network.
S306, the first device determines at least one fifth device from 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 this embodiment, when the first device determines that the number of the fourth devices is not 1, it indicates that the WiFi signal strengths corresponding to the plurality of fourth devices are the maximum WiFi signal strengths of the plurality of second devices in parallel.
Next, the first device determines a standby gateway of the bluetooth Mesh network in the plurality of fourth devices according to the number of neighbor nodes of each fourth device. Wherein, the neighbor node may further include: a first-level neighbor node, a second-level neighbor node, a third-level neighbor node, and the like. The corresponding number of neighbor nodes may include: the number of first-level neighbor nodes, the number of second-level neighbor nodes, the number of third-level neighbor nodes and the like.
In one possible implementation, the standby gateway of the bluetooth Mesh network is determined primarily based on the number of primary neighbor nodes, for example. It will be appreciated by those skilled in the art that a greater number of primary neighbor nodes for a device indicates that the device is closer to the center of the bluetooth Mesh network. And the first equipment determines the equipment with the maximum number of the first-level neighbor nodes in the plurality of fourth equipment as fifth equipment according to the number of the first-level neighbor nodes of the plurality of fourth equipment. Wherein the number of the fifth devices is at least one.
S307, the first device determines whether the number of the fifth devices is 1, if so, performs S308, and if not, performs S309.
Based on step S306, after the first device determines at least one fifth device among the at least one fourth device, the first device then determines a standby gateway of the bluetooth Mesh network according to the number of the fifth devices.
And S308, the first device determines at least one fifth device as a standby gateway.
In this embodiment, when the first device determines that the number of the fifth devices is 1, it indicates that the number of the first-level neighbor nodes corresponding to the fifth device is the only largest number among the number of the first-level neighbor nodes of the plurality of second devices. Thus, the fifth device is determined to be a standby gateway of the bluetooth Mesh network.
S309, the first device determines the device with the minimum device identifier in the at least one fifth device as the standby gateway.
The device identification is a fixed length value, for example, the device identification may be a UUID.
In this embodiment, when the first device determines that the number of the fifth devices is not 1, it indicates that the number of the first-level neighbor nodes corresponding to the plurality of fifth devices is the largest parallel number among the number of the first-level neighbor nodes of the plurality of fourth devices.
And then, the first device determines a standby gateway of the Bluetooth Mesh network in the plurality of fifth devices according to the device identifier of each fifth device. Taking the device identifier as the UUID as an example, the first device determines the device corresponding to the minimum UUID in the fifth devices as the standby 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 determining a main gateway and a standby gateway of the bluetooth Mesh network based on the steps, the first device sends the device identifier of the main gateway and the device identifier of the standby gateway to a plurality of second devices in the bluetooth Mesh network. The device identifier may be, for example, a UUID. Taking the device identifier as the UUID as an example, the first device sends the UUID of the main gateway and the UUID of the standby gateway of the bluetooth Mesh network to the plurality of second devices.
It should be noted that, the bluetooth Mesh network node information that is the same as that of the main gateway needs to be stored in the standby gateway, and the bluetooth Mesh network node application that is the same as that of the main gateway needs to be subscribed, which is beneficial to seamlessly switching the standby gateway to the main gateway for working when the standby gateway needs to be switched to the main gateway for working.
The method for deploying the active/standby 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 main gateway of the Bluetooth Mesh network. If the first device is the master gateway, the first device determines at least one fourth device from the plurality of second devices according to the WiFi signal strength of each second device, and the fourth device is a device with the largest WiFi signal strength from the plurality of second devices. The first device determines whether the number of the fourth devices is 1. And if so, the first device determines at least one fourth device as the standby gateway. If not, the first device determines at least one fifth device from the at least one fourth device according to the number of neighbor nodes of each fourth device, and 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 the fifth devices is 1. And if so, the first device determines at least one fifth device as the standby gateway. If not, the first device determines the device with the minimum device identifier in the at least one fifth device as the standby gateway. 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. The method for determining the main gateway and the standby gateway in the Bluetooth Mesh network according to the WiFi signal strength of a plurality of devices in the Bluetooth Mesh network, the number of neighbor nodes and the device identification guarantees the WiFi communication quality of the main gateway and the standby gateway in the Bluetooth Mesh network, meanwhile guarantees that the main gateway and the standby gateway are closer to the center of the network, and therefore 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 active/standby gateways in the bluetooth Mesh network need to be switched according to the WiFi signal strength of the first device. Next, a detailed embodiment is described with reference to fig. 4, where fig. 4 is a flowchart of a method for deploying an active/standby gateway according to 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 larger than or equal to a first threshold value, if so, 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 the external network, it is necessary 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 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, then S402 is executed, and if not, then 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 this embodiment, when the first device determines that the WiFi signal strength corresponding to the first device is greater than or equal to the first threshold, it indicates that the first device can still operate as a master gateway of the bluetooth Mesh network, so that the bluetooth Mesh network can normally access an external network.
The second threshold is a value representing the magnitude of the WiFi signal strength.
In order to ensure that the Bluetooth Mesh network can be normally accessed to an external network after a standby gateway of the Bluetooth Mesh network needs to be switched to a main gateway. And then, the first device judges whether the standby gateway of the Bluetooth Mesh network needs to be updated or not according to the WiFi signal intensity of the standby gateway device. Specifically, the first device determines whether the WiFi signal strength corresponding to the standby gateway is greater than or equal to a second threshold. If not, indicating that 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 the slave gateway to switch to the master gateway.
In this 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 cannot ensure the reliability of the bluetooth Mesh network accessing the external network. Therefore, the main gateway needs to stop working, and the standby gateway needs to work as the gateway of the bluetooth Mesh.
In a possible implementation manner, the first device sends a master/standby gateway switching instruction to the standby gateway. The master/standby gateway switching instruction is used for indicating that the standby gateway is switched to the main gateway.
S404, updating the first equipment to be the switched main gateway.
In this embodiment, after receiving the master/slave gateway switching instruction sent by the first device, the slave gateway switches to the master gateway of the bluetooth Mesh to operate, so that the master gateway of the bluetooth Mesh is updated. After the update is completed, the first device is updated to the switched master gateway, that is, the first device is used for indicating the master gateway of the bluetooth Mesh.
S405, the first device sends a state information request to the plurality of second devices.
In this embodiment, when the first device determines that the standby gateway needs to be updated, the first device sends a status information request to a plurality of second devices in the bluetooth Mesh network to obtain status information requests of the second devices. Wherein the state information includes: WiFi signal strength, number of neighbor nodes, etc., without limitation.
S406, the first device receives second messages sent by the plurality of second devices, wherein the second messages include device identifiers of the second devices, WiFi signal strength and the number of neighbor nodes.
S407, according to the second messages sent by the second devices, the first device updates the standby gateway of the Bluetooth Mesh network.
Next, steps S406 and S407 will be collectively described.
In this embodiment, when the first device receives the second messages sent by the plurality of second devices. The second message includes the device identifier of the second device, the WiFi signal strength, and the number of neighboring nodes.
The specific implementation manner of the first device updating the standby gateway of the bluetooth Mesh network according to the second messages sent by the multiple second devices is similar to the implementation manner of steps S303 to S309 in the foregoing embodiment, and details are not described here.
The method for deploying the active/standby 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. And the first equipment judges whether the WiFi signal strength corresponding to the standby gateway is greater than or equal to a second threshold value. If not, the first device sends a state information request to the plurality of second devices. If not, the first device sends a master/slave gateway switching instruction to the slave gateway, wherein the master/slave gateway switching instruction is used for indicating that the slave gateway is switched to the master gateway. The first device receives second messages sent by a plurality of second devices, wherein the second messages comprise respective device identifications, WiFi signal strength and neighbor node number 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 standby gateway needs to be updated or not is determined according to the WiFi signal strength of the standby gateway in the Bluetooth Mesh network, so that the effectiveness of the standby gateway is guaranteed, and the reliability of the Bluetooth Mesh network accessing to an external network is improved.
Fig. 5 is a schematic structural diagram of an active/standby gateway deployment apparatus according to an embodiment of the present application, where the apparatus is applied to a bluetooth Mesh network, and the bluetooth Mesh network includes multiple 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 in the plurality of devices except the first device;
a processing module 502, configured to determine, by the first device, whether the first device is a master gateway of the bluetooth Mesh network;
a determining module 503, configured to, if the first device is a master gateway, determine, by the first device, a standby gateway of the bluetooth Mesh network in the plurality of second devices according to the first packet sent by the plurality of second devices, and send a device identifier of the master gateway and a device identifier of the standby gateway to the plurality of second devices.
In one possible design, the processing module 502 is specifically configured to:
the first equipment judges whether the first equipment is a main gateway of the Bluetooth Mesh network or not according to configuration information; or,
and the first equipment judges whether the first equipment is a main gateway of the Bluetooth Mesh network or not according to the first messages sent by the plurality of second equipment.
In one possible design, the first packet includes WiFi signal strength of the second device and the number of neighbor nodes; the processing module 502 is specifically configured to:
the first device determines at least one third device from 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, wherein the at least one third device is the device with the largest WiFi signal strength from the first device and the plurality of second devices;
the first device judges whether the at least one third device comprises the first device;
if so, 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 so, determining that the first device is the main gateway, and if not, determining that the first device is not the main gateway;
if not, determining that the first device is not the primary gateway.
In one possible design, the first packet includes WiFi signal strength of the second device and the number of neighbor nodes; the determining module 503 is specifically configured to:
the first device determines at least one fourth device in the plurality of second devices according to the WiFi signal strength of each second device, wherein the fourth device is the device with the largest WiFi signal strength in the plurality of second devices;
the first equipment judges whether the number of the fourth equipment is 1 or not;
if so, 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 from 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 equipment.
In one possible design, the device identification is a fixed length number; the determining module 503 is specifically configured to:
the first equipment judges whether the number of the fifth equipment is 1;
if so, the first device determines the at least one fifth device as the standby gateway;
if not, the first device determines the device with the minimum device identifier in the at least one fifth device as the standby gateway.
In one possible design, the apparatus further includes an update module, and the update module is specifically configured to:
the first equipment judges whether the WiFi signal strength corresponding to the first equipment is greater than or equal to a first threshold value;
if not, the first device sends a master/slave gateway switching instruction to the slave gateway, wherein the master/slave gateway switching instruction is used for indicating that the slave gateway is switched to the master gateway.
In one possible design, the update module is further to:
the first equipment judges whether the WiFi signal strength corresponding to the standby gateway is larger than or equal to a second threshold value or not;
and if not, the first equipment updates the standby gateway of the Bluetooth Mesh network.
In one possible design, the update module is specifically configured to:
the first device sending a status information request to the plurality of second devices;
the first equipment receives second messages sent by the plurality of second equipment, wherein the second messages comprise respective equipment identifications, WiFi signal strength and the number of neighbor nodes of the second equipment;
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 apparatus provided in this embodiment may be used to implement the technical solutions of the above method embodiments, and the implementation principles and technical effects are similar, which are not described herein again.
Fig. 6 is a schematic diagram of a hardware structure of an active/standby gateway deployment device according to an embodiment of the present application, and as shown in fig. 6, an active/standby gateway deployment device 600 according to this embodiment includes: a processor 601 and a memory 602; wherein
A memory 602 for storing computer-executable instructions;
the processor 601 is configured to execute the computer execution instruction stored in the memory, so as to implement each step executed by the active/standby gateway deployment method in the foregoing embodiments. Reference may be made in particular to the description relating to the method embodiments described above.
Alternatively, the memory 602 may be separate or integrated with the processor 601.
When the memory 602 is independently configured, the active/standby gateway deployment apparatus further includes a bus 603 for connecting the memory 602 and the processor 601.
An embodiment of the present application provides a computer-readable storage medium, where a computer execution instruction is stored in the computer-readable storage medium, and when a processor executes the computer execution instruction, the method for deploying an active/standby gateway, executed by the above active/standby gateway deployment device, is implemented.
An embodiment of the present application further provides a computer program product, where the program product includes: a computer program, stored in a readable storage medium, from which at least one processor of the electronic device can read the computer program, 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 the several embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the above-described device embodiments are merely illustrative, and for example, the division of the modules is only one logical division, and other divisions may be realized in practice, for example, a plurality of modules may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or modules, and may be in an electrical, mechanical or other form.
The integrated module implemented in the form of a software functional module may be stored in a computer-readable storage medium. The software functional module is stored in a storage medium and includes several instructions for enabling a computer device (which may be a personal computer, a server, or a network device) or a processor (processor) to execute some steps of the methods according to the embodiments of the present application.
It should be understood that the Processor may be a Central Processing Unit (CPU), other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), etc. 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, or in a combination of the hardware and software modules within the processor.
The memory may comprise a high-speed RAM memory, and may further comprise a non-volatile storage NVM, such as at least one disk memory, and may also be a usb disk, a removable hard disk, a read-only memory, a magnetic or optical disk, etc.
The bus may be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, an Extended ISA (EISA) bus, or the like. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, the buses in the figures of the present application are not limited to only one bus or 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 disks. A storage media may be any available media that can be accessed by a general purpose or special purpose computer.
Those of ordinary skill in the art will understand that: all or a portion of the steps of implementing the above-described method embodiments may be performed by hardware associated with program instructions. The program may be stored in a computer-readable storage medium. When executed, the program performs steps comprising the method embodiments described above; and the aforementioned storage medium includes: various media that can store program codes, such as ROM, RAM, magnetic or optical disks.
Finally, it should be noted that: the above embodiments are only used for illustrating the technical solutions of the present application, and not for limiting the same; 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 solutions described in the foregoing embodiments may still be modified, or some or all of the technical features may be equivalently replaced; and the modifications or the substitutions do not make the essence of the corresponding technical solutions depart from the scope of the technical solutions of the embodiments of the present application.

Claims (12)

1. A method for deploying a master gateway and a standby gateway is applied to a Bluetooth Mesh network, wherein the Bluetooth Mesh network comprises a plurality of devices, and the method comprises the following steps:
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;
the first equipment judges whether the first equipment is a main gateway of the Bluetooth Mesh network;
if the first device is a master 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 a device identifier of the master gateway and a device identifier of the standby gateway to the plurality of second devices.
2. The method of claim 1, wherein the determining, by the first device, whether the first device is a master gateway of the bluetooth Mesh network comprises:
the first equipment judges whether the first equipment is a main gateway of the Bluetooth Mesh network or not according to configuration information; or,
and the first equipment judges whether the first equipment is a main gateway of the Bluetooth Mesh network or not according to the first messages sent by the plurality of second equipment.
3. The method according to claim 2, wherein the first packet includes WiFi signal strength and number of neighbor nodes of the second device; the determining, by the first device, whether the first device is a master gateway of the bluetooth Mesh network according to the first packet sent by the plurality of second devices includes:
the first device determines at least one third device from 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, wherein the at least one third device is the device with the largest WiFi signal strength from the first device and the plurality of second devices;
the first device judges whether the at least one third device comprises the first device;
if so, 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 so, determining that the first device is the main gateway, and if not, determining that the first device is not the main gateway;
if not, determining that the first device is not the primary gateway.
4. The method according to any one of claims 1, wherein the first packet includes WiFi signal strength and number of neighbor nodes of the second device; the determining, by the first device, a standby gateway in the plurality of second devices according to the first packet sent by the plurality of second devices includes:
the first device determines at least one fourth device in the plurality of second devices according to the WiFi signal strength of each second device, wherein the fourth device is the device with the largest WiFi signal strength in the plurality of second devices;
the first equipment judges whether the number of the fourth equipment is 1 or not;
if so, 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 from 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 equipment.
5. The method of claim 4, wherein the device identification is a fixed length number; determining the standby gateway according to the number of the fifth devices includes:
the first equipment judges whether the number of the fifth equipment is 1;
if so, the first device determines the at least one fifth device as the standby gateway;
if not, the first device determines the device with the minimum device identifier in the at least one fifth device as the standby gateway.
6. The method according to any of claims 1-5, wherein after determining a standby gateway among the plurality of second devices and sending the device identifier of the primary gateway and the device identifier of the standby gateway to the plurality of second devices, further comprising:
the first equipment judges whether the WiFi signal strength corresponding to the first equipment is greater than or equal to a first threshold value;
if not, the first device sends a master/slave gateway switching instruction to the slave gateway, wherein the master/slave gateway switching instruction is used for indicating that the slave gateway is switched to the master gateway.
7. The method according to any of claims 1-5, wherein after determining a standby gateway among the plurality of second devices and sending the device identifier of the primary gateway and the device identifier of the standby gateway to the plurality of second devices, further comprising:
the first equipment judges whether the WiFi signal strength corresponding to the standby gateway is larger than or equal to a second threshold value or not;
and if not, the first equipment updates the standby gateway of the Bluetooth Mesh network.
8. The method according to any of claim 7, wherein the updating the standby gateway of the Bluetooth Mesh network comprises:
the first device sending a status information request to the plurality of second devices;
the first equipment receives second messages sent by the plurality of second equipment, wherein the second messages comprise respective equipment identifications, WiFi signal strength and the number of neighbor nodes of the second equipment;
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.
9. A master and standby gateway deployment device is applied to a Bluetooth Mesh network, wherein the Bluetooth Mesh network comprises a plurality of devices, and the device comprises:
a receiving module, 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 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;
a determining module, configured to determine, by the first device according to the first packet sent by the multiple second devices, a standby gateway of the bluetooth Mesh network in the multiple second devices if the first device is a master gateway, and send a device identifier of the master gateway and a device identifier of the standby gateway to the multiple second devices.
10. An active/standby gateway deployment device, comprising:
a memory for storing a program;
a processor for executing the program stored by the memory, the processor being configured to perform the method of any of claims 1 to 8 when the program is executed.
11. A computer-readable storage medium comprising instructions which, when executed on a computer, cause the computer to perform the method of any one of claims 1 to 8.
12. A computer program product comprising a computer program, characterized in that the computer program realizes the method of any one of claims 1 to 8 when executed by a processor.
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 true CN113645072A (en) 2021-11-12
CN113645072B 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)

Cited By (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
YURY A等: "Service-oriented routing in distributed self-organizing software-defined networks", 《AICT》 *
赵海青;: "无线Mesh网中基于负载平衡的多路径路由协议", 微计算机信息, no. 02 *

Cited By (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

Also Published As

Publication number Publication date
CN113645072B (en) 2023-11-07

Similar Documents

Publication Publication Date Title
US20220272699A1 (en) Time domain resource format configuration method, communication apparatus, and communication system
CN109219157B (en) Network mode configuration method and device
CN110831094B (en) Method and device for processing data transmission channel
WO2017004255A1 (en) Management of network routing domains in communication networks
US20190260811A1 (en) Packet data unit session establishment method and network entity performing the same
CN113906717A (en) Local user plane function control
CN110913441B (en) Data transmission method and device
CN111885680A (en) Method, system and core equipment for establishing network connection
CN110830928A (en) Communication method and device
CN113645072B (en) Master-slave gateway deployment method and device
CN113645301A (en) Communication method and device
US20240155418A1 (en) Method and apparatus for connecting qos flow based terminal in wireless communication system
CN113645298A (en) Communication method and device of Internet of things equipment
CN114765600A (en) IPv6 address configuration method and routing equipment
CN110830598B (en) Method and network equipment for establishing and transmitting interface address and alias in BGP (Border gateway protocol) session
CN109768868B (en) Method, device and equipment for processing Ethernet broadcast frame
US11095514B2 (en) System and method for propagating anima network objective changes
CN115314336A (en) User online method of vBRAS and related equipment
CN112866013B (en) Network configuration method, device and system
CN114697217A (en) Method and related device for realizing cross-subnet communication of container
CN112087816A (en) Method for determining safety activation state and related product
JP2022553592A (en) SN RRC message processing method, apparatus, equipment and storage medium
CN113365325B (en) Data transmission method and device, storage medium and electronic equipment
CN111565141B (en) Data transmission method, first PE and second PE
EP4262244A1 (en) Method and device for determining mec access point

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