Embodiment
For the purpose, technical scheme and the advantage that make the embodiment of the present invention clearer, below in conjunction with the accompanying drawing in the embodiment of the present invention, technical scheme in the embodiment of the present invention is clearly and completely described, obviously, described embodiment is the present invention's part embodiment, rather than whole embodiment.Based on the embodiment in the present invention, those of ordinary skills belong to the scope of protection of the invention not making the every other embodiment that obtains under the creative work prerequisite.
The embodiment of the present invention provides a kind of method for searching path, in the method, the veneer in network element is divided into groups.in practice, need only to exist between any two veneers in two network elements and intersect or optical fiber, namely exist related, two network elements are associated, therefore the probability that is associated between network element is than there being large many of related probability between the veneer in network element, so generally, all be associated between network element, this just makes according to traditional when network element being divided to realize between the network element grouping onrelevant, the network element number that comprises in the network element grouping of each division is too much, when each network element grouping is independently carried out route searching, the spent time is a lot of equally, lost the meaning of grouping, more serious, may occur at all can't be according to the situation of network element grouping.Through inventor's many experiments and analysis, the veneer in network element is divided and can be addressed the above problem as elementary cell.
For this reason, the invention provides a kind of method for searching path, as shown in Figure 1, the method comprises the steps:
Step S101: the veneer in the network element of the whole network is divided into groups according to the physical connection mode between veneer, so that the connection that is independent of each other between each veneer grouping.
Can learn whether to exist between veneer according to the physical connection mode between veneer and intersect or optical fiber, know whether there is association between veneer with this.Judge whether to exist between veneer and intersect or optical fiber, can be take intersection and optical fiber list between all plates that obtain as foundation.Judge whether veneer exists intersection or optical fiber not only will consider whether to exist between the interior veneer of same network element and intersect or optical fiber, also will consider whether to exist between the veneer in different network elements and intersect or optical fiber.
Step S102: set up a plurality of search units, these a plurality of search units carry out route searching in each self-corresponding veneer grouping.
Due to the connection that is independent of each other between the veneer grouping, can't pathway between veneer grouping, be can't pathway between any two veneers in the grouping of different veneers, so it is also separate carrying out route searching in each veneer grouping, in order to raise the efficiency, reduce the resource occupation time, set up a plurality of search units, carry out route searching concurrently in each self-corresponding veneer grouping.
Step S103: the Search Results of all search units is gathered, obtain total route searching result.
Like this, owing to dividing into groups according to veneer, can so that the number of the elementary cell that comprises in veneer independent of each other grouping (being veneer in the present embodiment) still less, can carry out concurrently more route searching independent of each other, and shorten to whole search time and carry out the time that the veneer grouping spends that route searching expends time in the most normal, improve degree of parallelism, effectively saved the required time of route searching, can complete route searching transitory efficient.
In practice, the above-mentioned search unit that is used for carrying out route searching can have a variety of forms, can be process, can be also the thread in process.
Below describe the specific implementation of method for searching path provided by the invention in detail with several specific embodiments.
Embodiment two
Fig. 2 is the schematic diagram of the method for searching path that provides of the present embodiment; The method comprises the steps:
Step S201: obtain between plate and intersect and the optical fiber list;
Step S202: according to cross tabulating between the plate that obtains in step S201, detect whether to exist between plate between veneer and intersect and optical fiber, intersect existing between plate and the veneer of optical fiber is divided into a veneer grouping, make between the veneer grouping of final formation and do not have intersection and optical fiber between plate.
Can learn whether to exist between veneer according to the physical connection mode between veneer and intersect and optical fiber, know whether there is association between veneer with this.By step S202, all veneers are farthest divided into groups, make between each veneer grouping and do not have association, to carrying out separately independent route searching.
Step S203: set up a plurality of threads.
Step S204: trigger a plurality of threads of setting up in step S203 and carry out route searching in each self-corresponding veneer grouping.
Like this, each thread carries out independently route searching in each self-corresponding veneer grouping, do not exist between the route searching of all veneer groupings to interdepend.If system allows, when the quantity of the thread of setting up equaled the quantity of veneer grouping, the time of route searching cost was only depended on the veneer grouping that the cost of route searching time is the longest, there is no positive connection with the growth of network size.
Step S205: the route searching result of all threads is gathered, obtain total route searching result.
in practice, restriction due to system configuration, the quantity of thread can be restricted, when the number of the veneer grouping of dividing in step S202 surpasses the number of threads of system's permission foundation, can't realize setting up simultaneously the thread identical with veneer grouping number this moment, and can only set up quantity less than the thread of veneer grouping number, based on such consideration, preferably, when the quantity of the thread of setting up during less than the quantity of veneer grouping, a plurality of threads carry out respectively route searching and comprise in the grouping of separately veneer: when the thread of all foundation all occupied when carrying out route searching, the veneer packet awaits of not yet carrying out route searching is completed the thread of route searching, then by this thread of completing route searching, route searching is carried out in the veneer grouping that this not yet carries out route searching.
Embodiment three
Fig. 3 is the schematic diagram of the method for searching path that provides of the present embodiment, and the method comprises the steps:
Step S301: obtain between plate and intersect and the optical fiber list;
Step S302: according to cross tabulating between the plate that obtains in step S301 and optical fiber list, detect whether to exist between plate between veneer and intersect and optical fiber, intersect existing between plate and the veneer of optical fiber is divided into a veneer grouping, make between the veneer grouping of final formation and do not have intersection and optical fiber between plate.
Step S303: set up a plurality of processes.
Here, a plurality of processes can be based upon in different machines.
Step S304: trigger a plurality of processes of setting up in step S303 and carry out route searching in each self-corresponding veneer grouping.
Like this, each process is carried out independently route searching in each self-corresponding veneer grouping, do not exist between the route searching of all veneer groupings to interdepend.
Step S305: the route searching result of all processes is gathered, obtain total route searching result.
In practice, can create in addition a host process, be used for collecting the Search Results of the route searching that each process of carrying out route searching completes.
Need to prove, in the present embodiment, when corresponding a plurality of veneer grouping of a process, namely a process will be carried out route searching to a plurality of veneer groupings, and at this moment, this process needs successively route searching to be carried out in a plurality of veneer groupings of its correspondence one by one in order.
In the present embodiment by different processes to different veneer grouping carry out respectively route searching, during at different machines, realized distributed route searching when the process that creates, can also utilize fully idle resource with respect to the scheme of embodiment two.
Embodiment four
Fig. 4 is the schematic diagram of the method for searching path that provides of the present embodiment.The method comprises the steps:
Step S401: obtain between plate and intersect and the optical fiber list;
Step S402: according to intersecting and the optical fiber list between the plate that obtains in step S401, detect whether to exist between plate between veneer and intersect and optical fiber, intersect existing between plate and the veneer of optical fiber is divided into a veneer grouping, make the veneer of final formation not exist between plate between dividing into groups and intersect.
Step S403: set up a plurality of processes;
Step S404: utilize a plurality of processes of setting up to carry out route searching in each self-corresponding veneer grouping, and when corresponding a plurality of veneer grouping of a process, further set up a plurality of threads in this process, and the thread that utilizes described foundation to this process corresponding a plurality of veneers groupings carry out respectively route searching.
For a process of corresponding veneer grouping, no longer need further to create a plurality of threads.
Step S405: the route searching result of all processes is gathered, obtain total route searching result.
With respect to the scheme in embodiment three, the scheme of the present embodiment is when corresponding a plurality of veneer grouping of a process, not successively route searching to be carried out in veneer grouping serially by this process, but take this process as the basis, further create a plurality of threads, by this a plurality of thread parallels ground to this process corresponding veneer grouping carry out route searching, greatly saved the time of route searching, and improved the utilance of process.
Embodiment five
The present embodiment is corresponding provides a kind of path searching apparatus, and as shown in Figure 5, this device comprises that grouped element 501, search unit set up unit 502, trigger element 503 and gather unit 504.
Wherein, grouped element 501 is used for the veneer of the network element of the whole network is divided into groups according to the physical connection mode between veneer, so that the connection that is independent of each other between each veneer grouping.Search unit is set up unit 502 and is used for setting up a plurality of search units.Trigger element 503 is used for triggering search unit and sets up unit 502 for search unit corresponding to each veneer grouping foundation, and trigger the search unit of setting up and carry out route searching in each self-corresponding veneer grouping, gather unit 504 and be used for the Search Results of all search units is gathered, obtain total route searching result.
Wherein, grouped element 501 can comprise: detection sub-unit 5011 and division subelement 5012.Wherein whether detection sub-unit 5011 for detection of existing between veneer between plate intersects and optical fiber, divide that subelement 5012 is used for existing each other of detecting of detection sub-unit 5011 intersected between plate and the veneer of optical fiber is divided into a veneer grouping, make the veneer of final formation not exist between plate between dividing into groups and intersect.
When above-mentioned search unit was set up the search unit of setting up unit 502 and is thread, as shown in Figure 6, search unit is set up the unit can comprise that thread sets up subelement 5021, and this thread is set up subelement 5021 and is used for setting up a plurality of threads.This moment, trigger element 503 concrete a plurality of threads of setting up subelement 5021 foundation for the triggering thread carried out respectively route searching in each self-corresponding veneer grouping.
For the number of the thread of the tackling foundation number situation less than the veneer grouping, preferably, as shown in Figure 7, trigger element 503 comprises: take detection sub-unit 5031, etc. subelement 5032 to be triggered and search trigger subelement 5033.Wherein, take detection sub-unit 5031 for detection of whether all threads are all occupied be used to carrying out route searching; Complete the thread in path etc. subelement 5032 to be triggered for triggering the veneer packet awaits of not yet carrying out route searching; Search trigger subelement 5033 is used for triggering the thread of completing route searching route searching is carried out in the described veneer grouping of not yet carrying out route searching.
When above-mentioned search unit was set up the search unit of setting up unit 502 and is process, as shown in Figure 8, search unit is set up the unit can comprise that process sets up subelement 5022.This process is set up subelement 5022 and is used for setting up a plurality of processes.At this moment, trigger element 503 is concrete is used for triggering described process and sets up a plurality of processes of setting up the unit and carry out respectively route searching in each self-corresponding veneer grouping.
When above-mentioned search unit was set up the search unit of setting up unit 502 and comprised thread in process and process, as shown in Figure 9, search unit is set up the unit and comprised: process sets up subelement 5023 and thread is set up subelement 5024.Wherein process subelement 5023 is used for setting up a plurality of processes, and thread is set up unit 5024 and is used for setting up a plurality of threads.At this moment, as shown in figure 10, trigger element 503 comprises: first via path search triggers subelement 5034, thread is set up and triggered subelement 5035 and the second route searching triggering subelement 5036.Wherein first via path search triggering subelement 5034 carries out respectively route searching for triggering described a plurality of process in each self-corresponding veneer grouping; When thread set up to trigger subelement 5035 and is used for for corresponding a plurality of veneers grouping of a process, trigger thread and set up subelement 5035 and in-processly set up a plurality of threads at this; The second route searching trigger subelement 5036 be used for thread set up trigger subelement 5035 and set up a plurality of threads after, triggers described a plurality of threads and carry out respectively route searching in the veneer corresponding to process at this thread place divides into groups.
need to prove, even other application that multithreading is searched for simultaneously occur in transmission network management system, even or user's networking splits into independently networking with other formulas, (split according to the port that is mutually related this moment for example to adopt thinner granularity, can reduce certain efficient although it is so, do not reach optimum efficiency), but these are only that the medium of the granularity that splits or fractionation is (in different suppliers' transmission system, might claim intersection and optical fiber to be other titles) difference, and then the searching method that adopts multi-process that above-mentioned each embodiment of the present invention mentions or multithreading is also within protection scope of the present invention.
The above is only the preferred embodiment of the present invention; should be pointed out that for those skilled in the art, under the prerequisite that does not break away from the principle of the invention; can also make some improvements and modifications, these improvements and modifications also should be considered as protection scope of the present invention.