Background technology
With continuing to develop for the network communications technology, the NE quantity in network also exponentially increases, currently generally may be used
To be managed to each network element by NMS.Currently, when being managed to each network element, generally can be in each net
Parameter configuration is carried out in unit, carried out the network element after parameter configuration just can be managed collectively by NMS.
At present, when being configured to each network element, in the following manner can generally be included:
A kind of mode is by way of human configuration, for each network element, to be configured one by one.
Another way is to carry out batch configuration to the network element of same type.When batch configuration is carried out, can generally use
The mode of multicast packets sends operation bag to each network element, and network element just can enter after receiving operation bag according to the content in operation bag
Row configuration.Further, it is also possible to realize the batch configuration of network element by way of template configuration.Specifically, NMS
Batch configuration can be sent to each network element to ask, and FTP (the File Transfer where indicating configuration template
Protocol, file transfer protocol) server, so each network element can from ftp server download configuration template, such that it is able to
Configured.
In implementing the present invention, it may, inventor has found prior art, and at least there are the following problems:
With the continuous growth of NE quantity, have clearly a need for expending the considerable time by way of human configuration, and
And carry out the mode of human configuration and also easily malfunction.
Network element to same type carries out batch configuration, otherwise need network element to support multicast protocol, otherwise need network element to support
Template function, once network element does not support corresponding agreement or function, then cannot realize the batch configuration of network element.
Therefore, the method that network element carries out batch configuration is had some limitations in the prior art.
It should be noted that the introduction of technical background is intended merely to above it is convenient technical scheme is carried out it is clear,
Complete explanation, and facilitate the understanding of those skilled in the art and illustrate.Can not be merely because these schemes be of the invention
Background section is set forth and thinks that above-mentioned technical proposal is known to those skilled in the art.
The content of the invention
Regarding to the issue above, the purpose of embodiment of the present invention is the method and dress for providing a kind of network element batch configuration
Put, can avoid proposing extra demand to network element, moreover it is possible to save the time of batch configuration.
To achieve the above object, embodiment of the present invention provides a kind of method of network element batch configuration, including:Obtain batch
The call parameters of configuration service interface, and call the batch configuration service interface according to the call parameters;By described batch
Amount configuration service interface, the configuration information of each network element at least one network element to be configured is obtained from NM client;According to
The configuration information of each network element, builds the corresponding configuration task of each network element, and each configuration task for building is put into default line respectively
Cheng Chizhong;Each configuration task is performed by the concurrent thread in the default thread pool;Performed in the default thread pool
After complete each configuration task, configuration result is collected from each network element at least one network element, and the configuration is tied
Fruit feeds back to the NM client.
Further, the configuration information includes network element ID and network element configuration parameter.
Further, the configuration information according to each network element, builds the corresponding configuration task of each network element respectively, including:
The network element ID and network element configuration parameter of each network element are extracted from the configuration information;Inquired about in presetting database and the net
The network element IP address that unit's mark matches, and it is corresponding that the network element IP address and the network element configuration parameter are configured into network element
Configuration task.
Further, the concurrent thread by the default thread pool performs each configuration task, including:Institute
Network element configuration parameter in configuration task is sent the concurrent thread stated in default thread pool the network element into the configuration task
At the network element that IP address is pointed to;The network element that the network element IP address is pointed to locally is being matched somebody with somebody according to the network element configuration parameter
Put, and generate configuration result.
Further, methods described also includes:Detect the first total quantity of the default thread pool thread and current
Second total quantity of pending configuration task, when first total quantity is less than second total quantity, pause builds each
The corresponding configuration task of network element, until first total quantity is more than or equal to second total quantity.
To achieve the above object, embodiment of the present invention also provides a kind of device of network element batch configuration, including:Interface is adjusted
With unit, the call parameters for obtaining batch configuration service interface, and the batch configuration is called according to the call parameters
Service interface;Configuration service agent unit, for by the batch configuration service interface, being obtained from NM client and waiting to match somebody with somebody
The configuration information of each network element at least one network element put;Configuration task construction unit, for the configuration information according to each network element,
The corresponding configuration task of each network element is built respectively, and each configuration task for building is put into default thread pool;Thread pool unit,
For performing each configuration task by the concurrent thread in the default thread pool;Configuration result collection unit, for
After the default thread pool has performed each configuration task, configuration knot is collected from each network element at least one network element
Really, and by the configuration result NM client is fed back to.
Further, the configuration task construction unit, specifically for:The net of each network element is extracted from the configuration information
Unit's mark and network element configuration parameter;The network element IP address matched with the network element ID is inquired about in presetting database, and will
The network element IP address and the network element configuration parameter are configured to the corresponding configuration task of network element.
Further, the thread pool unit, specifically for:Network element configuration parameter in configuration task is sent to described
At the network element that network element IP address in configuration task is pointed to, to cause the network element of the network element IP address sensing locally according to institute
State network element configuration parameter to be configured, and generate configuration result.
Further, described device also includes:Victim control unit, for detecting the default thread pool thread
Second total quantity of one total quantity and currently pending configuration task, when first total quantity is less than the described second sum
During amount, pause builds the corresponding configuration task of each network element, until first total quantity is more than or equal to the described second sum
Amount.
Therefore, a kind of method and apparatus of network element batch configuration that embodiment of the present invention is provided can be by each
The configuration process of network element is configured to the configuration task being able to carry out, and is processed simultaneously by the concurrent thread preset in thread pool and respectively matched somebody with somebody
Put task such that it is able to concomitantly network element is configured.The configuration result of each network element may finally be collected and will be matched somebody with somebody
Put result to provide to NM client such that it is able to facilitate user to check the configuration result of each network element.The present invention need not
Network element can support multicast protocol and template function, while the processing method for passing through concurrent thread, can be greatly enhanced batch
The efficiency of configuration, saves the time of batch configuration.
Specific embodiment
To make the purpose, technical scheme and advantage of embodiment of the present invention clearer, implement below in conjunction with the present invention
Accompanying drawing in mode, is clearly and completely described to the technical scheme in embodiment of the present invention, it is clear that described reality
The mode of applying is a part of implementation method of the invention, rather than whole implementation methods.Based on the implementation method in the present invention, ability
The every other implementation method that domain those of ordinary skill is obtained under the premise of creative work is not made, belongs to the present invention
The scope of protection.
Embodiment of the present invention provides a kind of method of network element batch configuration, refers to Fig. 1, methods described can include with
Lower step.
Step S1:The call parameters of batch configuration service interface are obtained, and the batch is called according to the call parameters
Configuration service interface.
In the present embodiment, the configuration information of each network element can be preserved in NM client.On the boundary of NM client
In face, user can select network element to be configured.
In the present embodiment, network element batch configuration device can be set up with NM client and be connected, and carry out network element batch
Before amount configuration, can the equipment batch configuration service interface in network element batch configuration device in advance.The batch configuration service
Interface can be used for the configuration information of the network element for receiving to be configured.
In the present embodiment, the batch configuration service interface can be associated with call parameters.Called by described
Parameter, network element batch configuration device can call the batch configuration serve port.Specifically, in the present embodiment, true
After having determined the batch configuration serve port, the batch configuration serve port can be sent into network element batch configuration device
Configuration service agent unit at.So, what network element batch configuration device just can obtain batch configuration service interface calls ginseng
Number, and call the batch configuration service interface according to the call parameters.
Step S2:By the batch configuration service interface, at least one net to be configured is obtained from NM client
The configuration information of each network element in unit.
In the present embodiment, when the batch configuration service interface is called, the configuration service agent unit can be with
By the batch configuration service interface, the configuration of each network element at least one network element to be configured is obtained from NM client
Information.
Specifically, user can in batches select network element to be configured in NM client, and these network elements chosen are matched somebody with somebody
Confidence is ceased such that it is able to be sent to the configuration service agent unit by the batch configuration service interface.
In the present embodiment, the configuration information can include network element ID and network element configuration parameter.The network element mark
Knowledge can uniquely represent corresponding network element.For example, the network element ID can be digital ID, the digital ID can be webmaster visitor
Family end is pre-assigned to each network element.
The network element configuration parameter can include the various parameters related to network element.For example, the network element configuration parameter can
Being element name, network element date of formation, the port mode of network element, encapsulated type etc..
Step S3:According to the configuration information of each network element, the corresponding configuration task of each network element is built respectively, and it is each by what is built
Configuration task is put into default thread pool.
In the present embodiment, configuration service agent unit, can after the configuration information for obtaining each network element to be configured
Each network element is directed to by configuration task construction unit, corresponding executable configuration task is built.Specifically, configuration task structure
Building unit can respectively build the corresponding configuration task of each network element according to the configuration information of each network element.
In the present embodiment, the configuration task construction unit can extract the net of each network element from the configuration information
Unit's mark and network element configuration parameter.In actual application, IP address of the network element ID generally with network element in a network is associated
Storage.Therefore, the configuration task construction unit can inquire about the net matched with the network element ID in presetting database
First IP address.The presetting database can be in independent data server, or network element batch configuration device
Individual module, the present invention is not limited this.After network element IP address is obtained, the configuration task construction unit just can be by
The network element IP address and the network element configuration parameter are configured to the corresponding configuration task of network element.
In the present embodiment, after the corresponding configuration task of each network element is constructed, default thread pool can be transferred to hold
Each configuration task of row, to carry out the process of network element configuration.
Step S4:Each configuration task is performed by the concurrent thread in the default thread pool.
In the present embodiment, the default thread pool can perform each configuration task by the way of parallel processing.
In the default thread pool, the concurrent thread of predetermined number can be set.The concurrent thread of the predetermined number can be parallel
Pending task in ground treatment thread pool.
Specifically, the concurrent thread in the default thread pool can by the network element configuration parameter in configuration task send to
At the network element that network element IP address in the configuration task is pointed to.So, it is assumed that amounting in current preset thread pool has 10 simultaneously
Hair line journey, then the default thread pool just simultaneously can be sent to corresponding network element configuration parameter in 10 configuration tasks
At network element IP address.
So, the network element that the network element IP address is pointed to, just can be at this when respective network element configuration parameter is received
Ground is configured according to the network element configuration parameter, so as to generate configuration result.Can include being configured in the configuration result
The information of work(, it is also possible to the error message including configuration failure, such that it is able to being easy to subsequent user to be checked and being analyzed.
Step S5:After the default thread pool has performed each configuration task, from least one network element
Configuration result is collected at each network element, and the configuration result is fed back into the NM client.
In the present embodiment, after the default thread pool has processed each configuration task for building, just can be with
Configuration result is collected from each network element.Specifically, the IP address that each network element can be passed through by configuration result collection unit, to each net
First send configuration collection instruction, can include call back function in the instruction.Network element receive configuration result collect refer to
After order, just the configuration result of itself can be fed back to configuration result collection unit by call back function.
In the present embodiment, configuration result collection unit, can be by institute after the configuration result of all network elements is collected into
State configuration result and feed back to the NM client.So, user just can clearly check each network element at NM client
Concrete configuration situation, it is possible to the network element for configuration failure is diagnosed.
In one embodiment of the present invention, it is contemplated that the quantity of default thread pool thread is limited, if currently
The quantity of pending configuration task is more, and the thread in default thread pool may have little time treatment, so as to cause task to accumulate
Pressure, can aggravate the burden of default thread pool.In consideration of it, the default thread pool thread can be detected in the present embodiment
Second total quantity of the first total quantity and currently pending configuration task.When first total quantity is total less than described second
During quantity, show that currently pending task is excessive, the corresponding configuration task of each network element of structure can be suspended, until described first
When total quantity is more than or equal to second total quantity, can continue to build the corresponding configuration task of network element.
Refer to Fig. 2.One embodiment of the present invention also provides a kind of device of network element batch configuration, including:
Interface interchange unit 100, the call parameters for obtaining batch configuration service interface, and according to the call parameters
Call the batch configuration service interface;
Configuration service agent unit 200, for by the batch configuration service interface, being obtained from NM client and being treated
The configuration information of each network element at least one network element of configuration;
Configuration task construction unit 300, for the configuration information according to each network element, builds the corresponding configuration of each network element respectively
Task, and each configuration task for building is put into default thread pool;
Thread pool unit 400, for performing each configuration task by the concurrent thread in the default thread pool;
Configuration result collection unit 500, for after the default thread pool has performed each configuration task, from described
Configuration result is collected at each network element at least one network element, and the configuration result is fed back into the NM client.
Wherein,
The configuration task construction unit, specifically for:
The network element ID and network element configuration parameter of each network element are extracted from the configuration information;Inquired about in presetting database
The network element IP address matched with the network element ID, and the network element IP address and the network element configuration parameter are configured to net
The corresponding configuration task of unit.
The thread pool unit, specifically for:
The network element that the network element IP address that network element configuration parameter in configuration task is sent into the configuration task is pointed to
Place, with the network element IP address is pointed to network element locally being configured according to the network element configuration parameter, and generation is matched somebody with somebody
Put result.
Described device also includes:
Victim control unit, for detecting the first total quantity of the default thread pool thread and currently pending
Second total quantity of configuration task, when first total quantity is less than second total quantity, pause builds each network element correspondence
Configuration task, until first total quantity be more than or equal to second total quantity.
In the particular technique details of device and the method for network element batch configuration of the above-mentioned network element batch configuration being related to
It is similar, therefore no longer specifically repeat.
Therefore, a kind of method and apparatus of network element batch configuration that embodiment of the present invention is provided can be by each
The configuration process of network element is configured to the configuration task being able to carry out, and is processed simultaneously by the concurrent thread preset in thread pool and respectively matched somebody with somebody
Put task such that it is able to concomitantly network element is configured.The configuration result of each network element may finally be collected and will be matched somebody with somebody
Put result to provide to NM client such that it is able to facilitate user to check the configuration result of each network element.The present invention need not
Network element can support multicast protocol and template function, while the processing method for passing through concurrent thread, can be greatly enhanced batch
The efficiency of configuration, saves the time of batch configuration.
Each implementation method in this specification is described by the way of progressive, identical similar between each implementation method
Part mutually referring to what each implementation method was stressed is the difference with other embodiment.
Finally it should be noted that:Description to various implementation methods of the invention above is supplied to ability with the purpose for describing
Field technique personnel.It is not intended to exhaustion or be not intended to limit the invention to single disclosed embodiment.As above institute
State, various replacements of the invention and change will be apparent for above-mentioned technology one of ordinary skill in the art.Therefore,
Although specifically discuss the implementation method of some alternatives, other embodiment will be apparent, or ability
Field technique personnel relatively easily draw.It is contemplated that including discussed herein of the invention all replacements, modification and
Change, and the other embodiment in the spirit and scope of above-mentioned application that falls.