Risk assessment method and device for multiple network devices, electronic device and storage medium
By automatically acquiring and parsing configuration information of multiple models of network equipment, identifying configuration changes and generating risk assessment reports, the problem of low efficiency in configuration information monitoring in power communication networks is solved and the safe operation of the network is ensured.
Patent Information
- Application Number
- CN202410884992.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-03
- Publication Date
- 2024-10-29
AI Technical Summary
In power communication networks, the configuration information formats of multiple models of network equipment are different, making manual monitoring time-consuming, labor-intensive, error-prone, and reducing the efficiency of configuration information risk assessment.
Provides an automated multi-network device risk assessment method that obtains the current configuration information of each type of device, parses and objectsizes it, determines configuration changes, and generates a report based on the risk assessment information to display to users.
It realizes automated and cross-model configuration information monitoring, improves the efficiency of risk assessment, promptly reminds users of potential risks, and ensures the safe operation of the power communication network.
Smart Images

Figure CN118869482A_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present invention relate to the technical field of power communication networks, and in particular to a risk assessment method, device, electronic device, and storage medium for multiple network devices. Background Art
[0002] In the power communication network infrastructure, data communication and processing rely on the collaborative work of numerous network devices such as routers and switches. As the network scale expands and service demand grows, communication operation and maintenance personnel will frequently update the configuration of equipment to adapt to changing business needs. However, in this process, omissions in the issuance of configuration parameters may lead to network risk vulnerabilities. Therefore, regular auditing and analysis of the configuration of network equipment has become a key task to ensure network stability and security.
[0003] The configuration information formats of different network devices are different. Currently, the configuration information of each network device is mostly monitored by manual review. Due to the large number of network devices and different models, this method is time-consuming and labor-intensive, especially prone to errors when the network scale expands and the configuration complexity increases, which reduces the efficiency of risk assessment of configuration information of multiple network devices. Summary of the invention
[0004] The embodiments of the present invention provide a risk assessment method, device, electronic device and storage medium for multi-network devices, which can automatically monitor the configuration information of multi-network devices of different models in real time, improve the efficiency of risk assessment of configuration information of multi-network devices, and ensure the safe operation of power communication networks.
[0005] In a first aspect, an embodiment of the present invention provides a risk assessment method for a multi-network device, comprising:
[0006] Obtaining current configuration information of each model of network equipment at the current moment, and parsing and objectifying the current configuration information of each network equipment to obtain standard configuration information of each network equipment;
[0007] Determining whether a configuration change occurs to each network device based on standard configuration information of each network device and predetermined historical configuration information of each network device;
[0008] When a configuration change occurs to at least one network device, a risk assessment is performed on the at least one network device based on standard configuration information of the at least one network device and pre-set risk assessment information to obtain a risk assessment report;
[0009] The risk assessment report is presented to the user.
[0010] In a second aspect, an embodiment of the present invention provides a risk assessment device for multiple network devices, the device comprising:
[0011] The data conversion module is used to obtain the current configuration information of each type of network device at the current moment, and parse and objectify the current configuration information of each network device to obtain the standard configuration information of each network device;
[0012] An information determination module, configured to determine whether a configuration change occurs to each network device based on standard configuration information of each network device and predetermined historical configuration information of each network device;
[0013] A risk assessment module, configured to, when a configuration change occurs on at least one network device, perform a risk assessment on the at least one network device based on standard configuration information of the at least one network device and pre-set risk assessment information to obtain a risk assessment report;
[0014] The report display module is used to display the risk assessment report to the user.
[0015] In a third aspect, an embodiment of the present invention further provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, a risk assessment method for a multi-network device as described in any one of the embodiments of the present invention is implemented.
[0016] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements a risk assessment method for multiple network devices as described in any one of the embodiments of the present invention.
[0017] In an embodiment of the present invention, the current configuration information of each model of network equipment at the current moment is obtained, and the current configuration information of each network equipment is parsed and objectified to obtain the standard configuration information of each network equipment; based on the standard configuration information of each network equipment and the predetermined historical configuration information of each network equipment, it is determined whether each network equipment has a configuration change; when at least one network equipment has a configuration change, a risk assessment is performed on at least one network equipment based on the standard configuration information of at least one network equipment and the pre-set risk assessment information to obtain a risk assessment result; a risk assessment report is generated based on the risk assessment result, and the risk assessment report is displayed to the user. The method of the embodiment of the present invention can automatically and cross-modelly obtain the configuration information of the network equipment, automatically parse the configuration information of different formats and convert it into a unified structured data, which is convenient for identifying whether each network equipment has a configuration change, and improves the efficiency of configuration information monitoring of multiple network equipment. When there is a risk in the change of the configuration information of the network equipment, the user is reminded in time to ensure the safe operation of the power communication network. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for use in the embodiments are briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present invention and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without creative work.
[0019] Figure 1 A first flow chart of a risk assessment method for multiple network devices provided by an embodiment of the present invention;
[0020] Figure 2 A second flow chart of a risk assessment method for multiple network devices provided by an embodiment of the present invention;
[0021] Figure 3 A schematic diagram of the structure of a risk assessment device for multiple network devices provided by an embodiment of the present invention;
[0022] Figure 4 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0023] The present invention will be further described in detail below in conjunction with the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are only used to explain the present invention, rather than to limit the present invention. It should also be noted that, for ease of description, only parts related to the present invention, rather than all structures, are shown in the accompanying drawings.
[0024] Figure 1This is the first flow chart of a risk assessment method for multi-network devices provided in an embodiment of the present invention. The method in the embodiment of the present invention can automatically monitor the configuration information of multi-network devices of different models in real time, thereby improving the efficiency of risk assessment of configuration information of multi-network devices and ensuring the safe operation of the power communication network. The method can be executed by a risk assessment device for multi-network devices provided in an embodiment of the present invention. The device can be implemented in software and / or hardware. The following embodiments will be described by taking the device integrated in an electronic device as an example. The electronic device can be a server or a computer device, etc. Figure 1 , the method may specifically include the following steps:
[0025] Step 101: Acquire current configuration information of each type of network device at the current moment, and parse and objectify the current configuration information of each network device to obtain standard configuration information of each network device.
[0026] Among them, the model of the network device can be the manufacturer, brand or device number of the network device. The configuration information of the network device is key information to ensure that the network device runs correctly and efficiently in the network. The configuration information of the network device includes but is not limited to interface information, routing information, security settings, and service quality configuration. The configuration information of the network device is not static, and the configuration information of the network device will be updated from time to time. Network devices of different models have different configuration information, and the configuration information of the same network device at different times may also be different. The current configuration information is the configuration information of the network device obtained by the server at the current moment. Specifically, the format of the configuration information in the configuration text of network devices of different models is different. The standard configuration information is the configuration information obtained after the current configuration information of the network device is converted into a unified format.
[0027] In an optional implementation, the server is connected to each network device in communication, and the server can use an automatic data reading tool to obtain the current configuration information of each model of network device in real time. For example, the current configuration information of all network devices is read regularly using a simple network management protocol or a command line interface to ensure that the configuration information of the network devices can be captured in a timely manner. For example, if a network includes routers of brand A and brand B. The configuration of brand A routers starts with "interface GigabitEthernet0 / 0", while the configuration of brand B routers starts with "interface ge-0 / 0 / 0". The server can obtain "interface GigabitEthernet0 / 0" of brand A routers and "interface ge-0 / 0 / 0" of brand B routers through a simple network management protocol or a command line interface.
[0028] After obtaining the current configuration information of each model of network equipment, it is necessary to store the read current configuration information in a predetermined configuration information database so that users can query and analyze the configuration information of each network device at any time. The configuration information database includes the configuration information of each model of network equipment at each time. In this solution, in order to protect the stored configuration information from being read by unauthorized visitors, the configuration information is encrypted before being stored in the configuration information database to prevent the configuration information of the network device from being leaked.
[0029] Furthermore, after obtaining the current configuration information of each network device, the collected current configuration information is analyzed, including identifying the keywords, parameter formats, and grammatical rules of each current configuration information. For example, regular expressions are used to identify interface configurations, routing protocols, and other network parameters in the configuration information. At the same time, the working principle and configuration semantics of the network device are combined to ensure that the parsing strategy can accurately reflect the configuration intent of the configuration information. The configuration information of each network device is read, parsed, and converted according to the parsers corresponding to each network device pre-set in the server, and the parsed configuration information is converted into a unified structured data format, such as XML, YANG, or a custom data format, to obtain the standard configuration information of each network device.
[0030] Step 102: Determine whether a configuration change occurs on each network device based on the standard configuration information of each network device and predetermined historical configuration information of each network device.
[0031] Among them, the historical configuration information of each network device includes the standard configuration information of each network device at each time, and the historical configuration information of each network device can be obtained from the configuration information database. In an optional implementation, after obtaining the standard configuration information of each network device, the corresponding historical configuration information of each network device is searched in the historical matching information. For each network device, the configuration information of the moment closest to the current moment in the historical configuration information of the current network device is compared with the standard configuration information of the current network device. If there is no difference between the two configuration information, it can be determined that the current network device has not undergone a configuration change. If there is a difference between the two configuration information, it can be determined that the current network device has undergone a configuration change. In an optional implementation, the user can further determine whether each network device has undergone a configuration change based on the different performance characteristics of each model of network device. For example, after determining that there is no difference between the above two configuration information, the configuration information of network devices of different models is compared with the standard configuration information of the current network device, and whether the current network device has undergone a configuration change is determined based on the comparison result.
[0032] Step 103: When a configuration change occurs to at least one network device, a risk assessment is performed on the at least one network device based on standard configuration information of the at least one network device and pre-set risk assessment information to obtain a risk assessment report.
[0033] Among them, the risk assessment information includes risk levels and risk events, etc., and the risk events include change information when a network device undergoes a configuration change. Different risk levels correspond to different risk repair strategies, and the risk repair strategies are used to handle risk events. In this solution, optionally, a risk assessment is performed on at least one network device based on the standard configuration information of at least one network device and the pre-set risk assessment information to obtain a risk assessment report, including: determining the risk level corresponding to at least one network device based on the standard configuration information and risk assessment information of at least one network device; determining the repair strategy of the current network device based on the risk level, and generating a risk assessment report based on the risk level and the repair strategy.
[0034] Specifically, the server can identify and evaluate the security threats that may be introduced by the configuration changes of network devices based on the risk assessment information. When a configuration change occurs on a network device, the server determines the configuration change information based on its standard configuration information, and searches for the risk event corresponding to the configuration change information in the risk assessment information. After determining the risk event, the risk level and repair strategy corresponding to the risk event are determined in the risk assessment information. A risk assessment report is generated based on the repair strategy and risk event.
[0035] Exemplarily, the risk assessment information includes a set of risk assessment rules, and the format of each risk assessment rule is: IF (condition) THEN (risk level, repair suggestion). The condition can be a specific attribute value of a configuration item in the configuration information or a combination of multiple attributes. Suppose a configuration change information is to change the adminStatus of the router from shutdown to no shutdown. The risk assessment information contains a rule: "If the adminStatus of the router interface is changed from shutdown to no shutdown, there is a medium risk." The risk assessment information stipulates that the repair strategy for medium risk is: refuse to modify, and generate a warning message to prompt the user. The server can then generate a risk assessment report, which includes: configuration information: change the adminStatus of the router from shutdown to no shutdown, risk level: medium, repair strategy: refuse to modify, please confirm with the user.
[0036] In the above steps, the server can automatically generate a detailed report containing configuration changes and potential risks based on the configuration change information, providing clear guidance for operation and maintenance personnel to resolve risks, so that operation and maintenance personnel can quickly take repair measures or optimize configurations, thereby ensuring the safe operation of the power communication network.
[0037] Step 104: Display the risk assessment report to the user.
[0038] Specifically, after obtaining the risk assessment report, the risk assessment report can be sent to the display screen through the display screen connected to the server, so that the user can view the risk assessment report in time through the display screen. Alternatively, the server can also send the risk assessment report to the user terminal, such as the user's mobile phone, tablet computer and notebook, etc., so that the user can view the risk assessment report at any time and respond to the risk assessment report in time to ensure the safe operation of the power communication network.
[0039] The technical solution of this embodiment obtains the current configuration information of each model of network equipment at the current moment, and parses and objectifies the current configuration information of each network device to obtain the standard configuration information of each network device; determines whether each network device has a configuration change based on the standard configuration information of each network device and the predetermined historical configuration information of each network device; when at least one network device has a configuration change, performs a risk assessment on at least one network device based on the standard configuration information of at least one network device and the pre-set risk assessment information to obtain a risk assessment result; generates a risk assessment report based on the risk assessment result, and displays the risk assessment report to the user. The technical solution of this embodiment can automatically and cross-modelly obtain the configuration information of network devices, automatically parse the configuration information of different formats and convert it into unified structured data, which is convenient for identifying whether each network device has a configuration change, and improves the efficiency of configuration information monitoring of multiple network devices. When there is a risk in the change of the configuration information of the network device, the user is reminded in time to ensure the safe operation of the power communication network.
[0040] Figure 2 The second flow chart of a risk assessment method for multiple network devices provided by an embodiment of the present invention is a refinement of the above embodiment. The specific method can be as follows Figure 2 As shown, the method may include the following steps:
[0041] Step 201: Obtain current configuration information of each model of network equipment at the current moment.
[0042] Step 202: extract key features of the current configuration information of each network device according to a preset regular expression to obtain extracted configuration items.
[0043] Among them, the key feature information is the specific data or settings in the configuration information that represent the status, function and configuration of the network device. Configuration items are specific settings of the network device, including Internet Protocol address (IP) allocation, routing table configuration and security settings. Pre-set regular expressions are used to understand and parse the configuration syntax of each network device. Regular expressions optimize the configuration file format of network devices of different models so that the server can accurately match and extract configuration items. Exemplarily, for the interface configuration of network device model A and network device model B, the following regular expression can be used:
[0044] A:interface(\S+).*? line protocol
[0045] B:interface(\S+);.*? line protocol
[0046] Step 203: Object-oriented conversion is performed on the current configuration information and the extracted configuration items of each network device to obtain standard configuration information of each network device.
[0047] Among them, the standard configuration information is the configuration information obtained after the format conversion of the current configuration information. Specifically, after obtaining the extracted configuration items, the extracted configuration items are converted into corresponding attributes. Each extracted configuration item corresponds to an attribute of an object, that is, the attribute name is the configuration item name, such as the interface name, IP address, etc. The attribute value represents the specific setting of the configuration item, such as "GigabitEthernet0", "192.168.1.1", etc. The object of the current configuration information is determined based on all the attributes, that is, the standard configuration information. Converting the current configuration information and the extracted configuration items into a dynamic object set allows the server to compare the configuration information of different models of network devices for consistency.
[0048] Step 204: Determine the last configuration information of each network device from the historical configuration information of each network device.
[0049] Among them, the last configuration information is the configuration information corresponding to the moment closest to the current moment in the historical configuration information. The historical configuration information includes the configuration snapshot data of the network device. Configuration snapshot data refers to a backup data of the configuration text of the network device at a specific time point. The configuration snapshot data records the configuration status of the network device at that moment, including all the set parameters and commands in the configuration information. Specifically, the configuration snapshot data in the historical configuration information are stored in chronological order. After obtaining the standard configuration information of each network device, the last configuration information of each network device is determined from the historical configuration information of each network device according to the current moment.
[0050] Exemplarily, the historical configuration information of network device A includes configuration snapshot data of network device A: July 1, 2024, configuration snapshot 1. July 2, 2024, configuration snapshot 2. July 5, 2024, configuration snapshot 3. July 7, 2024, configuration snapshot 4. The current time is July 9, 2024, and it is determined that the last configuration information of network device A is configuration snapshot 4.
[0051] Step 205: For each network device, match the standard configuration information of the current network device with the last configuration information of the current network device to obtain a matching result.
[0052] Specifically, after obtaining the last configuration information of the network device, the standard configuration information can be matched with the last configuration information using a pre-set matching algorithm. For example, the longest common subsequence or text similarity algorithm is used. The longest common subsequence algorithm is an algorithm for comparing the similarity of two sequences. It can find the longest common subsequence in two sequences, that is, the longest continuous subsequence that appears in both sequences. By calculating the length of the longest common subsequence between the current configuration text and the most recent configuration snapshot, the degree of difference between them can be evaluated. If the length of the longest common subsequence is less than a certain threshold, it is considered that there is a difference between the two, and the matching result is determined to be a matching failure. If the length of the longest common subsequence is greater than or equal to the threshold, the matching result is determined to be a matching success.
[0053] Step 206: If the matching result is a matching failure, it is determined that a configuration change occurs on the current network device.
[0054] Specifically, if the matching result is a match failure, it can be determined that the character string or sequence length corresponding to the standard configuration information of the device in the current network is different from that of the last configuration information, and it can be determined that the configuration of the current network device has changed. In this solution, after determining that the configuration of the current network device has changed, it also includes: sorting the standard configuration information of the current network device according to the matching result to obtain the configuration change data of the current network device; and updating the predetermined historical configuration information of the current network device based on the configuration change data.
[0055] Specifically, after determining that a configuration change has occurred in a network device, the standard configuration information of the network device at the current moment is organized and organized into a configuration snapshot format and stored in the configuration snapshot data in the historical configuration information, so as to timely update the historical configuration information. Exemplary, a network device has the following configuration changes within a week: Monday: a new routing protocol configuration was added. Wednesday: the IP address of an interface was modified. Friday: a new security policy was enabled. The configuration snapshot data corresponding to the network device then includes: Monday: configuration snapshot 1, timestamp T1. Wednesday: configuration snapshot 2, timestamp T2. Friday: configuration snapshot 3, timestamp T3. When it is detected that the standard configuration information of the network device is different from the most recent configuration snapshot data, it is determined that a configuration change has occurred in the current network device.
[0056] By updating the configuration snapshot of network devices, the configuration changes of network devices can be monitored in real time, which helps to timely discover potential security vulnerabilities, configuration errors or other problems, so that appropriate measures can be taken in time to repair or optimize them.
[0057] Step 207: If the matching result is a successful match, determine whether the configuration of the current network device has been changed based on a predetermined comparison rule of the current network device and standard configuration information of the current network device.
[0058] Among them, the comparison rules are pre-set by the user according to the different performance characteristics and actual operating environment of each model of network equipment, and are used to further determine whether the network device has a configuration change. Specifically, after using the longest common subsequence and other matching algorithms to match the standard configuration information of the current network device with the last configuration information of the current network device, if the matching result is a successful match, it means that the network device may not have a configuration change (a successful match can only mean that the sequence length of the standard configuration information is the same as that of the last configuration information). Therefore, in order to ensure the safe operation of the communication network, it is necessary to further determine whether the network device has a configuration change. In this scheme, optionally, determining whether the current network device has a configuration change based on the predetermined comparison rules of the current network device and the standard configuration information of the current network device includes the following steps A1-A3:
[0059] Step A1: Determine the hierarchical structure of the standard configuration information of the current network device, and establish a standard object tree of the standard configuration information according to the hierarchical structure and configuration items of the standard configuration information.
[0060] The hierarchical structure of configuration information refers to the form in which configuration items in network devices are organized according to a certain hierarchical relationship. In this solution, the hierarchical structure of standard configuration information of network devices is regarded as a tree structure (standard object tree), which includes root nodes, intermediate nodes and leaf nodes, and each node represents a specific part or parameter in the standard configuration information. The root node represents the device itself, including the device model, etc. The intermediate nodes include interfaces, routing protocols, and security settings, etc. The leaf nodes represent specific configuration items or parameters, such as IP addresses, VLAN numbers, and passwords.
[0061] Step A2: Determine the comparison configuration information of the current network device according to the historical configuration information of each network device and the comparison rule of the current network device, and obtain the comparison object tree of the comparison configuration information.
[0062] Among them, one network device corresponds to one comparison rule. According to the comparison rule of the network device, the comparison object of the network device can be determined. The comparison object of a network device can be other network devices or the configuration information of its own network device at other times. For example, according to the comparison rule of network device A, it is determined that the comparison object of the standard configuration information of network device A is the standard configuration information of network device B and the last configuration information of network device A. Then, an object tree is constructed based on the standard configuration information of network device B as a comparison object tree of network device A. An object tree is constructed based on the last configuration information of network device A as a comparison object tree of network device A.
[0063] Step A3: Determine the comparison node based on the standard object tree, the comparison object tree and the comparison rule, compare the comparison node of the standard object tree and the comparison node of the comparison object tree in turn, and obtain the comparison result of each comparison node; determine whether the configuration of the current network device has changed according to the comparison result of each comparison node.
[0064] Among them, the comparison nodes include root nodes, intermediate nodes and leaf nodes. Specifically, after obtaining the standard object tree and the comparison object tree, the nodes to be compared are determined according to the comparison rules. For example, the standard object tree of network device A only has routing nodes (there is no routing configuration information in the standard configuration information), and according to the comparison rules of network device A, the comparison object of A is determined to be network device B (the object tree corresponding to network device B must have routing nodes).
[0065] According to the order from the root node to the intermediate node and then to the leaf node, the comparison nodes of the standard object tree and the comparison object tree are compared in turn according to the comparison rules, and the comparison results of each comparison node are obtained. For example, if the comparison object of network device A is network device B, the root nodes of the standard object tree of A and the comparison object tree of B are compared first. If their root nodes are the same, the comparison is stopped. If their root nodes are different, the intermediate nodes and leaf nodes are continued to be compared. If the comparison results of the intermediate nodes or leaf nodes are different, it is determined that the configuration of network device A has changed. Exemplarily, the standard object tree of A is tree A, and the comparison object tree of B is tree B. The comparison starts from the root nodes of tree A and tree B. The two root nodes represent different models of network devices. Both tree A and tree B have an interface node and a routing node. Compare their interface nodes: GigabitEthernet0: exists in both trees and has the same configuration, so there is no need to record the difference. GigabitEthernet1 vs. GigabitEthernet2: The IP addresses of these two interfaces are different, and there is an additional interface GigabitEthernet2 in the B-tree, so the comparison result of this comparison node is determined to be different. Compare its routing nodes: ospf configuration: The router-id (route id) in the ospf configuration of the two trees is different, so the comparison result of this comparison node is determined to be different.
[0066] In the above steps, by establishing a standard object tree and a comparison object tree, the configuration change information of the network device can be accurately detected and located, thereby improving the accuracy of determining whether the configuration of the network device has been changed.
[0067] Step 208: When a configuration change occurs to at least one network device, a risk assessment is performed on the at least one network device based on the standard configuration information of the at least one network device and the preset risk assessment information to obtain a risk assessment report.
[0068] Step 209: Display the risk assessment report to the user.
[0069] In the technical solution of this embodiment, the current configuration information of each model of network equipment at the current moment is obtained. The key features of the current configuration information of each network device are extracted according to a pre-set regular expression to obtain the extracted configuration items. The current configuration information of each network device and the extracted configuration items are object-converted to obtain the standard configuration information of each network device. The last configuration information of each network device is determined in the historical configuration information of each network device; wherein the last configuration information is the configuration information corresponding to the moment closest to the current moment in the historical configuration information. For each network device, the standard configuration information of the current network device is matched with the last configuration information of the current network device to obtain a matching result. If the matching result is a matching failure, it is determined that the current network device has a configuration change. If the matching result is a matching success, it is determined whether the current network device has a configuration change based on the pre-determined comparison rule of the current network device and the standard configuration information of the current network device. When at least one network device has a configuration change, a risk assessment is performed on the at least one network device based on the standard configuration information of the at least one network device and the pre-set risk assessment information to obtain a risk assessment result. A risk assessment report is generated based on the risk assessment result, and the risk assessment report is displayed to the user. The solution of this embodiment realizes the consistency comparison and management of cross-model network device configuration information. By recording configuration snapshots in time series, real-time monitoring and historical comparative analysis of the configuration information of network devices are realized. By comparing the configuration object tree and the comparison object tree, configuration change information can be accurately detected and located. The efficiency of configuration information monitoring of multiple network devices is improved. When there is a risk in the change of the configuration information of the network device, the user is reminded in time to ensure the safe operation of the power communication network.
[0070] Figure 3 The structure diagram of the risk assessment device for multiple network devices provided by the embodiment of the present invention is suitable for executing the risk assessment method for multiple network devices provided by the embodiment of the present invention. Figure 3 As shown, the device may specifically include:
[0071] The data conversion module 301 is used to obtain the current configuration information of each type of network device at the current moment, and parse and objectify the current configuration information of each network device to obtain the standard configuration information of each network device;
[0072] An information determination module 302, configured to determine whether a configuration change occurs to each network device based on standard configuration information of each network device and predetermined historical configuration information of each network device;
[0073] The risk assessment module 303 is used to perform risk assessment on the at least one network device based on the standard configuration information of the at least one network device and the preset risk assessment information when a configuration change occurs on the at least one network device, and obtain a risk assessment report;
[0074] The report display module 304 is used to display the risk assessment report to the user.
[0075] Optionally, the data conversion module 301 is specifically used to: extract key features of the current configuration information of each network device according to a preset regular expression to obtain extracted configuration items;
[0076] The current configuration information of each network device and the extracted configuration items are object-oriented converted to obtain standard configuration information of each network device.
[0077] Optionally, the information determination module 302 is specifically used to: determine the last configuration information of each network device from the historical configuration information of each network device; wherein the last configuration information is the configuration information corresponding to the time closest to the current time in the historical configuration information;
[0078] For each network device, matching the standard configuration information of the current network device with the last configuration information of the current network device to obtain a matching result;
[0079] If the matching result is a match failure, it is determined that a configuration change has occurred in the current network device; if the matching result is a match success, it is determined whether a configuration change has occurred in the current network device based on a predetermined comparison rule of the current network device and standard configuration information of the current network device.
[0080] Optionally, the information determination module 302 is further used to: sort the standard configuration information of the current network device according to the matching result to obtain the configuration change data of the current network device;
[0081] The predetermined historical configuration information of the current network device is updated based on the configuration change data.
[0082] Optionally, the information determination module 302 is further used to: determine the hierarchical structure of the standard configuration information of the current network device, and establish a standard object tree of the standard configuration information according to the hierarchical structure and the configuration items of the standard configuration information;
[0083] Determine the comparison configuration information of the current network device according to the historical configuration information of each network device and the comparison rule of the current network device, and obtain a comparison object tree of the comparison configuration information;
[0084] The standard object tree is compared with the comparison object tree, and based on the comparison result, it is determined whether a configuration change occurs in the current network device.
[0085] Optionally, the information determination module 302 is further used to: determine a comparison node based on the standard object tree, the comparison object tree and the comparison rule;
[0086] Comparing the comparison nodes of the standard object tree and the comparison nodes of the comparison object tree in sequence to obtain comparison results of the comparison nodes;
[0087] It is determined that a configuration change occurs on the current network device according to the comparison results of each comparison node.
[0088] Optionally, the risk assessment module 303 is specifically configured to: determine a risk level corresponding to the at least one network device based on the standard configuration information of the at least one network device and the risk assessment information;
[0089] A repair strategy for the current network device is determined based on the risk level, and the risk assessment report is generated based on the risk level and the repair strategy.
[0090] The multi-network device risk assessment device provided in the embodiment of the present invention can execute the multi-network device risk assessment method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method. The contents not described in detail in this embodiment can refer to the description in any method embodiment of the present invention.
[0091] Figure 4 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention, referring to Figure 4 , Figure 4 The electronic device 12 shown is only an example and should not limit the functions and scope of use of the embodiments of the present application. Figure 4 As shown, the electronic device 12 is in the form of a general purpose computing device. The components of the electronic device 12 may include, but are not limited to: one or more processors or processing units 16, a system memory 28, and a bus 18 that connects various system components (including the system memory 28 and the processing unit 16).
[0092] Bus 18 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processor or a local bus using any of a variety of bus architectures. By way of example, these architectures include, but are not limited to, an Industry Standard Architecture (ISA) bus, a Micro Channel Architecture (MAC) bus, an Enhanced ISA bus, a Video Electronics Standards Association (VESA) local bus, and a Peripheral Component Interconnect (PCI) bus.
[0093] The electronic device 12 typically includes a variety of computer system readable media. These media can be any available media that can be accessed by the electronic device 12, including volatile and non-volatile media, removable and non-removable media.
[0094] The system memory 28 may include computer system readable media in the form of volatile memory, such as random access memory (RAM) 30 and / or cache memory 32. The electronic device 12 may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, the storage system 34 may be used to read and write non-removable, non-volatile magnetic media ( Figure 4 not shown, usually called a "hard drive"). Although Figure 4 Not shown, a disk drive for reading and writing to a removable non-volatile disk (e.g., a "floppy disk"), and an optical drive for reading and writing to a removable non-volatile optical disk (e.g., a CD-ROM, a DVD-ROM, or other optical medium) may be provided. In these cases, each drive may be connected to the bus 18 via one or more data medium interfaces. The memory 28 may include at least one program product having a set (e.g., at least one) of program modules that are configured to perform the functions of the various embodiments of the present application.
[0095] A program / utility 40 having a set (at least one) of program modules 42 may be stored, for example, in the memory 28, such program modules 42 including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment. The program modules 42 generally perform the functions and / or methods of the embodiments described herein.
[0096] The electronic device 12 may also communicate with one or more external devices 14 (e.g., keyboards, pointing devices, displays 24, etc.), may communicate with one or more devices that enable a user to interact with the electronic device 12, and / or may communicate with any device that enables the electronic device 12 to communicate with one or more other computing devices (e.g., a network card, a modem, etc.). Such communication may be performed via an input / output (I / O) interface 22. Furthermore, the electronic device 12 may also communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) via a network adapter 20. As shown, the network adapter 20 communicates with other modules of the electronic device 12 via the bus 18. It should be understood that although Figure 4Not shown, other hardware and / or software modules may be used in conjunction with the electronic device 12, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0097] The processing unit 16 executes various functional applications and data processing by running the program stored in the system memory 28, for example, implementing a risk assessment method for multiple network devices provided in an embodiment of the present invention: obtaining current configuration information of network devices of various models at the current moment, and parsing and objectifying the current configuration information of each network device to obtain standard configuration information of each network device; determining whether configuration changes occur in each network device based on the standard configuration information of each network device and predetermined historical configuration information of each network device; when configuration changes occur in at least one network device, performing risk assessment on the at least one network device based on the standard configuration information of the at least one network device and pre-set risk assessment information to obtain a risk assessment report; and displaying the risk assessment report to a user.
[0098] The embodiment of the present invention provides a computer-readable storage medium, on which a computer program is stored. When the program is executed by a processor, a risk assessment method for multiple network devices provided by all the embodiments of the present invention is implemented: obtaining the current configuration information of each model of network devices at the current moment, and parsing and objectifying the current configuration information of each network device to obtain the standard configuration information of each network device; determining whether the configuration of each network device has changed based on the standard configuration information of each network device and the predetermined historical configuration information of each network device; when at least one network device has a configuration change, risk assessment is performed on the at least one network device based on the standard configuration information of the at least one network device and the preset risk assessment information to obtain a risk assessment report; and the risk assessment report is displayed to the user. The computer-readable medium may be a computer-readable signal medium or a computer-readable storage medium. The computer-readable storage medium may be, for example, but not limited to, an electronic device, device or device of electrical, magnetic, optical, electromagnetic, infrared, or semiconductor, or any combination thereof. More specific examples of computer-readable storage media (a non-exhaustive list) include: an electrical connection with one or more conductors, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this document, a computer-readable storage medium can be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction-executing electronic device, apparatus, or device.
[0099] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, which carry computer-readable program code. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction-executing electronic device, apparatus, or device.
[0100] The program code embodied on the computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
[0101] Computer program code for performing the operations of the present invention 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).
[0102] Note that the above are only preferred embodiments of the present invention and the technical principles used. Those skilled in the art will understand that the present invention is not limited to the specific embodiments herein, and that various obvious changes, readjustments and substitutions can be made by those skilled in the art without departing from the scope of protection of the present invention. Therefore, although the present invention has been described in more detail through the above embodiments, the present invention is not limited to the above embodiments, and may include more other equivalent embodiments without departing from the concept of the present invention, and the scope of the present invention is determined by the scope of the appended claims.
Claims
1. A risk assessment method for multiple network devices, characterized in that: The method comprises: Obtaining current configuration information of each model of network equipment at the current moment, and parsing and objectifying the current configuration information of each network equipment to obtain standard configuration information of each network equipment; Determining whether a configuration change occurs to each network device based on standard configuration information of each network device and predetermined historical configuration information of each network device; When a configuration change occurs to at least one network device, a risk assessment is performed on the at least one network device based on standard configuration information of the at least one network device and pre-set risk assessment information to obtain a risk assessment report; The risk assessment report is presented to the user.
2. The method according to claim 1, characterized in that: The current configuration information of each network device is parsed and objectified to obtain standard configuration information of each network device, including: Extract key features of the current configuration information of each network device according to a preset regular expression to obtain extracted configuration items; The current configuration information of each network device and the extracted configuration items are object-oriented converted to obtain standard configuration information of each network device.
3. The method according to claim 1, characterized in that Determining whether a configuration change occurs on each network device based on the standard configuration information of each network device and predetermined historical configuration information of each network device includes: Determining the last configuration information of each network device from the historical configuration information of each network device; wherein the last configuration information is the configuration information corresponding to the time closest to the current time in the historical configuration information; For each network device, matching the standard configuration information of the current network device with the last configuration information of the current network device to obtain a matching result; If the matching result is a match failure, it is determined that a configuration change has occurred in the current network device; if the matching result is a match success, it is determined whether a configuration change has occurred in the current network device based on a predetermined comparison rule of the current network device and standard configuration information of the current network device.
4. The method according to claim 3, characterized in that If the matching result is a matching failure, after determining that a configuration change occurs on the current network device, the method further includes: Arrange data of the standard configuration information of the current network device according to the matching result to obtain configuration change data of the current network device; The predetermined historical configuration information of the current network device is updated based on the configuration change data.
5. The method according to claim 3, characterized in that: Determining whether a configuration change occurs on the current network device based on a predetermined comparison rule of the current network device and standard configuration information of the current network device includes: Determine the hierarchical structure of the standard configuration information of the current network device, and establish a standard object tree of the standard configuration information according to the hierarchical structure and configuration items of the standard configuration information; Determine the comparison configuration information of the current network device according to the historical configuration information of each network device and the comparison rule of the current network device, and obtain a comparison object tree of the comparison configuration information; The standard object tree is compared with the comparison object tree, and based on the comparison result, it is determined whether a configuration change occurs in the current network device.
6. The method according to claim 5, characterized in that Comparing the standard object tree with the comparison object tree, and determining whether a configuration change occurs on the current network device based on the comparison result, includes: Determine a comparison node based on the standard object tree, the comparison object tree and the comparison rule; Comparing the comparison nodes of the standard object tree and the comparison nodes of the comparison object tree in sequence to obtain comparison results of the comparison nodes; It is determined that a configuration change occurs on the current network device according to the comparison results of each comparison node.
7. The method according to claim 1, characterized in that Performing a risk assessment on the at least one network device based on the standard configuration information of the at least one network device and the preset risk assessment information to obtain a risk assessment report includes: Determining a risk level corresponding to the at least one network device based on the standard configuration information of the at least one network device and the risk assessment information; A repair strategy for the current network device is determined based on the risk level, and the risk assessment report is generated based on the risk level and the repair strategy.
8. A risk assessment device for multiple network devices, characterized in that: include: The data conversion module is used to obtain the current configuration information of each type of network device at the current moment, and parse and objectify the current configuration information of each network device to obtain the standard configuration information of each network device; An information determination module, configured to determine whether a configuration change occurs to each network device based on standard configuration information of each network device and predetermined historical configuration information of each network device; A risk assessment module, configured to, when a configuration change occurs on at least one network device, perform a risk assessment on the at least one network device based on standard configuration information of the at least one network device and pre-set risk assessment information to obtain a risk assessment report; The report display module is used to display the risk assessment report to the user.
9. An electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, a risk assessment method for multi-network devices as described in any one of claims 1 to 7 is implemented.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, a risk assessment method for multi-network devices as described in any one of claims 1 to 7 is implemented.
Citation Information
Cited By
Network equipment detection method and device and electronic equipment
CN119484374A
Communication equipment configuration inspection method, device and equipment in power distribution network
CN120547061A
