CN-121996307-A - Information processing method, apparatus, terminal device, storage medium, and program product
Abstract
The disclosure relates to an information processing method, a device, a terminal device, a storage medium and a program product, wherein the information processing method comprises the steps of determining a host application program, a runtime environment corresponding to the host application program and a target plug-in corresponding to the host application program; the target plug-in is stored in a plug-in package, wherein the host application program, the runtime environment and the plug-in package are stored independently of each other, and the host application program loads the target plug-in based on the runtime environment. Because the host application program, the runtime environment and the plug-in package are stored independently of each other, the three are decoupled, the complexity of the system is reduced, and the plug-in package is light.
Inventors
- LIU ZHIXIANG
- YU JUN
- DU XIYAO
- YANG SONG
- YIN JIANAN
- HE GANG
- CHANG XING
- LI WEI
Assignees
- 北京小米移动软件有限公司
Dates
- Publication Date
- 20260508
- Application Date
- 20241101
Claims (20)
- 1. An information processing method, characterized by comprising: determining a host application program, a runtime environment corresponding to the host application program and a target plug-in corresponding to the host application program; Storing the target plug-in a plug-in package, wherein the host application program, the runtime environment and the plug-in package are stored independently of each other; the host application loads the target plug-in based on the runtime environment.
- 2. The method of claim 1, wherein the number of target inserts is a plurality; the storing the target plugin in a plugin package includes: Storing the target plugin into a plurality of plugin packages.
- 3. The method of claim 2, wherein the storing the target plug-in into a plurality of plug-in packages comprises: And respectively storing the target plug-ins into a plurality of plug-in packages in response to the number of the target plug-ins being greater than the preset number of plug-ins capable of storing the plug-ins in a single plug-in package.
- 4. A method according to claim 3, wherein said storing said target plug-ins into a plurality of said plug-in packages, respectively, comprises: Respectively storing the target plug-ins into a plurality of plug-in packages according to the preset quantity in response to the difference of the preset quantity corresponding to at least part of the plug-in packages; the number of the target plugins stored in the plugin package is positively correlated with the preset number corresponding to the plugin package.
- 5. A method according to claim 3, wherein said storing said target plug-ins into a plurality of said plug-in packages, respectively, comprises: and storing the target plugins in the plugin packages according to the preset quantity corresponding to the plugin packages, wherein the quantity of the target plugins stored in the plugin packages is the same or the quantity of the target plugins stored in at least part of the plugin packages is different.
- 6. The method of claim 2, wherein the storing the target plug-in into a plurality of plug-in packages comprises: and storing the target plugins in a plurality of plugin packages in response to the number of the target plugins being smaller than the preset number of plugins which can be stored in a single plugin package, wherein each plugin package stores one target plugin.
- 7. The method of claim 1, wherein the storing the target plugin in a plugin package comprises: Judging whether the plug-in package stores the target plug-in; And storing the target plugin in a plugin package in response to the target plugin not being stored in the plugin package.
- 8. The method of claim 1, wherein the host application loading the target plug-in based on the runtime environment comprises: Registering a proxy component of a target component in the host application program, wherein the proxy component is used for calling the target component of the target plug-in; Generating a plug-in class corresponding to the target component in the target plug-in; Searching and loading the plug-in class by calling the proxy component; And loading the target component of the target plug-in by calling the plug-in class.
- 9. The method of claim 8, wherein the target component comprises at least one of: A movable assembly; A service component; A broadcast receiver; a content provider.
- 10. The method of claim 1, wherein after loading the target plugin, the method further comprises: Responding to the detected update information of the target plug-in, and acquiring the latest version of the target plug-in, wherein the latest version has a calling path of the latest version; creating a first loader; according to the call path, searching and loading the target plug-in of the latest version through the first loader; And after the target plug-in of the latest version is loaded, updating the target plug-in the plug-in package to the latest version.
- 11. The method of claim 1, wherein the host application loading the target plug-in based on the runtime environment comprises: The host application program loads a first target class of the target plug-in through a second loader so as to realize the function corresponding to the first target class in the host application program; The target plug-in loads a second target class of other plug-ins through a third loader so as to realize the operation of the target plug-in according to the second target class; The second loader is used for loading the class of the target plugin by the host application program, and the third loader is used for loading the class of the plugin between plugins.
- 12. The method of claim 11, wherein the method further comprises: And the target plug-in loads a third target class of the host application program through the second loader and the third loader so as to realize the operation of the target plug-in according to the third target class.
- 13. The method of claim 1, wherein the host application includes backup information for the target plug-in; the host application loading the target plug-in based on the runtime environment, comprising: and when the direct loading of the target plug-in fails, searching and loading the target plug-in through the backup information contained in the host application program.
- 14. The method according to claim 1, wherein the method further comprises: Expanding a memory space for storing target files, wherein the target files comprise files required by starting the host application program; And storing the target file according to the expanded memory space, wherein the size of the memory space is positively correlated with the starting speed of the host application program.
- 15. The method of claim 1, wherein the host application loading the target plug-in based on the runtime environment comprises: Determining a white list of preloaded classes; According to the white list, before starting the target plugin, the host application program pre-loads the classes on the white list in the target plugin through a class loader.
- 16. The method of claim 1, further comprising, prior to loading the target plug-in: Closing verification of the class in the target plug-in; and loading the target plug-in after finding the class to be loaded.
- 17. An information processing apparatus, characterized by comprising: The determining module is used for determining a host application program, a runtime environment corresponding to the host application program and a target plug-in corresponding to the host application program; the storage module is used for storing the target plugin in a plugin package, wherein the host application program, the runtime environment and the plugin package are stored independently; And the loading module is used for loading the target plug-in by the host application program based on the runtime environment.
- 18. A terminal device, comprising: A processor and a memory for storing a computer program or executable instructions capable of running on the processor, wherein: A processor for executing the computer program or the executable instructions, the executable instructions performing the method of any of the preceding claims 1 to 16.
- 19. A non-transitory computer readable storage medium, characterized in that the non-transitory computer readable storage medium has stored therein a computer program or computer executable instructions, which when executed by a processor, implement the method of any of the preceding claims 1 to 16.
- 20. A computer program product comprising a computer program or executable instructions which, when executed by a processor, implement the method of any one of claims 1 to 16.
Description
Information processing method, apparatus, terminal device, storage medium, and program product Technical Field The present disclosure relates to the field of information processing technologies, and in particular, to an information processing method, an apparatus, a terminal device, a storage medium, and a computer program product. Background With the development of software and computer technology, more and more application programs are presented, and an operating system and application programs are usually installed in a terminal device, and different application programs have different functions. Each application program runs with several related information, the plug-in as one of them, through which related tasks can be performed. Disclosure of Invention The present disclosure provides an information processing method, apparatus, terminal device, storage medium, and computer program product. According to a first aspect of the disclosed embodiments, an information processing method is provided, which includes determining a host application program, a runtime environment corresponding to the host application program and a target plug-in corresponding to the host application program, storing the target plug-in a plug-in package, wherein the host application program, the runtime environment and the plug-in package are stored independently of each other, and the host application program loads the target plug-in based on the runtime environment. In one embodiment, the number of the target plugins is a plurality, and the storing the target plugins in a plugin package includes storing the target plugins in a plurality of plugin packages. In one embodiment, storing the target plugin into a plurality of plugin packages includes storing the target plugin into a plurality of plugin packages, respectively, in response to the number of target plugins being greater than a preset number of plugin packages capable of storing plugins. In one embodiment, the storing the target plugins in a plurality of plugin packages respectively includes storing the target plugins in a plurality of plugin packages respectively according to the preset number of the plugin packages in response to at least part of the preset number of the plugin packages being different, wherein the number of the target plugins stored in the plugin packages is positively correlated with the preset number of the plugin packages. In one embodiment, the storing the target plugins in a plurality of plugin packages respectively includes storing the target plugins in each plugin package in response to the preset number corresponding to each plugin package being the same, wherein the number of the target plugins stored in each plugin package is the same or the number of the target plugins stored in at least part of the plugin packages is different. In one embodiment, storing the target plugin into a plurality of plugin packages includes storing the target plugin in a plurality of plugin packages in response to the number of target plugins being less than a preset number of plugin packages capable of storing plugins, wherein each plugin package stores one of the target plugins. In one embodiment, the storing the target plugin in a plugin package includes determining whether the target plugin is already stored in the plugin package, and storing the target plugin in a plugin package in response to the target plugin not being stored in the plugin package. In one embodiment, the host application program loads the target plugin based on the runtime environment, and the method comprises the steps of registering a proxy component of a target component in the host application program, wherein the proxy component is used for calling the target component of the target plugin, generating a plugin class corresponding to the target component in the target plugin, searching and loading the plugin class by calling the proxy component, and loading the target component of the target plugin by calling the plugin class. In one embodiment, the target component comprises at least one of an active component, a service component, a broadcast receiver, and a content provider. In one embodiment, after loading the target plugin, the method further comprises the steps of responding to detection of update information of the target plugin to obtain the latest version of the target plugin, wherein the latest version has a self call path, creating a first loader, searching and loading the target plugin of the latest version through the first loader according to the call path, and updating the target plugin in the plugin package to the latest version after loading the target plugin of the latest version. In one embodiment, the host application program loads the target plugin based on the runtime environment, and the method comprises the steps that the host application program loads a first target class of the target plugin through a second loader so as to achieve a function corresponding to the