CN113553297B - Management method and system for switch configuration information - Google Patents

Management method and system for switch configuration information Download PDF

Info

Publication number
CN113553297B
CN113553297B CN202110639080.5A CN202110639080A CN113553297B CN 113553297 B CN113553297 B CN 113553297B CN 202110639080 A CN202110639080 A CN 202110639080A CN 113553297 B CN113553297 B CN 113553297B
Authority
CN
China
Prior art keywords
switch
configuration
tree structure
node
key value
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202110639080.5A
Other languages
Chinese (zh)
Other versions
CN113553297A (en
Inventor
任志晖
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ucloud Technology Co ltd
Original Assignee
Ucloud Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Ucloud Technology Co ltd filed Critical Ucloud Technology Co ltd
Priority to CN202110639080.5A priority Critical patent/CN113553297B/en
Publication of CN113553297A publication Critical patent/CN113553297A/en
Application granted granted Critical
Publication of CN113553297B publication Critical patent/CN113553297B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/13File access structures, e.g. distributed indices
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/2866Architectures; Arrangements
    • H04L67/30Profiles

Abstract

The invention discloses a management method and a system of switch configuration information, which are used for acquiring configuration files with switch full configuration information of each switch in a current network, dividing each configuration file into different function modules, analyzing each function module into a plurality of independent key value pairs according to a preset regular template, determining basic data of each switch as a root node by taking a configuration parameter name as a key and a configuration parameter content as a value, determining each leaf node according to all key value pairs corresponding to each switch, obtaining a target tree structure structured by the configuration information of each switch and storing the target tree structure in a database. The invention realizes the structural semantic description of the configuration parameters of the switches, so that the configuration information of the switches can be input into the database according to the defined tree structure, thereby enabling the configuration information of the switches stored in the database to cover all the configuration parameters of the switches and determining the structural relationship among the configuration parameters of the switches.

Description

Management method and system for switch configuration information
Technical Field
The present invention relates to the field of switch technologies, and in particular, to a method and a system for managing switch configuration information.
Background
A switch is a network device for electrical signal forwarding that provides an exclusive electrical signal path for any two network nodes accessing the switch. With the development of network technology, switches are used as basic devices of networks, and the applications of the switches are becoming more and more popular, and the number of the switches in the networks is increasing.
However, the huge number of switches, diversified switch brands, models, and software versions, result in huge switch configuration information. When the configuration problem of many producers many switches is investigated, there are two main ways in the existing scheme: the first method is manual investigation, but the time consumption is long, and the investigation efficiency is low; the second is automatic troubleshooting, in which configuration parameters of the switch are acquired by means of SNMP (simple network management protocol) or CLI (Command-Line Interface). However, due to the lack of structural relationship among the stored switch configuration parameters, the existing scheme can only acquire partial configuration parameters compatible with partial models of switches in partial scenes. However, in actual operation and maintenance, query, comparison, statistics and the like of the switch configuration parameters are required to cover all the switch configuration parameters and all models of all manufacturers, and the traditional automatic checking scheme cannot meet the requirement.
Disclosure of Invention
In view of the above, the present invention discloses a management method and system for switch configuration information, which implement structured semantic description of configuration parameters of a switch by dividing a configuration file containing the full configuration information of the switch into different function modules, and enable the switch configuration information to be entered into a database according to a defined tree structure by parsing each function module into key value pairs according to a regular template and structuring the key value pairs into the tree structure, so that not only can the switch configuration information stored in the database cover all switch configuration parameters and all models of all manufacturers, but also the structured relationship between the switch configuration parameters can be determined through the tree structure.
A management method of switch configuration information comprises the following steps:
acquiring configuration files of all switches in a current network, wherein each configuration file has switch full-amount configuration information;
dividing each of the configuration files into different functional modules;
analyzing each functional module into a plurality of independent key value pairs according to a preset regular template, wherein each key value pair takes a configuration parameter name as a key and takes configuration parameter content as a value;
determining the basic data of each switch as a root node, and determining each leaf node according to all key value pairs corresponding to each switch to obtain a target tree structure formed by structuring the configuration information of each switch;
and inputting the target tree structure corresponding to each switch into a database.
Optionally, the dividing each configuration file into different functional modules specifically includes:
and dividing each configuration file into different functional modules according to different paragraphs which are divided by a manufacturer in advance for the configuration text in each configuration file.
Optionally, the preset regular template includes the following three parts:
invariant parameters in the current switch configuration;
the name and type of the variable in the current switch configuration;
variable location of current switch configuration.
Optionally, the determining the basic data of each switch as a root node, and determining each leaf node according to all key value pairs corresponding to each switch to obtain a target tree structure structured by the configuration information of each switch specifically includes:
dividing all the functional modules of each configuration file into at least two hierarchical functional modules, which are respectively: the system comprises a first level function module and a second level function module, wherein the number of levels actually configured on a switch by the first level function module does not exceed a preset level number, and the number of levels actually configured on the switch by the second level function module exceeds the preset level number;
determining the basic data of the switch corresponding to each configuration file as the root node;
determining values in all the key value pairs corresponding to the first-level function module as the leaf nodes, and determining tree levels corresponding to the leaf nodes according to keys in the key value pairs corresponding to the leaf nodes to obtain a first tree structure;
determining a parent node and each child node associated with the parent node from each key value pair in the second hierarchy functional module according to the association relationship among each hierarchy in the second hierarchy functional module to obtain a second tree structure;
and obtaining the target tree structure according to the first tree structure and the second tree structure.
Optionally, the syntax defining structure of the configuration parameter name includes:
a parent node _ child node;
node _ outer association node.
A management system of switch configuration information, comprising:
the device comprises a configuration file acquisition unit, a configuration file acquisition unit and a configuration file management unit, wherein the configuration file acquisition unit is used for acquiring configuration files of all switches in the current network, and each configuration file has switch full-scale configuration information;
the module dividing unit is used for dividing each configuration file into different functional modules;
the analysis unit is used for analyzing each functional module into a plurality of independent key value pairs according to a preset regular template, wherein each key value pair is a key with a configuration parameter name and takes configuration parameter content as a value;
the tree structure establishing unit is used for determining the basic data of each switch as a root node, determining each leaf node according to all key value pairs corresponding to each switch, and obtaining a target tree structure formed by structuring the configuration information of each switch;
and the recording unit is used for recording the target tree structure corresponding to each switch into a database.
Optionally, the module dividing unit is specifically configured to:
and dividing each configuration file into different functional modules according to different paragraphs which are divided by a manufacturer for the configuration texts in each configuration file in advance.
Optionally, the preset regular template includes the following three parts:
invariant parameters in the current switch configuration;
the name and type of the variable in the current switch configuration;
variable location of current switch configuration.
Optionally, the tree structure establishing unit specifically includes:
a module dividing subunit, configured to divide all function modules of each configuration file into at least two hierarchical function modules, which are: the system comprises a first level function module and a second level function module, wherein the number of levels actually configured on a switch by the first level function module does not exceed a preset level number, and the number of levels actually configured on the switch by the second level function module exceeds the preset level number;
a root node determining subunit, configured to determine, as the root node, basic data of a switch corresponding to each configuration file;
a first tree structure establishing subunit, configured to determine values in all the key value pairs corresponding to the first level function module as the leaf nodes, and determine a tree level corresponding to the leaf node according to a key in the key value pair corresponding to each leaf node, so as to obtain a first tree structure;
a second tree structure building subunit, configured to determine, according to an association relationship between each hierarchy in the second hierarchy functional module, a parent node and each child node associated with the parent node from each key value pair in the second hierarchy functional module, to obtain a second tree structure;
and the target tree structure establishing subunit is used for obtaining the target tree structure according to the first tree structure and the second tree structure.
Optionally, the syntax defining structure of the configuration parameter name includes:
parent node _ child node;
node _ outer association node.
According to the technical scheme, the invention discloses a management method and a management system for switch configuration information, which are used for acquiring configuration files of all switches in a current network, wherein each configuration file has switch full configuration information, each configuration file is divided into different functional modules, each functional module is analyzed into a plurality of independent key value pairs according to a preset regular template, each key value pair takes a configuration parameter name as a key, the content of the configuration parameter as a value, basic data of each switch is determined as a root node, each leaf node is determined according to all the key value pairs corresponding to each switch, a target tree structure structured by the configuration information of each switch is obtained, and the target tree structure is stored in a database. The invention divides the configuration file containing the total configuration information of the switch into different functional modules, realizes the structural semantic description of the configuration parameters of the switch, analyzes each functional module into key value pairs according to a regular template, and structures the key value pairs into a tree structure, so that the configuration information of the switch can be input into a database according to the defined tree structure, thereby not only enabling the configuration information of the switch stored in the database to cover all the configuration parameters of the switch and all models of all manufacturers, but also determining the structural relationship among the configuration parameters of the switch through the tree structure.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the disclosed drawings without creative efforts.
Fig. 1 is a flowchart of a management method for switch configuration information according to an embodiment of the present invention;
fig. 2 is a flowchart of a method for structuring configuration information of each switch into a target tree structure according to an embodiment of the present invention;
fig. 3 is a schematic structural diagram of a management system for switch configuration information according to an embodiment of the present invention;
fig. 4 is a schematic structural diagram of a tree structure building unit according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The embodiment of the invention discloses a management method and a management system for switch configuration information, which are used for acquiring configuration files of switches in a current network, wherein each configuration file has switch full-quantity configuration information, each configuration file is divided into different functional modules, each functional module is analyzed into a plurality of independent key value pairs according to a preset regular template, each key value pair takes a configuration parameter name as a key, the configuration parameter content as a value, basic data of each switch is determined as a root node, each leaf node is determined according to all key value pairs corresponding to each switch, a target tree structure formed by structuring the configuration information of each switch is obtained, and the target tree structure is stored in a database. The invention divides the configuration file containing the total configuration information of the switch into different functional modules, realizes the structural semantic description of the configuration parameters of the switch, analyzes each functional module into key value pairs according to a regular template, and structures the key value pairs into a tree structure, so that the configuration information of the switch can be input into a database according to the defined tree structure, thereby not only enabling the configuration information of the switch stored in the database to cover all the configuration parameters of the switch and all models of all manufacturers, but also determining the structural relationship among the configuration parameters of the switch through the tree structure.
Referring to fig. 1, a flowchart of a method for managing switch configuration information disclosed in an embodiment of the present invention includes:
s101, acquiring configuration files of all switches in a current network;
wherein, each switch in the current network includes: all models of switches of all vendors in the current network.
Each switch corresponds to a configuration file, and each configuration file has switch full-scale configuration information.
In practical applications, the configuration file of the switch may be obtained through a connection manner such as SSH (Secure Shell protocol) or Telnet (remote terminal protocol), or may be obtained through an offline manner.
Step S102, dividing each configuration file into different functional modules;
it should be noted that the configuration file stores a configuration text, before the switch leaves the factory, the configuration text in the configuration file of the switch has been divided into different paragraphs by the manufacturer, and in actual application, the different paragraphs correspond to different functions.
Therefore, when the configuration files are divided into the functional modules, each configuration file can be divided into different functional modules according to different paragraphs which are divided by a manufacturer in advance for the configuration text in each configuration file.
Each function module is actually a text block for expressing a specific function, for example, the function module may be a text block for configuring functions commonly used by the switches such as AAA, interface, and the like.
Step S103, analyzing each functional module into a plurality of independent key value pairs according to a preset regular template;
and each key value pair takes the name of the configuration parameter as a key and takes the content of the configuration parameter as a value.
In this embodiment, the preset regular template includes the following three parts:
invariant parameters (constants) in the current switch configuration;
the name and type of the variable in the current switch configuration;
variable location of current switch configuration.
It should be particularly noted that the configuration parameter name in this embodiment is a key for defining a tree structure, and the following syntax definition is adopted for the configuration parameter name in the present invention:
1) Parent node _ child node _ 8230;
2) Node _ outer association node.
1) semanteme clearly describes tree hierarchical relation of each configuration of the switch, 2) semanteme clearly describes relation of external connection parameters, and the two semantemes can be combined to represent hierarchical relation and external connection meaning of each configuration of the switch.
It should be noted that, in the configuration of the switch, there is an association relationship in the non-module (text block), as with the association between different tables in the database, after defining the text block of the configuration, another code block referencing this configuration appears, and in order to express such a relationship of relevant connection, the present invention uses an external parameter to express this configuration;
for example:
vlan–interface,
the key-value pair defining the last abstraction of the vlan's configuration text block:
Figure BDA0003106421590000071
using the last abstract key-value pair of the interface configuration text block of vlan:
Figure BDA0003106421590000072
it should be noted that, each key value pair in the invention is named as a key by a configuration parameter name, and the configuration parameter content is a value, because the same syntax is adopted by the invention for the configuration parameter name, the invention can unify the extraction of the full quantity parameters of the switch, thereby providing the same switch configuration parameter reading warehouse for the subsequent configuration related automatic development.
Step S104, determining the basic data of each switch as a root node, determining each leaf node according to all key value pairs corresponding to each switch, and obtaining a target tree structure formed by structuring the configuration information of each switch;
the basic data of the switch may include: switch management address, switch name, etc.
It should be noted that the keys in the key value pair provide a basis for entry of the tree structure, for example:
when a tree structure needs to be entered into a database, configurations of different hierarchies need to be entered into different tables, as shown in example 1, two tables, namely BGP and BGP _ Network, exist in the database;
example 1:
Figure BDA0003106421590000081
at this time, since the function configuration requires hierarchical entry, it is necessary to specify which upper node is associated, so the key value pair obtained by parsing is as follows:
BGP _ ID: 1000// Condition 1 for correlating to higher level BGP
BGP _ ASNumber: 1.1.1.1// Condition 2 for correlation to the higher level BGP
Ipv 4// Condition 3 for correlating to a BGP of a previous level
X.x.x.x// content in specific entry database BGP _ Network table
Content of Network mask x.x.x.x// specific entry database BGP _ Network table
Wherein, BGP is the name of the father node table; and finally, associating the data with the related entry of the parent node table.
And step S105, inputting the target tree structure corresponding to each switch into a database.
To sum up, the invention discloses a management method of switch configuration information, which comprises the steps of obtaining configuration files of all switches in a current network, wherein each configuration file has switch full configuration information, dividing each configuration file into different function modules, analyzing each function module into a plurality of independent key value pairs according to a preset regular template, determining basic data of each switch as a root node by using a configuration parameter name as a key and using configuration parameter content as a value, determining each leaf node according to all key value pairs corresponding to each switch, obtaining a target tree structure formed by structuring the configuration information of each switch, and storing the target tree structure in a database. The invention divides the configuration file containing the total configuration information of the switch into different functional modules, realizes the structural semantic description of the configuration parameters of the switch, analyzes each functional module into key value pairs according to a regular template, and structures the key value pairs into a tree structure, so that the configuration information of the switch can be input into a database according to the defined tree structure, thereby not only enabling the configuration information of the switch stored in the database to cover all the configuration parameters of the switch and all models of all manufacturers, but also determining the structural relationship among the configuration parameters of the switch through the tree structure.
To further optimize the foregoing embodiment, referring to fig. 2, a flowchart of a method for structuring configuration information of each switch into a target tree structure disclosed in the embodiment of the present invention is shown, that is, step S104 in the foregoing embodiment may specifically include:
step S201, dividing all the functional modules of each configuration file into at least two hierarchical functional modules, which are: a first level function module and a second level function module;
it should be noted that, the hierarchy of the actual configuration of the functional modules on the switch is structured, for example:
Figure BDA0003106421590000091
the invention divides the function modules into a first level function module and a second level function module according to the level number of the function modules, wherein the level number of the first level function module actually configured on the switch does not exceed a preset level number, and the level number of the second level function module actually configured on the switch exceeds the preset level number.
The value of the preset level is determined according to actual needs, for example, the preset level is 3, and the present invention is not limited herein.
It should be particularly noted that, when the number of the layers included in the function module of each configuration file is large, the function module needs to be divided into a plurality of layer function modules, including but not limited to the first layer function module and the second layer function module, and may further include: a third level functional module, a fourth level functional module, and so on.
Step S202, determining the basic data of the switch corresponding to each configuration file as the root node;
step S203, determining values in all the key value pairs corresponding to the first-level function module as the leaf nodes, and determining tree levels corresponding to the leaf nodes according to keys in the key value pairs corresponding to each leaf node to obtain a first tree structure;
it should be noted that, because the number of the hierarchical levels included in the first hierarchical function module is not large, the first hierarchical function module can be directly entered into the database as a leaf node, for example:
basic data of switch
I _functionalmodule one
| _ function module two
| _ function module three
I _functionalmodule three-submodule one
L _ functional module n _8230
In this embodiment, the basic data of the switch may be used as the root of the tree, and the functional module may be used as the leaf of the tree.
Step S204, determining a father node and each child node associated with the father node from each key value pair in the second hierarchy functional module according to the association relation among the hierarchies in the second hierarchy functional module to obtain a second tree structure;
the determination process for the parent node and each child node is exemplified as follows:
Figure BDA0003106421590000101
in this embodiment, the first-level configuration, i.e., the configuration in which the main parameter configuration is indented into two cells, is used as the parent node parameter, the second-level configuration, i.e., the configuration in which the main parameter configuration is indented into four cells, is used as the child node parameter, and so on.
In practical application, according to different switch configuration conditions of each manufacturer, parameters of a father node and parameters of a child node are correspondingly different. Wherein each child node may further include: child sub-nodes, each child sub-node may further include: child nodes, and so on.
It should be noted that, the execution sequence of step S203 and step S204 includes, but is not limited to, the embodiment shown in fig. 2, and step S204 may be executed first and then step S203, or step S203 and step S204 may be executed simultaneously, which is determined according to actual needs, and the present invention is not limited herein.
And S205, obtaining the target tree structure according to the first tree structure and the second tree structure.
In summary, the present invention divides the configuration file containing the total configuration information of the switch into different functional modules, so as to realize the structural semantic description of the configuration parameters of the switch, and the configuration information of the switch can be input into the database according to the defined tree structure, thereby not only enabling the configuration information of the switch stored in the database to cover all the configuration parameters of the switch and all models of all manufacturers, but also determining the structural relationship between the configuration parameters of the switch through the tree structure.
Corresponding to the embodiment of the method, the invention also discloses a management system of the switch configuration information.
Referring to fig. 3, a schematic structural diagram of a management system for switch configuration information disclosed in the embodiment of the present invention includes:
a configuration file obtaining unit 301, configured to obtain configuration files of each switch in a current network, where each configuration file has full switch configuration information;
in practical applications, the configuration file of the switch may be obtained through a connection manner such as SSH (Secure Shell protocol) or Telnet (remote terminal protocol), or may be obtained through an offline manner.
A module dividing unit 302, configured to divide each of the configuration files into different functional modules;
it should be noted that the configuration file stores a configuration text, before the switch leaves the factory, the configuration text in the configuration file of the switch has been divided into different paragraphs by the manufacturer, and in actual application, the different paragraphs correspond to different functions.
Therefore, the module dividing unit is specifically configured to: and dividing each configuration file into different functional modules according to different paragraphs which are divided by a manufacturer for the configuration texts in each configuration file in advance.
The analysis unit 303 is configured to analyze each functional module into a plurality of independent key value pairs according to a preset regular template, where each key value pair is a key based on a configuration parameter name and takes configuration parameter content as a value;
and each key value pair takes the name of the configuration parameter as a key and takes the content of the configuration parameter as a value.
In this embodiment, the preset regular template includes the following three parts:
invariant parameters (constants) in the current switch configuration;
the name and type of the variable in the current switch configuration;
variable location of current switch configuration.
It should be particularly noted that the configuration parameter name in this embodiment is a key for defining the tree structure, and the following syntax definition is adopted for the configuration parameter name in the present invention:
1) Parent node _ child node _ 8230;
2) Node _ outer association node.
The 1) semantic definition describes the tree-like hierarchical relationship of each configuration of the switch, and the 2) semantic definition describes the relationship of the external connection parameters, and the two semantics can be combined with each other to represent the hierarchical relationship and the external connection meaning of each configuration of the switch.
A tree structure establishing unit 304, configured to determine the basic data of each switch as a root node, and determine each leaf node according to all key value pairs corresponding to each switch, so as to obtain a target tree structure structured by configuration information of each switch;
the basic data of the switch may include: switch management address, switch name, etc.
An entry unit 305, configured to enter the target tree structure corresponding to each switch into a database.
To sum up, the invention discloses a management system for switch configuration information, which obtains configuration files of each switch in a current network, wherein each configuration file has switch full configuration information, divides each configuration file into different function modules, analyzes each function module into a plurality of independent key value pairs according to a preset regular template, each key value pair takes a configuration parameter name as a key, takes configuration parameter content as a value, determines basic data of each switch as a root node, determines each leaf node according to all key value pairs corresponding to each switch, obtains a target tree structure formed by structuring the configuration information of each switch, and stores the target tree structure in a database. The invention divides the configuration file containing the total configuration information of the switch into different functional modules, realizes the structural semantic description of the configuration parameters of the switch, analyzes each functional module into key value pairs according to a regular template, and structures the key value pairs into a tree structure, so that the configuration information of the switch can be input into a database according to the defined tree structure, thereby not only enabling the configuration information of the switch stored in the database to cover all the configuration parameters of the switch and all models of all manufacturers, but also determining the structural relationship among the configuration parameters of the switch through the tree structure.
In order to further optimize the above embodiment, referring to fig. 4, a schematic structural diagram of a tree structure establishing unit disclosed in the embodiment of the present invention, the tree structure establishing unit specifically includes:
a module dividing subunit 401, configured to divide all function modules of each configuration file into at least two hierarchical function modules, which are: the system comprises a first level function module and a second level function module, wherein the number of levels actually configured on a switch by the first level function module does not exceed a preset level number, and the number of levels actually configured on the switch by the second level function module exceeds the preset level number;
it should be particularly noted that, when the number of the layers included in the function module of each configuration file is large, the function module needs to be divided into a plurality of layer function modules, including but not limited to the first layer function module and the second layer function module, and may further include: a third level functional module, a fourth level functional module, and so on.
A root node determining subunit 402, configured to determine, as the root node, basic data of the switch corresponding to each configuration file;
a first tree structure establishing subunit 403, configured to determine values in all the key value pairs corresponding to the first-level function module as the leaf nodes, and determine a tree level corresponding to each leaf node according to a key in the key value pair corresponding to each leaf node, so as to obtain a first tree structure;
a second tree structure establishing subunit 404, configured to determine, according to an association relationship between each hierarchy in the second hierarchy functional module, a parent node and each child node associated with the parent node from each key value pair in the second hierarchy functional module, so as to obtain a second tree structure;
a target tree structure establishing subunit 405, configured to obtain the target tree structure according to the first tree structure and the second tree structure.
In summary, the present invention divides the configuration file containing the total configuration information of the switch into different functional modules, so as to realize the structural semantic description of the configuration parameters of the switch, and the configuration information of the switch can be input into the database according to the defined tree structure, thereby not only enabling the configuration information of the switch stored in the database to cover all the configuration parameters of the switch and all models of all manufacturers, but also determining the structural relationship between the configuration parameters of the switch through the tree structure.
It should be noted that, for details of the working principle of each component in the system embodiment, reference is made to the corresponding part of the method embodiment, which is not described herein again.
Finally, it should also be noted that, in this document, relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrases "comprising one of 8230; \8230;" 8230; "does not exclude the presence of additional like elements in a process, method, article, or apparatus that comprises the element.
The embodiments in the present description are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the invention. Thus, the present invention is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (8)

1. A method for managing switch configuration information, comprising:
acquiring configuration files of all switches in a current network, wherein each configuration file has switch full-amount configuration information;
dividing each of the configuration files into different functional modules;
analyzing each functional module into a plurality of independent key value pairs according to a preset regular template, wherein each key value pair takes a configuration parameter name as a key and takes configuration parameter content as a value;
determining the basic data of each switch as a root node, and determining each leaf node according to all key value pairs corresponding to each switch to obtain a target tree structure formed by structuring the configuration information of each switch;
inputting the target tree structure corresponding to each switch into a database;
the determining the basic data of each switch as a root node, and determining each leaf node according to all key value pairs corresponding to each switch to obtain a target tree structure structured by the configuration information of each switch specifically includes:
dividing all the functional modules of each configuration file into at least two hierarchical functional modules, which are respectively: the system comprises a first level function module and a second level function module, wherein the number of levels actually configured on a switch by the first level function module does not exceed a preset level number, and the number of levels actually configured on the switch by the second level function module exceeds the preset level number;
determining the basic data of the switch corresponding to each configuration file as the root node;
determining values in all the key value pairs corresponding to the first level function module as the leaf nodes, and determining a tree level corresponding to the leaf nodes according to keys in the key value pairs corresponding to each leaf node to obtain a first tree structure;
determining a father node and each child node associated with the father node from each key value pair in the second hierarchy functional module according to the incidence relation among the hierarchies in the second hierarchy functional module to obtain a second tree structure;
and obtaining the target tree structure according to the first tree structure and the second tree structure.
2. The management method according to claim 1, wherein the dividing each of the configuration files into different functional modules specifically comprises:
and dividing each configuration file into different functional modules according to different paragraphs which are divided by a manufacturer in advance for the configuration text in each configuration file.
3. The management method according to claim 1, wherein the preset regular template comprises the following three parts:
invariant parameters in the current switch configuration;
the name and type of the variable in the current switch configuration;
variable location of current switch configuration.
4. The management method according to claim 1, wherein the syntax definition structure of the configuration parameter name comprises:
parent node _ child node;
node _ outer association node.
5. A management system for switch configuration information, comprising:
the device comprises a configuration file acquisition unit, a configuration file acquisition unit and a configuration file management unit, wherein the configuration file acquisition unit is used for acquiring configuration files of all switches in the current network, and each configuration file has switch full-scale configuration information;
the module dividing unit is used for dividing each configuration file into different functional modules;
the analysis unit is used for analyzing each functional module into a plurality of independent key value pairs according to a preset regular template, wherein each key value pair is a key with a configuration parameter name and takes configuration parameter content as a value;
the tree structure establishing unit is used for determining the basic data of each switch as a root node, determining each leaf node according to all key value pairs corresponding to each switch, and obtaining a target tree structure formed by structuring the configuration information of each switch;
the input unit is used for inputting the target tree structure corresponding to each switch into a database;
the tree structure establishing unit specifically includes:
a module dividing subunit, configured to divide all function modules of each configuration file into at least two hierarchical function modules, which are: the system comprises a first level function module and a second level function module, wherein the number of levels actually configured on a switch by the first level function module does not exceed a preset level number, and the number of levels actually configured on the switch by the second level function module exceeds the preset level number;
a root node determining subunit, configured to determine, as the root node, basic data of a switch corresponding to each configuration file;
a first tree structure establishing subunit, configured to determine values in all the key value pairs corresponding to the first-level function module as the leaf nodes, and determine a tree level corresponding to each leaf node according to a key in the key value pair corresponding to each leaf node, so as to obtain a first tree structure;
a second tree structure establishing subunit, configured to determine, according to an association relationship between each hierarchy in the second hierarchy functional module, a parent node and each child node associated with the parent node from each key value pair in the second hierarchy functional module, so as to obtain a second tree structure;
and the target tree structure establishing subunit is used for obtaining the target tree structure according to the first tree structure and the second tree structure.
6. The management system according to claim 5, wherein the module dividing unit is specifically configured to:
and dividing each configuration file into different functional modules according to different paragraphs which are divided by a manufacturer for the configuration texts in each configuration file in advance.
7. The management system according to claim 5, wherein the preset regular template comprises the following three parts:
invariant parameters in the current switch configuration;
the name and type of the variable in the current switch configuration;
variable position of current switch configuration.
8. The management system according to claim 5, wherein the syntax defining structure of the configuration parameter name comprises:
a parent node _ child node;
node _ outer association node.
CN202110639080.5A 2021-06-08 2021-06-08 Management method and system for switch configuration information Active CN113553297B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110639080.5A CN113553297B (en) 2021-06-08 2021-06-08 Management method and system for switch configuration information

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110639080.5A CN113553297B (en) 2021-06-08 2021-06-08 Management method and system for switch configuration information

Publications (2)

Publication Number Publication Date
CN113553297A CN113553297A (en) 2021-10-26
CN113553297B true CN113553297B (en) 2023-01-06

Family

ID=78130381

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110639080.5A Active CN113553297B (en) 2021-06-08 2021-06-08 Management method and system for switch configuration information

Country Status (1)

Country Link
CN (1) CN113553297B (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103455471A (en) * 2012-06-01 2013-12-18 阿里巴巴集团控股有限公司 Method and device for analyzing text to key value pairs
CN103646055A (en) * 2013-11-29 2014-03-19 广州视源电子科技股份有限公司 Method and device for obtaining program configuration information
CN104486259A (en) * 2014-12-16 2015-04-01 上海斐讯数据通信技术有限公司 Switch configuration file storage method, and switch configuration file storage system
US10044522B1 (en) * 2012-08-21 2018-08-07 Amazon Technologies Inc. Tree-oriented configuration management service
CN110851136A (en) * 2019-09-18 2020-02-28 平安科技(深圳)有限公司 Data acquisition method and device, electronic equipment and storage medium
CN112436964A (en) * 2020-11-12 2021-03-02 中国联合网络通信集团有限公司 Equipment adaptation method and network management device

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105095237B (en) * 2014-04-30 2018-07-17 国际商业机器公司 Method and apparatus for the pattern for generating non-relational database
CN105656665A (en) * 2015-12-24 2016-06-08 浪潮集团有限公司 Switch port configuring method and switch
CN106372176B (en) * 2016-08-30 2019-07-23 东华大学 A method of it supports to carry out nested document unified SQL query

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103455471A (en) * 2012-06-01 2013-12-18 阿里巴巴集团控股有限公司 Method and device for analyzing text to key value pairs
US10044522B1 (en) * 2012-08-21 2018-08-07 Amazon Technologies Inc. Tree-oriented configuration management service
CN103646055A (en) * 2013-11-29 2014-03-19 广州视源电子科技股份有限公司 Method and device for obtaining program configuration information
CN104486259A (en) * 2014-12-16 2015-04-01 上海斐讯数据通信技术有限公司 Switch configuration file storage method, and switch configuration file storage system
CN110851136A (en) * 2019-09-18 2020-02-28 平安科技(深圳)有限公司 Data acquisition method and device, electronic equipment and storage medium
CN112436964A (en) * 2020-11-12 2021-03-02 中国联合网络通信集团有限公司 Equipment adaptation method and network management device

Also Published As

Publication number Publication date
CN113553297A (en) 2021-10-26

Similar Documents

Publication Publication Date Title
US9558454B2 (en) System and method for model-based inventory management of a communications system
CN106664224B (en) Method and system for metadata enhanced inventory management for communication systems
US7721304B2 (en) Method and apparatus providing programmable network intelligence
US8667113B2 (en) Bitmap network management object change detection approach
CN101369918B (en) Network management browser
CN109739867B (en) Industrial metadata management method and system
CN102447585B (en) Method and device for converting network configuration protocol response message into command line
CN112152835B (en) Managing multiple semantic versions of a device configuration schema
US20080301143A1 (en) Automatic Update System and Method for Using a Meta Mib
WO2016107397A1 (en) System and method for model-based search and retrieval of networked data
CN105760491B (en) Data modeling method and device based on equipment function
CN104915238B (en) A kind of configuration parameter association determination method of Web applications
CN101170436B (en) A method for managing template in network management system
CN113553297B (en) Management method and system for switch configuration information
CN112055062B (en) Data communication method, device, equipment and readable storage medium
Mercian et al. Mind the semantic gap: Policy intent inference from network metadata
CN112202593A (en) Data acquisition method, device, network management system and computer storage medium
US20210266220A1 (en) Server to support client data models from heterogeneous data sources
CN114489594A (en) Method for constructing command parser, method and device for processing command parsing
CN109144489B (en) State data processing method based on Yang language model
CN106993036B (en) Running environment information processing method and switch
CN108270599B (en) Data analysis processing method and system based on SNMP (simple network management protocol)
CN113641352B (en) Method and system for automatically generating SNMP (simple network management protocol) codes
CN115599657B (en) Software facility abnormity judgment method
CN109510728A (en) The method that a kind of network management information library mib file is automatically converted into XML file

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant