CN117176626A - Node detection method, device, equipment and readable storage medium - Google Patents
Node detection method, device, equipment and readable storage medium Download PDFInfo
- Publication number
- CN117176626A CN117176626A CN202311255493.9A CN202311255493A CN117176626A CN 117176626 A CN117176626 A CN 117176626A CN 202311255493 A CN202311255493 A CN 202311255493A CN 117176626 A CN117176626 A CN 117176626A
- Authority
- CN
- China
- Prior art keywords
- node
- detection
- abnormal
- nodes
- detected
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000001514 detection method Methods 0.000 title claims abstract description 280
- 230000002159 abnormal effect Effects 0.000 claims abstract description 136
- 238000000034 method Methods 0.000 claims abstract description 47
- 230000008030 elimination Effects 0.000 claims abstract description 6
- 238000003379 elimination reaction Methods 0.000 claims abstract description 6
- 239000002243 precursor Substances 0.000 claims description 54
- 230000005856 abnormality Effects 0.000 claims description 27
- 230000004044 response Effects 0.000 claims description 26
- 238000012545 processing Methods 0.000 claims description 15
- 238000003780 insertion Methods 0.000 claims description 12
- 230000037431 insertion Effects 0.000 claims description 12
- 230000008569 process Effects 0.000 claims description 12
- 238000004590 computer program Methods 0.000 claims description 9
- 238000010276 construction Methods 0.000 claims description 5
- 238000004891 communication Methods 0.000 abstract description 13
- 238000012544 monitoring process Methods 0.000 description 13
- 238000004422 calculation algorithm Methods 0.000 description 12
- 238000010586 diagram Methods 0.000 description 8
- 230000036541 health Effects 0.000 description 8
- 230000006870 function Effects 0.000 description 5
- 239000011159 matrix material Substances 0.000 description 5
- 230000009471 action Effects 0.000 description 3
- 230000005540 biological transmission Effects 0.000 description 3
- 238000011022 operating instruction Methods 0.000 description 3
- 238000004364 calculation method Methods 0.000 description 2
- 230000003993 interaction Effects 0.000 description 2
- 238000012423 maintenance Methods 0.000 description 2
- 230000007246 mechanism Effects 0.000 description 2
- 238000010295 mobile communication Methods 0.000 description 2
- 239000000523 sample Substances 0.000 description 2
- 238000004458 analytical method Methods 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000010485 coping Effects 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 238000007429 general method Methods 0.000 description 1
- 230000003862 health status Effects 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 238000005457 optimization Methods 0.000 description 1
- 230000000750 progressive effect Effects 0.000 description 1
- 238000011084 recovery Methods 0.000 description 1
Classifications
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D30/00—Reducing energy consumption in communication networks
- Y02D30/70—Reducing energy consumption in communication networks in wireless communication networks
Landscapes
- Small-Scale Networks (AREA)
Abstract
The application discloses a node detection method, a device, equipment and a readable storage medium, which are applied to the distributed field and comprise the following steps: selecting a central node from a plurality of nodes to be detected; forming a ring node detection link by other nodes to be detected except the center node; node detection is completed by using a ring node detection link; when the abnormal node is detected, the abnormal information is sent to the central node by using the detection node, so that the central node eliminates the abnormal node from the annular node detection link; and when the abnormal node elimination is completed, reconstructing a new ring node detection link detection node state. According to the application, each node only pays attention to the states of the adjacent predecessor nodes and successor nodes, the range of the node concerned is smaller, and the network communication overhead is reduced; abnormal nodes can be positioned rapidly, the stability and the reliability of the system are improved, and the method is more suitable for constructing a distributed system or network with high performance and high availability requirements.
Description
Technical Field
The present application relates to the distributed field, and in particular, to a method, an apparatus, a device, and a readable storage medium for detecting a node.
Background
The general method for node detection in the related art includes: the method comprises the steps of Polling mechanism (Polling), active Reporting (Active Reporting), passive detection (Passive Monitoring), heartbeat timeout (Heartbeat Timeout), abnormal detection algorithm (Anomaly Detection) and the like, wherein detection pressure is concentrated on a central node, all nodes to be detected are detected by the central node, and at the moment, the central node is excessively high in pressure, inaccurate judgment is likely to happen, and when the central node occupies more resources, business is affected.
Therefore, the current node detection method has the situations that the detection effect is inaccurate and the detection efficiency cannot be ensured.
Disclosure of Invention
Accordingly, the present invention is directed to a method, apparatus, device and readable storage medium for detecting nodes, which solve the problem of low node detection efficiency in the prior art.
In order to solve the technical problems, the present invention provides a node detection method, including:
selecting a central node from a plurality of nodes to be detected;
forming a ring node detection link by other nodes to be detected except the center node;
completing node detection by using the ring node detection link;
In the detection process, if an abnormal node is detected, the abnormal information is sent to the central node by using the detection node, so that the central node rejects the abnormal node from the ring node detection link;
and when the abnormal node elimination is completed, reconstructing a new ring node detection link detection node state.
Optionally, the selecting a central node from the nodes to be detected includes:
respectively calculating network delay values between each node to be detected and other nodes to be detected, and respectively obtaining network delay sets corresponding to each node to be detected;
accumulating the network delay values in the network delay sets corresponding to the nodes to be detected respectively to obtain the total network delay values corresponding to the nodes to be detected respectively;
and taking the node to be detected corresponding to the minimum network delay total value as the center node.
Optionally, the detecting the node by using the ring node detection link includes:
each node in the ring node detection link is utilized to send heartbeat messages to the precursor node according to the preset period set by each node, and response messages sent by the precursor node according to the heartbeat messages are received;
And each node in the ring node detection link is utilized to receive the heartbeat message sent by the subsequent node, and a response message according to the heartbeat message is sent to the subsequent node.
Optionally, the detecting the abnormal node includes:
when the heartbeat message sent by the subsequent node is not received by the node within the preset time, the subsequent node is abnormal;
when the existence node does not timely receive a response message sent by the precursor node according to the heartbeat message, the precursor node is abnormal;
or,
when the heartbeat message sent by the subsequent node is not received by the node in the preset time, adding 1 to the abnormal times of the subsequent node and recording;
when the abnormal times of the subsequent nodes reach a first preset threshold value or the abnormal times of the subsequent nodes continuously reach a second preset threshold value, the subsequent nodes are abnormal;
when the existence node does not timely receive the response message sent by the precursor node according to the heartbeat message, adding 1 to the abnormal times of the precursor node and recording;
when the abnormal times of the precursor nodes reach a third preset threshold value or the abnormal times of the precursor nodes continuously reach a fourth preset threshold value, the precursor nodes are abnormal.
Optionally, the reconstructing the new ring node detects a link detection node status, including:
and directing the subsequent node of the abnormal node to the precursor node of the abnormal node to form the new ring node detection link detection node state.
Optionally, after the nodes to be detected except the central node form the ring node detection link, the method further includes:
if the newly added node to be detected exists, determining the insertion position of the newly added node to be detected in the annular node detection link according to the network delay values of the newly added node to be detected and each node in the annular node detection link;
and inserting the newly added node to be detected into the insertion position.
Optionally, the method further comprises:
sequentially detecting each node in the annular node detection link by using the central node according to a preset frequency and a preset sequence;
when detecting that an abnormal node exists, the ring node detects that all nodes in the link are abnormal.
The invention also provides a node detection device, which comprises:
the center node selecting module is used for selecting a center node from a plurality of nodes to be detected;
The ring node detection link construction module is used for forming ring node detection links from other nodes to be detected except the center node;
the node detection module is used for completing node detection by utilizing the annular node detection link;
the node abnormality first processing module is used for sending abnormality information to the center node by using the detection node when an abnormal node is detected in the detection process, so that the center node eliminates the abnormal node from the annular node detection link;
and the node abnormality second processing module is used for reconstructing a new ring node detection link detection node state when the abnormal node is removed.
The application also provides a node detection device, comprising:
a memory for storing a computer program;
and the processor is used for realizing the steps of the node detection method when executing the computer program.
The present application also provides a readable storage medium having stored thereon a computer program which when executed by a processor implements the steps of the above node detection method.
Therefore, the center node is selected from a plurality of nodes to be detected; forming a ring node detection link by other nodes to be detected except the center node; node detection is completed by using a ring node detection link; when the abnormal node is detected, the abnormal information is sent to the central node by using the detection node, so that the central node eliminates the abnormal node from the annular node detection link; and when the abnormal node elimination is completed, reconstructing a new ring node detection link detection node state. In the application, each node only needs to pay attention to the states of the adjacent predecessor nodes and successor nodes, and compared with the heartbeat detection method of the whole network broadcasting among other nodes, the node attention range is smaller, and the network communication overhead is reduced; when one node is abnormal, the node (the successor node of the abnormal node) detecting the node immediately informs the central node, and the central node is utilized to quickly reject the abnormal node from the detection ring, so that a new ring node detection link is formed. Therefore, abnormal nodes can be rapidly positioned, the stability and the reliability of the system are improved, and the method is more suitable for constructing a distributed system or network with high performance and high availability requirements. In addition, the application also provides a node detection device, equipment and a readable storage medium, which have the same beneficial effects.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings that are required to be used in the embodiments or the description of the prior art will be briefly described below, and it is obvious that the drawings in the following description are only embodiments of the present invention, and that other drawings can be obtained according to the provided drawings without inventive effort for a person skilled in the art.
Fig. 1 is a flowchart of a method for detecting a node according to an embodiment of the present invention;
fig. 2 is a schematic diagram of intra-link node detection according to an embodiment of the present invention;
fig. 3 is a schematic diagram of inter-link node detection according to an embodiment of the present invention;
fig. 4 is a schematic structural diagram of a node detection device according to an embodiment of the present invention;
fig. 5 is a schematic structural diagram of a node detection device according to an embodiment of the present invention.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the embodiments of the present invention more apparent, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention, and it is apparent that the described embodiments are only some embodiments of the present invention, not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
With the wide application and increasing scale of distributed systems, node state monitoring is a critical task to ensure system reliability and performance. The traditional node detection method may have the problems of low efficiency, unbalanced load and the like in the distributed system. The conventional node detection method includes the following steps:
(1) Polling mechanism (Polling): this is a basic node detection method, where the central hop detector polls each node one by one to detect its state. The probe periodically sends probe requests to each node and waits for responses. If no response is received within the specified time, the node is determined to be an abnormal node.
(2) Active Reporting (Active Reporting): each node periodically sends a heartbeat signal to the central node to report the status of its own node. And after the central node receives the heartbeat signal, judging whether the node operates normally or not according to a preset rule.
(3) Passive detection (Passive Monitoring): the central node judges the health condition of the nodes by monitoring the communication flow and interaction condition among the nodes. A node may be considered an abnormal node if it is not active or cannot communicate with other nodes for a long period of time.
(4) Heartbeat timeout (Heartbeat Timeout): each node periodically exchanges heartbeat information with the central node. If the central node does not receive the heartbeat message from a certain node within a specified time, the node is judged to be an abnormal node.
(5) Anomaly detection algorithm (Anomaly Detection): and analyzing and processing the heartbeat signals of the nodes by using an anomaly detection algorithm to find an abnormal heartbeat mode. When the heartbeat pattern is inconsistent with the expected pattern, the node may be in an abnormal state.
The pressure of the traditional method is concentrated on the central node, the pressure of the central node is too high, the state of the node is judged inaccurately or is not processed timely, and meanwhile, the central node occupies too much resources due to the pressure of the heartbeat, so that the service can be possibly influenced. Therefore, the invention provides a node detection method based on node link division, which divides the sequence of detection nodes and detected nodes according to the network quality, forms an annular detection link, and each node only carries out heartbeat detection with one adjacent node, thereby reducing the burden of a central node and balancing the interaction pressure among the nodes. Referring to fig. 1 specifically, fig. 1 is a flowchart of a node detection method according to an embodiment of the present invention. The method may include:
s101: and selecting a central node from a plurality of nodes to be detected.
Specifically, the present embodiment selects a central node from a group of nodes to be detected. The embodiment is not limited to a specific selection rule. For example, the central node may be selected according to the network physical distance rule between the nodes; or the central node can be selected according to the network communication quality rule between the nodes.
S102: and forming a ring node detection link by other nodes to be detected except the central node.
Specifically, the plurality of nodes to be detected in the embodiment are not limited to the nodes in a group, that is, the nodes to be detected in a group form a ring node detection link; or the nodes to be detected in the groups can be divided into a plurality of groups according to network segments, and all the nodes to be detected in the groups form a ring node detection link. And forming a ring node detection link by other nodes except the central node in the group of nodes to be detected, wherein each node in the ring node detection link only needs to pay attention to the states of the adjacent previous node (the predecessor node) and the next node (the successor node). The present embodiment is not limited to the manner in which the nodes form the ring node detection link. For example, the ring node detection link may be determined according to the network quality of the node; or it may also be to determine a ring node detection link based on the network delay value of the node.
S103: and using the ring node detection link to complete node detection.
Specifically, the present embodiment is not limited to a specific node detection content. For example, heartbeat health detection of a node; or may also be node pressure state detection; or may also be idle busy state detection of a node. Taking heartbeat detection as an example, each node in the ring node detection link detects its precursor node according to the detection frequency of the respective node, and when the precursor node receives the heartbeat message sent by the postamble node, sends a response message corresponding to the heartbeat message to the postamble node.
S104: in the detection process, if the abnormal node is detected, the abnormal information is sent to the central node by using the detection node, so that the central node eliminates the abnormal node from the ring node detection link.
Specifically, when the ring detection node link is utilized to detect the node, if the detection node detects that the precursor node is abnormal, abnormal information of the precursor node is sent to the central node, and the central node eliminates the abnormal node from the ring detection link. The present embodiment is not limited to the abnormality detection method. For example, heartbeat information sent by the subsequent node may not be received; or the abnormal times reach the preset times.
S105: when the abnormal node rejection is completed, a new ring node detection link detection node state is reconstructed when the abnormal node rejection is completed.
Specifically, when the abnormal node rejection is completed, one node is less in the ring detection link, and then the ring detection link is interrupted, so that a new ring node detection link needs to be rebuilt and constructed. The present embodiment is not limited to a specific construction method. For example, the detection relationship may be redetermined by all nodes; or other nodes can detect that the relation is unchanged, and the subsequent node of the abnormal node only needs to point to the predecessor node of the abnormal node.
By applying the node detection method provided by the embodiment of the application, the center node is selected from a plurality of nodes to be detected; forming a ring node detection link by other nodes to be detected except the center node; node detection is completed by using a ring node detection link; when the abnormal node is detected, the abnormal information is sent to the central node by using the detection node, so that the central node eliminates the abnormal node from the annular node detection link; and when the abnormal node elimination is completed, reconstructing a new ring node detection link detection node state. Compared with other traditional heartbeat detection methods requiring whole network broadcasting among nodes, the method has the advantages that the concerned range of the nodes is smaller, and the network communication overhead is reduced; when one node is abnormal, the detected node (the successor node of the abnormal node) of the detected node immediately informs the central node, and the abnormal node is quickly removed from the detection ring by the central node, so that a new annular node detection link is formed for node detection. Therefore, abnormal nodes can be rapidly positioned, the stability and the reliability of the system are improved, and the method is more suitable for constructing a distributed system or network with high performance and high availability requirements; compared with the simple ring topology structure detection contrast, the method increases the central node detection, particularly in the aspect of balancing the load of the whole detection system, can improve the monitoring capability, reliability and usability of the system, and is suitable for the health detection of a large-scale distributed system.
On the basis of the above embodiment, the present embodiment further describes and optimizes a technical solution, and specifically, for selecting a center node from nodes to be detected, the method may include the following steps:
step 21: and respectively calculating network delay values between each node to be detected and other nodes to be detected, and respectively obtaining network delay sets corresponding to each node to be detected.
Step 22: accumulating the network delay values in the network delay sets corresponding to the nodes to be detected respectively to obtain the total network delay values corresponding to the nodes to be detected respectively;
step 23: and taking the node to be detected corresponding to the minimum network delay total value as a central node.
Specifically, taking a node as an example, the current node sends Ping commands to other nodes (whether the network is connected or not can be checked by using the Ping commands) to obtain network delay values of the current node and the other nodes, and the network delay values of the current node and the other nodes are accumulated to obtain a total network delay value of the current node. The method is used for respectively obtaining the network delay value sets of each node and other nodes and the network delay total value of each node. And taking the node with the minimum network delay total value as a central node according to the network delay total value.
Therefore, in this embodiment, the central node is determined by using the total network delay value, so that the highest quality of the central node is ensured, the durability of detection is ensured, and the detection efficiency of the central node and each node is improved.
On the basis of the above embodiment, the technical solution is further described and optimized in this embodiment, and specifically, for forming a ring node detection link from other nodes to be detected except for the center node, the method may include the following steps:
step 311: randomly selecting one node to be detected from other nodes to be detected as a first node;
step 312: the network delay sets corresponding to other nodes to be detected except the center node form a two-dimensional matrix;
step 313: determining a detection relation between nodes in the ring node detection link according to the two-dimensional matrix and the first node;
or alternatively, the first and second heat exchangers may be,
step 321: forming a complete graph according to network delay sets corresponding to other nodes to be detected except the central node;
step 322: selecting a minimum spanning tree from the complete graph by using a minimum spanning tree algorithm;
step 323: the minimum spanning tree is converted into a ring node detection link.
Specifically, steps 311 to 313 use a backtracking algorithm to determine the ring node detection link, and for better understanding of steps 311 to 313, examples are as follows: the group of nodes comprises 11 detection nodes, the node 11 is selected as a central node according to the total network delay value, and network delay values corresponding to the other 10 nodes to be detected form a two-dimensional matrix, wherein the abscissa of the two-dimensional matrix is from node 1 to node 10, and the ordinate is from node 1 to node 10. (1) First, one node is randomly selected from the nodes 1 to 10 as the first node, and is marked as accessed. (2) A node which has the smallest delay value with the first node and is not accessed is determined to be selected as the next node from the two-dimensional matrix. (3) The next node is added to the loop and marked as accessed. (4) And repeating the step 2 and the step 3 until the number of the nodes in the loop reaches 10. (5) Finally, the delay value between the last node and the starting node is also taken into account and ensures that a closed loop is formed.
Specifically, steps 321 to 323 utilize a heuristic algorithm to determine a ring node detection link, and the specific steps include: (1) A complete graph is constructed based on the delay values between nodes. (2) A minimum spanning tree algorithm, such as Prim algorithm or Kruskal algorithm, is used to select from the graph to form a minimum spanning tree. (3) converting the minimum spanning tree into a torus link. Starting from any one node, the minimum spanning tree is traversed using a depth-first search or a breadth-first search, and ensuring that each node is accessed only once. And adding the traversed nodes into the annular link in turn in the traversal process. (4) If the number of ring link nodes formed is less than 10, this indicates that the heuristic fails to find a complete loop solution. At this time, other heuristic strategies, such as insertion, exchange or local search, can be introduced to optimize, so as to attempt to expand the number of ring link nodes; or directly connecting the rest nodes into the ring randomly to form a ring. (5) If the number of loop nodes formed is equal to 10, a better result is obtained.
It can be seen that, in this embodiment, the detection of each node in the ring node detection link is made more efficient by determining the ring node detection link by using a heuristic algorithm or a backtracking algorithm.
On the basis of the above embodiment, the technical solution is further described and optimized in this embodiment, and specifically, for completing node detection by using a ring node detection link, the method may include the following steps:
each node in the ring node detection link is utilized to send heartbeat messages to the precursor node according to the preset period set by each node, and response messages sent by the precursor node according to the heartbeat messages are received;
and each node in the ring node detection link is utilized to receive the heartbeat message sent by the subsequent node, and a response message according to the heartbeat message is sent to the subsequent node.
Specifically, the specific heartbeat message content in this embodiment is set according to the user requirement. For example, it may be a simple communication message; or may also be a different interface call request. In the detection process of completing node detection by using the ring node detection link, each node sends heartbeat messages to the predecessor node according to the detection period of the respective node and receives the heartbeat messages sent by the successor node.
Therefore, in this embodiment, each node in the ring node detection link is used to send a heartbeat message to the precursor node, and receive a response message sent by the precursor node according to the heartbeat message, so that the state detection of the precursor node is implemented, and the detection is more efficient.
On the basis of the above embodiment, the present embodiment further describes and optimizes a technical solution, and specifically, for using the detected abnormal node, the method may include the following steps:
step 511: when the heartbeat message sent by the subsequent node is not received by the node within the preset time, the subsequent node is abnormal;
step 512: when the existence node does not timely receive the response message sent by the precursor node according to the heartbeat message, the precursor node is abnormal;
or alternatively, the first and second heat exchangers may be,
step 521: if the heartbeat message sent by the subsequent node is not received by the node within the preset time, adding 1 to the abnormal times of the subsequent node and recording;
step 522: when the abnormal times of the subsequent nodes reach a first preset threshold value or the abnormal times of the subsequent nodes continuously reach a second preset threshold value, the subsequent nodes are abnormal;
step 523: when the existence node does not timely receive the response message sent by the precursor node according to the heartbeat message, adding 1 to the abnormal times of the precursor node and recording;
step 524: when the abnormal times of the precursor nodes reach a third preset threshold value or the abnormal times of the precursor nodes continuously reach a fourth preset threshold value, the precursor nodes are abnormal.
Specifically, in this embodiment, specific values of the first preset threshold, the second preset threshold, the third preset threshold and the fourth preset threshold are not limited, and may be dynamically adjusted according to the actual environment of the node. Step 511 to step 512, judging whether the heartbeat message sent by the subsequent node is received within a preset time according to the subsequent node abnormality detection; the basis for detecting and judging the abnormality of the precursor node is that the precursor node does not send a response message in time. The abnormality detection determination in steps 531 to 524 is based on steps 511 to 512, and the determination of the number of abnormalities and the determination of the number of consecutive abnormalities are added, and the abnormality determination is not made as an abnormality directly once.
It can be seen that, in this embodiment, the abnormal state can be accurately determined according to the basis of the abnormality detection determination.
On the basis of the above embodiment, the technical solution is further described and optimized in this embodiment, and specifically, for the precursor node abnormality, the subsequent node abnormality may include the following steps:
when the precursor node is abnormal, the precursor node is in an offline state, and whether the precursor node fails or not is judged according to the response message;
and when the subsequent node is abnormal, the subsequent node is in an offline state, and whether the subsequent node fails or not is judged according to the response message.
Specifically, when the node is abnormal, only whether the node is offline can be judged by judging whether the response message is received or whether the heartbeat message is sent, if the node is further judged to be faulty, the response message needs to be analyzed, and whether the abnormality is faulty is determined.
Therefore, in this embodiment, by further judging whether the node is abnormal according to the response message, the fault node can be reported in time; or the method can also be used for coping with abnormal conditions by means of active switching, fault recovery or alarm notification and the like, so that the self-adaptive capacity of the system is improved.
On the basis of the above embodiment, the present embodiment further describes and optimizes the technical solution, specifically, when abnormal node rejection is completed, reconstructing a new ring node detection link detection node state, which may include the following steps:
and directing the subsequent nodes of the abnormal node to the precursor nodes of the abnormal node to form a new ring node detection link detection node state.
Specifically, in order to reduce the influence on the original ring node detection link as much as possible, after the abnormal node is removed from the ring node detection link, the rest of node detection relations are unchanged, and a new ring node detection link can be formed rapidly only by executing the precursor node of the abnormal node to the subsequent node of the abnormal node.
It can be seen that, in this embodiment, only local link repartition is needed, and the original ring node detection link structure is not destroyed. Therefore, abnormal nodes can be rapidly positioned and repaired, and the stability and reliability of the system are improved.
On the basis of the above embodiment, the technical solution is further described and optimized in this embodiment, and specifically, the method may further include the following steps:
after forming the ring node detection link by other nodes to be detected except the center node, if the newly added node to be detected exists, determining the insertion position of the newly added node to be detected in the ring node detection link according to the network delay values of the newly added node to be detected and each node in the ring node detection link;
And inserting the newly added node to be detected into the insertion position.
Specifically, after the ring node detection link is formed, the newly added node to be detected calculates the network delay value of each node in the newly added node to be detected and the ring node detection link, takes the adjacent position of the node corresponding to the minimum network delay value as an insertion position, and inserts the newly added node into the position.
It can be seen that, in this embodiment, if a node is newly added, an insertion point is first selected according to the network conditions of the node and the node on the entire detection ring, that is, the node with the best network with the newly added node is selected as the insertion point. By the method, delay can be effectively reduced, and accuracy of node detection is improved.
On the basis of any one of the above embodiments, the technical solution is further described and optimized in this embodiment, and specifically, the method may further include the following steps:
step 61: detecting each node in the annular node detection link sequentially by using the central node according to the preset frequency and the preset sequence;
step 62: when detecting that an abnormal node exists, the ring node detects that all nodes in the link are abnormal.
Specifically, in order to prevent all node networks in the ring node detection link from being failed by the central node, the central node performs network detection on each node in the ring node detection link according to a certain frequency sequence, instead of detecting all nodes each time.
It can be seen that in this embodiment, the central node not only receives the anomaly information, but also is used for detecting the nodes between links, and does not need to detect all the nodes each time. All nodes can be prevented from being detected every time, and efficiency is improved; in addition, the network communication between the central node and other nodes can be kept, and the reliability of the network is improved; and the health state of the whole system can be monitored more comprehensively, and the reliability and fault tolerance of the system are improved.
On the basis of any one of the above embodiments, the node detection method provided in this embodiment may be integrated with other systems or services through a network interface, and provide a node detection result and related alarm information. The method can be applied to the following steps: (1) The large-scale distributed system comprises a cloud computing platform, an Internet of things system, a distributed database, a distributed storage system and the like, can track the health condition of nodes, timely discover fault nodes and perform dynamic adjustment and fault tolerance processing, and ensures high availability and performance optimization of the system; (2) Monitoring and managing node health status in a large-scale computer network, such as a data center, cloud computing environment, and the like. The method can rapidly detect node faults, notify an administrator in real time and take corresponding fault treatment measures, and improve the reliability and stability of the network. (3) The equipment monitoring of the Internet of things is large in equipment quantity and wide in distribution in the environment of the Internet of things. The method can be applied to node detection and health state monitoring of the Internet of things equipment, ensures normal operation of the equipment and reliable transmission of data, and provides timely alarm and maintenance; (4) The method can be used for monitoring network connection quality among nodes, evaluating indexes such as network delay, bandwidth and the like in real time, optimizing a data transmission path and providing stable cross-region communication service in a cross-region or distributed network; (5) The method can be used for detecting the health states of the base station and the equipment, monitoring parameters such as signal strength, transmission rate and the like, and providing efficient and reliable mobile communication service for connection management between the mobile communication base station and the mobile equipment; (6) BMC (Baseboard Management Controller) federal functionality, BMC federal functionality, refers to the ability to achieve collaborative cooperation and centralized management among multiple BMC devices. The BMC federal function realizes centralized management and monitoring. Through the functions, an administrator can manage hardware resources more conveniently and efficiently, and the reliability and operation and maintenance efficiency of the system are improved. The BMC is a management control chip positioned on a server or a computing device main board and is responsible for monitoring, controlling and managing hardware resources, and functions of remote management, health monitoring, remote control, security management, log recording and analysis and the like are provided.
In order to facilitate understanding of the present invention, examples are as follows:
all nodes S, the central node selects A.
Examples: s= { a, B, C, D, E, F, G }.
Determining a detection relation according to the node division rule:
b detection C, C detection D, D detection E, E detection F, F detection G, and G detection B. Fig. 2 is a schematic diagram of intra-link node detection according to an embodiment of the present invention, and fig. 3 is a schematic diagram of inter-link node detection according to an embodiment of the present invention.
The node detection device provided by the embodiment of the present invention is described below, and the node detection device described below and the node detection method described above may be referred to correspondingly.
Referring to fig. 4 specifically, fig. 4 is a schematic structural diagram of a node detection device according to an embodiment of the present invention, which may include:
the central node selecting module 100 is configured to select a central node from a plurality of nodes to be detected;
a ring node detection link construction module 200, configured to form a ring node detection link from nodes to be detected except the central node;
a node detection module 300, configured to complete node detection by using the ring node detection link;
the first processing module 400 for node abnormality is configured to send, in a detection process, abnormality information to the central node by using a detection node if an abnormal node is detected, so that the central node rejects the abnormal node from the ring node detection link;
And the node abnormality second processing module 500 is configured to reconstruct a new ring node detection link detection node state when the abnormal node rejection is completed.
Based on the above embodiment, the central node selection module 100 may include:
the first calculation unit is used for calculating network delay values between each node to be detected and other nodes to be detected respectively to obtain network delay sets corresponding to the nodes to be detected respectively;
the second calculation unit is used for accumulating the network delay values in the network delay sets corresponding to the nodes to be detected respectively to obtain total network delay values corresponding to the nodes to be detected respectively;
and the central node determining unit is used for taking the node to be detected corresponding to the minimum network delay total value as the central node.
Based on the above embodiment, the node detection module 300 may include:
the first sending and receiving unit is used for sending heartbeat messages to the precursor nodes according to preset periods set by each node in the ring node detection link and receiving response messages sent by the precursor nodes according to the heartbeat messages;
and the second receiving and transmitting unit is used for receiving the heartbeat messages sent by the subsequent nodes by utilizing each node in the ring node detection link and sending response messages according to the heartbeat messages to the subsequent nodes.
Based on the above embodiment, the first processing module 400 for node exception may include:
the first abnormality judging unit is used for judging whether the heartbeat message sent by the subsequent node is received by the node within the preset time or not, if so, the subsequent node is abnormal;
the second abnormality judging unit is used for judging that the precursor node is abnormal when the response message sent by the precursor node according to the heartbeat message is not received in time by the existing node;
or,
the first recording unit is used for adding 1 to the abnormal times of the subsequent nodes and recording when the heartbeat message sent by the subsequent nodes is not received by the existing nodes within the preset time;
the third abnormality judgment unit is used for judging that the subsequent node is abnormal when the abnormal times of the subsequent node reach a first preset threshold value or the abnormal times of the subsequent node continuously reach a second preset threshold value;
the second recording unit is used for adding 1 to the abnormal times of the precursor node and recording when the response message sent by the precursor node according to the heartbeat message is not received by the existing node in time;
and the fourth abnormality judgment unit is used for judging that the precursor node is abnormal when the abnormal times of the precursor node reach a third preset threshold value or the abnormal times of the precursor node continuously reach a fourth preset threshold value.
Based on the above embodiment, the second processing module 500 for node exception may include:
and the processing unit is used for pointing the subsequent node of the abnormal node to the precursor node of the abnormal node to form the new ring node detection link detection node state.
Based on the above embodiment, the node detection module may further include:
the newly added node insertion position determining module is used for determining the insertion position of the newly added node to be detected in the annular node detection link according to the network delay value of the newly added node to be detected and each node in the annular node detection link if the newly added node to be detected exists after the annular node detection link is formed by the other nodes to be detected except the central node;
and the newly added node inserting module is used for inserting the newly added node to be detected into the inserting position.
Based on any one of the foregoing embodiments, the node detection apparatus may further include:
the node center detection module is used for sequentially detecting each node in the annular node detection link by utilizing the center node according to a preset frequency and a preset sequence;
and the node center detection result module is used for detecting that all nodes in the link are abnormal when detecting that the abnormal node exists.
The node detection device provided by the embodiment of the application is used for selecting the center node from a plurality of nodes to be detected through the center node selection module 100; the ring node detection link construction module 200 is configured to form a ring node detection link from other nodes to be detected except the center node; the node detection module 300 is configured to complete node detection by using a ring node detection link; the first processing module 400 for node abnormality is configured to send, in a detection process, abnormality information to a central node by using a detection node if an abnormal node is detected, so that the central node rejects the abnormal node from a ring node detection link; the node anomaly second processing module 500 is configured to reconstruct a new ring node detection link detection node state when the anomaly node rejection is completed. In the application, each node only needs to pay attention to the states of the adjacent predecessor nodes and successor nodes, and compared with the heartbeat detection method of the whole network broadcasting among other nodes, the node attention range is smaller, and the network communication overhead is reduced; when one node is abnormal, the node (the successor node of the abnormal node) detecting the node immediately informs the central node, and the central node is utilized to quickly reject the abnormal node from the detection ring, so that a new ring node detection link is formed. Therefore, abnormal nodes can be rapidly positioned, the stability and the reliability of the system are improved, and the method is more suitable for constructing a distributed system or network with high performance and high availability requirements.
The following describes a node detection apparatus provided in an embodiment of the present invention, where the node detection apparatus described below and the node detection method described above may be referred to correspondingly.
Referring to fig. 5, fig. 5 is a schematic structural diagram of a node detection device according to an embodiment of the present invention, which may include:
a memory 10 for storing a computer program;
a processor 20 for executing a computer program to implement the above-described node detection method.
The memory 10, the processor 20, and the communication interface 31 all communicate with each other via a communication bus 32.
In the embodiment of the present invention, the memory 10 is used for storing one or more programs, the programs may include program codes, the program codes include computer operation instructions, and in the embodiment of the present invention, the memory 10 may store programs for implementing the following functions:
selecting a central node from a plurality of nodes to be detected;
forming a ring node detection link by other nodes to be detected except the center node;
node detection is completed by using a ring node detection link;
in the detection process, if the abnormal node is detected, the abnormal information is sent to the central node by using the detection node, so that the central node eliminates the abnormal node from the annular node detection link;
And when the abnormal node elimination is completed, reconstructing a new ring node detection link detection node state.
In one possible implementation, the memory 10 may include a storage program area and a storage data area, wherein the storage program area may store an operating system, and at least one application program required for functions, etc.; the storage data area may store data created during use.
In addition, memory 10 may include read only memory and random access memory and provide instructions and data to the processor. A portion of the memory may also include NVRAM. The memory stores an operating system and operating instructions, executable modules or data structures, or a subset thereof, or an extended set thereof, where the operating instructions may include various operating instructions for performing various operations. The operating system may include various system programs for implementing various basic tasks as well as handling hardware-based tasks.
The processor 20 may be a central processing unit (Central Processing Unit, CPU), an asic, a dsp, a fpga or other programmable logic device, and the processor 20 may be a microprocessor or any conventional processor. The processor 20 may call a program stored in the memory 10.
The communication interface 31 may be an interface of a communication module for connecting with other devices or systems.
Of course, it should be noted that the structure shown in fig. 5 does not limit the node detection apparatus according to the embodiment of the present invention, and the node detection apparatus may include more or fewer components than those shown in fig. 5 or may combine some components in practical applications.
The following describes a readable storage medium provided in an embodiment of the present invention, and the readable storage medium described below and the node detection method described above may be referred to correspondingly.
The invention also provides a readable storage medium, on which a computer program is stored, which when being executed by a processor implements the steps of the node detection method described above.
The readable storage medium may include: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (Random Access Memory, RAM), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
In this specification, each embodiment is described in a progressive manner, and each embodiment is mainly described in a different point from other embodiments, so that the same or similar parts between the embodiments are referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant points refer to the description of the method section.
Those of skill would further appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, computer software, or combinations of both, and that the various illustrative elements and steps are described above generally in terms of functionality in order to clearly illustrate the interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
Finally, it is further noted that, in this document, relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus.
The foregoing has described in detail the methods, apparatus, devices and readable storage medium for node detection provided by the present invention, and specific examples have been applied to illustrate the principles and embodiments of the present invention, and the above examples are only used to help understand the methods and core ideas of the present invention; meanwhile, as those skilled in the art will have variations in the specific embodiments and application scope in accordance with the ideas of the present invention, the present description should not be construed as limiting the present invention in view of the above.
Claims (10)
1. A method of detecting a node, comprising:
selecting a central node from a plurality of nodes to be detected;
forming a ring node detection link by other nodes to be detected except the center node;
completing node detection by using the ring node detection link;
in the detection process, if an abnormal node is detected, the abnormal information is sent to the central node by using the detection node, so that the central node rejects the abnormal node from the ring node detection link;
and when the abnormal node elimination is completed, reconstructing a new ring node detection link detection node state.
2. The node detection method according to claim 1, wherein the selecting a center node from the nodes to be detected includes:
respectively calculating network delay values between each node to be detected and other nodes to be detected, and respectively obtaining network delay sets corresponding to each node to be detected;
accumulating the network delay values in the network delay sets corresponding to the nodes to be detected respectively to obtain the total network delay values corresponding to the nodes to be detected respectively;
and taking the node to be detected corresponding to the minimum network delay total value as the center node.
3. The node detection method according to claim 1, wherein the performing node detection using the ring node detection link includes:
each node in the ring node detection link is utilized to send heartbeat messages to the precursor node according to the preset period set by each node, and response messages sent by the precursor node according to the heartbeat messages are received;
and each node in the ring node detection link is utilized to receive the heartbeat message sent by the subsequent node, and a response message according to the heartbeat message is sent to the subsequent node.
4. The node detection method according to claim 1, wherein the detecting of the abnormal node includes:
when the heartbeat message sent by the subsequent node is not received by the node within the preset time, the subsequent node is abnormal;
when the existence node does not timely receive a response message sent by the precursor node according to the heartbeat message, the precursor node is abnormal;
or,
when the heartbeat message sent by the subsequent node is not received by the node in the preset time, adding 1 to the abnormal times of the subsequent node and recording;
when the abnormal times of the subsequent nodes reach a first preset threshold value or the abnormal times of the subsequent nodes continuously reach a second preset threshold value, the subsequent nodes are abnormal;
when the existence node does not timely receive the response message sent by the precursor node according to the heartbeat message, adding 1 to the abnormal times of the precursor node and recording;
when the abnormal times of the precursor nodes reach a third preset threshold value or the abnormal times of the precursor nodes continuously reach a fourth preset threshold value, the precursor nodes are abnormal.
5. The node detection method according to claim 1, wherein the reconfiguring the new ring node detection link detection node state comprises:
And directing the subsequent node of the abnormal node to the precursor node of the abnormal node to form the new ring node detection link detection node state.
6. The node detection method according to claim 1, further comprising, after the forming of the ring node detection link by the nodes to be detected other than the center node:
if the newly added node to be detected exists, determining the insertion position of the newly added node to be detected in the annular node detection link according to the network delay values of the newly added node to be detected and each node in the annular node detection link;
and inserting the newly added node to be detected into the insertion position.
7. The node detection method according to any one of claims 1 to 6, characterized by further comprising:
sequentially detecting each node in the annular node detection link by using the central node according to a preset frequency and a preset sequence;
when detecting that an abnormal node exists, the ring node detects that all nodes in the link are abnormal.
8. A node detecting apparatus, comprising:
the center node selecting module is used for selecting a center node from a plurality of nodes to be detected;
The ring node detection link construction module is used for forming ring node detection links from other nodes to be detected except the center node;
the node detection module is used for completing node detection by utilizing the annular node detection link;
the node abnormality first processing module is used for sending abnormality information to the center node by using the detection node when an abnormal node is detected in the detection process, so that the center node eliminates the abnormal node from the annular node detection link;
and the node abnormality second processing module is used for reconstructing a new ring node detection link detection node state when the abnormal node is removed.
9. A node detecting apparatus, characterized by comprising:
a memory for storing a computer program;
processor for implementing the steps of the node detection method according to any of claims 1 to 7 when executing said computer program.
10. A readable storage medium, characterized in that the readable storage medium has stored thereon a computer program which, when executed by a processor, implements the steps of the node detection method according to any of claims 1 to 7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202311255493.9A CN117176626A (en) | 2023-09-26 | 2023-09-26 | Node detection method, device, equipment and readable storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202311255493.9A CN117176626A (en) | 2023-09-26 | 2023-09-26 | Node detection method, device, equipment and readable storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN117176626A true CN117176626A (en) | 2023-12-05 |
Family
ID=88943055
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202311255493.9A Pending CN117176626A (en) | 2023-09-26 | 2023-09-26 | Node detection method, device, equipment and readable storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN117176626A (en) |
-
2023
- 2023-09-26 CN CN202311255493.9A patent/CN117176626A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US7734960B2 (en) | Method of managing nodes in computer cluster | |
US7165192B1 (en) | Fault isolation in large networks | |
CN106656682B (en) | Cluster heartbeat detecting method, system and device | |
CN112769605B (en) | Heterogeneous multi-cloud operation and maintenance management method and hybrid cloud platform | |
US20130173965A1 (en) | Fault tracing system and method for remote maintenance | |
CN109688604B (en) | Bayesian network-based high-dynamic mobile ad hoc network survivability evaluation method | |
CN109039795A (en) | A kind of Cloud Server resource monitoring method and system | |
US11902362B2 (en) | Topology-aware load balancing method and apparatus, and computer device | |
CN107426051B (en) | The monitoring method of the working condition of distributed cluster system interior joint, apparatus and system | |
EP2119113A1 (en) | System, method, and network node for checking the consistency of node relationship information in the nodes of a strongly connected network | |
CN113300914A (en) | Network quality monitoring method, device, system, electronic equipment and storage medium | |
CN117176626A (en) | Node detection method, device, equipment and readable storage medium | |
CN116095180B (en) | Log return routing method, device and storage medium | |
CN105991305B (en) | A kind of method and device identifying link exception | |
CN117478582A (en) | Oil field production equipment state monitoring and optimizing method based on intelligent link management system | |
CN115150253B (en) | Fault root cause determining method and device and electronic equipment | |
US11153769B2 (en) | Network fault discovery | |
CN113391611A (en) | Early warning method, device and system for dynamic environment monitoring system | |
CN111988172B (en) | Network information management platform, device and security management method | |
CN114866606A (en) | Micro-service management system | |
CN112637000A (en) | Monitoring method of Internet of things equipment, server and Internet of things equipment | |
TW201409968A (en) | Information and communication service quality estimation and real-time alarming system and method | |
KR20040028400A (en) | Fault management system of metro ethernet network and method thereof | |
Scheit | Self-Healing in Self-Organizing Networks | |
CN114024835B (en) | Abnormality positioning method and device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |