Method, device and electronic device for locating faulty network equipment
By determining the IP information of the abnormal device and the last hop node in the network, the problem of failing to automatically and efficiently locate faulty network devices in the prior art is solved, and fast and accurate fault positioning is achieved, which is suitable for large-scale network environments.
Patent Information
- Application Number
- CN202210272335.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-18
- Publication Date
- 2025-01-03
- Estimated Expiration
- 2042-03-18
AI Technical Summary
The prior art cannot automatically, efficiently and accurately locate faulty network equipment when network failures, especially in large-scale networks, and is prone to positioning errors.
By determining the abnormal device based on the network connection status of all online network devices in the network to be detected, path collection is performed to determine the last hop node, and using the IP information of the last hop node to accurately locate the faulty network device.
It realizes automatic, efficient and accurate positioning of faulty network equipment in the event of network failure. The process does not require manual intervention, and is fast and efficient, and is suitable for large-scale networks.
Smart Images

Figure CN114448785B_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of communication technology, and specifically relates to a method, device, electronic device and computer-readable storage medium for locating a faulty network device. Background Art
[0002] At present, when a network failure occurs, related technologies usually locate the approximate scope of the failure based on the business notification of the business layer failure. This method can only passively listen to the feedback information of the upper-level business party to determine the network-level failure, and cannot locate the faulty network equipment. For example, if the business notifies that there are a large number of 404 responses to http access in the Internet Data Center (IDC) 1 computer room, it can only locate the problem in IDC1, and cannot make further judgments. In addition, sometimes due to the complex scheduling relationship between business parties, a false fault will be generated. At the top level of the business, the phenomenon is that there is a problem with IDC1, and the resources scheduled are IDC2. In fact, there is a fault in the IDC2 network equipment, which leads to the wrong positioning direction.
[0003] In addition, related technologies will determine faulty network devices by configuring packet statistics on network devices. This method uses command line tools to configure packet statistics on devices after a problem occurs. However, some devices are relatively low-level and do not support packet statistics commands, making it impossible to troubleshoot problems with this device. Moreover, this method can only be implemented in small-scale networks and cannot be implemented in large-scale networks with thousands of network devices.
[0004] It can be seen that there is an urgent need for a method that can automatically, efficiently and accurately locate faulty network devices when a network failure occurs. Summary of the invention
[0005] The purpose of the embodiments of the present application is to provide a method, apparatus, electronic device and computer-readable storage medium for locating a faulty network device, which can automatically, efficiently and accurately locate the faulty network device when it is determined that a network fault occurs.
[0006] In order to solve the above technical problems, this application is implemented as follows:
[0007] In a first aspect, an embodiment of the present application provides a method for locating a faulty network device, comprising: determining an abnormal network device in the network to be detected based on the network connectivity status of all online network devices in the network to be detected; performing path collection on the abnormal network device to determine the last hop node in the path; determining a target network device corresponding to the last hop node based on the IP information of the last hop node; and determining the faulty network device based on the target network device.
[0008] In the second aspect, an embodiment of the present application provides an apparatus for locating a faulty network device, comprising: a first determination module, used to determine the abnormal network device in the network to be detected according to the network connectivity status of all online network devices in the network to be detected; a second determination module, used to perform path collection on the abnormal network device and determine the last hop node in the path; a third determination module, used to determine the target network device corresponding to the last hop node according to the IP information of the last hop node; and a fourth determination module, used to determine the faulty network device based on the target network device.
[0009] In a third aspect, an embodiment of the present application provides an electronic device, which includes a processor, a memory, and a program or instruction stored in the memory and executable on the processor, wherein the program or instruction, when executed by the processor, implements the steps of the method described in the first aspect.
[0010] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, on which a program or instruction is stored, and when the program or instruction is executed by a processor, the steps of the method described in the first aspect are implemented.
[0011] In a fifth aspect, an embodiment of the present application provides a chip, comprising a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run a program or instruction to implement the method described in the first aspect.
[0012] In an embodiment of the present application, abnormal network devices in the network to be detected are determined according to the network connectivity status of all online network devices in the network to be detected; path collection is performed on the abnormal network devices to determine the last hop node in the path; the target network device corresponding to the last hop node is determined according to the IP information of the last hop node; the faulty network device is determined based on the target network device. When it is determined that a network fault occurs, the IP information of the last hop node of the abnormal network device can be used to accurately and reliably locate the faulty network device. The whole process does not require manual intervention and is fast and efficient. BRIEF DESCRIPTION OF THE DRAWINGS
[0013] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0014] Figure 1 is a schematic flow chart of a method for locating a faulty network device according to an embodiment of the present application;
[0015] Figure 2is a schematic flow chart of a method for locating a faulty network device according to another embodiment of the present application;
[0016] Figure 3 is a schematic flow chart of a method for locating a faulty network device according to another embodiment of the present application;
[0017] Figure 4 is a schematic flow chart of a method for locating a faulty network device according to another embodiment of the present application;
[0018] Figure 5 is a structural schematic diagram of an apparatus for locating a faulty network device according to an embodiment of the present application;
[0019] Figure 6 It is a schematic structural diagram of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION
[0020] In order to make the purpose, technical solution and advantages of the present application clearer, the technical solution of the present application will be clearly and completely described below in combination with the specific embodiments of the present application and the corresponding drawings. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present application.
[0021] The terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable under appropriate circumstances, so that the embodiments of the present application can be implemented in an order other than those illustrated or described here. In addition, the "and / or" in the specification and claims represents at least one of the connected objects, and the character " / " generally represents that the objects associated with each other are in an "or" relationship.
[0022] The technical solutions provided by various embodiments of the present application are described in detail below in conjunction with the accompanying drawings.
[0023] like Figure 1 As shown, an embodiment of the present application provides a method 100 for locating a faulty network device. The execution subject of the method may be a terminal device or a server, and the execution subject does not constitute a limitation of the present application. The method includes the following steps:
[0024] 110: Determine abnormal network devices in the network to be detected according to the network connectivity status of all online network devices in the network to be detected.
[0025] All online network devices in the network to be detected include multiple network devices.
[0026] The network connectivity status includes connected and disconnected, that is, according to the network connectivity status of all online network devices in the network to be detected, all online network devices in the network to be detected can be divided into connected network devices and disconnected network devices.
[0027] The abnormal network device refers to a network device whose network connectivity is disconnected due to a faulty network device in the network. The abnormal network device may include multiple abnormal network devices.
[0028] It can be understood that if it is determined according to step 110 that the abnormal network device exists, it means that a faulty network device exists in the network.
[0029] When it is determined that there is a faulty network device in the network, that is, when it is determined that a network fault occurs, perform the following steps to locate the faulty network device:
[0030] 120: Collect the path of the abnormal network device and determine the last hop node in the path.
[0031] When it is determined that the abnormal network device exists, the path collection program is triggered to collect the path of the abnormal network device, that is, to send a path collection request for collecting the node information through which the communication path of the abnormal network device passes. After receiving the path collection request, the network device in the path returns the node information through which the path passes. It is understandable that if there is a faulty network device in the path, the faulty network device can return its own node information normally, but it is impossible to pass the path collection request signal to the network device after the faulty network device. Therefore, through the path collection program, it is impossible to collect the node information of the network device after the faulty network device, that is, the last hop node in the determined path is the node of the faulty network device.
[0032] Thus, by collecting the path of the abnormal network device, the node information of the communication path of the abnormal network device can be collected, and the last hop node in the path can be determined, wherein the last hop node is the node where the fault occurs.
[0033] In one implementation, after determining the abnormal network device in the network to be detected, an alarm is issued, that is, when it is determined that there is a faulty network device in the network, that is, when it is determined that the network has a fault, the operation and maintenance personnel are notified of the network fault.
[0034] In one implementation, the abnormal network device includes a plurality of abnormal network devices. Performing path collection on the abnormal network device to determine the last hop node in the path includes: performing path collection on the plurality of abnormal network devices to determine a plurality of last hop nodes, wherein the plurality of last hop nodes are respectively the last hop nodes through which the communication paths of the plurality of abnormal network devices pass.
[0035] 130: Determine a target network device corresponding to the last hop node according to the IP information of the last hop node.
[0036] It is understandable that by collecting the path of the abnormal network device, the node information through which the communication path of the abnormal network device passes can be collected, and the node information includes the IP information of the node. Therefore, according to the IP information of the last hop node, the target network device corresponding to the last hop node can be determined, that is, the network device where the last hop node is located can be determined.
[0037] For example, the IP information of the last hop node through which the communication path of the abnormal network device passes is 10.105.54.xxx. According to the IP information, it is determined that the target network device corresponding to the last hop node is network device 1.
[0038] In one implementation, the abnormal network device includes multiple abnormal network devices, and after performing path collection on the abnormal network device and determining multiple last hop nodes, multiple network devices corresponding to the multiple last hop nodes are determined based on IP information of the multiple last hop nodes.
[0039] In one implementation, the multiple network devices are the target network devices.
[0040] In another implementation, considering that a large number of occurrences can indicate that the last hop node / network device is more likely to be a faulty node / network device, the target network device can be determined from the multiple network devices. The multiple network devices are grouped, counted, and sorted, and the network devices with the largest number are determined as the target network devices, for example, the network devices with the largest number are determined as the target network devices. Alternatively, after determining multiple last hop nodes, the multiple last hop nodes are grouped, counted, and sorted, and the last hop nodes with the largest number are determined as the target last hop nodes, and the target network device corresponding to the target last hop node is determined based on the IP information of the target last hop node.
[0041] Therefore, through data analysis, the network device corresponding to the last hop node that appears more frequently can be determined as the target network device where the fault is located, rather than determining multiple network devices corresponding to multiple last hop nodes as the target network devices where the fault is located. This can narrow the location range of the faulty network device.
[0042] 140: Determine a faulty network device based on the target network device.
[0043] The target network device may include one or more network devices. After the target network device is determined, the faulty network device may be determined based on the target network device.
[0044] For example, the target network device is directly determined as the faulty network device, or the faulty network device is determined from the target network devices.
[0045] Therefore, a method for locating a faulty network device provided in an embodiment of the present application determines an abnormal network device in the network to be detected according to the network connectivity status of all online network devices in the network to be detected; performs path collection on the abnormal network device to determine the last hop node in the path; determines a target network device corresponding to the last hop node according to the IP information of the last hop node; determines the faulty network device based on the target network device, and can accurately and reliably locate the faulty network device by using the IP information of the last hop node of the abnormal network device when determining that a network fault occurs, and the whole process does not require manual intervention, and is fast and efficient.
[0046] like Figure 2 As shown, another embodiment of the present application provides a method 200 for locating a faulty network device. The execution subject of the method may be a terminal device or a server, and the execution subject does not constitute a limitation of the present application. The method includes the following steps:
[0047] 211: Ping all online network devices in the network to be detected based on a preset period to obtain network connectivity status of all online network devices in the network to be detected.
[0048] It is understandable that before determining the abnormal network devices in the network to be detected based on the network connectivity status of all online network devices in the network to be detected, it also includes determining the network connectivity status of all online network devices in the network to be detected. Determining the network connectivity status of all online network devices in the network to be detected includes: performing ping detection on all online network devices in the network to be detected based on a preset period to obtain the network connectivity status of all online network devices in the network to be detected.
[0049] The ping detection may include a point-to-multipoint (P2MP) ping detection or a full-mesh ping detection, and may also include other detection methods, which are not limited in the present application.
[0050] All online network devices in the network to be detected have IP. Ping detection is performed on all online network devices in the network to be detected, specifically including: ping detection is performed on all online network devices in the network to be detected according to the IP information of all online network devices in the network to be detected. All online network devices in the network to be detected are detected points, and the ping detection is used to detect whether the IP of the detected point is reachable. If the IP is reachable, it means that the network is connected, and if the IP is unreachable, it means that the network is not connected. In other words, the ping detection is used to detect whether the network connectivity status of the detected point is connected or not connected.
[0051] In one implementation, if the IP of the detected point is detected to be reachable, the detected point is determined to be in a network connected state; if the IP of the detected point is detected to be unreachable, the detected point is determined to be in a network disconnected state.
[0052] In another implementation, if the IP of the detected point is detected to be reachable, the detected point is determined to be in a network connected state; if the IP of the detected point is detected to be unreachable, a secondary detection is immediately performed on the detection point; if the secondary detection detects that the IP of the detected point is still unreachable, the detected point is determined to be in a network disconnected state; if the secondary detection detects that the IP of the detected point is reachable, the detected point is determined to be in a network connected state. Thus, the detection accuracy can be improved through secondary detection.
[0053] The network connectivity status of all online network devices in the network to be detected obtained by performing ping detection on all online network devices in the network to be detected based on a preset period includes the network connectivity status of all online network devices in the network to be detected in each round of ping detection. For example, if the preset period is 10s, then 6 rounds of ping detection are performed on all online network devices in the network to be detected within one minute to obtain the network connectivity status of all online network devices in the network to be detected in these 6 rounds of ping detection.
[0054] In one implementation, before step 211, the method further includes: obtaining IP information of all online network devices in the network to be detected. For example, network devices such as switches and routers in the network are determined, and IP information of hosts connected to the above network devices is obtained, which is the IP information of all online network devices in the network to be detected in this application. In this application, any method can be used to obtain the IP information of all online network devices in the network to be detected, and this application does not limit this.
[0055] 212: Determine the number of disconnected network devices added in this round of detection according to the network connectivity status of all online network devices in the network to be detected.
[0056] The current round of detection is the most recent ping detection, and the results of the most recent ping detection of all online network devices in the network to be detected are compared with the results of the previous ping detection to determine the number of disconnected network devices newly added in the most recent ping detection.
[0057] In one implementation, a line graph can be generated based on the detection results to indicate the network connectivity status of all online network devices in the network to be detected within a preset time period, wherein the horizontal axis of the line graph is time and the vertical axis is the number of disconnected network devices. The line graph may include multiple lines, each of which represents the network connectivity of a different IDC room. Thus, the network connectivity and change trend within the preset time period can be observed through the line graph.
[0058] 213: If the number of the newly added disconnected network devices is greater than a second threshold, determine the newly added disconnected network devices as abnormal network devices.
[0059] If the number of the newly added disconnected network devices is greater than the second threshold, it is regarded as an abnormal situation, that is, the network fails, and the newly added disconnected network devices are determined as abnormal network devices; if the number of the newly added disconnected network devices is less than or equal to the second threshold, it is regarded as a normal situation, and the network is considered to be still in a normal state, and the newly added disconnected network devices are not determined as abnormal network devices.
[0060] 220: Collect the path of the abnormal network device and determine the last hop node in the path.
[0061] 230: Determine the target network device corresponding to the last hop node according to the IP information of the last hop node.
[0062] 240: Determine a faulty network device based on the target network device.
[0063] Steps S220-S240 may be performed using Figure 1 The description of steps S120 - S140 of the embodiment will not be repeated here.
[0064] Therefore, a method for locating a faulty network device provided in an embodiment of the present application determines an abnormal network device in the network to be detected according to the network connectivity status of all online network devices in the network to be detected; performs path collection on the abnormal network device to determine the last hop node in the path; determines a target network device corresponding to the last hop node according to the IP information of the last hop node; determines the faulty network device based on the target network device, and can accurately and reliably locate the faulty network device by using the IP information of the last hop node of the abnormal network device when determining that a network fault occurs, and the whole process does not require manual intervention, and is fast and efficient.
[0065] Therefore, an embodiment of the present application provides a method for locating a faulty network device, which obtains the network connectivity status of all online network devices in the network to be detected by pinging all online network devices in the network to be detected based on a preset period; determines the number of newly added disconnected network devices in this round of detection based on the network connectivity status of all online network devices in the network to be detected; if the number of newly added disconnected network devices is greater than a second threshold, determines the newly added disconnected network devices as abnormal network devices, which can achieve timely judgment of network faults and automatically determine the abnormal network devices affected by the network fault when a network fault occurs, so as to subsequently locate the faulty network device based on the last hop node of the communication path of the abnormal network device.
[0066] like Figure 3 As shown, another embodiment of the present application provides a method 300 for locating a faulty network device. The execution subject of the method may be a terminal device or a server, and the execution subject does not constitute a limitation of the present application. The method includes the following steps:
[0067] 310: Determine abnormal network devices in the network to be detected according to the network connectivity status of all online network devices in the network to be detected.
[0068] 320: Collect the path of the abnormal network device and determine the last hop node in the path.
[0069] Steps 310-320 may be performed using Figure 1 The description of steps 110-120 of the embodiment will not be repeated here. Step 310 can also be used Figure 2 The description of steps 211-213 of the embodiment will not be repeated here.
[0070] 330: Determine the target network device and target port corresponding to the last hop node according to the IP information of the last hop node.
[0071] exist Figure 1 Step 130 of the embodiment: based on determining the target network device corresponding to the last hop node according to the IP information of the last hop node, further determining the target port corresponding to the last node according to the IP information of the last hop node.
[0072] In one implementation, the target network device and the target port corresponding to the last hop node are determined according to the port information and the IP information data table configured for the port.
[0073] In one implementation, when multiple network devices and multiple ports are determined, considering that a large number of occurrences can indicate that the network device is more likely to be a faulty network device, and a large number of occurrences and being located on the target network device can indicate that the port is more likely to be a faulty port, the target network device and the target port can be determined from the multiple network devices and the multiple ports. The multiple network devices are grouped, the number is counted and sorted, and the network devices with a predominant number are determined as the target network devices, for example, the network devices with the largest number are determined as the target network devices. The multiple ports are counted and sorted, and the ports with a predominant number and located on the target network device are determined as the target ports, for example, the ports with the largest number and located on the target network device are determined as the target ports.
[0074] Therefore, through data analysis, the network device corresponding to the last hop node that appears more frequently can be determined as the target network device where the fault is located, and the port that appears more frequently and is located on the target network device can be determined as the target port where the fault is located. In this way, the location range of the faulty network device / faulty port can be narrowed.
[0075] 340: Determine a faulty network device based on the target network device, and determine a faulty port based on the target port.
[0076] exist Figure 1 Step 140 of the embodiment: on the basis of determining the faulty network device based on the target network device, further determining the faulty port based on the target port.
[0077] Therefore, a method for locating a faulty network device provided in an embodiment of the present application determines an abnormal network device in the network to be detected according to the network connectivity status of all online network devices in the network to be detected; performs path collection on the abnormal network device to determine the last hop node in the path; determines a target network device corresponding to the last hop node according to the IP information of the last hop node; determines the faulty network device based on the target network device, and can accurately and reliably locate the faulty network device by using the IP information of the last hop node of the abnormal network device when determining that a network fault occurs, and the whole process does not require manual intervention, and is fast and efficient.
[0078] Therefore, an embodiment of the present application provides a method for locating a faulty network device, which determines the target network device and target port corresponding to the last hop node based on the IP information of the last hop node; determines the faulty network device based on the target network device, and determines the faulty port based on the target port, which can further locate the faulty port on the faulty network device and further narrow the fault location range.
[0079] like Figure 4 As shown, another embodiment of the present application provides a method 400 for locating a faulty network device. The execution subject of the method may be a terminal device or a server, and the execution subject does not constitute a limitation of the present application. The method includes the following steps:
[0080] 410: Determine abnormal network devices in the network to be detected according to the network connectivity status of all online network devices in the network to be detected.
[0081] 420: Collect the path of the abnormal network device and determine the last hop node in the path.
[0082] 430: Determine the target network device corresponding to the last hop node according to the IP information of the last hop node.
[0083] 440: Determine a faulty network device based on the target network device.
[0084] Steps 410-440 may be performed using Figure 1 The description of steps 110-140 of the embodiment will not be repeated here. Step 410 can also be adopted Figure 2 The description of steps 211-213 of the embodiment will not be repeated here. Steps 430-440 can also be adopted Figure 3 The description of steps 330-340 of the embodiment will not be repeated here.
[0085] Based on any of the above embodiments, step 440 may further include: if the number of logs of the target network device within the target time period is greater than a first threshold, determining the target network device as a faulty network device.
[0086] Before determining the target network device as a faulty network device, log information within a target time period is obtained, and the log information within the target time period includes the number of logs generated by different network devices within the target time period. The number of logs of the target network device within the target time period is extracted. If the number of logs of the target network device within the target time period is greater than a first threshold, the target network device is determined to be a faulty network device.
[0087] The target time period is, for example, 5 minutes before path collection to the current moment. The first threshold value can be a fixed value set by itself, or it can be determined based on the log information within the target time period, such as the average value of the number of logs generated by the network device. If the number of logs of the target network device within the target time period is greater than the first threshold value, it means that the number of logs of the target network device is large, and it is likely to be a faulty network device. If the number of logs of the target network device within the target time period is less than or equal to the first threshold value, the target network device cannot be directly determined as a faulty network device, and the operation and maintenance personnel can be notified to perform manual inspection.
[0088] If step 430 determines the target port corresponding to the last node based on the IP information of the last hop node, then the target port located on the target network device can be further determined as a faulty port if the target network device is determined to be a faulty network device. If the number of logs of the target network device is less than or equal to the first threshold value within the target time period, that is, if the target network device is not determined to be a faulty network device, the target port cannot be determined as a faulty port.
[0089] Therefore, a method for locating a faulty network device provided in an embodiment of the present application determines an abnormal network device in the network to be detected according to the network connectivity status of all online network devices in the network to be detected; performs path collection on the abnormal network device to determine the last hop node in the path; determines a target network device corresponding to the last hop node according to the IP information of the last hop node; determines the faulty network device based on the target network device, and can accurately and reliably locate the faulty network device by using the IP information of the last hop node of the abnormal network device when determining that a network fault occurs, and the whole process does not require manual intervention, and is fast and efficient.
[0090] Therefore, an embodiment of the present application provides a method for locating a faulty network device, which extracts the number of logs of the target network device within a target time period; if the number of logs of the target network device within the target time period is greater than a first threshold, the target network device is determined to be a faulty network device, and the faulty network device can be further confirmed in combination with the number of logs to improve accuracy.
[0091] Figure 5 1 is a schematic diagram of a structure of an apparatus for locating a faulty network device according to an embodiment of the present application. Figure 5 As shown, the apparatus 500 for locating a faulty network device includes: a first determining module 510 , a second determining module 520 , a third determining module 530 , and a fourth determining module 540 .
[0092] The first determination module 510 is used to determine the abnormal network device in the network to be detected according to the network connectivity status of all online network devices in the network to be detected. The second determination module 520 is used to collect the path of the abnormal network device and determine the last hop node in the path. The third determination module 530 is used to determine the target network device corresponding to the last hop node according to the IP information of the last hop node. The fourth determination module 540 is used to determine the faulty network device based on the target network device.
[0093] In one implementation, the fourth determination module is used to extract the number of logs of the target network device within a target time period; if the number of logs of the target network device within the target time period is greater than a first threshold, the target network device is determined to be a faulty network device.
[0094] In one implementation, the device also includes: a fifth determination module, which is used to ping all online network devices in the network to be detected based on a preset period to obtain the network connectivity status of all online network devices in the network to be detected; the first determination module is used to determine the number of newly added disconnected network devices in this round of detection based on the network connectivity status of all online network devices in the network to be detected; if the number of newly added disconnected network devices is greater than a second threshold, the newly added disconnected network devices are determined as abnormal network devices.
[0095] In one implementation, the third determination module is used to: determine the target network device and target port corresponding to the last hop node based on the IP information of the last hop node; the fourth determination module is used to determine the faulty network device based on the target network device, and determine the faulty port based on the target port.
[0096] The device for locating a faulty network device in the embodiment of the present application may be a device, or a component, an integrated circuit, or a chip in a terminal. The device may be a mobile electronic device or a non-mobile electronic device. Exemplarily, the mobile electronic device may be a mobile phone, a tablet computer, a laptop computer, a PDA, an in-vehicle electronic device, a wearable device, an ultra-mobile personal computer (UMPC), a netbook, or a personal digital assistant (PDA), etc., and the non-mobile electronic device may be a server, a network attached storage (NAS), a personal computer (PC), a television (TV), a teller machine, or a self-service machine, etc., which is not specifically limited in the embodiment of the present application.
[0097] The device for locating a faulty network device in the embodiment of the present application may be a device having an operating system. The operating system may be an Android operating system, an iOS operating system, or other possible operating systems, which are not specifically limited in the embodiment of the present application.
[0098] According to the device 500 of the embodiment of the present application, reference can be made to the process of the method 100-400 corresponding to the embodiment of the present application, and the various units / modules in the device 500 and the above-mentioned other operations and / or functions are respectively for implementing the corresponding processes in the method 100-400, and can achieve the same or equivalent technical effects, which will not be repeated here for the sake of brevity.
[0099] Figure 6 A schematic diagram of the hardware structure of an electronic device to implement an embodiment of the present application.
[0100] The electronic device 600 includes but is not limited to: a radio frequency unit 601, a network module 602, an audio output unit 603, an input unit 604, a sensor 605, a display unit 606, a user input unit 607, an interface unit 608, a memory 609, and a processor 610.
[0101] Those skilled in the art will appreciate that the electronic device 600 may also include a power source (such as a battery) for supplying power to each component, and the power source may be logically connected to the processor 610 through a power management system, so that the power management system can manage charging, discharging, and power consumption. The electronic device structure shown in the figure does not constitute a limitation on the electronic device, and the electronic device may include more or fewer components than shown in the figure, or combine certain components, or arrange components differently, which will not be described in detail here.
[0102] It should be understood that in the embodiment of the present application, the input unit 604 may include a graphics processor (Graphics Processing Unit, GPU) 6041 and a microphone 6042, and the graphics processor 6041 processes the image data of the static picture or video obtained by the image capture device (such as a camera) in the video capture mode or the image capture mode. The display unit 606 may include a display panel 6061, and the display panel 6061 may be configured in the form of a liquid crystal display, an organic light emitting diode, etc. The user input unit 607 includes a touch panel 6071 and other input devices 6072. The touch panel 6071 is also called a touch screen. The touch panel 6071 may include two parts: a touch detection device and a touch controller. Other input devices 6072 may include, but are not limited to, a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, a mouse, and a joystick, which will not be repeated here.
[0103] In the embodiment of the present application, the radio frequency unit 601 receives downlink data from the network side device and sends it to the processor 610 for processing; in addition, the uplink data is sent to the network side device. Generally, the radio frequency unit 601 includes but is not limited to an antenna, at least one amplifier, a transceiver, a coupler, a low noise amplifier, a duplexer, etc.
[0104] The memory 609 can be used to store software programs or instructions and various data. The memory 609 can mainly include a program or instruction storage area and a data storage area, wherein the program or instruction storage area can store an operating system, an application program or instruction required for at least one function (such as a sound playback function, an image playback function, etc.), etc. In addition, the memory 609 can include a high-speed random access memory, and can also include a non-volatile memory, wherein the non-volatile memory can be a read-only memory (Read-Only Memory, ROM), a programmable read-only memory (Programmable ROM, PROM), an erasable programmable read-only memory (Erasable PROM, EPROM), an electrically erasable programmable read-only memory (Electrically EPROM, EEPROM) or a flash memory. For example, at least one disk storage device, a flash memory device, or other non-volatile solid-state storage devices.
[0105] The processor 610 may include one or more processing units; optionally, the processor 610 may integrate an application processor and a modem processor, wherein the application processor mainly processes an operating system, a user interface, and application programs or instructions, etc., and the modem processor mainly processes wireless communications, such as a baseband processor. It is understandable that the modem processor may not be integrated into the processor 610.
[0106] Among them, the processor 610 is used to determine the abnormal network device in the network to be detected according to the network connectivity status of all online network devices in the network to be detected; perform path collection on the abnormal network device to determine the last hop node in the path; determine the target network device corresponding to the last hop node according to the IP information of the last hop node; and determine the faulty network device based on the target network device.
[0107] In one implementation, the processor 610 is configured to extract the number of logs of the target network device within a target time period; if the number of logs of the target network device within the target time period is greater than a first threshold, the target network device is determined to be a faulty network device.
[0108] In one implementation, the processor 610 is used to perform a ping detection on all online network devices in the network to be detected based on a preset period to obtain the network connectivity status of all online network devices in the network to be detected; according to the network connectivity status of all online network devices in the network to be detected, determine the number of newly added disconnected network devices in this round of detection; if the number of newly added disconnected network devices is greater than a second threshold, determine the newly added disconnected network devices as abnormal network devices.
[0109] In one implementation, the processor 610 is used to determine the target network device and target port corresponding to the last hop node according to the IP information of the last hop node; determine the faulty network device based on the target network device, and determine the faulty port based on the target port.
[0110] According to the electronic device 600 of the embodiment of the present application, the process of the method 100-400 corresponding to the embodiment of the present application can be referred to, and the various units / modules in the electronic device 600 and the above-mentioned other operations and / or functions are respectively for implementing the corresponding processes in the method 100-400, and can achieve the same or equivalent technical effects. For the sake of brevity, they will not be repeated here.
[0111] An embodiment of the present application also provides a computer-readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, each process of the above-mentioned method embodiment for locating a faulty network device is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.
[0112] The processor is a processor in the electronic device described in the above embodiment. The readable storage medium includes a computer readable storage medium, such as a computer read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0113] An embodiment of the present application further provides a chip, which includes a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run programs or instructions to implement the various processes of the above-mentioned method embodiment for locating faulty network equipment, and can achieve the same technical effect. To avoid repetition, it will not be repeated here.
[0114] It should be understood that the chip mentioned in the embodiments of the present application can also be called a system-level chip, a system chip, a chip system or a system-on-chip chip, etc.
[0115] An embodiment of the present application further provides a computer program product, which includes a processor, a memory, and a program or instruction stored in the memory and executable on the processor, wherein the program or instruction, when executed by the processor, implements the steps of the method described in the first aspect.
[0116] It should be noted that the terms "comprises", "includes" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the statement "comprises one..." does not exclude the presence of other identical elements in the process, method, article or device including the element. In addition, it should be noted that the scope of the methods and devices in the embodiments of the present application is not limited to performing functions in the order shown or discussed, and may also include performing functions in a substantially simultaneous manner or in reverse order according to the functions involved, for example, the described method may be performed in an order different from that described, and various steps may also be added, omitted, or combined. In addition, the features described with reference to certain examples may be combined in other examples.
[0117] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, a disk, or an optical disk), and includes a number of instructions for a terminal (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present application.
[0118] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present application, ordinary technicians in this field can also make many forms without departing from the purpose of the present application and the scope of protection of the claims, all of which are within the protection of the present application.
Claims
1. A method for locating a faulty network device, characterized in that: The method comprises: Performing ping detection on all online network devices in the network to be detected based on a preset period to obtain the network connectivity status of all online network devices in the network to be detected; Determine the number of disconnected network devices added in this round of detection according to the network connectivity status of all online network devices in the network to be detected; If the number of the newly added disconnected network devices is greater than a second threshold, determining the newly added disconnected network devices as abnormal network devices; Collecting the path of the abnormal network device and determining the last hop node in the path; According to the IP information of the last hop node, the network device corresponding to the last hop node that appears more frequently is determined as the target network device where the fault is located; Extract the number of logs of the target network device within the target time period; If the number of logs of the target network device within the target time period is greater than a first threshold, the target network device is determined to be a faulty network device.
2. The method according to claim 1, characterized in that After determining the network device corresponding to the last hop node with a larger number of occurrences as the target network device where the fault is located, the method further includes: According to the IP information of the last hop node, a port that appears more frequently and is located on the target network device is determined as the target port where the fault is located; In the case where the target network device is determined to be a faulty network device, a faulty port is determined based on the target port.
3. A device for locating a faulty network device, characterized in that: The device comprises: A fifth determination module is used to perform ping detection on all online network devices in the network to be detected based on a preset period to obtain the network connectivity status of all online network devices in the network to be detected; A first determination module is used to determine the number of disconnected network devices newly added in this round of detection according to the network connectivity status of all online network devices in the network to be detected; if the number of newly added disconnected network devices is greater than a second threshold, the newly added disconnected network devices are determined as abnormal network devices; A second determination module is used to collect paths of the abnormal network devices and determine the last hop node in the path; A third determination module is used to determine the network device corresponding to the last hop node with a large number of occurrences as the target network device where the fault is located according to the IP information of the last hop node; The fourth determination module is used to extract the number of logs of the target network device within a target time period; if the number of logs of the target network device within the target time period is greater than a first threshold, the target network device is determined to be a faulty network device.
4. The device according to claim 3, characterized in that The third determination module is further configured to determine, based on the IP information of the last hop node, a port that appears more frequently and is located on the target network device as a target port where the fault is located; The fourth determination module is further configured to determine a faulty port based on the target port when the target network device is determined to be a faulty network device.
5. An electronic device, characterized in that: The method comprises a processor, a memory, and a program or instruction stored in the memory and executable on the processor, wherein the program or instruction implements the steps of the method according to any one of claims 1 to 2 when executed by the processor.
6. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 2 are implemented.
