The content of the invention
The embodiments of the invention provide a kind of standardized product service apparatus and business module extension method of replacing, it is possible to increaseThe integrated efficiency of secondary development business module and corresponding business module.
In a first aspect, the embodiments of the invention provide a kind of standardized product service apparatus, including:Business common interface, depositModule and at least one standardized product business module are stored up, wherein,
At least one described standardized product business module, for being generated according to the business common interface;
The memory module, generated according to the business common interface at least one for receiving and storing outside inputIndividual secondary development business module distinguishes corresponding products configuration information;
The business common interface, for according to each the described products configuration information stored in the memory module, reallyThe target secondary development business module enabled before settled;And obtain the mesh corresponding with the target secondary development business moduleProducts configuration information is marked, and reflection is carried out according to the target product configuration information and is called, to realize the target secondary developmentIt is integrated between business module and the corresponding standardized product business module.
Preferably,
The products configuration information, including:Product identification, name of product, version, program set name, class name, run location,Whether enable and download any one or more in ID (identification, identity) on demand.
Preferably,
The products configuration information, including:Whether enable;
The memory module, is further used for prestoring at least one at least one described standardized product business moduleIndividual target criteria business module distinguishes corresponding products configuration information;And according to outside triggering, will the corresponding target markDescribed whether enable in the products configuration information of quasi- business module is updated to not enable, and will be with the target criteriaWhether described in the corresponding products configuration information of the corresponding secondary development business module of business module enables renewalTo enable.
Preferably,
Using XML, (Extensible Markup Language, can expand the interface parameters type of the business common interfaceOpen up markup language) character string type;
Preferably,
The business common interface, including:Client traffic interface and server end business interface.
Second aspect, the embodiments of the invention provide a kind of industry based on any of the above-described described standardized product service apparatusModule of being engaged in extension method of replacing, including:
At least one standardized product business module is generated according to business common interface;
Memory module receives and stores at least one generated according to the business common interface of outside input and secondary opensSending service module distinguishes corresponding products configuration information;
The business common interface is according to each the described products configuration information stored in the memory module, it is determined that currentlyThe target secondary development business module enabled;And obtain the target product corresponding with the target secondary development business moduleConfiguration information, and called according to target product configuration information progress reflection, to realize the target secondary development business mouldIt is integrated between block and the corresponding standardized product business module.
Preferably,
The products configuration information, including:Product identification, name of product, version, program set name, class name, run location,Whether enable and download any one or more in ID on demand.
Preferably,
The products configuration information, including:Whether enable;
Further comprise:Prestore at least one target criteria industry at least one described standardized product business moduleModule of being engaged in distinguishes corresponding products configuration information;
Received in the memory module and store at least one generated according to the business common interface of outside inputSecondary development business module is distinguished after corresponding products configuration information, and in the business common interface according to the storage mouldEach the described products configuration information stored in block, it is determined that before the target secondary development business module currently enabled, furtherIncluding:
According to outside triggering, described in the products configuration information of the corresponding target criteria business moduleWhether enable and be updated to not enable;
Will the corresponding products configuration of corresponding with the target criteria business module secondary development business moduleDescribed whether enable in information is updated to enable.
Preferably,
The interface parameters type of the business common interface uses XML character string types;
Preferably,
The business common interface, including:Client traffic interface and server end business interface.
The third aspect, the embodiments of the invention provide a kind of computer-readable recording medium, including execute instruction, when the place of storage controlWhen managing the device execution execute instruction, the storage control performs the method described in any of the above-described.
Fourth aspect, the embodiments of the invention provide a kind of storage control, including:Processor, memory and bus;
The memory is used to store execute instruction, and the processor is connected with the memory by the bus, whenDuring the storage control operation, the execute instruction of memory storage described in the computing device, so that the storageController performs the method described in any of the above-described.
The embodiments of the invention provide a kind of standardized product service apparatus and business module extension method of replacing, standard productionBusiness common interface and memory module are provided with product service apparatus, wherein, memory module storage is secondary development businessThe corresponding products configuration information of module, then business common interface can determine the target two currently enabled by the memory moduleSecondary exploitation business module, is called, and then cause target secondary development so as to carry out reflection using corresponding products configuration informationBusiness module realizes business common interface, namely realizes target secondary development business module and the phase in standardized product service apparatusAnswer integrated between standardized product business module.Because secondary development business module replaces original benchmark service module, and it is otherWhen integrated between corresponding standardized product business module, mainly realized by business common interface, without corresponding to remainingProgram in business module is modified, and this improves collection of the secondary development business module with corresponding business moduleInto efficiency.
Embodiment
To make the purpose, technical scheme and advantage of the embodiment of the present invention clearer, below in conjunction with the embodiment of the present inventionIn accompanying drawing, the technical scheme in the embodiment of the present invention is clearly and completely described, it is clear that described embodiment isA part of embodiment of the present invention, rather than whole embodiments, based on the embodiment in the present invention, those of ordinary skill in the artThe every other embodiment obtained on the premise of creative work is not made, belongs to the scope of protection of the invention.
As shown in figure 1, the embodiments of the invention provide a kind of standardized product service apparatus, the device includes:Business is publicInterface 101, memory module 102 and at least one standardized product business module 103, wherein,
At least one described standardized product business module 103, for being generated according to the business common interface 101;
The memory module 102, for receive and store outside input according to the business common interface 101 generateAt least one secondary development business module distinguishes corresponding products configuration information;
The business common interface 101, for being believed according to each the described products configuration stored in the memory module 102Breath, it is determined that the target secondary development business module currently enabled;And obtain relative with the target secondary development business moduleThe target product configuration information answered, and called according to target product configuration information progress reflection, to realize the target twoIt is integrated between secondary exploitation business module and the corresponding standardized product business module 103.
In the embodiment shown in fig. 1, business common interface and memory module are provided with standardized product service apparatus,Wherein, memory module storage is the corresponding products configuration information of secondary development business module, then business common interface can lead toCross the memory module and determine the target secondary development business module currently enabled, so as to utilize corresponding products configuration informationCarry out reflection to call, and then cause target secondary development business module to realize business common interface, namely realize that target is secondary to openIt is integrated between respective standard product business module in sending service module and standardized product service apparatus.Due to secondary development industryWhen integrated between the original benchmark service module of module permutation, and other corresponding standardized product business modules of being engaged in, mainly pass throughBusiness common interface realizes that, without being modified to the program in remaining corresponding service module, this improves secondaryDevelop the integrated efficiency of business module and corresponding business module.
In an embodiment of the invention, the products configuration information, including:Product identification, name of product, version, journeySequence set name, class name, run location, whether enable and on demand download ID in any one or more.
Wherein, it is that specification stores and is easy to obtain, products configuration information can be stored by form.For example, such asShown in table 1 below, for a kind of data structure of pre-defined common configuration table.
Table 1
Assuming that project implementation staff development goes out secondary development business module, then can be manually by the secondary development business moduleThe corresponding informations such as corresponding product identification (secondary development customized product), run location (0) are added in above-mentioned table 1.In addition,Program set name, class name and run location are to realize the key message that reflection is called.
In an embodiment of the invention, the products configuration information, including:Whether enable;The memory module 102,It is further used for prestoring at least one target criteria business module at least one described standardized product business module 103The corresponding products configuration information of difference;And according to outside triggering, by the production of the corresponding target criteria business moduleDescribed whether enable in product configuration information is updated to not enable, and will be corresponding described with the target criteria business moduleDescribed whether enable in the corresponding products configuration information of secondary development business module is updated to enable.
For example, have two standardized product business modules of A and B in standardized product service apparatus, and stored in memory moduleIt is A products configuration information, wherein, it is integrated between A, B module, it is assumed that during using the standardized product service apparatus,It was found that A modules do not meet the demanding criteria of enterprise, so that relevant item implements personnel has carried out customization secondary development for A,It has developed secondary development business module A ', then afterwards in the integrating process for realizing A ' modules and B modules, business is public to be connectMouth need to know whether currently enable is A ' modules, therefore, also need whether enabling in A modules being updated to by enabling beforeDo not enable, and whether enabling in A ' modules is updated to enable by not enabling before.
In addition, relevant item, which implements personnel, to change two products configurations according to the practical application scene on current projectWhether enabling in information, flexibly switches between A modules and A ' modules.
In addition, if relevant item implements the secondary development industry that personnel go out multiple different editions for A Development of ModuleBusiness module, if any A1、A2And A3, and the application scenarios of current project are directed to, it is necessary to A3Carried out with B modules integrated, then now needBy A, A1And A2Whether enabling in module all is updated to not enable, and only by A3Whether enabling in module is updated to openWith, then business common interface, can be according to 4 stored in memory module it is determined that during target secondary development business module afterwardsProducts configuration information, i.e. A, A1、A2And A3Corresponding products configuration information, determines the secondary development business currently enabled respectivelyModule is A3。
In an embodiment of the invention, the interface parameters type of the business common interface uses XML character string types.
In embodiments of the present invention, can be according to business by using XML format character string type as interface parameters typeDemand carries out good extension, makes it more readable, and improves the stability of business common interface.
In an embodiment of the invention, the business common interface, including:Client traffic interface and server end industryBusiness interface.
The contents such as the information exchange between each unit, implementation procedure in said apparatus, due to implementing with the inventive methodExample is based on same design, and particular content can be found in the narration in the inventive method embodiment, and here is omitted.
As shown in Fig. 2 the embodiments of the invention provide a kind of business mould based on any of the above-described standardized product service apparatusBlock extends method of replacing, and this method may include steps of:
Step 201:At least one standardized product business module is generated according to business common interface;
Step 202:Memory module receives and stored generated according to the business common interface at least the one of outside inputIndividual secondary development business module distinguishes corresponding products configuration information;
Step 203:The business common interface according to each the described products configuration information stored in the memory module,It is determined that the target secondary development business module currently enabled;And obtain corresponding with the target secondary development business moduleTarget product configuration information, and called according to target product configuration information progress reflection, opened with realizing that the target is secondaryIt is integrated between sending service module and the corresponding standardized product business module.
In an embodiment of the invention, the products configuration information, including:Product identification, name of product, version, journeySequence set name, class name, run location, whether enable and on demand download ID in any one or more.
In an embodiment of the invention, the products configuration information, including:Whether enable;Further comprise:Deposit in advanceAt least one target criteria business module at least one described standardized product business module of storage distinguishes corresponding products configurationInformation;After the step 102, and before the step 103, further comprise:, will be corresponding according to outside triggeringDescribed whether enable in the products configuration information of the target criteria business module is updated to not enable;Will be with the meshWhether described in the corresponding products configuration information of the corresponding secondary development business module of mark benchmark service module opensWith being updated to enable.
In an embodiment of the invention, the interface parameters type of the business common interface uses XML character string types.
In an embodiment of the invention, the business common interface, including:Client traffic interface and server end industryBusiness interface.
Two standardized products business module R and S will be included with standardized product service apparatus below, and opened using secondaryExemplified by sending service module R ' displacement standardized product business modules R, describe in detail provided in an embodiment of the present invention a kind of based on standardThe business module extension method of replacing of product service apparatus, as shown in figure 3, this method may include steps of:
Step 301:Pre-defined business common interface.
In embodiments of the present invention, what should be completed first is to extract and define business common interface.For example, utilizing keywordInterface defines IJHJHTest business common interfaces, is accessed and method sound comprising association attributes in the business common interfaceIt is bright (e.g., to state two methods:GetJHKyye、GetJHView).
Step 302:Pre-defined common configuration table.
In advance can be according to actual conditions, the data structure to common configuration table is set, such as above-mentioned embodiment table 1.
Step 303:Standardized product business module R products configuration information is stored in common configuration table in advance.
In embodiments of the present invention, with products configuration information comprising product identification, name of product, version, program set name,Class name, run location, whether enable and download ID on demand exemplified by totally 8 information.
Step 304:The secondary development business module R ' according to the generation of business common interface for receiving outside input is correspondingProducts configuration information, and store into common configuration table.
The business common interface unified by defining, standardized product business module R and its corresponding secondary development business mouldBlock R ' observes unified contract, realizes the interface that business needs according to stipulations.Therefore, exploitation standardized product business module R andDuring its corresponding secondary development business module R ', it is that can finally realize business common interface, then needs according to the businessCommon interface is developed.For example, have in secondary development business module R ' defined respectively using keyword class JZJH classes,GSJH classes, EKJH classes, these three classes realize IJHJHTest business common interfaces, realize GetJHKyye, GetJHView method.
In embodiments of the present invention, secondary development customized product is related according to the preset products configuration information of project applicationR ' products configuration information is added in table 1 by project implementation personnel by hand according to actual conditions.
Step 305:According to outside triggering, whether enabling in R products configuration information is updated to not enable, by R 'Products configuration information in whether enable and be updated to enable.
Due to the purpose of the embodiment of the present invention be by secondary development business module R ' displacement standardized product business module R, becauseThis can implement personnel by relevant item and whether enabling in the products configuration information in two modules is modified.
Step 306:Business common interface is according to the products configuration information stored in common configuration table, it is determined that the target enabledSecondary development business module R '.
After the corresponding change that above-mentioned steps 305 complete two products configuration information, business common interface can therefrom knowThat currently enable is secondary development business module R ', and non-standard product business module R, accordingly, it is determined that R ' opens for target is secondarySending service module.
Step 307:Business common interface obtains the corresponding program set names of R ', class name and run location from common configuration table.
In embodiments of the present invention, unified interface method of calling, realization is called using reflection.Wherein, it is anti-for reduction programPenetrate and call the performance brought that problem is lost, by class object, method by business common interface is realized etc. be cached in internal memory withImprove performance.
Step 308:Business common interface carries out reflection according to program set name, class name and run location and called, so that targetSecondary development business module R ' and standardized product business module S are integrated.
In embodiments of the present invention, the integrated of R ' and S modules is realized, that is to say makes target secondary development business module R ' realExisting business common interface.
To realize R ' displacement R modules, the key code used in whole implementation process can be as follows:
The embodiments of the invention provide a kind of computer-readable recording medium, including execute instruction, when the computing device of storage controlDuring the execute instruction, the storage control performs the method described in any of the above-described embodiment.
The embodiments of the invention provide a kind of storage control, including:Processor, memory and bus;The memoryFor storing execute instruction, the processor is connected with the memory by the bus, when storage control operationWhen, the execute instruction of memory storage described in the computing device, so that storage control execution is any of the above-describedMethod described in embodiment.
To sum up, each embodiment of the invention at least has the advantages that:
1st, in embodiments of the present invention, business common interface and memory module are provided with standardized product service apparatus,Wherein, memory module storage is the corresponding products configuration information of secondary development business module, then business common interface can lead toCross the memory module and determine the target secondary development business module currently enabled, so as to utilize corresponding products configuration informationCarry out reflection to call, and then cause target secondary development business module to realize business common interface, namely realize that target is secondary to openIt is integrated between respective standard product business module in sending service module and standardized product service apparatus.Due to secondary development industryWhen integrated between the original benchmark service module of module permutation, and other corresponding standardized product business modules of being engaged in, mainly pass throughBusiness common interface realizes that, without being modified to the program in remaining corresponding service module, this improves secondaryDevelop the integrated efficiency of business module and corresponding business module.
2nd, in embodiments of the present invention, by unified business common interface, standardized product business module and correspondingSecondary development business module observes unified contract, updates standardized product business module patch so as to stable and secondary opensSending service module patch.
3rd, in embodiments of the present invention, it is cached to by class object, method by business common interface is realized etc. in internal memory,Reflection, which can be reduced, calls the performance brought that problem is lost, and improves performance.
4th, in embodiments of the present invention, can be according to industry by using XML format character string type as interface parameters typeBusiness demand carries out good extension, with more readability, and improves the stability of business common interface.
It should be noted that herein, such as first and second etc relational terms are used merely to an entityOr operation makes a distinction with another entity or operation, and not necessarily require or imply exist between these entities or operationAny this actual relation or order.Moreover, term " comprising ", "comprising" or its any other variant be intended to it is non-It is exclusive to include, so that process, method, article or equipment including a series of key elements not only include those key elements,But also other key elements including being not expressly set out, or also include solid by this process, method, article or equipmentSome key elements.In the absence of more restrictions, the key element limited by sentence " including one ", is not arrangedExcept also there is other identical factor in the process including the key element, method, article or equipment.
One of ordinary skill in the art will appreciate that:Realizing all or part of step of above method embodiment can pass throughProgrammed instruction related hardware is completed, and foregoing program can be stored in the storage medium of embodied on computer readable, the programUpon execution, the step of including above method embodiment is performed;And foregoing storage medium includes:ROM, RAM, magnetic disc or lightDisk etc. is various can be with the medium of store program codes.
It is last it should be noted that:Presently preferred embodiments of the present invention is the foregoing is only, the skill of the present invention is merely to illustrateArt scheme, is not intended to limit the scope of the present invention.Any modification for being made within the spirit and principles of the invention,Equivalent substitution, improvement etc., are all contained in protection scope of the present invention.