Module Centralized Sharing System Implemented Based on Module Federation Technology

Through the module centralized sharing system, the problem of high difficulty in module sharing retrieval in Module Federation technology is solved, efficient management of module resources and business reuse, and engineering development efficiency is improved. It is suitable for large-scale middle and backend management systems and low-code designers.

CN114860228BActive Publication Date: 2025-07-11HANGZHOU INSTRUCTION SET INTELLIGENT TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210538742.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-05-18
Publication Date
2025-07-11
Estimated Expiration
2042-05-18

AI Technical Summary

Technical Problem

In applications based on Module Federation technology, as the number of applications increases, the search difficulty caused by module sharing increases, especially the unnecessary search burden on low-code designer tools, which affects engineering development efficiency.

Method used

A module centralized sharing system was introduced, including module registration, parsing, processing and indexer. By uniquely identifying the management module resources, the unified registration, parsing, processing and retrieval of modules is realized, reducing the difficulty of retrieval of module sharing.

Benefits of technology

It effectively reduces the difficulty of retrieval of module sharing, improves the development efficiency of engineering systems, supports business reuse and silent iteration, and is suitable for large middle and backend management systems and low-code designer tools.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114860228B_ABST
    Figure CN114860228B_ABST
Patent Text Reader

Abstract

The present invention discloses a module-centered sharing system implemented based on Module Federation technology, which includes an engineering system and a sharing system. The sharing system includes: a module registration part, communicatively connected to the engineering system; a module parser, communicatively connected to the module registration part, configured to receive registration information and parse the registration information to output module information; a module processor, communicatively connected to the module parser; a module indexer, communicatively connected to the module processor, configured to create a binding relationship between the unique identifier of the module and the static resources of the module after receiving the processing result, and input the unique identifier into the engineering system; and a module retrieval part. The module-centered sharing system implemented based on Module Federation technology of the present invention realizes dynamic (runtime) import and use of shared modules within the system by establishing a centralized module sharing system within the system.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to a sharing system, and more particularly to a module-centered sharing system implemented based on Module Federation technology. Background Art

[0002] As Figure 1 shown in , three applications composed of three independent projects appA, appB, and appC built based on module federation technology. appA imports module B1 of appB and module C1 of appC. appB imports module A1 of appA and module C2 of appC. Although appA, appB, and appC are three different projects developed, deployed, and released independently, they can achieve unrestricted module sharing among them.

[0003] However, after the number of applications shown in the above figure gradually increases, a large number of applications share their own modules. When importing the shared modules of these applications, it is necessary to pay attention to which application the module is shared from, which increases the difficulty of module retrieval in the engineering development stage. At the same time, for tools like low-code designers, they do not care about the source of the raw materials when importing materials or raw materials, so it increases some completely unnecessary retrieval difficulties. Summary of the Invention

[0004] Aiming at the deficiencies of the prior art, the purpose of the present invention is to provide a module-centered sharing system implemented based on Module Federation technology that can effectively reduce the retrieval difficulty.

[0005] To achieve the above purpose, the present invention provides the following technical solution: A module-centered sharing system implemented based on Module Federation technology, characterized in that: it includes an engineering system and a sharing system, and the sharing system includes:

[0006] A module registration part, communicatively connected to the engineering system, for generating registration information for the modules to be shared within the engineering system;

[0007] A module parser, communicatively connected to the module registration part, for receiving the registration information and parsing the registration information to output module information;

[0008] A module processor, communicatively connected to the module parser, for receiving the module information and processing the module information to output a processing result;

[0009] A module indexer, communicatively connected to a module processor, is configured to create a binding relationship between the unique identifier of a module and the static resources of the module after receiving the processing result, and input the unique identifier into the engineering system;

[0010] A module retrieval part, communicatively connected to the engineering system, is configured to retrieve the corresponding module according to the unique identifier.

[0011] As a further improvement of the present invention, the specific steps for the module registration part to generate registration information are as follows: Step 1, determine whether there are modules to be shared in the engineering system;

[0012] Step 2, if there are shared modules, extract the shared module information and input it into the sharing system to generate registration information, and the sharing system outputs a callback signal to the engineering system;

[0013] Step 3, the engineering system determines whether to perform engineering deployment and release according to the callback result. If the callback result is a success signal, perform engineering deployment and release; if it is a failure signal, directly end.

[0014] As a further improvement of the present invention, the specific steps for determining whether there are shared modules in Step 1 are as follows:

[0015] Step 1-1, construct an engineering output construction signal;

[0016] Step 1-2, after the engineering construction is completed, parse the engineering according to the construction signal to analyze whether there are modules to be shared in the engineering. If there are, perform the parsing work of the shared modules, and transfer the parsed shared module information to the sharing system for module registration through a network request. If there are no modules to be shared, directly perform engineering deployment and release.

[0017] As a further improvement of the present invention, the specific steps for the module retrieval part to retrieve are as follows:

[0018] Step 1, the browser loads the remote module;

[0019] Step 2, determine whether there is a runtime cache. If not, initiate a network request to the sharing system, perform an index query from the module index according to the unified module address, return the module resource address to the browser after obtaining it; the browser executes after obtaining the module resource address to obtain a new runtime, and then injects the new runtime into the context to complete the complete execution process of a remote module and complete the retrieval. If there is a runtime cache, continue to the next step;

[0020] Step 3, when reusing the previous runtime, inject the context to complete the full execution process of a remote module. The beneficial effects of the present invention are that all modules that need to be shared within the engineering system can be dynamically registered into the module sharing system. The module sharing system can uniformly allocate, manage, and provide the import addresses of the modules. The shared modules comply with the modular specifications in the ECMA-262 standard and can be freely used in modern engineering in the form of module imports. At the same time, by using the sharing system, the following functions can be obtained in the engineering system:

[0021] Business reuse: The user login module within the system can be shared with other applications, enabling seamless login within the application without page refresh. The permission configuration module within the system can be shared with other applications, enabling seamless permission configuration within the application without page navigation.

[0022] Silent iteration: When the user login module and the permission configuration module within the system are updated, other applications that use these modules can immediately enjoy the latest version of the module without the need for further development, deployment, and release. Runtime reuse: If the permission configuration module is imported in multiple places within an application, as long as the permission configuration module has been loaded at any one place within the application, runtime sharing can be achieved without the need to load the permission configuration module again.

[0023] At the same time, through the application of the sharing system, the implementation difficulty of the following application scenarios can be effectively reduced: Large-scale middle and back-office management systems: These are large systems composed of multiple subsystems. Different subsystems can encapsulate the subsystems into modules for sharing, and the management system only needs to import and run these modules. This is usually the technical manifestation of micro frontends.

[0024] Tooling systems such as low-code designers: Low-code designers only implement tool capabilities, and the raw materials required by the tools can come from the module sharing system, making the tools lightweight. These raw materials can be developed by developers outside the tools, achieving specialization and separation. BRIEF DESCRIPTION OF THE DRAWINGS

[0025] Figure 1 It is a communication schematic diagram of three independent projects, appA, appB, and appC, built based on the module federation technology;

[0026] Figure 2 It is for Figure 1 and is a communication schematic diagram with a shared system added;

[0027] Figure 3 It is an execution flow chart of the shared system;

[0028] Figure 4 It is a flow chart for generating registration information in the module registration part;

[0029] Figure 5 Flow chart retrieved for the model retrieval section. Specific implementation mode

[0030] The present invention will be further described in detail below with reference to the embodiments given in the accompanying drawings.

[0031] Refer to Figures 2 to 5 As shown, a module-centered sharing system implemented based on the Module Federation technology in this embodiment is characterized in that it includes an engineering system and a sharing system. The sharing system includes: a module registration part, communicatively connected to the engineering system, for generating registration information for the modules to be shared in the engineering system;

[0032] A module parser, communicatively connected to the module registration part, for receiving the registration information and parsing the registration information to output module information;

[0033] A module processor, communicatively connected to the module parser, for receiving the module information and processing the module information to output a processing result;

[0034] A module indexer, communicatively connected to the module processor, for creating a binding relationship between the unique identifier of the module and the static resources of the module after receiving the processing result, and inputting the unique identifier into the engineering system;

[0035] A module retrieval part, communicatively connected to the engineering system, for retrieving the corresponding module according to the unique identifier. Through the sharing system composed of the above structure, module registration, parsing, processing, indexing, and retrieval can be realized, effectively facilitating people to retrieve and process the modules to be shared.

[0036] As a specific implementation mode of the improvement, the specific steps for the module registration part to generate registration information are as follows:

[0037] Step 1, determine whether there are modules to be shared in the engineering system;

[0038] Step 2, if there are shared modules, extract the shared module information and input it into the sharing system to generate registration information, and the sharing system outputs a callback signal to the engineering system;

[0039] Step 3, the engineering system determines whether to perform engineering deployment and release according to the callback result. If the callback result is a success signal, engineering deployment and release are performed. If it is a failure signal, it directly ends. Through the settings of the above three steps, it can effectively determine whether there are modules to be shared, and at the same time determine whether to perform engineering deployment and release according to the judgment result.

[0040] As a specific implementation of the improvement, the specific steps for determining whether there are shared modules in Step 1 are as follows:

[0041] Step 1-1, construct an engineering output construction signal;

[0042] Step 1-2, after the project construction is completed, parse the project according to the construction signal to analyze whether there are modules that need to be shared in the project. If so, perform the parsing work of the shared modules, and transmit the shared module information after parsing to the shared system for module registration through a network request. If there are no modules that need to be shared, directly perform project deployment and release. Through the settings of the above two steps, it is possible to further process the information of the modules that need to be shared, and then complete the deployment and release of the overall project.

[0043] As a specific implementation of the improvement, the specific steps for the module retrieval part to retrieve are as follows:

[0044] Step 1, the browser loads the remote module;

[0045] Step 2, determine whether there is a runtime cache. If not, initiate a network request to the shared system, perform an index query from the module index according to the unified module address, return the module resource address to the browser after obtaining it; after the browser obtains the module resource address, execute it to obtain a new runtime, and then inject the new runtime into the context to complete the complete execution process of a remote module, and complete the retrieval. If there is a runtime cache, continue to the next step;

[0046] Step 3, reuse the previous runtime, inject the context to complete the complete execution process of a remote module. Through the settings of the above steps, it is possible to avoid the problem of establishing a new runtime when there is already a runtime buffer in the browser, effectively increasing the overall operation efficiency.

[0047] In summary, the module-centered sharing system of this embodiment adds a shared-centered application outside appA, appB, and appC. Its role is to register the shared modules in the system composed of appA, appB, and appC. The way to import shared modules in this system will be imported from shared, rather than from the source.

[0048] The above are only the preferred embodiments of the present invention. The protection scope of the present invention is not limited to the above embodiments. All technical solutions within the idea of the present invention belong to the protection scope of the present invention. It should be pointed out that for those of ordinary skill in the art in this technical field, several improvements and refinements made without departing from the principle of the present invention should also be regarded as the protection scope of the present invention.

Claims

1. A module centralized sharing system implemented based on Module Federation technology, characterized in that: It includes an engineering system and a sharing system. The sharing system includes: A module registration part, which is communicatively connected to the engineering system and is used to generate registration information for the modules that need to be shared in the engineering system. The specific steps are as follows: Step 1, determine whether there are modules that need to be shared in the engineering system; Step 2, if there are shared modules, extract the shared module information and input it into the sharing system to generate registration information, and the sharing system outputs a callback signal to the engineering system; Step 3, the engineering system determines whether to perform engineering deployment and release according to the callback result. If the callback result is a success signal, perform engineering deployment and release. If it is a failure signal, directly end. A module parser, which is communicatively connected to the module registration part and is used to receive the registration information and then parse the registration information to output module information. A module processor, which is communicatively connected to the module parser and is used to receive the module information and process the module information to output a processing result. A module indexer, which is communicatively connected to the module processor and is used to create a binding relationship between the unique identifier of the module and the static resources of the module after receiving the processing result, and input the unique identifier into the engineering system. A module retrieval part, which is communicatively connected to the engineering system and is used to retrieve the corresponding module according to the unique identifier. The specific steps are as follows: Step 1, the browser loads the remote module; Step 2, determine whether there is a runtime cache. If not, initiate a network request to the sharing system, perform an index query from the module index according to the unified module address, and return the module resource address to the browser after obtaining it; after the browser obtains the module resource address, execute it to obtain a new runtime, and then inject the new runtime into the context to complete the complete execution process of a remote module and complete the retrieval. If there is a runtime cache, continue to the next step; Step 3, reuse the previous runtime and inject it into the context to complete the complete execution process of a remote module.

2. The module centralized sharing system implemented based on the Module Federation technology according to claim 1, wherein: The specific steps for determining whether there are shared modules in Step 1 are as follows: Step 1-1, construct an engineering output construction signal. Step 1-2, after the engineering construction is completed, parse the engineering according to the construction signal to analyze whether there are modules that need to be shared in the engineering. If there are, perform the parsing work of the shared modules, and transfer the parsed shared module information to the sharing system through a network request for module registration. If there are no modules that need to be shared, directly perform engineering deployment and release.

Citation Information

Patent Citations

  • Method and system for shared data in application

    CN103546532A

  • Multi-application sharing method, system and device, electronic equipment and storage medium

    CN111880786A