Control cluster fault detection method, device, electronic device and readable storage medium
By obtaining the control cluster node information and using the breadth-first traversal algorithm to establish a node relationship graph, the problem of low fault detection efficiency in the existing technology is solved, the fault type and fault source identification are quickly determined, and the fault detection efficiency is improved.
Patent Information
- Application Number
- CN202211337671.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-10-28
- Publication Date
- 2024-10-22
- Estimated Expiration
- 2042-10-28
AI Technical Summary
In the existing technology, the execution efficiency of control cluster fault detection and analysis is low and the fault type cannot be accurately determined, resulting in a waste of system resources.
By obtaining the information of the control cluster nodes, a node relationship graph is established, and the breadth-first traversal algorithm is called to generate traversal calculation results to determine the fault type.
Quickly determine the connection status and fault type of nodes and identify the fault source, which significantly improves the execution efficiency of fault detection.
Smart Images

Figure CN115766396B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of service control management, and in particular to a control cluster fault detection method, device, electronic device and readable storage medium. Background Art
[0002] The electronic information service cluster established by relying on device servers has efficient business processing capabilities. In order to ensure the normal operation in daily use, fault detection and analysis methods for the service cluster are required.
[0003] In the related art, the operation management and fault analysis of multiple control clusters mainly rely on view management. In the view manager, the operating status of all service nodes in the service cluster can be detected in real time; when a service node fails, the event manager is notified to handle the corresponding fault problem.
[0004] However, in the existing technical solutions, only the identity of the failed node can be located and identified, but the type of failure that occurred cannot be accurately determined; for cluster fault detection and analysis, the execution efficiency is low, resulting in a waste of system resources. Summary of the invention
[0005] The embodiments of the present invention provide a control cluster fault detection method, device, electronic device and readable storage medium to solve the problem of low efficiency in cluster fault detection and analysis in the prior art.
[0006] In a first aspect, an embodiment of the present invention provides a control cluster fault detection method, wherein the method comprises:
[0007] Obtaining node information for a node in a control cluster, the control cluster being composed of a plurality of control machines, the control machine including at least one node; the node information including: an identifier of the node and a connection relationship between the nodes;
[0008] Establishing a node relationship graph of the control cluster according to the node information, wherein the node relationship graph is used to represent connection links between all the nodes;
[0009] Calling a breadth-first traversal algorithm to perform search and traversal calculations on the node relationship graph to generate a traversal calculation result for each node;
[0010] According to the traversal calculation result, the fault and the fault type of the control cluster are determined.
[0011] In a second aspect, an embodiment of the present invention provides a control cluster fault detection device, the device comprising:
[0012] A node information acquisition module is used to acquire node information for a node in a control cluster, wherein the control cluster is composed of a plurality of control machines, and the control machine includes at least one node; the node information includes: an identifier of the node and a connection relationship between the nodes;
[0013] A node relationship graph generating module, used to establish a node relationship graph of the control cluster according to the node information, wherein the node relationship graph is used to represent the connection links between all the nodes;
[0014] A traversal algorithm execution module is used to call a breadth-first traversal algorithm to perform search and traversal calculations on the node relationship graph to generate a traversal calculation result for each node;
[0015] The fault type judgment module is used to determine the fault and fault type of the control cluster according to the traversal calculation result.
[0016] In a third aspect, the present invention provides an electronic device, comprising: a processor;
[0017] a memory for storing instructions executable by the processor;
[0018] The processor is configured to execute the command to implement the method.
[0019] In a fourth aspect, the present invention provides a readable storage medium, which, when instructions in the readable storage medium are executed by a processor of an electronic device, enables the electronic device to execute the method.
[0020] In an embodiment of the present invention, for a fault detection process of a multi-control cluster, firstly, node information of nodes in the control cluster is obtained, wherein the control cluster is composed of multiple control machines, and the control machine includes at least one node; the node information includes: an identification of the node and a connection relationship between each of the nodes; a node relationship graph of the control cluster is established based on the node information, and the node relationship graph is used to characterize the connection links between all the nodes; a breadth-first traversal algorithm is called to search and traverse the node relationship graph to generate a traversal calculation result for each node, and the calculation result mainly includes the degree of each node and the weight value of the link traversed; according to the traversal calculation result, the fault and fault type of the control cluster are determined; compared with the prior art solution, the degree and weight of different nodes are obtained by traversal calculation, so that the connection status of the current node in the control cluster can be quickly determined, the fault type and the identity of the fault source can be clearly identified, and the execution efficiency of the fault detection operation is greatly improved.
[0021] The above description is only an overview of the technical solution of the present invention. In order to more clearly understand the technical means of the present invention, it can be implemented according to the contents of the specification. In order to make the above and other purposes, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are listed below. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] Various other advantages and benefits will become apparent to those of ordinary skill in the art by reading the detailed description of the preferred embodiments below. The accompanying drawings are only for the purpose of illustrating the preferred embodiments and are not to be considered as limiting the present invention. Moreover, the same reference symbols are used throughout the accompanying drawings to represent the same components. In the accompanying drawings:
[0023] Figure 1 This is a simplified flow chart of the steps of implementing a control cluster fault detection method provided by an embodiment of the present invention;
[0024] Figure 2 It is a complete implementation step flow chart of a control cluster fault detection method provided by an embodiment of the present invention;
[0025] Figure 3 It is a schematic diagram of a control cluster component module provided by an embodiment of the present invention;
[0026] Figure 4 It is a schematic diagram of the contents of a breadth-first traversal result data linked list provided by an embodiment of the present invention;
[0027] Figure 5 This is a schematic diagram of a control cluster failure type provided by an embodiment of the present invention;
[0028] Figure 6 A fault control cluster traversal search result list provided by an embodiment of the present invention;
[0029] Figure 7 is another schematic diagram of a control cluster failure type provided by an embodiment of the present invention;
[0030] Figure 8 Another fault control cluster traversal search result linked list provided by an embodiment of the present invention;
[0031] Fig. 9 is another schematic diagram of a control cluster failure type provided by an embodiment of the present invention;
[0032] Fig.10 Another fault control cluster traversal search result linked list provided by an embodiment of the present invention;
[0033] Fig.11 It is a block diagram of the module composition of a control cluster fault detection device provided by an embodiment of the present invention;
[0034] Fig.12 is a functional component relationship diagram of an electronic device provided by an embodiment of the present invention;
[0035] Fig.13 It is a functional component relationship diagram of another electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0036] The exemplary embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present invention are shown in the accompanying drawings, it should be understood that the present invention can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided in order to enable a more thorough understanding of the present invention and to enable the scope of the present invention to be fully communicated to those skilled in the art.
[0037] Reference Figure 1 , Figure 1 is a brief flow chart of the steps of a control cluster fault detection method provided by an embodiment of the present invention, such as Figure 1 As shown, the method includes:
[0038] Step 101, obtaining node information for nodes in a control cluster, wherein the control cluster is composed of multiple control machines, and the control machine includes at least one node; the node information includes: an identifier of the node and a connection relationship between the nodes.
[0039] The service control management system uses a control cluster with multiple nodes as its hardware foundation. In real applications, it can support more complex computing service scenarios and has certain disaster recovery redundancy capabilities. The decentralized architecture design enables the system to maintain normal operation when a single node in the cluster fails.
[0040] Generally, a multi-control cluster is composed of multiple control nodes, and the control clusters are named and distinguished according to the number of nodes in the cluster. For example, a control cluster with four control nodes can be called a "four-control" cluster, and similarly it can be expanded to other "six-control" and "eight-control" node situations; for the convenience of management and maintenance, the same number of nodes are usually allocated and arranged in different service chassis to form a control machine; in a preferred implementation scheme, two control nodes are usually arranged in the same chassis to form a control machine, and then a control cluster is composed of multiple control machines with the same configuration; for a pair of control nodes in the same chassis, a non-transparent bridge (NTB, Non Transparent Briging) module is used in the embodiment of the present invention to establish a link connection between the two nodes; and for control nodes arranged in different control machines, optical fiber cables can be used to establish a connection link, and the embodiment of the present invention does not limit this.
[0041] A control cluster fault detection method provided in an embodiment of the present invention requires first to obtain node information of all nodes in the control cluster; in an embodiment of the present invention, the obtained control cluster node information mainly includes the node identification and the connection relationship between each of the nodes; at the software system level, all nodes in the control cluster have a single identity identification, which records the identity information of the node and the control machine where the node is located, so that the information interaction between the nodes can be effectively directed and communicated when the system is running.
[0042] Step 102: Establish a node relationship graph of the control cluster according to the node information, wherein the node relationship graph is used to represent connection links between all the nodes.
[0043] The node information records the connection relationship between each node, thereby establishing a node relationship graph of the control cluster; wherein, the node relationship graph is an undirected topological relationship set established based on the structure of a "graph", which is a mathematical object used to represent the relationship between objects, and its content elements are mainly composed of "nodes" and "edges"; in an embodiment of the present invention, the "nodes" in the graph correspond to each node in the control cluster, and the "edges" correspond to the link relationship between each node in the control cluster. For the identity relationship between two different nodes connected at both ends of the same edge, different weight values can be assigned to the edge.
[0044] Specifically, the control cluster node relationship graph established in the embodiment of the present invention is an undirected graph. There is no hierarchical relationship between the nodes, and all are peer nodes. In the control cluster, each control node has its own unique identity identifier, which is used to indicate the identity information of the node, and also records the identifier of the control machine where the node is located. The "edge" connecting the nodes is generated or not generated according to the existence or non-existence of real connection links between the nodes.
[0045] The node relationship diagram clearly shows the connection relationship of all nodes in the control cluster, and is also the execution basis of the breadth-first traversal algorithm, which has important reference significance for a control cluster fault detection method provided in an embodiment of the present invention.
[0046] Step 103, calling a breadth-first traversal algorithm, performing search and traversal calculations on the node relationship graph, and generating traversal calculation results for each node.
[0047] Breadth First Search (BFS) is a simple graph search algorithm that aims to systematically expand and check all nodes in the graph to find results. Its characteristics are: it does not consider the possible location of the result and thoroughly searches the entire graph until the result is found; for the search traversal calculation results, it records the sum of the node degree and the corresponding edge weight value after traversing with a single node as the starting node.
[0048] The "degree" of a node is used to represent the sum of the number of all other nodes that are connected to the current node; for example, in an optional implementation scheme of an embodiment of the present invention, for a four-control cluster with four control nodes, under normal circumstances, any of the nodes should have a connection link relationship with the other three nodes except itself, then the degrees of all nodes in the control cluster should be the same and be 3; specifically, according to the size relationship of the node identification number; a traversal calculation is performed with a single node as the traversal starting point, and each traversal calculation ends with the completion of all nodes except the starting node; that is, the number of executions of the BFS algorithm is equal to the number of nodes in the control cluster.
[0049] Benefiting from the operation logic of the BFS traversal algorithm, it is more suitable for quickly locating fault problems within the same controller; compared with the depth-first traversal algorithm (DFS, Depth First Search), the order in which it locates nodes during the search process will not guarantee priority search of the same controller, so BFS is more in line with the traversal calculation needs of the node relationship graph in the embodiment of the present invention.
[0050] Step 104: Determine the fault and fault type of the control cluster according to the traversal calculation result.
[0051] Following step 103, after executing the breadth-first algorithm to traverse and search the node relationship graph, the calculation results of all control nodes are obtained; the fault type of the control cluster is jointly determined based on the degree of the node in the calculation result and the sum of the weight values of the edges accumulated in a single traversal.
[0052] Specifically, in practical applications, for a control cluster with complete link connections, the degrees of all its nodes should be equal and equal to N-1, which is called the node full degree, where N represents the number of nodes owned by the control cluster; referring to the four-control cluster listed in step 103, N=4; then when the control cluster is in a normal state, the degrees of all nodes should be equal to N-1=3; if there is at least one node with a degree less than N-1, it indicates that there is a problem with the link between the node and another node in the control cluster, and it is determined that there must be a link failure in the control cluster.
[0053] Furthermore, for nodes with dissatisfaction, it is necessary to determine their specific fault type through the sum of the weights of the edges with which they are connected; in an embodiment of the present invention, since the weight values of the edges representing the connection links are different for other nodes in the same control machine and other nodes in different control machines; in an optional scheme provided in an embodiment of the present invention, for control nodes in the same control machine, the weight value of their connection links is set to the total number of nodes in the control cluster; and the weight value of node links between different control machines is set to 1.
[0054] Therefore, by comparing the changes in the weight values, it is possible to determine whether the connection failure occurs in the same control machine or between different control machines, as well as the identity information of the node where the connection failure occurs.
[0055] In summary, a control cluster fault detection method provided by an embodiment of the present invention first obtains node information of nodes in a control cluster, wherein the control cluster is composed of multiple control machines, and the control machine includes at least one node; the node information includes: the identification of the node and the connection relationship between each of the nodes; a node relationship graph of the control cluster is established based on the node information, and the node relationship graph is used to characterize the connection links between all the nodes; a breadth-first traversal algorithm is called to search and traverse the node relationship graph to generate a traversal calculation result for each node, and the calculation result mainly includes the degree of each node and the weight value of the link traversed; according to the traversal calculation result, the fault and fault type of the control cluster are determined; compared with the existing technical solutions, the degree and weight of different nodes are obtained by traversal calculation, so as to quickly judge the connection status of the current node in the control cluster, clarify the fault type and the identity of the fault source, and greatly improve the execution efficiency of the fault detection operation.
[0056] Reference Figure 2 , Figure 2 is a complete implementation step flow chart of a control cluster fault detection method provided by an embodiment of the present invention; Figure 2 As shown, the method includes:
[0057] Step 201, obtaining node information for nodes in a control cluster, wherein the control cluster is composed of multiple control machines, and the control machine includes at least one node; the node information includes: an identifier of the node and a connection relationship between the nodes.
[0058] The specific implementation process of this step can refer to the above step 101, which will not be repeated here.
[0059] Step 202: Establish a node relationship graph of the control cluster according to the node information, wherein the node relationship graph is used to represent connection links between all the nodes.
[0060] The specific implementation process of this step can refer to the above step 102, which will not be repeated here.
[0061] Step 203, calling the breadth-first traversal algorithm, searching and traversing the node relationship graph, determining the traversal path with each node as the traversal starting point, and calculating the degree of each node, where the degree of the node is the number of nodes having edges with the node; the edges between adjacent nodes in the node relationship graph are preset with corresponding weight values; the edges between adjacent nodes are used to characterize that there is a connection relationship between the current adjacent nodes.
[0062] Optionally, the traversal calculation results of each node are in the form of a data linked list, which includes the node identifier, the traversal path corresponding to each node, the identifier of the node on the traversal path, and the weight value of the node and the nodes on the traversal path.
[0063] A linked list is a non-continuous and non-sequential storage structure on a physical storage unit. The logical order of data elements is realized through the link order of pointers in the linked list. It is a directed chain data structure that represents the connection relationship between multiple elements. For the traversal algorithm executed in the embodiment of the present invention, its calculation results are expressed in the form of a data linked list. For the individual components connected to each other in the linked list, it mainly includes: the identification of the node, the traversal path corresponding to each node, the identification of the node on the traversal path, and the weight value of the node and the node on the traversal path.
[0064] Optionally, for the nodes establishing connection links in the same control machine, the weight value of the connection link is the number of nodes in the control cluster; for the nodes establishing connection links in different control machines, the weight value of the connection link is 1.
[0065] In a control cluster fault detection method provided in an embodiment of the present invention, different link weights can be assigned to connection links in a node relationship diagram established with control nodes; in an optional implementation scheme, for nodes establishing connection links in the same control machine, the weight value of the connection link is the number of nodes in the control cluster; for nodes establishing connection links in different control machines, the weight value of the connection link is 1; in actual applications, other values can be assigned to the link weights according to actual needs, and the embodiment of the present invention does not limit this.
[0066] Setting different weights for node connection links with different position relationships can effectively distinguish their identity relationships, which is of great significance for the subsequent judgment of control cluster failures.
[0067] Optionally, step 203 may specifically include:
[0068] Sub-step 2031, taking each node as the starting node, executing the breadth-first traversal algorithm according to the node relationship graph, and traversing the target nodes that establish connection links with the starting node in order of the size of the node identifiers, to form the traversal path corresponding to each node.
[0069] For the established node relationship graph, the utility model traverses it in sequence according to the order of the size of the node identifiers; each time, a single node in the control cluster is used as the starting node, and the target nodes that establish connection links with the starting node are traversed in sequence to form the traversal path corresponding to each node.
[0070] Reference Figure 3 , Figure 3 Schematic diagram of a control cluster component module provided by an embodiment of the present invention; Figure 3 As shown, it includes: control machine No. 1 (Site1), control machine No. 2 (Site2), node No. 1 (Node1), node No. 2 (Node2), node No. 3 (Node3), and node No. 4 (Node4); the figure represents a "four-control cluster" with 4 control nodes, among which node No. 1 and node No. 2 are both in control machine No. 1, and node No. 3 and node No. 4 are both in control machine No. 2. There are connection links between all nodes, and the connection relationship is marked by connecting lines in the figure; the nodes and the connecting lines together constitute the node relationship diagram of the four-control cluster.
[0071] When executing the breadth-first traversal algorithm, a single node is used as the target starting point in order of the size of the node identifier, and all nodes connected to the target starting point and the corresponding connection links are traversed; the traversal can be performed in order from large to small or from small to large according to the node identifier. In a preferred scheme provided in an embodiment of the present invention, the traversal is performed in order from small to large according to the node identifier.
[0072] The degree of a node is used to represent the number of nodes that have edges with the node. When describing a data structure such as a graph, the lowercase letter d is often used to represent the degree of a node for ease of writing; see Figure 3 , when the connection link is normal, each node is connected to 3 edges. Therefore, for a normal four-controller cluster, the degree of all its nodes should be equal and equal to the difference between the total number of nodes and 1, that is, d(Node1)=d(Node2)=d(Node3)=d(Node4)=3.
[0073] In the process of executing the breadth traversal algorithm, for a single traversal performed with a single node as the target starting point, the traversal results are recorded in the form of a data linked list; refer to Figure 4 , Figure 4 is a schematic diagram of the contents of a breadth-first traversal result data linked list provided by an embodiment of the present invention; Figure 4 As shown, it includes: node identification, traversal path and weight values of nodes on the traversal path; and sequentially shows the linked list relationship of traversing with a single node in the four-controller cluster as the target starting node.
[0074] Specifically, taking the first row of linked list links in the figure as an example, starting with node 1 as the target starting point, passing through node 2, node 3, and node 4 in sequence; where 402 identifies the traversal path corresponding to the link relationship between node 1 and node 2, such as Figure 3As shown in the node relationship, since node 1 and node 2 are both in control machine 1, the link weight value between node 1 and node 2 is 4; after traversing node 2, node 3 is traversed in the order of identification, and node 3 and node 1 are respectively in different control machines, so the weight value corresponding to their link relationship is 1; after traversing node 3, node 4 is continued to be traversed, and the link relationship between node 4 and node 1 is the same as that of node 3, so the corresponding weight value is also 1; after passing node 4, all nodes in the current control cluster have been traversed, so the next node address pointed to by the linked list traversal path after node 4 is empty (NULL), which indicates that the breadth-first traversal algorithm stops traversing the node relationship graph.
[0075] Step 204, taking the weighted result and degree corresponding to the node as the traversal calculation result of the node; the weighted result is the cumulative value of the weight values of the node and the nodes passed on the traversal path calculated with the node as the traversal starting point.
[0076] Following step 203, after executing the breadth-first traversal algorithm, the target nodes that establish connection links with the start node are traversed in order of the size of the node identifiers, and the traversal calculation results can be obtained; including the weighted results and degrees of each node after traversing with itself as the target starting point; refer to Figure 4 In the traversal calculation with node 1 as the target starting point, it passes through nodes 2, 3 and 4 that have connection relationships in turn. The weighted result of the traversal path is: 4+1+1=6, so the final weighted result corresponding to node 1 is 6.
[0077] It is worth noting that in a control cluster fault detection method provided in an embodiment of the present invention, for a linked list generated during the breadth traversal of a node relationship graph, if a connection link existing at a target starting point is interrupted or fails, the corresponding link weight is set to 0; for calculating the cumulative value of the weight values of the target starting node and the nodes passed on the traversal path, it is necessary to sum the links of all nodes, and if the link weight is 0, the total weight for the target starting node will be reduced accordingly.
[0078] Calling the breadth-first traversal algorithm to obtain the node's weight accumulation value and degree can accurately reflect the connection relationship between the node and other nodes in the entire control cluster, which is of great reference significance for the subsequent analysis of node failure types.
[0079] Step 205: According to the traversal calculation result, if there is at least one node whose degree is less than a first threshold, it is determined that a fault exists in the control cluster, and the fault type of the fault is determined.
[0080] After obtaining the calculation results of the breadth-first traversal, the connection status of the control cluster is analyzed; as described in step 104, for a control cluster with complete link connection, the degrees of all nodes should be equal and equal to N-1, which is called the node full degree, where N represents the number of nodes owned by the control cluster; therefore, if there is at least one node with a degree less than N-1, it indicates that there is a problem with the link between the node and another node in the control cluster, and it is determined that there must be a link failure in the control cluster.
[0081] Optionally, step 205 may specifically include:
[0082] Sub-step 2051 : if the degrees of all nodes of the control cluster are less than the first threshold, and there is at least one target node with a degree of 0, then it is determined that the fault type of the system fault is a target node fault.
[0083] Optional, see Figure 5 , Figure 5 is a schematic diagram of a control cluster failure type provided by an embodiment of the present invention; Figure 5 As shown, node 2 itself fails. Figure 3 The link connection relationship of the control node in the normal state is shown. Figure 5 There are faults in the connection between node 2 and all other nodes. The problem is represented by the dotted line, which is different from the connection represented by the solid line in the normal state.
[0084] Reference Figure 6 , Figure 6 A fault control cluster traversal search result list provided by an embodiment of the present invention; Figure 6 As shown in Figure 2, due to a fault in node 2, the links with nodes 1, 3, and 4 are all interrupted. Figure 6 In the traversal linked list, the weights of all traversal paths that pass through node 2 during the traversal process with other nodes as the target and starting nodes are all "0"; similarly, the weights of the links that pass through other nodes during the traversal with node 2 itself as the target and starting node are also "0".
[0085] In this case, since node 2 does not have any other connected nodes, its node degree is zero, that is, d(Node2) = 0; in the control cluster, if the degrees of all nodes are less than the difference between the total number of nodes and 1, and there is at least one target node with a degree of 0, then the fault type of the system fault is judged to be a target node failure.
[0086] Sub-step 2052: for the first nodes in the same control machine, if the degrees of the first nodes are the same and both are less than the first threshold, it is determined that the fault type of the system fault is a control machine internal communication fault.
[0087] Optional, see Figure 7 , Figure 7 is another schematic diagram of a control cluster failure type provided by an embodiment of the present invention; Figure 7 As shown, the connection link between node 1 and node 2 fails. Figure 3 The link connection relationship of the control node in the normal state is shown. Figure 7 There is a fault in the connection between node 1 and node 2 in the same controller (controller No. 1), and the problem in the connection is indicated by a dotted line, which is different from the connection indicated by a solid line in a normal state.
[0088] Reference Figure 8 , Figure 8 Another fault control cluster traversal search result list provided by an embodiment of the present invention; Figure 8 As shown in Figure 1, the link between node 1 and node 2 fails, so Figure 8 In the traversal linked list, the weights of the traversal paths that pass through each other with node 1 and node 2 as the target start nodes are all "0"; Figure 8 In the traversal linked list of the first row of the path traversed with node 1 as the target starting node, the path weight is recorded as 0 when passing node 2; similarly, in the traversal linked list of the second row of the path traversed with node 2 as the target starting node, the path weight is recorded as 0 when passing node 1.
[0089] In this case, since Node 1 and Node 2 have lost their link connection with each other, their node degrees will be less than the difference between the total number of nodes and 1. In the embodiment of the present invention, the connection link weight inside the same control machine is 4, then d(Node1)=d(Node2)=2. Since the connection relationship between Node 1 and Node 2 and other nodes is normal at this time, the degrees of other nodes remain unchanged, d(Node3)=d(Node4)=3. In addition, for the control nodes that have lost the link inside the same control machine, the sum of the link weights of Node 1 is 1+1=2, and similarly, the sum of the link weights of Node 2 is also 2.
[0090] In the control cluster, for the first nodes in the same control machine, if the degrees of the first nodes are the same and both are less than the first threshold, it is determined that the fault type of the system fault is a control machine internal communication fault.
[0091] Sub-step 2053, for the second nodes located in different control machines, if the degree of the second nodes is less than the first threshold, and the cumulative value of the weight values of the nodes passed on the traversal path with the second node as the traversal starting point is greater than the first threshold, then the fault type is judged to be a connectivity failure between target nodes inside different control machines.
[0092] Optional, see Fig. 9 , Fig. 9 is another schematic diagram of a control cluster failure type provided by an embodiment of the present invention; Fig. 9 As shown, the connection link between node 1 and node 3 fails. Figure 3 The link connection relationship of the control node in the normal state is shown. Fig. 9 There is a fault in the connection between node 1 and node 3 in different control machines, and the problem in the connection is indicated by a dotted line, which is different from the connection indicated by a solid line in a normal state.
[0093] Reference Fig.10 , Fig.10 Another fault control cluster traversal search result list provided by an embodiment of the present invention; Fig.10 As shown in Figure 1, the link between node 1 and node 3 fails, so Fig.10 In the traversal linked list, the weights of the traversal paths that pass through each other with node 1 and node 3 as the target start nodes are all "0"; Fig.10 In the traversal linked list of the first row of the path traversed with node 1 as the target starting node, the path weight is recorded as 0 when passing node 3; similarly, in the traversal linked list of the third row of the path traversed with node 3 as the target starting node, the path weight is recorded as 0 when passing node 1.
[0094] In this case, since Node 1 and Node 3 have lost their link connection with each other, their node degrees will be less than the difference between the total number of nodes and 1. In the embodiment of the present invention, the connection link weight between different control machines is 1, then d(Node1)=d(Node3)=2. Since the connection relationship between Node 1 and Node 3 and other nodes is normal at this time, the degrees of other nodes remain unchanged, d(Node2)=d(Node4)=3. In addition, for the control nodes that have lost the link between different control machines, the sum of the link weights of Node 1 is 1+4=5, and similarly, the sum of the link weights of Node 3 is also 5.
[0095] For the second nodes located in different control machines, if the degree of the second nodes is less than the first threshold, and the cumulative value of the weight values of the nodes passed on the traversal path with the second node as the traversal starting point is greater than the first threshold, then the fault type is judged to be a connectivity failure between target nodes inside different control machines.
[0096] Furthermore, the weight values of the faulty nodes with a degree less than N-1 are analyzed to determine the type of fault that has occurred. When different fault types occur, the changes in their weight values are different from those in the normal state, so the type of fault that has occurred can be determined.
[0097] Step 206: If the degrees of all nodes in the control cluster are equal and equal to the first threshold, it is determined that there is no system failure in the control cluster.
[0098] like Figure 3 In the control cluster module diagram shown in FIG, the connection links between all nodes are normal, and each node is connected by 3 edges. Therefore, for a normal four-control cluster, the degrees of all its nodes should be equal, and equal to the difference between the total number of nodes and 1, that is, d(Node1) = d(Node2) = d(Node3) = d(Node4) = 3; and the accumulated weights after traversal calculation of all nodes are also equal. Figure 3 In the illustrated embodiment, the sum of the weights is: 1+1+4=6.
[0099] In summary, a control cluster fault detection method provided by an embodiment of the present invention first obtains node information of nodes in a control cluster, wherein the control cluster is composed of multiple control machines, and the control machine includes at least one node; the node information includes: the identification of the node and the connection relationship between each of the nodes; a node relationship graph of the control cluster is established based on the node information, and the node relationship graph is used to characterize the connection links between all the nodes; a breadth-first traversal algorithm is called to search and traverse the node relationship graph to generate a traversal calculation result for each node, and the calculation result mainly includes the degree of each node and the weight value of the link traversed; according to the traversal calculation result, the fault and fault type of the control cluster are determined; compared with the existing technical solutions, the degree and weight of different nodes are obtained by traversal calculation, so as to quickly judge the connection status of the current node in the control cluster, clarify the fault type and the identity of the fault source, and greatly improve the execution efficiency of the fault detection operation.
[0100] Reference Fig.11 , Fig.11 is a block diagram of the module composition of a control cluster fault detection device provided by an embodiment of the present invention; Fig.11 As shown, the device comprises:
[0101] The node information acquisition module 301 is used to acquire node information for a node in a control cluster, wherein the control cluster is composed of a plurality of control machines, and the control machine includes at least one node; the node information includes: an identifier of the node and a connection relationship between the nodes;
[0102] A node relationship graph generating module 302 is used to establish a node relationship graph of the control cluster according to the node information, wherein the node relationship graph is used to represent the connection links between all the nodes;
[0103] The traversal algorithm execution module 303 is used to call the breadth-first traversal algorithm to perform search and traversal calculations on the node relationship graph to generate a traversal calculation result for each node;
[0104] The fault type determination module 304 is used to determine the fault and fault type of the control cluster according to the traversal calculation result.
[0105] Optionally, the traversal algorithm execution module 301 further includes:
[0106] A traversal path generation submodule is used to call a breadth-first traversal algorithm, perform search and traversal calculations on the node relationship graph, determine the traversal path that takes each node as the traversal starting point, and calculate the degree of each node; the degree of the node is the number of nodes that have edges with the node;
[0107] The calculation result statistics submodule is used to use the weighted result and degree corresponding to the node as the traversal calculation result of the node; the weighted result is the cumulative value of the weight value of the node and the nodes passed on the traversal path calculated with the node as the traversal starting point.
[0108] The system fault judgment submodule is used to determine, based on the traversal calculation result, if the degree of the node is less than a first threshold, that a fault exists in the control cluster and determine the fault type of the fault.
[0109] Optionally, the traversal path generation submodule further includes:
[0110] The traversal path generation unit is used to take each node as a starting node, execute a breadth-first traversal algorithm according to the node relationship graph, and traverse the target nodes that establish connection links with the starting node in order of the size of the node identifiers to form the traversal path corresponding to each node.
[0111] Optionally, according to the traversal calculation result, if there is at least one node whose degree is less than a first threshold, it is determined that a fault exists in the control cluster, and the fault type of the fault is determined.
[0112] Optionally, the first threshold is: a difference between the total number of nodes in the control cluster and 1.
[0113] Optionally, for the nodes establishing connection links in the same control machine, the weight value of the connection link is the number of nodes in the control cluster; for the nodes establishing connection links in different control machines, the weight value of the connection link is 1.
[0114] Optionally, if the degrees of all nodes of the control cluster are less than the first threshold, and there is at least one target node with a degree of 0, the fault type of the system fault is determined to be a target node fault.
[0115] Optionally, for the first nodes in the same control machine, if the degrees of the first nodes are the same and are both less than the first threshold, the fault type of the system fault is determined to be an internal communication fault of the control machine.
[0116] Optionally, for the second nodes located in different control machines, if the degree of the second nodes is less than a first threshold, and the cumulative value of the weight values of the nodes passed on the traversal path with the second node as the traversal starting point is greater than the first threshold, then the fault type is judged to be a connectivity failure between target nodes inside different control machines.
[0117] Optionally, if the degrees of all nodes in the control cluster are equal and equal to the first threshold, it is determined that there is no system failure in the control cluster.
[0118] Optionally, the traversal calculation results of each node are in the form of a data linked list, which includes the node identifier, the traversal path corresponding to each node, the identifier of the node on the traversal path, and the weight value of the node and the nodes on the traversal path.
[0119] In summary, a control cluster fault detection device provided by an embodiment of the present invention first obtains node information of nodes in a control cluster, wherein the control cluster is composed of multiple control machines, and the control machine includes at least one node; the node information includes: the identification of the node and the connection relationship between each of the nodes; a node relationship graph of the control cluster is established based on the node information, and the node relationship graph is used to characterize the connection links between all the nodes; a breadth-first traversal algorithm is called to search and traverse the node relationship graph to generate a traversal calculation result for each node, and the calculation result mainly includes the degree of each node and the weight value of the link traversed; according to the traversal calculation result, the fault and fault type of the control cluster are determined; compared with the existing technical solutions, the degree and weight of different nodes are obtained by traversal calculation, so as to quickly judge the connection status of the current node in the control cluster, clarify the fault type and the identity of the fault source, and greatly improve the execution efficiency of the fault detection operation.
[0120] Fig.12 is a block diagram of an electronic device 600 according to an exemplary embodiment. For example, the electronic device 600 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, etc.
[0121] Reference Fig.12, the electronic device 600 may include one or more of the following components: a processing component 602 , a memory 604 , a power component 606 , a multimedia component 608 , an audio component 610 , an input / output (I / O) interface 612 , a sensor component 614 , and a communication component 616 .
[0122] The processing component 602 generally controls the overall operation of the electronic device 600, such as operations associated with display, phone calls, data communications, camera operations, and recording operations. The processing component 602 may include one or more processors 620 to execute instructions to complete all or part of the steps of the above-mentioned method. In addition, the processing component 602 may include one or more modules to facilitate the interaction between the processing component 602 and other components. For example, the processing component 602 may include a multimedia module to facilitate the interaction between the multimedia component 608 and the processing component 602.
[0123] The memory 604 is used to store various types of data to support the operation of the electronic device 600. Examples of such data include instructions for any application or method operating on the electronic device 600, contact data, phone book data, messages, pictures, multimedia, etc. The memory 604 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.
[0124] The power supply component 606 provides power to the various components of the electronic device 600. The power supply component 606 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to the electronic device 600.
[0125] The multimedia component 608 includes a screen that provides an output interface between the electronic device 600 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundaries of the touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 608 includes a front camera and / or a rear camera. When the electronic device 600 is in an operating mode, such as a shooting mode or a multimedia mode, the front camera and / or the rear camera may receive external multimedia data. Each front camera and the rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.
[0126] The audio component 610 is used to output and / or input audio signals. For example, the audio component 610 includes a microphone (MIC), and when the electronic device 600 is in an operating mode, such as a call mode, a recording mode, and a voice recognition mode, the microphone is used to receive an external audio signal. The received audio signal can be further stored in the memory 604 or sent via the communication component 616. In some embodiments, the audio component 610 also includes a speaker for outputting audio signals.
[0127] I / O interface 612 provides an interface between processing component 602 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include but are not limited to: a home button, a volume button, a start button, and a lock button.
[0128] The sensor assembly 614 includes one or more sensors for providing various aspects of status assessment for the electronic device 600. For example, the sensor assembly 614 can detect the open / closed state of the electronic device 600, the relative positioning of the components, such as the display and keypad of the electronic device 600, and the sensor assembly 614 can also detect the position change of the electronic device 600 or a component of the electronic device 600, the presence or absence of contact between the user and the electronic device 600, the orientation or acceleration / deceleration of the electronic device 600, and the temperature change of the electronic device 600. The sensor assembly 614 may include a proximity sensor configured to detect the presence of a nearby object without any physical contact. The sensor assembly 614 may also include an optical sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 614 may also include an accelerometer, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
[0129] The communication component 616 is used to facilitate wired or wireless communication between the electronic device 600 and other devices. The electronic device 600 can access a wireless network based on a communication standard, such as WiFi, a carrier network (such as 2G, 3G, 4G or 5G), or a combination thereof. In an exemplary embodiment, the communication component 616 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 616 also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.
[0130] In an exemplary embodiment, the electronic device 600 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to implement a control cluster fault detection method provided in an embodiment of the present invention.
[0131] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 604 including instructions, and the instructions can be executed by a processor 620 of an electronic device 600 to perform the above method. For example, the non-transitory storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.
[0132] Fig.13 is a block diagram of an electronic device 700 according to an exemplary embodiment. For example, the electronic device 700 may be provided as a server. Fig.13 The electronic device 700 includes a processing component 722, which further includes one or more processors, and a memory resource represented by a memory 732, for storing instructions executable by the processing component 722, such as an application. The application stored in the memory 732 may include one or more modules, each corresponding to a set of instructions. In addition, the processing component 722 is configured to execute instructions to perform a control cluster fault detection method provided by an embodiment of the present invention.
[0133] The electronic device 700 may also include a power supply component 726 configured to perform power management of the electronic device 700, a wired or wireless network interface 750 configured to connect the electronic device 700 to a network, and an input / output (I / O) interface 758. The electronic device 700 may operate based on an operating system stored in the memory 732, such as Windows Server™, Mac OS X™, Unix™, Linux™, FreeBSD™ or the like.
[0134] Those skilled in the art will readily appreciate other embodiments of the invention after considering the specification and practicing the invention disclosed herein. The present invention is intended to cover any variations, uses or adaptations of the present invention that follow the general principles of the present invention and include common knowledge or customary techniques in the art that are not disclosed in this disclosure. The description and examples are to be considered exemplary only, and the true scope and spirit of the present invention are indicated by the following claims.
[0135] It should be understood that the present invention is not limited to the exact construction that has been described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the present invention is limited only by the appended claims.
Claims
1. A control cluster fault detection method, characterized in that: The method comprises: Obtaining node information for a node in a control cluster, the control cluster being composed of a plurality of control machines, the control machine including at least one node; the node information including: an identifier of the node and a connection relationship between the nodes; A node relationship graph of the control cluster is established according to the node information, wherein the node relationship graph is used to represent the connection links between all the nodes, and the edges between adjacent nodes in the node relationship graph are preset with corresponding weight values; the edges between adjacent nodes are used to represent that there is a connection relationship between the current adjacent nodes; Calling the breadth-first traversal algorithm to search and traverse the node relationship graph, and generating the traversal calculation results of each node, including: Calling a breadth-first traversal algorithm to search and traverse the node relationship graph, determine the traversal path that each node takes as the traversal starting point, and calculate the degree of each node; the degree of the node is the number of nodes that have edges with the node; The weighted result and degree corresponding to the node are used as the traversal calculation result of the node; the weighted result is the cumulative value of the weight values of the node and the nodes passed on the traversal path calculated with the node as the traversal starting point; Determining the fault and fault type of the control cluster according to the traversal calculation result includes: According to the traversal calculation result, if there is at least one node whose degree is less than a first threshold, it is determined that a fault exists in the control cluster, and the fault type of the fault is determined.
2. The method according to claim 1, characterized in that The first threshold is: the difference between the total number of nodes in the control cluster and 1.
3. The method according to claim 1, characterized in that The step of determining, based on the traversal calculation result, that a fault exists in the control cluster if the degree of the node is less than a first threshold, and determining the fault type of the fault includes: If the degrees of all nodes of the control cluster are less than the first threshold, and there is at least one target node with a degree of 0, then the fault type of the system fault is determined to be a target node fault.
4. The method according to claim 1, characterized in that The step of judging, based on the traversal calculation result, that a system fault exists in the control cluster if the degree of the node is less than a first threshold value, and determining the fault type of the fault includes: For the first nodes in the same control machine, if the degrees of the first nodes are the same and both are smaller than the first threshold, it is determined that the fault type of the system fault is a control machine internal communication fault.
5. The method according to claim 1, characterized in that The step of determining, based on the traversal calculation result, that a fault exists in the control cluster and a fault type of the fault, if at least one of the nodes has a degree less than a first threshold, includes: For the second nodes located in different control machines, if the degree of the second nodes is less than the first threshold, and the cumulative value of the weight values of the nodes passed on the traversal path with the second node as the traversal starting point is greater than the first threshold, then the fault type is judged to be a connectivity failure between target nodes inside different control machines.
6. The method according to claim 1, characterized in that The method further comprises: If the degrees of all nodes in the control cluster are equal and equal to the first threshold, it is determined that there is no system failure in the control cluster.
7. The method according to claim 1, characterized in that For the nodes establishing connection links in the same control machine, the weight value of the connection link is the number of nodes in the control cluster; for the nodes establishing connection links in different control machines, the weight value of the connection link is 1.
8. The method according to claim 1, characterized in that The calling of the breadth-first traversal algorithm to search and traverse the node relationship graph and determine the traversal path taken by taking each node as the traversal starting point includes: Taking each node as the starting node, a breadth-first traversal algorithm is executed according to the node relationship graph, and the target nodes that establish connection links with the starting node are traversed in sequence according to the size order of the node identifiers to form the traversal path corresponding to each node.
9. The method according to claim 1, characterized in that: The traversal calculation results of each node are in the form of a data linked list, which includes the node identifier, the traversal path corresponding to each node, the identifier of the node on the traversal path, and the weight value of the node and the nodes on the traversal path.
10. A control cluster fault detection device, characterized in that: The device comprises: A node information acquisition module is used to acquire node information for a node in a control cluster, wherein the control cluster is composed of a plurality of control machines, and the control machine includes at least one node; the node information includes: an identifier of the node and a connection relationship between the nodes; A node relationship graph generation module is used to establish a node relationship graph of the control cluster according to the node information, wherein the node relationship graph is used to represent the connection links between all the nodes, and the edges between adjacent nodes in the node relationship graph are preset with corresponding weight values; the edges between adjacent nodes are used to represent that there is a connection relationship between the current adjacent nodes; The traversal algorithm execution module is used to call the breadth-first traversal algorithm to search and traverse the node relationship graph to generate the traversal calculation results of each node, including: Determine the traversal path taken by each node as the traversal starting point, and calculate the degree of each node; the degree of the node is the number of nodes having edges with the node; The weighted result and degree corresponding to the node are used as the traversal calculation result of the node; the weighted result is the cumulative value of the weight values of the node and the nodes passed on the traversal path calculated with the node as the traversal starting point; A fault type judgment module is used to determine the fault and fault type of the control cluster according to the traversal calculation result, including: According to the traversal calculation result, if there is at least one node whose degree is less than a first threshold, it is determined that a fault exists in the control cluster, and the fault type of the fault is determined.
11. An electronic device, characterized in that: include: processor; a memory for storing instructions executable by the processor; The processor is configured to execute the instructions to implement the method as claimed in any one of claims 1 to 9.
12. A readable storage medium, characterized in that: When the instructions in the readable storage medium are executed by a processor of an electronic device, the electronic device is enabled to perform the method as claimed in any one of claims 1 to 9.
