WO2018192288A1 - 一种调整节点检测参数的方法、节点和网状网络 - Google Patents

一种调整节点检测参数的方法、节点和网状网络 Download PDF

Info

Publication number
WO2018192288A1
WO2018192288A1 PCT/CN2018/074492 CN2018074492W WO2018192288A1 WO 2018192288 A1 WO2018192288 A1 WO 2018192288A1 CN 2018074492 W CN2018074492 W CN 2018074492W WO 2018192288 A1 WO2018192288 A1 WO 2018192288A1
Authority
WO
WIPO (PCT)
Prior art keywords
node
gateway
credibility
link quality
fault
Prior art date
Application number
PCT/CN2018/074492
Other languages
English (en)
French (fr)
Inventor
李启端
刘博华
Original Assignee
华为技术有限公司
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 华为技术有限公司 filed Critical 华为技术有限公司
Publication of WO2018192288A1 publication Critical patent/WO2018192288A1/zh

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

Definitions

  • the embodiments of the present invention relate to the field of communications technologies, and in particular, to a method, a node, and a mesh network for adjusting node detection parameters.
  • a mesh network including a gateway and multiple nodes.
  • a gateway is used to initiate a network, control each node of multiple nodes to join a mesh network, and implement communication between multiple nodes or nodes and other networks.
  • any one of the plurality of nodes can not only transmit and receive data, but also can forward data sent by the node connected thereto to other nodes or gateways of the plurality of nodes, and therefore, two non-connected ones
  • one of the nodes can select a node connected to it as a parent node and form a link with N (greater than or equal to 1) nodes to implement communication between two non-connected nodes or to implement communication between the node and the gateway. .
  • a gateway failure can cause the mesh network to crash.
  • each node can continue to communicate by leaving the mesh network and joining other networks.
  • each node needs to detect the link fault between the gateway and the gateway according to the fixed detection parameters, and then switch the parent node to establish a new link, and then repeatedly detect and establish a new link until the After the reconnection threshold is still unable to communicate with the gateway, the gateway failure can be determined and then disconnected from the mesh network formed by the gateway.
  • the present invention provides a method, a node, and a mesh network for adjusting node detection parameters, which are used to solve the problem that the gateway failure time is very long due to the fixed detection parameters of other nodes in the traditional manner. problem.
  • a method for adjusting a node detection parameter includes: a first node is obtained by using a first node, where the method includes: a failure notification sent by the target node, the failure notification is used to indicate a gateway failure and is used to indicate that each of the plurality of nodes adjusts respective detection parameters, and the target node is a node that determines that the gateway is faulty among the plurality of nodes;
  • the node obtains the current link quality and the maximum link quality in the mesh network according to the fault notification, and the current link quality indicates the link quality between the first node and the gateway at the current moment; the first node is based on the current link quality.
  • the maximum link quality and the preset detection parameter, and the detection parameters of the first node are adjusted, and the detection parameters include a heartbeat loss threshold and a reconnection number threshold.
  • the present application provides a method for adjusting a node detection parameter.
  • the first node obtains a fault notification of a gateway fault, and the first node determines, according to the link quality, the maximum link quality, and the preset detection parameter between the first node and the gateway at the current moment.
  • the detection parameters of the first node are adjusted. 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, according to the current time Link quality, maximum link quality, and preset detection parameters between a node and a gateway to adjust the detection parameters of the first node, so that each node in the mesh network can adjust the detection parameters by the first node.
  • the method adjusts the respective detection parameters according to the link quality, the maximum link quality, and the preset detection parameters of the node to the gateway, and since the detection parameters of each node are adjusted according to the link quality of the node, different links are
  • the detection parameters of the nodes determined by the quality are also different, so that the nodes with good communication status and the communication status are not good in the mesh network. Points having different detection parameters, so that good communication node and the communication quality of poor quality gateway node failure determination time will differ, compared to the prior art can determine the time to accelerate the mesh network node failure.
  • the first node according to the current link quality, the maximum link quality, and the preset detection parameter, adjust the detection parameters of the first node, including: The node obtains the quotient of the current link quality and the maximum link quality, and multiplies the quotient of the current link quality and the maximum link quality by the preset detection parameter as the detected parameter of the first node.
  • the detection parameter is adjusted by the quotient of the current link quality and the maximum link quality.
  • the current link quality is less than or equal to the maximum link quality, the current link quality and the maximum link quality are used.
  • the same detection parameters can also be based on different link qualities. (The communication quality of nodes with good link quality is good, and the communication quality of nodes with bad links is not good.) The detection parameters of each node are adjusted to be different, so that communication Good quality nodes and nodes with poor communication quality have different detection parameters.
  • the fault notification carries the reliability of the gateway fault determined by the target node (ie, the first).
  • the method provided by the embodiment of the present invention further includes: the first node acquires the credibility of the gateway fault at the current moment (ie, the second credibility); the first node is trusted according to the first credibility and the second credibility. And a weight corresponding to the first credibility and the second credibility respectively, and updating the credibility of the gateway fault at the current moment.
  • the embodiment of the present invention can more accurately reflect the working state of the gateway, and reduce the impact of the node with poor link quality on the mesh network.
  • the first node is based on the first credibility
  • the method provided by the embodiment of the present invention further includes: after the first node is updated according to the current moment The relationship between the reliability of the gateway failure and the random number generated at the current time, and the working state of the first node at the current time, adjusts the working state of the first node.
  • the working state of the first node may be adjusted according to the relationship between the random numbers generated at the current moment, so that the node can determine the fault time of the gateway.
  • a fourth possible implementation manner of the first aspect The relationship between the reliability of the gateway fault and the random number generated at the current time, and the working state of the first node at the current moment, and adjusting the working state of the first node, including: the first node after determining the current time update The reliability of the gateway fault is greater than the random number.
  • the first node adjusts the working state of the first node to the reconnect state at the current moment; or, if the current moment is When the working state of a node is a reconnected state, the first node relinquishes a new link with the target node, and reduces the threshold of the number of reconnections of the first node by a preset step size.
  • the first node obtains the current according to the fault notification
  • the link quality includes: the maximum delay of the first node according to the maximum delay of the mesh network, the communication delay of the mesh network, the maximum delay of the mesh network, the weight of the communication delay of the mesh network, and the maximum hop count of the mesh network, The weight of the hop of the link between the first node and the gateway at the current moment, the maximum hop count of the mesh network, and the quotient of the hop count of the link between the first node and the gateway at the current moment, acquiring the current link quality.
  • the method provided by the embodiment of the present invention further includes: A node determines that the reliability of the gateway fault after the current time is greater than or equal to the random number, and after the first node adjusts the working state of the first node to the reconnected state, the first node adjusts the detected parameter by the first node. Any one of all nodes in the mesh network reestablishes the connection.
  • an embodiment of the present invention provides a method for adjusting a node detection parameter, where a method includes: a target node is included in a mesh network including a gateway and a plurality of nodes, and the method provided by the embodiment of the present invention includes: The node transmits a failure notification for indicating a gateway failure and for indicating each of the plurality of nodes to adjust respective detection parameters to the mesh network broadcast, the detection parameters including at least a heartbeat loss threshold and a reconnection number threshold.
  • the method provided by the embodiment of the present invention further includes a first node, where the method provided by the embodiment further includes: receiving, by the target node, the first node And a reconnection connection request message for instructing the target node to establish a link between the first node and the gateway; the target node unicasts the failure notification to the first node.
  • the failure notification carries the trustedness of the gateway fault determined by the target node degree.
  • a node including: an acquiring unit, configured to acquire a fault notification sent by a target node, where the fault notification is used to indicate a gateway fault and is used to indicate that each node of the multiple nodes adjusts respective detection parameters, and the target
  • the node is a node that determines that the gateway is faulty among the multiple nodes, and is used to obtain the current link quality and the maximum link quality in the mesh network according to the fault notification, and the current link quality indicates the current time between the first node and the gateway.
  • the link quality is used to adjust the detection parameters of the first node according to the current link quality, the maximum link quality, and the preset detection parameters, and the detection parameters include at least a heartbeat loss threshold and a reconnection threshold.
  • the acquiring unit is further configured to obtain the quotient of the current link quality and the maximum link quality
  • the adjusting unit is specifically configured to: The product of the quotient of the road quality and the maximum link quality multiplied by the preset detection parameter is used as the detection parameter after the adjustment of the first node.
  • the fault notification carries the first credibility
  • the first credibility is the target node.
  • the acquiring unit is further configured to obtain the second credibility, where the second credibility is the credibility of the gateway fault acquired by the first node at the current moment; the node provided by the embodiment of the present invention is further The method includes: an update unit, configured to update the credibility of the current time gateway fault according to the first credibility, the second credibility, and the weight corresponding to the first credibility and the second credibility respectively.
  • the adjusting unit is configured to update the current time The relationship between the reliability of the gateway failure and the random number generated at the current time, and the working state of the first node at the current moment, adjusts the working state of the first node.
  • the adjusting unit is specifically configured to: The reliability of the gateway fault is greater than the random number. If the working state of the first node is the network access state at the current moment, the first node adjusts the working state of the first node to the reconnect state at the current moment; or, if the current moment is When the working state of a node is a reconnected state, the first node relinquishes establishing a new link with the target node, and reduces the threshold of the number of reconnections of the first node by a preset step size.
  • the acquiring unit is configured to use the maximum according to the mesh network Delay, communication delay of the mesh network, weight of the quotient of the maximum delay of the mesh network and the communication delay of the mesh network, and the maximum hop count of the mesh network, and the chain between the first node and the gateway at the current time
  • the hop count of the road, the maximum hop count of the mesh network, and the quotient of the hop of the link between the first node and the gateway at the current moment obtain the current link quality.
  • 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 target node among multiple nodes, and the node includes: a sending unit, configured to mesh The network broadcast sends a failure notification, which is used to indicate a gateway failure and is used to indicate that each of the plurality of nodes adjusts respective detection parameters, and the detection parameters include at least a heartbeat loss threshold and a reconnection number threshold.
  • the foregoing multiple nodes further include a first node, the node further includes: a receiving unit, configured to receive, by the first node, a reconnection connection request message of the link between the first node and the gateway; the sending unit is further configured to unicast the failure notification to the first node.
  • the fault notification carries the reliability of the gateway fault determined by the target node.
  • a node comprising a processor, a memory, a system bus, and a communication interface; wherein the memory is configured to store a computer to execute an instruction, the processor and the memory are connected through a system bus, and when the node is running, the processor executes The memory-stored computer executes instructions to cause the node to perform a method of adjusting node detection parameters as described in any one of the possible implementations of the first aspect to the first aspect of the first aspect.
  • a target node in a sixth aspect, includes a processor, a memory, a system bus, and a communication interface; wherein the memory is configured to store a computer execution instruction, and the processor and the memory are connected through a system bus, and when the target node is running, processing The computer executing the memory stored instructions to cause the target node to perform the method of adjusting the node detection parameters as described in any one of the second possible implementations of the second aspect to the second aspect.
  • a seventh aspect a computer readable storage medium comprising instructions, when executed on a node, causing a node to perform any one of the possible implementations of the sixth possible implementation of the first aspect to the first aspect
  • a method of adjusting a node detection parameter as described in the manner, or, when it is running on a target node, causing the target node to perform any one of the possible implementations of the second possible implementation of the second aspect to the second aspect The described method of adjusting node detection parameters.
  • a computer program product comprising instructions, when executed on a node, causes a node to perform a method of adjusting node detection parameters as described in the first aspect to the sixth possible implementation of the first aspect Or, when it is running on the target node, causing the target node to perform a method of adjusting node detection parameters as described in any one of the possible implementations of the second aspect to the second aspect of the second aspect.
  • a ninth aspect provides a mesh network, including: a gateway and a plurality of nodes, wherein at least one target node and at least one node are present in the plurality of nodes, and the target node is the fourth aspect or the second aspect of the fourth aspect
  • a possible implementation of the described target node which is the node of any one of the first aspect to the sixth possible implementation of the first aspect.
  • the present application may further combine to provide more implementations.
  • FIG. 1 is a schematic structural diagram of a mesh network according to an embodiment of the present disclosure
  • FIG. 2 is a schematic diagram of a working state of a node according to an embodiment of the present invention.
  • FIG. 3 is a schematic structural diagram of hardware of a node according to an embodiment of the present disclosure.
  • FIG. 4 is a schematic flowchart 1 of a method for adjusting node detection parameters according to an embodiment of the present invention
  • FIG. 5 is a schematic flowchart 2 of a method for adjusting node detection parameters according to an embodiment of the present disclosure
  • FIG. 6 is a schematic flowchart 3 of a method for adjusting a node detection parameter according to an embodiment of the present disclosure
  • FIG. 7 is a schematic flowchart 4 of a method for adjusting node detection parameters according to an embodiment of the present disclosure
  • FIG. 8 is a schematic flowchart 5 of a method for adjusting node detection parameters according to an embodiment of the present disclosure
  • FIG. 9 is a schematic flowchart 6 of a method for adjusting node detection parameters according to an embodiment of the present disclosure.
  • FIG. 10 is a schematic structural diagram of a node according to an embodiment of the present disclosure.
  • FIG. 11 is a schematic structural diagram of still another node according to an embodiment of the present invention.
  • the words “first”, “second” and the like are used to distinguish the same or similar items whose functions and functions are substantially the same, in the field.
  • the skilled person will understand that the words “first”, “second” and the like do not limit the number and order of execution.
  • a failure notification is sent to a mesh network by a target node (which may be understood as a node in which the mesh network first determines the gateway failure) or unicast to a node that attempts to establish a new link with the target node. Instructing the gateway to fail and causing other nodes in the mesh network except the target node to calculate the link quality of the link between the gateway and the gateway at the current time, and then according to the link quality and the mesh network, after receiving the fault notification. The maximum link quality in the medium to adjust the respective detection parameters.
  • the node with good link quality and the node with poor link quality have different detection parameters, and the detection parameters required by the node with good link quality are usually small. Different detection parameters can make the node with good link quality shorten the time when the node determines the gateway failure.
  • the method for adjusting node detection parameters provided by the embodiment of the present invention can be applied to a wireless mesh network, and can also be applied to a wired mesh network.
  • FIG. 1 is a schematic diagram of a mesh network applied to a method for adjusting node detection parameters according to an embodiment of the present invention.
  • the mesh network includes a gateway 201 and multiple nodes (eg, node 202, node 203, node 204, node). 205 and node 206). It can be understood that more or fewer nodes than FIG. 1 may be included in the embodiment of the present invention.
  • the gateway 201 is configured to initiate networking and control multiple nodes 202-206 to join the mesh network, and is also used to implement communication between multiple nodes and other networks, or between any two nodes.
  • any node can communicate directly with the node connected to it.
  • any two disconnected nodes need to communicate, one of the two unconnected nodes will select a node connected to it as the parent node. And composing the link between the node and the node that needs to communicate.
  • node 202 needs to communicate with node 206, node 202 can select node 204 or node 205 to which it is connected as a parent node, and form a link through the selected parent node (node 204 or node 205) to establish node 202 and The communication of node 206, for example, node 202 selects node 204 as the 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 .
  • the node can communicate directly with the gateway, for example, node 202 and gateway 201. If there is no direct connection between any node and the gateway, the node can establish the link between the node and the gateway by selecting the parent node. For example, node 203 can establish a link to the gateway by selecting parent node 202, which includes node 203, node 202, and gateway 201.
  • a network of one hop is formed, otherwise a network of multiple hops is formed.
  • the hop count of the node 201 and the node 204 is 2. How to determine the hop count is a mature solution in the prior art, and details are not described herein again.
  • the node that selects 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 a child node of the node connected to the node in the upward route, and is the parent node of the node connected to the node in the downward route, wherein the node without the parent node is the gateway.
  • FIG. 2 shows the working state of each node in the mesh network according to the embodiment of the present invention.
  • any node in the embodiment of the present invention has four working states, which are respectively In the Joined state, the Retry state, the Leave wait state, and the Leave state, the four states of each node in the embodiment of the present invention may be based on the state of the gateway. (fault or normal) or state switching of the mesh network.
  • the node sends a heartbeat to the gateway periodically or periodically receives the heartbeat sent by the gateway according to the preset detection status.
  • the node determines that the heartbeat reply sent by the gateway is not received continuously, or the gateway does not receive the continuous sent by the gateway.
  • the node determines the link failure between the heartbeat and the gateway, and the node adjusts from the network access state to the reconnect state.
  • any node when any node is in the network access state, the any node can communicate with the node connected to the plurality of nodes in the mesh network (for example, receiving a receipt, sending a receipt, etc.), and by selecting a parent.
  • the node establishes a link to the gateway to communicate with the gateway.
  • the node In the reconnect state, the node can select the node connected to it as the parent node and establish a new link to the gateway. If the node determines that the number of reconnections with the parent node exceeds the reconnection number threshold, the parent node is changed again. The above process is repeated until the node determines that all the parent nodes connected thereto cannot establish a new link to the gateway, and the node switches from the reconnected state to the off-network waiting state.
  • the node During a preset time when the node is in the off-network waiting state, the node sends a failure notification to the node attempting to establish a new link with it, the failure notification is used to indicate the gateway failure and other nodes adjust their respective detection parameters (eg, heartbeat loss threshold and / or reconnection threshold). Finally, after the preset time of the network waiting, the node exits the mesh network as shown in FIG. 1 and joins other networks.
  • detection parameters eg, heartbeat loss threshold and / or reconnection threshold
  • the heartbeat loss threshold is used to determine the communication state of the link between a node and the gateway
  • the reconnection number threshold is used to limit the node to select after a link failure between a node and the gateway. The maximum number of reconnections with the parent node when the connected node is the parent node.
  • the role of the gateway is to initiate networking and control each node of the multiple nodes to join the mesh network and forward data sent by multiple nodes to other networks or forward data sent by other networks.
  • the mesh network is bound to collapse.
  • the node can leave the mesh network.
  • the gateway fails in some mesh networks. It can also be repaired for a period of time. Therefore, if the time of the gateway repair is within the preset time, the node in the off-network waiting state can rejoin the mesh network composed of the gateway.
  • the structure of any one of the nodes 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.
  • the node 202 includes a memory 301, a processor 302, a system bus 303, and a communication component 304.
  • the storage 301 can be used for storing data, software programs, and modules, and mainly includes a storage program area and a storage data area, the storage program area can store an operating system, an application required for at least one function, and the like, and the storage data area can store the use of the server. The data created, etc.
  • the processor 302 performs various functions and processing data of the node 202 by running or executing software programs and/or modules stored in the memory 301, as well as invoking data, software programs, and modules stored in the memory 301.
  • the system bus 303 includes an address bus, a data bus, a control bus for transmitting data and instructions, and a communication component 304 for supporting wired or wireless communication between the node 202 and other devices.
  • the system bus 303 can be divided into an address bus, a data bus, a control bus, and the like. For ease of representation, only one thick line is shown in Figure 3, but it does not mean that there is only one bus or one type of bus.
  • FIG. 3 is only an exemplary structure of any one of the nodes provided by the embodiment of the present invention, and the node may include more components than those shown in FIG. 3 during actual use.
  • an embodiment of the present invention provides a method for adjusting a node detection parameter, where the method is applied to a mesh network as shown in FIG. 1, the method includes:
  • the target node After determining the gateway fault, the target node broadcasts a fault notification, which is used to indicate a gateway fault and is used to indicate that each of the multiple nodes adjusts the respective detection parameters.
  • the target node is a node among the plurality of nodes that determines that the gateway is faulty.
  • the target node is usually the one of the plurality of nodes of the mesh network that first determines the gateway failure.
  • the node that first determines the gateway failure is usually the node with the fewest link hops with the gateway, for example, the node 202 as shown in FIG. .
  • the target node broadcasts a failure notification
  • a node for example, the first node
  • the network factor is not good
  • the failure notification of the target node broadcast is not received, so the node determines the current time and the gateway.
  • a node selected from all nodes connected to the node is still used as a parent node (for example, a target node) to reconstruct a new link to the gateway.
  • the target node can also be at the preset time (the preset time is that the target node is offline)
  • the preset time is that the target node is offline
  • the fault notification that the target node broadcasts or unicasts in the embodiment of the present invention may be a newly defined message, or may extend the message in the existing protocol.
  • the target node may be broadcasted or unicast through a Transmission Control Protocol (TCP) or a User Datagram Protocol (UDP) or a Link Control Protocol (LCP). Failure notification.
  • TCP Transmission Control Protocol
  • UDP User Datagram Protocol
  • LCP Link Control Protocol
  • the first node acquires a failure notification.
  • the target node Since the target node sends the fault notification to the first node, which may be sent by unicast or broadcast, the first node may obtain the fault notification sent by the target node from the mesh network, or may receive the fault notification from the target node.
  • the failure notification of the unicast transmission specifically, the failure notification of the unicast transmission or the failure notification of the broadcast transmission, needs to be analyzed in combination with the actual situation, and details are not described herein again.
  • any node after receiving the reconnection connection request message sent by another node, any node usually establishes a new link with other nodes, and feeds back a response for establishing a new link, and in this application, The target node sends a fault notification to other nodes unicast. Therefore, the fault notification carried in the unicast message in this application may be an extension to the traditional message based on the existing protocol, or may be a new one. The form of the message.
  • the first node obtains the current link quality and the maximum link quality in the mesh network according to the fault notification.
  • the current link quality indicates the link quality between the first node and the gateway at the current moment.
  • 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.
  • the first node adjusts the detection parameter of the first node according to the current link quality, the maximum link quality, and the preset detection parameter, where the detection parameter includes at least a heartbeat loss threshold and a reconnection number threshold.
  • the present application provides a method for adjusting a node detection parameter.
  • the first node obtains a fault notification of a gateway fault, and the first node determines, according to the link quality, the maximum link quality, and the preset detection parameter between the first node and the gateway at the current moment.
  • the detection parameters of the first node are adjusted. 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, according to the current time Link quality, maximum link quality, and preset detection parameters between a node and a gateway to adjust the detection parameters of the first node, so that each node in the mesh network can adjust the detection parameters by the first node.
  • the method adjusts the respective detection parameters according to the link quality, the maximum link quality, and the preset detection parameters of the node to the gateway, and since the detection parameters of each node are adjusted according to the link quality of the node, different links are
  • the detection parameters of the nodes determined by the quality are also different, so that the nodes with good communication status and the communication status are not good in the mesh network.
  • the nodes have different detection parameters, so that the nodes with good communication quality and the nodes with poor communication quality determine the time of the gateway failure, and the time for determining the failure of the mesh network by the node can be accelerated compared with the prior art.
  • the process of the target node determining the gateway failure may be referred to steps S105-S107 in FIG.
  • the target node determines a link fault between the target node and the gateway at the current moment.
  • the target node determines the link fault between the target node and the gateway at the current time, the target node adjusts from the network access state to the reconnect state according to the working state as shown in FIG. 2 .
  • the target node can determine the link failure between it and the gateway by the number of lost heartbeats or the number of heartbeat replies, it is not sure whether the link failure between it and the gateway is caused by the gateway failure or by the link. Any node failure is caused. Therefore, the target node will establish a new link between the gateways by replacing the parent node, and determine the gateway failure after the new link to the gateway cannot be established.
  • the target node selects M nodes as the parent node from the N nodes connected to the target node.
  • N is an integer greater than or equal to 1
  • M is an integer greater than or equal to 1, wherein M is less than or equal to N.
  • the number of the specific N needs to be determined in combination with the topology in the actual mesh network, which is not limited by the embodiment of the present invention.
  • the number of Ms that can be selected by the target node in the embodiment of the present invention can be set as needed.
  • You can also set the preset threshold and ensure that the quotient of M and N is greater than or equal to the preset threshold. For example, if N 5 and the preset threshold is 80%, you can choose 4 out of 5 connected nodes. Nodes or 5 nodes as parent nodes.
  • the target node does not reconnect with the selected M nodes at a time, but sends a reconnection connection request message to one of the M nodes at a time (reconnecting the connection request message)
  • a new link reaching the gateway is established between the target node and the node X.
  • the reconnection connection request message is resent to one of the M nodes. .
  • the link between the target node and the gateway is different, and the parent node selected by the target node may also have multiple parent nodes. Therefore, multiple new nodes between the target node and the gateway
  • the link needs to be determined according to the actual situation, but the different links do not constitute a limitation on the solution of the embodiment of the present invention.
  • the target node reconnects the connection request message to each of the M parent nodes according to a preset rule. If the target node determines that the number of reconnections with each of the M parent nodes is greater than the reconnection threshold. , the target node determines the gateway failure.
  • the preset rule is: the target node selects a parent node from the M parent nodes each time, and sends a reconnection connection request message to the target node, and the target node determines that the number of reconnections with the selected one parent node is greater than the reconnection. The number of thresholds, then reselect a parent node from the M parent nodes, and so on. If the target node reestablishes the link with the gateway through a parent node during the reconnection process, the target node will no longer send a reconnection connection request message to other nodes of the M parent nodes.
  • the process described in step S105 provided by the embodiment of the present invention may be implemented in the following manner: the target node sends a heartbeat to the gateway through the link established by the current time and the gateway or a link established with the gateway through the current time. Receiving a heartbeat sent by the gateway; the target node determines that the number of heartbeat replies sent by the gateway is not greater than the heartbeat loss threshold or the number of heartbeats that are not received by the gateway is greater than the heartbeat loss threshold, the target node determines the target node to the gateway at the current time. The link between the links is faulty.
  • the link between the different detection time nodes and the gateway is different, and the target node sends a heartbeat to the gateway through the link between the target node and the gateway at the current time.
  • step S105 may also be implemented by: the target node according to the link quality of the link between the target node and the gateway at the current time, and the target node continuously receiving the gateway.
  • the number of heartbeats is greater than the heartbeat loss threshold or the number of heartbeat reply messages sent by the gateway is not received continuously is greater than the heartbeat loss threshold, and the gateway failure is determined.
  • the link quality exists between the link between each node and the gateway, and the quotient of the link quality and the maximum link quality between each node and the gateway is greater than 0 or less than or equal to 1, if a link of one node The quotient of quality and maximum link quality is 0, indicating that the link quality of the link between the one node and the gateway is very poor. If the link quality of the other node is 1, the chain of the link between the other node and the gateway is indicated. The quality of the path is very good. Therefore, if the value of the quotient of the link quality and the maximum link quality of the target node is 1, and the target node does not continuously receive the number of heartbeat packets sent by the gateway or continuously receives the heartbeat reply sent by the gateway. The number of times reaches the heartbeat loss threshold, and the target node determines the gateway failure.
  • step S104 in the embodiment of the present invention may be implemented by the following steps shown in FIG. 6: S108 and S109:
  • the first node acquires a quotient of the current link quality and the maximum link quality.
  • the first node multiplies a product of the current link quality and the maximum link quality by a preset detection parameter as a detection parameter of the first node.
  • the detection parameters of the embodiment of the present invention are: a heartbeat loss threshold and a reconnection number threshold.
  • the detection parameter may also be other parameters except the heartbeat loss threshold and the reconnection number threshold, for example, delay, etc., and the embodiments of the present invention are not listed here, and any link between the node and the gateway may be reflected.
  • the parameters of the road state can be used as the detection parameters of the present application.
  • the preset detection parameter in the embodiment of the present invention may be preset by the system when the mesh network is configured, that is, the same heartbeat loss threshold and the reconnection number threshold are set for each node of the multiple nodes, or multiple Each node in the node sets different heartbeat loss thresholds and reconnection thresholds.
  • the preset detection parameter in the embodiment of the present invention may also be a detection parameter adjusted by an adjustment time of any node before the current adjustment time.
  • the adjustment parameter after the adjustment time before the current adjustment time is A.
  • the node can determine the link quality R ⁇ A as the adjusted detection parameter of the node, or the preset detection parameter is the system-preset detection parameter B, and the node can also link quality at the current time.
  • the R ⁇ B determines the detection parameter after the adjustment of the node, which is not limited by the embodiment of the present invention.
  • the preset detection parameters are as follows: a maximum heartbeat loss threshold and a maximum reconnection number threshold are described as examples:
  • the detection parameter is the heartbeat loss threshold
  • HT represents a heartbeat miss threshold adjusted
  • MaxHT loss threshold value represents a maximum heart
  • RQ represents the link quality between the current time and the gateway node
  • RQ max represents the maximum link quality.
  • the quotient of the link quality and the maximum link quality between the first node and the gateway at the current moment is greater than or equal to 0 and less than or equal to 1.
  • the parent node selected by the first node is different, the link between the first node and the gateway is different, and the different links make the link quality between the first node and the gateway different, therefore, the first node
  • Each link in the link with the gateway corresponds to a heartbeat loss threshold. It can be understood that if the first node sends a heartbeat to the gateway through the link A, if the first node does not continuously receive the heartbeat reply number sent by the gateway through the link A, the first node determines that the heartbeat reply threshold is greater than the heartbeat loss threshold of the link A. Link A is faulty.
  • a node only needs to determine the heartbeat loss threshold of a link between its gateways. Only when the heartbeat loss threshold is reached and the parent node is reconnected, the heartbeat according to the newly established link is required. The loss threshold determines the status of the newly created link.
  • RT represents the adjusted reconnection number threshold
  • MaxRT represents the maximum weight.
  • the number of consecutive times threshold, RQ represents the link quality between the first node and the gateway at the current moment, and RQ max represents the maximum link quality.
  • the parent node selected by the first node is different, and the link between the first node and the gateway is different, and different links correspond to different link qualities. Therefore, the first node is different for different parent nodes. The number of consecutive connections is also different. If the first node selects node A as the parent node and the first node selects node A as the parent node, the number of reconnection times is 5, and the number of reconnections of the first node with node A is reached. After 5 times, it still fails. Finally, the first node determines the gateway failure and enters the off-network waiting state to leave the mesh network after the preset time.
  • the maximum heartbeat loss threshold and the maximum reconnection number threshold may be set during system initialization. At this time, the maximum heartbeat loss threshold and the maximum reconnection threshold of each node of the multiple nodes may be the same or different. .
  • the fault notification in the embodiment of the present invention may further carry a node identifier, for example, carrying an identifier of the target node, where the node identifier is used to uniquely identify the target node.
  • the topology of the mesh network may be stored in each node, that is, the distance between each node and the gateway, so that after receiving the fault notification of carrying the node identifier, the first node
  • the credibility of the gateway fault can be determined according to the node identifier, because in general, the credibility of the gateway fault sent by the node with the fewest hops between the gateways is compared with the gateway fault sent by the node with the most hops between the gateways. The credibility is higher.
  • the fault indication message carries the first credibility
  • the first credibility is the credibility of the gateway fault determined by the target node, so that the purpose is to make the first node pass Update the credibility of the gateway failure to accurately determine if the gateway is faulty.
  • the credibility of the gateway fault is used to indicate the possibility of the gateway fault.
  • the value of the credibility of the gateway fault is greater than or equal to 0, less than or equal to 1.
  • the greater the value of the credibility of the gateway fault indicates the possibility of the gateway fault.
  • the greater the sex For example, a value of 0 for the reliability of the gateway failure indicates that the probability of a 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.
  • each node in the embodiment of the present invention may have a credibility of a gateway fault, and the credibility of the fault of the gateway is a default value, for example, a gateway stored by each node when the gateway is not faulty.
  • the reliability of the fault is zero.
  • the reliability of the failure of the gateway of each node is restored to the default value when it interacts with the gateway presence data.
  • the method provided by the embodiment of the present invention further includes:
  • the first node obtains the second credibility, where the second credibility is the credibility of the gateway fault acquired by the first node at the current moment.
  • the second credibility is set by the system when the mesh network is networked, or is obtained by the first node by using the link quality.
  • the first node updates the credibility of the current time gateway fault according to the first credibility, the second credibility, and the weight corresponding to the first credibility and the second credibility respectively.
  • step S111 in the embodiment of the present invention may be specifically implemented by:
  • RQ 2 represents the credibility of the gateway failure sent by the target node, that is, the first credibility
  • represents the weight of RQ 1
  • represents the weight of RQ 2
  • ⁇ + ⁇ 1.
  • the reliability of the gateway failure in the fault notification can be replaced by the link quality between the target node and the gateway.
  • the first node can be based on the link quality between the target node and the gateway. The above formula is used to update the credibility of the gateway fault at the current moment.
  • the first node may combine the relationship between the credibility of the gateway fault and the random number at the current moment of the update, and combine the working state of the current moment of the first node, and combine Figure 7, as shown in Figure 8, the method provided by the embodiment of the present invention further includes:
  • 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 time and the random number generated at the current time, and the working state of the first node at the current time.
  • the preset range of the random number is 0 to 1.
  • the step S112 in the embodiment of the present invention may be specifically implemented in the following manner: the first node determines that the reliability of the gateway fault after the current time is greater than the random number, and if the working state of the first node is the network access state at the current moment, the first The node adjusts the working state of the first node to the reconnected state at the current moment; or, if the working state of the first node is the reconnected state at the current moment, the first node relinquishes establishing a new link with the target node, and The threshold of the number of reconnections of the first node is decreased by a preset step size.
  • the preset step size is a positive integer smaller than the threshold of the number of reconnections.
  • the preset step size can be 1.
  • the working state of the first node at the current moment is the Jion state.
  • the first node updates the credibility of the gateway fault according to step S111, and generates a random number, if the updated gateway If the reliability of the fault is greater than the random number, the first node adjusts the state of the first node from the Jion state to the Retry state. This can make the first node enter the reconnect state as soon as possible, further shortening the time for the first node to determine the gateway failure.
  • the first node is in the Retry state at the current moment, and the first node generates a random number before each Retry connection. If the first node determines that the credibility of the updated gateway fault is greater than the random number according to S111, the first node skips. After the reconnection with the target node (normally, when the first node reestablishes the connection with the target node, only the threshold of reconnection times is reached, and the reconnection with the target node fails, the first node skips the target node.
  • the first node reduces the threshold of the number of reconnections by a preset step size, and immediately reduces the preset step with the node B.
  • a long reconnection threshold is used to reconstruct the connection. That is, when the first node in the Retry state reestablishes the 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 performing S112, skips the connection reconstruction with the node A. And decrementing the number of reconnections (for example, 5) by 1 and re-establishing a connection with the node B.
  • the threshold of the number of reconnections when the first node re-establishes the connection with the node B is 4, and the gateway is updated according to step S111.
  • the credibility of the failure In this way, the first node will abandon the reconnection with the target node, and when the node is reselected as the parent node, since the threshold of the number of reconnections has been reduced, the time for the first node to determine the gateway failure can be further shortened.
  • the step S103 in the embodiment of the present invention may be specifically implemented by: the first node according to a maximum delay of the mesh network, a communication delay of the mesh network, a maximum delay of the mesh network, and a communication delay of the mesh network.
  • the communication delay in the embodiment of the present invention refers to the time required for the data packet to be sent to the gateway through the node and then received by the gateway.
  • the maximum delay (MaxDelay, M d ) is set by the mesh network, indicating the maximum value of the communication delay.
  • the hop number Hop refers to the number of nodes included in the link established when any one node communicates with the gateway.
  • the maximum hop count MaxHop is set by the mesh network, and represents the maximum number of nodes included when a node communicates with the gateway.
  • the delay of the reaction network is blocked, and the long delay time indicates that the network of the mesh network is relatively congested.
  • the number of hops reflects the topology of the mesh network.
  • the number of hops means that the number of nodes included in the link from the node to the gateway in the mesh network is large.
  • the method provided by the embodiment of the present invention further includes:
  • the first node determines that the fault credibility of the updated gateway is greater than or equal to the random number, and then reconnects the second node according to the adjusted parameter of the first node, and the second node is a node in the mesh network. Any of the connected nodes.
  • FIG. 9 shows a specific embodiment of a method for adjusting node detection parameters according to an embodiment of the present invention.
  • the difference between FIG. 9 and FIG. 4-8 is that after step S101 in FIG. Step S114 is added and S120 is added after S112, that is, the reliability of the fault of the updated gateway is less than the random number, and then S120 is performed.
  • the target node determines whether there is a threshold that does not exceed the number of reconnections and that there is a connection that is not attempted. If the step S115 is performed, if no, a failure notification is sent, and S116 is performed.
  • the target node updates the credibility of the gateway fault, and determines whether to reestablish the connection according to the relationship between the credibility of the updated gateway fault and the random number.
  • the target node determines whether the time that the off-network waits exceeds the preset time. If yes, execute S117, if otherwise, execute S118.
  • the target node is detached from the mesh network.
  • the target node sends a failure notification to the first node unicast.
  • step S120 is added: when it is determined that the updated gateway failure credibility is less than the random number, the first node leaves the mesh network.
  • the embodiment of the present invention adjusts the detection parameters of each node so that different nodes have different detection parameters.
  • the node 202 and the gateway 201 are directly connected.
  • node node 202 has a smaller heartbeat loss threshold and retries than node 203, node 204, node 205, and node 206. Since the heartbeat loss threshold and the number of reconnection thresholds of the node 202 are small, the node 202 first discovers that the gateway 201 is faulty 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 is used to indicate the gateway.
  • Node 202, node 203, node 204, node 205, and node 206 update the credibility 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 the node 202 and the gateway is very low, the communication delay is low. Therefore, according to the link quality between the node 202 and the gateway, the reliability of the obtained gateway updated fault will be high. And it will be further improved when attempting to re-establish the connection through node 202. Thus node 202, node 203, node 204, node 205, and node 206 will all quickly discover the gateway failure and be off-network.
  • a node or the like includes a hardware structure and/or a software module corresponding to each function in order to implement the above functions.
  • a node or the like includes a hardware structure and/or a software module corresponding to each function in order to implement the above functions.
  • the present application can be implemented in a combination of hardware or hardware and computer software in conjunction with the elements and algorithm steps of the various examples described in the embodiments disclosed herein. Whether a function is implemented in hardware or computer software to drive hardware depends on the specific application and design constraints of the solution. A person skilled in the art can use different methods to implement the described functions for each particular application, but such implementation should not be considered to be beyond the scope of the embodiments of the invention.
  • the embodiment of the present invention may divide a function module into a node or the like according to the foregoing method example.
  • each function module may be divided according to each function, or two or more functions may be integrated into one processing module.
  • the above integrated modules can be implemented in the form of hardware or in the form of software functional modules. It should be noted that the division of the module in the embodiment of the present invention is schematic, and is only a logical function division, and the actual implementation may have another division manner.
  • an embodiment of the present invention provides a node, in a mesh network including a gateway and a plurality of nodes, where the node is the first node among the multiple nodes, and the node 40 includes:
  • the obtaining unit 401 is configured to acquire a fault notification sent by the target node, where the fault notification is used to indicate a gateway fault and is used to indicate that each of the plurality of nodes adjusts respective detection parameters, where the target node is the multiple nodes. Determining the node where the gateway is faulty.
  • the obtaining unit 401 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 current time between the first node and the gateway Link quality.
  • the adjusting unit 402 is configured to adjust the detection parameter of the first node according to the current link quality, the maximum link quality, and the preset detection parameter, where the detection parameter includes at least a heartbeat loss threshold and a reconnection number threshold.
  • 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: multiply a product of a current link quality and a maximum link quality by a preset detection parameter as a detection parameter after the first node is adjusted.
  • the fault notification carries a first credibility, where the first credibility is the credibility of the gateway fault determined by the target node, the obtaining unit 401 is further configured to obtain the second credibility, and the second The credibility is the credibility of the gateway fault acquired by the first node at the current moment.
  • the node 40 provided by the embodiment of the present invention further includes:
  • the updating unit 403 is configured to update the credibility of the current time gateway fault according to the first credibility, the second credibility, and the weight corresponding to the first credibility and the second credibility respectively.
  • the adjusting unit 402 is configured to adjust the work of the first node according to the relationship between the reliability of the gateway fault that is updated at the current time and the random number generated by the current time, and the working state of the first node at the current time. status.
  • the adjusting unit 402 is configured to: when determining that the reliability of the gateway fault after the current moment is greater than a random number, if the working state of the first node at the current moment is a network access state, the first node At the current moment, the working state of the first node is adjusted to a reconnect state; or, if the working state of the first node is a reconnect state at the current moment, the first node relinquishes establishing a new link with the target node, and will be the first The threshold of the number of reconnections of the node is decreased by a preset step size.
  • the obtaining unit 401 is configured to: according to a maximum delay of the mesh network, a communication delay of the mesh network, a weight of the maximum delay of the mesh network, and a communication delay of the mesh network, and a maximum hop count of the mesh network.
  • the node in the embodiment of the present invention further includes: a generating unit 404, configured to generate a random number.
  • the obtaining unit 401, the adjusting unit 402, the updating unit 403, and the generating unit 404 in the embodiment of the present invention can be integrated in the processor shown in FIG. 1.
  • another node provided by an 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 among multiple nodes, and the node 50 includes:
  • the sending unit 501 is configured to send, to the mesh network, a fault notification, where the fault notification is used to indicate a gateway fault, and is used to indicate that each of the multiple nodes adjusts respective detection parameters, where the detection parameter includes at least a heartbeat loss threshold and reconnection The number of thresholds.
  • the multiple nodes further include a first node
  • the node 50 further includes:
  • the receiving unit 502 is configured to receive a reconnection connection request message sent by the first node, where the reconnection connection request message is used to instruct the target node to establish a link between the first node and the gateway.
  • the sending unit 501 is further configured to send a failure notification to the first node unicast.
  • the fault notification carries the credibility of the gateway fault determined by the target node.
  • the receiving unit 502 can be integrated in the processor shown in FIG. 1.
  • an embodiment of the present invention provides a computer readable storage medium, where the computer readable storage medium stores instructions, when the computer readable storage medium is run on a computer, causing the node to execute the first node in the foregoing embodiment.
  • the steps performed are, for example, processes S102, S103, S104, S108, S109, S110 and S111, S112 and S113, S120.
  • an embodiment of the present invention provides a computer readable storage medium, where the computer readable storage medium stores instructions, when the computer readable storage medium is run on a computer, causing the node to execute S101, S105, S106, S107, S114, S115, S116, S117, S118, and S119.
  • a computer program product includes one or more computer instructions.
  • the computer can be a general purpose computer, a special purpose computer, a computer network, or other programmable device.
  • the computer instructions can be stored in a computer readable storage medium or transferred from one computer readable storage medium to another computer readable storage medium, for example, computer instructions can be wired from a website site, computer, node or data center (eg , coaxial cable, fiber optic, digital subscriber line (DSL) or wireless (eg, infrared, wireless, microwave, etc.) to another website site, computer, node, or data center.
  • the computer readable storage medium can be any available media that can be read by a computer or a data storage device such as a node, data center, or the like that includes one or more available media.
  • the usable medium may be a magnetic medium (for example, a floppy disk, a hard disk, a magnetic tape), an optical medium (for example, a DVD), or a semiconductor medium (for example, a Solid State Disk (SSD)) or the like.
  • a magnetic medium for example, a floppy disk, a hard disk, a magnetic tape
  • an optical medium for example, a DVD
  • a semiconductor medium for example, a Solid State Disk (SSD)
  • the disclosed system, apparatus, and method may be implemented in other manners.
  • the device embodiments described above are merely illustrative.
  • the division of the modules or units is only a logical function division.
  • there may be another division manner for example, multiple units or components may be used. Combinations can be integrated into another system, or some features can be ignored or not executed.
  • the mutual coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interface, device or unit, and may be in an electrical, mechanical or other form.
  • the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of the embodiment.
  • each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
  • the above integrated unit can be implemented in the form of hardware or in the 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 standalone product, may be stored in a computer readable storage medium.
  • a computer readable storage medium A number of instructions are included to cause a computer device (which may be a personal computer, node, or network device, etc.) or processor to perform all or part of the steps of the methods described in various embodiments of the present application.
  • the foregoing storage medium includes: a flash memory, a mobile hard disk, a read only memory, a random access memory, a magnetic disk, or an optical disk, and the like, which can store program codes.

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

本申请公开了一种调整节点检测参数的方法、节点和网状网络,涉及通信技术领域,用以解决传统方式中在网关故障的网状网络的中,其他节点由于检测参数固定从而导致的确定网关故障时间非常长的问题,该方法包括:第一节点获取目标节点发送的故障通知;第一节点根据故障通知,获取当前链路质量以及网状网络中的最大链路质量,当前链路质量表示当前时刻第一节点与网关之间的链路质量;第一节点根据当前链路质量、最大链路质量以及预设检测参数,调整第一节点的检测参数。本发明实施例提供的方法通过根据当前链路质量、最大链路质量以及预设检测参数对检测参数的调整,使得不同节点具有不同检测参数。

Description

一种调整节点检测参数的方法、节点和网状网络
本申请要求于2017年04月21日提交中国专利局、申请号为201710267630.9、申请名称为“一种调整节点检测参数的方法、节点和网状网络”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本发明实施例涉及通信技术领域,尤其涉及一种调整节点检测参数的方法、节点和网状网络。
背景技术
网状(mesh)网络,包括网关和多个节点。在网状网络中,网关用于发起组网,控制多个节点中的每个节点加入网状网络,并实现多个节点间,或者节点与其他网络间的通信。在网状网络中多个节点中的任一个节点不仅能够传送和接收数据,而且还可以将与其相连的节点发送的数据转发给多个节点中的其他节点或者网关,因此,两个非相连的节点通信时,其中一个节点可以选择与其相连的节点作为父节点并和N个(大于或等于1)节点组成链路以实现两个非相连的节点的通信或者实现该节点和网关之间的通信。
在由网关发起并维护的网状网络中,网关故障可能导致网状网络崩溃。传统方式中,通常在网关故障时,各个节点可以通过脱离网状网络并加入其他网络以继续通信。但是每个节点需要根据固定的检测参数先检测确定其与网关之间的链路故障后,再通过切换父节点以建立新的链路,再重复检测和建立新的链路的过程,直至超过重连次数阈值之后仍然无法与网关之间通信,才能确定网关故障,然后脱离该网关所组建的网状网络。
传统方式中,这样,对于较大规模的网状网络(网络中节点数量非常多),在由网关故障导致的网络故障时,造成每个节点确定网关故障的时间非常长,从而无法快速脱离网状网络。
发明内容
本申请提供一种调整节点检测参数的方法、节点和网状网络,用以解决传统方式中在网关故障的网状网络的中,其他节点由于检测参数固定从而导致的确定网关故障时间非常长的问题。
为达到上述目的,本申请采用如下技术方案:
第一方面,提供一种调整节点检测参数的方法,用于包括网关和多个节点的网状网络中,多个节点中包括第一节点,本发明实施例提供的方法包括:第一节点获取目标节点发送的故障通知,该故障通知用于指示网关故障以及用于指示多个节点中每个节点调整各自的检测参数,目标节点为所述多个节点中确定网关存在故障的节点;第一节点根据所述故障通知,获取当前链路质量以及网状网络中的最大链路质量,当前链路质量表示当前时刻第一节点与网关之间的链路质量;第一节点根据当前链路质量、所述最大链路质量以及预设检测参数,调整第一节点的检测参数,检测参数包括心跳 丢失阈值和重连次数阈值。
本申请提供一种调整节点检测参数的方法,通过获取网关故障的故障通知,第一节点根据当前时刻第一节点与网关之间的链路质量、最大链路质量和预设检测参数,以对第一节点的检测参数调整,由于不同的节点与网关之间的链路质量不同,链路质量好的节点的通信状态好,链路质量不好的节点通信质量差,因此,根据当前时刻第一节点与网关之间的链路质量、最大链路质量和预设检测参数,以对第一节点的检测参数调整,这样在网状网络中每个节点均可以以第一节点调整检测参数的方式来根据自己到网关的链路质量、最大链路质量和预设检测参数调整各自的检测参数,且由于每个节点的检测参数是根据该节点的链路质量调整的,因此不同的链路质量所确定的节点的检测参数也不同,从而在网状网络中能够使得通信状态好的节点和通信状态不好的节点具有不同的检测参数,这样通信质量好的节点和通信质量不好的节点确定网关故障的时间也会存在差异,相比与现有技术可以加快节点确定网状网络故障的时间。
结合第一方面,在第一方面的第一种可能的实现方式中,第一节点根据当前链路质量、最大链路质量以及预设检测参数,调整第一节点的检测参数,包括:第一节点获取所述当前链路质量与所述最大链路质量之商,将当前链路质量与最大链路质量之商与预设检测参数相乘的乘积,作为第一节点调整后的检测参数。本发明实施例通过当前链路质量和最大链路质量之商来调整检测参数,一方面,由于当前链路质量小于或等于最大链路质量,因此,当前链路质量和最大链路质量之商是个小于或等于1的数,这样可以使得调整后的检测参数小于或等于调整前的检测参数,另一方面,由于不同的节点到网关的链路质量不同,这样即使每个节点在调整之前具有相同的检测参数,也可以基于不同的链路质量,(链路质量好的节点的通信质量好,链路不好的节点通信质量不好)将每个节点的检测参数调整为不同,使得通信质量好的节点和通信质量不好的节点具有不同的检测参数。
结合第一方面或第一方面的第一种可能的实现方式,在第一方面的第二种可能的实现方式中,故障通知中携带有目标节点确定的网关故障的可信度(即第一可信度),本发明实施例提供的方法还包括:第一节点获取当前时刻网关故障的可信度(即第二可信度);第一节点根据第一可信度、第二可信度以及第一可信度和所述第二可信度分别对应的权重,更新当前时刻所述网关故障的可信度。本发明实施例结合网关故障的可信度,可以更加准确反映网关的工作状态,减少链路质量差的节点对网状网络产生的影响。
结合第一方面至第一方面的第二种可能的实现方式中任一种可能的实现方式,在第一方面的第三种可能的实现方式中,第一节点根据第一可信度、第二可信度以及第一可信度和第二可信度分别对应的权重,更新当前时刻网关故障的可信度之后,本发明实施例提供的方法还包括:第一节点根据当前时刻更新后的网关故障的可信度与当前时刻生成的随机数之间的关系,以及当前时刻第一节点的工作状态,调整第一节点的工作状态。在更新网关故障的可信度之后,可以根据当前时刻生成的随机数之间的关系将第一节点的工作状态调整,这样可以缩短节点确定网关的故障时间。
结合第一方面至第一方面的第三种可能的实现方式中任意一种可能的实现方式,在第一方面的第四种可能的实现方式中,第一节点根据当前时刻更新后的所述网关故 障的可信度与当前时刻生成的随机数之间的关系,以及当前时刻第一节点的工作状态,调整第一节点的工作状态,包括:第一节点在确定当前时刻更新后的所述网关故障的可信度大于所述随机数,如果当前时刻第一节点的工作状态为入网状态,则第一节点将当前时刻第一节点的工作状态调整为重连状态;或者,如果当前时刻第一节点的工作状态为重连状态,则第一节点放弃与目标节点建立新的链路,以及将第一节点的重连次数阈值减小预设步长。
结合第一方面至第一方面的第四种可能的实现方式中任意一种可能的实现方式,在第一方面的第五种可能的实现方式中,第一节点根据所述故障通知,获取当前链路质量,包括:第一节点根据网状网络的最大延迟、网状网络的通信延迟、网状网络的最大延迟与网状网络的通信延迟之商的权重和网状网络的最大跳数、当前时刻第一节点与所述网关之间的链路的跳数、网状网络的最大跳数、当前时刻第一节点与网关之间的链路的跳数之商的权重,获取当前链路质量。
结合第一方面至第一方面的第五种可能的实现方式中任意一种可能的实现方式,在第一方面的第六种可能的实现方式中,本发明实施例提供的方法还包括:第一节点确定当前时刻更新后的网关故障的可信度大于或等于随机数,第一节点将第一节点的工作状态调整为重连状态后,第一节点以第一节点调整后的检测参数与网状网络中所有节点中任意一个节点重建连接。
第二方面,本发明实施例提供一种调整节点检测参数的方法,用于包括网关和多个节点的网状网络中,多个节点中包括目标节点,本发明实施例提供的方法包括:目标节点向网状网络广播发送用于指示网关故障以及用于指示多个节点中每个节点调整各自的检测参数的故障通知,检测参数至少包括心跳丢失阈值和重连次数阈值。
结合第二方面,在第二方面的第一种可能的实现方式中,本发明实施例提供的方法还包括第一节点,本发明实施例提供的方法还包括:目标节点接收第一节点发送的用于指示目标节点建立所述第一节点与网关之间的链路的重连连接请求消息;目标节点向第一节点单播发送故障通知。
结合第二方面或第一方面的第一种可能的实现方式中,在第二方面的第二种可能的实现方式中,故障通知中携带有所述目标节点确定的所述网关故障的可信度。
第三方面,提供一种节点,包括:获取单元,用于获取目标节点发送的故障通知,该故障通知用于指示网关故障以及用于指示多个节点中每个节点调整各自的检测参数,目标节点为多个节点中确定网关存在故障的节点,以及用于根据故障通知,获取当前链路质量以及网状网络中的最大链路质量,当前链路质量表示当前时刻第一节点与网关之间的链路质量;调整单元,用于根据当前链路质量、最大链路质量以及预设检测参数,调整第一节点的检测参数,检测参数至少包括心跳丢失阈值和重连次数阈值。
结合第三方面,在第三方面的第一种可能的实现方式中,获取单元,还用于获取所述当前链路质量与最大链路质量之商;调整单元,具体用于:将当前链路质量与最大链路质量之商与预设检测参数相乘的乘积,作为第一节点调整后的检测参数。
结合第三方面或第三方面的第一种可能的实现方式,在第三方面的第三种可能的实现方式中,故障通知中携带有第一可信度,第一可信度为目标节点确定的网关故障的可信度,获取单元,还用于获取第二可信度,第二可信度为当前时刻第一节点获取 的网关故障的可信度;本发明实施例提供的节点还包括:更新单元,用于根据第一可信度、第二可信度以及第一可信度和第二可信度分别对应的权重,更新当前时刻网关故障的可信度。
结合第三方面至第三方面的第二种可能的实现方式中任意一种可能的实现方式,在第三方面的第三种可能的实现方式中,调整单元,用于根据当前时刻更新后的网关故障的可信度与当前时刻生成的随机数之间的关系,以及当前时刻第一节点的工作状态,调整第一节点的工作状态。
结合第三方面至第三方面的第三种可能的实现方式中任意一种可能的实现方式,在第三方面的第四种可能的实现方式中,调整单元具体用于:在确定当前时刻更新后的网关故障的可信度大于随机数,如果当前时刻第一节点的工作状态为入网状态,则第一节点将当前时刻第一节点的工作状态调整为重连状态;或者,如果当前时刻第一节点的工作状态为重连状态,则第一节点放弃与所述目标节点建立新的链路,以及将第一节点的重连次数阈值减小预设步长。
结合第三方面至第三方面的第四种可能的实现方式中任意一种可能的实现方式,在第三方面的第五种可能的实现方式中,获取单元,用于根据网状网络的最大延迟、所述网状网络的通信延迟、网状网络的最大延迟与网状网络的通信延迟之商的权重和所述网状网络的最大跳数、当前时刻第一节点与网关之间的链路的跳数、所述网状网络的最大跳数、当前时刻第一节点与网关之间的链路的跳数之商的权重,获取当前链路质量。
第四方面,本发明实施例提供一种节点,用于包括网关和多个节点的网状网络中,该节点作为多个节点中的目标节点,该节点包括:发送单元,用于向网状网络广播发送故障通知,该故障通知用于指示网关故障以及用于指示多个节点中每个节点调整各自的检测参数,检测参数至少包括心跳丢失阈值和重连次数阈值。
结合第四方面,在第四方面的第一种可能的实现方式中,上述多个节点还包括第一节点,节点还包括:接收单元,用于接收第一节点发送的用于指示目标节点建立第一节点与所述网关之间的链路的重连连接请求消息;发送单元还用于向第一节点单播发送故障通知。
结合第四方面或第四方面的第一种可能的实现方式,在第四方面的第二种可能的实现方式中,故障通知中携带有目标节点确定的网关故障的可信度。
第五方面,提供一种节点,该节点包括处理器、存储器、系统总线和通信接口;其中,存储器用于存储计算机执行指令,处理器与存储器通过系统总线连接,当节点运行时,处理器执行存储器存储的计算机执行指令,以使节点执行如第一方面至第一方面的第六种可能的实现方式中任意一种可能的实现方式所描述的调整节点检测参数的方法。
第六方面,提供一种目标节点,该节点包括处理器、存储器、系统总线和通信接口;其中,存储器用于存储计算机执行指令,处理器与存储器通过系统总线连接,当目标节点运行时,处理器执行存储器存储的计算机执行指令,以使目标节点执行如第二方面至第二方面的第二种可能的实现方式中任意一种可能的实现方式所描述的调整节点检测参数的方法。
第七方面,提供一种计算机可读存储介质,包括指令,当其在节点上运行时,使得节点执行如第一方面至第一方面的第六种可能的实现方式中任意一种可能的实现方式所描述的调整节点检测参数的方法,或者,当其在目标节点上运行时,使得目标节点执行如第二方面至第二方面的第二种可能的实现方式中任意一种可能的实现方式所描述的调整节点检测参数的方法。
第八方面,提供一种包含指令的计算机程序产品,当其在节点上运行时,使得节点执行如第一方面至第一方面的第六种可能的实现方式所描述的调整节点检测参数的方法,或者,当其在目标节点上运行时,使得目标节点执行如第二方面至第二方面的第二种可能的实现方式中任意一种可能的实现方式所描述的调整节点检测参数的方法。
第九方面,提供一种网状网络,包括:网关以及多个节点,其中,多个节点中存在至少一个目标节点和至少一个节点,该目标节点为第四方面或第四方面的第二种可能的实现方式所描述的目标节点,该节点为第一方面至第一方面的第六种可能的实现方式中任意一项所述的节点。
本申请在上述各方面提供的实现方式的基础上,还可以进行进一步组合以提供更多实现方式。
附图说明
图1为本发明实施例提供的一种网状网络的架构示意图;
图2为本发明实施例提供的节点工作状态的示意图;
图3为本发明实施例提供的一种节点的硬件结构示意图;
图4为本发明实施例提供的一种调整节点检测参数的方法的流程示意图一;
图5为本发明实施例提供的一种调整节点检测参数的方法的流程示意图二;
图6为本发明实施例提供的一种调整节点检测参数的方法的流程示意图三;
图7为本发明实施例提供的一种调整节点检测参数的方法的流程示意图四;
图8为本发明实施例提供的一种调整节点检测参数的方法的流程示意图五;
图9为本发明实施例提供的一种调整节点检测参数的方法的流程示意图六;
图10为本发明实施例提供的一种节点的结构示意图;
图11为本发明实施例提供的又一种节点的结构示意图。
具体实施方式
为了便于清楚描述本发明实施例的技术方案,在本发明的实施例中,采用了“第一”、“第二”等字样对功能和作用基本相同的相同项或相似项进行区分,本领域技术人员可以理解“第一”、“第二”等字样并不对数量和执行次序进行限定。
本发明实施例中,通过目标节点(可以理解为网状网络最先确定网关故障的节点)向网状网络广播或向某个尝试与目标节点建立新的链路的节点单播发送故障通知,指示网关故障并使得该网状网络中除该目标节点外的其他节点在接收到故障通知后,分别计算当前时刻自己到网关之间链路的链路质量,进而根据链路质量和网状网络中的最大链路质量来调整各自的检测参数。由于不同的节点与网关之间的链路质量不同,这样使得链路质量好的节点和链路质量不好节点具有不同的检测参数,链路质量好的节点所需要的检测参数通常比较小,检测参数不同可以使得链路质量好的节点缩短节点确定网关故障的时间。
本发明实施例提供的调整节点检测参数的方法可以应用于无线网状网络中,也可以应用于有线网状网络中。
本发明实施例以无线网状网络为例,如图1所示。图1示出了本发明实施例提供的一种调整节点检测参数的方法所应用的网状网络,该网状网络包括网关201,多个节点(例如,节点202、节点203、节点204、节点205以及节点206)。可以理解的是,本发明实施例中可以包括比图1更多或者更少的节点。
其中,网关201用于发起组网以及控制多个节点202~206加入网状网络,还用于实现多个节点与其他网络之间通信,或者多个节点中任意两个节点之间的通信。
在图1中任意一个节点可以与其相连的节点直接通信,任意两个不相连的节点之间需要通信时,该任意两个不相连的节点中的一个节点会选择与其相连的一个节点作为父节点,并组成由该节点到需要通信的节点之间的链路。例如,节点202需要和节点206通信,则节点202可以选择与其相连的节点204或者节点205作为父节点,并通过所选择的父节点(节点204或者节点205)构成链路,以建立节点202和节点206的通信,例如,以节点202选择节点204作为父节点,则节点202和节点206之间的链路包括:节点202、节点204、节点206或者节点202、节点204、节点205、节点206。
在图1所示的系统中,若任意一个节点与网关直接连接,则该节点与网关可以直接通信,例如,节点202与网关201。若任意一个节点与网关之间没有直接连接,则该节点可以通过选择父节点以建立该节点到网关之间的链路。例如,节点203可以通过选择父节点202建立到达网关的链路,该链路包括节点203、节点202以及网关201。
本发明实施例中若两个节点之间直接连接,则组成一跳的网络,否则组成多跳的网络。例如,节点202与网关201之间的跳数为1,节点201与节点204之间的链路包括网关201、节点202和节点204时,则节点201与节点204的跳数为2。如何确定跳数是现有技术中比较成熟的方案,本发明实施例在此不再赘述。
本发明实施例中选择父节点的节点可以称为子节点,子节点与父节点是个相对的概念。每个节点在向上路由中作为与该节点相连的节点的子节点,向下路由中作为与该节点相连的节点的父节点,其中,没有父节点的节点为网关。
如图2所示,图2示出了本发明实施例提供的网状网络中每个节点的工作状态,如图2所示,本发明实施例中任意一个节点具有四个工作状态,分别为:入网(Joined)状态、重连(Retry)状态、离网等待(Leave wait)状态以及离网(Leave)状态,本发明实施例中的每个节点的四个状态之间可以根据网关的状态(故障或者正常)或者网状网络的状态切换。
其中,在入网状态时,节点按照预设检测周期性的向网关发送心跳或者周期性的接收网关发送的心跳,当节点确定连续未接收到网关发送的心跳回复次数或者连续未接收到网关发送的心跳的次数大于心跳丢失阈值时,则节点确定其与网关之间的链路故障,于是节点从入网状态调整为重连状态。
可以理解的是,任意一个节点在处于入网状态时,该任意一个节点可以与网状网络中的多个节点中与其相连的节点可以通信(例如,接收收据、发送收据等), 以及通过选择父节点建立达到网关的链路,从而与网关通信。
在重连状态时,节点可以通过选择与其相连的节点作为父节点,并与其建立新的到达网关的链路,若节点确定与父节点重连次数超过重连次数阈值时,再次更改父节点并重复上述过程,直至节点确定所有与其相连的父节点均无法建立新的到达网关的链路,则节点从重连状态切换为离网等待状态。
在节点处于离网等待状态的预设时间内,节点向尝试与其建立新链路的节点发送故障通知,该故障通知用于指示网关故障以及其他节点调整各自的检测参数(例如,心跳丢失阈值和/或重连次数阈值)。最后,节点在离网等待的预设时间后,退出如图1所示的网状网络,加入其他网络。
本发明实施例中,心跳丢失阈值用于确定一个节点与网关之间的链路的通信状态,重连次数阈值用于在一个节点与网关之间的链路故障后,限制该节点在选择与其相连的节点作为父节点时,与父节点之间的最大的重连次数。
可以理解的是,如上述,网关的作用是用于发起组网以及控制多个节点中每个节点加入网状网络以及将多个节点发送的数据转发至其他网络或者将其他网络发送的数据转发至多个节点,因此在网关故障的网状网络中,势必导致网状网络的崩溃,此时,节点在确定网关故障后,可以通过脱离网状网络,当然,有的网状网络中网关故障后,还可以在一段时间内修复,因此,若网关修复的时间在预设时间内,则处于离网等待状态的节点可以重新加入该网关组成的网状网络。
需要说明的是,一般情况下,网关故障修复后,通常处于安全考虑更改网络的安全密钥,因此,处于离网等待状态节点需要在获取的更改后的密钥才能成功加入网状网络中。
进一步地,本发明实施例中,图1中任意一个节点的结构可以如图3所示。本发明实施例以节点202为例介绍,如图3所示,节点202包括存储器301、处理器302、系统总线303以及通信组件304。其中,存储器301可用于存储数据、软件程序以及模块,主要包括存储程序区和存储数据区,存储程序区可存储操作系统、至少一个功能所需的应用程序等,存储数据区可存储服务器的使用所创建的数据等。处理器302通过运行或执行存储在存储器301内的软件程序和/或模块,以及调用存储在存储器301内的数据、软件程序以及模块,执行节点202的各种功能和处理数据。系统总线303包括地址总线、数据总线、控制总线,用于传输数据和指令;通信组件304用于支持节点202和其他设备之间进行有线或无线方式的通信。
其中,系统总线303可以分为地址总线、数据总线、控制总线等。为便于表示,图3中仅用一条粗线表示,但并不表示仅有一根总线或一种类型的总线。
可以理解的是,图3仅是示例性的给出了本发明实施例提供的任意一个节点的结构,在实际使用过程中节点可以包括比图3所示的更多组件。
如图4所示,本发明实施例提供一种调整节点检测参数的方法,该方法应用于如图1所示的网状网络,该方法包括:
S101、目标节点在确定网关故障之后,目标节点广播发送故障通知,该故障通知用于指示网关故障以及用于指示多个节点中每个节点调整各自的检测参数。
目标节点为多个节点中确定网关存在故障的节点。
目标节点通常是该网状网络的多个节点中最先确定网关故障的节点。在由网关故障引起的网状网络的通信状态故障的情况下,最先确定网关故障的节点通常是与网关之间的链路跳数最少的节点,例如,如图1中所示的节点202。
由于目标节点广播发送故障通知时,可能存在节点(例如,第一节点)正在执行任务或者网络因素不佳,未收到目标节点广播发送的故障通知,因此,该节点在确定当前时刻其与网关之间的链路故障后,会依旧从所有与该节点相连的节点中选择一个节点作为父节点(例如,目标节点)重建到达网关的新链路。所以,为了保证网状网络中每个节点均能接收到故障通知,并根据故障通知调整各自的检测参数,本发明实施例中目标节点还可以在预设时间(预设时间为目标节点处于离线等待的时间)内接收到任意一个节点(例如,第一节点)发送的重连连接请求消息时,向该第一节点单播发送故障通知。
可以理解的是,本发明实施例中目标节点广播或者单播发送的故障通知可以是新定义消息,也可以是对现有协议中的消息进行扩展。
示例性的,该目标节点可以通过传输控制协议(Transmission Control Protocol,TCP)或者用户数据报协议(User Datagram Protocol,UDP)或者链路控制层协议(Link Control Protocol,LCP)广播或者单播发送的故障通知。
S102、第一节点获取故障通知。
由于目标节点向第一节点发送故障通知可以是单播发送的也可以是广播发送的,因此,第一节点可以从网状网络中获取目标节点发送的故障通知,也可以从目标节点处接收其单播发送的故障通知,具体是接收单播发送的故障通知还是广播发送的故障通知,需要结合实际情况分析,本发明实施例在此不再赘述。
可以理解的是,传统方式中,任意一个节点在接收到其他节点发送的重连连接请求消息后通常是与其他节点建立新的链路,并反馈建立新的链路的响应,而本申请中目标节点是向其他节点单播发送故障通知,因此,本申请中的单播消息中携带的故障通知可以是在现有协议的基础上对传统的消息中的扩展,也可以是一种新的消息形式。
S103、第一节点根据故障通知,获取当前链路质量以及网状网络中的最大链路质量,当前链路质量表示当前时刻第一节点与所述网关之间的链路质量。
可选的,网状网络中的最大链路质量可以是预设设定的,在网状网络初始化时每个节点均存储有最大链路质量。
S104、第一节点根据当前链路质量、最大链路质量以及预设检测参数,调整第一节点的检测参数,检测参数至少包括心跳丢失阈值和重连次数阈值。
本申请提供一种调整节点检测参数的方法,通过获取网关故障的故障通知,第一节点根据当前时刻第一节点与网关之间的链路质量、最大链路质量和预设检测参数,以对第一节点的检测参数调整,由于不同的节点与网关之间的链路质量不同,链路质量好的节点的通信状态好,链路质量不好的节点通信质量差,因此,根据当前时刻第一节点与网关之间的链路质量、最大链路质量和预设检测参数,以对第一节点的检测参数调整,这样在网状网络中每个节点均可以以第一节点调整检测参数的方式来根据自己到网关的链路质量、最大链路质量和预设检测参数调整各自的检 测参数,且由于每个节点的检测参数是根据该节点的链路质量调整的,因此不同的链路质量所确定的节点的检测参数也不同,从而在网状网络中能够使得通信状态好的节点和通信状态不好的节点具有不同的检测参数,这样通信质量好的节点和通信质量不好的节点确定网关故障的时间也会存在差异,相比与现有技术可以加快节点确定网状网络故障的时间。
可选的,结合图4,如图5所示,目标节点确定网关故障的过程可以参见图4中的步骤S105-S107。
S105、在目标节点处于入网状态时,目标节点确定当前时刻目标节点与网关之间的链路故障。
可以理解的是,在目标节点确定当前时刻目标节点到网关之间的链路故障后,目标节点按照如图2所示的工作状态,从入网状态调整为重连状态。
虽然,目标节点可以通过丢失的心跳次数或者心跳回复次数确定其与网关之间的链路故障,但是其并不能确定其与网关之间的链路故障是由网关故障引起的还是由链路中任意一个节点故障引起的,因此,目标节点将通过更换父节点以建立新的达到网关之间的链路,并在无法建立到达网关的新的链路后,确定网关故障。
S106、目标节点从与目标节点相连的N个节点中选择M个节点作为父节点。
其中,本发明实施例中的N为大于或等于1的整数,M为大于或等于1的整数,其中,M小于或等于N。
具体的N的数量需要结合实际网状网络中的拓扑结构来确定,本发明实施例对此不进行限定。
可以理解的是,本发明实施例中可以目标节点所选择的M的数量可以根据需要设置,例如,可以使得M=N,即将目标节点的5个相连节点中的每个节点均作为父节点,也可以通过设置预设阈值,并保证M与N之商大于或等于预设阈值即可,例如,若N=5,且预设阈值为80%,则可以从5个相连节点中任选4个节点或5个节点作为父节点。
可以理解的是,在实际过程中,目标节点并非一次均与选择的M个节点重新连接,而是每次向M个节点中的一个节点X发送重连连接请求消息(重连连接请求消息用于目标节点与节点X建立达到网关的新的链路),直至目标节点与节点X的重连次数达到重连次数阈值时,才向M个节点中的一个节点Y重新发送重连连接请求消息。
由于目标节点所选择的父节点不同,目标节点到网关之间的链路也不同,且目标节点所选择的父节点也有可能存在多个父节点,因此,目标节点到网关之间的多条新的链路需要根据实际情况确定,但是不同的链路其并不构成对本发明实施例方案的限制。
S107、目标节点按照预设规则向M个父节点中的每个父节点重连连接请求消息,目标节点若确定与M个父节点中的每个父节点的重连次数均大于重连次数阈值,则目标节点确定网关故障。
其中,预设规则为:目标节点每次从M个父节点中选择一个父节点,并向其发送重连连接请求消息,目标节点在确定与所选择一个父节点的重连次数均大于重连 次数阈值,则从M个父节点中重新选择一个父节点,以此类推。若在重连过程中目标节点通过某个父节点重建与网关之间的链路,则目标节点将不再向M个父节点中的其他节点发送重连连接请求消息。
可选的,一方面,本发明实施例提供的步骤S105所描述的过程可以通过以下方式实现:目标节点通过当前时刻与网关建立的链路向网关发送心跳或者通过当前时刻与网关建立的链路接收网关发送的心跳;目标节点确定连续未接收到网关发送的心跳回复次数大于心跳丢失阈值或者连续未接收到网关发送的心跳的次数大于心跳丢失阈值,则目标节点确定当前时刻目标节点到网关之间的链路故障。
可以理解的是,不同的检测时刻节点与网关之间的链路不同,目标节点通过当前时刻目标节点到网关之间的链路向网关发送心跳。
另一方面,本发明实施例提供的步骤S105所描述的过程还可以通过以下方式实现:目标节点根据当前时刻目标节点与网关之间链路的链路质量,以及目标节点连续未接收到网关发送的心跳的次数大于心跳丢失阈值或者连续未接收到网关发送的心跳回复消息的次数大于心跳丢失阈值,确定网关故障。
具体的,每个节点与网关之间的链路均存在链路质量,每个节点与网关之间的链路质量和最大链路质量之商大于0或小于等于1,若一个节点的链路质量和最大链路质量之商为0表示该一个节点与网关之间链路的链路质量非常差,若另一个节点的链路质量为1表示该另一个节点与网关之间链路的链路质量非常好,因此,若目标节点的链路质量和最大链路质量之商的值为1且该目标节点连续未接收到网关发送的心跳包的次数或者连续未接收到网关发送的心跳回复的次数达到心跳丢失阈值,则目标节点确定网关故障。
可选的,结合图5,如图6所示,本发明实施例中的步骤S104可以通过以下图6所示的步骤:S108和S109来实现:
S108、第一节点获取当前链路质量与最大链路质量之商。
S109、第一节点将当前链路质量与所述最大链路质量之商与预设检测参数相乘的乘积,作为第一节点调整后的检测参数。
可选的,本发明实施例的检测参数为:心跳丢失阈值和重连次数阈值。
可以理解的是,检测参数还可以为除心跳丢失阈值和重连次数阈值之外的其余参数,例如,时延等,本发明实施例在此不再列举,任何可以反映节点与网关之间链路状态的参数均可以作为本申请的检测参数。
本发明实施例中的预设检测参数可以为网状网络组网时系统预先设定的,即为多个节点中每个节点均设置相同的心跳丢失阈值和重连次数阈值,或者为多个节点中每个节点均设置不相同的心跳丢失阈值和重连次数阈值。
当然,本发明实施例中的预设检测参数还可以为任一个节点在当前调整时刻之前的一个调整时刻调整后的检测参数,例如,当前调整时刻之前的一个调整时刻调整后的检测参数为A,则当前时刻此节点可以将链路质量R×A确定为此节点调整后的检测参数,又或者预设检测参数为系统预设的检测参数B,则当前时刻此节点也可以将链路质量R×B确定为此节点调整后的检测参数,本发明实施例对此不限定。
下述将分别结合检测参数为心跳丢失阈值和重连次数阈值介绍如何调整心跳丢失阈值和重连次数阈值。本发明实施例以预设检测参数为:最大心跳丢失阈值和最大重连次数阈值为例进行说明:
一方面,检测参数为心跳丢失阈值,则对心跳丢失阈值调整可以通过公式HT=MaxHT×(RQ/RQ max)实现。其中,HT表示调整后的心跳丢失阈值,MaxHT表示最大心跳丢失阈值,RQ表示当前时刻第一节点与网关之间的链路质量,RQ max表示最大链路质量。
本发明实施例中的当前时刻第一节点与网关之间的链路质量与最大链路质量之商为大于或等于0,且小于或等于1的数。
可以理解的是,第一节点所选择的父节点不同,第一节点与网关之间的链路不同,不同的链路使得第一节点与网关之间的链路质量不同,因此,第一节点与网关之间存在的链路中每条链路对应一个心跳丢失阈值。可以理解为:若第一节点通过链路A向网关发送心跳,则第一节点若通过链路A连续未接收到网关发送的心跳回复次数大于链路A的心跳丢失阈值,则第一节点确定链路A故障。
一般情况下,一个节点只需要确定其到网关之间的一个链路的心跳丢失阈值即可,仅只有在达到心跳丢失阈值且重新选择父节点重连时,才需要根据新建的链路的心跳丢失阈值判断新建的链路的状态。
另一方面,检测参数为重连次数阈值,则对重连次数阈值调整可以通过公式HT=MaxRT×(RQ/RQ max)确定,其中,RT表示调整后的重连次数阈值,MaxRT表示最大重连次数阈值,RQ表示当前时刻第一节点与网关之间的链路质量,RQ max表示最大链路质量。
可以理解的是,第一节点所选择的父节点不同,第一节点与网关之间的链路也不同,不同的链路对应不同的链路质量,因此,第一节点对不同的父节点重连的次数阈值也不同,相应的若第一节点选择节点A作为父节点,第一节点选择节点A作为父节点时的重连次数阈值为5,则第一节点在与节点A重连次数达到5次后依旧失败,最终第一节点确定网关故障,并进入离网等待状态以在预设时间后脱离网状网络。
本发明实施例中最大心跳丢失阈值和最大重连次数阈值可以是系统初始化时设置的,此时多个节点中每个节点的最大心跳丢失阈值和最大重连次数阈值可以相同,也可以不相同。
当然,本发明实施例的故障通知中还可以携带节点标识,例如,携带目标节点的标识,节点标识用于唯一识别目标节点。
可以理解的是,本发明实施例中每个节点中还可以存储网状网络的拓扑结构,即每个节点到网关之间的距离,这样在接收到携带节点标识的故障通知后,第一节点可以根据节点标识确定网关故障的可信度,因为一般情况下,与网关之间跳数最少的节点发送的网关故障的可信度相较于与网关之间跳数最多的节点发送的网关故障的可信度较高。
由于第一节点在无法与网关通信时,其通常通过更换父节点重连后,若依旧连接失败,才将确定网关故障,但是,对于其余节点而言,为了确定网络故障是由网关故障引起的,因此,本发明实施例中故障指示消息中携带有第一可信度,第一可 信度为所述目标节点确定的网关故障的可信度,这样做的目的是为了使得第一节点通过更新网关故障的可信度,从而准确地确定网关是否故障。其中,网关故障的可信度用于表示网关故障的可能性,网关故障的可信度的值大于或等于0,小于或等于1,网关故障的可信度的值越大表示网关故障的可能性越大。例如,网关故障的可信度的值为0表示网关故障的可能性为0,网关故障的可信度的值为1表示网关处于故障状态。
可以理解的是,本发明实施例中每个节点均可以有一个网关故障的可信度,该网关的故障的可信度为默认值,例如,在网关未故障时,每个节点存储的网关的故障的可信度为0。每个节点的网关的故障的可信度在其与网关存在数据交互时恢复为默认值。
如图结合图4,如图7所示,本发明实施例提供的方法还包括:
S110、第一节点获取第二可信度,第二可信度为当前时刻第一节点获取的网关故障的可信度。
其中,第二可信度为网状网络组网时由系统设置的,或者是第一节点通过链路质量获取的。
S111、第一节点根据第一可信度、第二可信度以及第一可信度和第二可信度分别对应的权重,更新当前时刻网关故障的可信度。
可选的,本发明实施例中的步骤S111可以具体通过以下方式实现:
第一节点根据公式R=RQ 1×α+RQ 2×β更新当前时刻网关故障的可信度,其中,R表示当前时刻更新后的网关故障的可信度,RQ 1表示第二可信度,RQ 2表示目标节点发送的网关故障的可信度,即第一可信度,α表示RQ 1的权重,β表示RQ 2的权重,且α+β=1。
本发明实施例中的α和β的值可以根据需要设置,只要保证α+β=1即可,示例性的,本发明实施例中的α=0.8,β=0.2。
需要说明的是,故障通知中的网关故障的可信度可以通过目标节点和网关之间的链路质量代替,在这种情况下,第一节点可以根据目标节点和网关之间的链路质量采用上述公式更新当前时刻网关故障的可信度。
第一节点在更新当前时刻网关故障的可信度后,可以根据更新后的当前时刻网关故障的可信度和随机数之间的关系,并结合第一节点当前时刻所处的工作状态,结合图7,如图8所示,本发明实施例提供的方法还包括:
S112、第一节点根据当前时刻更新后的网关故障的可信度与当前时刻生成的随机数之间的关系,以及当前时刻第一节点的工作状态,调整第一节点的工作状态。
其中,随机数的预设范围为0~1。
具体的,当前时刻第一节点所处的工作状态不同,在当前时刻更新后的所述网关故障的可信度大于所述随机数的情况下,对应调整后的工作状态存在差异,因此,本发明实施例中的步骤S112具体可以通过以下方式实现:第一节点在确定当前时刻更新后的网关故障的可信度大于随机数,如果当前时刻第一节点的工作状态为入网状态,则第一节点将当前时刻第一节点的工作状态调整为重连状态;或者,如果当前时刻第一节点的工作状态为重连状态,则第一节点放弃与所述目标节点建立新的 链路,以及将第一节点的重连次数阈值减小预设步长。
其中,预设步长为小于重连次数阈值的正整数。示例性的,预设步长可以为1。
例如,当前时刻第一节点的工作状态为Jion状态,第一节点接收到第一故障通知后,第一节点根据步骤S111对网关故障的可信度更新,并生成随机数,若更新后的网关故障的可信度大于随机数则第一节点将第一节点的状态从Jion状态调整为Retry状态。这样可以尽快使得第一节点进入重连状态,进一步缩短了第一节点确定网关故障的时间。
例如,当前时刻第一节点处于Retry状态,在每次Retry连接前,第一节点生成随机数,若第一节点根据S111确定更新后的网关故障的可信度大于随机数,则第一节点跳过与目标节点的此次重连(正常情况下,第一节点在与目标节点重建连接时,只有达到重连次数阈值,且依旧与目标节点重连失败,第一节点才跳过与目标节点,并选择所有与第一节点相连的节点中除目标节点之外的一个节点B重建连接),第一节点并将重连次数阈值减少预设步长,并立即与节点B以减少预设步长的重连次数阈值重建连接。即Retry状态的第一节点通过节点A重建连接时,若节点A为Leave wait节点,则Retry状态的第一节点收到节点A发送的故障通知,且执行S112后跳过与节点A继续重建连接,并将重连次数阈值(例如,5)减1,并与节点B重新建立连接,此时,第一节点与节点B重新建立连接时的重连次数阈值为4,并根据步骤S111更新网关故障的可信度。这样第一节点将放弃与目标节点进行重连,且在重新选择节点作为父节点是,由于重连次数阈值已减少,这样可以进一步缩短第一节点确定网关故障的时间。
可选的,本发明实施例中的步骤S103可以通过以下方式具体实现:第一节点根据网状网络的最大延迟、网状网络的通信延迟、网状网络的最大延迟与网状网络的通信延迟之商的权重和网状网络的最大跳数、当前时刻第一节点与所述网关之间的链路的跳数、网状网络的最大跳数、当前时刻第一节点与网关之间的链路的跳数之商的权重,获取当前链路质量。
示例性的,第一节点根据公式RQ=λ 1×(M d/A d)+λ 2(M h/H)获取当前时刻第一节点与网关之间的链路质量,其中,RQ表示当前时刻第一节点与网关之间的链路质量,M d表示网状网络的最大延迟,A d表示网状网络的通信延迟,M h表示网状网络的最大跳数,H表示当前时刻第一节点与网关通信时链路的跳数,λ 1和λ 2表示权重因子且λ 12=1。
本发明实施例中的通信延迟指数据包通过节点发送到网关,然后收到网关作出响应的这一过程所需要的时间。
本发明实施例中最大延迟(MaxDelay,M d)由网状网络设置,表示通信延迟的最大值。
本发明实施例中跳数Hop指任意一个节点与网关通信时所建立的链路包括的节点数目。
本发明实施例中最大跳数MaxHop由网状网络设置,表示一个节点与网关通信时包括的最多节点数目。
本发明实施例中的λ 1和λ 2可以根据需要设置,只要保证λ 12=1即可,实际情 况下,延迟反应网络阻塞程度,延迟时间长表示网状网络的网络比较拥堵,跳数反应网状网络的拓扑情况,跳数多意味着网状网络中的节点到网关的链路中包括的节点数量多。示例性的,本发明实施例可以设置每个节点的延迟和跳数对到网关链路质量影响的权重是一致的,例如,λ 1=0.5,λ 2=0.5。
可选的,本发明实施例提供的方法还包括:
S113、第一节点确定当前时刻更新后的网关的故障可信度大于或等于随机数,则根据第一节点调整后的检测参数与第二节点重连,第二节点为网状网络中与节点相连的所有节点中任意一个节点。
如图9所示,图9示出了本发明实施例提供的一种调整节点检测参数的方法的具体实施例,在图9与图4-8的区别在于,图9中在步骤S101之后,增加了步骤S114以及在S112之后增加了S120,即更新后的网关的故障的可信度小于随机数则执行S120。
S114、目标节点判断是否存在未超过重连次数阈值及存在未尝试的相连连接,若是在执行步骤S115,若否,则发送故障通知,并执行S116。
S115、目标节点更新网关故障的可信度,并根据更新后的网关故障的可信度与随机数之间的关系确定是否重建连接。
S116、目标节点判断离网等待的时间是否超过预设时间,若是,则执行S117,若否则执行S118。
S117、目标节点从网状网络中脱离。
S118、判断是否接收到其他节点发送的重连连接请求消息,若是则执行S110,若否,则执行S119。
S119、目标节点向第一节点单播发送故障通知。
并在第一节点执行完步骤S112之后,增加了S120:在确定更新后的网关故障可信度小于随机数时,第一节点脱离网状网络。
可以理解的是,本发明实施例通过对每个节点的检测参数调整,使得不同的节点具有不同的检测参数,在如图1所示的网状网络中,节点202与网关201是直接连接的节点,节点202的心跳丢失阈值和重试次数较节点203、节点204、节点205和节点206小。由于节点202的心跳丢失阈值和重连次数阈值小,则节点202首先发现网关201故障,并向节点202、节点203、节点204、节点205和节点206发送故障通知,该故障通知用于指示网关故障,以及指示每个节点调整各自的心跳丢失阈值和/或重连次数阈值。节点202、节点203、节点204、节点205和节点206根据故障通知以及节点202与网关之间的链路质量调整更新网关故障的可信度。由于节点202与网关之间的跳数很低,因此通信延迟低。所以根据节点202与网关之间的链路质量,获取的网关更新后的故障的可信度将会很高。并且会在通过节点202尝试重建连接时进一步提高。从而节点202、节点203、节点204、节点205和节点206都将快速的发现网关故障,并且离网。
上述主要从节点的角度对本发明实施例提供的方案进行了介绍。可以理解的是,节点等为了实现上述功能,其包含了执行各个功能相应的硬件结构和/或软件模块。本领域技术人员应该很容易意识到,结合本文中所公开的实施例描述的各示例的单 元及算法步骤,本申请能够以硬件或硬件和计算机软件的结合形式来实现。某个功能究竟以硬件还是计算机软件驱动硬件的方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本发明实施例的范围。
本发明实施例可以根据上述方法示例对节点等进行功能模块的划分,例如,可以对应各个功能划分各个功能模块,也可以将两个或两个以上的功能集成在一个处理模块中。上述集成的模块既可以采用硬件的形式实现,也可以采用软件功能模块的形式实现。需要说明的是,本发明实施例中对模块的划分是示意性的,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式。
如图10所示,本发明实施例提供一种节点,用于包括网关和多个节点的网状网络中,节点作为多个节点中的第一节点,节点40包括:
获取单元401,用于获取目标节点发送的故障通知,该故障通知用于指示网关故障以及用于指示多个节点中每个节点调整各自的检测参数,所述目标节点为所述多个节点中确定所述网关存在故障的节点。
获取单元401,还用于根据故障通知,获取当前链路质量以及所述网状网络中的最大链路质量,所述当前链路质量表示当前时刻所述第一节点与所述网关之间的链路质量。
调整单元402,用于根据当前链路质量、最大链路质量以及预设检测参数,调整第一节点的检测参数,检测参数至少包括心跳丢失阈值和重连次数阈值。
可选的,获取单元401,还用于获取当前链路质量与所述最大链路质量之商。
调整单元402,具体用于:将当前链路质量与最大链路质量之商与预设检测参数相乘的乘积,作为第一节点调整后的检测参数。
可选的,故障通知中携带有第一可信度,所述第一可信度为目标节点确定的网关故障的可信度,获取单元401,还用于获取第二可信度,第二可信度为当前时刻所述第一节点获取的网关故障的可信度。
本发明实施例提供的节点40还包括:
更新单元403,用于根据第一可信度、第二可信度以及第一可信度和所述第二可信度分别对应的权重,更新当前时刻网关故障的可信度。
可选的,调整单元402,用于根据当前时刻更新后的网关故障的可信度与当前时刻生成的随机数之间的关系,以及当前时刻第一节点的工作状态,调整第一节点的工作状态。
可选的,调整单元402具体用于:在确定所述当前时刻更新后的所述网关故障的可信度大于随机数,如果当前时刻第一节点的工作状态为入网状态,则第一节点将当前时刻所述第一节点的工作状态调整为重连状态;或者,如果当前时刻第一节点的工作状态为重连状态,则第一节点放弃与目标节点建立新的链路,以及将第一节点的重连次数阈值减小预设步长。
可选的,获取单元401,用于根据网状网络的最大延迟、网状网络的通信延迟、网状网络的最大延迟与网状网络的通信延迟之商的权重和网状网络的最大跳数、当前时刻第一节点与网关之间的链路的跳数、网状网络的最大跳数、当前时刻第一节 点与网关之间的链路的跳数之商的权重,获取当前链路质量。
可选的,本发明实施例中的节点还包括:生成单元404,用于生成随机数。
可以理解的是,本发明实施例中的获取单元401,调整单元402、更新单元403、生成单元404可以集成在如图1所示的处理器中。
如图11所示,本发明实施例提供的另一种节点,用于包括网关和多个节点的网状网络中,该节点用作多个节点中的目标节点,节点50包括:
发送单元501,用于向网状网络广播发送故障通知,该故障通知用于指示网关故障以及用于指示多个节点中每个节点调整各自的检测参数,检测参数至少包括心跳丢失阈值和重连次数阈值。
可选的,多个节点还包括第一节点,节点50还包括:
接收单元502,用于接收第一节点发送的重连连接请求消息,重连连接请求消息用于指示所述目标节点建立所述第一节点与网关之间的链路。
发送单元501还用于,向第一节点单播发送故障通知。
可选的,故障通知中携带有目标节点确定的网关故障的可信度。
可以理解的是,本发明实施例中的发送单元501,接收单元502可以集成在如图1所示的处理器中。
一方面,本发明实施例提供一种计算机可读存储介质,计算机可读存储介质中存储有指令,当计算机可读存储介质在计算机上运行时,使得节点执行上述实施例中由第一节点所执行的步骤,例如,过程S102、S103、S104、S108、S109、S110以及S111、S112以及S113、S120。
又一方面,本发明实施例提供一种计算机可读存储介质,计算机可读存储介质中存储有指令,当计算机可读存储介质在计算机上运行时,使得节点执行S101、S105、S106、S107、S114、S115、S116、S117、S118以及S119。
在上述实施例中,可以全部或部分的通过软件、硬件、固件或者其任意组合来实现。当使用软件程序实现时,可以全部或部分地以计算机程序产品的形式实现。计算机程序产品包括一个或多个计算机指令。在计算机上加载和执行所述计算机程序指令时,全部或部分地产生按照本发明实施例多描述的流程或功能。所述计算机可以使通用计算机、专用计算机、计算机网络、或者其他可编程装置。计算机指令可以存储在计算机可读存储介质中,或者从一个计算机可读存储介质向另一个计算机可读存储介质传输,例如,计算机指令可以从一个网站站点,计算机、节点或数据中心通过有线(例如,同轴电缆、光纤、数字用户线DSL)或无线(例如,红外、无线、微波等)方式向另一个网站站点、计算机、节点或数据中心传输。计算机可读存储介质可以是计算机能够读取的任何可用介质或者是包含一个或多个可用介质集成的节点、数据中心等数据存储设备。所述可用介质可以使磁性介质,(例如,软盘,硬盘、磁带)、光介质(例如,DVD)、或者半导体介质(例如,固态硬盘(Solid State Disk,SSD))等。
通过以上的实施方式的描述,所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,仅以上述各功能模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能模块完成,即将装置的内部结构划分成不同的 功能模块,以完成以上描述的全部或者部分功能。上述描述的系统,装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。
在本申请所提供的几个实施例中,应该理解到,所揭露的系统,装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述模块或单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。
所述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,节点,或者网络设备等)或处理器执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:快闪存储器、移动硬盘、只读存储器、随机存取存储器、磁碟或者光盘等各种可以存储程序代码的介质。
以上所述,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何在本申请揭露的技术范围内的变化或替换,都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以所述权利要求的保护范围为准。

Claims (16)

  1. 一种调整节点检测参数的方法,用于包括网关和多个节点的网状网络中,所述多个节点中包括第一节点,其特征在于,所述方法包括:
    所述第一节点获取目标节点发送的故障通知,该故障通知用于指示网关故障以及用于指示多个节点中每个节点调整各自的检测参数,所述目标节点为所述多个节点中确定所述网关存在故障的节点;
    所述第一节点根据所述故障通知,获取当前链路质量以及所述网状网络中的最大链路质量,所述当前链路质量表示当前时刻所述第一节点与所述网关之间的链路质量;
    所述第一节点根据所述当前链路质量、所述最大链路质量以及预设检测参数,调整所述第一节点的检测参数,所述检测参数包括心跳丢失阈值和重连次数阈值。
  2. 根据权利要求1所述的方法,其特征在于,所述第一节点根据所述当前链路质量、所述最大链路质量以及预设检测参数,调整所述第一节点的检测参数,包括:
    所述第一节点获取所述当前链路质量与所述最大链路质量之商;
    所述第一节点将所述当前链路质量与所述最大链路质量之商与所述预设检测参数相乘的乘积,作为所述第一节点调整后的检测参数。
  3. 根据权利要求1或2所述的方法,其特征在于,所述故障通知中携带有第一可信度,所述第一可信度为所述目标节点确定的所述网关故障的可信度,所述方法还包括:
    所述第一节点获取第二可信度,所述第二可信度为当前时刻所述第一节点获取的网关故障的可信度;
    所述第一节点根据所述第一可信度、所述第二可信度以及所述第一可信度和所述第二可信度分别对应的权重,更新当前时刻所述网关故障的可信度。
  4. 根据权利要求3所述的方法,其特征在于,所述第一节点根据所述第一可信度、所述第二可信度以及所述第一可信度和所述第二可信度分别对应的权重,更新当前时刻所述网关故障的可信度之后,所述方法还包括:
    所述第一节点根据当前时刻更新后的所述网关故障的可信度与当前时刻生成的随机数之间的关系,以及当前时刻所述第一节点的工作状态,调整所述第一节点的工作状态。
  5. 根据权利要求4所述的方法,其特征在于,所述第一节点根据当前时刻更新后的所述网关故障的可信度与当前时刻生成的随机数之间的关系,以及当前时刻所述第一节点的工作状态,调整所述第一节点的工作状态,包括:
    所述第一节点在确定所述当前时刻更新后的所述网关故障的可信度大于所述随机数,如果当前时刻所述第一节点的工作状态为入网状态,则所述第一节点将当前时刻所述第一节点的工作状态调整为重连状态;
    或者,如果当前时刻所述第一节点的工作状态为重连状态,则所述第一节点放弃与所述目标节点建立新的链路,以及将所述第一节点的重连次数阈值减小预设步长。
  6. 根据权利要求1-5任一项所述的方法,其特征在于,所述第一节点根据所述 故障通知,获取当前链路质量,包括:
    所述第一节点根据所述网状网络的最大延迟、所述网状网络的通信延迟、所述网状网络的最大延迟与所述网状网络的通信延迟之商的权重和所述网状网络的最大跳数、当前时刻所述第一节点与所述网关之间的链路的跳数、所述网状网络的最大跳数、当前时刻所述第一节点与所述网关之间的链路的跳数之商的权重,获取当前链路质量。
  7. 一种调整节点检测参数的方法,用于包括网关和多个节点的网状网络中,所述多个节点中包括目标节点,其特征在于,所述方法包括:
    所述目标节点向所述网状网络广播发送故障通知,所述故障通知用于指示网关故障以及用于指示多个节点中每个节点调整各自的检测参数,所述检测参数包括心跳丢失阈值和重连次数阈值。
  8. 根据权利要求7所述的方法,其特征在于,所述多个节点还包括第一节点,所述方法还包括:
    所述目标节点接收所述第一节点发送的重连连接请求消息,所述重连连接请求消息用于指示所述目标节点建立所述第一节点与所述网关之间的链路;
    所述目标节点向第一节点单播发送所述故障通知。
  9. 根据权利要求7或8所述的方法,其特征在于,所述故障通知中携带有所述目标节点确定的所述网关故障的可信度。
  10. 一种节点,用于包括网关和多个节点的网状网络中,所述节点作为所述多个节点中的第一节点,其特征在于,所述节点包括:
    获取单元,用于获取目标节点发送的故障通知,该故障通知用于指示网关故障以及用于指示多个节点中每个节点调整各自的检测参数,所述目标节点为所述多个节点中确定所述网关存在故障的节点;
    所述获取单元,还用于根据所述故障通知,获取当前链路质量以及所述网状网络中的最大链路质量,所述当前链路质量表示当前时刻所述第一节点与所述网关之间的链路质量;
    调整单元,用于根据所述当前链路质量、所述最大链路质量以及预设检测参数,调整所述第一节点的检测参数,所述检测参数包括心跳丢失阈值和重连次数阈值。
  11. 根据权利要求10所述的节点,其特征在于,
    所述获取单元,还用于获取所述当前链路质量与所述最大链路质量之商;
    所述调整单元,具体用于:将所述当前链路质量与所述最大链路质量之商与所述预设检测参数相乘的乘积,作为所述第一节点调整后的检测参数。
  12. 根据权利要求10或11所述的节点,其特征在于,所述故障通知中携带有第一可信度,所述第一可信度为所述目标节点确定的所述网关故障的可信度,所述获取单元,还用于获取第二可信度,所述第二可信度为当前时刻所述第一节点获取的网关故障的可信度;
    所述节点还包括:
    更新单元,用于根据所述第一可信度、所述第二可信度以及所述第一可信度和所述第二可信度分别对应的权重,更新当前时刻所述网关故障的可信度。
  13. 根据权利要求12所述的节点,其特征在于,所述调整单元,用于根据当前时刻更新后的所述网关故障的可信度与当前时刻生成的随机数之间的关系,以及当前时刻所述第一节点的工作状态,调整所述第一节点的工作状态。
  14. 一种节点,用于包括网关和多个节点的网状网络中,所述节点作为所述多个节点中的目标节点,其特征在于,所述节点包括:
    发送单元,用于向所述网状网络广播发送故障通知,所述故障通知用于指示网关故障以及用于指示多个节点中每个节点调整各自的检测参数,所述检测参数包括心跳丢失阈值和重连次数阈值。
  15. 根据权利要求14所述的节点,其特征在于,所述多个节点还包括第一节点,所述目标节点还包括:
    接收单元,用于接收所述第一节点发送的重连连接请求消息,所述重连连接请求消息用于指示所述目标节点建立所述第一节点与所述网关之间的链路;
    所述发送单元还用于,向所述第一节点单播发送所述故障通知。
  16. 一种网状网络,其特征在于,所述网状网络包括:网关和多个节点;所述多个节点中包括如权利要求10-13中任一项所述的节点和如权利要求14或15所述的节点。
PCT/CN2018/074492 2017-04-21 2018-01-29 一种调整节点检测参数的方法、节点和网状网络 WO2018192288A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201710267630.9 2017-04-21
CN201710267630.9A CN108737142B (zh) 2017-04-21 2017-04-21 一种调整节点检测参数的方法、节点和网状网络

Publications (1)

Publication Number Publication Date
WO2018192288A1 true WO2018192288A1 (zh) 2018-10-25

Family

ID=63855657

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/074492 WO2018192288A1 (zh) 2017-04-21 2018-01-29 一种调整节点检测参数的方法、节点和网状网络

Country Status (2)

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

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110177353B (zh) * 2019-06-17 2021-11-05 腾讯科技(深圳)有限公司 用于车辆通信的副链路监测方法、装置、介质及电子设备
CN110752952B (zh) * 2019-10-25 2022-02-22 腾讯科技(深圳)有限公司 网络故障定位方法、装置、网络设备及计算机存储介质
CN113128297A (zh) * 2019-12-31 2021-07-16 深圳云天励飞技术有限公司 一种设备对接方法、装置、电子设备及存储介质
WO2021207960A1 (zh) * 2020-04-15 2021-10-21 云图技术有限公司 一种实现断线重连的数据处理方法、装置、设备及系统
CN113347679B (zh) * 2021-05-31 2023-06-13 浙江大华技术股份有限公司 一种数据传输方法、装置、存储介质及电子装置
CN114285782A (zh) * 2021-12-22 2022-04-05 深圳电器公司 数据处理方法及相关装置

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080232259A1 (en) * 2007-03-21 2008-09-25 Cisco Technology, Inc. Fault Reporting Tag for Mesh Access Points
CN101674217A (zh) * 2008-09-10 2010-03-17 中兴通讯股份有限公司 一种在mesh网络中实现永久环网保护的方法
CN102685768A (zh) * 2011-03-08 2012-09-19 华为技术有限公司 心跳消息的处理方法、心跳周期的获取方法及接入网设备

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101039313A (zh) * 2006-03-17 2007-09-19 广东省电信有限公司研究院 一种网络实体分别独立控制协议心跳的实现方法
US8325627B2 (en) * 2007-04-13 2012-12-04 Hart Communication Foundation Adaptive scheduling in a wireless network
CN102026269B (zh) * 2009-09-17 2014-08-13 中兴通讯股份有限公司 测量上报触发时间参数的优化方法及装置
CN102118773B (zh) * 2011-03-21 2014-08-20 华为技术有限公司 检测网络节点间链路连接状态的方法及相关设备
CN102447631A (zh) * 2011-12-28 2012-05-09 华为终端有限公司 一种心跳连接方法,相关装置以及系统
CN103346944B (zh) * 2013-06-18 2016-07-27 北京卓越信通电子股份有限公司 多点协同检测链路的环网
CN103491592B (zh) * 2013-10-16 2016-08-24 浙江中控技术股份有限公司 无线mesh传感器网络路径构建方法、装置及网关
CN106452989B (zh) * 2016-08-31 2019-12-13 北京小米移动软件有限公司 建立智能场景的方法及装置

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080232259A1 (en) * 2007-03-21 2008-09-25 Cisco Technology, Inc. Fault Reporting Tag for Mesh Access Points
CN101674217A (zh) * 2008-09-10 2010-03-17 中兴通讯股份有限公司 一种在mesh网络中实现永久环网保护的方法
CN102685768A (zh) * 2011-03-08 2012-09-19 华为技术有限公司 心跳消息的处理方法、心跳周期的获取方法及接入网设备

Also Published As

Publication number Publication date
CN108737142B (zh) 2020-11-06
CN108737142A (zh) 2018-11-02

Similar Documents

Publication Publication Date Title
WO2018192288A1 (zh) 一种调整节点检测参数的方法、节点和网状网络
US8570857B2 (en) Resilient IP ring protocol and architecture
CN102480753B (zh) 链路状态检测方法和装置
JP5869130B2 (ja) ハイブリッドネットワーク内のトポロジ発見
US9276898B2 (en) Method and device for link fault detecting and recovering based on ARP interaction
US10171986B2 (en) Radio relay device and system with waiting time optimization
US8811190B2 (en) Maximum transmission unit (MTU) size discovery mechanism and method for data-link layers
US9215078B2 (en) Multicast method and multicast device
US20150350043A1 (en) Methods and arrangements for checking connectivity and detecting connectivity failure
US20170214609A1 (en) Forwarding method and forwarding device
US9871690B2 (en) Indicating a master network controller in a virtual router redundancy protocol
JP7430224B2 (ja) パケット処理方法およびゲートウェイ・デバイス
WO2012167474A1 (zh) 网络环路检测方法、设备及系统
CN111935763B (zh) 无线网格网络中提高数据传输可靠性的方法、网络系统
WO2012048585A1 (zh) 切换方法和路由器
US8060628B2 (en) Technique for realizing high reliability in inter-application communication
EP3322141B1 (en) Backup designated router election and designated router failure processing method and equipment
EP2736204B1 (en) Rendezvous Point Convergence Method and Apparatus
CN110933729B (zh) 确定多跳网络节点生存时间值的方法及装置
CN110933730B (zh) 确定多跳网络节点生存时间值的方法及装置
JP2021069114A (ja) 複数のノードを含むネットワークのための方法、ブルートゥース低エネルギーネットワーク、およびコンピュータプログラム製品
JP2022553529A (ja) ネットワークデバイスを動作させるための装置、方法及びコンピュータプログラム
Zhang et al. Reliability and latency enhancements in a zigbee remote sensing system
JP6977604B2 (ja) 無線通信装置、無線通信プログラム、無線通信方法、並びに、無線通信システム
US20150016452A1 (en) Communication node device, communication system, communication control method and computer-readable program product

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 18788637

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 18788637

Country of ref document: EP

Kind code of ref document: A1