CN1946039A - Method and device for analyzing command line back display information based on template volume - Google Patents

Method and device for analyzing command line back display information based on template volume Download PDF

Info

Publication number
CN1946039A
CN1946039A CN 200610145465 CN200610145465A CN1946039A CN 1946039 A CN1946039 A CN 1946039A CN 200610145465 CN200610145465 CN 200610145465 CN 200610145465 A CN200610145465 A CN 200610145465A CN 1946039 A CN1946039 A CN 1946039A
Authority
CN
China
Prior art keywords
template
template set
echo message
module
coupling
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.)
Granted
Application number
CN 200610145465
Other languages
Chinese (zh)
Other versions
CN100561942C (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.)
New H3C Technologies Co Ltd
Original Assignee
Hangzhou Huawei 3Com 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 Hangzhou Huawei 3Com Technology Co Ltd filed Critical Hangzhou Huawei 3Com Technology Co Ltd
Priority to CNB2006101454651A priority Critical patent/CN100561942C/en
Publication of CN1946039A publication Critical patent/CN1946039A/en
Application granted granted Critical
Publication of CN100561942C publication Critical patent/CN100561942C/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

This invention relates to an analysis method for back-display information of command lines based on a templet set, which matches the back-display information and templets of the set hierarchically and stores the matched parameter information according to the centralized relative hierarchical relation of templets when the match is finished. This invention includes a service module: executing the analysis module and storing the result, a templet set storage module: storing pre-set templet set files, an analysis module: analyzing the back-display information of the command lines based on the templet set corresponding to the storage module, which analyzes the back-display information one by one using the hierarchical templet set.

Description

Order line echo message analytic method and device based on template set
Technical field
The present invention relates to a kind of order line echo message analytic method and device, method and device that the default template set of especially a kind of basis is resolved the order line echo message belong to the digital communication field.
Background technology
In the digital communication field, generally comprise equipment such as switch and router, these equipment are managed the following three kinds of modes that mainly contain:
(1) order line it be a kind of textual interface interactive mode that the network equipment provides, very big flexibility is arranged.Equipment is all supported by modes such as serial ports, Telnet, dialing at present, terminal or terminal-emulation software link to each other by the control mouth of serial ports on the computer and switch, the command line interface of access switch, equipment can be at display terminal echo prompt, the user is in the corresponding order of display terminal input, the command analysis module will be resolved the order of input, the equipment fill order and echo as a result on the terminal that shows, as shown in Figure 1, imported order " display device " at display terminal, the result of command execution by echo to display terminal.
(2) NMP or webmaster are formed by Network Management Station with by the network element of pipe (also claiming managed device) two parts based on the network management of TCP/IP.This two-part communication protocol is called NMP, and NMP is Simple Network Management Protocol (Simple Network Management Protocol is called for short SNMP) the most widely at present.By the management of NMP realization, can use unified method to manage to equipment.Webmastering software is that a cover can be used for monitoring and the software of supervising the network and equipment thereof, has pattern manipulation interface usually, has user interface preferably.Present webmastering software majority is realized the management of equipment by snmp protocol.
(3) WEB mode WEB browser mode can be passed through the outband management interface, also can be by virtual interface management in the configuration band.Can use at intranet and extranet, but can increase the burden of front end, and configuration is complicated, usefulness less.
In above-mentioned 3 kinds of modes of management equipment,, limited aspect versatility though SNMP and webmastering software user interface are friendly and as standard the unified method management is arranged.Some producers may protect privately owned node, and some old equipment may not supported the function of snmp management on the other hand, and this has caused the restriction that webmaster is used.Order line way to manage versatility is better, equipment all can manage by order line, but it is friendly inadequately that the textual interface that it uses is compared with the graphical interfaces in modern times, and its there is no fixed standard in form, the order line form of distinct device may be quite different, is difficult to use unified method to manage.The echo message of order, behind input command among Fig. 1 " display device ", the echo message of order is compared with order and is more random, and the keeper also needs irrelevant information is filtered.
Adopt webmastering software at present, must be with unified form display device information on the page, this just need provide a kind of general mechanism, can discern the otherness of this order line, make that webmastering software can be in the echo message of distinct device order line, extract the field of identical meanings, with convenient management to distinct device.Prior art also exists deficiency for the echo message aspect of resolving the distinct device order, therefore needs a kind of order line echo message to distinct device to resolve, with the order difference of automatic adaptation configuration device, different vendor.
Summary of the invention
The invention provides a kind of order line echo message analytic method and device based on template set, solve and use webmastering software to be difficult to the problem that the order line echo message is resolved in the prior art, make things convenient for webmastering software to pass through command line mode, configuration or running status to equipment are obtained and are managed, and can realize distinct device is carried out the purpose of unified management.
To achieve these goals, the invention provides a kind of order line echo message analytic method, comprising: the template of order line echo message and template set is mated based on template set; According to the result of the master module of order line echo message and template set coupling, subsequent commands row echo message is carried out the follow-up coupling of this template set, or does the processing of resolving failure; The parameter of coupling is preserved by the relative hierarchical relationship of template in template set; Parameter acquisition device configuration information according to coupling; Wherein, described template set is made of one or more templates; It is master module that described template set is specified a template.
In the technique scheme, also comprise: when the master module of order line echo message and subtemplate collection was complementary, subsequent commands row echo message carried out the follow-up coupling of this subtemplate collection.
In the technique scheme, the described order line echo message is mated with the template of template set comprises: whether the root node of judging the command header of an echo message of order line echo message and template is consistent, if not, then carries out next template; Otherwise judge whether the order echo message after the removal command header is consistent with a branch node of template, is that then the match is successful, otherwise all inconsistent with all branch nodes, be revised as the preceding order echo message of root node, carry out next template.
In the technique scheme, described follow-up coupling also comprises: will may mate from template with the be complementary subsequent commands row echo message of order line echo message and one to multiple of master module of master module; Wherein, described is master module other template in addition from template.
In the technique scheme, described follow-up coupling further comprises: will be with master module or from template be complementary the subsequent commands row echo message of order line echo message and master module or from one to multiple follow-up template of template with may follow-up template mate.
In the such scheme, when matching follow-up template and/or may follow-up template the time, follow-up template and parameter that may follow-up template are saved in the parameter information of a last template.
In the technique scheme, also comprise: whether the conditional expression in the Rule of judgment template meets the demands, if meet the demands then open template and/or subtemplate collection in the condition template, otherwise next bar template of executive condition template.
During for the master module of next straton template set, carry out the follow-up coupling of next straton template set from template when what subsequent commands row echo message was complementary.The follow-up coupling of described next straton template set comprises:
A) use current straton template set that the order line echo message is mated;
B) judge whether have template and order line echo message to be complementary in the current straton template set, if carry out c), otherwise carry out e);
C) judge whether the template that the match is successful in the current straton template set is from template, if not, then preserve the parameter of coupling; If then carry out d);
D) judge whether the template that the match is successful in the current straton template set is the master module of working as next straton template set of anterior layer, if not, then preserves the parameter of coupling; If, current straton template set is updated to next straton template set when anterior layer, work as the follow-up coupling of next straton template set of anterior layer;
E) judge whether current straton template set is the ground floor of template set,, otherwise current straton template set is updated to last layer subtemplate collection when anterior layer, carry out a) if then it fails to match.
The present invention also provides a kind of device that the order line echo message is resolved that is used for, and comprising: business module: be connected with parsing module, be used for according to the template set title of input and the address information of equipment, carry out parsing module and preserve the result that parsing module is carried out; Template set memory module: be connected with parsing module, be used to store the template set file that sets in advance; Parsing module: be used for the order line echo message being resolved according to the template set of template set memory module correspondence.
The present invention proposes a kind of order line echo message analytic method and device,, adopt the mode of layering and matching, when the match is successful, preserve the parameter information of template matches by each template of order line echo message and template set is mated based on template set; When all matching, all templates do not return; The parameter layering of coupling is kept at the position of each template correspondence, can obtains the comparatively unified result of standard, can set in advance different template sets according to the difference of device command row version information to the distinct device version.Because this method adopts the method for layering and matching that echo message is resolved one by one, can travel through template set up to obtaining the path that a template is successfully mated, and match relevant parameters information.The present invention has satisfied the demand that webmastering software utility command line pipe is managed digital communication equipment, enlarged the scope of webmastering software management equipment, support management by the mode that increases template to new equipment, provide great flexibility for the issue of webmaster product and function expand, can effectively solve and use webmastering software to be difficult to the order line echo message is resolved and the problem of the deficiency that prior art is resolved in the prior art.
Below by drawings and Examples, technical scheme of the present invention is described in further detail.
Description of drawings
Fig. 1 is a prior art order line echo message schematic diagram;
Fig. 2 is the flow chart that the present invention is based on the order line echo message analytic method of template set;
Fig. 3 is this method embodiment template schematic diagram;
Fig. 4 is this method embodiment template set schematic diagram;
Fig. 5 is the embodiment flow chart that each template of this method and delegation's echo message mate;
Fig. 6 is the flow chart of the follow-up coupling of this method subtemplate collection;
Fig. 7 is used for the device embodiment schematic diagram that the order line echo message is resolved for the present invention;
Fig. 8 is apparatus of the present invention preferred embodiment schematic diagram.
Embodiment
Fig. 2 is the flow chart that the present invention is based on the order line echo message analytic method of template set.As shown in Figure 2, this method comprises:
The template of order line echo message and template set is mated; According to the result of the master module of order line echo message and template set coupling, subsequent commands row echo message is carried out the follow-up coupling of this template set, or does the processing of resolving failure; The parameter of coupling is preserved by the relative hierarchical relationship of template in template set; Parameter acquisition device configuration information according to coupling; Wherein, described template set is made of one or more templates; It is master module that described template set is specified a template.When the master module of order line echo message and template set was complementary, subsequent commands row echo message carried out the follow-up coupling of this template set; When all templates of order line echo message and template set all do not match, resolve failure, finish.
This method has proposed a kind of order line echo message analytic method based on template, by each template of order line echo message and template set is mated, adopts the mode of layering and matching, preserves the parameter information of template matches when the match is successful; When all matching, all templates do not finish.The template parameter of coupling is preserved by the relative hierarchical relationship of this template in template set, can be obtained the comparatively unified result of standard, and, can travel through template set up to obtaining the path that a template is successfully mated owing to adopt the method for layering and matching.The present invention resolves echo message one by one by the template set matching algorithm of layering, can obtain the comparatively unified result of standard to the distinct device version, satisfy the demand that webmastering software utility command line pipe is managed digital communication equipment, enlarged the scope of webmastering software management equipment.Support management to new equipment by the mode that increases template, this characteristic provides great flexibility for the issue of webmaster product and function expand.
Fig. 3 is the schematic diagram of embodiment template in this method.Each template has been expressed the feature of an order line echo message that is complementary with it among the present invention, and the position appears in title, parameter type and the parameter of the parameter that need therefrom extract.
Article one, template mainly comprises following essential element:
(1) the root node keyword mates during parsing fully, and a template comprises a root node, and acl as shown in Figure 3 is the root node keyword;
(2) the branch node keyword mates during parsing fully, and a template can comprise one or more branch nodes, as the number among Fig. 3, match-order.
(3) variable name is represented variable name with the name of ' ' number beginning, but is not comprised ': ' with the rear section, as.During coupling from the delegation's echo message that matches value.
(4) braces, braces have comprised one or more branches, and each branch is by ' | ' number separation.Number be separated into two branches as the template in the braces among Fig. 3 by ' | ': " number$number:IntRange[2000; 3999] [match-order $matchOrder:MatchOrder] " and " number $number:IntRange[3000,5999] ".With braces in a plurality of branches can multiselect one when mating, therefrom select a branch and mate, as long as the match is successful for selected branch and actual echo message.
(5) bracket, bracket have comprised one or more sub-branches, and each sub-branch is by ' | ' number separation.Can select a sub-branch match or do not match content in the bracket during coupling.
(6) types of variables is used to describe possible value of variable or feature etc.With the title of ': ' beginning, modified Bian Liang $matchOrder behind the variable name as the MatchOrder type.
Braces and bracket can carry out multinest in the template, and the types of variables support is self-defined, is customization type as type MatchOrder, can enumerate its all possible value in its definition.
According to the template of structure, we can be abstract with the template of Fig. 3 is two root nodes that element: acl is a template, is a multi-branch node in the braces.This branch node continues to be subdivided into two sub-branches again.Can continue to divide according to this building method, be divided fully up to all branch nodes.
Fig. 4 is an embodiment template set schematic diagram.The template of a plurality of parsings is formed template set.Template set of the present invention also comprises the relational tags of the mutual restriction relation between each template of expression, by relational tags correlative template is used when needed together to finish the parsing of a specific transactions content.
Resolve template set for one and can comprise following relational tags:
1. template set label: TemplSet can nested other any label under it, comprises that it is that template set can comprise the subtemplate collection itself, and the subtemplate collection can comprise iteration subtemplate collection, and the rest may be inferred.As shown in Figure 4, the template set name is called " basic Acl ".
2. master module label: Main is nested in a master module in this template set of expression under the template set label.As shown in Figure 4, acl has used the main label, so use as master module.
3. from template label: Templ, corresponding with Main, represent a common templates in this template set.As shown in Figure 4, what rule used is the templ label, as using from template.
4. follow-up template label: Succeed can follow at the master module label, after template label, follow-up template label, the follow-up template label of possibility, has a kind of inevitable ordinal relation between an expression and the top template.As shown in Figure 4, the template in the label Succeed is follow-up template, follows in master module acl back the follow-up template of expression master module acl.
5. possibility follow-up template label: MaySucceed can follow at the master module label, after template label, follow-up template label, the follow-up template label of possibility, has a kind of non-inevitable ordinal relation between an expression and the top template.As shown in Figure 4, the template in the label MaySucceed is the follow-up template of possible, and following template (2) and the template after template (3) in the master module back all is possible follow-up template.
6. condition label: Cond, control is to the use of template under it and template set, judges whether to open template under it by the evaluation to conditional expression.Can nested all other any labels, comprise it oneself.
What comprise in above-mentioned each relational tags is dissimilar templates, and for example: the template between the MaySucceed label is possible follow-up template, being between the Templ label from template, and a template set can define a master module and some from template.
As can be seen from Figure 4, this template set has mainly comprised two templates, and template name is respectively acl and rule.Master module acl has followed the back two follow-up templates 1,2, if the expression master module matches a current line command echo message, back two line command echo message may mate with template 1,2 respectively so; Also may template 2 directly mate next line, template 1 is not done coupling, this is the inevitable ordinal relation because of a follow-up template representation and a last template, and for the follow-up template of possibility, represents that then may there be, also may exist the follow-up template of possibility in a template back.
The embodiment flow chart that Fig. 5 mates for each template in this method and delegation's echo message.Each template of template set comprises root node and one or more branch node, and described each template with order line echo message and template set is mated and comprised:
The command header of order line echo message and the root node of template are mated;
Judge whether command header is consistent with root node,, carry out next template if inconsistent then it fails to match; Otherwise the branch node that the order line echo message is removed after the command header with template mates;
Judge whether the order line echo message after the removal command header is consistent with a branch node, and if not, then it fails to match for all branch nodes, be revised as the preceding order line echo message of root node coupling, carry out next template; If then the match is successful, preserve the parameter information of coupling, carry out next template.
For example: mate for the template among the echo message acl number 2005 match-order auto of delegation and Fig. 3, at first the command header acl of this echo message is consistent with the root node of template, to remove the echo message after the command header then, promptly " number 2005 match-order auto " mate with the branch node of Fig. 3, can match the previous branch node in the braces, " number$number:IntRange[2000; 3999] [match-order$matchOrder:MatchOrder], match two parameter value: number:2005 at last; MatchOrder:auto.After every order line echo message and the template matches success, can collect the parameter information that matches, the result is with parameter name and parameter value is corresponding preserves, and name corresponds to the variable name in the template, and parameter value corresponds to the character string that matches from the echo row.With template is abstract be the node chained list after, just can be by beginning to travel through the template branch node from the template root node, up to obtaining all successful paths of coupling of all nodes, and therefrom extract the relevant parameters value information.Template set is made up of some templates, every capable echo message is with corresponding with the corresponding templates preservation with parameter value of the parameter name that matches, like this, finish whole parsing of echo message, can see the parameter information that each template matches arrives clearly, owing to preserve in the hierarchical position of template set according to each template when preserving, so also layer representation of last analysis result, well arranged, be easy to read.
In this method, when described template set comprises the subtemplate collection, also comprise: when the master module of order line echo message and subtemplate collection was complementary, subsequent commands row echo message carried out the follow-up coupling of this subtemplate collection.
In the such scheme, also comprise: judge that whether the conditional expression in the Rule of judgment template satisfies, and is template and/or the subtemplate collection of then opening in the condition template, otherwise carries out next template.
In the technique scheme, also comprise: will with master module be complementary the order line echo message subsequent commands row echo message with mate from template.
In the technique scheme, at the master module of described template set or from the master module of template, subtemplate collection or after template, can be provided with follow-up template, can also be provided with may follow-up template, and described follow-up coupling further comprises: will mate with master module or from one to multiple the follow-up template and the possible follow-up template of template with master module or from the be complementary subsequent commands row echo message of order line echo message of template.
In the such scheme, when matching follow-up template and/or may follow-up template the time, follow-up template and parameter that may follow-up template are saved in the parameter information of a last template at its place.
In the technique scheme, during for the master module of next straton template set, carry out the follow-up coupling of next straton template set from template when what subsequent commands row echo message was complementary.
Fig. 6 is the flow chart of the follow-up coupling of subtemplate collection of the present invention.As shown in Figure 6:
The follow-up coupling of described next straton template set comprises:
A) use current straton template set that the order line echo message is mated;
B) judge whether have template and order line echo message to be complementary in the current straton template set, if carry out c), otherwise carry out e);
C) judge whether the template that the match is successful in the current straton template set is from template, if not, then preserve the parameter information of coupling) if then carry out d;
D) judge whether the template that the match is successful in the current straton template set is the master module of working as next straton template set of anterior layer, if not, then preserve the parameter information of coupling, if, current straton template set is updated to next straton template set when anterior layer, works as the follow-up coupling of next straton template set of anterior layer;
E) judge whether current straton template set is the ground floor of template set,, otherwise current straton template set is updated to last layer subtemplate collection when anterior layer, carry out a) if then it fails to match.
At coupling first row is original position from template set during echo message, and promptly top layer begins, if subsequent commands row echo message be complementary during for the master module of next straton template set, carry out the follow-up coupling of next straton template set from template; This moment, follow-up order echo message will begin coupling from the subtemplate collection.If template set has only one deck, when promptly template set did not comprise the subtemplate collection, the process of follow-up coupling and the process of Fig. 6 were similar, were that current straton template set changes current template set into.
Because can specify a template in the template set is master module, have only master module successfully to mate after, other template just participates in the coupling of follow-up template together together with master module.Adopt layering and matching when the template set order line is resolved in addition, between the feasible so different subtemplate collection with one deck, the template of same names can the phase mutual interference in resolve command.Article one, template is understood the collection parameter value information after successfully matching delegation's echo, and the result preserves with the parameter name-value pair.Template set whenever matches master module, will apply for again that parameter space deposits this template and the follow-up parameter information that may match thereof.Wherein, the follow-up template of each template and parameter that may follow-up template are kept in its parameter information of a last template.Such as: the follow-up template of master module and may follow-up template matches to parameter information be kept in the master module, from the follow-up template of template and may follow-up template matches to parameter information be kept at from template, the rest may be inferred.In the template set all template matches to parameter value be encapsulated as the form of parameter set, preserve position according to each layer that matches, application layer can inquire every parameter information that template matches arrives in the template set by calling its interface and importing concrete template name into.
Template set process of analysis to Fig. 6 illustrates below:
For example: the order " display acl all " and the order line echo message as shown in Table 1:
Table one
Basic?ACL?3004,1?rule
ACL′s?step?is?4 (1)
ACL′s?step?is?4 (2)
rule?2?permit?ip
rule?2?comment?rule-for-acl-basic
Basic?ACL?3000,1?rule
ACL′s?step?is?1“0?times?match” (3)
rule?0?deny?ip
Use the order line echo message of the template set his-and-hers watches one among Fig. 4 to resolve, used the main label as acl among Fig. 4, so use as master module, the rule conduct is from template, master module back root two follow-up templates 1,2, if master module matches current delegation's echo, back two row echos may be mated with template 1,2 respectively so; Also may template 1 not do coupling, template 2 is directly mated next line.
According to above-mentioned principle, the order line echo message of his-and-hers watches one is resolved: the first row echo message " Basic ACL 3004; 1 rule " matches master module among Fig. 4 " BasicACL$aclNumber:Format[$ ;] { $ruleCount}{rules in the table one; | rule, | rules|rule}[match-order is $matchOrder:MatchOrder].The step of being mated by each row echo message and template as can be known, aclNumber matches 3004, braces { $ruleCount} matches 1, braces { rules, | rule, | rules|rule} matches rule, because bracket [match-orderis $matchOrder:MatchOrder] can be selected a branch or ignore all branches when coupling, there is not information in the first row echo message rule back, so ignore bracket, do not mate, obtain the first row echo message at last, it is the parameter information " aclNumber=3004, ruleCount=1 " of master module.Second and third row echo message (1) in the table one, the template (1) in (2) difference match map 4, (2); Because second and third row echo message (1), what (2) matched respectively is the possible follow-up and follow-up template of master module, so the parameter information that matches is kept in the parameter information of master module.
If template set has only one deck, when promptly template set did not comprise the subtemplate collection, the process of follow-up coupling and the process of Fig. 6 were similar, were that current straton template set changes into when the anterior layer template set.Fourth line echo message in the table one " rule 2 permit ip " uses template set analytic method shown in Figure 6 to resolve when the template set with Fig. 4 mates, use when the anterior layer template set echo message is mated a, " rule 2 permit ip " with when the anterior layer template set from template matches, promptly with " rule$id$acess:Acess[source$srcAdd:AddAll[$srcMsk]] [$fragment:Fragment] [time-range$tr:string[1; 32]] " be complementary, as anterior layer template set the match is successful b, the judgement of execution in step c, the fourth line echo message with when the anterior layer template set from template matches c, from template is not to work as the master module d of next straton template set of anterior layer, do not comprise the subtemplate collection from template in the present embodiment, so the fourth line echo message only with from template matches, the match is successful then preserves parameter information from template.In like manner, fifth line echo message in the table one " rule 2 commentrule-for-acl-basic " matches in Fig. 4 template set the possible follow-up template (3) from template, and the fifth line echo message is saved in the parameter of coupling in the parameter information of template.
The 6th row echo message and the first row echo message resolving are similar in the table one, no longer describe in detail, the 7th row echo message " ACL ' s step is 1 " 0 times match " (3) matches the template (2) in the template set shown in Figure 4, is a follow-up template of master module.The 8th row echo message and fourth line echo message matching process are similar, no longer describe in detail.Table two is last analysis results of table one echo message:
Table two
{//basicAcl {//basicAcl
{//acl {//acl
aclNumber:3004 aclNumber:3000
ruleCount:1 ruleCount:1
matchOrder:1 matchOrder:1
discrip:ACL′s?step?is?4 stepNum:1
stepNum:4 }
} {//rule
{//rule id:0
id:2 access:0
access:1 fragment:0
fragment:0 }
srcAdd:0.0.0.0 }
comment:rule-for-acl-basic
}
}
From the analysis result of table two, can see, the parameter value of follow-up template is integrated in the last template parameter that it follows: the parameter of stepNum and discrip parameter and master module acl combines, comment parameter and combine from the parameter of template rule.Can find out that from table two the two groups of acl in front and back have been distinguished and, acl is master module, and when whenever matching master module, template set will apply for again that the parameter set space deposits the parameter value that follow-up this template set matches.The parameter that defines in the template: fragment:Fragment is fragment:0 in analysis result in addition, here because specifying the type of parameter f ragment in the template set definition is Fragment,
In the definition the inside of concrete Fragment a default value being arranged is 0:
<ParaType?name=″Fragment″type=″int″default=″0″>
<Value>fragment(1)</Value>
</ParaType>
For the parameter of the type that has comprised default value in the template,, the default value of its parameter type will be returned if there is not the value of coupling in the actual command row echo message.
Matchorder:1 in the analysis result,, srcAdd:0.0.0 also is the default value of parameter.
By the analysis result of table two, can be easily template parameter name after resolve inquire concrete parameter value.For distinct device command-line version differences, can shield difference between the version by constructing different templates.Because template name and parameter name relative fixed concerning the same business of distinct device, if accomplish during the template definition of different editions these two unified mutually, webmastering software can use a cover code and many group templates to cooperate and finish professional management work.
In this method, also comprise: from the template set index file, find corresponding template set defined file path according to device version information and template set title, obtain corresponding template set; Described template set index file comprises device version information, template set title and template set file path.According to the template set that sets in advance, can define the index file of a logging template collection directory information; Come to seek corresponding template set file according to version information from index file.
By template set index file administrative template file more efficiently is set,, thereby make parsing quicker, accurate so that find corresponding template set fast.For general device, its command-line version can determine that wherein the version issue number is optional concerning some equipment by equipment chain number, general route version number and three information of version issue number are unique.By defining the index file of a logging template collection directory information, can improve the versatility of template file management.Index file can comprise the table of following several row: equipment chain number, general route version number, version issue number, template set title, template set place file path.For an equipment, at first get access to its 3 version informations, and the template set title that provides according to concrete business together, obtains corresponding templates collection file.For a certain record in the index file, its version issue number can not provide yet, and preferential the use mated the template file of version issue number when the locating file path, only just uses the template file that does not comprise the version issue number when it is undefined.
Fig. 7 is the device embodiment schematic diagram that is used to realize said method, as shown in Figure 7, this device specifically comprises: business module: be connected with parsing module, be used for according to the template set title of input and the address information of equipment, carry out parsing module and preserve the result that parsing module is carried out; Template set memory module: be connected with parsing module, be used to store the template set file that sets in advance; Parsing module: be used for the order line echo message being resolved according to the template set of template set memory module correspondence.In this device, business module provides the address information or the IP address of equipment, business module is according to the device version information of importing into and carry out professional template set title, can call parsing module, parsing module finds corresponding template set to resolve in the template set memory module and analysis result is turned back to business module.
Fig. 8 is the preferred embodiment schematic diagram of apparatus of the present invention, as shown in Figure 8, this device also comprises: the template set index module: be connected with the template set memory module with parsing module, be used for the positional information of logging template collection file storage and the index of corresponding directory information, can in the template set memory module, find corresponding template set according to described index, transmit the position of template set storage to parsing module.
Described parsing also comprises the version module: be connected with the template set index module with business module, the device address information remote that provides by business module signs in on the equipment, obtain one section device version information, and resolve to three version numbers, the template set title that provides according to the device version information of obtaining and business module is obtained the position of template set storage, the parsing of fill order row together from the template set index module.Specific implementation shown in the principle of method, is not described in detail in this as described above.
The present invention has satisfied the demand that webmastering software utility command row comes administering digital communication product, has enlarged the scope of webmastering software management equipment.Support management to new equipment by the mode that increases template, this characteristic provides great flexibility for the issue of webmaster product and function expand.The present invention has constructed different templates for different order echo message, embodied suitability to difference between the different command, and when making up template set, adopted master module/among the present invention from compound modes such as template, follow-up template, subtemplate collection, can travel through each template in the whole template set when making the order line echoing, and the relational tags that is provided with between the template can make and find corresponding template faster when resolving, and makes coupling more quick, accurate.The result who resolves is easy to recognition, and can find the corresponding parameters value very soon according to the result who resolves, and adopts the method for layering collection parameter, and master slave relation is clear, be easy to the user finds corresponding parameter value fast; At the management aspect of template set, claim the index file that is provided with to find the file path of template set rapidly according to version information and corresponding templates set name.
It should be noted last that, above embodiment is only unrestricted in order to technical scheme of the present invention to be described, although the present invention is had been described in detail with reference to preferred embodiment, those of ordinary skill in the art is to be understood that, can make amendment or be equal to replacement technical scheme of the present invention, and not break away from the spirit and scope of technical solution of the present invention.

Claims (12)

1. the order line echo message analytic method based on template set is characterized in that, comprising:
The template of order line echo message and template set is mated;
According to the result of the master module of order line echo message and template set coupling, subsequent commands row echo message is carried out the follow-up coupling of this template set, or does the processing of resolving failure;
The parameter of coupling is preserved by the relative hierarchical relationship of template in template set;
Parameter acquisition device configuration information according to coupling;
Wherein, described template set is made of one or more templates; It is master module that described template set is specified a template.
2. the method for claim 1 is characterized in that, also comprises:
When the master module of order line echo message and subtemplate collection is complementary, carry out the follow-up coupling of this subtemplate collection.
3. the method for claim 1 is characterized in that, also comprises:
Whether the conditional expression in the Rule of judgment template satisfies, and is template and/or the subtemplate collection of then opening in the condition template, otherwise next template of executive condition template.
4, the method for claim 1 is characterized in that, described template with order line echo message and template set is mated and comprised:
The command header of order line echo message and the root node of template are mated;
Judge whether command header is consistent with root node,, carry out next template if inconsistent then it fails to match; Otherwise the branch node that the order line echo message is removed after the command header with template mates;
Judge whether the order line echo message after the removal command header is consistent with a branch node, and if not, then it fails to match for all branch nodes, be revised as the preceding order line echo message of root node coupling, carry out next template; If then the match is successful, preserve the parameter information of coupling, carry out next template.
5. as claim 1,2,3 or 4 described methods, it is characterized in that, also comprise:
Will with master module be complementary the subsequent commands row echo message of order line echo message and master module one to multiple follow-up template and/or may follow-up template mate.
6. as claim 1,2,3 or 4 described methods, it is characterized in that, also comprise:
Will with master module be complementary the order line echo message subsequent commands row echo message with mate from template;
During for the master module of next straton template set, carry out the follow-up coupling of next straton template set from template when what subsequent commands row echo message was complementary;
Wherein, described is master module other template in addition from template.
7. method as claimed in claim 6 is characterized in that, the follow-up coupling of described next straton template set comprises:
A) use current straton template set that the order line echo message is mated;
B) judge whether have template and order line echo message to be complementary in the current straton template set, if carry out c), otherwise carry out e);
C) judge whether the template that the match is successful in the current straton template set is from template, if not, then preserve the parameter of coupling; If then carry out d);
D) judge whether the template that the match is successful in the current straton template set is the master module of working as next straton template set of anterior layer, if not, then preserves the parameter of coupling; If, current straton template set is updated to next straton template set when anterior layer, work as the follow-up coupling of next straton template set of anterior layer;
E) judge whether current straton template set is the ground floor of template set,, otherwise current straton template set is updated to last layer subtemplate collection when anterior layer, carry out a) if then it fails to match.
8. the method for claim 1 is characterized in that, described parameter with coupling is preserved by the relative hierarchical relationship of template in template set and comprised:
The parameter information of preserving follow-up template and/or may follow-up template mating is in the parameter information of a last template at its place;
Preservation from the parameter information of template or subtemplate collection in the parameter information of its place template set.
9. as claim 1,2,3,4 or 8 described methods, it is characterized in that, also comprise:
From the template set index file, find corresponding template set file path according to device version information and template set title, obtain corresponding template set;
Described template set index file comprises device version information, template set title and template set file path.
10. one kind is used for the device that the order line echo message is resolved, and it is characterized in that, comprising:
Business module: be connected with parsing module, be used for, carry out parsing module and preserve the result that parsing module is carried out according to the template set title of input and the address information of equipment;
Template set memory module: be connected with parsing module, be used to store the template set file that sets in advance;
Parsing module: be used for the order line echo message being resolved according to the template set of template set memory module correspondence.
11. device as claimed in claim 10 is characterized in that, also comprises:
Template set index module: be connected with the template set memory module with parsing module, be used for the positional information of logging template collection file storage and the index of corresponding directory information, can in the template set memory module, find corresponding template set according to described index, transmit the position of template set storage to parsing module.
12., it is characterized in that described parsing module also comprises as claim 10 or 11 described devices:
Version module: be connected with the template set index module with business module, the device address information acquisition apparatus version information that provides by business module, the template set title that provides according to the device version information of obtaining and business module is obtained the position of template set storage together from the template set index module.
CNB2006101454651A 2006-11-17 2006-11-17 Order line echo message analytic method and device based on template set Active CN100561942C (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CNB2006101454651A CN100561942C (en) 2006-11-17 2006-11-17 Order line echo message analytic method and device based on template set

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CNB2006101454651A CN100561942C (en) 2006-11-17 2006-11-17 Order line echo message analytic method and device based on template set

Publications (2)

Publication Number Publication Date
CN1946039A true CN1946039A (en) 2007-04-11
CN100561942C CN100561942C (en) 2009-11-18

Family

ID=38045259

Family Applications (1)

Application Number Title Priority Date Filing Date
CNB2006101454651A Active CN100561942C (en) 2006-11-17 2006-11-17 Order line echo message analytic method and device based on template set

Country Status (1)

Country Link
CN (1) CN100561942C (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102955692A (en) * 2011-08-29 2013-03-06 鸿富锦精密工业(深圳)有限公司 Parameter analyzing tool and analyzing method
CN105183507A (en) * 2015-08-24 2015-12-23 汉柏科技有限公司 Version matching method and system of application programs
CN107911249A (en) * 2017-11-28 2018-04-13 新华三技术有限公司 Order line sending method, device and the equipment of a kind of network equipment
CN112636996A (en) * 2020-11-16 2021-04-09 中标软件有限公司 Network security monitoring system and method for distinguishing operation command and echoing in terminal information acquisition
CN114070705A (en) * 2021-11-16 2022-02-18 广东九博科技股份有限公司 Device network management method, medium and device based on command line
CN116506291A (en) * 2023-06-28 2023-07-28 章和技术(广州)有限公司 Method and device for analyzing configuration content of network equipment of power system

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102955692A (en) * 2011-08-29 2013-03-06 鸿富锦精密工业(深圳)有限公司 Parameter analyzing tool and analyzing method
CN105183507A (en) * 2015-08-24 2015-12-23 汉柏科技有限公司 Version matching method and system of application programs
CN107911249A (en) * 2017-11-28 2018-04-13 新华三技术有限公司 Order line sending method, device and the equipment of a kind of network equipment
CN107911249B (en) * 2017-11-28 2021-05-28 新华三技术有限公司 Method, device and equipment for sending command line of network equipment
CN112636996A (en) * 2020-11-16 2021-04-09 中标软件有限公司 Network security monitoring system and method for distinguishing operation command and echoing in terminal information acquisition
CN114070705A (en) * 2021-11-16 2022-02-18 广东九博科技股份有限公司 Device network management method, medium and device based on command line
CN116506291A (en) * 2023-06-28 2023-07-28 章和技术(广州)有限公司 Method and device for analyzing configuration content of network equipment of power system
CN116506291B (en) * 2023-06-28 2023-09-05 章和技术(广州)有限公司 Method and device for analyzing configuration content of network equipment of power system

Also Published As

Publication number Publication date
CN100561942C (en) 2009-11-18

Similar Documents

Publication Publication Date Title
CN1946039A (en) Method and device for analyzing command line back display information based on template volume
CN1251095C (en) Remote control program system
CN1112642C (en) Design part reusing method in configuration tool
CN1956394A (en) Method and device for service configuration of network equipment
CN1277192C (en) A log analyzing system and analytical method based on the system
CN1719786A (en) Automatic testing system and method for command of command line interface of data communication apparatus
CN1171873A (en) Method for comparing attribute values of controllable object expressions in network element
CN1752934A (en) Compiler, compilation method, and compilation program
CN1920754A (en) Method and system for inputting artistic character/image into application program
CN101079755A (en) Configuration method of network element management system
CN101042649A (en) Configuring information processing method and arrangement, and platform system
CN1731748A (en) Testing system and method
CN1852261A (en) Method for maintenance of neighbor entry
CN1866250A (en) Method and system for managing system data
CN1863102A (en) System and method for testing apparatus based on managing information base
CN1921492A (en) Method and device for configuration management
CN1976289A (en) Program arranging method and system based on distributing network
CN1848750A (en) Method for opening Ethernet business
CN1614927A (en) Method for realizing tree-shaped structure in B/S structure
CN1677932A (en) Network management configuration method and apparatus thereof
CN2684478Y (en) Network management system, apparatus to be managed, managing apparatus and program
CN1155201C (en) Method for making data layout in communication equipment and its system
CN1812343A (en) Element management server and method for managing multi-service network elements
CN104298757A (en) Method and system allowing compatibility with mobile clients and databases different in version
CN1960367A (en) Method for associating general multiple protocols

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
CP03 Change of name, title or address
CP03 Change of name, title or address

Address after: 310052 Binjiang District Changhe Road, Zhejiang, China, No. 466, No.

Patentee after: Xinhua three Technology Co., Ltd.

Address before: 310053 Hangzhou hi tech Industrial Development Zone, Zhejiang province science and Technology Industrial Park, No. 310 and No. six road, HUAWEI, Hangzhou production base

Patentee before: Huasan Communication Technology Co., Ltd.