Method and device for automatically checking configuration and state of network equipment
Through the method of automatically checking the configuration and status of network equipment, the problems of inefficiency and misconfiguration in traditional methods are solved, efficient and accurate configuration and status check are achieved, and the quality and efficiency of network system construction and operation and maintenance work are significantly improved. .
Patent Information
- Application Number
- CN202411669016.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-21
- Publication Date
- 2025-02-18
AI Technical Summary
Traditional network equipment configuration and status check methods are inefficient, and are prone to configuration errors and inconsistent status problems, especially in scenarios where large-scale network system construction and frequent configuration modifications are made.
It provides an automated inspection method for network equipment configuration and status, including parsing equipment information, obtaining equipment inspection rules, collecting equipment configuration and status data, judging inspection rules and outputting inspection results. This method analyzes device information in an automated way, acquires inspection rules associated with the device, collects configuration and status data, and checks and outputs the data.
Through automated inspection methods, the efficiency and accuracy of network equipment configuration and status checks are significantly improved, and the problems of configuration errors, inconsistencies in status and specifications are solved, providing an efficient, reliable and automated configuration and status checks for network equipment. Solution.
Smart Images

Figure CN119484285A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of computer network engineering, and in particular to a method and device for automatically checking the configuration and status of network equipment. Background Art
[0002] In traditional network construction and delivery, after the network equipment is configured, the network administrator logs in to the device's command line interface and executes commands to obtain the current configuration and status information, and then checks the correctness of the configuration and status based on their own experience. This method is not only inefficient, but also prone to human misjudgment, resulting in configuration and status that do not meet expectations. Especially in scenarios involving large-scale network system construction and frequent configuration changes, multiple network administrators are often required to work together, and different people have different experiences. In the absence of a standardized configuration and status inspection system, the correctness of network equipment configuration and status is difficult to guarantee.
[0003] Therefore, there is an urgent need for an automated inspection method and device for network device configuration and status, which can solve the configuration errors, status inconsistencies and configuration specification requirements that may occur during the construction of large-scale network systems through automated inspection, and help implementation personnel better check the configuration and status of network devices. Summary of the invention
[0004] The present invention provides a method and device for automatically checking the configuration and status of network equipment, which are used to solve the technical problems of low work efficiency of implementation personnel and possible configuration errors, inconsistent status, etc. in the traditional method.
[0005] The present invention provides a method for automatically checking the configuration and status of a network device, comprising the following steps:
[0006] S1, parsing device information;
[0007] S2, obtaining equipment inspection rules;
[0008] S3, device configuration and status collection;
[0009] S4, determine the inspection rules;
[0010] S5, output the inspection result.
[0011] Further, parsing the device information includes: obtaining the device identification and device login information by parsing the input device information;
[0012] The device identifier is one or more of an IP address, a serial number, or a group name of a group of network devices with the same configuration or status.
[0013] Furthermore, obtaining device inspection rules includes: matching the device identification obtained by parsing the device information in the configuration and status inspection rule library to obtain a list of all inspection rules associated with the device, and dividing the inspection rules into three categories: complete match, fuzzy match, and key value match.
[0014] Furthermore, the device configuration and status collection includes: automatically initiating a connection with a network device according to the device login information obtained through the analysis, identifying a collection method supported by the network device, and collecting the current configuration and status information of the network device.
[0015] Furthermore, determining the inspection rules includes: traversing each rule by category according to the obtained three-category rule list, inspecting the collected device configuration and status data, and recording the inspection result of each rule.
[0016] Furthermore, outputting the inspection results includes: outputting, displaying and storing each inspection result of the network device for subsequent result viewing.
[0017] The present invention also provides an automated inspection device for network device configuration and status, comprising:
[0018] A first processing unit, configured to parse the network device information read from the first storage unit device information library;
[0019] A first acquisition unit, used to acquire the inspection rule information from the second storage unit;
[0020] The second acquisition unit is used to automatically identify the acquisition method supported by the device and automatically acquire the configuration and status data of the network device;
[0021] A second processing unit, configured to check the configuration and status data of the network device according to the checking rules;
[0022] A third processing unit, used for processing, displaying and storing the inspection results;
[0023] The first storage unit, as a device information library, is used to store information of network devices, including connection addresses, login information, and detection result information;
[0024] A second storage unit, serving as an inspection rule base, is used to store inspection rules for network devices;
[0025] The inspection rule library further includes: a first rule module for complete matching, storing inspection rules for determining whether a certain configuration or state of a network device completely matches an expected value;
[0026] The second rule module is used for fuzzy matching and stores the checking rules for judging whether a certain configuration or state of the network device fuzzily matches the expected value;
[0027] The third rule module is used for key value matching and stores the checking rules for comparing whether the numerical variables in the network device configuration or status can match the expected values.
[0028] The present invention can achieve the following beneficial effects:
[0029] Through modular processing procedures such as device information analysis, device inspection rule acquisition, device configuration and status collection, inspection rule judgment, and inspection result output, it not only improves the efficiency and accuracy of network device configuration and status inspection, but also enhances its practicality and is compatible with a variety of network devices. The present invention solves the problems of configuration errors, inconsistent status, and specification requirements encountered in the construction and maintenance of large-scale network systems, provides an efficient, reliable, and automated solution for the configuration and status inspection of network devices, and significantly improves the quality and efficiency of network system construction and operation and maintenance work.
[0030] Other features and advantages of the present invention will be described in the following description, and partly become apparent from the description, or understood by practicing the present invention. The purpose and other advantages of the present invention can be realized and obtained by the structures particularly pointed out in the written description and the accompanying drawings.
[0031] The technical solution of the present invention is further described in detail below through the accompanying drawings and embodiments. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] The accompanying drawings are used to provide a further understanding of the present invention and constitute a part of the specification. Together with the embodiments of the present invention, they are used to explain the present invention and do not constitute a limitation of the present invention. In the accompanying drawings:
[0033] Figure 1 A specific flow chart of a method for automatically checking the configuration and status of network equipment provided in an embodiment of the present application.
[0034] Figure 2 A schematic diagram of the structure of an automated inspection device for network device configuration and status provided in an embodiment of the present application.
[0035] Figure 3 A schematic diagram of a network device configuration and status inspection rule library provided in an embodiment of the present application.
[0036] Figure 4 A signaling interaction flow chart of a method for automatically checking the configuration and status of network equipment provided in an embodiment of the present application. DETAILED DESCRIPTION
[0037] The preferred embodiments of the present invention are described below in conjunction with the accompanying drawings. It should be understood that the preferred embodiments described herein are only used to illustrate and explain the present invention, and are not used to limit the present invention.
[0038] The embodiment of the present invention provides a method for automatically checking the configuration and status of a network device, such as Figure 1 As shown, the following steps are included:
[0039] S1, parsing device information;
[0040] S2, obtaining equipment inspection rules;
[0041] S3, device configuration and status collection;
[0042] S4, determine the inspection rules;
[0043] S5, output the inspection result.
[0044] The working principle of the above technical solution is: obtain the device information through the device information parsing module to connect the device, obtain the device inspection rule module to obtain the rule items that need to be checked from the rule library, the device configuration and status acquisition module automatically collects the configuration and status data of different types of devices, the judgment inspection rule module checks the device configuration and status item by item according to the inspection rules, and the output inspection result module outputs, displays and stores the inspection results.
[0045] The beneficial effects of the above technical solution are: through modular processing procedures such as parsing device information, obtaining device inspection rules, device configuration and status collection, judging inspection rules, and outputting inspection results, not only the efficiency and accuracy of network device configuration and status inspection are improved, but also its practicality is enhanced, and it can be compatible with a variety of network devices. The present invention solves the problems of configuration errors, inconsistent status, and specification requirements encountered in the construction and maintenance of large-scale network systems, provides an efficient, reliable, and automated solution for the configuration and status inspection of network devices, and significantly improves the quality and efficiency of network system construction and operation and maintenance work.
[0046] In one embodiment, parsing device information includes: obtaining device identification and device login information by parsing the input device information; wherein the device identification is one or more of an IP address, a serial number, or a group name of a group of network devices with the same configuration or status.
[0047] The working principle of the above technical solution is as follows: the device information parsing module reads the network device information from the device information library, and obtains the unique identification and device login information of the device by parsing the above information. The device identification can be an IP address, a serial number, or a group of network devices with the same configuration or status, which is mainly used for the next step of the associated device check rule.
[0048] The beneficial effect of the above technical solution is: in a complex network environment, it is crucial to clearly identify the device. By parsing the device information to obtain identifications such as IP addresses, serial numbers or device group names, it is like issuing a unique "ID card" to each network device. For large networks, there may be a large number of similar or different types of devices, and accurate identification can avoid confusion. For example, in an enterprise network with hundreds or thousands of devices, the IP address can directly locate a specific server or terminal, the serial number can be used to distinguish different device individuals of the same model, and the device group name helps to uniformly manage devices with the same configuration or function, providing precise guidance for subsequent targeted operations.
[0049] In one embodiment, obtaining device inspection rules includes: matching the device identification obtained by parsing the device information in the configuration and status inspection rule library to obtain a list of all inspection rules associated with the device, and dividing the inspection rules into three categories: full match, fuzzy match, and key value match.
[0050] The working principle of the above technical solution is: the device inspection rule acquisition module reads the left and right rules in the inspection rule library, and then filters the rules according to the device identification obtained by parsing to obtain all inspection rules related only to the device identification.
[0051] The beneficial effects of the above technical solution are:
[0052] 1. The inspection rules are divided into three categories: full match, fuzzy match, and key value match. They are adapted to network devices of different brands and types. According to the characteristics of the inspection rule types of different network devices, different inspection contents are handled in a targeted manner, reducing the complexity and error rate in the inspection process and improving the operability and accuracy of the inspection.
[0053] 2. Matching in the inspection rule library based on device identification can ensure that each device has a corresponding set of inspection rules. Different network devices require different inspection standards due to differences in their functions, configurations, and application scenarios, avoiding irrelevant or missed inspections of devices, improving inspection efficiency and quality, and ensuring that each device can be evaluated under the most appropriate rules.
[0054] In one embodiment, device configuration and status collection includes: automatically initiating a connection with a network device according to the parsed device login information, identifying a collection method supported by the network device, and collecting current configuration and status information of the network device.
[0055] Further, Figure 4 This is a flowchart of the interaction between the device configuration and status collection module and network devices, which is used to automatically collect configuration and status data of different network devices. The specific steps are as follows:
[0056] Step 401: The inspection tool initiates a request to connect to a network device.
[0057] In this step, the inspection tool obtains device information from the device library, and initiates a login connection request based on the obtained device login information: connection address, authentication information.
[0058] Step 402: After receiving the login request, the network device verifies the login information.
[0059] Step 403: After completing the login information verification, the network device will return a message to the inspection tool indicating whether the connection is successful.
[0060] In this step, if the login information verification is successful, a connection success message will be returned, otherwise a connection failure message will be returned.
[0061] Step 404: After receiving the message of successful connection, the inspection tool will send a detection command execution request of different collection methods to the network device.
[0062] In this step, in order to adapt to different types of network devices on the market, it is necessary to detect the collection methods supported by the network devices. The detection commands include detection of two collection methods: NetConf and command line (CLI). The collection methods supported by the network devices can be identified through the detection commands.
[0063] Step 405: The network device executes the received detection command on the device itself to obtain an execution result.
[0064] Step 406: After obtaining the execution result of the detection command, the network device returns the execution result to the inspection tool.
[0065] Step 407: The inspection tool judges the received execution result and selects the collection method to be used according to the judgment result.
[0066] Step 408: According to the collection method selected in step 407, a request for configuration and status collection is sent to the network device.
[0067] Step 409: The network device reads its own configuration and status data according to the received collection request.
[0068] Step 410: The network device returns a response message of the configuration and status data of the device to the inspection tool.
[0069] Step 411: The inspection tool parses the response message to obtain the configuration and status text data of the current network device.
[0070] The working principle of the above technical solution is: the device configuration and status acquisition module uses the device login information obtained by the device inspection rule acquisition module to establish a connection with the network device, and then collects the current configuration and status information of the device. This step supports different configuration and status acquisition methods, and can automatically detect the acquisition method supported by the device, ensuring wide adaptability to network devices of different brands and models.
[0071] The beneficial effects of the above technical solution are:
[0072] 1. Automatically initiating connection with network devices is an important part of the entire collection process. In a large-scale network environment, if you rely on manual connection of devices one by one, it is not only time-consuming and laborious, but also prone to human errors. Through automated connection, a large number of devices can be connected in a short time. Automated connection can initiate connection requests to devices without manually entering login information one by one and waiting for the connection to be established. This greatly saves human resources and time costs, allowing the entire inspection process to be started more quickly and improving overall work efficiency.
[0073] 2. Automatically identifying the collection methods supported by network devices and collecting configuration and status information is the key to obtaining accurate data. Different network devices may support different collection protocols and methods. The automatic identification function can select the most appropriate collection method based on the characteristics of the device. This intelligent collection method ensures that the collected data is complete and accurate, avoids data loss or errors caused by improper collection methods, provides a reliable data basis for subsequent rule judgment, and ensures the effectiveness of the entire inspection process.
[0074] In one embodiment, determining the inspection rule includes: traversing each rule by category according to the obtained three-category rule list, inspecting the collected device configuration and status data, and recording the inspection result of each rule.
[0075] Furthermore, in the judgment and checking rule module, there are three different sub-judgment modules to process different types of rules.
[0076] The working principle of the above technical solution is: the judgment inspection rule module checks the device configuration and status information obtained by the device configuration and status acquisition module item by item according to the rule list obtained by obtaining the device inspection rules, and records the inspection result of each rule.
[0077] Furthermore, the complete match rule determines whether the rule is satisfied based on the configuration and status text of the device and the rule's predicate and expected value, and if satisfied, the check passes;
[0078] The fuzzy matching rule matches the configuration and status text of the device according to the regular expression. If the match is successful, the check passes.
[0079] The key value matching rule first extracts the matching value from the configuration and status text of the device according to the regular expression, and then determines whether the matching value satisfies the rule according to the operator and expected value of the rule. If so, the check passes.
[0080] The beneficial effects of the above technical solution are:
[0081] 1. Check the collected device configuration and status data by category and traverse each rule to ensure a comprehensive and detailed evaluation of the device. This comprehensive inspection method does not miss any link that may have problems, whether it is network connection parameters, security settings or application-related configurations, so as to fully understand the actual situation of the device and provide comprehensive data support for device maintenance and management.
[0082] 2. It is important to record the inspection results of each rule. These records are like the health records of the equipment and play a key role in the subsequent equipment management process. When a problem occurs with the equipment, the source of the problem can be quickly located by viewing the historical inspection results. For long-term equipment maintenance and optimization work, these records can help administrators analyze the changing trends of the equipment, understand which configurations are prone to problems, and then take targeted preventive measures to improve the stability and reliability of the equipment.
[0083] In one embodiment, outputting the inspection results includes: outputting, displaying and storing each inspection result of the network device for subsequent result viewing.
[0084] The working principle of the above technical solution is: the output inspection result module summarizes and displays each inspection result of the network device. The inspection results can also be stored in the device information library for long-term storage to facilitate subsequent query of historical results.
[0085] The beneficial effects of the above technical solution are:
[0086] 1. Output and display each inspection result of network equipment, providing managers with an intuitive view of equipment status. Through visualization or clear report format, managers can quickly understand the overall situation of the equipment. For busy network operation and maintenance personnel, this intuitive display method greatly improves their speed of discovering problems, and can quickly focus on the problematic equipment among a large number of equipment information, take timely measures to avoid the expansion of the problem, and ensure the normal operation of the network.
[0087] 2. Storing inspection results in the device information database provides strong support for long-term management of the device. The device will undergo multiple inspections and maintenance during its life cycle, and these historical data form a valuable knowledge base. When upgrading, replacing or adjusting the network architecture, you can refer to these historical results to evaluate the performance trend of the device. At the same time, the stored results can also be used for auditing and compliance checks to ensure that the company's network equipment complies with relevant security and management regulations, and to ensure corporate information security and network stability.
[0088] In one embodiment, Figure 3 As shown, a network device configuration and status automatic inspection device, comprising:
[0089] The first processing unit 201 is used to parse the network device information read from the first storage unit;
[0090] A first acquisition unit 202, used to acquire the inspection rule information in the second storage unit;
[0091] The second acquisition unit 203 is used to automatically identify the collection method supported by the device and automatically collect the configuration and status data of the network device;
[0092] The second processing unit 204 is used to check the configuration and status data of the network device according to the checking rules;
[0093] The third processing unit 205 is used to process, display and store the inspection results;
[0094] A second storage unit 206, used to store inspection rules for network devices;
[0095] The first storage unit 207 is used to store information of the network device, including connection address, login information and detection result.
[0096] The working principle of the above technical solution is as follows: First, the network device information in the first storage unit 207, such as the connection address, login information and detection result information, will be extracted and parsed by the first processing unit 201, so that the device can grasp the basic situation of the device. At the same time, the first acquisition unit 202 obtains the inspection rule information from the second storage unit 206. Then, the second acquisition unit 203 collects the configuration and status data of the network device by automatically identifying the collection method supported by the device. Subsequently, the second processing unit 204 uses the obtained inspection rules to check the collected configuration and status data. Finally, the third processing unit 205 performs a series of operations such as processing, displaying and storing the inspection results, so as to achieve the purpose of automated inspection of the configuration and status of the network device.
[0097] The beneficial effects of the above technical solution are:
[0098] 1. The whole process does not require manual intervention in each inspection link. From parsing network device information, obtaining inspection rules, to automatically collecting data, checking according to rules and processing results, it is done in one go. Compared with the traditional manual inspection method, it greatly saves time and labor costs. For example, when facing a large number of network devices that need to be inspected, manual configuration checking and status analysis may be required one by one, while the device can handle multiple devices at the same time, greatly shortening the inspection cycle.
[0099] 2. It can automatically identify the collection methods supported by the equipment and collect data, avoiding errors or incomplete data caused by improper manual selection of collection methods. In addition, automatic collection can quickly obtain a large amount of data, improve the speed of data acquisition, and provide sufficient information in a timely manner for subsequent inspection and analysis.
[0100] In one embodiment, Figure 3 As shown, the inspection rule base includes: a first rule module, which is used for complete matching and stores inspection rules for determining whether a certain configuration or state of a network device completely matches an expected value;
[0101] The second rule module is used for fuzzy matching and stores the checking rules for judging whether a certain configuration or state of the network device fuzzily matches the expected value;
[0102] The third rule module is used for key value matching and stores the checking rules for comparing whether the numerical variables in the network device configuration or status can match the expected values.
[0103] Furthermore, the complete match rule includes a device identifier, a judgement symbol whose value is existence or non-existence, and an expected value of a configuration or status in the form of a string. The device identifier, the judgement symbol and the expected value constitute a complete match check rule.
[0104] The fuzzy matching rule includes a device identifier and an expected value of a configuration or state in a regular expression format. The device identifier and the expected value constitute a fuzzy matching check rule.
[0105] The key value matching rule includes a device identifier, an extraction expression for extracting numerical variables from current configuration and status data, an expected value of the above numerical variable, and an operator for comparing the current value and the expected value of the numerical variable. The operator is equal to, greater than, and less than. The device identifier, variable extraction expression, variable expected value plus the operator constitute a key value matching check rule.
[0106] The working principle of the above technical solution is as follows: the complete matching rule determines whether the rule is satisfied based on the configuration and status text of the device and the rule's predicate and expected value, and if satisfied, the check passes;
[0107] The fuzzy matching rule matches the configuration and status text of the device according to the regular expression. If the match is successful, the check passes.
[0108] The key value matching rule first extracts the matching value from the configuration and status text of the device according to the regular expression, and then determines whether the matching value satisfies the rule according to the operator and expected value of the rule. If so, the check passes.
[0109] The beneficial effects of the above technical solution are:
[0110] 1. It has three rule modules: full match, fuzzy match and key value match, and is compatible with a variety of network devices. This application provides an efficient, reliable and automated solution for the configuration and status check of network devices, significantly improving the quality and efficiency of network system construction and operation and maintenance.
[0111] 2. Each rule has a clear structure and judgment method, so that matching and judgment can be performed quickly during the inspection process. The direct comparison of the complete matching rule, the regular expression matching engine of the fuzzy matching rule, and the numerical calculation and comparison of the key value matching rule can complete the inspection of a large amount of device data in a short time, discover problems in time, reduce network downtime caused by equipment failure or configuration errors, and ensure the continuous and stable operation of the network.
[0112] The automated inspection method and device for network device configuration and status provided by the present invention realizes efficient and accurate inspection of network device configuration and status through an automated method. By constructing a rule base for complete matching, fuzzy matching and key value matching, as well as corresponding equipment information parsing, inspection rule acquisition, configuration and status collection, rule judgment and result output modules, implementation personnel are allowed to quickly identify errors and inconsistencies in network device configuration in an automated manner, thereby improving the efficiency and reliability of network system construction and maintenance. In addition, the design of the device and method of the present invention takes into account network devices of different brands and types, and enhances its applicability by supporting multiple configuration and status collection methods.
[0113] Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include these modifications and variations.
Claims
1. A method for automatically checking the configuration and status of a network device, characterized in that: The following steps are involved: S1, parsing device information; S2, obtaining equipment inspection rules; S3, device configuration and status collection; S4, determine the inspection rules; S5, output the inspection result.
2. The method for automatically checking the configuration and status of network equipment according to claim 1, characterized in that: Parsing the device information includes: obtaining the device identification and device login information by parsing the input device information; The device identification includes: an IP address, a serial number, a group name of a group of network devices with the same configuration or status, or one or more combinations thereof.
3. The method for automatically checking the configuration and status of network equipment according to claim 1, characterized in that: Obtaining device inspection rules includes: matching the device identification obtained by parsing the device information in the configuration and status inspection rule library, obtaining a list of all inspection rules associated with the device, and dividing the inspection rules into three categories: complete match, fuzzy match, and key value match.
4. The method for automatically checking the configuration and status of network equipment according to claim 1, characterized in that: Device configuration and status collection includes: automatically initiating a connection with a network device based on the parsed device login information, identifying the collection methods supported by the network device, and collecting the current configuration and status information of the network device.
5. The method for automatically checking the configuration and status of network equipment according to claim 1, characterized in that: The determination and inspection rules include: traversing each rule by category according to the obtained three-category rule list, inspecting the collected device configuration and status data, and recording the inspection result of each rule.
6. The method for automatically checking the configuration and status of network equipment according to claim 1, characterized in that: Outputting inspection results includes: outputting, displaying and storing each inspection result of the network device for subsequent result review.
7. An automated inspection device for network device configuration and status, characterized in that: include: A first processing unit (201), configured to parse the network device information read from the first storage unit; A first acquisition unit (202), used for acquiring the inspection rule information in the second storage unit; A second acquisition unit (203) is used to automatically identify the acquisition method supported by the device and automatically acquire the configuration and status data of the network device; A second processing unit (204) is used to check the configuration and status data of the network device according to the checking rules; A third processing unit (205), used for processing, displaying and storing the inspection results; A second storage unit (206), used for storing inspection rules of network devices; The first storage unit (207) is used to store information of the network device, the information including the connection address, login information and detection result.
8. The automatic checking device for network device configuration and status according to claim 7, characterized in that: The inspection rule base includes: The first rule module is used for complete matching and stores a check rule for determining whether a certain configuration or state of a network device completely matches an expected value; The second rule module is used for fuzzy matching and stores the checking rules for judging whether a certain configuration or state of the network device fuzzily matches the expected value; The third rule module is used for key value matching and stores the checking rules for comparing whether the numerical variables in the network device configuration or status can match the expected values.