Component loading method and device and storage medium

By obtaining functional interface keywords in lightweight applications to confirm the state of container components and loading them on demand, the problem of redeveloping the host application is solved, and efficient container component loading is achieved.

CN121364896APending Publication Date: 2026-01-20TENCENT TECH (BEIJING) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410978514.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-19
Publication Date
2026-01-20

AI Technical Summary

Technical Problem

In existing technologies, lightweight applications require host application developers to redevelop and release new client application versions when adding container components, resulting in low component loading efficiency.

Method used

By obtaining the function interface keywords of the target function, we can confirm whether the container component has been loaded. If it is not loaded, we can search locally or retrieve it from the server to ensure that the container component is loaded on demand and avoid repeated downloads and redevelopment.

Benefits of technology

It improves the loading efficiency of container components in lightweight applications, reduces the frequency of development and release, and enhances the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121364896A_ABST
    Figure CN121364896A_ABST
Patent Text Reader

Abstract

The invention discloses a component loading method and device and a storage medium. The method comprises the steps of obtaining a target interface keyword of a function interface corresponding to a target function in response to a triggering operation for the target function in the portable application program; carrying out loading confirmation on a target container component corresponding to the target function according to the target interface keyword to obtain a loading result of the target container component; if the loading result is that the target container component is not loaded, performing local search on the target container component according to the target interface keyword to obtain a search result for the target container component; if the search result is that the target container component does not exist locally, obtaining the target container component from the server according to the target interface keyword; and loading the target container component to enable the loaded target container component to execute the target function. According to the embodiment of the invention, the loading efficiency of the container component in the portable application program can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of computer, and particularly relates to a component loading method and device and storage medium. BACKGROUND

[0002] The light application program refers to an application program which can be used without downloading and installing. Different function container components can be installed in the light application program, so that various functions can be realized to meet different use requirements of users. In the current scheme, when a container component of a certain function needs to be added in the light application program, the host application developer of the light application program needs to develop the container component of the function to be integrated into the host application, and add the related dependencies of the container component in the light application program, and then generate a new client application version of the host application containing the container component. In this way, during the startup process of the new version of the host application, the container of the light application program in the host application will be initialized, so that the container component can be loaded. At this time, the container of the light application program loads the light application program, and enables the container component according to the calling logic of the light application program to realize the corresponding function.

[0003] In the scheme, the host application developer needs to inherit the related component dependencies in the coding stage, and re-release the host application version, so that the newly added container component in the light application program can take effect. That is, the scheme needs to re-develop, adapt and release a new client application version, so that the light application program can support loading of the new container component, and therefore the component loading efficiency is low. SUMMARY

[0004] The following is a summary of the subject matter described in detail herein. This summary is not intended to limit the scope of the claims.

[0005] The embodiment of the present application provides a component loading method, device and storage medium, which can improve the loading efficiency of the container component in the light application program.

[0006] In one aspect, the embodiment of the present application provides a component loading method, comprising the following steps:

[0007] In response to a trigger operation for a target function in a light application program, a target interface keyword of a function interface corresponding to the target function is acquired;

[0008] According to the target interface keyword, a target container component corresponding to the target function is loaded and confirmed, and a loading result of the target container component is obtained;

[0009] if the loading result is that the target container component is not loaded, performing a local search on the target container component according to the target interface keyword to obtain a search result for the target container component;

[0010] if the search result is that the target container component does not exist locally, obtaining the target container component from a server according to the target interface keyword;

[0011] loading the target container component, so that the target container component performs the target function after loading is completed.

[0012] In another aspect, the embodiments of the present application further provide a component loading apparatus, which comprises:

[0013] an information obtaining unit, configured to obtain a target interface keyword of a function interface corresponding to a target function in a light application in response to a triggering operation of the target function;

[0014] a loading confirming unit, configured to perform loading confirmation on a target container component corresponding to the target function according to the target interface keyword, to obtain a loading result of the target container component;

[0015] a component searching unit, configured to perform a local search on the target container component according to the target interface keyword to obtain a search result for the target container component if the loading result is that the target container component is not loaded;

[0016] a component obtaining unit, configured to obtain the target container component from a server according to the target interface keyword if the search result is that the target container component does not exist locally;

[0017] a component running unit, configured to load the target container component, so that the target container component performs the target function after loading is completed.

[0018] Optionally, the loading confirming unit is specifically configured to:

[0019] obtain a loaded component list, wherein the loaded component list records loaded container components that have been loaded currently;

[0020] perform traversal matching on all the loaded container components in the loaded component list according to the target interface keyword;

[0021] if there is a loaded container component in the loaded component list that matches the target interface keyword, obtain a loading result that the target container component has been loaded currently;

[0022] If there is no loaded container component matching the target interface keyword in the loaded component list, a loading result that the target container component is not currently loaded is obtained.

[0023] Optionally, the component obtaining unit is specifically configured to:

[0024] Obtain program toolkit version information of the light application;

[0025] According to the program toolkit version information and the target interface keyword, obtain the target container component from a server.

[0026] Optionally, the component obtaining unit is specifically configured to:

[0027] According to the program toolkit version information and the target interface keyword, obtain component version information, a component download address and download mode information of the target container component from the server;

[0028] According to the component version information, the component download address and the download mode information, obtain the target container component from the server.

[0029] Optionally, the component loading apparatus further comprises a component processing unit, and the component processing unit is configured to:

[0030] In response to a trigger operation for a light application, obtain first component version information and function interface keywords corresponding to each existing container component in the light application;

[0031] According to the function interface keywords corresponding to each existing container component, obtain second component version information of each existing container component currently saved from the server;

[0032] For each existing container component, perform update processing on the existing container component according to the first component version information and the second component version information;

[0033] For the existing container component that has performed the update processing, update the corresponding first component version information to the corresponding second component version information;

[0034] Preload the existing container component that has performed the update processing.

[0035] Optionally, the component running unit is specifically configured to:

[0036] Install the target container component to a target installation directory;

[0037] The class loader for dynamically loading the target container component is invoked with the installation path corresponding to the target installation directory as a loading path entry, and the target container component in the target installation directory is loaded.

[0038] Optionally, the component running unit is further configured to:

[0039] An already-loaded component list is obtained, and the already-loaded container component that has been currently loaded is recorded in the already-loaded component list.

[0040] A business instance corresponding to the target container component is constructed, and the business instance is added to the already-loaded component list.

[0041] Optionally, the component searching unit is configured to:

[0042] All container component names saved locally are obtained.

[0043] All the component names are concatenated into a string area by using a separator.

[0044] A state machine is constructed according to the target interface keyword, the state machine is used to indicate a link relationship between multiple target characters, and the target interface keyword is composed of multiple target characters.

[0045] The string area is traversed according to the state machine, and a search result for the target container component is obtained.

[0046] Optionally, the component searching unit is further configured to:

[0047] According to the target interface keyword, multiple target characters are determined.

[0048] For each target character, a character node is respectively created, and the character node includes the target character, a child pointer, and a string pointer.

[0049] A head node is created, and the head node is linked to one character node in the multiple character nodes, and the target character corresponding to the character node linked to the head node is the first character constituting the target interface keyword.

[0050] According to the front-back order of the multiple target characters constituting the target interface keyword, a child node link relationship between the multiple character nodes is determined.

[0051] For each character node, the child pointer is pointed to other character nodes that meet the child node link relationship, and a child node link chain is formed.

[0052] For the last character node in the sub-node link chain, the string pointer is pointed to a target string corresponding to the target interface keyword, and the string pointers of other character nodes in the sub-node link chain are pointed to null.

[0053] Optionally, the component searching unit is further configured to:

[0054] initialize a node marker pointing to the head node;

[0055] perform character traversal on the string area to obtain a current read character;

[0056] if the read character is not the delimiter, perform node traversal along the sub-node link chain, compare the read character with the target character contained in the character node currently traversed to obtain a comparison result, determine the character node pointed to by the node marker according to the comparison result, and return to the step of performing character traversal on the string area;

[0057] if the read character is the delimiter, and the character node pointed to by the node marker is a null node or the string pointer of the character node pointed to by the node marker points to null, point the node marker to the head node, and return to the step of performing character traversal on the string area;

[0058] if the read character is the delimiter, and the character node pointed to by the node marker is not a null node and the string pointer of the character node pointed to by the node marker does not point to null, save the content pointed to by the string pointer of the character node pointed to by the node marker in a preset storage space;

[0059] after completing the character traversal on the string area, obtain a searching result for the target container component according to the content saved in the storage space.

[0060] Optionally, the component searching unit is further configured to:

[0061] if the comparison result is that the read character is consistent with the target character contained in the character node currently traversed, determine that the character node pointed to by the node marker is the character node currently traversed;

[0062] if the comparison result is that the read character is inconsistent with the target character contained in the character node currently traversed, determine that the character node pointed to by the node marker is a null node.

[0063] In another aspect, the embodiment of the present application further provides an electronic device, comprising:

[0064] at least one processor;

[0065] at least one memory for storing at least one program;

[0066] The at least one program, when executed by the at least one processor, implements the component loading method as described above.

[0067] In another aspect, the embodiments of the present application also provide a computer readable storage medium, which stores a processor executable computer program, and the processor executable computer program is used for implementing the component loading method as described above when executed by a processor.

[0068] In another aspect, the embodiments of the present application also provide a computer program product, which includes a computer program or computer instructions, and the computer program or computer instructions are stored in a computer readable storage medium, and a processor of an electronic device reads the computer program or computer instructions from the computer readable storage medium, and the processor executes the computer program or computer instructions, so that the electronic device executes the component loading method as described above.

[0069] In the technical scheme provided by the embodiments of the present application, in response to a trigger operation for a target function in a light application, a target interface keyword of a function interface corresponding to the target function is acquired first, and then a target container component corresponding to the target function is loaded and confirmed according to the target interface keyword, to obtain a loading result of the target container component. By loading and confirming the target container component first, it can be confirmed whether the target container component has been loaded, so that useless repeated loading can be avoided. If the loading result is that the target container component has not been loaded, the target container component is locally searched according to the target interface keyword, to obtain a searching result for the target container component. In this way, it can be determined whether the target container component is saved locally, so that useless repeated downloading of the target container component can be avoided. If the searching result is that the target container component does not exist locally, the target container component is acquired from a server according to the target interface keyword, and then the target container component is loaded, so that the target function is executed by the target container component after loading. In this way, the target container component can be downloaded and loaded from the server only when it is needed, so that the target function is executed by the target container component after loading, thereby achieving the purpose of loading the target container component on demand. Moreover, in this process, the host application of the light application does not need to be redeveloped and versioned for the target container component, so that the loading efficiency of the target container component in the light application can be improved as a whole, thereby improving the user experience.

[0070] Other features and advantages of the present application will be set forth in the description that follows, and in part will be apparent from the description, or can be learned by practice of the application. The purposes and other advantages of the present application will be realized and attained by the structure particularly pointed out in the description and claims hereof as well as the appended drawings. BRIEF DESCRIPTION OF DRAWINGS

[0071] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments of the application and together with the description, serve to explain the technical solution of the application, and do not constitute a limitation on the technical solution of the application.

[0072] Figure 1 is a framework diagram of a system to which a component loading method according to an embodiment of the present application is applied;

[0073] Figure 2 is a relationship diagram of an application container and a host application of a light application according to an embodiment of the present application;

[0074] Figures 3A-3F is an interface diagram of a target function execution scenario of a light application platform to which an embodiment of the present application is applied;

[0075] Figure 4 is a flowchart of a component loading method according to an embodiment of the present application;

[0076] Figure 5 is a module structure diagram of an optimized light application container SDK according to an embodiment of the present application;

[0077] Figure 6 is a structure comparison diagram of a light application container SDK before and after optimization according to an embodiment of the present application;

[0078] Figure 7 is a flowchart of determining a loading result of a target container component according to an embodiment of the present application;

[0079] Figure 8 is a flowchart of locally searching for a target container component according to an embodiment of the present application;

[0080] Figure 9 is a diagram of a state machine according to an embodiment of the present application;

[0081] Figure 10 is an example diagram of a state machine according to an embodiment of the present application;

[0082] Figure 11 is a flowchart of constructing a state machine according to an embodiment of the present application;

[0083] Figure 12 is a schematic diagram of a character node created according to an embodiment of the present application;

[0084] Figure 13 is another example diagram of a state machine according to an embodiment of the present application;

[0085] Figure 14 is a flowchart of character traversal of a string region according to an embodiment of the present application;

[0086] Figure 15 is a flowchart of obtaining a target container component from a server according to an embodiment of the present application;

[0087] Figure 16 is a flowchart of loading a target container component according to an embodiment of the present application;

[0088] Figure 17 is another flowchart of loading a target container component according to an embodiment of the present application;

[0089] Figure 18 is a first implementation step flowchart of a component loading method according to an embodiment of the present application;

[0090] Figure 19 is a second implementation step flowchart of a component loading method according to an embodiment of the present application;

[0091] Figure 20 is another flowchart of a component loading method according to an embodiment of the present application;

[0092] Figure 21 is a third implementation step flowchart of a component loading method according to an embodiment of the present application;

[0093] Figure 22 is a module diagram of a component loading apparatus according to an embodiment of the present application;

[0094] Figure 23 is a schematic diagram of an electronic device provided by an embodiment of the present application. DETAILED DESCRIPTION

[0095] The present application will be further described by way of illustration with reference to the accompanying drawings and specific embodiments. The described embodiments should not be considered limiting to the present application, and all other embodiments obtained by those of ordinary skill in the art without creative work are within the scope of protection of the present application.

[0096] In the following description, reference is made to "some embodiments", which describe a subset of all possible embodiments, but it is understood that "some embodiments" can be the same subset or different subsets of all possible embodiments, and can be combined with each other without conflict.

[0097] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used in the description herein is for describing the embodiments of the application only and is not intended to be limiting of the application.

[0098] Before the embodiments of the application are further described in detail, the terms and phrases involved in the embodiments of the application are explained, and the terms and phrases involved in the embodiments of the application are applicable to the following explanations.

[0099] 1) Container: A lightweight virtualization technology that allows running applications and their dependencies in isolated environments. In web development, a container usually refers to a server-side component used to host and isolate web applications and their runtime environments. Containers can provide a consistent runtime environment for applications, making it easier to deploy and manage applications across different environments and platforms.

[0100] 2) Component: A self-contained unit in software that can be developed, tested, and maintained independently. In front-end development, a component usually refers to a reusable UI element, such as buttons, text boxes, lists, etc. Component-based development can improve code modularity and speed up development.

[0101] 3) Container component: A special type of component that can be responsible for managing and coordinating the behavior and data flow of other components. Container components can contain state management logic and be responsible for passing state and callback functions to their child components.

[0102] 4) Component loading: Refers to loading components from the file system, network, or other sources into memory and preparing them for use in the application. In web development, component loading may involve technologies such as dynamic imports, asynchronous components, etc., to achieve on-demand loading and lazy loading. Component loading mechanisms can improve application startup performance and reduce first render time.

[0103] 5) Host application: Refers to the main program that runs and manages other applications, components, or plugins. In web development, the host application can be a browser, a server-side framework (such as Node.js), or other types of application platforms. The host application is responsible for providing a runtime environment, API support, resource management, etc., to support applications or components running on it.

[0104] 6) Software Development Kit (SDK): Also known as a program kit, it is a set of tools, documents and sample code for helping developers create applications for a specific software package, framework, platform or operating system. SDK usually includes compilers, debuggers, software frameworks, etc. These tools can simplify the creation process of the application, provide files of Application Programming Interface (API), and even possibly include hardware for communication with embedded systems. In addition, SDK often contains sample code, technical notes and other supporting documents to help developers understand and use these tools.

[0105] 7) Dependency: Refers to the case where one software component (such as module, library, framework, etc.) depends on another software component. This dependency relationship indicates that in order for the first component to work properly, the second component must exist and be available.

[0106] 8) Inheritance: A core concept of object-oriented programming, it refers to allowing the creation of a new class (called subclass or derived class) to inherit the properties and methods of another class (called parent class or base class). The main purpose of inheritance is to achieve code reuse and modularization, so that the new class can extend or customize the functionality of the parent class while maintaining the independence and maintainability of the parent class code.

[0107] Figure 1 is a system architecture diagram applied by the component loading method according to the embodiments of the present application. It includes object terminal 110, Internet 120, gateway 130 and server 140.

[0108] Object terminal 110 is the device used by the object to execute the component loading method. It includes desktop computers, laptops, PDAs (Personal Digital Assistants), mobile phones, car terminals, home theater terminals, special-purpose terminals, and many other forms. In addition, it can be a single device or a collection of multiple devices. For example, multiple devices are connected through a local area network, share a display device for collaborative work, and together constitute a terminal. Object terminal 110 can also communicate with Internet 120 in a wired or wireless manner to exchange data.

[0109] Gateway 130, also known as an internetwork connector or protocol converter, is a computer system or device that enables network interconnection at the transport layer and acts as a translator. It bridges the gap between two systems using different communication protocols, data formats, languages, or even completely different architectures. Gateway 130 also provides filtering and security functions. Messages sent from target terminal 110 to server 140 are forwarded to the corresponding server 140 via gateway 130. Messages sent from server 140 to target terminal 110 are also forwarded to the corresponding target terminal 110 via gateway 130.

[0110] Server 140 refers to a computer system capable of providing certain services to target terminal 110. Compared to target terminal 110, server 140 has higher requirements in terms of stability, security, and performance. Server 140 can be a single high-performance computer in a network platform, a cluster of multiple high-performance computers, a portion of a single high-performance computer (e.g., a virtual machine), or a combination of portions of multiple high-performance computers (e.g., virtual machines). Server 140 can also communicate with the Internet 120 via wired or wireless means to exchange data.

[0111] Lightweight applications are applications that can be used without downloading and installation. Different container components with varying functions can be installed within lightweight applications, enabling diverse functionalities to meet different user needs. In the current solution, refer to... Figure 2 As shown, Figure 2 This illustration shows a schematic diagram of the relationship between the application container and the host application of a lightweight application provided in an embodiment of this application. When it is necessary to add a container component (such as...) to a lightweight application... Figure 2 When integrating application components A and B into a lightweight application, the host application developers need to develop a container component for that functionality to integrate into the host application. This involves adding dependencies for the container component to the lightweight application—that is, importing libraries, frameworks, or modules to use the container component's functionality. These dependencies provide the lightweight application with the ability to create and manage containers, enabling the encapsulation, isolation, and management of different components or services. A new client application version containing the container component is then generated. During the startup of the new version of the host application, the container for the lightweight application within the host application initializes, allowing the container component to be loaded. The container then loads the lightweight application and, according to its calling logic, activates the container component to implement the corresponding functionality.

[0112] In the scheme, the host application developer needs to inherit the relevant component dependency in the coding stage, and re-release the host application version, so that the newly added container component in the light application program takes effect. Thus, in the application startup process, the container of the light application program can load the corresponding container component (such as the application A component and the application B component in Figure 2 ). The container of the light application program can load the light application program, and enable the corresponding container component according to the calling logic of the light application program. That is, in order to add component support, the host application developer needs to inherit the relevant component dependency in the coding stage, that is, needs to re-develop, adapt and release a new client application version, so that the light application program supports loading new container components, and thus there is a problem of low component loading efficiency.

[0113] The embodiments of the present application can be applied in various scenarios, for example Figures 3A-3F the target function execution scenario of the light application program platform, etc.

[0114] In the target function execution scenario of the light application program platform, if the object needs to execute a certain target function in the light application program, a container component of a certain function needs to be added in the light application program, and a new client application version of the host application containing the container component is generated. In this way, the object can execute the target function in the new client application version.

[0115] As shown in Figure 3A , the object terminal 110 is a computer terminal. When the object enters the light application program platform at the object terminal 110, the object can trigger an operation on a target function (such as the “code scanning” function in Figure 3A , which can also be a “map” function or a “canvas” function) in the light application program, so that the object terminal 110 can obtain the target interface keyword of the function interface corresponding to the “code scanning” function.

[0116] As shown in Figure 3B , after obtaining the target interface keyword of the “code scanning” function interface, the computer terminal interface displays a prompt information for prompting that the object is loading the target container component, such as “loading confirmation......”.

[0117] As shown in Figure 3C , if the loading result is that the target container component is not loaded, the computer terminal interface displays a prompt information for prompting that the object is further locally searching for the target container component, such as “target container component is not loaded, local search......”.

[0118] As shown in Figure 3DIf the loading result is that the target container component does not exist locally, the computer terminal interface displays a prompt message for prompting that the object is further acquiring the target container component from the server, such as "The target container component does not exist, and the server is searching......".

[0119] As shown in Figure 3E After the server finds the target container component, the computer terminal interface displays a prompt message for prompting that the object is loading the target container component, such as "Loading......", and after a period of time, the computer terminal interface displays a prompt message for prompting that the object is loaded, as shown in Figure 3F The loaded target container component can execute the "code scanning" function.

[0120] According to an embodiment of the present application, a component loading method is provided. The component loading method of the embodiment of the present application is executed by the object terminal 110 alone, or executed by the server 140 alone, or executed by the object terminal 110 and the server 140 together. The following takes the execution by the object terminal 110 as an example for description.

[0121] As shown in Figure 4 According to an embodiment of the present application, the component loading method includes:

[0122] Step 410, in response to a trigger operation for a target function in a light application program, acquiring a target interface keyword of a function interface corresponding to the target function;

[0123] Step 420, loading confirmation is performed on a target container component corresponding to the target function according to the target interface keyword, and a loading result of the target container component is obtained;

[0124] Step 430, if the loading result is that the target container component is not loaded, local searching is performed on the target container component according to the target interface keyword, and a searching result for the target container component is obtained;

[0125] Step 440, if the searching result is that the target container component does not exist locally, the target container component is acquired from the server according to the target interface keyword;

[0126] Step 450, loading is performed on the target container component, so that the loaded target container component executes the target function.

[0127] The benefits of the embodiments of the step 410-450 include, but are not limited to: (1) By performing the loading confirmation on the target container component first, it can be confirmed whether the target container component has been loaded, so that useless repeated loading can be avoided. (2) If it is determined that the target container component is not loaded, the target container component is locally searched according to the target interface keyword, so that it can be determined whether the target container component is saved locally first, so that useless repeated downloading of the target container component can be avoided. (3) If it is determined that the target container component does not exist locally, the target container component is obtained from the server according to the target interface keyword, and then the target container component is loaded, so that the target container component after loading performs the target function. In this way, the target container component can be downloaded and loaded from the server only when it is needed, so that the target container component after loading performs the target function, thereby achieving the purpose of on-demand loading of the target container component. Moreover, in this process, the host application of the lightweight application does not need to be redeveloped and versioned for the target container component. Therefore, compared with the related art, when facing the compatibility problem of new components and the business repair and update problem of inventory components, the related art needs to redevelop the adaptation and generate a new client application version containing the host application of the container component. The present application can improve the loading efficiency of the target container component in the lightweight application as a whole.

[0128] The step 410-450 will be described in detail below.

[0129] In step 410, in response to a trigger operation for a target function in a lightweight application, a target interface keyword of a function interface corresponding to the target function is obtained. The target function refers to a specific function in the lightweight application of the object terminal triggered by the object, such as a code scanning function, a map function, a canvas function, etc. The trigger operation refers to the behavior of the user who wants to execute a certain function, such as clicking a button, selecting a menu item, etc. The lightweight application will respond to this trigger operation of the object. The function interface refers to a programming interface for executing the target function. The target interface keyword refers to an identifier that can uniquely identify the function interface corresponding to the target function, which can be used to reference the function interface corresponding to the target function in the code of the lightweight application. The embodiments of the present application can correctly locate the function interface corresponding to the target function by obtaining the target interface keyword, and execute the corresponding target function.

[0130] It can be understood that the object performs a trigger operation in the light application to perform a certain target function. In order to respond to the trigger operation and perform the target function, the light application needs to find the function interface associated with the target function, and correctly call and execute the interface by obtaining the target interface keyword of the function interface corresponding to the target function. In this way, the light application can respond to the operation of the object and provide the required function service.

[0131] Among them, the code scanning function refers to the function of allowing the object to obtain relevant information or perform a specific operation by scanning a two-dimensional code or a bar code. The map function refers to allowing the map to be displayed in the light application, and providing geographic location related services such as obtaining the object's location, marking the location, etc. The canvas function refers to allowing graphics, text, etc. to be drawn in the light application. Among them, each specific function in the light application will correspond to a function interface (such as an API interface) to realize the specific function by calling the API interface corresponding to the light application.

[0132] It should be noted that the implementation of the target function of the light application needs a corresponding target container component, and there is a corresponding relationship between the target function, the function interface corresponding to the target function, the target interface keyword, and the target container component. Among them, the target interface keyword of the function interface corresponding to the target function can be an API keyword, and the application program API interceptor of the SDK of the light application can intercept the function interface call (such as API call request) of the target function in the application program, and extract the target interface keyword (such as API keyword) in the function interface call parameter. For example, the code scanning function can correspond to the E.scanCode interface (E is the abbreviation of the light application), and the interface keyword corresponding to the E.scanCode interface can be "scanCode"; the map function can correspond to the map component interface, and the interface keyword corresponding to the map component interface can be "map"; the canvas function can correspond to the canvas component interface, and the interface keyword corresponding to the canvas component interface can be "canvas". These API interfaces can provide rich functions and services for the object, so that the object can easily realize various function requirements.

[0133] Note that when obtaining the object's location, marking the location, and other object data, the object's consent should be obtained in advance. Moreover, the collection, use, and processing of these object data will comply with relevant laws, regulations, and standards. When obtaining the object's consent, the object's separate permission or separate consent can be obtained through a pop-up window or by jumping to a confirmation page.

[0134] In some embodiments, in order to adapt to the component loading method provided in the present application, the embodiments of the present application optimize the light application container SDK (including container files and SDK) at the same time, and strip the business implementation and interface of the container component. The light application runtime can better implement on-demand loading of target container components. Before further describing the component loading method, the optimized light application container SDK is described in detail.

[0135] Please refer to Figure 5 , Figure 5 A module structure diagram of the component loading method provided in the embodiments of the present application is shown. The component management service is deployed in the backend server, and is used to provide a version information management service of the container file of the light application, including component publishing, updating, etc. The container file (such as container file A, container file B, container file C in Figure 5 ) is deployed in the backend server, and corresponds to the business logic implementation of the container component. For example, container component A can implement the code scanning function, and container file A corresponds to the business logic implementation of the code scanning function. The component loader is located in the light application container SDK of the object terminal, and is used to implement the business logic of dynamic component loading. The component version management is located in the light application container SDK of the object terminal, and is used to implement the version management logic of the container component. The SDK refers to the program tool kit of the light application of the object terminal, and is used to provide related APIs and abstract interface definitions of the light application. In addition, the container component (such as container component A, container component B, container component C in Figure 5 ) depends on the abstract interface to implement the corresponding business capability. In the container runtime of the light application, one container component corresponds to the business (i.e. interface) function implementation of a certain category of light application, for example: code scanning, map, canvas, etc.

[0136] Please refer to Figure 6 , Figure 6 The structure comparison diagram of the light application container SDK before and after optimization provided in the present application is shown, Figure 6 The left side of the figure shows the light application container SDK before optimization, Figure 6The optimized light application container SDK is shown in the middle right. In order to implement the scheme, the original light application container SDK needs to be optimized and modified in the development stage. Specifically, the light application container SDK can be split to deploy the container file of the light application in the background server and integrate the SDK locally. In this way, the business implementation and interface of the container component can be separated, and the on-demand loading of the target container component can be better implemented during the runtime of the light application. On the one hand, the efficiency problems of repeated release and access adaptation can be reduced, and on the other hand, the package compatibility problem of the related technology in the local package to the host application of the terminal device can be effectively avoided, and the problem of too large package size can be avoided.

[0137] In some embodiments, the optimization and modification process can specifically include: first, splitting the light application component implementation, which can specifically be abstracting a special base class as the implementation parent class BasePlugin of the applet component, and then BasePlugin will be the parent class interface of all applet components; then, the light application component can take BasePlugin as the parent class, rewrite the method interceptor and business implementation of BasePlugin; further, modifying the interceptor implementation of the JSAPI of the light application, using the reflection method to find all classes that inherit BasePlugin and instantiate during the initialization of the light application SDK; then, implementing the dynamic loading logic of the component and the version management logic of the component; finally, repackaging the split light application component and the applet container SDK. In this way, the light application component at this time only contains the business implementation corresponding to the component, and the applet container SDK contains the basic runtime loading logic of the applet container, the component dynamic loading and version management business logic, and the base class (BaseJsPlugin) implementation of the applet component.

[0138] It should be noted that the working principle of the method interceptor mainly includes: (1) intercepting method calls: when a certain method is called, the method interceptor will capture this call event, which is usually implemented through the proxy pattern (Proxy Pattern) or bytecode enhancement technology (such as AspectJ of Java). (2) Execute pre-logic: Before the actual execution of the method, the interceptor will execute some custom pre-logic, which can include verifying permissions, recording logs, setting parameters, etc. (3) Call the original method: After the pre-logic is executed, the interceptor will call the original method, which can ensure the normal execution of business logic. (4) Execute post-logic: After the method is executed, the interceptor will execute some custom post-logic. It can include updating the state, recording the result, handling exceptions, etc. (5) Return the result: The interceptor can return the return value of the original method (if any) to the caller. Therefore, the method interceptor can provide a flexible and reusable way to handle common functions across multiple modules or classes. By using the interceptor, the development object can separate these functions from the business logic, making the code more clear, easy to maintain and extend.

[0139] It should be noted that BasePlugin is a basic plugin of the build system, which can provide some build tasks and some general conventions of the build, which are common to most builds, and adds a structure to the build to facilitate the consistency of the operation of these builds.

[0140] In step 420, after obtaining the target interface keyword of the function interface corresponding to the target function, the application will first confirm the loading of the target container component corresponding to the target function according to the target interface keyword, to confirm whether the target container component has been loaded, so as to avoid useless repeated loading.

[0141] In some embodiments, referring to Figure 7 , the loading of the target container component corresponding to the target function is confirmed according to the target interface keyword, and the loading result of the target container component is obtained, which can specifically include:

[0142] Step 710, obtaining a loaded component list;

[0143] Step 720, according to the target interface keyword, all loaded container components in the loaded component list are iteratively matched;

[0144] Step 730, determining the loading result of the target container component according to the result of the iterative matching.

[0145] In step 710 of some embodiments, the loaded component list records the loaded container components that have been loaded currently. Among them, the program component interception logic of the SDK corresponding to the light application can check the current loaded component list to match the corresponding loaded container components in the loaded component list through the target interface keyword (such as "scanCode").

[0146] In step 720 of some embodiments, the loaded component list can record the loaded container components that have been loaded currently and the component name corresponding to each loaded container component, and the component name is used to uniquely identify a container component. In this way, all the loaded container components in the loaded component list can be matched through the target interface keyword and the component name to obtain the loading result of the target container component.

[0147] In some specific embodiments, the process of matching all the loaded container components in the loaded component list through the target interface keyword and the component name can specifically include: performing string matching on the target interface keyword and the component name corresponding to each loaded container component recorded in the loaded component list to determine the loading result of the target container component according to the result of the string matching. Among them, the string matching is an algorithm for comparing two strings to determine whether the two strings are the same or similar under certain rules. The string matching algorithm can include Brute-Force (BF), Knuth-Morris-Pratt Algorithm, etc., which are not limited here.

[0148] In other specific embodiments, the process of matching all the loaded container components in the loaded component list through the target interface keyword and the component name can specifically further include: inputting the target interface keyword and the component name corresponding to each loaded container component recorded in the loaded component list into a string matching model to perform similarity calculation, and determining the loading result of the target container component according to the output result of the string matching model. Among them, the string matching model can be a model constructed based on the string matching algorithm, which will not be described here.

[0149] In still other specific embodiments, the process of matching all the loaded container components in the loaded component list through the target interface keyword and the component name can specifically further include: constructing a state machine according to the target interface keyword to match the component name of the container component through the constructed state machine to determine the loading result of the target container component. Among them, the process of constructing a state machine according to the target interface keyword to match the component name of the container component through the constructed state machine will be described in detail in subsequent embodiments, which will not be described here.

[0150] In step 730 of some embodiments, the loading result can be that the target container component has been loaded or has not been loaded. Specifically, determining the loading result of the target container component according to the traversal of the matched result can include: if there is a loaded container component matching the target interface keyword in the loaded component list, obtaining a loading result that the target container component has been loaded; if there is no loaded container component matching the target interface keyword in the loaded component list, obtaining a loading result that the target container component has not been loaded.

[0151] In the above embodiments, according to the matching of the target interface keyword and the component name string corresponding to the loaded container component that has been loaded and recorded in the loaded component list, the container component corresponding to the component name matching the target interface keyword can be quickly found in the loaded component list to determine the target container component, so that useless repeated loading can be avoided, and the loading efficiency of the target container component in the lightweight application program can be improved.

[0152] In some embodiments, the trigger operation for the target function in the lightweight application program can generate an API call request, and if the loading result is that the target container component has been loaded, the lightweight application program can directly use the target container component to respond to the API call request of the lightweight application program, execute the related business logic, and execute the target function.

[0153] In step 430, if the loading result is that the target container component has not been loaded, it indicates that the target container component is not recorded in the loaded component list. At this time, the target container component can be locally searched according to the target interface keyword to obtain a search result for the target container component. In this way, it can be determined whether the target container component is saved locally, so that useless repeated downloading of the target container component can be avoided.

[0154] In some embodiments, referring to Figure 8 , the process of locally searching the target container component according to the target interface keyword specifically includes the following steps:

[0155] Step 810: obtaining the component names of all container components saved locally;

[0156] Step 820: concatenating all the component names into a string area by using a separator;

[0157] Step 830: constructing a state machine according to the target interface keyword;

[0158] Step 840: traversing the string area according to the state machine to obtain a search result for the target container component.

[0159] In step 810 of some embodiments, the object terminal can save some container components and corresponding component names locally (e.g., in a file system, a database, etc.), at which time the lightweight application can obtain the component names of all the container components saved locally.

[0160] In step 820 of some embodiments, the separator refers to a symbol or character used to separate or mark different data items, fields or components. Common separators can include a comma (,), a space, a tab, a semicolon (;), a vertical bar (|), etc. A component name is equivalent to a string, and string concatenation refers to a process of connecting multiple strings. Embodiments of the present application can use separators to concatenate all component names into strings, so as to accurately separate and identify different component names in subsequent processing. For example, if a comma is used as a separator to concatenate 3 component names, then a string area obtained after string concatenation can be: "component name 1, component name 2, component name 3".

[0161] In step 830 of some embodiments, the target interface keyword is composed of multiple target characters, i.e., equivalent to a string. Further, the present application can construct a state machine according to the target interface keyword, which is used to indicate the linking relationship between multiple target characters. The state machine of embodiments of the present application, also known as a finite state machine, is a tree-shaped data structure and algorithm logic designed for string matching of the target interface keyword. The state machine is used to indicate the linking relationship between multiple target characters.

[0162] Referring to Figure 9 , the state machine is a tree-shaped data structure composed of multiple nodes, where head represents the head node. For each node, f represents the target character, and the child pointer (child) points to the child node linking chain. Specifically, f is of type char, and child is of type struct_char_node* (a pointer type). The child node linking chain includes multiple child nodes, such as child node 1 and child node 2. For the string pointer (str), if the current node is the end node, then the string pointer points to the string formed by the link, otherwise it points to null.

[0163] In an example, assume that the target interface keyword is composed of four characters "abc", and the constructed state machine is as shown in Figure 10 . Figure 10In the example, the head node links the character node 1001 (target character is a). And for the character node 1001, the child pointer points to the character node 1002 (target character is b), and the string pointer points to null. For the character node 1002, the child pointer points to the character node 1003 (target character is c), and the string pointer points to null. For the character node 1003, the child pointer also points to null, but the string pointer points to the string "abc".

[0164] In some embodiments, referring to Figure 11 , the state machine is constructed according to the target interface keyword, including:

[0165] Step 1110, determining a plurality of target characters according to the target interface keyword;

[0166] Step 1120, creating a character node for each target character respectively;

[0167] Step 1130, creating a head node, and linking the head node to one of the plurality of character nodes;

[0168] Step 1140, determining a child node linking relationship between the plurality of character nodes according to the order of the plurality of target characters constituting the target interface keyword;

[0169] Step 1150, for each character node, pointing the child pointer to other character nodes meeting the child node linking relationship to form a child node linking chain;

[0170] Step 1160, for the last character node in the child node linking chain, pointing the string pointer to a target string corresponding to the target interface keyword, and pointing the string pointer of other character nodes in the child node linking chain to null.

[0171] In step 1110 of some embodiments, because the target interface keyword is composed of a plurality of target characters, the target interface keyword can be split to obtain a plurality of target characters. In an example, if the target interface keyword is "scanCode", the target characters obtained after splitting include {s, c, a, n, C, o, d, e}, a total of 8 characters.

[0172] In some embodiments, the target interface keyword can be de-duplicated to update the plurality of target characters. As can be seen, the present application can effectively reduce the number of target characters by using the de-duplicated method after character splitting, thereby reducing the complexity of the constructed state machine.

[0173] In step 1120 of some embodiments, a character node is created for each target character. The character node contains the target character, a child pointer, and a string pointer. The child pointer points to a character node that is linked to the character node as a child. If the character node is the last node in the child link chain, the string pointer points to the string corresponding to the child link chain, otherwise the string pointer is empty.

[0174] It should be noted that although the target characters can be different from each other, the target characters contained in the character nodes can be the same.

[0175] In an embodiment, the process of creating a character node for each target character includes:

[0176] The character nodes are drawn according to the number of times the target character appears in the string, wherein the string includes a string formed by the target characters that constitute the target interface keyword.

[0177] The target character, the child pointer, and the string pointer are marked on the drawn character node.

[0178] In an example, if the target interface keyword has three target characters, i.e., {a, b, b}, referring to Figure 12 , a character node 1201 can be created according to the fact that a appears once in abc, and character nodes 1202 and 1203 can be created according to the fact that b appears twice in abc. The respective target characters are marked on the character nodes 1201-1203, and the child pointer and the string pointer are marked. At this time, the child pointer and the string pointer are empty.

[0179] It should be noted that other ways of creating character nodes can also be used, and the embodiments of the present application do not make specific limitations in this regard.

[0180] In step 1130 of some embodiments, the head node is a node that serves as a starting position, and the character nodes in the state machine can be traversed layer by layer starting from the head node. The head node is linked to one of the character nodes. The head node can also be a head pointer that points to one of the character nodes. The target character corresponding to the character node linked to the head node is the first character that constitutes the target interface keyword. For example, referring to Figure 12 , the character nodes 1201-1203 created in Figure 13 , the head node can be linked to the character node 1201 after the head node is created.

[0181] In step 1140 of some embodiments, if the order of the plurality of target characters refers to the order relationship between adjacent two characters, the sub-node linkage relationship between the adjacent two characters can be determined according to the order relationship of the plurality of target characters constituting the target interface keyword. For example, as shown in FIG. 12, the order relationship exists between the character node 1201 (the target character is a) and the character node 1202 (the target character is b), and thus the sub-node linkage relationship exists between the character node 1201 (the target character is a) and the character node 1202 (the target character is b). The order relationship exists between the character node 1202 (the target character is b) and the character node 1203 (the target character is b), and thus the sub-node linkage relationship exists between the character node 1202 (the target character is b) and the character node 1203 (the target character is b). Figure 12

[0182] In step 1150 of some embodiments, referring to Figure 13 , for the character node 1201, the child pointer is directed to the character node 1202 having the sub-node linkage relationship with the character node 1201. For the character node 1202, the child pointer is directed to the character node 1203 having the sub-node linkage relationship with the character node 1202. For the character node 1203, the child pointer is empty because there is no character node having the sub-node linkage relationship with the character node 1203. Further, the character node 1201 to the character node 1203 form a sub-node linkage chain.

[0183] In step 1160 of some embodiments, referring to Figure 13 , if the target interface keyword is abb, for the last character node in the sub-node linkage chain, i.e., the character node 1203, the string pointer can be directed to the target string corresponding to the three target characters (a, b and b) corresponding to the sub-node linkage chain, i.e., abb. The string pointers of the other character nodes in the sub-node linkage chain are directed to be empty, i.e., the string pointers of the character node 1201 and the character node 1202 in the sub-node linkage chain are directed to be empty. At this point, the state machine construction is completed.

[0184] The embodiments of the above steps 1110 to 1160 have the benefit that the state machine can be constructed based on the association between the plurality of target characters, and the automation degree of constructing the state machine is improved.

[0185] In step 840 of some embodiments, the string area is traversed according to the state machine, and the search result for the target container component is obtained.

[0186] In some embodiments, referring to Figure 14 , step 840 can specifically include:

[0187] Step 1410, initializing a node marker pointing to a head node; ​

[0188] Step 1420, character traversal is performed on the string area to obtain a current read character;

[0189] Step 1430, if the read character is not a delimiter, node traversal is performed along the child node link chain, a comparison result is obtained by comparing the read character with the target character contained in the character node currently traversed, a character node pointed to by the node marker is determined according to the comparison result, and the step of performing character traversal on the string area is returned;

[0190] Step 1440, if the read character is a delimiter, and the character node pointed to by the node marker is a null node, or the string pointer of the character node pointed to by the node marker points to null, the node marker is pointed to the head node, and the step of performing character traversal on the string area is returned;

[0191] Step 1450, if the read character is a delimiter, and the character node pointed to by the node marker is not a null node, and the string pointer of the character node pointed to by the node marker does not point to null, the content pointed to by the string pointer of the character node pointed to by the node marker is saved in a preset storage space;

[0192] Step 1460, after the character traversal on the string area is completed, a search result for the target container component is obtained according to the content saved in the storage space.

[0193] In step 1410 of some embodiments, the node marker is a variable used to mark the character node traversed when the state machine is traversed. The node marker initially points to the head node.

[0194] In step 1420 of some embodiments, the string area corresponding to the component name of all the locally saved container components stores a plurality of strings, and there are delimiters (such as “\0”) between the strings. For example, the string area stores {pa\0ab\0bcc\0ad\0}, a total of 4 strings and 4 delimiters. By traversing the string area corresponding to the component name of all the locally saved container components, the current read characters are p, a, \0, a, b, \0, b, c, c, \0, a, d, and \0 in turn, a total of 13 characters. It can be seen that the current read character can be a delimiter or not.

[0195] In step 1430 of some embodiments, if the read character is not a delimiter, it is an effective character, and node traversal is performed along the child node link chain by using the node marker, a comparison result is obtained by comparing the read character with the target character contained in the character node currently traversed. Then, a character node pointed to by the node marker is determined according to the comparison result, and the step of performing character traversal on the string area is returned, i.e., step 1420 is returned.

[0196] In some embodiments, the comparison result includes whether the read character matches or does not match the target character contained in the currently traversed character node. Therefore, determining the character node pointed to by the node tag based on the comparison result includes:

[0197] If the comparison result shows that the read character is consistent with the target character contained in the currently traversed character node, then the character node pointed to by the node marker is determined to be the currently traversed character node.

[0198] If the comparison result shows that the character read is inconsistent with the target character contained in the currently traversed character node, the character node pointed to by the node marker is determined to be an empty node.

[0199] In one example, the first character read is 'p', and the node marker points to the head node. (See reference...) Figure 13 Starting from the head node, the currently traversed character nodes are obtained sequentially along the child node chain, namely character nodes 1201, 1202, and 1203. If the comparison results are all inconsistent, it can be determined that the character node pointed to by the node marker is an empty node. The second character read is 'a', and the node marker is reset from pointing to an empty node to pointing to the head node. Starting from the head node, the currently traversed character nodes are obtained sequentially along the child node chain. Since the target character contained in character node 1201 is the same as the read character, there is no need to traverse other character nodes, and it is determined that the node marker points to character node 1201. For the next read character, if it is not a separator, the node traversal starts from character node 1201 pointed to by the node marker and proceeds along the child node chain.

[0200] In the above embodiments, this application can set the pointer of the node marker according to different comparison results, thereby improving the accuracy of node traversal of the state machine.

[0201] In step 1440 of some embodiments, if the character being read is a delimiter, and the character node pointed to by the node marker is an empty node, or the string pointer of the character node pointed to by the node marker is null, then it indicates that a string has been traversed, the node marker is set to the head node, and the process returns to step 1420.

[0202] In step 1450 of some embodiments, if the character being read is a delimiter, and the character node pointed to by the node marker is not an empty node and the string pointer of the character node pointed to by the node marker is not empty, the content pointed to by the string pointer of the character node pointed to by the node marker is saved in a preset storage space.

[0203] In step 1460 of some embodiments, after the character traversal of the string area is completed, the lookup result for the target container component is obtained according to the content stored in the storage space. If the storage space stores content, it is determined that the target container component exists locally, and the content stored in the storage space is the target string corresponding to the target interface keyword. If the storage space does not store content, it is determined that the target container component does not exist locally.

[0204] The above embodiment has the benefit that the character traversal of the string area can be completed according to whether the character node pointed to by the node mark is empty and whether the string pointer of the character node is empty, and the accuracy of the node traversal of the state machine can be improved.

[0205] It should be noted that the process of constructing the state machine according to the target interface keyword to perform the traversal matching of the component name of the container component according to the constructed state machine can refer to steps 810 to 840 of the present application, and specifically, the component names of all the locally stored container components therein can be replaced by the component names of all the currently loaded loaded container components recorded in the loaded component list to obtain a new string area. Further, the state machine is constructed according to the target interface keyword, and the new string area is traversed according to the state machine to obtain the lookup result for the target container component.

[0206] In some embodiments, the trigger operation for the target function in the lightweight application can generate an API call request, and if the lookup result is that the target container component exists locally, the lightweight application can load the target container component locally, and the loaded target container component can execute the related business logic, i.e., the target function, in response to the API call request of the lightweight application. Wherein, the component loading refers to loading an independent container component from a disk or a storage device to a memory, so that the container component can be called and executed during the running of the lightweight application, thereby achieving flexible component management and dynamic function extension.

[0207] In step 440, if the lookup result is that the target container component does not exist locally, the target container component can be obtained from the server according to the target interface keyword. In this way, the target container component can be downloaded and loaded from the server only when it is needed, so that the loaded target container component can execute the target function, thereby achieving the purpose of on-demand loading of the target container component.

[0208] In some embodiments, referring to Figure 15 , the target container component can be obtained from the server according to the target interface keyword, which can specifically include:

[0209] In step 1510, the program toolkit version information of the lightweight application is obtained.

[0210] In step 1520, the target container component is obtained from the server according to the program kit version information and the target interface keyword.

[0211] In step 1510 of some embodiments, if the search result is that the target container component does not exist locally, the program kit version information of the light application, i.e., the SDK version information, can be obtained. The SDK version information can include version number, update content, release date, etc., and can help understand the new features of the SDK, the problems fixed, and the changes in compatibility.

[0212] In step 1520 of some embodiments, if the search result is that the target container component does not exist locally, the light application can communicate with the server through the background component management service interface to check the current latest container component information, and obtain the target container component from the server.

[0213] In some embodiments, step 1520 can specifically include:

[0214] According to the program kit version information and the target interface keyword, component version information, a component download address, and download method information of the target container component are obtained from the server;

[0215] According to the component version information, the component download address, and the download method information, the target container component is obtained from the server.

[0216] It should be noted that the component version information refers to the version number or other version-related information of the target container component. The component download address refers to the address of the location of the target container component, which can be a Uniform Resource Locator (URL) link through which the corresponding container file of the target container component can be downloaded. The download method information refers to the method information for downloading the corresponding container file of the target container component, for example, whether to use a differential method to download the container file. The differential method refers to a method of downloading only the changed part of the file instead of the entire file by comparing the difference between the files. This method can reduce the amount of data transmitted, thereby improving the download and transmission efficiency. The application can also use other file download methods, such as using specific download tools, commands, etc., which are not limited herein.

[0217] Further, after obtaining the component version information, the component download address, and the download method information, the container file of the target container component can be downloaded from the server to update the related information of the target container component locally according to the container file.

[0218] In step 450, after obtaining the target container component, the light application can load the target container component, so that the target container component after loading performs the target function, so that the dynamic loading of the components of the light application can be realized.

[0219] In some embodiments, referring to Figure 16 loading the target container component can specifically include:

[0220] Step 1610, installing the target container component to the target installation directory;

[0221] Step 1620, taking the installation path corresponding to the target installation directory as a loading path entry, calling a class loader for dynamically loading the target container component, and loading the target container component in the target installation directory.

[0222] In step 1610 of some embodiments, the target installation directory refers to a directory specified by the light application, used to store installed components, files or tools. The target container file obtained by the present application can be from the loaded component list, the local or the server, so installing the target container component to the target installation directory means copying or moving the target container component from the source location (such as the server, the local, etc.) to the predetermined target installation directory, ensuring that the target container component is correctly placed in the specified directory for subsequent loading and calling operations.

[0223] It should be noted that during the installation of the target container component, the present application can continuously detect whether the target installation directory exists the related files of the target container component, and if so, it is considered that the installation is successful.

[0224] In step 1620 of some embodiments, the installation path corresponding to the target installation directory is taken as a loading path entry, that is, the installation path corresponding to the target installation directory of the installed target container component can be added to the loading path of the system, so that the light application can find and load the component. The present application can call the current DexClassLoader as a class loader for dynamically loading the target container component, to load the target container component in the target installation directory. For example, the organization mode of the installation path corresponding to the target container component is "application private path / first-level storage path / component name / component version / container file", the light application SDK can use DexClassLoader to load the container file corresponding to the target container component from the corresponding installation path, and the specific loading mode can be to call the constructor method of DexClassLoader, taking the installation path of the container file as the loading path entry of DexClassLoader, and adding the container file to the runtime dependency, to realize the loading of the target container component in the target installation directory.

[0225] It should be noted that the class loader (ClassLoader) is a mechanism for loading Java class files in Java, through which classes, resources and components can be dynamically loaded. The DexClassLoader is a class loader in the Android platform for dynamically loading DEX files (Dalvik Executable) at runtime. The DEX file is the main compilation product (i.e., the executable file format file) of an Android application, which contains the code of the application.

[0226] It should be noted that in order to achieve the loading of the resource file corresponding to the target container component, an AssetManager, a Resources, and a ContextWrapper instance object need to be constructed, and these resource object managers and the target container component need to be associated to ensure that the resource file can be correctly found.

[0227] Among them, AssetManager is a class for accessing raw resource files. These resource files are usually located in the assets directory of the lightweight application. Resources is an interface that can provide access to application resources. These application resources can include strings, colors, dimensions, layouts, images, etc., and are usually located in the res directory of the lightweight application. The Resources object is associated with the Context of the lightweight application and can be obtained through the getResources() method of the Context. ContextWrapper is a class that can provide wrapping or proxying of Context objects. In Android, Context is a very important interface that can provide methods for accessing lightweight application-specific resources and classes, as well as permissions for calling application-level operations. ContextWrapper allows developers to add or override certain functions without affecting the original Context.

[0228] In the above embodiments, the application loads the target container component in the target installation directory by calling the class loader for dynamically loading the target container component, so that the program can access and use the functions provided by the component in real time, realizing flexible and dynamic use of the component. Moreover, in this process, the host application of the lightweight application does not need to be redeveloped and versioned for the target container component, so the loading efficiency of the target container component in the lightweight application as a whole can be improved, thereby improving the user's experience.

[0229] In some other embodiments, with reference to Figure 17The loading of the target container component can further include:

[0230] In step 1710, a loaded component list is obtained.

[0231] In step 1720, a business instance corresponding to the target container component is constructed, and the business instance is added to the loaded component list.

[0232] In step 1710 of some embodiments, the loaded component list records the loaded container components that have been loaded at present. The above-mentioned embodiments have been described in detail, and thus will not be described herein.

[0233] In step 1720 of some embodiments, the application can find the business implementation entry class (i.e., the class inheriting BasePlugin) of the target container component corresponding to the lightweight application program from the classpath in a reflective manner. Then, the business instance corresponding to the target container component can be constructed in a reflective manner (e.g., Class.newInstance()). Further, the constructed business instance corresponding to the target container component can be added to the component list of the lightweight application program runtime, i.e., added to the loaded component list, to indicate that the target container component is available at present.

[0234] It should be noted that the classpath refers to the search path of Java class files (.class files) and JAR files (Java Archive, a file for packaging multiple Java class files and related resources). When a Java virtual machine (JVM) or a Java compiler needs to load a class, the corresponding.class file or JAR file can be searched in the classpath.

[0235] In some embodiments, as shown in FIG. 7, a specific implementation process of the application for dynamically installing the target container component can include: Figure 18

[0236] (1) Start;

[0237] (2) Read the installation state of the target container component from the target installation directory;

[0238] (3) Determine whether the installation state is successful. If yes, i.e., the installation is unsuccessful, perform step (4). If no, i.e., the installation is successful, perform step (5). This step refers to determining whether the target container component is installed in the target installation directory;

[0239] (4) Install the target container component to the specified installation path, and perform step (2) again;

[0240] ​(5) constructing a class loader for dynamically loading the target container component; the specific process can refer to step 1620 in the foregoing description;

[0241] (6) constructing a business instance corresponding to the target container component; the specific process can refer to step 1720 in the foregoing description;

[0242] (7) updating the loaded component list; the specific process can refer to step 1720 in the foregoing description;

[0243] (8) ending.

[0244] In some embodiments, as shown in FIG. 5, a specific implementation process of the component loading method provided by the embodiments of the present application can include: Figure 19

[0245] (1) receiving an API calling request of the light application; that is, in response to a triggering operation of a target function in the light application, the specific process can refer to step 410 in the foregoing description;

[0246] (2) extracting an API keyword of a function interface corresponding to the target function; that is, obtaining a target interface keyword of the function interface corresponding to the target function, the specific process can refer to step 410 in the foregoing description;

[0247] (3) checking the loaded component list; that is, loading the target container component corresponding to the target function according to the target interface keyword to obtain a loading result of the target container component, the specific process can refer to step 420 in the foregoing description;

[0248] (4) determining whether to load, if yes, that is, the loading result is that the target container component has been loaded, performing step (10); if no, that is, the loading result is that the target container component has not been loaded, performing step (5);

[0249] (5) querying the local component; that is, locally searching the target container component according to the target interface keyword to obtain a searching result of the target container component, the specific process can refer to step 430 in the foregoing description;

[0250] (6) determining whether the target container component exists in the local, if yes, that is, the target container component exists in the local, performing step (9); if no, that is, the target container component does not exist in the local, performing step (7);

[0251] (7) component detection updating; that is, obtaining the target container component from the server according to the target interface keyword, the specific process can refer to step 440 in the foregoing description;

[0252] (8) updating the local component; the specific process can refer to step 440 in the foregoing description; ​

[0253] (9) loading the target container component; the specific process can refer to step 450 in the foregoing;

[0254] (10) responding to the API call logic; that is, causing the target container component after loading to execute the target function; the specific process can refer to step 450 in the foregoing;

[0255] (11) ending.

[0256] In some embodiments, referring to Figure 20 , the component loading method provided in the application can further include:

[0257] Step 2010, in response to a triggering operation of the light application, obtaining first component version information and a function interface keyword corresponding to each existing container component in the light application;

[0258] Step 2020, according to the function interface keyword corresponding to each existing container component, obtaining second component version information of each existing container component currently saved from the server;

[0259] Step 2030, for each existing container component, updating the existing container component according to the first component version information and the second component version information;

[0260] Step 2040, for the existing container component after updating, updating the corresponding first component version information to the corresponding second component version information;

[0261] Step 2050, preloading the existing container component after updating.

[0262] In step 2010 of some embodiments, the first component version information refers to the component version information corresponding to each existing container component loaded in the light application, and the component version information has been described in detail in the foregoing embodiments and will not be repeated here.

[0263] It should be noted that the component loading method provided in the application can further include version update management of the mini program container component. The container SDK of the light application is initialized (for example, it can correspond to the start of the host application), and the container component management service corresponding to the light application is started. Further, the container component version management service of the light application and the background component management service can be communicated to query the component information of the light application currently existing locally, including the first component version information and the function interface keyword corresponding to each existing container component.

[0264] In step 2020 of some embodiments, the second component version information refers to the component version information corresponding to the latest container component that has been updated and saved in the server. At this time, the light application can obtain the second component version information of each existing container component currently saved in the server according to the functional interface keyword corresponding to each existing container component. The first component version information and the second component version information can be the same or different, depending on whether the update is performed.

[0265] In step 2030 of some embodiments, for each existing container component, the light application can compare the first component version information with the second component version information to determine whether there is update information for each existing container component. If there is an update, the container file of the existing container component with the update obtained from the service can be downloaded to the local to update the existing container component.

[0266] In step 2040 of some embodiments, after the container file of the updated existing container component is downloaded, for the existing container component that has been updated, the light application can update the corresponding first component version information to the corresponding second component version information to update the version information of the existing container component locally.

[0267] In step 2050 of some embodiments, the existing container component that has been updated can be preloaded by the component loader of the light application. The preloading also refers to the installation, which can be understood as, for the updated existing container component, after the download update is completed, the existing container component can be pre-installed locally, and when the actual call is run, the class loader for dynamically loading the target container component is called to load the target container component in the target installation directory, so that the applet component can run.

[0268] In some embodiments, as shown in Figure 21 the specific implementation process of the component update of the target container component provided by the embodiments of the present application can include:

[0269] (1) Start;

[0270] (2) Container information version management service starts; that is, in response to the trigger operation of the light application, the specific process can refer to step 2010 in the foregoing;

[0271] (3) Check the update of the existing container component; that is, the second component version information of each existing container component currently saved in the server is obtained according to the functional interface keyword corresponding to each existing container component, and the specific process can refer to step 2020 in the foregoing;

[0272] (4) judging whether there is an update, if yes, executing step (5), that is, the first component version information and the second component version information are different; if no, executing step (6), that is, the first component version information and the second component version information are the same, and no update is needed, and the specific process can refer to step 2030 in the foregoing;

[0273] (5) downloading the updated local container information; the specific process can refer to step 2040 in the foregoing;

[0274] (6) preloading the existing container component of the update processing; the specific process can refer to step 2050 in the foregoing;

[0275] (7) ending.

[0276] In the above embodiment, the application first performs loading confirmation on the target container component, if the loading result is that the target container component is not loaded, then the target container component is locally searched according to the target interface keyword, if the searching result is that the target container component does not exist locally, then the target container component is obtained from the server according to the target interface keyword, and then the target container component is loaded, so that the target container component after loading performs the target function, thus, useless repeated downloading of the target container component can be avoided, the target function of the target container component after loading is performed, and the purpose of on-demand loading of the target container component is achieved, and in this process, the host application of the light application does not need to be redeveloped and version-published for the target container component, and therefore the loading efficiency of the target container component in the light application as a whole can be improved, and the user experience can be improved.

[0277] It can be understood that, although each step in each flowchart above is displayed in sequence according to the arrow representation, these steps are not necessarily executed in sequence according to the arrow representation. Unless otherwise specified in the embodiment, the execution of these steps does not have strict sequence restrictions, and these steps can be executed in other sequences. Moreover, at least part of the steps in the flowchart above can include multiple steps or multiple stages, and these steps or stages do not necessarily execute at the same time, but can execute at different times, and the execution sequence of these steps or stages is not necessarily sequential, but can be executed in rotation or alternation with at least part of other steps or steps or stages in other steps.

[0278] Figure 22 A structural schematic diagram of a component loading device 2200 provided by the embodiment of the application is shown. The component loading device 2200 can specifically include:

[0279] The information acquisition unit 2210 is configured to acquire a target interface keyword of a function interface corresponding to a target function in response to a triggering operation for the target function in the light application program.

[0280] The loading confirmation unit 2220 is configured to perform loading confirmation on the target container component corresponding to the target function according to the target interface keyword, and obtain a loading result of the target container component.

[0281] The component searching unit 2230 is configured to perform local searching on the target container component according to the target interface keyword if the loading result is that the target container component is not loaded, and obtain a searching result of the target container component.

[0282] The component acquisition unit 2240 is configured to acquire the target container component from the server according to the target interface keyword if the searching result is that the target container component does not exist locally.

[0283] The component running unit 2250 is configured to load the target container component, so that the target container component after loading performs the target function.

[0284] Optionally, the loading confirmation unit 2220 is specifically configured to:

[0285] acquire an already-loaded component list, and the already-loaded component list records already-loaded container components that have been loaded at present;

[0286] perform traversal matching on all the already-loaded container components in the already-loaded component list according to the target interface keyword;

[0287] if there is an already-loaded container component in the already-loaded component list that matches the target interface keyword, obtain a loading result that the target container component has been loaded at present;

[0288] if there is no already-loaded container component in the already-loaded component list that matches the target interface keyword, obtain a loading result that the target container component has not been loaded at present.

[0289] Optionally, the component acquisition unit 2240 is specifically configured to:

[0290] acquire program toolkit version information of the light application program;

[0291] acquire the target container component from the server according to the program toolkit version information and the target interface keyword.

[0292] Optionally, the component acquisition unit 2240 is specifically further configured to:

[0293] acquire component version information, a component download address and download mode information of the target container component from the server according to the program toolkit version information and the target interface keyword.

[0294] According to the component version information, the component download address and the download mode information, the target container component is obtained from the server.

[0295] Optionally, the component loading apparatus further comprises a component processing unit (not shown) configured to:

[0296] In response to a triggering operation for the light application, the first component version information and the function interface keyword corresponding to each existing container component in the light application are obtained;

[0297] According to the function interface keyword corresponding to each existing container component, the second component version information of each existing container component currently saved in the server is obtained;

[0298] For each existing container component, the existing container component is updated according to the first component version information and the second component version information;

[0299] For the existing container component that has been updated, the corresponding first component version information is updated to the corresponding second component version information;

[0300] The existing container component that has been updated is preloaded.

[0301] Optionally, the component running unit 2250 is specifically configured to:

[0302] The target container component is installed into a target installation directory;

[0303] The installation path corresponding to the target installation directory is taken as a loading path entry, a class loader for dynamically loading the target container component is invoked, and the target container component in the target installation directory is loaded.

[0304] Optionally, the component running unit 2250 is specifically further configured to:

[0305] An already-loaded component list is obtained, and the already-loaded component list records the already-loaded container components that have been currently loaded;

[0306] A business instance corresponding to the target container component is constructed, and the business instance is added to the already-loaded component list.

[0307] Optionally, the component searching unit 2230 is specifically configured to:

[0308] The component names of all the container components saved locally are obtained;

[0309] All the component names are concatenated into a string by using a separator, and a string area is obtained;

[0310] The state machine is used to indicate a link relationship between the plurality of target characters, and the target interface keyword is composed of the plurality of target characters;

[0311] The state machine is used to indicate a link relationship between the plurality of target characters, and the target interface keyword is composed of the plurality of target characters;

[0312] Optionally, the component searching unit 2230 is specifically configured to:

[0313] According to the target interface keyword, the plurality of target characters are determined;

[0314] For each target character, a character node is created, wherein the character node includes the target character, a child pointer, and a string pointer;

[0315] A head node is created, and the head node is linked to one of the plurality of character nodes, wherein the target character corresponding to the character node linked to the head node is the first character constituting the target interface keyword;

[0316] According to the front and back order of the plurality of target characters constituting the target interface keyword, a child node link relationship between the plurality of character nodes is determined;

[0317] For each character node, the child pointer is pointed to other character nodes meeting the child node link relationship, to form a child node link chain;

[0318] For the last character node in the child node link chain, the string pointer is pointed to a target string corresponding to the target interface keyword, and the string pointers of other character nodes of the child node link chain are pointed to null.

[0319] Optionally, the component searching unit 2230 is specifically configured to:

[0320] A node marker pointing to the head node is initialized;

[0321] The character traversal is performed on the string area, to obtain a current read character;

[0322] If the read character is not a delimiter, node traversal is performed along the child node link chain, a comparison result is obtained by comparing the read character with a target character included in a character node currently traversed, a character node pointed to by the node marker is determined according to the comparison result, and the step of performing character traversal on the string area is returned;

[0323] If the read character is a delimiter, and the character node pointed to by the node marker is a null node, or the string pointer of the character node pointed to by the node marker is pointed to null, the node marker is pointed to the head node, and the step of performing character traversal on the string area is returned;

[0324] If the read character is a separator, and the character node pointed to by the node marker is not a null node, and the string pointer of the character node pointed to by the node marker points to a non-empty string, the content pointed to by the string pointer of the character node pointed to by the node marker is saved in the preset storage space;

[0325] After the character traversal of the string area is completed, the search result for the target container component is obtained according to the content saved in the storage space.

[0326] Optionally, the component searching unit 2230 is specifically configured to:

[0327] If the comparison result is that the read character is consistent with the target character contained in the character node currently traversed, it is determined that the character node pointed to by the node marker is the character node currently traversed.

[0328] If the comparison result is that the read character is inconsistent with the target character contained in the character node currently traversed, it is determined that the character node pointed to by the node marker is a null node.

[0329] Referring to Figure 23 The embodiment of the application further discloses an electronic device, and the electronic device 2300 comprises:

[0330] at least one processor 2301;

[0331] at least one memory 2302 configured to store at least one program;

[0332] When the at least one program is executed by the at least one processor 2301, the component loading method is implemented.

[0333] The embodiment of the application further discloses a computer readable storage medium, wherein a computer program executable by a processor is stored, and the computer program executable by the processor is used to implement the component loading method when the computer program executable by the processor is executed by the processor.

[0334] The embodiment of the application further discloses a computer program product, comprising a computer program or computer instructions, the computer program or computer instructions are stored in a computer readable storage medium, and the processor of the electronic device reads the computer program or computer instructions from the computer readable storage medium, and the processor executes the computer program or computer instructions, so that the electronic device executes the component loading method.

[0335] It can be understood that, although the steps in the above flowcharts are shown in sequence according to the arrows, the steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in the embodiments, the steps are not necessarily executed in strict sequence, and the steps can be executed in other sequences. Moreover, at least some of the steps in the above flowcharts can include multiple steps or multiple stages, which are not necessarily executed at the same time, but can be executed at different times, and the execution sequence of the steps or stages is not necessarily sequential, but can be executed alternately or alternately with at least some of the other steps or steps or stages in other steps.

[0336] The terms "first", "second", "third", "fourth" and the like in the description of the application and in the claims of the foregoing drawings, if any, are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the use of the terms so

[0337] It should be understood that in this application, "at least one" means one or more, and "multiple" means two or more. "And / or" is used to describe the relationship between the associated objects, which means that there can be three relationships, for example, "A and / or B" can mean that only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally represents that the associated objects before and after are a "or" relationship. "At least one of the following" or the like means any combination of these items, including any combination of single or multiple items. For example, at least one of a, b or c, can mean a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, c can be single or multiple.

[0338] In several embodiments provided in the present application, it should be understood that the disclosed system, device and method can be implemented in other manners. For example, the described device embodiments are merely illustrative. For example, the division of the units is only a logical function division. There can be another division manner for the actual implementation, for example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the displayed or discussed mutual couplings or direct couplings or communication connections can be indirect couplings or communication connections through some interfaces, devices or units, and can be in electrical, mechanical or other forms.

[0339] In the embodiments of the present application, the term "module" or "unit" refers to a computer program or a part of a computer program with a predetermined function, and works together with other related parts to achieve a predetermined target, and can be implemented entirely or partially by using software, hardware (such as a processing circuit or a memory) or a combination thereof. Similarly, one processor (or multiple processors or memories) can be used to implement one or more modules or units. In addition, each module or unit can be a part of an integral module or unit that includes the functions of the module or unit.

[0340] The units described as separate components can or can not be physically separate, and the components shown as units can or can not be physical units, that is, they can be located in one place, or they can be distributed on multiple network units. Part or all of the units can be selected according to actual needs to achieve the purpose of the embodiments of the present application.

[0341] In addition, each functional unit in the various embodiments of the present application can be integrated in one processing unit, or each unit can be a physically separate unit, or two or more units can be integrated in one unit. The integrated unit can be implemented in the form of hardware or in the form of a software functional unit.

[0342] The integrated unit, if implemented in the form of a software function unit and sold or used as an independent product, can be stored in a computer readable storage medium. Based on such understanding, the technical solutions of the present application or the part that essentially contributes to the related art or the whole or part of the technical solutions can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes a plurality of instructions for causing a computer device (which can be a personal computer, a server or a network device, etc.) to execute all or part of the steps of the method described in the embodiments of the present application. The aforementioned storage medium includes a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and various media that can store program codes.

[0343] For the step numbers in the above method embodiments, only the order between the steps is set for the convenience of explanation, and the order of the execution of each step in the embodiments can be adaptively adjusted according to the understanding of those skilled in the art.

Claims

1. An assembly loading method, characterized by, The method comprises the following steps: In response to a triggering operation for a target function in a light application, a target interface keyword of a function interface corresponding to the target function is acquired; A loading result of a target container component corresponding to the target function is obtained by loading confirmation of the target container component according to the target interface keyword; If the loading result is that the target container component is not loaded, a search result for the target container component is obtained by local search of the target container component according to the target interface keyword; If the search result is that the target container component does not exist locally, the target container component is acquired from a server according to the target interface keyword; The target container component is loaded to enable the target container component after loading to execute the target function.

2. The method of claim 1, wherein, The loading confirmation of the target container component according to the target interface keyword to obtain the loading result of the target container component comprises: An already-loaded component list is acquired, and the already-loaded component list records already-loaded container components that have been loaded currently; All the already-loaded container components in the already-loaded component list are matched by iteration according to the target interface keyword; If there is an already-loaded container component matching the target interface keyword in the already-loaded component list, the loading result that the target container component has been loaded currently is obtained; If there is no already-loaded container component matching the target interface keyword in the already-loaded component list, the loading result that the target container component has not been loaded currently is obtained.

3. The method of claim 1, wherein, The target container component is acquired from the server according to the target interface keyword, which comprises: Program toolkit version information of the light application is acquired; The target container component is acquired from the server according to the program toolkit version information and the target interface keyword.

4. The method of claim 3, wherein, The target container component is acquired from the server according to the program toolkit version information and the target interface keyword, which comprises: Component version information, a component download address and download mode information of the target container component are acquired from the server according to the program toolkit version information and the target interface keyword; The target container component is acquired from the server according to the component version information, the component download address and the download mode information.

5. The method of claim 1, wherein, The method further comprises: In response to a triggering operation for a light application, first component version information and a function interface keyword corresponding to each existing container component in the light application are acquired; Second component version information of each existing container component currently saved in the server is acquired from the server according to the function interface keyword corresponding to each existing container component; For each existing container component, the existing container component is updated according to the first component version information and the second component version information; For the existing container component that has been updated, the corresponding first component version information is updated to the corresponding second component version information. Preloading the existing container component to which the updating process is performed.

6. The method of claim 1, wherein, The loading of the target container component comprises: installing the target container component to a target installation directory; taking the installation path corresponding to the target installation directory as a loading path entry, calling a class loader for dynamically loading the target container component, and loading the target container component in the target installation directory.

7. The method of claim 6, wherein, The loading of the target container component further comprises: obtaining a loaded component list in which loaded container components currently loaded are recorded; constructing a business instance corresponding to the target container component and adding the business instance to the loaded component list.

8. The method of claim 1, wherein, The process of locally searching for the target container component according to the target interface keyword comprises the following steps: obtaining component names of all container components locally saved; concatenating all the component names into a string area by using a separator; constructing a state machine according to the target interface keyword, the state machine being used to indicate a link relationship between multiple target characters, the target interface keyword being composed of the multiple target characters; performing character traversal on the string area according to the state machine to obtain a search result for the target container component.

9. The method of claim 8, wherein, The construction of the state machine according to the target interface keyword comprises: determining multiple target characters according to the target interface keyword; respectively creating a character node for each target character, wherein the character node contains the target character, a child pointer and a string pointer; creating a head node and linking the head node to one character node of the multiple character nodes, wherein the target character corresponding to the character node linked to the head node is the first character constituting the target interface keyword; determining a child node link relationship between the multiple character nodes according to the order of the multiple target characters constituting the target interface keyword; for each character node, pointing the child pointer to other character nodes conforming to the child node link relationship to form a child node link chain; for the last character node in the child node link chain, pointing the string pointer to a target string constituting the target interface keyword and pointing the string pointers of other character nodes of the child node link chain to null.

10. The method of claim 9, wherein, The character traversal on the string area according to the state machine to obtain the search result for the target container component comprises: initializing a node marker pointing to the head node; performing character traversal on the string area to obtain a current read character; if the read character is not the separator, performing node traversal along the child node link chain, comparing the read character with the target character contained in the character node currently traversed to obtain a comparison result, determining a character node pointed to by the node marker according to the comparison result, and returning to the step of performing character traversal on the string area; if the read character is the separator, and the character node pointed to by the node marker is a null node, or the string pointer of the character node pointed to by the node marker points to null, the node marker is pointed to the head node, and the step of character traversal of the string area is returned; if the read character is the separator, and the character node pointed to by the node marker is not a null node, the string pointer of the character node pointed to by the node marker does not point to null, the content pointed to by the string pointer of the character node pointed to by the node marker is saved in a preset storage space; after the character traversal of the string area is completed, the search result for the target container component is obtained according to the content saved in the storage space.

11. The method of claim 10, wherein, the node marker is determined according to the comparison result, including: if the comparison result is that the read character is consistent with the target character contained in the character node currently traversed, the character node pointed to by the node marker is determined as the character node currently traversed; if the comparison result is that the read character is not consistent with the target character contained in the character node currently traversed, the character node pointed to by the node marker is determined as a null node.

12. An assembly loading device, characterized by including: an information acquisition unit, configured to acquire a target interface keyword of a function interface corresponding to a target function in a light application program in response to a trigger operation for the target function; a loading confirmation unit, configured to perform loading confirmation on a target container component corresponding to the target function according to the target interface keyword, and obtain a loading result of the target container component; a component search unit, configured to perform local search on the target container component according to the target interface keyword if the loading result is that the target container component is not loaded, and obtain a search result for the target container component; a component acquisition unit, configured to acquire the target container component from a server according to the target interface keyword if the search result is that the target container component does not exist locally; a component running unit, configured to load the target container component, so that the target container component after loading performs the target function.

13. An electronic device, comprising: including: at least one processor; at least one memory for storing at least one program; when at least one program is executed by at least one processor, the component loading method according to any one of claims 1 to 11 is implemented.

14. A computer-readable storage medium, characterized in that, a computer program executable by a processor is stored in the memory, and the computer program executable by the processor is executed by the processor to implement the component loading method according to any one of claims 1 to 11.

15. A computer program product comprising computer programs or computer instructions, characterized in that, the computer program or the computer instruction is stored in a computer readable storage medium, and the processor of the electronic device reads the computer program or the computer instruction from the computer readable storage medium, and the processor executes the computer program or the computer instruction, so that the electronic device executes the component loading method according to any one of claims 1 to 11.