WO2016155388A1 - 应用安装、运行方法及装置 - Google Patents

应用安装、运行方法及装置 Download PDF

Info

Publication number
WO2016155388A1
WO2016155388A1 PCT/CN2015/099591 CN2015099591W WO2016155388A1 WO 2016155388 A1 WO2016155388 A1 WO 2016155388A1 CN 2015099591 W CN2015099591 W CN 2015099591W WO 2016155388 A1 WO2016155388 A1 WO 2016155388A1
Authority
WO
WIPO (PCT)
Prior art keywords
plugin
plug
main application
application
main
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.)
Ceased
Application number
PCT/CN2015/099591
Other languages
English (en)
French (fr)
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
Qizhi Software Beijing Co Ltd
Original Assignee
Beijing Qihoo Technology Co Ltd
Qizhi Software Beijing Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Qihoo Technology Co Ltd, Qizhi Software Beijing Co Ltd filed Critical Beijing Qihoo Technology Co Ltd
Publication of WO2016155388A1 publication Critical patent/WO2016155388A1/zh
Anticipated expiration legal-status Critical
Ceased legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/61Installation
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; 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

Definitions

  • the present invention relates to the field of Internet applications, and in particular, to an application installation method and apparatus, and an application operation method and apparatus.
  • Android (Android) system has become one of the most commonly used operating systems for smart terminals due to its openness and compatibility.
  • the organizational structure of the Android system can be easily plugged and functionalized independently because of its good inter-component and inter-application communication mechanisms. However, these mechanisms are limited to installed applications.
  • the present invention has been made in order to provide an application mounting method, an application operating method, and a corresponding apparatus that overcome the above problems or at least partially solve the above problems.
  • an embodiment of the present invention provides an application installation method, including:
  • the main application is installed, wherein the main application can call different plugins according to requirements to implement different auxiliary functions.
  • an embodiment of the present invention further provides an application running method, including:
  • the plug-in corresponding to the selected plug-in identifier is invoked by the main application to implement a corresponding auxiliary function.
  • an embodiment of the present invention further provides an application installation apparatus, including:
  • a function determining module configured to determine, according to requirements, a plurality of types of functions to be implemented, wherein the plurality of types of functions include a primary function and an auxiliary function;
  • a classification configuration module configured to generate a main application for the main function, and generate a separate plug-in for each auxiliary function
  • the installation module is adapted to install the main application, wherein the main application can call different plugins according to requirements to implement different auxiliary functions.
  • an embodiment of the present invention further provides an application running device, including:
  • a startup module configured to open a main application having a main function, wherein the main application can invoke a plug-in having an auxiliary function other than the main function;
  • a selection module configured to select, according to requirements, a plug-in identifier corresponding to the auxiliary function in an interface of the main application
  • the calling module is adapted to use the plug-in corresponding to the selected plug-in identifier by the main application to implement a corresponding auxiliary function.
  • a computer program comprising computer readable code, when the computer readable code is run on a computing device, causing the computing device to perform any of the above described application installation methods, And/or, any of the above application execution methods.
  • a computer readable medium wherein the computer program described above is stored.
  • the functions corresponding to the requirements are divided into two categories, one is a main function implemented by the main application, and the other is an auxiliary function implemented by the plug-in.
  • the main application needs to be installed. If other auxiliary functions are needed, different plug-ins can be called in real time according to requirements by the main application to implement different auxiliary functions. That is, in the embodiment of the present invention, only the main application needs to be installed in an operating system in the form of a separate application, and the remaining plug-ins need not be installed to be used.
  • the main application can implement the corresponding function by calling the plug-in through a certain communication method.
  • the embodiments of the present invention divide the functions corresponding to the requirements, so that the requirements can be developed in a distributed manner, and each auxiliary function is implemented by a plug-in function, which can be directly used as a plug-in for other products, and further improves the practicability of the plug-in. .
  • the main application only the main application is installed, and the corresponding installation package only needs to contain the code and resources necessary for the application, which greatly reduces the application installation data package and can speed up the application installation data package.
  • the download process prevents the user from giving up the download by seeing the application too much, or giving up the download halfway because the download is too slow, which improves the user experience.
  • the plug-in since the plug-in is separated from the main application, the plug-in can be dynamically added, updated, and deleted according to the control command, and the system space can be fully utilized. And it is independent of the update process of the main application, and the update process of each plug-in is independent, thus making the update process more independent, and does not interfere with the update of other plug-ins or main applications.
  • FIG. 1 shows a process flow diagram of an application installation method in accordance with one embodiment of the present invention
  • FIG. 2 is a schematic diagram showing a specific example of an architecture between a main application and a plug-in according to an embodiment of the present invention
  • FIG. 3 is a schematic diagram showing an interface of a plug-in display according to an embodiment of the present invention.
  • FIG. 4 shows a process flow diagram of an application mode of operation in accordance with one embodiment of the present invention
  • FIG. 5 is a schematic diagram showing a main application calling a plurality of plugins according to an embodiment of the present invention
  • FIG. 6 is a schematic diagram showing a flow of implementing a plugin according to an embodiment of the present invention.
  • FIG. 7 is a schematic structural view of an application mounting device according to an embodiment of the present invention.
  • FIG. 8 is a schematic view showing another structure of an application mounting device according to an embodiment of the present invention.
  • FIG. 9 is a schematic structural view of an application running device according to an embodiment of the present invention.
  • Figure 10 is a schematic block diagram of a computing device for performing an application installation method and/or an application execution method in accordance with the present invention
  • Fig. 11 schematically shows a storage unit for holding or carrying program code implementing an application installation method and/or an application execution method according to the present invention.
  • FIG. 1 shows a process flow diagram of an application installation method in accordance with one embodiment of the present invention.
  • the application installation method includes at least steps S102 to S106:
  • Step S102 Determine, according to requirements, a plurality of types of functions to be implemented, where the plurality of types of functions include a primary function and an auxiliary function;
  • Step S104 generating a main application as a main function, and generating a separate plug-in for each auxiliary function;
  • Step S106 Install a main application, wherein the main application can call different plugins according to requirements to implement different auxiliary functions.
  • plug-in mentioned in the embodiment of the present invention is actually an independent application (apk), which internally includes resources and codes, and related android component definitions.
  • the functions corresponding to the requirements are divided into two categories, one is a main function implemented by the main application, and the other is an auxiliary function implemented by the plug-in.
  • the main application needs to be installed. If other auxiliary functions are needed, different plug-ins can be called in real time according to requirements by the main application to implement different auxiliary functions. That is, in the embodiment of the present invention, only the main application needs to be installed in an operating system in the form of a separate application, and the remaining plug-ins need not be installed to be used.
  • the main application can implement the corresponding function by calling the plug-in through a certain communication method.
  • the embodiments of the present invention divide the functions corresponding to the requirements, so that the requirements can be developed in a distributed manner, and each auxiliary function is implemented by a plug-in function, which can be directly used as a plug-in for other products, and further improves the practicability of the plug-in. .
  • the main application only the main application is installed, and the corresponding installation package only needs to contain the code and resources necessary for the application, which greatly reduces the application installation data package and can speed up the application installation data package.
  • the download process prevents the user from giving up the download by seeing the application too much, or giving up the download halfway because the download is too slow, which improves the user experience.
  • the plug-in since the plug-in is separated from the main application, the plug-in can be dynamically added, updated, and deleted according to the control command, and the system space can be fully utilized. And its The update process of the main application is independent, and the update process of each plug-in is independent, thus making the update process more independent, and does not interfere with the update of other plug-ins or main applications.
  • the plug-in may be selectively distinguished from the main application installation manner, for example, each of the auxiliary functions may be displayed in the foreground.
  • Plugins or you can silently load plugins with accessibility in the background.
  • the main application only needs to install the code and resources necessary to run its application.
  • Other functions can dynamically download the silent installation after the main application is installed, so that the application data package can be greatly reduced.
  • the purpose of slimming is to increase the download volume of the application, so that the application can be more widely accepted by users.
  • FIG. 2 shows a schematic diagram of a specific example of an architecture between a main application and a plug-in according to an embodiment of the present invention.
  • the main application is a search app
  • the corresponding auxiliary functions include novels, music, movies, news, skins, and the like.
  • Each auxiliary function exists in a separate plug-in form, and the search app can implement the dynamics of the plug-in through specific calls. load.
  • FIG. 3 shows an interface diagram of a plug-in display in accordance with one embodiment of the present invention. Referring to FIG.
  • auxiliary functions such as a title, news, video, novel, picture, map, application, music, and the like can be dynamically loaded.
  • search app can invoke the novel plug-in to transform into a novel app with functions such as a reader, a bookshelf, a library, and the like.
  • the presentation form of the plug-in in the main application interface includes at least one of the following: a card; a pop-up window; and a scrolling screen.
  • the update of each plug-in is also independent. It is not necessary to update the main application to update the resources of each plug-in.
  • the skin of the app can be dynamically switched through the plugin.
  • Each skin theme can be dynamically loaded and updated as a standalone plugin.
  • the skin library does not need to update the main app. It can flexibly produce various star versions, holiday versions, and even users. Customize skins, share skins, and more.
  • the plug-in may be stored in a different storage space separately from the main application, and the plug-in may be separately stored in the expansion space (for example, an expansion card, an SD card, a TF card), and Dynamic loading, deletion, or updating can be implemented in the extended space.
  • the commands for adding and deleting plug-ins are remotely controlled by the cloud, which further ensures the flexibility of the plug-ins.
  • each plug-in with auxiliary functions is loaded, including two parts, one is to load the plug-in code, and the other is to load the plug-in resource.
  • the plug-in code of each plug-in is loaded by the class loader of the main application, and the plug-in code of each plug-in is loaded into the memory, and the plug-in independent class loader is generated for each plug-in.
  • each plugin resource is loaded correspondingly using the class loader of each plugin.
  • an app can only have one resource object (Resource) and a class loader (ClassLoader) that loads the app code, so the resources and code used throughout the app are the main app. If you want to call the resources and code inside the plugin without limiting the original code structure and logic of the plugin, you must replace the main application's resource object and class loader (mResource, mClassLoader) with the plugin. Resources and class loaders, so plugins can use their own resources and code directly.
  • an embodiment of the present invention further provides an application running method, which is applied to an application installed by using the above application installation method.
  • 4 shows a process flow diagram of an application mode of operation in accordance with one embodiment of the present invention.
  • the application running method at least includes:
  • Step S402 the main application having the main function is enabled, wherein the main application can invoke a plug-in having other auxiliary functions besides the main function;
  • Step S404 selecting, according to requirements, a plug-in identifier corresponding to the auxiliary function in an interface of the main application;
  • Step S406 The plug-in corresponding to the selected plug-in identifier is used by the main application to implement the corresponding auxiliary function.
  • the functions corresponding to the requirements are divided into two categories, one is a main function implemented by the main application, and the other is an auxiliary function implemented by the plug-in.
  • the main application needs to be installed in an operating system in the form of a separate application, and the remaining plug-ins need not be installed to be used.
  • the main application can implement the corresponding function by calling the plug-in through a certain communication method.
  • the embodiments of the present invention divide the functions corresponding to the requirements, so that the requirements can be developed in a distributed manner, and each auxiliary function is implemented by a plug-in function, which can be directly used as a plug-in for other products, and further improves the practicability of the plug-in. .
  • the plug-in since the plug-in is separated from the main application, the plug-in can be dynamically added, updated, and deleted according to the control command, and the system space can be fully utilized. And it is independent of the update process of the main application, and the update process of each plug-in is independent, thus making the update process more independent, and does not interfere with the update of other plug-ins or main applications.
  • the plugin is actually a standalone application. It contains resources and code and related android component definitions. To make the main app call up the plugin, you need to simulate the environment in which the app is running and provide it to the plugin.
  • the key points include: plugin code. And resource loading, plugin resource injection, component hosting, and proxying.
  • plugin code And resource loading, plugin resource injection, component hosting, and proxying.
  • plugin resource injection And resource injection, plugin resource injection, component hosting, and proxying.
  • proxying In addition, in order for the plugin to maintain the original structure and code logic, we need to handle their specific calls: such as this, super call, system component property simulation (launch_mode, intent-filter, etc.).
  • the embodiment of the present invention adopts a processing method for establishing a managed plug-in component in a main application, wherein the managed plug-in component can simulate a non-independent plug-in generated when the same auxiliary function is implemented and embedded in the main application is generated. event. When any event is detected, the managed plug-in component is triggered to forward the event to the event handler function of the dependent plug-in for processing.
  • the managed plugin component is a proxy activity, which can simulate the Activity life cycle and the Activity event.
  • the proxy activity is passed through the reflection call to pass the Activity event to the handler corresponding to the plugin Activity event for processing. That is, define a dedicated proxy Activity (ProxyActivity) in the main app, the Activity is specifically used to proxy the plug-in Activity, simulate the life cycle of the plug-in Activity (onCreate, onStart, etc.) and various events, plug-ins
  • the Activity is created as an ordinary Java object, and the event is passed to the handler of the plugin Activity through a reflection call. The process is transparent to the plugin, and it still implements the logic of the Activity as usual.
  • ProxyActivity is not a real Activity. It does not have a plugin class loader and resources. The proxy activity can only solve the event that the simulation system initiates actively and the component passively receives. When the plugin activity uses the methods provided by the system such as this or super, Such as setContentView, etc., there will inevitably be problems.
  • the embodiment of the present invention defines a very simple plugin implementation specification: all activities used in the plugin must inherit a specific PluginActivity from the plugin sdk.
  • PluginActivity will rewrite the key methods of the system, and forward the calls of the subclass directly to ProxyActiviy. In this way, the more critical methods of the plugin Activity using this or super call will be handled by ProxyActivity, just like it is a real Activity. same.
  • an app can only have one resource object and a class loader that loads the app code, so the resources and code used throughout the app are both the main app. If you want to call the resources and code in the plugin without limiting the original code structure and logic of the plugin, you must force the plugin's resources and class loader into the context of the main application calling each plugin. In the main application to call each plugin.
  • the resource object and the class loader of the context of the main application are replaced by the reflection with the resource object and the class loader of the plugin; the resource object and the class loader of the plugin are respectively loaded by the plugin.
  • a plugin is generally a component of a plugin (Activity, Service, etc.).
  • the present invention is a component of the main application calling plugin, and the plugin is provided to the main application. Context, if the plugin is used directly, it must be wrong. Therefore, this embodiment uses the reflection to replace the resource object and the class loader (mResource, mClassLoader) and other objects in the context with the resources and classes of the plugin. The loader, so that the plugin can use its own resources and code directly.
  • the main application communicates with each plugin by setting a plugin interface on each plugin to implement a call to each plugin.
  • the plugin component provides a plugin interface (IPlugin) to the plugin to help the plugin communicate with the host.
  • the key methods are onLoad(), onCommand(), onLoad() when the plugin is loaded.
  • the plugin can perform some initialization work in the function.
  • onCommand() is called when the plugin receives the command.
  • the plugin can be in the function. Implement the processing of commands.
  • FIG. 5 shows a schematic diagram of a main application invoking a plurality of plugins in accordance with one embodiment of the present invention.
  • the embodiments of the present invention can enable plug-in functions of applications, such as application cards and application modules.
  • Blocks, application skins, etc. can be plug-in independent, so that application development can be distributed synchronously, increasing the value of existing products, and solving the problem of large application size, as well as some small updates also need to update the entire app. Problems, improve user experience and shorten user processes. specifically,
  • Plug-in resources and code dynamic loading solve the problem of plug-in dynamic update, so the plug-in does not need to be included in the installation package of the main app.
  • component proxy and hosting solve the problem of component definition in the plug-in, reduce the coupling between the plug-in and the host.
  • plug-in resources and class loader injection to ensure the original logic and resources of the plug-in, so that the plug-in can be run as a plug-in without major changes.
  • the implementation of the plugin interface provides a mechanism for the plugin to communicate with the host.
  • FIG. 6 shows a schematic diagram of a plug-in implementation flow according to an embodiment of the present invention.
  • the plugin manager manages the plugin, performs preprocessing such as initialization operations and preloading. This process is independent and asynchronous with the startup process of the main app.
  • the plugin call is initiated through the app function interface, and the required plugin is called to the plugin manager.
  • the plugin then launches and loads and displays the new plugin feature interface on the app's function interface.
  • an embodiment of the present invention further provides an application installation device.
  • Figure 7 is a block diagram showing the construction of an application mounting device in accordance with one embodiment of the present invention. Referring to Figure 7, the device includes at least:
  • the function determining module 710 is adapted to determine a plurality of types of functions to be implemented according to requirements, wherein the plurality of types of functions include a primary function and an auxiliary function;
  • the classification configuration module 720 is coupled to the function determination module 710, is adapted to generate a main application for the main function, and generates a separate plug-in for each auxiliary function;
  • the installation module 730 is coupled to the classification configuration module 720 and is adapted to install a main application, wherein the main application can call different plug-ins according to requirements to implement different auxiliary functions.
  • FIG. 8 shows another schematic structural view of an application mounting apparatus according to an embodiment of the present invention.
  • the application installation device may further include:
  • the plug-in loading module 740 is respectively coupled to the configuration module 720 and the installation module 730, and is adapted to display the plug-ins with auxiliary functions in the foreground after the installation of the main application is finished; or to silently load the plug-ins with auxiliary functions in the background. .
  • the plug-in loading module 740 is further configured to:
  • Each plugin resource is loaded correspondingly by the class loader of each plugin.
  • the plugin code and resources of each plugin are loaded to simulate the plugin runtime environment when the plugin is called;
  • the plug-in manager After the plug-in is loaded, the plug-in manager uninitifies and manages the plug-ins.
  • FIG. 9 is a block diagram showing the structure of an application running device according to an embodiment of the present invention.
  • the device includes at least:
  • the startup module 910 is adapted to enable a main application having a main function, wherein the main application can invoke a plug-in having an auxiliary function other than the main function;
  • the selection module 920 is coupled to the startup module 910, and is adapted to select a plug-in identifier corresponding to the auxiliary function according to requirements in an interface of the main application;
  • the calling module 930 is coupled to the selection module 920, and is adapted to use the plug-in corresponding to the selected plug-in identifier by the main application to implement the corresponding auxiliary function.
  • the calling module 930 is further configured to:
  • the managed plugin component can simulate an event generated when a non-independent plugin that implements the same auxiliary function and is embedded in the main application is called;
  • the managed plug-in component When any event is detected, the managed plug-in component is triggered to forward the event to the event handler function of the dependent plug-in for processing.
  • the managed plug-in component is a proxy activity, which can simulate the Activity life cycle and Activity event;
  • the proxy activity is passed through the reflection call to pass the Activity event to the handler corresponding to the plugin Activity event for processing.
  • the hosted plugin component is implemented by the following steps:
  • the call to the subclass is forwarded by the PluginActivity to the managed plugin component.
  • the hosted plugin component is transparent relative to its corresponding plugin.
  • the calling module 930 is further configured to:
  • the resource objects and class loaders of each plug-in are forcibly injected into the context used by the main application to call each plug-in for the main application to call each plug-in.
  • the calling module 930 is further configured to:
  • the resource object and the class loader of the context of the main application are replaced by the reflection with the resource object and the class loader of the plugin;
  • the resource object and code of the plugin are respectively loaded by the resource object and the class loader of the plugin, and the auxiliary function of the plugin is executed.
  • the functions corresponding to the requirements are divided into two categories, one is a main function implemented by the main application, and the other is an auxiliary function implemented by the plug-in.
  • the main application needs to be installed. If other auxiliary functions are needed, different plug-ins can be called in real time according to requirements by the main application to implement different auxiliary functions. That is, in the embodiment of the present invention, only the main application needs to be installed in an operating system in the form of a separate application, and the remaining plug-ins need not be installed to be used.
  • the main application can realize the phase by calling the plug-in through a certain communication method. The function should be.
  • the embodiments of the present invention divide the functions corresponding to the requirements, so that the requirements can be developed in a distributed manner, and each auxiliary function is implemented by a plug-in function, which can be directly used as a plug-in for other products, and further improves the practicability of the plug-in. .
  • the main application only the main application is installed, and the corresponding installation package only needs to contain the code and resources necessary for the application, which greatly reduces the application installation data package and can speed up the application installation data package.
  • the download process prevents the user from giving up the download by seeing the application too much, or giving up the download halfway because the download is too slow, which improves the user experience.
  • the plug-in since the plug-in is separated from the main application, the plug-in can be dynamically added, updated, and deleted according to the control command, and the system space can be fully utilized. And it is independent of the update process of the main application, and the update process of each plug-in is independent, thus making the update process more independent, and does not interfere with the update of other plug-ins or main applications.
  • modules in the devices of the embodiments can be adaptively changed and placed in one or more devices different from the embodiment.
  • the modules or units or components of the embodiments may be combined into one module or unit or component, and further they may be divided into a plurality of sub-modules or sub-units or sub-components.
  • any combination of the features disclosed in the specification, including the accompanying claims, the abstract and the drawings, and any methods so disclosed, or All processes or units of the device are combined.
  • Each feature disclosed in this specification (including the accompanying claims, the abstract and the drawings) may be replaced by alternative features that provide the same, equivalent or similar purpose.
  • the various component embodiments of the present invention may be implemented in hardware, or in a software module running on one or more processors, or in a combination thereof.
  • a microprocessor or digital signal processor may be used in practice to implement some or all of the functionality of some or all of the application mounting devices, application operating devices, in accordance with embodiments of the present invention.
  • the invention may also be embodied as a device or device program (eg, a computer program and a computer) for performing some or all of the methods described herein. Program product).
  • Such a program implementing the invention may be stored on a computer readable medium or may be in the form of one or more signals. Such signals may be downloaded from an Internet website, provided on a carrier signal, or provided in any other form.
  • Figure 10 illustrates a computing device that can implement an application installation method and/or an application operation method in accordance with the present invention.
  • the computing device conventionally includes a processor 1010 and a computer program product or computer readable medium in the form of a memory 1020.
  • the memory 1020 may be an electronic memory such as a flash memory, an EEPROM (Electrically Erasable Programmable Read Only Memory), an EPROM, a hard disk, or a ROM.
  • the memory 1020 has a memory space 1030 for executing program code 1031 of any of the above method steps.
  • storage space 1030 for program code may include various program code 1031 for implementing various steps in the above methods, respectively.
  • the program code can be read from or written to one or more computer program products.
  • Such computer program products include program code carriers such as hard disks, compact disks (CDs), memory cards or floppy disks.
  • Such a computer program product is typically a portable or fixed storage unit as described with reference to FIG.
  • the storage unit may have storage segments, storage spaces, and the like that are similarly arranged to memory 1020 in the computing device of FIG.
  • the program code can be compressed, for example, in an appropriate form.
  • the storage unit includes computer readable code 1031', ie, code that can be read by, for example, a processor such as 1010, which when executed by a computing device causes the computing device to perform each of the methods described above step.

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)

Abstract

本发明提供了一种应用安装、运行方法及装置。其中,应用安装方法,包括:根据需求确定需实现的多类功能,其中,所述多类功能包括主功能和辅助功能;为所述主功能生成主应用,以及,为各类辅助功能生成独立的插件;安装所述主应用,其中,所述主应用能够根据需求调用不同的插件,以实现不同的辅助功能。采用本发明能够将主应用与辅助应用的插件独立出来,从而缩小安装包,加速安装速度,减小对系统空间的占用。

Description

应用安装、运行方法及装置 技术领域
本发明涉及互联网应用领域,特别是涉及一种应用安装方法及装置,以及一种应用运行方法及装置。
背景技术
安卓(Android)系统因其开放性、兼容性等特性已经成为目前智能终端最常用的操作系统之一。Android系统的组织架构因其拥有很好的组件间以及应用间通信的机制,可以很方便的将应用插件化、功能独立化。但是,这些机制仅限于已安装的应用。
目前,Android系统中传统的插件化技术规定,每个插件都需要以独立应用的形式安装在用户的操作系统中。但是,如果每个插件都需要安装才能使用,随着用户需求的增加以及网络本身的发展,操作系统需要安装的插件越来越多,随着插件的增长,应用数会逐渐增多,占用大量的资源,容易造成操作系统运行缓慢甚至过载。
发明内容
鉴于上述问题,提出了本发明以便提供一种克服上述问题或者至少部分地解决上述问题的应用安装方法、应用运行方法和相应的装置。
基于本发明的一个方面,本发明实施例提供了一种应用安装方法,包括:
根据需求确定需实现的多类功能,其中,所述多类功能包括主功能和辅助功能;
为所述主功能生成主应用,以及,为各类辅助功能生成独立的插件;
安装所述主应用,其中,所述主应用能够根据需求调用不同的插件,以实现不同的辅助功能。
基于本发明的另一个方面,本发明实施例还提供了一种应用运行方法,包括:
开启具备主功能的主应用,其中,所述主应用能够调用具备除所述主功能外的其他辅助功能的插件;
在所述主应用的界面中根据需求选择辅助功能对应的插件标识;
利用所述主应用调用选择的插件标识所对应的插件,以实现对应的辅助功能。
基于本发明的又一个方面,本发明实施例还提供了一种应用安装装置,包括:
功能确定模块,适于根据需求确定需实现的多类功能,其中,所述多类功能包括主功能和辅助功能;
分类配置模块,适于为所述主功能生成主应用,以及,为各类辅助功能生成独立的插件;
安装模块,适于安装所述主应用,其中,所述主应用能够根据需求调用不同的插件,以实现不同的辅助功能。
基于本发明的又一个方面,本发明实施例还提供了一种应用运行装置,包括:
启动模块,适于开启具备主功能的主应用,其中,所述主应用能够调用具备除所述主功能外的其他辅助功能的插件;
选择模块,适于在所述主应用的界面中根据需求选择辅助功能对应的插件标识;
调用模块,适于利用所述主应用调用选择的插件标识所对应的插件,以实现对应的辅助功能。
根据本发明的又一个方面,提供了一种计算机程序,其包括计算机可读代码,当所述计算机可读代码在计算设备上运行时,导致所述计算设备执行任一个上述的应用安装方法,和/或,任一个上述的应用运行方法。
根据本发明的再一个方面,提供了一种计算机可读介质,其中存储了上述的计算机程序。
在本发明实施例中,将需求对应的功能分为两类,一类是由主应用实现的主功能,另一类是通过插件实现的辅助功能。在本发明实施例中,只需要安装主应用,若需要其他辅助功能,则可以通过主应用根据需求实时调用不同的插件,以实现不同的辅助功能。即,在本发明实施例中,仅主应用需要以独立应用的形式安装的操作系统中,其余插件并不需要安装才能够使用。在实施时,主应用通过一定的通信方式调用插件即能实现相应的功能。另外,本发明实施例将需求对应的功能进行划分,使得各需求可以分散同步进行开发,每个辅助功能以插件功能实现,可直接作为其他产品的插件,重复使用,进一步提高了插件的实用性。另外,在主应用的安装过程中,因此仅仅安装主应用,其对应的安装包仅需要包含其应用所必须的代码和资源即可,大幅度缩小了应用安装数据包,能够加快应用安装数据包的下载过程,避免用户因看到应用太大直接放弃下载,或者因下载过慢而中途放弃下载,提高了用户的感受体验。进一步,因插件与主应用分隔开,那么插件可以根据控制命令动态地添加、更新、删除,可以充分利用系统空间。且其与主应用的更新过程是独立的,且每个插件的更新过程均是独立的,因此使得更新过程更为独立化,与其他插件或主应用的更新互不干扰。
上述说明仅是本发明技术方案的概述,为了能够更清楚了解本发明的技术手段,而可依照说明书的内容予以实施,并且为了让本发明的上述和其它目的、特征和优点能够更明显易懂,以下特举本发明的具体实施方式。
附图说明
通过阅读下文优选实施方式的详细描述,各种其他的优点和益处对于本领域普通技术人员将变得清楚明了。附图仅用于示出优选实施方式的目的,而并不认为是对本发明的限制。而且在整个附图中,用相同的参考符号表示相同的部件。在附图中:
图1示出了根据本发明一个实施例的应用安装方法的处理流程图;
图2示出了根据本发明一个实施例的主应用与插件间的架构的具体实例的示意图;
图3示出了根据本发明一个实施例的插件显示的界面示意图;
图4示出了根据本发明一个实施例的应用运行方式的处理流程图;
图5示出了根据本发明一个实施例的主应用调用多个插件的示意图;
图6示出了根据本发明一个实施例的插件实现流程的示意图;
图7示出了根据本发明一个实施例的应用安装装置的一种结构示意图;
图8示出了根据本发明一个实施例的应用安装装置的另一种结构示意图;
图9示出了根据本发明一个实施例的应用运行装置的一种结构示意图;
图10示意性地示出了用于执行根据本发明的应用安装方法和/或应用执行方法的计算设备的框图;以及
图11示意性地示出了用于保持或者携带实现根据本发明的应用安装方法和/或应用执行方法的程序代码的存储单元。
具体实施方式
下面结合附图和具体的实施方式对本发明作进一步的描述。
为解决上述技术问题,本发明实施例提供了一种新的应用安装方法。图1示出了根据本发明一个实施例的应用安装方法的处理流程图。参见图1,该应用安装方法至少包括步骤S102至步骤S106:
步骤S102、根据需求确定需实现的多类功能,其中,多类功能包括主功能和辅助功能;
步骤S104、为主功能生成主应用,以及,为各类辅助功能生成独立的插件;
步骤S106、安装主应用,其中,主应用能够根据需求调用不同的插件,以实现不同的辅助功能。
需要说明地是,本发明实施例提及的插件实际上也是一个独立的应用(apk),其内部包括资源和代码,以及相关的android组件定义等。
在本发明实施例中,将需求对应的功能分为两类,一类是由主应用实现的主功能,另一类是通过插件实现的辅助功能。在本发明实施例中,只需要安装主应用,若需要其他辅助功能,则可以通过主应用根据需求实时调用不同的插件,以实现不同的辅助功能。即,在本发明实施例中,仅主应用需要以独立应用的形式安装的操作系统中,其余插件并不需要安装才能够使用。在实施时,主应用通过一定的通信方式调用插件即能实现相应的功能。另外,本发明实施例将需求对应的功能进行划分,使得各需求可以分散同步进行开发,每个辅助功能以插件功能实现,可直接作为其他产品的插件,重复使用,进一步提高了插件的实用性。另外,在主应用的安装过程中,因此仅仅安装主应用,其对应的安装包仅需要包含其应用所必须的代码和资源即可,大幅度缩小了应用安装数据包,能够加快应用安装数据包的下载过程,避免用户因看到应用太大直接放弃下载,或者因下载过慢而中途放弃下载,提高了用户的感受体验。进一步,因插件与主应用分隔开,那么插件可以根据控制命令动态地添加、更新、删除,可以充分利用系统空间。且其与 主应用的更新过程是独立的,且每个插件的更新过程均是独立的,因此使得更新过程更为独立化,与其他插件或主应用的更新互不干扰。
在本发明实施例中,当步骤S106执行之后,即在主应用安装结束之后,可以选择性地对插件进行区别于主应用的安装方式,例如,可以在前台显示性地加载具备辅助功能的各插件,或者,也可以在后台静默加载具备辅助功能的各插件。将各辅助功能插件化后,主应用只需要安装运行其应用所必须的代码和资源即可,其他功能可以在主应用安装之后动态下载静默安装,使得应用数据包可大幅度的缩小,从而实现了应用瘦身这一目的,提高了应用的下载量,使得应用能够更广泛地被用户接受。
进一步,将辅助功能插件化之后,主应用将拥有完全的本地化体验(例如音乐、视频、小说、新闻、扫码等等)。图2示出了根据本发明一个实施例的主应用与插件间的架构的具体实例的示意图。参见图2,主应用为搜索app,其对应的多种辅助功能包括小说、音乐、影视、新闻、皮肤等等,各辅助功能以单独的插件形式存在,搜索app可通过具体调用实现插件的动态加载。图3示出了根据本发明一个实施例的插件显示的界面示意图。参见图3,在搜索应用中,可动态加载拍题、新闻、视频、小说、图片、地图、应用、音乐等多种辅助功能。举个例子,当用户搜索小说(包括与小说相关的关键字,如书名、作者等)时,搜索app可调用小说插件,从而变身小说app,具有阅读器、书架、书库等功能。其中,插件在主应用界面中的呈现形式包括下列至少之一:卡片;弹窗;滚屏。
因插件的独立性,各插件的更新也是独立的,更新各插件的资源无须更新主应用。例如,应用的皮肤可通过插件动态切换,每个皮肤主题可作为一个独立的插件动态加载和更新,更新皮肤库不需要更新主应用,可灵活的制作各种明星版、节日版,甚至用户可以自定义皮肤、分享皮肤等等。
值得说明地是,采用本发明实施例提供的应用安装方法,插件可与主应用分别存储在不同的存储空间,插件可单独存储在扩展空间中(例如扩展卡,SD卡、TF卡),并且可在扩展空间中实现动态加载、删除或更新。其中,增删插件的命令由云端远程控制,进一步保证了插件的灵活性。
其中,加载具备辅助功能的各插件,包括两部分,一部分是加载插件代码,另一部分是加载插件资源。在本发明实施例中,利用主应用的类加载器加载各插件的插件代码,进而将各插件的插件代码加载到内存中,为各插件生成本插件独立的类加载器。随后,利用各插件的类加载器对应加载各插件资源。
通常情况下,一个app只能拥有一个资源对象(Resource)和一个加载app代码的类加载器(ClassLoader),所以在app各处使用的资源和代码都是主app的。如果要在不限定条件不破坏插件原有代码结构和逻辑的情况下调用插件里面的资源和代码,那么就必须将主应用的资源对象和类加载器(mResource、mClassLoader)等对象替换为插件的资源和类加载器,这样,插件就可以直接使用自己的资源和代码了。
要让主app调起插件,则需要模拟一个app运行的环境提供给插件运行,因此,各 插件的插件代码和资源被加载后用于在插件被调用时模拟插件运行环境;以及,各插件加载结束后,由插件管理器对插件进行统一命名以及管理。
基于同一发明构思,本发明实施例还提供了一种应用运行方法,应用于采用上述应用安装方法安装的应用。图4示出了根据本发明一个实施例的应用运行方式的处理流程图。参见图4,应用运行方法至少包括:
步骤S402、开启具备主功能的主应用,其中,主应用能够调用具备除主功能外的其他辅助功能的插件;
步骤S404、在主应用的界面中根据需求选择辅助功能对应的插件标识;
步骤S406、利用主应用调用选择的插件标识所对应的插件,以实现对应的辅助功能。
在本发明实施例中,将需求对应的功能分为两类,一类是由主应用实现的主功能,另一类是通过插件实现的辅助功能。在本发明实施例中,仅主应用需要以独立应用的形式安装的操作系统中,其余插件并不需要安装才能够使用。在实施时,主应用通过一定的通信方式调用插件即能实现相应的功能。另外,本发明实施例将需求对应的功能进行划分,使得各需求可以分散同步进行开发,每个辅助功能以插件功能实现,可直接作为其他产品的插件,重复使用,进一步提高了插件的实用性。进一步,因插件与主应用分隔开,那么插件可以根据控制命令动态地添加、更新、删除,可以充分利用系统空间。且其与主应用的更新过程是独立的,且每个插件的更新过程均是独立的,因此使得更新过程更为独立化,与其他插件或主应用的更新互不干扰。
插件实际上是一个独立的应用,它内部包含资源和代码以及相关的android组件定义等,要让主app调起插件,则需要模拟一个app运行的环境提供给插件运行,其中重点包括:插件代码和资源的加载、插件资源注入、组件托管和代理。另外为让插件保持原有的结构和代码逻辑,我们需要处理他们的特定调用:如this、super调用、系统组件属性模拟(launch_mode、intent-filter等)。
首先,利用主应用调用插件。Android中大部分组件是需要注册在apk的Androidmanifest.xml中才能被系统正常调用的(如Activity、Service等),而本发明实施例中的插件并没有安装,此时它的组件是没有向系统注册的,app无法像使用传统的组件那样调起它。要使用插件中的组件,就必须解决这个问题。为解决这一问题,本发明实施例采用在主应用中建立托管插件组件的处理方法,其中,托管插件组件能够模拟实现同一辅助功能、且嵌入到主应用中的非独立插件被调用时所产生事件。当监测到任一事件发生时,托管插件组件被触发将发生的事件转至非独立插件具备的事件处理函数中进行处理。
以活动(Activity)为例,当插件为活动Activity时,托管插件组件为代理Activity,能够模拟Activity生命周期和Activity事件。当Activity事件发生时,代理Activity通过反射调用将Activity事件传递到插件Activity事件对应的处理函数中进行处理。即,在主app中定义一个专用的代理Activity(ProxyActivity),该Activity专门用来代理插件的Activity,模拟实现插件Activity的生命周期(onCreate、onStart等)和各种事件,插件 Activity作为一个普通的java对象创建,事件通过反射调用传递到插件Activity对于的处理函数中,该过程对于插件来说是透明,它还是照常实现Activity的逻辑。
ProxyActivity不是真正的Activity,它没有插件的类加载器和资源,代理Activity能解决的只是模拟系统主动发起,组件被动接收的事件,当插件Activity使用例如this或者super等主动调用系统提供的方法时(如setContentView等),必然会出现问题。
为了解决此问题,本发明实施例定义了一个非常简单的插件实现规范:插件中使用的所有Activity必须继承自插件sdk中一个特定的PluginActivity。在插件架构良好,大部分同类Activity都有统一的父类的情况下,只需要将这些父类的父类替换为PluginActivity即可。PluginActivity会重写系统的关键方法,将子类的调用直接转发给ProxyActiviy,这样,插件Activity使用this或者super调用的比较关键的方法,都将被ProxyActivity所处理,就像它自己就是一个真实的Activity一样。
通常情况下,一个app只能拥有一个资源对象和一个加载app代码的类加载器,所以在app各处使用的资源和代码都是主app的。如果要在不限定条件不破坏插件原有代码结构和逻辑的情况下调用插件里面的资源和代码,那么就必须将插件的资源和类加载器强行注入到主应用调用各插件所使用的上下文环境中,以供主应用调用各插件。
具体地,当主应用调用一个插件时,利用反射将主应用的上下文的资源对象和类加载器替换为该插件的资源对象和类加载器;利用该插件的资源对象和类加载器分别加载插件的资源和代码,执行插件的辅助功能。当呼起一个插件时,一般情况下是调起一个插件的组件(Activity、Service等),前面提到过,本发明是主应用调用插件的组件,这时提供给插件使用的是主应用的上下文(context),如果插件直接使用它必然出错,因此,本实施例在使用之前强行的利用反射将该context中的资源对象和类加载器(mResource、mClassLoader)等对象替换为插件的资源和类加载器,这样,插件就可以直接使用自己的资源和代码了。
因主应用同时与多个插件存在互动关系,因此,主应用通过设置各插件上的插件接口与各插件进行通信,以实现对各插件的调用。例如,插件组件给插件提供了一个插件接口(IPlugin),可以帮助插件与宿主通信。关键方法为onLoad()、onCommand(),onLoad()在插件被加载时调用,插件可在该函数中进行一些初始化工作,onCommand()在插件接收到命令时被调用,插件可以在该函数中实现命令的处理。
当主应用同时调用多个插件时,当其中任一个插件发出命令时,插件管理器接收命令并将命令分发至插件管理器管理的所有插件,其中,对命令感兴趣的插件对其进行处理,产生应答结果;插件管理器接收对命令的应答结果,并将其返回至发出命令的插件。即可以在插件中定义一个统一的规范,当插件发出一个命令时,插件管理器将命令分发给所有的插件,插件只需在接口类的应答(onCommand)中处理自己感兴趣的命令即可,命令的传递使用系统的Intent类封装,这样即保证了插件间不存在依赖性,又避免了插件代码的依赖。图5示出了根据本发明一个实施例的主应用调用多个插件的示意图。
根据上文的描述可知,本发明实施例可使应用的功能插件化,如应用卡片、应用模 块、应用皮肤等均可插件化独立化,从而使得应用的开发可以分散的同步进行,提高了现有产品的价值,并解决了应用体积大的问题,以及某些小的更新也需要更新整个app的问题,提高用户体验,缩短用户流程。具体地,
1、插件资源和代码动态加载解决了插件动态更新的问题,这样插件不需要包含在主app的安装包中。
2、组件代理和托管,解决了插件中组件定义的问题,降低插件与宿主的耦合性。
3、插件资源和类加载器的注入,保证了插件原有逻辑和资源,使插件无需做大改动就可作为插件运行。
4、插件中this、super的调用处理,保证插件代码完整的运行。
5、插件间的互相调用实现,可以让插件间无依赖性,并可互相调起。
6、插件接口的实现给插件提供了一种与宿主通信的机制。
图6示出了根据本发明一个实施例的插件实现流程的示意图。参见图6,插件管理器对插件进行管理,进行初始化操作和预加载等预处理。该处理过程与主app的启动过程是独立的、异步的。当主app初始化结束后,通过app功能界面发起插件调用,到插件管理器处调用需要的插件。随后,插件启动,并在app功能界面上加载并显示新的插件功能界面。
基于同一发明构思,本发明实施例还提供了一种应用安装装置。图7示出了根据本发明一个实施例的应用安装装置的一种结构示意图。参见图7,该装置至少包括:
功能确定模块710,适于根据需求确定需实现的多类功能,其中,多类功能包括主功能和辅助功能;
分类配置模块720,与功能确定模块710耦合,适于为主功能生成主应用,以及,为各类辅助功能生成独立的插件;
安装模块730,与分类配置模块720耦合,适于安装主应用,其中,主应用能够根据需求调用不同的插件,以实现不同的辅助功能。
图8示出了根据本发明一个实施例的应用安装装置的另一种结构示意图。在一个优选的实施例中,参见图7,应用安装装置还可以包括:
插件加载模块740,分别分类配置模块720以及安装模块730耦合,适于在主应用安装结束之后,在前台显示性地加载具备辅助功能的各插件;或者,在后台静默加载具备辅助功能的各插件。
在一个优选的实施例中,插件加载模块740还用于:
利用主应用的类加载器加载各插件的插件代码;
将各插件的插件代码加载到内存中,为各插件生成本插件独立的类加载器;
利用各插件的类加载器对应加载各插件资源。
在一个优选的实施例中,
各插件的插件代码和资源被加载后用于在插件被调用时模拟插件运行环境;以及
各插件加载结束后,由插件管理器对插件进行统一命名以及管理。
基于同一发明构思,本发明实施例还提供了一种应用运行装置。图9示出了根据本发明一个实施例的应用运行装置的一种结构示意图。参见图9,该装置至少包括:
启动模块910,适于开启具备主功能的主应用,其中,主应用能够调用具备除主功能外的其他辅助功能的插件;
选择模块920,与启动模块910耦合,适于在主应用的界面中根据需求选择辅助功能对应的插件标识;
调用模块930,与选择模块920耦合,适于利用主应用调用选择的插件标识所对应的插件,以实现对应的辅助功能。
在一个优选的实施例中,调用模块930还用于:
在主应用中建立托管插件组件,其中,托管插件组件能够模拟实现同一辅助功能、且嵌入到主应用中的非独立插件被调用时所产生事件;
当监测到任一事件发生时,托管插件组件被触发将发生的事件转至非独立插件具备的事件处理函数中进行处理。
在一个优选的实施例中,当插件为活动Activity时,
托管插件组件为代理Activity,能够模拟Activity生命周期和Activity事件;
当Activity事件发生时,代理Activity通过反射调用将Activity事件传递到插件Activity事件对应的处理函数中进行处理。
在一个优选的实施例中,托管插件组件通过如下步骤实现:
统一插件架构中同类Activity的父类;
将统一的父类替换为特定的PluginActivity;
当子类被调用时,由PluginActivity将子类的调用转发至托管插件组件。
在一个优选的实施例中,托管插件组件相对于其对应的插件是透明的。
在一个优选的实施例中,调用模块930还用于:
将各插件的资源对象和类加载器强行注入到主应用调用各插件所使用的上下文环境中,以供主应用调用各插件。
在一个优选的实施例中,调用模块930还用于:
当主应用调用一个插件时,利用反射将主应用的上下文的资源对象和类加载器替换为该插件的资源对象和类加载器;
利用该插件的资源对象和类加载器分别加载插件的资源和代码,执行插件的辅助功能。
采用本发明实施例提供的方法及装置,能够达到如下区别技术特征:
在本发明实施例中,将需求对应的功能分为两类,一类是由主应用实现的主功能,另一类是通过插件实现的辅助功能。在本发明实施例中,只需要安装主应用,若需要其他辅助功能,则可以通过主应用根据需求实时调用不同的插件,以实现不同的辅助功能。即,在本发明实施例中,仅主应用需要以独立应用的形式安装的操作系统中,其余插件并不需要安装才能够使用。在实施时,主应用通过一定的通信方式调用插件即能实现相 应的功能。另外,本发明实施例将需求对应的功能进行划分,使得各需求可以分散同步进行开发,每个辅助功能以插件功能实现,可直接作为其他产品的插件,重复使用,进一步提高了插件的实用性。另外,在主应用的安装过程中,因此仅仅安装主应用,其对应的安装包仅需要包含其应用所必须的代码和资源即可,大幅度缩小了应用安装数据包,能够加快应用安装数据包的下载过程,避免用户因看到应用太大直接放弃下载,或者因下载过慢而中途放弃下载,提高了用户的感受体验。进一步,因插件与主应用分隔开,那么插件可以根据控制命令动态地添加、更新、删除,可以充分利用系统空间。且其与主应用的更新过程是独立的,且每个插件的更新过程均是独立的,因此使得更新过程更为独立化,与其他插件或主应用的更新互不干扰。
在此处所提供的说明书中,说明了大量具体细节。然而,能够理解,本发明的实施例可以在没有这些具体细节的情况下实践。在一些实例中,并未详细示出公知的方法、结构和技术,以便不模糊对本说明书的理解。
类似地,应当理解,为了精简本公开并帮助理解各个发明方面中的一个或多个,在上面对本发明的示例性实施例的描述中,本发明的各个特征有时被一起分组到单个实施例、图、或者对其的描述中。然而,并不应将该公开的方法解释成反映如下意图:即所要求保护的本发明要求比在每个权利要求中所明确记载的特征更多的特征。更确切地说,如下面的权利要求书所反映的那样,发明方面在于少于前面公开的单个实施例的所有特征。因此,遵循具体实施方式的权利要求书由此明确地并入该具体实施方式,其中每个权利要求本身都作为本发明的单独实施例。
本领域那些技术人员可以理解,可以对实施例中的设备中的模块进行自适应性地改变并且把它们设置在与该实施例不同的一个或多个设备中。可以把实施例中的模块或单元或组件组合成一个模块或单元或组件,以及此外可以把它们分成多个子模块或子单元或子组件。除了这样的特征和/或过程或者单元中的至少一些是相互排斥之外,可以采用任何组合对本说明书(包括伴随的权利要求、摘要和附图)中公开的所有特征以及如此公开的任何方法或者设备的所有过程或单元进行组合。除非另外明确陈述,本说明书(包括伴随的权利要求、摘要和附图)中公开的每个特征可以由提供相同、等同或相似目的的替代特征来代替。
此外,本领域的技术人员能够理解,尽管在此所述的一些实施例包括其它实施例中所包括的某些特征而不是其它特征,但是不同实施例的特征的组合意味着处于本发明的范围之内并且形成不同的实施例。例如,在下面的权利要求书中,所要求保护的实施例的任意之一都可以以任意的组合方式来使用。
本发明的各个部件实施例可以以硬件实现,或者以在一个或者多个处理器上运行的软件模块实现,或者以它们的组合实现。本领域的技术人员应当理解,可以在实践中使用微处理器或者数字信号处理器(DSP)来实现根据本发明实施例的应用安装装置、应用运行装置中的一些或者全部部件的一些或者全部功能。本发明还可以实现为用于执行这里所描述的方法的一部分或者全部的设备或者装置程序(例如,计算机程序和计算机 程序产品)。这样的实现本发明的程序可以存储在计算机可读介质上,或者可以具有一个或者多个信号的形式。这样的信号可以从因特网网站上下载得到,或者在载体信号上提供,或者以任何其他形式提供。
例如,图10示出了可以实现根据本发明的应用安装方法和/或应用运行方法的计算设备。该计算设备传统上包括处理器1010和以存储器1020形式的计算机程序产品或者计算机可读介质。存储器1020可以是诸如闪存、EEPROM(电可擦除可编程只读存储器)、EPROM、硬盘或者ROM之类的电子存储器。存储器1020具有用于执行上述方法中的任何方法步骤的程序代码1031的存储空间1030。例如,用于程序代码的存储空间1030可以包括分别用于实现上面的方法中的各种步骤的各个程序代码1031。这些程序代码可以从一个或者多个计算机程序产品中读出或者写入到这一个或者多个计算机程序产品中。这些计算机程序产品包括诸如硬盘,紧致盘(CD)、存储卡或者软盘之类的程序代码载体。这样的计算机程序产品通常为如参考图11所述的便携式或者固定存储单元。该存储单元可以具有与图10的计算设备中的存储器1020类似布置的存储段、存储空间等。程序代码可以例如以适当形式进行压缩。通常,存储单元包括计算机可读代码1031’,即可以由例如诸如1010之类的处理器读取的代码,这些代码当由计算设备运行时,导致该计算设备执行上面所描述的方法中的各个步骤。
本文中所称的“一个实施例”、“实施例”或者“一个或者多个实施例”意味着,结合实施例描述的特定特征、结构或者特性包括在本发明的至少一个实施例中。此外,请注意,这里“在一个实施例中”的词语例子不一定全指同一个实施例。
应该注意的是上述实施例对本发明进行说明而不是对本发明进行限制,并且本领域技术人员在不脱离所附权利要求的范围的情况下可设计出替换实施例。在权利要求中,不应将位于括号之间的任何参考符号构造成对权利要求的限制。单词“包含”不排除存在未列在权利要求中的元件或步骤。位于元件之前的单词“一”或“一个”不排除存在多个这样的元件。本发明可以借助于包括有若干不同元件的硬件以及借助于适当编程的计算机来实现。在列举了若干装置的单元权利要求中,这些装置中的若干个可以是通过同一个硬件项来具体体现。单词第一、第二、以及第三等的使用不表示任何顺序。可将这些单词解释为名称。
此外,还应当注意,本说明书中使用的语言主要是为了可读性和教导的目的而选择的,而不是为了解释或者限定本发明的主题而选择的。因此,在不偏离所附权利要求书的范围和精神的情况下,对于本技术领域的普通技术人员来说许多修改和变更都是显而易见的。对于本发明的范围,对本发明所做的公开是说明性的,而非限制性的,本发明的范围由所附权利要求书限定。

Claims (31)

  1. 一种应用安装方法,包括:
    根据需求确定需实现的多类功能,其中,所述多类功能包括主功能和辅助功能;
    为所述主功能生成主应用,以及,为各类辅助功能生成独立的插件;
    安装所述主应用,其中,所述主应用能够根据需求调用不同的插件,以实现不同的辅助功能。
  2. 根据权利要求1所述的方法,其中,在所述主应用安装结束之后,还包括:
    在前台显示性地加载具备辅助功能的各插件;或者
    在后台静默加载具备辅助功能的各插件。
  3. 根据权利要求2所述的方法,其中,所述加载具备辅助功能的各插件,包括:
    利用所述主应用的类加载器加载各插件的插件代码;
    将各插件的所述插件代码加载到内存中,为各插件生成本插件独立的类加载器;
    利用各插件的类加载器对应加载各插件资源。
  4. 根据权利要求3所述的方法,其中,
    各插件的插件代码和资源被加载后用于在插件被调用时模拟插件运行环境;以及
    各插件加载结束后,由插件管理器对插件进行统一命名以及管理。
  5. 一种应用运行方法,包括:
    开启具备主功能的主应用,其中,所述主应用能够调用具备除所述主功能外的其他辅助功能的插件;
    在所述主应用的界面中根据需求选择辅助功能对应的插件标识;
    利用所述主应用调用选择的插件标识所对应的插件,以实现对应的辅助功能。
  6. 根据权利要求5所述的方法,其中,利用所述主应用调用插件,包括:
    在所述主应用中建立托管插件组件,其中,所述托管插件组件能够模拟实现同一辅助功能、且嵌入到主应用中的非独立插件被调用时所产生事件;
    当监测到任一事件发生时,所述托管插件组件被触发将发生的事件转至所述非独立插件具备的事件处理函数中进行处理。
  7. 根据权利要求6所述的方法,其中,当所述插件为活动Activity时,
    所述托管插件组件为代理Activity,能够模拟Activity生命周期和Activity事件;
    当Activity事件发生时,所述代理Activity通过反射调用将Activity事件传递到插件Activity事件对应的处理函数中进行处理。
  8. 根据权利要求7所述的方法,其中,所述托管插件组件通过如下步骤实现:
    统一插件架构中同类Activity的父类;
    将统一的父类替换为特定的PluginActivity;
    当子类被调用时,由所述PluginActivity将子类的调用转发至所述托管插件组件。
  9. 根据权利要求6至8任一项所述的方法,其中,所述托管插件组件相对于其对应 的插件是透明的。
  10. 根据权利要求5至9任一项所述的方法,其中,利用所述主应用调用插件,还包括:
    将各插件的资源对象和类加载器强行注入到所述主应用调用各插件所使用的上下文环境中,以供所述主应用调用各插件。
  11. 根据权利要求10所述的方法,其中,利用所述主应用调用插件,包括:
    当所述主应用调用一个插件时,利用反射将所述主应用的上下文的资源对象和类加载器替换为该插件的资源对象和类加载器;
    利用该插件的资源对象和类加载器分别加载插件的资源和代码,执行插件的辅助功能。
  12. 根据权利要求5至11任一项所述的方法,其中,利用所述主应用调用插件,包括:
    所述主应用通过设置各插件上的插件接口与各插件进行通信,以实现对各插件的调用。
  13. 根据权利要求5至11任一项所述的方法,其中,还包括:
    当所述主应用同时调用多个插件时,
    当其中任一个插件发出命令时,所述插件管理器接收所述命令并将所述命令分发至所述插件管理器管理的所有插件,其中,对所述命令感兴趣的插件对其进行处理,产生应答结果;
    所述插件管理器接收对所述命令的应答结果,并将其返回至发出命令的插件。
  14. 根据权利要求13所述的方法,其中,所述命令在传递过程中使用系统的Intent类封装。
  15. 根据权利要求5至14任一项所述的方法,其中,在所述主应用的运行过程中,根据需求可增删插件数量或种类。
  16. 根据权利要求15所述的方法,其中,增删插件的命令由云端远程控制。
  17. 根据权利要求1至16任一项所述的方法,其中,所述插件在所述主应用界面中的呈现形式包括下列至少之一:
    卡片;
    弹窗;
    滚屏。
  18. 根据权利要求1至17任一项所述的方法,其中,当所述主应用为搜索应用时,
    辅助功能包括下列至少之一:
    小说;
    扫码;
    音乐;
    视频;
    新闻;
    皮肤。
  19. 一种应用安装装置,包括:
    功能确定模块,适于根据需求确定需实现的多类功能,其中,所述多类功能包括主功能和辅助功能;
    分类配置模块,适于为所述主功能生成主应用,以及,为各类辅助功能生成独立的插件;
    安装模块,适于安装所述主应用,其中,所述主应用能够根据需求调用不同的插件,以实现不同的辅助功能。
  20. 根据权利要求19所述的装置,其中,还包括:
    插件加载模块,适于在所述主应用安装结束之后,在前台显示性地加载具备辅助功能的各插件;或者,在后台静默加载具备辅助功能的各插件。
  21. 根据权利要求20所述的装置,其中,所述插件加载模块还用于:
    利用所述主应用的类加载器加载各插件的插件代码;
    将各插件的所述插件代码加载到内存中,为各插件生成本插件独立的类加载器;
    利用各插件的类加载器对应加载各插件资源。
  22. 根据权利要求21所述的装置,其中,
    各插件的插件代码和资源被加载后用于在插件被调用时模拟插件运行环境;以及
    各插件加载结束后,由插件管理器对插件进行统一命名以及管理。
  23. 一种应用运行装置,包括:
    启动模块,适于开启具备主功能的主应用,其中,所述主应用能够调用具备除所述主功能外的其他辅助功能的插件;
    选择模块,适于在所述主应用的界面中根据需求选择辅助功能对应的插件标识;
    调用模块,适于利用所述主应用调用选择的插件标识所对应的插件,以实现对应的辅助功能。
  24. 根据权利要求23所述的装置,其中,所述调用模块还用于:
    在所述主应用中建立托管插件组件,其中,所述托管插件组件能够模拟实现同一辅助功能、且嵌入到主应用中的非独立插件被调用时所产生事件;
    当监测到任一事件发生时,所述托管插件组件被触发将发生的事件转至所述非独立插件具备的事件处理函数中进行处理。
  25. 根据权利要求24所述的装置,其中,当所述插件为活动Activity时,
    所述托管插件组件为代理Activity,能够模拟Activity生命周期和Activity事件;
    当Activity事件发生时,所述代理Activity通过反射调用将Activity事件传递到插件Activity事件对应的处理函数中进行处理。
  26. 根据权利要求25所述的装置,其中,所述托管插件组件通过如下步骤实现:
    统一插件架构中同类Activity的父类;
    将统一的父类替换为特定的PluginActivity;
    当子类被调用时,由所述PluginActivity将子类的调用转发至所述托管插件组件。
  27. 根据权利要求24至26任一项所述的装置,其中,所述托管插件组件相对于其对应的插件是透明的。
  28. 根据权利要求23至27任一项所述的装置,其中,所述调用模块还用于:
    将各插件的资源对象和类加载器强行注入到所述主应用调用各插件所使用的上下文环境中,以供所述主应用调用各插件。
  29. 根据权利要求28所述的装置,其中,所述调用模块还用于:
    当所述主应用调用一个插件时,利用反射将所述主应用的上下文的资源对象和类加载器替换为该插件的资源对象和类加载器;
    利用该插件的资源对象和类加载器分别加载插件的资源和代码,执行插件的辅助功能。
  30. 一种计算机程序,包括计算机可读代码,当所述计算机可读代码在计算设备上运行时,导致所述计算设备执行根据权利要求1-4中的任一个所述的应用安装方法,和/或,权利要求5-18中的任一个所述的应用运行方法。
  31. 一种计算机可读介质,其中存储了如权利要求30所述的计算机程序。
PCT/CN2015/099591 2015-03-31 2015-12-29 应用安装、运行方法及装置 Ceased WO2016155388A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201510150236.8A CN104714828B (zh) 2015-03-31 2015-03-31 应用安装、运行方法及装置
CN201510150236.8 2015-03-31

Publications (1)

Publication Number Publication Date
WO2016155388A1 true WO2016155388A1 (zh) 2016-10-06

Family

ID=53414198

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2015/099591 Ceased WO2016155388A1 (zh) 2015-03-31 2015-12-29 应用安装、运行方法及装置

Country Status (2)

Country Link
CN (1) CN104714828B (zh)
WO (1) WO2016155388A1 (zh)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107220059A (zh) * 2017-06-14 2017-09-29 北京小米移动软件有限公司 应用界面的显示方法及装置
CN115408051A (zh) * 2022-08-31 2022-11-29 长城汽车股份有限公司 应用程序的模式切换方法、装置、电子设备及存储介质

Families Citing this family (34)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104714828B (zh) * 2015-03-31 2017-06-09 北京奇虎科技有限公司 应用安装、运行方法及装置
CN106484445A (zh) * 2015-08-27 2017-03-08 阿里巴巴集团控股有限公司 移动终端应用程序的页面展示方法和装置
CN106557343A (zh) * 2015-09-30 2017-04-05 阿里巴巴集团控股有限公司 生成功能应用及加载资源的方法及装置
CN106909406A (zh) * 2015-12-23 2017-06-30 北京奇虎科技有限公司 一种加载应用程序的apk插件的方法及装置
CN105872708A (zh) * 2015-12-30 2016-08-17 乐视致新电子科技(天津)有限公司 一种显示桌面生成方法、显示桌面生成系统和智能电视
CN105700886B (zh) * 2016-01-14 2019-02-26 腾讯科技(北京)有限公司 插件界面的显示方法及终端
CN105760160B (zh) * 2016-02-04 2020-03-03 百度在线网络技术(北京)有限公司 一种从插件添加卡片的方法、装置和系统
CN107092494B (zh) * 2016-02-18 2020-09-01 腾讯科技(深圳)有限公司 访问apk资源的方法和装置
CN105740033A (zh) * 2016-03-15 2016-07-06 广州彩瞳网络技术有限公司 一种终端设备、插件加载运行装置及插件加载运行方法
CN107203524A (zh) * 2016-03-16 2017-09-26 阿里巴巴集团控股有限公司 一种打包APK文件的方法、加载Bundle文件的方法及系统
CN105955787B (zh) * 2016-05-18 2019-11-22 深圳市掌玩网络技术有限公司 一种用于Android系统的插件加载方法及装置
CN106055330A (zh) * 2016-05-31 2016-10-26 深圳卡尔拓客科技有限公司 一种应用程序的管理方法及系统
CN106131612B (zh) * 2016-06-30 2019-03-05 武汉斗鱼网络科技有限公司 安卓app动态加载资源功能模块的方法及系统
CN106325923A (zh) * 2016-08-17 2017-01-11 北京奇虎科技有限公司 功能插件的管理方法及装置
CN106371874A (zh) * 2016-08-31 2017-02-01 广州品唯软件有限公司 一种插件数据加载方法及设备
CN106815044A (zh) * 2016-12-12 2017-06-09 广州视源电子科技股份有限公司 软件功能扩展的方法、装置及系统
CN106886437B (zh) * 2017-01-24 2021-08-31 北京奇虎科技有限公司 应用程序更新方法与装置
CN106775916B (zh) * 2017-02-17 2020-02-28 北京金山安全软件有限公司 减小应用安装包的方法、装置及电子设备
CN107015800A (zh) * 2017-03-14 2017-08-04 宇龙计算机通信科技(深圳)有限公司 显示方法、装置及设备
CN107193609B (zh) * 2017-05-27 2021-05-07 北京奇虎科技有限公司 应用中功能模块调用方法及装置、电子设备
CN107463406A (zh) * 2017-08-08 2017-12-12 上海连尚网络科技有限公司 发布移动应用的方法和电子设备
CN109408133B (zh) * 2017-08-16 2021-12-14 阿里巴巴集团控股有限公司 一种启动组件的方法和设备
CN107992308B (zh) * 2017-11-22 2020-10-20 竞技世界(北京)网络技术有限公司 一种安卓终端应用程序的插件化管理方法
CN108388453B (zh) * 2018-01-15 2020-08-11 珠海格力电器股份有限公司 插件管理、应用程序形成方法、装置及服务器
CN108595220B (zh) * 2018-04-25 2021-04-16 上海掌门科技有限公司 应用组件的处理方法、设备及计算机可读存储介质
CN110427198A (zh) * 2018-04-27 2019-11-08 中兴通讯股份有限公司 应用程序的热修复方法、装置及终端、存储介质
CN108804082A (zh) * 2018-05-10 2018-11-13 北京酷我科技有限公司 一种插件化JSBridge的实现方法
CN109656592B (zh) * 2018-12-06 2022-02-08 Oppo广东移动通信有限公司 卡片管理方法、装置、终端及计算机可读存储介质
CN110515673B (zh) * 2019-07-24 2022-10-11 百度在线网络技术(北京)有限公司 插件化系统及其方法
CN110531961B (zh) * 2019-07-24 2023-05-23 百度在线网络技术(北京)有限公司 智能服务破壳系统及其方法
CN110908734A (zh) * 2019-11-15 2020-03-24 网易(杭州)网络有限公司 基于插件化的应用组合方法、装置、终端设备及存储介质
CN111435313A (zh) * 2019-12-09 2020-07-21 杭州海康威视数字技术股份有限公司 一种软件换肤的方法及装置
CN111857765B (zh) * 2020-06-16 2024-06-28 深圳晶泰科技有限公司 用于药物设计系统的插件系统及其生成方法和更新方法
CN114528048A (zh) * 2022-02-18 2022-05-24 Oppo广东移动通信有限公司 应用执行方法、应用执行架构、电子设备及存储介质

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103530156A (zh) * 2013-10-17 2014-01-22 北京奇虎科技有限公司 动态加载和调用程序的方法及装置
US20150046424A1 (en) * 2012-08-06 2015-02-12 Hsiu-Ping Lin Methods and systems for searching software applications
CN104391716A (zh) * 2014-11-14 2015-03-04 百度在线网络技术(北京)有限公司 基于插件的应用程序实现方法及装置
CN104714828A (zh) * 2015-03-31 2015-06-17 北京奇虎科技有限公司 应用安装、运行方法及装置

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104123151B (zh) * 2013-04-28 2018-07-10 百度在线网络技术(北京)有限公司 移动终端中应用程序的插件管理方法、装置和移动终端
CN103970573A (zh) * 2014-05-21 2014-08-06 百度在线网络技术(北京)有限公司 用于移动设备的轻应用程序系统及其程序加载系统和方法
CN104021024B (zh) * 2014-06-25 2017-06-06 广州市久邦数码科技有限公司 一种桌面系统功能屏幕的加载方法及其系统

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150046424A1 (en) * 2012-08-06 2015-02-12 Hsiu-Ping Lin Methods and systems for searching software applications
CN103530156A (zh) * 2013-10-17 2014-01-22 北京奇虎科技有限公司 动态加载和调用程序的方法及装置
CN104391716A (zh) * 2014-11-14 2015-03-04 百度在线网络技术(北京)有限公司 基于插件的应用程序实现方法及装置
CN104714828A (zh) * 2015-03-31 2015-06-17 北京奇虎科技有限公司 应用安装、运行方法及装置

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107220059A (zh) * 2017-06-14 2017-09-29 北京小米移动软件有限公司 应用界面的显示方法及装置
EP3428790A1 (en) * 2017-06-14 2019-01-16 Beijing Xiaomi Mobile Software Co., Ltd. Method and device for displaying application interface
CN115408051A (zh) * 2022-08-31 2022-11-29 长城汽车股份有限公司 应用程序的模式切换方法、装置、电子设备及存储介质

Also Published As

Publication number Publication date
CN104714828A (zh) 2015-06-17
CN104714828B (zh) 2017-06-09

Similar Documents

Publication Publication Date Title
CN104714828B (zh) 应用安装、运行方法及装置
US9928038B2 (en) Dynamically building locale objects or subsections of locale objects based on historical data
US11467816B1 (en) Method and system of running an application
US9588657B1 (en) Seamless integration of non-native windows with dynamically scalable resolution into host operating system
US9317195B1 (en) Seamless integration of non-native windows with dynamically scalable resolution into host operating system
US10580051B2 (en) Background element associated with an application installed in a browser application
US9619304B2 (en) Automatic connections between application components
US9058193B2 (en) Methods and systems for providing compatibility of applications with multiple versions of an operating system
US12340209B2 (en) Runtime application modification of a user interface
CN103180822A (zh) 使用共享工作器的子组件实例和同步
US10908948B2 (en) Multiple application instances in operating systems that utilize a single process for application execution
WO2019090994A1 (zh) 测试脚本自动化执行方法、装置、设备以及存储介质
CN108509207A (zh) Web应用程序的跨系统安装
US20230169138A1 (en) Rendering primitive child elements corresponding to child components of a user interface without instantiating the child components
US9558014B2 (en) System, method and apparatus for transparently enabling software applications with adaptive user interfaces
CN110020370A (zh) 在客户端应用中实现动画的方法、装置及动画脚本的框架
CN105204832B (zh) 一种实现脚本引擎的系统及方法
US9141353B2 (en) Dynamically building locale objects at run-time
CN114911541A (zh) 配置信息的处理方法、装置、电子设备及存储介质
CN110673827B (zh) 基于安卓系统的资源调用方法及装置、电子设备
US9785560B2 (en) Scene-isolated internet application
CN105183491A (zh) 跨平台的桌面gis系统及其启动方法
KR20080027293A (ko) 데이터 언어에서 다수 언어들의 관리
CN120295807A (zh) 数据处理方法、装置、电子设备、存储介质及程序产品
US9778917B2 (en) Dynamically building subsections of locale objects at run-time

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 15887337

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 15887337

Country of ref document: EP

Kind code of ref document: A1