Network sub-health state detection method and device, electronic equipment and storage medium
By sending detection information to different detection nodes in the cluster and combining it with reply information, the problem of nodes in a distributed system being difficult to accurately detect the sub-health status of the network is solved and the detection accuracy is improved.
Patent Information
- Application Number
- CN202410864609.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-28
- Publication Date
- 2024-09-17
- Estimated Expiration
- 2044-06-28
AI Technical Summary
In the existing technology, it is difficult for nodes in a distributed system to accurately detect whether their own network is in a sub-healthy state, resulting in low detection accuracy.
By sending detection information to different detection nodes in the cluster, including the network status data of its own node, and receiving the reply information returned by the detection node, it determines whether the network status of its own node is in a sub-health state by combining the network status data of itself and the detection node. .
It improves the accuracy of network sub-health status detection and considers not only the network status of its own node, but also the network status of the detection node, thereby more accurately determining the network status of its own node.
Smart Images

Figure CN118659993A
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a network sub-health state detection method, device, electronic equipment and computer-readable storage medium. Background Art
[0002] The operating status of the network where the nodes in a cluster, such as a distributed system, are located can be divided into three types, namely, "healthy" state, "unhealthy" state and "sub-healthy" state. When the network where the node is located is sub-healthy, it usually causes the distributed system to enter a state of poor performance, so it is necessary to detect the sub-healthy state of the network.
[0003] In the related art, when detecting the sub-health state of a network, a node in a distributed system usually determines whether the network it is in is in a sub-health state based on the information in the detection message it sends. However, it is difficult to accurately detect whether the network its own node is in is in a sub-health state based only on the detection message of its own node.
[0004] In view of this, how to improve the accuracy of network sub-health status detection is a problem that technical personnel in this field need to solve. Summary of the invention
[0005] The purpose of the embodiments of the present invention is to provide a method, device, electronic device and computer-readable storage medium for detecting a sub-healthy state of a network, which can improve the accuracy of detecting a sub-healthy state of a network.
[0006] To solve the above technical problems, the embodiments of the present invention provide the following technical solutions:
[0007] An embodiment of the present invention provides a method for detecting a sub-healthy state of a network, which is applied to any node in a cluster, and includes:
[0008] Sending detection information to a detection node in the cluster; the detection information includes network status data of the own node, and the detection node is different from the own node;
[0009] receiving reply information returned by the detection node; the reply information includes enhanced detection information and the detection information, and the enhanced detection information includes network status data of the detection node;
[0010] According to the reply information of the detection node, it is determined whether the network status of the own node is a sub-healthy network status.
[0011] In some embodiments, the detection node is multiple;
[0012] The step of determining whether the network state of the own node is a sub-healthy state of the network according to the reply information of the detection node comprises:
[0013] For each of the detection nodes, calculate the corresponding network packet loss rate and network delay according to the reply information;
[0014] In the case where at least one of all the network packet loss rates is greater than the packet loss rate threshold or at least one of all the network delays is greater than the delay threshold, for each of the detection nodes, determining a corresponding network detection result according to the reply information returned by the detection node;
[0015] According to the network detection results corresponding to each detection node, it is determined whether the network state of the own node is a sub-healthy state.
[0016] In some embodiments, determining whether the network state of the own node is a network sub-health state according to the network detection results corresponding to each detection node respectively includes:
[0017] When at least one of the network detection results includes that the own node is abnormal among all the network detection results, it is determined that the network state of the own node is a network sub-health state.
[0018] In some embodiments, the network status data in the detection information includes at least one of a first transmission error statistic, a first transmission packet loss statistic, a first transmission timestamp, a first reception error statistic, a first reception packet loss statistic, and a first reception timestamp;
[0019] The network status data in the enhanced detection information includes at least one of a second sending error statistic, a second sending packet loss statistic, a second sending timestamp, a second receiving error statistic, a second receiving packet loss statistic, and a second receiving timestamp.
[0020] In some embodiments, when at least one of all the network packet loss rates is greater than the packet loss rate threshold or at least one of all the network delays is greater than the delay threshold, for each of the detection nodes, determining the corresponding network detection result according to the reply information returned by the detection node includes:
[0021] In the case where at least one of all the network packet loss rates is greater than the packet loss rate threshold, for each of the detection nodes, determine a network detection result according to the first sending error statistic, the first sending packet loss statistic, the first receiving error statistic, the first receiving packet loss statistic, the second sending error statistic, the second sending packet loss statistic, the second receiving error statistic, and the second receiving packet loss statistic in the reply information;
[0022] Or, when there is at least one network delay that is greater than the delay threshold among all network delays, for each detection node, the network detection result is determined according to the first sending timestamp, the first receiving timestamp, the second sending timestamp and the second receiving timestamp in the reply information.
[0023] In some embodiments, determining the network detection result according to the first sending error statistic, the first sending packet loss statistic, the first receiving error statistic, the first receiving packet loss statistic, the second sending error statistic, the second sending packet loss statistic, the second receiving error statistic, and the second receiving packet loss statistic in the reply information includes:
[0024] According to the first sending error statistic and the first sending packet loss statistic, combined with the first sending error statistic and the first sending packet loss statistic in the detection data sent to the detection node last time, determining whether the first sending error statistic increment or the first sending packet loss statistic increment is greater than zero;
[0025] If the first sending error statistic increment or the first sending packet loss statistic increment is greater than zero, determining that the network detection result is that the node itself is abnormal;
[0026] If the first sending error statistical value increment and the first sending packet loss statistical value increment are both not greater than zero, then according to the second sending error statistical value, the second sending packet loss statistical value, the second receiving error statistical value, and the second receiving packet loss statistical value, combined with the second sending error statistical value, the second sending packet loss statistical value, the second receiving error statistical value, and the second receiving packet loss statistical value in the reply data returned by the detection node last received, determine whether the second sending error statistical value increment or the second sending packet loss statistical value increment or the second receiving error statistical value increment or the second receiving packet loss statistical value increment is greater than zero;
[0027] If the second sending error statistic increment or the second sending packet loss statistic increment or the second receiving error statistic increment or the second receiving packet loss statistic increment is greater than zero, determining that the network detection result is that the detection node is abnormal;
[0028] If the second sending error statistic increment, the second sending packet loss statistic increment, the second receiving error statistic increment, and the second receiving packet loss statistic increment are all not greater than zero, judging whether the first receiving error statistic increment or the first receiving packet loss statistic increment is greater than zero according to the first receiving error statistic and the first receiving packet loss statistic, combined with the first receiving error statistic and the first receiving packet loss statistic in the detection data last sent to the detection node;
[0029] If the first received error statistic increment or the first received packet loss statistic increment is greater than zero, determining that the network detection result is that the node itself is abnormal;
[0030] If the first received error statistic increment and the first received packet loss statistic increment are both not greater than zero, it is determined that the network detection result is that the own node and the detection node are not identified to be abnormal.
[0031] In some embodiments, the detection information further includes a first system load value; and the method further includes:
[0032] When the increment of the first transmission error statistic value or the increment of the transmission packet loss statistic value is greater than zero, determining whether the first system load value is greater than a first load threshold, and if so, determining that the central processor of the own node is abnormal; if not, determining that there is a transmission failure in the network of the own node;
[0033] Or, when the increment of the first reception error statistic value or the increment of the first reception packet loss statistic value is greater than zero, determine whether the first system load value is greater than the first load threshold. If so, determine that the central processor of its own node is abnormal; if not, determine that there is a reception failure in the network of its own node.
[0034] In some embodiments, determining the network detection result according to the first sending timestamp, the first receiving timestamp, the second sending timestamp, and the second receiving timestamp in the reply information includes:
[0035] Determine whether a first difference between the second receiving timestamp and the first sending timestamp exceeds a first time threshold;
[0036] If the first difference exceeds the first time threshold, determining that the network detection result is that the node itself is abnormal;
[0037] If the first difference does not exceed the first time threshold, determining whether a second difference between the second sending timestamp and the second receiving timestamp is greater than a second time threshold;
[0038] If the second difference is greater than the second time threshold, determining that the network detection result is that the detection node is abnormal;
[0039] If the second difference is not greater than the second time threshold, determining whether a third difference between the first receiving timestamp and the second sending timestamp is greater than a third time threshold;
[0040] If the third difference is greater than the third time threshold, determining that the network detection result is that the node itself is abnormal;
[0041] If the third difference is not greater than the third time threshold, it is determined that the network detection result is that the own node and the detection node are not identified to be abnormal.
[0042] In some embodiments, the detection information further includes a first system load value; and the method further includes:
[0043] In the case where the first difference exceeds the first time threshold, determining whether the first system load value is greater than the first load threshold, and if so, determining that the central processor of the own node is abnormal; if not, determining that the delay from the own node to the detection node is abnormal;
[0044] Or, when the third difference is greater than the third time threshold, determine whether the first system load value is greater than the first load threshold. If so, determine that the central processor of its own node is abnormal; if not, determine that the delay from the detection node to its own node is abnormal.
[0045] In some embodiments, before sending the detection information to the detection nodes in the cluster, the method further includes:
[0046] A jump selection method is used to determine multiple detection nodes corresponding to the own node from the cluster.
[0047] In some embodiments, determining a plurality of detection nodes corresponding to the own node from the cluster includes:
[0048] Number all nodes in the cluster in the order of their Internet Protocol addresses;
[0049] Take the node next to the own node as the first detection node;
[0050] Determine the number of the second detection node according to the number of the first detection node and the total number of nodes in the cluster in combination with the first calculation relationship;
[0051] According to the number of the first detection node and the total number of nodes in the cluster, the number of the third detection node is determined in combination with the second calculation relationship; the number of the third detection node is greater than the number of the second node;
[0052] A second detection node is determined from the cluster according to the number of the second detection node, and a third detection node is determined from the cluster according to the number of the third detection node.
[0053] In some embodiments, the first calculation relationship is: n2=M+INT(N / 3);
[0054] The second calculation relationship is: n3=M+2*INT(N / 3);
[0055] Among them, n2 represents the number of the second detection node, n3 represents the number of the third detection node, M represents the number of the first detection node, N represents the total number of all nodes in the cluster, and INT() represents the floor function.
[0056] Another aspect of the present invention provides a network sub-health status detection device, which is applied to any node in a cluster, and includes:
[0057] A sending module, used to send detection information to a detection node in the cluster; the detection information includes network status data of the own node, and the detection node is different from the own node;
[0058] A receiving module, configured to receive reply information returned by the detection node; the reply information includes enhanced detection information and the detection information, and the enhanced detection information includes network status data of the detection node;
[0059] The detection module is used to determine whether the network status of its own node is a sub-healthy network status according to the reply information of the detection node.
[0060] Another aspect of the present invention provides an electronic device, including:
[0061] Memory for storing computer programs;
[0062] A processor is used to execute the computer program to implement the steps of the network sub-health status detection method as described above.
[0063] Another aspect of an embodiment of the present invention provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the network sub-health status detection method as described above are implemented.
[0064] It can be seen from the above technical solution that the beneficial effects of the present invention are:
[0065] The present invention provides a network sub-health status detection method, which is applied to any node in a cluster, including: sending detection information to a detection node in the cluster; the detection information includes network status data of the own node, and the detection node is different from the own node; receiving reply information returned by the detection node; the reply information includes enhanced detection information and detection information, and the enhanced detection information includes the network status data of the detection node; according to the reply information of the detection node, determining whether the network status of the own node is a network sub-health status.
[0066] It can be seen that when a node in the implementation of the present invention detects whether its own network is in a sub-healthy state, it sends detection information containing its own network status data to a detection node different from its own node in the cluster. After receiving the detection information, the detection node returns the detection information and returns enhanced detection information carrying the network status data of the detection node. After receiving the reply information returned by each detection node, the node determines whether the network status of its own network is in a sub-healthy state based on the detection information sent by itself and the enhanced detection information of each detection node. In the embodiment of the present invention, when detecting the sub-healthy state of the network, not only the network condition of its own node is considered, but also the network condition of the detection node is considered. Therefore, the sub-healthy state of its own network can be determined more accurately, thereby improving the accuracy of network sub-healthy state detection. BRIEF DESCRIPTION OF THE DRAWINGS
[0067] In order to more clearly illustrate the embodiments of the present invention, the following briefly introduces the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0068] Figure 1 A schematic diagram of a network sub-health status detection method provided by an embodiment of the present invention Figure 2
[0069] Figure 2 Another method for detecting sub-healthy state of a network provided by an embodiment of the present invention is shown in FIG. Figure 2
[0070] Figure 3 A schematic diagram of information interaction between a node and a detection node in a cluster provided by an embodiment of the present invention Figure 2
[0071] Figure 4 A network detection result diagram provided by an embodiment of the present invention Figure 2
[0072] Figure 5 A schematic diagram of a network detection process provided by an embodiment of the present invention when the network packet loss rate is greater than the packet loss rate threshold Figure 2
[0073] Figure 6 Another network detection process provided by an embodiment of the present invention when the network packet loss rate is greater than the packet loss rate threshold Figure 2
[0074] Figure 7A schematic diagram of a network detection process provided by an embodiment of the present invention when the network delay is greater than the delay threshold Figure 2
[0075] Figure 8 Another network detection process provided by an embodiment of the present invention when the network delay is greater than the delay threshold Figure 2
[0076] Fig. 9 A schematic diagram of a network sub-health status detection device provided by an embodiment of the present invention Figure 2
[0077] Fig.10 A schematic diagram of the structure of a network sub-health status detection device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0078] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0079] The terms "including" and "having" in the specification of the present invention and the above-mentioned drawings, as well as any variations thereof, are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device including a series of steps or units is not limited to the listed steps or units, but may include steps or units that are not listed.
[0080] In order to enable those skilled in the art to better understand the solution of the present invention, the present invention is further described in detail below in conjunction with the accompanying drawings and specific implementation methods.
[0081] The operation status of the network where the nodes in the cluster, such as the distributed system, are located can be divided into three types, namely "healthy" state, "unhealthy" state and "sub-healthy" state, among which the state that allows the network to operate normally and can recover quickly after being impacted by the outside world is the "healthy" state; the state of being paralyzed and unable to operate normally is the "sub-healthy" state; the state that can operate normally at ordinary times, but the ability to resist risks is extremely low is the "sub-healthy" state. When the network where the node is located is in sub-health, it usually causes the distributed system to enter a state of low performance, so it is necessary to detect the sub-healthy state of the network. The present invention implements the problem of low detection accuracy of the current network sub-health detection method, and proposes a network sub-health state detection method that can improve the detection accuracy.
[0082] Next, a network sub-health status detection method provided by an embodiment of the present invention is described in detail. Figure 1 A flow chart of a network sub-health state detection method provided in an embodiment of the present invention is provided. The network sub-health state detection method is applied to any node in a cluster. In practical applications, any node can execute the method provided in the embodiment of the present invention. The node executing the method can be called its own node. The embodiment of the present invention describes the technical solution in detail from the perspective of its own node. The method includes:
[0083] S 110: Sending detection information to a detection node in the cluster; the detection information includes network status data of the own node, and the detection node is different from the own node;
[0084] It should be noted that, when any node in the cluster needs to detect the sub-health status of the network in which it is located, it can send detection information to a detection node in the cluster that is different from its own node, wherein the detection information may include the network status data of its own node, and the network status data is data information that can reflect the network status of the node. Among them, the detection node for the own node can be selected in advance from the cluster.
[0085] S120: receiving reply information returned by the detection node; the reply information includes enhanced detection information and detection information, and the enhanced detection information includes network status data of the detection node;
[0086] Specifically, after receiving the network status data, the detection node will return a reply message, wherein the returned reply message includes the detection information received by the detection node and enhanced detection information of the detection node, and the enhanced detection information includes the network status data of the detection node.
[0087] S130: Determine whether the network status of the own node is a sub-healthy network status according to the reply information of the detection node.
[0088] Specifically, after receiving the reply information from the detection node, the own node can further comprehensively judge whether the network status of the network in which the own node is located is a sub-healthy state based on the detection information related to the own node and the enhanced detection information related to the detection node in the reply information.
[0089] It can be seen that when a node in the implementation of the present invention detects whether its own network is in a sub-healthy state, it sends detection information containing its own network status data to a detection node different from its own node in the cluster. After receiving the detection information, the detection node returns the detection information and returns enhanced detection information carrying the network status data of the detection node. After receiving the reply information returned by each detection node, the node determines whether the network status of its own network is in a sub-healthy state based on the detection information sent by itself and the enhanced detection information of each detection node. In the embodiment of the present invention, when detecting the sub-healthy state of the network, not only the network condition of its own node is considered, but also the network condition of the detection node is considered. Therefore, the sub-healthy state of its own network can be determined more accurately, thereby improving the accuracy of network sub-healthy state detection.
[0090] Based on the above embodiments, the embodiments of the present invention further illustrate and introduce the technical solution:
[0091] In the implementation of the present invention, there can be multiple detection nodes. Figure 2 , Figure 2 A flow chart of another network sub-health state detection method provided by an embodiment of the present invention, the method comprising:
[0092] S210: Sending detection information to a detection node in the cluster; the detection information includes network status data of the own node, and the detection node is different from the own node;
[0093] It should be noted that in the embodiment of the present invention, the own node sends detection information to multiple detection nodes in the cluster, and specifically, the detection information may be sent to each detection node once at a preset time interval, wherein the multiple detection nodes are different from the own node.
[0094] like Figure 3 As shown, the nodes in the cluster are A, B, C, D, and E. Taking node A as an example, the detection nodes of node A are B, C, and D, so node A sends detection information to nodes B, C, and D. Taking node B as an example, the detection nodes of node B are C, D, and E, so node B sends detection information to nodes C, D, and E, respectively.
[0095] S220: receiving reply information returned by the detection node; the reply information includes enhanced detection information and detection information, and the enhanced detection information includes network status data of the detection node;
[0096] Specifically, each detection node in the embodiment of the present invention returns corresponding reply information after receiving each detection information, wherein the reply information includes the detection information received by the detection node and the enhanced detection information of the detection node.
[0097] S230: For each detection node, calculate the corresponding network packet loss rate and network delay according to the reply information;
[0098] It should be noted that each detection node will return a reply message after receiving the detection information. In order to further improve the detection efficiency in the embodiment of the present invention, for each detection node, the node itself can calculate the corresponding network packet loss rate and network delay based on the reply information returned by the detection node, so that a set of network packet loss rate and network delay can be obtained for each detection node. Specifically, the network delay can be calculated based on the sending timestamp in the detection information in the returned reply information and the receiving timestamp when the reply information is received; if the reply information is not received within the preset time length, it is considered that the information is lost, so the network packet loss rate and network delay can be calculated by sending the detection information to the detection node multiple times and receiving the reply information multiple times.
[0099] For example, the own node is A, and the detection nodes are B, C, and D. A can calculate a set of network packet loss rate and network delay based on the reply information returned by B, A can calculate a set of network packet loss rate and network delay based on the reply information returned by C, and A can calculate a set of network packet loss rate and network delay based on the reply information returned by D.
[0100] S240: When at least one network packet loss rate among all network packet loss rates is greater than the packet loss rate threshold or at least one network delay among all network delays is greater than the delay threshold, for each detection node, determine a corresponding network detection result according to the reply information returned by the detection node;
[0101] It should be noted that the node network is in a sub-healthy state. According to the physical connection between the nodes, there are three reasons. One is that the node itself has a network sub-healthy fault, another is that the link has a network sub-healthy fault, and the other is that the related detection node has a network sub-healthy fault.
[0102] Therefore, in an embodiment of the present invention, in order to further rule out that the network sub-health state of a node is caused by a network sub-health failure of a link or a network sub-health state of a related detection node, when there is at least one network packet loss rate greater than a packet loss rate threshold among all the network packet loss rates calculated for each detection node above, or when there is at least one network delay greater than a delay threshold among all the network delays, for each detection node, a corresponding network detection result can be determined according to the reply information returned by the detection node. Specifically, the network status data included in the detection information in the reply information and the network status data included in the enhanced detection information can be analyzed to obtain the network detection results corresponding to the node itself and the detection node.
[0103] It can be understood that, through the above calculation, a set of network packet loss rate and network delay will be obtained for each detection node. If there are m detection nodes, m network packet loss rates and m network delays can be obtained. If at least one of the m network packet loss rates is greater than the packet loss rate threshold, or at least one of the m network delays is greater than the delay threshold, it can be considered that the network where the node is located has a certain risk. At this time, the first detection node can be further targeted, and network detection analysis can be performed according to the reply information returned by the detection node to determine the network detection result corresponding to the node and the first detection node; ...; for the i-th detection node, network detection analysis can be performed according to the reply information returned by the detection node to determine the network detection result corresponding to the node and the i-th detection node; ...; for the m-th detection node, network detection analysis can be performed according to the reply information returned by the detection node to determine the network detection result corresponding to the node and the m-th detection node. It can be seen that m network detection results can be obtained.
[0104] S250: Determine whether the network state of the own node is a sub-healthy state according to the network detection results corresponding to each detection node.
[0105] It should be noted that in the embodiment of the present invention, after obtaining the network detection results corresponding to each detection node, all network detection results can be further integrated to determine whether the network status of its own node is in a sub-healthy state. By comprehensively considering the network conditions of the detection node, it is possible to accurately detect whether the network status of its own node is in a sub-healthy state.
[0106] In some embodiments, the process of determining whether the network state of the node itself is a sub-healthy state according to the network detection results corresponding to each detection node in the above S250 may include:
[0107] When at least one of all network detection results includes that the own node is abnormal, it is determined that the network state of the own node is a sub-healthy state.
[0108] It should be noted that, from the above analysis, a corresponding network detection result is obtained for each detection node, and the network detection result is obtained by analyzing the network status data of the own node and the network status data of the detection node. The network detection result includes the abnormality of the own node, or the network detection result includes the abnormality of the detection node, or the network detection result includes the failure to identify the own node and the abnormality of the corresponding detection node.
[0109] In the embodiment of the present invention, if at least one of all the obtained network detection results includes that the own node is abnormal, it can be determined that the network state of the own node is a sub-healthy state.
[0110] It can be understood that the own node and the detection node are determined as a group. For example, if the own node is A and the detection nodes are B, C, and D, then AB is a group, AC is a group, and AD is a group. Figure 4 As shown in the figure, for each group of nodes, the network detection results can be divided into three situations: one is the abnormality of the node itself, one is the abnormality of the detection node, and one is the failure to identify the node itself and the abnormality of the detection node. For example, for the AB group, the abnormality of the node itself is A abnormality, the abnormality of the detection node is B abnormality, and the failure to identify the node itself and the abnormality of the detection node is neither A nor B.
[0111] If the network detection result of group AB is A abnormal, the network detection result of group AC is A abnormal, and the network detection result of group AD is A abnormal, then it can be determined that the network state of node A itself is a sub-healthy state.
[0112] In some embodiments, the method may further include:
[0113] In the case that all network detection results include that the own node is not identified and the corresponding detection node is abnormal, it is determined that the network link corresponding to the own node is abnormal.
[0114] That is, if the network detection results corresponding to each detection node are that the node itself is not identified and the corresponding detection node is abnormal, such as Figure 4 As shown, if the network detection result of group AB is that its own node is not identified and the corresponding detection node has an abnormality, the network detection result of group AC is that its own node is not identified and the corresponding detection node has an abnormality, and the network detection result of group AD is that its own node is not identified and the corresponding detection node has an abnormality, then it can be determined that the network link corresponding to its own node A is abnormal, that is, the network abnormality is caused by the network link abnormality, not that the network of node A is in a sub-healthy state.
[0115] In order to avoid affecting the business, after determining that the network link corresponding to the node itself is abnormal, the network port corresponding to the node itself can be fault-switched. For example, if the node itself has only one network port, shut down the network port; if the node itself has multiple network ports, determine a backup network port from the other network ports and switch the network port of the node itself to the backup network port so that the network of the node itself can return to normal.
[0116] In some embodiments, in order to more accurately detect whether the network in which the node is located is in a sub-healthy state, the network status data in the detection information sent by each detection node may include at least one of a first transmission error statistic, a first transmission packet loss statistic, a first transmission timestamp, a first reception error statistic, a first reception packet loss statistic, and a first reception timestamp;
[0117] The network status data in the enhanced detection information returned by the detection node may include at least one of a second transmission error statistic, a second transmission packet loss statistic, a second transmission timestamp, a second reception error statistic, a second reception packet loss statistic, and a second reception timestamp.
[0118] like Figure 3 As shown, in the embodiment of the present invention, the node itself is node A and the detection node is node B as an example for explanation. The network status data in the detection information sent by node A may include at least one of a sending error statistic corresponding to node A's tx_error, a sending packet loss statistic corresponding to node A's tx_drop, a sending timestamp T1 corresponding to node A's sending timestamp, a receiving error statistic corresponding to node A's rx_error, a receiving packet loss statistic corresponding to node A's rx_drop, and a receiving timestamp T4 corresponding to node A's receiving timestamp.
[0119] The network status data in the enhanced detection information of the B node may include at least one of the sending error statistics corresponding to the B node tx_error, the sending packet loss statistics corresponding to the B node tx_drop, the sending timestamp T3 corresponding to the sending timestamp of the B node, the receiving error statistics corresponding to the B node rx_error, the receiving packet loss statistics corresponding to the B node rx_drop, and the receiving timestamp T2 corresponding to the receiving timestamp of the B node.
[0120] It should be noted that, in order to further distinguish the network status data of the own node and the detection node in the embodiment of the present invention, the various parameters in the network status data of the own node are respectively referred to as the first sending error statistic, the first sending packet loss statistic, the first sending timestamp, the first receiving error statistic, the first receiving packet loss statistic and the first receiving timestamp; the various parameters in the network status data in the detection node are respectively referred to as the second sending error statistic, the second sending packet loss statistic, the second sending timestamp, the second receiving error statistic, the second receiving packet loss statistic and the second receiving timestamp.
[0121] Among them, the first sending timestamp corresponding to the own node (i.e., sending timestamp T1) is the timestamp of sending the detection information to the detection node, the second receiving timestamp corresponding to the detection node (i.e., receiving timestamp T2) is the timestamp of the detection node receiving the detection information, the second sending timestamp corresponding to the detection node (i.e., sending timestamp T3) is the timestamp of the detection node returning the reply information, and the first receiving timestamp corresponding to the own node (i.e., receiving timestamp T4) is the timestamp of the own node receiving the reply information. In some embodiments, the network status data in the detection information sent by the detection node may include each of the first sending error statistics, the first sending packet loss statistics, the first sending timestamp, the first receiving error statistics, the first receiving packet loss statistics, and the first receiving timestamp;
[0122] The network status data in the enhanced detection information returned by the detection node may include each of a second transmission error statistic, a second transmission packet loss statistic, a second transmission timestamp, a second reception error statistic, a second reception packet loss statistic, and a second reception timestamp.
[0123] Accordingly, in the above S240, when at least one network packet loss rate among all network packet loss rates is greater than the packet loss rate threshold or at least one network delay among all network delays is greater than the delay threshold, for each detection node, the process of determining the corresponding network detection result according to the reply information returned by the detection node may include:
[0124] In the case where at least one network packet loss rate among all network packet loss rates is greater than the packet loss rate threshold, for each detection node, determine the network detection result according to the first sending error statistic value, the first sending packet loss statistic value, the first receiving error statistic value, the first receiving packet loss statistic value, the second sending error statistic value, the second sending packet loss statistic value, the second receiving error statistic value, and the second receiving packet loss statistic value in the reply information;
[0125] Or, when there is at least one network delay greater than the delay threshold among all network delays, for each detection node, the network detection result is determined according to the first sending timestamp, the first receiving timestamp, the second sending timestamp and the second receiving timestamp in the reply information.
[0126] It should be noted that, when at least one network packet loss rate among all network packet loss rates is greater than the packet loss rate threshold, the first sending error statistic, the first sending packet loss statistic, the first receiving error statistic and the first receiving packet loss statistic can reflect the network transmission status of the node itself, and the second sending error statistic, the second sending packet loss statistic, the second receiving error statistic and the second receiving packet loss statistic of the detection node can reflect the network transmission status of the detection node. Therefore, in the embodiment of the present invention, when at least one network packet loss rate among all network packet loss rates is greater than the packet loss rate threshold, for each detection node, according to the first sending error statistic, the first sending packet loss statistic, the first receiving error statistic, the first receiving packet loss statistic, the second sending error statistic, the second sending packet loss statistic, the second receiving error statistic and the second receiving packet loss statistic in the reply information returned by the detection node, the network detection result of each group of nodes can be determined more accurately.
[0127] In the case where at least one network delay among all network delays is greater than the delay threshold, the first sending timestamp and the first receiving timestamp can reflect the network delay status of the node itself, and the second sending timestamp and the second receiving timestamp can reflect the network delay status of the detection node. Therefore, in the embodiment of the present invention, in the case where at least one network delay among all network delays is greater than the delay threshold, for each detection node, the network detection result of each group of nodes can be determined more accurately based on the first sending timestamp, the first receiving timestamp, the second sending timestamp and the second receiving timestamp in the reply information.
[0128] In some embodiments, please refer to Figure 5 , when there is at least one network packet loss rate greater than the packet loss rate threshold among all network packet loss rates, the following can be further adopted for each detection node: Figure 5 The method shown performs enhanced packet loss detection to accurately determine the network detection result. In the embodiment of the present invention, the self-node is node A and the detection node is node B as an example for detailed description.
[0129] The process of determining the network detection result according to the first sending error statistic, the first sending packet loss statistic, the first receiving error statistic, the first receiving packet loss statistic, the second sending error statistic, the second sending packet loss statistic, the second receiving error statistic, and the second receiving packet loss statistic in the reply information may include:
[0130] S501: Calculate a first transmission error statistic increment and a first transmission packet loss statistic increment according to the first transmission error statistic and the first transmission packet loss statistic, combined with the first transmission error statistic and the first transmission packet loss statistic in the detection data sent to the detection node last time;
[0131] It should be noted that, in an embodiment of the present invention, the first transmission error statistic increment (also known as the A tx_error increment) and the first transmission packet loss statistic increment (also known as the A tx_drop increment) can be calculated based on the first transmission error statistic and the first transmission packet loss statistic in the detection data sent to the detection node last time, and the first transmission error statistic and the first transmission packet loss statistic in the detection information sent to the detection node this time.
[0132] S502: Determine whether the first transmission error statistic increment or the first transmission packet loss statistic increment is greater than zero; if the first transmission error statistic increment or the first transmission packet loss statistic increment is greater than zero, proceed to S503; if both the first transmission error statistic increment and the first transmission packet loss statistic increment are not greater than zero, proceed to S504;
[0133] It should be noted that, in the implementation of the present invention, after obtaining the first transmission error statistical value increment (that is, the A tx_error increment) and the first transmission packet loss statistical value increment (that is, the A tx_drop increment), it can be further determined whether the A tx_error increment or the A tx_drop increment is greater than 0. If at least one of them is greater than 0, enter S503; if both increments are not greater than 0, enter S504.
[0134] S503: Determine that the network detection result is that the node itself is abnormal;
[0135] It can be understood that in actual applications, if at least one of the A tx_error increment or the A tx_drop increment of node A itself is greater than 0, it means that there may be an abnormality in the network of node A itself. At this time, it can be determined that the network detection result of node A itself is abnormal for the detection node B.
[0136] S504: Calculate a second transmission error statistic increment, a second transmission packet loss statistic increment, a second reception error statistic increment, and a second reception packet loss statistic increment according to the second transmission error statistic value, the second transmission packet loss statistic value, the second reception error statistic value, and the second reception packet loss statistic value, in combination with the second transmission error statistic value, the second transmission packet loss statistic value, the second reception error statistic value, and the second reception packet loss statistic value in the reply data received last and returned by the detection node;
[0137] It should be noted that, when it is determined that the A tx_error increment and the A tx_drop increment are both not greater than 0, it can be determined that there is no abnormality in the transmission of its own node A, but it cannot be determined whether there are other abnormalities in its own node A. Therefore, in order to further improve the detection accuracy, at this time, the second transmission error statistics, second transmission packet loss statistics, second reception error statistics, and second reception packet loss statistics in the reply data received last and sent by the detection node B, as well as the second transmission error statistics, second transmission packet loss statistics, second reception error statistics, and second reception packet loss statistics in the reply data received this time and sent by the detection node B, can be further calculated to obtain the second transmission error statistics increment (B tx_error increment), the second transmission packet loss statistics increment (B tx_drop increment), the second reception error statistics increment (Br_error increment), and the second reception packet loss statistics increment (Br_drop increment) corresponding to the detection node B.
[0138] S505: Determine whether the second transmission error statistic increment or the second transmission packet loss statistic increment or the second reception error statistic increment or the second reception packet loss statistic increment is greater than zero; if the second transmission error statistic increment or the second transmission packet loss statistic increment or the second reception error statistic increment or the second reception packet loss statistic increment is greater than zero, proceed to S506; if the second transmission error statistic increment, the second transmission packet loss statistic increment, the second reception error statistic increment and the second reception packet loss statistic increment are not greater than zero, proceed to S507;
[0139] It should be noted that, in order to more accurately determine the network status of the detection node B in the embodiment of the present invention, after calculating the second transmission error statistical value increment (B tx_error increment), the second transmission packet loss statistical value increment (B tx_drop increment), the second reception error statistical value increment (Br_error increment) and the second reception packet loss statistical value increment (Br_drop increment) corresponding to the detection node B, it can be further determined whether the Btx_error increment or the Btx_drop increment or the Br_error increment or the Br_drop increment is greater than 0. If at least one of the Btx_error increment, the Btx_drop increment, the Br_error increment and the Br_drop increment is greater than 0, the process can proceed to S506; otherwise, the process proceeds to 507;
[0140] S560: Determine that the network detection result is that the detection node is abnormal;
[0141] It can be understood that when at least one of the B tx_error increment, the B tx_drop increment, the Br_error increment, and the Br_drop increment is greater than 0, it indicates that the network status of the detection node B is abnormal, and the network detection result can be obtained as the detection node is abnormal.
[0142] S507: Calculate a first reception error statistic increment and a first reception packet loss statistic increment according to the first reception error statistic and the first reception packet loss statistic, combined with the first reception error statistic and the first reception packet loss statistic in the detection data sent to the detection node last time;
[0143] It can be understood that when the increment of B tx_error, the increment of B tx_drop, the increment of Br_error, and the increment of Br_drop are all not greater than 0, it can be considered that the detection node B has no abnormality, that is, the detection node B has not been identified to have an abnormality, and it is necessary to further detect whether there are other abnormalities in its own node A. The first reception error statistic increment (A r_error increment) and the first reception packet loss statistic increment (A r_drop increment) can be calculated based on the first reception error statistic and the first reception packet loss statistic in the detection data sent to the detection node last time, and the first reception error statistic and the first reception packet loss statistic calculated based on the reply information returned by the detection node B this time.
[0144] S508: Determine whether the increment of the first reception error statistic value or the increment of the first reception packet loss statistic value is greater than zero; if the increment of the first reception error statistic value or the increment of the first reception packet loss statistic value is greater than zero, proceed to S509; if the increment of the first reception error statistic value and the increment of the first reception packet loss statistic value are both not greater than zero, proceed to S510;
[0145] It can be understood that after obtaining the Ar_error increment and the Ar_drop increment, it can be further determined whether the Ar_error increment or the Ar_drop increment is greater than zero.
[0146] S509: Determine that the network detection result is that the node itself is abnormal;
[0147] It should be noted that if it is determined that at least one of the A r_error increment and the A r_drop increment is greater than 0, it means that the node A itself is still abnormal. At this time, it can be determined that the network detection result is that the node itself is abnormal.
[0148] S510: Determine that the network detection result is that the own node is not identified and the detection node is abnormal.
[0149] It should be noted that, in the embodiment of the present invention, if it is determined that the Ar_error increment and the Ar_drop increment are not greater than 0, it can be considered that there is no abnormality in the node A itself, that is, no abnormality is identified in the node itself.
[0150] It can be understood that the embodiment of the present invention comprehensively considers the first sending error statistic, the first sending packet loss statistic, the first receiving error statistic, the first receiving packet loss statistic of its own node, and the second sending error statistic, the second sending packet loss statistic, the second receiving error statistic, and the second receiving packet loss statistic of each detection node. Therefore, when there is at least one network packet loss rate greater than the packet loss rate threshold among all network packet loss rates, the specific network detection result can be accurately determined, which is conducive to further improving the accuracy of network sub-health status detection.
[0151] In with Figure 5 Based on the corresponding embodiments, please refer to Figure 6 , the detection information in the embodiment of the present invention may also include a first system load value, and the enhanced detection information may also include a second system load value; wherein the system load is a measure of the workload of the CPU (Central Processing Unit) in the node, and the system load value is the average number of threads in the running queue within a specific time interval. In order to distinguish the system load value of the own node from the system load value of the detection node in the embodiment of the present invention, the system load value in the detection information of the own node is called the first system load value, and the system load value in the enhanced detection information of the detection node is called the second system load value.
[0152] The method may further include:
[0153] When the increment of the first transmission error statistic value or the increment of the transmission packet loss statistic value is greater than zero, determining whether the first system load value is greater than the first load threshold, if so, determining that the central processor of the own node is abnormal; if not, determining that there is a transmission failure in the network of the own node;
[0154] Or, when the first reception error statistic increment or the first reception packet loss statistic increment is greater than zero, determine whether the first system load value is greater than the second load threshold. If so, determine that the central processor of its own node is abnormal; if not, determine that there is a reception failure in the network of its own node.
[0155] It should be noted that, when the first sending error statistic increment or the sending packet loss statistic increment is greater than zero, or when the first receiving error statistic increment or the first receiving packet loss statistic increment is greater than zero, it can be determined that the node itself is abnormal. In these two cases in the embodiment of the present invention, in order to further determine the cause of the abnormality of the node itself, so as to take corresponding operations in time to better ensure the health of the network, when the first sending error statistic increment or the sending packet loss statistic increment is greater than zero, it can be judged whether the first system load value is greater than the first load threshold, and when the first system load value is greater than the first load threshold, it is determined that the central processor of the node itself is abnormal, and at this time, the network port of the node itself can be fault-switched; when the first system load value is not greater than the first load threshold, it is determined that there is a sending failure in the network of the node itself, and at this time, the network port of the node itself can also be fault-switched, so as to put the network in a better state and ensure the normal operation of the business.
[0156] It can be understood that when the increment of the first reception error statistic value or the increment of the first reception packet loss statistic value is greater than zero, it can also be determined whether the first system load value is greater than the second load threshold. If the first system load value is greater than the second load threshold, it can be determined that the central processor of its own node is abnormal, and the network port of its own node can be fault-switched at this time; if the first system load value is not greater than the second load threshold, it is determined that there is a receiving failure in the network of its own node, and the network port of its own node can be fault-switched at this time.
[0157] It should be noted that the first load threshold and the second load threshold in the embodiment of the present invention can be empirical values, or can be determined according to actual needs. In addition, for the process of performing a failover on the network port of the own node in the embodiment of the present invention, it can be further determined whether the own node has a spare network port. If there is a spare network port, the network port of the own node (the current network port) can be switched to the spare network port so that the network of the own node can be restored to normal. If there is no spare network port, the network port can be shut down.
[0158] When the second sending error statistic increment or the second sending packet loss statistic increment or the second receiving error statistic increment or the second receiving packet loss statistic increment is greater than zero, it can be determined that the detection node is abnormal. At this time, in order to further determine the cause of the abnormality of the detection node, it can be determined whether the second system load value is greater than the third load threshold. If the second system load value is greater than the third load threshold, it can be determined that the central processor of the detection node is abnormal; if the second system load value is not greater than the third load threshold, it is determined that the detection node has sending packet loss or receiving packet loss, and there is no need to switch the network port of the node itself.
[0159] In some embodiments, in some embodiments, please refer to Figure 7 and Figure 8 , when at least one network delay among all network delays is greater than the delay threshold, the following can be used for each detection node: Figure 7 The method shown performs enhanced delay detection to accurately determine the network detection result. In the embodiment of the present invention, the self node is node A and the detection node is node B as an example for detailed description.
[0160] The process of determining the network detection result according to the first sending timestamp, the first receiving timestamp, the second sending timestamp, and the second receiving timestamp in the reply information may include:
[0161] S701: Determine whether a first difference between a second receiving timestamp and a first sending timestamp exceeds a first time threshold; if the first difference exceeds the first time threshold, proceed to S702; if the first difference does not exceed the first time threshold, proceed to S703;
[0162] It should be noted that, in the embodiment of the present invention, a first difference may be calculated according to the second receiving timestamp T2 and the first sending timestamp T1, and the first difference T2-T1 may be compared with the first time threshold shold4.
[0163] S702: Determine that the network detection result is that the node itself is abnormal;
[0164] It is understandable that, in the case of T2-T1>shold4, it can be determined that the network detection result is that the node itself is abnormal. In order to further determine the cause of the abnormality of the node itself, the detection information can also include the first system load value, please refer to Figure 8 , it can be further determined whether the first system load value A sysload is greater than the first load threshold shold5. If so, it is determined that the central processor of the own node is abnormal, and the network port of the own node can be fault-switched at this time; if not, it is determined that the delay from the own node to the detection node is abnormal, and the network port of the own node can be fault-switched at this time.
[0165] S703: Determine whether the second difference between the second sending timestamp and the second receiving timestamp is greater than the second time threshold; if the second difference is greater than the second time threshold, proceed to S704; if the second difference is not greater than the second time threshold, proceed to S705;
[0166] It should be noted that, when it is determined that the first difference T2-T1 does not exceed the first time threshold shold4, it can be further determined whether the second difference T3-T2 between the second sending timestamp T3 and the second receiving timestamp T2 is greater than the second time threshold shold6.
[0167] S704: Determine that the network detection result is that the detection node is abnormal;
[0168] Specifically, when it is determined that the second difference T3-T2 is greater than the second time threshold shold6, it can be determined that the detection node is abnormal, and at this time, there is no need to operate the network port of the node itself.
[0169] For further information, please refer to Figure 8 The enhanced detection information in the embodiment of the present invention also includes a second system load value. In order to further determine the cause of the abnormality of the detection node in the embodiment of the present invention, when the second difference T3-T2 is greater than the second time threshold shold6, it can be judged whether the second system load value (such as B sysload) is greater than the third load threshold shold7. If so, it is determined that the central processing unit CPU of the detection node is abnormal; if not, it is determined that the detection node is abnormal.
[0170] S705: Determine whether a third difference between the first receiving timestamp and the second sending timestamp is greater than a third time threshold; if the third difference is greater than the third time threshold, proceed to S706; if the third difference is not greater than the third time threshold, proceed to S707;
[0171] It should be noted that, in the embodiment of the present invention, when the second difference is not greater than the second time threshold, it can be determined that no abnormality has been identified in the detection node. In order to further identify whether there are other abnormalities in the node itself, it can be further determined whether the third difference T4-T3 between the first receiving timestamp T4 and the second sending timestamp T3 is greater than the third time threshold shold8.
[0172] S706: Determine that the network detection result is that the node itself is abnormal;
[0173] Specifically, when it is determined that the third difference T4-T3 is greater than the third time threshold shold8, it can be determined that the node itself is abnormal. In order to further determine the cause of the abnormality of the node itself, such as Figure 8 As shown, it can be further determined whether the first system load value (such as A sysload) is greater than the second load threshold shold9. If so, it is determined that the central processor of the own node is abnormal, and the network port of the own node can be fault-switched at this time; if not, it is determined that the delay from the detection node to the own node is abnormal, and the network port of the own node can be fault-switched at this time.
[0174] S707: Determine that the network detection result is that the own node is not identified and the detection node is abnormal.
[0175] It should be noted that in the embodiment of the present invention, when the third difference T4-T3 is not greater than the third time threshold shold8, it can be determined that the abnormality of the own node is not identified, that is, the network detection result can be obtained that the abnormality of the own node and the detection node is not identified.
[0176] It should also be noted that the specific values of the various thresholds in the embodiments of the present invention can be determined according to actual needs, and the embodiments of the present invention do not specifically limit this.
[0177] In addition, for the process of fault switching of the network port of its own node in the embodiment of the present invention, it can be further determined whether there is a backup network port of its own node. If there is a backup network port, the network port of its own node (the current network port) can be switched to the backup network port so that the network of its own node can be restored to normal. If there is no backup network port, the network port can be shut down.
[0178] In some embodiments, before sending the detection information to the detection nodes in the cluster in S110, the method may further include:
[0179] A jump selection method is used to determine multiple detection nodes corresponding to the own node from the cluster.
[0180] It should be noted that if all nodes detect each other, too much detection information will occupy bandwidth resources. Therefore, in order to reduce bandwidth occupancy while ensuring detection accuracy, multiple detection nodes can be selected from the cluster in the embodiment of the present invention. Considering that nodes with adjacent IP addresses are more likely to use the same hardware resources physically, in order to avoid the selected detection nodes having the same network problems, each detection node with non-adjacent IP addresses can be selected from the cluster in a jumping selection manner.
[0181] In some embodiments, the process of determining multiple detection nodes corresponding to the own node from the cluster may include:
[0182] Number all nodes in the cluster in the order of their Internet Protocol addresses;
[0183] Take the node next to the own node as the first detection node;
[0184] According to the number of the first detection node and the total number of nodes in the cluster, the number of the second detection node is determined in combination with the first calculation relationship;
[0185] According to the number of the first detection node and the total number of nodes in the cluster, the number of the third detection node is determined in combination with the second calculation relationship; the number of the third detection node is greater than the number of the second node;
[0186] A second detection node is determined from the cluster according to the number of the second detection node, and a third detection node is determined from the cluster according to the number of the third detection node.
[0187] It should be noted that in the embodiment of the present invention, three detection nodes can be selected from the cluster. Specifically, all nodes in the cluster can be numbered in the order of Internet Protocol IP addresses, and then the node located next to the own node is used as the first detection node. The number of the second detection node is determined based on the number of the first detection node and the total number of nodes in the cluster, combined with the first calculation relationship. The number of the third detection node is determined based on the number of the first detection node and the total number of nodes in the cluster, combined with the second calculation relationship. Then, the second detection node is determined from the cluster based on the number of the second detection node, and the third detection node is determined from the cluster based on the number of the third detection node, thereby selecting three detection nodes. Among them:
[0188] The first calculation relationship is: n2=M+INT(N / 3);
[0189] The second calculation relationship is: n3=M+2*INT(N / 3); wherein n2 represents the number of the second detection node, n3 represents the number of the third detection node, M represents the number of the first detection node, N represents the total number of all nodes in the cluster, and INT() represents the rounding down function.
[0190] For example, there are N nodes in the cluster, which are numbered from 1 to N according to the IP addresses of each node. The node itself first selects the next node M with its own number as the first detection node, then selects the node at the position of M+INT(N / 3) as another detection node, and finally selects the node at the position of M+2*INT(N / 3) as the second detection node. It should be noted here that if the position calculated by M+2*INT(N / 3) exceeds N, the calculation result of M+2*INT(N / 3) is taken as the remainder of N, and the node at the position corresponding to the result after taking the remainder is taken as the third detection node.
[0191] by Figure 3 The nodes shown are taken as an example for explanation. ABCDE are numbered 12345. A selects nodes numbered 2, 3 (that is, 2+INT(5 / 3)=3), and 4 (2+2*INT(5 / 3)=4), that is, BCD nodes.
[0192] Regarding the timeliness of the method provided in the embodiment of the present invention, Figure 3 The five nodes in are taken as an example to illustrate, as shown in Table 1:
[0193] Table 1 Timeliness analysis table
[0194] Unit time A B C D E 1 A Information 2 A Information A Information A Information 3 A Information A Information A Information A Information A Information
[0195] It is understandable that in the process of information propagation, the information of node A can be diffused to all nodes in 3 units of time. Assuming there are N nodes in the cluster, any node can be diffused to all nodes in t units of time, where t = t1 + 1, and t1 can be obtained by rounding up N / 3.
[0196] It can be seen that the detection information sent by any node in the embodiment of the present invention can be gradually diffused to all nodes based on the principle of chain diffusion and the principle of network sub-health interaction. The self-node in the embodiment of the present invention can judge in more detail whether the network sub-health fault exists in its own node, link or other detection nodes based on the enhanced detection information returned by the detection node and the detection information sent by the self-node, and can improve the node's detection of whether the network it is in is in a sub-health state while occupying as few resources as possible. The detection process occupies fewer resources and is highly efficient, and can obtain more accurate network sub-health fault judgments, which is beneficial to reduce the complexity of analyzing network anomalies and improve the efficiency of analyzing network sub-health problems.
[0197] The present invention also provides a corresponding device for the network sub-health state detection method, which further makes the method more practical. Among them, the device can be described from the perspective of functional modules and hardware. The network sub-health state detection device provided by the present invention is introduced below. The device is used to implement the network sub-health state detection method provided by the present invention. In this embodiment, the network sub-health state detection device may include or be divided into one or more program modules, and the one or more program modules are stored in a storage medium and executed by one or more processors to complete the network sub-health state detection method disclosed in the above embodiment. The program module referred to in the present invention refers to a series of computer program instruction segments that can complete specific functions, which is more suitable for describing the execution process of the network sub-health state detection device in the storage medium than the program itself. The following description will specifically introduce the functions of each program module of this embodiment. The network sub-health state detection device described below and the network sub-health state detection method described above can be referenced to each other.
[0198] From the perspective of functional modules, see Fig. 9 , Fig. 9 A structural diagram of a network sub-health status detection device provided by the present invention in a specific implementation manner, the device is applied to any node in a cluster and may include:
[0199] The sending module 11 is used to send detection information to the detection node in the cluster; the detection information includes the network status data of the own node, and the detection node is different from the own node;
[0200] The receiving module 12 is used to receive the reply information returned by the detection node; the reply information includes enhanced detection information and detection information, and the enhanced detection information includes the network status data of the detection node;
[0201] The detection module 13 is used to determine whether the network status of its own node is a sub-healthy network status according to the reply information of the detection node.
[0202] In some embodiments, the detection node is multiple; the detection module 13 includes:
[0203] A first calculation unit, configured to calculate, for each of the detection nodes, a corresponding network packet loss rate and a network delay according to the reply information;
[0204] A first determining unit is configured to determine, for each of the detection nodes, a corresponding network detection result according to reply information returned by the detection node, when at least one of the network packet loss rates among all the network packet loss rates is greater than the packet loss rate threshold or at least one of the network delays among all the network delays is greater than the delay threshold;
[0205] The second determining unit is used to determine whether the network state of the own node is a network sub-health state according to the network detection results corresponding to each detection node.
[0206] In some embodiments, the second determining unit is configured to:
[0207] When at least one of the network detection results includes that the own node is abnormal among all the network detection results, it is determined that the network state of the own node is a network sub-health state.
[0208] In some embodiments, the network status data in the detection information includes at least one of a first transmission error statistic, a first transmission packet loss statistic, a first transmission timestamp, a first reception error statistic, a first reception packet loss statistic, and a first reception timestamp;
[0209] The network status data in the enhanced detection information includes at least one of a second sending error statistic, a second sending packet loss statistic, a second sending timestamp, a second receiving error statistic, a second receiving packet loss statistic, and a second receiving timestamp.
[0210] In some embodiments, the first determining unit includes:
[0211] A first determining subunit is configured to determine, for each of the detection nodes, a network detection result according to the first sending error statistic, the first sending packet loss statistic, the first receiving error statistic, the first receiving packet loss statistic, the second sending error statistic, the second sending packet loss statistic, the second receiving error statistic, and the second receiving packet loss statistic in the reply information, when at least one of the network packet loss rates among all the network packet loss rates is greater than the packet loss rate threshold;
[0212] Or, a second determination subunit is used to determine the network detection result for each detection node based on the first sending timestamp, the first receiving timestamp, the second sending timestamp and the second receiving timestamp in the reply information when there is at least one network delay that is greater than a delay threshold among all network delays.
[0213] In some embodiments, the first determining subunit includes:
[0214] A first judgment subunit is used to judge whether the first sending error statistic value increment or the sending packet loss statistic value increment is greater than zero according to the first sending error statistic value and the first sending packet loss statistic value, combined with the first sending error statistic value and the first sending packet loss statistic value in the detection data sent to the detection node last time; if the first sending error statistic value increment or the sending packet loss statistic value increment is greater than zero, triggering a third determination subunit; if both the sending error statistic value increment and the sending packet loss statistic value increment are not greater than zero, triggering a second judgment subunit;
[0215] The third determination subunit is used to determine that the network detection result is that the node itself is abnormal;
[0216] The second judgment subunit judges whether the second sending error statistic increment or the second sending packet loss statistic increment or the second receiving error statistic increment or the second receiving packet loss statistic increment is greater than zero according to the second sending error statistic value, the second sending packet loss statistic value, the second receiving error statistic value, and the second receiving packet loss statistic value, in combination with the second sending error statistic value, the second sending packet loss statistic value, the second receiving error statistic value, and the second receiving packet loss statistic value in the reply data returned by the detection node last received; if the second sending error statistic increment or the second sending packet loss statistic increment or the second receiving error statistic increment or the second receiving packet loss statistic increment is greater than zero, triggering the fourth determination subunit; if the second sending error statistic increment, the second sending packet loss statistic increment, the second receiving error statistic increment, and the second receiving packet loss statistic increment are not greater than zero, triggering the third judgment subunit;
[0217] A fourth determining subunit, configured to determine that a network detection result is that the detection node is abnormal;
[0218] a third judging subunit, configured to judge whether the first reception error statistic increment or the first reception packet loss statistic increment is greater than zero according to the first reception error statistic value and the first reception packet loss statistic value, in combination with the first reception error statistic value and the first reception packet loss statistic value in the detection data sent to the detection node last time; if the first reception error statistic increment or the first reception packet loss statistic increment is greater than zero, triggering the fifth determining subunit; if the first reception error statistic increment and the first reception packet loss statistic increment are both not greater than zero, triggering the sixth determining subunit;
[0219] A fifth determination subunit is used to determine that the network detection result is that the node itself is abnormal;
[0220] The sixth determining subunit is used to determine that the network detection result is that the own node is not identified and the detection node is abnormal.
[0221] In some embodiments, the detection information further includes a first system load value; the device further includes:
[0222] a fourth judgment subunit, configured to, when the increment of the first sending error statistic value or the increment of the sending packet loss statistic value is greater than zero, determine whether the first system load value is greater than a first load threshold, and if so, trigger the seventh determination subunit; if not, trigger the eighth determination subunit;
[0223] A seventh determination subunit, used to determine that the central processing unit of its own node is abnormal;
[0224] An eighth determining subunit, used to determine that a transmission failure exists in the network of its own node;
[0225] Or, a fifth judgment subunit, configured to, when the increment of the first reception error statistic value or the increment of the first reception packet loss statistic value is greater than zero, determine whether the first system load value is greater than a first load threshold, and if so, trigger the ninth determination subunit; if not, trigger the tenth determination subunit;
[0226] A ninth determination subunit, used to determine that the central processing unit of its own node is abnormal;
[0227] The tenth determining subunit is used to determine whether a receiving failure exists in the network of its own node.
[0228] In some embodiments, the second determining subunit includes:
[0229] a sixth judgment subunit, configured to judge whether a first difference between the first receiving timestamp and the first sending timestamp exceeds a first time threshold; if the first difference exceeds the first time threshold, triggering an eleventh determination subunit; if the first difference does not exceed the first time threshold, triggering a seventh judgment subunit;
[0230] An eleventh determination subunit is used to determine that the network detection result is that the node itself is abnormal;
[0231] a seventh judgment subunit, configured to judge whether a second difference between the second sending timestamp and the first receiving timestamp is greater than a second time threshold; if the second difference is greater than the second time threshold, triggering a twelfth determination subunit; if the second difference is not greater than the second time threshold, triggering an eighth judgment subunit;
[0232] A twelfth determining subunit is used to determine that the network detection result is that the detection node is abnormal;
[0233] an eighth judgment subunit, configured to judge whether a third difference between the second receiving timestamp and the second sending timestamp is greater than a third time threshold; if the third difference is greater than the third time threshold, triggering a thirteenth determination subunit; if the third difference is not greater than the third time threshold, triggering a fourteenth determination subunit;
[0234] A thirteenth determination subunit is used to determine that the network detection result is that the node itself is abnormal;
[0235] The fourteenth determining subunit is used to determine that the network detection result is that the own node is not identified and the detection node is abnormal.
[0236] In some embodiments, the detection information further includes a first system load value; the device further includes:
[0237] a ninth determining subunit, configured to determine whether the first system load value is greater than a first load threshold when the first difference value exceeds the first time threshold, and if so, trigger the fifteenth determining subunit; if not, trigger the sixteenth determining subunit;
[0238] A fifteenth determination subunit is used to determine whether the central processing unit of its own node is abnormal;
[0239] A sixteenth determination subunit, used to determine the abnormal delay from the own node to the detection node;
[0240] or, a tenth judging subunit, configured to judge whether the first system load value is greater than the first load threshold value when the third difference value is greater than the third time threshold value, and if so, trigger the seventeenth determining subunit; if not, trigger the eighteenth determining subunit;
[0241] A seventeenth determination subunit is used to determine whether the central processing unit of its own node is abnormal;
[0242] The eighteenth determining subunit is used to determine that the delay from the detection node to its own node is abnormal.
[0243] In some embodiments, the apparatus further comprises:
[0244] The selection module is used to determine multiple detection nodes corresponding to its own node from the cluster by using a jumping selection method.
[0245] In some embodiments, the selection module includes:
[0246] A sorting unit, used to number all nodes in the cluster in the order of Internet Protocol addresses;
[0247] A third determining unit is used to take a node located next to the own node as a first detection node;
[0248] a fourth determining unit, configured to determine the number of the second detection node according to the number of the first detection node and the total number of nodes in the cluster in combination with the first calculation relationship;
[0249] a fifth determining unit, configured to determine the number of a third detection node according to the number of the first detection node and the total number of nodes in the cluster in combination with the second calculation relationship; the number of the third detection node is greater than the number of the second node;
[0250] The sixth determining unit is configured to determine a second detection node from the cluster according to the number of the second detection node, and to determine a third detection node from the cluster according to the number of the third detection node.
[0251] In some embodiments, the first calculation relationship is: n2=M+INT(N / 3);
[0252] The second calculation relationship is: n3=M+2*INT(N / 3);
[0253] Among them, n2 represents the number of the second detection node, n3 represents the number of the third detection node, M represents the number of the first detection node, N represents the total number of all nodes in the cluster, and INT() represents the floor function.
[0254] It should be noted that the description of the features in the embodiments corresponding to the network sub-health status detection device provided in the implementation of the present invention can be the relevant description of the embodiments corresponding to the implementation of the above method, which will not be repeated here.
[0255] The network sub-health status detection device mentioned above is described from the perspective of functional modules. Furthermore, the present invention also provides an electronic device, which is described from the perspective of hardware. Fig.10 A structural diagram of an electronic device provided by an embodiment of the present invention, such as Fig.10 As shown, the electronic device includes: a memory 60 for storing a computer program;
[0256] The processor 61 is used to implement the steps of the network sub-health status detection method in the above embodiment when executing the computer program.
[0257] The electronic device provided in this embodiment may include but is not limited to a smart phone, a tablet computer, a laptop computer or a desktop computer.
[0258] Among them, the processor 61 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 61 can be implemented in at least one hardware form of digital signal processing (DSP), field programmable gate array (FPGA), and programmable logic array (PLA). The processor 61 may also include a main processor and a coprocessor. The main processor is a processor for processing data in the awake state, also known as a central processing unit (CPU); the coprocessor is a low-power processor for processing data in the standby state. In some embodiments, the processor 61 may be integrated with a graphics processing unit (GPU), and the GPU is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 61 may also include an artificial intelligence (AI) processor, which is used to process computing operations related to machine learning.
[0259] The memory 60 may include one or more computer-readable storage media, which may be non-transitory. The memory 60 may also include a high-speed random access memory, and a non-volatile memory, such as one or more disk storage devices, flash memory storage devices. In this embodiment, the memory 60 is at least used to store the following computer program 601, wherein, after the computer program is loaded and executed by the processor 61, the relevant steps of the network sub-health state detection method disclosed in any of the aforementioned embodiments can be implemented. In addition, the resources stored in the memory 60 may also include an operating system 602 and data 603, etc., and the storage method may be temporary storage or permanent storage. Among them, the operating system 602 may include Windows, Unix, Linux, etc. Data 603 may include, but is not limited to, network sub-health state detection results, etc.
[0260] In some embodiments, the electronic device may further include a display screen 62 , an input / output interface 63 , a communication interface 64 , a power supply 65 , and a communication bus 66 .
[0261] Those skilled in the art will understand that Fig.10 The structure shown in the figure does not constitute a limitation on the electronic device, and may include more or fewer components than shown in the figure.
[0262] It is understandable that if the network sub-health state detection method in the above embodiment is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention is essentially or part of the contribution to the current technology or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium to execute all or part of the steps of the methods of each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), electrically erasable programmable ROM, register, hard disk, removable disk, CD-ROM, disk or optical disk and other media that can store program codes.
[0263] Based on this, an embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the above-mentioned network sub-health status detection method are implemented.
[0264] In addition, an embodiment of the present invention further provides a computer program product, including a computer program / instruction, which implements the steps of the above-mentioned network sub-health status detection method when executed by a processor.
[0265] The above is a detailed introduction to a network sub-health status detection method, device, electronic device and computer-readable storage medium provided by an embodiment of the present invention. The various embodiments in the specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same and similar parts between the embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part description.
[0266] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.
[0267] The above is a detailed introduction to a network sub-health status detection method, device, electronic device and computer-readable storage medium provided by the present invention. Specific examples are used herein to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea. It should be pointed out that for ordinary technicians in this technical field, without departing from the principles of the present invention, several improvements and modifications can be made to the present invention, and these improvements and modifications also fall within the scope of protection of the claims of the present invention.
Claims
1. A method for detecting a network sub-health state, characterized in that: Applicable to any node in the cluster, including: Sending detection information to a detection node in the cluster; the detection information includes network status data of the own node, and the detection node is different from the own node; receiving reply information returned by the detection node; the reply information includes enhanced detection information and the detection information, and the enhanced detection information includes network status data of the detection node; According to the reply information of the detection node, it is determined whether the network status of the own node is a sub-healthy network status.
2. The network sub-health status detection method according to claim 1, characterized in that: There are multiple detection nodes; The step of determining whether the network state of the own node is a sub-healthy state of the network according to the reply information of the detection node comprises: For each of the detection nodes, calculate the corresponding network packet loss rate and network delay according to the reply information; In the case where at least one of all the network packet loss rates is greater than the packet loss rate threshold or at least one of all the network delays is greater than the delay threshold, for each of the detection nodes, determining a corresponding network detection result according to the reply information returned by the detection node; According to the network detection results corresponding to each detection node, it is determined whether the network state of the own node is a sub-healthy state.
3. The network sub-health status detection method according to claim 2, characterized in that: The determining whether the network state of the own node is a sub-healthy state of the network according to the network detection results corresponding to each detection node respectively includes: When at least one of the network detection results includes that the own node is abnormal among all the network detection results, it is determined that the network state of the own node is a network sub-health state.
4. The network sub-health status detection method according to claim 2, characterized in that: The network status data in the detection information includes at least one of a first sending error statistic, a first sending packet loss statistic, a first sending timestamp, a first receiving error statistic, a first receiving packet loss statistic, and a first receiving timestamp; The network status data in the enhanced detection information includes at least one of a second sending error statistic, a second sending packet loss statistic, a second sending timestamp, a second receiving error statistic, a second receiving packet loss statistic, and a second receiving timestamp.
5. The network sub-health status detection method according to claim 4, characterized in that: In the case that at least one of all the network packet loss rates is greater than the packet loss rate threshold or at least one of all the network delays is greater than the delay threshold, for each of the detection nodes, determining a corresponding network detection result according to the reply information returned by the detection node, including: In the case where at least one of all the network packet loss rates is greater than the packet loss rate threshold, for each of the detection nodes, determine a network detection result according to the first sending error statistic, the first sending packet loss statistic, the first receiving error statistic, the first receiving packet loss statistic, the second sending error statistic, the second sending packet loss statistic, the second receiving error statistic, and the second receiving packet loss statistic in the reply information; Or, when there is at least one network delay that is greater than the delay threshold among all network delays, for each detection node, the network detection result is determined according to the first sending timestamp, the first receiving timestamp, the second sending timestamp and the second receiving timestamp in the reply information.
6. The network sub-health status detection method according to claim 5, characterized in that: The determining of the network detection result according to the first sending error statistic, the first sending packet loss statistic, the first receiving error statistic, the first receiving packet loss statistic, the second sending error statistic, the second sending packet loss statistic, the second receiving error statistic and the second receiving packet loss statistic in the reply information includes: According to the first sending error statistic and the first sending packet loss statistic, combined with the first sending error statistic and the first sending packet loss statistic in the detection data sent to the detection node last time, determining whether the first sending error statistic increment or the first sending packet loss statistic increment is greater than zero; If the first sending error statistic increment or the first sending packet loss statistic increment is greater than zero, determining that the network detection result is that the node itself is abnormal; If the first sending error statistical value increment and the first sending packet loss statistical value increment are both not greater than zero, then according to the second sending error statistical value, the second sending packet loss statistical value, the second receiving error statistical value, and the second receiving packet loss statistical value, combined with the second sending error statistical value, the second sending packet loss statistical value, the second receiving error statistical value, and the second receiving packet loss statistical value in the reply data returned by the detection node last received, determine whether the second sending error statistical value increment or the second sending packet loss statistical value increment or the second receiving error statistical value increment or the second receiving packet loss statistical value increment is greater than zero; If the second sending error statistic increment or the second sending packet loss statistic increment or the second receiving error statistic increment or the second receiving packet loss statistic increment is greater than zero, determining that the network detection result is that the detection node is abnormal; If the second sending error statistic increment, the second sending packet loss statistic increment, the second receiving error statistic increment, and the second receiving packet loss statistic increment are all not greater than zero, judging whether the first receiving error statistic increment or the first receiving packet loss statistic increment is greater than zero according to the first receiving error statistic and the first receiving packet loss statistic, combined with the first receiving error statistic and the first receiving packet loss statistic in the detection data last sent to the detection node; If the first received error statistic increment or the first received packet loss statistic increment is greater than zero, determining that the network detection result is that the node itself is abnormal; If the first received error statistic increment and the first received packet loss statistic increment are both not greater than zero, it is determined that the network detection result is that the own node and the detection node are not identified to be abnormal.
7. The network sub-health status detection method according to claim 6, characterized in that: The detection information also includes a first system load value; the method also includes: When the increment of the first transmission error statistic value or the increment of the transmission packet loss statistic value is greater than zero, determining whether the first system load value is greater than a first load threshold, and if so, determining that the central processor of the own node is abnormal; if not, determining that there is a transmission failure in the network of the own node; Or, when the increment of the first reception error statistic value or the increment of the first reception packet loss statistic value is greater than zero, determine whether the first system load value is greater than the first load threshold. If so, determine that the central processor of its own node is abnormal; if not, determine that there is a reception failure in the network of its own node.
8. The network sub-health status detection method according to claim 5, characterized in that: The determining the network detection result according to the first sending timestamp, the first receiving timestamp, the second sending timestamp and the second receiving timestamp in the reply information includes: Determine whether a first difference between the second receiving timestamp and the first sending timestamp exceeds a first time threshold; If the first difference exceeds the first time threshold, determining that the network detection result is that the node itself is abnormal; If the first difference does not exceed the first time threshold, determining whether a second difference between the second sending timestamp and the second receiving timestamp is greater than a second time threshold; If the second difference is greater than the second time threshold, determining that the network detection result is that the detection node is abnormal; If the second difference is not greater than the second time threshold, determining whether a third difference between the first receiving timestamp and the second sending timestamp is greater than a third time threshold; If the third difference is greater than the third time threshold, determining that the network detection result is that the node itself is abnormal; If the third difference is not greater than the third time threshold, it is determined that the network detection result is that the own node and the detection node are not identified to be abnormal.
9. The network sub-health status detection method according to claim 8, characterized in that: The detection information also includes a first system load value; the method also includes: In the case where the first difference exceeds the first time threshold, determining whether the first system load value is greater than the first load threshold, and if so, determining that the central processor of the own node is abnormal; if not, determining that the delay from the own node to the detection node is abnormal; Or, when the third difference is greater than the third time threshold, determine whether the first system load value is greater than the first load threshold. If so, determine that the central processor of its own node is abnormal; if not, determine that the delay from the detection node to its own node is abnormal.
10. The network sub-health status detection method according to any one of claims 1 to 9, characterized in that: Before sending the detection information to the detection nodes in the cluster, the method further includes: A jump selection method is used to determine multiple detection nodes corresponding to the own node from the cluster.
11. The network sub-health status detection method according to claim 10, characterized in that: The step of determining a plurality of detection nodes corresponding to the own node from the cluster includes: Number all nodes in the cluster in the order of their Internet Protocol addresses; Take the node next to the own node as the first detection node; Determine the number of the second detection node according to the number of the first detection node and the total number of nodes in the cluster in combination with the first calculation relationship; According to the number of the first detection node and the total number of nodes in the cluster, the number of the third detection node is determined in combination with the second calculation relationship; the number of the third detection node is greater than the number of the second node; A second detection node is determined from the cluster according to the number of the second detection node, and a third detection node is determined from the cluster according to the number of the third detection node.
12. The network sub-health status detection method according to claim 11, characterized in that: The first calculation relationship is: n2=M+INT(N / 3); The second calculation relationship is: n3=M+2*INT(N / 3); Among them, n2 represents the number of the second detection node, n3 represents the number of the third detection node, M represents the number of the first detection node, N represents the total number of all nodes in the cluster, and INT() represents the floor function.
13. A network sub-health status detection device, characterized in that: Applicable to any node in the cluster, including: A sending module, used for sending detection information to a detection node in the cluster; the detection information includes network status data of the own node, and the detection node is different from the own node; A receiving module, configured to receive reply information returned by the detection node; the reply information includes enhanced detection information and the detection information, and the enhanced detection information includes network status data of the detection node; The detection module is used to determine whether the network status of its own node is a sub-healthy network status according to the reply information of the detection node.
14. An electronic device, characterized in that: include: Memory for storing computer programs; A processor is used to execute the computer program to implement the steps of the network sub-health status detection method as described in any one of claims 1 to 12.
15. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the network sub-health status detection method according to any one of claims 1 to 12 are implemented.
Citation Information
Patent Citations
Distributed storage system network sub-health detection method and device
CN111142801A
Method and system for detecting network sub-health state of client node
CN113132160A
Network health state analysis method and device, computer equipment and storage medium
CN113890816A
Node state detection method, node state detection device, equipment and medium
CN114531373A
Network failure diagnosis method and apparatus, device and storage medium
WO2022134742A1
Cited By
Network state detection method, device, equipment and medium
CN119743414A
