A distributed heartbeat detection method and system
By employing the Gossip algorithm for node status monitoring and synchronization in a distributed system, combined with adaptive algorithms and encryption technology, the problems of high network overhead, high latency, and insufficient fault tolerance in traditional heartbeat detection methods are solved. This achieves more efficient and reliable heartbeat detection, applicable to various distributed systems, and improves system performance and user experience.
Patent Information
- Application Number
- CN202410986906.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-23
- Publication Date
- 2026-01-13
- Estimated Expiration
- 2044-07-23
AI Technical Summary
Traditional heartbeat detection methods suffer from high network overhead, high latency, and insufficient fault tolerance in distributed systems. They are difficult to effectively reduce communication overhead and latency, and they struggle to handle the challenges of frequent node changes and fault handling in large-scale systems.
The Gossip algorithm is used to dynamically monitor and synchronize node status. Combined with an adaptive algorithm, the information exchange frequency and strategy are dynamically adjusted according to network load and node load. It supports multiple network environments, uses encryption and authentication technologies to ensure the security of information transmission, and provides flexible configuration options to adapt to different application scenarios and system requirements.
It reduces communication overhead and latency, improves system reliability and stability, is suitable for distributed systems of all sizes, including cloud computing platforms and IoT device networks, reduces system maintenance costs, and enhances system performance and user experience.
Smart Images

Figure CN118784536B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of distributed systems and heartbeat detection technology, specifically a distributed heartbeat detection method and system. Background Technology
[0002] In distributed systems, heartbeat detection is a commonly used method for monitoring health status. Traditional heartbeat detection methods typically detect the reachability and health status of nodes by periodically sending heartbeat messages to ensure the normal operation of the system. However, traditional methods suffer from high communication overhead and high latency, especially in large-scale distributed systems where these problems are more pronounced.
[0003] In general, traditional heartbeat detection methods suffer from problems such as high network overhead, high latency, and insufficient fault tolerance. Due to the frequent and unordered nature of inter-node communication, traditional methods often fail to effectively reduce communication overhead and latency, and also struggle to handle the challenges of frequent node changes and fault handling in large-scale systems. Summary of the Invention
[0004] The technical objective of this invention is to address the above-mentioned shortcomings by providing a distributed heartbeat detection method and system, which can effectively detect and process the health status of nodes in a distributed system, thereby improving the reliability and stability of the system.
[0005] The technical solution adopted by this invention to solve its technical problem is:
[0006] A distributed heartbeat detection method is proposed. In a distributed system, the Gossip algorithm is used to dynamically monitor and synchronize the node status, including periodic information exchange and propagation, to ensure the consistency of the node status in the system. The method can intelligently adjust according to changes in the node status to improve the stability and reliability of the system.
[0007] The Gossip algorithm is optimized for large-scale systems to improve information propagation efficiency and node response speed. Combined with an adaptive algorithm, it dynamically adjusts the frequency and strategy of information exchange based on network load and node load. It supports applications in various network environments, including local area networks and cloud computing environments.
[0008] The Gossip algorithm's heartbeat detection mechanism uses encryption and authentication technologies to ensure the security and reliability of information transmission, enabling rapid identification and handling of abnormal states, including node failures and network partitions; and provides flexible configuration options to adapt to different application scenarios and system requirements.
[0009] The implementation of this method includes:
[0010] Node registration and information dissemination;
[0011] Heartbeat detection and status update between nodes;
[0012] Inter-node state synchronization and consistency maintenance;
[0013] Anomaly detection and self-healing mechanisms between nodes.
[0014] This heartbeat detection mechanism is applicable to various distributed systems, including but not limited to cloud computing platforms, IoT device networks, and large-scale clusters. Addressing the problems of high network overhead, high latency, and insufficient fault tolerance in traditional heartbeat detection methods, this method implements a more efficient and reliable heartbeat detection mechanism in distributed systems. Based on the Gossip algorithm, this mechanism aims to reduce system communication costs, decrease heartbeat detection latency, and improve system reliability and stability, thereby promoting better operation and management of distributed systems. This approach brings innovation to the field of distributed systems, solves the challenges faced by existing technologies, and improves system performance and user experience.
[0015] Furthermore, the node registration and information propagation:
[0016] When a new node joins the distributed system, it sends a registration request to known nodes and obtains the system's topology information. After receiving the registration request, the known nodes broadcast the new node's information to other nodes through the Gossip algorithm, including the node's identifier, address, and status information.
[0017] This step ensures that all nodes in the system can promptly detect the addition of new nodes and achieves global synchronization of node information. This algorithm uses a round-robin approach to select detection targets, rather than the random selection method used in Goosip. This traditional random selection method has a high probability of consuming a significant amount of time to detect a specific node, which is inherent to random algorithms. Maintaining a list of nodes to be detected and iteratively detecting them, updating this list as nodes are added, guarantees that all nodes are detected within a stable time period.
[0018] Furthermore, the heartbeat detection and state update between nodes:
[0019] Each node periodically sends heartbeat messages to other nodes to check their liveness status; the node that receives the heartbeat message updates the status information of the sending node and maintains the stability of the node's state.
[0020] The frequency and timeout of heartbeat detection can be flexibly adjusted according to actual conditions to balance system response speed and network overhead.
[0021] Furthermore, the inter-node state synchronization and consistency maintenance include:
[0022] The distributed information propagation mechanism of the Gossip algorithm ensures the consistency of state information of each node in the system. When the state of a node changes, it is propagated through heartbeat detection messages and Gossip information to update the state information of other nodes in a timely manner, so as to maintain the overall consistency of the system.
[0023] Furthermore, the inter-node anomaly detection and self-healing mechanism,
[0024] When a node fails to receive heartbeat messages from other nodes multiple times consecutively, it is marked as an abnormal node, triggering a self-healing mechanism. This mechanism selectively performs node failure recovery, data redistribution, or state switching operations based on the actual situation to ensure continuous system availability and stability. Before asserting that a node is "failed," it is only suspected that the node has failed. The goal is to minimize false alarms, as even spending more time detecting failed nodes is better than incorrectly marking a healthy node as "failed." The specific working method is as follows:
[0025] When node N1 fails to receive an ACK message from node N2 via either direct ping or indirect ping-req, it doesn't immediately determine that N2 is "down," but rather suspects that N2 is "down" and propagates this suspicion. The suspected node is still treated as a non-faulty node and continues to receive ping messages like other nodes. If a node receives an ACK message from N2, it will be marked as an active node again, and this "good news" will be propagated. N2 itself will also receive the message that it is suspected of being "down" and declare this suspicion to other nodes in the cluster as incorrect. If no message is received from N2 after a predefined timeout, then it can be concluded that this node is "down," and this "bad news" will be propagated.
[0026] Each node in the cluster maintains a member list containing nodes that the current node considers 'active'. Node N1 periodically selects a node N2 from the member list and sends a heartbeat packet. If it receives an ACK from N2 within the timeout period, node N1 considers node N2 to be 'active'. Otherwise, node N1 suspects a possible malfunction in node N2 and checks node N2's status using a third node in the member list, N3. Node N3 sends a heartbeat packet to node N2. If node N2 returns an ACK within a specified time, node N2 is considered 'active'. Otherwise, node N2 is confirmed to be malfunctioning and will be removed from the cluster.
[0027] This method prevents false alarms. For example, N1 might not receive a response from N2 for some reason (perhaps due to network congestion between them), even though N2 is still alive and accessible to N4. If a node cannot be accessed by any of these k nodes, it can be marked as "down".
[0028] Furthermore, the implementation of this method also includes parameter configuration and optimization functions, allowing users to set and tune parameters according to system scale, network environment, and performance requirements. This includes adjusting the frequency of heartbeat detection, the propagation strategy of the Gossip algorithm, and the execution rules of the self-healing mechanism to achieve optimal system performance and resource utilization efficiency.
[0029] Furthermore, the implementation of this method also includes:
[0030] Multi-level heartbeat detection and fault tolerance: Based on the importance and status of nodes, different levels of heartbeat detection frequency and fault tolerance strategies can be set; for example, for critical nodes or high-load nodes, more frequent heartbeat detection frequency and stricter fault tolerance rules can be set to ensure the stability and reliability of the system.
[0031] Dynamic load balancing and adaptive adjustment automatically adjust resource allocation and task scheduling based on system load and node status changes to optimize overall system performance and resource utilization efficiency. This adaptive adjustment mechanism effectively addresses system load fluctuations and node anomalies, improving system adaptability and reliability.
[0032] This invention also claims a distributed heartbeat detection system, comprising:
[0033] The node registration and information propagation module is used to enable new nodes to send registration requests to known nodes and obtain the system's topology information when they join the distributed system. After receiving the registration request, the known nodes broadcast the new node's information to other nodes through the Gossip algorithm, including the node's identifier, address, and status information.
[0034] The node heartbeat detection and status update module is used to enable each node to periodically send heartbeat messages to other nodes to detect the other party's liveness status; the node that receives the heartbeat message updates the status information of the sending node and maintains the stability of the node status.
[0035] The inter-node state synchronization and consistency maintenance module ensures the consistency of state information of each node in the system through the distributed information propagation mechanism of the Gossip algorithm;
[0036] The node anomaly detection and self-healing module is used to mark a node as an abnormal node and trigger the self-healing mechanism when a node fails to receive heartbeat messages from other nodes multiple times in a row. The self-healing mechanism selectively performs node fault recovery, data redistribution, or state switching operations according to the actual situation.
[0037] The present invention also claims a distributed heartbeat detection device, comprising: at least one memory and at least one processor;
[0038] The at least one memory is used to store a machine-readable program;
[0039] The at least one processor is used to call the machine-readable program to implement the above method.
[0040] The present invention also claims protection for a computer-readable medium storing computer instructions that, when executed by a processor, cause the processor to perform the method described above.
[0041] Compared with the prior art, the distributed heartbeat detection method and system of the present invention have the following advantages:
[0042] 1. Reduced Communication Overhead: This invention employs a heartbeat detection mechanism based on the Gossip algorithm. Through randomized information propagation, it effectively reduces the communication overhead required for heartbeat detection in distributed systems. Compared to traditional methods, this saves a significant amount of network bandwidth resources.
[0043] 2. Reduced Latency: The heartbeat detection mechanism based on the Gossip algorithm features fast convergence and distributed information propagation, effectively reducing the latency of heartbeat detection. This is especially important for distributed systems that require real-time response and efficient interaction.
[0044] 3. Improved fault tolerance: Due to the adoption of the Gossip algorithm, this heartbeat detection mechanism has a certain degree of fault tolerance. Even if some nodes fail or the network partitions, the system can still maintain a good operating state, improving the system's stability and reliability.
[0045] 4. Wide Applicability: The heartbeat detection mechanism designed in this invention is applicable to distributed systems of various sizes, including cloud computing platforms, big data processing systems, containerized environments, and other fields. Its flexibility and scalability make this technology highly adaptable to different application scenarios.
[0046] 5. Reduced Maintenance Costs: Since heartbeat detection is a fundamental function in distributed systems, the efficient heartbeat detection mechanism of this invention can reduce system maintenance costs. It reduces reliance on network resources and maintenance personnel, and improves the system's automated management capabilities.
[0047] 6. Promoting the Development of Distributed Systems: This invention provides an innovative heartbeat detection technology that promotes the development and application of distributed systems by reducing communication overhead, decreasing latency, and improving fault tolerance. It is of great significance for building high-performance, highly reliable distributed computing environments. Attached Figure Description
[0048] Figure 1 This is an illustration of the distributed heartbeat detection method provided in this embodiment of the invention;
[0049] Figure 2 This is a schematic diagram illustrating the fault detection during node health checks provided in an embodiment of the present invention;
[0050] Figure 3 This is a schematic diagram illustrating a node experiencing a false health check report, provided in an embodiment of the present invention.
[0051] Figure 4 This is an example page illustration of an application instance of the distributed heartbeat detection method provided in this embodiment of the invention. Detailed Implementation
[0052] The present invention will be further described below with reference to the accompanying drawings and specific embodiments.
[0053] This invention provides a distributed heartbeat detection method. In a distributed system, the Gossip algorithm is used to dynamically monitor and synchronize the node status, including periodic information exchange and propagation, to ensure the consistency of node status in the system. The method can intelligently adjust according to changes in node status, thereby improving the stability and reliability of the system.
[0054] The Gossip algorithm is optimized for large-scale systems to improve information propagation efficiency and node response speed; combined with an adaptive algorithm, it dynamically adjusts the frequency and strategy of information exchange based on network load and node load; and it supports applications in various network environments, including local area networks and cloud computing environments.
[0055] The Gossip algorithm's heartbeat detection mechanism uses encryption and authentication technologies to ensure the security and reliability of information transmission, enabling rapid identification and handling of abnormal states, including node failures and network partitions; and provides flexible configuration options to adapt to different application scenarios and system requirements.
[0056] The implementation of this method includes:
[0057] 1. Node registration and information dissemination:
[0058] When a new node joins the distributed system, it sends a registration request to known nodes and obtains the system's topology information. After receiving the registration request, the known nodes broadcast the new node's information to other nodes through the Gossip algorithm, including the node's identifier, address, and status information.
[0059] This step ensures that all nodes in the system can promptly detect the addition of new nodes and achieves global synchronization of node information. This algorithm uses a round-robin approach to select detection targets, rather than the random selection method used in Goosip. This traditional random selection method has a high probability of consuming a significant amount of time to detect a specific node, which is inherent to random algorithms. Maintaining a list of nodes to be detected and iteratively detecting them, updating this list as nodes are added, guarantees that all nodes are detected within a stable time period.
[0060] 2. Heartbeat detection and status update between nodes:
[0061] Each node periodically sends heartbeat messages to other nodes to check their liveness; the node that receives the heartbeat message updates the status information of the sending node and maintains the stability of the node's state.
[0062] The frequency and timeout of heartbeat detection can be flexibly adjusted according to actual conditions to balance system response speed and network overhead.
[0063] 3. State synchronization and consistency maintenance between nodes:
[0064] The Gossip algorithm's distributed information propagation mechanism ensures the consistency of state information across all nodes in the system. When a node's state changes, it propagates the information through heartbeat messages and Gossip messages, promptly updating the state information of other nodes to maintain overall system consistency.
[0065] 4. Anomaly detection and self-healing mechanism between nodes:
[0066] When a node fails to receive heartbeat messages from other nodes multiple times consecutively, it is marked as an abnormal node, triggering a self-healing mechanism. This mechanism selectively performs node failure recovery, data redistribution, or state switching operations based on the actual situation to ensure continuous system availability and stability. Before asserting that a node is "failed," it is only suspected that the node has failed. The goal is to minimize false alarms, as even spending more time detecting failed nodes is better than incorrectly marking a healthy node as "failed." The specific working method is as follows:
[0067] like Figure 2As shown, when node N1 fails to receive an ACK message from node N2 via either direct ping or indirect ping-req, it doesn't immediately determine that N2 is "down," but rather suspects that N2 is "down" and propagates this suspicion. The suspected node is still treated as a non-faulty node and continues to receive ping messages like other nodes. If a node receives an ACK message from N2, it will be marked as an active node again, and this "good news" will be propagated. N2 itself will also receive the message that it is suspected of being "down" and declare to other nodes in the cluster that this suspicion is incorrect. If no message is received from N2 after a predefined timeout, then it can be concluded that this node is "down," and this "bad news" will be propagated.
[0068] Each node in the cluster maintains a member list containing nodes that the current node considers 'active'. Node N1 periodically selects a node N2 from the member list and sends a heartbeat packet. If it receives an ACK from N2 within the timeout period, node N1 considers node N2 to be 'active'. Otherwise, node N1 suspects a possible malfunction in node N2 and checks node N2's status using a third node in the member list, N3. Node N3 sends a heartbeat packet to node N2. If node N2 returns an ACK within a specified time, node N2 is considered 'active'. Otherwise, node N2 is confirmed to be malfunctioning and will be removed from the cluster.
[0069] This method prevents false alarms. For example, if N1 doesn't receive a response from N2 for some reason (perhaps due to network congestion between the two), but N2 is actually still alive and accessible to N4, then... Figure 3 As shown. If a node cannot be accessed by any of these k nodes, it can be marked as "down".
[0070] 5. Parameter configuration and optimization adjustment functions:
[0071] This method offers flexible parameter configuration and optimization capabilities, allowing users to set and tune parameters based on system size, network environment, and performance requirements. For example, adjustments can be made to the heartbeat detection frequency, the Gossip algorithm's propagation strategy, and the self-healing mechanism's execution rules to achieve optimal system performance and resource utilization efficiency.
[0072] 6. Multi-level heartbeat detection and fault tolerance:
[0073] This method introduces a multi-level heartbeat detection mechanism, setting different levels of heartbeat detection frequency and fault tolerance strategies based on the importance and status of nodes. For example, for critical or high-load nodes, more frequent heartbeat detection frequencies and stricter fault tolerance rules can be set to ensure the stability and reliability of the system.
[0074] 7. Dynamic load balancing and adaptive adjustment:
[0075] Based on system load and node status changes, resource allocation and task scheduling are automatically adjusted to optimize overall system performance and resource utilization efficiency. This adaptive adjustment mechanism can effectively cope with system load fluctuations and node anomalies, improving system adaptability and reliability.
[0076] The Gossip algorithm is a distributed information propagation and data synchronization algorithm characterized by randomized communication, fast convergence, and high fault tolerance. In distributed systems, the Gossip algorithm is widely used in scenarios such as data replication, state synchronization, and event propagation, and has achieved good results in practical systems. Heartbeat detection based on the Gossip algorithm has great potential; through randomized information propagation and distributed state synchronization, it can reduce system communication overhead and latency, and improve system fault tolerance and stability. However, a complete heartbeat detection mechanism based on the Gossip algorithm is currently lacking and requires further research and implementation. This method utilizes the Gossip algorithm to design a novel heartbeat detection mechanism to address the problems of traditional methods and improve the performance and reliability of distributed systems. This heartbeat detection mechanism combines the advantages of the Gossip algorithm, featuring lower communication overhead, shorter latency, and better fault tolerance, making it suitable for distributed systems of various sizes and cloud computing environments.
[0077] This heartbeat detection mechanism is applicable to various distributed systems, including but not limited to cloud computing platforms, IoT device networks, and large-scale clusters. Addressing the problems of high network overhead, high latency, and insufficient fault tolerance in traditional heartbeat detection methods, this method implements a more efficient and reliable heartbeat detection mechanism in distributed systems. Based on the Gossip algorithm, this mechanism aims to reduce system communication costs, decrease heartbeat detection latency, and improve system reliability and stability, thereby promoting better operation and management of distributed systems. This approach brings innovation to the field of distributed systems, solves the challenges faced by existing technologies, and improves system performance and user experience.
[0078] This invention also provides a distributed heartbeat detection system, comprising:
[0079] 1. Node registration and information propagation module: When a new node joins the distributed system, it sends a registration request to known nodes and obtains the system's topology information. After receiving the registration request, the known nodes broadcast the new node's information to other nodes through the Gossip algorithm, including the node's identifier, address, and status information.
[0080] This module ensures that all nodes in the system can promptly detect the addition of new nodes and achieves global synchronization of node information. This algorithm uses a round-robin approach to select detection targets, rather than the random selection method used in Goosip. This traditional random selection method has a high probability of consuming a significant amount of time to detect a specific node, which is inherent to the nature of random algorithms. Maintaining a list of nodes to be detected and iteratively detecting them, updating this list as a node is added, guarantees that all nodes are detected within a stable time period.
[0081] 2. The node heartbeat detection and status update module is used to enable each node to periodically send heartbeat messages to other nodes to detect the other party's liveness status; the node that receives the heartbeat message updates the status information of the sending node and maintains the stability of the node status.
[0082] The frequency and timeout of heartbeat detection can be flexibly adjusted according to actual conditions to balance system response speed and network overhead.
[0083] 3. The inter-node state synchronization and consistency maintenance module ensures the consistency of state information across all nodes in the system through the distributed information propagation mechanism of the Gossip algorithm. When the state of a node changes, it propagates the information through heartbeat detection messages and Gossip messages to promptly update the state information of other nodes, thereby maintaining the overall consistency of the system.
[0084] 4. The node anomaly detection and self-healing module is used to mark a node as an anomaly and trigger a self-healing mechanism when it fails to receive heartbeat messages from other nodes multiple times consecutively. The self-healing mechanism selectively performs node fault recovery, data redistribution, or state switching operations based on the actual situation to ensure the continuous availability and stability of the system. Before asserting that a node is "failed," it only indicates a suspected fault in that node. The goal is to minimize false alarms, because even spending more time detecting failed nodes is better than incorrectly marking a normal node as "failed." The specific working method is as follows:
[0085] like Figure 2As shown, when node N1 fails to receive an ACK message from node N2 via either direct ping or indirect ping-req, it doesn't immediately determine that N2 is "down," but rather suspects that N2 is "down" and propagates this suspicion. The suspected node is still treated as a non-faulty node and continues to receive ping messages like other nodes. If a node receives an ACK message from N2, it will be marked as an active node again, and this "good news" will be propagated. N2 itself will also receive the message that it is suspected of being "down" and declare to other nodes in the cluster that this suspicion is incorrect. If no message is received from N2 after a predefined timeout, then it can be concluded that this node is "down," and this "bad news" will be propagated.
[0086] Each node in the cluster maintains a member list containing nodes that the current node considers 'active'. Node N1 periodically selects a node N2 from the member list and sends a heartbeat packet. If it receives an ACK from N2 within the timeout period, node N1 considers node N2 to be 'active'. Otherwise, node N1 suspects a possible malfunction in node N2 and checks node N2's status using a third node in the member list, N3. Node N3 sends a heartbeat packet to node N2. If node N2 returns an ACK within a specified time, node N2 is considered 'active'. Otherwise, node N2 is confirmed to be malfunctioning and will be removed from the cluster.
[0087] This method prevents false alarms. For example, if N1 doesn't receive a response from N2 for some reason (perhaps due to network congestion between the two), but N2 is actually still alive and accessible to N4, then... Figure 3 As shown. If a node cannot be accessed by any of these k nodes, it can be marked as "down".
[0088] 5. Parameter configuration and optimization module: This module provides flexible parameter configuration and optimization capabilities, allowing users to set and tune parameters according to system scale, network environment, and performance requirements. For example, it can include adjusting the heartbeat detection frequency, the Gossip algorithm propagation strategy, and the execution rules of the self-healing mechanism to achieve optimal system performance and resource utilization efficiency.
[0089] 6. A multi-level heartbeat detection and fault tolerance module is used to set different levels of heartbeat detection frequency and fault tolerance strategies based on the importance and status of nodes. For example, for critical nodes or high-load nodes, more frequent heartbeat detection frequencies and stricter fault tolerance rules can be set to ensure the stability and reliability of the system.
[0090] 7. The dynamic load balancing and adaptive adjustment module is used to automatically adjust resource allocation and task scheduling based on system load and node status changes to optimize overall system performance and resource utilization efficiency. This adaptive adjustment mechanism can effectively cope with system load fluctuations and node anomalies, improving system adaptability and reliability.
[0091] The system uses the Gossip algorithm to dynamically monitor and synchronize node states, including periodic information exchange and propagation, to ensure that node states remain consistent. It can also intelligently adjust based on changes in node states, thereby improving the system's stability and reliability.
[0092] Among them, the Gossip algorithm is optimized for large-scale systems to improve information transmission efficiency and node response speed; combined with an adaptive algorithm, it dynamically adjusts the frequency and strategy of information exchange according to network load and node load; it supports applications in various network environments, including LAN and cloud computing environments; the Gossip algorithm's heartbeat detection mechanism uses encryption and authentication technologies to ensure the security and trustworthiness of information transmission, enabling rapid identification and handling of abnormal states, including node failures and network partitions; and it provides flexible configuration options to adapt to different application scenarios and system requirements.
[0093] This system is applicable to various distributed systems, including but not limited to cloud computing platforms, IoT device networks, and large-scale clusters.
[0094] This invention also provides a distributed heartbeat detection device, comprising: at least one memory and at least one processor;
[0095] The at least one memory is used to store a machine-readable program;
[0096] The at least one processor is used to call the machine-readable program to implement the distributed heartbeat detection method described in the above embodiments.
[0097] This invention also provides a computer-readable medium storing computer instructions, which, when executed by a processor, cause the processor to perform the distributed heartbeat detection method described in the above embodiments. Specifically, a system or apparatus equipped with a storage medium storing software program code that implements the functions of any of the above embodiments can be provided, and the computer (or CPU or MPU) of the system or apparatus can read and execute the program code stored in the storage medium.
[0098] In this case, the program code read from the storage medium can itself implement the function of any of the above embodiments, and therefore the program code and the storage medium storing the program code constitute part of the present invention.
[0099] Examples of storage media used to provide program code include floppy disks, hard disks, magneto-optical disks, optical disks (such as CD-ROM, CD-R, CD-RW, DVD-ROM, DVD-RAM, DVD-RW, DVD+RW), magnetic tapes, non-volatile memory cards, and ROMs. Alternatively, program code can be downloaded from a server computer via a communication network.
[0100] Furthermore, it should be clear that not only can the program code read by the computer be executed, but also the operating system or other components operating on the computer can be instructed based on the program code to perform some or all of the actual operations, thereby realizing the function of any of the embodiments described above.
[0101] Furthermore, it is understood that the program code read from the storage medium is written to the memory set in the expansion board inserted into the computer or to the memory set in the expansion unit connected to the computer. Then, based on the instructions of the program code, the CPU or other components installed on the expansion board or expansion unit execute some and all of the actual operations, thereby realizing the function of any of the embodiments described above.
[0102] The present invention has been shown and described in detail above with reference to the accompanying drawings and preferred embodiments. However, the present invention is not limited to these disclosed embodiments. Based on the above embodiments, those skilled in the art will know that more embodiments of the present invention can be obtained by combining the code review methods in the different embodiments. These embodiments are also within the protection scope of the present invention.
Claims
1. A distributed heartbeat detection method, characterized in that, In distributed systems, the Gossip algorithm is used to achieve dynamic monitoring and synchronization of node states, including periodic information exchange and propagation. The Gossip algorithm, combined with an adaptive algorithm, dynamically adjusts the frequency and strategy of information exchange based on network load and node load. It supports applications in various network environments, including LAN and cloud computing environments; The heartbeat detection mechanism of the Gossip algorithm uses encryption and authentication technologies to ensure the security and trustworthiness of information transmission, and to achieve rapid identification and handling of abnormal states. It also provides flexible configuration options to adapt to different application scenarios and system requirements; The implementation of this method includes: Node registration and information propagation: When a new node joins the distributed system, it sends a registration request to known nodes and obtains the system's topology information; after receiving the registration request, the known nodes broadcast the new node's information to other nodes through the Gossip algorithm, including the node's identifier, address, and status information; Heartbeat detection and status update between nodes: Each node periodically sends heartbeat messages to other nodes to detect the other party's liveness status; the node that receives the heartbeat message updates the status information of the sending node and maintains the stability of the node's state; the frequency and timeout of heartbeat detection are flexibly adjusted according to the actual situation to balance the system's response speed and network overhead. Inter-node state synchronization and consistency maintenance: Through the distributed information propagation mechanism of the Gossip algorithm, the state information of each node in the system is kept consistent; when the state of a node changes, the state information of other nodes is updated in a timely manner through heartbeat detection messages and Gossip information to maintain the overall consistency of the system. Inter-node anomaly detection and self-healing mechanism: When a node fails to receive heartbeat messages from other nodes multiple times consecutively, it is marked as an abnormal node, and the self-healing mechanism is triggered. The self-healing mechanism selectively performs node failure recovery, data reallocation, or state switching operations based on the actual situation. The specific working method is as follows: Each node in the cluster maintains a member list containing nodes that the current node considers 'active'. Node N1 periodically selects a node N2 from the member list and sends a heartbeat packet. If it receives an ACK from N2 within the timeout period, node N1 considers node N2 to be 'active'. Otherwise, node N1 suspects a possible malfunction in node N2 and checks node N2's status using a third node in the member list, N3. Node N3 sends a heartbeat packet to node N2. If node N2 returns an ACK within a specified time, node N2 is considered 'active'. Otherwise, node N2 is confirmed to be malfunctioning and will be removed from the cluster.
2. The distributed heartbeat detection method according to claim 1, characterized in that, The implementation of this method also includes parameter configuration and optimization adjustment functions. Users can set and tune parameters according to system scale, network environment and performance requirements, including adjusting the frequency of heartbeat detection, the propagation strategy of the Gossip algorithm and the execution rules of the self-healing mechanism.
3. The distributed heartbeat detection method according to claim 1, characterized in that, The implementation of this method also includes: Multi-level heartbeat detection and fault tolerance: Based on the importance and status of nodes, different levels of heartbeat detection frequency and fault tolerance strategies are set; Dynamic load balancing and adaptive adjustment: Based on system load and node status changes, automatically adjust resource allocation and task scheduling to optimize overall system performance and resource utilization efficiency.
4. A distributed heartbeat detection system, characterized in that, include: The node registration and information propagation module is used to send a registration request to known nodes and obtain the system's topology information when a new node joins the distributed system. Once a node receives a registration request, it broadcasts the new node's information to other nodes using the Gossip algorithm, including the node's identifier, address, and status information. The inter-node heartbeat detection and status update module is used to enable each node to periodically send heartbeat messages to other nodes to detect the other party's liveness status. The node that receives the heartbeat message updates the status information of the sending node and maintains the stability of the node's state; The inter-node state synchronization and consistency maintenance module ensures the consistency of state information of each node in the system through the distributed information propagation mechanism of the Gossip algorithm. When the state of a node changes, it promptly updates the state information of other nodes through heartbeat detection messages and Gossip information to maintain the overall consistency of the system. The node anomaly detection and self-healing module is used to mark a node as an anomaly and trigger a self-healing mechanism when it fails to receive heartbeat messages from other nodes multiple times consecutively. The self-healing mechanism selectively performs node fault recovery, data reallocation, or state switching operations based on the actual situation. The specific operation is as follows: Each node in the cluster maintains a member list containing nodes that the current node considers 'active'. Node N1 periodically selects a node N2 from the member list and sends a heartbeat packet. If it receives an ACK from N2 within a timeout period, node N1 considers node N2 to be 'active'. Otherwise, node N1 suspects a possible malfunction in node N2 and checks node N2's status using a third node in the member list, N3. Node N3 sends a heartbeat packet to node N2. If node N2 returns an ACK within a specified time, node N2 is considered 'active'; otherwise, node N2 is confirmed to be malfunctioning and will be removed from the cluster. The Gossip algorithm, combined with an adaptive algorithm, dynamically adjusts the frequency and strategy of information exchange based on network load and node load. It supports applications in various network environments, including LAN and cloud computing environments; The Gossip algorithm's heartbeat detection mechanism uses encryption and authentication technologies to ensure the security and reliability of information transmission, enabling rapid identification and handling of abnormal states; it also provides flexible configuration options to adapt to different application scenarios and system requirements.
5. A distributed heartbeat detection device, characterized in that, include: At least one memory and at least one processor; The at least one memory is used to store a machine-readable program; The at least one processor is configured to invoke the machine-readable program to implement the method according to any one of claims 1 to 3.
6. A computer-readable medium, characterized in that, The computer-readable medium stores computer instructions that, when executed by a processor, cause the processor to perform the method described in any one of claims 1 to 3.
Citation Information
Patent Citations
Failure detection method suitable to large-scale storage cluster
CN102769673A
Methods and Apparatus for Membership Management of Network Nodes
US20080104218A1