








技术领域technical field
本发明涉及计算机处理技术领域,特别是涉及一种插件的多进程管理方法和装置。The present invention relates to the technical field of computer processing, in particular to a method and device for multi-process management of a plug-in.
背景技术Background technique
在软件开发中,为了方便对软件进行功能扩展,可以采用插件方式进行开发,将软件所要实现的一个一个功能封装在插件中,最后将各个插件集成在软件主程序包中一同发布。In software development, in order to facilitate the function expansion of the software, the plug-in method can be used for development, and the functions to be implemented by the software are encapsulated in the plug-in, and finally each plug-in is integrated into the main software package and released together.
在Android开发中,为了尽可能地减少手机的内存占用,大多数APP(应用程序)都会启动至少两个进程,一个运行在后台(运行后台任务的常驻进程),另一个运行在前台,提供用户可见的界面(即UI进程)。In Android development, in order to reduce the memory usage of the phone as much as possible, most APPs (applications) will start at least two processes, one runs in the background (a resident process that runs background tasks), and the other runs in the foreground, providing User-visible interface (i.e. UI process).
当用户使用APP完成一些操作后,回退到手机桌面,前台的那个进程会在一段时间后(比如10秒)自动退出,以减少手机系统内存占用,这便是多进程模型。而APP上的插件并不支持多进程模型,即插件中无法同时运行两个或两个以上的进程。因此,亟待解决这一技术问题。When the user uses the APP to complete some operations and returns to the mobile phone desktop, the process in the foreground will automatically exit after a period of time (such as 10 seconds) to reduce the memory usage of the mobile phone system. This is the multi-process model. The plug-in on the APP does not support the multi-process model, that is, the plug-in cannot run two or more processes at the same time. Therefore, it is urgent to solve this technical problem.
发明内容SUMMARY OF THE INVENTION
鉴于上述问题,提出了本发明以便提供一种克服上述问题或者至少部分地解决上述问题的一种插件的多进程管理方法和装置。In view of the above problems, the present invention is proposed to provide a plug-in multi-process management method and apparatus that overcomes the above problems or at least partially solves the above problems.
依据本发明实施例的一方面,提供了一种插件的多进程管理方法,包括:According to an aspect of the embodiments of the present invention, a multi-process management method for a plug-in is provided, including:
在宿主的配置文件中注册多个预留进程;Register multiple reserved processes in the host's configuration file;
当宿主加载插件时,读取宿主加载的插件中每个组件声明的进程;When the host loads the plugin, read the process declared by each component in the plugin loaded by the host;
在所述每个组件声明的进程与注册的多个预留进程之间建立对应关系;establishing a corresponding relationship between the process declared by each component and the registered multiple reserved processes;
当在插件中启动任意组件时,根据所述对应关系查找所述任意组件声明的进程对应的目标预留进程;When starting any component in the plug-in, search for the target reserved process corresponding to the process declared by the arbitrary component according to the corresponding relationship;
在所述目标预留进程中运行所述任意组件。Run the arbitrary component in the target reservation process.
可选地,插件中每个组件的类型包括下列至少之一:Optionally, the type of each component in the plug-in includes at least one of the following:
活动界面Activity、服务Service、内容提供者Content Provider、广播接收器Broadcast Receiver。Activity interface Activity, Service Service, Content Provider Content Provider, Broadcast Receiver Broadcast Receiver.
可选地,所述在宿主的配置文件中注册多个预留进程,包括:Optionally, the registration of multiple reservation processes in the configuration file of the host includes:
获取宿主的插件中每个组件声明的进程;Get the process declared by each component in the host's plugin;
根据所述每个组件声明的进程,在宿主的配置文件中注册相应的多个预留进程。According to the process declared by each component, the corresponding multiple reserved processes are registered in the configuration file of the host.
可选地,所述在宿主的配置文件中注册多个预留进程,包括:Optionally, the registration of multiple reservation processes in the configuration file of the host includes:
在宿主的配置文件中写入进程信息,以注册各个预留进程,其中,所述进程信息至少包括以下信息:Write process information in the configuration file of the host to register each reserved process, wherein the process information at least includes the following information:
进程的编号、进程的状态、进程对应的插件名、插件中不同类型的组件的使用数量。The number of the process, the state of the process, the name of the plug-in corresponding to the process, and the number of different types of components used in the plug-in.
可选地,在所述目标预留进程中运行所述任意组件之后,所述方法还包括:Optionally, after running the arbitrary component in the target reservation process, the method further includes:
将所述目标预留进程的状态标记为表示已分配的状态。The state of the target reservation process is marked as representing the allocated state.
可选地,所述方法还包括:Optionally, the method further includes:
获取宿主的插件的多个任务,其中,所述多个任务各自能够实现插件的不同功能;Obtain multiple tasks of the plug-in of the host, wherein each of the multiple tasks can implement different functions of the plug-in;
在宿主的配置文件中注册所述多个任务各自的活动界面所属的Task,其中,不同的任务各自的活动界面属于不同的Task;Register the Task to which the respective activity interfaces of the multiple tasks belong in the configuration file of the host, wherein the respective activity interfaces of different tasks belong to different Tasks;
当宿主加载插件并启动所述多个任务中的任意任务的当前活动界面时,在所述配置文件中查找所述当前活动界面所属的目标Task;When the host loads the plug-in and starts the current active interface of any task in the multiple tasks, searches the configuration file for the target Task to which the current active interface belongs;
在宿主中查找所述目标Task对应的所有注册界面,并依据预设的选取策略从所述目标Task对应的所有注册界面中选取目标注册界面;Find all the registration interfaces corresponding to the target Task in the host, and select the target registration interface from all the registration interfaces corresponding to the target Task according to a preset selection strategy;
将所述目标注册界面分配给所述当前活动界面使用。Allocate the target registration interface to the currently active interface for use.
可选地,所述Task是具有栈结构的容器,能够放置一个或多个活动界面。Optionally, the Task is a container with a stack structure, capable of placing one or more active interfaces.
可选地,同一个任务的活动界面属于同一个Task。Optionally, the activity interfaces of the same task belong to the same Task.
可选地,所述在宿主的配置文件中注册所述多个任务各自的活动界面所属的Task,包括:Optionally, the Task to which the respective activity interfaces of the multiple tasks are registered in the configuration file of the host includes:
获取宿主的多个Task;Get multiple tasks of the host;
在宿主的配置文件中注册所述多个任务各自的活动界面的TaskAffinity属性,由该属性指示活动界面在所述多个Task中所属的Task。The TaskAffinity attribute of the respective activity interfaces of the multiple tasks is registered in the configuration file of the host, and the attribute indicates the task to which the activity interface belongs among the multiple tasks.
可选地,所述获取宿主的多个Task,包括:Optionally, the multiple Tasks of the acquisition host include:
读取宿主的配置文件;Read the host's configuration file;
查找在宿主的配置文件中注册的宿主的多个Task。Finds multiple tasks of the host registered in the host's configuration file.
可选地,所述方法还包括:Optionally, the method further includes:
在宿主中为所述多个Task中的各个Task预设多个注册界面;In the host, multiple registration interfaces are preset for each Task in the multiple Tasks;
对各个Task预设的多个注册界面进行分组,其中,各组对应一个或多个注册界面。The multiple registration interfaces preset for each Task are grouped, wherein each group corresponds to one or more registration interfaces.
可选地,所述对各个Task预设的多个注册界面进行分组,包括:Optionally, the grouping of multiple registration interfaces preset for each Task includes:
按照不同的启动模式对各个Task预设的多个注册界面进行分组,其中,一种启动模式对应一个组,所述不同的启动模式包括下列任意之一:The multiple registration interfaces preset by each Task are grouped according to different startup modes, wherein one startup mode corresponds to one group, and the different startup modes include any one of the following:
Standard、SingleTop、SingleTask、SingleInstance。Standard, SingleTop, SingleTask, SingleInstance.
可选地,所述依据预设的选取策略从所述目标Task对应的所有注册界面中选取目标注册界面,包括:Optionally, selecting a target registration interface from all registration interfaces corresponding to the target Task according to a preset selection strategy, including:
确定所述当前活动界面的启动模式;determining the startup mode of the currently active interface;
在所述目标Task对应的多组注册界面中,查找所述当前活动界面的启动模式对应的分组;In the multiple groups of registration interfaces corresponding to the target Task, search for the grouping corresponding to the startup mode of the currently active interface;
在所述当前活动界面的启动模式对应的分组中查找所有注册界面;Find all registered interfaces in the grouping corresponding to the startup mode of the current active interface;
在查找到的所有注册界面中确定使用状态为空余状态的注册界面,并从中选取任意注册界面作为目标注册界面。Among all the registration interfaces found, the registration interface whose usage state is in the idle state is determined, and any registration interface is selected as the target registration interface.
可选地,所述将所述目标注册界面分配给所述当前活动界面使用,包括:Optionally, allocating the target registration interface to the currently active interface for use includes:
将所述目标注册界面的信息传递给插件的加载器,由插件的加载器根据所述目标注册界面的信息启动目标注册界面供所述当前活动界面使用。The information of the target registration interface is transmitted to the loader of the plug-in, and the loader of the plug-in starts the target registration interface for use by the currently active interface according to the information of the target registration interface.
依据本发明实施例的另一方面,还提供了一种插件的多进程管理装置,包括:According to another aspect of the embodiments of the present invention, a plug-in multi-process management device is also provided, including:
第一注册模块,适于在宿主的配置文件中注册多个预留进程;a first registration module, adapted to register multiple reserved processes in the configuration file of the host;
读取模块,适于当宿主加载插件时,读取宿主加载的插件中每个组件声明的进程;The reading module is suitable for reading the process declared by each component in the plug-in loaded by the host when the host loads the plug-in;
建立模块,适于在所述每个组件声明的进程与注册的多个预留进程之间建立对应关系;a establishing module, adapted to establish a correspondence between the process declared by each component and the multiple registered reserved processes;
查找模块,适于当在插件中启动任意组件时,根据所述对应关系查找所述任意组件声明的进程对应的目标预留进程;A search module, adapted to search the target reserved process corresponding to the process declared by the arbitrary component according to the corresponding relationship when any component is started in the plug-in;
运行模块,适于在所述目标预留进程中运行所述任意组件。An operation module, adapted to run the arbitrary component in the target reservation process.
可选地,插件中每个组件的类型包括下列至少之一:Optionally, the type of each component in the plug-in includes at least one of the following:
活动界面Activity、服务Service、内容提供者Content Provider、广播接收器Broadcast Receiver。Activity interface Activity, Service Service, Content Provider Content Provider, Broadcast Receiver Broadcast Receiver.
可选地,所述第一注册模块还适于:Optionally, the first registration module is further adapted to:
获取宿主的插件中每个组件声明的进程;Get the process declared by each component in the host's plugin;
根据所述每个组件声明的进程,在宿主的配置文件中注册相应的多个预留进程。According to the process declared by each component, the corresponding multiple reserved processes are registered in the configuration file of the host.
可选地,所述第一注册模块还适于:Optionally, the first registration module is further adapted to:
在宿主的配置文件中写入进程信息,以注册各个预留进程,其中,所述进程信息至少包括以下信息:Write process information in the configuration file of the host to register each reserved process, wherein the process information at least includes the following information:
进程的编号、进程的状态、进程对应的插件名、插件中不同类型的组件的使用数量。The number of the process, the state of the process, the name of the plug-in corresponding to the process, and the number of different types of components used in the plug-in.
可选地,所述装置还包括:Optionally, the device further includes:
标记模块,适于在所述运行模块在所述目标预留进程中运行所述任意组件之后,将所述目标预留进程的状态标记为表示已分配的状态。A marking module, adapted to mark the state of the target reservation process as a state representing an allocated state after the execution module runs the arbitrary component in the target reservation process.
可选地,所述装置还包括:Optionally, the device further includes:
获取模块,适于获取宿主的插件的多个任务,其中,所述多个任务各自能够实现插件的不同功能;an acquisition module, adapted to acquire multiple tasks of the plug-in of the host, wherein each of the multiple tasks can implement different functions of the plug-in;
第二注册模块,适于在宿主的配置文件中注册所述多个任务各自的活动界面所属的Task,其中,不同的任务各自的活动界面属于不同的Task;The second registration module is adapted to register the Task to which the respective active interfaces of the multiple tasks belong in the configuration file of the host, wherein the respective active interfaces of different tasks belong to different Tasks;
目标Task查找模块,适于当宿主加载插件并启动所述多个任务中的任意任务的当前活动界面时,在所述配置文件中查找所述当前活动界面所属的目标Task;A target Task search module, adapted to search the target Task to which the current active interface belongs in the configuration file when the host loads the plug-in and starts the current active interface of any task in the multiple tasks;
选取模块,适于在宿主中查找所述目标Task对应的所有注册界面,并依据预设的选取策略从所述目标Task对应的所有注册界面中选取目标注册界面;A selection module, adapted to search all registration interfaces corresponding to the target Task in the host, and select a target registration interface from all the registration interfaces corresponding to the target Task according to a preset selection strategy;
分配模块,适于将所述目标注册界面分配给所述当前活动界面使用。The assigning module is adapted to assign the target registration interface to the currently active interface for use.
可选地,所述Task是具有栈结构的容器,能够放置一个或多个活动界面。Optionally, the Task is a container with a stack structure, capable of placing one or more active interfaces.
可选地,同一个任务的活动界面属于同一个Task。Optionally, the activity interfaces of the same task belong to the same Task.
可选地,所述第二注册模块还适于:Optionally, the second registration module is further adapted to:
获取宿主的多个Task;Get multiple tasks of the host;
在宿主的配置文件中注册所述多个任务各自的活动界面的TaskAffinity属性,由该属性指示活动界面在所述多个Task中所属的Task。The TaskAffinity attribute of the respective activity interfaces of the multiple tasks is registered in the configuration file of the host, and the attribute indicates the task to which the activity interface belongs among the multiple tasks.
可选地,所述第二注册模块还适于:Optionally, the second registration module is further adapted to:
读取宿主的配置文件;Read the host's configuration file;
查找在宿主的配置文件中注册的宿主的多个Task。Finds multiple tasks of the host registered in the host's configuration file.
可选地,所述装置还包括:Optionally, the device further includes:
配置模块,适于在宿主中为所述多个Task中的各个Task预设多个注册界面;对各个Task预设的多个注册界面进行分组,其中,各组对应一个或多个注册界面。The configuration module is adapted to preset multiple registration interfaces for each of the multiple tasks in the host; group the multiple preset registration interfaces of each task, wherein each group corresponds to one or more registration interfaces.
可选地,所述配置模块还适于:Optionally, the configuration module is further adapted to:
按照不同的启动模式对各个Task预设的多个注册界面进行分组,其中,一种启动模式对应一个组,所述不同的启动模式包括下列任意之一:The multiple registration interfaces preset by each Task are grouped according to different startup modes, wherein one startup mode corresponds to one group, and the different startup modes include any one of the following:
Standard、SingleTop、SingleTask、SingleInstance。Standard, SingleTop, SingleTask, SingleInstance.
可选地,所述选取模块还适于:Optionally, the selection module is also adapted to:
确定所述当前活动界面的启动模式;determining the startup mode of the currently active interface;
在所述目标Task对应的多组注册界面中,查找所述当前活动界面的启动模式对应的分组;In the multiple groups of registration interfaces corresponding to the target Task, search for the grouping corresponding to the startup mode of the currently active interface;
在所述当前活动界面的启动模式对应的分组中查找所有注册界面;Find all registered interfaces in the grouping corresponding to the startup mode of the current active interface;
在查找到的所有注册界面中确定使用状态为空余状态的注册界面,并从中选取任意注册界面作为目标注册界面。Among all the registration interfaces found, the registration interface whose usage state is in the idle state is determined, and any registration interface is selected as the target registration interface.
可选地,所述分配模块还适于:Optionally, the distribution module is further adapted to:
将所述目标注册界面的信息传递给插件的加载器,由插件的加载器根据所述目标注册界面的信息启动目标注册界面供所述当前活动界面使用。The information of the target registration interface is transmitted to the loader of the plug-in, and the loader of the plug-in starts the target registration interface for use by the currently active interface according to the information of the target registration interface.
在本发明实施例中,在宿主的配置文件中注册多个预留进程,当宿主加载插件时,读取宿主加载的插件中每个组件声明的进程;随后,在每个组件声明的进程与注册的多个预留进程之间建立对应关系;之后,当在插件中启动任意组件时,根据对应关系查找任意组件声明的进程对应的目标预留进程;在目标预留进程中运行任意组件。可以看到,本发明实施例在每个组件声明的进程与注册的多个预留进程之间建立对应关系,从而,当在插件中启动任意组件时,根据对应关系查找任意组件声明的进程对应的目标预留进程,进而在目标预留进程中运行任意组件,解决了现有技术中插件的组件只能运行在同一个进程的问题,实现了插件的多进程运行的目的。In the embodiment of the present invention, multiple reserved processes are registered in the configuration file of the host, and when the host loads the plug-in, the process declared by each component in the plug-in loaded by the host is read; A corresponding relationship is established between multiple registered reserved processes; after that, when any component is started in the plug-in, the target reserved process corresponding to the process declared by any component is searched according to the corresponding relationship; any component is run in the target reserved process. It can be seen that the embodiment of the present invention establishes a corresponding relationship between the process declared by each component and the multiple registered reserved processes, so that when any component is started in the plug-in, the corresponding relationship of the process declared by any component is searched according to the corresponding relationship. The target reservation process is established, and any component is run in the target reservation process, which solves the problem that the components of the plug-in can only run in the same process in the prior art, and realizes the purpose of multi-process operation of the plug-in.
上述说明仅是本发明技术方案的概述,为了能够更清楚了解本发明的技术手段,而可依照说明书的内容予以实施,并且为了让本发明的上述和其它目的、特征和优点能够更明显易懂,以下特举本发明的具体实施方式。The above description is only an overview of the technical solutions of the present invention, in order to be able to understand the technical means of the present invention more clearly, it can be implemented according to the content of the description, and in order to make the above and other purposes, features and advantages of the present invention more obvious and easy to understand , the following specific embodiments of the present invention are given.
根据下文结合附图对本发明具体实施例的详细描述,本领域技术人员将会更加明了本发明的上述以及其他目的、优点和特征。The above and other objects, advantages and features of the present invention will be more apparent to those skilled in the art from the following detailed description of the specific embodiments of the present invention in conjunction with the accompanying drawings.
附图说明Description of drawings
通过阅读下文优选实施方式的详细描述,各种其他的优点和益处对于本领域普通技术人员将变得清楚明了。附图仅用于示出优选实施方式的目的,而并不认为是对本发明的限制。而且在整个附图中,用相同的参考符号表示相同的部件。在附图中:Various other advantages and benefits will become apparent to those of ordinary skill in the art upon reading the following detailed description of the preferred embodiments. The drawings are for the purpose of illustrating preferred embodiments only and are not to be considered limiting of the invention. Also, the same components are denoted by the same reference numerals throughout the drawings. In the attached image:
图1示出了根据本发明一实施例的插件的多进程管理方法的流程图;1 shows a flowchart of a multi-process management method for a plug-in according to an embodiment of the present invention;
图2A示出了根据本发明一实施例的插件中声明的进程的示意图;2A shows a schematic diagram of a process declared in a plug-in according to an embodiment of the present invention;
图2B示出了根据本发明一实施例的预留进程的示意图;2B shows a schematic diagram of a reservation process according to an embodiment of the present invention;
图3示出了根据本发明一实施例的动态匹配活动界面的方法的流程图;3 shows a flowchart of a method for dynamically matching an active interface according to an embodiment of the present invention;
图4示出了根据本发明一实施例Task预设的多个注册界面的分组示意图;4 shows a schematic diagram of grouping of multiple registration interfaces preset by Task according to an embodiment of the present invention;
图5示出了根据本发明一实施例的选取目标注册界面的方法的流程图;5 shows a flowchart of a method for selecting a target registration interface according to an embodiment of the present invention;
图6示出了根据本发明一实施例的实现插件的多任务栈的方法的流程图;6 shows a flowchart of a method for implementing a multitasking stack of a plug-in according to an embodiment of the present invention;
图7示出了根据本发明一实施例的插件的多进程管理装置的结构示意图;FIG. 7 shows a schematic structural diagram of a multi-process management apparatus for a plug-in according to an embodiment of the present invention;
图8示出了根据本发明另一实施例的插件的多进程管理装置的结构示意图。FIG. 8 shows a schematic structural diagram of a multi-process management apparatus for a plug-in according to another embodiment of the present invention.
具体实施方式Detailed ways
下面将参照附图更详细地描述本公开的示例性实施例。虽然附图中显示了本公开的示例性实施例,然而应当理解,可以以各种形式实现本公开而不应被这里阐述的实施例所限制。相反,提供这些实施例是为了能够更透彻地理解本公开,并且能够将本公开的范围完整的传达给本领域的技术人员。Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be embodied in various forms and should not be limited by the embodiments set forth herein. Rather, these embodiments are provided so that the present disclosure will be more thoroughly understood, and will fully convey the scope of the present disclosure to those skilled in the art.
进程是操作系统结构的基础,是一种具有独立功能的程序。它可以申请和拥有系统资源,是一个动态的概念,是一个活动的实体。进程不只是程序的代码,还包括当前的活动,通过程序计数器的值和处理寄存器的内容来表示。A process is the foundation of the operating system structure and is a program with independent functions. It can apply for and own system resources, is a dynamic concept, is an active entity. A process is not just the code of the program, but also the current activity, represented by the value of the program counter and the contents of the processing register.
如前文介绍,插件上不支持多进程模型,即插件中无法同时运行两个或两个以上的进程。为了解决这一问题,本发明实施例提供了一种插件的多进程管理方法。图1示出了根据本发明一实施例的插件的多进程管理方法的流程图,在图1中,该方法至少可以包括以下步骤S102至S110。As mentioned above, the multi-process model is not supported on the plug-in, that is, two or more processes cannot be run in the plug-in at the same time. To solve this problem, an embodiment of the present invention provides a multi-process management method for a plug-in. Fig. 1 shows a flowchart of a multi-process management method for a plug-in according to an embodiment of the present invention. In Fig. 1 , the method may at least include the following steps S102 to S110.
步骤S102,在宿主的配置文件中注册多个预留进程。Step S102, registering multiple reservation processes in the configuration file of the host.
步骤S104,当宿主加载插件时,读取该宿主加载的插件中每个组件声明的进程。Step S104, when the host loads the plug-in, read the process declared by each component in the plug-in loaded by the host.
步骤S106,在每个组件声明的进程与注册的多个预留进程之间建立对应关系。Step S106, establishing a correspondence between the process declared by each component and the multiple registered reserved processes.
步骤S108,当在插件中启动任意组件时,根据对应关系查找任意组件声明的进程对应的目标预留进程。In step S108, when any component is started in the plug-in, the target reserved process corresponding to the process declared by any component is searched according to the corresponding relationship.
步骤S110,在目标预留进程中运行任意组件。Step S110, run any component in the target reservation process.
在本发明实施例中,在宿主的配置文件中注册多个预留进程,当宿主加载插件时,读取宿主加载的插件中每个组件声明的进程;随后,在每个组件声明的进程与注册的多个预留进程之间建立对应关系;之后,当在插件中启动任意组件时,根据对应关系查找任意组件声明的进程对应的目标预留进程;在目标预留进程中运行任意组件。可以看到,本发明实施例在每个组件声明的进程与注册的多个预留进程之间建立对应关系,从而,当在插件中启动任意组件时,根据对应关系查找任意组件声明的进程对应的目标预留进程,进而在目标预留进程中运行任意组件,解决了现有技术中插件的组件只能运行在同一个进程的问题,实现了插件的多进程运行的目的。In the embodiment of the present invention, multiple reserved processes are registered in the configuration file of the host, and when the host loads the plug-in, the process declared by each component in the plug-in loaded by the host is read; A corresponding relationship is established between multiple registered reserved processes; after that, when any component is started in the plug-in, the target reserved process corresponding to the process declared by any component is searched according to the corresponding relationship; any component is run in the target reserved process. It can be seen that the embodiment of the present invention establishes a corresponding relationship between the process declared by each component and the multiple registered reserved processes, so that when any component is started in the plug-in, the corresponding relationship of the process declared by any component is searched according to the corresponding relationship. The target reservation process is established, and any component is run in the target reservation process, which solves the problem that the components of the plug-in can only run in the same process in the prior art, and realizes the purpose of multi-process operation of the plug-in.
上文步骤S102中在宿主的配置文件中注册多个预留进程,本发明实施例提供了可选的方案,即,获取宿主的插件中每个组件声明的进程,进而根据每个组件声明的进程,在宿主的配置文件中注册相应的多个预留进程。这里,以Android(安卓)系统为例,插件中每个组件的类型包括Activity(活动界面)、Service(服务)、Content Provider(内容提供者)、Broadcast Receiver(广播接收器)。In the above step S102, multiple reserved processes are registered in the configuration file of the host. The embodiment of the present invention provides an optional solution, that is, the process declared by each component in the plug-in of the host is obtained, and then the process declared by each component is obtained. process, register the corresponding multiple reserved processes in the host's configuration file. Here, taking the Android system as an example, the types of each component in the plug-in include Activity (activity interface), Service (service), Content Provider (content provider), and Broadcast Receiver (broadcast receiver).
如图2A所示,获取到宿主的插件中各组件声明的进程分别为进程A、进程B和进程C,则根据各组件声明的这些进程,在宿主的配置文件中注册相应的多个预留进程PA、PB、PC。这里,进程A对应预留进程PA,进程B对应预留进程PB以及进程C对应预留进程PC。需要说明的是,此处例举仅是示意性的,并不对本发明实施例进行限制。如图2B中所示的每个圆圈表示在宿主的配置文件中注册多个预留进程。As shown in FIG. 2A , the processes declared by each component in the plug-in of the host are obtained as process A, process B and process C respectively, then according to these processes declared by each component, the corresponding multiple reservations are registered in the configuration file of the host Processes PA, PB, PC. Here, the process A corresponds to the reserved process PA, the process B corresponds to the reserved process PB, and the process C corresponds to the reserved process PC. It should be noted that the examples here are only illustrative, and do not limit the embodiments of the present invention. Each circle as shown in Figure 2B represents that multiple reservation processes are registered in the host's configuration file.
以Activity、Service以及Provider为例,如下所示:Take Activity, Service, and Provider as examples, as follows:
<Activity name=”xxxxActivity”/><Activity name="xxxxActivity"/>
<Service name=”xxxxService”/><Service name="xxxxService"/>
<Provider name=”xxxxProvider”/><Provider name="xxxxProvider"/>
在现有技术中,上述这些组件使用默认的UI进程,无法实现多进程运行。在本发明实施中,上述这些组件可以按进程进行扩展,如下所示:In the prior art, the above-mentioned components use the default UI process and cannot implement multi-process operation. In the implementation of the present invention, the above components can be extended according to the process, as follows:
<Activity name=”xxxxActivity”/><Activity name="xxxxActivity"/>
<Service name=”xxxxService”/><Service name="xxxxService"/>
<Provider name=”xxxxProvider”/><Provider name="xxxxProvider"/>
<Activity name=”xxxxActivity”<Activity name="xxxxActivity"
process=":p1"/>process=":p1"/>
<Service name=”xxxxService”<Service name="xxxxService"
process=":p1"/>process=":p1"/>
<Provider name=”xxxxProvider”<Provider name="xxxxProvider"
process=":p1"/>process=":p1"/>
……
<Activity name=”xxxxActivity”<Activity name="xxxxActivity"
process=":pn"/>process=":pn"/>
<Service name=”xxxxService”<Service name="xxxxService"
process=":pn"/>process=":pn"/>
<Provider name=”xxxxProvider"<Provider name="xxxxProvider"
process=":pn"/>process=":pn"/>
扩展后,各个组件可以按照p0到pn进程运行。After expansion, individual components can run as p0 to pn processes.
进一步地,步骤S102在宿主的配置文件中注册多个预留进程时,可以在宿主的配置文件中写入进程信息,以注册各个预留进程,其中,进程信息至少可以包括进程的编号、进程的状态、进程对应的插件名、插件中不同类型的组件的使用数量,等等,本发明实施例不限于此。Further, when registering multiple reserved processes in the configuration file of the host in step S102, process information can be written in the configuration file of the host to register each reserved process, wherein the process information can at least include the number of the process, the process state, the plug-in name corresponding to the process, the usage quantity of different types of components in the plug-in, etc., the embodiment of the present invention is not limited to this.
在步骤S110在目标预留进程中运行任意组件之后,还可以将目标预留进程的状态标记为表示已分配的状态,以表示目标预留进程被占用。After any component is run in the target reservation process in step S110, the state of the target reservation process may also be marked as an allocated state to indicate that the target reservation process is occupied.
本发明实施例除了可以实现多进程匹配,还可以根据插件Activity的TaskAffinity的区分并动态匹配Activity。In addition to implementing multi-process matching, the embodiment of the present invention can also dynamically match activities according to the distinction of the TaskAffinity of the plug-in Activity.
图3示出了根据本发明一实施例的动态匹配活动界面的方法的流程图,在Android系统中,活动界面为Activity。在图3中,该方法至少包括以下步骤S302至S310。FIG. 3 shows a flowchart of a method for dynamically matching an activity interface according to an embodiment of the present invention. In an Android system, the activity interface is an Activity. In FIG. 3, the method includes at least the following steps S302 to S310.
步骤S302,获取宿主的插件的多个任务,其中,多个任务各自能够实现插件的不同功能。Step S302: Acquire multiple tasks of the plug-in of the host, wherein each of the multiple tasks can implement different functions of the plug-in.
在该步骤中,例如手机卫士上的防盗插件有多个任务,分别能够实现定位、报警等功能。In this step, for example, the anti-theft plug-in on the mobile phone guard has multiple tasks, which can respectively implement functions such as positioning and alarming.
步骤S304,在宿主的配置文件中注册多个任务各自的活动界面所属的Task,其中,不同的任务各自的活动界面属于不同的Task。Step S304: Register the Tasks to which the respective activity interfaces of the multiple tasks belong in the configuration file of the host, wherein the respective activity interfaces of different tasks belong to different Tasks.
步骤S306,当宿主加载插件并启动多个任务中的任意任务的当前活动界面时,在配置文件中查找当前活动界面所属的目标Task。Step S306, when the host loads the plug-in and starts the current active interface of any task among the multiple tasks, it searches the configuration file for the target Task to which the current active interface belongs.
步骤S308,在宿主中查找目标Task对应的所有注册界面,并依据预设的选取策略从目标Task对应的所有注册界面中选取目标注册界面。In step S308, all registration interfaces corresponding to the target Task are searched in the host, and a target registration interface is selected from all the registration interfaces corresponding to the target Task according to a preset selection strategy.
步骤S310,将目标注册界面分配给当前活动界面使用。Step S310: Allocate the target registration interface to the current active interface for use.
可以看到,本发明实施例在宿主的配置文件中注册多个任务各自的活动界面所属的Task,并且不同的任务各自的活动界面属于不同的Task,这样使得不同的任务之间能够自由切换,无需退出任务。并且,本发明实施例在启动任意任务的当前活动界面时,能够从当前活动界面所属的目标Task对应的所有注册界面中选取目标注册界面,将目标注册界面分配给当前活动界面使用,保证了任务界面的正常启动。It can be seen that the embodiment of the present invention registers the Task to which the respective active interfaces of multiple tasks belong in the configuration file of the host, and the respective active interfaces of different tasks belong to different Tasks, so that different tasks can be freely switched, No need to quit the task. In addition, when the current active interface of any task is started in the embodiment of the present invention, the target registration interface can be selected from all the registration interfaces corresponding to the target Task to which the current active interface belongs, and the target registration interface can be allocated to the current active interface for use, thereby ensuring the task of normal startup of the interface.
宿主的Task是固定的,且有多个,每个Task包含多个活动界面,都预埋或配置在宿主的配置文件中。以Android系统为例,宿主的每个Task包含多个Activity,都预埋在宿主的配置文件AndroidManifest.xml中。宿主的每个Task中能够放置或装载多个Activity,其回退和打开的顺序逻辑和基本的数据结构栈是一致的。The task of the host is fixed and there are multiple ones. Each task contains multiple activity interfaces, which are embedded or configured in the configuration file of the host. Taking the Android system as an example, each Task of the host contains multiple Activities, which are pre-buried in the host's configuration file AndroidManifest.xml. Multiple Activities can be placed or loaded in each Task of the host, and the sequence logic of rollback and opening is consistent with the basic data structure stack.
进一步地,步骤S304中在宿主的配置文件中注册多个任务各自的活动界面所属的Task,本发明实施例提供了一种可选的方案,在该方案中,可以获取宿主的多个Task,进而在宿主的配置文件中注册多个任务各自的活动界面在多个Task中所属的Task。例如,宿主的多个Task分别为Task1、Task2、Task3,则可以在宿主的配置文件中注册多个任务各自的活动界面属于Task1、Task2或者Task3,需要说明的是,此处例举仅是示意性的,并不对本发明实施例进行限制。Further, in step S304, in the configuration file of the host, the Tasks to which the respective activity interfaces of the multiple tasks belong are registered. The embodiment of the present invention provides an optional solution, in which multiple Tasks of the host can be obtained, Furthermore, the tasks to which the respective activity interfaces of the multiple tasks belong in the multiple tasks are registered in the configuration file of the host. For example, if the multiple tasks of the host are respectively Task1, Task2, and Task3, you can register the respective activity interfaces of the multiple tasks in the configuration file of the host to belong to Task1, Task2 or Task3. It should be noted that the examples here are only for illustration. It is not intended to limit the embodiments of the present invention.
此外,步骤S304中限定了不同的任务各自的活动界面属于不同的Task,从而使得不同的任务之间能够自由切换,无需退出任务。在可选的实施例中,为了保证同一任务的不同活动界面的快速、有效切换,同一个任务的活动界面属于同一个Task。In addition, in step S304, it is defined that the respective active interfaces of different tasks belong to different tasks, so that different tasks can be switched freely without exiting the task. In an optional embodiment, in order to ensure fast and effective switching of different activity interfaces of the same task, the activity interfaces of the same task belong to the same Task.
在本发明的可选实施例中,上述在宿主的配置文件中注册多个任务各自的活动界面在多个Task中所属的Task时,可以在宿主的配置文件中注册多个任务各自的活动界面的TaskAffinity属性,由该属性指示活动界面在多个Task中所属的Task。仍然以上述例举为例,对于多个任务中的各个任务,可以在宿主的配置文件中注册各个任务的活动界面的TaskAffinity属性,由该属性指示活动界面属于Task1、Task2或者Task3。In an optional embodiment of the present invention, when the above-mentioned tasks to which the respective active interfaces of multiple tasks belong to the multiple tasks are registered in the configuration file of the host, the respective active interfaces of the multiple tasks may be registered in the configuration file of the host. The TaskAffinity property, which indicates the Task to which the active interface belongs in multiple Tasks. Still taking the above example as an example, for each task in the multiple tasks, the TaskAffinity attribute of the activity interface of each task may be registered in the configuration file of the host, and the attribute indicates that the activity interface belongs to Task1, Task2 or Task3.
如上文介绍,宿主的Task是固定的,且有多个,每个Task包含多个活动界面,都预埋或配置在宿主的配置文件中。因而,上述获取宿主的多个Task时,可以读取宿主的配置文件,进而查找在宿主的配置文件中注册的宿主的多个Task。进一步地,本发明实施例还可以在宿主中为多个Task中的各个Task预设多个注册界面,以提供给活动界面使用,并且对各个Task预设的多个注册界面进行分组,其中,各组对应一个或多个注册界面。As described above, the host's tasks are fixed and there are multiple ones. Each task contains multiple activity interfaces, all of which are pre-buried or configured in the host's configuration file. Therefore, when acquiring multiple tasks of the host, the configuration file of the host can be read, and then the multiple tasks of the host registered in the configuration file of the host can be searched. Further, in this embodiment of the present invention, multiple registration interfaces may be preset for each of the multiple Tasks in the host, so as to be used by the activity interface, and the multiple preset registration interfaces of each Task may be grouped, wherein, Each group corresponds to one or more registration interfaces.
在本发明的可选实施例中,将不同的启动模式分配给各个注册界面的LaunchMode属性,以指示各个注册界面的启动模式,这里,不同的启动模式可以包括Standard、SingleTop、SingleTask、SingleInstance中的任意之一。以Android系统为例,下面将详细介绍这几种启动模式的区别。In an optional embodiment of the present invention, different startup modes are assigned to the LaunchMode attribute of each registration interface to indicate the startup mode of each registration interface. Here, the different startup modes may include Standard, SingleTop, SingleTask, and SingleInstance. any one. Taking the Android system as an example, the following will introduce the differences between these startup modes in detail.
(1)哪个任务存放着Activity,用来对行为进行响应。对Standard和SingleTop这两个启动模式来说,这个任务是产生行为,并且调用StartActivity()的那个。(1) Which task stores the Activity and is used to respond to the behavior. For the two startup modes Standard and SingleTop, the task is the one that generates the behavior and calls StartActivity().
(2)它们是否可以有多个实例。Standard和SingleTop类型的Activity可以被实例化多次。它们可以属于多个任务,一个特定的任务也可以拥有同一个Activity的多个实例。(2) Can they have multiple instances. Activities of type Standard and SingleTop can be instantiated multiple times. They can belong to multiple tasks, and a particular task can have multiple instances of the same Activity.
(3)作为比较SingleTask和SingleInstance类型的Activity只限定有一个实例。因为这些Activity是任务的根。这个限制意味着,在设备上不能同时有超过一个任务的实例。(3) There is only one instance of Activity that compares SingleTask and SingleInstance types. Because these Activity is the root of the task. This limitation means that there cannot be more than one instance of the task on the device at the same time.
(4)是否能有其他的Activity在它所在的任务中。SingleInstance类型的Activity是它所在任务中唯一的Activity。如果它启动了其他的Activity,不管那个Activity的启动模式如何,它都会加载到一个不同的任务中。在其他的方面,SingleInstance和SingleTask启动模式是相同的。(4) Whether there are other Activity in its task. An Activity of type SingleInstance is the only Activity in its task. If it starts another Activity, it will be loaded into a different task regardless of the startup mode of that Activity. In other respects, the SingleInstance and SingleTask startup modes are identical.
(5)其他三种模式运行任务中有多个Activity。SingleTask总是任务中的根Activity,但是它可以启动其他的Activity并分配到它所在的任务中。Standard和SingleTop类型的Activity可以出现在任务中的任何地方。(5) There are multiple Activities in the other three modes of running tasks. SingleTask is always the root activity in the task, but it can start other activities and be assigned to the task in which it is located. Activity of type Standard and SingleTop can appear anywhere in the task.
(6)是否启动一个新的实例来处理一个新的行为。对默认的Standard启动模式来说,对于每一个行为都会创建一个新的实例来响应。每个实例只处理一个行为。对于SingleTop启动模式,如果一个已经存在的实例位于目标任务Activity栈的栈顶,那么它将被重用来处理这个行为。如果它不在栈顶,它将不会被重用,而是为行为创建一个新的实例,并压入栈中。(6) Whether to start a new instance to handle a new behavior. For the default Standard startup mode, a new instance is created in response to each action. Only one behavior is handled per instance. For SingleTop startup mode, if an existing instance is at the top of the target task's Activity stack, it will be reused to handle this behavior. If it's not at the top of the stack, it won't be reused, but a new instance of the behavior is created and pushed onto the stack.
例如,一个任务的Activity栈由根Activity A、B、C和D从上到下按这样的顺序组成,所以这个栈就是A-B-C-D。一个行为指向类型为D的Activity。如果D是默认的Standard启动模式,一个新的实例会被启动,栈现在就是这样A-B-C-D-D。但是,如果D的加载模式是SingleTop,已经存在的实例会用来处理这个行为(因为它在栈的顶端),并且栈中还应该是A-B-C-D。For example, a task's activity stack consists of root activities A, B, C, and D in this order from top to bottom, so the stack is A-B-C-D. An action points to an Activity of type D. If D was the default Standard startup mode, a new instance would be started and the stack would now be A-B-C-D-D. However, if D's load mode is SingleTop, the existing instance will be used to handle this behavior (because it's at the top of the stack), and the stack should also be A-B-C-D.
在前面提到,SingleTask和SingleInstance类型的Activity最多只有一个实例,所以它们的实例应该会处理每个新的行为。SingleInstance类型的Activity总是在栈的顶端(因为它是任务中唯一的一个Activity),所以总是能够适当的处理行为。然而,SingleTask类型的Activity也许会有其他的Activity在它的上面。如果是这样的话,那就不能处理这个行为,这个行为被丢弃。即使这个行为被丢弃了,它的到来也会导致那些应该保留不变任务显示到前台来。As mentioned earlier, Activities of type SingleTask and SingleInstance have at most one instance, so their instance should handle each new behavior. An Activity of type SingleInstance is always at the top of the stack (because it is the only Activity in the task), so it can always handle the behavior appropriately. However, an Activity of type SingleTask may have other Activity on top of it. If so, then the behavior cannot be handled and the behavior is discarded. Even if this behavior is discarded, its arrival will cause tasks that should remain unchanged to be brought to the foreground.
进一步地,在对各个Task预设的多个注册界面进行分组时,可以按照不同的启动模式对各个Task预设的多个注册界面进行分组,其中,一种启动模式对应一个组。Further, when the multiple preset registration interfaces of each Task are grouped, the multiple preset registration interfaces of each Task may be grouped according to different startup modes, wherein one startup mode corresponds to one group.
如图4所示,存在LaunchMode为SingleTask的行1),为Standard的行2),以及为SingleTop的行3)。图4中的每个圆圈表示注册界面,可以看到,1)已被占用了两个注册界面,2)被占用一个注册界面,3)没有被占用。在理解时类似停车位,假如用户想停车,则应该有如下几个步骤。As shown in FIG. 4 , there are row 1) whose LaunchMode is SingleTask, row 2) which is Standard, and row 3) whose LaunchMode is SingleTop. Each circle in FIG. 4 represents a registration interface, and it can be seen that 1) two registration interfaces are occupied, 2) one registration interface is occupied, and 3) is not occupied. Similar to a parking space in understanding, if the user wants to park, there should be the following steps.
步骤1,首先要知道自己是什么车。如果是轿车,则可以停;如果是水泥罐车,也许就不行了。也即明确自己的Activity类型,不能把SingleTask的Activity停在Standard的位置上。
步骤2,通过观察或者咨询物业管理员,以寻找适合自己的空余车位。也即从多个注册界面寻找应该使用哪个。Step 2: Find a suitable vacant parking space by observing or consulting the property manager. That is, finding which one should be used from multiple registration interfaces.
步骤3,将车准确停在车位上。也即将目标注册界面分配给当前活动界面使用。
步骤4,下次找时,直接找车位即可。毕竟相似的车很常见。也就是说,直接通过遍历所有注册界面,从中寻找符合的目标注册界面即可。Step 4. When looking for the next time, just look for the parking space directly. After all, similar cars are common. That is to say, simply traverse all the registration interfaces, and find the matching target registration interface from them.
基于上述对各个Task预设的多个注册界面的分组,即一种启动模式对应一个组,上文步骤S308中依据预设的选取策略从目标Task对应的所有注册界面中选取目标注册界面,本发明实施例提供了一种可选的方案,图5示出了根据本发明一实施例的选取目标注册界面的方法的流程图。如图5所示,该方法至少可以包括以下步骤S502至S508。Based on the above-mentioned grouping of multiple registration interfaces preset for each task, that is, one startup mode corresponds to one group, in the above step S308, the target registration interface is selected from all the registration interfaces corresponding to the target task according to the preset selection strategy. The embodiment of the present invention provides an optional solution, and FIG. 5 shows a flowchart of a method for selecting a target registration interface according to an embodiment of the present invention. As shown in FIG. 5 , the method may at least include the following steps S502 to S508.
步骤S502,确定当前活动界面的启动模式。Step S502, determining the startup mode of the current active interface.
步骤S504,在目标Task对应的多组注册界面中,查找当前活动界面的启动模式对应的分组。Step S504, in the multiple groups of registration interfaces corresponding to the target Task, search for the group corresponding to the startup mode of the current active interface.
步骤S506,在当前活动界面的启动模式对应的分组中查找所有注册界面。Step S506: Search for all registered interfaces in the group corresponding to the startup mode of the current active interface.
步骤S508,在查找到的所有注册界面中确定使用状态为空余状态的注册界面,并从中选取任意注册界面作为目标注册界面。Step S508 , among all the found registration interfaces, determine a registration interface whose usage state is a free state, and select any registration interface from it as a target registration interface.
本发明实施例基于不同的启动模式选取目标注册界面,实现快速、有效地选取目的,保证了任务界面的正常启动。The embodiment of the present invention selects the target registration interface based on different startup modes, realizes the purpose of quick and effective selection, and ensures the normal startup of the task interface.
进一步地,在上文步骤S310中将目标注册界面分配给当前活动界面使用时,本发明实施例可以将目标注册界面的信息传递给插件的加载器,由插件的加载器根据目标注册界面的信息启动目标注册界面,供当前活动界面使用。Further, when the target registration interface is allocated to the current active interface for use in the above step S310, the embodiment of the present invention can transfer the information of the target registration interface to the loader of the plug-in, and the loader of the plug-in can transfer the information of the target registration interface according to the information of the target registration interface. Start the target registration interface for use by the currently active interface.
下面将通过一具体实施例来详细介绍本发明的实现插件的多任务栈的方法的过程。该实施例以Android系统为例,活动界面为Activity,Task为Activity栈,宿主的配置文件为AndroidManifest.xml。The process of the method for implementing the multi-task stack of a plug-in of the present invention will be described in detail below through a specific embodiment. In this embodiment, the Android system is taken as an example, the activity interface is Activity, the Task is the Activity stack, and the configuration file of the host is AndroidManifest.xml.
图6示出了根据本发明一实施例的实现插件的多任务栈的方法的流程图。如图6所示,该方法至少可以包括以下步骤S602至S620。FIG. 6 shows a flowchart of a method for implementing a multitasking stack of a plug-in according to an embodiment of the present invention. As shown in FIG. 6 , the method may at least include the following steps S602 to S620.
步骤S602,读取宿主的配置文件,查找在宿主的配置文件中注册的宿主的多个Task。Step S602: Read the configuration file of the host, and search for multiple tasks of the host registered in the configuration file of the host.
步骤S604,在宿主中为多个Task中的各个Task预设多个注册界面。Step S604, preset multiple registration interfaces for each Task in the multiple Tasks in the host.
步骤S606,对各个Task预设的多个注册界面进行分组,其中,各组对应一个或多个注册界面。Step S606: Group multiple registration interfaces preset for each Task, wherein each group corresponds to one or more registration interfaces.
在该步骤中,例如可以分组为N组,每组有M个注册界面。并且,可以按照不同的启动模式对各个Task预设的多个注册界面进行分组,其中,一种启动模式对应一个组。这里,不同的启动模式可以包括Standard、SingleTop、SingleTask、SingleInstance中的任意之一,关于各种启动模式的区别请参见前文介绍,此处不再赘述。In this step, for example, it can be grouped into N groups, and each group has M registration interfaces. In addition, multiple registration interfaces preset for each Task can be grouped according to different startup modes, wherein one startup mode corresponds to one group. Here, different startup modes may include any one of Standard, SingleTop, SingleTask, and SingleInstance. For the differences between various startup modes, please refer to the previous introduction, which will not be repeated here.
步骤S608,获取宿主的插件的多个任务。Step S608, acquiring multiple tasks of the plug-in of the host.
在该步骤中,插件的多个任务,其各自能够实现插件的不同功能。In this step, multiple tasks of the plug-in, each of which can implement different functions of the plug-in.
步骤S610,在宿主的配置文件中,注册多个任务各自的活动界面在宿主的多个Task中所属的Task。Step S610, in the configuration file of the host, register the tasks to which the respective activity interfaces of the multiple tasks belong among the multiple tasks of the host.
例如,宿主的多个Task分别为Task1、Task2、Task3,则可以在宿主的配置文件中注册多个任务各自的活动界面属于Task1、Task2或者Task3,需要说明的是,此处例举仅是示意性的,并不对本发明实施例进行限制。For example, if the multiple tasks of the host are respectively Task1, Task2, and Task3, you can register the respective activity interfaces of the multiple tasks in the configuration file of the host to belong to Task1, Task2 or Task3. It should be noted that the examples here are only for illustration. It is not intended to limit the embodiments of the present invention.
进一步地,可以在宿主的配置文件中注册多个任务各自的活动界面的TaskAffinity属性,由该属性指示活动界面在多个Task中所属的Task。仍然以上述例举为例,对于多个任务中的各个任务,可以在宿主的配置文件中注册各个任务的活动界面的TaskAffinity属性,由该属性指示活动界面属于Task1、Task2或者Task3。Further, the TaskAffinity attribute of the respective activity interfaces of multiple tasks may be registered in the configuration file of the host, and the attribute indicates the Task to which the activity interfaces belong in the multiple tasks. Still taking the above example as an example, for each task in the multiple tasks, the TaskAffinity attribute of the activity interface of each task may be registered in the configuration file of the host, and the attribute indicates that the activity interface belongs to Task1, Task2 or Task3.
步骤S612,当宿主加载插件并启动多个任务中的任意任务的当前活动界面时,在配置文件中查找当前活动界面所属的目标Task。Step S612, when the host loads the plug-in and starts the current active interface of any task among the multiple tasks, it searches the configuration file for the target Task to which the current active interface belongs.
步骤S614,确定当前活动界面的启动模式,在目标Task对应的多组注册界面中,查找当前活动界面的启动模式对应的分组。Step S614: Determine the startup mode of the current active interface, and search for the group corresponding to the startup mode of the current active interface in the multiple groups of registration interfaces corresponding to the target Task.
步骤S616,在当前活动界面的启动模式对应的分组中查找所有注册界面。Step S616: Search for all registered interfaces in the group corresponding to the startup mode of the current active interface.
步骤S618,在查找到的所有注册界面中确定使用状态为空余状态的注册界面,并从中选取任意注册界面作为目标注册界面。Step S618 , among all the found registration interfaces, determine a registration interface whose usage state is a free state, and select any registration interface from it as a target registration interface.
步骤S620,将目标注册界面的信息传递给插件的加载器,由插件的加载器根据目标注册界面的信息启动目标注册界面,供当前活动界面使用。In step S620, the information of the target registration interface is transmitted to the loader of the plug-in, and the loader of the plug-in starts the target registration interface according to the information of the target registration interface for use by the currently active interface.
举例来说,在宿主的配置文件AndroidManifest.xml中注册插件的某个任务的Activity1属于Task1,则框架会到宿主中查找Task1的所有Activity,找到合适的Activity的时候,就将它分配给插件的Activity1使用。For example, if the Activity1 of a task that registers the plugin in the host's configuration file AndroidManifest.xml belongs to Task1, the framework will go to the host to find all the Activities of Task1, and when it finds a suitable Activity, it will be assigned to the plugin's Activity1. Activity1 use.
本发明实施例在宿主的配置文件中注册多个任务各自的活动界面所属的Task,并且不同的任务各自的活动界面属于不同的Task,这样使得不同的任务之间能够自由切换,无需退出任务。并且,本发明实施例在启动任意任务的当前活动界面时,能够从当前活动界面所属的目标Task对应的所有注册界面中选取目标注册界面,将目标注册界面分配给当前活动界面使用,保证了任务界面的正常启动。In the embodiment of the present invention, the tasks to which the respective active interfaces of multiple tasks belong are registered in the configuration file of the host, and the respective active interfaces of different tasks belong to different tasks, so that different tasks can be switched freely without exiting the task. In addition, when the current active interface of any task is started in the embodiment of the present invention, the target registration interface can be selected from all the registration interfaces corresponding to the target Task to which the current active interface belongs, and the target registration interface can be allocated to the current active interface for use, thereby ensuring the task of normal startup of the interface.
需要说明的是,实际应用中,上述所有可选实施方式可以采用结合的方式任意组合,形成本发明的可选实施例,在此不再一一赘述。It should be noted that, in practical applications, all the above-mentioned optional embodiments may be combined arbitrarily to form optional embodiments of the present invention, which will not be repeated here.
基于上文各个实施例提供的插件的多进程管理方法,基于同一发明构思,本发明实施例还提供了一种插件的多进程管理装置。Based on the plug-in multi-process management methods provided by the above embodiments, and based on the same inventive concept, an embodiment of the present invention further provides a plug-in multi-process management apparatus.
图7示出了根据本发明一实施例的插件的多进程管理装置的结构示意图。如图7所示,该装置至少可以包括第一注册模块710、读取模块720、建立模块730、查找模块740以及运行模块750。FIG. 7 shows a schematic structural diagram of a multi-process management apparatus for a plug-in according to an embodiment of the present invention. As shown in FIG. 7 , the apparatus may at least include a
现介绍本发明实施例的插件的多进程管理装置的各组成或器件的功能以及各部分间的连接关系:The functions of each component or device of the multi-process management device for the plug-in according to the embodiment of the present invention and the connection relationship between each part are now introduced:
第一注册模块710,适于在宿主的配置文件中注册多个预留进程;A
读取模块720,与第一注册模块710相耦合,适于当宿主加载插件时,读取宿主加载的插件中每个组件声明的进程;The
建立模块730,与读取模块720相耦合,适于在所述每个组件声明的进程与注册的多个预留进程之间建立对应关系;A establishing
查找模块740,与建立模块730相耦合,适于当在插件中启动任意组件时,根据所述对应关系查找所述任意组件声明的进程对应的目标预留进程;The
运行模块750,与查找模块740相耦合,适于在所述目标预留进程中运行所述任意组件。An
在本发明一实施例中,插件中每个组件的类型包括下列至少之一:In an embodiment of the present invention, the type of each component in the plug-in includes at least one of the following:
活动界面Activity、服务Service、内容提供者Content Provider、广播接收器Broadcast Receiver。Activity interface Activity, Service Service, Content Provider Content Provider, Broadcast Receiver Broadcast Receiver.
在本发明一实施例中,所述第一注册模块710还适于:In an embodiment of the present invention, the
获取宿主的插件中每个组件声明的进程;Get the process declared by each component in the host's plugin;
根据所述每个组件声明的进程,在宿主的配置文件中注册相应的多个预留进程。According to the process declared by each component, the corresponding multiple reserved processes are registered in the configuration file of the host.
在本发明一实施例中,所述第一注册模块710还适于:In an embodiment of the present invention, the
在宿主的配置文件中写入进程信息,以注册各个预留进程,其中,所述进程信息至少包括以下信息:Write process information in the configuration file of the host to register each reserved process, wherein the process information at least includes the following information:
进程的编号、进程的状态、进程对应的插件名、插件中不同类型的组件的使用数量。The number of the process, the state of the process, the name of the plug-in corresponding to the process, and the number of different types of components used in the plug-in.
在本发明一实施例中,如图8所示,上文图7展示的装置还可以包括:In an embodiment of the present invention, as shown in FIG. 8 , the apparatus shown in FIG. 7 above may further include:
标记模块810,与运行模块750相耦合,适于在所述运行模块750在所述目标预留进程中运行所述任意组件之后,将所述目标预留进程的状态标记为表示已分配的状态。A marking
在本发明一实施例中,上文图7展示的装置还可以包括:In an embodiment of the present invention, the apparatus shown in FIG. 7 above may further include:
获取模块(附图中未示出),适于获取宿主的插件的多个任务,其中,所述多个任务各自能够实现插件的不同功能;an acquisition module (not shown in the drawings), adapted to acquire multiple tasks of the plug-in of the host, wherein each of the multiple tasks can implement different functions of the plug-in;
第二注册模块(附图中未示出),与获取模块相耦合,适于在宿主的配置文件中注册所述多个任务各自的活动界面所属的Task,其中,不同的任务各自的活动界面属于不同的Task;The second registration module (not shown in the drawings), coupled with the acquisition module, is adapted to register the Task to which the respective active interfaces of the multiple tasks belong in the configuration file of the host, wherein the respective active interfaces of different tasks belong to different tasks;
目标Task查找模块(附图中未示出),与第二注册模块相耦合,适于当宿主加载插件并启动所述多个任务中的任意任务的当前活动界面时,在所述配置文件中查找所述当前活动界面所属的目标Task;The target Task search module (not shown in the accompanying drawings), coupled with the second registration module, is suitable for when the host loads the plug-in and starts the current active interface of any task in the plurality of tasks, in the configuration file Find the target Task to which the current active interface belongs;
选取模块(附图中未示出),与目标Task查找模块相耦合,适于在宿主中查找所述目标Task对应的所有注册界面,并依据预设的选取策略从所述目标Task对应的所有注册界面中选取目标注册界面;The selection module (not shown in the accompanying drawings), coupled with the target Task search module, is suitable for searching all the registration interfaces corresponding to the target Task in the host, and according to the preset selection strategy from all the corresponding target Tasks Select the target registration interface in the registration interface;
分配模块(附图中未示出),与选取模块相耦合,适于将所述目标注册界面分配给所述当前活动界面使用。An allocation module (not shown in the drawings), coupled with the selection module, is adapted to allocate the target registration interface to the currently active interface for use.
在本发明一实施例中,所述Task是具有栈结构的容器,能够放置一个或多个活动界面。In an embodiment of the present invention, the Task is a container with a stack structure, capable of placing one or more active interfaces.
在本发明一实施例中,同一个任务的活动界面属于同一个Task。In an embodiment of the present invention, the active interface of the same task belongs to the same Task.
在本发明一实施例中,所述第二注册模块还适于:In an embodiment of the present invention, the second registration module is further adapted to:
获取宿主的多个Task;Get multiple tasks of the host;
在宿主的配置文件中注册所述多个任务各自的活动界面的TaskAffinity属性,由该属性指示活动界面在所述多个Task中所属的Task。The TaskAffinity attribute of the respective activity interfaces of the multiple tasks is registered in the configuration file of the host, and the attribute indicates the task to which the activity interface belongs among the multiple tasks.
在本发明一实施例中,所述第二注册模块还适于:In an embodiment of the present invention, the second registration module is further adapted to:
读取宿主的配置文件;Read the host's configuration file;
查找在宿主的配置文件中注册的宿主的多个Task。Finds multiple tasks of the host registered in the host's configuration file.
在本发明一实施例中,上文图7展示的装置还可以包括:In an embodiment of the present invention, the apparatus shown in FIG. 7 above may further include:
配置模块(附图中未示出),适于在宿主中为所述多个Task中的各个Task预设多个注册界面;对各个Task预设的多个注册界面进行分组,其中,各组对应一个或多个注册界面。A configuration module (not shown in the accompanying drawings), adapted to preset multiple registration interfaces for each Task in the multiple Tasks in the host; group the multiple preset registration interfaces of each Task, wherein each group Corresponds to one or more registration interfaces.
在本发明一实施例中,所述配置模块还适于:In an embodiment of the present invention, the configuration module is further adapted to:
按照不同的启动模式对各个Task预设的多个注册界面进行分组,其中,一种启动模式对应一个组,所述不同的启动模式包括下列任意之一:The multiple registration interfaces preset by each Task are grouped according to different startup modes, wherein one startup mode corresponds to one group, and the different startup modes include any one of the following:
Standard、SingleTop、SingleTask、SingleInstance。Standard, SingleTop, SingleTask, SingleInstance.
在本发明一实施例中,所述选取模块还适于:In an embodiment of the present invention, the selection module is further adapted to:
确定所述当前活动界面的启动模式;determining the startup mode of the currently active interface;
在所述目标Task对应的多组注册界面中,查找所述当前活动界面的启动模式对应的分组;In the multiple groups of registration interfaces corresponding to the target Task, search for the grouping corresponding to the startup mode of the currently active interface;
在所述当前活动界面的启动模式对应的分组中查找所有注册界面;Find all registered interfaces in the grouping corresponding to the startup mode of the current active interface;
在查找到的所有注册界面中确定使用状态为空余状态的注册界面,并从中选取任意注册界面作为目标注册界面。Among all the registration interfaces found, the registration interface whose usage state is in the idle state is determined, and any registration interface is selected as the target registration interface.
在本发明一实施例中,所述分配模块还适于:In an embodiment of the present invention, the distribution module is further adapted to:
将所述目标注册界面的信息传递给插件的加载器,由插件的加载器根据所述目标注册界面的信息启动目标注册界面供所述当前活动界面使用。The information of the target registration interface is transmitted to the loader of the plug-in, and the loader of the plug-in starts the target registration interface for use by the currently active interface according to the information of the target registration interface.
根据上述任意一个可选实施例或多个可选实施例的组合,本发明实施例能够达到如下有益效果:According to any one of the foregoing optional embodiments or a combination of multiple optional embodiments, the embodiments of the present invention can achieve the following beneficial effects:
在本发明实施例中,在宿主的配置文件中注册多个预留进程,当宿主加载插件时,读取宿主加载的插件中每个组件声明的进程;随后,在每个组件声明的进程与注册的多个预留进程之间建立对应关系;之后,当在插件中启动任意组件时,根据对应关系查找任意组件声明的进程对应的目标预留进程;在目标预留进程中运行任意组件。可以看到,本发明实施例在每个组件声明的进程与注册的多个预留进程之间建立对应关系,从而,当在插件中启动任意组件时,根据对应关系查找任意组件声明的进程对应的目标预留进程,进而在目标预留进程中运行任意组件,解决了现有技术中插件的组件只能运行在同一个进程的问题,实现了插件的多进程运行的目的。In the embodiment of the present invention, multiple reserved processes are registered in the configuration file of the host, and when the host loads the plug-in, the process declared by each component in the plug-in loaded by the host is read; A corresponding relationship is established between multiple registered reserved processes; after that, when any component is started in the plug-in, the target reserved process corresponding to the process declared by any component is searched according to the corresponding relationship; any component is run in the target reserved process. It can be seen that the embodiment of the present invention establishes a corresponding relationship between the process declared by each component and the multiple registered reserved processes, so that when any component is started in the plug-in, the corresponding relationship of the process declared by any component is searched according to the corresponding relationship. The target reservation process is established, and any component is run in the target reservation process, which solves the problem that the components of the plug-in can only run in the same process in the prior art, and realizes the purpose of multi-process operation of the plug-in.
进一步地,本发明实施例在宿主的配置文件中注册多个任务各自的活动界面所属的Task,并且不同的任务各自的活动界面属于不同的Task,这样使得不同的任务之间能够自由切换,无需退出任务。并且,本发明实施例在启动任意任务的当前活动界面时,能够从当前活动界面所属的目标Task对应的所有注册界面中选取目标注册界面,将目标注册界面分配给当前活动界面使用,保证了任务界面的正常启动。Further, the embodiment of the present invention registers the Task to which the respective active interfaces of multiple tasks belong in the configuration file of the host, and the respective active interfaces of different tasks belong to different Tasks, so that different tasks can be switched freely without the need for Exit the task. In addition, when the current active interface of any task is started in the embodiment of the present invention, the target registration interface can be selected from all the registration interfaces corresponding to the target Task to which the current active interface belongs, and the target registration interface can be allocated to the current active interface for use, thereby ensuring the task of normal startup of the interface.
在此处所提供的说明书中,说明了大量具体细节。然而,能够理解,本发明的实施例可以在没有这些具体细节的情况下实践。在一些实例中,并未详细示出公知的方法、结构和技术,以便不模糊对本说明书的理解。In the description provided herein, numerous specific details are set forth. It will be understood, however, that embodiments of the invention may be practiced without these specific details. In some instances, well-known methods, structures and techniques have not been shown in detail in order not to obscure an understanding of this description.
类似地,应当理解,为了精简本公开并帮助理解各个发明方面中的一个或多个,在上面对本发明的示例性实施例的描述中,本发明的各个特征有时被一起分组到单个实施例、图、或者对其的描述中。然而,并不应将该公开的方法解释成反映如下意图:即所要求保护的本发明要求比在每个权利要求中所明确记载的特征更多的特征。更确切地说,如下面的权利要求书所反映的那样,发明方面在于少于前面公开的单个实施例的所有特征。因此,遵循具体实施方式的权利要求书由此明确地并入该具体实施方式,其中每个权利要求本身都作为本发明的单独实施例。Similarly, it is to be understood that in the above description of exemplary embodiments of the invention, various features of the invention are sometimes grouped together into a single embodiment, figure, or its description. This disclosure, however, should not be construed as reflecting an intention that the invention as claimed requires more features than are expressly recited in each claim. Rather, as the following claims reflect, inventive aspects lie in less than all features of a single foregoing disclosed embodiment. Thus, the claims following the Detailed Description are hereby expressly incorporated into this Detailed Description, with each claim standing on its own as a separate embodiment of this invention.
本领域那些技术人员可以理解,可以对实施例中的设备中的模块进行自适应性地改变并且把它们设置在与该实施例不同的一个或多个设备中。可以把实施例中的模块或单元或组件组合成一个模块或单元或组件,以及此外可以把它们分成多个子模块或子单元或子组件。除了这样的特征和/或过程或者单元中的至少一些是相互排斥之外,可以采用任何组合对本说明书(包括伴随的权利要求、摘要和附图)中公开的所有特征以及如此公开的任何方法或者设备的所有过程或单元进行组合。除非另外明确陈述,本说明书(包括伴随的权利要求、摘要和附图)中公开的每个特征可以由提供相同、等同或相似目的的替代特征来代替。Those skilled in the art will appreciate that the modules in the device in the embodiment can be adaptively changed and arranged in one or more devices different from the embodiment. The modules or units or components in the embodiments may be combined into one module or unit or component, and further they may be divided into multiple sub-modules or sub-units or sub-assemblies. All features disclosed in this specification (including accompanying claims, abstract and drawings) and any method so disclosed may be employed in any combination unless at least some of such features and/or procedures or elements are mutually exclusive. All processes or units of equipment are combined. Each feature disclosed in this specification (including accompanying claims, abstract and drawings) may be replaced by alternative features serving the same, equivalent or similar purpose, unless expressly stated otherwise.
此外,本领域的技术人员能够理解,尽管在此所述的一些实施例包括其它实施例中所包括的某些特征而不是其它特征,但是不同实施例的特征的组合意味着处于本发明的范围之内并且形成不同的实施例。例如,在权利要求书中,所要求保护的实施例的任意之一都可以以任意的组合方式来使用。Furthermore, those skilled in the art will appreciate that although some of the embodiments described herein include certain features, but not others, included in other embodiments, that combinations of features of different embodiments are intended to be within the scope of the invention within and form different embodiments. For example, in the claims, any of the claimed embodiments may be used in any combination.
本发明的各个部件实施例可以以硬件实现,或者以在一个或者多个处理器上运行的软件模块实现,或者以它们的组合实现。本领域的技术人员应当理解,可以在实践中使用微处理器或者数字信号处理器(DSP)来实现根据本发明实施例的一种插件的多进程管理装置中的一些或者全部部件的一些或者全部功能。本发明还可以实现为用于执行这里所描述的方法的一部分或者全部的设备或者装置程序(例如,计算机程序和计算机程序产品)。这样的实现本发明的程序可以存储在计算机可读介质上,或者可以具有一个或者多个信号的形式。这样的信号可以从因特网网站上下载得到,或者在载体信号上提供,或者以任何其他形式提供。Various component embodiments of the present invention may be implemented in hardware, or in software modules running on one or more processors, or in a combination thereof. Those skilled in the art should understand that a microprocessor or a digital signal processor (DSP) may be used in practice to implement some or all of some or all of some or all of the components in a plug-in multi-process management apparatus according to an embodiment of the present invention Function. The present invention can also be implemented as apparatus or apparatus programs (eg, computer programs and computer program products) for performing part or all of the methods described herein. Such a program implementing the present 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 Internet sites, or provided on carrier signals, or in any other form.
应该注意的是上述实施例对本发明进行说明而不是对本发明进行限制,并且本领域技术人员在不脱离所附权利要求的范围的情况下可设计出替换实施例。在权利要求中,不应将位于括号之间的任何参考符号构造成对权利要求的限制。单词“包含”不排除存在未列在权利要求中的元件或步骤。位于元件之前的单词“一”或“一个”不排除存在多个这样的元件。本发明可以借助于包括有若干不同元件的硬件以及借助于适当编程的计算机来实现。在列举了若干装置的单元权利要求中,这些装置中的若干个可以是通过同一个硬件项来具体体现。单词第一、第二、以及第三等的使用不表示任何顺序。可将这些单词解释为名称。It should be noted that the above-described embodiments illustrate rather than limit the invention, and that alternative embodiments may be devised by those skilled in the art without departing from the scope of the appended claims. In the claims, any reference signs placed between parentheses shall not be construed as limiting the claim. The word "comprising" does not exclude the presence of elements or steps not listed in a claim. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. The invention can be implemented by means of hardware comprising several different elements and by means of a suitably programmed computer. In a unit claim enumerating several means, several of these means may be embodied by one and the same item of hardware. The use of the words first, second, and third, etc. do not denote any order. These words can be interpreted as names.
至此,本领域技术人员应认识到,虽然本文已详尽示出和描述了本发明的多个示例性实施例,但是,在不脱离本发明精神和范围的情况下,仍可根据本发明公开的内容直接确定或推导出符合本发明原理的许多其他变型或修改。因此,本发明的范围应被理解和认定为覆盖了所有这些其他变型或修改。By now, those skilled in the art will recognize that, although various exemplary embodiments of the present invention have been illustrated and described in detail herein, the present invention may still be implemented in accordance with the present disclosure without departing from the spirit and scope of the present invention. The content directly determines or derives many other variations or modifications consistent with the principles of the invention. Accordingly, the scope of the present invention should be understood and deemed to cover all such other variations or modifications.
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201710273785.3ACN107239297B (en) | 2017-04-21 | 2017-04-21 | A plug-in multi-process management method and device |
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201710273785.3ACN107239297B (en) | 2017-04-21 | 2017-04-21 | A plug-in multi-process management method and device |
| Publication Number | Publication Date |
|---|---|
| CN107239297A CN107239297A (en) | 2017-10-10 |
| CN107239297Btrue CN107239297B (en) | 2020-10-20 |
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN201710273785.3AExpired - Fee RelatedCN107239297B (en) | 2017-04-21 | 2017-04-21 | A plug-in multi-process management method and device |
| Country | Link |
|---|---|
| CN (1) | CN107239297B (en) |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN108089895B (en)* | 2017-12-19 | 2021-03-19 | 珠海市君天电子科技有限公司 | Activity registration method and device in plug-in, electronic equipment and storage medium |
| CN109032674B (en)* | 2018-06-07 | 2021-08-24 | 烽火通信科技股份有限公司 | Multi-process management method, system and network equipment |
| CN109144692A (en)* | 2018-07-16 | 2019-01-04 | 北京奇虎科技有限公司 | A kind of method, apparatus and terminal for the process of distributing |
| CN109739567B (en)* | 2018-11-26 | 2024-05-07 | 平安科技(深圳)有限公司 | Method, device, computer equipment and storage medium for rapidly terminating application program |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN104699537A (en)* | 2015-03-18 | 2015-06-10 | 北京奇虎科技有限公司 | Program control method, activity module scheduling method and corresponding devices thereof |
| CN104750528B (en)* | 2015-03-31 | 2016-08-24 | 北京奇虎科技有限公司 | A kind of assembly management method and apparatus in Android program |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN104699537A (en)* | 2015-03-18 | 2015-06-10 | 北京奇虎科技有限公司 | Program control method, activity module scheduling method and corresponding devices thereof |
| CN104750528B (en)* | 2015-03-31 | 2016-08-24 | 北京奇虎科技有限公司 | A kind of assembly management method and apparatus in Android program |
| Publication number | Publication date |
|---|---|
| CN107239297A (en) | 2017-10-10 |
| Publication | Publication Date | Title |
|---|---|---|
| CN107239297B (en) | A plug-in multi-process management method and device | |
| CN111158879B (en) | Scheduling method, device, machine-readable medium and system for system resources | |
| EP3403177B1 (en) | Managing delivery of code and dependent data using application containers | |
| US9015724B2 (en) | Job dispatching with scheduler record updates containing characteristics combinations of job characteristics | |
| CN107430549A (en) | Union-based memory management | |
| CN104980454A (en) | Method, server and system for sharing resource data | |
| CN105718287A (en) | Program streaming execution method for intelligent terminal | |
| CN104750528B (en) | A kind of assembly management method and apparatus in Android program | |
| KR102338849B1 (en) | Method and system for providing stack memory management in real-time operating systems | |
| CN107277029A (en) | A kind of method of remote procedure call, device and computer equipment | |
| CN107818023B (en) | Thread-based message processing method, intelligent device and storage medium | |
| JP2014520346A5 (en) | ||
| CN111831410A (en) | Task processing method, device, storage medium and electronic device | |
| CN105279017A (en) | Cloud test platform based task distribution method, apparatus and system | |
| CN104750555A (en) | Management method and device for progresses in Android program | |
| CN107193587B (en) | A method and apparatus for realizing a multitasking stack of a plug-in | |
| CN111126604A (en) | Model training method, device, server and storage medium | |
| CN111831411A (en) | Task processing method, device, storage medium and electronic device | |
| CN112784199A (en) | Event flow processing method, device, storage medium and program product | |
| CN111352710B (en) | Process management method and device, computing device, storage medium | |
| CN109901925B (en) | Method and system for task processing | |
| CN112181637B (en) | Method and device for allocating memory resources | |
| CN109905258B (en) | PaaS management method, device and storage medium | |
| CN111813541B (en) | Task scheduling method, device, medium and equipment | |
| CN117591282A (en) | GPU-based resource allocation method, device, equipment and storage medium |
| 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 | ||
| CF01 | Termination of patent right due to non-payment of annual fee | Granted publication date:20201020 | |
| CF01 | Termination of patent right due to non-payment of annual fee |