Network device detection method, apparatus, device, storage medium, and program product
By remotely logging into the client to parse and display the execution results of network devices, and extracting and displaying the related information of key information, the problem of insufficient feedback information from network devices is solved, and the efficiency of troubleshooting is improved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- AGRICULTURAL BANK OF CHINA
- Filing Date
- 2024-11-26
- Publication Date
- 2026-05-29
AI Technical Summary
The current network devices do not provide enough feedback information, resulting in low efficiency in troubleshooting.
The detection command is generated by the remote login client. After the network device executes it and returns the result, the remote login client, with the rich echo information function enabled, uses regular expressions to parse the result, extract key information and obtain related information, and displays the execution result and related information.
It provides a wealth of feedback information, improving the efficiency of troubleshooting network equipment faults.
Smart Images

Figure CN119484372B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular to a method, apparatus, device, storage medium, and program product for detecting network devices. Background Technology
[0002] Remote login refers to the process of accessing and using computer resources or services located in another geographical location from one geographical location (local computer or terminal) via a network connection. This technology allows users to remotely operate another computer as if it were their local computer, including executing commands, accessing files, and running programs.
[0003] Users log in to network devices via remote login technology. They input commands on a remote login client, and the network device receives and generates detection commands based on these inputs, executing these commands on its operating system. This may involve configuration changes, status queries, or other operations. After execution, the network device displays the results back to the user. However, the current feedback information is insufficient. Summary of the Invention
[0004] This application provides network device detection methods, apparatus, equipment, storage media, and program products to provide rich feedback information and improve troubleshooting efficiency during the fault diagnosis process of network devices.
[0005] In a first aspect, embodiments of this application provide a network device detection method, applied to a remote login client, comprising:
[0006] The detection command generated based on the user's command input operation on the remote login client is sent to the network device;
[0007] Receive the execution result generated based on the detection command returned by the network device;
[0008] With the rich echo information function enabled, extract key information from the execution result and obtain the associated information of the key information;
[0009] Display the execution results and the associated information.
[0010] In one possible implementation, extracting key information from the execution result includes:
[0011] Query the first configuration table, which stores several regular expressions;
[0012] The execution result is parsed using the aforementioned regular expressions to extract key information from the execution result. The key information is the content in the execution result that matches the target regular expression among the aforementioned regular expressions. The target regular expression is the regular expression that was successfully matched among the aforementioned regular expressions.
[0013] In one possible implementation, the first configuration table stores the mapping relationship between regular expressions and query interfaces, and the mapping relationship between query interfaces and query fields. The association information for obtaining the key information includes:
[0014] Query the mapping relationship between the regular expression and the query interface to determine the target query interface corresponding to the target regular expression;
[0015] Query the mapping relationship between the query interface and the query fields to determine the target query field corresponding to the target query interface;
[0016] Based on the target query interface and the target query field, obtain the associated information of the key information.
[0017] In one possible implementation, obtaining the association information of the key information based on the target query interface and the target query field includes:
[0018] If the key information contains an Internet Protocol address, then it is determined that the target query interface contains a first interface and the target query field contains a first field;
[0019] From the second configuration table mapped from the first interface, query the field content corresponding to the first field to obtain application or service information associated with the Internet Protocol address in the key information. The second configuration table stores relevant information for multiple Internet Protocol addresses.
[0020] In one possible implementation, obtaining the association information of the key information based on the target query interface and the target query field includes:
[0021] If the key information includes a network interface, then it is determined that the target query interface includes a second interface and the target query field includes a second field;
[0022] From the third configuration table mapped to the second interface, query the field content corresponding to the second field to obtain the network interface opening and closing time information in the key information. The third configuration table stores relevant information of multiple network interfaces.
[0023] In one possible implementation, displaying the execution result and the associated information includes:
[0024] Based on the position of the extracted key information in the execution result, the display position of the associated information is determined;
[0025] The execution result is displayed, and the associated information is displayed at the specified display location.
[0026] In one possible implementation, the method further includes:
[0027] If the richness of the echo information function is turned off, the execution result will be displayed directly.
[0028] Secondly, embodiments of this application provide a network device detection apparatus, comprising:
[0029] The sending module is used to send the detection command generated based on the user's command input operation on the remote login client to the network device;
[0030] The receiving module is used to receive the execution result generated based on the detection command returned by the network device;
[0031] The extraction module is used to extract key information from the execution result and obtain the associated information of the key information when the rich echo information function is enabled.
[0032] The display module is used to display the execution results and the associated information.
[0033] In one possible implementation, the extraction module is specifically used for:
[0034] Query the first configuration table, which stores several regular expressions;
[0035] The execution result is parsed using the aforementioned regular expressions to extract key information from the execution result. The key information is the content in the execution result that matches the target regular expression among the aforementioned regular expressions. The target regular expression is the regular expression that was successfully matched among the aforementioned regular expressions.
[0036] In one possible implementation, the first configuration table stores the mapping relationship between regular expressions and query interfaces, and also stores the mapping relationship between query interfaces and query fields. The extraction module is specifically used for:
[0037] Query the mapping relationship between the regular expression and the query interface to determine the target query interface corresponding to the target regular expression;
[0038] Query the mapping relationship between the query interface and the query fields to determine the target query field corresponding to the target query interface;
[0039] Based on the target query interface and the target query field, obtain the associated information of the key information.
[0040] In one possible implementation, the extraction module is specifically used for:
[0041] If the key information contains an Internet Protocol address, then it is determined that the target query interface contains a first interface and the target query field contains a first field;
[0042] From the second configuration table mapped from the first interface, query the field content corresponding to the first field to obtain application or service information associated with the Internet Protocol address in the key information. The second configuration table stores relevant information for multiple Internet Protocol addresses.
[0043] In one possible implementation, the extraction module is specifically used for:
[0044] If the key information includes a network interface, then it is determined that the target query interface includes a second interface and the target query field includes a second field;
[0045] From the third configuration table mapped to the second interface, query the field content corresponding to the second field to obtain the network interface opening and closing time information in the key information. The third configuration table stores relevant information of multiple network interfaces.
[0046] In one possible implementation, the display module is specifically used for:
[0047] Based on the position of the extracted key information in the execution result, the display position of the associated information is determined;
[0048] The execution result is displayed, and the associated information is displayed at the specified display location.
[0049] In one possible implementation, the device is further used for:
[0050] If the richness of the echo information function is turned off, the execution result will be displayed directly.
[0051] Thirdly, embodiments of this application provide a network device detection device, including: a memory and a processor;
[0052] The memory stores computer-executed instructions;
[0053] The processor executes computer execution instructions stored in the memory, causing the processor to perform the first aspect and / or various possible implementations of the first aspect as described above.
[0054] Fourthly, embodiments of this application provide a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, are used to implement the first aspect and / or various possible implementations of the first aspect.
[0055] Fifthly, embodiments of this application provide a computer program product, including a computer program that, when executed by a processor, implements the first aspect and / or various possible implementations of the first aspect.
[0056] The network device detection method, apparatus, device, storage medium, and program product provided in this application embodiment allow a remote login client to send detection commands to the network device. These detection commands are generated based on user input on the remote login client. Upon receiving the detection command, the network device executes it on its operating system and transmits the execution result back to the remote login client. The remote login client receives the execution result and, if the rich echo information function is enabled, extracts key information from the execution result and obtains related information. This related information is displayed simultaneously with the execution result. By displaying the related information of key information from the execution result when the rich echo information function is enabled, rich echo information is provided during network device troubleshooting, thereby improving troubleshooting efficiency. Attached Figure Description
[0057] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.
[0058] Figure 1 A diagram illustrating the return information after executing a detection command for a network device;
[0059] Figure 2 A schematic diagram illustrating a scenario for the network device detection method provided in this application;
[0060] Figure 3 Flowchart of the network device testing method provided in this application Figure 1 ;
[0061] Figure 4 Flowchart of the network device testing method provided in this application Figure 2 ;
[0062] Figure 5A schematic diagram of the first configuration table provided for this application;
[0063] Figure 6 This application provides a schematic diagram showing the associated information;
[0064] Figure 7 A schematic diagram illustrating the execution process of the network device detection method provided in this application;
[0065] Figure 8 A schematic diagram of the network device testing device provided in this application;
[0066] Figure 9 A schematic diagram of the network device testing equipment provided in this application.
[0067] The accompanying drawings illustrate specific embodiments of this application, which will be described in more detail below. These drawings and descriptions are not intended to limit the scope of the concept in any way, but rather to illustrate the concept of this application to those skilled in the art through reference to particular embodiments. Detailed Implementation
[0068] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.
[0069] Users log in to network devices using remote login technology. The user inputs commands on the remote login client, and the network device receives and generates detection commands based on these inputs, then executes these commands on its operating system. After execution, the network device returns the results to the remote login client. For example, a user might input the command `dis arp`, and the network device would return information such as... Figure 1 As shown.
[0070] The command `dis arp` displays the device's ARP (Address Resolution Protocol) table. The ARP table is used by network devices to map IP addresses to MAC addresses. For example... Figure 1 As shown, the device returned detailed information from the ARP table, including IP address, MAC address, expiration time (EXP), type / VLAN, interface, and VPN instance. The following is an explanation of the returned information:
[0071] ARP Entry Types: Lists the types of ARP entries (i.e., a record in the ARP table), including dynamic (D), static (S), interface (I), OpenFlow (O), and redirection (RD).
[0072] IP ADDRESS: Displays the IP address in the ARP entry.
[0073] MAC ADDRESS: Displays the MAC address associated with the IP address.
[0074] EXP(M): Indicates the expiration time of an ARP entry (in minutes).
[0075] TYPE / VLAN: Displays the type of ARP entry (dynamic, static, interface, etc.) and the VLAN to which it belongs.
[0076] INTERFACE: Displays the interface associated with the ARP entry.
[0077] VPN-INSTANCE: Displays the VPN instance associated with the ARP entry.
[0078] Users cannot obtain more detailed information from the echoes of network devices. For example, for the IP address 10.36.129.106, users cannot know the applications or services associated with or supported by that IP address, nor can they know when the IP address was assigned to the current user or device. This poses difficulties for data analysis, troubleshooting, and emergency response. Furthermore, because the operating system of network devices primarily focuses on core switching functions and lacks secondary development capabilities, this problem cannot be solved by modifying the operating system.
[0079] The network device detection method provided in this application allows a remote login client to send detection commands to the network device. These commands are generated based on user input on the remote login client. Upon receiving the command, the network device executes it on its operating system and transmits the execution result back to the remote login client. The remote login client receives the execution result and, if the rich echo information feature is enabled, extracts key information from the execution result and retrieves its related information. This related information is then displayed alongside the execution result. By retrieving and displaying related information from the execution result when the rich echo information feature is enabled, the technical problem of low network device troubleshooting efficiency due to insufficient echo information in current detection methods is solved.
[0080] Figure 2 This is a schematic diagram illustrating a scenario for the network device detection method provided in this application, such as... Figure 2As shown, the specific application scenario of this application is a scenario where a user remotely logs into network device 202 from remote login client 201 to perform fault diagnosis and testing.
[0081] The technical solution of this application and how the technical solution of this application solves the above-mentioned technical problems are described in detail below with specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments. The embodiments of this application will now be described with reference to the accompanying drawings.
[0082] Figure 3 Flowchart of the network device testing method provided in this application Figure 1 ,like Figure 3 As shown, this method can be applied to remote login clients, and the method includes:
[0083] S301. Send the detection command generated based on the user's command input operation on the remote login client to the network device.
[0084] Users can input commands on the remote login client, which will then generate corresponding detection commands and send them to the network device.
[0085] S302. Receive the execution result generated based on the detection command returned by the network device.
[0086] The network device receives and executes the detection command, and then sends the execution result back to the remote login client.
[0087] S303. When the rich information display function is enabled, extract key information from the execution results and obtain the related information of the key information.
[0088] The remote login client checks whether the rich information display feature is enabled. If it is, it can extract information from the execution results, including key information. Once key information is extracted, it can further obtain related information. For example, if key information is an Internet Protocol address, it can extract all Internet Protocol addresses from the execution results and further obtain related information, which may include, but is not limited to, application names, service names, and allocation times.
[0089] S304. Display the execution results and related information.
[0090] In this embodiment of the application, related information is displayed along with the execution result.
[0091] The network device detection method provided in this application embodiment allows a remote login client to send detection commands to the network device. These commands are generated based on user input on the remote login client. Upon receiving the command, the network device executes it on its operating system and transmits the execution result back to the remote login client. The remote login client receives the execution result and, if the rich echo information function is enabled, extracts key information from the execution result and obtains related information. This related information is then displayed along with the execution result. By displaying related information of key information from the execution result when the rich echo information function is enabled, rich echo information is provided during network device troubleshooting, thereby improving troubleshooting efficiency.
[0092] Figure 4 Flowchart of the network device testing method provided in this application Figure 2 ,like Figure 4 As shown, in this embodiment... Figure 3 Based on the embodiments, the network device detection method is described in detail. This method can be applied to remote login clients and includes:
[0093] S401. Send the detection command generated based on the user's command input operation on the remote login client to the network device.
[0094] S402. Receive the execution result generated based on the detection command returned by the network device.
[0095] S403. With the rich echo information function enabled, query the first configuration table, which stores several regular expressions.
[0096] In this embodiment of the application, a switch can be provided in the remote login client to control whether to enable the rich echo information function. This switch can be presented in the user interface as a checkbox, button or command line parameter.
[0097] When the rich echo information feature is enabled, the remote login client can automatically extract key information from the execution results returned by the network device.
[0098] S404. Several regular expressions are used to parse the execution results in order to extract key information from the execution results. The key information is the content in the execution results that matches the target regular expression in the several regular expressions. The target regular expression is the regular expression that is successfully matched in the several regular expressions.
[0099] The first configuration table stores several regular expressions. Each regular expression is used to identify and extract specific patterns or information from the execution results. After the execution results are returned, the regular expressions in the first configuration table are used to parse the results. Each regular expression is applied sequentially to the execution results to find matching content. The target regular expression refers to those regular expressions that successfully match the execution results among several regular expressions. Content matching the target regular expressions is extracted from the execution results. This content is the key information and may include error codes, internet protocol addresses, network interfaces, date and timestamps, resource usage, etc.
[0100] S405. Obtain related information for key information.
[0101] In one possible implementation, the first configuration table stores the mapping relationship between regular expressions and query interfaces, as well as the mapping relationship between query interfaces and query fields, and the associated information for obtaining key information, which may specifically include:
[0102] The mapping relationship between query regular expressions and query interfaces is determined to identify the target query interface corresponding to the target regular expression.
[0103] Query the mapping relationship between the query interface and the query fields, and determine the target query field corresponding to the target query interface;
[0104] Based on the target query interface and target query fields, obtain the related information of key information.
[0105] The first configuration table stores the mapping between regular expressions and their corresponding query interfaces. Each regular expression is used to identify a specific type of key information and points to a query interface to obtain more information. The first configuration table also stores the mapping between query interfaces and their corresponding query fields. These fields define the types of information that the query interface can access or retrieve.
[0106] When a regular expression successfully matches the execution result, the first configuration table is consulted to determine the target query interface corresponding to that regular expression. This step ensures that it's known which interface to use to retrieve the relevant information. Next, the first configuration table is queried to determine the target query fields corresponding to the target query interface. These fields indicate the specific types of information to be retrieved.
[0107] In one possible implementation, based on the target query interface and the target query field, the related information of the key information is obtained, which may specifically include:
[0108] If the key information contains an Internet Protocol address, then it is determined that the target query interface contains the first interface and the target query field contains the first field;
[0109] From the second configuration table mapped from the first interface, query the field content corresponding to the first field to obtain the application or service information associated with the Internet protocol address in the key information. The second configuration table stores information related to multiple Internet protocol addresses.
[0110] In this embodiment, if the extracted key information includes an Internet Protocol (IP) address, it can be determined that the target query interface includes a first interface, which is dedicated to processing queries related to IP addresses. Simultaneously, it can be determined that the target query field includes a first field, which stores application or service information related to the IP address. (Refer to...) Figure 5 The diagram shown is a schematic of the first configuration table provided in this application. The first field is the application / service field in the diagram.
[0111] The remote login client accesses the second configuration table through the first interface. The second configuration table stores multiple Internet Protocol (IP) addresses and their related information. This second configuration table can be a configuration table within a configuration management database. By querying the field content corresponding to the first field in the second configuration table, application or service information associated with the IP address in the key information can be obtained.
[0112] In one possible implementation, based on the target query interface and the target query field, the related information of the key information is obtained, which may specifically include:
[0113] If the key information contains a network interface, then it is determined that the target query interface contains a second interface and the target query field contains a second field.
[0114] From the third configuration table mapped from the second interface, query the field content corresponding to the second field to obtain the opening and closing time information of the network interface in the key information. The third configuration table stores relevant information of multiple network interfaces.
[0115] The opening and closing time of a network interface refers to the function of configuring a network device to automatically open or close the interface within a specified time period.
[0116] In this embodiment, if the extracted key information includes a network interface, it can be determined that the target query interface includes a second interface, which is specifically used for queries related to the network interface. Simultaneously, it can be determined that the target query field includes a second field, which stores the opening and closing time information of the network interface. For example... Figure 5 As shown, the second field is the opening and closing time field in the diagram.
[0117] The remote login client accesses the third configuration table through the second interface. This third configuration table stores multiple network interfaces and their related information. It can also be a configuration table within the configuration management database. Within the third configuration table, the opening and closing times of the network interfaces are retrieved by querying the fields corresponding to the second field.
[0118] S406. Display execution results and related information.
[0119] In one possible implementation, displaying the execution results and related information may specifically include:
[0120] Based on the location of the extracted key information in the execution results, determine the display location of the related information;
[0121] Display the execution results and show related information in the display location.
[0122] In this embodiment, the display position of related information is determined based on the position of the extracted key information in the execution result. This means that the related information will be inserted or appended to the context related to the key information, for example, inserted after the key information, or displayed as a comment near the key information. (See also...) Figure 6 The diagram shown is a schematic of the display of related information provided in this application, in which related information is inserted after the key information.
[0123] Furthermore, the detection command, the execution result of the detection command, and the associated information of the execution result can be stored together in the result record table.
[0124] In one possible implementation, the network device detection method of this application embodiment may further include:
[0125] When the rich output feature is disabled, the execution result is displayed directly.
[0126] When the information enrichment function is turned off, the steps of extracting key information and obtaining related information of key information are not executed, and the returned execution result is displayed directly.
[0127] Reference Figure 7 The diagram shown illustrates the execution process of the network device detection method provided in this application. The network device detection method of this application interacts with other systems (such as databases, monitoring systems, and log management systems) through a query interface to obtain additional information related to the extracted key information. The retrieved external information is integrated with the original echo information to form richer echo content, helping users better understand the device status and execution results, and improving the efficiency of fault analysis and emergency handling.
[0128] The technical solution of this application can flexibly enrich the echo information according to actual needs without modifying the network device firmware.
[0129] The network device detection method provided in this application embodiment allows a remote login client to send detection commands to the network device. These commands are generated based on user input on the remote login client. Upon receiving the command, the network device executes it on its operating system and transmits the execution result back to the remote login client. The remote login client receives the execution result and, if the rich echo information function is enabled, extracts key information from the execution result and obtains related information. This related information is then displayed along with the execution result. By displaying related information of key information from the execution result when the rich echo information function is enabled, rich echo information is provided during network device troubleshooting, thereby improving troubleshooting efficiency.
[0130] Figure 8 This is a schematic diagram of the network device testing device provided in this application, such as... Figure 8 As shown, the network device detection device 80 provided in this embodiment includes:
[0131] The sending module 801 is used to send the detection command generated based on the user's command input operation on the remote login client to the network device;
[0132] The receiving module 802 is used to receive the execution result generated based on the detection command returned by the network device;
[0133] The extraction module 803 is used to extract key information from the execution results and obtain the related information of the key information when the rich echo information function is enabled.
[0134] Display module 804 is used to display execution results and related information.
[0135] In one possible implementation, the extraction module is specifically used for:
[0136] Query the first configuration table, which stores several regular expressions;
[0137] The execution results are parsed using several regular expressions to extract key information. The key information is the content in the execution results that matches the target regular expression among the several regular expressions. The target regular expression is the regular expression that was successfully matched among the several regular expressions.
[0138] In one possible implementation, the first configuration table stores the mapping relationship between regular expressions and query interfaces, as well as the mapping relationship between query interfaces and query fields. The extraction module is specifically used for:
[0139] The mapping relationship between query regular expressions and query interfaces is determined to identify the target query interface corresponding to the target regular expression.
[0140] Query the mapping relationship between the query interface and the query fields, and determine the target query field corresponding to the target query interface;
[0141] Based on the target query interface and target query fields, obtain the related information of key information.
[0142] In one possible implementation, the extraction module is specifically used for:
[0143] If the key information contains an Internet Protocol address, then it is determined that the target query interface contains the first interface and the target query field contains the first field;
[0144] From the second configuration table mapped from the first interface, query the field content corresponding to the first field to obtain the application or service information associated with the Internet protocol address in the key information. The second configuration table stores information related to multiple Internet protocol addresses.
[0145] In one possible implementation, the extraction module is specifically used for:
[0146] If the key information contains a network interface, then it is determined that the target query interface contains a second interface and the target query field contains a second field.
[0147] From the third configuration table mapped from the second interface, query the field content corresponding to the second field to obtain the opening and closing time information of the network interface in the key information. The third configuration table stores relevant information of multiple network interfaces.
[0148] In one possible implementation, the display module is specifically used for:
[0149] Based on the location of the extracted key information in the execution results, determine the display location of the related information;
[0150] Display the execution results and show related information in the display location.
[0151] In one possible implementation, the device is further used for:
[0152] When the rich output feature is disabled, the execution result is displayed directly.
[0153] The network device detection device provided in this embodiment can execute the method provided in the above method embodiment. Its implementation principle and technical effect are similar, and will not be described in detail here.
[0154] Figure 9 This is a schematic diagram of the network device testing equipment provided in this application. Figure 9 As shown, the network device detection device 90 provided in this embodiment includes at least one processor 901 and a memory 902. Optionally, the device 90 further includes a communication component 903. The processor 901, memory 902, and communication component 903 are connected via a bus.
[0155] In a specific implementation, at least one processor 901 executes computer execution instructions stored in memory 902, causing at least one processor 901 to perform the above-described method.
[0156] The specific implementation process of processor 901 can be found in the above method embodiments, and its implementation principle and technical effect are similar. It will not be repeated here.
[0157] In the above embodiments, it should be understood that the processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), etc. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in this invention can be directly implemented by a hardware processor, or implemented by a combination of hardware and software modules within the processor.
[0158] The memory may include random access memory (RAM) and may also include non-volatile memory (NVM), such as at least one disk storage device.
[0159] The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. Buses can be categorized as address buses, data buses, control buses, etc. For ease of illustration, the buses shown in the accompanying drawings are not limited to a single bus or a single type of bus.
[0160] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the above-described method.
[0161] This application also provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, implement the above-described method.
[0162] The aforementioned readable storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk. The readable storage medium can be any available medium accessible to a general-purpose or special-purpose computer.
[0163] An exemplary readable storage medium is coupled to a processor, enabling the processor to read information from and write information to the readable storage medium. Of course, the readable storage medium can also be a component of the processor. The processor and the readable storage medium can reside in an Application Specific Integrated Circuit (ASIC). Alternatively, the processor and the readable storage medium can exist as discrete components in the device.
[0164] The division of units is merely a logical functional division; in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be indirect coupling or communication connection through some interfaces, devices, or units, and may be electrical, mechanical, or other forms.
[0165] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0166] In addition, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.
[0167] If a function is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this invention, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0168] Those skilled in the art will understand that all or part of the steps of the above-described method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When executed, the program performs the steps of the above-described method embodiments; and the aforementioned storage medium includes various media capable of storing program code, such as ROM, RAM, magnetic disks, or optical disks.
[0169] Finally, it should be noted that other embodiments of the invention will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This invention is intended to cover any variations, uses, or adaptations of the invention that follow the general principles of the invention and include common knowledge or customary techniques in the art not disclosed herein, and is not limited to the precise structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of the invention is limited only by the appended claims.
Claims
1. A method for detecting network devices, characterized in that, Applied to remote login clients, the method includes: The detection command generated based on the user's command input operation on the remote login client is sent to the network device; Receive the execution result generated based on the detection command returned by the network device; With the rich echo information function enabled, key information is extracted from the execution results; Based on the aforementioned key information, determine the target query interface and target query fields; Based on the target query interface and the target query field, obtain the association information of the key information; Display the execution results and the associated information; The step of obtaining the association information of the key information based on the target query interface and the target query field includes: If the key information contains an Internet Protocol address, then it is determined that the target query interface contains a first interface and the target query field contains a first field; from the second configuration table mapped to the first interface, the field content corresponding to the first field is queried to obtain the application or service information associated with the Internet Protocol address in the key information. The second configuration table stores relevant information for multiple Internet Protocol addresses. If the key information includes a network interface, then it is determined that the target query interface includes a second interface and the target query field includes a second field; from the third configuration table mapped to the second interface, the field content corresponding to the second field is queried to obtain the opening and closing time information of the network interface in the key information. The third configuration table stores relevant information of multiple network interfaces.
2. The method according to claim 1, characterized in that, Extracting key information from the execution result includes: Query the first configuration table, which stores several regular expressions; The execution result is parsed using the aforementioned regular expressions to extract key information from the execution result. The key information is the content in the execution result that matches the target regular expression among the aforementioned regular expressions. The target regular expression is the regular expression that was successfully matched among the aforementioned regular expressions.
3. The method according to claim 2, characterized in that, The first configuration table stores the mapping relationship between regular expressions and query interfaces, as well as the mapping relationship between query interfaces and query fields. Determining the target query interface and target query field based on the key information includes: Query the mapping relationship between the regular expression and the query interface to determine the target query interface corresponding to the target regular expression; Query the mapping relationship between the query interface and the query field to determine the target query field corresponding to the target query interface.
4. The method according to any one of claims 1-3, characterized in that, The display of the execution result and the associated information includes: Based on the position of the extracted key information in the execution result, the display position of the associated information is determined; The execution result is displayed, and the associated information is displayed at the specified display location.
5. The method according to any one of claims 1-3, characterized in that, The method further includes: If the richness of the echo information function is turned off, the execution result will be displayed directly.
6. A network device testing device, characterized in that, The device includes: The sending module is used to send the detection command generated based on the user's command input operation on the remote login client to the network device; The receiving module is used to receive the execution result generated based on the detection command returned by the network device; The extraction module is used to extract key information from the execution result when the richness of echo information function is enabled; determine the target query interface and target query field based on the key information; and obtain the association information of the key information based on the target query interface and the target query field. A display module is used to display the execution results and the associated information; The extraction module, when obtaining the associated information of the key information based on the target query interface and the target query field, specifically performs the following steps: If the key information contains an Internet Protocol address, then determine that the target query interface contains a first interface and the target query field contains a first field; query the field content corresponding to the first field from the second configuration table mapped to the first interface to obtain application or service information associated with the Internet Protocol address in the key information, wherein the second configuration table stores related information for multiple Internet Protocol addresses; If the key information contains a network interface, then determine that the target query interface contains a second interface and the target query field contains a second field; query the field content corresponding to the second field from the third configuration table mapped to the second interface to obtain the opening and closing time information of the network interface in the key information, wherein the third configuration table stores related information for multiple network interfaces.
7. A network device testing device, characterized in that, include: Memory, processor; The memory stores computer-executed instructions; The processor executes computer execution instructions stored in the memory, causing the processor to perform the method as described in any one of claims 1-5.
8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, are used to implement the method as described in any one of claims 1-5.
9. A computer program product, characterized in that, The computer program product includes a computer program that, when executed by a processor, implements the method described in any one of claims 1-5.