Summary of the invention
Embodiments provide a kind of method and apparatus of management software functional module life cycle, to realize analysing structure in order to multiple functional module, reduce software maintenance cost.
First aspect, provide a kind of method of management software functional module life cycle, described method comprises:
When software startup, generate the dependence collection of illustrative plates between each functional module in described software;
According to described dependence collection of illustrative plates, that determines each functional module described analyses structure order;
When described software preparation exits, described in determining, analyse structure order, in order structure is analysed to each functional module described.
Alternatively, the dependence graph in described generation software between each functional module comprises:
Read configuration file, in described configuration file, describe the dependence between each functional module;
According to described configuration file, generate the dependence collection of illustrative plates between each functional module described.
Wherein, described configuration file can store as a part for described software, and the dependence between modules can utilize JSON, XML or INI form to describe.
Alternatively, in one embodiment, described method also comprises:
When described software needs to upgrade, by upgrading described configuration file to realize the adjustment of functional module being analysed to structure order.
Alternatively, described dependence collection of illustrative plates is directed acyclic graph DAG, described according to described dependence collection of illustrative plates, determines that the structure order of analysing of each functional module described comprises:
Described dependence collection of illustrative plates is utilized to carry out topological sorting in the following manner:
I), an in-degree is selected to be the summit of 0 and to export;
Ii), delete from described dependence collection of illustrative plates described summit and all go out limit;
Iii), circulation performs above step I) and ii).
Second aspect, provide a kind of device of management software functional module life cycle, described device comprises:
Generation unit, for when software startup, generates the dependence collection of illustrative plates between each functional module in described software;
Determining unit, for the described dependence collection of illustrative plates generated according to described generation unit, that determines each functional module described analyses structure order;
Processing unit, for when described software preparation exits, analyses structure order, analyse structure in order to each functional module described according to described determining unit described in determining.
Alternatively, described generation unit specifically for:
Read configuration file, in described configuration file, describe the dependence between each functional module;
According to described configuration file, generate the dependence collection of illustrative plates between each functional module described.
Alternatively, described device also comprises storage unit,
Described storage unit, for the part of described configuration file as described software being stored, wherein, the dependence in described configuration file between modules utilizes JSON, XML or INI form to describe.
Alternatively, in one embodiment of the invention, described device also comprises:
Updating block, during for needing at described software to upgrade, upgrades described configuration file;
Described generation unit, also for according to the configuration file after renewal, generates the dependence collection of illustrative plates after upgrading;
Described determining unit, also for according to the dependence collection of illustrative plates after described renewal, that determines each functional module after upgrading analyses structure order;
Described processing unit, also for analysing structure order according to the functional module after described renewal, analyses structure in order to each functional module described.
Alternatively, described dependence collection of illustrative plates is directed acyclic graph DAG, described determining unit specifically for:
Described dependence collection of illustrative plates is utilized to carry out topological sorting in the following manner:
I), an in-degree is selected to be the summit of 0 and to export;
Ii), delete from described dependence collection of illustrative plates described summit and all go out limit;
Iii), circulation performs above step I) and ii).
The method and apparatus of the management software functional module life cycle that the embodiment of the present invention provides, what utilize the dependence collection of illustrative plates between each functional module to determine each functional module described analyses structure order, and structure order is analysed described in determining, in order structure is analysed to each functional module described.Because dependence collection of illustrative plates clearly can reflect the dependence between each functional module, thus just can determine accordingly suitably between each functional module to analyse structure order, thus realize analysing structure in order to multiple functional module, reduce software maintenance cost.
Embodiment
In order to those skilled in the art understand the technical scheme of the application better, first some terms are herein made an explanation below.
Directed acyclic graph (Directory Acyclic Graph, DAG) is made up of the summit of gathering and directed edge, and every bar limit connects a summit and arrives another, with this, from a certain summit p, along orderly limit, it is impossible that p is got back in final circulation again.
Functional module refers to that data illustrate, the set of executable statement supervisor element.Functional module completes a subfunction of software program.
The embodiment of the present invention utilizes analyses structure order between dependence collection of illustrative plates determination functional module, can ensure to analyse structure in order between multiple functional module, reduce software maintenance cost.
For making the object, technical solutions and advantages of the present invention clearly, below in conjunction with accompanying drawing, embodiment of the present invention is described further in detail.
Fig. 1 is the process flow diagram of the method for a kind of management software functional module life cycle that the embodiment of the present invention provides.With reference to Fig. 1, the method for the management software functional module life cycle that the embodiment of the present invention provides can comprise:
11, when software startup, the dependence collection of illustrative plates between each functional module in described software is generated;
12, according to described dependence collection of illustrative plates, that determines each functional module described analyses structure order;
13, when described software preparation exits, described in determining, analyse structure order, in order structure is analysed to each functional module described.
In embodiments of the present invention, described dependence collection of illustrative plates can reflect the dependence between each functional module.
In embodiments of the present invention, alternatively, described dependence collection of illustrative plates can be directed acyclic graph or other collection of illustrative plates that can reflect the dependence between each functional module.
It should be noted that, in soft project object model, dependence describes the semantic annexation between two model elements (class, use-case etc.): one of them model element is independently, another model element is not independently, it depends on independently model element, if independently model element changes, impact is depended on its model element.In embodiments of the present invention, the model element spy in dependence refers to the functional module in software.
If when modules A depends on module B, namely the functional realiey of modules A needs the functional realiey depending on module B, then based on the dependence between modules A and module B, just can analyse structure order between determination module A and module B, thus reach the object of administration module life cycle.
When modules A depends on module B, not only embodied dependence functionally, also embodied the dependence in life cycle, namely the life cycle of modules A depends on the life cycle of module B, thus establish between modules A, B analyse structure order: after A analyses structure, B analyses structure again.
The method of the management software functional module life cycle that the embodiment of the present invention provides, what utilize the dependence collection of illustrative plates between each functional module to determine each functional module described analyses structure order, and structure order is analysed described in determining, in order structure is analysed to each functional module described.Because dependence collection of illustrative plates clearly can reflect the dependence between each functional module, thus just can determine accordingly suitably between each functional module to analyse structure order, thus realize analysing structure in order to multiple functional module, reduce software maintenance cost.
Alternatively, the dependence graph generated described in step 11 in software between each functional module can comprise:
Read configuration file, in described configuration file, describe the dependence between each functional module;
According to described configuration file, generate the dependence collection of illustrative plates between each functional module described.
Wherein, alternatively, the dependence in described configuration file between each functional module can utilize JSON, XML or INI form to describe.So, the dependence collection of illustrative plates between its functional module can just dynamically be generated.
Describe the dependence between each functional module for JSON form, have employed the roughly descriptor format that the dependence of this data layout of JSON to intermodule be described in the embodiment of the present invention as follows:
Describe by above form, expression be " Depender depends on Dependee ", i.e. " Depender depends on Dependee ".
Software program just correctly can generate the dependence collection of illustrative plates in software between functional module according to the description of this configuration file.
In addition, in embodiments of the present invention, the part that described configuration file can be used as described software stores, that is, described configuration file is with in the form chained process sequence of program resource.Thus, the security of described configuration file can be ensured, prevent configuration file by malicious modification or damage.Certainly, when security requirement is not high, also can adopts and described configuration file is not stored as a part for described software.
When software needs to upgrade, as when needs increase, minimizing functional module, need the dependence between adjustment functional module and then readjust to analyse structure order, now, only need to upgrade this configuration file, like this, simple update software efficiently can be realized.In one embodiment of the invention, except comprising step 11 ~ 13 above-mentioned, the method of the management software functional module life cycle that the embodiment of the present invention provides also can comprise: when described software needs to upgrade, by upgrading described configuration file to realize the adjustment of functional module being analysed to structure order.
In embodiments of the present invention, when described dependence collection of illustrative plates is directed acyclic graph DAG, according to described dependence collection of illustrative plates described in step 13, determine analysing structure order and can comprising of each functional module described:
Described dependence collection of illustrative plates is utilized to carry out topological sorting in the following manner:
I), an in-degree is selected to be the summit of 0 and to export;
Ii), delete from described dependence collection of illustrative plates described summit and all go out limit;
Iii), circulation performs above step I) and ii).
Topological sorting herein refers to, scheming G to a DAG and carry out topological sorting, is that a linear order is lined up on summits all in figure G, make any pair summit u and v in figure, if limit (u, v) ∈ E (G), then before u appears at v in linear order.Briefly, obtained a total order in this set by a partial order in certain set, this operation is referred to as topological sorting.
Topological sorting is commonly used to the order determining that a dependence concentrates event to occur.In the present invention in order to obtain between each functional module analyse structure order, utilize the dependence DAG collection of illustrative plates of established each intermodule to carry out topological sorting.
Fig. 2 is the example of a kind of DAG figure.The result of DAG figure shown in Fig. 2 after utilizing method herein to carry out topological sorting is: 2-> 8-> 0-> 3-> 7-> 1-> 5-> 6-> 9-> 4-> 11-> 10-> 12.Visible, in embodiments of the present invention, utilize DAG figure can clearly determine between each functional module analyse structure order, realize analyse each functional module of structure in an orderly manner, save safeguard and cost of development.
Fig. 3 is the process flow diagram of the method for the another kind of management software functional module life cycle that the embodiment of the present invention provides.With reference to Fig. 3, the method for the management software functional module life cycle that the embodiment of the present invention provides can comprise:
31, when software startup, read configuration file, generate dependence collection of illustrative plates, wherein, in described configuration file, describe the dependence between each functional module.
Wherein, described dependence collection of illustrative plates can be schemed for DAG.Dependence in described configuration file between each functional module can utilize JSON, XML or INI form to describe.
32, when program is run, each functional module of corresponding establishment.
33, when described software preparation exits, according to described dependence collection of illustrative plates, that determines each functional module described analyses structure order.
Wherein, described dependence collection of illustrative plates is utilized to carry out topological sorting in the following manner:
I), an in-degree is selected to be the summit of 0 and to export;
Ii), delete from described dependence collection of illustrative plates described summit and all go out limit;
Iii), circulation performs above step I) and ii).
34, described in determining, analyse structure order, in order structure is analysed to each functional module described.
When described software needs to upgrade, by upgrading described configuration file to realize the adjustment of functional module being analysed to structure order.
The method of the management software functional module life cycle that the embodiment of the present invention provides, what utilize the dependence collection of illustrative plates between each functional module to determine each functional module described analyses structure order, and structure order is analysed described in determining, in order structure is analysed to each functional module described.Because dependence collection of illustrative plates clearly can reflect the dependence between each functional module, thus just can determine accordingly suitably between each functional module to analyse structure order, thus realize analysing structure in order to multiple functional module, reduce software maintenance cost.
Fig. 4 A is the structured flowchart of the device of a kind of management software functional module life cycle that the embodiment of the present invention provides.With reference to Fig. 4, the device 40 of the management software functional module life cycle that the embodiment of the present invention provides can comprise generation unit 41, determining unit 42 and processing unit 43.Wherein:
Generation unit 41, for when software startup, generates the dependence collection of illustrative plates between each functional module in described software;
Determining unit 42, for the described dependence collection of illustrative plates generated according to described generation unit 41, that determines each functional module described analyses structure order;
Processing unit 43, for when described software preparation exits, analyses structure order, analyse structure in order to each functional module described according to described determining unit 42 described in determining.
The device of the management software functional module life cycle that the embodiment of the present invention provides, what utilize the dependence collection of illustrative plates between each functional module to determine each functional module described analyses structure order, and structure order is analysed described in determining, in order structure is analysed to each functional module described.Because dependence collection of illustrative plates clearly can reflect the dependence between each functional module, thus just can determine accordingly suitably between each functional module to analyse structure order, thus realize analysing structure in order to multiple functional module, reduce software maintenance cost.
Alternatively, described generation unit 41 can be specifically for:
Read configuration file, in described configuration file, describe the dependence between each functional module;
According to described configuration file, generate the dependence collection of illustrative plates between each functional module described.
Alternatively, in one embodiment of the invention, with reference to Fig. 4 B, described device 40 also comprises storage unit 44,
Described storage unit 44, for the part of described configuration file as described software being stored, wherein, the dependence in described configuration file between modules utilizes JSON, XML or INI form to describe.
Alternatively, in one embodiment of the invention, with reference to Fig. 4 C, described device 40 also can comprise:
Updating block 45, during for needing at described software to upgrade, upgrades described configuration file;
Described generation unit 41, also for according to the configuration file after renewal, generates the dependence collection of illustrative plates after upgrading;
Described determining unit 42, also for according to the dependence collection of illustrative plates after described renewal, that determines each functional module after upgrading analyses structure order;
Described processing unit 43, also for analysing structure order according to the functional module after described renewal, analyses structure in order to each functional module described.
Alternatively, in another embodiment of the present invention, described dependence collection of illustrative plates is directed acyclic graph DAG, and described determining unit 42 can be specifically for:
Described dependence collection of illustrative plates is utilized to carry out topological sorting in the following manner:
I), an in-degree is selected to be the summit of 0 and to export;
Ii), delete from described dependence collection of illustrative plates described summit and all go out limit;
Iii), circulation performs above step I) and ii).
It should be noted that: the device of the management software functional module life cycle that above-described embodiment provides only is illustrated with the division of above-mentioned each functional module when describing, in practical application, can distribute as required and by above-mentioned functions and be completed by different functional modules, inner structure by device is divided into different unit or functional module, to complete all or part of function described above.In addition, the device of the management software functional module life cycle that above-described embodiment provides and the embodiment of the method for management software functional module life cycle belong to same design, and its specific implementation process refers to embodiment of the method, repeats no more here.
It should be noted that, each embodiment in this instructions all adopts the mode of going forward one by one to describe, and what each embodiment stressed is the difference with other embodiments, between each embodiment identical similar part mutually see.For device class embodiment, due to itself and embodiment of the method basic simlarity, so description is fairly simple, relevant part illustrates see the part of embodiment of the method.
It should be noted that, in this article, term " comprises ", " comprising " or its any other variant are intended to contain comprising of nonexcludability, thus make to comprise the process of a series of key element, method, article or equipment and not only comprise those key elements, but also comprise other key elements clearly do not listed, or also comprise by the intrinsic key element of this process, method, article or equipment.When not more restrictions, the key element limited by statement " comprising ... ", and be not precluded within process, method, article or the equipment comprising described key element and also there is other identical element.
One of ordinary skill in the art will appreciate that all or part of step realizing above-described embodiment can have been come by hardware, the hardware that also can carry out instruction relevant by program completes, described program can be stored in a kind of computer-readable recording medium, the above-mentioned storage medium mentioned can be ROM (read-only memory), disk or CD etc.
The foregoing is only preferred embodiment of the present invention, not in order to limit the present invention, within the spirit and principles in the present invention all, any amendment done, equivalent replacement, improvement etc., all should be included within protection scope of the present invention.