CN100346606C - Information analytical method for facility configuration - Google Patents

Information analytical method for facility configuration Download PDF

Info

Publication number
CN100346606C
CN100346606C CNB031575676A CN03157567A CN100346606C CN 100346606 C CN100346606 C CN 100346606C CN B031575676 A CNB031575676 A CN B031575676A CN 03157567 A CN03157567 A CN 03157567A CN 100346606 C CN100346606 C CN 100346606C
Authority
CN
China
Prior art keywords
command
character stream
parameter
order
name
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.)
Expired - Fee Related
Application number
CNB031575676A
Other languages
Chinese (zh)
Other versions
CN1601969A (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.)
Huawei Technologies Co Ltd
Original Assignee
Huawei Technologies 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 Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to CNB031575676A priority Critical patent/CN100346606C/en
Publication of CN1601969A publication Critical patent/CN1601969A/en
Application granted granted Critical
Publication of CN100346606C publication Critical patent/CN100346606C/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Abstract

The present invention discloses an information analytical method for facility configuration, which is characterized in that the method comprises the following steps that a network management station saves a grammar definition table which comprises facility configuration information in the network management station; the network management station obtains the facility configuration information to analyze the facility configuration information according to grammar definitions of the grammar definition table in a network management station database. The method analyzes the configuration information by adopting the grammar definition table based on the network management database to overcome the dependence for a configurated facility in the analytic process, and the purpose of decreasing the analytic workload is reached.

Description

A kind of device configuration information analytic method
Technical field
The present invention relates to field of network management, relate in particular to the device configuration information analytic method in a kind of network management process.
Background technology
Current, the equipment that moves on network had carried out customization mostly.In the customization process, the user is by the configuration of configuration order realization to equipment on the network, to realize the customization of these equipment.In the network management process, the configuration information in these configuration orders and the configuration order need be shown on the foreground, and in some cases, also need the configuration information in the configuration order that shows is made amendment, to realize maintenance to the network equipment.Current, realize that the method for this kind maintenance mainly contains two kinds, be respectively:
1) if carried database by user configured equipment, the function that can utilize this database to provide, user's configuration information is exported to file, the file that utilizes file transfer protocol (FTP) that this each equipment is derived again is sent to a certain place centralized stores, concentrate realization to file modification in this place, thereby revise configuration information;
2) no matter whether carried database by user configured equipment, network management workstation issues and moves the order of a current configuration information of display device by the telnet agreement, and receives the configuration information that returns by the telnet agreement; Can store these configuration informations in the file into and preserve, in this document, can revise these information, and send to equipment by the terminal document host-host protocol, the configuration of updating the equipment, thus realization is to the brand-new configuration of equipment.
Because mode 2) by the order of the current configuration information of operation display device, the readability of the information that obtains and resolvability are than mode 1) good, so use wider.If pass-through mode 2) revises equipment disposition, just must solve the parsing problem of configuration information, configuration information can simply be thought character stream, but the rule of resolving must be the grammer according to the equipment disposition order, therefore, how to provide this rule and utilize this rule to realize resolving to become a key issue that realizes network device management.
Prior art one:
In the prior art, coding code on the equipment that is configured, after the user is input to configuration order and parameter information thereof on the equipment that is configured one by one, this program finds corresponding processing function according to the order of input, this function is known the parameter information of this order, can finish the parsing of configuration information.The instruction set of this scheme and operating system is similar, and characteristics are that the media without any for example configuration file and database provides dependent parser, writes code grammer is provided but adopt.
The prior art has following shortcoming:
1) owing to adopt the code that is configured on the equipment to resolve, therefore, the prior art relies on seriously being configured equipment, owing to be configured the instability of equipment, can cause the stability of the parsing configuration information module that has the code of writing to ensure;
2) no autgmentability: owing to adopt the code on the equipment that is configured to resolve, therefore, each is configured equipment needs respectively command set to be registered and safeguarded, workload is bigger, and along with device command changes, need not stop to revise code, its modification process also is a process that workload is very big.
Prior art two:
In the prior art, consider the needs of resolving flexibility, network management workstation provides the configuration file of grammer, and the definition information of all orders records in the configuration file according to certain format one by one; During parsing, network management workstation is found out the record of the syntactic definition of this order in the configuration file according to resolved command name, according to this recorded information, finishes parsing work.The prior art is come the syntactic definition of hold-over command with extending mark language (XML), reads dependency rule from the XML file when resolving configuration information; During read command set, adopt XML that DOM Document Object Model (DOM) that is provided and the related libraries of using this model are provided.In the syntactic definition in the prior art, have a kind of command relationship of iteration, show as: each bar order all has a father and son, if father is empty, represent that then this order is in the starting position of iteration,, then represent iteration termination if son is empty.This iterative relation is actual to be in order to show one tree, and the tissue of order carries out according to tree usually.
The prior art has following shortcoming:
1) use the form organizational command of tree can in the actual resolved process, take a large amount of internal memories;
2) must use DOM and related libraries, can cause workload significantly to increase the parsing of this DOM and related libraries;
3) record in the grammar file is more: in order to comprise all branch's situations, need therefore cause record more for grammer record of every kind of combination definition.
Summary of the invention
In view of this, main purpose of the present invention is to provide a kind of analytic method of device configuration information, this method adopts and based on the syntactic definition table of database on the network management workstation configuration information is resolved, to overcome resolving to being configured the dependence of equipment, and, reach the purpose that reduces to resolve workload by adopting the syntactic definition table.
The present invention is a kind of device configuration information analytic method, and this method may further comprise the steps:
Network management workstation obtains the configuration information character stream of equipment, according to the syntactic definition that is kept at the syntactic definition table that includes equipment disposition command set information in the network management workstation database, resolve the configuration information character stream of this equipment, obtain the command name and the parameter that comprise in the described character stream;
Described syntactic definition table comprises at least: the command mode table that is used for the definition command pattern; Be used to define the command name and the sign correspondence table of command name, command type, major parameter number and the optional parameters number of each order; The major parameter table that is used for the major parameter Name ﹠ Location of definition command; Be used for the whether optional parameters table of band value of definition command optional parameters title, optional parameters.
Described syntactic definition table further comprises:
The interface command group table that is used for command id in the group under defining interface command id and this interface command;
Wherein, in described command mode table, command name and sign correspondence table, major parameter table and optional parameters table, also comprise the command id of ordering in the configuration information.
Wherein, described syntactic definition table is kept in the database of network management workstation.
Wherein, described syntactic definition table is kept in the database of network management workstation and is:
Network management workstation is inserted into the syntactic definition of all configuration order collection information in the syntactic definition table in the database by database script.
Wherein, described syntactic definition table or be kept in the network management workstation by extending mark language.
Wherein, described network management workstation obtains the configuration information character stream and comprises:
Network management workstation issues the order of configurations shown information by being used for the standard agreement telnet of long-range Connection Service to equipment; Equipment is received this order, configurations shown information, and return the configuration information character stream to network management workstation by the telnet agreement, network management workstation is kept at buffering area with the configuration information character stream.
Wherein, described parsing comprises:
B1, network management workstation read in the configuration information character stream line by line, judge according to the content in the described syntactic definition table whether the order in this row configuration information registers, if, execution in step B2 then; Otherwise, finish the parsing of current line, return step B1;
B2, network management workstation finish the processing to the command name of configuration information character stream, according to the content in the described syntactic definition table, the command mode in the processing configuration information;
B3, according to the content in the described syntactic definition table, obtain and extract the parameter in the configuration information; Return execution in step B1, until all row of handling configuration information.
Wherein, among the step B1, describedly judge whether order has registered and comprise:
First unit of ordering in the character string of B11, acquisition character stream current line;
B12, be used as in the array of record order title in the correspondence table, search all command names that comprise above-mentioned first module in command name and sign; If the number of the command name that finds is 0, be illustrated in command name and the sign correspondence table and do not register this name, search procedure finishes, and finishes the resolving to the current line character string; If the command name number that finds is 1, execution in step B13 then, if the command name number that finds greater than 1, execution in step B14 then;
The number of the component units in the command name that B13, judgement are found, if the component units number is 1, show that the command name in the current line character string conforms to fully with the command name order of finding, judge that then the command name obtain in the current line character string registers in the syntactic definition table, obtain this command name simultaneously; If the component units number of the command name that finds is greater than 1, then take out all unit of this command name, compare one by one with all unit of command name in the current line character string, if it is all identical, judge that then the command name obtain in the current line character string registers, and obtain this command name, otherwise judgement obtains the not registration of command name in the current line character string;
B14, take out the command name find one by one, judge according to the described method of step B13 whether the command name of current line character string is registered, if the command name of current line character string does not all conform to fully with all command names that find, then judge to obtain the not registration of this current line character string command title; Otherwise the command name that judgement obtains in the current line character string is registered.
Wherein, among the step B2, described end is treated to network management workstation with the command name end of character stream pointer movement to the configuration information character stream to the command name of configuration information character stream, specifically comprises:
Unit number in B21, the calculation command title;
B22, judge whether the number of command name equals 1, if, moving hand not; Otherwise, take out each unit in the command name one by one, and respectively the pointer position of character string buffering area be modified to the next unit of current retrieval unit successively.
Wherein, among the step B2, described processing command pattern comprises:
B23, judge whether interface command is labeled as vacation, if, direct execution in step B24 then; If not, execution in step B25, wherein, interface command is carrying out being marked as vacation before the described processing command pattern;
The pattern of B24, taking-up the current command correspondence, judge whether command mode is interface modes, if, then interface command is labeled as very, and write down this interface command title, this is referred to as father's name feature of ordering in this interface command group, then, begin next command is handled execution in step B25;
B25, judge whether the current command is interface modes, if, execution in step B26 then; Otherwise, execution in step B27;
B26, cover the interface command title, begin next group interface process of commands with the current command;
B27, the composition order of the current interface command of traversal from described interface command group table see that to have or not command id and the current command sign identical, if do not have, then revise interface command and are labeled as vacation, the processing end of current interface command; If have, then current interface command name is referred to as father's name feature of this order.
Wherein, among the step B3, described acquisition and extracting parameter comprise:
B31, preservation point to the character stream current location at place, character stream parameter position;
B32, according to the command name that obtains, whether the number of major parameter of judging this order in described major parameter table greater than 0, if, then execution in step B33 and subsequent step, otherwise, execution in step B39 and subsequent step;
B33, in the major parameter table, take out a major parameter in turn; Current location from character stream begins, and takes out a unit that belongs to parameter in this order in turn;
Whether the position of the major parameter that B34, judgement are taken out is defined as-1, if not, execution in step B35 then, otherwise, the next unit that belongs to parameter in the character stream taken out, judge that whether this unit is the keyword of the optional parameters registered in the optional parameters table, if, then extract the major parameter that this may occur, return step B33 then, dispose execution in step B38 until all major parameters to this order; Otherwise the order of this character stream is unusual order, finishes the resolving to this line character stream;
B35, the position of the major parameter that takes out is compared with the position of taking out current character stream unit, if position consistency, then execution in step B36; If the position of major parameter definition is greater than the position of current character stream, then execution in step B37; If less than the position of current character stream, then the order of character stream is unusual order, finishes the resolving to this line character stream in the position of major parameter definition;
B36, the content that current character is flowed the unit extract and preserve as parameter value, return step B33 then, dispose execution in step B38 until all major parameters to this order;
B37, take out the next unit of current character stream unit in turn, return execution in step B35, when the value of two positions is identical till; If when finishing to character stream delegation, it is consistent that the position of these two unit does not still reach, and then the order of character stream is unusual order, finishes the resolving to this line character stream;
B38, be the position that step B31 is preserved with the location restore of character stream;
B39, judge optional parameters number whether greater than 0, if, execution in step B40 then; Otherwise, judge whether the major parameter of this command definition and the number of optional parameters all are-1, if then finish the parameter extraction process;
B40, in the optional parameters table, take out first optional parameters in turn, begin the keyword in the sequential search optional parameters from the current location of character stream; If find keyword, execution in step B41 then; Otherwise if do not find keyword in character stream, then the order of character stream is unusual order, finishes the resolving to this line character stream;
B41, judge whether the position of keyword in character stream is the original position of character stream, if, execution in step B42 then; Otherwise, check then whether the previous character of keyword in the character stream and a back character all are the spaces, if illustrate in the order and disposed this parameter, execution in step B43; Otherwise, return execution in step B40;
If the position of B42 keyword in character stream is the original position of character stream, check then in the character stream whether a character is the space behind the keyword, if, execution in step B43 then; Otherwise, return execution in step B40;
B43, according to the content in the optional parameters table, whether the parameter of judging the parameter of taking out the whether value of one of band value is 0, if then parameter name is extracted; If be 1, then take out the number of parameters information of keyword back from the parameter name field, from character stream, take out the unit of corresponding number, as the parameter value of this keyword heel;
After B44 handled current optional parameters, the position of recovering character stream was the position that step B31 is preserved, and returns step B40, until handling all optional parameters.
As seen, the present invention has following advantage:
1) because the resolving that is configured facility information is carried out on network management workstation, therefore, the present invention is with the parsing of device configuration information and to be configured equipment itself separated, thereby has reduced the dependence of resolving to equipment, has increased the stability of parsing;
2) provide autgmentability: change or order when increasing deletion at the grammer of device command, can not revise the code of equipment, get final product and only the syntactic definition table in the database is upgraded;
3) owing to adopt the form of syntactic definition table to preserve syntactic definition, therefore, can not use DOM model and related libraries to realize resolving, reduce the workload of resolving;
4) definition mode of syntactic definition table makes definition structure simple relatively, and has reduced in resolving the request memory to network management workstation.
Description of drawings
Fig. 1 realizes the flow chart that user configuration information is resolved for utilizing five syntactic definition tables in the embodiment of the invention.
Fig. 2 is the flow chart of the specific implementation of step 102 shown in Figure 1.
Fig. 3 is the flow chart of the specific implementation of step 103 shown in Figure 1.
Fig. 4 is the flow chart of realizing in the step 105 shown in Figure 1 major parameter processing in the configuration information.
Fig. 5 is the flow chart of realizing in the step 105 shown in Figure 1 optional parameters processing in the configuration information.
Embodiment
The present invention is a kind of analytic method of device configuration information, in the method, network management workstation uses predefined syntactic definition in database, the for example user's of Cmd a b c configuration information is carried out dissection process, thereby resolve the command name Cmd that obtains in the user configuration information, and each parameter a, b and c.
Describe the present invention below in conjunction with accompanying drawing.
Before describing the present invention, at first some related among the present invention notions are explained:
1, command mode: this command mode is used to organize the Management Information Base of general character, and an order can belong to a plurality of patterns, as interface modes, privileged EXEC mode etc.;
Though command parameter related in 2 resolvings is numerous, but these parameters can be divided into major parameter (PrimaryPara) and optional parameters (OptionalPara), major parameter is necessary parameter, can extract by the position of this parameter-definition, and can't pass through keyword extraction; Optional parameters generally all has keyword, and the back is immediately following parameter value; Optional parameters also can be with parameter value, with parameter name as parameter value; As expansion, the present invention also supports to wear before the keyword special case of parameter value;
3, legitimacy: consider that the order provisional capital in the configuration information is legal, therefore, in the present invention, whether the parameter that need not in the analysis configuration order again is legal.
In embodiments of the present invention, the database on the employing network management workstation is realized the storage to configuration order collection information, has defined five syntactic definition tables and come stored configuration order and parameter information thereof in this database, and these five syntactic definition tables are respectively:
(1) command mode table (CmdModeTab): be used for the pattern of record order, its definition content comprises:
Command mode (CmdMode), integer; This command mode is 0 or any natural number, in order to describe the pattern of order;
Command id (CmdID), integer; This command id is as the sign (ID) of describing order, and a configuration order only has an ID;
(2) command name and sign correspondence table (CmdNameIDTab): be used to write down an order, its definition content comprises:
CmdID, integer;
Command name (CmdName), character string; This command name is the name of order;
Command type (CmdType), integer; This command type is used to help the type definition of input command;
Order major parameter (CmdPrimary), integer; The major parameter number of expression order;
Order optional parameters (CmdOptional), integer; The optional parameters number of expression order;
(3) major parameter table (PrimaryParaTab): be used for the major parameter of record order, its definition content comprises:
CmdID, integer;
Parameter name (ParaName), character string; Expression parameter name;
Parameter position (ParaIdx), integer; The position of representing this major parameter definition;
(4) optional parameters table (OptionalParaTab): be used for the optional parameters of definition command, its definition content comprises:
CmdID, integer;
ParaName, character string; The title of expression parameter;
Whether parameter band value (ParaSelf), integer, and this ParaSelf non-0 promptly 1, and whether expression parameter back has value; If be 0, expression has only keyword; If be 1, expression keyword back can be a plurality of with parameter value; Under parameter value is a plurality of situation, can follow the tracks of in the parameter name back with certain symbol such as X, identify the parameter value number with the number of X;
(5) interface command group table (IFCmdGrpTab): be used for order in the group under record interface order and this interface command, to realize the hierarchical relationship between the order; Interface command is a kind of order of setting in order to represent the hierarchical relationship between the different command, in actual applications, number order can belong to same order, at this moment, this same order is an interface command, those orders that belong to this same order then can be reduced a group, and all orders in this group belong to son's order of interface command, and this interface command is father's order of all orders in this group; Utilize order in the corresponding different group of different interface commands, in this way, realize definition hierarchical relationship between the different command; The definition content of interface command group table comprises:
Interface command sign (IFCmdID), integer; The CmdID of expression interface command;
Command id (InGrpCmdID) in the group, integer; Be used to represent to belong to the interior ID that orders of some groups that above-mentioned interface command identifies the order of representative.
Above-mentioned five syntactic definition tables except preserving with the form of table, can also utilize the form of XML file to preserve in database, and the content that is write down in this XML file and the above-mentioned syntactic definition table can be changed mutually.
In embodiments of the present invention, suppose and have following command definition:
snmp-server?community?community-name[view?view-name][ro|rw]
Wherein, snmp-server community is a command id, and community-name is the major parameter title, and view is the optional parameters title, the parameter value of view-name for being followed as the view back of keyword, ro and rw are the optional parameters title that parameter value is not followed in the back; In order to be implemented in the database this command definition of storage, about definition, in four syntactic definition tables shown in table 1~table 4, insert the definition of this order to five syntactic definition tables of memory command and parameter information thereof with reference to above-mentioned:
CmdMode ?CmdID
0 0
Table 1 CmdModeTab
?CmdID ?CmdName ?CmdType ?CmdPrimary ?CmdOptional
?0 ?snmp-server ?community ?0 ?1 ?3
Table 2 CmdNameIDTab
?CmdID ?ParaName ?ParaIdx
?0 ?community-name ?0
Table 3 PrimaryParaTab
?CmdID ?ParaName ?ParaSelf
?0 ?View ?1
?0 ?Ro ?0
?0 ?Ro ?0
Table 4 OptionalParaTab
Because in embodiments of the present invention, command definition snmp-server communitycommunity-name[view view-name] [ro|rw] do not relate to the related content of interface command group table, therefore, ginseng is shown in Table 5, and does not comprise the content of this command definition in interface command group table.
IFCmdID ?InGrpCmdID
Table 5 IFCmdGrpTab
In the embodiment of the invention, adopt database script, mentioned order and parameter thereof are inserted in described four tables, for other command definition, also can be according to this method, in five syntactic definition tables that store separately order and parameter information into database respectively;
Referring to shown in Figure 1, in the embodiment of the invention, the syntactic definition of utilizing above-mentioned table 1~table 5 to store, realize the parsing to following user configuration information:
snmp-server?community?public?ro
Specifically may further comprise the steps:
Step 100: network management workstation obtains the configuration information of equipment, and equipment configurations shown information specifically comprises:
Network management workstation sends the order of configurations shown information to the equipment that was disposed by the user by the standard agreement (telnet) that is used for long-range Connection Service, after the equipment of being configured is received this order, the explicit user configuration information, and return user configuration information by the telnet agreement to network management workstation, network management workstation with this user configuration information deposit in buffering area with etc. to be resolved; In this step, if network management workstation is not received the user configuration information that the equipment of being configured returns in the predefined time, perhaps program is made mistakes, and then network management workstation finishes this resolving; After network management workstation obtains to be configured all user configuration informations of equipment, execution in step 101;
Step 101: network management workstation is read the delegation's character string in the configuration information in order from buffering area, judges whether this line character string is null, if, then in buffering area, read the next line character string in order, otherwise, remove the leading space of this character string, execution in step 102 then;
Step 102:, judge whether the order in this line character string of reading registers in the syntactic definition table, if then obtain command name, execution in step 103 according to five above-mentioned syntactic definition tables; Otherwise, return step 101; Certainly, in configuration information, also may comprise comment line,, therefore, in this step, further comprise and judge this row whether with the special identifier of comment line because comment line is not truly a configuration information, as "! " or " // ", beginning is if then return step 101;
Step 103: with the command name end of character stream pointer movement in the configuration information character stream;
Step 104: according to five above-mentioned syntactic definition tables, the command mode in the processing configuration information; Because in embodiments of the present invention, do not comprise the content of relevant command mode in the processed configuration information, therefore, in embodiments of the present invention, this step is not carried out;
Step 105: five syntactic definition tables according to above-mentioned, obtain the parameter information in the configuration information, and obtain parameter from wherein extracting;
Step 106: whether judgement resolves all row in the configuration information finishes, if then finish this resolving, otherwise return step 101, continuation is resolved next line in the configuration information, finishes until all the elements in the configuration information are resolved, and finishes this resolving.
One by one the specific implementation of above-mentioned correlation step is described in detail below.
(1) specific implementation of step 102:
Above-mentioned steps 102 needs to realize judging whether the order in the character string of reading registers in the syntactic definition table, under the situation of having determined command name, make subsequent step from the syntactic definition table, to find this order corresponding parameters and command format, to realize parsing according to the command name that obtains; Because command name can be the unit of a word of a correspondence, it also can be the unit of a plurality of corresponding words, therefore, when processing configuration information, at first in the syntactic definition table, find out the command definition that all have first unit of ordering in the configuration information, in these command definitions, find out command definition then again with preceding two unit of ordering in the configuration information, next find out command definition more therein with first three unit of ordering in the configuration information, in case find unique one with have configuration information in the command definition that conforms to fully of order, then judge to obtain ordering in the configuration information and in the syntactic definition table, register, and obtain the command name of this order, carry out subsequent step then, continue configuration information is handled; If finally the order of not finding any one to conform to fully then finishes the resolving to the current line character string; Referring to shown in Figure 2, concrete treatment step comprises:
Step 201: first unit of ordering in the character string of acquisition current line;
Step 202: in command name and sign correspondence table, be used as in the array of record order title, search all command names that comprise above-mentioned first module; If the number of the command name that finds is 0, be illustrated in command name and the sign correspondence table and do not register this name, execution in step 207, search procedure finishes, and finishes the resolving to the current line character string; If the command name number that finds is 1, then execution in step 203, if the command name number that finds greater than 1, then execution in step 204;
Step 203: the number of judging the component units in the command name that finds, if the component units number is 1, show that the command name in the current line character string conforms to fully with the command name order of finding, then execution in step 208, the command name that judgement obtains in the current line character string is registered in the syntactic definition table, obtains this command name simultaneously; If the component units number of the command name that finds is greater than 1, then execution in step 205~206: all unit that take out this command name, compare one by one with all unit of command name in the current line character string, if all identical, then execution in step 208, and the command name that judgement obtains in the current line character string is registered, and obtain this command name, otherwise execution in step 207 is judged the not registration of command name that obtains in the current line character string;
Step 204: take out the command name that finds one by one, judge according to the described method of step 203 and step 205~206 whether the command name of current line character string is registered; In this step, if the command name of current line character string does not all conform to fully with all command names that find, then execution in step 207, judge to obtain the not registration of this current line character string command title, finish the resolving to the current line character string.
(2) specific implementation of step 103:
Step 103 allows character stream move to command name end, thereby makes character stream be in the parameter position in order to according to command name processing character stream; Its specific implementation step is:
A. unit number in the calculation command title;
B. judge whether the unit number equals 1 in the command name, if, therefore, do not need to be moved further pointer because the current pointer of character string buffering area has pointed to the end of command name; Otherwise, take out each unit in the command name one by one, and respectively the pointer position of character string buffering area be modified to the next unit of current retrieval unit successively.
(3) specific implementation of step 104:
Step 104 is used to handle the content relevant with command mode, before step 104 is handled, interface command is labeled as vacation, and referring to shown in Figure 3, concrete treatment step comprises:
Step 300: judge that interface command marks whether to be vacation, if show the processing of before current interface command is handled, not carrying out interface command, then direct execution in step 301; If not, show the processing of before current interface command is handled, having carried out interface command, execution in step 302;
Step 301: the pattern of taking out the current command correspondence, as command mode is interface modes, then interface command is labeled as very, and write down this interface command title, this is referred to as father's name feature of ordering in this interface command group, this interface command is disposed, begin next command is handled, execution in step 302;
Step 302: judge whether the current command is interface modes, if then execution in step 303; Otherwise, execution in step 304;
Step 303: because the pattern of the current command is also to be to show interface modes order in the group of a last interface command has been disposed, therefore, in this step, cover the interface command title, begin next group interface process of commands with the current command;
Step 304~step 307: the composition order of the current interface command of traversal from Table I FCmdGrpTab, see and have or not command id to identify identical: if order does not belong to current interface command with the current command, then revise interface command and be labeled as vacation, the processing of current interface command finishes; If there is order to belong to current interface command, then current interface command title is filled into father's name feature of this order.
Following order is for example arranged:
interface?interface-name
nat?reset
Wherein, nat reset is the interior order of the group of interface command interface, then A3 is when handling nat reset, from IFCmdGrpTab, order all corresponding records with interface, search therein and whether comprise corresponding sign with nat reset, the result is then father's characteristic of order nat reset to be extended this as interface.
(4) specific implementation of step 105:
Step 105 is as Parameter Extraction, and command syntax definition of the present invention will reduce the complexity of resolving greatly; Before the performing step to step 105 is described in detail, at first the parameter situation that might occur in the order is described:
First kind of situation:
There is following order:
[order] A[B] [KEY1 C D] [KEY2 E]
Wherein, parameter A is a major parameter, must occur in this order; B parameter is a kind of special major parameter, this parameter is not owing to be with keyword, therefore can not be classified as optional parameters one class, but this parameter may not occur in order, therefore, such parameter is classified as special major parameter, and for example two continuous situations can not appear in the major parameter of this class of B parameter in an order;
Parameters C, D are optional parameters, just can occur when keyword KEY1 occurs, because parameters C and D belong to same keyword KEY1, therefore, they can be gathered together in order, with half grammer record of corresponding minimizing; Parameter E is an optional parameters, just occurs when keyword KEY2 occurs;
In order to extract the parameter in the above order, can carry out in the following manner:
Major parameter A can point out by the position, is 0 as position that can designated parameter A, then gets first unit after order, gets final product as the value of parameter A;
Whether B parameter is a major parameter, but because it can not occur, therefore, can not obtain it from positional information and occur, and in order to reduce to resolve the needed grammer record of this type of parameter, the location definition with B parameter is-1 especially; Whether whether B occur and can have keyword KEY1 or KEY2 to decide after checking B: if behind the B immediately following KEY1 or KEY2, parameter value that then can extracting parameter B;
Elder generation's locator key speech KEY1 when extracting parameter C, D, two unit finding out thereafter get final product as its parameter value preservation;
Extracting parameter E can be according to carrying out for the processing of parameters C and D is similar.
Second kind of situation:
[order] A[B]
Parameter A is a major parameter, is ordering pertinent making now;
B parameter is a major parameter, might not occur in order;
Extraction for parameter A can be carried out according to the processing method in above-mentioned first kind of situation, key is to handle for the extraction of B parameter, when handling, in the grammer record, B also is defined as major parameter, in the real process, if the parameter A back also has a unit, show that then B occurs in this order, extracting parameter B; Otherwise show that B does not occur in this order.
In order to be implemented under above-mentioned two kinds of situations, equal correct extracting parameters, referring to Fig. 4 and shown in Figure 5, step 105 adopts following steps to come specific implementation:
Referring to shown in Figure 4, realize in the step 105 step that major parameter in the configuration information is handled is comprised:
Step 401: preserve the current location of character stream, the parameter position place of this current location for the character stream pointer being pointed to by step 103;
Step 402 is according to the command name that is obtained by step 102, whether the number of major parameter of judging this order in the major parameter table is greater than 0, if, then execution in step 403 and subsequent step, begin to extract major parameter, otherwise, beginning to extract optional parameters according to the optional parameters table of this command name correspondence, this process is referring to shown in Figure 5;
Step 403: take out a major parameter in the major parameter table in turn: the current location from character stream begins, and takes out a unit that belongs to parameter in this order in turn;
Step 404: whether the position of judging the major parameter that takes out is defined as-1, if not, then execution in step 405, otherwise, execution in step 409~410: take out the next unit that belongs to parameter in the character stream, judge that whether this unit is the keyword of the optional parameters registered in the optional parameters table, if, show that then this major parameter that may occur occurs in character stream, extract the major parameter that this may occur, return step 403 then, dispose until all major parameters to this order, the leaching process of optional parameters is carried out in beginning according to flow process shown in Figure 5; Otherwise, execution in step 407: judge that the order that obtains this character stream is unusual order, finishes the resolving to this line character stream;
Step 405: the position of the major parameter that takes out is compared with the position of taking out current character stream unit, if position consistency, then execution in step 406; If the position of major parameter definition is greater than the position of current character stream, then execution in step 408; If less than the position of current character stream, then execution in step 407 in the position of major parameter definition: judge that the order that obtains character stream is unusual order, finishes the resolving to this line character stream;
Step 406: the content that current character is flowed the unit extracts and preserves as parameter value, returns step 403 then, disposes until all major parameters to this order, and beginning is carried out the extraction of optional parameters according to flow process shown in Figure 5;
408 take out the next unit of current character stream unit in turn, return execution in step 405, when the value of two positions is identical till; If when finishing to character stream delegation, it is consistent that the position of these two unit does not still reach, and then the order of character stream is unusual order, finishes the resolving to this line character stream;
Referring to shown in Figure 5, realize in the step 105 step that optional parameters in the configuration information is handled is comprised:
Step 501: with the location restore of character stream is the position that step 401 is preserved, just with the parameter position place of character stream location restore to character stream;
Step 502: whether the number of judging optional parameters is greater than 0, if then execution in step 503; Otherwise, judge whether the major parameter of this command definition and the number of optional parameters all are-1, if represent that this order not with any parameter, then finishes the parameter extraction process;
Step 503~step 504: in the optional parameters table, take out optional parameters in turn, begin the keyword in the sequential search optional parameters from the current location of character stream; If find keyword, then execution in step 505; Otherwise then the order of character stream is unusual order, finishes the resolving to this line character stream;
Step 505: judge whether the position of keyword in character stream is the original position of character stream, if then execution in step 506; Otherwise execution in step 507: whether a previous character and a back character of checking keyword in the character stream all are the spaces, if illustrate in the order and disposed this parameter, execution in step 508; Otherwise, illustrate that the keyword that finds is the part character of a unit, do not dispose this parameter in the order, return execution in step 503;
Step 506: check in the character stream whether a character is the space behind the keyword, if then disposed this parameter, execution in step 508 in the explanation order; Otherwise, illustrate that the keyword that finds is the part character of a unit, do not dispose this parameter in the order, return execution in step 503;
Step 508~step 510: judge whether the ParaSelf value of taking out parameter is 0, if illustrate that then this optional parameters need not only parameter name to be extracted with parameter value; If the ParaSelf value of parameter is 1, illustrate that then there is parameter this optional parameters back, from the number of parameters information of parameter name field taking-up keyword back, from character stream, take out the unit of corresponding number, as the parameter value of this keyword heel;
Step 511: after handling current optional parameters, the position of recovering character stream is the position that step 401 is preserved, and returns step 503, until handling all optional parameters.
The above only is preferred embodiment of the present invention, and is in order to restriction the present invention, within the spirit and principles in the present invention not all, any modification of being done, is equal to replacement, improvement etc., all should be included within protection scope of the present invention.

Claims (11)

1, a kind of device configuration information analytic method is characterized in that this method may further comprise the steps:
Network management workstation obtains the configuration information character stream of equipment, according to the syntactic definition that is kept at the syntactic definition table that includes equipment disposition command set information in the network management workstation database, resolve the configuration information character stream of this equipment, obtain the command name and the parameter that comprise in the described character stream;
Described syntactic definition table comprises at least: the command mode table that is used for the definition command pattern; Be used to define the command name and the sign correspondence table of command name, command type, major parameter number and the optional parameters number of each order; The major parameter table that is used for the major parameter Name ﹠ Location of definition command; Be used for the whether optional parameters table of band value of definition command optional parameters title, optional parameters.
2, method according to claim 1 is characterized in that, described syntactic definition table further comprises:
The interface command group table that is used for command id in the group under defining interface command id and this interface command;
Wherein, in described command mode table, command name and sign correspondence table, major parameter table and optional parameters table, also comprise the command id of ordering in the configuration information.
3, method according to claim 1 is characterized in that, described syntactic definition table is kept in the database of network management workstation.
4, method according to claim 3 is characterized in that described syntactic definition table is kept in the database of network management workstation and is: network management workstation is inserted into the syntactic definition of all configuration order collection information in the syntactic definition table in the database by database script.
5, method according to claim 1 is characterized in that, described syntactic definition table is kept in the network management workstation by extending mark language.
6, method according to claim 1 is characterized in that described network management workstation obtains the configuration information character stream and comprises:
Network management workstation issues the order of configurations shown information by being used for the standard agreement telnet of long-range Connection Service to equipment; Equipment is received this order, configurations shown information, and return the configuration information character stream to network management workstation by the telnet agreement, network management workstation is kept at buffering area with the configuration information character stream.
7, method according to claim 2 is characterized in that described parsing comprises:
B1, network management workstation read in the configuration information character stream line by line, judge according to the content in the described syntactic definition table whether the order in this row configuration information registers, if, execution in step B2 then; Otherwise, finish the parsing of current line, return step B1;
B2, network management workstation finish the processing to the command name of configuration information character stream, according to the content in the described syntactic definition table, the command mode in the processing configuration information;
B3, according to the content in the described syntactic definition table, obtain and extract the parameter in the configuration information; Return execution in step B1, until all row of handling configuration information.
8, method according to claim 7 is characterized in that, among the step B1, describedly judges whether order has registered and comprises:
First unit of ordering in the character string of B11, acquisition character stream current line;
B12, be used as in the array of record order title in the correspondence table, search all command names that comprise above-mentioned first module in command name and sign; If the number of the command name that finds is 0, be illustrated in command name and the sign correspondence table and do not register this name, search procedure finishes, and finishes the resolving to the current line character string; If the command name number that finds is 1, execution in step B13 then, if the command name number that finds greater than 1, execution in step B14 then;
The number of the component units in the command name that B13, judgement are found, if the component units number is 1, show that the command name in the current line character string conforms to fully with the command name order of finding, judge that then the command name obtain in the current line character string registers in the syntactic definition table, obtain this command name simultaneously; If the component units number of the command name that finds is greater than 1, then take out all unit of this command name, compare one by one with all unit of command name in the current line character string, if it is all identical, judge that then the command name obtain in the current line character string registers, and obtain this command name, otherwise judgement obtains the not registration of command name in the current line character string;
B14, take out the command name find one by one, judge according to the described method of step B13 whether the command name of current line character string is registered, if the command name of current line character string does not all conform to fully with all command names that find, then judge to obtain the not registration of this current line character string command title; Otherwise the command name that judgement obtains in the current line character string is registered.
9, method according to claim 7 is characterized in that, among the step B2, described end is treated to network management workstation with the command name end of character stream pointer movement to the configuration information character stream to the command name of configuration information character stream, specifically comprises:
Unit number in B21, the calculation command title;
B22, judge whether the number of command name equals 1, if, moving hand not; Otherwise, take out each unit in the command name one by one, and respectively the pointer position of character string buffering area be modified to the next unit of current retrieval unit successively.
10, method according to claim 7 is characterized in that, among the step B2, described processing command pattern comprises:
B23, judge whether interface command is labeled as vacation, if, direct execution in step B24 then; If not, execution in step B25, wherein, interface command is carrying out being marked as vacation before the described processing command pattern;
The pattern of B24, taking-up the current command correspondence, judge whether command mode is interface modes, if, then interface command is labeled as very, and write down this interface command title, this is referred to as father's name feature of ordering in this interface command group, then, begin next command is handled execution in step B25;
B25, judge whether the current command is interface modes, if, execution in step B26 then; Otherwise, execution in step B27;
B26, cover the interface command title, begin next group interface process of commands with the current command;
B27, the composition order of the current interface command of traversal from described interface command group table see that to have or not command id and the current command sign identical, if do not have, then revise interface command and are labeled as vacation, the processing end of current interface command; If have, then current interface command name is referred to as father's name feature of this order.
11, method according to claim 7 is characterized in that, among the step B3, described acquisition and extracting parameter comprise:
B31, preservation point to the character stream current location at place, character stream parameter position;
B32, according to the command name that obtains, whether the number of major parameter of judging this order in described major parameter table greater than 0, if, then execution in step B33 and subsequent step, otherwise, execution in step B39 and subsequent step;
B33, in the major parameter table, take out a major parameter in turn; Current location from character stream begins, and takes out a unit that belongs to parameter in this order in turn;
Whether the position of the major parameter that B34, judgement are taken out is defined as-1, if not, execution in step B35 then, otherwise, the next unit that belongs to parameter in the character stream taken out, judge that whether this unit is the keyword of the optional parameters registered in the optional parameters table, if, then extract the major parameter that this may occur, return step B33 then, dispose execution in step B38 until all major parameters to this order; Otherwise the order of this character stream is unusual order, finishes the resolving to this line character stream;
B35, the position of the major parameter that takes out is compared with the position of taking out current character stream unit, if position consistency, then execution in step B36; If the position of major parameter definition is greater than the position of current character stream, then execution in step B37; If less than the position of current character stream, then the order of character stream is unusual order, finishes the resolving to this line character stream in the position of major parameter definition;
B36, the content that current character is flowed the unit extract and preserve as parameter value, return step B33 then, dispose execution in step B38 until all major parameters to this order;
B37, take out the next unit of current character stream unit in turn, return execution in step B35, when the value of two positions is identical till; If when finishing to character stream delegation, it is consistent that the position of these two unit does not still reach, and then the order of character stream is unusual order, finishes the resolving to this line character stream;
B38, be the position that step B31 is preserved with the location restore of character stream;
B39, judge optional parameters number whether greater than 0, if, execution in step B40 then; Otherwise, judge whether the major parameter of this command definition and the number of optional parameters all are-1, if then finish the parameter extraction process;
B40, in the optional parameters table, take out first optional parameters in turn, begin the keyword in the sequential search optional parameters from the current location of character stream; If find keyword, execution in step B41 then; Otherwise if do not find keyword in character stream, then the order of character stream is unusual order, finishes the resolving to this line character stream;
B41, judge whether the position of keyword in character stream is the original position of character stream, if, execution in step B42 then; Otherwise, check then whether the previous character of keyword in the character stream and a back character all are the spaces, if illustrate in the order and disposed this parameter, execution in step B43; Otherwise, return execution in step B40;
If the position of B42 keyword in character stream is the original position of character stream, check then in the character stream whether a character is the space behind the keyword, if, execution in step B43 then; Otherwise, return execution in step B40;
B43, according to the content in the optional parameters table, whether the parameter of judging the parameter of taking out the whether value of one of band value is 0, if then parameter name is extracted; If be 1, then take out the number of parameters information of keyword back from the parameter name field, from character stream, take out the unit of corresponding number, as the parameter value of this keyword heel;
After B44 handled current optional parameters, the position of recovering character stream was the position that step B31 is preserved, and returns step B40, until handling all optional parameters.
CNB031575676A 2003-09-24 2003-09-24 Information analytical method for facility configuration Expired - Fee Related CN100346606C (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CNB031575676A CN100346606C (en) 2003-09-24 2003-09-24 Information analytical method for facility configuration

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CNB031575676A CN100346606C (en) 2003-09-24 2003-09-24 Information analytical method for facility configuration

Publications (2)

Publication Number Publication Date
CN1601969A CN1601969A (en) 2005-03-30
CN100346606C true CN100346606C (en) 2007-10-31

Family

ID=34660362

Family Applications (1)

Application Number Title Priority Date Filing Date
CNB031575676A Expired - Fee Related CN100346606C (en) 2003-09-24 2003-09-24 Information analytical method for facility configuration

Country Status (1)

Country Link
CN (1) CN100346606C (en)

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100411340C (en) * 2005-07-27 2008-08-13 腾讯科技(深圳)有限公司 Method and apparatus for quickly obtaining on-line enterprise information
US8549494B2 (en) * 2007-06-28 2013-10-01 Symantec Corporation Techniques for parsing electronic files
CN102148825B (en) * 2011-01-28 2013-07-31 清华大学 Method and device for configuring and analysing dynamic protocol
CN102857355B (en) * 2011-06-27 2018-07-13 中兴通讯股份有限公司 A kind of method and device of message adaptation
CN107301207B (en) * 2017-06-02 2020-04-17 北京天融信网络安全技术有限公司 Method and device for analyzing XML
CN109558590B (en) * 2018-11-23 2022-11-15 中国人民解放军63789部队 Method for positioning key fault device based on spacecraft remote measurement parameter word segmentation
CN111045766B (en) * 2019-11-25 2022-07-01 杭州迪普科技股份有限公司 Method and device for outputting prompt information based on command line interface

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1394036A (en) * 2001-06-21 2003-01-29 华为技术有限公司 Network management system based on strategy
CN1412995A (en) * 2002-10-16 2003-04-23 华为技术有限公司 Information management method in data communication equipment
WO2003044699A1 (en) * 2001-11-21 2003-05-30 Enterasys Networks, Inc. Translating configuration files among network devices

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1394036A (en) * 2001-06-21 2003-01-29 华为技术有限公司 Network management system based on strategy
WO2003044699A1 (en) * 2001-11-21 2003-05-30 Enterasys Networks, Inc. Translating configuration files among network devices
CN1412995A (en) * 2002-10-16 2003-04-23 华为技术有限公司 Information management method in data communication equipment

Also Published As

Publication number Publication date
CN1601969A (en) 2005-03-30

Similar Documents

Publication Publication Date Title
CN100337407C (en) Method and system for compressing structured descriptions of documents
CN1198220C (en) Method and apparatus for populating multiple data marts in single aggregation process
CN1306441C (en) Data processing method and appts.
CN1606743A (en) Index structure of metadata, method for providing indices of metadata, and metadata searching method and apparatus using the indices of metadata
CN1260665C (en) Electronic apparatus for managing changeable storage medium, method thereof and storage medium
CN1924858A (en) Method and device for fetching new words and input method system
CN1615480A (en) Translating configuration files among network devices
CN1315017A (en) Difference extraction between two versions of data-tables containing intra-reference
CN101069181A (en) Storage device and recording medium
CN1591403A (en) Edition compatible data processing system
CN1647076A (en) Method and apparatus for querying relational databases
CN101030157A (en) Method and system for updating user vocabulary synchronouslly
CN1672150A (en) Views for software atomization
CN1229944A (en) System and method for reducing footprint of preloaded classes
CN1768325A (en) Rule application management in an abstract database abstract of the disclosure
CN1946235A (en) User identifying module service and method and system for using personalized tailered issuing
CN101046812A (en) Method of data base table recording structure and detection and its device
CN1858742A (en) Method and system for realizing update data in real time data bank
CN1584884A (en) Apparatus and method for searching data of structured document
CN101047733A (en) Short message processing method and device
CN1526104A (en) Parsing structured data
CN100346606C (en) Information analytical method for facility configuration
CN1664816A (en) Method for realizing transplantation between information websites of different platforms
CN1942931A (en) Audio bitstream format in which the bitstream syntax is described by an ordered transveral of a tree hierarchy data structure
CN1163836C (en) Image information search device, image data-base device, and image imformation storage device

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20071031

Termination date: 20150924

EXPY Termination of patent right or utility model