Node state evaluation method and device, computer device, and storage medium

By detecting network available ports and latency packet loss rate in kernel mode, the timeliness and accuracy issues of existing network sub-health detection are solved, achieving more efficient network status assessment and reducing the impact on system performance.

CN118524034BActive Publication Date: 2026-01-23JINAN INSPUR DATA TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410724415.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-06-05
Publication Date
2026-01-23
Estimated Expiration
2044-06-05

AI Technical Summary

Technical Problem

Existing methods for detecting network sub-health issues suffer from timeliness problems and impact on system performance. In particular, the timeliness of using Ping and UDP packets is insufficient, and libpcap packet capture can lead to performance issues and false positives for packet loss.

Method used

By employing kernel-mode detection, the system detects available ports, network latency, and packet loss rate to determine whether thresholds are exceeded and triggers network port or node isolation, thereby reducing the probability of false positives and improving detection timeliness and accuracy.

Benefits of technology

It improves the timeliness and accuracy of network sub-health detection, reduces the impact on system performance, and reduces the probability of false positives and packet loss.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118524034B_ABST
    Figure CN118524034B_ABST
Patent Text Reader

Abstract

The application relates to a node state evaluation method and device, computer equipment and a storage medium, belongs to the technical field of computer communication networks, and comprises the following steps: in response to detecting a node state evaluation request, a detection list is obtained; based on the detection list, available ports in a target node are determined, and a first target port matched with the available ports is determined, the first target port being a port in other nodes in the entire network except the target node, and each available port forming a mapping relationship with the ports in the multiple other nodes; based on an echo service mechanism and the mapping relationship, the time delay and the packet loss rate of a target available port corresponding to a network port are determined; and based on the time delay and / or the packet loss rate, the state of the target node is evaluated. The application can improve the timeliness and accuracy of node sub-health state detection, thereby reducing the influence of the node sub-health state detection on system performance.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer communication network technology, and in particular to a node status assessment method, apparatus, computer equipment, and storage medium. Background Technology

[0002] Existing network sub-health detection logic typically employs two methods. One is to use existing Ping (Packet Internet Groper) or UDP (User Datagram Protocol) messages to probe and obtain network latency and packet loss values. The other is to use libpcap (a network packet capture function package) to capture packets and obtain these values. The first method, being upper-layer software, suffers from timeliness issues, typically resulting in higher latency than the second method. The second method, using packet capture, is more timely than the first, but the two kernel-level copy operations can negatively impact performance. Furthermore, libpcap itself may misjudge packet loss under high network interface load.

[0003] Therefore, there is an urgent need to propose a node status assessment method, device, computer equipment, and storage medium that can improve the timeliness and accuracy of detection. Summary of the Invention

[0004] Therefore, it is necessary to provide a node status assessment method, device, computer equipment, and storage medium that can improve the timeliness and accuracy of network sub-health detection, in order to address the above-mentioned technical problems.

[0005] On the one hand, a node state evaluation method is provided, the method comprising:

[0006] In response to the detection of a node status assessment request, a probe list is obtained, which includes at least the node address, port number, network interface name, and network interface address;

[0007] Based on the probe list, the available ports in the target node are detected and determined, as well as the first target port that matches the available port. The first target port is a port in other nodes in the entire network other than the target node. Each available port forms a mapping relationship with ports in multiple other nodes.

[0008] Based on the echo service mechanism and the mapping relationship, the latency and packet loss rate of the network interface corresponding to the target available port are determined;

[0009] The state of the target node is evaluated based on the latency and / or the packet loss rate.

[0010] Optionally, based on the probe list, determining the available ports in the target node includes:

[0011] Obtain the probe list corresponding to the second target port in the target node, and initialize the threshold for the number of probes to the second target port to obtain the preset threshold;

[0012] When the current number of probes to the second target port is less than or equal to a preset threshold, a probe packet is constructed based on the probe list and the probe packet is sent to the network port corresponding to the second target port;

[0013] If no response message to the probe message is captured within the preset time range, the peer port number in the probe list is incremented by one, and the current probe count is incremented by one.

[0014] If the current number of probes exceeds a preset threshold and no response message is captured during any probe attempt, the probe is considered to have failed.

[0015] If a response message to the probe message is captured within the preset time range, the probe is considered successful.

[0016] In response to the detection of a probe failure, the second target port is defined as an unavailable port;

[0017] In response to the detection of a successful probe result, the second target port is defined as an available port, and the first target information is recorded. The first target information includes at least the available port and the node address, port number and network interface address corresponding to the first target port that matches the available port.

[0018] Optionally, based on the probe list, determining a first target port that matches an available port includes:

[0019] Based on the network port corresponding to the network port name and the probe list, the probe message is sent to multiple peer ports, where the peer ports are ports in other nodes in the entire network except for the target node;

[0020] The detection is considered successful when a reply message is received from at least one peer port within a preset time range.

[0021] In response to the detection of a successful probe result, the peer port of the reply message that sent the message is defined as the first target port that matches the available port;

[0022] A one-to-one mapping relationship is formed based on the available ports and their matching first target ports.

[0023] Optionally, the echo service mechanism includes:

[0024] In response to the detection of an echo service request, a first detection message based on the second target information is sent to the peer port through the network interface corresponding to the second target port.

[0025] When a first detection packet based on the second target information is captured on the network interface corresponding to the peer port, the second target information in the first detection packet is swapped in order to generate a new packet.

[0026] The new message is returned to the network interface corresponding to the second target port in response to the echo service request.

[0027] Optionally, based on the echo service mechanism and the mapping relationship, determining the latency and packet loss rate of the network interface corresponding to the target available port includes:

[0028] In response to the detection of a node status assessment request, based on the mapping relationship, a second detection message generated based on the first target information is sent to the network interface corresponding to the first target port that matches the target available port through the network interface corresponding to the target available port.

[0029] In response to capturing a second detection packet generated based on the first target information on the network interface corresponding to the first target port, the first target information in the second detection packet is swapped in order to generate a new packet;

[0030] The new message is returned to the network interface corresponding to the target available port, and the message transmission latency and packet loss rate are obtained to evaluate the status of the target node.

[0031] Optionally, the methods for determining the latency and packet loss rate include:

[0032] Based on a preset time interval, the second detection message is sent to the network port corresponding to the target available port, and the sending time is recorded on the second detection message;

[0033] In response to receiving a return message of the second detection message within a preset time range, the difference between the receiving time and the sending time is calculated to obtain the delay, and the packet loss rate is determined based on the number of data packets in the return message and the number of data packets in the second detection message.

[0034] Optionally, assessing the state of the target node based on the latency and / or the packet loss rate includes:

[0035] In response to detecting that the latency is greater than a first preset value and / or the packet loss rate is greater than a second preset value, the network port corresponding to the target available port is shut down;

[0036] When the number of network ports in the target node that are in a closed state is greater than or equal to a third preset value, the target node is defined as being in a sub-healthy state, and node isolation operation is performed.

[0037] On the other hand, a node state evaluation device is provided, the device comprising:

[0038] The acquisition module is used to acquire a probe list when a node status assessment request is detected. The probe list includes at least the node address, port number, network interface name, and network interface address.

[0039] The detection module is used to detect and determine the available ports in the target node based on the detection list, and the first target port that matches the available port. The first target port is a port in other nodes in the entire network other than the target node. Each available port forms a mapping relationship with ports in multiple other nodes.

[0040] The determination module is used to determine the latency and packet loss rate of the network interface corresponding to the target available port based on the echo service mechanism and the mapping relationship;

[0041] The status assessment module is used to assess the status of the target node based on the latency and / or the packet loss rate.

[0042] In another aspect, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to perform the following steps:

[0043] In response to the detection of a node status assessment request, a probe list is obtained, which includes at least the node address, port number, network interface name, and network interface address;

[0044] Based on the probe list, the available ports in the target node are detected and determined, as well as the first target port that matches the available port. The first target port is a port in other nodes in the entire network other than the target node. Each available port forms a mapping relationship with ports in multiple other nodes.

[0045] Based on the echo service mechanism and the mapping relationship, the latency and packet loss rate of the network interface corresponding to the target available port are determined;

[0046] The state of the target node is evaluated based on the latency and / or the packet loss rate.

[0047] In another aspect, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, performs the following steps:

[0048] In response to the detection of a node status assessment request, a probe list is obtained, which includes at least the node address, port number, network interface name, and network interface address;

[0049] Based on the probe list, the available ports in the target node are detected and determined, as well as the first target port that matches the available port. The first target port is a port in other nodes in the entire network other than the target node. Each available port forms a mapping relationship with ports in multiple other nodes.

[0050] Based on the echo service mechanism and the mapping relationship, the latency and packet loss rate of the network interface corresponding to the target available port are determined;

[0051] The state of the target node is evaluated based on the latency and / or the packet loss rate.

[0052] The aforementioned node status assessment method, apparatus, computer equipment, and storage medium, the method comprising: in response to detecting a node status assessment request, acquiring a probe list, the probe list including at least node address, port number, network port name, and network port address; based on the probe list, probing and determining available ports in a target node, and a first target port matching the available ports, the first target port being a port in other nodes in the entire network excluding the target node, each available port forming a mapping relationship with ports in multiple other nodes; based on an echo service mechanism and the mapping relationship, determining the latency and packet loss rate of the network port corresponding to the target available port; and based on the latency and / or the packet loss rate, assessing the status of the target node. This application can improve the timeliness and accuracy of node sub-health status detection, thereby reducing its impact on system performance. Attached Figure Description

[0053] Figure 1 This is a diagram illustrating the application environment of a node state evaluation method in one embodiment.

[0054] Figure 2 This is a flowchart illustrating a node state evaluation method in one embodiment;

[0055] Figure 3 This is another flowchart illustrating the node state evaluation method in one embodiment;

[0056] Figure 4 This is a schematic diagram of the echo service mechanism of a node state evaluation method in one embodiment;

[0057] Figure 5 This is a schematic diagram of the initialization detection process of a node state evaluation method in one embodiment;

[0058] Figure 6This is a schematic diagram of the initialization detection process of a node state evaluation method in one embodiment;

[0059] Figure 7 This is a schematic diagram of the read latency, packet loss, and judgment process of a node state evaluation method in one embodiment;

[0060] Figure 8 This is a structural block diagram of a node state evaluation device in one embodiment;

[0061] Figure 9 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation

[0062] To make the objectives, technical solutions, and advantages of this application clearer, the technical solutions in the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0063] It should be understood that, in the description of this application, unless the context explicitly requires it, words such as "including" or "comprising" throughout the specification should be interpreted as including rather than exclusive or exhaustive; that is, meaning "including but not limited to".

[0064] It should also be understood that the terms "first," "second," etc., are used for descriptive purposes only and should not be construed as indicating or implying relative importance. Furthermore, in the description of this application, unless otherwise stated, "a plurality of" means two or more.

[0065] It should be noted that the terms "S1," "S2," etc., are used only for descriptive purposes and do not specifically refer to the order or sequence, nor are they intended to limit this application. They are merely for the convenience of describing the method of this application and should not be construed as indicating the sequential order of the steps. Furthermore, the technical solutions of the various embodiments can be combined with each other, but this must be based on the ability of those skilled in the art to implement them. When the combination of technical solutions is contradictory or impossible to implement, it should be considered that such a combination of technical solutions does not exist and is not within the scope of protection claimed in this application.

[0066] A network that can operate normally and recover quickly after being subjected to external shocks is called a "healthy" state. A network that is paralyzed and unable to operate normally is called an "unhealthy" state. Many large and medium-sized enterprises' networks are in a "sub-healthy" state. In this state, the network can normally operate, but its ability to withstand risks is extremely low. It is easily paralyzed in the event of a sudden network risk and is difficult to recover for a long time. Sub-healthy networks typically lead to a state of low performance in distributed systems. As the background technology indicates, existing methods for detecting sub-healthy networks have issues with timeliness or impacting system performance.

[0067] To address the aforementioned technical issues, this application provides a node status assessment method, apparatus, computer equipment, and storage medium. By placing the entire detection process in kernel mode, including detecting available port numbers, detecting network latency and network packet loss values, determining whether the network latency and / or packet loss values ​​exceed a threshold, and triggering a down port or node network isolation action if the threshold is exceeded, the timeliness of detection is improved, its impact on system performance is reduced, and the probability of falsely judging packet loss as exceeding the threshold is reduced.

[0068] The node state evaluation method provided in this application can be applied to, for example... Figure 1 In the application environment shown, terminal 102 communicates with a data processing platform set on server 104 via a network. Terminal 102 can be, but is not limited to, various personal computers, laptops, smartphones, tablets, and portable wearable devices. Server 104 can be implemented as a standalone server or a server cluster consisting of multiple servers.

[0069] In one embodiment, such as Figure 2 As shown, a node state evaluation method is provided, which can be applied to... Figure 1 Taking the terminal in the example, the explanation includes the following steps:

[0070] S1: In response to the detection of a node status assessment request, obtain a probe list, which includes at least the node address, port number, network interface name, and network interface address.

[0071] It should be noted that both the probe list and the node status assessment request are sent by the upper-layer application. The upper-layer application can use these to issue commands or requests and control the driver layer based on the configured interface. A node refers to a connection point in the entire network, such as a server connected to the network. Each node includes multiple ports, each port has a port number, and each port number corresponds to a network interface. The probe list contains relevant data information about the node to be evaluated and the peer node. The relevant data information can specifically include the probe network interface name, network interface MAC (i.e., network interface address, which is the media access control address), port number, node name, and node IP (Internet Protocol address). Taking a server as an example, the network interface MAC includes the local network interface MAC and the peer network interface MAC, the node IP includes the local IP and the peer IP, the port number includes the local port number and the peer port number, the probe network interface name includes the local network interface name and the peer network interface name, and the node name includes the local node name and the peer node name. Here, "local" refers to the target node, and "peer" refers to other nodes in the entire network other than the target node.

[0072] In some specific implementations, in response to the detection of a node state assessment request, obtaining the probe list includes:

[0073] Utilize upper-layer applications to send node status assessment requests and probe lists;

[0074] Based on the relevant data information in the probe list, a corresponding packet capture strategy is generated and sent to the driver. This packet capture strategy is to capture specific packets generated based on the relevant data information in the probe list.

[0075] Among them, such as Figure 3 As shown, the driver connects to the upper-layer application through an interface, and the upper-layer application controls the driver through the interface. The interface includes an echo service startup interface, an initialization probe interface, an initialization detection interface, and a latency and packet loss acquisition interface. The initialization probe interface, the initialization detection interface, and the latency and packet loss acquisition interface are used in the probe process, the detection process, and the latency and packet loss acquisition process, respectively. The echo service startup interface is used in the probe process and the detection process. In this application, all detection schemes are performed in the kernel state, which can avoid the two data packet copying actions caused by packet capture. The node status is evaluated based on the kernel state, and only counting statistics are performed. There is no longer any data packet copying action, which can improve detection efficiency and reduce the additional occupation of system resources.

[0076] S2: Based on the probe list, detect and determine the available ports in the target node, and the first target port that matches the available port. The first target port is a port in other nodes in the entire network other than the target node. Each available port forms a mapping relationship with ports in multiple other nodes.

[0077] It should be noted that the available ports in the target node refer to the ports corresponding to the network interfaces that receive reply messages as detected through the probing process. The first target port is the port that sends the reply message. One port in the target node can form a mapping relationship with ports in multiple other nodes.

[0078] In some specific implementations, such as Figure 5 As shown, based on the probe list, the detection of available ports in the target node includes:

[0079] The driver layer obtains the probe list corresponding to the second target port in the target node, initializes the threshold for the number of probes to the second target port, obtains the preset threshold, and generates a packet capture strategy based on the probe list, that is, captures specific packets generated based on the relevant information in the probe list. The preset threshold can be set according to actual needs, such as 20 times. The second target port is the port to be probed in the target node. The relevant information of the probe list is as described above and will not be repeated here.

[0080] In response to the detection that the current number of probes to the second target port is less than or equal to a preset threshold, i.e., the current number of probes is less than or equal to 20, a probe packet is constructed based on the probe list, i.e., a probe packet is constructed based on the relevant information in the probe list. The relevant information may include the local network port MAC (i.e., the network port address corresponding to the second target port), the peer network port MAC, the local IP (i.e., the IP of the node to which the second target port belongs), the peer IP, the local port number (i.e., the port number of the second target port), and the peer port number. The probe packet is then sent to the network port corresponding to the second target port so that the probe packet can be sent to the peer network port through that network port.

[0081] If no response message to the probe message is captured within the preset time range, the peer port number in the probe list is incremented by one, and the current probe count is incremented by one. The preset time range can be set according to actual needs, such as 2 seconds. If no response message to the probe message sent by the peer port is captured within 2 seconds, it means that the peer port does not match the second target port. In this case, the peer port number is incremented by one, and other ports in the node are selected again for probe. In addition, the current probe count is incremented by one. For example, if the current probe count is the 10th time, after the increment operation, it becomes the 11th time, and the next probe will be the 11th probe.

[0082] When the current number of probes is detected to be greater than a preset threshold and no response message is captured in any probe process corresponding to any probe number, it indicates that the probe has failed. That is, after incrementing the probe count, it exceeds the preset threshold. For example, if the probe count is the 21st time and no response message is captured in the previous 20 probe processes, it indicates that the probe has failed, meaning that there is no matching port for the second target port.

[0083] If a response message to the probe message is captured within a preset time range, the probe is considered successful. For example, if a response message to the probe message sent by the peer port is captured within 2 seconds, the probe is considered successful.

[0084] In response to the detection of a probe failure, the second target port is defined as an unavailable port;

[0085] In response to the detection of a successful probe result, the second target port is defined as an available port, and the first target information is recorded. The first target information includes at least the available port and the node address, port number and network interface address corresponding to the first target port that matches the available port, namely the local network interface MAC (i.e. the network interface address corresponding to the second target port), the peer network interface MAC, the local IP (i.e. the IP of the node to which the second target port belongs), the peer IP, the local port number (i.e. the port number of the second target port) and the peer port number.

[0086] In some specific implementations, based on the probe list, determining a first target port that matches an available port includes:

[0087] Based on the network port corresponding to the network port name and the probe list, a probe message is generated through the probe list and sent to multiple peer ports through the network port. The peer ports are ports of other nodes in the entire network except for the target node. Each peer port belongs to a different node, and the number of peer ports can be set to 3, 4, etc. according to actual needs.

[0088] When a response message to the probe message sent by at least one peer port is captured within a preset time range, i.e., a response message sent by the peer port through its corresponding network port, it indicates that the probe is successful. The preset time range can be set according to actual needs, such as 2 seconds.

[0089] In response to the detection of a successful probe result, the peer port of the reply message that sent the message is defined as the first target port that matches the available port;

[0090] Based on the available ports and their matching first target ports, a one-to-one mapping relationship is formed, wherein one available port can be mapped to multiple first target ports.

[0091] In the above implementation, by pre-detecting and determining the available ports in the target node, as well as the first target port that matches the available ports, it can be ensured that each port used for testing can provide useful data during subsequent node status detection. This avoids the occurrence of unavailable ports during the detection process, which affects the efficiency and accuracy of status assessment and improves the timeliness of status assessment.

[0092] In some specific implementations, the priority determination rules for the peer port to which the probe message needs to be sent include:

[0093] Retrieve the number of successful matches and the time between the target port and multiple peer ports from the historical database;

[0094] The target time period is divided according to the time cycle. The target time period can be from Monday to Sunday. The time cycle can be weekdays and weekends, or working hours and non-working hours. For example, 9:00 to 18:00 from Monday to Friday is working hours, and the rest of the time is non-working hours. Weekdays can also be defined as working hours, and weekends can be defined as non-working hours.

[0095] Determine the time period to which the successful match time between the target port and the peer port belongs, and process the number of successful matches, including:

[0096] When a successful match is detected during working hours and the number of successful matches is greater than or equal to the fourth preset value, the number of successful matches is incremented by one.

[0097] When a successful match is detected during non-working hours and the number of successful matches is greater than or equal to the fourth preset value, the number of successful matches is not processed.

[0098] When a successful match is detected during non-working hours and the number of successful matches is less than the fourth preset value, the number of successful matches is decremented by one.

[0099] When a successful match is detected during working hours and the number of successful matches is less than the fourth preset value, no action is taken on the number of successful matches.

[0100] The fourth preset threshold can be set according to actual needs, such as 100 times. Based on the number of matching after processing, multiple peer ports are sorted. The one with the most successful matching has the highest priority, and so on. According to the priority sorting order, the probe message is sent to the peer port with the higher priority.

[0101] In the above implementation, by prioritizing the peer ports to determine the preferred sending path for probe packets, the matching speed between the target port and the peer port can be improved, thereby improving the efficiency of node status assessment.

[0102] S3: Based on the echo service mechanism and the mapping relationship, determine the latency and packet loss rate of the network port corresponding to the target available port.

[0103] It should be noted that, as Figure 4 As shown, the echo service mechanism includes:

[0104] In response to the detection of an echo service request from an upper-layer application, the echo service is started using the driver layer, and a packet capture strategy is issued. The first detection message based on the second target information is sent to the peer port through the network interface corresponding to the second target port.

[0105] In response to the capture of a first detection packet based on the second target information on the network interface corresponding to the peer port, the second target information in the first detection packet is swapped in order to generate a new packet to clearly indicate that the new packet is a reply packet. That is, the second target port related information in the first detection packet is swapped with the peer port information. For example, if the second target information in the first detection packet is the local network interface MAC, the peer network interface MAC, the local IP, the peer IP, the local port number, and the peer port number, the information in the new packet is the peer network interface MAC, the local network interface MAC, the peer IP, the local IP, the peer port number, and the local port number.

[0106] The new message is returned to the network interface corresponding to the second target port in response to the echo service request.

[0107] If the echo service mechanism is applied during the initialization detection phase, the second target port is the target node port that has not yet been determined to be available, and the peer port is the other node port used to determine whether it matches the second target port. If the echo service mechanism is applied during the initialization detection phase, the second target port is the target available port, and the peer port is the other node port that matches the target available port.

[0108] In some specific implementations, such as Figure 6 As shown, based on the echo service mechanism and the mapping relationship, determining the latency and packet loss rate of the network interface corresponding to the target available port includes:

[0109] In response to the detection of a node status assessment request, based on the mapping relationship, a second detection message generated based on the first target information is sent to the network interface corresponding to the first target port that matches the target available port through the network interface corresponding to the target available port.

[0110] In response to capturing a second detection packet generated based on the first target information on the network interface corresponding to the first target port, the first target information in the second detection packet is swapped in order to generate a new packet;

[0111] The new message is returned to the network interface corresponding to the target available port, and the message transmission latency and packet loss rate are obtained to evaluate the status of the target node.

[0112] In some specific embodiments, the methods for determining the latency and packet loss rate include:

[0113] Based on a preset time interval, the second detection message is sent to the network interface corresponding to the target available port, and the sending time is recorded on the second detection message. The preset time interval can be set according to actual needs, such as 0.02 seconds, that is, a detection message is sent out every 0.02 seconds. Each detection message includes multiple data packets.

[0114] In response to receiving a return message of the second detection message within a preset time range, the difference between the receiving time and the sending time is calculated to obtain the delay, and the packet loss rate is determined based on the number of data packets in the return message and the number of data packets in the second detection message. The preset time range can be set according to actual needs, such as 2 seconds. That is, when the return message is received within 2 seconds, the difference between the receiving time and the sending time is the delay, and the difference between the number of data packets in the second detection message and the number of data packets in the return message is divided by the number of data packets in the second detection message to obtain the packet loss rate.

[0115] In the above implementation, the latency and packet loss rate are calculated and determined based on the echo service mechanism and the mapping relationship between available ports and other matching node ports, which reduces the probability of falsely judging packet loss exceeding the threshold and improves the accuracy of state assessment.

[0116] S4: Evaluate the state of the target node based on the latency and / or the packet loss rate.

[0117] It should be noted that the status of the target node can include healthy status, unhealthy status, and sub-healthy status.

[0118] In some specific implementations, such as Figure 7 As shown, based on the latency and / or the packet loss rate, evaluating the state of the target node includes:

[0119] In response to detecting that the latency is greater than a first preset value and / or the packet loss rate is greater than a second preset value, the network port corresponding to the target available port is shut down. If the target available port has multiple matching other node ports, multiple latencies and packet loss rates can be calculated. This application selects the minimum latency and minimum packet loss rate for comparison with the preset values. The first and second preset values ​​can be set according to actual needs, such as 0.01 seconds and 1% respectively. If the above standards are met, the network port corresponding to the target available port is shut down.

[0120] When the number of network ports in the target node that are in a closed state is greater than or equal to a third preset value, the target node is defined as being in a sub-healthy state, and a node isolation operation is performed. The third preset value can be set according to actual needs, and is generally 100% of the network ports in a node, that is, all network ports under a node are down (all in a closed state). In this case, the target node is defined as being in a sub-healthy state, and a node isolation operation is performed.

[0121] In the above implementation, when the network interface to which the target available port belongs is found to be in a sub-healthy state, a network interface down operation is triggered. When the target node is found to be in a sub-healthy state, a node isolation action is triggered. Thus, based on timely operation, the impact on system performance is reduced.

[0122] In the above node status assessment method, all network sub-health detection is performed in the kernel space. Specifically, this includes probing available ports, detecting network latency and network packet loss values, and determining whether the network latency and network packet loss values ​​exceed the threshold. If they do, a down port or node network isolation action is triggered. Based on the above method, the timeliness of network sub-health detection can be improved, its impact on system performance can be reduced, and the probability of falsely judging packet loss as exceeding the threshold can be reduced.

[0123] It should be understood that, although Figures 2-7 The steps in the flowchart are shown sequentially as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order in which these steps are executed, and they can be performed in other orders. Figures 2-7 At least some of the steps in the process may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least some of the sub-steps or stages of other steps.

[0124] In one embodiment, such as Figure 8 As shown, a node state assessment device is provided, comprising: an acquisition module, a detection module, a determination module, and a state assessment module, wherein:

[0125] The acquisition module is used to acquire a probe list when a node status assessment request is detected. The probe list includes at least the node address, port number, network interface name, and network interface address.

[0126] The detection module is used to detect and determine the available ports in the target node based on the detection list, and the first target port that matches the available port. The first target port is a port in other nodes in the entire network other than the target node. Each available port forms a mapping relationship with ports in multiple other nodes.

[0127] The determination module is used to determine the latency and packet loss rate of the network interface corresponding to the target available port based on the echo service mechanism and the mapping relationship;

[0128] The status assessment module is used to assess the status of the target node based on the latency and / or the packet loss rate.

[0129] In a preferred embodiment of the present invention, the detection module is specifically used for:

[0130] Obtain the probe list corresponding to the second target port in the target node, and initialize the threshold for the number of probes to the second target port to obtain the preset threshold;

[0131] When the current number of probes to the second target port is less than or equal to a preset threshold, a probe packet is constructed based on the probe list and the probe packet is sent to the network port corresponding to the second target port;

[0132] If no response message to the probe message is captured within the preset time range, the peer port number in the probe list is incremented by one, and the current probe count is incremented by one.

[0133] If the current number of probes exceeds a preset threshold and no response message is captured during any probe attempt, the probe is considered to have failed.

[0134] If a response message to the probe message is captured within the preset time range, the probe is considered successful.

[0135] In response to the detection of a probe failure, the second target port is defined as an unavailable port;

[0136] In response to the detection of a successful probe result, the second target port is defined as an available port, and the first target information is recorded. The first target information includes at least the available port and the node address, port number and network interface address corresponding to the first target port that matches the available port.

[0137] In a preferred embodiment of the present invention, the detection module is further configured to:

[0138] Based on the network port corresponding to the network port name and the probe list, the probe message is sent to multiple peer ports, where the peer ports are ports in other nodes in the entire network except for the target node;

[0139] The detection is considered successful when a reply message is received from at least one peer port within a preset time range.

[0140] In response to the detection of a successful probe result, the peer port of the reply message that sent the message is defined as the first target port that matches the available port;

[0141] A one-to-one mapping relationship is formed based on the available ports and their matching first target ports.

[0142] In a preferred embodiment of the present invention, the determining module is specifically used for:

[0143] In response to the detection of an echo service request, a first detection message based on the second target information is sent to the peer port through the network interface corresponding to the second target port.

[0144] When a first detection packet based on the second target information is captured on the network interface corresponding to the peer port, the second target information in the first detection packet is swapped in order to generate a new packet.

[0145] The new message is returned to the network interface corresponding to the second target port in response to the echo service request.

[0146] In a preferred embodiment of the present invention, the determining module is further configured to:

[0147] In response to the detection of a node status assessment request, based on the mapping relationship, a second detection message generated based on the first target information is sent to the network interface corresponding to the first target port that matches the target available port through the network interface corresponding to the target available port.

[0148] In response to capturing a second detection packet generated based on the first target information on the network interface corresponding to the first target port, the first target information in the second detection packet is swapped in order to generate a new packet;

[0149] The new message is returned to the network interface corresponding to the target available port, and the message transmission latency and packet loss rate are obtained to evaluate the status of the target node.

[0150] In a preferred embodiment of the present invention, the determining module is further configured to:

[0151] Based on a preset time interval, the second detection message is sent to the network port corresponding to the target available port, and the sending time is recorded on the second detection message;

[0152] In response to receiving a return message of the second detection message within a preset time range, the difference between the receiving time and the sending time is calculated to obtain the delay, and the packet loss rate is determined based on the number of data packets in the return message and the number of data packets in the second detection message.

[0153] In a preferred embodiment of the present invention, the state assessment module is specifically used for:

[0154] In response to detecting that the latency is greater than a first preset value and / or the packet loss rate is greater than a second preset value, the network port corresponding to the target available port is shut down;

[0155] When the number of network ports in the target node that are in a closed state is greater than or equal to a third preset value, the target node is defined as being in a sub-healthy state, and node isolation operation is performed.

[0156] Specific limitations regarding the node state assessment device can be found in the limitations of the node state assessment method described above, and will not be repeated here. Each module in the aforementioned node state assessment device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device in hardware form, or stored in the memory of a computer device in software form, so that the processor can call and execute the operations corresponding to each module.

[0157] In one embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as follows: Figure 9 As shown, the computer device includes a processor, memory, network interface, display screen, and input devices connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The network interface is used to communicate with external terminals via a network connection. When the computer program is executed by the processor, it implements a node state evaluation method. The display screen can be an LCD screen or an e-ink screen. The input devices can be a touch layer covering the display screen, buttons, a trackball, or a touchpad mounted on the computer device casing, or an external keyboard, touchpad, or mouse.

[0158] Those skilled in the art will understand that Figure 9The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0159] In one embodiment, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to perform the following steps:

[0160] S1: In response to the detection of a node status assessment request, obtain a probe list, which includes at least the node address, port number, network interface name, and network interface address;

[0161] S2: Based on the probe list, detect and determine the available ports in the target node, and the first target port that matches the available port. The first target port is a port in other nodes in the entire network other than the target node. Each available port forms a mapping relationship with ports in multiple other nodes.

[0162] S3: Based on the echo service mechanism and the mapping relationship, determine the latency and packet loss rate of the network port corresponding to the target available port;

[0163] S4: Evaluate the state of the target node based on the latency and / or the packet loss rate.

[0164] In one embodiment, the processor, when executing a computer program, also performs the following steps:

[0165] Obtain the probe list corresponding to the second target port in the target node, and initialize the threshold for the number of probes to the second target port to obtain the preset threshold;

[0166] When the current number of probes to the second target port is less than or equal to a preset threshold, a probe packet is constructed based on the probe list and the probe packet is sent to the network port corresponding to the second target port;

[0167] If no response message to the probe message is captured within the preset time range, the peer port number in the probe list is incremented by one, and the current probe count is incremented by one.

[0168] If the current number of probes exceeds a preset threshold and no response message is captured during any probe attempt, the probe is considered to have failed.

[0169] If a response message to the probe message is captured within the preset time range, the probe is considered successful.

[0170] In response to the detection of a probe failure, the second target port is defined as an unavailable port;

[0171] In response to the detection of a successful probe result, the second target port is defined as an available port, and the first target information is recorded. The first target information includes at least the available port and the node address, port number and network interface address corresponding to the first target port that matches the available port.

[0172] In one embodiment, the processor, when executing a computer program, also performs the following steps:

[0173] Based on the network port corresponding to the network port name and the probe list, the probe message is sent to multiple peer ports, where the peer ports are ports in other nodes in the entire network except for the target node;

[0174] The detection is considered successful when a reply message is received from at least one peer port within a preset time range.

[0175] In response to the detection of a successful probe result, the peer port of the reply message that sent the message is defined as the first target port that matches the available port;

[0176] A one-to-one mapping relationship is formed based on the available ports and their matching first target ports.

[0177] In one embodiment, the processor, when executing a computer program, also performs the following steps:

[0178] In response to the detection of an echo service request, a first detection message based on the second target information is sent to the peer port through the network interface corresponding to the second target port.

[0179] When a first detection packet based on the second target information is captured on the network interface corresponding to the peer port, the second target information in the first detection packet is swapped in order to generate a new packet.

[0180] The new message is returned to the network interface corresponding to the second target port in response to the echo service request.

[0181] In one embodiment, the processor, when executing a computer program, also performs the following steps:

[0182] In response to the detection of a node status assessment request, based on the mapping relationship, a second detection message generated based on the first target information is sent to the network interface corresponding to the first target port that matches the target available port through the network interface corresponding to the target available port.

[0183] In response to capturing a second detection packet generated based on the first target information on the network interface corresponding to the first target port, the first target information in the second detection packet is swapped in order to generate a new packet;

[0184] The new message is returned to the network interface corresponding to the target available port, and the message transmission latency and packet loss rate are obtained to evaluate the status of the target node.

[0185] In one embodiment, the processor, when executing a computer program, also performs the following steps:

[0186] Based on a preset time interval, the second detection message is sent to the network port corresponding to the target available port, and the sending time is recorded on the second detection message;

[0187] In response to receiving a return message of the second detection message within a preset time range, the difference between the receiving time and the sending time is calculated to obtain the delay, and the packet loss rate is determined based on the number of data packets in the return message and the number of data packets in the second detection message.

[0188] In one embodiment, the processor, when executing a computer program, also performs the following steps:

[0189] In response to detecting that the latency is greater than a first preset value and / or the packet loss rate is greater than a second preset value, the network port corresponding to the target available port is shut down;

[0190] When the number of network ports in the target node that are in a closed state is greater than or equal to a third preset value, the target node is defined as being in a sub-healthy state, and node isolation operation is performed.

[0191] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, the computer program performing the following steps when executed by a processor:

[0192] S1: In response to the detection of a node status assessment request, obtain a probe list, which includes at least the node address, port number, network interface name, and network interface address;

[0193] S2: Based on the probe list, detect and determine the available ports in the target node, and the first target port that matches the available port. The first target port is a port in other nodes in the entire network other than the target node. Each available port forms a mapping relationship with ports in multiple other nodes.

[0194] S3: Based on the echo service mechanism and the mapping relationship, determine the latency and packet loss rate of the network port corresponding to the target available port;

[0195] S4: Evaluate the state of the target node based on the latency and / or the packet loss rate.

[0196] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:

[0197] Obtain the probe list corresponding to the second target port in the target node, and initialize the threshold for the number of probes to the second target port to obtain the preset threshold;

[0198] When the current number of probes to the second target port is less than or equal to a preset threshold, a probe packet is constructed based on the probe list and the probe packet is sent to the network port corresponding to the second target port;

[0199] If no response message to the probe message is captured within the preset time range, the peer port number in the probe list is incremented by one, and the current probe count is incremented by one.

[0200] If the current number of probes exceeds a preset threshold and no response message is captured during any probe attempt, the probe is considered to have failed.

[0201] If a response message to the probe message is captured within the preset time range, the probe is considered successful.

[0202] In response to the detection of a probe failure, the second target port is defined as an unavailable port;

[0203] In response to the detection of a successful probe result, the second target port is defined as an available port, and the first target information is recorded. The first target information includes at least the available port and the node address, port number and network interface address corresponding to the first target port that matches the available port.

[0204] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:

[0205] Based on the network port corresponding to the network port name and the probe list, the probe message is sent to multiple peer ports, where the peer ports are ports in other nodes in the entire network except for the target node;

[0206] The detection is considered successful when a reply message is received from at least one peer port within a preset time range.

[0207] In response to the detection of a successful probe result, the peer port of the reply message that sent the message is defined as the first target port that matches the available port;

[0208] A one-to-one mapping relationship is formed based on the available ports and their matching first target ports.

[0209] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:

[0210] In response to the detection of an echo service request, a first detection message based on the second target information is sent to the peer port through the network interface corresponding to the second target port.

[0211] When a first detection packet based on the second target information is captured on the network interface corresponding to the peer port, the second target information in the first detection packet is swapped in order to generate a new packet.

[0212] The new message is returned to the network interface corresponding to the second target port in response to the echo service request.

[0213] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:

[0214] In response to the detection of a node status assessment request, based on the mapping relationship, a second detection message generated based on the first target information is sent to the network interface corresponding to the first target port that matches the target available port through the network interface corresponding to the target available port.

[0215] In response to capturing a second detection packet generated based on the first target information on the network interface corresponding to the first target port, the first target information in the second detection packet is swapped in order to generate a new packet;

[0216] The new message is returned to the network interface corresponding to the target available port, and the message transmission latency and packet loss rate are obtained to evaluate the status of the target node.

[0217] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:

[0218] Based on a preset time interval, the second detection message is sent to the network port corresponding to the target available port, and the sending time is recorded on the second detection message;

[0219] In response to receiving a return message of the second detection message within a preset time range, the difference between the receiving time and the sending time is calculated to obtain the delay, and the packet loss rate is determined based on the number of data packets in the return message and the number of data packets in the second detection message.

[0220] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:

[0221] In response to detecting that the latency is greater than a first preset value and / or the packet loss rate is greater than a second preset value, the network port corresponding to the target available port is shut down;

[0222] When the number of network ports in the target node that are in a closed state is greater than or equal to a third preset value, the target node is defined as being in a sub-healthy state, and node isolation operation is performed.

[0223] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), Rambus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.

[0224] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0225] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the invention patent. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this patent application should be determined by the appended claims.

Claims

1. A node state evaluation method, characterized in that, The method includes: In response to the detection of a node status assessment request, a probe list is obtained, which includes at least the node address, port number, network interface name, and network interface address; Based on the probe list, the available ports in the target node are detected and determined, as well as the first target port that matches the available port. The first target port is a port in other nodes in the entire network other than the target node. Each available port forms a mapping relationship with ports in multiple other nodes. Based on the echo service mechanism and the mapping relationship, the latency and packet loss rate of the network interface corresponding to the target available port are determined; The state of the target node is evaluated based on the latency and / or the packet loss rate; The echo service mechanism includes: In response to the detection of an echo service request, a first detection message based on the second target information is sent to the peer port through the network interface corresponding to the second target port. When a first detection packet based on the second target information is captured on the network interface corresponding to the peer port, the second target information in the first detection packet is swapped in order to generate a new packet. The new message is returned to the network interface corresponding to the second target port in response to the echo service request; Based on the echo service mechanism and the mapping relationship, determining the latency and packet loss rate of the network interface corresponding to the target available port includes: In response to the detection of a node status assessment request, based on the mapping relationship, a second detection message generated based on the first target information is sent to the network interface corresponding to the first target port that matches the target available port through the network interface corresponding to the target available port. In response to capturing a second detection packet generated based on the first target information on the network interface corresponding to the first target port, the first target information in the second detection packet is swapped in order to generate a new packet; The new message is returned to the network interface corresponding to the target available port, and the message transmission latency and packet loss rate are obtained to evaluate the status of the target node.

2. The node state evaluation method according to claim 1, characterized in that, Based on the probe list, the available ports in the target node are determined by probes including: Obtain the probe list corresponding to the second target port in the target node, and initialize the threshold for the number of probes to the second target port to obtain the preset threshold; When the current number of probes to the second target port is less than or equal to a preset threshold, a probe packet is constructed based on the probe list and the probe packet is sent to the network port corresponding to the second target port; If no response message to the probe message is captured within the preset time range, the peer port number in the probe list is incremented by one, and the current probe count is incremented by one. If the current number of probes exceeds a preset threshold and no response message is captured during any probe attempt, the probe is considered to have failed. If a response message to the probe message is captured within the preset time range, the probe is considered successful. In response to the detection of a probe failure, the second target port is defined as an unavailable port; In response to the detection of a successful probe result, the second target port is defined as an available port, and the first target information is recorded. The first target information includes at least the available port and the node address, port number and network interface address corresponding to the first target port that matches the available port.

3. The node state evaluation method according to claim 2, characterized in that, Based on the probe list, the probe determines the first target port that matches the available ports, including: Based on the network port corresponding to the network port name and the probe list, the probe message is sent to multiple peer ports, where the peer ports are ports in other nodes in the entire network except for the target node; The detection is considered successful when a reply message is received from at least one peer port within a preset time range. In response to the detection of a successful probe result, the peer port of the reply message that sent the message is defined as the first target port that matches the available port; A one-to-one mapping relationship is formed based on the available ports and their matching first target ports.

4. The node state evaluation method according to claim 1, characterized in that, The methods for determining the latency and packet loss rate include: Based on a preset time interval, the second detection message is sent to the network port corresponding to the target available port, and the sending time is recorded on the second detection message; In response to receiving a return message of the second detection message within a preset time range, the difference between the receiving time and the sending time is calculated to obtain the delay, and the packet loss rate is determined based on the number of data packets in the return message and the number of data packets in the second detection message.

5. The node state evaluation method according to claim 1, characterized in that, Evaluating the state of the target node based on the latency and / or the packet loss rate includes: In response to detecting that the latency is greater than a first preset value and / or the packet loss rate is greater than a second preset value, the network port corresponding to the target available port is shut down; When the number of network ports in the target node that are in a closed state is greater than or equal to a third preset value, the target node is defined as being in a sub-healthy state, and node isolation operation is performed.

6. A node state assessment apparatus for implementing the node state assessment method as described in claim 1, characterized in that, The device includes: The acquisition module is used to acquire a probe list when a node status assessment request is detected. The probe list includes at least the node address, port number, network interface name, and network interface address. The detection module is used to detect and determine the available ports in the target node based on the detection list, and the first target port that matches the available port. The first target port is a port in other nodes in the entire network other than the target node. Each available port forms a mapping relationship with ports in multiple other nodes. The determination module is used to determine the latency and packet loss rate of the network interface corresponding to the target available port based on the echo service mechanism and the mapping relationship; The status assessment module is used to assess the status of the target node based on the latency and / or the packet loss rate.

7. A computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the method of any one of claims 1 to 5.

8. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the method of any one of claims 1 to 5.

Citation Information

Patent Citations

  • Network health state analysis method and device, computer equipment and storage medium

    CN113890816A

  • Network link monitoring method and device, electronic equipment and storage medium

    CN115632968A