Network state detection method, device, equipment and medium

By acquiring and analyzing network performance data, determining whether the network link is in a sub-health state, and by sending target protocol messages and analyzing feedback information, determining the status of each device, the problem of difficulty in quickly determining network failure conditions in the prior art is solved, real-time monitoring of network status and rapid fault location are achieved.

CN119743414AInactive Publication Date: 2025-04-01INSPUR SUZHOU INTELLIGENT TECH CO LTD

Patent Information

Application Number
CN202412000378.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-31
Publication Date
2025-04-01
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

The prior art is difficult to quickly determine network failure conditions, which makes it difficult to quickly recover when suffering from sudden network risks, and is prone to falling into a state of low performance.

Method used

By obtaining the network performance of the target network link, it is determined whether the network sub-health status occurs. If it occurs, the target protocol message is sent to the switch, and the status of each device is determined based on the feedback message of the switch and the node resource information of the electronic device.

Benefits of technology

Real-time monitoring of network status and rapid determination of fault conditions are realized, the health status of network links can be accurately judged, and the risk resistance and recovery speed of the network are improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119743414A_ABST
    Figure CN119743414A_ABST
Patent Text Reader

Abstract

The invention relates to the field of network communication, in particular to a network state detection method, device and equipment and a medium, and the method comprises the steps: obtaining the network performance of a target network link which comprises electronic equipment, a switch and target equipment; determining whether the target network link has a network sub-health state according to the network performance of the target network link; if the target network link is in the network sub-health state, a target protocol message is sent to the switch, and the target protocol message is used for enabling the switch to return a target protocol feedback message; and determining the state of each device of the target network link according to the packet loss information of the target protocol feedback message and the node resource information of the electronic device. According to the invention, the real-time monitoring of the network state is realized, and the fault reason can be quickly determined.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of network communication, and in particular to a network status detection method, device, equipment and medium. Background Art

[0002] With the rapid development of information technology, the network has become the core infrastructure of modern large and medium-sized enterprises, supporting the daily operation and data processing of enterprises. The state in which the network can operate normally and recover quickly after being impacted by the outside world is called a healthy state; the state in which the network is paralyzed and cannot operate normally is called a sub-healthy state.

[0003] The networks of many large and medium-sized enterprises are in a sub-healthy state. Networks in this state can operate normally, but their ability to resist risks is extremely low. When they are subject to sudden network risks, they are easily paralyzed and difficult to recover for a long time, which will cause the distributed system to enter a state of low performance.

[0004] In related technologies, a client / server architecture is usually used to detect whether the network is in a sub-healthy state, that is, the client sends a detection message to the server, and the server immediately returns the message after receiving the message. After the client collects the returned message, it can calculate the delay and packet loss on the entire link from the client to the server based on the time tag and the number of sent and received messages, thereby making a preliminary assessment of the network status. This method can reflect the current state of the network to a certain extent, but it cannot determine the fault condition of the network. Summary of the invention

[0005] The present invention aims to provide a network status detection method, device, equipment and medium, which can quickly determine the fault situation.

[0006] In a first aspect, a network status detection method is provided, which is performed by an electronic device, and the network status detection method includes:

[0007] Acquire network performance of a target network link, wherein the target network link includes: an electronic device, a switch, and a target device;

[0008] Determining whether the target network link is in a sub-healthy state according to the network performance of the target network link;

[0009] If the target network link is in a sub-healthy state, a target protocol message is sent to the switch, and the target protocol message is used to make the switch return a target protocol feedback message;

[0010] The status of each device of the target network link is determined according to the packet loss information of the target protocol feedback message and the node resource information of the electronic device.

[0011] In a preferred example, the present invention can be further configured as follows: the target protocol message is a bidirectional forwarding detection protocol message.

[0012] In a preferred example, the present invention can be further configured as follows: determining the status of each device of the target network link according to the packet loss information of the target protocol feedback message and the node resource information of the electronic device, including:

[0013] If the packet loss information indicates that there is a packet loss situation and the packet loss rate is not 1, the state of the switch is determined to be a healthy state, and whether the state of the electronic device is a healthy state is determined according to the node resource information of the electronic device; if the state of the electronic device is a healthy state, the state of the target device is determined to be a sub-healthy state;

[0014] If the packet loss information indicates that there is no packet loss, it is determined that the state of the target device is a sub-healthy state.

[0015] In a preferred example, the present invention can be further configured as follows:

[0016] If the state of the electronic device is a sub-healthy state, optimizing the resource information of the electronic device so that the state of the electronic device is a healthy state;

[0017] Acquire new network performance of the target network link; determine whether the target network link is in a network sub-health state according to the new network performance of the target network link;

[0018] If the target network link is in a sub-healthy state, the target device is determined to be in a sub-healthy state; if the target network link is not in a sub-healthy state, the target device is determined to be in a healthy state.

[0019] In a preferred example, the present invention can be further configured as follows: the sending of the target protocol message to the switch includes:

[0020] Divide the current period into multiple sub-periods;

[0021] Sending the target protocol message to the switch at a first frequency in a first sub-period;

[0022] If the sub-packet loss information of the first sub-period indicates that there is no packet loss, the target protocol message is sent to the switch at a second frequency in the next sub-period; the second frequency is greater than the first frequency; otherwise, the target protocol message is sent to the switch at the first frequency in the next sub-period; until the sending of the target protocol message in the current period is completed.

[0023] In a preferred example, the present invention can be further configured as follows: the network performance includes packet loss rate and delay;

[0024] The determining, based on the network performance of the target network link, whether the target network link is in a network sub-health state comprises:

[0025] Determine whether the packet loss rate exceeds a preset packet loss rate threshold; determine whether the delay exceeds a preset delay threshold;

[0026] If the preset condition is met, it is determined that the target network link is in a sub-healthy state; otherwise, it is determined that the target network link is in a sub-healthy state;

[0027] The preset conditions include: the packet loss rate exceeds a preset packet loss rate threshold, or the delay exceeds a preset delay threshold.

[0028] In a preferred example, the present invention can be further configured as follows: before determining whether the target network link is in a network sub-healthy state according to the network performance of the target network link, the method further includes:

[0029] Obtaining historical threshold information of the previous period, wherein the historical threshold information includes: a preset packet loss rate historical threshold and a preset delay historical threshold;

[0030] Determine a first threshold adjustment value according to a difference between current network traffic and network traffic in a previous period;

[0031] Determine a second threshold adjustment value according to the time period to which the current moment belongs and the time period to which the previous time period belongs;

[0032] Threshold information is determined according to the first threshold adjustment value, the second threshold adjustment value and the historical threshold information, where the threshold information includes: a preset packet loss rate threshold and a preset delay threshold.

[0033] In a second aspect, a network status detection device is provided, comprising:

[0034] An acquisition module, used to acquire network performance of a target network link, wherein the target network link includes: an electronic device, a switch, and a target device;

[0035] A first determination module is used to determine whether the target network link is in a network sub-health state according to the network performance of the target network link;

[0036] A re-judgment module, used for sending a target protocol message to the switch if the target network link is in a sub-healthy state, wherein the target protocol message is used for causing the switch to return a target protocol feedback message;

[0037] The second determination module is used to determine the status of each device of the target network link according to the packet loss information of the target protocol feedback message and the node resource information of the electronic device.

[0038] In a third aspect, an electronic device is provided, including:

[0039] one or more processors;

[0040] Memory;

[0041] One or more applications, wherein one or more applications are stored in a memory and configured to be executed by one or more processors, and the one or more programs are configured to: perform operations corresponding to the network status detection method shown in any possible implementation of the first aspect.

[0042] In a fourth aspect, a computer-readable storage medium is provided, wherein the storage medium stores at least one instruction, at least one program, a code set or an instruction set, and the at least one instruction, at least one program, a code set or an instruction set is loaded by a processor and executes the steps of the network status detection method shown in any possible implementation method of the first aspect.

[0043] In a fifth aspect, a computer program product is provided, including a computer program, which, when executed by a processor, implements operations corresponding to the network status detection method shown in any possible implementation manner in the first aspect.

[0044] In summary, the network status detection method provided by the present invention includes the following beneficial technical effects:

[0045] The network performance of the target network link is obtained. Based on the network performance data, it can be accurately determined whether the target network link has entered a sub-healthy state. When a sub-healthy state is detected, a small-scale detection is performed, specifically the detection of the electronic device to the switch link. The electronic device will quickly send the target protocol message to the switch, and use the target protocol feedback message returned by the switch and the node resource information of the electronic device to comprehensively evaluate the specific status of each device on the target network link. This not only realizes real-time monitoring of the network status, but also can quickly determine the fault condition.

[0046] In addition, the present invention also provides a network status detection device, equipment and medium, all of which have the above-mentioned beneficial technical effects. BRIEF DESCRIPTION OF THE DRAWINGS

[0047] In order to more clearly illustrate the embodiments of the present invention or the technical solutions of the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. 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.

[0048] Figure 1 It is a schematic diagram of an application scenario of a network status detection method provided by an embodiment of the present invention;

[0049] Figure 2 It is a flow chart of a network status detection method provided by an embodiment of the present invention;

[0050] Figure 3 A flowchart of a specific network status detection method provided by an embodiment of the present invention;

[0051] Figure 4 It is a structural schematic diagram of a network status detection device provided by an embodiment of the present invention;

[0052] Figure 5 It is a structural schematic diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0053] This specific embodiment is merely an explanation of the present invention and is not a limitation of the present invention. After reading this specification, those skilled in the art may make non-creative modifications to the present embodiment as needed, but such modifications are protected by patent law as long as they are within the scope of the present invention.

[0054] It should be noted that in the optional embodiments of the present invention, the object information and other related data involved, when the embodiments of the present invention are applied to specific products or technologies, need to obtain the permission or consent of the object, and the collection, use and processing of the relevant data need to comply with the relevant laws, regulations and standards of the relevant countries and regions. In other words, if the embodiments of the present invention involve data related to the object, it needs to be obtained with the authorization and consent of the object, the authorization and consent of the relevant department, and in compliance with the relevant laws, regulations and standards of the country and region. If personal information is involved in the embodiments, the acquisition of all personal information needs to obtain the consent of the individual. If sensitive information is involved, the separate consent of the information subject needs to be obtained. The embodiments also need to be implemented with the authorization and consent of the object.

[0055] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are 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.

[0056] In addition, the term "and / or" in this article is only a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article, unless otherwise specified, generally means that the associated objects before and after are in an "or" relationship.

[0057] For ease of understanding, an embodiment of the present invention provides a scenario diagram of a method for detecting sub-health in a network, such as Figure 1 As shown in the figure, it includes: node 1 (client device), switch and node 2 (server device). On the basis of the original network sub-health detection, target protocol messages are added, such as BFD detection messages. That is, in the time series, after the original network sub-health detects that there is a network sub-health problem, the sending of BFD detection messages is triggered to narrow the scope of the problem.

[0058] Taking the BFD protocol as an example, the embodiment of the present invention proposes a method for detecting and processing network sub-health based on the extended BFD protocol. First, according to the original network sub-health detection logic, the C / S architecture is used to detect delay and packet loss. When it is found that the delay and / or packet loss exceeds the threshold, the BFD protocol (SMP protocol) is immediately re-judged, that is, a two-way forwarding detection protocol message is created and sent to the outside to detect whether there is a problem from the node to the switch. If there is also packet loss in the two-way forwarding detection protocol message, the node system status is immediately re-judged, that is, whether there is a problem with the node resources (CPU, memory, network). According to the above logic, it can be determined whether the fault is in the Client node or in the link from the Client to the switch. Through the above logic, the specific problem point can be quickly located, the accuracy of network sub-health detection is improved, the probability of misjudging the packet loss exceeding the threshold is reduced, and the operation and maintenance efficiency can also be improved.

[0059] Specifically, an embodiment of the present invention provides a network status detection method, such as Figure 2As shown, the method provided in the embodiment of the present invention can be executed by an electronic device, and the electronic device is a server. The server can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides cloud computing services. The terminal device can be a smart phone, a tablet computer, a laptop computer, a desktop computer, etc., but is not limited to this. The terminal device and the electronic device can be directly or indirectly connected through wired or wireless communication, and the embodiment of the present invention is not limited here. The method includes:

[0060] S101, obtaining network performance of a target network link, where the target network link includes: an electronic device, a switch, and a target device;

[0061] The target network link is used to realize data transmission between the electronic device and the target device. When the electronic device is a client device, the target device is a server; when the electronic device is a server, the target device is a client device. The switch is used to forward data packets and connect different electronic devices and target devices through multiple ports. Network performance includes but is not limited to bandwidth, delay, packet loss rate, and jitter, which can reflect the performance of the target network link, such as transmission capacity, response speed, and stability.

[0062] S102, determining whether the target network link is in a sub-healthy state according to the network performance of the target network link;

[0063] In the embodiment of the present invention, the network performance is monitored to see whether it exceeds a threshold value. If it exceeds the threshold value, it indicates that the network is in a sub-healthy state.

[0064] S103, if the target network link is in a sub-healthy state, a target protocol message is sent to the switch, and the target protocol message is used to make the switch return a target protocol feedback message;

[0065] The target protocol message is a bidirectional forwarding detection protocol message or an icmp protocol message.

[0066] Bfd (Bidirectional Forwarding Detection) provides a general, standardized, media-independent and protocol-independent fast fault detection mechanism for fast detection and monitoring of the forwarding connectivity of links or IP routes in the network. The icmp protocol message (Internet Control Message Protocol) is part of the Internet protocol suite and is used to transmit control messages between IP hosts and routers.

[0067] When a sub-healthy network state is detected, the electronic device will automatically send the target protocol message and receive the feedback message from the switch. The communication process of the entire target link is divided into at least two small segments, and then the fault is determined for a certain small segment. By gradually narrowing the fault area, accurate fault location can be performed.

[0068] In some embodiments, the electronic device sends a target protocol message with a first timestamp and requires the switch to reply with a response with a second timestamp of received data and a third timestamp of returned data, so as to determine the delay and packet loss through these timestamps.

[0069] S104: Determine the status of each device of the target network link according to the packet loss information of the target protocol feedback message and the node resource information of the electronic device.

[0070] Packet loss information indicates whether information is lost or not successfully received during transmission based on the target protocol feedback message. The status of each device in the target network link refers to the current working status of each node (i.e., electronic device, switch, and target device) in the target network link, including whether it is operating normally (healthy status), whether there is a fault, etc.

[0071] It is understandable that in the process of network communication, in order to ensure reliable data transmission and stable operation of the network, it is necessary to constantly monitor the status of the network link. If the electronic device can receive information fed back by the switch, the status of the switch can be determined as a healthy state. At this time, it is necessary to pay attention to the node resource information of the electronic device to determine whether the electronic device is in a healthy state; since the target network link is currently in a sub-healthy state, if the electronic device is also in a healthy state, the target device is in a sub-healthy state. Through simple judgment, the location of the fault can be preliminarily located, so that the technicians can carry out targeted maintenance.

[0072] It can be seen that in the embodiment of the present invention, the network performance of the target network link is obtained, and based on the network performance data, it can be accurately determined whether the target network link has entered a sub-healthy state of the network; when the sub-healthy state is detected, a small-scale detection is performed, specifically the detection of the electronic device to the switch link, wherein the electronic device will quickly send the target protocol message to the switch, and use the target protocol feedback message returned by the switch and the node resource information of the electronic device to comprehensively evaluate the specific status of each device on the target network link, which not only realizes real-time monitoring of the network status, but also can quickly determine the fault condition.

[0073] A possible implementation of the embodiment of the present invention, S104, determining the state of each device of the target network link according to the packet loss information of the target protocol feedback message and the node resource information of the electronic device, includes:

[0074] S1041. If the packet loss information indicates that there is no packet loss, determine that the state of the target device is a sub-healthy state.

[0075] Among them, if there is no packet loss, it means that the link between the electronic device and the switch is normal, and both are in a healthy state. However, since the target network link is in a sub-healthy state, the state of the target device is predicted to be a sub-healthy state.

[0076] S1042: If the packet loss information indicates that there is packet loss and the packet loss rate is not 1, determining that the state of the switch is a healthy state, and determining whether the state of the electronic device is a healthy state based on the node resource information of the electronic device;

[0077] In an embodiment of the present invention, if there is packet loss, if all packets are lost, that is, the packet loss rate is 1, at this time, it cannot be determined whether it is an electronic device failure or a switch failure. It can be judged in combination with the network performance of the target network link. If at least one feedback message can be obtained during the preliminary judgment, it means that the switch can work. At this time, the state of the switch is determined to be normal, and the state of the electronic device is sub-healthy; if no feedback message is received during the preliminary judgment, a prompt message is generated to facilitate manual confirmation by the technician.

[0078] If there is packet loss and the packet loss rate is not 1, it means that the switch can operate normally and the switch status is determined to be healthy. At this time, since the target network link is in a sub-healthy state, it may be that the electronic device is in a sub-healthy state and / or the target device is in a sub-healthy state. Obtain the node resource information of the electronic device, such as CPU, memory, and network, so as to determine the status of the electronic device based on the node resources.

[0079] Specifically, the status of the electronic device may be determined in combination with multiple dimensions of the node resource information.

[0080] In some embodiments, thresholds corresponding to multiple dimensions are pre-set, such as CPU usage not exceeding a first threshold, such as 80%, memory usage not exceeding a second threshold, such as 70%, remaining storage space not less than a third threshold such as 10%, network excellence not less than a fourth threshold, etc.; threshold matching is performed on the collected node resource information, and if all dimensions meet the corresponding thresholds, the device is determined to be in a healthy state; otherwise, it is determined to be in a sub-healthy state.

[0081] S1043: If the state of the electronic device is a healthy state, determine that the state of the target device is a sub-healthy state.

[0082] If the status of the electronic device is healthy, the status of the switch is healthy, and the target network link is in a sub-healthy state, then the status of the target device is in a sub-healthy state.

[0083] S1044, if the state of the electronic device is a sub-healthy state, optimizing the resource information of the electronic device so that the state of the electronic device is a healthy state;

[0084] If the state of the electronic device is sub-healthy, the state of the target device is unclear. In one achievable manner, the resource information of the electronic device can be optimized first so that its resource information conforms to the resource information range in a healthy state, and the state of the electronic device is healthy.

[0085] Furthermore, a target protocol message may be sent to the switch; if the second packet loss information of the target protocol feedback message indicates that there is no packet loss, it is determined that the current state of the electronic device is a healthy state.

[0086] S1045. Obtain new network performance of the target network link; determine whether the target network link is in a sub-healthy state based on the new network performance of the target network link; if the target network link is in a sub-healthy state, determine that the target device is in a sub-healthy state; if the target network link is not in a sub-healthy state, determine that the target device is in a healthy state.

[0087] A possible implementation of the embodiment of the present invention includes sending a target protocol message to a switch, including:

[0088] Divide the current period into multiple sub-periods;

[0089] Sending a target protocol message to the switch at a first frequency in a first sub-period;

[0090] If the sub-packet loss information of the first sub-period indicates that there is no packet loss, the target protocol message is sent to the switch at the second frequency in the next sub-period; the second frequency is greater than the first frequency; otherwise, the target protocol message is sent to the switch at the first frequency in the next sub-period; until the sending of the target protocol message in the current period is completed.

[0091] Among them, the current time period is the current time period that needs to detect the target network link. The current time period is subdivided into multiple smaller sub-periods, such as the current time period is 8:01-8:03, divided into 8:01-8:02, 8:02-8:03. The first frequency and the second frequency respectively represent two different sending rates used when sending the target protocol message. The first frequency is the regular sending frequency, and the second frequency is higher, indicating that the network condition is good and there is no packet loss in the previous sub-period. Increase the amount of message sending to improve communication efficiency.

[0092] The current time period is divided into multiple sub-periods, and the time length of each sub-period can be the same or different, which is not limited in the embodiment of the present invention. In the first sub-period, the target protocol message is sent to the switch at a first frequency; if there is no packet loss in the first sub-period, it means that the current network condition is good, so in the next sub-period, the sending frequency is increased, and the target protocol message is sent to the switch at a second frequency. If packet loss occurs in the first sub-period, it means that the current network condition may be poor, and the original sending frequency is maintained in the next sub-period, and the target protocol message is sent to the switch until all the target protocol messages in the current period are sent. The increased frequency can be increased in sequence according to the fixed frequency difference until the frequency reaches the preset frequency threshold.

[0093] It can be seen that in the embodiment of the present invention, the current time period is divided into multiple sub-time periods, and the sending frequency of the target protocol message is dynamically adjusted according to the network conditions in the sub-time period; the sending process of the target protocol message is optimized by dynamically adjusting the sending frequency; when the network condition is good, the sending speed of the message can be accelerated by increasing the sending frequency, thereby improving the communication efficiency; and when the network condition is poor, the stability of the communication is ensured by reducing the sending frequency.

[0094] In a possible implementation manner of an embodiment of the present invention, network performance includes packet loss rate and delay; according to the network performance of the target network link, determining whether the target network link is in a network sub-healthy state includes: determining whether the packet loss rate exceeds a preset packet loss rate threshold; determining whether the delay exceeds a preset delay threshold; if the preset conditions are met, determining that the target network link is in a network sub-healthy state; otherwise, determining that the target network link is in a sub-healthy state; wherein the preset conditions include: the packet loss rate exceeds the preset packet loss rate threshold, or the delay exceeds the preset delay threshold.

[0095] In the embodiment of the present invention, two key network performance indicators, packet loss rate and latency, are comprehensively considered, and corresponding thresholds are set to determine whether the network is in a sub-healthy state, which simplifies the judgment logic and improves the detection speed and accuracy.

[0096] A possible implementation of the embodiment of the present invention, before determining whether the target network link is in a network sub-health state according to the network performance of the target network link, further includes:

[0097] Obtain historical threshold information for the previous period, the historical threshold information including: a preset packet loss rate historical threshold and a preset delay historical threshold;

[0098] Determine a first threshold adjustment value according to a difference between current network traffic and network traffic in a previous period;

[0099] Determine a second threshold adjustment value according to the time period to which the current moment belongs and the time period to which the previous time period belongs;

[0100] The threshold information is determined according to the first threshold adjustment value, the second threshold adjustment value and the historical threshold information, where the threshold information includes: a preset packet loss rate threshold and a preset delay threshold.

[0101] In an embodiment of the present invention, historical threshold information and network traffic of the previous time period are obtained; based on the difference in network traffic between the previous and next time periods, the change in network usage pattern is determined. If the current network traffic is higher than that of the previous time period, the threshold may need to be increased to avoid false alarms; if the current network traffic is lower than that of the previous time period, the threshold may need to be lowered to increase the sensitivity of detection. Based on the first corresponding relationship, a first threshold adjustment value corresponding to the difference is determined, wherein the first corresponding relationship is a corresponding relationship between multiple differences and multiple adjustment values.

[0102] Time factors may also affect performance. Multiple time periods are set. Network loads in different time periods are different. By considering the time period, the threshold can be adjusted more accurately to adapt to network conditions in different time periods. According to the time period and the second correspondence, the second threshold adjustment value corresponding to the time period is determined, where the second correspondence is a correspondence between multiple time periods and multiple adjustment values.

[0103] A new preset packet loss rate threshold and a preset delay threshold are determined according to the previously calculated first threshold adjustment value, the second threshold adjustment value and the acquired historical threshold information.

[0104] Specifically, in an achievable manner, the new packet loss rate threshold T1 can be calculated by the following formula:

[0105] Tl = Hl + α × Δf + β × Δt;

[0106] The new delay threshold Td can be calculated in a similar way:

[0107] Td = Hd + γ × Δf + δ × Δt;

[0108] Wherein, Hl: historical packet loss rate threshold; Hdy: historical delay threshold; Δf: first threshold adjustment value; Δt: second threshold adjustment value; Tl: new packet loss rate threshold; Td: new delay threshold; α, β, γ and δ are weight values, and the specific size can be customized by the user, α+β=1, γ+δ=1.

[0109] It should be noted that both Tl and Td are set to finite values, and when reaching their respective corresponding limits, they no longer change.

[0110] It can be seen that in the embodiment of the present invention, the preset packet loss rate and delay thresholds are dynamically adjusted according to factors such as historical data, current network traffic changes and time periods, and an adaptive adjustment mechanism is used to make the thresholds more in line with the actual situation of the current network environment, thereby avoiding false alarms or missed alarms caused by fixed thresholds.

[0111] Based on any of the above embodiments, see Figure 3 , Figure 3 A flowchart of a specific method provided by an embodiment of the present invention includes:

[0112] (1) The client triggers the sending of network sub-health detection messages to the server

[0113] (2) After the server detects the network sub-health message, it immediately returns the message to the client

[0114] (3) The client calculates whether there is a network sub-health problem of delay and packet loss based on the message reception situation. If a network sub-health problem is found, jump to (4); otherwise, jump to (10)

[0115] (4) The client sends a BDF detection message to the switch

[0116] (5) After receiving the message, the switch immediately returns the BDF detection message to the client.

[0117] (6) The client calculates whether there is a packet loss problem based on the message reception. If there is BDF packet loss, jump to (7); otherwise jump to (8)

[0118] (7) If there is a problem with the link from the client to the switch, jump to (9)

[0119] (8) The prompt may be a problem with the client itself or the server link. Jump to (9)

[0120] (9) Shut down the problematic network port and jump to (10)

[0121] (10) End.

[0122] In an embodiment of the present invention, the C / S architecture is first used to detect delay and packet loss according to the original network sub-health detection logic. When it is found that the delay and / or packet loss exceeds the threshold, the BFD protocol (SMP protocol) is immediately re-judged, that is, a two-way forwarding detection protocol message is created and sent to the outside to detect whether there is a problem from the node to the switch. If there is also packet loss in the two-way forwarding detection protocol message, the node system status is immediately re-judged, that is, whether there is a problem with the node resources (CPU, memory, network). According to the above logic, it can be determined whether the fault is in the Client node or in the link from the Client to the switch. Through the above logic, the specific problem point can be quickly located, the accuracy of network sub-health detection is improved, the probability of misjudging the packet loss exceeding the threshold is reduced, and the operation and maintenance efficiency can also be improved.

[0123] A network status detection device provided by an embodiment of the present invention is introduced below. The network status detection device described below and the network status detection method described above can be referred to each other. The network status detection device of this embodiment is set in an electronic device. Figure 4 , Figure 4 : is a structural block diagram of a network status detection device according to one embodiment of the present invention, comprising:

[0124] An acquisition module 210 is used to acquire network performance of a target network link, where the target network link includes: an electronic device, a switch, and a target device;

[0125] A first determination module 220, configured to determine whether a target network link is in a sub-healthy state according to the network performance of the target network link;

[0126] The re-judgment module 230 is used to send a target protocol message to the switch if the target network link is in a sub-healthy state, and the target protocol message is used to make the switch return a target protocol feedback message;

[0127] The second determination module 240 is used to determine the status of each device of the target network link according to the packet loss information of the target protocol feedback message and the node resource information of the electronic device.

[0128] In an embodiment of the present invention, the acquisition module 210 acquires the network performance of the target network link, and the first determination module 220 can accurately determine whether the target network link has entered a sub-healthy state based on the network performance data; when the sub-healthy state is detected, the re-judgment module 230 will quickly send the target protocol message to the switch, and the second determination module 240 uses the target protocol feedback message returned by the switch and the node resource information of the electronic device to comprehensively evaluate the specific status of each device on the target network link, which not only realizes real-time monitoring of the network status, but also can quickly determine the fault condition.

[0129] In one achievable manner, the target protocol message is a bidirectional forwarding detection protocol message or an icmp protocol message.

[0130] In an achievable manner, when determining the status of each device of the target network link according to the packet loss information of the target protocol feedback message and the node resource information of the electronic device, the second determination module 240 is used to:

[0131] If the packet loss information indicates that there is packet loss and the packet loss rate is not 1, the state of the switch is determined to be a healthy state, and based on the node resource information of the electronic device, it is determined whether the state of the electronic device is a healthy state; if the state of the electronic device is a healthy state, the state of the target device is determined to be a sub-healthy state;

[0132] If the packet loss information indicates that there is no packet loss, it is determined that the state of the target device is a sub-healthy state.

[0133] In an implementable manner, the second determining module 240 is further configured to:

[0134] If the state of the electronic device is a sub-healthy state, optimizing the resource information of the electronic device so that the state of the electronic device is a healthy state;

[0135] Obtaining new network performance of the target network link; determining whether the target network link is in a sub-healthy state according to the new network performance of the target network link;

[0136] If the target network link is in a sub-healthy state, the target device is determined to be in a sub-healthy state; if the target network link is not in a sub-healthy state, the target device is determined to be in a healthy state.

[0137] In one achievable manner, when sending the target protocol message to the switch, the re-judgment module is used to:

[0138] Divide the current period into multiple sub-periods;

[0139] Sending a target protocol message to the switch at a first frequency in a first sub-period;

[0140] If the sub-packet loss information of the first sub-period indicates that there is no packet loss, the target protocol message is sent to the switch at the second frequency in the next sub-period; the second frequency is greater than the first frequency; otherwise, the target protocol message is sent to the switch at the first frequency in the next sub-period; until the sending of the target protocol message in the current period is completed.

[0141] In one achievable approach, network performance includes packet loss rate and latency;

[0142] When determining whether the target network link is in a sub-healthy state according to the network performance of the target network link, the first determining module 220 is used to:

[0143] Determine whether the packet loss rate exceeds a preset packet loss rate threshold; determine whether the delay exceeds a preset delay threshold;

[0144] If the preset conditions are met, it is determined that the target network link is in a sub-healthy state; otherwise, it is determined that the target network link is in a sub-healthy state;

[0145] The preset conditions include: a packet loss rate exceeding a preset packet loss rate threshold, or a delay exceeding a preset delay threshold.

[0146] In an implementable manner, the first determining module 220 is further configured to:

[0147] Obtain historical threshold information for the previous period, the historical threshold information including: a preset packet loss rate historical threshold and a preset delay historical threshold;

[0148] Determine a first threshold adjustment value according to a difference between current network traffic and network traffic in a previous period;

[0149] Determine a second threshold adjustment value according to the time period to which the current moment belongs and the time period to which the previous time period belongs;

[0150] The threshold information is determined according to the first threshold adjustment value, the second threshold adjustment value and the historical threshold information, where the threshold information includes: a preset packet loss rate threshold and a preset delay threshold.

[0151] An embodiment of the present invention provides an electronic device, such as Figure 5 As shown, Figure 5 The electronic device 300 shown includes: a processor 301 and a memory 303. The processor 301 and the memory 303 are connected, such as through a bus 302. Optionally, the electronic device 300 may also include a transceiver 304. It should be noted that in actual applications, the transceiver 304 is not limited to one, and the structure of the electronic device 300 does not constitute a limitation on the embodiments of the present invention.

[0152] The processor 301 may be a CPU (Central Processing Unit), a general-purpose processor, a DSP (Digital Signal Processor), an ASIC (Application Specific Integrated Circuit), an FPGA (Field Programmable Gate Array) or other programmable logic devices, transistor logic devices, hardware components or any combination thereof. It may implement or execute various exemplary logic blocks, modules and circuits described in conjunction with the disclosure of the present invention. The processor 301 may also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, etc.

[0153] The bus 302 may include a path to transmit information between the above components. The bus 302 may be a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus. The bus 302 may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 5 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.

[0154] The memory 303 may be a ROM (Read Only Memory) or other types of static storage devices that can store static information and instructions, a RAM (Random Access Memory) or other types of dynamic storage devices that can store information and instructions, or an EEPROM (Electrically Erasable Programmable Read Only Memory), a CD-ROM (Compact Disc Read Only Memory) or other optical disk storage, optical disk storage (including compressed optical disk, laser disk, optical disk, digital versatile disk, Blu-ray disk, etc.), a magnetic disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store the desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited thereto.

[0155] The memory 303 is used to store application code for executing the solution of the present invention, and the execution is controlled by the processor 301. The processor 301 is used to execute the application code stored in the memory 303 to implement the content shown in the above method embodiment.

[0156] Figure 5 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.

[0157] An embodiment of the present invention provides a computer-readable storage medium, on which a computer program is stored. When the computer-readable storage medium is run on a computer, the computer can execute the corresponding contents of the aforementioned method embodiment.

[0158] An embodiment of the present invention provides a computer program product, including a computer program, which implements the corresponding contents of the aforementioned method embodiment when the computer program is executed by a processor.

[0159] It should be understood that, although the steps in the flowchart of the accompanying drawings are displayed in sequence as indicated by the arrows, these steps are not necessarily executed in sequence in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least a part of the steps in the flowchart of the accompanying drawings may include multiple sub-steps or multiple stages, and these sub-steps or stages are not necessarily executed at the same time, but can be executed at different times, and their execution order is not necessarily sequential, but can be executed in turn or alternately with other steps or at least a part of the sub-steps or stages of other steps.

[0160] The above are only some embodiments of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.

Claims

1. A network status detection method, characterized in that: Executed by an electronic device, the network status detection method includes: Acquire network performance of a target network link, wherein the target network link includes: an electronic device, a switch, and a target device; Determining whether the target network link is in a sub-healthy state according to the network performance of the target network link; If the target network link is in a sub-healthy state, a target protocol message is sent to the switch, and the target protocol message is used to make the switch return a target protocol feedback message; The status of each device of the target network link is determined according to the packet loss information of the target protocol feedback message and the node resource information of the electronic device.

2. The network status detection method according to claim 1, characterized in that: The determining the status of each device of the target network link according to the packet loss information of the target protocol feedback message and the node resource information of the electronic device includes: If the packet loss information indicates that there is a packet loss situation and the packet loss rate is not 1, the state of the switch is determined to be a healthy state, and whether the state of the electronic device is a healthy state is determined according to the node resource information of the electronic device; if the state of the electronic device is a healthy state, the state of the target device is determined to be a sub-healthy state; If the packet loss information indicates that there is no packet loss, it is determined that the state of the target device is a sub-healthy state.

3. The network status detection method according to claim 2, characterized in that: Also includes: If the state of the electronic device is a sub-healthy state, optimizing the resource information of the electronic device so that the state of the electronic device is a healthy state; Acquire new network performance of the target network link; determine whether the target network link is in a network sub-health state according to the new network performance of the target network link; If the target network link is in a sub-healthy state, determining that the target device is in a sub-healthy state; If the target network link is not in a sub-healthy state, it is determined that the target device is in a healthy state.

4. The network status detection method according to claim 1, characterized in that: The target protocol message is a bidirectional forwarding detection protocol message.

5. The network status detection method according to claim 1, characterized in that: The sending of the target protocol message to the switch includes: Divide the current period into multiple sub-periods; Sending the target protocol message to the switch at a first frequency in a first sub-period; If the sub-packet loss information of the first sub-period indicates that there is no packet loss, the target protocol message is sent to the switch at a second frequency in the next sub-period; the second frequency is greater than the first frequency; otherwise, the target protocol message is sent to the switch at the first frequency in the next sub-period; until the sending of the target protocol message in the current period is completed.

6. The network status detection method according to claim 1, characterized in that: The network performance includes packet loss rate and delay; The determining, based on the network performance of the target network link, whether the target network link is in a network sub-health state comprises: Determine whether the packet loss rate exceeds a preset packet loss rate threshold; determine whether the delay exceeds a preset delay threshold; If the preset condition is met, it is determined that the target network link is in a sub-healthy state; otherwise, it is determined that the target network link is in a sub-healthy state; The preset conditions include: the packet loss rate exceeds a preset packet loss rate threshold, or the delay exceeds a preset delay threshold.

7. The network status detection method according to claim 6, characterized in that: Before determining whether the target network link is in a sub-healthy state according to the network performance of the target network link, the method further includes: Obtaining historical threshold information of the previous period, the historical threshold information including: a preset packet loss rate historical threshold and a preset delay historical threshold; Determine a first threshold adjustment value according to a difference between current network traffic and network traffic in a previous period; Determine a second threshold adjustment value according to the time period to which the current moment belongs and the time period to which the previous time period belongs; Threshold information is determined according to the first threshold adjustment value, the second threshold adjustment value and the historical threshold information, where the threshold information includes: a preset packet loss rate threshold and a preset delay threshold.

8. A network status detection device, characterized in that: include: An acquisition module, used to acquire network performance of a target network link, wherein the target network link includes: an electronic device, a switch, and a target device; A first determination module is used to determine whether the target network link is in a network sub-health state according to the network performance of the target network link; A re-judgment module, used for sending a target protocol message to the switch if the target network link is in a sub-healthy state, wherein the target protocol message is used for causing the switch to return a target protocol feedback message; The second determination module is used to determine the status of each device of the target network link according to the packet loss information of the target protocol feedback message and the node resource information of the electronic device.

9. An electronic device, characterized in that: include: one or more processors; Memory; One or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the one or more processors, and the one or more applications are configured to: execute the steps of the network status detection method according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: The storage medium stores at least one instruction, at least one program, code set or instruction set, and the at least one instruction, at least one program, code set or instruction set is loaded by the processor and executes the steps of the network status detection method according to any one of claims 1 to 7.

Citation Information

Patent Citations

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

    CN115632968A

  • Link state detection method and device, electronic equipment and storage medium

    CN116781554A

  • Industrial internet network security detection system and method based on cloud computing

    CN117119460A

  • Network sub-health state detection method and device, electronic equipment and storage medium

    CN118659993A

  • Link sub-health detection method and device and electronic equipment

    CN118694685A

Cited By

  • Network monitoring method, device, equipment and program product

    CN120567717A