Summary of the invention
In view of the above problems, the application describes a kind of implementation method of the network management configuration module based on TLV structure, and described method comprises:
Configuration parameter user is needed to create a XML file;
For equipment creates a generic configuration masterplate file;
Obtain network management configuration information and show;
Down distributing configuration data;
Wherein, in described XML file, store the ID of the static control needing Chinese and English display, the ID that the corresponding overall situation of each described static control is unique.
Preferably, configuration interface realizes based on MFC, and before described configuration interface display, initialization function obtains corresponding described parameter in described XML file according to the Chinese and English selected during user's logging in gateway system.
Preferably, described generic configuration masterplate file adopts the elongated message structure of TLV.
Preferably, the described generic configuration masterplate file group that comprises the group of many group MIB parameter node compositions, MIB parameter node and be made up of one group of MIB parameter node.
Preferably, described MIB parameter node comprises TAG corresponding to described MIB parameter node, the length of described MIB parameter nodal value and the value of described MIB parameter node.
Preferably, the described group be made up of one group of MIB parameter node comprises the index of cache file and the described group be made up of one group of MIB parameter node.
Preferably, obtain described network management configuration information and display process comprise step:
Generate generic configuration masterplate file object objPackage;
Call Tag value corresponding to described configuration parameter that addItem method will obtain and length adds array;
Call the data that getData method organization need sends to server, then the TLV data of composition, corresponding command code and the message object that returns are sent asynchronous message as parameter call ClientSendSyncMsg to sever;
If described message sends successfully, call the message of setData parsing from server by described object objPackage, and store according to group and item;
Call network bytes sequence translation interface the value after conversion is assigned to control corresponding to Tag and shows.
Preferably, the process of down distributing configuration data comprises step:
Obtain the value that configuration interface input frame control is corresponding;
Carry out the conversion of network bytes sequence, generate generic configuration masterplate file object objPackage;
Call addItem method, by the value after conversion and the Tag value of correspondence and length, add array;
Call the data that getData method organization need sends to server;
The TLV data of composition, corresponding command code and the message object that returns are sent asynchronous message as parameter call ClientSendSyncMsg to sever;
Sever again by configuration distributing to described equipment.
Technique scheme tool has the following advantages or beneficial effect: the present invention is mainly used in the implementation method providing a kind of network management configuration module based on TLV structure, mainly comprises XML file design, the design of generic configuration class, network management configuration acquisition of information and display and configuration data and issues a few part.Network management system is the integrated management software platform managing multiple distinct device, the present invention fully takes into account the flexibility of message structure length when message structure designs, have employed TLV variable length structure, when avoiding the structural design according to regular length, the structure needing AM/BAM to define is consistent, otherwise the problem that can report an error, especially in the vicissitudinous situation of MIB node; Directly control ID and the TAG of each for display page configuration parameter is worth by MAP structure connection when TLV structural design, eliminates the operation to the display control bundle variable of parameters in regular length design; Simultaneously to the conversion of network bytes sequence, the structure of TLV and parsing, configuration parameter is assigned to the operations such as control corresponding on interface encapsulates, the calling interface be simple and easy to is provided.Calling of configuration interface, reduces the exploitation of front desk service configuration section and maintenance cost and burden; New configuration interface, meets the requirement of easily expansion, easy care, the demand that convenient support is following, the templating of such as business configuration.
Embodiment one
As shown in Figure 1, a kind of implementation method of the network management configuration module based on TLV structure, comprises step:
The all types of parameter configured user is needed to create a XML file;
For equipment creates a generic configuration masterplate file;
Obtain network management configuration information and show;
Down distributing configuration data.
Wherein, mainly comprise XML file design based on the implementation method of the network management configuration module of TLV structure, the design of generic configuration masterplate, gateway configuration information obtain and the issuing of display and configuration data.
Specifically, process user being needed all types of parameter configured to create a XML file is mainly the design relating to XML file.In the present embodiment, configuration management partial page Chinese and English mainly realizes based on XML file, and configuration interface realizes based on MFC, and the element on interface is made up of different controls, the ID that all corresponding overall situation of each control is unique.In XML file, the ID of the static control of Chinese and English display stores corresponding Chinese and English as required, and the Chinese and English selected when logging in network management system according to user in the initialization function OnInitDialog before interface display obtains corresponding Chinese and English and calls the display of SetWindowText function.Example is configured to Port Mirroring:
The process creating a generic configuration masterplate file for equipment relates generally to the design of generic configuration masterplate file.The message structure of AM/BAM communication in the present embodiment, adopt the elongated message structure of TLV, generic configuration class CCommConfig (i.e. generic configuration masterplate file) fully takes into account expansibility and the ease for maintenance of interface at the beginning of design, conveniently to support following demand simultaneously, and call the exploitation and maintenance cost and burden that can reduce front desk service configuration section by configuration interface.To the conversion of network bytes sequence, the structure of TLV and parsing etc. encapsulate, and provide the calling interface be simple and easy to.
As shown in table 1 below with configuration class CCommConfig attribute:
Table 1CCommConfig members list
Main method and function as follows:
CCommConfig::createGroup method: create an itemgroup, and add array end to;
CCommConfig::addItem method: add an item in last group in array;
CCommConfig::getData method: organization need sends to the data of server;
CCommConfig::setData method: resolve the message from server, and store according to group and item;
CCommConfig::getItemInfo method: the TAG value corresponding according to node, takes out corresponding value in Group after parsing;
Wherein, CTlvItem and CTlvItemGroup is class corresponding to generic configuration class members, and CTlvItem is MIB parameter node class, and CTlvItemGroup is the group class of MIB parameter node composition.
CTlvItem members list and main method as shown in table 2:
Table 2CTlvItem members list
Main method and function as follows:
CTlvItem::getItemID method: get the TAG that MIB parameter node is corresponding;
CTlvItem::getValue method: get the value that MIB parameter node is corresponding;
CTlvItem::getSize method: the length of getting MIB parameter nodal value;
Shown in CTlvItemGroup members list and main method table 3:
Table 3CTlvItemGroup members list
Title |
Type |
Explanation |
m_arrItem |
CArray<CSnmpItem*,CSnmpItem*> |
Buffer memory one group of CSnmpItem |
m_nIndex |
int |
Index in group |
Main method and function:
CTlvItemGroup::addItem method: a new establishment item;
CTlvItemGroup::getItemInfo method: read an item information in this group;
CTlvItemGroup::getData method: the form all item of this group being converted into TLV;
CTlvItemGroup::release method: delete all item in this group, Free up Memory.
As shown in Figure 2, the acquisition of network management configuration information and display complete in initialization function OnInitDialog before interface display.First generate generic configuration class CCommConfig object objPackage, the Tag value that each configuration parameter that then will be obtained by this object reference addItem method is corresponding, length adds array, call the data that getData method organization need sends to server again, then by the TLV data of composition, corresponding command code and the message object returned send asynchronous message as parameter call ClientSendSyncMsg to sever, if success, call the message of setData parsing from server by CCommConfig object objPackage, and store according to group and item, finally call network bytes sequence translation interface the value after conversion is assigned to control corresponding to Tag and shows.
In the process of down distributing configuration data, have modified the value of configuration parameter and after determining amendment, in the event of ACK button response, complete issuing of configuration data.As shown in Figure 3, first the value that configuration interface input frame control is corresponding is obtained, then the conversion of network bytes sequence is carried out, generate generic configuration class CCommConfig object objPackage, and call addItem method, by the value after conversion and the Tag of correspondence and length, add array, call the data that getData method organization need sends to server again, then the TLV data of composition, corresponding command code and the message object that returns are sent asynchronous message as parameter call ClientSendSyncMsg to sever, configuration distributing can come into force to equipment by sever again.
The implementation method of the network management configuration module based on TLV structure that the present embodiment proposes, XML realizes the Chinese and English display of configuration management interface, the message structure variable-length of network management configuration AM/BAM communication, directly control ID and the TAG of each for display page configuration parameter is worth by MAP structure connection when TLV structural design, eliminate the operation to the display control bundle variable of parameters in regular length design, and network bytes sequence is changed, the structure of TLV and parsing etc. encapsulate, and provide the interface interchange be simple and easy to.When supporting administration configuration to miscellaneous equipment, if MIB corresponding to configuration item is consistent, directly just can to support and without the need to revising code; If inconsistent, the structure of then just asking and page display need to distinguish with unit type, and other code different model equipment can be general, without the need to changing, configuration interface in general class also can be general between distinct device, can support the management to miscellaneous equipment configuration fast.And code is succinct, realizes the time short, it is characterized in that comprising:
1) XML realizes Chinese and English.XML file is used for stored configuration administrative section page Chinese and English, configuration interface is based on MFC (MicrosoftFoundationClasses, Microsoft Foundation class libraries) realize, XML file can be operated very easily in a program by loading XML dynamic link library.Element on interface is made up of different controls, the ID that all corresponding overall situation of each control is unique.In XML file, the ID of the static control of Chinese and English display stores corresponding Chinese and English as required, and the Chinese and English selected when logging in network management system according to user in the initialization function OnInitDialog before interface display obtains corresponding Chinese and English and calls the display of SetWindowText function.
2) control associates with TAG.Directly control ID and the TAG of each for display page configuration parameter is worth by MAP structure connection when Data Structure Design, eliminates the operation to the display control bundle variable of parameters in regular length design.
3) message structure variable-length.AM/BAM message communicating adopts TLV variable length format, client and sever end only and need unpack rule and to encapsulate configuration parameter and resolve by the group bag of TLV, without the need to the structural design as struct regular length, need client and sever to hold the structure that the configuration parameter of preservation same structure and length is respectively corresponding, avoid the mistake caused because structure is inconsistent, deal with also more flexible.
4) structure of TLV and parsing.Network managment foreground and background communication information structure is about decided to be TLV structure, when client sends GET request to sever, client needs, according to this structure, each parameter group that will obtain is made into TLV character string and sends to server to hold, and needs first to split (namely resolving) to know the value will getting which configuration parameter from equipment according to TLV structure to packet after sever end receives data.The value of the configuration parameter got also will to be organized into TLV character string according to this structure and to return to client end by sever end after getting value, carries out splitting (namely resolving) become each configuration item and value and shown after client end receives the value returned by TLV structure.SET request in like manner, does not repeat like this.
5) self-defined generic configuration class provides interface interchange.Code redundancy is caused in order to avoid repeating to write code, function is reused, shorten the development time of similar functions, here network bytes sequence general for each configuration item is changed, the functions such as the structure of TLV and parsing encapsulate, object directly by generating generic configuration class calls, and code structure is succinct, uses also very convenient.
Described elongated message structure, refers to that the message structure length that AM/BAM carries out communicating is not fixed, can TLV group bag according to a preconcerted arrangement and unpack rule and to construct configuration parameter and resolve, and message-length is depending on configuration parameter type, number and value.
Described TLV structure, tag-length-value (TLV), Tag (label), Length (length), Value (value), in data communication field, often fixing (being generally 1 ~ 4bytes), V field length is variable for the length of T, L field.T field represents type of message, the content that L field represents message length, V field is often used for depositing message.
Described XML dynamic link library, in a program during analyzing XML file, needs to introduce msxml6.dll, does not just need us to write the syntax analyzer of XML by oneself.It is COM (ComponentObjectModel) library of object, encapsulates carrying out required all objects when XML resolves.Because COM is a kind of reusable object occurred in a binary format, and language has nothing to do, and can call, realize the parsing to XML document in the application with any language (as VC, C++Builder etc.) to it.
The present invention is directed to the configuration management in network management system, provide a kind of implementation method of the network management configuration module based on TLV structure, designed by XML file, generic configuration class designs, network management configuration acquisition of information and display and configuration data issue a few part and jointly complete configuration management function in network management system.The support of administration page Chinese and English of the present invention realizes based on XML, generic configuration class CCommConfig provides abundant interface, client is by configuring TAG corresponding to relevant MIB node and value (composing null value during GET), the relevant interface function organization need that calling CCommConfig provides sends to the data of server, GET and SET request is sent to server, the message that the relevant interface function parsing server that CCommConfig is then called in GET success to be provided returns also shows, and deals with very simple and convenient.In native system, configuration item mainly contains: RSTP, Port Mirroring, QOS, ACL access control, QINQ, alarm configuration, PON, IGMP, SNMP, ONU mandate, SWITCH, VLAN, VOIP, IPTV, DHCP etc.The device type that webmaster of the present invention has been supported has the OLT of FP6508 and FP8680 two profiles number and the ONU of Multiple Type, to support the administration configuration to miscellaneous equipment, when the MIB that configuration item is corresponding is consistent, directly just can support, if inconsistent, then the structure of just request and page display need to distinguish with unit type, and other code different model equipment can be general, without the need to changing, the management to miscellaneous equipment configuration can be supported fast.
The invention provides the implementation method of the network management configuration module based on TLV structure, AM/BAM communication information structure length is variable, directly control ID and the TAG of each for display page configuration parameter is worth by MAP structure connection when Data Structure Design, eliminates the operation to the display control bundle variable of parameters in regular length design.Self-defined generic configuration class, to the conversion of network bytes sequence, the structure of TLV and parsing etc. encapsulate, and provide the calling interface be simple and easy to.Calling of configuration interface, reduces the exploitation of front desk service configuration section and maintenance cost and burden; Meanwhile, new configuration interface, meets the requirement of easily expansion, easy care, the demand that convenient support is following, the templating of such as business configuration.
Interface in generic configuration class and device type have nothing to do, can be general in the administration configuration of distinct device, to support the administration configuration to miscellaneous equipment, when the MIB that configuration item is corresponding is consistent, directly just can support, if inconsistent, the structure of then just asking and page display need to distinguish with unit type, other code different model equipment can be general, without the need to changing, can support the management to miscellaneous equipment configuration fast.
For a person skilled in the art, after reading above-mentioned explanation, various changes and modifications undoubtedly will be apparent.Therefore, appending claims should regard the whole change and correction of containing true intention of the present invention and scope as.In Claims scope, the scope of any and all equivalences and content, all should think and still belong to the intent and scope of the invention.