Summary of the invention
In view of this, the invention provides a kind of method, Apparatus and system of webmaster multi-protocols adaptation, simplified the network element interface of the outside different agreement of inter access, make protocol processes become simply, stablize.
A kind of method that the invention provides webmaster multi-protocols adaptation, comprising:
Receive the agreement request that calling module sends;
According to the protocol type of described agreement request, obtain corresponding configuration information;
According to described configuration information, described agreement request is configured to protocol object model;
By the described protocol object model after coding by with described configuration information in port send to ext nal network element, and trigger described port and start and monitor;
By described port, obtain return information;
Decoded return information is built into the return data of protocol object model, returns to described calling module.
Preferably, the described protocol type according to described agreement request obtains corresponding configuration information, comprising:
Search and whether have the configuration information corresponding with described protocol type;
If exist, carry out describedly according to described configuration information, described agreement request is configured to protocol model object step;
If do not exist, according to described protocol type, set up corresponding configuration information.
Preferably, also comprise: described configuration information is monitored by switch.
Preferably, described configuration information comprises configuration file.
Preferably, described in, send to ext nal network element comprise synchronous and or asynchronous system.
The present invention also provides a kind of webmaster multi-protocols adaptive device, comprising:
Configuration module, receiver module, parsing module, monitoring module and sending module; Described parsing module comprises at least one analyzing sub-module;
Described configuration module, for safeguarding the configuration information corresponding with described analyzing sub-module;
Described receiver module, for receiving the agreement request of calling module transmission and being sent to parsing module;
Described parsing module, for obtaining the configuration information corresponding to protocol type of described agreement request; By described configuration information, described agreement request is sent to the analyzing sub-module corresponding with described protocol type; And obtain port and trigger described port startup and monitor by described configuration information;
Described analyzing sub-module, for being configured to protocol object model by described agreement request; Protocol object model after coding is sent to described monitoring module; Also, for the described return information of decoding, decoded return information is built into the return data of protocol object model, and is sent to described sending module;
Described monitoring module, for being sent to corresponding network element by the protocol object model after described coding; The return information that described port is received is transmitted to described protocol analysis submodule;
Described sending module, for being back to described calling module by described return data.
Preferably, also comprise and search module and interface module;
Describedly search the protocol type that module is obtained according to described parsing module, search and whether have the configuration information corresponding with described protocol type,
If exist feedback configuration information to described parsing module,
If do not exist, send described protocol type to described interface module;
Described interface module, for setting up corresponding configuration information according to described protocol type.
Preferably, described configuration module also comprises: switch, and for monitoring described configuration information.
Preferably, described configuration information comprises configuration file.
Preferably, described sending module and described receiver module comprise asynchronous and or sync cap.
The present invention also provides a kind of webmaster multi-protocols adaption system, comprising:
Webmaster internal module, webmaster multi-protocols adaptive device and at least one network element;
Described webmaster internal module, sends agreement request to described webmaster multi-protocols adaptive device;
Described webmaster multi-protocols adaptive device, obtains corresponding configuration information according to the protocol type of described agreement request; According to described configuration information, described agreement request is configured to protocol object model; Described protocol object model after coding is sent to corresponding described network element by the port with described configuration information, and trigger described port startup and monitor; By described port, obtain return information; Decoded return information is built into the return data of protocol object model, returns to described webmaster internal module;
Described network element, receives the protocol object model after described coding, and sends return information to described port.
Method, the Apparatus and system of a kind of webmaster multi-protocols adaptation provided by the invention, adopt unified protocol object model and the management of configuration information, realize the support of network management system to various protocols, simplify the network element interface of the outside different agreement of inter access, made protocol processes become simply, stablize.
Embodiment
In order to make object of the present invention, technical scheme and advantage clearer, below in conjunction with drawings and Examples, the present invention is further elaborated.Should be appreciated that specific embodiment described herein, only in order to explain the present invention, is not intended to limit the present invention.
The method of a kind of webmaster multi-protocols adaptation providing for the embodiment of the present invention as Fig. 1, the method comprises the following steps:
Step 101: receive the agreement request that calling module sends.
Wherein, the agreement request that calling module sends has comprised the information that indicates protocol type.
Step 102: obtain corresponding configuration information according to the protocol type of described agreement request.
In this embodiment, for different protocol types, have different configuration informations, this configuration information comprises protocol module information, port information, can also comprise startup class that the information of enabling, agreement are corresponding etc.The dissimilar agreement request receiving is carried out to different dissection process according to corresponding configuration information.Configuration information herein can be configuration file.
Step 103: described agreement request is configured to protocol object model according to described configuration information.
In this step, the content-data that agreement request is comprised is packaged as protocol model object, in this embodiment, protocol object model is the subclass that the agreement base class that defines from corresponding configuration information is inherited, some base attributes that comprised agreement base class, for example: protocol name, agreement ID, agreement time of reception, parameter in protocol data bag etc., in addition the subclass of inheriting, be the custom field information that protocol object model also comprises some expansions, these fields and concrete traffic aided, the for example oid in snmp agreement and oid value, rank in syslog agreement etc., can carry out self-defined according to concrete different agreement type.
Step 104: by the protocol object model after coding by with configuration information in port send to ext nal network element, and trigger port and start to monitor.
The protocol object model based coding that step S103 is built is corresponding protocol format, protocol object model after this coding is sent to network element that should protocol type, and obtain corresponding port according to configuration information corresponding to this agreement request, trigger this port and start monitoring, the data of network element feedback will be obtained by this port.
Step 105: obtain return information by described port.
The port starting according to concrete agreement request, will obtain according to whole return informations of the corresponding network element feedback of this agreement request.
Step 106: decoded return information is built into the return data of protocol object model, returns to described calling module.
In this embodiment, the return information that port is obtained carries out the decoding of protocol format, and decoded return information is built into protocol object model, forms and feeds back to the return data of calling module, and send to its calling module.
The method of a kind of webmaster multi-protocols adaptation that the embodiment of the present invention provides, calling module is unified Protocol-oriented object model, shield the complicated of outside multi-protocols, simplified the network element interface of the outside different agreement of inter access, made protocol processes become simply, stablize.
In other embodiment of the present invention, according to the protocol type of agreement request, obtain in the step of corresponding configuration information, can also comprise:
Search and whether have the configuration information corresponding with described protocol type;
If exist, carry out describedly according to described configuration information, described agreement request is configured to protocol model object step;
If do not exist, according to described protocol type, set up corresponding configuration information.
Thereby can, according to the increase of ext nal network element interface, create corresponding configuration information and can carry out to New Deal type the processing of unified protocol object model.
As preferred embodiment, below with configuration file, be illustrated, configuration file can be safeguarded by an independent thread, by switch, the variation of configuration file is monitored, if started monitoring, once variation has occurred configuration file simultaneously, reload configuration file, be convenient to safeguard.
In the present invention, when carrying out data access with ext nal network element, can by call different interfaces carry out synchronous and or asynchronous access, thereby improve performance.
The structural representation of a kind of webmaster multi-protocols adaptive device providing for the embodiment of the present invention as Fig. 2.As shown in the figure, this device 200 comprises:
Configuration module 202, receiver module 204, parsing module 203, monitoring module 201 and sending module 205; Wherein, parsing module 203 comprise at least one analyzing sub-module (for example analyzing sub-module 2031 in figure, analyzing sub-module 2032 ..., analyzing sub-module 203N).
Configuration module 202, for safeguard with analyzing sub-module 2031, analyzing sub-module 2032 ..., configuration information that analyzing sub-module 203N is corresponding.
Receiver module 204, for receiving the agreement request of calling module transmission and being sent to parsing module 203.
Parsing module 203, for obtaining the configuration information corresponding to protocol type of agreement request; By configuration information, this agreement request is sent to the analyzing sub-module corresponding with its protocol type; And obtain port and trigger this port startup and monitor by configuration information.
Analyzing sub-module, for being configured to agreement request on protocol object model; Protocol object model after coding is sent to and monitors module 201; Also, for the return information of decoding, decoded return information is built into the return data of protocol object model, and is sent to sending module 205.
Monitor module 201, for the return information that port is received, be transmitted to protocol analysis submodule.
Sending module 205, for being back to calling module by return data.
A kind of webmaster multi-protocols adaptive device that the embodiment of the present invention provides, adopts unified protocol object model, has shielded the complicated of outside multi-protocols, has simplified the network element interface of the outside different agreement of inter access, makes protocol processes become simply, stablize.
The structural representation of a kind of webmaster multi-protocols adaptive device that Fig. 3 provides for further embodiment of this invention.As shown in the figure, this device 300 comprises:
Configuration module 302, receiver module 304, parsing module 303, monitoring module 301 and sending module 305; Wherein, parsing module 303 comprises at least one analyzing sub-module, for the ease of explaining, in this embodiment, usining snmp protocol analyzing sub-module 3031, TRO69 protocol analysis submodule 3032 is set forth as execution mode specifically, and analyzing sub-module 303N can be the analyzing sub-module of any type agreement.But content of the present invention is not limited to this.In this embodiment, also comprise and search module 306, interface module 307.
Configuration module 302, for safeguarding the configuration information corresponding with analyzing sub-module.
In this embodiment, this configuration information can be that form is the configuration file of XML grammer, for different protocol types, have different configuration files, be that configuration module has comprised configuration file corresponding to all analyzing sub-module difference, configuration file corresponding to each analyzing sub-module comprised protocol module information, port information that should protocol type, can also comprise startup class that the information of enabling, agreement are corresponding etc.Can adopt the tree structure storage of stratification.Configuration file can be resolved bag and resolved by the dom4j XML that increases income, and carries out initialization when configuration module loads.This configuration module safeguarded by an independent thread, and can to it, monitor by switch, if enabled monitoring, once configuration file changes, will reload configuration file.
Receiver module 304, for receiving the agreement request of calling module transmission and being sent to parsing module 203.
Parsing module 303, for obtaining the configuration information corresponding to protocol type of agreement request; By configuration information, this agreement request is sent to the analyzing sub-module corresponding with its protocol type; And obtain port and trigger this port startup and monitor by configuration information.
Wherein, for the two-layer protocol of this class of SOAP, TR069 based on http protocol, by analyzing http protocol content, judge identification.According to identifying, show that two-layer protocol type is sent to corresponding analyzing sub-module and resolves.
Analyzing sub-module, for being configured to agreement request on protocol object model; Protocol object model after coding is sent to and monitors module 301; Also, for the return information of decoding, decoded return information is built into the return data of protocol object model, and is sent to sending module 305.
Below will using snmp protocol analyzing sub-module 3031, TR069 protocol analysis submodule 3032 as specific embodiment explanation the present invention.
Snmp protocol analyzing sub-module 3031, for resolving related protocol request and the data of snmp protocol type,
After the agreement request of snmp protocol type that receives parsing module 303 forwardings, for example, by some base attributes of the agreement comprising in agreement request: protocol name, agreement ID, agreement time of reception, the parameter in protocol data bag etc., are filled in protocol object model.Be understandable that, according to concrete protocol type, also comprise the custom field information of some expansions, these fields and concrete traffic aided, for example oid in snmp agreement and oid value, the rank in syslog agreement etc.Protocol object model by packaged, is encoded to after snmp protocol form, is sent to and monitors module 301;
When receiving the return information of monitoring module 301 feedbacks, this return information is carried out to the decoding of snmp protocol form, the attribute of the data that return information is comprised is filled in protocol object model, form return data, be sent to sending module 305, to feed back to calling module, unified the data mode of intrinsic call.
TR069 protocol analysis submodule, for resolving related protocol request and the data of TR069 protocol type,
After the agreement request of TR069 protocol type that receives parsing module 303 forwardings, XML information is wherein decoded, according to the method for calling of the RPC method in TR069 agreement, obtain the parameter information of CPE, this parameter information is filled in protocol object model.Protocol object model by packaged, is encoded to after TR069 protocol format, is sent to and monitors module 301;
When receiving the return information of monitoring module 301 feedbacks, this return information is carried out to the decoding of TR069 protocol format, and the attribute of the data that return information is comprised is filled in protocol object model, forms return data, be sent to sending module 305, to feed back to calling module.
Protocol type of the present invention can also comprise SYSLOG, SOAP, TL1 etc.
Monitor module 201, for the protocol object model after coding is sent to corresponding network element; And the return information that port is received is transmitted to protocol analysis submodule.
Search the protocol type that module 306 is obtained according to parsing module 303, search and whether have the configuration information corresponding with described protocol type, if exist feedback configuration information to described parsing module 303, not send protocol type to interface module 307 if do not exist.
Interface module 307, for setting up corresponding configuration information according to protocol type.
This interface module 307 has defined the interface class of protocol object model, base class as self-defining data type, when searching module while 306 surpassing the configuration information that can not find match protocol type, can by interface module 307, create according to this agreement request configuration file and the corresponding analyzing sub-module of coupling.
A kind of webmaster multi-protocols adaptive device that further embodiment of this invention provides, adopt unified protocol object model, shielded the complicated of outside multi-protocols, simplified the network element interface of the outside different agreement of inter access, make protocol processes become simply, stablize, simultaneously, defined and can expand to interface module, be convenient to the expansion that developer carries out custom protocol, and by configuration file or plug-in unit, load, when not needing certain protocol type, only need in configuration file, modify, without code is changed, be convenient to safeguard.
The system schematic of a kind of webmaster multi-protocols adaptation providing for the embodiment of the present invention as Fig. 4, as shown in the figure, this system comprises: webmaster internal module 401, webmaster multi-protocols adaptive device 402 and at least one network element 403.
Webmaster internal module 401, sends agreement request to webmaster multi-protocols adaptive device 402.
Webmaster multi-protocols adaptive device 402, obtains corresponding configuration information according to the protocol type of agreement request; According to configuration information, agreement request is configured to protocol object model; Protocol object model after coding is sent to corresponding network element by the port with configuration information, and trigger port startup and monitor; By port, obtain return information; Decoded return information is built into the return data of protocol object model, returns to described webmaster internal module.
Network element 403, the protocol object model after received code, and send return information to corresponding ports.
Network element can comprise SNMP NE, TR069 network element, SYSLOG network element, SOAP network element, TL1 network element etc.
Wherein gateway protocol adaptive device 402 is with above-mentioned webmaster multi-protocols adaptive device, and the operation principles of system can be with reference to said method, therefore do not repeat them here.
The system of a kind of webmaster multi-protocols adaptation provided by the invention, by protocol adaptation device, build unified protocol object model, realize the support of network management system to various protocols, simplified the network element interface of the outside different agreement of inter access, make protocol processes become simply, stablize.And this system has facilitated webmaster to manage network element, compatible good, do not need a plurality of network management systems of overlapping development, can effectively reduce costs.
The foregoing is only preferred embodiment of the present invention, not in order to limit the present invention, all any modifications of doing within the spirit and principles in the present invention, be equal to and replace and improvement etc., within all should being included in protection scope of the present invention.