CN108737142B - Method for adjusting node detection parameters, node and mesh network - Google Patents

Method for adjusting node detection parameters, node and mesh network Download PDF

Info

Publication number
CN108737142B
CN108737142B CN201710267630.9A CN201710267630A CN108737142B CN 108737142 B CN108737142 B CN 108737142B CN 201710267630 A CN201710267630 A CN 201710267630A CN 108737142 B CN108737142 B CN 108737142B
Authority
CN
China
Prior art keywords
node
gateway
link quality
reliability
current
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
CN201710267630.9A
Other languages
Chinese (zh)
Other versions
CN108737142A (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.)
Huawei Technologies Co Ltd
Original Assignee
Huawei Technologies 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 Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to CN201710267630.9A priority Critical patent/CN108737142B/en
Priority to PCT/CN2018/074492 priority patent/WO2018192288A1/en
Publication of CN108737142A publication Critical patent/CN108737142A/en
Application granted granted Critical
Publication of CN108737142B publication Critical patent/CN108737142B/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/08Configuration management of networks or network elements
    • H04L41/0803Configuration setting
    • H04L41/0813Configuration setting characterised by the conditions triggering a change of settings
    • H04L41/0816Configuration setting characterised by the conditions triggering a change of settings the condition being an adaptation, e.g. in response to network events
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/10Active monitoring, e.g. heartbeat, ping or trace-route
    • 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/0631Management of faults, events, alarms or notifications using root cause analysis; using analysis of correlation between notifications, alarms or events based on decision criteria, e.g. hierarchy, tree or time analysis
    • 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/0677Localisation of faults
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/08Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/08Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
    • H04L43/0876Network utilisation, e.g. volume of load or congestion level
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/16Threshold monitoring
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W40/00Communication routing or communication path finding
    • H04W40/02Communication route or path selection, e.g. power-based or shortest path routing
    • H04W40/04Communication route or path selection, e.g. power-based or shortest path routing based on wireless node resources
    • H04W40/10Communication route or path selection, e.g. power-based or shortest path routing based on wireless node resources based on available power or energy

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Environmental & Geological Engineering (AREA)
  • Health & Medical Sciences (AREA)
  • Cardiology (AREA)
  • General Health & Medical Sciences (AREA)
  • Mobile Radio Communication Systems (AREA)
  • Small-Scale Networks (AREA)

Abstract

The application discloses a method for adjusting node detection parameters, a node and a mesh network, relates to the technical field of communication, and aims to solve the problem that in the mesh network with gateway failure in the traditional mode, the failure time of other nodes for determining the gateway is very long due to fixed detection parameters, wherein the method comprises the following steps: a first node acquires a fault notification sent by a target node; the first node acquires the current link quality and the maximum link quality in the mesh network according to the fault notification, wherein the current link quality represents the link quality between the first node and the gateway at the current moment; and the first node adjusts the detection parameters of the first node according to the current link quality, the maximum link quality and the preset detection parameters. According to the method provided by the embodiment of the invention, different nodes have different detection parameters by adjusting the detection parameters according to the current link quality, the maximum link quality and the preset detection parameters.

Description

Method for adjusting node detection parameters, node and mesh network
Technical Field
The embodiment of the invention relates to the technical field of communication, in particular to a method for adjusting node detection parameters, a node and a mesh network.
Background
A mesh (mesh) network includes a gateway and a plurality of nodes. In the mesh network, the gateway is used for initiating networking, controlling each node in a plurality of nodes to join the mesh network, and realizing communication among the plurality of nodes or communication between the nodes and other networks. In the mesh network, any node in a plurality of nodes can not only transmit and receive data, but also can forward the data sent by the node connected with the node to other nodes in the plurality of nodes or gateways, so that when two non-connected nodes communicate, one node can select the node connected with the node as a parent node and form a link with N (greater than or equal to 1) nodes to realize the communication of the two non-connected nodes or realize the communication between the node and the gateway.
In a mesh network initiated and maintained by a gateway, a gateway failure may cause the mesh network to crash. Conventionally, each node may continue to communicate by leaving the mesh network and joining other networks, typically upon failure of the gateway. However, each node needs to detect and determine the link fault between the node and the gateway according to the fixed detection parameters, then establishes a new link by switching the father node, repeats the processes of detecting and establishing the new link until the communication between the node and the gateway is still unavailable after the reconnection time threshold is exceeded, cannot determine the gateway fault, and then breaks away from the mesh network established by the gateway.
In the conventional method, for a large-scale mesh network (the number of nodes in the network is very large), when the network fails due to gateway failure, the time for each node to determine the gateway failure is very long, so that the mesh network cannot be rapidly disconnected.
Disclosure of Invention
The application provides a method for adjusting node detection parameters, a node and a mesh network, which are used for solving the problem that in the mesh network with gateway failure in the traditional mode, the time for determining the gateway failure is very long due to the fact that the detection parameters of other nodes are fixed.
In order to achieve the purpose, the technical scheme is as follows:
in a first aspect, a method for adjusting a node detection parameter is provided, where the method is used in a mesh network including a gateway and a plurality of nodes, where the plurality of nodes includes a first node, and the method provided in an embodiment of the present invention includes: the method comprises the steps that a first node obtains a fault notification sent by a target node, the fault notification is used for indicating gateway faults and for indicating each node in a plurality of nodes to adjust respective detection parameters, and the target node is a node which determines that a gateway has faults in the plurality of nodes; the first node acquires the current link quality and the maximum link quality in the mesh network according to the fault notification, wherein the current link quality represents the link quality between the first node and the gateway at the current moment; and the first node adjusts the detection parameters of the first node according to the current link quality, the maximum link quality and preset detection parameters, wherein the detection parameters comprise a heartbeat loss threshold and a reconnection time threshold.
The application provides a method for adjusting node detection parameters, which adjusts the detection parameters of a first node by obtaining a fault notification of gateway faults, wherein the first node adjusts the detection parameters of the first node according to the link quality between the first node and a gateway at the current moment, the maximum link quality and preset detection parameters, because the link quality between different nodes and the gateway is different, the communication state of the node with good link quality is good, and the communication quality of the node with poor link quality is poor, therefore, the detection parameters of the first node are adjusted according to the link quality between the first node and the gateway at the current moment, the maximum link quality and the preset detection parameters, so that each node in a mesh network can adjust the detection parameters according to the link quality from the node to the gateway, the maximum link quality and the preset detection parameters in a mode that the detection parameters of each node are adjusted according to the link quality of the node, therefore, the detection parameters of the nodes determined by different link qualities are different, so that the nodes with good communication states and the nodes with poor communication states have different detection parameters in the mesh network, and the time for determining the gateway fault by the nodes with good communication qualities and the time for determining the mesh network fault by the nodes with poor communication qualities are different.
With reference to the first aspect, in a first possible implementation manner of the first aspect, the adjusting, by the first node, the detection parameter of the first node according to the current link quality, the maximum link quality, and a preset detection parameter includes: and the first node acquires the quotient of the current link quality and the maximum link quality, and takes the product of the quotient of the current link quality and the maximum link quality multiplied by a preset detection parameter as the detection parameter after the first node is adjusted. In the embodiment of the invention, the detection parameters are adjusted by the quotient of the current link quality and the maximum link quality, on one hand, the quotient of the current link quality and the maximum link quality is less than or equal to the maximum link quality, so that the adjusted detection parameters are less than or equal to the detection parameters before adjustment, and on the other hand, the detection parameters of each node can be adjusted to be different based on different link qualities (the communication quality of the nodes with good link quality is good and the communication quality of the nodes with poor link quality) even if each node has the same detection parameters before adjustment because the different link qualities from different nodes to a gateway are different, so that the nodes with good communication quality and the nodes with poor communication quality have different detection parameters.
With reference to the first aspect or the first possible implementation manner of the first aspect, in a second possible implementation manner of the first aspect, the fault notification carries a reliability (i.e., a first reliability) of the gateway fault determined by the target node, and the method provided in the embodiment of the present invention further includes: the first node acquires the reliability (namely second reliability) of the gateway fault at the current moment; and the first node updates the reliability of the gateway fault at the current moment according to the first reliability, the second reliability and the weights respectively corresponding to the first reliability and the second reliability. The embodiment of the invention combines the credibility of the gateway fault, can more accurately reflect the working state of the gateway, and reduces the influence of the nodes with poor link quality on the mesh network.
With reference to any one of the first aspect to the second possible implementation manner of the first aspect, in a third possible implementation manner of the first aspect, after the first node updates the reliability of the gateway failure at the current time according to the first reliability, the second reliability, and weights respectively corresponding to the first reliability and the second reliability, the method provided in the embodiment of the present invention further includes: and the first node adjusts the working state of the first node according to the relationship between the reliability of the updated gateway fault at the current moment and the random number generated at the current moment and the working state of the first node at the current moment. After the reliability of the gateway fault is updated, the working state of the first node can be adjusted according to the relation between the random numbers generated at the current moment, so that the fault time of the gateway determined by the node can be shortened.
With reference to any one of the first aspect to the third possible implementation manner of the first aspect, in a fourth possible implementation manner of the first aspect, the adjusting, by the first node, the working state of the first node according to the relationship between the updated reliability of the gateway fault at the current time and the random number generated at the current time and the working state of the first node at the current time includes: the first node determines that the reliability of the updated gateway fault at the current moment is greater than the random number, and if the working state of the first node at the current moment is a network access state, the first node adjusts the working state of the first node at the current moment to be a reconnection state; or if the working state of the first node at the current moment is the reconnection state, the first node abandons the establishment of a new link with the target node, and reduces the reconnection time threshold of the first node by a preset step length.
With reference to any one of the first aspect to the fourth possible implementation manner of the first aspect, in a fifth possible implementation manner of the first aspect, the obtaining, by the first node, the current link quality according to the fault notification includes: the first node acquires the current link quality according to the maximum delay of the mesh network, the communication delay of the mesh network, the weight of the quotient of the maximum delay of the mesh network and the communication delay of the mesh network, the maximum hop count of the mesh network, the hop count of the link between the first node and the gateway at the current moment, the maximum hop count of the mesh network and the weight of the quotient of the hop count of the link between the first node and the gateway at the current moment.
With reference to any one possible implementation manner of the first aspect to the fifth possible implementation manner of the first aspect, in a sixth possible implementation manner of the first aspect, the method provided by the embodiment of the present invention further includes: and after the first node adjusts the working state of the first node to be a reconnection state, the first node reestablishes connection with any one of all nodes in the mesh network by using the detection parameters adjusted by the first node.
In a second aspect, an embodiment of the present invention provides a method for adjusting a node detection parameter, where the method is used in a mesh network including a gateway and a plurality of nodes, where the plurality of nodes includes a target node, and the method includes: and the target node broadcasts and sends a fault notice for indicating gateway faults and for indicating each node in the plurality of nodes to adjust respective detection parameters to the mesh network, wherein the detection parameters at least comprise a heartbeat loss threshold value and a reconnection time threshold value.
With reference to the second aspect, in a first possible implementation manner of the second aspect, the method provided in the embodiment of the present invention further includes the first node, and the method provided in the embodiment of the present invention further includes: a target node receives a reconnection connection request message which is sent by a first node and used for indicating the target node to establish a link between the first node and a gateway; the target node unicast-sends a failure notification to the first node.
With reference to the second aspect or the first possible implementation manner of the first aspect, in a second possible implementation manner of the second aspect, the failure notification carries the reliability of the gateway failure determined by the target node.
In a third aspect, a node is provided, including: an obtaining unit, configured to obtain a fault notification sent by a target node, where the fault notification is used to indicate a gateway fault and to indicate each node in a plurality of nodes to adjust a respective detection parameter, the target node is a node in the plurality of nodes where a fault exists in the gateway, and is used to obtain, according to the fault notification, a current link quality and a maximum link quality in a mesh network, where the current link quality indicates a link quality between a first node and the gateway at a current time; and the adjusting unit is used for adjusting the detection parameters of the first node according to the current link quality, the maximum link quality and preset detection parameters, wherein the detection parameters at least comprise a heartbeat loss threshold and a reconnection time threshold.
With reference to the third aspect, in a first possible implementation manner of the third aspect, the obtaining unit is further configured to obtain a quotient of the current link quality and a maximum link quality; the adjusting unit is specifically configured to: and taking the product of the quotient of the current link quality and the maximum link quality multiplied by a preset detection parameter as the detection parameter after the first node is adjusted.
With reference to the third aspect or the first possible implementation manner of the third aspect, in a third possible implementation manner of the third aspect, the fault notification carries a first reliability, where the first reliability is a reliability of the gateway fault determined by the target node, and the obtaining unit is further configured to obtain a second reliability, where the second reliability is a reliability of the gateway fault obtained by the first node at the current time; the node provided by the embodiment of the invention also comprises: and the updating unit is used for updating the reliability of the gateway fault at the current moment according to the first reliability, the second reliability and the weights respectively corresponding to the first reliability and the second reliability.
With reference to any one of the third to the second possible implementation manners of the third aspect, in a third possible implementation manner of the third aspect, the adjusting unit is configured to adjust the working state of the first node according to a relationship between the updated reliability of the gateway fault at the current time and the random number generated at the current time, and the working state of the first node at the current time.
With reference to any one of the third possible implementation manners of the third aspect to the third possible implementation manner of the third aspect, in a fourth possible implementation manner of the third aspect, the adjusting unit is specifically configured to: if the reliability of the updated gateway fault at the current moment is determined to be greater than the random number, the first node adjusts the working state of the first node at the current moment to be a reconnection state if the working state of the first node at the current moment is a network access state; or if the working state of the first node at the current moment is the reconnection state, the first node abandons the establishment of a new link with the target node, and reduces the reconnection time threshold of the first node by a preset step length.
With reference to any one of the third to the fourth possible implementation manners of the third aspect, in a fifth possible implementation manner of the third aspect, the obtaining unit is configured to obtain the current link quality according to a maximum delay of the mesh network, a communication delay of the mesh network, a weight of a quotient of the maximum delay of the mesh network and the communication delay of the mesh network, a maximum hop count of the mesh network, a hop count of a link between the first node and the gateway at the current time, the maximum hop count of the mesh network, and a weight of a quotient of the hop count of the link between the first node and the gateway at the current time.
In a fourth aspect, an embodiment of the present invention provides a node, used in a mesh network including a gateway and a plurality of nodes, where the node is a target node in the plurality of nodes, and the node includes: and a sending unit, configured to broadcast a failure notification to the mesh network, where the failure notification is used to indicate a gateway failure and to instruct each node in the plurality of nodes to adjust respective detection parameters, and the detection parameters at least include a heartbeat loss threshold and a reconnection number threshold.
With reference to the fourth aspect, in a first possible implementation manner of the fourth aspect, the multiple nodes further include a first node, and the node further includes: a receiving unit, configured to receive a reconnection request message sent by a first node and used to instruct a target node to establish a link between the first node and the gateway; the sending unit is further configured to unicast a failure notification to the first node.
With reference to the fourth aspect or the first possible implementation manner of the fourth aspect, in a second possible implementation manner of the fourth aspect, the failure notification carries the reliability of the gateway failure determined by the target node.
In a fifth aspect, a node is provided that includes a processor, a memory, a system bus, and a communication interface; when the node runs, the processor executes the computer-executable instructions stored in the memory, so that the node executes the method for adjusting the node detection parameters as described in any one of the first to sixth possible implementation manners of the first aspect.
In a sixth aspect, a target node is provided, the node comprising a processor, a memory, a system bus, and a communication interface; when the target node runs, the processor executes the computer-executable instructions stored in the memory, so that the target node executes the method for adjusting the node detection parameters as described in any one of the second possible implementation manners of the second aspect to the second possible implementation manner of the second aspect.
A seventh aspect provides a computer-readable storage medium, which includes instructions that, when executed on a node, cause the node to perform the method for adjusting a node detection parameter as described in any one of the sixth possible implementations of the first aspect to the first aspect, or that, when executed on a target node, cause the target node to perform the method for adjusting a node detection parameter as described in any one of the second possible implementations of the second aspect to the second aspect.
In an eighth aspect, a computer program product is provided, which contains instructions that, when run on a node, cause the node to perform the method for adjusting a node detection parameter as described in any one of the first to sixth possible implementations of the first aspect, or that, when run on a target node, cause the target node to perform the method for adjusting a node detection parameter as described in any one of the second to second possible implementations of the second aspect.
In a ninth aspect, there is provided a mesh network comprising: a gateway and a plurality of nodes, where at least one target node and at least one node exist in the plurality of nodes, the target node is the target node described in the fourth aspect or the second possible implementation manner of the fourth aspect, and the node is the node described in any one of the first to sixth possible implementation manners of the first aspect.
The present application can further combine to provide more implementations on the basis of the implementations provided by the above aspects.
Drawings
Fig. 1 is a schematic diagram illustrating an architecture of a mesh network according to an embodiment of the present invention;
fig. 2 is a schematic diagram of a node operating state according to an embodiment of the present invention;
fig. 3 is a schematic diagram of a hardware structure of a node according to an embodiment of the present invention;
fig. 4 is a first flowchart illustrating a method for adjusting node detection parameters according to an embodiment of the present invention;
fig. 5 is a schematic flowchart illustrating a second method for adjusting node detection parameters according to an embodiment of the present invention;
fig. 6 is a third schematic flowchart of a method for adjusting node detection parameters according to an embodiment of the present invention;
fig. 7 is a fourth schematic flowchart of a method for adjusting node detection parameters according to an embodiment of the present invention;
fig. 8 is a schematic flowchart of a method for adjusting node detection parameters according to an embodiment of the present invention;
fig. 9 is a sixth schematic flowchart of a method for adjusting node detection parameters according to an embodiment of the present invention;
fig. 10 is a schematic structural diagram of a node according to an embodiment of the present invention;
fig. 11 is a schematic structural diagram of another node according to an embodiment of the present invention.
Detailed Description
For the convenience of clearly describing the technical solutions of the embodiments of the present invention, in the embodiments of the present invention, the words "first", "second", and the like are used to distinguish the same items or similar items with basically the same functions and actions, and those skilled in the art can understand that the words "first", "second", and the like do not limit the quantity and execution order.
In the embodiment of the invention, a target node (which can be understood as a node of a mesh network determining a gateway fault firstly) broadcasts to the mesh network or sends a fault notification to a node trying to establish a new link with the target node in a unicast mode, the gateway fault is indicated, other nodes except the target node in the mesh network respectively calculate the link quality of the link between the target node and the gateway at the current moment after receiving the fault notification, and then respective detection parameters are adjusted according to the link quality and the maximum link quality in the mesh network. Because the link quality between different nodes and the gateway is different, the node with good link quality and the node with poor link quality have different detection parameters, the detection parameters required by the node with good link quality are usually smaller, and the time for determining the gateway fault by the node with good link quality can be shortened by the different detection parameters.
The method for adjusting the node detection parameters provided by the embodiment of the invention can be applied to a wireless mesh network and can also be applied to a wired mesh network.
The embodiment of the present invention is exemplified by a wireless mesh network, as shown in fig. 1. Fig. 1 illustrates a mesh network to which a method for adjusting a node detection parameter according to an embodiment of the present invention is applied, where the mesh network includes a gateway 201, and a plurality of nodes (e.g., a node 202, a node 203, a node 204, a node 205, and a node 206). It is understood that more or fewer nodes than those of fig. 1 may be included in embodiments of the present invention.
The gateway 201 is used for initiating networking and controlling the plurality of nodes 202-206 to join the mesh network, and is also used for realizing communication between the plurality of nodes and other networks or communication between any two nodes in the plurality of nodes.
In fig. 1, any node may directly communicate with a node connected to the node, and when communication is required between any two unconnected nodes, one of the two unconnected nodes may select a node connected to the node as a parent node and form a link from the node to the node requiring communication. For example, if node 202 needs to communicate with node 206, then node 202 may select node 204 or node 205 connected to it as a parent node and form a link through the selected parent node (node 204 or node 205) to establish communication between node 202 and node 206, e.g., if node 202 selects node 204 as a parent node, then the link between node 202 and node 206 includes: node 202, node 204, node 206 or node 202, node 204, node 205, node 206.
In the system shown in fig. 1, if any one node is directly connected to the gateway, the node and the gateway can directly communicate, for example, the node 202 and the gateway 201. If any node is not directly connected with the gateway, the node can establish a link between the node and the gateway by selecting a parent node. For example, node 203 may establish a link to the gateway by selecting parent node 202, the link including node 203, node 202, and gateway 201.
In the embodiment of the invention, if two nodes are directly connected, a one-hop network is formed, otherwise, a multi-hop network is formed. For example, if the hop count between the node 202 and the gateway 201 is 1, and the link between the node 201 and the node 204 includes the gateway 201, the node 202, and the node 204, then the hop count between the node 201 and the node 204 is 2. How to determine the hop count is a relatively mature scheme in the prior art, and the embodiment of the present invention is not described herein again.
The node selecting the parent node in the embodiment of the present invention may be referred to as a child node, and the child node and the parent node are relative concepts. Each node is taken as a child node of the node connected with the node in the upward route, and is taken as a parent node of the node connected with the node in the downward route, wherein the node without the parent node is a gateway.
As shown in fig. 2, fig. 2 shows an operating state of each node in the mesh network provided in the embodiment of the present invention, and as shown in fig. 2, any node in the embodiment of the present invention has four operating states, which are: a connected (Joined) state, a reconnected (Retry) state, an offline wait (Leave) state, and an offline (Leave) state, and four states of each node in the embodiment of the present invention may be switched according to a state of a gateway (fault or normal) or a state of a mesh network.
When the node determines that the number of continuous non-received heartbeat reply times sent by the gateway or the number of continuous non-received heartbeat sent by the gateway is greater than a heartbeat loss threshold value, the node determines that a link between the node and the gateway fails, and then the node is adjusted from the network access state to the reconnection state.
It will be appreciated that any node, when in a network-entry state, may communicate (e.g., receive receipts, send receipts, etc.) with nodes of the plurality of nodes in the mesh network to which it is connected and with the gateway by selecting a parent node to establish a link to the gateway.
In the reconnection state, the node can select the node connected with the node as a father node and establish a new link reaching the gateway with the node, if the node determines that the reconnection times with the father node exceed the reconnection time threshold, the father node is changed again and the process is repeated until the node determines that all the father nodes connected with the node cannot establish the new link reaching the gateway, and the node is switched from the reconnection state to the off-network waiting state.
During a preset time when a node is in an off-network waiting state, the node sends a failure notification to the node attempting to establish a new link with the node, wherein the failure notification is used for indicating that a gateway fails and other nodes adjust respective detection parameters (such as a heartbeat loss threshold value and/or a reconnection time threshold value). Finally, after the preset time of off-network waiting, the node exits the mesh network shown in fig. 1 and joins in other networks.
In the embodiment of the invention, the heartbeat loss threshold is used for determining the communication state of a link between one node and a gateway, and the reconnection time threshold is used for limiting the maximum reconnection time between the node and a father node when the node selects the node connected with the node as the father node after the link between the node and the gateway fails.
It can be understood that, as described above, the gateway is used for initiating networking and controlling each node in the plurality of nodes to join the mesh network and forwarding data sent by the plurality of nodes to other networks or forwarding data sent by other networks to the plurality of nodes, so that in the mesh network with a gateway failure, a breakdown of the mesh network is inevitably caused, at this time, the node may leave the mesh network after determining the gateway failure, and of course, after the gateway failure in some mesh networks, the node may also be repaired within a period of time, so that if the time for repairing the gateway is within the preset time, the node in the off-network waiting state may rejoin the mesh network formed by the gateway.
It should be noted that, in general, after the gateway is repaired, security consideration is usually performed to change the security key of the network, and therefore, the node in the off-network waiting state needs to acquire the changed key before successfully joining the mesh network.
Further, in the embodiment of the present invention, the structure of any node in fig. 1 may be as shown in fig. 3. The embodiment of the present invention is described by taking the node 202 as an example, as shown in fig. 3, the node 202 includes a memory 301, a processor 302, a system bus 303, and a communication component 304. The memory 301 may be used to store data, software programs, and modules, and mainly includes a program storage area and a data storage area, where the program storage area may store an operating system, an application program required by at least one function, and the like, and the data storage area may store data created by use of a server, and the like. Processor 302 performs various functions of node 202 and processes data by running or executing software programs and/or modules stored in memory 301 and invoking data, software programs and modules stored in memory 301. The system bus 303 includes an address bus, a data bus, and a control bus for transmitting data and instructions; communication component 304 is operative to support communications between node 202 and other devices in a wired or wireless manner.
The system bus 303 may be divided into an address bus, a data bus, a control bus, and the like. For ease of illustration, only one thick line is shown in FIG. 3, but this does not mean only one bus or one type of bus.
It is understood that fig. 3 is only an exemplary structure of any one node provided by the embodiment of the present invention, and a node may include more components than those shown in fig. 3 in an actual use process.
As shown in fig. 4, an embodiment of the present invention provides a method for adjusting a node detection parameter, where the method is applied to a mesh network shown in fig. 1, and the method includes:
s101, after determining the gateway fault, the target node broadcasts and sends a fault notification, wherein the fault notification is used for indicating the gateway fault and for indicating each node in the plurality of nodes to adjust respective detection parameters.
The target node is a node which determines that the gateway has a fault in the plurality of nodes.
The target node is typically the node of the plurality of nodes of the mesh network that first determines a gateway failure. In the case of a communication state failure of the mesh network caused by a gateway failure, the node that first determines the gateway failure is typically the node with the least number of link hops with the gateway, e.g., node 202 as shown in fig. 1.
Since there may be a node (e.g., the first node) performing a task or having poor network factors when the target node broadcasts the failure notification, and the failure notification broadcast by the target node is not received, after determining that the link between the node and the gateway at the current time is failed, the node may still select one node from all nodes connected to the node as a parent node (e.g., the target node) to reestablish a new link to the gateway. Therefore, in order to ensure that each node in the mesh network can receive the fault notification and adjust the respective detection parameters according to the fault notification, in the embodiment of the present invention, when receiving a reconnection request message sent by any node (e.g., a first node) within a preset time (the preset time is a time when the target node is waiting offline), the target node may send the fault notification to the first node in a unicast manner.
It can be understood that the fault notification broadcast or unicast sent by the target node in the embodiment of the present invention may be a newly defined message, or may be an extension to a message in an existing protocol.
Illustratively, the target node may send the failure notification by broadcast or unicast through a Transmission Control Protocol (TCP), a User Datagram Protocol (UDP), or a Link Control Protocol (LCP).
S102, the first node acquires the fault notification.
Since the target node sends the fault notification to the first node, the fault notification may be sent by a unicast or by a broadcast, the first node may obtain the fault notification sent by the target node from the mesh network, and may also receive the fault notification sent by the unicast from the target node, specifically, receive the fault notification sent by the unicast or the fault notification sent by the broadcast, which needs to be analyzed in combination with the actual situation.
It can be understood that, in a conventional manner, after receiving a reconnection request message sent by another node, any node usually establishes a new link with the other node and feeds back a response for establishing the new link, and a target node in the present application sends a failure notification to the other node in a unicast manner, so that the failure notification carried in the unicast message in the present application may be an extension to a conventional message based on an existing protocol, or may be in a new message form.
S103, the first node acquires the current link quality and the maximum link quality in the mesh network according to the fault notification, wherein the current link quality represents the link quality between the first node and the gateway at the current moment.
Optionally, the maximum link quality in the mesh network may be preset, and each node stores the maximum link quality when the mesh network is initialized.
S104, the first node adjusts the detection parameters of the first node according to the current link quality, the maximum link quality and preset detection parameters, wherein the detection parameters at least comprise a heartbeat loss threshold and a reconnection time threshold.
The application provides a method for adjusting node detection parameters, which adjusts the detection parameters of a first node by obtaining a fault notification of gateway faults, wherein the first node adjusts the detection parameters of the first node according to the link quality between the first node and a gateway at the current moment, the maximum link quality and preset detection parameters, because the link quality between different nodes and the gateway is different, the communication state of the node with good link quality is good, and the communication quality of the node with poor link quality is poor, therefore, the detection parameters of the first node are adjusted according to the link quality between the first node and the gateway at the current moment, the maximum link quality and the preset detection parameters, so that each node in a mesh network can adjust the detection parameters according to the link quality from the node to the gateway, the maximum link quality and the preset detection parameters in a mode that the detection parameters of each node are adjusted according to the link quality of the node, therefore, the detection parameters of the nodes determined by different link qualities are different, so that the nodes with good communication states and the nodes with poor communication states have different detection parameters in the mesh network, and the time for determining the gateway fault by the nodes with good communication qualities and the time for determining the mesh network fault by the nodes with poor communication qualities are different.
Optionally, in conjunction with fig. 4, as shown in fig. 5, the process of the target node determining the gateway failure may refer to steps S105 to S107 in fig. 4.
And S105, when the target node is in the network access state, the target node determines the link fault between the target node and the gateway at the current moment.
It can be understood that, after the target node determines that the link between the target node and the gateway is failed at the current time, the target node is adjusted from the network access state to the reconnection state according to the working state shown in fig. 2.
Although the target node can determine the link failure between the target node and the gateway through the lost heartbeat number or the heartbeat reply number, the target node cannot determine whether the link failure between the target node and the gateway is caused by the gateway failure or any node failure in the link, so that the target node can establish a new link between the target node and the gateway by replacing a parent node, and determine the gateway failure after the new link reaching the gateway cannot be established.
S106, the target node selects M nodes from the N nodes connected with the target node as father nodes.
In the embodiment of the invention, N is an integer greater than or equal to 1, M is an integer greater than or equal to 1, and M is less than or equal to N.
The specific number of N needs to be determined by combining the topology in the actual mesh network, which is not limited in the embodiment of the present invention.
It is to be understood that, in the embodiment of the present invention, the number of M that can be selected by the target node may be set as needed, for example, M may be equal to N, that is, each node in 5 connected nodes of the target node is taken as a parent node, or it may be sufficient to set a preset threshold and ensure that a quotient of M and N is greater than or equal to the preset threshold, for example, if N is 5 and the preset threshold is 80%, 4 nodes or 5 nodes may be optionally selected from the 5 connected nodes as parent nodes.
It can be understood that, in an actual process, the target node is not reconnected with the selected M nodes at a time, but sends a reconnection request message (the reconnection request message is used for the target node to establish a new link with the node X to the gateway) to one node X among the M nodes each time, and does not send the reconnection request message to one node Y among the M nodes until the reconnection number of the target node and the node X reaches the reconnection number threshold.
Because the parent node selected by the target node is different, the link from the target node to the gateway is also different, and there may be multiple parent nodes in the parent node selected by the target node, therefore, multiple new links from the target node to the gateway need to be determined according to actual situations, but different links do not constitute a limitation to the embodiment of the present invention.
S107, the target node reconnects the connection request message to each father node in the M father nodes according to a preset rule, and if the target node determines that the reconnection times of the target node and each father node in the M father nodes are larger than the reconnection time threshold, the target node determines that the gateway fails.
Wherein, the preset rule is as follows: the target node selects a father node from the M father nodes each time and sends a reconnection connection request message to the father node, and when the target node determines that the reconnection times of the selected father node are all larger than the reconnection time threshold, the target node reselects a father node from the M father nodes, and so on. If the target node rebuilds the link with the gateway through a father node in the reconnection process, the target node does not send reconnection connection request information to other nodes in the M father nodes.
Optionally, in an aspect, the process described in step S105 provided in the embodiment of the present invention may be implemented in the following manner: the target node sends heartbeat to the gateway through a link established between the target node and the gateway at the current moment or receives the heartbeat sent by the gateway through the link established between the target node and the gateway at the current moment; and the target node determines that the number of times of continuously not receiving the heartbeat reply sent by the gateway is greater than a heartbeat loss threshold or the number of times of continuously not receiving the heartbeat sent by the gateway is greater than the heartbeat loss threshold, and then the target node determines the link fault between the target node and the gateway at the current moment.
It can be understood that, different links between the nodes and the gateway at different detection time are different, and the target node sends heartbeat to the gateway through the link between the target node and the gateway at the current time.
On the other hand, the process described in step S105 provided in the embodiment of the present invention can also be implemented by the following manner: and the target node determines the gateway fault according to the link quality of the link between the target node and the gateway at the current moment, and the frequency that the target node continuously does not receive the heartbeat sent by the gateway is greater than the heartbeat loss threshold value or the frequency that the target node continuously does not receive the heartbeat reply message sent by the gateway is greater than the heartbeat loss threshold value.
Specifically, link quality exists in a link between each node and a gateway, the quotient of the link quality between each node and the gateway and the maximum link quality is greater than 0 or less than or equal to 1, if the quotient of the link quality of one node and the maximum link quality is 0, the link quality of the link between the node and the gateway is very poor, and if the quotient of the link quality of another node and the maximum link quality is 1, the link quality of the link between the node and the gateway is very good, therefore, if the quotient of the link quality of a target node and the maximum link quality is 1, and the number of times that the target node continuously does not receive heartbeat packets sent by the gateway or the number of times that the target node continuously does not receive heartbeat replies sent by the gateway reaches a heartbeat loss threshold, the target node determines that the gateway is faulty.
Optionally, with reference to fig. 5, as shown in fig. 6, step S104 in the embodiment of the present invention may be implemented by the following steps shown in fig. 6: s108 and S109 to:
s108, the first node acquires the quotient of the current link quality and the maximum link quality.
S109, the first node takes the product of the quotient of the current link quality and the maximum link quality multiplied by a preset detection parameter as the detection parameter after the first node is adjusted.
Optionally, the detection parameters in the embodiment of the present invention are: a heartbeat loss threshold and a reconnection number threshold.
It is to be understood that the detection parameter may also be other parameters besides the heartbeat loss threshold and the reconnection number threshold, for example, time delay and the like, which are not listed here in this embodiment of the present invention, and any parameter that can reflect the link state between the node and the gateway may be used as the detection parameter of the present application.
The preset detection parameter in the embodiment of the present invention may be preset by a system when networking a mesh network, that is, the same heartbeat loss threshold and reconnection time threshold are set for each node in a plurality of nodes, or different heartbeat loss thresholds and reconnection time thresholds are set for each node in a plurality of nodes.
Of course, the preset detection parameter in the embodiment of the present invention may also be a detection parameter adjusted by any node at an adjustment time before the current adjustment time, for example, if the detection parameter adjusted at an adjustment time before the current adjustment time is a, the node at the current time may determine the link quality rxa as the detection parameter adjusted by the node, or if the preset detection parameter is a detection parameter B preset by the system, the node at the current time may also determine the link quality rxb as the detection parameter adjusted by the node, which is not limited in the embodiment of the present invention.
How to adjust the heartbeat loss threshold and the reconnection time threshold will be described below in conjunction with detecting parameters as the heartbeat loss threshold and the reconnection time threshold, respectively. The embodiment of the invention takes the preset detection parameters as follows: the maximum heartbeat loss threshold and the maximum reconnection number threshold are described as an example:
in one aspect, if the detected parameter is a heart rate loss threshold, the heart rate loss threshold can be adjusted by the formula HT ═ MaxHT × (RQ/RQ)max) And (5) realizing. Wherein, HT represents the adjusted heartbeat loss threshold, MaxHT represents the maximum heartbeat loss threshold, RQ represents the link quality between the first node and the gateway at the current time, and RQ represents the link quality between the first node and the gateway at the current timemaxIndicating the maximum link quality.
In the embodiment of the present invention, the quotient of the link quality between the first node and the gateway at the current time and the maximum link quality is a number greater than or equal to 0 and less than or equal to 1.
It will be appreciated that the parent node selected by the first node is different, the links between the first node and the gateway are different, and the different links cause the link quality between the first node and the gateway to be different, and therefore each of the links existing between the first node and the gateway corresponds to a heartbeat loss threshold. It can be understood that: if the first node sends heartbeat to the gateway through the link A, the first node determines that the link A fails if the number of times that the first node continuously does not receive heartbeat replies sent by the gateway through the link A is greater than the heartbeat loss threshold of the link A.
Generally, a node only needs to determine the heartbeat loss threshold of a link between the node and a gateway, and only when the heartbeat loss threshold is reached and a father node is reselected for reconnection, the state of the newly-built link needs to be judged according to the heartbeat loss threshold of the newly-built link.
On the other hand, if the detection parameter is the threshold of the number of reconnections, the threshold of the number of reconnections can be adjusted by the formula HT ═ MaxRT × (RQ/RQ)max) Determining, wherein RT represents an adjusted reconnection time threshold, MaxRT represents a maximum reconnection time threshold, RQ represents link quality between a first node and a gateway at the current time, and RQ representsmaxIndicating the maximum link quality.
It can be understood that, the father nodes selected by the first node are different, the links between the first node and the gateway are also different, and different links correspond to different link qualities, so that the threshold of the number of reconnection times for different father nodes by the first node is also different, correspondingly, if the first node selects the node a as the father node, and the threshold of the number of reconnection times for the first node selecting the node a as the father node is 5, the first node still fails after the number of reconnection times with the node a reaches 5 times, and finally the first node determines that the gateway is faulty, and enters an off-network waiting state to leave the mesh network after a preset time.
In the embodiment of the present invention, the maximum heartbeat loss threshold and the maximum reconnection time threshold may be set during system initialization, and at this time, the maximum heartbeat loss threshold and the maximum reconnection time threshold of each node in the plurality of nodes may be the same or different.
Of course, the fault notification in the embodiment of the present invention may also carry a node identifier, for example, an identifier of a target node, where the node identifier is used to uniquely identify the target node.
It may be understood that, in the embodiment of the present invention, each node may further store a topology structure of the mesh network, that is, a distance between each node and the gateway, so that, after receiving the fault notification carrying the node identifier, the first node may determine the reliability of the gateway fault according to the node identifier, because generally, the reliability of the gateway fault sent by the node with the fewest number of hops with respect to the gateway is higher than the reliability of the gateway fault sent by the node with the fewest number of hops with respect to the gateway.
When the first node cannot communicate with the gateway, it will determine that the gateway fails if the connection still fails after the first node is reconnected by replacing the parent node, but for the remaining nodes, in order to determine that the network failure is caused by the gateway failure, in the embodiment of the present invention, the failure indication message carries a first reliability, where the first reliability is a reliability of the gateway failure determined by the target node, and this is performed in order to enable the first node to accurately determine whether the gateway fails by updating the reliability of the gateway failure. The reliability of the gateway fault is used for representing the possibility of the gateway fault, the reliability value of the gateway fault is greater than or equal to 0 and less than or equal to 1, and the higher the reliability value of the gateway fault is, the higher the possibility of the gateway fault is. For example, a value of 0 for the reliability of the gateway failure indicates that the probability of the gateway failure is 0, and a value of 1 for the reliability of the gateway failure indicates that the gateway is in a failure state.
It is understood that in the embodiment of the present invention, each node may have a reliability of a gateway failure, where the reliability of the gateway failure is a default value, for example, when the gateway does not fail, the reliability of the gateway failure stored by each node is 0. The trustworthiness of the failure of the gateway of each node is restored to a default value when it has data interaction with the gateway.
As shown in fig. 7, in conjunction with fig. 4, the method provided in the embodiment of the present invention further includes:
s110, the first node obtains a second reliability, and the second reliability is the reliability of the gateway fault obtained by the first node at the current time.
The second credibility is set by the system when the mesh network is networked, or acquired by the first node through the link quality.
And S111, updating the reliability of the gateway fault at the current moment by the first node according to the first reliability, the second reliability and the weights respectively corresponding to the first reliability and the second reliability.
Optionally, step S111 in the embodiment of the present invention may be specifically implemented by the following manner:
the first node is according to the formula R ═ RQ1×α+RQ2Updating the reliability of the gateway fault at the current moment by x beta, wherein R represents the reliability of the gateway fault updated at the current moment, and RQ1Indicating a second degree of confidence, RQ2Representing the trustworthiness of the gateway failure sent by the target node, i.e. the first trustworthiness, alpha representing RQ1Beta represents RQ2And α + β is 1.
The values of α and β in the embodiment of the present invention may be set as needed as long as α + β is guaranteed to be 1, and exemplarily, α is 0.8 and β is 0.2 in the embodiment of the present invention.
It should be noted that the reliability of the gateway fault in the fault notification may be replaced by the link quality between the target node and the gateway, and in this case, the first node may update the reliability of the gateway fault at the current time by using the above formula according to the link quality between the target node and the gateway.
After updating the reliability of the gateway fault at the current time, the first node may, according to the relationship between the updated reliability of the gateway fault at the current time and the random number, and in combination with the working state of the first node at the current time, and as shown in fig. 7, as shown in fig. 8, the method provided in the embodiment of the present invention further includes:
and S112, the first node adjusts the working state of the first node according to the relationship between the reliability of the updated gateway fault at the current time and the random number generated at the current time and the working state of the first node at the current time.
Wherein the preset range of the random number is 0-1.
Specifically, the working states of the first node at the current time are different, and when the reliability of the gateway fault updated at the current time is greater than the random number, the correspondingly adjusted working states are different, so step S112 in the embodiment of the present invention may specifically be implemented in the following manner: the reliability of the gateway fault after the first node is determined to be updated at the current moment is larger than the random number, and if the working state of the first node at the current moment is the network access state, the first node adjusts the working state of the first node at the current moment to be the reconnection state; or if the working state of the first node at the current moment is the reconnection state, the first node abandons the establishment of a new link with the target node, and reduces the reconnection time threshold of the first node by a preset step length.
The preset step length is a positive integer smaller than the reconnection time threshold. Illustratively, the preset step size may be 1.
For example, the working state of the first node at the current time is a Jion state, after the first node receives the first failure notification, the first node updates the reliability of the gateway failure according to step S111, and generates a random number, and if the updated reliability of the gateway failure is greater than the random number, the first node adjusts the state of the first node from the Jion state to a Retry state. Therefore, the first node can enter the reconnection state as soon as possible, and the time for determining the gateway fault by the first node is further shortened.
For example, the first node is in a Retry state at the current time, before Retry connection every time, the first node generates a random number, and if the first node determines that the reliability of the updated gateway fault is greater than the random number according to S111, the first node skips the reconnection with the target node (in a normal case, when the first node is reestablished with the target node, the first node skips the target node only if the reconnection number threshold is reached and reconnection with the target node still fails, and selects one node B except the target node from all nodes connected with the first node to reestablish connection), and the first node reduces the reconnection number threshold by a preset step length and immediately reestablishes connection with the node B by reducing the reconnection number threshold of the preset step length. That is, when the first node in the Retry state reestablishes a connection through the node a, if the node a is a Leave wait node, the first node in the Retry state receives the failure notification sent by the node a, and after S112 is executed, the first node skips continuing to reestablish a connection with the node a, and subtracts 1 from the threshold of the number of reconnection times (for example, 5), and reestablishes a connection with the node B, at this time, the threshold of the number of reconnection times when the first node reestablishes a connection with the node B is 4, and the reliability of the gateway failure is updated according to step S111. Therefore, the first node abandons the reconnection with the target node, and the reconnection time threshold is reduced when the first node is reselected as a parent node, so that the time for determining the gateway failure by the first node can be further shortened.
Optionally, step S103 in the embodiment of the present invention may be specifically implemented in the following manner: the first node acquires the current link quality according to the maximum delay of the mesh network, the communication delay of the mesh network, the weight of the quotient of the maximum delay of the mesh network and the communication delay of the mesh network, the maximum hop count of the mesh network, the hop count of the link between the first node and the gateway at the current moment, the maximum hop count of the mesh network and the weight of the quotient of the hop count of the link between the first node and the gateway at the current moment.
Illustratively, the first node is according to the formula RQ ═ λ1×(Md/Ad)+λ2(MhH) obtaining the link quality between the first node and the gateway at the current moment, wherein RQ represents the link quality between the first node and the gateway at the current moment, and MdIndicates the maximum delay of the mesh network, AdIndicating communication delay of mesh network, MhRepresenting the maximum number of hops of the mesh network, H representing the number of hops of the link when the first node communicates with the gateway at the present moment, λ1And λ2Represents a weight factor and12=1。
the communication delay in the embodiment of the present invention refers to the time required for the data packet to be transmitted to the gateway through the node and then to be received by the gateway in response.
Maximum delay in the embodiment of the present invention: (MaxDelay,Md) Set by the mesh network, indicates the maximum value of the communication delay.
In the embodiment of the invention, Hop count Hop refers to the number of nodes included in a link established when any node communicates with a gateway.
In the embodiment of the invention, the maximum hop count MaxHop is set by the mesh network and represents the maximum node number included when one node communicates with the gateway.
Lambda in the examples of the invention1And λ2Can be set as required as long as lambda is ensured12In practical cases, the delay reflects the degree of network congestion, the delay time indicates that the network of the mesh network is relatively congested, the hop count reflects the topology of the mesh network, and the large hop count means that the number of nodes included in the links from the nodes in the mesh network to the gateways is large. Illustratively, embodiments of the invention may set the delay and hop count of each node to be consistent with respect to the weight of the impact on link quality to the gateway, e.g., λ1=0.5,λ2=0.5。
Optionally, the method provided in the embodiment of the present invention further includes:
and S113, if the first node determines that the reliability of the updated gateway fault at the current moment is greater than or equal to the random number, reconnecting the gateway fault with a second node according to the detection parameters adjusted by the first node, wherein the second node is any one of all nodes connected with the nodes in the mesh network.
As shown in fig. 9, fig. 9 shows a specific embodiment of a method for adjusting a node detection parameter according to an embodiment of the present invention, and the difference between fig. 9 and fig. 4-8 is that in fig. 9, after step S101, step S114 is added, and after S112, step S120 is added, that is, S120 is executed when the reliability of the failure of the updated gateway is less than the random number.
S114, the target node determines whether there is a connection that does not exceed the reconnection number threshold and that has not been attempted, if so, step S115 is executed, otherwise, a failure notification is sent, and S116 is executed.
And S115, the target node updates the reliability of the gateway fault and determines whether to reestablish the connection according to the relationship between the updated reliability of the gateway fault and the random number.
And S116, the target node judges whether the off-network waiting time exceeds the preset time, if so, S117 is executed, and if not, S118 is executed.
And S117, the target node is separated from the mesh network.
And S118, judging whether reconnection request messages sent by other nodes are received, if so, executing S110, and if not, executing S119.
S119, the target node unicast and sends a fault notification to the first node.
And after the first node finishes the step S112, adding S120: upon determining that the updated gateway failure confidence level is less than the random number, the first node disengages from the mesh network.
It can be understood that, in the mesh network shown in fig. 1, the node 202 and the gateway 201 are directly connected nodes, and the heartbeat loss threshold and the number of retries of the node 202 are smaller than those of the node 203, the node 204, the node 205 and the node 206. Since the heartbeat loss threshold and the reconnection number threshold of the node 202 are small, the node 202 first discovers the gateway 201 failure and sends a failure notification to the node 202, the node 203, the node 204, the node 205, and the node 206, the failure notification indicating the gateway failure and instructing each node to adjust the respective heartbeat loss threshold and/or reconnection number threshold. Node 202, node 203, node 204, node 205, and node 206 update the trustworthiness of the gateway failure based on the failure notification and the link quality adjustment between node 202 and the gateway. Since the number of hops between node 202 and the gateway is low, the communication delay is low. The obtained gateway updated fault will have a high confidence level based on the link quality between the node 202 and the gateway. And may be further enhanced when attempting to reestablish a connection through node 202. Thus, node 202, node 203, node 204, node 205, and node 206 will all quickly discover gateway failures and go off-grid.
The scheme provided by the embodiment of the invention is introduced mainly from the node point of view. It is to be understood that the nodes and the like, in order to implement the above-described functions, include corresponding hardware structures and/or software modules for performing the respective functions. Those of skill in the art would readily appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as hardware or combinations of hardware and computer software. Whether a function is performed as hardware or computer software drives hardware depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present embodiments.
In the embodiment of the present invention, the nodes and the like may be divided into functional modules according to the above method examples, for example, each functional module may be divided corresponding to each function, or two or more functions may be integrated into one processing module. The integrated module can be realized in a hardware mode, and can also be realized in a software functional module mode. It should be noted that, the division of the modules in the embodiment of the present invention is schematic, and is only a logic function division, and there may be another division manner in actual implementation.
As shown in fig. 10, an embodiment of the present invention provides a node, which is used in a mesh network including a gateway and a plurality of nodes, where the node is a first node in the plurality of nodes, and a node 40 includes:
an obtaining unit 401, configured to obtain a failure notification sent by a target node, where the failure notification is used to indicate a gateway failure and to indicate each of a plurality of nodes to adjust a respective detection parameter, and the target node is a node, in the plurality of nodes, that determines that the gateway has a failure.
The obtaining unit 401 is further configured to obtain, according to the failure notification, a current link quality and a maximum link quality in the mesh network, where the current link quality indicates a link quality between the first node and the gateway at the current time.
An adjusting unit 402, configured to adjust a detection parameter of the first node according to the current link quality, the maximum link quality, and a preset detection parameter, where the detection parameter at least includes a heartbeat loss threshold and a reconnection number threshold.
Optionally, the obtaining unit 401 is further configured to obtain a quotient of the current link quality and the maximum link quality.
The adjusting unit 402 is specifically configured to: and taking the product of the quotient of the current link quality and the maximum link quality multiplied by a preset detection parameter as the detection parameter after the first node is adjusted.
Optionally, the fault notification carries a first reliability, where the first reliability is a reliability of the gateway fault determined by the target node, and the obtaining unit 401 is further configured to obtain a second reliability, where the second reliability is a reliability of the gateway fault obtained by the first node at the current time.
The node 40 provided in the embodiment of the present invention further includes:
an updating unit 403, configured to update the reliability of the gateway failure at the current time according to the first reliability, the second reliability, and weights corresponding to the first reliability and the second reliability, respectively.
Optionally, the adjusting unit 402 is configured to adjust the working state of the first node according to the relationship between the reliability of the updated gateway fault at the current time and the random number generated at the current time, and the working state of the first node at the current time.
Optionally, the adjusting unit 402 is specifically configured to: if the reliability of the updated gateway fault at the current moment is determined to be greater than the random number, the first node adjusts the working state of the first node at the current moment to be a reconnection state if the working state of the first node at the current moment is a network access state; or if the working state of the first node at the current moment is the reconnection state, the first node abandons the establishment of a new link with the target node, and reduces the reconnection time threshold of the first node by a preset step length.
Optionally, the obtaining unit 401 is configured to obtain the current link quality according to the maximum delay of the mesh network, the communication delay of the mesh network, the weight of the quotient of the maximum delay of the mesh network and the communication delay of the mesh network, the maximum hop count of the mesh network, the hop count of the link between the first node and the gateway at the current time, the maximum hop count of the mesh network, and the weight of the quotient of the hop count of the link between the first node and the gateway at the current time.
Optionally, the node in the embodiment of the present invention further includes: a generating unit 404 for generating a random number.
It is understood that the obtaining unit 401, the adjusting unit 402, the updating unit 403, and the generating unit 404 in the embodiment of the present invention may be integrated in a processor as shown in fig. 1.
As shown in fig. 11, another node provided in the embodiment of the present invention is used in a mesh network including a gateway and a plurality of nodes, where the node serves as a target node in the plurality of nodes, and the node 50 includes:
a sending unit 501, configured to broadcast and send a failure notification to the mesh network, where the failure notification is used to indicate a gateway failure and to instruct each node in the plurality of nodes to adjust respective detection parameters, and the detection parameters at least include a heartbeat loss threshold and a reconnection number threshold.
Optionally, the plurality of nodes further includes a first node, and the node 50 further includes:
a receiving unit 502, configured to receive a reconnection request message sent by a first node, where the reconnection request message is used to instruct the target node to establish a link between the first node and a gateway.
The sending unit 501 is further configured to send a failure notification to the first node by unicast.
Optionally, the failure notification carries the reliability of the gateway failure determined by the target node.
It is understood that the sending unit 501 and the receiving unit 502 in the embodiment of the present invention may be integrated in a processor as shown in fig. 1.
In one aspect, an embodiment of the present invention provides a computer-readable storage medium, where instructions are stored, and when the computer-readable storage medium is executed on a computer, the computer-readable storage medium causes a node to perform the steps performed by the first node in the foregoing embodiments, for example, the processes S102, S103, S104, S108, S109, S110, and S111, S112, and S113, S120.
In yet another aspect, an embodiment of the present invention provides a computer-readable storage medium having stored therein instructions, which, when run on a computer, cause the node to perform S101, S105, S106, S107, S114, S115, S116, S117, S118, and S119.
In the above embodiments, all or part of the implementation may be realized by software, hardware, firmware, or any combination thereof. When implemented using a software program, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loaded and executed on a computer, cause the flow or functions described in accordance with embodiments of the invention, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored in a computer readable storage medium or transmitted from one computer readable storage medium to another computer readable storage medium, for example, the computer instructions may be transmitted from one website site, computer, node, or data center to another website site, computer, node, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line, DSL), or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer readable storage medium can be any available medium that can be read by a computer or a data storage device including one or more available media integrated nodes, data centers, and the like. The usable medium may be a magnetic medium (e.g., floppy Disk, hard Disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., Solid State Disk (SSD)), among others.
Through the above description of the embodiments, it is clear to those skilled in the art that, for convenience and simplicity of description, the foregoing division of the functional modules is merely used as an example, and in practical applications, the above function distribution may be completed by different functional modules according to needs, that is, the internal structure of the device may be divided into different functional modules to complete all or part of the above described functions. For the specific working processes of the system, the apparatus and the unit described above, reference may be made to the corresponding processes in the foregoing method embodiments, and details are not described here again.
In the several embodiments provided in the present application, it should be understood that the disclosed system, apparatus and method may be implemented in other manners. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the modules or units is only one logical division, and there may be other divisions when actually implemented, for example, a plurality of units or components may be combined or may be 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 units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application may be substantially implemented or contributed to by the prior art, or all or part of the technical solution may be embodied in a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a node, or a network device) or a processor to execute all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: flash memory, removable hard drive, read only memory, random access memory, magnetic or optical disk, and the like.
The above description is only an embodiment of the present application, but the scope of the present application is not limited thereto, and any changes or substitutions within the technical scope of the present disclosure should be covered by the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (16)

1. A method for adjusting node detection parameters for use in a mesh network including a gateway and a plurality of nodes, including a first node, the method comprising:
the first node acquires a fault notification sent by a target node, wherein the fault notification is used for indicating gateway faults and for indicating each node in a plurality of nodes to adjust respective detection parameters, and the target node is a node which determines that the gateway has faults in the plurality of nodes;
the first node acquires the current link quality and the maximum link quality in the mesh network according to the fault notification, wherein the current link quality represents the link quality between the first node and the gateway at the current moment;
and the first node adjusts the detection parameters of the first node according to the current link quality, the maximum link quality and preset detection parameters, wherein the detection parameters comprise a heartbeat loss threshold and a reconnection time threshold.
2. The method of claim 1, wherein the first node adjusts the detection parameter of the first node according to the current link quality, the maximum link quality and a preset detection parameter, and wherein the adjusting comprises:
the first node obtains the quotient of the current link quality and the maximum link quality;
and the first node takes the product of the quotient of the current link quality and the maximum link quality multiplied by the preset detection parameter as the detection parameter after the first node is adjusted.
3. The method according to claim 1 or 2, wherein the fault notification carries a first reliability, and the first reliability is a reliability of the gateway fault determined by the target node, and the method further comprises:
the first node acquires a second credibility, wherein the second credibility is the credibility of the gateway fault acquired by the first node at the current moment;
and the first node updates the reliability of the gateway fault at the current moment according to the first reliability, the second reliability and the weights respectively corresponding to the first reliability and the second reliability.
4. The method of claim 3, wherein after the first node updates the reliability of the gateway failure at the current time according to the first reliability, the second reliability, and the weights corresponding to the first reliability and the second reliability, the method further comprises:
and the first node adjusts the working state of the first node according to the relationship between the reliability of the gateway fault updated at the current moment and the random number generated at the current moment and the working state of the first node at the current moment.
5. The method according to claim 4, wherein the adjusting, by the first node, the operating state of the first node according to the relationship between the updated reliability of the gateway fault at the current time and the random number generated at the current time and the operating state of the first node at the current time comprises:
the first node determines that the reliability of the updated gateway fault at the current moment is greater than the random number, and if the working state of the first node at the current moment is a network access state, the first node adjusts the working state of the first node at the current moment to be a reconnection state;
or, if the working state of the first node at the current moment is the reconnection state, the first node abandons establishment of a new link with the target node, and reduces the reconnection time threshold of the first node by a preset step length.
6. The method of claim 1, wherein obtaining, by the first node, the current link quality based on the failure notification comprises:
the first node acquires the current link quality according to the maximum delay of the mesh network, the communication delay of the mesh network, the weight of the quotient of the maximum delay of the mesh network and the communication delay of the mesh network and the weight of the quotient of the maximum hop count of the mesh network, the hop count of the link between the first node and the gateway at the current moment, the maximum hop count of the mesh network and the hop count of the link between the first node and the gateway at the current moment.
7. A method for adjusting node detection parameters for use in a mesh network including a gateway and a plurality of nodes including a target node, the method comprising:
the target node broadcasts and sends a fault notification to the mesh network, wherein the fault notification is used for indicating gateway faults and instructing each node in the plurality of nodes to adjust respective detection parameters, so that each node obtains the current link quality and the maximum link quality in the mesh network according to the fault notification, and adjusts the detection parameters of each node according to the current link quality, the maximum link quality and preset detection parameters, wherein the current link quality represents the link quality between each node and the gateway at the current moment, and the detection parameters comprise a heartbeat loss threshold and a reconnection time threshold.
8. The method of claim 7, wherein the plurality of nodes further comprises a first node, the method further comprising:
the target node receives a reconnection connection request message sent by the first node, wherein the reconnection connection request message is used for indicating the target node to establish a link between the first node and the gateway;
and the target node unicast-sends the fault notification to the first node.
9. The method according to claim 7 or 8, wherein the failure notification carries the reliability of the gateway failure determined by the target node.
10. A node for use in a mesh network comprising a gateway and a plurality of nodes, the node being a first node of the plurality of nodes, the node comprising:
an obtaining unit, configured to obtain a fault notification sent by a target node, where the fault notification is used to indicate a gateway fault and to indicate each of a plurality of nodes to adjust a respective detection parameter, and the target node is a node in the plurality of nodes, where it is determined that the gateway has a fault;
the obtaining unit is further configured to obtain, according to the fault notification, a current link quality and a maximum link quality in the mesh network, where the current link quality indicates a link quality between the first node and the gateway at a current time;
and the adjusting unit is used for adjusting the detection parameters of the first node according to the current link quality, the maximum link quality and preset detection parameters, wherein the detection parameters comprise a heartbeat loss threshold and a reconnection time threshold.
11. The node of claim 10,
the obtaining unit is further configured to obtain a quotient between the current link quality and the maximum link quality;
the adjusting unit is specifically configured to: and taking the product of the quotient of the current link quality and the maximum link quality multiplied by the preset detection parameter as the detection parameter after the first node is adjusted.
12. The node according to claim 10 or 11, wherein the fault notification carries a first reliability, where the first reliability is a reliability of the gateway fault determined by the target node, and the obtaining unit is further configured to obtain a second reliability, where the second reliability is a reliability of the gateway fault obtained by the first node at the current time;
the node further comprises:
and the updating unit is used for updating the reliability of the gateway fault at the current moment according to the first reliability, the second reliability and the weights respectively corresponding to the first reliability and the second reliability.
13. The node according to claim 12, wherein the adjusting unit is configured to adjust the operating state of the first node according to a relationship between the updated reliability of the gateway fault at the current time and a random number generated at the current time, and the operating state of the first node at the current time.
14. A node for use in a mesh network comprising a gateway and a plurality of nodes, the node being a target node of the plurality of nodes, the node comprising:
a sending unit, configured to send a failure notification to the mesh network in a broadcast manner, where the failure notification is used to indicate a gateway failure and to indicate each node in the multiple nodes to adjust a respective detection parameter, so that each node obtains a current link quality and a maximum link quality in the mesh network according to the failure notification, and adjusts the detection parameter of each node according to the current link quality, the maximum link quality, and a preset detection parameter, where the current link quality represents a link quality between each node and the gateway at a current time, and the detection parameter includes a heartbeat loss threshold and a reconnection number threshold.
15. The node of claim 14, wherein the plurality of nodes further comprises a first node, and wherein the target node further comprises:
a receiving unit, configured to receive a reconnection request message sent by the first node, where the reconnection request message is used to instruct the target node to establish a link between the first node and the gateway;
the sending unit is further configured to send the failure notification to the first node in a unicast manner.
16. A mesh network, the mesh network comprising: a gateway and a plurality of nodes; the plurality of nodes comprises a node according to any of claims 10-13 and a node according to claim 14 or 15.
CN201710267630.9A 2017-04-21 2017-04-21 Method for adjusting node detection parameters, node and mesh network Active CN108737142B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201710267630.9A CN108737142B (en) 2017-04-21 2017-04-21 Method for adjusting node detection parameters, node and mesh network
PCT/CN2018/074492 WO2018192288A1 (en) 2017-04-21 2018-01-29 Method for adjusting node detection parameters, node, and mesh network

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710267630.9A CN108737142B (en) 2017-04-21 2017-04-21 Method for adjusting node detection parameters, node and mesh network

Publications (2)

Publication Number Publication Date
CN108737142A CN108737142A (en) 2018-11-02
CN108737142B true CN108737142B (en) 2020-11-06

Family

ID=63855657

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710267630.9A Active CN108737142B (en) 2017-04-21 2017-04-21 Method for adjusting node detection parameters, node and mesh network

Country Status (2)

Country Link
CN (1) CN108737142B (en)
WO (1) WO2018192288A1 (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110177353B (en) * 2019-06-17 2021-11-05 腾讯科技(深圳)有限公司 Secondary link monitoring method, device, medium and electronic equipment for vehicle communication
CN110752952B (en) * 2019-10-25 2022-02-22 腾讯科技(深圳)有限公司 Network fault positioning method and device, network equipment and computer storage medium
CN113128297A (en) * 2019-12-31 2021-07-16 深圳云天励飞技术有限公司 Equipment docking method and device, electronic equipment and storage medium
WO2021207960A1 (en) * 2020-04-15 2021-10-21 云图技术有限公司 Data processing method, apparatus, device and system for implementing disconnected network reconnection
CN113347679B (en) * 2021-05-31 2023-06-13 浙江大华技术股份有限公司 Data transmission method and device, storage medium and electronic device
CN114285782A (en) * 2021-12-22 2022-04-05 深圳电器公司 Data processing method and related device

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102026269A (en) * 2009-09-17 2011-04-20 中兴通讯股份有限公司 Optimization method for measuring reporting triggering time parameter and device thereof
CN102118773A (en) * 2011-03-21 2011-07-06 华为技术有限公司 Method for detecting link connection state between network nodes and relevant device
CN103346944A (en) * 2013-06-18 2013-10-09 北京卓越信通电子股份有限公司 Multi-channel looped network node device with multi-point collaboration detection and detection method
CN106452989A (en) * 2016-08-31 2017-02-22 北京小米移动软件有限公司 Method and device for establishing intelligent scene

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101039313A (en) * 2006-03-17 2007-09-19 广东省电信有限公司研究院 Implementing method for network entity to separately independent control protocol heart-beat
US7843807B2 (en) * 2007-03-21 2010-11-30 Cisco Technology, Inc. Fault reporting tag for mesh access points
US8325627B2 (en) * 2007-04-13 2012-12-04 Hart Communication Foundation Adaptive scheduling in a wireless network
CN101674217B (en) * 2008-09-10 2012-09-05 中兴通讯股份有限公司 Method for realizing permanent ring network protection in MESH network
CN102685768B (en) * 2011-03-08 2016-02-03 华为技术有限公司 The processing method of heartbeat message, the acquisition methods of heart beat cycle and access network equipment
CN102447631A (en) * 2011-12-28 2012-05-09 华为终端有限公司 Heartbeat connection method and related device and system thereof
CN103491592B (en) * 2013-10-16 2016-08-24 浙江中控技术股份有限公司 Wireless mesh sensor network path construction method, device and gateway

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102026269A (en) * 2009-09-17 2011-04-20 中兴通讯股份有限公司 Optimization method for measuring reporting triggering time parameter and device thereof
CN102118773A (en) * 2011-03-21 2011-07-06 华为技术有限公司 Method for detecting link connection state between network nodes and relevant device
CN103346944A (en) * 2013-06-18 2013-10-09 北京卓越信通电子股份有限公司 Multi-channel looped network node device with multi-point collaboration detection and detection method
CN106452989A (en) * 2016-08-31 2017-02-22 北京小米移动软件有限公司 Method and device for establishing intelligent scene

Also Published As

Publication number Publication date
CN108737142A (en) 2018-11-02
WO2018192288A1 (en) 2018-10-25

Similar Documents

Publication Publication Date Title
CN108737142B (en) Method for adjusting node detection parameters, node and mesh network
US10659345B2 (en) Service path protection method, controller, device and system
US10310944B2 (en) Phased network formation for power restoration
CN102480753B (en) Link state detection method and device
EP3216178B1 (en) Fast network formation using a battery-backed network backbone
US9397747B2 (en) Method and apparatus for connectivity control in a data center network
US9276898B2 (en) Method and device for link fault detecting and recovering based on ARP interaction
CN109525445B (en) Link switching method, link redundancy backup network and computer readable storage medium
US20160173367A1 (en) Redundant Pathways For Network Elements
US20120275316A1 (en) Failure Detection Method and Device for FCoE Virtual Link
WO2010095028A2 (en) Maximum transmission unit (mtu) size discovery mechanism and method for data-link layers
WO2015070383A1 (en) Link aggregation method, apparatus, and system
CN111935763B (en) Method for improving data transmission reliability in wireless mesh network and network system
JP2021534669A (en) Packet processing method and gateway device
US8218433B2 (en) Monitoring connectivity in ring networks
CN112995002B (en) Switch ring network design method, switch and storage medium
CN108289044B (en) Data forwarding method, link state method for determining static route and network equipment
GB2494385A (en) Transmitting and Forwarding Data
JP2007243932A (en) Wireless data communication system
JP2013110737A (en) Node device, termination device and communication control method
EP3537671B1 (en) Protection switching method and system, and nodes
CN109039889A (en) A kind of message forwarding method and device
CN113573379A (en) Data transmission method and device
JP6042549B2 (en) How to run a computer network
CN107801196B (en) Method and system for detecting off-line node

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