Knowledge graph construction method and device, inspection method, and storage medium

By constructing a network equipment inspection method based on knowledge graph, the universality and efficiency problems of configuration inspection in the existing technology are solved, efficient and accurate configuration error identification is achieved, and the stability and service quality of network equipment are improved.

CN114153980BActive Publication Date: 2025-10-10ZTE CORP
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202010930320.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-09-07
Publication Date
2025-10-10
Estimated Expiration
2040-09-07

AI Technical Summary

Technical Problem

Existing network device configuration checking methods lack versatility and flexibility, resulting in undetected configuration errors, affecting service quality and network stability, and resulting in low inspection efficiency.

Method used

A knowledge graph-based network equipment inspection method is constructed. By obtaining configuration data for preprocessing and classification, configuration scenario data sets are extracted, entity relationships are established, and a knowledge graph is constructed to achieve hierarchical extraction and retrieval of configuration commands, thereby improving inspection accuracy and efficiency.

Benefits of technology

It improves the accuracy and efficiency of network device configuration checks, can quickly identify configuration errors, reduce manpower and time costs, has versatility and flexibility, and the inspection results are highly interpretable.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114153980B_ABST
    Figure CN114153980B_ABST
Patent Text Reader

Abstract

The embodiment of the present disclosure provides a knowledge graph construction method and device, a checking method and a storage medium, and belongs to the technical field of artificial intelligence. The knowledge graph construction method of the network device comprises the following steps: obtaining configuration data of the network device; preprocessing the configuration data to obtain a device classification data set; classifying configuration scenes according to the device classification data set, and performing knowledge extraction on the classified configuration scenes to obtain a configuration scene data set; extracting entity relationships of the configuration scene data set according to device types and device roles, and constructing a knowledge graph according to the entity relationships. The knowledge graph provided by the embodiment is accurate, and the accuracy of the checking of the configuration of the network device can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of artificial intelligence, and in particular to a knowledge graph construction method and device, a checking method and device, and a storage medium. BACKGROUND

[0002] In the process of putting online and service starting of network devices, various configuration commands need to be issued to the devices, including basic configurations (such as user information), port configurations (such as physical ports, vlan ports, etc.), protocol configurations (such as IBGP, OSPF, etc.), and various service configurations (such as tunnels, pseudo-wires, l2vpn, l3vpn, etc.). Some of these configuration commands need to be completed manually, and errors may occur in the process of setting configurations due to certain reasons (such as the technical level of service personnel, operation standardization, etc.). Network devices themselves provide a certain configuration checking mechanism, which can detect some obvious error configurations, but some error configurations cannot be detected and are issued to the devices.

[0003] In addition, due to the large variety and large quantity of current network devices, and the various customer services, it takes a lot of manpower and time to complete the correctness detection of the configurations of all devices. The commonly used configuration checking means at present is mainly a kind of detection rule-based inspection system, which lacks universality and flexibility, and is limited to a certain region or a certain operator network inspection tool, thereby leading to inapplicability on other regions or other operator networks, and new devices and new services also need to redevelop the inspection system. In addition, whether the inspection results of the inspection tool are accurate almost completely depends on the operation and maintenance experience, and unknown configuration errors are likely to be missed.

[0004] Configuration errors in devices may affect service quality and user experience, may cause service interruption under certain conditions, and may even threaten the stable operation of the network. Therefore, it is necessary to provide a configuration checking method to find configuration errors and correct them in time to eliminate potential risks. SUMMARY

[0005] The main purpose of the embodiments of the present disclosure is to propose a network device knowledge graph construction method and device, a network device checking method and device based on the knowledge graph, an electronic device, and a storage medium, to improve the accuracy of the knowledge graph and the checking efficiency of the configurations of the network device.

[0006] To achieve the above purpose, the network device knowledge graph construction method proposed by the embodiments of the present disclosure comprises:

[0007] obtaining configuration data of a network device;

[0008] preprocessing the configuration data to obtain a device classification data set;

[0009] Classifying configuration scenarios according to the device classification data set, and extracting knowledge from the classified configuration scenarios to obtain a configuration scenario data set;

[0010] Entity relationships of the configuration scenario dataset are extracted according to device type and device role, and a knowledge graph is constructed based on the entity relationships.

[0011] To achieve the above objectives, the present disclosure further proposes a method for inspecting network devices based on a knowledge graph, including:

[0012] Extract the configuration scripts of the network devices to be checked in layers;

[0013] Establish a configuration command mapping relationship based on the extracted configuration script to be checked to obtain a configuration command segment;

[0014] Search the configuration command segment in the knowledge graph to obtain search results;

[0015] Checking the network device according to the search result;

[0016] Among them, the knowledge graph is constructed according to the knowledge graph construction method of the network device described above.

[0017] To achieve the above objectives, the present disclosure further provides a device for constructing a knowledge graph of a network device, comprising:

[0018] Configuration acquisition module, used to obtain configuration data of network devices;

[0019] A preprocessing module, configured to preprocess the configuration data to obtain a device classification data set;

[0020] Classifying configuration scenarios according to the device classification data set, and extracting knowledge from the classified configuration scenarios to obtain a configuration scenario data set;

[0021] The knowledge graph construction module is used to extract the entity relationships of the configuration scenario dataset according to the device type and device role, and construct a knowledge graph based on the entity relationships.

[0022] To achieve the above objectives, the present disclosure further provides a knowledge graph-based network device inspection device, which can implement the above-mentioned knowledge graph-based network device inspection method. The device includes:

[0023] A layered extraction module is used to extract the configuration scripts of the network devices to be checked in layers;

[0024] A mapping module is used to establish a configuration command mapping relationship based on the extracted configuration script to be checked, and obtain a configuration command segment;

[0025] The retrieval module is used to search the configuration command segment in the knowledge graph to obtain the retrieval results;

[0026] An inspection module, used to inspect network devices based on the search results;

[0027] Among them, the knowledge graph is constructed by the above-mentioned knowledge graph construction method of network devices.

[0028] To achieve the above objectives, the present disclosure further provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are used to enable a computer to execute:

[0029] The method for constructing the knowledge graph of the above-mentioned network devices;

[0030] or,

[0031] The above-mentioned knowledge graph-based network device inspection method.

[0032] The embodiments of the present disclosure propose a method and apparatus for constructing a knowledge graph for network equipment, a method and apparatus for inspecting network equipment based on a knowledge graph, and a computer-readable storage medium. By acquiring configuration data of the network equipment, preprocessing the configuration data, and obtaining a device classification data set, configuration scenarios are classified according to the device classification data set, and knowledge is extracted from the classified configuration scenarios to obtain a configuration scenario data set. Entity relationships of the configuration scenario data set are extracted according to device types and device roles to construct a knowledge graph based on the entity relationships. The knowledge of the constructed knowledge graph is accurate, which can improve the accuracy and efficiency of inspection of the configuration of the network equipment. BRIEF DESCRIPTION OF THE DRAWINGS

[0033] Figure 1 is a schematic diagram of a triple.

[0034] Figure 2 It is a schematic diagram of an application scenario of the knowledge graph-based network device inspection method provided in an embodiment of the present disclosure.

[0035] Figure 3 This is another application scenario diagram of the knowledge graph-based network device inspection method provided in an embodiment of the present disclosure.

[0036] Figure 4 It is a flowchart of the knowledge graph construction method of the network device provided by the embodiment of the present disclosure.

[0037] Figure 5 yes Figure 4Flowchart of step 202 in FIG.

[0038] Figure 6 yes Figure 4 Schematic diagram of the application scenario of step 202 in FIG.

[0039] Figure 7 yes Figure 4 Schematic diagram of the application scenario of step 203 in FIG.

[0040] Figure 8 yes Figure 4 Schematic diagram of another application scenario of step 203 in FIG.

[0041] Figure 9 This is a mapping relationship diagram of the configuration commands provided in the embodiment of the present disclosure.

[0042] Figure 10 It is a flowchart of the knowledge graph-based network device inspection method provided by an embodiment of the present disclosure. DETAILED DESCRIPTION

[0043] In order to make the purpose, technical solutions and advantages of the present invention more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not intended to limit the present application.

[0044] It should be noted that although the device schematics illustrate functional module divisions and the flowcharts illustrate logical sequences, in certain circumstances, the steps shown or described may be performed in a sequence that differs from the module divisions in the device or the sequence in the flowcharts. The terms "first," "second," and so on, in the specification, claims, and drawings, are used to distinguish similar items and are not necessarily used to describe a specific sequence or precedence.

[0045] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those skilled in the art to which the present invention pertains. The terms used herein are for the purpose of describing embodiments of the present invention only and are not intended to limit the present invention.

[0046] First, let’s analyze some of the terms used in this application:

[0047] Knowledge Graph: describes the concepts, entities, and relationships of the objective world in a structured form, making it easier for computers to better manage, calculate, and understand the vast amount of information on the Internet. Typically, structured knowledge is represented in the form of a graph. A knowledge graph is essentially a large semantic network that aims to describe concepts, entities, events, and the relationships between them in the objective world. With entities as nodes and relationships as edges, it provides a way to view the world from a relational perspective. Currently, the combination of knowledge graphs and machine learning is a hot topic in the development of artificial intelligence and is widely used in processes such as search, recommendation, question-answering, explanation, and decision-making. The construction of a knowledge graph mainly includes: knowledge acquisition, knowledge extraction, knowledge fusion, knowledge storage, knowledge modeling, and knowledge reasoning.

[0048] An entity is a distinct, independent entity, such as a person or a product. Everything in the world is composed of specific things, and these specific things are called entities. Entities are the most basic elements in a knowledge graph. Different entities have different relationships with each other.

[0049] Property: It is the attribute value pointed to from an entity. The attribute value mainly refers to the attribute specified by the object. Different attributes can be defined in the entity, or the attribute can be defined as an entity. Different attributes are connected through different edges.

[0050] Relation: It is used to express the abstract connection between entities. This abstract connection is also called the edge between entities in the knowledge graph.

[0051] Triple: See Figure 1 There are two main forms of triples: the first is "entity-relationship-entity"; the second is "entity-attribute-attribute value", where triples are used to construct information into a graph path. The triple structure path associates different entities, thus representing them in a more intuitive way, making it easier for people to understand the relationships between different entities and providing interpretability. The embodiments of this disclosure are described using the second form of representation.

[0052] Network management system: used to manage and maintain base station equipment. It can be used to manage network equipment, such as managing the operating status of network equipment, including real-time monitoring of the operating status of network equipment.

[0053] Existing network devices: refers to the network devices that are currently running.

[0054] Network equipment management platform: refers to the platform used to manage user manuals, including SOP (Standard Operation Procedure) documents.

[0055] The solution provided by the embodiments of the present disclosure involves a method and device for constructing a knowledge graph of a network device, a method and device for inspecting a network device based on a knowledge graph, an electronic device, and a storage medium. It is specifically illustrated through the following embodiments. First, the method for constructing a knowledge graph of a network device in the embodiments of the present disclosure is described.

[0056] The knowledge graph construction method for network devices provided by the embodiments of the present disclosure can be used on network devices with the following functions: the network device has the function of issuing configurable attribute commands; the configuration commands have a relatively fixed grammatical structure or fixed rules; configuration data can be easily obtained from the network device, and the configuration data can be exported in batches as text files with a certain format or grammatical structure; the network management system or SDN controller of the network can obtain the device type and role of the device, and can batch export configuration files of the corresponding device type.

[0057] The method for constructing a knowledge graph for a network device provided in the embodiments of the present disclosure can be applied to a terminal or a server, and can also be software running on a terminal or a server. In some embodiments, the terminal can be a smartphone, tablet computer, laptop computer, desktop computer, or smartwatch, etc.; the server can be configured as an independent physical server, or as a server cluster or distributed system composed of multiple physical servers, or as a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms; the software can be a method for constructing a knowledge graph for a network device, etc., but is not limited to the above forms.

[0058] Figures 2-3: is a schematic diagram of an application scenario of an embodiment of the present disclosure. The network device of the embodiment of the present disclosure includes: a configuration anomaly detection module 101 and a network management system or / SDN (Software Defined Network) controller 102. It should be noted that in actual applications, the configuration data related to the device can be obtained through the network management system or / SDN controller 102 as needed. The embodiment of the present disclosure does not limit how to obtain the configuration data related to the device. The configuration data related to the device can be obtained through the network management system or through the SDN controller; the configuration data includes the device type or device role, so that the corresponding configuration knowledge graph can be found more accurately, and then the configuration script can be checked.

[0059] In some embodiments, the architecture of the network device can be in two forms, such as Figure 2 The architecture shown is a first architecture form of a network device, and the configuration anomaly detection module 101 can be independently set up with the network management system or / SDN controller 102; Figure 3 The architecture shown is the second architecture form of the network device, and the configuration anomaly detection module 101 can be built into the network management system or / SDN controller 102. The network management system or SDN controller 102 performs network communication with the bearer network.

[0060] Figure 4 This is an optional flowchart of the method for constructing a knowledge graph of a network device provided in an embodiment of the present application. Figure 4 The method includes steps 201 to 204.

[0061] Step 201: Obtain configuration data of a network device;

[0062] Step 202: pre-process the configuration data to obtain a device classification data set;

[0063] Step 203: Classify the configuration scenarios according to the device classification data set, and extract knowledge from the classified configuration scenarios to obtain a configuration scenario data set;

[0064] Step 204: Extract entity relationships of the configuration scenario dataset based on device type and device role, and construct a knowledge graph based on the entity relationships.

[0065] In some embodiments, in order to collect configuration data of various device types, step 201 includes: obtaining configuration data of a specified network device from an existing network device. The existing network device refers to a network device that is currently running, the specified network device refers to a network device with a specific device type, and the configuration data is a configuration script of the network device; the configuration data includes configuration commands; the configuration data is presented in the form of text, and the configuration data in the form of text has a fixed syntax or has clear rules; the configuration data can reflect the corresponding device type or device role, so as to be used to distinguish it from other device types or other device roles. The device type is the specific model of the device, and a network device of a specific device type refers to a network device with a specific model; different device types have different device roles in the network, such as access layer devices, aggregation layer devices, core layer devices, etc.; generally, devices of different device types have different configurations, that is, they have different configuration data, and the same device also has different configurations when it appears as different device roles.

[0066] In practical applications, information reflecting the device type or device role can be clearly described in the configuration data, or can be collected through a network management system or SDN controller. It should be noted that the configuration data related to the device can be collected through the network management system or SDN controller as needed. The embodiments of this disclosure do not limit how the configuration data related to the device is collected. The configuration data related to the device can be obtained through the network management system or the SDN controller.

[0067] In the disclosed embodiments, the network management system or SDN controller of a network device is used to obtain configuration data related to the device. The configuration data includes the device type or device role, so that the corresponding configuration knowledge graph can be accurately found, and the configuration script can be tested. The device type is the specific model of the device. Different device types play different roles in the network, such as access layer devices, aggregation layer devices, and core layer devices. Generally, devices of different device types have different configurations, that is, they have different configuration data, and the same device also has different configurations when it appears in different device roles.

[0068] In step 202, since the configuration data includes configuration commands, the obtained sample data set of the device classification includes a plurality of configuration commands.

[0069] In some embodiments, the preprocessing of configuration data in step 202 includes standardization of configuration commands and cleaning of configuration commands. In step 202, the configuration script obtained from the network device is used as analysis data. Since different configuration commands may have different configuration parameters in different scenarios, but the command functions they have are the same, these configuration commands with the same command functions but different parameters can be preprocessed. In step 202, a standard configuration manual is obtained from the network device management platform, and a large number of standard configuration commands are extracted from the standard configuration manual. A command parser is constructed using these standard configuration commands to standardize the configuration commands in the configuration script through the command parser. In this way, configuration commands with multiple different parameters can be represented by the same standard command, which facilitates the knowledge extraction (step 203), knowledge graph modeling (step 204), knowledge graph storage and subsequent detection of network device configuration anomalies in the subsequent steps.

[0070] In order to obtain more accurate configuration commands and make the obtained data more accurate, in the embodiment of the present disclosure, configuration commands are extracted from a large number of configuration files through a data mining algorithm.

[0071] See also Figure 5 In some embodiments, step 202 includes:

[0072] Step 2021: Classify the configuration data to obtain a sample data set of device classification;

[0073] Step 2022: extract standard configuration commands from the standard configuration command manual;

[0074] Step 2023: Obtain a device classification data set based on the similarity between the configuration commands of the sample data set and the standard configuration commands.

[0075] In step 2021 of one embodiment, the configuration data can be classified according to the device type to obtain a sample data set S0 of device classification; in other embodiments, the configuration data can also be classified by other means, which are not limited by the embodiments of the present disclosure. In some embodiments, all configuration scripts classify the configuration data according to the device type or device role to obtain a sample data set S0 of device classification. Among them, the device type is the specific model of the device, and different device types have different device roles in the network, such as access layer devices, aggregation layer devices, core layer devices, etc.; usually, devices of different device types have different configurations, that is, they have different configuration data, and the same device also has different configurations when it appears as different device roles.

[0076] In one embodiment, step 2022 includes:

[0077] Obtain the standard configuration manual from the network device management platform;

[0078] Extract standard configuration commands from the standard configuration manual.

[0079] Since the standard configuration manual has a large number of configuration files, ie, a large number of configuration scripts, a large number of standard configuration commands can be extracted. In some embodiments, the standard configuration commands are extracted from the large number of configuration files through a data mining algorithm, thereby obtaining more accurate configuration data.

[0080] In some embodiments, step 2023 includes:

[0081] Build a command parser based on standard configuration commands;

[0082] Calculate the similarity between the configuration commands of the sample data set and the standard configuration commands of the command parser;

[0083] The standard configuration commands with the highest similarity are selected as the device classification dataset.

[0084] In step 2022, the standard configuration commands are classified and constructed to obtain a command parser. In practical applications, the similarity between each configuration command line in the configuration script of the sample dataset S0 and the standard command in the command parser can be calculated, and the standard command with the highest similarity is selected as the parsed standard configuration command and the device classification dataset S1.

[0085] In order to obtain more accurate standard configuration commands, in practical applications, the knowledge graph construction method for network devices also includes:

[0086] Filtering the configuration commands of the configuration data. In practical applications, it is necessary to filter some configuration commands of the configuration data that are not related to network services to obtain more accurate standard configuration commands, thereby obtaining a device classification data set S1 in the standard configuration command format of classified devices.

[0087] See also Figure 6 ,In a specific application scenario, the original configuration data is ,preprocessed to obtain standard configuration commands, and ,configuration commands not related to network services have also ,been filtered.

[0088] In one embodiment, step 203 includes:

[0089] Classifying the configuration scenarios from the device classification data set according to a preset classification mode to obtain classified configuration scenarios; wherein the preset classification mode includes a preset segmentation method and script rules;

[0090] Knowledge is extracted from the classified configuration scenarios according to the hierarchical relationship to obtain a configuration scenario dataset.

[0091] In step 203, configuration scenarios are classified from the device classification data set S1 according to the preset segmentation method and script rule configuration, wherein the preset segmentation method can be set to a specific segmentation method for the configuration scenario, and the preset script rule can be set to a specific script rule for the configuration scenario; different device types have slightly different classification modes, which are mainly reflected in the difference in the configuration scenario delimiters; the configuration scenario usually includes multiple lines of configuration commands that appear continuously in the configuration text, and one configuration scenario is usually separated from another configuration scenario in the configuration text by a blank line or a specific identifier. The configuration commands in a configuration scenario may be displayed as different indentation widths in the configuration text, indicating that the relationship between the previous and next commands is a main command-subcommand relationship, and the subcommand assists the main command to achieve a specific configuration function, which will be combined later Figures 7-8 , Table 1-2 provides detailed descriptions.

[0092] In a practical application, the configuration script formats of two different device types are described. Figure 7 , Figure 7 This is a schematic diagram of the division of different configuration scenarios, where: Figure 7 It illustrates the configuration scenario command rules for two different device types, combined with Table 1: The configuration scenario start identifier includes the configuration scenario separator and other commands. For example, the configuration scenario start identifier is!<!--1dp--> In the example, the configuration scene separator is an exclamation mark! , and the other commands are<!--1dp--> , by configuring the scene separator! with other commands<!--1dp--> Constitute the configuration scene starting identifier!<!--1dp--> The configuration scenario includes the main configuration command and the auxiliary configuration command. The main configuration command controller ce1_3 / 16 and the auxiliary configuration command out_index 23 together constitute the configuration scenario: controller ce1_3 / 16

[0093] out_index 23.

[0094]

[0095] Table 1

[0096] See also Figure 8 , Figure 8 It shows the configuration commands after layered extraction, where: Figure 8 The results of extracting two hierarchical relationships are shown in Table 2: The first hierarchical relationship, that is, the first configuration mode, is a hierarchical relationship based on commands at the same level, for example: configuration scenario! <ospfv2>与主命令router ospf <process-id>The second level relationship, namely the second configuration mode, is based on the hierarchical relationship between the commands of this level and the next level. For example, the main command area <area-id-ip>sub-commands of the next level of the main command

[0097] stub

[0098] network <ipv4-address> <net-mask>

[0099] network <ipv4-address> <net-mask>

[0100] mpls traffic-eng

[0101]

[0102] Table 2

[0103] When extracting knowledge from the classified configuration scenarios according to the hierarchical relationship in step 203, the classified configuration scenarios in the device classification dataset S1 are extracted according to the hierarchical relationship. In one embodiment, the hierarchical relationship includes two categories: the first category is commands at the same level, that is, the configuration scenario starting command and the commands at the same level, where the level refers to the command being indented by different units compared to the starting command to form a different level, thereby obtaining a hierarchical relationship of configuration scenario-main command; the second category is the relationship between a command and the command at the next level, that is, the subsequent command is indented compared to the command, thereby obtaining a hierarchical relationship of main command-subcommand, such as Figure 7 As shown, the subcommand ap address XXXX255.255.255.255Y and the subcommand out_index6 have fixed width indents. Figures 6-8 The extracted configuration commands with hierarchical relationships are called configuration patterns, thereby obtaining a configuration scenario dataset S2 classified by device.

[0104] In step 203 of some embodiments, all configuration patterns in the device classification data set S1 are subjected to association analysis and extraction based on a big data mining algorithm. By adjusting the preset threshold of the frequent item set of the association analysis (the number of times a certain configuration pattern appears in the sample), configuration patterns with different frequencies of appearance in the sample data are obtained, and the configuration pattern above the preset threshold is used as the correct standard configuration pattern. By using a big data mining algorithm to extract configuration commands from a large number of configuration files, there are different combination relationships between configuration commands in different configuration scenarios, and different configuration scenarios are divided by specific scenario separators in the configuration files. There may also be multiple layers of configuration commands in the same configuration scenario. Configuration commands at different levels are extracted by constructing a hierarchical model of scenario command-main command, and main command-subcommand, thereby extracting a large configuration scenario into multi-level configuration command segments (configuration patterns).

[0105] In some embodiments, step 203 extracts a configuration pattern through unsupervised learning. Since the configuration pattern extracted through unsupervised learning cannot be guaranteed to be completely correct, the extracted configuration pattern can be annotated and confirmed, and the extracted configuration commands can be modified during the confirmation process. Commands in the configuration pattern can be defined as having four different attributes: mandatory commands, optional commands, repeatable commands, and optional repeatable commands. Mandatory commands are commands that must exist in the configuration pattern and are default command attributes. Optional commands are commands whose presence or absence does not affect the correctness of the configuration pattern. Repeatable commands are commands that can be repeated multiple times. Optional repeatable commands are commands that can be repeated or not. By defining different attributes for each command, the flexibility of the configuration pattern can be greatly improved, thereby obtaining a modified configuration scenario dataset S2 classified by device type. In actual applications, the extracted configuration commands can be modified by manually annotating and confirming them by experienced operation and maintenance experts, and the extracted configuration commands can be modified during the confirmation process based on actual business conditions, thereby improving the accuracy of the configuration pattern.

[0106] In some embodiments, the method for constructing a knowledge graph for a network device further includes:

[0107] A mapping relationship is established according to the configuration commands of the knowledge graph to obtain a unified code corresponding to the configuration commands.

[0108] In the actual embodiment, if the configuration commands are directly stored in the knowledge graph during the construction process, it will bring inconvenience and affect the efficiency of subsequent configuration checks. In addition, since the configuration commands are usually composed of multiple strings, numbers, special characters, operators and spaces, each of which is of varying lengths, in order to facilitate the subsequent configuration checks of network devices, each configuration command is mapped to a fixed-length character command as a unified code. Figure 9 In a specific embodiment, the configuration command is mapped to a fixed-length character command. The left box shows the configuration command format extracted from a certain configuration scenario, and the right box shows the Chinese characters mapped to each configuration command format. Each command entity is uniquely mapped.

[0109] In a practical application, the principle of constructing a knowledge graph is to define both device types and configuration commands as specific entities based on the obtained configuration scenario dataset S2. In one specific embodiment, a "hasScenario" edge is defined between the device type and the configuration scenario command, indicating that the device type has this configuration scenario; a "hasCmd" edge is defined between the configuration scenario command and the main command, indicating that the configuration scenario has this main command; and a "hasSubCmd" edge is defined between the main command and the subcommand, indicating that the main command has this subcommand. Furthermore, corresponding command attributes are added to each command. This constructs a configuration knowledge graph for the corresponding network device.

[0110] To facilitate the implementation of the preprocessing steps of the embodiments of the present disclosure, the embodiments of the present disclosure also provide a configuration data export format, which saves configuration data in text form. Each configuration text only contains the configuration data of one network device. A configuration scenario in the configuration text consists of multiple consecutive configuration commands, and the configuration scenarios are separated by blank lines or specific identifiers. A configuration scenario can contain multiple main and sub-configuration commands, and the main and sub-configuration relationships between the main and sub-configuration commands are marked with fixed-width indents or specific identifiers.

[0111] In step 204, the extracted configuration commands are associated with network devices and configuration business scenarios, thereby constructing a configuration knowledge graph for network devices. Different device types and configuration commands are defined as different entities. The relationships between devices and commands, and between commands, are defined as different edges (relationships). These different entities and edges express the relationships between configuration commands in the configuration script as triples, thereby constructing a configuration knowledge graph for network devices.

[0112] In some embodiments, the method for inspecting network devices based on a knowledge graph further includes the following steps:

[0113] Store the constructed graph in the local database.

[0114] The knowledge graph construction of the network device provided by the embodiment of the present disclosure obtains the configuration data of the network device, preprocesses the configuration data to obtain a device classification data set, classifies the configuration scenarios according to the device classification data set, and extracts knowledge of the classified configuration scenarios to obtain a configuration scenario data set, and extracts the entity relationships of the configuration scenario data set according to the device type and device role to construct a knowledge graph based on the entity relationships. The knowledge of the constructed knowledge graph is accurate, which can improve the accuracy and efficiency of the inspection of the configuration of the network device.

[0115] The knowledge graph of network devices provided by the embodiments of the present disclosure is constructed by obtaining configuration data of the network devices, preprocessing the configuration data to obtain a device classification data set, classifying configuration scenarios based on the device classification data set, and extracting knowledge of the classified configuration scenarios to obtain a configuration scenario data set. The entity relationships of the configuration scenario data set are extracted according to the device type and device role, so that a knowledge graph can be constructed based on the entity relationships. The subsequent configuration of the network devices is facilitated by the constructed knowledge graph. The knowledge graph constructed by the embodiments of the present disclosure has accurate knowledge and can improve the accuracy and efficiency of the inspection.

[0116] The disclosed embodiments also provide a method for inspecting network devices based on a knowledge graph, which can be applied to a terminal, a server, or software running on a terminal or a server. In some embodiments, the terminal can be a smartphone, a tablet, a laptop, a desktop computer, or a smartwatch; the server can be configured as an independent physical server, or as a server cluster or distributed system consisting of multiple physical servers; or as a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms; the software can implement a method for inspecting network devices based on a knowledge graph, etc., but is not limited to the above forms.

[0117] See also Figure 10 , the embodiment of the present disclosure provides a method for inspecting network devices based on a knowledge graph, including steps 301 to 304.

[0118] Step 301: extract the configuration script of the network device to be checked in layers;

[0119] Step 302: Establish a configuration command mapping relationship based on the extracted configuration script to be checked to obtain a configuration command segment;

[0120] Step 303: Search the configuration command segment in the knowledge graph to obtain search results;

[0121] Step 304: Check the network device according to the search results;

[0122] Among them, the knowledge graph in step 303 is constructed by the above-mentioned knowledge graph construction method of network devices.

[0123] In some embodiments, after the configuration command is mapped, a hierarchical configuration command segment can be obtained, which is checked against the constructed configuration knowledge graph; the configuration command segment to be checked is retrieved in the graph through the association relationship between the scenario command-main command and the main command-sub-command, so that the network device can be checked through the retrieval results; if the retrieval is correct, the checked configuration command segment is correct; otherwise, there is a command error in the configuration command segment. Through the solution implemented in the present disclosure, abnormal configuration commands can be identified more accurately.

[0124] The knowledge graph-based network device inspection method provided by the embodiment of the present disclosure extracts the configuration script of the network device to be inspected in layers, establishes a configuration command mapping relationship based on the extracted configuration script to be inspected, obtains the configuration command segment, and then searches the configuration command segment in the knowledge graph, thereby inspecting the network device according to the retrieval results to determine whether the configuration of the network device is abnormal based on the inspection results. The technical solution provided by the embodiment of the present disclosure can take into account the versatility and flexibility of configuration inspection, realize rapid detection of configuration anomalies, greatly improve the efficiency of configuration anomaly inspection, and save a lot of manpower and time costs for telecom operators.

[0125] The technical solution provided by the embodiment of the present disclosure utilizes the network management system or SDN controller on the network device to obtain data related to the device configuration, including the device type and device role, during the configuration anomaly inspection process, so that the corresponding configuration knowledge graph can be accurately found, and then the configuration script can be checked.

[0126] In practical applications, the corresponding identifiers are mapped to obtain the configuration mode set C1 to be checked. Since the device type of the configuration script to be checked is known, the corresponding device type can be found in the constructed network device configuration knowledge graph. Then, through the "hasScenario" edge relationship, all configuration mode sets D1 under this device type are obtained. Each subset ci in the configuration mode set C1 is searched for the dj configuration mode in the configuration mode set D1, and the "hasCmd" and "hasSubCmd" edge relationships are used to search. If the corresponding configuration command segment can be completely found, the configuration of the network device to be checked is determined to be normal. Otherwise, if the command that appears in the subset ci does not appear in the dj configuration mode, the configuration of the network device to be checked is determined to be redundant. If a mandatory command in the dj configuration mode does not appear in the subset ci, and the command's attribute is mandatory, the configuration of the network device to be checked is determined to be missing.

[0127] A common method for checking for anomalies in network device configurations is to use inspection tools based on strong rules. These inspection tools rely on manually written inspection rules for judgment. This tool is not very versatile and requires constant rule maintenance. Furthermore, inspection efficiency is very low, with equipment inspections in a single city taking several hours. Compared to inspection methods based on strong rules, the technical solution provided by the embodiments of the present disclosure offers the advantages of strong versatility, reduced rule maintenance, and high inspection efficiency.

[0128] Another commonly used method for checking anomalies in network device configurations is data mining techniques (such as correlation analysis) based on big data statistics. This technique relies on the volume of the inspection sample data, making it impossible to effectively check small sample data, resulting in poor stability of the inspection results and a lack of business-related interpretability. Compared to data mining techniques based on big data statistics, the technical solution provided by the embodiments of the present disclosure does not rely on the volume of inspection sample data, can effectively check small sample data, and has good stability of inspection results.

[0129] In the method for checking the configuration anomalies of network devices proposed in the embodiment of the present disclosure, the relevant technical ideas of knowledge graphs are introduced, and the logical relationship of the configuration commands is constructed into a configuration knowledge graph of the corresponding network device through the methods of knowledge extraction and knowledge construction (modeling). By establishing relationships between configuration commands in the form of a graph, the commands can be checked efficiently to check for abnormal configuration commands. Commonly used inspection tools take several hours to inspect a city, while the technical solution provided by the embodiment of the present disclosure can shorten it to a few minutes. Compared with commonly used deep learning or machine learning methods, the commands in the configuration knowledge graph provided by the embodiment of the present disclosure have business association logic, are explainable for abnormal commands detected, and the inspection results are more credible.

[0130] The present disclosure also provides a knowledge graph construction device for a network device, which can implement the above-mentioned knowledge graph construction method for a network device. The device includes:

[0131] Configuration acquisition module, used to obtain configuration data of network devices;

[0132] A preprocessing module is used to preprocess the configuration data to obtain a device classification data set;

[0133] The knowledge extraction module is used to classify configuration scenarios according to the device classification data set and extract knowledge from the classified configuration scenarios to obtain a configuration scenario data set;

[0134] The knowledge graph construction module is used to extract the entity relationships of the configuration scenario dataset based on device type and device role, and construct a knowledge graph based on the entity relationships.

[0135] The present disclosure also provides another embodiment of a network device knowledge graph construction device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the above-described Figure 4 Steps 201 to 204 of the method, Figure 5 Method steps 2021 to 2023.

[0136] The present disclosure also provides a knowledge graph-based network device inspection device, which can implement the above-mentioned knowledge graph-based network device inspection method. The device includes:

[0137] A layered extraction module is used to extract the configuration scripts of the network devices to be checked in layers;

[0138] A mapping module is used to establish a configuration command mapping relationship based on the extracted configuration script to be checked, and obtain a configuration command segment;

[0139] The retrieval module is used to search the configuration command segment in the knowledge graph to obtain the retrieval results;

[0140] An inspection module, used to inspect network devices based on the search results;

[0141] Among them, the knowledge graph is constructed by the above-mentioned knowledge graph construction method of network devices.

[0142] The present disclosure also provides another embodiment of a network device inspection device based on a knowledge graph, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the above-described Figure 10 Steps 301 to 304 of the method.

[0143] The present disclosure also provides an electronic device, including:

[0144] at least one memory;

[0145] at least one processor;

[0146] at least one program;

[0147] The program is stored in the memory, and the processor executes at least one program to implement the knowledge graph construction method of the network device described above, or the knowledge graph-based network device inspection method described above. The electronic device can be any smart terminal including a mobile phone, tablet computer, personal digital assistant (PDA), point of sales (POS), vehicle-mounted computer, etc.

[0148] The embodiments of the present disclosure also provide a computer-readable storage medium, wherein the computer-executable instructions are used to execute the knowledge graph construction method of the above-mentioned network device of the present application, or the above-mentioned inspection method of the network device based on the knowledge graph.

[0149] The knowledge graph construction method and device for network devices, the inspection method and device for network devices based on the knowledge graph, the electronic device, and the storage medium proposed in the embodiments of the present disclosure obtain the configuration data of the network device, pre-process the configuration data, obtain a device classification data set, classify the configuration scenarios according to the device classification data set, and extract knowledge of the classified configuration scenarios to obtain a configuration scenario data set, and extract the entity relationship of the configuration scenario data set according to the device type and device role, so as to construct a knowledge graph based on the entity relationship. The knowledge of the constructed knowledge graph is accurate, which can improve the accuracy and efficiency of the inspection of the configuration of the network device. Due to the introduction of the relevant technical ideas of the knowledge graph, the logical relationship of the configuration command is constructed into a configuration knowledge graph of the corresponding network device through the methods of knowledge extraction and knowledge construction (modeling). By establishing relationships between the configuration commands in the form of a graph, the commands can be efficiently checked to detect abnormal configuration commands. Commonly used inspection tools take several hours to inspect a city, while the technical solution provided by the embodiments of the present disclosure can shorten the inspection to a few minutes. Compared with commonly used deep learning or machine learning methods, the commands in the configuration knowledge graph provided by the embodiment of the present disclosure have business association logic, are explainable for abnormal commands detected, and the inspection results are more credible.

[0150] The memory, as a non-transient computer-readable storage medium, can be used to store non-transient software programs and non-transient computer executable programs. In addition, the memory may include a high-speed random access memory and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some embodiments, the memory may optionally include a memory remotely arranged relative to the processor, and these remote memories may be connected to the processor via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0151] The embodiments described in the embodiments of the present disclosure are intended to more clearly illustrate the technical solutions of the embodiments of the present disclosure and do not constitute a limitation on the technical solutions provided by the embodiments of the present disclosure. Those skilled in the art will appreciate that with the evolution of technology and the emergence of new application scenarios, the technical solutions provided by the embodiments of the present disclosure are also applicable to similar technical problems.

[0152] It will be understood by those skilled in the art that Figures 4-5 The method for constructing a knowledge graph of a network device shown in the figure does not constitute a limitation on the embodiments of the present disclosure, and may include more or fewer steps than shown in the figure, or a combination of certain steps, or different steps. Figure 10 The inspection method of network devices based on the knowledge graph shown in the does not constitute a limitation on the embodiments of the present disclosure, and may include more or fewer steps than shown in the figure, or a combination of certain steps, or different steps.

[0153] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, i.e., they may be located in one place or distributed across multiple network units. Some or all of the modules may be selected based on actual needs to achieve the objectives of this embodiment.

[0154] Those skilled in the art will appreciate that all or some of the steps in the methods, systems, and functional modules / units in the devices disclosed above may be implemented as software, firmware, hardware, or appropriate combinations thereof.

[0155] The terms "first", "second", "third", "fourth", etc. (if any) in the specification of the present application and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequential order. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0156] It should be understood that in this application, "at least one (item)" means one or more, and "more" means two or more. "And / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" can mean: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally indicates that the previous and next associated objects are in an "or" relationship. "At least one of the following items" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, c can be single or plural.

[0157] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are merely schematic. For example, the division of the units is merely a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0158] The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected to achieve the purpose of this embodiment according to actual needs.

[0159] In addition, the functional units in the various embodiments of the present application may be integrated into a single processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.

[0160] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including multiple instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store programs, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0161] The preferred embodiments of the present disclosure are described above with reference to the accompanying drawings, but are not intended to limit the scope of the present disclosure. Any modifications, equivalent substitutions, and improvements made by those skilled in the art without departing from the scope and essence of the present disclosure should be within the scope of the present disclosure. < / ipv4-address> < / ipv4-address>

Claims

1. A method for constructing a knowledge graph of a network device, characterized in that: include: Get configuration data of network devices; Preprocessing the configuration data to obtain a device classification data set; wherein the configuration data includes configuration commands, and the device classification data set includes a standard configuration command having the highest similarity to the configuration command; Classifying configuration scenarios according to the device classification data set, and extracting knowledge from the classified configuration scenarios to obtain a configuration scenario data set; wherein the classified configuration scenarios are used to characterize configuration scenario command rules for the network devices of the same device type; Entity relationships of the configuration scenario dataset are extracted according to device type and device role, and a knowledge graph is constructed based on the entity relationships.

2. The method according to claim 1, characterized in that The preprocessing of the configuration data to obtain a device classification data set includes: Classifying the configuration data to obtain a sample data set of device classification; Extract standard configuration commands from the standard configuration command manual; The device classification data set is obtained according to the similarity between the configuration commands of the sample data set and the standard configuration commands.

3. The method according to claim 2, characterized in that The obtaining of the device classification data set according to the similarity between the configuration commands of the sample data set and the standard configuration commands includes: Building a command parser according to the standard configuration command; Calculating the similarity between the configuration commands of the sample data set and the standard configuration commands of the command parser; The standard configuration command with the highest similarity is selected as the device classification data set.

4. The method according to claim 1, wherein The configuration scenario classification is performed according to the device classification data set, and knowledge extraction is performed on the classified configuration scenarios to obtain a configuration scenario data set, including: Classifying configuration scenarios from the device classification data set according to a preset classification mode to obtain classified configuration scenarios; Knowledge extraction is performed on the classified configuration scenarios according to a hierarchical relationship to obtain the configuration scenario data set.

5. The method according to claim 4, characterized in that The preset classification mode includes a preset segmentation method and script rules.

6. The method according to any one of claims 1 to 5, characterized in that Also includes: A mapping relationship is established according to the configuration commands of the knowledge graph to obtain a unified code corresponding to the configuration commands.

7. The method according to any one of claims 1 to 5, characterized in that Also includes: Filtering the configuration commands of the configuration data.

8. A method for inspecting network equipment based on knowledge graph, characterized in that: include: Extract the configuration scripts of the network devices to be checked in layers; Establish a configuration command mapping relationship based on the extracted configuration script to be checked to obtain a configuration command segment; Search the configuration command segment in the knowledge graph to obtain search results; Checking the network device according to the search result; Wherein, the knowledge graph is constructed by the method according to any one of claims 1 to 6.

9. A device for constructing a knowledge graph of a network device, characterized in that: include: Configuration acquisition module, used to obtain configuration data of network devices; a preprocessing module, configured to preprocess the configuration data to obtain a device classification data set; wherein the configuration data includes configuration commands, and the device classification data set includes a standard configuration command having the highest similarity to the configuration command; Classifying configuration scenarios according to the device classification data set, and extracting knowledge from the classified configuration scenarios to obtain a configuration scenario data set; wherein the classified configuration scenarios are used to characterize configuration scenario command rules for the network devices of the same device type; The knowledge graph construction module is used to extract the entity relationships of the configuration scenario dataset according to the device type and device role, and construct a knowledge graph based on the entity relationships.

10. A computer-readable storage medium, characterized in that The computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are used to cause a computer to execute: The method according to any one of claims 1 to 7; or, The method according to claim 8.

Citation Information

Patent Citations

  • Design validation using natural language processing

    US20170111225A1