Method, apparatus, medium and program product for loading components
By plug-in processing of application components and using built-in or external resource loading methods, combined with priority loading mode, the problem of application package size increases and installation speed decreases is solved, improving user experience and loading efficiency.
Patent Information
- Application Number
- CN202411275979.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-11
- Publication Date
- 2025-01-03
- Estimated Expiration
- 2044-09-11
AI Technical Summary
As the existing componentized architecture of the application increases, the volume of the package increases, the installation speed and user experience decrease, and it is difficult to effectively manage component dependencies.
By plug-in processing of application components, loading them using resource built-in or resource external methods, combining preloading, on-demand loading and idle loading modes, component priority is set to reduce package size and improve installation speed.
Reduces the application package size, improves installation speed and user experience, reduces user waiting time, and improves component loading efficiency.
Smart Images

Figure CN119248311A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a method, device, computer-readable medium and computer program product for loading a component. Background Art
[0002] Based on the existing technology, the componentized architecture of applications is mainly achieved by decomposing applications into independent and reusable components. These components can be developed, tested and deployed separately, thereby improving development efficiency and the modularity of applications. However, although this method is conducive to code maintenance and development, the introduction of external dependencies increases the package size, and as the number of functions increases, the amount of code continues to increase, which affects the installation speed of the application and the user experience. Summary of the invention
[0003] Multiple aspects of the present application provide a method, an apparatus, a computer-readable medium, and a 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] Determine resource mode information corresponding to the one or more target components, wherein the resource mode information includes 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 to download or update an application, one or more target components included in the application that need to be loaded;
[0010] A device for determining resource mode information corresponding to the one or more target components, wherein the resource mode information includes a resource external mode and a resource internal mode;
[0011] A device for acquiring component resources of the one or more target components for loading accordingly based on the resource mode information.
[0012] Another aspect of the present application provides an electronic device, the 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, and 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] Another aspect of the present application provides a computer program product, including a computer program, which implements the method of the embodiment of the application when executed by a processor.
[0018] The solution provided in the embodiment of the present application makes the components of the application program plug-in-based, and adopts a resource-built-in or resource-external method 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, thereby reducing the package size of the application program, avoiding bloated package size due to increased functions, improving installation speed, and improving the user experience of new and upgraded users; by setting priorities for components to be loaded, and loading components according to priorities using corresponding loading modes such as preloading, on-demand loading, or idle loading, 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 the description 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 paying any creative labor.
[0020] Other features, objects and advantages of the present application will become more apparent by reading the detailed description of non-limiting embodiments made with reference to the following drawings:
[0021] Figure 1 A schematic diagram of a flow chart of a method for loading a component provided in an embodiment of the present application is shown;
[0022] Figure 2 A schematic diagram showing an exemplary application program and components according to an embodiment of the present application;
[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 schematic diagram of the structure of a device suitable for implementing the solution in the embodiment 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] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work 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 (CPU), input / output interface, network interface and memory.
[0028] The memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0029] Computer readable media include permanent and non-permanent, removable and non-removable media, and can be implemented by any method or technology to store information. Information can be computer program instructions, data structures, modules of programs 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, read-only compact disk (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device.
[0030] Figure 1 A schematic flow chart of a method for loading a component provided by an embodiment of the present application is shown. The method at least includes step S101, step S102 and step S103.
[0031] In actual 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 the present embodiment, an application (Application, App) can be installed or run in the user device, and the application can be a containerized application. For a containerized application, the application and all its runtime dependencies can be packaged into an independent unit called a container, and each container can contain all components of the application. When running the application, the terminal device according to the present embodiment can exchange data with the network device corresponding to the application.
[0033] Optionally, the application according to this embodiment is an application based on the MVI (Model-View-Intent) architecture. Based on the MVI architecture, the state change of the system is driven by user intent (Intent), which is very suitable for responsive programming and functional programming paradigms, and is commonly seen in modern front-end frameworks such as Redux or MobX.
[0034] The application of the embodiment of the present application includes multiple target components, which are components obtained by plug-in processing of multiple functional components included in the application. The plug-in processing 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 external resource storage, the corresponding component resources are stored in the remote network device. When the external resource component needs to be loaded, the corresponding component resources are obtained through the remote network device.
[0037] For target components loaded by built-in resources, the corresponding component resources are stored in the assest directory of the target application. When it is necessary to load a component with built-in resources, the corresponding component resources are obtained by decompressing and copying the component stored in the assest directory.
[0038] The method may use a variety of methods to determine which target components are to be loaded in an external resource manner and which target components are to be loaded in an internal resource manner. For example, the method may determine which method is to be used to load the target component based on the loading mode indication information preset by the user for each target component. For another example, the method may use the external resource manner as the default method for loading the target component, and use the internal resource manner to load the target component in a specific case.
[0039] According to one embodiment, for components in the 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 of preloading, on-demand loading and idle loading in order of priority from high to low.
[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 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 may 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 implemented 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 in 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 the three loading modes of 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 noticing when they open the App for the first time.
[0046] The method of this example loads the components of the App through an external component solution or a built-in component solution. In the external component solution, the method of this example stores the corresponding component resources in the server, and when the component resources need to be obtained, the component resources are obtained by remote pulling through the server. In the built-in component solution, the method of this example puts 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. Among them, the operation of unzipping and copying to the app_tribe / stash directory is to automatically install these components when the user opens the App shell application next time, 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 mode 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 aforementioned resource external mode; if it is resource internal mode, the target component is loaded in the aforementioned 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 of the external resource mode and which target components have resource mode information of the internal resource mode.
[0053] According to an embodiment, the method determines resource mode information preset by 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 reach a predetermined condition, the resource mode information of the one or more target components is a 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 of time 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 built-in resource 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 assest 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 an 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 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 in the previous text 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. The Tribe is a dynamic SDK that supports the dynamic update function of components (Bundle), that is, the components can update or change their functions and behaviors in real time without reinstalling or restarting. And the dynamic update function is tightly integrated with the native code of the application. In addition, the routing framework (BLRouter) is used in the SDK to implement routing jumps 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 normally even on versions before Android 5.0;
[0068] 2) Improved DEX and resource loading response timing under multi-concurrency; DEX (Dalvik Executable) is the compiled file format of Android applications, used in the Android runtime environment. Resource loading is the process of an application loading its resources. In a multi-concurrency environment, that is, when multiple threads or processes are running at the same time, 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 simultaneous loading of multiple components without having to load 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 increased 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 priorities using corresponding loading modes such as preloading, on-demand loading, or idle loading, the user waiting time is reduced.
[0071] In addition, the present application also provides a device for loading a component, the structure of which 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 internal mode (hereinafter referred to as "mode determination device 102"), and a device for acquiring 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 device loads the one or more target components in a resource-internal or resource-external manner.
[0074] Among them, for the target component loaded by external resource storage, the corresponding component resources are stored in the remote network device. When the external resource component needs to be loaded, the corresponding component resources are obtained through the remote network device.
[0075] For target components loaded by built-in resources, the corresponding component resources are stored in the assest directory of the target application. When it is necessary to load a component with built-in resources, the corresponding component resources are obtained by decompressing and copying the component stored in the assest directory.
[0076] The device may use a variety of methods to determine which target components are to be loaded in an external resource manner and which target components are to be loaded in an internal resource manner. For example, the device may determine which method is to be used to load the target component based on the loading mode indication information preset by the user for each target component. For another example, the device may use the external resource manner as the default method for loading the target component, and use the internal resource manner to load the target component in a specific case.
[0077] According to one embodiment, for components in the application corresponding to the main core functions or the main framework of the application, the device loads them in a resource-built-in manner, and 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 of preloading, on-demand loading and idle loading in order of priority from high to low.
[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 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 may 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 explain, the component determination device 101 determines one or more target components included in the application program that need to be loaded in response to a trigger instruction for downloading or updating the application program.
[0082] The target component is a component obtained by plug-in-processing multiple functional components included in the application.
[0083] The mode determining means 102 determines resource mode 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 aforementioned resource external mode; if it is resource internal mode, the target component is loaded in the aforementioned 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 of the external resource mode and which target components have resource mode information of the internal resource mode.
[0087] According to an 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 acquisition device acquires 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 device is based on the state indication information, and if the network state does not meet the 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 of time 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 built-in resource 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 acquires 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 the target component whose resource mode information is the resource built-in mode, the resource loading device 103 obtains the corresponding component resources by decompressing and copying the components stored in the assest directory. In the process of installing the App for the first time, 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 the loading mode corresponding to the target component to be loaded.
[0097] Optionally, the loading mode determination device corresponds the target component to the three loading modes of 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 resources 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. The Tribe is a dynamic SDK that supports the dynamic update function of components (Bundle), that is, the components can update or change their functions and behaviors in real time without reinstalling or restarting. And the dynamic update function is tightly integrated with the native code of the application. In addition, in the SDK, the routing framework (BLRouter) is used to implement routing jumps 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 normally even on versions before Android 5.0;
[0102] 2) Improved DEX and resource loading response timing under multi-concurrency; DEX (Dalvik Executable) is the compiled file format of Android applications, used in the Android runtime environment. Resource loading is the process of an application loading its resources. In a multi-concurrency environment, that is, when multiple threads or processes are running at the same time, 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 simultaneous loading of multiple components without having to load 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, the components of the application are plug-in-ized, and the component resources are obtained for loading in a built-in or external resource manner, so that 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 due to increased 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 priorities 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, and the method corresponding to the electronic device may be the method for loading components 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 connected to the at least one processor in communication; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can 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 through a network, or may be an application running on the above device. The user device includes but is not limited to various terminal devices such as computers, mobile phones, tablet computers, smart watches, and bracelets. The network device includes but is not limited to network hosts, single network servers, multiple network server sets, or cloud computing-based computer sets, which can be used to implement some processing functions when setting an alarm. Here, the cloud is composed of a large number of hosts or network servers based on cloud computing, where cloud computing is a type of distributed computing, a virtual computer composed of a group of loosely coupled computer sets.
[0107] Figure 4The structure of a device suitable for implementing the method and / or technical solution in the embodiment of the present application is shown, and the device 1200 includes a central processing unit (CPU, Central Processing Unit) 1201, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM, Read Only Memory) 1202 or the program loaded from the storage part 1208 to the random access memory (RAM, Random Access Memory) 1203. In RAM1203, various programs and data required for system operation are also stored. CPU 1201, ROM 1202 and RAM 1203 are connected to each other through bus 1204. Input / output (I / O, Input / Output) interface 1205 is also connected to bus 1204.
[0108] The following components are connected to the I / O interface 1205: an input section 1206 including a keyboard, a mouse, a touch screen, a microphone, an infrared sensor, etc.; an output section 1207 including a cathode ray tube (CRT), a liquid crystal display (LCD), an LED display, an OLED display, etc., and a speaker, etc.; a storage section 1208 including one or more computer-readable media such as a hard disk, an optical disk, a magnetic disk, a semiconductor memory, etc.; and a communication section 1209 including a network interface card such as a LAN (Local Area Network) card, a modem, etc. The communication section 1209 performs communication processing via a network such as the Internet.
[0109] In particular, the methods and / or embodiments in the embodiments of the present application may be implemented as computer software programs. For example, the embodiments disclosed in the present application include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes program code for executing the method shown in the flowchart. When the computer program is executed by the central processing unit (CPU) 1201, the above functions defined in the method of the present application are executed.
[0110] Another embodiment of the present application further provides a computer-readable storage medium having computer program instructions stored thereon, wherein the computer program instructions can be executed by a processor to implement the methods and / or technical solutions of any one or more embodiments of the present application described above.
[0111] Specifically, the present embodiment may adopt any combination of one or more computer-readable media. The computer-readable medium may be a computer-readable signal medium or a computer-readable storage medium. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination thereof. More specific examples (non-exhaustive list) of computer-readable storage media include: an electrical connection with 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 may be used by or in combination with an instruction execution system, device, or device.
[0112] Computer readable signal media may include a data signal propagated in baseband or as part of a carrier wave, which carries a computer readable program code. Such propagated data signals may take a variety of forms, including, but not limited to, electromagnetic signals, optical signals, or any suitable combination of the above. Computer readable signal media may also be any computer readable medium other than a computer readable storage medium, which may send, propagate, or transmit 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] Computer program code for performing the operations of the present application may be written in one or more programming languages or a combination thereof, including object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate 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 may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may 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 shows the possible architecture, function and operation of the equipment, method and computer program product according to various embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some implementations as replacements, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square 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 square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated system for hardware that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0116] Those skilled in the art can 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 the present 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 separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0119] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit 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, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor to perform some steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), disk or optical disk and other media that can store program codes.
[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 it. 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] In addition, 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 stated in a device claim can also be implemented by one unit or device through software or hardware. The words first, second, etc. are used to indicate names, and do not indicate 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; Determine resource mode information corresponding to the one or more target components, wherein the resource mode information includes an external resource mode and an internal resource mode; Based on the resource mode information, component resources of the one or more target components are correspondingly acquired for loading.
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: The step of acquiring component resources of the one or more target components for loading based on the resource mode information includes: For target components whose resource mode information is resource external mode, the corresponding component resources are obtained by interacting with remote network devices; for target components whose resource mode information is resource internal mode, the corresponding component resources are obtained by decompressing and copying the components stored in the assest directory.
4. 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 the pre-stored mode indication information, resource mode information of the one or more target components is determined.
5. 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 reach a predetermined condition, the resource mode information of the one or more target components is a resource built-in mode.
6. 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 also includes: Determine the loading mode corresponding to the target component to be loaded; 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.
7. The method according to claim 6, wherein: The method corresponds the target component to the three loading modes of preloading, on-demand loading and idle loading in order of priority from high to low.
8. A device for loading a component, wherein: The device comprises: means for determining, 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; A device for determining resource mode information corresponding to the one or more target components, wherein the resource mode information includes a resource external mode and a resource internal mode; A device for acquiring component resources of the one or more target components for loading accordingly based on the resource mode information.
9. 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 7.
10. 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 7.
11. 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 7 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
Remote plug-in loading method and device
CN115269049A
Resource data processing method and device, computer equipment and storage medium
CN116700829A
Page loading method and device, electronic equipment and computer readable medium
CN117633382A
