CN103984567A - Method and device for modularizing of open platform - Google Patents

Method and device for modularizing of open platform Download PDF

Info

Publication number
CN103984567A
CN103984567A CN201410161868.XA CN201410161868A CN103984567A CN 103984567 A CN103984567 A CN 103984567A CN 201410161868 A CN201410161868 A CN 201410161868A CN 103984567 A CN103984567 A CN 103984567A
Authority
CN
China
Prior art keywords
module
open platform
resource
resource manager
website
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201410161868.XA
Other languages
Chinese (zh)
Other versions
CN103984567B (en
Inventor
邓建利
谢志胜
贾玉光
刘红斌
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Century Light Technology Development (beijing) Co Ltd
Original Assignee
Century Light Technology Development (beijing) Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Century Light Technology Development (beijing) Co Ltd filed Critical Century Light Technology Development (beijing) Co Ltd
Priority to CN201410161868.XA priority Critical patent/CN103984567B/en
Publication of CN103984567A publication Critical patent/CN103984567A/en
Application granted granted Critical
Publication of CN103984567B publication Critical patent/CN103984567B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

The invention provides a method and a device for modularizing of an open platform. The method comprises the following steps of carrying out routing request and resource isolation management according to a plurality of modules; requesting the corresponding method, name and version number to uniformly manage the module resources, and simultaneously carrying out multi-version running and management. The module versions are deployed in the node mode, and the same version of modules can run at different nodes. The method and the device have the advantages that the module services have high property and high availability, the dynamic deployment is simpler, the running is controllable, and the coupling is reduced in the module development process.

Description

The modular method and apparatus of open platform
Technical field
The present invention relates to program development field, particularly the modular method and apparatus of a kind of open platform.
Background technology
Open platform modularization relies on OGSI (Open Service Gateway Initiative) technology to realize module life period management and service registration.Realize module heat by node control and dispose and heat control, multimode version can coexist provides service.The degree of coupling that has reduced open platform API exploitation, module, by Version Control, realizes and disposes, starts, stops, unloading, and makes the operation of module manage monitoring by service platform, provides a complete set of abatement functions to the stable operation of whole open platform.Realize many versions storehouse management of module, all modules are all stored physical file in warehouse simultaneously, provide effective guarantee for comparison and the rollback of different editions.
But, due to the business complexity of modules A PI, between multimode, there is complementary problem, not only comprise that the class compiling that open platform modularization exists relies on, for complicated module, the problem that also exists bidirectional dependency and circulation to rely on.
For existing the problems referred to above in correlation technique, effective solution is not yet proposed at present.
Summary of the invention
For solving the existing problem of above-mentioned prior art, the present invention proposes the modular method and apparatus of a kind of open platform, realize module Dynamical Deployment and dynamic offloading, module storehouse management and Version Control are provided, the service heat of realization is upgraded, and reduces the exploitation degree of coupling.
The present invention adopts following technical scheme: a kind of open platform modular approach, comprising:
Control desk is disposed and is installed module based on node mode, reads for website end;
In the time starting module, will work as front module by control desk and be registered in module resource manager;
Utilize module warehouse to realize many storage of versions of module, same version module may operate at different nodes.
Preferably, the method also comprises: in the time of stopping modular, module resource is removed from the module resource manager of open platform.
Preferably, described deployment and installation steps further comprise that module is uploaded, module parses and module metadata store,
Wherein, module resource manager and open platform website end data are unified to represent and manage by database, upload on the node of appointment and loading and the corresponding jar file of instantiation, resolve the API descriptive metadata of this jar file in database, website shows corresponding API document by the API of reading database.
Preferably, the method also comprises:
In the time of Unload module, module is removed from the module resource manager of open platform, and remove corresponding module resource from module resource manager.
Preferably, the step of described startup module further comprises:
In response to user's request, control desk is loaded into the module example of appointment in current module resource manager, and upgrades API state in the time starting, and by reading database, website shows API document,
Wherein, the warehouse-in class ServiceMethodBean of module is explained as the entrance class of unified module, its mounted resource and classLoader are switched in current Classloader, and be registered in module resource manager, for loading the resource of the module that will start, find the module of startup by agency.
Preferably, in resource position fixing process, unique interface service is determined in the method name that use is called and the combination of version number.
Preferably, the step of described stopping modular further comprises:
Ask in response to user, control desk removes the module instance of appointment from current explorer, and at real-time update API state, pass through reading database, website shows API document, and the resource of module is removed from the module resource manager of open platform, and open platform is just ignored all modules that stop, the request entering cannot be processed, and the API document that open platform front end website is corresponding and description are all marked as to suspend and use.
Preferably, the step of described Unload module further comprises:
Control desk removes corresponding module resource from module resource manager, and the entity jar file of this module also will remove simultaneously, the API document that open platform front end website is corresponding, and in old version, website does not show this API associated description simultaneously.
Preferably, in the many storage of versions of described module, adopt the storage directory structure of maven, module warehouse carries out unified management on control desk, and all modules are deployed to and must upload on module warehouse, unifies distribution and is deployed to corresponding node.
According to a further aspect in the invention, provide a kind of open platform modular unit, having comprised:
Installation unit, for based on node mode, module being disposed and installed, reads for website end;
Start unit, is registered to module resource manager to start this module for working as front module;
Unit, module warehouse, for realizing many storage of versions of module, wherein same version module may operate at different nodes;
Stop element, for removing module resource, to stop this module from the module resource manager of open platform;
Unloading unit for module is removed from the module resource manager of open platform, and removes corresponding module resource from module resource manager;
Wherein, described device is determined unique resource by the method name that will call and the combination of version number.
Than prior art, the having the following advantages of technical scheme of the present invention:
The Dynamical Deployment of module in platform is simpler, move controlled, Development of Module reduces coupling, module is upgraded and is realized heat deployment control, and multimode version coexists, by warehouse and Version Control, by module upgrade Risk Reduction to minimizing, and the module of different old versions can compare mutually, module interface access realizes dynamically controlled, can carry out method level control startup for module and stop.
Brief description of the drawings
Fig. 1 is according to the process flow diagram of the open platform modular approach of the embodiment of the present invention.
Fig. 2 is according to the process flow diagram of the module installation process of the embodiment of the present invention.
Fig. 3 is according to the process flow diagram of the module start-up course of the embodiment of the present invention.
Fig. 4 is according to the process flow diagram of the module stopped process of the embodiment of the present invention.
Fig. 5 is according to the process flow diagram of the module uninstall process of the embodiment of the present invention.
Fig. 6 is according to the many versions of the module of the embodiment of the present invention schematic diagram that coexists.
Fig. 7 is according to the process flow diagram of the many version managements of module of the embodiment of the present invention.
Fig. 8 is according to the process flow diagram of the class load mechanism of the embodiment of the present invention.
Fig. 9 is the process flow diagram of searching according to the module class of the embodiment of the present invention.
Figure 10 is the module life period schematic diagram according to the embodiment of the present invention.
Embodiment
Various ways can be for (comprising the process of being embodied as; Device; System; Material composition; The computer program comprising on computer-readable recording medium; And/or processor (such as following processor, this processor is configured to carry out instruction that store on the storer that is coupled to processor and/or that provided by this storer)) enforcement the present invention.In this manual, any other form that these enforcements or the present invention can adopt can be called technology.Generally speaking, can change within the scope of the invention the sequence of steps of disclosed process.Unless separately had and expressed, the parts (such as processor or storer) that are described as being configured to execute the task may be embodied as by provisional configuration to become in preset time to carry out the general parts of this task or be manufactured into the concrete parts of carrying out this task.
Below provide the detailed description to one or more embodiment of the present invention together with illustrating the accompanying drawing of the principle of the invention.Describe the present invention in conjunction with such embodiment, but the invention is not restricted to any embodiment.Scope of the present invention is only defined by the claims, and the present invention contain manyly substitute, amendment and equivalent.Set forth in the following description many details to provide thorough understanding of the present invention.These details are provided for exemplary purposes, and also can realize the present invention according to claims without some or all details in these details.
Fig. 1 is according to the process flow diagram of the open platform modular approach of the embodiment of the present invention.Method provided by the invention comprises:
1, control desk is disposed and is installed module, reads for website end.
Module is disposed and is installed, and by the deployment installation module of control desk, comprises that module is uploaded, module parses and module metadata store.And with the end data unification of open platform website represents and manages.
Fig. 2 is according to the process flow diagram of the module installation process of the embodiment of the present invention.As shown in Figure 2, in response to user's request, governor disposes specified node, and API is distributed in database.Website shows corresponding API document by the API of reading database.
The further preferred embodiment according to the present invention, the Node that deployment module uploads to appointment by Governor goes up and loading and this jar of instantiation, and the API descriptive metadata of resolving this jar file is in database, is now labeled as and installs, website does not show.
2, in the time starting module, will work as front module and be registered in module resource manager.
Fig. 3 is according to the process flow diagram of the module start-up course of the embodiment of the present invention.As shown in Figure 3, in response to user's request, Governor is loaded into the module example of appointment in current module resource manager, and upgrades API state in the time starting.By reading database, website shows API document.
In the preferred embodiment of the invention, the warehouse-in class ServiceMethodBean of module is explained as the entrance class of unified module, its mounted resource and classLoader are switched in current Classloader, and are registered in module resource manager for loading the resource of the module that will start.Just can find like this module of startup by agency.Determine unique interface service by the method name of calling and the combination of version number at present.
3, utilize module warehouse to realize many storage of versions of module.
Module warehouse is for the target directory of memory module.Fig. 6 is according to the many versions of the module of the embodiment of the present invention schematic diagram that coexists.As shown in Figure 5, in the preferred embodiment of the invention, the structure of catalogue is with reference to the storage organization of maven, based on the many storage of versions management under module title.
Fig. 7 is according to the process flow diagram of the many version managements of module of the embodiment of the present invention.As shown in Figure 7, module warehouse carries out unified management on Governor.All modules are deployed to and must upload on module warehouse, unify distribution and are deployed to corresponding node.
According to a further embodiment of the invention, in the time of stopping modular, module resource is removed from the module resource storer of open platform.
Fig. 4 is according to the process flow diagram of the module stopped process of the embodiment of the present invention.As shown in Figure 4, in response to user's request, Governor removes the module instance of appointment from current explorer, and at real-time update API state.By reading database, website shows API document.The resource of module is removed from the module resource manager of open platform, and open platform just can be ignored all modules that stop like this, and the request entering cannot be processed.The API document that while open platform front end website is corresponding and description are all in being labeled as " time-out use " prompting.
According to a further embodiment of the invention, in the time of Unload module, module is removed from the module resource manager of open platform, and remove corresponding module resource from module resource manager.
Fig. 5 is according to the process flow diagram of the module uninstall process of the embodiment of the present invention.As shown in Figure 5, in response to user's request, Governor in the time removing corresponding module resource from module resource manager, and the entity jar file of this module also will remove.API document corresponding to open platform front end website also will be in old version simultaneously, and website does not show this API associated description simultaneously.
Below the further preferred embodiment that module class of the present invention loads, the process loading for realizing module class.In class load mechanism, the most important is exactly to have the classloader mechanism of independent separate and the closure that ensured Module, and the classloader of OSGI framework is made up of jointly System Classloader, Bundle Classloader.Each Bundle has independently Classloader.The load mechanism of the class of Bundle of the present invention as shown in Figure 8.
Searching of module class can be passed through following steps, the process flow diagram referring to Fig. 9:
Steps A: as needs load be the class of java.*, be directly delegated to Parent Classloader, as found corresponding class in parent Classloader, directly return, as do not find, the NoClassDefFoundException that dishes out is abnormal.
Step B: be not the class of java.* as what load, judge whether the class loading belongs to the scope configuring in boot delegation, enter step C if do not belonged to, continue to be delegated to Parent Classloader as belonged to, as found and directly return in Parent Classloader, as do not find, enter step C.
Step C: as belong to the class in Bundle Import package, the classloader that gives the Bundle of export package loads, as loads failure, and the NoClassDefFoundException that directly dishes out, directly returns as loaded successfully.
Step D: if do not belonged to the class in Bundle Import package, whether search belongs to the class of the package of export in Require Bundles, as the Classloader that belongs to the Bundle that transfers to export package loads, directly return as loaded successfully, as load failure and enter step e.
Step e: search needs the class loading in Bundle classpath (being exactly the path configuring at Bundle-Classpath), as loads successfully, directly returns, as loads failure and continue to enter step F.
Step F: the classpath of search Fragment Bundle (referring to Fragment-Host configuration), as load successfully, directly returns, as loads failure and continue to enter step G.
Step G: judge whether to belong to the package of export, as belong to the NoClassDefFoundException that directly dishes out, enter step H if do not belonged to.
Step H: the package that judges whether to belong to DynamicImport, if do not belonged to the NoClassDefFoundException that directly dishes out, as the ClassLoader that belongs to the Bundle that uses export package loads, directly return as loaded successfully, as load the failure NoClassDefFoundException that dishes out.
For the resource file in Bundle, useful bundle.getResource, bundle.getEntry or bundle.findEntries obtain, what return is an object that can be converted into java.net.URL, just can be loaded into corresponding resource file by URL, need the mode by Require-Bundle is set just can obtain if get the resource file of other Bundle, Require-Bundle also can be considered a kind of mode that resource file is shared that realizes.
Module life period schematic diagram shown in Figure 10, the present invention provides a kind of device corresponding to module life period on the other hand.Comprise with lower unit:
Installation unit, for based on node mode, module being disposed and installed, reads for website end;
Start unit, is registered to module resource manager to start this module for working as front module;
Unit, module warehouse, for realizing many storage of versions of module, wherein same version module may operate at different nodes;
Stop element, for removing module resource, to stop this module from the module resource manager of open platform;
Unloading unit for module is removed from the module resource manager of open platform, and removes corresponding module resource from module resource manager;
Wherein, described device is determined unique resource by the method name that will call and the combination of version number.
In sum, open platform modular approach and device that the present invention proposes, realized module heat and disposed and heat control, multimode version coexists and resource isolation, modular approach level controlling run state, the operation of Dynamic control module method starts, and rollback control.
Obviously, it should be appreciated by those skilled in the art, above-mentioned of the present invention each module or each step can realize with general computing system, they can concentrate on single computing system, or be distributed on the network that multiple computing systems form, alternatively, they can be realized with the executable program code of computing system, thereby, they can be stored in storage system and be carried out by computing system.Like this, the present invention is not restricted to any specific hardware and software combination.
Should be understood that, above-mentioned embodiment of the present invention is only for exemplary illustration or explain principle of the present invention, and is not construed as limiting the invention.Therefore any amendment of, making, be equal to replacement, improvement etc., within protection scope of the present invention all should be included in without departing from the spirit and scope of the present invention in the situation that.In addition, claims of the present invention are intended to contain whole variations and the modification in the equivalents that falls into claims scope and border or this scope and border.

Claims (10)

1. an open platform modular approach, is characterized in that, comprising:
Control desk is disposed and is installed module based on node mode, reads for website end;
In the time starting module, will work as front module by control desk and be registered in module resource manager;
Utilize module warehouse to realize many storage of versions of module, same version module may operate at different nodes.
2. method according to claim 1, is characterized in that, the method also comprises:
In the time of stopping modular, module resource is removed from the module resource manager of open platform.
3. method according to claim 1, is characterized in that, described deployment and installation steps further comprise that module is uploaded, module parses and module metadata store,
Wherein, module resource manager and open platform website end data are unified to represent and manage by database, upload on the node of appointment and loading and the corresponding jar file of instantiation, resolve the API descriptive metadata of this jar file in database, website shows corresponding API document by the API of reading database.
4. method according to claim 1, is characterized in that, the method also comprises:
In the time of Unload module, module is removed from the module resource manager of open platform, and remove corresponding module resource from module resource manager.
5. method according to claim 1, is characterized in that, the step of described startup module further comprises:
In response to user's request, control desk is loaded into the module example of appointment in current module resource manager, and upgrades API state in the time starting, and by reading database, website shows API document,
Wherein, the warehouse-in class ServiceMethodBean of module is explained as the entrance class of unified module, its mounted resource and classLoader are switched in current Classloader, and be registered in module resource manager, for loading the resource of the module that will start, find the module of startup by agency.
6. method according to claim 5, is characterized in that, in resource position fixing process, unique interface service is determined in the method name that use is called and the combination of version number.
7. method according to claim 1, is characterized in that, the step of described stopping modular further comprises:
Ask in response to user, control desk removes the module instance of appointment from current explorer, and at real-time update API state, pass through reading database, website shows API document, and the resource of module is removed from the module resource manager of open platform, and open platform is just ignored all modules that stop, the request entering cannot be processed, and the API document that open platform front end website is corresponding and description are all marked as to suspend and use.
8. method according to claim 3, is characterized in that, the step of described Unload module further comprises:
Control desk removes corresponding module resource from module resource manager, and the entity jar file of this module also will remove simultaneously, the API document that open platform front end website is corresponding, and in old version, website does not show this API associated description simultaneously.
9. method according to claim 1, it is characterized in that, in the many storage of versions of described module, adopt the storage directory structure of maven, module warehouse carries out unified management on control desk, all modules are deployed to and must upload on module warehouse, unify distribution and are deployed to corresponding node.
10. an open platform modular unit, is characterized in that, comprising:
Installation unit, for based on node mode, module being disposed and installed, reads for website end;
Start unit, is registered to module resource manager to start this module for working as front module;
Unit, module warehouse, for realizing many storage of versions of module, wherein same version module may operate at different nodes;
Stop element, for removing module resource, to stop this module from the module resource manager of open platform;
Unloading unit for module is removed from the module resource manager of open platform, and removes corresponding module resource from module resource manager;
Wherein, described device is determined unique resource by the method name that will call and the combination of version number.
CN201410161868.XA 2014-04-22 2014-04-22 The modular method and apparatus of open platform Active CN103984567B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410161868.XA CN103984567B (en) 2014-04-22 2014-04-22 The modular method and apparatus of open platform

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410161868.XA CN103984567B (en) 2014-04-22 2014-04-22 The modular method and apparatus of open platform

Publications (2)

Publication Number Publication Date
CN103984567A true CN103984567A (en) 2014-08-13
CN103984567B CN103984567B (en) 2017-12-26

Family

ID=51276560

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410161868.XA Active CN103984567B (en) 2014-04-22 2014-04-22 The modular method and apparatus of open platform

Country Status (1)

Country Link
CN (1) CN103984567B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105677302A (en) * 2014-11-17 2016-06-15 阿里巴巴集团控股有限公司 Application program modularization developing method and device

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101494657A (en) * 2008-01-24 2009-07-29 纬创资通股份有限公司 Method and system for automatic arrangement program control
CN102253832A (en) * 2011-06-24 2011-11-23 上海北大方正科技电脑系统有限公司 Method and system for monitoring versions of function modules by using server application program
CN102262556A (en) * 2011-09-08 2011-11-30 山东中创软件工程股份有限公司 Method and system for configuring service information
US20120204168A1 (en) * 2010-06-17 2012-08-09 International Business Machines Corporation Modifying a Multi-Module Application
CN103294455A (en) * 2012-02-27 2013-09-11 杭州勒卡斯广告策划有限公司 Software service implementation method and system, as well as Java platform

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101494657A (en) * 2008-01-24 2009-07-29 纬创资通股份有限公司 Method and system for automatic arrangement program control
US20120204168A1 (en) * 2010-06-17 2012-08-09 International Business Machines Corporation Modifying a Multi-Module Application
CN102253832A (en) * 2011-06-24 2011-11-23 上海北大方正科技电脑系统有限公司 Method and system for monitoring versions of function modules by using server application program
CN102262556A (en) * 2011-09-08 2011-11-30 山东中创软件工程股份有限公司 Method and system for configuring service information
CN103294455A (en) * 2012-02-27 2013-09-11 杭州勒卡斯广告策划有限公司 Software service implementation method and system, as well as Java platform

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
NALLA: "http://www.ibm.com/developerworks/cn/webservices/ws-OSGi/", 《HTTP://WWW.IBM.COM/DEVELOPERWORKS/CN/WEBSERVICES/WS-OSGI/》 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105677302A (en) * 2014-11-17 2016-06-15 阿里巴巴集团控股有限公司 Application program modularization developing method and device
CN105677302B (en) * 2014-11-17 2019-04-12 阿里巴巴集团控股有限公司 A kind of application program module melts forwarding method and device

Also Published As

Publication number Publication date
CN103984567B (en) 2017-12-26

Similar Documents

Publication Publication Date Title
CN106537338B (en) Self-expanding clouds
CN102567015B (en) For performing the method and system that dynamic software version is selected
RU2417416C2 (en) Solution deployment in server farm
US8799453B2 (en) Managing networks and machines for an online service
CN103428241B (en) Service arrangement method and system
US20120102480A1 (en) High availability of machines during patching
Taherkordi et al. Optimizing sensor network reprogramming via in situ reconfigurable components
US20060184926A1 (en) Deployment of applications in a multitier compute infrastructure
US10310900B2 (en) Operating programs on a computer cluster
US8112745B2 (en) Apparatus and method for capabilities verification and restriction of managed applications in an execution environment
US20130283259A1 (en) Application installation
CN102521009A (en) Creating and deploying service-ready virtual hard disks
US20100312879A1 (en) Plug-in provisioning integration in a clustered environment
EP1609056A2 (en) System and method for single transparent deployment flow
CN102999352A (en) Embedded system assembly loading method
CN105516154A (en) Security policy configuration method and device applied to SEAndroid (Security-Enhanced Android) system
WO2012054202A2 (en) Installing software remotely using a high privilege process
Hall A policy-driven class loader to support deployment in extensible frameworks
JP2006065462A (en) Software system, software stopping method, program, and storage medium
CN103984567A (en) Method and device for modularizing of open platform
WO2015028538A1 (en) A method and system for upgrading software
CN105122209A (en) Web services provided from software framework
CN106815056B (en) Application heat deployment method and device based on JCL framework
CN110837394B (en) High-availability configuration version warehouse configuration method, terminal and readable medium
CN102156685A (en) Method and device for automatically configuring distributed network system script

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant