Network automation detection method, device, equipment and storage medium

By analyzing the characters returned by the switch and the packet capture information through the automated detection method, the problem of high error rate in the detection of networking equipment information in the existing technology is solved, and fast and accurate acquisition of networking information is achieved.

CN118200215BActive Publication Date: 2024-08-30SHENZHEN FENGRUNDA TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410600480.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-05-15
Publication Date
2024-08-30
Estimated Expiration
2044-05-15

AI Technical Summary

Technical Problem

The existing technology has problems such as high error rate and too long time when probing network device information. In particular, it is difficult to accurately obtain network device information through manual probing of networking methods.

Method used

Adopting the automatic network detection method, by establishing a connection with the switch under test, parsing the returned characters to determine the number of connected switches and the number of switches under test connected to the port, and comparing the packet capture information and parameter configuration information to generate network test results. Implement automated exploration.

Benefits of technology

It improves the accuracy and efficiency of networking equipment information, reduces manual errors, and enables faster and more accurate deduction of network networking and equipment information in unfamiliar networking methods.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118200215B
    Figure CN118200215B
Patent Text Reader

Abstract

The present application discloses a networking automatic detection method, device, equipment and storage medium, which relates to the field of computer network technology, including: after establishing a connection with a switch under test in the networking, determining the number of switches connected to the networking according to whether the switch under test returns a character string; when obtaining a return character, determining the number of switches to be tested connected to each port of the switch under test according to the return character; configuring parameters of the switch under test connected to the switch under test; comparing the packet capture information of the switch under test with the parameter configuration information of the switch under test to obtain a comparison result; generating a networking test result according to the number of switches connected to the networking, the number of switches to be tested connected to each port of the switch under test and the comparison result, without the need to manually detect the networking information, only one network card is needed, and the method can be used to detect unfamiliar networking methods, so as to more correctly deduce the networking and all device information of the network.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer network technology, and in particular to a networking automation detection method, device, equipment and storage medium. Background Art

[0002] LLDP (Link Layer Discovery Protocol) is a network protocol used to automatically discover information about connected devices on a local area network. It allows network devices (such as switches and routers) to send and receive information about connected devices, including device type, port identification, device manufacturer information, etc.

[0003] Currently, LLDP detects the information of all devices connected to the switch. The only way to detect the networking mode and the information of all devices is to manually explore, which takes a long time and is prone to errors.

[0004] The above contents are only used to assist in understanding the technical solution of the present application and do not constitute an admission that the above contents are prior art. Summary of the invention

[0005] The main purpose of the present application is to provide a method, device, equipment and storage medium for automatic detection of networking, aiming to solve the technical problem of high error rate in detecting device information of networking in the prior art.

[0006] To achieve the above objectives, the present application proposes a network automation detection method, which includes:

[0007] After establishing a connection with the switch under test in the network, determining the number of switches connected to the network according to whether the switch under test returns a character string;

[0008] When the return character is obtained, the number of switches to be tested connected to each port of the switch to be tested is determined according to the return character;

[0009] Performing parameter configuration on the switch to be tested connected to the switch to be tested;

[0010] Comparing the packet capture information of the tested switch with the parameter configuration information of the tested switch to obtain a comparison result;

[0011] The networking test result is generated according to the number of switches connected to the networking, the number of switches to be tested connected to each port of the tested switch, and the comparison result.

[0012] In one embodiment, the step of establishing a connection with the switch under test in the networking includes:

[0013] Remotely connect to the switch under test in the network;

[0014] Enter the command line interface and execute the view command to view the information of the link layer discovery protocol to obtain the information of the switch under test.

[0015] In one embodiment, the step of determining the number of switches connected to the network according to whether the tested switch returns a character string includes:

[0016] When no character string returned by the tested switch is received, it is determined that no switch is connected to the tested switch;

[0017] When the character string returned by the tested switch is received, the number of switches connected to the tested switch is determined according to the number of the received character strings.

[0018] In one embodiment, the step of determining the number of switches to be tested connected to each port of the switch to be tested according to the returned character comprises:

[0019] Parsing the returned characters to obtain parameter information of the switch to be tested connected to each port of the switch to be tested;

[0020] When there is no duplicate port in the parameter information, it is determined that there is only one switch connected to the port;

[0021] When there are repeated ports in the parameter information, the number of switches connected to the port is determined according to the number of repeated ports.

[0022] In one embodiment, the step of configuring parameters of all switches to be tested connected to the switch to be tested includes:

[0023] Connect all switches in the network respectively through the remote connection unit;

[0024] Delete the management address, port description address, and system name parameters carried in the link layer discovery protocol messages of all switches in the network except the switch under test.

[0025] In one embodiment, the step of comparing the packet capture information of the tested switch with the parameter configuration information of the tested switch to obtain a comparison result includes:

[0026] Capturing packets on the switch under test by means of a packet capturing unit, finding out whether the parameter information carried in the message sent by other switches under test in the network still contains the management address, port description address and system name parameters, and finding out whether the information of the link layer discovery protocol still contains the management address, port description address and system name parameters in the command line interface;

[0027] When the management address, port description address and system name are not found, it is determined that there is no fault in the network;

[0028] When the management address, port description address and system name are found, it is determined that there is a fault in the networking.

[0029] In one embodiment, after the step of generating the networking test result according to the number of switches connected to the networking, the number of switches to be tested connected to each port of the tested switch, and the comparison result, the step further includes:

[0030] Calling the information writing unit;

[0031] When there is no fault in the network, the number of switches connected to the network, the number of switches to be tested connected to each port of the tested switch and information on test passing are written into the information storage unit through the information writing unit;

[0032] When a fault occurs in the network, information indicating that the test has failed is written into the information storage unit through the information writing unit.

[0033] In addition, to achieve the above purpose, the present application also proposes a network automation detection device, the device comprising:

[0034] A first judgment module is used to determine the number of switches connected to the network according to whether the tested switch returns a character string after establishing a connection with the tested switch in the network;

[0035] A second judgment module is used to determine the number of switches to be tested connected to each port of the switch to be tested according to the returned character when the returned character is obtained;

[0036] A comparison and verification module is used to configure parameters of all switches to be tested that are connected to the switch to be tested; compare the packet capture information of the switch to be tested with the parameter configuration information of the switch to be tested to obtain a comparison result;

[0037] The output module is used to generate a networking test result according to the number of switches connected to the networking, the number of switches to be tested connected to each port of the tested switch, and the comparison result.

[0038] In addition, to achieve the above-mentioned purpose, the present application also proposes a network automation detection device, which includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, and the computer program is configured to implement the steps of the network automation detection method described above.

[0039] In addition, to achieve the above-mentioned purpose, the present application also proposes a storage medium, which is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by the processor, the steps of the network automation detection method described above are implemented.

[0040] In addition, to achieve the above-mentioned purpose, the present application also provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, the steps of the network automation detection method described above are implemented.

[0041] One or more technical solutions proposed in this application have at least the following technical effects:

[0042] After establishing a connection with the switch under test in the network, the number of switches connected to the network is determined according to whether the switch under test returns a character string; when the return character is obtained, the number of switches under test connected to each port of the switch under test is determined according to the return character; the switch under test connected to the switch under test is parameter configured; the packet capture information of the switch under test is compared with the parameter configuration information of the switch under test to obtain a comparison result; the networking test result is generated according to the number of switches connected to the network, the number of switches under test connected to each port of the switch under test and the comparison result. There is no need to manually detect the networking information, only one network card is needed, which can be used to detect unfamiliar networking methods, so as to more correctly deduce the networking and all device information of the network. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0044] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0045] Figure 1 A flowchart of the first embodiment of the network automation detection method of the present application is provided;

[0046] Figure 2 A possible networking result diagram provided for the first embodiment of the networking automatic detection method of the present application;

[0047] Figure 3 A flow chart of the second embodiment of the network automation detection method of the present application;

[0048] Figure 4A flowchart of the third embodiment of the network automation detection method of the present application is provided;

[0049] Figure 5 This is a schematic diagram of the module structure of the networked automated detection device according to an embodiment of the present application;

[0050] Figure 6 This is a schematic diagram of the device structure of the hardware operating environment involved in the networking automation detection method in the embodiment of the present application.

[0051] The purpose, features and advantages of this application will be further described in conjunction with the embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0052] It should be understood that the specific embodiments described herein are only used to explain the technical solutions of the present application and are not used to limit the present application.

[0053] In order to better understand the technical solution of the present application, a detailed description will be given below in conjunction with the accompanying drawings and specific implementation methods.

[0054] The existing technology can only manually explore the networking mode and the information of all devices, which takes a long time and is prone to errors.

[0055] This application provides a solution that uses an automated method to detect all device information in the network and improve fault tolerance.

[0056] It should be noted that the execution subject of this embodiment can be a computing service device with data processing, network communication and program running functions, such as a tablet computer, a personal computer, a mobile phone, etc., or an electronic device capable of realizing the above functions, a networking automation detection device, etc. The following takes the networking automation detection device as an example to illustrate this embodiment and the following embodiments.

[0057] Based on this, the present application embodiment provides a network automation detection method, referring to Figure 1 , Figure 1 This is a flow chart of the first embodiment of the method for networking automated detection equipment of the present application.

[0058] In this embodiment, the method for networking automated detection equipment includes steps S10 to S40:

[0059] Step S10, after establishing a connection with the switch under test in the network, determine the number of switches connected to the network according to whether the switch under test returns a character string.

[0060] It should be noted that this strategy is developed using Python and only requires one network card to complete.

[0061] It can be understood that networking refers to connecting multiple network devices (such as computers, servers, switches, routers, etc.) to form a unified network system to achieve functions such as resource sharing, communication and data transmission. In the networking process, factors such as network topology, device layout, connection method, protocol selection, etc. need to be considered to ensure the stability, security and performance of the network.

[0062] like Figure 2 As shown, Figure 2 A possible networking result diagram provided for the first embodiment of the networking automatic detection method of the present application.

[0063] Step S20: when the return character is obtained, the number of switches to be tested connected to each port of the switch to be tested is determined according to the return character.

[0064] In a specific implementation, the parameter information of other devices connected to each port of the switch 1 under test is parsed according to the re module.

[0065] Step S30: performing parameter configuration on the switch to be tested that is connected to the switch to be tested.

[0066] In a feasible implementation, step S30 may include connecting all switches in the network respectively through the remote connection unit; deleting the management address, port description address and system name parameters carried in the link layer discovery protocol message of other switches in the network except the switch under test.

[0067] It should be noted that the remote connection unit is the paramiko module. Paramiko is an SSH client library for Python that can be used to connect to remote servers and perform various operations, such as file transfer, remote command execution, etc. It is an implementation of the SSH2 protocol in Python language, making it easy to communicate with remote servers through SSH in Python programs.

[0068] In addition, it should be noted that the Link Layer Discovery Protocol is LLDP. LLDP (Link Layer Discovery Protocol) is a data link layer protocol used to discover and identify information about adjacent devices in a local area network. LLDP packets are data units transmitted by the LLDP protocol in the network and are used to exchange basic information about devices.

[0069] In the specific implementation, five devices are connected through the paramiko module, and the three parameters of management address TLV, port description TLV, and system name TLV carried in the lldp messages of the other four devices except the switch 1 under test are turned off. The three parameters are used to transmit the management information, port description, and system name of the device.

[0070] It should be noted that the management address TLV is used to specify the management address of the device so that other devices can identify and communicate with it. For example, it is used for remote management of devices in network management. The port description TLV provides port description information, such as port number, port type or port function, to help administrators identify the port of the device. The system name TLV provides the system name of the device, which is used to uniquely identify the device and help administrators identify and manage devices in the network.

[0071] Step S40: Compare the packet capture information of the tested switch with the parameter configuration information of the tested switch to obtain a comparison result.

[0072] In a feasible implementation, step S40 may include capturing packets on the switch under test by a packet capturing unit, searching whether the parameter information carried in the message sent by other switches under test in the networking still contains the management address, the port description address, and the system name parameter, and searching the information of the link layer discovery protocol on the command line interface to see whether the management address, the port description address, and the system name parameter still exist;

[0073] If the management address, port description address and system name are not found, it is determined that there is no fault in the network;

[0074] When the management address, port description address and system name are found, it is determined that there is a fault in the network.

[0075] It should be noted that the packet capture unit is the scapy module. Scapy is a Python library for creating, manipulating and analyzing network packets. It can be used to build custom network tools, network protocol implementations, network attacks and security tests, etc. Functions include: Building and parsing packets: Scapy allows users to build various types of network packets, including Ethernet, IP, TCP, UDP, ICMP and other protocols, and can parse and analyze received packets; Sending and receiving packets: Scapy provides the function of sending and receiving packets. Users can send customized packets to the network, or capture and analyze packets received from the network interface; Network detection and scanning: Scapy can be used to perform network detection and scanning, such as Ping scanning, port scanning, etc., to discover and identify hosts and services in the network; Protocol implementation: Users can use Scapy to implement and test various network protocols, including standard protocols and custom protocols.

[0076] It should be noted that the command line interface is the vtysh view. The vtysh view is a command line interface (CLI) used to configure and manage router functions on network devices. In the vtysh view, users can execute various commands to configure the router's routing protocols, routing tables, interfaces, etc. This allows administrators to use a single command line interface to configure and manage multiple routing protocols without switching to different CLIs; the vtysh view provides a unified command line interface that allows users to configure and manage multiple routing protocols, such as BGP, OSPF, RIP, etc., without switching to different CLIs; users can configure the parameters of various routing protocols in the vtysh view, including BGP, OSPF, RIP, etc., to achieve routing information exchange and routing table updates; users can view and manage the router's routing table, including viewing routing information, adding static routes, deleting routes, and other operations. Users can configure the router's interface parameters in the vtysh view, including IP address, subnet mask, MTU, etc.; users can view the router's status information, including interface status, routing protocol neighbor relationship, router operation status, etc.

[0077] In the specific implementation, the scapy module is used to capture packets on the switch 1 under test to check whether these three parameters are deleted from the TLV information carried in the packets sent by other switches and the lldp information viewed in the vtysh view. If they are deleted, the test passes; otherwise, the test fails.

[0078] Step S50, generating a networking test result according to the number of switches connected to the networking, the number of switches to be tested connected to each port of the tested switch, and the comparison result.

[0079] In a feasible implementation, step S50 may include calling an information writing unit; when there is no fault in the networking, the number of switches connected to the networking, the number of switches to be tested connected to each port of the tested switch, and information on test passing are written into the information storage unit through the information writing unit; when there is a fault in the networking, the information on test failure is written into the information storage unit through the information writing unit.

[0080] It should be noted that the opennxl module is used to create an Excel workbook and add a worksheet; write information in the worksheet; and save the Excel file to disk.

[0081] This embodiment provides a networking automatic detection method. After establishing a connection with a switch under test in the networking, the number of switches connected to the networking is determined according to whether the switch under test returns a character string; when a return character is obtained, the number of switches to be tested connected to each port of the switch under test is determined according to the return character; parameter configuration is performed on the switch under test connected to the switch under test; packet capture information of the switch under test is compared with parameter configuration information of the switch under test to obtain a comparison result; a networking test result is generated according to the number of switches connected to the networking, the number of switches to be tested connected to each port of the switch under test, and the comparison result. No manual detection of networking information is required, and only one network card is required. The method can be used to detect unfamiliar networking modes, so as to more correctly deduce the networking and all device information of the network.

[0082] Based on the first embodiment of the present application, in the second embodiment of the present application, the same or similar contents as those in the above-mentioned embodiment 1 can be referred to the above introduction, and will not be repeated in the following. Figure 3 , step S10, the network automation detection method further includes steps S101~S104:

[0083] Step S101: remotely connect to a switch under test in the network.

[0084] In the specific implementation, paramiko is used to connect to the switch 1 under test.

[0085] Step S102, entering the command line interface to execute a view command to view information of the link layer discovery protocol to obtain information of the switch under test.

[0086] In the specific implementation, enter the vtysh view to view the lldp link information and determine the total number of devices based on the character string returned by the switch.

[0087] Step S103: When no character string is received from the switch under test, it is determined that no switch is connected to the switch under test.

[0088] In a specific implementation, if no character string is returned, it is determined that no other management switch is connected to the switch.

[0089] Step S104: when the character string returned by the tested switch is received, the number of switches connected to the tested switch is determined according to the number of received character strings.

[0090] In a specific implementation, a character string is returned, and the number of access switches is determined according to the number of returned characters.

[0091] This embodiment provides a networking automated detection method, which remotely connects to a switch under test in the networking, enters a command line interface, executes a view command to view information of a link layer discovery protocol, and obtains information of the switch under test; when no character string returned by the switch under test is received, it is determined that no switch is connected to the switch under test; when a character string returned by the switch under test is received, the number of switches connected to the switch under test is determined according to the number of received character strings, without the need to view the lldp command through a vthsh view and figure out a specific networking structure.

[0092] Based on the first and second embodiments of the present application, in the third embodiment of the present application, the same or similar contents as those in the above embodiments can be referred to the above introduction, and will not be described in detail later. Figure 4 , step S20, the network automation detection method further includes steps S201~S203:

[0093] Step S201: Parse the returned characters to obtain parameter information of the switch to be tested connected to each port of the switch to be tested.

[0094] It should be noted that this strategy uses the re module for parsing, which is a standard library in Python for processing regular expressions. Regular expressions are a text pattern matching and search tool that searches, replaces, and verifies text by specifying a pattern.

[0095] In addition, it should be noted that the parameter information of the switch to be tested carries all device information by default.

[0096] In a specific implementation, the parameter information of other devices connected to each port of the switch 1 under test is parsed according to the re module.

[0097] Step S202: When there is no port duplication in the parameter information, it is determined that there is only one switch connected to the port.

[0098] In a specific implementation, if there is no duplicate port in the returned string, it is determined that there is only one device connected to the interface.

[0099] Step S203: When there are repeated ports in the parameter information, the number of switches connected to the ports is determined according to the number of repeated ports.

[0100] In the specific implementation, there are repeated ports in the returned string, and the number of devices connected to the interface is determined based on the number of repeated ports.

[0101] This embodiment provides a networking automatic detection method, which parses the returned characters to obtain parameter information of the switch to be tested connected to each port of the tested switch; when there is no port duplication in the parameter information, it is determined that there is only one switch connected to the port; when there is a port duplication in the parameter information, the number of switches connected to the port is determined according to the number of port duplications, without the need to view the lldp command through the vthsh view and figure out the specific networking structure.

[0102] It should be noted that the above examples are only used to understand the present application and do not constitute a limitation on the network automation detection method of the present application. More simple transformations based on this technical concept are all within the scope of protection of the present application.

[0103] This application also provides a network automation detection device, please refer to Figure 5 , the networking automation detection device comprises:

[0104] A first judgment module 10 is used to determine the number of switches connected to the network according to whether the switch under test returns a character string after establishing a connection with the switch under test in the network;

[0105] A second judgment module 20 is used to determine the number of switches to be tested connected to each port of the switch to be tested according to the returned character when the returned character is obtained;

[0106] The comparison and verification module 30 is used to configure parameters of all switches to be tested that are connected to the switch to be tested; compare the packet capture information of the switch to be tested with the parameter configuration information of the switch to be tested to obtain a comparison result;

[0107] The output module 40 is used to generate a networking test result according to the number of switches connected to the network, the number of switches to be tested connected to each port of the tested switch, and the comparison result. The networking automation detection device provided by the present application adopts the networking automation detection method in the above embodiment, which can solve the technical problem of high error rate of device information detection in the prior art. Compared with the prior art, the beneficial effects of the networking automation detection device provided by the present application are the same as the beneficial effects of the networking automation detection method provided by the above embodiment, and other technical features in the networking automation detection device are the same as the features disclosed in the above embodiment method, which will not be repeated here.

[0108] The present application provides a networking automation detection device, which includes: at least one processor; and a memory that is communicatively connected to the at least one processor; wherein the memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the networking automation detection method in the above-mentioned embodiment 1.

[0109] Reference below Figure 6 , which shows a schematic diagram of the structure of a networking automation detection device suitable for implementing the embodiment of the present application. The networking automation detection device in the embodiment of the present application may include but is not limited to mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Descriptions), PMPs (Portable Media Players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 5 The networking automation detection 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 application.

[0110] like Figure 6 As shown, the networking automation detection equipment may include a processing device 1001 (such as a central processing unit, a graphics processing unit, etc.), which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM: Read Only Memory) 1002 or the program loaded from the storage device 1003 to the random access memory (RAM: Random Access Memory) 1004. In RAM1004, various programs and data required for the operation of the xxx device are also stored. The processing device 1001, ROM1002 and RAM1004 are connected to each other through a bus 1005. The input / output (I / O) interface 1006 is also connected to the bus. Generally, the following systems can be connected to the I / O interface 1006: an input device 1007 including, for example, a touch screen, a touchpad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; an output device 1008 including, for example, a liquid crystal display (LCD: Liquid Crystal Display), a speaker, a vibrator, etc.; a storage device 1003 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 1009. The communication device 1009 can allow the networked automated detection device to communicate with other devices wirelessly or wired to exchange data. Although the figure shows a networked automated detection device with various systems, it should be understood that it is not required to implement or have all the systems shown. More or fewer systems can be implemented or provided instead.

[0111] In particular, according to the embodiments disclosed in the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present application include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device, or installed from a storage device 1003, or installed from a ROM 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiment disclosed in the present application are executed.

[0112] The networking automation detection device provided by the present application adopts the networking automation detection method in the above embodiment, which can solve the technical problem of high error rate of device information detection in the prior art. Compared with the prior art, the beneficial effects of the networking automation detection device provided by the present application are the same as the beneficial effects of the networking automation detection device method provided by the above embodiment, and other technical features in the networking automation detection device are the same as the features disclosed in the method of the previous embodiment, which will not be repeated here.

[0113] It should be understood that the various parts disclosed in this application can be implemented by hardware, software, firmware or a combination thereof. In the description of the above embodiments, specific features, structures, materials or characteristics can be combined in any one or more embodiments or examples in a suitable manner.

[0114] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

[0115] The present application provides a computer-readable storage medium having computer-readable program instructions (ie, computer programs) stored thereon, and the computer-readable program instructions are used to execute the network automation detection method in the above-mentioned embodiment.

[0116] The computer-readable storage medium provided in the present application may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, systems or devices, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM: Random Access Memory), a read-only memory (ROM: Read Only Memory), an erasable programmable read-only memory (EPROM: Erasable Programmable Read Only Memory or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM: CD-Read Only Memory), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program, which may be used by or in combination with an instruction execution system, system or device. The program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (Radio Frequency: Radio Frequency), etc., or any suitable combination of the above.

[0117] The computer-readable storage medium may be included in the networked automated detection device; or may exist independently without being assembled into the networked automated detection device.

[0118] Computer program code for performing the operations of the present application may be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, C++, and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0119] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0120] The modules involved in the embodiments described in this application may be implemented by software or hardware, wherein the name of the module does not constitute a limitation on the unit itself in some cases.

[0121] The readable storage medium provided in the present application is a computer-readable storage medium, which stores computer-readable program instructions (i.e., computer programs) for executing the above-mentioned network automation detection method, and can solve the technical problem of high error rate of device information detection in the prior art. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided in the present application are the same as the beneficial effects of the network automation detection method provided in the above-mentioned embodiment, and will not be repeated here.

[0122] The present application also provides a computer program product, including a computer program, which implements the steps of the above-mentioned network automation detection method when executed by a processor.

[0123] The computer program product provided by this application can solve the technical problem of high error rate in detecting device information of networking in the prior art. Compared with the prior art, the beneficial effects of the computer program product provided by this application are the same as those of the networking automatic detection method provided by the above embodiment, which will not be elaborated here.

[0124] The above descriptions are only some embodiments of the present application, and are not intended to limit the patent scope of the present application. All equivalent structural changes made using the contents of the present application specification and drawings under the technical concept of the present application, or direct / indirect applications in other related technical fields are included in the patent protection scope of the present application.

Claims

1. A network automation detection method, characterized in that: The network automation detection method comprises: After establishing a connection with the switch under test in the network, determining the number of switches connected to the network according to whether the switch under test returns a character string; When the returned character string is obtained, the number of switches to be tested connected to each port of the switch to be tested is determined according to the returned character string; Performing parameter configuration on the switch to be tested connected to the switch to be tested; Comparing the packet capture information of the tested switch with the parameter configuration information of the tested switch to obtain a comparison result; Generate a networking test result according to the number of switches connected to the networking, the number of switches to be tested connected to each port of the tested switch, and the comparison result; The step of comparing the packet capture information of the tested switch with the parameter configuration information of the tested switch to obtain a comparison result includes: Capturing packets on the switch under test by means of a packet capturing unit, finding out whether the management address, port description address and system name are still present in the parameter information carried in the message sent by other switches under test in the network, and finding out whether the management address, port description address and system name are still present in the information of the link layer discovery protocol in the command line interface; When the management address, port description address and system name are not found, it is determined that there is no fault in the network; When the management address, port description address and system name are found, it is determined that there is a fault in the network; After the step of generating the networking test result according to the number of switches connected to the networking, the number of switches to be tested connected to each port of the tested switch, and the comparison result, the step further includes: Calling the information writing unit; When there is no fault in the network, the number of switches connected to the network, the number of switches to be tested connected to each port of the tested switch and information on test passing are written into the information storage unit through the information writing unit; When a fault occurs in the network, information indicating that the test has failed is written into the information storage unit through the information writing unit.

2. The network automation detection method according to claim 1, characterized in that: The step of establishing a connection with the switch under test in the networking includes: Remotely connect to the switch under test in the network; Enter the command line interface and execute the view command to view the information of the link layer discovery protocol to obtain the information of the switch under test.

3. The network automation detection method according to any one of claims 1 to 2, characterized in that: The step of determining the number of switches connected to the network according to whether the tested switch returns a character string comprises: When no character string returned by the tested switch is received, it is determined that the tested switch is not connected to the tested switch; When the character string returned by the tested switch is received, the number of switches to be tested connected to the tested switch is determined according to the number of the character strings returned by the tested switch.

4. The network automation detection method according to claim 1, characterized in that: The step of determining the number of switches to be tested connected to each port of the switch to be tested according to the returned character string comprises: Parsing the returned character string to obtain parameter information of the switch to be tested connected to each port of the switch to be tested; When there is no duplicate port in the parameter information, it is determined that there is only one switch to be tested connected to the port; When there are repeated ports in the parameter information, the number of switches to be tested connected to the ports is determined according to the number of repeated ports.

5. The network automation detection method according to claim 1, characterized in that: The step of configuring parameters of all switches to be tested connected to the switch to be tested includes: Connect all switches in the network respectively through the remote connection unit; Delete the management address, port description address, and system name carried in the link layer discovery protocol messages of all switches in the network except the switch under test.

6. A networked automated detection device, characterized in that: The device comprises: A first judgment module is used to determine the number of switches connected to the network according to whether the tested switch returns a character string after establishing a connection with the tested switch in the network; A second judgment module is used to determine the number of switches to be tested connected to each port of the switch to be tested according to the returned string when the returned string is obtained; A comparison and verification module is used to configure parameters of all switches to be tested that are connected to the switch to be tested; compare the packet capture information of the switch to be tested with the parameter configuration information of the switch to be tested to obtain a comparison result; The comparison verification module is further used to capture packets on the switch under test through a packet capture unit, find out whether the management address, port description address and system name are still present in the parameter information carried in the message sent by other switches under test in the network, and find out whether the management address, port description address and system name are still present in the information of the link layer discovery protocol in the command line interface; when the management address, port description address and system name are not found, it is determined that there is no fault in the network; when the management address, port description address and system name are found, it is determined that there is a fault in the network; An output module, configured to generate a networking test result according to the number of switches connected to the networking, the number of switches to be tested connected to each port of the tested switch, and the comparison result; The output module is also used to call the information writing unit; when there is no fault in the networking, the number of switches connected to the networking, the number of switches to be tested connected to each port of the tested switch, and the information of the test passing are written into the information storage unit through the information writing unit; when there is a fault in the networking, the information of the test failing is written into the information storage unit through the information writing unit.

7. A networked automated detection device, characterized in that: The device comprises: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the network automation detection method according to any one of claims 1 to 5.

8. A storage medium, characterized in that: The storage medium is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the network automation detection method according to any one of claims 1 to 5 are implemented.

Citation Information

Patent Citations

  • A verification method for device parameter configuration of a station control layer of an intelligent transformer station

    CN108551394A

  • Network fault delimiting method and device and computer storage medium

    CN109728931A