Method for loading applications in micro-frontend, and related apparatus

By setting virtual dependencies for child applications in the micro-frontend and using loaders for version isolation, the compatibility problem of parent and child applications using different versions of dependencies is solved, improving the compatibility and maintainability of micro-frontend applications.

WO2025247101A1PCT designated stage Publication Date: 2025-12-04HUAWEI TECH CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2025/096808
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2024-05-28
Filing Date
2025-05-23
Publication Date
2025-12-04

AI Technical Summary

Technical Problem

In micro-frontends, when parent and child applications use different versions of the same dependency, compatibility issues may arise, leading to conflicts and interference, which can affect project delivery efficiency and maintainability.

Method used

By setting virtual dependencies for child applications and using a loader for version isolation, compatibility is achieved by ensuring that the dependency versions of the parent and child applications can be loaded correctly.

Benefits of technology

This enables parent and child applications to run on the same page without conflict, improving the compatibility, maintainability, and performance of micro-frontend applications.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2025096808_04122025_PF_FP_ABST
    Figure CN2025096808_04122025_PF_FP_ABST
Patent Text Reader

Abstract

Disclosed in the present application are a method for loading applications in a micro-frontend, and a related apparatus. The method comprises: first receiving an application loading request in a micro-frontend, wherein applications include a parent application and a plurality of child applications corresponding to the parent application, the parent application comprising a plurality of first dependencies and the child applications each comprising a plurality of second dependencies; then, on the basis of the application loading request, loading the parent application and the plurality of first dependencies in the parent application, and loading the second dependencies in the plurality of child applications; and when second dependencies in a first child application among the plurality of child applications are loaded, if the second dependencies are identical to the first dependencies while versions of the second dependencies are different from versions of the first dependencies, a loader of the first child application configuring virtual dependencies for the second dependencies, and using the virtual dependencies to load the second dependencies. In this way, different versions of the same dependency can be isolated, so that parent applications have the capability to be compatible with child applications using different versions of the same dependency.
Need to check novelty before this filing date? Find Prior Art

Description

Loading method of application in micro front-end and related device

[0001] The present application claims priority to the Chinese patent application No. 202410681238.9, filed on May 28, 2024, and entitled "Loading method of application in micro front-end and related device", the whole content of which is incorporated herein by reference. TECHNICAL FIELD

[0002] The present application relates to the field of micro front-end, in particular to a loading method of application in micro front-end and related device. BACKGROUND

[0003] In the micro front-end, the application of the micro front-end includes a parent application and a child application. The parent application is a basic application, and the parent application is responsible for carrying and managing each child application. The child application is an application that can be embedded or accessed in the parent application. The child application is generally responsible for implementing a specific function or business module. The parent application and each child application can be independently developed, independently deployed, and independently run, which can improve the delivery efficiency of the front-end project.

[0004] The parent application and the child application can both load external resources at runtime. The loaded external resources are referred to as dependencies. The parent application and the child application use the same dependencies, which can be referred to as common dependencies. The same dependency can have different versions, and the versions can distinguish the ability of the product built at different times. In a front-end project with common dependencies, the parent application and the child application can use different versions of the same dependency, which can cause compatibility problems between the parent application and the child application. SUMMARY

[0005] The present application discloses a loading method of application in micro front-end and related device. In the case that the parent application and the child application use different versions of the same dependency, the parent application can be compatible with the child application. The parent application has the ability to support loading the child application using different versions of the same dependency.

[0006] In a first aspect, the application provides a loading method for an application in a micro-frontend, the method comprising: first, receiving an application loading request in the micro-frontend, the application comprising a parent application and a plurality of child applications corresponding to the parent application, the parent application comprising a plurality of first dependencies, and each child application comprising a plurality of second dependencies; then, loading the parent application and the plurality of first dependencies in the parent application according to the application loading request; and loading the second dependencies of the plurality of child applications; a first child application being any child application in the plurality of child applications, when loading the second dependencies of the first child application, if the second dependencies of the first child application are the same as the first dependencies and the versions of the second dependencies of the first child application are different from the versions of the first dependencies, setting a virtual dependency for the second dependencies of the first child application by a loader of the first child application, and loading the second dependencies of the first child application using the virtual dependency.

[0007] In the technical solution provided by the application, the virtual dependency is set to enable the running environment to distinguish that the versions of the second dependencies of the first child application and the versions of the first dependencies of the parent application belong to two different versions of the same dependency, so that when the second dependencies of the first child application are loaded, the virtual dependency set by the loader can correctly load the correct version of the dependency, realizing version isolation of the dependency, ensuring that the first dependencies of the parent application and the second dependencies of the first child application do not conflict when running simultaneously in the same page, and realizing compatibility of the parent application and the first child application.

[0008] In a possible implementation manner of the first aspect, the plurality of child applications further comprise a second child application, if the second dependencies of the second child application are the same as the first dependencies, the versions of the second dependencies of the second child application are different from the versions of the first dependencies, and the versions of the second dependencies of the second child application are also different from the versions of the second dependencies of the first child application, the loader of the second child application is different from the loader of the first child application.

[0009] Through the above implementation manner, different loaders can independently manage dependency versions, and such isolation enables two child applications using different versions of the same dependency to not conflict and interfere, and is also conducive to improving maintainability, performance, and flexibility of the micro-frontend application.

[0010] In a possible implementation manner of the first aspect, the method further comprises: obtaining first mapping information according to an application loader request, the first mapping information comprising a correspondence between a plurality of target child applications and at least one loader, the plurality of target child applications belonging to the plurality of child applications, and a target child application being a child application using different versions of the same dependency compared to the parent application; and loading the second dependencies of the plurality of child applications comprises: loading the second dependencies of the plurality of child applications based on the first mapping information, and the loader of the first child application being obtained from the first mapping information based on an identifier of the first child application.

[0011] By the above implementation manner, for the first sub-application using different versions of the same dependency compared to the parent application, the loader of the first sub-application can be quickly located based on the corresponding relationship between the target sub-application and the loader in the first mapping information, and the isolation of different versions of the same dependency can be implemented through the loader of the first sub-application, which is also conducive to improving the loading efficiency of the sub-application.

[0012] In a possible implementation manner of the first aspect, the first mapping information further includes: version information of a plurality of first dependencies used by the parent application; the identification of each sub-application in the plurality of sub-applications and the version information of a plurality of second dependencies used by each sub-application; and the version information of the second dependencies managed by each loader. Based on the dependency version information of the parent application and the dependency version information of each sub-application, it is convenient to compare and determine whether the first dependency of the parent application and the second dependency of the sub-application are the same and whether the versions of the dependencies are the same, and it is also convenient to obtain the resource of the corresponding dependency version for loading.

[0013] In a possible implementation manner of the first aspect, if the second dependency of the first sub-application is the same as the first dependency, and the version of the second dependency of the first sub-application is also the same as the version of the first dependency, the second dependency of the first sub-application is not loaded. Through this implementation manner, when loading the dependency of the sub-application, if it is detected that the same dependency of the same version has been loaded in the parent application, the loaded dependency can be directly reused, and repeated loading of resources is avoided.

[0014] In the second aspect, the present application provides a device for application loading in micro front-end. The device includes: an acquisition module configured to receive an application loading request in micro front-end, the application including a parent application and a plurality of sub-applications corresponding to the parent application, the parent application including a plurality of first dependencies, and each sub-application including a plurality of second dependencies; a processing module configured to load the parent application and the plurality of first dependencies in the parent application according to the application loading request; the processing module is further configured to load the second dependencies of the plurality of sub-applications; a first sub-application is any sub-application in the plurality of sub-applications; and the processing module is configured to, when loading the second dependency of the first sub-application, if the second dependency of the first sub-application is the same as the first dependency, and the version of the second dependency of the first sub-application is different from the version of the first dependency, set a virtual dependency for the second dependency of the first sub-application through the loader of the first sub-application, and load the second dependency of the first sub-application using the virtual dependency.

[0015] In a possible implementation manner of the second aspect, the plurality of sub-applications further include a second sub-application, if the second dependency of the second sub-application is the same as the first dependency, the version of the second dependency of the second sub-application is different from the version of the first dependency, and the version of the second dependency of the second sub-application is also different from the version of the second dependency of the first sub-application, the loader of the second sub-application is different from the loader of the first sub-application.

[0016] In a possible implementation manner of the second aspect, the obtaining module is further configured to obtain first mapping information according to the application loader request, the first mapping information comprising a correspondence between a plurality of target sub-applications and at least one loader, the plurality of target sub-applications belonging to the plurality of sub-applications, and the target sub-application being a sub-application using a different version of the same dependency compared with the parent application; and the processing module is specifically configured to load the second dependency of the plurality of sub-applications based on the first mapping information, the loader of the first sub-application being obtained by the processing module from the first mapping information based on the identifier of the first sub-application.

[0017] In a possible implementation manner of the second aspect, the first mapping information further comprises: version information of the plurality of first dependencies used by the parent application; an identifier of each sub-application in the plurality of sub-applications and version information of the plurality of second dependencies used by each sub-application; and version information of the second dependency managed by each loader.

[0018] In a possible implementation manner of the second aspect, if the second dependency of the first sub-application is the same as the first dependency, and the version of the second dependency of the first sub-application is also the same as the version of the first dependency, the processing module does not load the second dependency of the first sub-application.

[0019] In a third aspect, the present application provides a computing device, comprising a processor and a memory, the memory being configured to store program instructions; the processor is configured to invoke the program instructions in the memory, so that the computing device executes the method in the first aspect or any possible implementation manner of the first aspect. Exemplarily, the computing device can be a client.

[0020] In a fourth aspect, the present application provides a computing device cluster, comprising at least one computing device, each computing device in the at least one computing device comprising a processor and a memory, the processor of the at least one computing device being configured to execute the instructions stored in the memory of the at least one computing device, so that the computing device cluster executes the method in the first aspect or any possible implementation manner of the first aspect.

[0021] In a fifth aspect, the present application provides a computer readable storage medium, comprising computer instructions, when the computer instructions are executed by a processor, the method in the first aspect or any possible implementation manner of the first aspect is implemented.

[0022] In a sixth aspect, the present application provides a computer program product, when the computer program product is executed by a processor, the method in the first aspect or any possible implementation manner of the first aspect is implemented. Exemplarily, the computer program product can be a software installation package. BRIEF DESCRIPTION OF DRAWINGS

[0023] FIG. 1 is a schematic diagram of an architecture of a micro-frontend application loading system provided by the present application;

[0024] FIG. 2 is a flowchart of a mapping information generation method for micro-frontend application loading provided by the present application;

[0025] FIG. 3 is a flowchart of a micro-frontend application loading method provided by the present application;

[0026] FIG. 4 is a schematic diagram of an application scenario provided by the present application;

[0027] FIG. 5 is a schematic diagram of another application scenario provided by the present application;

[0028] FIG. 6 is a schematic diagram of a structure of a computing device provided by the present application;

[0029] FIG. 7 is a schematic diagram of a structure of a computing device provided by the present application;

[0030] FIG. 8 is a schematic diagram of a structure of a computing device cluster provided by the present application;

[0031] FIG. 9 is a schematic diagram of a computing device connected through a network provided by the present application. DETAILED DESCRIPTION

[0032] The terms used in the present application are merely for the purpose of describing specific embodiments and are not intended to limit the present application. The terms "first", "second", and the like in the specification and claims of the present application are used to distinguish different objects and are not intended to describe a particular order. In addition, the description in the present application, such as "at least one of a1, a2, … and an (or at least one)", includes any one of a1, a2, … and an alone, and any combination of any number of a1, a2, … and an. Each case can exist alone. For example, the description of "at least one of a, b, and c" includes the cases of a alone, b alone, c alone, a and b in combination, a and c in combination, b and c in combination, or a, b, and c in combination.

[0033] In micro-frontend engineering, dependency refers to external resources that a project or application depends on, which includes but is not limited to code library, third-party module, library file, build tool, framework, style sheet, font, or other types of resources, such as data file, configuration file, etc.

[0034] The code library is, for example, a general tool function, a data structure, an algorithm implementation, etc.; the third-party module is a software package developed and maintained by a third-party (i.e., an independent entity or group from the application developer and the application end user) developer or organization; the library file is a file containing executable code, which is usually used to introduce specific functions or resources in programming, and the library file is, for example, in the form of a compiled binary file, a dynamic link library, a static library, etc.; the build tool includes, for example, Webpack, Parcel, Rollup, etc., as well as plugins and configuration files related thereto; the framework is a basic structure for supporting and developing software applications, which provides a set of predefined tools, libraries and specifications for simplifying and accelerating the development process of the application; the style sheet refers to a cascading style sheet (CSS) file or a preprocessor file in the project for defining styles and layouts, and the CSS file indicates how to display elements in a web page.

[0035] For any dependency, there is at least one version of the dependency during the development process of the dependency. Among them, the first version is the original version, and the subsequent versions can be improved versions based on the first version of the dependency or the previous version of the dependency. For example, dependency a has three versions, the first version is the original version, denoted as version V1; the second version is an improved version, denoted as version V2; the third is an improved version, denoted as version V3. Here, version V2 and version V3 can be improved versions based on version V1, but version V2 is different from version V3. Alternatively, version V2 is an improved version based on version V1, and version V3 is an improved version based on version V2. Here, the number of versions of dependency a and the relationship between versions are only an example, and in actual application, the number of versions of dependency a can be more or less, and the relationship between versions can be simpler or more complex.

[0036] In this application, in order to distinguish different versions of the same dependency, when describing the dependency, a lowercase letter is used to represent the dependency, and an Arabic numeral is used to distinguish the version. For example, for dependency a, the first version of the above dependency a is denoted as a1, the second version of the dependency a is denoted as a2, and the third version of the dependency a is denoted as a3. Exemplarily, the larger the Arabic numeral used to represent the version, the newer the corresponding version, that is, the version of dependency a in a2 is newer than the version of dependency a in a1, and the version of dependency a in a3 is newer than the version of dependency a in a2.

[0037] The application of micro front-end includes a parent application and multiple child applications. Assuming that the dependency version information of the parent application includes a2, b2 and c2, that is, the parent application uses three dependencies, a, b and c, wherein the version of dependency a is V2, the version of dependency b is V2, and the version of dependency c is V2, when the child application meets the following conditions, the child application uses different versions of the same dependency compared with the parent application:

[0038] Condition 1: The dependency version information of the child application includes a1;

[0039] Condition 2: The dependency version information of the child application includes a1 and b1;

[0040] Condition 3: The dependency version information of the child application includes a1, b1 and c1;

[0041] Condition 4: The dependency version information of the child application includes a3 and b3.

[0042] The above conditions 1-4 are only an example of the child application using different versions of the same dependency compared with the parent application, and should not limit the dependency version of the child application. As can be seen from the above conditions 1-4, there can be one or more common dependencies between the child application and the parent application.

[0043] In the above conditions 1-4, the child application and the parent application have common dependencies, and the version of the common dependency used by the child application is different from the version of the common dependency used by the parent application, resulting in version conflict, and the parent application and the child application are incompatible. To solve this problem, the present application provides a micro front-end application loading method, so that the parent application has the ability to support loading the child application using different versions of the same dependency, and in the case where the parent application and the child application use different versions of the same dependency, the compatibility of the parent application and the child application can be realized.

[0044] The technical solutions in the present application will be described below with reference to the accompanying drawings.

[0045] Referring to FIG. 1, FIG. 1 is an architecture schematic diagram of a micro front-end application loading system provided by the present application. As shown in FIG. 1, the system includes a client 100 and a configuration system 120, wherein the client 100 and the configuration system 120 are connected through a network. The client 100 that establishes a communication connection with the configuration system 120 can be one or more.

[0046] The micro front-end application is deployed on the client 100, and the micro front-end application includes a parent application and multiple child applications corresponding to the parent application. The parent application is usually responsible for the layout and navigation structure of the entire page, usually including top navigation, sidebar, bottom navigation, etc., and management of the child application. The child application is used to implement specific business functions.

[0047] The parent application includes a plurality of dependencies, and each child application includes a plurality of dependencies. The dependencies of the child application and the dependencies of the parent application can be the same or different. When the dependencies of the child application and the dependencies of the parent application are the same, the versions of the dependencies of the child application and the versions of the dependencies of the parent application can be the same or different. At least one loader is also deployed on the client 100. The at least one loader can correspond to a plurality of child applications, and each child application corresponds to a loader. The loader of the child application is used to isolate the versions of the dependencies of the child application and the versions of the dependencies of the parent application by setting a virtual dependency when the dependencies of the child application and the dependencies of the parent application are the same, and the versions of the dependencies of the child application and the versions of the dependencies of the parent application are different, so that the parent application and the child application can be compatible.

[0048] The client 100 is used to implement human-computer interaction, and the client 100 is deployed on a hardware device such as a terminal device or a computing device used by a user.

[0049] The terminal device includes, for example, a personal computer, a smart phone, a wearable device, a palm-held processing device, a tablet computer, a mobile notebook, an augmented reality (AR) device, a virtual reality (VR) device, an integrated game console, a wearable device, a vehicle-mounted device, a smart conference device, a smart advertising device, a smart home appliance, and the like. The smart home appliance can be a sweeping robot, a mopping robot, and the like, and is not specifically limited herein.

[0050] The computing device includes a bare metal server (BMS), a virtual machine, a container, or an edge computing device. The BMS refers to a general-purpose physical server, for example, an ARM server or an X86 server. The virtual machine refers to a complete computer system that is simulated by software, runs in a completely isolated environment, and has complete hardware system functions. The work that can be completed in an entity computer can be realized in the virtual machine. When a virtual machine is created in a computing device, part of the hard disk and memory capacity of the entity machine needs to be used as the hard disk and memory capacity of the virtual machine. Each virtual machine has an independent basic input / output system (BIOS), a hard disk, and an operating system, and can be operated like an entity machine. The container is a kind of virtualization software that can combine an application and all its dependencies into a software package that is not limited by the underlying host operating system. In this way, the complex environment does not need to be built again, and the process of application development to deployment is simplified. The edge computing device refers to a device that is closer to a data source and an end user, has low latency, and has high bandwidth characteristics, such as an edge server.

[0051] In a specific implementation, the client 100 can be in the form of software, an application, a plug-in, or the like, implemented on a terminal device or a computing device, such as a client of a personal computer (PC), a browser-based client, or a console of a cloud platform.

[0052] The configuration system 120 is responsible for the development and configuration of the micro front-end, and includes a configuration server of a parent application in the micro front-end, servers of various child applications in the micro front-end, and a resource server providing dependent resources.

[0053] FIG. 1 is an example of a micro front-end application loading system, but the architecture of the micro front-end application loading system is not limited to that shown in FIG. 1.

[0054] The micro front-end application loading method provided by the present application will be described below in conjunction with the accompanying drawings.

[0055] In order to enable the parent application to load child applications using different versions of common dependencies, the client needs to rely on mapping information recording the correspondence between the loader and the child applications in the micro front-end to execute the micro front-end application loading method.

[0056] The manner of obtaining the mapping information will be described below in conjunction with FIG. 2.

[0057] Referring to FIG. 2, FIG. 2 is a flowchart of a mapping information generation method for micro front-end application loading provided by the present application. The method can be applied to the configuration system 120 in FIG. 1, and specifically to the configuration server of the parent application. The method described in the embodiment of FIG. 2 includes but is not limited to the following steps S201-S202.

[0058] S201: Obtain dependent version information of the micro front-end application.

[0059] The micro front-end application includes a parent application and a plurality of child applications corresponding to the parent application, and the dependent version information of the micro front-end application includes dependent version information of the parent application and dependent version information of each of the plurality of child applications. The dependent version information of the parent application is obtained from the local by the configuration server, and the dependent version information of the child application is obtained through the publication of the server of the child application.

[0060] The dependency version information of the parent application comprises an identifier of the parent application, an identifier of a dependency of the parent application, and version information of the dependency of the parent application. The dependency version information of the child application comprises an identifier of the child application, an identifier of a dependency of the child application, and version information of the dependency of the child application.

[0061] The identifier herein can be a combination of one or more characters, wherein the characters can be one or more of numbers, letters, and other symbols, for example, a combination of one or more numbers, or a combination of one or more numbers and letters.

[0062] S202: generating first mapping information according to the dependency version information of the micro-frontend application.

[0063] In an implementation manner, the first mapping information is generated according to the dependency version information of the micro-frontend application, comprising: determining target child applications in the plurality of child applications and a version comparison result of each target child application according to the dependency version information of the parent application and the dependency version information of each of the plurality of child applications, wherein the version comparison result of the target child application records different versions of the same dependency used by the target child application compared with the parent application; constructing at least one loader based on the version comparison result of each target child application; and recording a correspondence between an identifier of the target child application and an identifier of the loader to generate the first mapping information.

[0064] The first mapping information comprises identifiers of the plurality of target child applications and identifiers of the loaders corresponding to each target child application. The plurality of target child applications belong to the plurality of child applications. The plurality of target child applications correspond to at least one loader, and each target child application corresponds to one loader. The loader of the target child application can manage different versions of the same dependency used by the target child application compared with the parent application.

[0065] The loader is a program or a module in the micro-frontend. The function of the loader is to obtain a dependency resource required by a child application from a remote or local at runtime, isolate the child application from different versions of the same dependency used by the parent application, so that the dependency of the child application can be successfully rendered into a page of the parent application, and compatibility between the parent application and the child application is achieved.

[0066] The target child application is a child application that uses different versions of the same dependency compared with the parent application.

[0067] For example, the dependency version information of the parent application includes a2, b2 and c2, if the dependency version information of the child application 1 is a1, the child application 1 and the parent application both use the same dependency a, but the versions of the dependency a used by the two are different, the version of the dependency a of the parent application is V2 and the version of the dependency a of the child application 1 is V1, the child application 1 uses different versions of the same dependency compared with the parent application, and therefore the child application 1 is the target child application; if the dependency version information of the child application 1 is a2, b2 and c2, in this case, the common dependencies between the child application 1 and the parent application are a, b and c, for any common dependency, the versions of the common dependency used by the two are the same, the child application 1 does not use different versions of the same dependency compared with the parent application, and therefore the child application 1 is not the target child application.

[0068] The construction process of the loader is described below by taking an example.

[0069] Suppose the dependency version information of the parent application and the dependency version information of a plurality of child applications are as follows:

[0070] The dependency version information of the parent application includes a2, b2 and c2;

[0071] The dependency version information of the child application 1 is a1;

[0072] The dependency version information of the child application 2 includes b3 and c2;

[0073] The dependency version information of the child application 3 includes a2, b3 and c3;

[0074] The dependency version information of the child application 4 includes b3 and c3;

[0075] The dependency version information of the child application 5 includes a2, b2 and c2.

[0076] Since the target sub-applications are sub-applications using different versions of the same dependency compared to the parent application, the target sub-applications in the above method are determined to include sub-application 1, sub-application 2, sub-application 3, and sub-application 4, where the version comparison result of sub-application 1 is {a1}, the version comparison result of sub-application 2 is {b3}, the version comparison result of sub-application 3 is {b3, c3}, and the version comparison result of sub-application 4 is {b3, c3}. Then, based on the version comparison result of each target sub-application, a loader is constructed. Specifically, based on the version comparison result of sub-application 1, loader A01 is constructed, which is used to manage a1. Based on the version comparison result of sub-application 2, loader A02 is constructed, which is used to manage b3. Since the version comparison result of sub-application 3 and the version comparison result of sub-application 4 are the same, sub-application 3 and sub-application 4 share loader A03, which is used to manage b3 and c3. Finally, the correspondence between the identifier of the target sub-application and the identifier of the loader is recorded to generate first mapping information, which can be represented as shown in Table 1 below.

[0077] Table 1 is an example of first mapping information. As can be seen from Table 1, sub-application 1 corresponds to loader A01, sub-application 2 corresponds to loader A03, and sub-application 3 and sub-application 4 both correspond to loader A03. In addition, the first mapping information shown in Table 1 not only includes the identifier of the target sub-application and the identifier of the loader corresponding to the target sub-application, but also includes the management information of the loader. Taking loader A01 as an example, as can be seen from Table 1, the dependency version managed by loader A01 is a1.

[0078] Table 1

[0079] Table 1 is only an example of first mapping information and should not limit the number of target sub-applications, the number of loaders, the correspondence between target sub-applications and loaders, and other contents in the first mapping information. In some possible embodiments, the correspondence between the identifier of the target sub-application and the identifier of the loader in Table 1, and the correspondence between the identifier of the loader and the management information of the loader can also be recorded separately by two tables.

[0080] In some possible embodiments, the version comparison result of sub-application 2 {b3} is a subset of the version comparison result of sub-application 3 {b3, c3}. Therefore, for the above plurality of target sub-applications, only two loaders can be established, which are the above loader A01 and loader A03, where sub-application 1 corresponds to loader A01, and sub-application 2, sub-application 3, and sub-application 4 all correspond to loader A03.

[0081] It can be known from the construction manner of the above loader that one loader can manage at least one dependency, and for each dependency managed by the loader, the loader can manage one version of the same dependency instead of multiple versions of the same dependency.

[0082] In an implementation manner, the plurality of sub-applications include a first sub-application and a second sub-application, the target dependency is a common dependency between the first sub-application, the second sub-application and the parent application, the version of the target dependency of the first sub-application is different from the version of the target dependency of the parent application, the version of the target dependency of the second sub-application is also different from the version of the target dependency of the parent application, and the version of the target dependency of the first sub-application is also different from the version of the target dependency of the second sub-application, and the loader of the first sub-application is different from the loader of the second sub-application.

[0083] In some possible embodiments, the first mapping information further includes one or more of the following information: version information of a dependency used by the parent application; identification of each sub-application in the plurality of sub-applications and version information of a dependency used by each sub-application; and version information of a dependency managed by each loader.

[0084] The configuration server stores the first mapping information locally after generating the first mapping information. For example, the first mapping information can be obtained by the client from the configuration server when the client receives an application loading request in the micro front-end, and the first mapping information can be pre-deployed in the client together with program code of the parent application and program code of the loader, which is not limited herein.

[0085] In the embodiment of FIG. 2, the first mapping information is generated based on the dependency version of the parent application and the dependency version of the sub-application embedded in the parent application, and the first mapping information records the constructed loader and the corresponding sub-application of the loader, and the loader is used to manage different versions of the common dependency of the sub-application compared with the parent application. In this way, different versions of the same dependency between the parent application and the sub-application can be isolated, and repeated loading of resources can also be avoided.

[0086] Referring to FIG. 3, FIG. 3 is a flowchart of a micro front-end application loading method provided by the present application. The method is applied to a client, for example, the client 100 in FIG. 1, and the client is deployed with an application of a micro front-end and at least one loader used to assist loading of the micro front-end application. The method described in the embodiment of FIG. 3 includes but is not limited to the following steps S301-S303.

[0087] S301: receiving an application loading request in a micro front-end.

[0088] The micro front-end application includes a parent application and a plurality of child applications corresponding to the parent application, the parent application includes a plurality of first dependencies, and the child applications include a plurality of second dependencies. The application loader request includes an identifier of the parent application and identifiers of each of the plurality of child applications.

[0089] For example, the application loading request is generated dynamically by the client detecting the interaction of the user.

[0090] S302: loading the parent application and the plurality of first dependencies in the parent application according to the application loading request.

[0091] In response to the application loading request, the dependency version information of the parent application is obtained locally, the plurality of first dependencies to be used by the parent application are obtained from the dependency library based on the dependency version information of the parent application, and the program of the parent application and the plurality of first dependencies in the parent application are loaded locally. The dependency version information of the parent application can be pre-stored locally or obtained remotely from the configuration server, which is not limited here.

[0092] In an implementation manner, the first mapping information can also be obtained directly from the configuration server in response to the application loading request. The first mapping information includes the correspondence between the plurality of target child applications and the at least one loader, and the first mapping information can further include the version information of the plurality of first dependencies used by the parent application, the identifier of each of the plurality of child applications and the version information of the plurality of second dependencies used by each of the child applications, and the version information of the second dependencies managed by each of the loaders. The target child application is described above and will not be repeated here.

[0093] Further, after the main application is loaded, the loader in the micro front-end can be triggered to perform an initialization operation by the main application, so that each loader obtains the version information of the second dependency managed by itself, and the related information of the parent application, such as the parent application state management information, the parent application registry, and the parent application service instance, can also be injected into the loader.

[0094] The parent application state management information can include global state information (such as user login state, subject setting, language preference, etc.), general state management logic (such as data request, error handling, state update, etc.), and the like. Injecting the parent application state management information into the loader can enable the child applications loaded by the loader to access these global states, achieve state sharing and synchronization, and also share the general state management logic, thereby reducing the cost of repeated development and maintenance.

[0095] The parent application registry can include the parent application's identifier, parent application's dependency version information, child application's identifier, child application's dependency version information, child application's loading entry point, and child application's lifecycle hooks (which are the handling functions related to the child application's startup, running, and stopping lifecycle events, affecting the child application's loading, initialization, rendering, and unloading). Injecting the parent application registry into the loader facilitates the loader's dynamic loading and management of child applications, helping to ensure that child applications are correctly initialized and run.

[0096] A parent application service instance refers to an instance within a parent application used to provide shared services or functionalities. These services may include, for example, user authentication, access control, data caching, and network requests. Injecting parent application service instances into the loader allows the loader to reuse the parent application's service logic, reducing code duplication and resource waste.

[0097] S303: Load the second dependency of multiple sub-applications. When loading the second dependency of the first sub-application among multiple sub-applications, if the second dependency of the first sub-application is the same as the first dependency, and the version of the second dependency of the first sub-application is different from the version of the first dependency, the second dependency of the first sub-application is loaded through the loader of the first sub-application.

[0098] Here, the first sub-application is any one of the aforementioned multiple sub-applications, including the first sub-application.

[0099] The process of loading the second dependency of the first sub-application through the loader of the first sub-application includes: setting a virtual dependency for the second dependency of the first sub-application through the loader of the first sub-application, and loading the second dependency of the first sub-application using the virtual dependency.

[0100] This virtual dependency is mapped to the version path or module name of the second dependency of the actual first child application. For example, the virtual dependency is named differently from the first dependency of the parent application.

[0101] By setting virtual dependencies, the runtime environment can distinguish between the version of the second dependency of the first sub-application and the version of the first dependency of the parent application, which belong to the same dependency but are two different versions. In this way, when loading the second dependency of the first sub-application, the correct version of the dependency can be loaded based on the virtual dependency set by the loader, thus achieving dependency version isolation. This ensures that the first dependency of the parent application and the second dependency of the first sub-application will not conflict when running on the same page at the same time, thus achieving compatibility between the parent application and the first sub-application.

[0102] The version of the second dependency of the first sub-application is different from the version of the first dependency of the parent application, which can be that the version of the second dependency of the first sub-application is lower than the version of the first dependency of the parent application, meaning that the parent application is upgraded first than the first sub-application; or the version of the second dependency of the first sub-application is higher than the version of the first dependency of the parent application, meaning that the first sub-application is upgraded first than the parent application.

[0103] For example, loading the second dependency of the above-mentioned multiple sub-applications includes loading the second dependency of the above-mentioned multiple sub-applications based on the first mapping information, and the loader of the first sub-application is obtained from the first mapping information based on the identifier of the first sub-application.

[0104] For example, the loading process of the second dependency of the first sub-application is as follows: based on the first mapping information, the version of the second dependency of the first sub-application and the version of the first dependency can be known, and it is determined that the version of the second dependency of the first sub-application is different from the version of the first dependency by comparison. The loader of the first sub-application is determined according to the corresponding relationship between the target sub-application and the loader in the first mapping information, the multiple target sub-applications include the first sub-application, and the version of the second dependency of the first sub-application belongs to the version of the second dependency managed by the loader of the first sub-application. Therefore, the second dependency of the first sub-application is loaded by the loader of the first sub-application.

[0105] For example, the first mapping information is shown in Table 1, the first sub-application is sub-application 1, and when loading a dependency of sub-application 1, if it is determined that the version of the dependency is different from the version of the dependency of the parent application, the mapping relationship of "the identifier of the target sub-application is 1-the identifier of the loader is A01-the management information of the loader is a1" is found from Table 1 based on the identifier of sub-application 1. Based on the mapping relationship, it is determined that the loader of sub-application 1 is loader A01.

[0106] In an implementation manner, the multiple sub-applications further include a second sub-application. If the second dependency of the second sub-application is the same as the first dependency of the parent application, the version of the second dependency of the second sub-application is different from the version of the first dependency of the parent application, and the version of the second dependency of the second sub-application is also different from the version of the second dependency of the first sub-application, the loader of the second sub-application is different from the loader of the first sub-application. In this way, different loaders can independently manage the versions of the dependencies, and such isolation makes two sub-applications using different versions of the same dependency not conflict and interfere with each other, and is also conducive to improving the maintainability, performance and flexibility of the micro-frontend application.

[0107] In some possible embodiments, if the version of the second dependency of the first sub-application is the same as the first dependency of the parent application, and the version of the second dependency of the first sub-application is also the same as the version of the first dependency of the parent application, and the dependency of the parent application is loaded first, when it is detected that the first dependency of the parent application has been loaded, the second dependency of the first sub-application is not loaded. In this way, repeated loading of resources is avoided, dependencies can be shared and reused, and the loading efficiency of resources is improved.

[0108] Exemplarily, the second dependencies managed by each loader can be stored in a common resource pool, and when a dependency version required by loading a sub-application is needed, a resource of the corresponding dependency version can be obtained from the common resource pool. By implementing this manner, resources are uniformly managed, repeated storage of resources is avoided, and storage space is saved.

[0109] The following describes the application of the embodiment of FIG. 3 in a specific scenario. Referring to FIG. 4, FIG. 4 is a schematic diagram of an application scenario provided in the present application. The scenario shown in FIG. 4 is a scenario of upgrading a micro-frontend architecture. The micro-frontend application shown in FIG. 4 includes a parent application and two sub-applications corresponding to the parent application, namely, a legacy sub-application X and a new-version sub-application Y. The dependency versions used by the parent application include a high-version dependency a, a high-version dependency b, and a high-version dependency c. The dependency versions used by the sub-application X include a low-version dependency a, a low-version dependency b, and a low-version dependency c. The dependency versions used by the sub-application Y include a high-version dependency a, a high-version dependency b, and a high-version dependency c. As can be seen, the versions of the dependencies of the parent application are higher than the versions of the dependencies of the sub-application X. The parent application is upgraded first, and therefore the sub-application X is referred to as a legacy sub-application. In this case, the sub-application X does not need to be modified, and the sub-application X is loaded by using a loader 1. The loader 1 is configured to manage different versions of the same dependency used by the sub-application X compared with the parent application. When loading the dependencies of the sub-application X, the loader 1 can set virtual dependencies for the low-version dependency a, the low-version dependency b, and the low-version dependency c respectively, to achieve compatibility between the parent application and the legacy sub-application X. For the sub-application Y, the dependencies of the sub-application Y are the same as the dependencies of the parent application, and the versions of the dependencies of the sub-application Y are consistent with the versions of the dependencies of the parent application. Therefore, the sub-application Y is referred to as a new-version sub-application, and the sub-application Y is directly compatible with the parent application.

[0110] In the scenario shown in FIG. 4, in the micro-frontend, the legacy sub-application does not need to be modified, and compatibility between the legacy sub-application and the parent application can be achieved by using a loader, and coexistence of the legacy sub-application and the new-version sub-application in the same page is supported. In the process of implementing smooth evolution of the micro-frontend architecture, compared with the manner of achieving compatibility by forcing each sub-application to use the same version of the common dependency as the parent application, the present application can reduce the modification cost of the sub-application.

[0111] FIG. 4 is a scenario in which the version of the dependency of the parent application is higher than the version of the dependency of the child application, and the present application is also applicable to a scenario in which the version of the dependency of the parent application is lower than the version of the dependency of the child application. The method shown in FIG. 3 is implemented, and in the case where the parent application and the child application use different versions of the same dependency, the parent application sets a virtual dependency for the dependency of different versions through the loader of the child application to implement the loading of the dependency of the child application, so that the parent application has the ability to support the loading of the child application using different versions of the same dependency.

[0112] In the micro-frontend architecture, different child applications can be developed by different development teams, and it is possible that the development team of a certain child application (for example, a first child application) wants to upgrade the version of a certain dependency used by itself, in which case, the configuration server can perform the following method to update the first mapping information to modify the correspondence between the child application and the loader, so that the decoupling between the child applications is realized, and asynchronous upgrading is realized.

[0113] Taking the version upgrade of the dependency of the first child application as an example, the updating process of the first mapping information is described as follows:

[0114] The server of the first child application sends upgrade indication information to the configuration server, the upgrade indication information includes the identifier of the dependency of the first child application whose version is upgraded and the version information of the dependency after the upgrade, and the configuration server updates the first mapping information according to the upgrade indication information to obtain second mapping information, wherein, compared with the first mapping information, the second mapping information has at least one of the following changes:

[0115] The correspondence between the identifier of the target child application and the identifier of the loader;

[0116] The number of loaders; and

[0117] The number of target child applications.

[0118] In an implementation, assuming that the loader of the first sub-application in the first mapping information is the first loader, the first mapping information is updated according to the upgrade indication information, and the second mapping information is obtained, including: determining a latest version comparison result of the first sub-application according to the upgrade indication information, the latest version comparison result including different versions of the same dependency used by the upgraded first sub-application compared with the parent application; if the dependency version in the latest version comparison result does not belong to the dependency version managed by the first loader, and there is a second loader in the first mapping information, and the dependency version managed by the second loader includes the dependency version in the latest version comparison result, then the correspondence between the first sub-application and the first loader in the first mapping information is modified to the correspondence between the first sub-application and the second loader, to obtain the second mapping information. That is, when the dependency version of a certain sub-application is upgraded, the correspondence between the sub-application and the loader can be modified, and the existing loader can be directly reused, without the need to force the version of the dependency used by the sub-application to be consistent with the version of the dependency used by the parent application, thereby reducing the modification cost required for compatibility and achieving asynchronous upgrade.

[0119] For example, the first sub-application is the sub-application 2, the dependency version of the sub-application 2 includes b3 and c2, the dependency version of the parent application includes a2, b2 and c2, and the first mapping information is shown in Table 1. Based on the identifier of the sub-application 2, the table 1 is searched to determine that the sub-application 2 corresponds to the loader A02. When the dependency c used by the sub-application 2 is upgraded from version V2 to version V3, the dependency version of the upgraded sub-application 2 includes b3 and c3, and the latest version comparison result of the sub-application 2 includes b3 and c3. As shown in Table 1, the dependency version (for example, c3) in the latest version comparison result of the sub-application 2 does not belong to the dependency version managed by the loader A02, but the loader A03 includes the dependency version in the latest version comparison result of the sub-application 2. Therefore, the loader corresponding to the sub-application 2 in Table 1 is modified from the loader A02 to the loader A03. In the updated Table 1, the sub-application 2 corresponds to the loader A03, and the loader A02 has no corresponding sub-application. The loader A02 in Table 1 can be retained or deleted.

[0120] In some possible embodiments, the dependency version in the latest version comparison result described above can not belong to the dependency version managed by the first loader, and there can also be no second loader in the first mapping information. In this case, the second loader can be constructed based on the latest version comparison result, the correspondence between the identifier of the first sub-application and the identifier of the first loader in the first mapping information is deleted, and the correspondence between the identifier of the first sub-application and the identifier of the second loader is added to the first mapping information, to obtain the second mapping information. Here, the second loader can be established independently of the existing loader, or can be obtained by modifying an existing loader, which is not limited here.

[0121] In some possible embodiments, it is also possible that the upgraded first sub-application does not use the same version of the dependency as compared with the parent application, i.e., the first sub-application does not belong to the target sub-application, in which case, updating the first mapping information means: deleting the mapping relationship in the first mapping information that contains the identifier of the first sub-application, or deleting the identifier of the first sub-application in the mapping relationship recorded in the first mapping information. This implementation shows that the first sub-application has a corresponding loader before the upgrade, and the first sub-application does not have a corresponding loader after the upgrade.

[0122] The above embodiments mainly introduce the updating of the first mapping information when the version of a certain dependency of the first sub-application is upgraded, and it can be understood that when the version of a certain dependency of the parent application is updated or the version of a dependency of another sub-application is upgraded, the first mapping information can be updated by referring to the foregoing method to obtain second mapping information. The second mapping information stored locally by the configuration server is the current latest mapping information.

[0123] For the client, whenever an application loader request in the micro front-end is received, the client can obtain the current latest mapping information from the configuration server to perform the micro front-end application loading method described in the foregoing embodiment of FIG. 3, which will not be described herein again.

[0124] Referring to FIG. 5, FIG. 5 is a schematic diagram of another application scenario provided by the present application. In FIG. 5, the plurality of sub-applications corresponding to the parent application include a sub-application A and a sub-application B, the sub-application A is developed by an A team, and the sub-application B is developed by a B team. In the development stage, the sub-application A uses a different version of the same dependency as compared with the parent application, for example, the sub-application A uses a low-version dependency, and the sub-application B uses a different version of the same dependency as compared with the parent application, for example, the sub-application B uses a middle-version dependency. In the running stage, the low-version dependency of the sub-application A is loaded by a loader 1 to implement the compatibility of the sub-application A with the parent application, and the middle-version dependency of the sub-application B is loaded by a loader 2 to implement the compatibility of the sub-application B with the parent application. When the A team performs the upgrade on the sub-application A, the upgraded sub-application A uses a different version of the same dependency as compared with the parent application, for example, the upgraded sub-application A uses the middle-version dependency, and the loader corresponding to the sub-application A is modified to the loader 2, and in the running stage, for the sub-application A, the middle-version dependency of the sub-application A is loaded by the loader 2 to implement the compatibility of the sub-application A with the parent application. It can be seen that when a development team upgrades the version of the dependency of a sub-application, the configuration server only needs to update the correspondence between the sub-application and the loader without synchronously upgrading with other teams. When the sub-application is accessed, the corresponding loader can be used to load the sub-application, so as to implement the mutual decoupling between the sub-application and the parent application and between the sub-applications, and the asynchronous upgrade scenario between the sub-application and the parent application and between the sub-applications.

[0125] Referring to FIG. 6, FIG. 6 is a structural schematic diagram of a computing device for micro front end provided by the present application. The computing device 200 shown in FIG. 6 is used to implement the method described in the foregoing FIG. 3, or is used to implement the method described in FIG. 2. The computing device 200 includes an obtaining module 201 and a processing module 202.

[0126] In an implementation manner, the obtaining module 201 is configured to receive an application loading request in a micro front end, the application including a parent application and a plurality of child applications corresponding to the parent application, the parent application including a plurality of first dependencies, the child applications including a plurality of second dependencies, and the plurality of child applications including a first child application; and the processing module 202 is configured to: load the parent application and the plurality of first dependencies in the parent application according to the application loading request, and load the second dependencies of the plurality of child applications; and when loading the second dependency of the first child application, if the second dependency of the first child application is the same as the first dependency, and the version of the second dependency of the first child application is different from the version of the first dependency, set a virtual dependency for the second dependency of the first child application by a loader of the first child application, and load the second dependency of the first child application by using the virtual dependency. In this case, the computing device 200 can be the client 100 in the foregoing FIG. 1.

[0127] In another implementation manner, the obtaining module 201 is configured to obtain dependency version information of a micro front end application; and the processing module 202 is configured to generate the first mapping information according to the dependency version information of the micro front end application.

[0128] The computing device 200 can be implemented by software, or can be implemented by hardware. In the computing device 200, the obtaining module 201 and the processing module 202 can be implemented by software, or can be implemented by hardware. For example, the implementation manner of the processing module 202 is introduced as follows. Similarly, the implementation manner of the obtaining module 201 can refer to the implementation manner of the processing module 202.

[0129] As an example of a software functional unit, the processing module 202 can include code running on a compute instance. The compute instance can include at least one of a physical host (computing device), a virtual machine, a container. Further, the compute instance can be one or more. For example, the processing module 202 can include code running on multiple hosts / virtual machines / containers. It should be noted that the multiple hosts / virtual machines / containers for running the code can be distributed in the same region, or in different regions. Further, the multiple hosts / virtual machines / containers for running the code can be distributed in the same availability zone (AZ), or in different AZs, each AZ including one data center or multiple data centers in close geographical proximity. Typically, a region can include multiple AZs.

[0130] Similarly, the multiple hosts / virtual machines / containers for running the code can be distributed in the same virtual private cloud (VPC), or in multiple VPCs. Typically, a VPC is set up within a region, and communication between two VPCs in the same region, or between VPCs in different regions, requires a communication gateway in each VPC to enable interconnection between VPCs.

[0131] As an example of a hardware functional unit, the processing module 202 can include at least one computing device, such as a server or the like. Alternatively, the processing module 202 can also be a device implemented by a central processing unit (CPU), an application-specific integrated circuit (ASIC), or a programmable logic device (PLD), or the like. The PLD can be a complex programmable logical device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL), a data processing unit (DPU), a neural network processing unit (NPU), a system on chip (SoC), an offload card, an acceleration card, or any combination thereof.

[0132] The plurality of computing devices included in the processing module 202 can be distributed in the same region or in different regions. The plurality of computing devices included in the processing module 202 can be distributed in the same AZ or in different AZs. Similarly, the plurality of computing devices included in the processing module 202 can be distributed in the same VPC or in multiple VPCs. The plurality of computing devices can be any combination of servers, ASICs, PLDs, CPLDs, FPGAs, GALs, DPUs, NPUs, SoCs, offload cards, acceleration cards, and the like.

[0133] It should be noted that in other embodiments, in FIG. 6, the acquisition module 201 can be configured to perform any of the steps of the method described in the embodiment of FIG. 3 or the method described in the embodiment of FIG. 2, and the processing module 202 can be configured to perform any of the steps of the method described in the embodiment of FIG. 3 or the method described in the embodiment of FIG. 2. The steps to be implemented by the acquisition module 201 and the processing module 202 can be specified as needed, and the entire function of the computing device 200 can be implemented by the acquisition module 201 and the processing module 202 respectively implementing different steps of the method described in the embodiment of FIG. 3 or the method described in the embodiment of FIG. 2.

[0134] The application further provides a chip system, which comprises a processor and a power supply circuit, the power supply circuit is used for performing power supply for the processor, and the processor is used for performing operation steps corresponding to the method described in the embodiment of FIG. 3 or the method described in the embodiment of FIG. 2. For brevity, details are not described herein. The processor can be implemented by a GPU, or can be implemented by a DPU, an NPU, an XPU, a SoC, an offload card, an acceleration card or the like.

[0135] Referring to FIG. 7, FIG. 7 is a structural schematic diagram of a computing device provided by the application. The computing device 800 comprises a bus 802, a processor 804, a memory 806 and a communication interface 808. The processor 804, the memory 806 and the communication interface 808 communicate through the bus 802. The computing device 800 can be a server or a terminal device. For example, when the computing device 800 performs the method described in the foregoing embodiment of FIG. 3, the computing device 800 can be the client 100 in the foregoing FIG. 1. It should be understood that the number of processors and memories in the computing device 800 is not limited by the application.

[0136] The bus 802 can be a peripheral component interconnect Express (PCIe) bus or an extended industry standard architecture (EISA) bus, a unified bus (Ubus or UB), a compute express link (CXL), a cache coherent interconnect for accelerators (CCIX) or the like. The unified bus is also referred to as a versatile bus. The bus can be divided into an address bus, a data bus, a control bus and the like. For the convenience of representation, only one line is used in FIG. 8, but it does not mean that there is only one bus or only one type of bus. The bus 802 can comprise a channel for transmitting information between various components (for example, the memory 806, the processor 804 and the communication interface 808) of the computing device 800. The unified bus can also be referred to as a versatile bus.

[0137] The processor 804 can include any one or more of a central processing unit (CPU), a graphics processing unit (GPU), a microprocessor (MP), or a digital signal processor (DSP), an ASIC, a FPGA, a CPLD, an NPU, a SoC, an offload card, an acceleration card, or other computing device.

[0138] The memory 806 can include volatile memory, such as random access memory (RAM). The processor 804 can further include non-volatile memory, such as read only memory (ROM), flash memory, a hard disk drive (HDD), or a solid-state drive (SSD). In addition, the memory 806 can be implemented using storage class memory (SCM), phase change memory (PCM), or other types of storage media.

[0139] It is worth noting that the same type of storage medium can be configured to implement the memory 806 function in the same computing device, or two or more types of storage media can be configured to implement the memory 806 function, which is not limited in the present application.

[0140] The memory 806 stores executable program code, in one implementation, the processor 804 executes the executable program code to respectively implement the functions of the aforementioned acquisition module 201 and processing module 202, thereby implementing the method described in the embodiment of FIG. 3, that is, the memory 806 stores instructions for executing the method described in the embodiment of FIG. 3; in another implementation, the processor 804 executes the executable program code to respectively implement the functions of the aforementioned acquisition module 201 and processing module 202, thereby implementing the method described in the embodiment of FIG. 2, that is, the memory 806 stores instructions for executing the method described in the embodiment of FIG. 2.

[0141] The communication interface 808 uses a transceiver module such as, but not limited to, a network interface card, a transceiver, to implement communication between the computing device 800 and other devices or communication networks.

[0142] As a possible implementation, the computing device 800 can also include a chip system including a processor and a power supply circuit for performing power supply for the processor, the processor being configured to perform the operation steps corresponding to the method described in the embodiment of FIG. 3, or the processor being configured to perform the operation steps corresponding to the method described in the embodiment of FIG. 2. For brevity, details are not repeated here. The processor can be implemented by a GPU, or can be implemented by a DPU, NPU, XPU, SoC, offload card, acceleration card, or other computing device or AI chip.

[0143] As a possible implementation, the computing device 800 can include multiple types of processors 804, i.e., the computing device 800 is a heterogeneous device, for example, the computing device 800 includes a CPU and a GPU, and the operation steps corresponding to the method described in the embodiment of FIG. 3 or the operation steps corresponding to the method described in the embodiment of FIG. 2 can be performed by at least one of the processors 804. For brevity, details are not repeated here.

[0144] Referring to FIG. 8, FIG. 8 is a structural schematic diagram of a computing device cluster provided by the present application. The computing device cluster includes at least one computing device. The computing device can be a server, for example, a central server, an edge server, or a local server in a local data center. In some embodiments, the computing device can also be a terminal device such as a desktop computer, a notebook computer, or a smart phone.

[0145] As shown in FIG. 8, the computing device cluster includes at least one computing device 800. The same instructions for performing the method described in the embodiment of FIG. 3 or the method described in the embodiment of FIG. 2 can be stored in the memory 806 of one or more computing devices 800 in the computing device cluster.

[0146] In some possible implementations, the memory 806 of one or more computing devices 800 in the computing device cluster can also respectively store partial instructions for performing the method described in the embodiment of FIG. 3. In other words, the combination of one or more computing devices 800 can collectively execute the instructions for performing the method described in the embodiment of FIG. 3.

[0147] In some possible implementations, the memory 806 of one or more computing devices 800 in the computing device cluster can also respectively store partial instructions for performing the method described in the embodiment of FIG. 2. In other words, the combination of one or more computing devices 800 can collectively execute the instructions for performing the method described in the embodiment of FIG. 2.

[0148] It should be noted that the memories 806 in different computing devices 800 in the computing device cluster can store different instructions for performing the above-described partial functions of the computing apparatus 200 respectively. That is, the memories 806 in different computing devices 800 store instructions for implementing the functions of one or more of the above-described obtaining module 201 and processing module 202.

[0149] In some possible implementations, one or more computing devices in the computing device cluster can be connected through a network. The network can be a wide area network or a local area network, etc. Figure 9 shows one possible implementation. As shown in Figure 9, two computing devices 800A and 800B are connected through a network. Specifically, the computing devices are connected to the network through the communication interfaces in the computing devices. In this type of possible implementation, the memory 806 in the computing device 800A stores instructions for performing the functions of the obtaining module 201. Meanwhile, the memory 806 in the computing device 800B stores instructions for performing the functions of the processing module 202.

[0150] The connection between the above-described computing device cluster can also be such that, in the above-described application loading method provided by the present application, the functions of the processing module 202 are performed in dependence on the data obtained by the obtaining module 201, and a large amount of computing resources and storage resources are required, so the functions implemented by the above-described obtaining module 201 and processing module 202 are performed by one computing device.

[0151] It should be understood that the functions of the computing device 800A shown in Figure 9 can also be performed by multiple computing devices 800. Similarly, the functions of the computing device 800B can also be performed by multiple computing devices 800.

[0152] The present application also provides a computer program product containing instructions. The computer program product can be a software or program product containing instructions, which can be run on a computing device or stored in any available medium. When the computer program product is run on at least one computing device, the at least one computing device is caused to perform the method described in the above-described embodiment of Figure 3, or perform the method described in the above-described embodiment of Figure 2.

[0153] The present application also provides a computer-readable storage medium. The computer-readable storage medium can be any available medium that can be stored by a computing device or a data storage device such as a data center containing one or more available media. The available medium can be a magnetic medium (for example, a floppy disk, a hard disk, a magnetic tape), an optical medium (for example, a DVD), or a semiconductor medium (for example, a solid state disk), etc. The computer-readable storage medium contains instructions for instructing a computing device to perform the method described in the embodiment of Figure 3, or perform the method described in the embodiment of Figure 2.

[0154] It should be noted that the above examples are only used to illustrate the technical solutions of the present application, and are not intended to limit the same. Although the present application has been described in detail with reference to the foregoing examples, those skilled in the art should understand that the technical solutions recorded in the foregoing examples can be modified, or some of the technical features can be replaced by equivalent features. Such modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the protection scope of the technical solutions of the embodiments of the present application.

Claims

1. A method for loading applications in a micro front end, characterized in that, The method comprises: receiving an application loading request in a micro front end, the application comprising a parent application and a plurality of child applications corresponding to the parent application, the parent application comprising a plurality of first dependencies, the child applications comprising a plurality of second dependencies, and the plurality of child applications comprising a first child application; loading the parent application and the plurality of first dependencies in the parent application according to the application loading request; loading the second dependencies of the plurality of child applications; when the second dependencies of the first child application are loaded, if the second dependencies of the first child application are the same as the first dependencies, and the versions of the second dependencies of the first child application are different from the versions of the first dependencies, setting a virtual dependency for the second dependencies of the first child application by a loader of the first child application, and loading the second dependencies of the first child application using the virtual dependency.

2. The method of claim 1, wherein, The plurality of child applications further comprise a second child application, if the second dependencies of the second child application are the same as the first dependencies, the versions of the second dependencies of the second child application are different from the versions of the first dependencies, and the versions of the second dependencies of the second child application are also different from the versions of the second dependencies of the first child application, the loader of the second child application is different from the loader of the first child application.

3. The method according to claim 1 or 2, characterized in that, The method further comprises: obtaining first mapping information according to the application loader request, the first mapping information comprising a correspondence between a plurality of target child applications and at least one loader, the plurality of target child applications belonging to the plurality of child applications, and the target child applications being child applications using the same dependency in different versions compared with the parent application; the loading of the second dependencies of the plurality of child applications comprises: loading the second dependencies of the plurality of child applications based on the first mapping information, and the loader of the first child application being obtained from the first mapping information based on an identifier of the first child application.

4. The method of claim 3, wherein, The first mapping information further comprises: version information of the plurality of first dependencies used by the parent application; an identifier of each child application in the plurality of child applications and version information of the plurality of second dependencies used by the each child application; and version information of the second dependencies managed by each loader.

5. The method according to any one of claims 1 to 4, characterized in that, If the second dependencies of the first child application are the same as the first dependencies, and the versions of the second dependencies of the first child application are also the same as the versions of the first dependencies, the second dependencies of the first child application are not loaded.

6. An apparatus for application loading in micro-front-ends, characterized in that, The apparatus comprises: an obtaining module configured to receive an application loading request in a micro front end, the application comprising a parent application and a plurality of child applications corresponding to the parent application, the parent application comprising a plurality of first dependencies, the child applications comprising a plurality of second dependencies, and the plurality of child applications comprising a first child application; a processing module configured to load the parent application and the plurality of first dependencies in the parent application according to the application loading request; the processing module is further configured to load the second dependencies of the plurality of child applications; The processing module is further configured to, when loading a second dependency of the first sub-application, if the second dependency is the same as the first dependency and the version of the second dependency is different from the version of the first dependency, set a virtual dependency for the second dependency by a loader of the first sub-application, and load the second dependency of the first sub-application using the virtual dependency.

7. The apparatus of claim 6, wherein, The plurality of sub-applications further comprises a second sub-application, If the second dependency of the second sub-application is the same as the first dependency, the version of the second dependency of the second sub-application is different from the version of the first dependency, and the version of the second dependency of the second sub-application is also different from the version of the second dependency of the first sub-application, the loader of the second sub-application is different from the loader of the first sub-application.

8. The apparatus of claim 6 or 7, wherein, The obtaining module is further configured to obtain first mapping information according to the application loader request, the first mapping information comprising a correspondence between a plurality of target sub-applications and at least one loader, the plurality of target sub-applications belonging to the plurality of sub-applications, and the target sub-application being a sub-application using a same dependency in different versions. The processing module is specifically configured to load a second dependency of the plurality of sub-applications based on the first mapping information, the loader of the first sub-application being obtained from the first mapping information based on the identifier of the first sub-application.

9. The apparatus of claim 8, wherein, The first mapping information further comprises: version information of the plurality of first dependencies used by the parent application; an identifier of each sub-application in the plurality of sub-applications and version information of the plurality of second dependencies used by the each sub-application; and version information of the second dependency managed by each loader.

10. The device according to any of claims 6-9, characterized in that The processing module is further configured to, if the second dependency of the first sub-application is the same as the first dependency and the version of the second dependency of the first sub-application is also the same as the version of the first dependency, not load the second dependency of the first sub-application.

11. A computing device, comprising: The computing device comprises a processor and a memory, the memory being configured to store instructions, and the processor being configured to execute the instructions stored in the memory to implement the method of any one of claims 1-5.

12. A computer-readable storage medium, characterized in that, The computer instructions, when executed by a processor, implement the method of any one of claims 1-5.

13. A computer program product comprising instructions, characterized in that, The instructions, when executed by a computing device, cause the computing device to perform the operation steps of the method of any one of claims 1-5.

Citation Information

Patent Citations

  • Method and device for realizing multi-version dependent isolation

    CN110968340A

  • Dependence management method and device based on PAAS, electronic equipment and medium

    CN114764354A

  • Micro-front-end architecture and resource processing method

    CN117234621A

  • Compatibility framework using versioning class loaders

    US20060248140A1