CN105653331A - Middleware application method and apparatus - Google Patents
Middleware application method and apparatus Download PDFInfo
- Publication number
- CN105653331A CN105653331A CN201511023564.8A CN201511023564A CN105653331A CN 105653331 A CN105653331 A CN 105653331A CN 201511023564 A CN201511023564 A CN 201511023564A CN 105653331 A CN105653331 A CN 105653331A
- Authority
- CN
- China
- Prior art keywords
- framework
- middleware
- osgi
- osgi framework
- application program
- 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.)
- Pending
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/445—Program loading or initiating
- G06F9/44521—Dynamic linking or loading; Link editing at or after load time, e.g. Java class loading
- G06F9/44526—Plug-ins; Add-ons
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Stored Programmes (AREA)
Abstract
The present invention is applicable to the technical field of Android devices, and provides a middleware application method and apparatus. The application method comprises the steps of loading a middleware framework service in an Android system, and starting a functional module in the middleware framework service; binding an application program with the middleware framework service, installing the application program to the middleware framework service, and after finishing installation, starting the application program; and in running of the application program, invoking the functional module that the application program relies on from the middleware framework service, wherein the middleware framework service is an OSGi framework service, and the OSGi framework service is used for implementing running of the OSGi framework in the Android system. According to the method, problems of strong coupling of the middleware and the application program and large load of the Android system in the prior art are solved, and it is ensured that the Android system always runs the OSGi framework service of the highest version.
Description
Technical field
The invention belongs to Android equipment technical field, relate in particular to a kind of application process and dress of middlewarePut.
Background technology
When prior art is called jara application program in Android system, middleware with the form of jar bag withApplication program is together integrated, causes the close coupling between middleware and application program, and the providing of middlewareForm is single. In the time there is the different middleware of multiple function identical version on same Android equipment, meetingStrengthen the load of Android system in Android equipment. If need to install new application on Android equipmentProgram or while unloading mounted application program, and need the application program of installing maybe to need the application of unloadingIn program, integrated middleware, need to judge the version of middleware, guarantees the application journey of installingOrder is the middleware of highest version.
Summary of the invention
Given this, the embodiment of the present invention provides a kind of application process and device of middleware, to solve existing skillThe problem that in art, middleware and application program coupling are strong, Android system load is large.
First aspect, provides a kind of application process of middleware, and described application process comprises:
In Android system, load middleware framework service, start the merit in described middleware framework serviceEnergy module;
By application program and described middleware framework service binding, and by described application program be mounted to described inBetween in part framework services, after installation, start described application program; And
In the running of described application program, from described middleware framework service, call described application journeyThe functional module that order relies on;
Wherein, described middleware framework service is OSGi framework services, and described OSGi framework services is used forRealize and in Android system, move OSGi framework.
Second aspect, provides a kind of implement device of middleware, and described implement device comprises:
Load-on module, for loading middleware framework service in Android system, starts described middlewareFunctional module in framework services;
Start module, for by application program and described middleware framework service binding, and by described application journeyOrder is mounted in described middleware framework service, starts described application program after installation;
Calling module, for the running in described application program, from described middleware framework serviceCall the functional module that described application program relies on;
Wherein, described middleware framework service is OSGi framework services, and described OSGi framework services is used forRealize and in Android system, move OSGi framework.
Compared with prior art, the embodiment of the present invention by loading middleware framework clothes in Android systemBusiness, starts the functional module in described middleware framework service; By application program and described middleware framework clothesBusiness binding, and described application program is mounted in described middleware framework service, after installation, startDescribed application program; In the running of described application program, from described middleware framework service, callThe functional module that described application program relies on; Wherein, described middleware framework service is OSGi framework clothesBusiness, described OSGi framework services is moved OSGi framework for realizing in Android system. Thereby makeMiddleware is integrated in Android system in the mode of service, and application program only need to be bound this service, noNeed to be integrated with middleware, effectively solve the strong problem of middleware and application program coupling in prior art,And application program can adopt apk mode or jar packet mode to call the functional module in middleware, abundantThe method of calling of middleware.
Brief description of the drawings
In order to be illustrated more clearly in the embodiment of the present invention or technical scheme of the prior art, below will be to implementingIn example or description of the Prior Art, the accompanying drawing of required use is briefly described, and apparently, the following describesIn accompanying drawing be only some embodiments of the present invention, for those of ordinary skill in the art, do not payingGo out under the prerequisite of creative work, can also obtain other accompanying drawings according to these accompanying drawings.
Fig. 1 is the realization flow figure of the application process of the middleware that provides of the embodiment of the present invention;
Fig. 2 is the specific implementation flow process of step S101 in the application process of the middleware that provides of the embodiment of the present inventionFigure;
Fig. 3 is the specific implementation flow process of step S102 in the application process of the middleware that provides of the embodiment of the present inventionFigure;
Fig. 4 is the specific implementation flow process of step S103 in the application process of the middleware that provides of the embodiment of the present inventionFigure;
Fig. 5 is the realization flow figure of the application process of the middleware that provides of another embodiment of the present invention;
Fig. 6 is the composition structure chart of the implement device of the middleware that provides of the embodiment of the present invention.
Detailed description of the invention
In order to make object of the present invention, technical scheme and advantage clearer, below in conjunction with accompanying drawing and realityExecute example, the present invention is further elaborated. Only should be appreciated that specific embodiment described hereinOnly, in order to explain the present invention, be not intended to limit the present invention.
The embodiment of the present invention, by load middleware framework service in Android system, starts described centreFunctional module in part framework services; By application program and described middleware framework service binding, and described in inciting somebody to actionApplication program is mounted in described middleware framework service, starts described application program after installation; ?In the running of described application program, from described middleware framework service, call described application program and comply withBad functional module; Wherein, described middleware framework service is OSGi framework services, described OSGi frameworkService moves OSGi framework for realizing in Android system. Thereby make the side of middleware with serviceFormula is integrated in Android system, and application program only need to be bound this service, do not need with middleware integrated,Effectively solve the strong problem of middleware and application program coupling in prior art, and application program can be adoptedCall the functional module in middleware by apk mode or jar packet mode, enriched the method for calling of middleware.The embodiment of the present invention also provides corresponding implement device, below is described in detail respectively.
Fig. 1 shows the realization flow of the application process of the middleware that the embodiment of the present invention provides.
In embodiments of the present invention, described application process is applied in the smart machine with Android system,Described smart machine includes but not limited to smart mobile phone, panel computer, intelligent watch, intelligent TV set.
Consult Fig. 1, described application process comprises:
In step S101, in Android system, load middleware framework service, start described middlewareFunctional module in framework services.
Here, described middleware is OSGi framework, and described middleware framework service is OSGi framework services,Described OSGi framework services is moved OSGi framework for realizing in Android system. Described functional moduleOperate on described OSGi framework. Wherein, OSGi framework (OpenServiceGatewayInitiative)Refer to organized to set up by OSGiAlliance one service (business) specification based on Java language, fortuneRow is on Java Virtual Machine. In embodiments of the present invention, in Android system, defined in one in advanceBetween part framework services, described middleware framework service is the service for realizing operation OSGi framework, is about toOSGi framework is embodied as the service (servie) in Android system, for convenience of description, is designated as hereOSGi framework services. In Android system, load described OSGi framework services, and start described OSGiFunctional module in framework services.
Alternatively, Fig. 2 shows step S101 in the application process of the middleware that the embodiment of the present invention providesSpecific implementation flow process.
Consult Fig. 2, described step S101 comprises:
In step S201, in Android system, set up OSGi framework services, and from described OSGiIn framework services, obtain OSGi framework instance.
Exemplarily, can set up GetFramework service and inherit the service in Android, described inGetFramework service is OSGi framework services; And pass through functionFrameWorFactory.newFrameWork () obtains framework instance.
In step S202, in Android system, start described OSGi framework services, and describedIn the startup initialization procedure of OSGi framework services, start described OSGi framework instance.
, can in Android system, start by startService described OSGi framework services here,Start GetFramework service; And start described OSGi framework by Framework.start () methodExample.
In step S203, the jar file of the functional module in OSGi framework is converted to a bundleFile.
Here, described middleware (being OSGi framework) is made up of each function several functions moduleThe corresponding bundle file of module, is designated as a bundle file, such as download module correspondenceBundleDownload. In embodiments of the present invention, after functional module has been developed by described functional moduleBe compiled into jar file, travel through all functions module in described middleware (being OSGi framework), by eachThe jar file of individual functional module is converted to a bundle file.
In step S204, a described bundle file is mounted in described OSGi framework services,Obtain OSGi framework interface and an identification information thereof, a described OSGi framework interface is described function mouldThe startup interface of piece.
In embodiments of the present invention, the jar file of functional module is being converted to after a bundle file,By calling Framework.getBundleContext () method, to obtain each functional module correspondingBundleContext; Obtain by the method installation institute of calling BundleContext.install (stringlocation) againA bundle file of getting, obtains starting the required OSGi framework interface of described functional module, andOne OSGi framework interface. Here, parameter l ocation represents that a described bundle file is at OSGiIn framework, deposit path, a bundle file here represents the functional module in OSGi framework services.
After a bundle file successful installation, described OSGi framework services is returned to described functional module pairThe identification information (ID) of the one OSGi framework interface of answering. Here, described identification information is the runtimeIdentifier, for OSGi framework is according to the precedence of the set-up time of an OSGi framework interface, by littleTo one that distributes greatly long shaping numeral. Can pass through the getBundleId () of an OSGi framework interfaceMethod is obtained the identification information of a described OSGi framework interface. Further, can be by described firstThe getSymbolicName () method of OSGi framework interface is obtained the designation of a described bundle fileAnd getVersion () method is obtained the version number of a described bundle file. Building database is stored eachThe designation of the one bundle file corresponding to functional module, version number, an OSGi framework interface andThe function title of its identification information (ID) and described functional module.
In step S205, according to described identification information call described the one OSGi framework interface start described inFunctional module.
Obtain a corresponding OSGi interface according to the described identification information returning. Getting an OSGiAfter framework interface, call Bundle.start () method and start described functional module.
Above-mentioned steps S203 to S205 is carried out in circulation. Until in described middleware (being OSGi framework)The whole loadeds of functional module. Now, OSGi framework services just operates in Adroid system.
In step S102, by application program and described middleware framework service binding, and by described application journeyOrder is mounted in described middleware framework service, starts described application program after installation.
Here, the installation file form of described application program is jar or apk, by binding described OSGiFramework services is obtained framework instance, so that described application program is mounted in described OSGi framework services.
Alternatively, Fig. 3 shows step S102 in the application process of the middleware that the embodiment of the present invention providesSpecific implementation flow process.
Consult Fig. 3, described step S102 comprises:
In step S301, described compiling of application is become to apk file or jar file, then by described apkFile or jar file are converted to the 2nd bundle file.
Here, described application program, after exploitation, is compiled as jar file or apk file, shouldWith the installation file form of program be jar or apk. Described jar file is converted to the 2nd bundle fileOr after being converted to jar file, described apk file is converted to again the 2nd bundle file. Again by callingFramework.getBundleContext () method is obtained the BundleContext of described the 2nd bundle file.
In step S302, application program and described OSGi framework services are bound to obtain OSGi frameworkExample.
Can realize tying up of application program and described OSGi framework services by bindServie () method here,Fixed, to obtain OSGi framework instance.
In step S303, described the 2nd bundle file is mounted in described OSGi framework services,To the 2nd OSGi framework interface and identification information thereof, what described the 2nd OSGi interface was described application program opensMobile interface.
Application program is being converted to after the 2nd bundle file, by callingThe method of BundleContext.install (stringlocation) is installed the 2nd accessed bundle file,To starting the required OSGi framework interface of described application program, i.e. the 2nd OSGi framework interface. Here,Parameter l ocation represents that described the 2nd bundle file deposits path in OSGi framework, hereTwo bundle files represent the application program in OSGi framework services.
After the 2nd bundle file successful installation, described OSGi framework services is returned to described application program pairThe identification information (ID) of the 2nd OSGi framework interface of answering. Here, described identification information is the runtimeIdentifier, for OSGi framework is according to the precedence of the set-up time of the 2nd OSGi framework interface, by littleTo one that distributes greatly long shaping numeral. Can pass through the getBundleId () of the 2nd OSGi framework interfaceMethod is obtained the identification information of described the 2nd OSGi framework interface. Further, can be by described secondThe getSymbolicName () method of OSGi framework interface is obtained the designation of described the 2nd bundle fileAnd getVersion () method is obtained the version number of described the 2nd bundle file. Building database is stored eachThe designation of the 2nd bundle file corresponding to application program, version number, the 2nd OSGi framework interface andThe merit of the functional module in OSGi framework that its identification information (ID) and described application program rely onCan title.
In step S304, according to described identification information call described the 2nd OSGi framework interface start described inApplication program.
Obtain the 2nd corresponding OSGi interface according to the described identification information returning. Getting the 2nd OSGiAfter framework interface, call Bundle.start () method and start described application program.
So far, realized in OSGi framework and started application program, and the installation file of described application programForm can be that apk can be also jar, has enriched the form of application call middleware, can adopt apk sideFormula, also can adopt jar mode. By step S101, OSGi framework is integrated in Adroid with one serviceIn system, application program only need to be bound described service, and do not need with OSGi framework in functional moduleIntegrated, thus coupling reduced, effectively solve in prior art middleware and application program coupling strongProblem.
Here, instrument dex2jar can arrive .dex format conversion the form of the java class of Android, therefore,Can by as issue orders: dex2jarxxx.apk, apk file is carried out to decompiling, obtain jar file.In addition, a bundle file or the 2nd bundle file are the jar files that has added certain metadata. WantJar file is converted to a bundle file or the 2nd bundle file, need to increases corresponding for jar fileMetadata, metadata comprises readable information, bundle identifying information and code visibility information. Described canRead message refers to the information that the dependent help of bundle is provided for user. Described bundle identifying information refers toThe necessary information of identification bundle file, the each bundle file being installed in OSGi framework services mustMust have a unique identification information, described identification information is by bundle designation and bundle version number twoPart composition. Described code visibility information has defined inner visible code and outside visible code.In embodiments of the present invention, because each functional module in OSGi framework services is separate;And application program is only paid close attention to its internal logic processing, be also separate, therefore, a described bundleIn file or the 2nd bundle file, do not need to comprise code visibility information.
In step S103, in the running of described application program, from described middleware framework serviceCall the functional module that described application program relies on.
In the running of application program, realize its function if comprised in OSGi framework services requiredFunctional module, calls institute by the identification information of an OSGi framework interface corresponding to described functional moduleState functional module, complete its merit to realize application program by the functional module of calling in OSGi framework servicesEnergy.
Alternatively, Fig. 4 shows step S103 in the application process of the middleware that the embodiment of the present invention providesSpecific implementation flow process.
Consult Fig. 4, described step S103 comprises:
In step S401, inquire about the database in described OSGi framework services, obtain described application programThe identification information of the one OSGi framework interface of the functional module relying on.
In step S402, obtain a corresponding OSGi framework interface according to described identification information, according toDefault interface protocol is inputted parameter preset by a described OSGi framework interface to described functional module,Start described functional module to carry out function corresponding to described functional module.
Here, described default interface protocol comprises importation and output. Wherein, input partDivide and defined the parameter that application program will be inputted to functional module, such as application package name. Output is fixedJustice the storage directory of execution result of invoked functional module, be preferably/data/data/ application package nameThe function title of the invoked functional module of/files//...
Exemplarily, suppose that the functional module that application program relies on comprises for download module, described in callingWhen download module, according to described default interface protocol to described download module transmit described application package name,Download address parameter, downloads according to download address to start download module. Download module is complete in downloadAfter, notification application download function is finished, and will download result store to "/data/data/ shouldWith the function title of program package name/files/ download module/" catalogue in.
In step S403, in the time receiving the execution ending message that described functional module returns, according to describedInterface protocol obtains the execution result of described functional module.
Here, when the execution ending message that receives functional module and return, from described default interface associationIn agreed adopted storage directory, obtain the execution result of functional module. Exemplarily, when the download module callingReturn and carry out after ending message, from the catalogue " function of/data/data/ application package name/files/ download moduleTitle/" in search execution result, obtain the content of download.
The next functional module relying on for described application program, repeats above-mentioned steps S401Call described next functional module to S403, until described application program rely at OSGi frameworkIn functional module be all finished.
In sum, the embodiment of the present invention is by being integrated in Android by OSGi framework in the mode of serviceIn system, described OSGi framework services comprises multiple functional modules of each middleware, and application program is notNeed to be integrated with functional module, only need to bind this service can call institute from described OSGi framework servicesThe functional module relying on, solves the strong problem of middleware and application program coupling in prior art effectively,Application program can adopt apk mode or jar packet mode to call the functional module in middleware, and abundantThe presentation mode of middleware.
Alternatively, Fig. 5 shows the realization flow of the application process of the middleware that the embodiment of the present invention provides.
Consult Fig. 5, described application process comprises step S501 to S503, and wherein, described step S501 extremelyStep S503 is identical with the step S101 to S103 described in Fig. 1 embodiment respectively, specifically refers toState the narration of embodiment, repeat no more herein. Difference is, the application process of described middleware also wrapsDraw together:
In step 504, from server, obtain the version number of the configuration file of described middleware framework service,In obtained version number during higher than the version number of local configuration file, by the version of local configuration fileNumber be updated to obtained version number, and download described configuration file from server, according to described configuration literary compositionPart upgrades described middleware framework service.
In embodiments of the present invention, Android system is obtained described OSGi framework clothes from server in real timeThe version number of the configuration file of business. When obtained version number is higher than the version number of the configuration file of current this localityTime, the version number of current this locality is updated to obtained version number, and downloads described configuration from serverFile; Resolve the configuration file of downloading, determine pending action. Here, described pending action bagDraw together loading, upgrade and unloading.
In the time that described pending action is loading, obtain bundle file/two bundle to be loadedFile, is mounted to described OSGi framework by a described bundle file/two bundle file to be loadedIn service.
In the time that described pending action is renewal, from described OSGi framework services, unload first of appointmentBundle file/two bundle file, and obtain a bundle file to be loaded or/the 2nd bundleFile, is mounted to described OSGi framework by a described bundle file/two bundle file to be loadedIn service.
In the time that described pending action is unloading, obtain bundle file/two bundle to be unloadedFile. Have if current described in application program launching in the time of functional module corresponding to the bundle file unloading,First close described application program, and from described OSGi framework services, unload closing after described application programA bundle file described to be unloaded; Otherwise, described in directly unloading from described OSGi framework servicesA bundle file to be unloaded.
By above-mentioned steps, in the Android system of Android equipment, move all the time the OSGi of highest versionFramework services, thus the load capacity of Android system alleviated, can dynamically update OSGi frameworkVersion, and when new application program being installed in Android system or unloading original application program, nothingNeed judge the version of the middleware of each application program.
Fig. 6 shows the composition structure of the application apparatus of the middleware that the embodiment of the present invention provides, for the ease ofIllustrate, only show the part relevant to the embodiment of the present invention.
In embodiments of the present invention, the application apparatus of described middleware is used for realizing above-mentioned Fig. 1 to Fig. 5 and implementsThe application process of the middleware in example described in any one can be the software unit that is built in smart machine, hardThe unit of part unit or software and hardware combining. Described smart machine has Android system, comprises but does not limitIn smart mobile phone, panel computer, intelligent watch, intelligent TV set.
Consult Fig. 6, the application apparatus of described middleware comprises:
Load-on module 61, for loading middleware framework service in Android system, starts described centreFunctional module in part framework services;
Start module 62, for by application program and described middleware framework service binding, and by described applicationInstallation, to described middleware framework service, starts described application program after installation;
Calling module 63, for the running in described application program, from described middleware framework serviceIn call the functional module that described application program relies on;
Wherein, described middleware framework service is OSGi framework services, and described OSGi framework services is used forRealize and in Android system, move OSGi framework.
Further, described load-on module 61 comprises:
Set up unit 611, for setting up OSGi framework services in Android system, and from described OSGiIn framework services, obtain OSGi framework instance;
Service start unit 612, for starting described OSGi framework services, and at described OSGi framework clothesIn the startup initialization procedure of business, start described OSGi framework instance;
Function converting unit 613, for being converted to first by the jar file of the functional module of OSGi frameworkBundle file;
Function mounting unit 614, for being mounted to a described bundle file described OSGi framework clothesIn business, obtain OSGi framework interface and an identification information thereof, described in a described OSGi framework interface isThe startup interface of functional module;
Functional module start unit 615, connects for call a described OSGi framework according to described identification informationMouth starts described functional module.
Further, described startup module 62 comprises:
Application converting unit 621, for described compiling of application being become to apk file or jar file, then willDescribed apk file or jar file are converted to the 2nd bundle file;
Binding unit 622, for binding to obtain OSGi by application program and described OSGi framework servicesFramework instance;
Application installation unit 623, for being mounted to described the 2nd bundle file described OSGi framework clothesIn business, the 2nd OSGi framework interface and the identification information thereof obtaining, described the 2nd OSGi interface is described answeringWith the startup interface of program;
Application start unit 634, opens for call described the 2nd OSGi framework interface according to described identification informationMoving described application program.
Further, described calling module 63 comprises:
Query unit 631, for inquiring about the database of described OSGi framework services, obtains described application journeyThe identification information of the one OSGi framework interface of the functional module that order relies on;
Call unit 632, for obtain a corresponding OSGi framework interface according to described identification information, pressesInput parameter preset by a described OSGi framework interface to described functional module according to default interface protocol,Start described functional module to carry out function corresponding to described functional module;
Acquiring unit 633, in the time receiving the execution ending message that described functional module returns, according toDescribed interface protocol obtains the execution result of described functional module.
Further, described device also comprises:
More new module, for obtain the version number of configuration file of described middleware framework service from server,In obtained version number during higher than the version number of local configuration file, by the version of local configuration fileNumber be updated to obtained version number, and download described configuration file from server, according to described configuration literary compositionPart upgrades described middleware framework service.
The embodiment of the present invention is obtained described OSGi framework clothes from server in real time by described more new moduleThe version number of the configuration file of business. When obtained version number is higher than the version number of the configuration file of current this localityTime, the version number of current this locality is updated to obtained version number, and downloads described configuration from serverFile; Resolve the configuration file of downloading, determine pending action. Here, described pending action bagDraw together loading, upgrade and unloading.
In the time that described pending action is loading, obtain bundle file/two bundle to be loadedFile, is mounted to described OSGi framework by a described bundle file/two bundle file to be loadedIn service. In the time that described pending action is renewal, what from described OSGi framework services, unloading was specifiedThe one bundle file/two bundle file, and obtain bundle file/two bundle to be loadedFile, is mounted to described OSGi framework by a described bundle file/two bundle file to be loadedIn service. In the time that described pending action is unloading, obtain bundle file/the second to be unloadedBundle file. There is function corresponding to a bundle file to be unloaded described in application program launching if currentWhen module, first close described application program, and closing after described application program from described OSGi framework clothesA bundle file to be unloaded described in unloading in business; Otherwise, directly from described OSGi framework servicesA bundle file to be unloaded described in unloading.
By above-mentioned more new module, make the highest version of operation all the time in the Android system of Android equipmentThis OSGi framework services, thus the load capacity of Android system alleviated, can dynamically update OSGiThe version of framework, and new application program is installed in Android system or unloads original application programTime, without the version that judges middleware.
It should be noted that, the device in the embodiment of the present invention can be for realizing in said method embodimentAll technical schemes, the function of its each functional module can be concrete according to the method in said method embodimentRealize, its specific implementation process can, with reference to the associated description in above-mentioned example, repeat no more herein.
In sum, the embodiment of the present invention, by load middleware framework service in Android system, opensFunctional module in moving described middleware framework service; By application program and described middleware framework service binding,And described application program is mounted in described middleware framework service, after installation, start described applicationProgram; In the running of described application program, from described middleware framework service, call described applicationThe functional module that program relies on; Wherein, described middleware framework service is OSGi framework services, described inOSGi framework services is moved OSGi framework for realizing in Android system. Thereby make middleware withService mode be integrated in Android system, application program only need to be bound this service, do not need with inBetween part integrated, effectively solve the strong problem of middleware and application program coupling in prior art, and applicationProgram can adopt apk mode or jar packet mode to call the functional module in middleware, has enriched middlewareMethod of calling.
Those of ordinary skill in the art can recognize, in conjunction with respectively showing of embodiment description disclosed hereinUnit and the algorithm steps of example, can come with the combination of electronic hardware or computer software and electronic hardwareRealize. These functions are carried out with hardware or software mode actually, depend on the application-specific of technical schemeAnd design constraint. Professional and technical personnel can realize with distinct methods each specifically should being used forDescribed function, but this realization should not thought and exceeds scope of the present invention.
Those skilled in the art can be well understood to, for convenience and simplicity of description, and foregoing descriptionDevice and the specific works process of unit, can be with reference to the corresponding process in preceding method embodiment, at thisRepeat no more.
In the several embodiment that provide in the application, should be understood that the application side of disclosed middlewareMethod and device, can realize by another way. For example, device embodiment described above is onlySchematically, for example, the division of described module, unit, is only that a kind of logic function is divided, actual realCan have now other dividing mode, for example multiple unit or assembly can in conjunction with or can be integrated into anotherA system, or some features can ignore, or do not carry out. Another point, shown or discussed mutual itBetween coupling or direct-coupling or communication connection can be by some interfaces, device or the INDIRECT COUPLING of unitOr communication connection, can be electrically, machinery or other form.
The described unit as separating component explanation can or can not be also physically to separate, asThe parts that unit shows can be or can not be also physical locations, can be positioned at a place, orAlso can be distributed on multiple NEs. Can select according to the actual needs wherein some or all ofThe object of the present embodiment scheme is realized in unit.
In addition, the each functional unit in each embodiment of the present invention, module can be integrated in one and process listIn unit, can be also that the independent physics of unit, module exists, also can two or more unit,Module integration is in a unit.
If described function realizes also as independently production marketing or use using the form of SFU software functional unitTime, can be stored in a computer read/write memory medium. Based on such understanding, skill of the present inventionThe part that art scheme contributes to prior art in essence in other words or the part of this technical scheme can be withThe form of software product embodies, and this computer software product is stored in a storage medium, if compriseDry instruction in order to make a computer equipment (can be personal computer, server, or the network equipmentDeng) carry out all or part of step of method described in the present invention each embodiment. And aforesaid storage medium bagDraw together: USB flash disk, portable hard drive, read-only storage (ROM, Read-OnlyMemory), arbitrary access are depositedReservoir (RAM, RandomAccessMemory), magnetic disc or CD etc. are various can storage program generationThe medium of code.
The above be only the specific embodiment of the present invention, but protection scope of the present invention is not limited toThis, any be familiar with those skilled in the art the present invention disclose technical scope in, can expect easilyChange or replace, within all should being encompassed in protection scope of the present invention. Therefore, protection scope of the present invention shouldThe described protection domain with claim is as the criterion.
Claims (10)
1. an application process for middleware, is characterized in that, described method comprises:
In Android system, load middleware framework service, start the merit in described middleware framework serviceEnergy module;
By application program and described middleware framework service binding, and by described application program be mounted to described inBetween in part framework services, after installation, start described application program; And
In the running of described application program, from described middleware framework service, call described application journeyThe functional module that order relies on;
Wherein, described middleware framework service is OSGi framework services, and described OSGi framework services is used forRealize and in Android system, move OSGi framework.
2. the application process of middleware as claimed in claim 1, is characterized in that, described at AndroidIn system, load middleware framework service, the functional module starting in described middleware framework service comprises:
In Android system, set up OSGi framework services, and obtain from described OSGi framework servicesOSGi framework instance;
Start described OSGi framework services, and in the startup initialization procedure of described OSGi framework servicesStart described OSGi framework instance;
The jar file of the functional module in OSGi framework is converted to a bundle file;
A described bundle file is mounted in described OSGi framework services, obtains an OSGi frameBridge joint mouth and identification information thereof, the startup interface that a described OSGi framework interface is described functional module;
Call a described OSGi framework interface according to described identification information and start described functional module.
3. the application process of middleware as claimed in claim 1, is characterized in that, described by application programWith described middleware framework service binding, and described application program is mounted in described middleware framework service,After installation, starting described application program comprises:
Described compiling of application is become to apk file or jar file, then by described apk file or jar fileBe converted to the 2nd bundle file;
Application program and described OSGi framework services are bound to obtain OSGi framework instance;
Described the 2nd bundle file is mounted in described OSGi framework services, obtains the 2nd OSGi frameBridge joint mouth and identification information thereof, the startup interface that described the 2nd OSGi interface is described application program;
Call described the 2nd OSGi framework interface according to described identification information and start described application program.
4. the application process of middleware as claimed in claim 1, is characterized in that, described in described applicationIn the running of program, from described middleware framework service, call the function that described application program relies onModule comprises:
Inquire about the database in described OSGi framework services, obtain the function mould that described application program relies onThe identification information of the one OSGi framework interface of piece;
Obtain a corresponding OSGi framework interface according to described identification information, according to default interface protocolTo described functional module input parameter preset, start described function mould by a described OSGi framework interfacePiece is to carry out function corresponding to described functional module;
In the time receiving the execution ending message that described functional module returns, obtain institute according to described interface protocolState the execution result of functional module.
5. the application process of the middleware as described in claim 1 to 4 any one, is characterized in that, described inMethod also comprises:
From server, obtain the version number of the configuration file of described middleware framework service, in obtained versionThis shop is during higher than the version number of local configuration file, by the version number of local configuration file be updated to obtainThe version number of getting, and download described configuration file from server, according to described configuration file upgrade described inBetween part framework services.
6. an application apparatus for middleware, is characterized in that, described device comprises:
Load-on module, for loading middleware framework service in Android system, starts described middlewareFunctional module in framework services;
Start module, for by application program and described middleware framework service binding, and by described application journeyOrder is mounted in described middleware framework service, starts described application program after installation;
Calling module, for the running in described application program, from described middleware framework serviceCall the functional module that described application program relies on;
Wherein, described middleware framework service is OSGi framework services, and described OSGi framework services is used forRealize and in Android system, move OSGi framework.
7. the application apparatus of middleware as claimed in claim 6, is characterized in that, described load-on module bagDraw together:
Set up unit, for setting up OSGi framework services in Android system, and from described OSGiIn framework services, obtain OSGi framework instance;
Service start unit, for starting described OSGi framework services, and in described OSGi framework servicesStartup initialization procedure in start described OSGi framework instance;
Function converting unit, for being converted to first by the jar file of the functional module of OSGi frameworkBundle file;
Function mounting unit, for a described bundle file is mounted to described OSGi framework services,Obtain OSGi framework interface and an identification information thereof, a described OSGi framework interface is described function mouldThe startup interface of piece;
Functional module start unit, for calling a described OSGi framework interface according to described identification informationStart described functional module.
8. the application apparatus of middleware as claimed in claim 6, is characterized in that, described startup module bagDraw together:
Application converting unit, for described compiling of application being become to apk file or jar file, then described in inciting somebody to actionApk file or jar file are converted to the 2nd bundle file;
Binding unit, for binding to obtain OSGi framework by application program and described OSGi framework servicesExample;
Application installation unit, for described the 2nd bundle file is mounted to described OSGi framework services,The 2nd OSGi framework interface and the identification information thereof obtaining, described the 2nd OSGi interface is described application programStartup interface;
Application start unit, starts for call described the 2nd OSGi framework interface according to described identification informationDescribed application program.
9. the application apparatus of middleware as claimed in claim 6, is characterized in that, described calling module bagDraw together:
Query unit, for inquiring about the database of described OSGi framework services, obtains described application programThe identification information of the one OSGi framework interface of the functional module relying on;
Call unit, for obtain a corresponding OSGi framework interface according to described identification information, according toDefault interface protocol is inputted parameter preset by a described OSGi framework interface to described functional module,Start described functional module to carry out function corresponding to described functional module;
Acquiring unit, in the time receiving the execution ending message that described functional module returns, according to describedInterface protocol obtains the execution result of described functional module.
10. the application apparatus of the middleware as described in claim 6 to 9 any one, is characterized in that, instituteStating device also comprises:
More new module, for obtain the version number of configuration file of described middleware framework service from server,In obtained version number during higher than the version number of local configuration file, by the version of local configuration fileNumber be updated to obtained version number, and download described configuration file from server, according to described configuration literary compositionPart upgrades described middleware framework service.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201511023564.8A CN105653331A (en) | 2015-12-29 | 2015-12-29 | Middleware application method and apparatus |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201511023564.8A CN105653331A (en) | 2015-12-29 | 2015-12-29 | Middleware application method and apparatus |
Publications (1)
Publication Number | Publication Date |
---|---|
CN105653331A true CN105653331A (en) | 2016-06-08 |
Family
ID=56490007
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201511023564.8A Pending CN105653331A (en) | 2015-12-29 | 2015-12-29 | Middleware application method and apparatus |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN105653331A (en) |
Cited By (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106990996A (en) * | 2017-04-06 | 2017-07-28 | 青岛海信移动通信技术股份有限公司 | The method and device of application call framework layer interface |
CN107220082A (en) * | 2017-05-18 | 2017-09-29 | 北京小米移动软件有限公司 | Installation method, device and the equipment of application program |
CN108804236A (en) * | 2017-05-04 | 2018-11-13 | Tcl集团股份有限公司 | A kind of sharing method and system of AIDL files |
CN110852139A (en) * | 2018-08-21 | 2020-02-28 | 阿里巴巴集团控股有限公司 | Biometric feature recognition method, biometric feature recognition device, biometric feature recognition equipment and storage medium |
CN112882741A (en) * | 2019-11-29 | 2021-06-01 | 北京沃东天骏信息技术有限公司 | Application management system and method |
CN113377556A (en) * | 2021-06-30 | 2021-09-10 | Tcl通讯(宁波)有限公司 | Method for realizing non-invasive communication service of Android platform |
CN110852139B (en) * | 2018-08-21 | 2024-05-24 | 斑马智行网络(香港)有限公司 | Biometric identification method, device, apparatus and storage medium |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6195685B1 (en) * | 1998-05-22 | 2001-02-27 | International Business Machines Corporation | Flexible event sharing, batching, and state consistency mechanisms for interactive applications |
CN101634946A (en) * | 2009-08-20 | 2010-01-27 | 华南理工大学 | Generation method of RFID member |
CN102385516A (en) * | 2011-10-31 | 2012-03-21 | 华南理工大学 | Method for designing reconfigurable radio frequency identification (RFID) middleware based on cloud server |
CN104636122A (en) * | 2013-11-06 | 2015-05-20 | 中国移动通信集团公司 | Sharing method and device of capacity component |
-
2015
- 2015-12-29 CN CN201511023564.8A patent/CN105653331A/en active Pending
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6195685B1 (en) * | 1998-05-22 | 2001-02-27 | International Business Machines Corporation | Flexible event sharing, batching, and state consistency mechanisms for interactive applications |
CN101634946A (en) * | 2009-08-20 | 2010-01-27 | 华南理工大学 | Generation method of RFID member |
CN102385516A (en) * | 2011-10-31 | 2012-03-21 | 华南理工大学 | Method for designing reconfigurable radio frequency identification (RFID) middleware based on cloud server |
CN104636122A (en) * | 2013-11-06 | 2015-05-20 | 中国移动通信集团公司 | Sharing method and device of capacity component |
Cited By (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106990996A (en) * | 2017-04-06 | 2017-07-28 | 青岛海信移动通信技术股份有限公司 | The method and device of application call framework layer interface |
CN106990996B (en) * | 2017-04-06 | 2021-02-02 | 青岛海信移动通信技术股份有限公司 | Method and device for calling framework layer interface by application program |
CN108804236A (en) * | 2017-05-04 | 2018-11-13 | Tcl集团股份有限公司 | A kind of sharing method and system of AIDL files |
CN108804236B (en) * | 2017-05-04 | 2022-05-03 | Tcl科技集团股份有限公司 | AIDL file sharing method and system |
CN107220082A (en) * | 2017-05-18 | 2017-09-29 | 北京小米移动软件有限公司 | Installation method, device and the equipment of application program |
CN107220082B (en) * | 2017-05-18 | 2021-02-26 | 北京小米移动软件有限公司 | Application program installation method, device and equipment |
CN110852139A (en) * | 2018-08-21 | 2020-02-28 | 阿里巴巴集团控股有限公司 | Biometric feature recognition method, biometric feature recognition device, biometric feature recognition equipment and storage medium |
CN110852139B (en) * | 2018-08-21 | 2024-05-24 | 斑马智行网络(香港)有限公司 | Biometric identification method, device, apparatus and storage medium |
CN112882741A (en) * | 2019-11-29 | 2021-06-01 | 北京沃东天骏信息技术有限公司 | Application management system and method |
CN113377556A (en) * | 2021-06-30 | 2021-09-10 | Tcl通讯(宁波)有限公司 | Method for realizing non-invasive communication service of Android platform |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109034814B (en) | Intelligent contract processing method and device based on Etheng virtual machine | |
CN105653331A (en) | Middleware application method and apparatus | |
CN103250133B (en) | Software definition wireless terminal device and the method being used for issuing and install wireless application | |
CN102855152B (en) | The method and system of resource file in upgrade applications | |
CN101984410A (en) | Method and device for generating and unloading software installation package | |
CN101179430B (en) | Device and method of controlling distributed system software version updating | |
CN105045611A (en) | Upgrading method and apparatus | |
KR20040022461A (en) | System and method for organizing field upgradable wireless communication device software | |
CN105335187A (en) | Application processing method and apparatus | |
US20100313197A1 (en) | System and method for operating domain profile using database in core framework for sdr mobile terminals | |
CN105516154B (en) | Security policy configuration method and device applied to SEAndroid system | |
CN104375849A (en) | Core loading method and device | |
US20070282801A1 (en) | Dynamically creating and executing an application lifecycle management operation | |
CN102546708A (en) | Plug-in obtaining method and system as well as relevant devices | |
CN105302563A (en) | Plug-in method and system for mobile application service | |
CN104750528A (en) | Management method and device for components in Android program | |
CN103825925A (en) | Application program upgrading method and system, and application program upgrading client terminal | |
CN111857801B (en) | Construction method of mobile application | |
CN102404149B (en) | Management system and method of service characteristics | |
CN104699537A (en) | Program control method, activity module scheduling method and corresponding devices thereof | |
CN103777981A (en) | Multi-operation-system remote loading implementation method suitable for X86 framework | |
CN104834541A (en) | Function module mounting method, mounting system and mounting system updating method | |
CN103716346A (en) | Management method and device of application on android handset client | |
US20160198018A1 (en) | Mobile device for executing radio application | |
US10078532B2 (en) | Resource management method and device for terminal system among multiple operating systems |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20160608 |
|
RJ01 | Rejection of invention patent application after publication |