CN106933636A - Start method, device and the terminal device of plug-in services - Google Patents

Start method, device and the terminal device of plug-in services Download PDF

Info

Publication number
CN106933636A
CN106933636A CN201710157645.XA CN201710157645A CN106933636A CN 106933636 A CN106933636 A CN 106933636A CN 201710157645 A CN201710157645 A CN 201710157645A CN 106933636 A CN106933636 A CN 106933636A
Authority
CN
China
Prior art keywords
service
management component
destination
destination service
plug
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
CN201710157645.XA
Other languages
Chinese (zh)
Other versions
CN106933636B (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.)
Beijing Qihoo Technology Co Ltd
Original Assignee
Beijing Qihoo Technology 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 Beijing Qihoo Technology Co Ltd filed Critical Beijing Qihoo Technology Co Ltd
Priority to CN201710157645.XA priority Critical patent/CN106933636B/en
Publication of CN106933636A publication Critical patent/CN106933636A/en
Application granted granted Critical
Publication of CN106933636B publication Critical patent/CN106933636B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements 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/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44521Dynamic linking or loading; Link editing at or after load time, e.g. Java class loading
    • G06F9/44526Plug-ins; Add-ons

Abstract

The embodiment of the invention discloses a kind of method for starting plug-in services, device and terminal device.Wherein method includes:The startup service request information of client is received by the Binder objects of service management component;The destination service in process according to where the startup service request information starts the service management component;Wherein, all services in the process where the service management component manages it, the service management component is operated in different processes from the client.The embodiment of the present invention sets service management component by each process for service end, manage all services in process where it, when destination service and client are operated in different processes, the startup to destination service can be realized, therefore when the service that plug-in unit is provided is started, both position need not be cheated by preset service in the AndroidManifest.xml files of main program, it is not required that the extra process upgraded to main program in service upgrade.

Description

Start method, device and the terminal device of plug-in services
Technical field
The invention belongs to field of computer technology, more particularly to a kind of method for starting plug-in services, device and terminal Equipment.
Background technology
Plug-in unit is the program that a kind of application programming interfaces for following certain specification are write out, and current android system makes The method of the service provided with plug-in unit includes:Start service (Start Service), stop service (Stop Service), tie up Fixed service (Bind Service) and unbinding service (Unbind Service).Carried using plug-in unit in android system The service of confession is mainly realized using two schemes:One kind is by writing a service intermediary in main program, using this Service intermediary calls plug-in unit by reflex mechanism, and its concrete methods of realizing is:First in main program This service intermediary is stated in AndroidManifest.xml files, this service intermediary is then write in main program, in this service The all functions being situated between all are to call the function inside plug-in unit to realize by reflex mechanism;Another kind is by pre- in main program If some service hole positions, the service of plug-in unit offer is loaded using these service hole positions, its concrete methods of realizing is:It is advance first Multiple virtual service registration informations, i.e. service hole position are stated in the AndroidManifest.xml files of main program, then For position is cheated in the service that the service distribution that plug-in unit is provided is adapted, this service is loaded into the process space corresponding to the position of service hole Operation.
Although above-mentioned existing two schemes can realize the use of the service provided plug-in unit, however, specific real During existing, it has been found that above-mentioned existing two schemes all have certain limitation:The first scheme, upgrade plug-in unit The service of offer must first upgrade main program, can be using the service after upgrading, it is necessary to enter only after main program of having upgraded The extra process of row main program upgrading;Second scheme, because default service hole bit quantity is limited, and after service is resided in Platform, life cycle is more long, and so default service hole position will run out quickly, and if default hole position excessively can cause to open Dynamic speed is affected, when third party or oneself by Binder obtain main program application information when, it is possible to can because letter Excessively there is the exception of TransactionTooLarge in breath.
The content of the invention
The embodiment of the present invention technical problem to be solved is:There is provided it is a kind of start the method for plug-in services, device and Terminal device, can start the service that plug-in unit is provided in the case where that need not set hole position and need not carry out extra process.
In order to solve the above technical problems, one side according to embodiments of the present invention, there is provided a kind of startup plug-in services Method, including:
The startup service request information of client is received by the Binder objects of service management component;
The destination service in process according to where the startup service request information starts the service management component;
Wherein, all services in the process where the service management component manages it, the service management component with The client is operated in different processes.
In another embodiment based on the above method of the present invention, the Binder objects by service management component The startup service request information of client is received, including:
The AIDL interface objects of the service management component are called according to the startup service request information StartService functions.
It is described to be started according to the startup service request information in another embodiment based on the above method of the present invention The destination service in process where the service management component, including:
The Service Management group is accessed by the internal class object that the AIDL interfaces are inherited in the service management component The startService functions of part core classes;The core classes of wherein described service management component realize the AIDL interfaces.
It is described to be started according to the startup service request information in another embodiment based on the above method of the present invention The destination service in process where the service management component, including:
According to the startup service request information, whether detection preserves destination service peace in the service management component Dress information;
If preserving destination service mount message in the service management component, obtain the destination service and letter is installed Breath;
If not preserving destination service mount message in the service management component, destination service mount message is created.
In another embodiment based on the above method of the present invention, the establishment destination service mount message, including:
According to the startup service request information, whether detection preserves in the service management component is provided with target clothes The plug-in unit of business;
If preserving the plug-in unit for being provided with destination service in the service management component, target clothes are obtained from the plug-in unit The ServiceInfo objects of business;
If not preserving the plug-in unit for being provided with destination service in the service management component, from the plug-in unit for providing destination service Installation kit in obtain destination service ServiceInfo objects;
ServiceInfo objects based on the startup service request information and the destination service, create destination service Mount message.
In another embodiment based on the above method of the present invention, after the establishment destination service mount message, also Including:
The destination service mount message is preserved in the service management component.
In another embodiment based on the above method of the present invention, after the establishment destination service mount message, also Including:
Based on destination service mount message installation targets service.
In another embodiment based on the above method of the present invention, it is described obtain the destination service mount message it Afterwards, also include:
According to the destination service mount message, whether detection preserves destination service in the service management component;
If preserving destination service in the service management component, the onStartCommand of the destination service is called Function;
If not preserving destination service in the service management component, mesh is installed based on the destination service mount message Mark service.
It is described to be installed based on the destination service mount message in another embodiment based on the above method of the present invention Destination service, including:
Obtain the Context objects of the plug-in unit that destination service is provided;
Taken using the Context Object Creations target of the plug-in unit for providing destination service based on the destination service mount message Business;
Initialize the destination service.
It is described to be utilized based on the destination service mount message in another embodiment based on the above method of the present invention The Context Object Creation destination services of the plug-in unit of destination service are provided, including:
The Classloader of plug-in unit described in Context object acquisitions from the plug-in unit for providing destination service;
The universal class name of destination service is obtained from the destination service mount message;
Universal class name based on the destination service, the mesh is obtained by reflex mechanism using the Classloader of the plug-in unit Mark the system class object of service;
Called by reflex mechanism the destination service system class newInstance come call constructed fuction create mesh Mark service.
In another embodiment based on the above method of the present invention, the initialization destination service, including:
The function of the attachBaseContext of the destination service is called by reflex mechanism;
Call the onCreate functions of the destination service.
It is described to be installed based on the destination service mount message in another embodiment based on the above method of the present invention After destination service, also include:
The destination service is preserved in the service management component.
It is described to be installed based on the destination service mount message in another embodiment based on the above method of the present invention After destination service, also include:
Call the onStartCommand functions of the destination service.
A kind of other side according to embodiments of the present invention, there is provided device of startup plug-in services, including:
Receiving unit, the startup service request for receiving client for the Binder objects by service management component is believed Breath;
Execution unit, in the process where for starting the service management component according to the startup service request information Destination service;
Wherein, all services in the process where the service management component manages it, the service management component with The client is operated in different processes.
In another embodiment based on said apparatus of the present invention, the receiving unit, specifically for being opened according to Dynamic service request information calls the startService functions of the AIDL interface objects of the service management component.
In another embodiment based on said apparatus of the present invention, the execution unit, specifically for by the clothes The internal class object that the AIDL interfaces are inherited in business management assembly accesses the service management component core classes StartService functions;Wherein, the core classes of the service management component realize the AIDL interfaces.
In another embodiment based on said apparatus of the present invention, the execution unit, including:
First detection module, for according to the startup service request information, detect to be in the service management component It is no to preserve destination service mount message;
Acquisition module, for the testing result according to the first detection module, in response in the service management component In preserve destination service mount message, obtain the destination service mount message;
Creation module, for the testing result according to the first detection module, in response in the service management component In do not preserve destination service mount message, create destination service mount message.
In another embodiment based on said apparatus of the present invention, the creation module, specifically for:
According to the startup service request information, whether detection preserves in the service management component is provided with target clothes The plug-in unit of business;
If preserving the plug-in unit for being provided with destination service in the service management component, target clothes are obtained from the plug-in unit The ServiceInfo objects of business;
If not preserving the plug-in unit for being provided with destination service in the service management component, from the plug-in unit for providing destination service Installation kit in obtain destination service ServiceInfo objects;
ServiceInfo objects based on the startup service request information and the destination service, create destination service Mount message.
In another embodiment based on said apparatus of the present invention, the execution unit also includes:
First memory module, for preserving the destination service mount message in the service management component.
In another embodiment based on said apparatus of the present invention, the execution unit also includes:
Module is installed, after creating destination service mount message in the creation module, based on the destination service Mount message installation targets are serviced.
In another embodiment based on said apparatus of the present invention, the execution unit also includes:
Second detection module, for according to the destination service mount message, detect to be in the service management component It is no to preserve destination service;
Performing module, for the testing result according to second detection module, in response in the service management component In preserve destination service, call the onStartCommand functions of the destination service;
The installation module, is additionally operable to the testing result according to second detection module, in response in the service pipe Destination service is not preserved in reason component, based on destination service mount message installation targets service.
In another embodiment based on said apparatus of the present invention, the installation module, specifically for:
Obtain the Context objects of the plug-in unit that destination service is provided;
Taken using the Context Object Creations target of the plug-in unit for providing destination service based on the destination service mount message Business;
Initialize the destination service.
In another embodiment based on said apparatus of the present invention, the installation module is installed based on the destination service Information Pull provides the Context Object Creation destination services of the plug-in unit of destination service, specifically for:
The Classloader of plug-in unit described in Context object acquisitions from the plug-in unit for providing destination service;
The universal class name of destination service is obtained from the destination service mount message;
Universal class name based on the destination service, the mesh is obtained by reflex mechanism using the Classloader of the plug-in unit Mark the system class object of service;
Called by reflex mechanism the destination service system class newInstance come call constructed fuction create mesh Mark service.
In another embodiment based on said apparatus of the present invention, destination service described in the installation module initialization, Specifically for:
The function of the attachBaseContext of the destination service is called by reflex mechanism;
Call the onCreate functions of the destination service.
In another embodiment based on said apparatus of the present invention, the execution unit also includes:
Second memory module, for preserving the destination service in the service management component.
In another embodiment based on said apparatus of the present invention, the performing module is additionally operable in the installation mould Block is based on after destination service mount message installation targets service, calls the onStartCommand letters of the destination service Number.
Another aspect according to embodiments of the present invention, there is provided a kind of terminal device, including:Processor and memory; Wherein,
The memory is used for the program of the method for storing the startup plug-in services described in any of the above-described embodiment;
The processor is used for the program of the method for performing the startup plug-in services stored in the memory.
The method of startups plug-in services, device and the terminal device provided based on the above embodiment of the present invention, by being to take Business each process of end sets service management component, all services in process where it is managed, when by service management component After Binder objects receive the startup service request information of client, Service Management is started according to this startup service request information The destination service in process where component, when destination service and client are operated in different processes, it is possible to achieve right The startup of destination service, because the embodiment of the present invention is by being arranged at the service management component in each process in process All services are managed, therefore it preset service need not both be cheated in the AndroidManifest.xml files of main program Position, it is not required that the extra process upgraded to main program in service upgrade, you can realize to the service of plug-in unit offer Start.
Brief description of the drawings
The Description of Drawings embodiments of the invention of a part for specification are constituted, and together with description for explaining Principle of the invention.
Referring to the drawings, according to following detailed description, the present invention can be more clearly understood from, wherein:
Fig. 1 is the flow chart of the one embodiment for the method that the embodiment of the present invention starts plug-in services.
Fig. 2 is the flow chart of another embodiment of the method that the embodiment of the present invention starts plug-in services.
Fig. 3 is the flow chart of another embodiment of the method that the embodiment of the present invention starts plug-in services.
Fig. 4 is the flow chart of the further embodiment of the method that the embodiment of the present invention starts plug-in services.
Fig. 5 is the structure chart of the one embodiment for the device that the embodiment of the present invention starts plug-in services.
Fig. 6 is the structure chart of another embodiment of the device that the embodiment of the present invention starts plug-in services.
Fig. 7 is the structure chart of another embodiment of the device that the embodiment of the present invention starts plug-in services.
Fig. 8 is the block diagram of the part-structure of the mobile phone related to terminal device provided in an embodiment of the present invention.
Specific embodiment
Describe various exemplary embodiments of the invention in detail now with reference to accompanying drawing.It should be noted that:Unless had in addition Body illustrates that the positioned opposite of the part for otherwise illustrating in these embodiments, numerical expression and numerical value do not limit of the invention Scope.
Simultaneously, it should be appreciated that for the ease of description, the size of the various pieces shown in accompanying drawing is not according to reality Proportionate relationship draw.
The description only actually at least one exemplary embodiment is illustrative below, never as to the present invention And its any limitation applied or use.
May be not discussed in detail for technology, method and apparatus known to person of ordinary skill in the relevant, but suitable In the case of, the technology, method and apparatus should be considered as a part for specification.
It should be noted that:Similar label and letter represents similar terms in following accompanying drawing, therefore, once a certain Xiang Yi It is defined in individual accompanying drawing, then it need not be further discussed in subsequent accompanying drawing.
Fig. 1 is the flow chart of the one embodiment for the method that the embodiment of the present invention starts plug-in services.As shown in figure 1, should The method of embodiment includes:
S102, the startup service request information of client is received by the Binder objects of service management component.
S104, according to the destination service in the process started where service request information starts service management component.
Wherein, a background service of the service that destination service is provided for plug-in unit, for example, android system, services institute Process would generally be in AndroidManifest.xml files<Service>Android in label:In process Specified.Client is to call a side of service, and a side of service implementation is service end, and for example clearing up plug-in unit will call backup Come the backup before clearing up, then the side for clearing up plug-in unit is client to backup services in plug-in unit, there is provided a side of backup services It is service end, client is operated in different processes from service end.A clothes are designed with each process of service end Business management assembly, all services in the process where it are managed by service management component.
In a specific embodiment, starting service request information can include:Intent objects, Context objects and Messenger objects.Wherein, Intent is to be related to data and attached to performing the action of once-through operation, action in android system The description of addend evidence, android system is responsible for finding corresponding component according to the description of this Intent, and Intent is passed to The component for calling, completes calling for component.Context is one information of application environment of description, can be with by Context The resource and class of application program are obtained, is also operated including some application levels.Messenger be by client transmission come for Mark the unique mark of client, it is also possible to do the transmission messenger service with client.
In implementing, operation S102 can call the AIDL interfaces of service management component according to startup service request information The startService functions of object, operation S104 can be by the internal class object of succession AIDL interfaces in service management component The startService functions of access service management assembly core classes start destination service, the wherein core of service management component Class realizes AIDL interfaces.
In a specific embodiment, IPluginServiceServer interface objects are connect for the AIDL of service management component Mouth object, IPluginServiceServer interfaces are the core interface of service management component, PluginServiceServer classes It is the core classes of service management component, is implementing for IPluginServiceServer interfaces, service management component passes through Core interface realizes the work such as the service dispatch of service end, offer jointly with core classes.Due to IPluginServiceServer Interface object is the Proxy of Binder objects, it is therefore desirable to realized in the process where destination service IPluignServiceServer.Stub classes, IPluignServiceServer.Stub classes are PluginServiceServer The inner classes of class, inherit IPluginServiceServer interfaces, realize its basic function, and finally jump to Processed accordingly in PluginServiceServer classes;Wherein IPluginServiceServer interfaces are stated StartService functions, inner classes IPluignServiceServer.Stub defines startService functions, PluginServiceServer classes realize startService functions.
Wherein, IPluignServiceServer.Stub classes are realized in service management component, and the behaviour initialized to it Work includes:PluginServiceServer objects are created or obtained, PluginServiceServer.Stub pairs is created or obtain As, and the either method in PluginServiceServer.Stub is called, jump to PluginServiceServer.First, Whether detection preserves PluginServiceServer objects in service management component;If being preserved in service management component There are PluginServiceServer objects, obtain PluginServiceServer objects;Otherwise, if in service management component PluginServiceServer objects are not preserved, PluginServiceServer objects are created;It is then detected that being managed in service Whether PluginServiceServer.Stub objects are preserved in reason component;If being preserved in service management component PluginServiceServer.Stub objects, obtain PluginServiceServer.Stub objects;Otherwise, if being managed in service PluginServiceServer.Stub objects are not preserved in reason component, PluginServiceServer.Stub pairs is created As;Finally, the either method in PluginServiceServer.Stub is called, PluginServiceServer is jumped to.
Specifically, create PluginServiceServer objects can by call IPluginHost interfaces or The fetchServiceServer functions of IPluginClient interfaces obtain IPluginServiceServer interface objects and come real It is existing.The example of its specific code is as follows:
Wherein IPluginHost interfaces are the interface of Resident Process, and IPluginClient interfaces are in addition to Resident Process The interface of other processes, the class of mServiceMgr objects is PluginServiceServer, and mServiceMgr objects are by adjusting IPluginServiceServer.Stub classes are obtained with getService functions.
Creating PluginServiceServer.Stub objects can be by calling getService functions to realize.Its tool The example of body code is as follows:
In a specific embodiment, the example of the specific code of startService functions is as follows:
Wherein, a Intent objects are replicated first in the function, if client and destination service are same In process, once destination service have modified Intent objects, client can also be corresponded to and changed, and so be occurred unpredictable Problem, it is therefore desirable to replicate portion Intent objects first in function to do various operations, to prevent problem above. The example for replicating the specific code of Intent objects is as follows:
private Intent cloneIntentLocked(Intent intent){
return new Intent(intent);
}
Then the function is obtained based on Intent objects by retrieveServiceLocked functions ServiceRecord objects, wherein ServiceRecord the object records mount message of destination service, wherein obtaining The acquisition of plugin information may be related to during ServiceRecord objects.If destination service is not installed afterwards, pass through InstallServiceIfNeededLocked functions attempt installation targets service.Last invocation target service OnStartCommand functions, and the universal class name ComponentName of destination service is directly returned, represent destination service Successfully start up.
Based on the method for startup plug-in services provided in an embodiment of the present invention, service is set by each process for service end Management assembly, manages all services in process where it, when the Binder objects by service management component receive client After the startup service request information at end, the mesh in process according to where this startup service request information starts service management component Mark service, when destination service and client are operated in different processes, it is possible to achieve the startup to destination service, due to this Inventive embodiments be by the service management component being arranged in each process to process in all services be managed, therefore It both need not cheat position by preset service in the AndroidManifest.xml files of main program, it is not required that in service upgrade When the extra process upgraded to main program, you can the startup of service provided plug-in unit is provided.
Fig. 2 is the flow chart of another embodiment of the method that the embodiment of the present invention starts plug-in services.As shown in Fig. 2 The method of the embodiment includes:
S202, the startup service request information of client is received by the Binder objects of service management component.
S204, according to service request information is started, whether detection preserves destination service installation in service management component Information.
If preserving destination service mount message in service management component, operation S206 is performed;No person, if being managed in service Destination service mount message is not preserved in reason component, operation S208 is performed.
S206, obtains destination service mount message.
S208, creates destination service mount message.
In implementing, operation S208 can be detected in service management component first according to service request information is started Whether preservation is provided with the plug-in unit of destination service, if preserving the plug-in unit for being provided with destination service in service management component, from The ServiceInfo objects of destination service are obtained in plug-in unit, otherwise, if do not preserved in service management component being provided with target clothes The plug-in unit of business, then obtain the ServiceInfo objects of destination service, last base from the installation kit of plug-in unit for providing destination service In the ServiceInfo objects for starting service request information and the destination service for being obtained, destination service mount message is created.
Further, after S208 is operated, the method for the startup plug-in services of the embodiment also includes:Operation S210, base In the service of destination service mount message installation targets.
In implementing, after S208 is operated, can also include:Destination service is preserved in service management component to install The operation of information, letter is installed directly can obtain destination service from service management component when destination service is started next time Breath.
In a specific embodiment, operation S204, to S208 is operated, is with the universal class name of destination service first Intent objects in ComponentName and startup service request information, delay in the ServiceRecord of service management component The ServiceRecord objects that searching matches with it in table are deposited, record has service pipe wherein in ServiceRecord cache tables The mount message of all mounted services in process where reason component, ServiceRecord objects are installed for destination service Information, if finding ServiceRecord objects in the ServiceRecord cache tables of service management component, obtains ServicedRecord objects, represent that destination service has been installed, if in the ServiceRecord cache tables of service management component In do not find ServiceRecord objects, represent that destination service is not yet installed, create ServicedRecord objects;Then from Plug-in unit name is obtained in the universal class name ComponentName of destination service, is judged by plug-in unit framework corresponding with plug-in unit name Whether there is the plug-in unit in service management component, if there is the plug-in unit in service management component, can be provided using it Service, now obtains the ServiceInfo objects of destination service from plug-in unit, such as default from plug-in unit The ServiceInfo objects of destination service are obtained in ComponentList objects, wherein ComponentList objects are preserved The PackageInfo objects of plug-in unit, if not existing the plug-in unit in service management component, need to download the plug-in unit, from plug-in unit Installation kit in obtain destination service ServiceInfo objects;It is finally based on and starts service request information and destination service The ServiceRecord objects of ServiceInfo Object Creation destination services, and it is saved into ServiceRecord cachings In the Intent.FilterComparison tables of table and system, wherein Intent.FilterComparison tables are used for carrying out Intent is contrasted.The example of the specific code of aforesaid operations is as follows:
Wherein, ServiceRecord classes include:Name, for recording the universal class name of service, with system ComponentName objects are encapsulated, and the wherein Key of ComponentName objects is plug-in unit name, and Value is class full name; Plugin, for recording the name of the plug-in unit belonging to service, the also as result of name.getPackageName (), with character Go here and there to represent;ClassName, the full name of class for recording service, the also as result of name.getClassName (), with word Symbol goes here and there to represent;Intent, for recording the filter condition in some services, such as Action, IntentFilter etc., with side Just read after, and screened;ServiceInfo, for recording the service described in the AndroidManifest.xml of plug-in unit Information, is the ServiceInfo objects of system;Service, for recording service object, is created after service is installed successfully , it is core field;Whether startRequested, for recording the service of having been turned on, and calls onStartCommand, in solution Used except binding service and when stopping service.
Fig. 3 is the flow chart of another embodiment of the method that the embodiment of the present invention starts plug-in services.As shown in figure 3, The method of the embodiment includes:
S302, the startup service request information of client is received by the Binder objects of service management component.
S304, according to service request information is started, whether detection preserves destination service installation in service management component Information.
If preserving destination service mount message in service management component, operation S306 is performed;No person, if being managed in service Destination service mount message is not preserved in reason component, operation S308 is performed.
S308, creates destination service mount message.
S306, obtains destination service mount message.
S310, according to destination service mount message, whether detection preserves destination service in service management component.
If preserving destination service in service management component, operation 314 is performed;Otherwise, if in service management component Destination service is not preserved, operation S312 is performed.
S312, based on the service of destination service mount message installation targets.
S314, the onStartCommand functions of invocation target service.
Further, after S308 is operated, operation S312 is also performed, based on the service of destination service mount message installation targets Operation.
In implementing, after S308 is operated, can also include:Destination service is preserved in service management component to install The operation of information, letter is installed directly can obtain destination service from service management component when destination service is started next time Breath.
Further, after S312 is operated, operation S314, the onStartCommand functions of invocation target service are also performed Operation.
In implementing, after S312 is operated, can also include:The behaviour of destination service is preserved in service management component Make, destination service directly can be obtained from service management component with when destination service is started next time.
In a specific embodiment, S310 is operated to S314 is operated, first according to ServiceRecord pairs for being obtained As judging that, with the presence or absence of corresponding service in service management component, not only record has wherein in ServiceRecord cache tables The mount message of all mounted services in process where service management component, also record have where service management component The mount message of all services for preparing to install in process, if there is corresponding service in service management component, before expression The service is successful installation of, onStartCommand functions have been directly invoked, if not existing in service management component Corresponding service, before expression and the service is installed not successfully, it is necessary to begin attempt to install the service.The example of its specific code It is as follows:
Fig. 4 is the flow chart of the further embodiment of the method that the embodiment of the present invention starts plug-in services.As shown in figure 4, This embodiment offers a kind of method based on the service of destination service mount message installation targets, the method includes:
S402, obtains the Context objects of the plug-in unit for providing destination service.
S404, the Context Object Creation targets of the plug-in unit for providing destination service are utilized based on destination service mount message Service.
S406, initialized target service.
In implementing, operation S404 can include:From the Context object acquisition plug-in units of the plug-in unit for providing destination service Classloader, from destination service mount message obtain destination service universal class name, based on destination service universal class name, by anti- The system class object that mechanism obtains destination service using the Classloader of plug-in unit is penetrated, is by what reflex mechanism invocation target was serviced Unite class newInstance come call constructed fuction create destination service.
In implementing, operation S406 can include:Serviced by reflex mechanism invocation target The function of attachBaseContext;And the onCreate functions of invocation target service.
Wherein, after installation targets service, the operation of destination service is preserved in service management component, specifically in clothes Business management assembly in preserve initialization after destination service, with next time start destination service when can directly from Service Management The destination service after initialization is obtained in component.
In a specific embodiment, operation 402 obtains the plug-in unit of offer destination service first to operation 406 Context objects, to obtain ClassLoader objects by it, and as the BaseContext of destination service, Then from provide destination service plug-in unit Context object acquisition plug-in units ClassLoader objects, will pass through reflection machine Make to create destination service, destination service is created by reflex mechanism afterwards;It specifically includes three below step:From target Name field in the ServiceInfo of the ServiceRecord objects of service obtains the universal class name of destination service, by reflection Mechanism obtains the Class objects of destination service, i.e. system class object using the ClassLoader objects of plug-in unit, then by anti- The newInstance of the system class that mechanism invocation target is serviced is penetrated to call constructed fuction to create destination service;Afterwards by anti- The function of the attachBaseContext of mechanism invocation target service is penetrated, the onCreate functions of last invocation target service are real Now to the initialization of destination service.The example of its specific code is as follows:
Wherein, the example of the specific code of attachBaseContext functions is as follows:
In the function, parameter ContextWrapper is destination service, and the parent of destination service is system ContextWrapper classes, parameter Context is then the Context objects of the plug-in unit for obtaining before.
Fig. 5 is the structure chart of the one embodiment for the device that the embodiment of the present invention starts plug-in services.As shown in figure 5, should The device of embodiment includes:Receiving unit 510 and execution unit 520.Wherein:
Receiving unit 510, the startup service request of client is received for the Binder objects by service management component Information.
Execution unit 520, for the mesh in the process started where service request information starts service management component Mark service.
Wherein, all services in the process where service management component manages it, service management component is transported with client Row is in different processes.
In implementing, receiving unit 510 can be specifically for calling Service Management group according to startup service request information The startService functions of the AIDL interface objects of part, execution unit 520 can be specifically for by service management component The startService functions for inheriting the internal class object access service management assembly core classes of the AIDL interfaces start mesh Mark service, the core classes of wherein service management component realize AIDL interfaces.
Based on the device of startup plug-in services provided in an embodiment of the present invention, service is set by each process for service end Management assembly, manages all services in process where it, when the Binder objects by service management component receive client After the startup service request information at end, the mesh in process according to where this startup service request information starts service management component Mark service, when destination service and client are operated in different processes, it is possible to achieve the startup to destination service, due to this Inventive embodiments be by the service management component being arranged in each process to process in all services be managed, therefore It both need not cheat position by preset service in the AndroidManifest.xml files of main program, it is not required that in service upgrade When the extra process upgraded to main program, you can the startup of service provided plug-in unit is provided.
Fig. 6 is the structure chart of another embodiment of the device that the embodiment of the present invention starts plug-in services.As shown in fig. 6, Compared with the embodiment of Fig. 5, in this embodiment, the execution unit 620 for starting the device of plug-in services also includes:First detection Module 621, acquisition module 622 and creation module 623.Wherein:
First detection module 621, for according to service request information is started, whether detection to preserve in service management component There is destination service mount message.
Acquisition module 622, for the testing result according to first detection module 621, in response in service management component Destination service mount message is preserved, destination service mount message is obtained.
Creation module 623, for the testing result according to first detection module 621, in response in service management component Destination service mount message is not preserved, destination service mount message is created.
In implementing, creation module 623 can be specifically for:First according to service request information is started, detection is in clothes Whether the plug-in unit for being provided with destination service is preserved in business management assembly, if preserved in service management component being provided with destination service Plug-in unit, then from plug-in unit obtain destination service ServiceInfo objects, if do not preserved in service management component being provided with The plug-in unit of destination service, then obtain the ServiceInfo objects of destination service from the installation kit of plug-in unit for providing destination service, The ServiceInfo objects for starting service request information and the destination service for being obtained are finally based on, destination service are created and is installed Information.
Further, as shown in fig. 6, execution unit 620 also includes:Module 624 is installed, for being created in creation module 623 After destination service mount message, based on the service of destination service mount message installation targets.
In implementing, execution unit 620 can also include:First memory module, for being protected in service management component Destination service mount message is deposited, is taken so that when destination service is started next time target directly can be obtained from service management component Business mount message.
Fig. 7 is the structure chart of another embodiment of the device that the embodiment of the present invention starts plug-in services.As shown in fig. 7, Compared with the embodiment of Fig. 6, in this embodiment, the execution unit 720 for starting the device of plug-in services also includes:Second detection Module 725 and performing module 726.Wherein:
Second detection module 725, for according to destination service mount message, whether detection to preserve in service management component There is destination service.
Performing module 726, for the testing result according to the second detection module 725, in response in service management component Preserve destination service, the onStartCommand functions of invocation target service.
Module 724 is installed, the testing result according to the second detection module 725 is additionally operable to, in response in service management component In do not preserve destination service, based on destination service mount message installation targets service.
In implementing, installing module 724 can be specifically for:Obtain Context pairs of the plug-in unit that destination service is provided As utilizing the Context Object Creation destination services of the plug-in unit for providing destination service, Yi Jichu based on destination service mount message The beginningization destination service.
Specifically, module 724 is installed and is based on Context of the destination service mount message using the plug-in unit for providing destination service Object Creation destination service, specifically for:From the class loading of the Context object acquisition plug-in units of the plug-in unit for providing destination service Device, the universal class name of destination service is obtained from destination service mount message, the universal class name based on destination service, by reflex mechanism profit The system class object of destination service is obtained with the Classloader of plug-in unit, the system class serviced by reflex mechanism invocation target NewInstance come call constructed fuction create destination service.
Specifically, the initialized target service of module 724 is installed, specifically for:Serviced by reflex mechanism invocation target The function of attachBaseContext, and the onCreate functions that invocation target is serviced.
Further, execution unit 720 also includes:Second memory module, for preserving target clothes in service management component Business, directly destination service can be obtained with when destination service is started next time from service management component.
Specifically, after the service of the initialized target of module 724 is installed, after the second memory module is used to preserve initialization Destination service, is taken with can directly obtain the target after initialization from service management component when destination service is started next time Business.
Further, performing module 726, are additionally operable to installing module 724 based on destination service mount message installation targets clothes After business, the onStartCommand functions of invocation target service.
In addition, the embodiment of the present invention additionally provides terminal device, as shown in figure 8, for convenience of description, illustrate only and this The related part of inventive embodiments, particular technique details is not disclosed, and refer to present invention method part.The terminal sets Standby can be to include mobile phone, panel computer, PDA (Personal Digital Assistant, personal digital assistant), POS Any terminal device such as (Point of Sales, point-of-sale terminal), vehicle-mounted computer, so that terminal device is as mobile phone as an example:
Fig. 8 is the block diagram of the part-structure of the mobile phone related to terminal device provided in an embodiment of the present invention.With reference to Fig. 8, Mobile phone includes:Radio frequency (Radio Frequency, RF) circuit 810, memory 820, input block 830, display unit 840, biography Sensor 850, voicefrequency circuit 860, Wireless Fidelity (wireless-fidelity, Wi-Fi) module 870, processor 880, Yi Ji electricity The grade part of source 890.It will be understood by those skilled in the art that the handset structure shown in Fig. 8 does not constitute the restriction to mobile phone, can With including than illustrating more or less part, or some parts are combined, or different part arrangements.
Each component parts of mobile phone is specifically introduced with reference to Fig. 8:
RF circuits 810 can be used to receiving and sending messages or communication process in, the reception and transmission of signal, especially, by base station After downlink information is received, processed to processor 880;In addition, up data is activation will be designed to base station.Generally, RF circuits 810 Including but not limited to antenna, at least one amplifier, transceiver, coupler, low-noise amplifier (Low Noise Amplifier, LNA), duplexer etc..Additionally, RF circuits 810 can also be communicated by radio communication with network and other equipment. Above-mentioned radio communication can use any communication standard or agreement, including but not limited to global system for mobile communications (Global System of Mobile communication, GSM), general packet radio service (General Packet Radio Service, GPRS), CDMA (Code Division Multiple Access, CDMA), WCDMA (Wideband Code Division Multiple Access, WCDMA), Long Term Evolution (Long Term Evolution, LTE), Email, Short Message Service (Short Messaging Service, SMS) etc..
Memory 820 can be used to store software program and module, and processor 880 is by running storage in memory 820 Software program and module, so as to perform various function application and the data processing of mobile phone.Memory 820 can mainly include Storing program area and storage data field, wherein, the application journey that storing program area can be needed for storage program area, at least one function Sequence (such as sound-playing function, image player function etc.) etc.;Storage data field can be stored and use what is created according to mobile phone Data (such as voice data, phone directory etc.) etc..Additionally, memory 820 can include high-speed random access memory, can be with Including nonvolatile memory, for example, at least one disk memory, flush memory device or other volatile solid-states Part.
Input block 830 can be used to receive the numeral or character information of input, and produce with the user of mobile phone set with And the relevant key signals input of function control.Specifically, input block 830 may include that contact panel 831 and other inputs set Standby 832.Contact panel 831, also referred to as touch-screen, user can be collected thereon or neighbouring touch operation (such as user uses The operation of any suitable object such as finger, stylus or annex on contact panel 831 or near contact panel 831), and root Corresponding attachment means are driven according to formula set in advance.Optionally, contact panel 831 may include touch detecting apparatus and touch Two parts of controller.Wherein, touch detecting apparatus detect the touch orientation of user, and detect the signal that touch operation brings, Transmit a signal to touch controller;Touch controller receives touch information from touch detecting apparatus, and is converted into touching Point coordinates, then give processor 880, and the order sent of receiving processor 880 and can be performed.Furthermore, it is possible to using electricity The polytypes such as resistive, condenser type, infrared ray and surface acoustic wave realize contact panel 831.Except contact panel 831, input Unit 830 can also include other input equipments 832.Specifically, other input equipments 832 can include but is not limited to secondary or physical bond One or more in disk, function key (such as volume control button, switch key etc.), trace ball, mouse, action bars etc..
Display unit 840 can be used for show by user input information or be supplied to user information and mobile phone it is various Menu.Display unit 840 may include display panel 841, optionally, can use liquid crystal display (Liquid Crystal Display, LCD), the form such as Organic Light Emitting Diode (Organic Light-Emitting Diode, OLED) it is aobvious to configure Show panel 841.Further, contact panel 831 can cover display panel 841, when contact panel 831 detect it is thereon or attached After near touch operation, processor 880 is sent to determine the type of touch event, with preprocessor 880 according to touch event Type corresponding visual output is provided on display panel 841.Although in fig. 8, contact panel 831 and display panel 841 It is input and the input function that mobile phone is realized as two independent parts, but in some embodiments it is possible to by touch-control Panel 831 and display panel 841 be integrated and input that realize mobile phone and output function.
Mobile phone may also include at least one sensor 850, such as optical sensor, motion sensor and other sensors. Specifically, optical sensor may include ambient light sensor and proximity transducer, wherein, ambient light sensor can be according to ambient light Light and shade adjust the brightness of display panel 841, proximity transducer can close display panel 841 when mobile phone is moved in one's ear And/or backlight.As one kind of motion sensor, (generally three axles) acceleration in the detectable all directions of accelerometer sensor Size, size and the direction of gravity are can detect that when static, can be used for recognize mobile phone attitude application (such as horizontal/vertical screen is cut Change, dependent game, magnetometer pose calibrating), Vibration identification correlation function (such as pedometer, tap) etc.;May be used also as mobile phone The other sensors such as gyroscope, barometer, hygrometer, thermometer, the infrared ray sensor of configuration, will not be repeated here.
Voicefrequency circuit 860, loudspeaker 861, microphone 862 can provide the COBBAIF between user and mobile phone.Audio-frequency electric Electric signal after the voice data conversion that road 860 will can receive, is transferred to loudspeaker 861, and sound is converted to by loudspeaker 861 Signal output;On the other hand, the voice signal of collection is converted to electric signal by microphone 862, is turned after being received by voicefrequency circuit 860 It is changed to voice data, then after voice data output processor 880 is processed, through RF circuits 810 to be sent to such as another mobile phone, Or export to memory 820 so as to further treatment voice data.
WiFi belongs to short range wireless transmission technology, and mobile phone can help user's transceiver electronicses postal by WiFi module 870 Part, browse webpage and access streaming video etc., it has provided the user wireless broadband internet and has accessed.Although Fig. 8 shows WiFi module 870, but it is understood that, it is simultaneously not belonging to must be configured into for mobile phone, can not change as needed completely Become in the essential scope of invention and omit.
Processor 880 is the control centre of mobile phone, using various interfaces and the various pieces of connection whole mobile phone, is led to Cross operation or perform software program of the storage in memory 820 and/or module, and call storage in memory 820 Data, perform the various functions and processing data of mobile phone, so as to carry out integral monitoring to mobile phone.Optionally, processor 880 can be wrapped Include one or more processing units;Preferably, processor 880 can integrated application processor and modem processor, wherein, should Operating system, user interface and application program etc. are mainly processed with processor, modem processor mainly processes radio communication. It is understood that above-mentioned modem processor can not also be integrated into processor 880.
Mobile phone also includes the power supply 890 (such as battery) powered to all parts, it is preferred that power supply can be by power supply pipe Reason system is logically contiguous with processor 880, so as to realize management charging, electric discharge and power managed by power-supply management system Etc. function.
Although not shown, mobile phone can also will not be repeated here including camera, bluetooth module etc..
In embodiments of the present invention, the processor 880 included by the terminal device also has following functions:
The startup service request information of client is received by the Binder objects of service management component;
According to the destination service in the process started where service request information starts service management component;
Wherein, all services in the process where service management component manages it, service management component is transported with client Row is in different processes.
The embodiment of the invention provides following technical scheme:
1st, a kind of method for starting plug-in services, including:
The startup service request information of client is received by the Binder objects of service management component;
The destination service in process according to where the startup service request information starts the service management component;
Wherein, all services in the process where the service management component manages it, the service management component with The client is operated in different processes.
2nd, the method according to 1, the startup that the Binder objects by service management component receive client takes Business solicited message, including:
The AIDL interface objects of the service management component are called according to the startup service request information StartService functions.
3rd, the method according to 2, it is described that the service management component institute is started according to the startup service request information Process in destination service, including:
The Service Management group is accessed by the internal class object that the AIDL interfaces are inherited in the service management component The startService functions of part core classes;The core classes of wherein described service management component realize the AIDL interfaces.
4th, the method according to 1 to 3 any one, it is described that the service is started according to the startup service request information The destination service in process where management assembly, including:
According to the startup service request information, whether detection preserves destination service peace in the service management component Dress information;
If preserving destination service mount message in the service management component, obtain the destination service and letter is installed Breath;
If not preserving destination service mount message in the service management component, destination service mount message is created.
5th, the method according to 4, the establishment destination service mount message, including:
According to the startup service request information, whether detection preserves in the service management component is provided with target clothes The plug-in unit of business;
If preserving the plug-in unit for being provided with destination service in the service management component, target clothes are obtained from the plug-in unit The ServiceInfo objects of business;
If not preserving the plug-in unit for being provided with destination service in the service management component, from the plug-in unit for providing destination service Installation kit in obtain destination service ServiceInfo objects;
ServiceInfo objects based on the startup service request information and the destination service, create destination service Mount message.
6th, the method according to 4 or 5, after the establishment destination service mount message, also includes:
The destination service mount message is preserved in the service management component.
7th, the method according to 4 to 6 any one, after the establishment destination service mount message, also includes:
Based on destination service mount message installation targets service.
8th, the method according to 7, after the acquisition destination service mount message, also includes:
According to the destination service mount message, whether detection preserves destination service in the service management component;
If preserving destination service in the service management component, the onStartCommand of the destination service is called Function;
If not preserving destination service in the service management component, mesh is installed based on the destination service mount message Mark service.
9th, the method according to 7 or 8, it is described based on destination service mount message installation targets service, including:
Obtain the Context objects of the plug-in unit that destination service is provided;
Taken using the Context Object Creations target of the plug-in unit for providing destination service based on the destination service mount message Business;
Initialize the destination service.
10th, the method according to 9, it is described that the plug-in unit that destination service is provided is utilized based on the destination service mount message Context Object Creation destination services, including:
The Classloader of plug-in unit described in Context object acquisitions from the plug-in unit for providing destination service;
The universal class name of destination service is obtained from the destination service mount message;
Universal class name based on the destination service, the mesh is obtained by reflex mechanism using the Classloader of the plug-in unit Mark the system class object of service;
Called by reflex mechanism the destination service system class newInstance come call constructed fuction create mesh Mark service.
11st, the method according to 9, the initialization destination service, including:
The function of the attachBaseContext of the destination service is called by reflex mechanism;
Call the onCreate functions of the destination service.
12nd, the method according to 8 to 11 any one, it is described based on destination service mount message installation targets clothes After business, also include:
The destination service is preserved in the service management component.
13rd, the method according to 8 to 12 any one, it is described based on destination service mount message installation targets clothes After business, also include:
Call the onStartCommand functions of the destination service.
14th, a kind of device for starting plug-in services, including:
Receiving unit, the startup service request for receiving client for the Binder objects by service management component is believed Breath;
Execution unit, in the process where for starting the service management component according to the startup service request information Destination service;
Wherein, all services in the process where the service management component manages it, the service management component with The client is operated in different processes.
15th, the device according to 14, the receiving unit, specifically for being called according to the startup service request information The startService functions of the AIDL interface objects of the service management component.
16th, the device according to 15, the execution unit, specifically for by inheriting institute in the service management component The internal class object for stating AIDL interfaces accesses the startService functions of the service management component core classes;Wherein, it is described The core classes of service management component realize the AIDL interfaces.
17th, the device according to 16, the execution unit, including:
First detection module, for according to the startup service request information, detect to be in the service management component It is no to preserve destination service mount message;
Acquisition module, for the testing result according to the first detection module, in response in the service management component In preserve destination service mount message, obtain the destination service mount message;
Creation module, for the testing result according to the first detection module, in response in the service management component In do not preserve destination service mount message, create destination service mount message.
18th, the device according to 17, the creation module, specifically for:
According to the startup service request information, whether detection preserves in the service management component is provided with target clothes The plug-in unit of business;
If preserving the plug-in unit for being provided with destination service in the service management component, target clothes are obtained from the plug-in unit The ServiceInfo objects of business;
If not preserving the plug-in unit for being provided with destination service in the service management component, from the plug-in unit for providing destination service Installation kit in obtain destination service ServiceInfo objects;
ServiceInfo objects based on the startup service request information and the destination service, create destination service Mount message.
19th, the device according to 17 or 18, the execution unit also includes:
First memory module, for preserving the destination service mount message in the service management component.
20th, the device according to 17 to 19 any one, the execution unit also includes:
Module is installed, after creating destination service mount message in the creation module, based on the destination service Mount message installation targets are serviced.
21st, the device according to 20, the execution unit also includes:
Second detection module, for according to the destination service mount message, detect to be in the service management component It is no to preserve destination service;
Performing module, for the testing result according to second detection module, in response in the service management component In preserve destination service, call the onStartCommand functions of the destination service;
The installation module, is additionally operable to the testing result according to second detection module, in response in the service pipe Destination service is not preserved in reason component, based on destination service mount message installation targets service.
22nd, the device according to 20 or 21, the installation module, specifically for:
Obtain the Context objects of the plug-in unit that destination service is provided;
Taken using the Context Object Creations target of the plug-in unit for providing destination service based on the destination service mount message Business;
Initialize the destination service.
23rd, the device according to 22, the installation module is utilized based on the destination service mount message and provides target The Context Object Creation destination services of the plug-in unit of service, specifically for:
The Classloader of plug-in unit described in Context object acquisitions from the plug-in unit for providing destination service;
The universal class name of destination service is obtained from the destination service mount message;
Universal class name based on the destination service, the mesh is obtained by reflex mechanism using the Classloader of the plug-in unit Mark the system class object of service;
Called by reflex mechanism the destination service system class newInstance come call constructed fuction create mesh Mark service.
24th, the device according to 22, destination service described in the installation module initialization, specifically for:
The function of the attachBaseContext of the destination service is called by reflex mechanism;
Call the onCreate functions of the destination service.
25th, the device according to 21 to 24 any one, the execution unit also includes:
Second memory module, for preserving the destination service in the service management component.
26th, the device according to 21 to 25 any one, the performing module is additionally operable to be based in the installation module After the destination service mount message installation targets service, the onStartCommand functions of the destination service are called.
27th, a kind of terminal device, including:Processor and memory;Wherein,
The memory is used for the method for storing the startup plug-in services described in 1 to 13 any one;
The processor is used for the method for performing the startup plug-in services.
Each embodiment is described by the way of progressive in this specification, and what each embodiment was stressed is and it The difference of its embodiment, same or analogous part cross-reference between each embodiment.For system embodiment For, because it is substantially corresponding with embodiment of the method, so description is fairly simple, referring to the portion of embodiment of the method in place of correlation Defend oneself bright.
Methods and apparatus of the present invention, equipment may be achieved in many ways.For example, can be by software, hardware, firmware Or any combinations of software, hardware, firmware realize methods and apparatus of the present invention, equipment.The step of for methods described Said sequence be not limited to order described in detail above merely to illustrate, the step of the method for the present invention, unless with Other manner is illustrated.Additionally, in certain embodiments, also the present invention can be embodied as recording journey in the recording medium Sequence, these programs include the machine readable instructions for realizing the method according to the invention.Thus, the present invention also covering storage is used In the recording medium of the program for performing the method according to the invention.
Description of the invention is given for the sake of example and description, and is not exhaustively or by the present invention It is limited to disclosed form.Many modifications and variations are for the ordinary skill in the art obvious.Select and retouch State embodiment and be to more preferably illustrate principle of the invention and practical application, and one of ordinary skill in the art is managed The solution present invention is suitable to the various embodiments with various modifications of special-purpose so as to design.

Claims (10)

1. it is a kind of start plug-in services method, it is characterised in that including:
The startup service request information of client is received by the Binder objects of service management component;
The destination service in process according to where the startup service request information starts the service management component;
Wherein, all services in the process where the service management component manages it, the service management component with it is described Client is operated in different processes.
2. method according to claim 1, it is characterised in that the Binder objects by service management component are received The startup service request information of client, including:
The startService of the AIDL interface objects of the service management component is called according to the startup service request information Function;
Destination service in the process according to where the startup service request information starts the service management component, bag Include:
The service management component core is accessed by the internal class object that the AIDL interfaces are inherited in the service management component The startService functions of heart class;The core classes of wherein described service management component realize the AIDL interfaces.
3. method according to claim 1 and 2, it is characterised in that described to be started according to the startup service request information The destination service in process where the service management component, including:
According to the startup service request information, whether detection preserves destination service in the service management component and installs letter Breath;
If preserving destination service mount message in the service management component, the destination service mount message is obtained;
If not preserving destination service mount message in the service management component, destination service mount message is created.
4. method according to claim 3, it is characterised in that the establishment destination service mount message, including:
According to the startup service request information, whether detection preserves in the service management component and is provided with destination service Plug-in unit;
If preserving the plug-in unit for being provided with destination service in the service management component, destination service is obtained from the plug-in unit ServiceInfo objects;
If not preserving the plug-in unit for being provided with destination service in the service management component, from the peace of the plug-in unit for providing destination service The ServiceInfo objects of destination service are obtained in dress bag;
ServiceInfo objects based on the startup service request information and the destination service, create destination service and install Information.
5. the method according to claim 3 or 4, it is characterised in that after the establishment destination service mount message, also wrap Include:
Based on destination service mount message installation targets service.
6. method according to claim 5, it is characterised in that after the acquisition destination service mount message, also Including:
According to the destination service mount message, whether detection preserves destination service in the service management component;
If preserving destination service in the service management component, the onStartCommand letters of the destination service are called Number;
If not preserving destination service in the service management component, based on destination service mount message installation targets clothes Business.
7. the method according to claim 5 or 6, it is characterised in that described to be installed based on the destination service mount message Destination service, including:
Obtain the Context objects of the plug-in unit that destination service is provided;
The Context Object Creation destination services of the plug-in unit that destination service is provided are utilized based on the destination service mount message;
Initialize the destination service.
8. the method according to claim 6 or 7, it is characterised in that described to be installed based on the destination service mount message After destination service, also include:
Call the onStartCommand functions of the destination service.
9. it is a kind of start plug-in services device, it is characterised in that including:
Receiving unit, the startup service request information of client is received for the Binder objects by service management component;
Execution unit, the mesh in process where for starting the service management component according to the startup service request information Mark service;
Wherein, all services in the process where the service management component manages it, the service management component with it is described Client is operated in different processes.
10. a kind of terminal device, it is characterised in that including:Processor and memory;Wherein,
The memory is used for the method for storing the startup plug-in services described in claim 1 to 8 any one;
The processor is used for the method for performing the startup plug-in services.
CN201710157645.XA 2017-03-16 2017-03-16 Method and device for starting plug-in service and terminal equipment Active CN106933636B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710157645.XA CN106933636B (en) 2017-03-16 2017-03-16 Method and device for starting plug-in service and terminal equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710157645.XA CN106933636B (en) 2017-03-16 2017-03-16 Method and device for starting plug-in service and terminal equipment

Publications (2)

Publication Number Publication Date
CN106933636A true CN106933636A (en) 2017-07-07
CN106933636B CN106933636B (en) 2020-08-18

Family

ID=59433479

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710157645.XA Active CN106933636B (en) 2017-03-16 2017-03-16 Method and device for starting plug-in service and terminal equipment

Country Status (1)

Country Link
CN (1) CN106933636B (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109240843A (en) * 2018-08-10 2019-01-18 青岛海信电器股份有限公司 A kind of application processing method and device
CN109445960A (en) * 2018-10-18 2019-03-08 腾讯科技(深圳)有限公司 Method for routing, device and the storage medium of application
CN109828796A (en) * 2019-01-17 2019-05-31 武汉精立电子技术有限公司 A kind of plug-in unit call method and device based on microkernel architecture
CN110806882A (en) * 2019-11-08 2020-02-18 黎剑猛 Method and system for monitoring plug-in installation

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101188623A (en) * 2006-11-20 2008-05-28 国际商业机器公司 Method and system for dynamic binding door components
CN101978390A (en) * 2008-03-25 2011-02-16 微软公司 Service initiation techniques
US20110227930A1 (en) * 2010-03-22 2011-09-22 Ralph Huchtemann Farminizer software
US20110276950A1 (en) * 2010-05-05 2011-11-10 Microsoft Corporation Name binding extensibility for typed programming language
US20120188595A1 (en) * 2011-01-25 2012-07-26 Joseph Harold Teibel Print specification conversion
CN103246518A (en) * 2013-05-23 2013-08-14 北京邮电大学 Configuration method and device based on service component architecture
CN103632331A (en) * 2013-11-26 2014-03-12 福建四创软件有限公司 Configurable plug-in type data service method
CN103902390A (en) * 2014-03-12 2014-07-02 深圳创维-Rgb电子有限公司 Inter-process communication method based on Android application layer and basis application communication system
CN105354081A (en) * 2015-11-26 2016-02-24 北京奇虎科技有限公司 Synchronous service binding method and apparatus
CN106484461A (en) * 2016-09-13 2017-03-08 北京智能管家科技有限公司 Service keepalive method and device in intelligent terminal

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101188623A (en) * 2006-11-20 2008-05-28 国际商业机器公司 Method and system for dynamic binding door components
CN101978390A (en) * 2008-03-25 2011-02-16 微软公司 Service initiation techniques
US20110227930A1 (en) * 2010-03-22 2011-09-22 Ralph Huchtemann Farminizer software
US20110276950A1 (en) * 2010-05-05 2011-11-10 Microsoft Corporation Name binding extensibility for typed programming language
US20120188595A1 (en) * 2011-01-25 2012-07-26 Joseph Harold Teibel Print specification conversion
CN103246518A (en) * 2013-05-23 2013-08-14 北京邮电大学 Configuration method and device based on service component architecture
CN103632331A (en) * 2013-11-26 2014-03-12 福建四创软件有限公司 Configurable plug-in type data service method
CN103902390A (en) * 2014-03-12 2014-07-02 深圳创维-Rgb电子有限公司 Inter-process communication method based on Android application layer and basis application communication system
CN105354081A (en) * 2015-11-26 2016-02-24 北京奇虎科技有限公司 Synchronous service binding method and apparatus
CN106484461A (en) * 2016-09-13 2017-03-08 北京智能管家科技有限公司 Service keepalive method and device in intelligent terminal

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109240843A (en) * 2018-08-10 2019-01-18 青岛海信电器股份有限公司 A kind of application processing method and device
CN109445960A (en) * 2018-10-18 2019-03-08 腾讯科技(深圳)有限公司 Method for routing, device and the storage medium of application
CN109445960B (en) * 2018-10-18 2021-03-02 腾讯科技(深圳)有限公司 Application routing method, device and storage medium
CN109828796A (en) * 2019-01-17 2019-05-31 武汉精立电子技术有限公司 A kind of plug-in unit call method and device based on microkernel architecture
CN109828796B (en) * 2019-01-17 2022-04-15 武汉精立电子技术有限公司 Plug-in calling method and device based on microkernel architecture
CN110806882A (en) * 2019-11-08 2020-02-18 黎剑猛 Method and system for monitoring plug-in installation

Also Published As

Publication number Publication date
CN106933636B (en) 2020-08-18

Similar Documents

Publication Publication Date Title
CN107908952B (en) Method and device for identifying real machine and simulator and terminal
CN109753276B (en) Control method based on illusion engine and related device
CN107329985B (en) Page collection method and device and mobile terminal
CN103473092B (en) A kind of download the processing method of application, device and terminal unit
CN106775637A (en) The page display method and device of a kind of application program
CN108920220B (en) Function calling method, device and terminal
WO2015035947A1 (en) Method for realizing cellphone without card, cellphone and server
CN108228230A (en) Upgrade method, terminal and the computer readable storage medium of UFS firmwares
CN106502681B (en) A kind of register method of sensor, device and mobile terminal
CN104965722B (en) A kind of method and device of display information
CN106227588A (en) The creation method of a kind of multi-instance object, device and mobile terminal
CN106933636A (en) Start method, device and the terminal device of plug-in services
CN107071180A (en) Desktop customization layout method, mobile terminal and computer-readable recording medium
CN108595203A (en) Application function executes method, mobile terminal and computer readable storage medium
CN106708580A (en) Free-installation application program operating method, system and intelligent terminal
CN107273139A (en) A kind of method for updating system, equipment and computer-readable recording medium
CN106775827A (en) A kind of application program update method and device, computer equipment
CN106201547A (en) Method, device and the mobile terminal that a kind of message based on mobile terminal shows
CN106201748A (en) Method, device and the mobile terminal of a kind of Message Processing based on mobile terminal
CN106843868A (en) Method, device and mobile terminal that a kind of many accounts are logged in
CN107276602A (en) Radio frequency interference processing method, device, storage medium and terminal
CN106959859A (en) The call method and device of system call function
CN108090345A (en) Linux system external command performs method and device
CN106506815A (en) A kind of application enables method and relevant device
CN106407771A (en) Message management method and device

Legal Events

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