Summary of the invention
Embodiment of the invention technical matters to be solved is, a kind of dynamic base management method and device are provided.Can realize unified management to dynamic base, simplify the realization of front-end and back-end, make whole framework universalization, more easy exploiting and expansion.
In order to solve the problems of the technologies described above, the embodiment of the invention provides a kind of dynamic base management method, comprising:
Load the dynamic base of management dynamic base;
The dynamic base of the said management dynamic base of initialization, said initialization comprise that the dynamic base of said management dynamic base loads the bottom dynamic base of management, and the function register that said bottom dynamic base is supported is in the dynamic base of said management dynamic base;
The access request that the dynamic base receiving front-end of said management dynamic base sends;
The function that the dynamic base of said management dynamic base is supported according to the bottom dynamic base of the said access request inquiry and registration that receives, and functional object or the return results of bottom dynamic base support that returns said front end request according to Query Result to said front end be not for supporting.
Wherein, said function register with the support of said bottom dynamic base can comprise in the dynamic base of said management dynamic base:
Call the registration function of said bottom dynamic base, the function register that said bottom dynamic base is supported is in the dynamic base of said management dynamic base.
Simultaneously, said method also can further comprise, generates the dynamic base of said management dynamic base in advance.
The bottom dynamic base of the dynamic base management of said management dynamic base is the bottom dynamic base of a plurality of identical or different types.
The dynamic base of said management dynamic base comprises front end call function table, unified entrance function and bottom call function table, and the dynamic base of said management dynamic base comprises according to the function of the bottom dynamic base support of the said access request inquiry and registration that receives:
Call the function in the said front end call function table according to the access request of said front end;
Function in the invoked said front end call function table jumps to said unified entrance function;
Said unified entrance function jumps to function corresponding in the said bottom call function table again.
On the other hand, the embodiment of the invention also provides a kind of dynamic base management devices, and this device comprises:
Load-on module is used to load the dynamic base of managing dynamic base;
Initialization module; The dynamic base that is used for the said management dynamic base of initialization; Said initialization comprises that the dynamic base of said management dynamic base loads the bottom dynamic base of management, and the function register that said bottom dynamic base is supported is in the dynamic base of said management dynamic base;
Administration module; Be used to move the dynamic base of the said management dynamic base after the initialization; The access request that the dynamic base receiving front-end of said management dynamic base sends; And the function of supporting according to the bottom dynamic base of the said access request inquiry and registration that receives, functional object or the return results of bottom dynamic base support that returns said front end request to said front end according to Query Result again be not for supporting.
Wherein, said initialization module also is used for, and calls the registration function of said bottom dynamic base, and the function register that said bottom dynamic base is supported is in the dynamic base of said management dynamic base.
Said device also can comprise, generation module is used for generating in advance the dynamic base of said management dynamic base.
The bottom dynamic base of the dynamic base management of said management dynamic base is the bottom dynamic base of a plurality of identical or different types.
The dynamic base of said management dynamic base comprises front end call function table, unified entrance function and bottom call function table,
The dynamic base of the said management dynamic base after the initialization of said administration module operation also is used for; Call the function in the said front end call function table according to the access request of said front end; Function in the invoked said front end call function table jumps to said unified entrance function, and said unified entrance function jumps to function corresponding in the said bottom call function table again.
In embodiments of the present invention through realizing the dynamic base of a management dynamic base; The dynamic base of bottom all is registered to wherein, comes all bottom dynamic base of unified management by it, front end visits all functions of bottom dynamic base through the dynamic base of this management dynamic base; Like this when the bottom dynamic base changes; As long as be modified in the log-on message in the dynamic base of managing dynamic base, just can realize the visit of front end, improved the versatility of whole framework.
Embodiment
To combine the accompanying drawing in the embodiment of the invention below, the technical scheme in the embodiment of the invention is carried out clear, intactly description, obviously, described embodiment only is the present invention's part embodiment, rather than whole embodiment.Based on the embodiment among the present invention, those of ordinary skills are not making the every other embodiment that is obtained under the creative work prerequisite, all belong to the scope of the present invention's protection.
In embodiments of the present invention; Dynamic base through a management dynamic base realizes front end calling the bottom dynamic base; Because the bottom dynamic base only need be carried out the registration of function in the dynamic base of management dynamic base; Front end just can realize that through the function of registration function corresponding calls, and the unified interface that makes front end to provide through the dynamic base of managing dynamic base gets final product, when the bottom dynamic base changes; Front end need not carry out code development, has improved the efficient of system in exploitation greatly.
As shown in Figure 1, be an idiographic flow synoptic diagram of the dynamic base management method in the embodiment of the invention.This flow process comprises the steps.
101, load the dynamic base of management dynamic base.The step that certainly, before this step, also can comprise the dynamic base that generates said management dynamic base in advance.Owing to when moving, the situation of the dynamic base of managing dynamic base possibly occur repeatedly loading, thereby a generation action might not all be arranged before each loading action in system.
102, the dynamic base of the said management dynamic base of initialization, said initialization comprise that the dynamic base of said management dynamic base loads the bottom dynamic base of management, and the function register that said bottom dynamic base is supported is in the dynamic base of said management dynamic base.Such as, through calling the registration function of said bottom dynamic base, the function register that said bottom dynamic base is supported is in the dynamic base of said management dynamic base.
Wherein, the bottom dynamic base of the dynamic base of said management dynamic base management can be the bottom dynamic base of a plurality of identical or different types.Like these bottom dynamic base can all be the bottom dynamic base of photoshop, also can be the bottom dynamic base of video converter, also can be the combination of the bottom dynamic base of photoshop and video converter, or the like.
103, the access request of the dynamic base receiving front-end of said management dynamic base transmission.
104, the function supported according to the bottom dynamic base of the said access request inquiry and registration that receives of the dynamic base of said management dynamic base, and functional object or the return results of bottom dynamic base support that returns said front end request according to Query Result to said front end be not for supporting.
In the dynamic base of management dynamic base, can comprise front end call function table, unified entrance function and bottom call function table, the dynamic base of so said management dynamic base can comprise according to the function of the bottom dynamic base support of the said access request inquiry and registration that receives: call the function in the said front end call function table according to the access request of said front end; Function in the invoked said front end call function table jumps to said unified entrance function; Said unified entrance function jumps to function corresponding in the said bottom call function table again.
Corresponding to above-mentioned method flow, the embodiment of the invention also provides a kind of dynamic base management devices, and is as shown in Figure 2, and this device comprises: load-on module 20 is used to load the dynamic base of managing dynamic base; Initialization module 22; The dynamic base that is used for the said management dynamic base of initialization; Said initialization comprises that the dynamic base of said management dynamic base loads the bottom dynamic base of management, and the function register that said bottom dynamic base is supported is in the dynamic base of said management dynamic base; Administration module 24; Be used to move the dynamic base of the said management dynamic base after the initialization; The access request that the dynamic base receiving front-end of said management dynamic base sends; And the function of supporting according to the bottom dynamic base of the said access request inquiry and registration that receives, functional object or the return results of bottom dynamic base support that returns said front end request to said front end according to Query Result again be not for supporting.
Wherein, said device also can comprise, generation module 26 (being designated dotted line among the figure) is used for generating in advance the dynamic base of said management dynamic base.
Said initialization module 22 also is used for, and calls the registration function of said bottom dynamic base, and the function register that said bottom dynamic base is supported is in the dynamic base of said management dynamic base.
The bottom dynamic base of the dynamic base management of said management dynamic base is the bottom dynamic base of a plurality of identical or different types.The dynamic base of said management dynamic base comprises front end call function table, unified entrance function and bottom call function table; The dynamic base of the said management dynamic base after the initialization of said administration module 24 operations also is used for; Call the function in the said front end call function table according to the access request of said front end; Function in the invoked said front end call function table jumps to said unified entrance function, and said unified entrance function jumps to function corresponding in the said bottom call function table again.
As shown in Figure 3, be another idiographic flow synoptic diagram of the dynamic base management method in the embodiment of the invention.This flow process comprises the steps.
Step 301: the dynamic base that generates the management dynamic base in advance.
Step 302: outside (interface or operation layer) loads the dynamic base of this management dynamic base.
Step 303: the initialization function of the dynamic base of external call management dynamic base.
Step 304: the dynamic base of management dynamic base is carried out initialization; Load the bottom dynamic base that all quilts are managed; And call their registration function; Let function register that the bottom dynamic base of being managed supports its in the dynamic base of this management dynamic base, by the dynamic base unified management of managing dynamic base.
Step 305: outside (interface or operation layer) request query should be managed the dynamic base of dynamic base.
Step 306: the dynamic base of this management dynamic base according to the request query that receives to outside return results information.Particularly, when the function register table of the dynamic base of managing dynamic base,, then return this functional object to the outside if there is the functional object of supporting according to the requesting query oneself that receives; If there is not the functional object of support, then returns empty information etc. and do not support with indication to the outside.
Be appreciated that the angle from control from the embodiment of the above, interface (being that front end or title are outside) provides an external program; When the user double-clicks it; System has given this program control, this program power of being under control, and it is able to carry out then; When this program was carried out, elder generation loaded the dynamic base of management dynamic base, and the initialization function (promptly the dynamic base of management dynamic base being carried out initialization) through calling the dynamic base of managing dynamic base is given the dynamic base of managing dynamic base control then; After the controlled authority of dynamic base of management dynamic base; Load the dynamic base that all are managed; And to the function of these dynamic base register (as, these functions are put in the function register table of oneself), the dynamic base of managing dynamic base has afterwards just had a tabulation of all functions; Manage the dynamic base of dynamic base then and return (being that initialization finishes), return authority to the outside from the initialization function.When function of the dynamic base of managing dynamic base will be inquired in the outside; The request function of the dynamic base of external call management dynamic base; Give the dynamic base of management dynamic base control once more, the dynamic base of management dynamic base is returned the result, and control is got back to the outside once more.
Visible in sum; The core of the embodiment of the invention is to realize the dynamic base of a management dynamic base, and on the function, its function is equivalent to the registration table of windows; The dynamic base of bottom all should be registered to above it, and comes all dynamic base of unified management bottom by it; And the outside service logical layer only should visit all functions of bottom through it, comes to visit through registration table just as the program of windows and asks the assembly in the system.
Simultaneously; The dynamic base of management dynamic base is except supporting component registration; Also support the registering functional function, come in the address registration of some general functions exactly, use a dynamic address table in store then; The also corresponding IID of function, outside management dynamic base transfer through this core is come to visit and is asked real function address; If a function has a plurality of assemblies to realize, as directshow, select an assembly (be dynamically connected certainly, also can manually connect).
In specific embodiments more of the present invention, the function that the dynamic base of this management dynamic base will realize can comprise:
Init: all dll under the traversal current directory, and call their registration function;
Regedit: load and specify dynamic base, and call its registration function;
Unregedit: dynamic base is specified in unloading;
Uninit: anti-initialization;
Request: query function inquires bottom and whether has realized appointed function;
Get_info: return all log-on messages, debugging is analyzed and is used.
The function that the dynamic base of being managed accordingly, will realize comprises:
Regedit: the function of supporting oneself is with in corresponding interface is registered to the dynamic base of management; Let the upper strata can have access to the function of oneself supporting; Also to enter to the perfect program registration of a functional support, a selectivity is provided, when calling for the upper strata if another assembly has also been realized our function own; Its realization is more perfect than us, should call it rather than oneself so;
Unregedit: when the upper strata will unload oneself, can call this function, do some corresponding processing;
Request: function request function is used for letting the upper strata inquiry whether support an appointed function.
Therefore, the method and apparatus that the embodiment of the invention provided can dynamically increase and reduce the dynamic base of managing, and the upper strata need not to remodify the dynamic base that can call in the bottom.And different with plug-in unit of the prior art, the method and apparatus that the embodiment of the invention provided has more than and is limited on the one type very single dynamic base of management.
Simultaneously, in order to realize security, the dynamic base of management dynamic base can realize two function pointer tables; One is the function pointer of depositing the function register of bottom dynamic base is come in, and is Table A, and one is then generated by the dynamic base of managing dynamic base; Be table B, all deposit pointer.Pointer during the A table is shown with B is to concern one to one; The function in the B table is called on the upper strata; Function in the B table jumps to unified entrance function, and first entrance function jumps to corresponding function in the A table again, and the function pointer in the A table is to point to function corresponding in the plug-in unit.The all functions that call on the upper strata all can be passed through unified entrance function, and are as shown in Figure 4.
Can carry out safety verification at unified entrance function, with filtering function or the like.This whole process is just as the system call of operating system; What the B table was corresponding is the API table of operating system; The system call inlet that unified entrance function is equivalent to operating system (or is the interruption inlet; CPU after P3 cries the rapid system call entry), the A table is equivalent to the API table in the operating system nucleus.
In addition; The technical scheme that provides through the embodiment of the invention when two softwares all are when going to manage according to such method, is photoshop such as one; Other one is video Converter; These two bottoms (all dynamic base of bottom) can merge so, are equivalent to put all feature cards together just, and this new bottom is with the function that photoshop and video Converter are provided simultaneously.Just as this software of emacs, can play games with it, can write code with it, can listen to the music with it, also can come receiving and dispatching mail with it.This is a kind of compound relation of binary level, also is a kind of relation of combination.
The method for designing of such framework because dynamic base is binary level, is the combination of binary level therefore, the reusing of binary level.
To sum up can know,, the dynamic base of bottom all is registered to wherein in embodiments of the present invention through realizing the dynamic base of a management dynamic base; Come all bottom dynamic base of unified management by it; Front end visits all functions of bottom dynamic base through the dynamic base of this management dynamic base, like this when the bottom dynamic base changes, as long as be modified in the log-on message in the dynamic base of management dynamic base; Just can realize the visit of front end, improve the versatility of whole framework.
One of ordinary skill in the art will appreciate that all or part of flow process that realizes in the foregoing description method; Be to instruct relevant hardware to accomplish through computer program; Described program can be stored in the computer read/write memory medium; This program can comprise the flow process like the embodiment of above-mentioned each side method when carrying out.Wherein, described storage medium can be magnetic disc, CD, read-only storage memory body (Read-Only Memory, ROM) or at random store memory body (Random Access Memory, RAM) etc.
Above disclosedly be merely a kind of preferred embodiment of the present invention, can not limit the present invention's interest field certainly with this, the equivalent variations of therefore doing according to claim of the present invention still belongs to the scope that the present invention is contained.