A cluster networking method, distributed storage cluster and product

By obtaining all reachable nodes of each node in a distributed storage cluster and forming networks based on the optimal fully connected sub-graph, the problem of high communication delay between nodes in the prior art is solved, and the cluster group is improved network efficiency and consistency.

CN118921381BActive Publication Date: 2025-02-11INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411390553.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-09-30
Publication Date
2025-02-11
Estimated Expiration
2044-09-30

AI Technical Summary

Technical Problem

The existing distributed cluster network relies on the heartbeat communication of master and slave nodes, resulting in high communication delays between slave nodes, affecting the efficiency of load balancing and large-scale data access.

Method used

By obtaining all reachable nodes of each node in the distributed storage cluster, and when the networking conditions are met, a new cluster is generated by networking based on the optimal fully connected subgraph.

Benefits of technology

It improves the efficiency of cluster networking, reduces communication delay, enhances state consistency and load balancing capabilities between nodes, and is suitable for high-efficiency and low-latency communication scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118921381B_ABST
    Figure CN118921381B_ABST
Patent Text Reader

Abstract

The embodiment of the present application provides a cluster networking method, a distributed storage cluster and a product, which belongs to the technical field of distributed storage clusters. The method includes obtaining all reachable nodes corresponding to itself when the connection state of a link in the distributed storage cluster changes, any two nodes in the distributed storage cluster have a physical communication link, and the reachable node is a node that any node directly or indirectly communicates with; when there are the latest view messages corresponding to all reachable nodes corresponding to itself locally, it is determined that the networking conditions are met; when the networking conditions are met, the optimal fully connected subgraph in the current connection state is solved based on all reachable nodes corresponding to the node itself; networking is performed based on the optimal fully connected subgraph to generate a new cluster, wherein any two nodes in the new cluster have a physical communication link. The embodiment of the present application aims to improve the efficiency of cluster networking.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the technical field of distributed storage clusters, and more specifically, to a cluster networking method, a distributed storage cluster, and a product. Background Art

[0002] With the rapid development of the big data era, the management and storage of large-scale data has become a considerable challenge. SAN (Storage Area Network) storage cluster is a data storage management solution that stores data on multiple nodes to achieve high reliability, high scalability and high performance. The storage cluster can improve the performance of providing external data access, and the data of each node is kept synchronized to ensure data security and consistency.

[0003] Existing distributed cluster networking relies on a heartbeat communication connection between a master node and several slave nodes to maintain cluster membership. Slave nodes that have a continuous heartbeat with the master node are considered to be in the cluster, otherwise they are considered to have left the cluster.

[0004] However, this networking method based on heartbeat communication between master and slave nodes often requires multiple node forwarding for communication between slave nodes, resulting in high communication delays, which is not conducive to maintaining state consistency between nodes, and further affects the ability of cluster nodes to achieve load balancing. In the scenario of large-scale data access, it cannot meet the requirements of high-efficiency and low-latency communication; when the connection status of nodes in the cluster changes, the efficiency of re-networking is low. Summary of the invention

[0005] The embodiments of the present application provide a cluster networking method, a distributed storage cluster, and a product, aiming to improve the efficiency of cluster networking.

[0006] In a first aspect, an embodiment of the present application provides a cluster networking method, which is applied to any node in a distributed storage cluster, and the method includes:

[0007] When the connection state of the link in the distributed storage cluster changes, all reachable nodes corresponding to the distributed storage cluster are obtained, wherein there is a physical communication link between any two nodes in the distributed storage cluster, and the reachable nodes are nodes that any node directly or indirectly communicates with;

[0008] When the local computer has the latest view messages corresponding to all reachable nodes corresponding to itself, it is determined that the networking condition is met;

[0009] When the networking conditions are met, the optimal fully connected subgraph in the current connection state is solved based on all reachable nodes corresponding to the node itself;

[0010] A new cluster is generated by networking based on the optimal fully connected subgraph, wherein a physical communication link exists between any two nodes in the new cluster.

[0011] Optionally, get all reachable nodes corresponding to itself, including:

[0012] Obtaining a target entry corresponding to itself from a local message entry list, wherein the message entry list stores the target entry corresponding to itself and an entry of any node, wherein the entry includes a view message of the corresponding node received by itself;

[0013] Acquire the latest view message from the target entry, and determine the node identifiers of all visible nodes currently corresponding to itself based on the latest view message, wherein the visible nodes are nodes that directly communicate with itself;

[0014] Based on the node identifiers of all currently corresponding visible nodes, searching the message item list for items corresponding to all visible nodes;

[0015] According to the entries corresponding to all the visible nodes, the node identifiers of all the reachable nodes corresponding to the node are determined.

[0016] Optionally, after obtaining all reachable nodes corresponding to itself, the method further includes:

[0017] According to the node identifiers of all reachable nodes corresponding to itself, obtaining the entry corresponding to each reachable node in the message entry list;

[0018] Search for entries corresponding to each reachable node, and determine whether the entry corresponding to any reachable node stores the latest view message corresponding to the reachable node.

[0019] Optionally, after determining whether the entry corresponding to any reachable node stores the latest view message corresponding to the reachable node, the method further includes:

[0020] When the entry corresponding to any reachable node does not store the latest view message corresponding to the reachable node, it is determined that the networking condition is not met;

[0021] After the target time period has passed, re-judge whether the networking conditions are met.

[0022] Optionally, when the networking conditions are met, solving the optimal fully connected subgraph in the current connection state based on all reachable nodes corresponding to the node itself includes:

[0023] Determine an initial node set based on itself and all reachable nodes corresponding to itself, and generate an initial view based on the initial node set;

[0024] The initial view is segmented to obtain a set of hypotheses including a plurality of hypotheses, wherein each hypotheses includes at least two segmented views and each node exists in only one segmented view;

[0025] Calculate the fitness corresponding to each assumption in the assumption set respectively;

[0026] Performing hybridization or mutation processing on multiple hypotheses in the hypothetical set to obtain multiple new hypotheses;

[0027] Iteratively updating the set of proposed assumptions based on the multiple new proposed assumptions;

[0028] In the updated set of hypotheses, the largest fully connected subgraph contained in the hypotheses with the largest fitness is selected as the optimal fully connected subgraph, and there is a physical communication link between any two nodes in the fully connected subgraph.

[0029] Optionally, respectively calculating the fitness corresponding to each assumption in the assumption set includes:

[0030] For any hypothesis, determining the number of fully connected subgraphs of the segmented views included in the hypothesis and the number of nodes in any fully connected subgraph;

[0031] The proposed fitness is calculated based on the number of fully connected subgraphs, the maximum number of nodes in the cluster, and the number of nodes in any fully connected subgraph.

[0032] Optionally, the formula for calculating the fitness of any proposed setting is:

[0033]

[0034] Where F is the fitness, N is the maximum number of nodes in the cluster, and n is the number of nodes in any fully connected subgraph. V n is the number of the fully connected subgraphs.

[0035] Optionally, performing hybridization processing on multiple hypotheses in the hypothetical set includes:

[0036] Obtain any two hypotheses from the hypothetical set as the first hypotheses and the second hypotheses;

[0037] At least one node in the initial node set is made to use the view segmentation result in the first assumption, and the remaining nodes are made to use the view segmentation result in the second assumption, so as to generate a new assumption.

[0038] Optionally, performing mutation processing on multiple hypotheses in the hypothetical set includes:

[0039] Obtain any hypothesis from the set of hypotheses, randomly change the view segmentation result of at least one node in the hypotheses, and generate a new hypotheses.

[0040] Optionally, based on the multiple new assumptions, iteratively updating the assumption set includes:

[0041] For any new proposed design, determine the fitness corresponding to the new proposed design;

[0042] Determine whether the newly proposed fitness is greater than the current minimum fitness in the proposed set;

[0043] When the fitness of the new proposed setting is greater than the current minimum fitness, the proposed setting corresponding to the current minimum fitness is replaced by the new proposed setting;

[0044] When the fitness of the new proposed setting is not greater than the current minimum fitness, discarding the new proposed setting;

[0045] When the minimum fitness in the proposed set does not change in the target number of iterations, the iterative update of the proposed set is stopped.

[0046] Optionally, after iteratively updating the set of hypotheses based on the multiple new hypotheses, the method further comprises:

[0047] In the updated set of hypotheses, when the number of hypotheses with the largest fitness is greater than 1, the largest fully connected subgraphs corresponding to the multiple hypotheses with the largest fitness are obtained respectively;

[0048] From each of the largest fully connected subgraphs, select the largest fully connected subgraph where the node with the smallest node identifier is located as the optimal fully connected subgraph.

[0049] Optionally, the method further comprises:

[0050] When the refresh interval is reached or the connection status of the link in the distributed storage cluster changes, the latest view message of the distributed storage cluster is generated, and the latest view message includes: the current connection status information, the previous connection status information and the cluster node status information;

[0051] The latest view message is stored in a local message item list;

[0052] Mark the nodes to which the latest view message needs to be sent, and update the forwarding node list based on the node identifiers of all marked nodes; wherein marking the nodes to which the latest view message needs to be sent includes: marking all visible nodes of the node;

[0053] The latest view message is forwarded according to the forwarding node list.

[0054] Optionally, generate its own latest view message, including:

[0055] Obtain the message sequence number of the last view message, its own node ID, and cluster node status from the local non-volatile memory, and obtain the visible node list and the last connection status locally;

[0056] updating the message sequence number of the previous view message to obtain the latest message sequence number, and writing the latest message sequence number into the non-volatile memory;

[0057] Write the latest message sequence number, its own node identifier, cluster node status, visible node list and last connection status into the message buffer of the corresponding entry in the local message entry list;

[0058] A latest view message is generated based on the data in the message buffer.

[0059] Optionally, updating the message sequence number of the previous view message to obtain the latest message sequence number includes:

[0060] When the refresh interval is reached, the message sequence number is increased by 1 as the latest message sequence number;

[0061] When the connection status of the link in the distributed storage cluster changes, the message sequence number is increased by 2 to serve as the latest message sequence number.

[0062] Optionally, before generating its own latest view message, it also includes:

[0063] Traverse all nodes directly connected to itself to determine whether each node can communicate with itself normally;

[0064] When any node can communicate with itself normally, the node is determined to be a visible node corresponding to itself;

[0065] Get the node IDs of all visible nodes and update the local visible node list.

[0066] Optionally, when any node can communicate normally with itself, the method further includes:

[0067] Determine whether any visible node exists in the local node index list;

[0068] If the visible node does not exist in the node index list, a null entry is allocated to the visible node in the local message entry list;

[0069] A node identifier of the visible node and index information of the empty entry are established and added to the node index list.

[0070] Optionally, the method further comprises:

[0071] Receive the latest view message sent by any visible node;

[0072] Obtaining a node identifier in the latest view message, and determining a source node of the latest view message;

[0073] According to the node identifier, searching a local node index list to determine a position of an entry corresponding to the node identifier in a local message entry list;

[0074] Marking the nodes to which the latest view message needs to be sent, and updating the forwarding node list based on the node identifiers of all marked nodes; wherein marking the nodes to which the latest view message needs to be sent includes: marking nodes that are visible to themselves and invisible to the source node;

[0075] Writing the latest view message into a message buffer in the entry;

[0076] The latest view message is forwarded according to the forwarding node list.

[0077] Optionally, marking a node that is visible to itself and invisible to the source node includes:

[0078] Read the local visible node list and the visible node list of the source node in the latest view message;

[0079] Mark all nodes that exist in the local visible node list and not in the source node's visible node list.

[0080] Optionally, when the source node does not exist in the local node index list, the method further includes:

[0081] In the local message entry list, allocating an empty entry to the source node;

[0082] Establishing a node identifier of the source node and index information of the empty entry, and adding them to the node index list;

[0083] The latest view message of the source node is written into the message buffer of the empty entry.

[0084] In a second aspect, an embodiment of the present application provides a distributed storage cluster, including multiple nodes, wherein there is a direct link between any two nodes; any node is configured to locally maintain the following data:

[0085] A node index list, which is used to record the index information of the corresponding entries in the message entry list of all reachable nodes of the node;

[0086] A visible node list, used to record all nodes directly connected to the node;

[0087] A connection status buffer, used to store the previous connection status of the node;

[0088] a message entry list, corresponding to the node index list, and used to store entries corresponding to each node identifier; wherein each entry includes a message buffer and a forwarding node list; the message buffer is used to record the latest view message generated by the node corresponding to the node identifier; the forwarding node list is used to record the node identifier of the node to which the latest view message stored in the entry needs to be sent;

[0089] Any node is configured to execute the steps in the cluster networking method described in the first aspect of the embodiment to re-network and generate a new cluster when the connection state of the link in the cluster changes.

[0090] In a third aspect, an embodiment of the present application provides a computer device, comprising: at least one processor, and a memory, wherein the memory stores a computer program that can be run on the processor, wherein when the processor executes the computer program, the cluster networking method described in the first aspect of the embodiment is executed.

[0091] In a fourth aspect, an embodiment of the present application provides a non-volatile readable storage medium, wherein the non-volatile readable storage medium stores a computer program, wherein when the computer program is executed by a processor, the cluster networking method described in the first aspect is performed.

[0092] In a fifth aspect, an embodiment of the present application provides a computer program product, including a computer program / instruction, which, when executed by a processor, implements the cluster networking method described in the first aspect.

[0093] Beneficial effects:

[0094] This method is applied to any node in a distributed storage cluster. When the connection state of a link in the distributed storage cluster changes, all reachable nodes corresponding to the node are obtained. The reachable nodes are nodes that any node directly or indirectly communicates with.

[0095] When the latest view messages corresponding to all reachable nodes corresponding to the node exist locally, it is determined that the networking conditions are met; when the networking conditions are met, the optimal fully connected subgraph in the current connection state is solved based on all reachable nodes corresponding to the node itself; networking is performed based on the optimal fully connected subgraph to generate a new cluster, wherein any two nodes in the new cluster have a physical communication link.

[0096] That is, there is a physical communication link between any two nodes in the distributed storage cluster, and data can be directly exchanged, thereby improving the efficiency of data interaction between nodes. When a link change occurs in the distributed storage cluster, the optimal fully connected subgraph under the current connection state can be determined based on the reachable nodes corresponding to the node itself. The new cluster reconstructed based on the optimal fully connected subgraph can continue to serve as the carrier of the distributed storage cluster. Compared with the networking based on heartbeat communication between master and slave nodes, this process can improve the efficiency of cluster networking. BRIEF DESCRIPTION OF THE DRAWINGS

[0097] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art.

[0098] Figure 1 A flowchart showing the steps of the cluster networking method provided in an embodiment of the present application is shown;

[0099] Figure 2 A flowchart of the steps for sending the latest view message provided by an embodiment of the present application is shown;

[0100] Figure 3 A flowchart of the forwarding steps of the latest view message provided by an embodiment of the present application is shown;

[0101] Figure 4 A flow chart of the steps for determining an optimal fully connected subgraph provided in an embodiment of the present application is shown;

[0102] Figure 5 A schematic diagram of a cluster node provided in an embodiment of the present application is shown;

[0103] Figure 6 A schematic diagram of a distributed storage cluster provided in an embodiment of the present application is shown;

[0104] Figure 7 A schematic diagram of a computer device provided in an embodiment of the present application is shown;

[0105] Figure 8 A schematic diagram of a non-volatile readable storage medium provided in an embodiment of the present application is shown;

[0106] Fig. 9 A schematic diagram of a computer program product provided by an embodiment of the present application is shown. DETAILED DESCRIPTION

[0107] The technical solutions in the embodiments of the present application will be described below in conjunction with the drawings in the embodiments of the present application.

[0108] To make the purpose, technical scheme and advantages of the embodiments of the present application clearer, each embodiment of the present application will be described in detail below in conjunction with the accompanying drawings. However, it will be appreciated by those skilled in the art that in each embodiment of the present application, many technical details are proposed in order to enable the reader to better understand the present application. However, even without these technical details and various changes and modifications based on the following embodiments, the technical scheme claimed in the present application can also be implemented. The division of the following embodiments is for the convenience of description, and the specific implementation of the present application should not constitute any limitation, and the various embodiments can be combined with each other and referenced to each other without contradiction.

[0109] Most existing distributed clusters rely on a heartbeat communication connection between a master node, i.e., the Leader node, and several slave nodes, i.e., the Follower nodes, to maintain cluster membership. Nodes that have a continuous heartbeat with the Leader node are considered to be in the cluster, and vice versa. However, this paradigm has two disadvantages:

[0110] First, the follower nodes are only required to communicate with the leader node. There is no strict constraint on the communication quality between the follower nodes. Communication between the nodes often needs to be forwarded by multiple nodes, resulting in high communication delay and making it difficult for the follower nodes to maintain consistent status, which in turn affects the ability of the cluster nodes to achieve load balancing.

[0111] Second, when the network splits and nodes are divided into different network partitions, the process of reselecting the leader node takes a long time. For example, for an etcd cluster, in certain scenarios, it may take more than half an hour to complete the election of the leader node, and no services can be provided to the outside world during the leader node election.

[0112] Therefore, the current networking method based on heartbeat communication between master and slave nodes results in low efficiency of cluster networking and cannot meet the communication requirements of high efficiency and low latency, further affecting the weakening of storage services provided by the storage cluster to the outside world.

[0113] Therefore, in order to improve the efficiency of cluster networking, an embodiment of the present application provides a cluster networking method.

[0114] Reference Figure 1 , shows a flowchart of the steps of a cluster networking method provided in an embodiment of the present application, the method is applied to any node in a distributed storage cluster, and the method may include the following steps:

[0115] S101: When the connection state of a link in the distributed storage cluster changes, all reachable nodes corresponding to the distributed storage cluster are obtained.

[0116] There are multiple nodes in the distributed storage cluster, and there is a physical communication link between any two nodes, that is, any two nodes can directly establish communication to exchange data. For any node, the node that directly establishes a physical communication link with the node is regarded as the visible node of the node, and the node that directly or indirectly communicates with the node is regarded as the reachable node.

[0117] For example, a physical communication link is directly established between node a and node b and node c, a physical communication link is directly established between node b and node d, and a physical communication link is directly established between node c and node e. Then, for node a, node b and node c are visible nodes, and node b, node c, node d and node e are all reachable nodes.

[0118] For any node in the distributed storage cluster, the following contents may be set in the node:

[0119] The visible node list is used to record all visible nodes that are currently directly connected to the node, the number of each visible node, and the number of all visible nodes.

[0120] A message entry list is used to store entries corresponding to each reachable node identifier. For example, in the message entry list, any view message sent by any reachable node received by the node is stored in the entry corresponding to the reachable node; each entry includes a message buffer and a forwarding node list; the message buffer is used to record the latest view message generated by the node corresponding to the node identifier; the forwarding node list is used to record the node identifier of the node to which the latest view message stored in the entry needs to be sent.

[0121] The node index list is used to record the index information of the corresponding entries in the message entry list of all reachable nodes of the node.

[0122] In this embodiment, the view message generated or sent by any node to other nodes includes the current connection status information, the previous connection status information and the cluster node status information, where:

[0123] The current connection status information includes the message sequence number, the node identifier of the node, and the visible node list of the node. The current connection status is used to describe the visible nodes that the node is directly connected to in the current connection;

[0124] The last connection state information is the connection state of the link of the node before the connection state changes. A connection state buffer is provided in any node to store the last connection state information of the node;

[0125] For example, the visible nodes for direct communication of node a at time T1 include node b and node c, and the current connection status information is generated at time T1. At time T2, node a detects a new visible node d for direct communication. At this time, at time T2, the current connection status information is stored in the connection status buffer as the previous connection status information, and the current connection status information is generated.

[0126] Cluster node status information is used to characterize the status of each node in the cluster and all nodes in the cluster. For example, there is a cluster database on each node. When the operation of any client changes the cluster status, the cluster status needs to be synchronized to all nodes, and the status of each node needs to be updated. Each node status update will have a serial number. Cluster status updates include modifying the value of any address or modifying any key value in the cluster database.

[0127] In this embodiment, cluster node status information and message sequence numbers are stored in the node's non-volatile memory after being updated, and the node's own node identification is also stored in the non-volatile memory. The content in the non-volatile storage is persistent and can be restored after the node fails and restarts.

[0128] When the connection status of a link in the distributed storage cluster changes, the node corresponding to the link change needs to generate a latest view message first, and broadcast the latest view message to all nodes, so that all nodes synchronize the change in the connection status of the link and maintain the consistency of each node in the cluster.

[0129] Reference Figure 2 , shows a flowchart of the steps of sending the latest view message provided by an embodiment of the present application. In a feasible implementation manner, for any node, after the link connection state changes, the process of generating the latest view message and broadcasting the latest view message to all nodes includes:

[0130] A1: Traverse all nodes directly connected to itself, determine whether each node can communicate with itself normally, and if any node can communicate with itself normally, determine that node as its corresponding visible node.

[0131] For example, the physical connection link between nodes is implemented based on a gateway disposed on the node, and the gateway detects in real time whether the link of any port is connected or disconnected.

[0132] The link connection state change includes the disconnection of any link or the addition of a link. The node corresponding to the link currently in the connection state is the visible node corresponding to the node.

[0133] A2: Get the node IDs of all visible nodes and update the local visible node list.

[0134] Get the node identifiers of all visible nodes corresponding to the current node. In the actual implementation process, the node can send a node identifier request to any visible node. After responding to the node identifier request, the visible node can return its own node identifier to the node. The node updates its local visible node list according to the node identifiers of all visible nodes.

[0135] For example, if any visible node is a new visible node, the local visible node list, message item list and node index list of the node do not contain any information of the new visible node, so the following steps may also be performed:

[0136] When any node can communicate normally with itself, determine whether any visible node exists in the local node index list; if the visible node does not exist in the node index list, allocate an empty entry for the visible node in the local message entry list; establish the node identifier of the visible node and the index information of the empty entry, and add them to the node index list.

[0137] That is, after a new visible node appears, the node creates an empty entry corresponding to the new visible node in the message item list, so as to facilitate the subsequent acquisition of view information sent by the new visible node, and adds the node identifier corresponding to the visible node and the index information of the empty entry in the node index list, so as to facilitate the node to quickly locate the entry corresponding to the new visible node in the message item list according to the index information in the node index list.

[0138] A3: Generate its own latest view message, and store the latest view message in a local message item list.

[0139] The latest view message specifically includes the current connection status information, the previous connection status information and the cluster node status information.

[0140] Specifically, the latest view message generated by itself includes:

[0141] First, obtain the message sequence number of the previous view message, its own node ID, and cluster node status from the local non-volatile memory;

[0142] Then, the message sequence number of the previous view message is updated to obtain the latest message sequence number, and is written into the non-volatile memory. For example, when the connection status of the link in the distributed storage cluster changes, the message sequence number is increased by 2 as the latest message sequence number.

[0143] Next, the latest message sequence number, its own node identifier, and cluster node status are written into the message buffer of the corresponding entry in the local message entry list; after obtaining the stored visible node list locally and the previous connection status in the connection status buffer, they are written into the message buffer of the corresponding entry in the local message entry list; based on the data in the message buffer, the latest view message is generated.

[0144] In the actual implementation process, the data currently stored in the message buffer may be combined to obtain the latest view message, and all the data currently stored in the message buffer may be encrypted based on an encryption algorithm to obtain the latest view message. Custom settings may be made according to actual application requirements, and this embodiment does not impose any limitation.

[0145] A4: Mark the nodes to which the latest view message needs to be sent, and update the forwarding node list based on the node identifiers of all marked nodes.

[0146] When any node sends the latest view message generated by itself to other nodes, the nodes to which the latest view message needs to be sent are all visible nodes marked by itself. At this time, the forwarding node list includes the node identifiers corresponding to all visible nodes corresponding to the node, that is, the latest view generated by itself is sent to all visible nodes.

[0147] A5: forwarding the latest view message according to the forwarding node list.

[0148] After the forwarding node list is updated, the latest view message of each visible node in the forwarding node list is sent to all visible nodes respectively according to the node identifier of the node.

[0149] After any node receives the latest view message sent by other nodes, it stores the latest view message in its own local message entry list.

[0150] In a feasible implementation, in addition to synchronizing the latest message view between nodes when a link changes, the view message of the cluster can also be updated at intervals. Specifically, when the refresh interval is reached, any node generates a latest view message and sends it to all corresponding visible nodes. In order to distinguish the view message updated at a time and the message view when the link changes, when the view message is updated at a time, in the process of generating the latest view message, the message sequence number obtained from the non-volatile memory can be increased by 1 as the latest message sequence number.

[0151] In a feasible implementation, when a link changes, it indicates that at least two nodes cannot directly interact with each other, that is, the latest view message cannot be sent directly. In order to keep the latest message view of any node consistent on each node in the cluster, node forwarding is required. For example, the visible nodes of node a include node b and node c, and the visible nodes of node b include node c. Assuming that the link between node a and node c is disconnected, node a sends its latest view information to node b. After node b forwards it, node c can receive the latest view information of node a.

[0152] Reference Figure 3 , shows a flowchart of the forwarding steps of the latest view message provided in an embodiment of the present application. Therefore, in a feasible implementation manner, for any node, the forwarding process includes the following steps:

[0153] B1: After receiving the latest view message sent by any visible node, obtain the node identifier in the latest view message to determine the source node of the latest view message.

[0154] B2: searching a local node index list according to the node identifier, and determining a position of the entry corresponding to the node identifier in the local message entry list.

[0155] When a node receives the latest view message corresponding to any visible node, it stores it in its own message entry list, and can locate the latest view message of any visible node in the message entry list through the node index list.

[0156] When the source node does not exist in the local node index list, an empty entry can be allocated to the source node in the local message entry list; the node identifier of the source node and the index information of the empty entry are established and added to the node index list; and the latest view message of the source node is written into the message buffer of the empty entry.

[0157] B3: Mark the nodes to which the latest view message needs to be sent, and update the forwarding node list based on the node identifiers of all marked nodes.

[0158] Marking the node to which the latest view message needs to be sent includes: marking a node that is visible to itself and is invisible to the source node.

[0159] Specifically, the node reads the local visible node list and the visible node list of the source node in the latest view message, and determines, after comparison, whether any visible node that the source node should have sent is its own visible node. If any visible node that the source node should have sent is its own visible node, it means that the node does not need to forward the latest view message for the source node, and the source node itself has sent the latest view message to these visible nodes.

[0160] If any node is a visible node of itself but not a visible node of the source node, it indicates that the visible node may not have received the latest view message of the source node and needs to forward the latest view message to the source node.

[0161] B4: Write the latest view message into the message buffer in the entry.

[0162] When the forwarding node list is updated, it means that forwarding is required. At this time, the latest view message of the source node is written into the message buffer in the entry to prepare for forwarding.

[0163] B5: forwarding the latest view message according to the forwarding node list.

[0164] Finally, according to the forwarding node list, the latest view message of the source node is sent to the nodes included in the forwarding node list.

[0165] Therefore, by sending the latest view information of any node to itself and forwarding the latest view information of any node, each node in the cluster can gradually receive the latest view information of any node, so that the latest view information of any node maintains global consistency.

[0166] In the actual implementation process, there may be multiple nodes that forward the latest view information of the same source node. However, since the latest view information of the source node contains a message sequence number, if any node receives the latest view information of the source node from multiple nodes, it compares the message sequence numbers in the multiple latest view information, selects the latest view information with the largest message sequence number to retain, and deletes the rest. If the message sequence numbers of multiple latest view information are the same, only one can be retained.

[0167] Specifically, after the above-mentioned view message is broadcast and synchronized between nodes, when the connection state of the link in the distributed storage cluster changes, all reachable nodes corresponding to itself are obtained, specifically, the target entry corresponding to itself is obtained in the local message entry list, and the message entry list stores the target entry corresponding to itself and the entry of any node, and the entry includes the view message of the corresponding node received by itself.

[0168] The latest view message is obtained from the target entry, and node identifiers of all visible nodes currently corresponding to the self are determined based on the latest view message, wherein the visible nodes are nodes that directly communicate with the self.

[0169] Based on the node identifiers of all currently corresponding visible nodes, the entries corresponding to all visible nodes are searched in the message entry list; and according to the entries corresponding to all visible nodes, the node identifiers of all reachable nodes corresponding to the node are determined.

[0170] Specifically, the node identifiers of all reachable nodes corresponding to the node can be obtained layer by layer according to the breadth-first search. For example, the visible nodes corresponding to the node are first determined, and the entries corresponding to all visible nodes are searched in the message entry list according to the node identifiers of the visible nodes to obtain the latest view message of each visible node. The latest view message of the visible node includes the visible node list, and then the node identifiers of all visible nodes corresponding to the visible node can be known. In this way, the node identifiers of all reachable nodes corresponding to the node can be obtained layer by layer.

[0171] Then, according to the node identifiers of all reachable nodes corresponding to itself, the entry corresponding to each reachable node is obtained in the message entry list; the entry corresponding to each reachable node is searched, and it is determined whether the entry corresponding to any reachable node stores the latest view message corresponding to the reachable node.

[0172] S102: When the latest view messages corresponding to all reachable nodes corresponding to the local device exist, it is determined that the networking condition is met.

[0173] The essence of judging whether the networking conditions are met is whether the current cluster is in a stable state. If the nodes in the cluster are still in synchronization with the latest view message after the link connection status changes, it indicates that the current cluster is still in an unstable state.

[0174] Therefore, if the node locally stores the latest view messages corresponding to all reachable nodes, it is determined that the networking conditions are met and a new cluster can be formed.

[0175] When the entry corresponding to any reachable node does not store the latest view message corresponding to the reachable node, it is determined that the networking condition is not met; after the target time period, it is re-judged whether the networking condition is met, that is, if the node has not received the latest view message of any reachable node, it is equal to the target time period, and it is checked again whether the latest view message of the reachable node is received. If it is received, the networking condition is met. If it is not received, the target time period is continued to be waited.

[0176] In the actual implementation process, the length of the target time period can be customized according to the needs of the actual application, and this embodiment does not impose any limitation.

[0177] S103: When the networking conditions are met, the optimal fully connected subgraph in the current connection state is solved based on all reachable nodes corresponding to the node itself.

[0178] For example, the optimal fully connected subgraph can be determined based on a genetic algorithm. The purpose of the genetic algorithm is to solve the largest fully connected subgraph for a given set of nodes. Specifically, a view is assigned to each node, thereby assigning all nodes to a series of pairwise disjoint views, and expecting that a certain partition contains the largest fully connected subgraph. If basic graph theory methods are used, the complexity of this solution process is n factorial, which cannot be used in a production environment. The genetic algorithm used in this embodiment can control this complexity to a constant order of magnitude.

[0179] Reference Figure 4 , shows a flow chart of the steps for determining the optimal fully connected subgraph provided in an embodiment of the present application. Specifically, when the networking conditions are met, the process of solving the optimal fully connected subgraph in the current connection state based on all reachable nodes corresponding to the node itself may include the following sub-steps:

[0180] C1: Determine an initial node set based on itself and all reachable nodes corresponding to itself, and generate an initial view based on the initial node set.

[0181] All the reachable nodes corresponding to the node are taken as the initial node set. In the initial node view, the nodes can be sorted from small to large according to the node identifiers of the nodes, and all the nodes in the initial node set can be regarded as a view.

[0182] In this embodiment, when determining the optimal fully connected subgraph based on the genetic algorithm, multiple hypotheses can be determined first. The hypotheses refer to making an assumption first and performing the genetic algorithm calculation according to this assumption. The hypotheses in this embodiment refer to hypotheses that include different views. A hypotheses can include only one view or multiple views, and any view contains at least one node.

[0183] For example, the initial view including itself and all its reachable nodes can be taken as a virtual setting 0. For example, if all reachable nodes of node a include node b, node c and node d, then the initial view corresponding to the virtual setting 0 is {a, b, c, d}.

[0184] C2: Segment the initial view to obtain a hypothetical set including multiple hypotheses.

[0185] A plurality of assumptions are obtained by segmenting according to the initial view. At this time, each assumption obtained by segmenting according to the initial view includes at least two segmented views, and each node exists in only one segmented view.

[0186] For example, when multiple assumptions in the assumption set are divided, one node can be used as a view and all other nodes can be used as a view. There can also be multiple division methods, but each node can only exist in one view at the same time, and each view is set with a corresponding view index number. For example, when the initial view is used as assumption 0, the assumptions that can be divided are as follows:

[0187] It is proposed to set 0: {a, b, c, d};

[0188] Assume 1: {a}+{b, c, d}

[0189] Assume 2: {b}+{a, c, d}

[0190] Proposed 3: {c}+{a, b, d}

[0191] Proposed 4: {d}+{a, b, c}

[0192] Proposed 5: {a, b}+{c}+{d}

[0193] Proposed 6: {a, b} + {c, d}

[0194] …

[0195] In the actual implementation process, various random segmentation views may be generated as needed, which is not limited in this embodiment.

[0196] C3: Calculate the fitness corresponding to each hypothesis in the hypothesis set respectively.

[0197] The process of calculating the fitness corresponding to each proposed setting is:

[0198] For any hypothesis, determining the number of fully connected subgraphs of the segmented views included in the hypothesis and the number of nodes in any fully connected subgraph;

[0199] The proposed fitness is calculated based on the number of fully connected subgraphs, the maximum number of nodes in the cluster, and the number of nodes in any fully connected subgraph.

[0200] Specifically, the formula for calculating the fitness of any proposed model is:

[0201]

[0202] Where F is the fitness, N is the maximum number of nodes in the cluster, and n is the number of nodes in any fully connected subgraph. V nis the number of the fully connected subgraphs.

[0203] After calculating the fitness corresponding to each assumption, all assumptions can be sorted in order from small to large fitness.

[0204] C4: Performing hybridization or mutation processing on multiple hypotheses in the hypothetical set to obtain multiple new hypotheses.

[0205] Specifically, performing hybridization processing on multiple hypotheses in the hypothetical set includes:

[0206] Obtain any two hypotheses from the hypothetical set as the first hypotheses and the second hypotheses;

[0207] At least one node in the initial node set is made to use the view segmentation result in the first assumption, and the remaining nodes are made to use the view segmentation result in the second assumption, so as to generate a new assumption.

[0208] For example, the set of false initial nodes includes nodes a, b, c and d, and two assumptions are obtained randomly, where:

[0209] The first proposed view is proposed view A, which includes view 0 and view Figure 1 , split into: {a, b} + {c, d},

[0210] The second proposed setting is proposed setting B including Figure 1 And Vision Figure 2 : {a, b, c}+{d}

[0211] For example, we can let nodes a and c use the view segmentation result in the first assumption, and let nodes b and d use the view segmentation result in the second assumption. Then, in the generated new assumption, node a should be divided in view 0 according to the first assumption, and node b should be divided in view 1 according to the second assumption. Figure 1 In the example, node c should be divided into Figure 1 In the example, node d should be divided into Figure 2 The new assumptions finally obtained include view 0, view Figure 1 And Vision Figure 2 : {a}+{b, c}+{d}.

[0212] Specifically, performing mutation processing on multiple assumptions in the assumption set includes:

[0213] Obtain any hypothesis from the set of hypotheses, randomly change the view segmentation result of at least one node in the hypotheses, and generate a new hypotheses.

[0214] For example, the random acquisition of the proposed 6 includes view 0 and view Figure 1: {a, b} + {c, d}, randomly change at least one point of the view segmentation results, and when generating a new assumption, split the node b in view 0 into view Figure 2 In the new proposed view, the new view includes view 0, view Figure 1 And Vision Figure 2 :{a}+{c,d}+{b}.

[0215] C5: Based on the multiple new assumptions, iteratively update the assumption set.

[0216] First, for any new assumption, the fitness corresponding to the new assumption is determined, and then it is determined whether the fitness of the new assumption is greater than the current minimum fitness in the assumption set.

[0217] When the fitness of the new proposed setting is greater than the current minimum fitness, the proposed setting corresponding to the current minimum fitness is replaced by the new proposed setting; when the fitness of the new proposed setting is not greater than the current minimum fitness, the new proposed setting is discarded.

[0218] When the minimum fitness in the proposed set does not change in the target number of iterations, the iterative update of the proposed set is stopped.

[0219] For example, the target number can be set according to the needs of the actual application. For example, the target number can be set to 4, that is, if the newly proposed fitness cannot replace the minimum fitness for 4 consecutive times, the representation can stop iterating.

[0220] C6: In the updated set of hypotheses, the largest fully connected subgraph contained in the hypotheses with the largest fitness is selected as the optimal fully connected subgraph, where any two nodes in the fully connected subgraph have a physical communication link.

[0221] After multiple hybridization or mutation iterations, the fitness of each hypothesis in the hypothesis set is difficult to be improved. At this time, the hypothesis with the largest fitness is selected as the final hypothesis, and the largest fully connected subgraph is selected from the multiple views of the final hypothesis, that is, the fully connected subgraph containing the largest number of nodes is the most optimal fully connected subgraph, and there is a physical communication link between any two nodes in any fully connected subgraph.

[0222] In a feasible implementation, when the number of hypotheses with the largest fitness in the updated hypotheses set is greater than 1, the corresponding largest fully connected subgraphs are obtained from the multiple hypotheses with the largest fitness respectively; from each of the largest fully connected subgraphs, the largest fully connected subgraph where the node with the smallest node identifier is located is selected as the optimal fully connected subgraph.

[0223] That is, when the maximum fitness corresponds to multiple assumptions, the largest fully connected subgraph is obtained from these assumptions with the largest fitness. If there are multiple largest fully connected subgraphs, the largest fully connected subgraph with the smallest node identifier is selected as the optimal fully connected subgraph.

[0224] S104: Networking is performed based on the optimal fully connected subgraph to generate a new cluster, wherein a physical communication link exists between any two nodes in the new cluster.

[0225] Since the latest view message of each node in the cluster will eventually synchronize all nodes, and the genetic algorithm process executed by each node is the same, the optimal fully connected subgraph finally obtained by any node is the same result.

[0226] For example, for any node, the optimal fully connected subgraph finally generated corresponds to a view index number, and a view attribution array can be set. In the view attribution array, the relationship between the view index number of the optimal fully connected subgraph and the node identifier of each node is mapped. For example, node a belongs to the optimal fully connected subgraph, and the view index number corresponding to the node identifier of node a in the view attribution array is view 0, and then the view attribution data is stored in the node's own topological view list.

[0227] This method is mainly used for cluster range delineation in distributed storage clusters. When the network links in the cluster change, it is necessary to select a reliable subset of reachable nodes as a carrier for the cluster to continue operating. The complexity of using traditional graph theory methods to solve this problem is extremely high. For example, the complexity of the general solution algorithm is O(n!). This method can control this complexity to a constant order of magnitude under common circumstances, and control the algorithm complexity of re-networking to O(1), so that the cluster range delineation task can be completed efficiently, greatly shortening the cluster downtime and business suspension time. The SAN storage cluster built based on this method shows extremely high availability. In the case of complex network partitions, the average re-networking time is about 2-3s, which greatly reduces storage offline events during single point failures or network partitions, and greatly improves cluster availability.

[0228] Reference Figure 5 , shows a schematic diagram of cluster nodes provided in an embodiment of the present application, assuming a four-node cluster {a, b, c, d}, where there were direct links between nodes. Now node d is offline, and the other three nodes respectively perceive this offline information and start information exchange. After the network is stable, it enters the topology construction stage, that is, re-networking.

[0229] The following division methods can be included when dividing the proposed area:

[0230] Assume 1) that all nodes are in the same view: {a, b, c};

[0231] In this partition, the number of fully connected views with 3 nodes is 1, and there is no fully connected view with other number of nodes. Therefore, according to the fitness calculation formula, the fitness can be assumed to be:

[0232] F=(2*32)^(3-1)*1= 64^2=4096;

[0233] Assume 2), split the nodes into {a}+{b, c}, there is one fully connected view with one node, and there is one fully connected view with two nodes, then the fitness of the proposed solution is:

[0234] F= (2*32)^(1-1)*1+(2*32)^(2-1)*1=64^0+64^1=65;

[0235] Assume 3), split the node into {b}+{a, c}, as in the fitness calculation process of Assume 2), the fitness of Assume 3) is also F=65;

[0236] Assume 4) to split the nodes into {c}+{a, b}. Similarly, assume that the fitness of 4) is F=65;

[0237] It can also be divided into other random view assumptions and the fitness F of each assumption is calculated separately. However, it can be seen that the fitness F value of assumption 1) of the view containing 3 nodes is much larger than the F value of other non-maximum subgraphs. Therefore, the fully connected view with the largest fitness can be quickly selected through the genetic algorithm.

[0238] Reference Figure 6 , shows a schematic diagram of a distributed storage cluster provided in an embodiment of the present application, the distributed storage cluster includes multiple nodes 1-n, wherein there is a direct link between any two nodes; each node is configured to locally maintain the following data:

[0239] A node index list, which is used to record the index information of the corresponding entries in the message entry list of all reachable nodes of the node;

[0240] A visible node list, used to record all nodes directly connected to the node;

[0241] A connection status buffer, used to store the previous connection status of the node;

[0242] a message entry list, corresponding to the node index list, and used to store entries corresponding to each node identifier; wherein each entry includes a message buffer and a forwarding node list; the message buffer is used to record the latest view message generated by the node corresponding to the node identifier; the forwarding node list is used to record the node identifier of the node to which the latest view message stored in the entry needs to be sent;

[0243] Any node is configured to execute the steps in the method described in the embodiment to re-network and generate a new cluster when the connection status of the link in the cluster changes.

[0244] Reference Figure 7 , shows a schematic diagram of a computer device provided in an embodiment of the present application, including: at least one processor 701, and a memory 702, wherein the memory 702 stores a computer program that can be run on the processor 701, wherein the processor 701 executes the cluster networking method described in the embodiment when executing the computer program.

[0245] Reference Figure 8 , shows a schematic diagram of a non-volatile readable storage medium provided in an embodiment of the present application, wherein the non-volatile readable storage medium 800 stores a computer program 801, wherein the computer program 801, when executed by a processor, performs the cluster networking method described in the embodiment.

[0246] Reference Fig. 9 , shows a schematic diagram of a computer program product provided in an embodiment of the present application, wherein the computer program product 900 includes a computer program / instruction 901, which, when executed by a processor, implements the cluster networking method described in the embodiment.

[0247] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.

[0248] Those skilled in the art will appreciate that the embodiments of the present application can be provided as methods, devices, or computer program products. Therefore, the present application can adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application can adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0249] The embodiments of the present application are described with reference to the flowcharts and / or block diagrams of the methods, terminal devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing terminal device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing terminal device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0250] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing terminal device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0251] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal device so that a series of operating steps are executed on the computer or other programmable terminal device to produce a computer-implemented process, thereby providing instructions for executing on the computer or other programmable terminal device to implement the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0252] Although the preferred embodiments of the present application have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the embodiments of the present application.

[0253] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or terminal device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or terminal device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or terminal device including the elements.

[0254] Specific examples are used herein to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea. At the same time, for those skilled in the art, according to the idea of ​​the present application, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.

Claims

1. A cluster networking method, characterized in that: Applied to any node in a distributed storage cluster, the method includes: When the connection state of the link in the distributed storage cluster changes, all reachable nodes corresponding to the distributed storage cluster are obtained, wherein there is a physical communication link between any two nodes in the distributed storage cluster, and the reachable nodes are nodes that any node directly or indirectly communicates with; When the local computer has the latest view messages corresponding to all reachable nodes corresponding to itself, it is determined that the networking condition is met; Under the condition of satisfying the networking conditions, the optimal fully connected subgraph in the current connection state is solved based on all reachable nodes corresponding to the node itself, including: determining an initial node set based on the node itself and all reachable nodes corresponding to the node itself, and generating an initial view based on the initial node set; segmenting the initial view to obtain a set of hypothetical assumptions containing multiple hypotheses, wherein each hypothetical assumption includes at least two segmented views, and each node exists in only one segmented view; respectively calculating the fitness corresponding to each hypothetical assumption in the set of hypothetical assumptions; performing hybridization or mutation processing on multiple hypotheses in the set of hypothetical assumptions to obtain multiple new hypotheses; iteratively updating the set of hypothetical assumptions based on the multiple new hypotheses; in the updated set of hypothetical assumptions, selecting the largest fully connected subgraph contained in the hypothetical assumption with the largest fitness as the optimal fully connected subgraph, and any two nodes in the fully connected subgraph have a physical communication link; Networking is performed based on the optimal fully connected subgraph to generate a new cluster, wherein there is a physical communication link between any two nodes in the new cluster; The method also includes, when a connection state of a link in the distributed storage cluster changes, a node corresponding to the link change generates a latest view message, and broadcasts the latest view message to all nodes.

2. The cluster networking method according to claim 1, characterized in that: Get all reachable nodes corresponding to itself, including: Obtaining a target entry corresponding to itself from a local message entry list, wherein the message entry list stores the target entry corresponding to itself and an entry of any node, wherein the entry includes a view message of the corresponding node received by itself; Acquire the latest view message from the target entry, and determine the node identifiers of all visible nodes currently corresponding to itself based on the latest view message, wherein the visible nodes are nodes that directly communicate with itself; Based on the node identifiers of all currently corresponding visible nodes, searching the message item list for items corresponding to all the visible nodes; According to the entries corresponding to all the visible nodes, the node identifiers of all the reachable nodes corresponding to the node are determined.

3. The cluster networking method according to claim 2, characterized in that: After obtaining all reachable nodes corresponding to itself, the method further includes: According to the node identifiers of all reachable nodes corresponding to itself, obtaining the entry corresponding to each reachable node in the message entry list; Search for entries corresponding to each reachable node, and determine whether the entry corresponding to any reachable node stores the latest view message corresponding to the reachable node.

4. The cluster networking method according to claim 3, characterized in that: After determining whether the entry corresponding to any reachable node stores the latest view message corresponding to the reachable node, the method further includes: When the entry corresponding to any reachable node does not store the latest view message corresponding to the reachable node, it is determined that the networking condition is not met; After the target time period has passed, re-judge whether the networking conditions are met.

5. The cluster networking method according to claim 1, characterized in that: Calculating the fitness corresponding to each assumption in the assumption set respectively, including: For any hypothesis, determining the number of fully connected subgraphs of the segmented views included in the hypothesis and the number of nodes in any fully connected subgraph; The proposed fitness is calculated based on the number of fully connected subgraphs, the maximum number of nodes in the cluster, and the number of nodes in any fully connected subgraph.

6. The cluster networking method according to claim 5, characterized in that: The formula for calculating the fitness of any proposed model is: Where F is the fitness, N is the maximum number of nodes in the cluster, and n is the number of nodes in any fully connected subgraph. V n is the number of the fully connected subgraphs.

7. The cluster networking method according to claim 1, characterized in that: Performing a hybridization process on multiple hypotheses in the hypothetical set includes: Obtain any two hypotheses from the hypothetical set as the first hypotheses and the second hypotheses; At least one node in the initial node set is made to use the view segmentation result in the first assumption, and the remaining nodes are made to use the view segmentation result in the second assumption, so as to generate a new assumption.

8. The cluster networking method according to claim 1, characterized in that: Performing mutation processing on multiple assumptions in the assumption set includes: Obtain any hypothesis from the set of hypotheses, randomly change the view segmentation result of at least one node in the hypotheses, and generate a new hypotheses.

9. The cluster networking method according to claim 1, characterized in that: Based on the multiple new assumptions, iteratively updating the assumption set includes: For any new proposed design, determine the fitness corresponding to the new proposed design; Determine whether the newly proposed fitness is greater than the current minimum fitness in the proposed set; When the fitness of the new proposed setting is greater than the current minimum fitness, the proposed setting corresponding to the current minimum fitness is replaced by the new proposed setting; When the fitness of the new proposed setting is not greater than the current minimum fitness, discarding the new proposed setting; When the minimum fitness in the proposed set does not change in the target number of iterations, the iterative update of the proposed set is stopped.

10. The cluster networking method according to claim 1, characterized in that: After iteratively updating the set of hypotheses based on the multiple new hypotheses, the method further includes: In the updated set of hypotheses, when the number of hypotheses with the largest fitness is greater than 1, the largest fully connected subgraphs corresponding to the multiple hypotheses with the largest fitness are obtained respectively; From each of the largest fully connected subgraphs, select the largest fully connected subgraph where the node with the smallest node identifier is located as the optimal fully connected subgraph.

11. The cluster networking method according to claim 1, characterized in that: The method further comprises: When the refresh interval is reached or the connection status of the link in the distributed storage cluster changes, the latest view message of the distributed storage cluster is generated, and the latest view message includes: the current connection status information, the previous connection status information and the cluster node status information; The latest view message is stored in a local message item list; Mark the nodes to which the latest view message needs to be sent, and update the forwarding node list based on the node identifiers of all marked nodes; wherein marking the nodes to which the latest view message needs to be sent includes: marking all visible nodes of the node; The latest view message is forwarded according to the forwarding node list.

12. The cluster networking method according to claim 11, characterized in that: Generates its own latest view message, including: Obtain the message sequence number of the last view message, its own node ID, and cluster node status from the local non-volatile memory, and obtain the visible node list and the last connection status locally; updating the message sequence number of the previous view message to obtain the latest message sequence number, and writing the latest message sequence number into the non-volatile memory; Write the latest message sequence number, its own node identifier, cluster node status, visible node list and last connection status into the message buffer of the corresponding entry in the local message entry list; A latest view message is generated based on the data in the message buffer.

13. The cluster networking method according to claim 12, characterized in that: The message sequence number of the previous view message is updated to obtain the latest message sequence number, including: When the refresh interval is reached, the message sequence number is increased by 1 as the latest message sequence number; When the connection status of the link in the distributed storage cluster changes, the message sequence number is increased by 2 to serve as the latest message sequence number.

14. The cluster networking method according to claim 11, characterized in that: Before generating its own latest view message, also include: Traverse all nodes directly connected to itself to determine whether each node can communicate with itself normally; When any node can communicate with itself normally, the node is determined to be a visible node corresponding to itself; Get the node IDs of all visible nodes and update the local visible node list.

15. The cluster networking method according to claim 14, characterized in that: In the case that any node can communicate normally with itself, the method further includes: Determine whether any visible node exists in the local node index list; If the visible node does not exist in the node index list, a null entry is allocated to the visible node in the local message entry list; A node identifier of the visible node and index information of the empty entry are established and added to the node index list.

16. The cluster networking method according to claim 1, characterized in that: The method further comprises: Receive the latest view message sent by any visible node; Obtaining a node identifier in the latest view message, and determining a source node of the latest view message; According to the node identifier, searching a local node index list to determine a position of an entry corresponding to the node identifier in a local message entry list; Marking the nodes to which the latest view message needs to be sent, and updating the forwarding node list based on the node identifiers of all marked nodes; wherein marking the nodes to which the latest view message needs to be sent includes: marking nodes that are visible to themselves and invisible to the source node; Writing the latest view message into a message buffer in the entry; The latest view message is forwarded according to the forwarding node list.

17. The cluster networking method according to claim 16, characterized in that: Mark the node that is visible to itself and invisible to the source node, including: Read the local visible node list and the visible node list of the source node in the latest view message; Mark all nodes that exist in the local visible node list and not in the source node's visible node list.

18. The cluster networking method according to claim 16, characterized in that: In the case where the source node does not exist in the local node index list, the method further includes: In the local message entry list, allocating an empty entry to the source node; Establishing a node identifier of the source node and index information of the empty entry, and adding them to the node index list; The latest view message of the source node is written into the message buffer of the empty entry.

19. A distributed storage cluster, characterized in that: It includes multiple nodes, where any two nodes have a direct link; any node is configured to maintain the following data locally: A node index list, which is used to record the index information of the corresponding entries in the message entry list of all reachable nodes of the node; A visible node list, used to record all nodes directly connected to the node; A connection status buffer, used to store the previous connection status of the node; a message entry list, corresponding to the node index list, and used to store entries corresponding to each node identifier; wherein each entry includes a message buffer and a forwarding node list; the message buffer is used to record the latest view message generated by the node corresponding to the node identifier; the forwarding node list is used to record the node identifier of the node to which the latest view message stored in the entry needs to be sent; Any node is configured to execute the steps in the cluster networking method according to any one of claims 1 to 18 to re-network and generate a new cluster when the connection status of a link in the cluster changes.

20. A computer device, characterized in that: include: At least one processor, and a memory, wherein the memory stores a computer program that can be run on the processor, wherein the processor executes the cluster networking method according to any one of claims 1 to 18 when executing the computer program.

21. A non-volatile readable storage medium, characterized in that: The non-volatile readable storage medium stores a computer program, wherein the computer program, when executed by a processor, performs the cluster networking method according to any one of claims 1 to 18.

22. A computer program product comprising a computer program / instructions, characterized in that When the computer program / instruction is executed by a processor, the cluster networking method described in any one of claims 1 to 18 is implemented.

Citation Information

Patent Citations

  • Computer-implemented system and method for updating network's knowledge of network's topology

    CN110199500A

  • Main node determination method and device in distributed cluster, equipment and storage medium

    CN111416739A