Decentralized method, apparatus, device and medium for KVM cluster

By autonomously determining the node with the smallest communication time parameter as the central node in the KVM cluster and periodically detecting it through heartbeat messages, the problem of cluster crashes caused by central node failure is solved, thus achieving decentralization and improved reliability of the KVM cluster.

CN122120093APending Publication Date: 2026-05-29ZHEJIANG UNIVIEW TECH CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
ZHEJIANG UNIVIEW TECH CO LTD
Filing Date
2024-11-28
Publication Date
2026-05-29

Smart Images

  • Figure CN122120093A_ABST
    Figure CN122120093A_ABST
Patent Text Reader

Abstract

The application discloses a kind of KVM cluster decentralization method, device, equipment and medium.The method comprises: any KVM node in control target KVM cluster sends communication detection message to other KVM nodes, and determines the communication time parameter between the KVM node and other KVM nodes according to communication detection message;Determine the KVM node with minimum communication time parameter in target KVM cluster as center node;Center node periodically sends heartbeat message to other KVM nodes in target KVM cluster, and judges whether to execute the operation of center node re-determination according to the receiving feedback information of other KVM nodes to heartbeat message.The application carries out self-determination to center node by the communication time of each node in cluster and other nodes, realizes that cluster self-determination center node, solves the problem that the failure of artificial selection center node can lead to cluster collapse, makes KVM cluster completely decentralization, and improves cluster communication efficiency and data processing speed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of distributed device technology, and in particular to a decentralized method, apparatus, device, and medium for KVM clusters. Background Technology

[0002] KVM (Keyboard Video Mouse) is widely used in command centers, control centers, and other similar locations. KVM connects to a keyboard, mouse, and monitor at the workstation, allowing control of multiple remote hosts and switching between them, making management simpler and more convenient and improving work efficiency.

[0003] In the current KVM cluster, a central node needs to be manually designated. Clients interact with the designated central node, and all database operations are stored in the central node. If the central node fails, the entire cluster will crash. Summary of the Invention

[0004] This invention provides a decentralized method, apparatus, device, and medium for KVM clusters to solve the cluster risks caused by the human selection of a central node, and to achieve complete decentralization in KVM clusters through the autonomous determination of the central node.

[0005] According to one aspect of the present invention, a decentralized method for KVM clusters is provided, comprising:

[0006] Control any KVM node in the target KVM cluster to send a communication detection message to other KVM nodes, and determine the communication time parameters between the KVM node and the other KVM nodes based on the communication detection message;

[0007] The KVM node with the smallest communication time parameter in the target KVM cluster is identified as the central node.

[0008] The central node periodically sends heartbeat messages to other KVM nodes in the target KVM cluster, and determines whether to perform the operation of re-determining the central node based on the feedback information of the other KVM nodes on receiving the heartbeat messages.

[0009] According to another aspect of the present invention, a decentralized device for a KVM cluster is provided, comprising:

[0010] The communication detection module is used to control any KVM node in the target KVM cluster to send a communication detection message to other KVM nodes, and to determine the communication time parameters between the KVM node and the other KVM nodes based on the communication detection message.

[0011] The central node determination module is used to determine the KVM node with the smallest communication time parameter in the target KVM cluster as the central node.

[0012] The heartbeat message sending module is used by the central node to periodically send heartbeat messages to other KVM nodes in the target KVM cluster, and to determine whether to perform the operation of re-determining the central node based on the feedback information of the other KVM nodes on receiving the heartbeat messages.

[0013] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising:

[0014] At least one processor; and

[0015] A memory communicatively connected to the at least one processor; wherein,

[0016] The memory stores a computer program that can be executed by the at least one processor, which enables the at least one processor to perform the decentralized method of the KVM cluster according to any embodiment of the present invention.

[0017] According to another aspect of the present invention, a computer-readable storage medium is provided, the computer-readable storage medium storing computer instructions for causing a processor to execute and implement the decentralized method of KVM cluster as described in any embodiment of the present invention.

[0018] The technical solution of this invention autonomously determines the central node by measuring the communication time between each node and other nodes within the cluster. This enables the cluster to autonomously elect a central node, avoiding the hidden dangers caused by manually selecting a central node, solving the problem that a failure of a designated central node can lead to cluster crashes, making the KVM cluster completely decentralized, improving cluster communication efficiency and data processing speed, optimizing resource allocation, and enhancing cluster reliability.

[0019] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of the present invention, nor is it intended to limit the scope of the invention. Other features of the invention will become readily apparent from the following description. Attached Figure Description

[0020] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0021] Figure 1This is a flowchart of a decentralized method for a KVM cluster provided according to an embodiment of the present invention;

[0022] Figure 2 This is a schematic diagram of the transmission of communication detection messages;

[0023] Figure 3 This is a schematic diagram illustrating the transmission of heartbeat and response messages;

[0024] Figure 4 This is a flowchart of another decentralized method for KVM clusters provided according to an embodiment of the present invention;

[0025] Figure 5 This is a diagram illustrating the sending of multicast messages to join the cluster after a KVM node starts up.

[0026] Figure 6 This is a diagram illustrating the storage of device information;

[0027] Figure 7 This is a diagram illustrating the addition of a new KVM node;

[0028] Figure 8 This is a diagram illustrating offline notification from a slave node.

[0029] Figure 9 This is a diagram illustrating a KVM node exiting the cluster.

[0030] Figure 10 This is a diagram illustrating the addition of a KVM node to a new cluster;

[0031] Figure 11 This is a diagram illustrating how a client selects a login option for a KVM cluster.

[0032] Figure 12 This is a schematic diagram of the structure of a decentralized device for a KVM cluster according to an embodiment of the present invention;

[0033] Figure 13 This is a schematic diagram of the structure of an electronic device that implements the decentralized method of KVM cluster in this embodiment of the invention. Detailed Implementation

[0034] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.

[0035] It should be noted that the terms "candidate," "target," etc., used in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0036] Figure 1 This invention provides a flowchart of a decentralized method for a KVM cluster. This embodiment is applicable to situations where a central node in a KVM cluster is elected autonomously. This method can be executed by a decentralized device of the KVM cluster, which can be implemented in hardware and / or software. This decentralized device can be configured in a server with communication and computing capabilities. Figure 1 As shown, the method includes:

[0037] S110. Control any KVM node in the target KVM cluster to send a communication detection message to other KVM nodes, and determine the communication time parameters between the KVM node and other KVM nodes based on the communication detection message.

[0038] The target KVM cluster consists of multiple KVM nodes, each of which is a KVM device. Before a central node is determined in the target KVM cluster, the determination of the central node is managed by the management node in the cluster. The management node can be any one of the KVM nodes. After the central node is determined, the central node takes over the work of the management node.

[0039] Specifically, the management node in the target KVM cluster controls each KVM node in the target KVM cluster to send communication detection messages to all other KVM nodes. The communication detection messages are used to detect the reachability and quality of the network connection between two KVM nodes. The communication detection messages include the sending node device information, the responding node device information, the sending timestamp, and the receiving timestamp. Based on the sending timestamp and receiving timestamp in the communication detection messages, the round-trip time between each KVM node as a sending node and the corresponding responding node is determined as a communication time parameter.

[0040] For example, such as Figure 2The diagram illustrates the transmission of communication detection messages. The target KVM cluster includes four KVM nodes, i.e., four KVM devices. Each KVM device stores device information for all KVM devices. Each KVM device sends communication detection messages to the other three KVM devices. Upon receiving the communication detection messages, the other KVM devices respond. Each KVM device determines the communication time based on the responses from the other three KVM devices it listens to. The sum of the communication times of the other three KVM devices is used as the communication time parameter for that KVM device. Specifically, in target cluster 1, the communication time from device 1 to devices 2, 3, and 4 is calculated as time1 and used as the communication time parameter for device 1; the communication time from device 2 to devices 1, 3, and 4 is calculated as time2 and used as the communication time parameter for device 2; the communication time from device 3 to devices 1, 2, and 4 is calculated as time3 and used as the communication time parameter for device 3; and the communication time from device 4 to devices 1, 2, and 3 is calculated as time4 and used as the communication time parameter for device 4. The communication detection message includes an ICMP echo request message sent by the sending node and an echo response message returned by the responding node.

[0041] S120. Determine the KVM node with the smallest communication time parameter in the target KVM cluster as the central node.

[0042] Since the communication time parameter characterizes the network connectivity and quality of each KVM node to other KVM nodes, the KVM node with the best network connectivity quality is selected from all KVM nodes in the target KVM cluster as the central node to improve the efficiency of the central node when sending data to other KVM nodes.

[0043] Specifically, the KVM node with the shortest round-trip communication time with all other KVM nodes in the target KVM cluster is selected as the central node. For example, the corresponding KVM nodes are sorted in ascending order according to time1, time2, time3, and time4, and the KVM node ranked first is selected as the central node.

[0044] Optionally, to improve the accuracy of central node determination, the central node can be re-determined at a preset period to avoid the impact of changes in the communication quality of the central node. Specifically, after the central node is determined, a timer is started. When the timer reaches the preset time interval, the current central node sends a communication detection message to other KVM nodes. Upon receiving the communication detection message and responding, other KVM nodes also send communication detection messages to their corresponding KVM nodes. This process re-determines the communication time parameters of each KVM node, and then uses the re-determined communication time parameters to re-determine a new central node.

[0045] S130. The central node periodically sends heartbeat messages to other KVM nodes in the target KVM cluster, and determines whether to perform the operation of re-determining the central node based on the feedback information of other KVM nodes on receiving the heartbeat messages.

[0046] Once the central node is determined, it periodically sends heartbeat messages to all other KVM nodes in the cluster. Upon receiving the heartbeat messages, the other KVM nodes send response messages back to the central node. For example... Figure 3 The diagram illustrates the transmission of heartbeat and response messages. Device 3 is the central node, periodically sending heartbeat messages to all other nodes to inform them that it is the central node. Other devices respond with response messages if they are online.

[0047] Specifically, if all KVM nodes in the target KVM cluster are online, the central node will periodically send heartbeat messages to the other KVM nodes, and the other KVM nodes will also send response messages back to the central node. In this case, the central node can receive the response messages from all other KVM nodes on time, and there is no need to perform the operation of re-determining the central node. If the central node in the target KVM cluster is offline, the central node will not be able to send heartbeat messages to the other KVM nodes on time, and the operation of re-determining the central node is required.

[0048] In one feasible embodiment, determining whether to perform the operation of re-determining the central node based on the feedback information received by other KVM nodes regarding heartbeat messages includes:

[0049] If other KVM nodes do not receive a heartbeat message within a preset time interval, the system controls any KVM node in the target KVM cluster to send a communication detection message to other KVM nodes, and performs the operation of re-determining the central node.

[0050] If the central node in the target KVM cluster goes offline, it cannot send heartbeat messages to other KVM nodes at regular intervals. Therefore, if any other KVM node does not receive a heartbeat message from the central node within a preset time interval, it indicates that the central node is offline. In this case, the central node sends a communication detection message to other KVM nodes. Upon receiving the communication detection message, each KVM node responds and simultaneously sends its own communication detection message to the corresponding KVM node. This process re-determines the communication time parameters for each KVM node, and then uses these re-determined parameters to determine a new central node. The preset time interval is determined based on the period of the central node's heartbeat message transmission; for example, the preset time interval may be greater than the heartbeat message period but less than twice the heartbeat message period.

[0051] This embodiment determines the online status of the central node by receiving heartbeat messages from slave nodes other than the central node. If the central node is detected to be offline, it is re-determined. This achieves autonomous determination of the central node and avoids the impact of central node offline status.

[0052] The technical solution of this invention autonomously determines the central node by measuring the communication time between each node and other nodes within the cluster. This enables the cluster to autonomously elect a central node, avoiding the hidden dangers caused by manual selection of the central node, solving the problem that a failure of the central node can lead to cluster crashes, making the KVM cluster completely decentralized, improving cluster communication efficiency and data processing speed, optimizing resource allocation, and enhancing cluster reliability.

[0053] Figure 4 This is a flowchart illustrating a decentralized method for a KVM cluster provided in an embodiment of the present invention. This embodiment further refines and supplements the technical features of the above embodiments. For example... Figure 4 As shown, the method includes:

[0054] S210. After the target KVM node starts up, it sends a target cluster join multicast message to the multicast address corresponding to the target KVM cluster, and receives other cluster join multicast messages sent by other KVM nodes from the multicast address.

[0055] Upon initial startup, nodes in the target KVM cluster are added to a pre-defined multicast domain corresponding to the target KVM cluster. The multicast address and port of the pre-defined multicast domain are fixed. After addition, a multicast message to join the cluster is sent to that multicast address. Each KVM node sends a cluster join multicast message to this multicast address after startup, and each KVM node can receive other cluster join multicast messages sent by other KVM nodes from this multicast address.

[0056] like Figure 5 The diagram illustrates the sending of a cluster join multicast message after a KVM node starts up. Each KVM device sends a cluster join multicast message to the multicast address 224.0.0.251, so each device in this multicast domain can receive multicast messages sent by other devices.

[0057] S220. Based on the multicast message of joining other clusters, save the device information of other KVM nodes on the target KVM node, and establish network connections between the target KVM node and other KVM nodes respectively based on the device information of other KVM nodes, so as to send and receive communication detection messages and heartbeat messages according to the network connection.

[0058] Each KVM node's cluster join multicast message includes its own device information, such as device IP address and sequence number. Therefore, upon receiving a cluster join multicast message from another KVM node, each KVM node saves the device information from that message. In other words, each KVM node in the KVM cluster maintains its own device information as well as the device information of all other KVM nodes. Figure 6 The image shows a diagram illustrating the saving of device information.

[0059] After saving the device information, each KVM node contains the device information of all other KVM nodes in the cluster. Then, a network connection is established based on the device information of other KVM nodes for network communication and message transmission between nodes.

[0060] S230. Control any KVM node in the target KVM cluster to send a communication detection message to other KVM nodes, and determine the communication time parameters between the KVM node and other KVM nodes based on the communication detection message.

[0061] S240. Determine the KVM node with the smallest communication time parameter in the target KVM cluster as the central node.

[0062] In one feasible embodiment, after determining the KVM node with the smallest communication time parameter in the target KVM cluster as the central node, the method further includes:

[0063] If the central node and other KVM nodes receive a new cluster join multicast message sent by the new KVM node to the multicast address corresponding to the target KVM cluster, then the central node and other KVM nodes save the device information of the new KVM node, and establish network connections between the central node and other KVM nodes and the new KVM node according to the device information of the new KVM node.

[0064] The central node controls any KVM node in the target KVM cluster to send communication detection messages to other KVM nodes and executes the operations redefined by the central node.

[0065] If a new KVM node is added to the target KVM cluster, the new KVM node is first added to the multicast domain corresponding to the target KVM cluster, and sends a multicast message to join the cluster to the multicast address of that multicast domain. Upon receiving the new cluster join multicast message, all KVM nodes in that multicast domain of the target KVM cluster add the new KVM node's device information to their respective nodes based on the device information in the message, and simultaneously establish network connections between all KVM nodes and the new KVM node based on that device information. For example... Figure 7 The diagram shows the addition of a new KVM node.

[0066] Since a new KVM node has been added to the target KVM cluster, the central node needs to be re-determined to ensure its accuracy. The central node controls any KVM node in the target KVM cluster, including the new KVM node, to send communication detection messages to all other KVM nodes, thus performing the central node re-determination operation. By autonomously re-determining the central node when a new device node is added, the overall communication efficiency and data processing speed of the cluster are improved.

[0067] S250. The central node periodically sends heartbeat messages to other KVM nodes in the target KVM cluster, and determines whether to perform the operation of re-determining the central node based on the feedback information of other KVM nodes on receiving the heartbeat messages.

[0068] In one feasible embodiment, after the central node periodically sends heartbeat messages to other KVM nodes in the target KVM cluster, the method further includes:

[0069] If the central node does not receive a heartbeat response message from the first KVM node, it sends a first KVM node deletion message to the second KVM node; wherein the first KVM node is any of the other KVM nodes, and the second KVM node is any of the other KVM nodes except the first KVM node.

[0070] The central node periodically sends heartbeat messages to other KVM nodes to confirm the status of other KVM nodes and its own node. If the central node does not receive a heartbeat response message from the first KVM node within a preset time interval after sending a heartbeat message to the first KVM node, it determines that the first KVM node is offline.

[0071] After the central node determines that the first KVM node is offline, it sends a deletion message for the first KVM node to the second KVM node. Upon receiving the message, the second KVM node deletes the device information of the first KVM node stored on its own node.

[0072] like Figure 8 The diagram illustrates a slave node offline notification. Slave nodes are KVM nodes other than the central node in the KVM cluster. Device 3 is the central node, which sends heartbeat messages to slave nodes Device 1, Device 2, and Device 4. Device 1 and Device 2 send response messages to the central node. Device 4 does not send a response message, so the central node considers Device 4 to be offline. At the same time, the central node sends an offline notification for Device 4 to Device 1 and Device 2. After receiving the offline notification for Device 4, Device 1 and Device 2 delete the saved device information of Device 4.

[0073] In one feasible embodiment, the method further includes:

[0074] If a cluster modification instruction is received from the third KVM node in the target KVM cluster, the third KVM node is controlled to send a target cluster exit multicast message to the multicast address corresponding to the target KVM cluster, and a new cluster join multicast message to the multicast address corresponding to the new KVM cluster.

[0075] If a device in the target KVM cluster needs to have its cluster modified, a cluster modification command is generated for a third KVM node, which is the node corresponding to the device whose cluster needs to be modified. The third KVM node first sends a target cluster exit multicast message to the multicast address corresponding to the target KVM cluster. The KVM nodes in the target KVM cluster delete the saved device information of the third KVM node based on the target cluster exit multicast message. If the third KVM node is the central node, the central node is re-determined; otherwise, the current central node remains unchanged.

[0076] After the third KVM node sends the target cluster exit multicast message, it sends a new cluster join multicast message to the multicast address corresponding to the new KVM cluster. The KVM nodes in the new KVM cluster save the device information of the third KVM node according to the device information in the new cluster join multicast message, and establish network connections between the KVM nodes in the new KVM cluster and the third KVM node according to the device information of the third KVM node.

[0077] For example, the multicast address corresponding to the target KVM cluster and the multicast address corresponding to the new KVM cluster can be the same or different. The multicast message for leaving the target cluster and the multicast message for joining the new cluster include node device information, as well as the exit cluster identifier information and the join cluster identifier information. When the multicast address corresponding to the target KVM cluster and the multicast address corresponding to the new KVM cluster are the same, they are distinguished according to the cluster identifier information.

[0078] like Figure 9 The diagram illustrates a KVM node exiting a cluster. Devices 5 to 8 are the third KVM nodes. When devices 5 to 8 exit cluster 1 and join cluster 2, they send a "Leave Cluster 1" multicast message to the multicast address corresponding to cluster 1, and a "Join Cluster 2" multicast message to the multicast address corresponding to cluster 2. Figure 10 The diagram shows a KVM node joining a new cluster. Devices 5 to 8 are nodes in cluster 2, and devices 1 to 4 are nodes in cluster 1.

[0079] By enabling KVM nodes to automatically leave the old cluster and join the new cluster, multiple KVM clusters within the same local area network can be isolated through cluster grouping, thus allowing multiple KVM clusters to coexist within a single local area network.

[0080] Optionally, if a device information modification instruction is received from the fourth KVM node in the target KVM cluster, the fourth KVM node is controlled to send a device information modification multicast message to the multicast address corresponding to the target KVM cluster. Upon receiving the device information modification multicast message, other KVM nodes in the target KVM cluster modify the device information of the fourth KVM node they maintain, such as modifying IP information.

[0081] In one feasible embodiment, after determining the KVM node with the smallest communication time parameter in the target KVM cluster as the central node, the method further includes:

[0082] Upon receiving the client's login probe message, the central node sends a target cluster central node information message to the client;

[0083] If a login command for the target cluster, determined by the client based on the target cluster central node information message and other cluster central node information messages, is received, then the cluster information of the target KVM cluster is sent to the client.

[0084] The local area network (LAN) includes multiple KVM clusters. After startup, the client needs to select one of these clusters to log in to. Specifically, upon startup, the client sends a login probe message to the devices corresponding to all KVM nodes within the LAN. If the central node receives this login probe message, it sends a target cluster central node information message to the client, informing the client of its own node information and the corresponding KVM cluster information. After receiving the target cluster central node information messages and other cluster central node information messages from multiple central nodes within the LAN, the client selects the target KVM cluster to log in to based on the message information. The central node then displays the cluster information of the target KVM cluster to the client, which includes at least the node information of each node in the target KVM cluster.

[0085] like Figure 11 The diagram illustrates how a client selects a KVM cluster to log in to. After the client starts, it sends a client login probe multicast message to all devices in the local area network. After receiving the probe multicast message, the central node in each cluster in the local area network will return a message stating "Device 1 is the central node of cluster 1" or "Device 5 is the central node of cluster 2". The client then presents the cluster information of cluster 1 and cluster 2 for the client to choose from.

[0086] This embodiment enables users to directly select and log in to multiple KVM clusters within the same local area network by sending login probe messages through the client, thereby improving the efficiency of users logging into KVM clusters through the client.

[0087] The technical solution of this invention improves the accuracy of the central node by autonomously determining the central node under various abnormal conditions, solves the problem that the cluster will crash due to the failure of the central node, and realizes the complete decentralization of the KVM cluster.

[0088] Figure 12 This is a schematic diagram of the structure of a decentralized device for a KVM cluster provided in an embodiment of the present invention. Figure 12 As shown, the device includes:

[0089] The communication detection module 310 is used to control any KVM node in the target KVM cluster to send a communication detection message to other KVM nodes, and to determine the communication time parameters between the KVM node and the other KVM nodes based on the communication detection message.

[0090] The central node determination module 320 is used to determine the KVM node with the smallest communication time parameter in the target KVM cluster as the central node.

[0091] The heartbeat message sending module 330 is used for the central node to periodically send heartbeat messages to other KVM nodes in the target KVM cluster, and to determine whether to perform the operation of re-determining the central node based on the feedback information of the other KVM nodes on receiving the heartbeat messages.

[0092] The technical solution of this invention autonomously determines the central node by measuring the communication time between each node and other nodes within the cluster. This enables the cluster to autonomously elect a central node, avoiding the hidden dangers caused by manual selection of the central node, solving the problem that a failure of the central node can lead to cluster crashes, making the KVM cluster completely decentralized, improving cluster communication efficiency and data processing speed, optimizing resource allocation, and enhancing cluster reliability.

[0093] Optionally, the heartbeat message sending module includes a central node re-determination unit, used for:

[0094] If the other KVM nodes do not receive the heartbeat message within a preset time interval, then control any KVM node in the target KVM cluster to send a communication detection message to the other KVM nodes, and perform the operation of re-determining the central node.

[0095] Optionally, the device further includes a KVM cluster generation module, used to control any KVM node in the target KVM cluster before sending communication detection messages to other KVM nodes:

[0096] After the target KVM node starts up, it sends a target cluster join multicast message to the multicast address corresponding to the target KVM cluster, and receives other cluster join multicast messages sent by other KVM nodes from the multicast address.

[0097] Based on the multicast message of joining other clusters, the device information of the other KVM nodes is saved on the target KVM node, and network connections are established between the target KVM node and the other KVM nodes respectively based on the device information of the other KVM nodes, so as to send and receive communication detection messages and heartbeat messages according to the network connection.

[0098] Optionally, the device further includes a new node addition module, used to determine the KVM node with the smallest communication time parameter in the target KVM cluster as the central node:

[0099] If the central node and the other KVM nodes receive a new cluster join multicast message sent by the new KVM node to the multicast address corresponding to the target KVM cluster, then the central node and the other KVM nodes save the device information of the new KVM node, and establish network connections between the central node and the other KVM nodes and the new KVM node according to the device information of the new KVM node.

[0100] The central node controls any KVM node in the target KVM cluster to send communication detection messages to other KVM nodes, and executes the operation redefined by the central node.

[0101] Optionally, the device further includes a node offline module, used after the central node periodically sends heartbeat messages to other KVM nodes in the target KVM cluster:

[0102] If the central node does not receive a heartbeat response message from the first KVM node, it sends the first KVM node deletion message to the second KVM node; wherein the first KVM node is any of the other KVM nodes, and the second KVM node is any of the other KVM nodes except the first KVM node.

[0103] Optionally, the device further includes a node cluster modification module, used for:

[0104] If a cluster modification instruction is received from the third KVM node in the target KVM cluster, the third KVM node is controlled to send a target cluster exit multicast message to the multicast address corresponding to the target KVM cluster, and a new cluster join multicast message to the multicast address corresponding to the new KVM cluster; wherein, the third KVM node is the node corresponding to the device whose cluster needs to be changed.

[0105] Optionally, the device further includes a client login module, used to determine the KVM node with the smallest communication time parameter in the target KVM cluster as the central node:

[0106] The central node receives the client login probe message and sends the target cluster central node information message to the client;

[0107] If a login instruction for the target cluster, determined by the client based on the target cluster central node information message and other cluster central node information messages, is received, then the cluster information of the target KVM cluster is sent to the client.

[0108] The decentralized device for KVM clusters provided in this embodiment of the invention can execute the decentralized method for KVM clusters provided in any embodiment of the invention, and has the corresponding functional modules and beneficial effects of the method execution.

[0109] The acquisition, storage, use, and processing of data in this application comply with relevant national laws and regulations and do not violate public order and good morals.

[0110] According to embodiments of this disclosure, this disclosure also provides an electronic device, a readable storage medium, and a computer program product.

[0111] Figure 13 A schematic diagram of an electronic device 10 that can be used to implement embodiments of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices (e.g., helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the invention described and / or claimed herein.

[0112] like Figure 13 As shown, the electronic device 10 includes at least one processor 11 and a memory, such as a read-only memory (ROM) 12 or a random access memory (RAM) 13, communicatively connected to the at least one processor 11. The memory stores computer programs executable by the at least one processor. The processor 11 can perform various appropriate actions and processes based on the computer program stored in the ROM 12 or loaded from storage unit 18 into the RAM 13. The RAM 13 can also store various programs and data required for the operation of the electronic device 10. The processor 11, ROM 12, and RAM 13 are interconnected via a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.

[0113] Multiple components in electronic device 10 are connected to I / O interface 15, including: input unit 16, such as keyboard, mouse, etc.; output unit 17, such as various types of displays, speakers, etc.; storage unit 18, such as disk, optical disk, etc.; and communication unit 19, such as network card, modem, wireless transceiver, etc. Communication unit 19 allows electronic device 10 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.

[0114] Processor 11 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, digital signal processors (DSPs), and any suitable processor, controller, microcontroller, etc. Processor 11 performs the various methods and processes described above, such as the decentralized approach of a KVM cluster.

[0115] In some embodiments, the decentralized method for KVM clustering may be implemented as a computer program tangibly contained in a computer-readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on electronic device 10 via ROM 12 and / or communication unit 19. When the computer program is loaded into RAM 13 and executed by processor 11, one or more steps of the decentralized method for KVM clustering described above may be performed. Alternatively, in other embodiments, processor 11 may be configured to execute the decentralized method for KVM clustering by any other suitable means (e.g., by means of firmware).

[0116] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific reference products (ASSPs), systems-on-a-chip (SoCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transferring data and instructions to the storage system, the at least one input device, and the at least one output device.

[0117] Computer programs used to implement the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when executed by the processor, the computer programs cause the functions / operations specified in the flowcharts and / or block diagrams to be performed. The computer programs may be executed entirely on a machine, partially on a machine, or as a standalone software package, partially on a machine and partially on a remote machine, or entirely on a remote machine or server.

[0118] In the context of this invention, a computer-readable storage medium can be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, apparatus, or device. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination thereof. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.

[0119] To provide interaction with a user, the systems and techniques described herein can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the electronic device. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).

[0120] The systems and technologies described herein can be implemented in computing systems that include back-end components (e.g., as data servers), or computing systems that include switching components (e.g., application servers), or computing systems that include front-end components (e.g., user computers with graphical user interfaces or web browsers through which users can interact with implementations of the systems and technologies described herein), or any combination of such back-end, switching, or front-end components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., communication networks). Examples of communication networks include local area networks (LANs), wide area networks (WANs), blockchain networks, and the Internet.

[0121] A computing system can include clients and servers. Clients and servers are generally located far apart and typically interact through communication networks. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. The server can be a cloud server, also known as a cloud computing server or cloud host, which is a hosting product within the cloud computing service system to address the shortcomings of traditional physical hosts and VPS services, such as high management difficulty and weak business scalability.

[0122] It should be understood that the various forms of processes shown above can be used, with steps reordered, added, or deleted. For example, the steps described in this invention can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution of this invention can be achieved, and this is not limited herein.

[0123] The specific embodiments described above do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.

Claims

1. A decentralized method for KVM clusters, characterized in that, The method includes: Control any KVM node in the target KVM cluster to send a communication detection message to other KVM nodes, and determine the communication time parameters between the KVM node and the other KVM nodes based on the communication detection message; The KVM node with the smallest communication time parameter in the target KVM cluster is identified as the central node. The central node periodically sends heartbeat messages to other KVM nodes in the target KVM cluster, and determines whether to perform the operation of re-determining the central node based on the feedback information of the other KVM nodes on receiving the heartbeat messages.

2. The method according to claim 1, characterized in that, Based on the feedback information from the other KVM nodes regarding the heartbeat messages, determine whether to perform the operation of re-determining the central node, including: If the other KVM nodes do not receive the heartbeat message within a preset time interval, then control any KVM node in the target KVM cluster to send a communication detection message to the other KVM nodes, and perform the operation of re-determining the central node.

3. The method according to claim 1, characterized in that, Before controlling any KVM node in the target KVM cluster to send communication detection messages to other KVM nodes, the method further includes: After the target KVM node starts up, it sends a target cluster join multicast message to the multicast address corresponding to the target KVM cluster, and receives other cluster join multicast messages sent by other KVM nodes from the multicast address. Based on the multicast message of joining other clusters, the device information of the other KVM nodes is saved on the target KVM node, and network connections are established between the target KVM node and the other KVM nodes respectively based on the device information of the other KVM nodes, so as to send and receive communication detection messages and heartbeat messages according to the network connection.

4. The method according to claim 1, characterized in that, After determining the KVM node with the smallest communication time parameter in the target KVM cluster as the central node, the method further includes: If the central node and the other KVM nodes receive a new cluster join multicast message sent by the new KVM node to the multicast address corresponding to the target KVM cluster, then the central node and the other KVM nodes save the device information of the new KVM node, and establish network connections between the central node and the other KVM nodes and the new KVM node according to the device information of the new KVM node. The central node controls any KVM node in the target KVM cluster to send communication detection messages to other KVM nodes, and executes the operation redefined by the central node.

5. The method according to claim 1, characterized in that, After the central node periodically sends heartbeat messages to other KVM nodes in the target KVM cluster, the method further includes: If the central node does not receive a heartbeat response message from the first KVM node, it sends the first KVM node deletion message to the second KVM node; wherein the first KVM node is any of the other KVM nodes, and the second KVM node is any of the other KVM nodes except the first KVM node.

6. The method according to claim 1, characterized in that, The method further includes: If a cluster modification instruction is received from the third KVM node in the target KVM cluster, the third KVM node is controlled to send a target cluster exit multicast message to the multicast address corresponding to the target KVM cluster, and a new cluster join multicast message to the multicast address corresponding to the new KVM cluster; wherein, the third KVM node is the node corresponding to the device whose cluster needs to be changed.

7. The method according to claim 1, characterized in that, After determining the KVM node with the smallest communication time parameter in the target KVM cluster as the central node, the method further includes: The central node receives the client login probe message and sends the target cluster central node information message to the client; If a login instruction for the target cluster, determined by the client based on the target cluster central node information message and other cluster central node information messages, is received, then the cluster information of the target KVM cluster is sent to the client.

8. A decentralized device for a KVM cluster, characterized in that, The device includes: The communication detection module is used to control any KVM node in the target KVM cluster to send a communication detection message to other KVM nodes, and to determine the communication time parameters between the KVM node and the other KVM nodes based on the communication detection message. The central node determination module is used to determine the KVM node with the smallest communication time parameter in the target KVM cluster as the central node. The heartbeat message sending module is used by the central node to periodically send heartbeat messages to other KVM nodes in the target KVM cluster, and to determine whether to perform the operation of re-determining the central node based on the feedback information of the other KVM nodes on receiving the heartbeat messages.

9. An electronic device, characterized in that, The electronic device includes: At least one processor; and A memory communicatively connected to the at least one processor; wherein, The memory stores a computer program that can be executed by the at least one processor, the computer program being executed by the at least one processor to enable the at least one processor to perform the decentralized method of the KVM cluster according to any one of claims 1-7.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions that cause a processor to execute the decentralized method of the KVM cluster according to any one of claims 1-7.