Method, apparatus, medium, and program product for loading components

By plug-inizing the application's components and loading component resources in an internal or external manner, combined with a priority strategy, the problems of increased package size and decreased installation speed caused by the componentized architecture are solved, thereby improving user experience and installation speed.

CN119248311BActive Publication Date: 2025-09-30SHANGHAI BILIBILI TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411275979.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-09-11
Publication Date
2025-09-30
Estimated Expiration
2044-09-11

AI Technical Summary

Technical Problem

In the prior art, the componentized architecture of applications leads to an increase in package size, a decrease in installation speed and user experience, especially when more functions are added.

Method used

By making the application's components plug-ins and loading component resources using built-in or external resources, combined with the priority strategies of preloading, on-demand loading, and idle loading, the number of components loaded during the first installation can be reduced and the installation speed can be increased.

Benefits of technology

It reduces the application package size, improves installation speed and user experience, especially the experience of new and upgraded users, and reduces user waiting time.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119248311B_ABST
    Figure CN119248311B_ABST
Patent Text Reader

Abstract

The present application provides a method, device, medium and program product for loading components. The method according to the present application includes: in response to a trigger instruction to download or update an application, determining one or more target components contained in the application that need to be loaded; determining resource mode information corresponding to the one or more target components, the resource mode information including a resource external mode and a resource built-in mode; based on the resource mode information, correspondingly obtaining component resources of the one or more target components for loading. The present application plugs the components of the application into plug-ins, and adopts a resource built-in or resource external method to obtain component resources for loading, so that users do not need to load all components when installing the application for the first time, thereby reducing the package size of the application, avoiding the bloated package size caused by the increase in functions, and improving the installation speed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a method, apparatus, computer-readable medium, and computer program product for loading a component. Background Art

[0002] Based on existing technology, component-based application architectures are primarily achieved by breaking applications down into independent, reusable components. These components can be developed, tested, and deployed independently, improving development efficiency and the modularity of the application. However, while this approach facilitates code maintenance and development, it also increases package size due to the introduction of external dependencies. Furthermore, as functionality increases, the amount of code continues to grow, impacting application installation speed and user experience. Summary of the Invention

[0003] Various aspects of the present application provide a method, apparatus, computer-readable medium, and computer program product for loading a component.

[0004] In one aspect of the present application, a method for loading a component is provided, wherein the method comprises:

[0005] In response to a trigger instruction to download or update an application, determining one or more target components included in the application that need to be loaded;

[0006] Determining resource mode information corresponding to the one or more target components, the resource mode information including an external resource mode and an internal resource mode;

[0007] Based on the resource mode information, component resources of the one or more target components are correspondingly acquired for loading.

[0008] In one aspect of the present application, a device for loading a component is provided, wherein the device comprises:

[0009] means for determining, in response to a trigger instruction for downloading or updating an application, one or more target components included in the application that need to be loaded;

[0010] means for determining resource mode information corresponding to the one or more target components, the resource mode information including a resource external mode and a resource internal mode;

[0011] The device is used to obtain component resources of the one or more target components for loading based on the resource mode information.

[0012] Another aspect of the present application provides an electronic device, comprising:

[0013] at least one processor; and

[0014] a memory communicatively connected to the at least one processor; wherein,

[0015] The memory stores instructions that can be executed by the at least one processor. The instructions are executed by the at least one processor to enable the at least one processor to perform the method of the embodiment of the application.

[0016] In another aspect of the present application, a computer-readable storage medium is provided, on which computer program instructions are stored. The computer program instructions can be executed by a processor to implement the method of the embodiment of the application.

[0017] In another aspect of the present application, a computer program product is provided, comprising a computer program, wherein when the computer program is executed by a processor, the method of the embodiment of the application is implemented.

[0018] The solution provided in the embodiment of the present application makes the components of the application program plug-in-based and adopts a built-in or external resource approach to obtain component resources for loading, thereby eliminating the need for users to load all components when installing the application program for the first time. This reduces the package size of the application program, avoids bloated package size due to increased functions, improves installation speed, and enhances the user experience for new and upgraded users. By setting priorities for components to be loaded and loading components using corresponding loading modes such as preloading, on-demand loading, or idle loading according to the priorities, user waiting time is reduced. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] In order to more clearly illustrate the technical solutions in the embodiments of the present application, a brief introduction will be given below to the drawings required for use in the embodiments or descriptions of the prior art. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0020] Other features, objects and advantages of the present application will become more apparent upon reading the detailed description of non-limiting embodiments made with reference to the following drawings:

[0021] Figure 1 A schematic diagram of a process for loading a component provided by an embodiment of the present application is shown;

[0022] Figure 2 A schematic diagram showing exemplary applications and components according to an embodiment of the present application is shown;

[0023] Figure 3 A schematic structural diagram of a device for loading a component provided in an embodiment of the present application is shown;

[0024] Figure 4 A structural diagram of a device suitable for implementing the solution in the embodiments of the present application is shown.

[0025] The same or similar reference numerals in the drawings represent the same or similar components. DETAILED DESCRIPTION

[0026] To make the purpose, technical solutions, and advantages of the embodiments of this application more clear, the technical solutions in the embodiments of this application will be clearly and completely described below in conjunction with the drawings in the embodiments of this application. Obviously, the described embodiments are part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.

[0027] In a typical configuration of the present application, the terminal and the equipment of the service network each include one or more processors (CPUs), input / output interfaces, network interfaces and memories.

[0028] Memory may include non-permanent storage in a computer-readable medium, in the form of random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of a computer-readable medium.

[0029] Computer-readable media include both permanent and non-permanent, removable and non-removable media, and can be implemented by any method or technology for information storage. Information can be computer program instructions, data structures, program modules, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disc-read only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassettes, magnetic tape, disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device.

[0030] Figure 1 A flow chart of a method for loading a component provided by an embodiment of the present application is shown, wherein the method comprises at least step S101, step S102 and step S103.

[0031] In practical scenarios, the execution subject of the above method can be a user device, or a device formed by integrating a user device and a network device through a network, or a program running on the above device. The user device includes but is not limited to various terminal devices such as computers, mobile phones, and tablet computers.

[0032] According to this embodiment, a user device can install or run an application (Application, App). Such an application can be a containerized application. For a containerized application, the application and all its runtime dependencies are packaged into an independent unit called a container. Each container can contain all components of the application. When running an application, the terminal device according to this embodiment can exchange data with the network device corresponding to the application.

[0033] Optionally, the application according to this embodiment is based on the Model-View-Intent (MVI) architecture. Based on the MVI architecture, system state changes are driven by user intents. This pattern is well-suited for responsive and functional programming paradigms and is commonly found in modern front-end frameworks such as Redux and MobX.

[0034] The application of the embodiment of the present application includes multiple target components, each of which is a component obtained by plug-inizing multiple functional components included in the application. The plug-inization process sets the functional modules of the application as independent plug-ins, which can be installed or updated independently of the main application.

[0035] According to one embodiment, the method loads the one or more target components in a resource-built-in or resource-external manner.

[0036] Among them, for the target component loaded by adopting the resource externalization method, the corresponding component resources are stored in the remote network device. When the resource externalization component needs to be loaded, the corresponding component resources are obtained through the remote network device.

[0037] For target components loaded using built-in resources, the corresponding component resources are stored in the target application's assests directory. When you need to load a component with built-in resources, you can obtain the corresponding component resources by decompressing and copying the components stored in the assests directory.

[0038] The method may employ various methods to determine which target components are to be loaded using an external resource approach and which target components are to be loaded using an internal resource approach. For example, the method may determine which approach to use to load a target component based on loading mode indication information pre-set by the user for each target component. For another example, the method may utilize an external resource approach as the default approach to load a target component, and employ an internal resource approach to load a target component in specific circumstances.

[0039] According to one embodiment, for components in an application corresponding to the main core functions or the main framework of the application, the method uses a resource built-in method to load them, and for components with other extended functions in the application, the method uses a resource external method to load them.

[0040] Optionally, the method sets corresponding priority information for each target component, wherein the priority information includes various information that can be used to indicate the importance of the target component or the order in which the target components are loaded.

[0041] Optionally, the priority information corresponds to a preset loading mode, and the method corresponds the target component to three loading modes: preloading, on-demand loading, and idle loading, in descending order of priority.

[0042] Among them, in the preloading mode, the resources of the target component are loaded before they are actually needed. In the on-demand loading mode, the resources of the target component are loaded only when they are actually needed. In the idle loading mode, the resources of the target component are loaded when the working state of the client device is idle. The idle state may refer to the client device being in a black screen state, or the CPU occupancy rate of the client device being less than a predetermined occupancy rate threshold, etc. Those skilled in the art can set the applicable scenarios corresponding to preloading, on-demand loading and idle loading respectively based on actual needs, which will not be repeated here.

[0043] Refer to the following Figure 2 The exemplary applications and components shown are used to illustrate the methods of the embodiments of the present application.

[0044] Reference Figure 2 , Figure 2 The App shown is an application that provides video-related services. The application includes multiple functional modules. This example is based on the tribe2.0 framework. By plugging in the functional modules in the App, the following is obtained: Figure 2 The multiple components shown on the right can be installed or updated independently of the main application. Through plug-in processing, the App is used as a shell application, which only contains the most important functional modules of the application, such as Figure 2There are four basic modules, including the "Startup Module" shown on the upper right, to increase the installation speed of the App.

[0045] For each component obtained after plug-in, the method of this example sets the corresponding priority according to the importance of the component, so that the more core the component, the higher the priority. In addition, the method of this example further corresponds these components to three loading modes: preloading, idle loading, and on-demand loading according to the priority of each component. By setting the priority and loading mode, the more core the component, the higher the priority it will be loaded. In addition, through the preloading mode, new users can download and install components without any perception when they open the App for the first time.

[0046] The method in this example loads the components of the App through either an external component solution or a built-in component solution. In the external component solution, the method in this example stores the corresponding component resources on the server. When the component resources are needed, they are obtained remotely from the server. In the built-in component solution, the method in this example places the components in the assests directory of the App shell application. During the first installation of the App, the user manually unzips and copies the corresponding component resources in the assests directory to the app_tribe / stash and data directories. The operation of unzipping and copying to the app_tribe / stash directory is to automatically install these components the next time the user opens the App shell application, and the operation of unzipping and copying to the data directory is to ensure that this operation takes effect, thereby ensuring the immediate availability of the components.

[0047] Refer to the following Figure 1 To illustrate, in step S101, in response to a trigger instruction to download or update an application, one or more target components included in the application that need to be loaded are determined.

[0048] The target component is a component obtained by plug-in-processing multiple functional components included in the application.

[0049] In step S102, resource pattern information corresponding to the one or more target components is determined.

[0050] The resource mode information includes resource external mode and resource internal mode. If the resource mode information of the target component is resource external mode, the target component is loaded in the resource external mode; if it is resource internal mode, the target component is loaded in the resource internal mode.

[0051] According to one embodiment, the method determines resource mode information of the one or more target components based on pre-stored mode indication information.

[0052] Specifically, the preset mode indication information includes information for indicating which target components in the target application have resource mode information in the resource external mode and which target components have resource mode information in the resource internal mode.

[0053] According to one embodiment, the method determines resource mode information preset for one or more target components based on the current network status. Specifically, step S102 includes step S1021 and step S1022.

[0054] In step S1021, status indication information for indicating the current network status is obtained.

[0055] The status indication information may include various information for indicating the network status, such as signal strength, data transmission speed, network delay or data packet loss rate, etc.

[0056] In step S1022, based on the status indication information, if the network status does not meet the predetermined condition, the resource mode information of the one or more target components is the resource built-in mode.

[0057] For example, by setting predetermined conditions related to the network status, if the average network speed within a predetermined period is lower than a predetermined threshold, the resource mode information of one or more target components to be loaded is a resource built-in mode, so that the external resource method is used as the general method for loading the target component, and the resource built-in method is used as the target component for loading only when the network conditions are poor.

[0058] Continue to refer to Figure 1 To illustrate, in step S103, based on the resource mode information, the component resources of the one or more target components are correspondingly acquired for loading.

[0059] Specifically, for a target component whose resource mode information is a resource external mode, the corresponding component resources are acquired through interaction with a remote network device.

[0060] For target components whose resource mode information is resource built-in mode, the corresponding component resources are obtained by decompressing and copying the components stored in the assests directory. During the first installation of the app, the user manually decompresses and copies the corresponding component resources in the assests directory to the app_tribe / stash and data directories.

[0061] According to one embodiment, the method sets corresponding priority information for each target component and corresponds the target component to different loading modes according to the priority information. According to this embodiment, the method further includes step S104 and step S105.

[0062] In step S104, the loading mode corresponding to the target component to be loaded is determined.

[0063] Optionally, the method assigns the target component to three loading modes, namely, preloading, on-demand loading, and idle loading, in descending order of priority. The respective loading modes of preloading, on-demand loading, and idle loading have been described above and will not be repeated here.

[0064] In step S105, after the component resources are acquired based on the resource mode information corresponding to the target component to be loaded, the target component is loaded according to the loading mode corresponding to the target component.

[0065] According to one embodiment, the method is implemented based on the MVI architecture and the Tribe componentization solution. Tribe is a dynamic SDK that supports dynamic component (Bundle) updates, enabling components to update or change their functionality and behavior in real time without requiring reinstallation or restart. This dynamic update functionality is tightly integrated with the application's native code. Furthermore, the SDK uses a routing framework (BLRouter) to implement routing and service acquisition for dynamically updateable components.

[0066] Optionally, the Tribe componentization solution of the embodiment of the present application makes the following improvements to the existing Tribe 2.0 architecture:

[0067] 1) Downward support for solutions below API 21; API 21 is the version code of Android 5.0 Lollipop. Downward support means that the framework can work properly even on versions earlier than Android 5.0;

[0068] 2) Improved DEX and resource loading response timing in multi-concurrency environments. DEX (Dalvik Executable) is the compiled file format of Android applications, used in the Android runtime environment. Resource loading is the process by which an application loads its resources. In a multi-concurrency environment, when multiple threads or processes are running simultaneously, the framework optimizes the loading timing of DEX files and resources to improve response speed and efficiency.

[0069] 3) Specify support for simultaneous loading of multiple components; by supporting the simultaneous loading of multiple components instead of loading them one by one, the startup speed and performance of the application are improved.

[0070] According to the method of the embodiment of the present application, by plug-inizing the components of the application and adopting the resource built-in or resource external method to obtain the component resources for loading, the user does not need to load all components when installing the application for the first time, thereby reducing the package size of the application, avoiding the bloated package size caused by the increase of functions, improving the installation speed, and improving the user experience of new users and upgraded users; by setting priorities for the components to be loaded, and loading the components according to the priority using corresponding loading modes such as preloading, on-demand loading or idle loading, the user waiting time is reduced.

[0071] In addition, the embodiment of the present application also provides a device for loading components, the structure of the device is as follows: Figure 3 shown.

[0072] The device includes: a device for determining one or more target components contained in the application that need to be loaded in response to a trigger instruction for downloading or updating the application (hereinafter referred to as "component determination device 101"), a device for determining resource mode information corresponding to the one or more target components, the resource mode information including a resource external mode and a resource built-in mode (hereinafter referred to as "mode determination device 102"), and a device for obtaining component resources of the one or more target components for loading based on the resource mode information (hereinafter referred to as "resource loading device 103").

[0073] According to one embodiment, the apparatus loads the one or more target components in a resource-built-in or resource-external manner.

[0074] Among them, for the target component loaded by adopting the resource externalization method, the corresponding component resources are stored in the remote network device. When the resource externalization component needs to be loaded, the corresponding component resources are obtained through the remote network device.

[0075] For target components loaded using built-in resources, the corresponding component resources are stored in the target application's assests directory. When you need to load a component with built-in resources, you can obtain the corresponding component resources by decompressing and copying the components stored in the assests directory.

[0076] The device may use a variety of methods to determine which target components are to be loaded using an external resource method and which target components are to be loaded using an internal resource method. For example, the device may determine which method to use to load the target components based on the loading mode indication information pre-set by the user for each target component. For another example, the device may use an external resource method as the default method for loading target components, and use an internal resource method to load target components in specific circumstances.

[0077] According to one embodiment, for components in an application corresponding to the main core functions or the main framework of the application, the device loads them in a resource-built-in manner; for components with other extended functions in the application, the device loads them in a resource-external manner.

[0078] Optionally, the device sets corresponding priority information for each target component, wherein the priority information includes various information that can be used to indicate the importance of the target component or the order in which the target components are loaded.

[0079] Optionally, the priority information corresponds to a preset loading mode, and the method corresponds the target component to three loading modes: preloading, on-demand loading, and idle loading, in descending order of priority.

[0080] Among them, in the preloading mode, the resources of the target component are loaded before they are actually needed. In the on-demand loading mode, the resources of the target component are loaded only when they are actually needed. In the idle loading mode, the resources of the target component are loaded when the working state of the client device is idle. The idle state may refer to the client device being in a black screen state, or the CPU occupancy rate of the client device being less than a predetermined occupancy rate threshold, etc. Those skilled in the art can set the applicable scenarios corresponding to preloading, on-demand loading and idle loading respectively based on actual needs, which will not be repeated here.

[0081] Refer to the following Figure 3 To illustrate, the component determining means 101 determines one or more target components included in the application that need to be loaded in response to a trigger instruction for downloading or updating the application.

[0082] The target component is a component obtained by plug-in-processing multiple functional components included in the application.

[0083] The pattern determining means 102 determines resource pattern information corresponding to the one or more target components.

[0084] The resource mode information includes resource external mode and resource internal mode. If the resource mode information of the target component is resource external mode, the target component is loaded in the resource external mode; if it is resource internal mode, the target component is loaded in the resource internal mode.

[0085] According to one embodiment, the mode determining means 102 determines the resource mode information of the one or more target components based on pre-stored mode indication information.

[0086] Specifically, the preset mode indication information includes information for indicating which target components in the target application have resource mode information in the resource external mode and which target components have resource mode information in the resource internal mode.

[0087] According to one embodiment, the mode determining means 102 determines resource mode information preset by one or more target components based on the current network state. Specifically, the mode determining means 102 includes a state indication obtaining means and a sub-mode determining means.

[0088] The status indication obtaining means obtains status indication information for indicating the current network status.

[0089] The status indication information may include various information for indicating the network status, such as signal strength, data transmission speed, network delay or data packet loss rate, etc.

[0090] The sub-mode determining means is based on the state indication information, and if the network state does not meet a predetermined condition, the resource mode information of the one or more target components is the resource built-in mode.

[0091] For example, by setting predetermined conditions related to the network status, if the average network speed within a predetermined period is lower than a predetermined threshold, the resource mode information of one or more target components to be loaded is a resource built-in mode, so that the external resource method is used as the general method for loading the target component, and the resource built-in method is used as the target component for loading only when the network conditions are poor.

[0092] Continue to refer to Figure 3 To illustrate, the resource loading device 103 obtains the component resources of the one or more target components for loading based on the resource mode information.

[0093] Specifically, for a target component whose resource mode information is a resource external mode, the resource loading device 103 obtains corresponding component resources by interacting with a remote network device.

[0094] For target components whose resource mode information is resource built-in mode, the resource loading device 103 obtains the corresponding component resources by decompressing and copying the components stored in the assests directory. During the first installation of the App, the user manually decompresses and copies the corresponding component resources in the assests directory to the app_tribe / stash and data directories.

[0095] According to one embodiment, the device sets corresponding priority information for each target component and corresponds the target component to different loading modes according to the priority information. According to this embodiment, the method further includes a loading mode determining device and a mode loading device.

[0096] The loading mode determining device determines a loading mode corresponding to a target component to be loaded.

[0097] Optionally, the loading mode determining device corresponds the target component to three loading modes, namely, preloading, on-demand loading, and idle loading, in descending order of priority. The corresponding loading modes of preloading, on-demand loading, and idle loading have been described above and will not be repeated here.

[0098] After acquiring the component resource based on the resource mode information corresponding to the target component to be loaded, the mode loading device loads the component according to the loading mode corresponding to the target component.

[0099] According to one embodiment, the device is implemented based on the MVI architecture and the Tribe componentization solution. Tribe is a dynamic SDK that supports dynamic component (Bundle) updates, enabling components to update or change their functionality and behavior in real time without requiring reinstallation or restart. This dynamic update functionality is tightly integrated with the application's native code. Furthermore, the SDK uses a routing framework (BLRouter) to implement routing and service acquisition for dynamically updateable components.

[0100] Optionally, the Tribe componentization solution of the embodiment of the present application makes the following improvements to the existing Tribe 2.0 architecture:

[0101] 1) Downward support for solutions below API 21; API 21 is the version code of Android 5.0 Lollipop. Downward support means that the framework can work properly even on versions earlier than Android 5.0;

[0102] 2) Improved DEX and resource loading response timing in multi-concurrency environments. DEX (Dalvik Executable) is the compiled file format of Android applications, used in the Android runtime environment. Resource loading is the process by which an application loads its resources. In a multi-concurrency environment, when multiple threads or processes are running simultaneously, the framework optimizes the loading timing of DEX files and resources to improve response speed and efficiency.

[0103] 3) Specify support for simultaneous loading of multiple components; by supporting the simultaneous loading of multiple components instead of loading them one by one, the startup speed and performance of the application are improved.

[0104] According to the device of the embodiment of the present application, by plug-inizing the components of the application and adopting the resource built-in or resource external method to obtain the component resources for loading, the user does not need to load all components when installing the application for the first time, thereby reducing the package size of the application, avoiding the bloated package size caused by the increase in functions, improving the installation speed, and improving the user experience of new users and upgraded users; by setting priorities for the components to be loaded and loading the components according to the priority using corresponding loading modes such as preloading, on-demand loading or idle loading, the user waiting time is reduced.

[0105] Based on the same inventive concept, an electronic device is also provided in an embodiment of the present application. The method corresponding to the electronic device may be the method used in the aforementioned embodiment, and its principle of solving the problem is similar to that of the method. The electronic device provided in an embodiment of the present application includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the methods and / or technical solutions of the aforementioned multiple embodiments of the present application.

[0106] The electronic device may be a user device, or a device formed by integrating a user device and a network device via a network, or an application running on such a device. The user device includes, but is not limited to, computers, mobile phones, tablets, smart watches, wristbands, and other terminal devices. The network device may include, but is not limited to, a network host, a single network server, a collection of multiple network servers, or a collection of computers based on cloud computing, and may be used to implement some of the processing functions required for setting an alarm. Here, the cloud is composed of a large number of hosts or network servers based on cloud computing. Cloud computing is a type of distributed computing, consisting of a virtual computer composed of a group of loosely coupled computers.

[0107] Figure 4The structure of a device suitable for implementing the methods and / or technical solutions in the embodiments of the present application is shown. The device 1200 includes a central processing unit (CPU) 1201, which can perform various appropriate actions and processes based on programs stored in a read-only memory (ROM) 1202 or programs loaded from a storage unit 1208 into a random access memory (RAM) 1203. RAM 1203 also stores various programs and data required for system operation. CPU 1201, ROM 1202, and RAM 1203 are interconnected via a bus 1204. An input / output (I / O) interface 1205 is also connected to bus 1204.

[0108] The following components are connected to I / O interface 1205: an input section 1206 including a keyboard, mouse, touch screen, microphone, infrared sensor, and the like; an output section 1207 including devices such as a cathode ray tube (CRT), liquid crystal display (LCD), LED display, OLED display, and speakers; a storage section 1208 including one or more computer-readable media such as a hard disk, optical disk, magnetic disk, and semiconductor memory; and a communication section 1209 including a network interface card such as a LAN (Local Area Network) card or a modem. Communication section 1209 performs communication processing via a network such as the Internet.

[0109] In particular, the methods and / or embodiments of the present application can be implemented as computer software programs. For example, the embodiments disclosed herein include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for executing the method illustrated in the flowchart. When the computer program is executed by the central processing unit (CPU) 1201, the functions defined in the method of the present application are performed.

[0110] Another embodiment of the present application further provides a computer-readable storage medium having computer program instructions stored thereon, which can be executed by a processor to implement the methods and / or technical solutions of any one or more embodiments of the present application.

[0111] Specifically, this embodiment may employ any combination of one or more computer-readable media. A computer-readable medium may be a computer-readable signal medium or a computer-readable storage medium. A computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples (a non-exhaustive list) of computer-readable storage media include: an electrical connection having one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In this document, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.

[0112] A computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, which carries computer-readable program code. This propagated data signal may take a variety of forms, including, but not limited to, electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium that can transmit, propagate, or transport a program for use by or in conjunction with an instruction execution system, apparatus, or device.

[0113] Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.

[0114] The computer program code for performing the operations of the present application can be written in one or more programming languages, or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, and C++, as well as conventional procedural programming languages ​​such as "C" or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a stand-alone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer can be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0115] The flow chart or block diagram in the accompanying drawings illustrate the possible architecture, functions and operations of the equipment, methods and computer program products according to various embodiments of the present application. In this regard, each box in the flow chart or block diagram can represent a module, program segment or a part of code, and the module, program segment or a part of code include one or more executable instructions for realizing the logical function of the specification. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a sequence different from that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flow chart, and the combination of the boxes in the block diagram and / or flow chart can be implemented with a dedicated system for hardware that performs the function or operation of the specification, or can be implemented with a combination of dedicated hardware and computer instructions.

[0116] Those skilled in the art will clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0117] In the several embodiments provided in this application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or page components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.

[0118] The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected to achieve the purpose of this embodiment according to actual needs.

[0119] In addition, the functional units in the various embodiments of the present application may be integrated into a single processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or in the form of hardware plus software functional units.

[0120] The above-mentioned integrated unit implemented in the form of a software functional unit can be stored in a computer-readable storage medium. The above-mentioned software functional unit is stored in a storage medium and includes a number of instructions for causing a computer device (which can be a personal computer, server, or network device, etc.) or a processor to perform some of the steps of the method described in various embodiments of this application. The aforementioned storage medium includes: USB flash drives, mobile hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, optical disks, and other media that can store program code.

[0121] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application.

[0122] Furthermore, it is clear that the word "comprising" does not exclude other units or steps, and the singular does not exclude the plural. Multiple units or devices recited in a device claim may also be implemented by a single unit or device through software or hardware. Terms such as "first" and "second" are used to indicate names and do not imply any particular order.

Claims

1. A method for loading a component, wherein: The method comprises: In response to a trigger instruction to download or update an application, determining one or more target components included in the application that need to be loaded; Determining resource mode information corresponding to the one or more target components, the resource mode information including an external resource mode and an internal resource mode; Based on the resource mode information, correspondingly acquiring component resources of the one or more target components for loading; Wherein, based on the resource mode information, correspondingly acquiring the component resources of the one or more target components for loading includes: For target components whose resource mode information is resource external mode, the corresponding component resources are obtained by interacting with the remote network device; for target components whose resource mode information is resource built-in mode, the corresponding component resources are obtained by decompressing and copying the components stored in the assests directory.

2. The method according to claim 1, wherein The target component is a component obtained by plug-in processing multiple functional components included in the application. The plug-in processing sets the functional modules of the application as independent plug-ins, and the plug-ins can be installed or updated independently of the main application.

3. The method according to claim 1 or 2, wherein: Determining the resource mode information corresponding to the one or more target components includes: Based on pre-stored mode indication information, resource mode information of the one or more target components is determined.

4. The method according to claim 1 or 2, wherein: Determining the resource mode information corresponding to the one or more target components includes: Obtaining status indication information for indicating the current network status; Based on the status indication information, if the network status does not meet the predetermined condition, the resource mode information of the one or more target components is the resource built-in mode.

5. The method according to claim 1 or 2, wherein: The method sets corresponding priority information for each target component and corresponds the target component to different loading modes according to the priority information. The method further includes: Determine the loading mode corresponding to the target component to be loaded; After the component resource is acquired based on the resource mode information corresponding to the target component to be loaded, the component is loaded according to the loading mode corresponding to the target component.

6. The method according to claim 5, wherein: The method corresponds the target component to three loading modes, namely, preloading, on-demand loading, and idle loading, in order of priority from high to low.

7. A device for loading a component, wherein: The device comprises: means for determining, in response to a trigger instruction for downloading or updating an application, one or more target components included in the application that need to be loaded; means for determining resource mode information corresponding to the one or more target components, the resource mode information including a resource external mode and a resource internal mode; means for acquiring component resources of the one or more target components for loading accordingly based on the resource mode information; Wherein, based on the resource mode information, correspondingly acquiring the component resources of the one or more target components for loading includes: For target components whose resource mode information is resource external mode, the corresponding component resources are obtained by interacting with the remote network device; for target components whose resource mode information is resource built-in mode, the corresponding component resources are obtained by decompressing and copying the components stored in the assests directory.

8. An electronic device, comprising: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 6.

9. A computer-readable medium having computer program instructions stored thereon, wherein the computer program instructions can be executed by a processor to implement the method according to any one of claims 1 to 6.

10. A computer program product comprising a computer program, wherein when the computer program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.

Citation Information

Patent Citations

  • Method and device for loading application program plugins

    CN102662703A

  • Method, system and computer device for updating and loading application program

    CN109144533A