CN114679491A - Micro front-end service application method and device, storage medium and electronic equipment - Google Patents

Micro front-end service application method and device, storage medium and electronic equipment Download PDF

Info

Publication number
CN114679491A
CN114679491A CN202011573414.5A CN202011573414A CN114679491A CN 114679491 A CN114679491 A CN 114679491A CN 202011573414 A CN202011573414 A CN 202011573414A CN 114679491 A CN114679491 A CN 114679491A
Authority
CN
China
Prior art keywords
service
layer unit
module
application layer
service module
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202011573414.5A
Other languages
Chinese (zh)
Inventor
刘小娟
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Jingdong Technology Holding Co Ltd
Original Assignee
Jingdong Technology Holding Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Jingdong Technology Holding Co Ltd filed Critical Jingdong Technology Holding Co Ltd
Priority to CN202011573414.5A priority Critical patent/CN114679491A/en
Publication of CN114679491A publication Critical patent/CN114679491A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/74Address processing for routing
    • H04L45/745Address table lookup; Address filtering

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Stored Programmes (AREA)

Abstract

The application provides a micro front-end service application method, a micro front-end service application device, a storage medium and electronic equipment. According to the micro front-end service device provided by the embodiment of the application, the service modules bearing different service contents are arranged in the sub-application layer unit, and the central registry is configured in the main application layer unit, so that the main application layer unit forwards the access instruction to the target service module corresponding to the access instruction in the sub-application layer unit through the central registry, and the data file of the target service module is loaded to the main application layer unit, and therefore the main application layer unit can be compatible with the service modules developed based on different frames in the sub-application layer unit, the micro front-end service device can decouple the front-end service, and the service modules in the sub-application layer unit can be configured to adaptively deploy specific service requirements, and the expandability of the developed projects is improved.

Description

Micro front-end service application method and device, storage medium and electronic equipment
Technical Field
The present application relates to the field of data processing technologies, and in particular, to a method and an apparatus for applying a micro front-end service, a storage medium, and an electronic device.
Background
In recent years, with the rapid development of the related technologies in the front-end field, the engineering degree of the front-end is rapidly improved, but with the increase of the content of the project, the quantity of the front-end project is increased, and the problem of maintenance is more and more prominent, wherein the front-end is a layer facing to a Web user and generally comprises routing control, data aggregation, template rendering, content distribution and the like.
As business of enterprises evolve, and over time, the common parts of each project become more and more common, making front-end layers developed by independent project teams more and more difficult to maintain. Currently, Web front-end and back-end separation techniques typically use a single framework, for example, a Model View Model (MVVM) to abstract the state and behavior of the views therein, thereby separating the views from the business logic.
However, the single framework approach described above may cause a project developed based on the same framework to support only the specific framework, but not other frameworks, which may affect the extensibility of the project.
Disclosure of Invention
The embodiment of the application provides a micro front-end service application method, a micro front-end service application device, a storage medium and electronic equipment, and aims to solve the technical problem that technical compatibility cannot be realized for multiple front-end frames in a single-frame mode at present.
In a first aspect, an embodiment of the present application provides a micro front-end service device, including: a main application layer unit and a sub-application layer unit;
at least one service module is arranged in the sub-application layer unit, and the service module is used for bearing service contents of corresponding services;
the main application layer unit is configured with a central registry, and forwards an access instruction to a target service module corresponding to the access instruction in the sub application layer unit through the central registry so as to load a data file of the target service module to the main application unit.
In one possible design, a sub-application management module is arranged in the main application layer unit;
the sub-application management module is used for matching the access instruction to the target service module by using the central registry and loading a static file of the target service module, wherein the data file comprises the static file.
In one possible design, the micro front-end service device further includes: a user access layer unit;
and the user access layer unit is used for receiving the access instruction and displaying the page of the main application layer unit after the static file is loaded.
In one possible design, at least one common service module is disposed in the main application layer unit, and the common service module is configured to provide a common capability for the service module, and the common capability is configured to support a corresponding user interaction operation.
In one possible design, the common services module includes: at least one of an account management module, a rights management module, and a menu management module.
In one possible design, the micro front-end service device further includes: a basic service layer unit;
the basic service layer unit is configured with a basic service module, the basic service module is used for providing basic capability for the service module, and the basic capability is used for supporting the operation management of the service module.
In one possible design, the micro front-end service device further includes: the rear end is connected with an interface;
the back-end connection interface is used for requesting the data file to a background server corresponding to each service module.
In a second aspect, an embodiment of the present application provides a micro front-end service application method, which is applied to a micro front-end service device, where the micro front-end service device includes: the system comprises a main application layer unit and a sub application layer unit, wherein at least one service module is arranged in the sub application layer unit and is used for bearing service contents of corresponding services; the method comprises the following steps:
After the main application layer unit obtains an access instruction, the access instruction is forwarded to a corresponding target service module in the sub application layer unit by using a central registry in the main application layer unit;
and loading the data file of the target service module to the main application unit.
In one possible design, the forwarding the access instruction to the corresponding target service module in the sub application layer unit by using the central registry in the main application layer unit includes:
and matching the access instruction to the target service module by using the central registry through a sub-application management module in the main application layer unit so as to load a static file of the target service module.
In one possible design, after the loading the data file of the target business module to the host application, the method further includes:
and displaying the page of the main application after the static file is loaded in a user access layer unit.
In a possible design, the method for applying micro front-end services further includes:
and responding to user interaction operation, and calling a target public service module in the main application layer unit, wherein the target public service module is a public service module corresponding to the user interaction operation in the main application layer unit, the public service module is used for providing public capability for the business module, and the public capability is used for supporting the corresponding user interaction operation.
In one possible design, the common services module includes: at least one of an account management module, a rights management module, and a menu management module.
In one possible design, the method for applying the micro front-end service further includes:
and responding to a business management instruction, and calling a target basic service module in the main application layer unit, wherein the basic service module is a basic service module corresponding to the business management instruction in the main application layer unit, the basic service module is used for providing basic capability for the business module, and the basic capability is used for supporting the operation management of the business module.
In one possible design, the method for applying the micro front-end service further includes:
and responding to the access instruction, and requesting the data file from the background server corresponding to each service module through a back-end connection interface.
In a third aspect, an embodiment of the present application further provides an electronic device, including:
a processor; and the number of the first and second groups,
a memory for storing executable instructions of the processor;
wherein the processor is configured to perform the functions of the units in the micro front-end service device in any one of the first aspect via execution of the executable instructions.
In a fourth aspect, the present application further provides a storage medium, on which a computer program is stored, where the program, when executed by a processor, implements the functions of each unit in the micro front-end service device in any one of the first aspects.
In a fifth aspect, this application further provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, the computer program implements the functions of each unit in the micro front-end service device in any one of the first aspects.
The embodiment of the application provides a micro front-end service application method, a device, a storage medium and an electronic device, by arranging service modules for bearing different service contents in the sub-application layer unit and configuring a central registry in the main application layer unit, so that the main application layer unit forwards the access instruction to the target service module corresponding to the access instruction in the sub application layer unit through the central registry to load the data file of the target service module to the main application unit, thereby realizing that the main application unit can be compatible with the business modules developed based on different frameworks in the sub-application layer unit, so that the micro front-end service device can decouple the front-end business, and the service module in the sub-application layer unit can be configured to adaptively deploy specific service requirements, so that the expandability of the developed project is improved.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly introduced below, and it is obvious that the drawings in the following description are some embodiments of the present application, and for those skilled in the art, other drawings can be obtained according to these drawings without inventive exercise.
FIG. 1 is an apparatus diagram of a micro front-end service apparatus shown herein according to an example embodiment;
FIG. 2 is a flow diagram illustrating a micro front-end service application method according to an example embodiment;
FIG. 3 is a flow diagram illustrating a method for micro-front-end service application according to another example embodiment;
fig. 4 is a schematic structural diagram of an electronic device shown in the present application according to an example embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are some embodiments of the present application, but not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
The terms "first," "second," "third," "fourth," and the like in the description and in the claims of the present application and in the above-described drawings (if any) are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the application described herein are capable of operation in sequences other than those illustrated or described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
As business of enterprises evolve, and over time, the common parts of each project become more and more common, making front-end layers developed by independent project teams more and more difficult to maintain. Generally, a large-scale business system (e.g., a financial business system, an educational business system, an entertainment business system, etc.) includes a plurality of business modules, each business module is supported by a corresponding back-end service, each back-end service corresponds to an independent front-end in a normal development process, and due to reasons such as technology type selection, leading decision, history leaving, etc., technology stacks used by the front-ends may be different in old and new and have different devices. If device consistency needs to be maintained, the implementation is performed by using a Web front-end separation technology, and a single framework is usually used, for example, the state and behavior of a view in the device are abstracted by using an MVVM device, so that the view and business logic are separated. However, the single-frame approach may result in a high dependency of a project developed based on the same frame on a specific front-end frame, and when the platform needs to be supported by other front-end frames, it is impossible to ensure the technical compatibility.
In view of the above technical problems, the technical idea of the present application is to set service modules bearing different service contents in a sub-application layer unit, and configure a central registry in a main application layer unit, so that the main application layer unit forwards an access instruction to a target service module corresponding to the access instruction in the sub-application layer unit through the central registry to load a data file of the target service module to the main application unit, thereby implementing that service modules developed based on different frames in the sub-application layer unit can be compatible in the main application unit, so that the micro front-end service device can decouple front-end services, and can also adaptively deploy specific service requirements by configuring the service modules in the sub-application layer unit.
Fig. 1 is an apparatus diagram of a micro front-end service apparatus according to an example embodiment. As shown in fig. 1, the micro front-end service device provided in the present application includes: a main application layer unit and a sub-application layer unit.
At least one service module is arranged in the sub-application layer unit, and the service module is used for bearing service contents of corresponding services. For example, in a financial business system, business modules such as "fund", "post-investment", "map", "policy", "research", and "external project" may be set in the sub-application layer unit, and each business module is used to carry corresponding financial business content and functions. A "fund" may be illustrated as one of the business modules, which may be for exposing fund business related content and services.
In addition, a central registry is configured in the main application layer unit, and the main application layer unit can forward the access instruction to the target service module corresponding to the access instruction in the sub application layer unit through the central registry so as to load the data file of the target service module to the main application. It is worth noting that in one possible design, communication between the main application layer unit and the sub-application layer unit can be achieved in the manner of eventemitter 3.
The central registry may be used to establish an address access relationship between the main application layer unit and the sub-application layer unit, and when the main application layer unit receives a relevant access instruction, the main application layer unit may forward the relevant access instruction to the corresponding service module in the sub-application layer unit through the mapping relationship in the central registry. For example, if the access instruction obtained in the main application layer unit is related service or service for accessing "fund", the access instruction may be forwarded to the "fund" module in the sub application layer unit through the central registry, so that the data file in the "fund" module is loaded to the main application and displayed in the main application.
Optionally, the data file of the target service module may be loaded to the main application through an import-html-entry. Specifically, the method can be implemented by reading entries such as js \ css and the like in HTML of the target service module and then injecting the entries into HTML of the main application.
The central registry can be realized by a method in a Single-SPA framework. Thus, various technology stacks are compatible, i.e., multiple technologies can be used in the same page (e.g., React, Vue, AngularJS, Angular, Ember), and reloading of the page is not required. And the existing code does not need to be reconstructed, namely, if the code is written by selecting a new technical framework, the code in the existing project does not need to be reconstructed. In addition, the code of each independent module can be loaded as required, and extra resources are not wasted. In addition, each independent module is independently developed and independently operated, the optimal access authority can be configured, the function can be split to the minimum, and the authority can be divided according to the function. Thereby fusing multiple items of different technologies together through the Single-SPA and the central registry therein.
In this embodiment, by setting service modules carrying different service contents in the sub-application layer unit and configuring the central registry in the main application layer unit, the main application layer unit forwards the access instruction to the target service module corresponding to the access instruction in the sub-application layer unit through the central registry to load the data file of the target service module to the main application, so that the main application can perform compatibility on the service modules developed based on different frames in the sub-application layer unit, so that the micro front-end service device can perform decoupling of front-end services, and can also perform adaptive deployment on specific service requirements by configuring the service modules in the sub-application layer unit.
With reference to fig. 1, on the basis of the foregoing embodiment, the main application layer unit may further include a sub application management module, where the sub application management module is configured to match the access instruction to the target service module by using the central registry, and load a static file of the target service module, where the data file includes the static file. It should be noted that the service module types in the sub application layer unit may be constructed according to actual requirements, and if a new service module needs to be added to the sub application layer unit, the service module may be registered in the sub application management module. For the loading of the static files, a Systemjs tool can be adopted, the Systemjs tool is a universal Javascript module loader, and an ES6 module AMD CommonJS and a global script can be loaded in a browser and NodeJS.
In addition, the main application layer unit can be further provided with at least one public service module, the public service module is used for providing public capability for the service module, and the public capability is used for supporting corresponding user interactive operation. Referring to fig. 1, the common service module may include: at least one of an account management module, a rights management module, and a menu management module. It should be noted that some function modules commonly used in each application may be selected as a common service module, for example, in each application, account management is usually required, so that the common service module of the whole device may be formed by setting the account management module in the main application unit, so as to avoid setting the function module in each business module separately and repeatedly, thereby effectively simplifying the system.
On the basis of the foregoing embodiment, the micro front-end service apparatus may further include: and a basic service layer unit. The basic service layer unit is configured with a basic service module, the basic service module is used for providing basic capability for the service module, and the basic capability is used for supporting the operation management of the service module. With continued reference to fig. 1, the basic service module described above may include: at least one of a monitoring module, a distribution module, a point burying module and a simulation module. It should be noted that the basic service module is used to provide basic capability for the service module in operation management, that is, operations such as monitoring, service distribution, site-embedding management, and data simulation can be performed on the operation of the service module.
With reference to fig. 1, the micro front-end service apparatus provided in this embodiment may further include: and a rear end connection interface, wherein the JEN nginx can be adopted for the rear end connection interface. The back-end connection interface is used for requesting data files from the background server corresponding to each service module. For example, in response to an access instruction to the "fund" service module, a data file of a response is requested from the fund backend server for front-end presentation, for example, in a browser or wechat applet page manner.
Fig. 2 is a flowchart illustrating a micro front-end service application method according to an example embodiment. As shown in fig. 2, the method for applying the micro front-end service provided by this embodiment includes:
step 101, obtaining an access instruction in a main application layer unit.
The micro front-end service application method provided by this embodiment is applied to the micro front-end service device provided by any of the above embodiments. The front-end service device includes: a main application layer unit and a sub-application layer unit.
At least one service module is arranged in the sub-application layer unit, and the service module is used for bearing service contents of corresponding services. For example, in a financial business system, business modules such as "fund", "post-investment", "map", "policy", "research", and "external project" may be set in the sub-application layer unit, and each business module is used to carry corresponding financial business content and functions. A "fund" may be illustrated as one of the business modules, which may be for exposing fund business related content and services.
When a user needs to access a related target service module, the main application layer unit can acquire an access instruction by inputting a corresponding access instruction in the user access layer unit.
And 102, forwarding the access instruction to a corresponding target service module in the sub application layer unit by using a central registry in the main application layer unit.
And a central registry is configured in the main application layer unit, and the main application layer unit can forward the access instruction to a target service module corresponding to the access instruction in the sub-application layer unit through the central registry so as to load the data file of the target service module to the main application unit. It is worth noting that in one possible design, communication between the main application layer unit and the sub-application layer unit can be achieved in the manner of eventemitter 3.
And 103, loading the data file of the target service module to the main application.
The central registry may be used to establish an address access relationship between the main application layer unit and the sub-application layer units, and when the main application layer unit receives a relevant access instruction, the main application layer unit may forward the relevant access instruction to the corresponding service module in the sub-application layer unit through the mapping relationship in the central registry. For example, if the access instruction acquired in the main application layer unit is related service or service for accessing "fund", the access instruction may be forwarded to the "fund" module in the sub application layer unit through the central registry, so that the data file in the "fund" module is loaded to the main application and displayed in the main application.
Optionally, the data file of the target service module may be loaded to the main application through an import-html-entry. Specifically, the method can be implemented by reading entries such as js \ css and the like in HTML of the target service module and then injecting the entries into HTML of the main application.
The central registry can be realized by a method in a Single-SPA framework. Thus, a variety of technology stacks may be compatible, i.e., multiple technologies may be used in the same page (e.g., React, Vue, AngularJS, Angular, Ember), and reloading of the page is not required. And the existing code does not need to be reconstructed, namely, if the code is written by selecting a new technical framework, the code in the existing project does not need to be reconstructed. In addition, the code of each independent module can be loaded according to the requirement, and extra resources are not wasted. Moreover, each independent module is independently developed and independently operated, the optimal access authority can be configured, the function can be split to the minimum, and the authority can be divided according to the function. Thereby fusing multiple items of different technologies together through the Single-SPA and the central registry therein.
In this embodiment, by setting service modules carrying different service contents in the sub-application layer unit and configuring the central registry in the main application layer unit, the main application layer unit forwards the access instruction to the target service module corresponding to the access instruction in the sub-application layer unit through the central registry to load the data file of the target service module to the main application unit, so that the main application unit can perform compatibility on service modules developed based on different frames in the sub-application layer unit, so that the micro front-end service device can perform decoupling of front-end services, and can also perform adaptive deployment on specific service requirements by configuring the service modules in the sub-application layer unit, thereby improving expandability of the developed project.
Fig. 3 is a flow chart diagram illustrating a micro-front-end service application method according to another example embodiment of the present application. As shown in fig. 3, the method for applying the micro front-end service provided by this embodiment includes:
step 201, obtaining an access instruction in a main application layer unit.
The micro front-end service application method provided by this embodiment is applied to the micro front-end service device provided by any of the above embodiments. The front-end service device includes: a main application layer unit and a sub-application layer unit.
At least one service module is arranged in the sub-application layer unit, and the service module is used for bearing service contents of corresponding services. For example, in a financial business system, business modules such as "fund", "post-investment", "map", "policy", "research", and "external project" may be set in the sub-application layer unit, and each business module is used to carry corresponding financial business content and functions. A "fund" may be illustrated as one of the business modules, which may be for exposing fund business related content and services.
When a user needs to access a related target service module, the main application layer unit can acquire an access instruction by inputting a corresponding access instruction in the user access layer unit.
Step 202, matching the access instruction to the target service module by the sub-application management module in the main application layer unit and by using the central registry, so as to load the static file of the target service module.
On the basis of the above embodiment, the main application layer unit may further include a sub-application management module, where the sub-application management module is configured to match the access instruction to the target service module by using the central registry, and load a static file of the target service module, where the data file includes the static file. It should be noted that the service module types in the sub application layer unit may be constructed according to actual requirements, and if a new service module needs to be added to the sub application layer unit, the service module may be registered in the sub application management module. For the loading of the static files, a Systemjs tool can be adopted, the Systemjs tool is a universal Javascript module loader, and an ES6 module AMD CommonJS and a global script can be loaded in a browser and NodeJS.
And step 203, loading the data file of the target business module to the main application.
The central registry may be used to establish an address access relationship between the main application layer unit and the sub-application layer unit, and when the main application layer unit receives a relevant access instruction, the main application layer unit may forward the relevant access instruction to the corresponding service module in the sub-application layer unit through the mapping relationship in the central registry. For example, if the access instruction acquired in the main application layer unit is related service or service for accessing "fund", the access instruction may be forwarded to the "fund" module in the sub application layer unit through the central registry, so that the data file in the "fund" module is loaded to the main application and displayed in the main application.
Optionally, the data file of the target service module may be loaded to the main application through an import-html-entry. Specifically, the method can be implemented by reading entries such as js \ css and the like in HTML of the target service module and then injecting the entries into HTML of the main application.
The central registry can be realized by a method in a Single-SPA framework. Thus, various technology stacks are compatible, i.e., multiple technologies can be used in the same page (e.g., React, Vue, AngularJS, Angular, Ember), and reloading of the page is not required. And the existing code does not need to be reconstructed, namely, if the code is written by selecting a new technical framework, the code in the existing project does not need to be reconstructed. In addition, the code of each independent module can be loaded as required, and extra resources are not wasted. In addition, each independent module is independently developed and independently operated, the optimal access authority can be configured, the function can be split to the minimum, and the authority can be divided according to the function. Thereby fusing multiple items of different technologies together through the Single-SPA and the central registry therein.
And step 204, displaying the page of the main application loaded with the static file in the user access layer unit.
In this step, the data file may be requested from the background server corresponding to each service module through the back-end connection interface. For example, in response to an access instruction to the "fund" service module, a static file of a response is requested from the fund background server, and the static file is loaded into the main application layer unit, so that a page of the main application layer unit after the static file is loaded is displayed in the user access layer unit, for example, a page of a browser or a wechat applet is displayed.
In addition, the main application layer unit can also be provided with at least one public service module, the public service module is used for providing public capability for the service module, and the public capability is used for supporting corresponding user interactive operation. Referring to fig. 1, the common service module may include: at least one of an account management module, a rights management module, and a menu management module. It should be noted that some function modules commonly used in each application may be selected as a common service module, for example, in each application, account management is usually required, so that the common service module of the whole device may be formed by setting the account management module in the main application, so as to avoid setting the function module in each business module separately and repeatedly, thereby effectively simplifying the system. The target public service module can be called in the main application layer unit in response to the user interaction operation, wherein the target public service module is a public service module corresponding to the user interaction operation in the main application layer unit, the public service module is used for providing public capability for the service module, and the public capability is used for supporting the corresponding user interaction operation.
The micro front-end service device may further include: and a basic service layer unit. The basic service layer unit is configured with a basic service module, the basic service module is used for providing basic capability for the service module, and the basic capability is used for supporting the operation management of the service module. With continued reference to fig. 1, the basic service module described above may include: at least one of a monitoring module, a distribution module, a point burying module and a simulation module. It is worth to be noted that the basic service module is used to provide basic capability in operation management for the service module, that is, operations such as monitoring, service distribution, site burying management, and data simulation can be performed on operation of the service module. In response to the service management instruction, a target basic service module can be called in the main application layer unit, wherein the basic service module is a basic service module corresponding to the service management instruction in the main application layer unit.
Fig. 4 is a schematic structural diagram of an electronic device shown in the present application according to an example embodiment. As shown in fig. 4, the present embodiment provides an electronic device 300, including:
a processor 301; and the number of the first and second groups,
a memory 302 for storing executable instructions of the processor, which may also be a flash (flash memory);
Wherein the processor 301 is configured to perform the steps of the above-described method via execution of the executable instructions. Reference may be made specifically to the description of the functions of each unit in the micro front-end service device.
Alternatively, the memory 302 may be separate or integrated with the processor 301.
When the memory 302 is a device independent of the processor 301, the electronic device 300 may further include:
a bus 303 for connecting the processor 301 and the memory 302.
The present embodiment also provides a readable storage medium, in which a computer program is stored, and when at least one processor of the electronic device executes the computer program, the electronic device executes the functions of the units in the micro front-end service device provided in the foregoing embodiments.
The present embodiments also provide a program product comprising a computer program, the computer program being stored in a readable storage medium. The computer program can be read from a readable storage medium by at least one processor of the electronic device, and the execution of the computer program by the at least one processor causes the electronic device to implement the functions of the units in the micro front-end service device provided by the various embodiments described above.
Those of ordinary skill in the art will understand that: all or a portion of the steps of implementing the above-described method embodiments may be performed by hardware associated with program instructions. The program may be stored in a computer-readable storage medium. When executed, the program performs steps comprising the method embodiments described above; and the aforementioned storage medium includes: various media that can store program codes, such as ROM, RAM, magnetic or optical disks.
Finally, it should be noted that: the above embodiments are only used for illustrating the technical solutions of the present application, and not for limiting the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some or all of the technical features may be equivalently replaced; and the modifications or the substitutions do not make the essence of the corresponding technical solutions depart from the scope of the technical solutions of the embodiments of the present application.

Claims (17)

1. A micro front-end service device, comprising: a main application layer unit and a sub-application layer unit;
at least one service module is arranged in the sub-application layer unit, and the service module is used for bearing service contents of corresponding services;
The main application layer unit is configured with a central registry, and forwards an access instruction to a target service module corresponding to the access instruction in the sub application layer unit through the central registry so as to load a data file of the target service module to the main application unit.
2. The micro front-end service device according to claim 1, wherein a sub-application management module is disposed in the main application layer unit;
the sub-application management module is used for matching the access instruction to the target service module by using the central registry and loading a static file of the target service module, wherein the data file comprises the static file.
3. The micro front-end service device of claim 2, further comprising: a user access layer unit;
and the user access layer unit is used for receiving the access instruction and displaying the page of the main application unit after the static file is loaded.
4. The micro front-end service device according to any one of claims 1 to 3, wherein at least one common service module is disposed in the main application layer unit, and the common service module is configured to provide common capabilities for the service modules, and the common capabilities are configured to support corresponding user interaction operations.
5. The micro front-end service device of claim 4, wherein the common service module comprises: at least one of an account management module, a rights management module, and a menu management module.
6. The micro front-end service device according to any one of claims 1 to 3, further comprising: a basic service layer unit;
the basic service layer unit is configured with a basic service module, the basic service module is used for providing basic capability for the service module, and the basic capability is used for supporting the operation management of the service module.
7. The micro front-end service device according to any one of claims 1 to 3, further comprising: the rear end is connected with an interface;
the back-end connection interface is used for requesting the data file to a background server corresponding to each service module.
8. A micro front-end service application method is applied to a micro front-end service device, and the micro front-end service device comprises: the system comprises a main application layer unit and a sub application layer unit, wherein at least one service module is arranged in the sub application layer unit and is used for bearing service contents of corresponding services; the method comprises the following steps:
After the main application layer unit obtains an access instruction, the access instruction is forwarded to a corresponding target service module in the sub application layer unit by using a central registry in the main application layer unit;
and loading the data file of the target service module to the main application unit.
9. The micro front-end service application method according to claim 8, wherein the forwarding the access instruction to the corresponding target business module in the sub application layer unit by using the central registry in the main application layer unit comprises:
and matching the access instruction to the target service module by using the central registry through a sub-application management module in the main application layer unit so as to load a static file of the target service module.
10. The micro front-end service application method according to claim 9, further comprising, after the loading the data file of the target business module to the main application unit:
and displaying the page of the main application unit loaded with the static file in a user access layer unit.
11. The micro front-end service application method according to any one of claims 8 to 10, further comprising:
And responding to user interaction operation, calling a target public service module in the main application layer unit, wherein the target public service module is a public service module corresponding to the user interaction operation in the main application layer unit, the public service module is used for providing public capability for the business module, and the public capability is used for supporting corresponding user interaction operation.
12. The micro front-end services application method of claim 11, wherein the common services module comprises: at least one of an account management module, a rights management module, and a menu management module.
13. The micro front-end service application method according to any one of claims 8 to 10, further comprising:
and responding to a service management instruction, calling a basic service module in the main application layer unit, wherein the basic service module is a basic service module corresponding to the service management instruction in the main application layer unit, and the basic service module is used for providing basic capability for the service module, and the basic capability is used for supporting the operation management of the service module.
14. The micro front-end service application method according to any one of claims 8 to 10, further comprising:
And responding to the access instruction, and requesting the data file from the background server corresponding to each service module through a back-end connection interface.
15. An electronic device, comprising:
a processor; and
a memory for storing a computer program for the processor;
wherein the processor is configured to implement the functions of the units in the micro front-end service device of any one of claims 1 to 7 by executing the computer program.
16. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the micro front-end service application method of any one of claims 8 to 14.
17. A computer program product comprising a computer program, characterized in that the computer program, when being executed by a processor, implements the micro front end service application method of any of claims 8 to 14.
CN202011573414.5A 2020-12-24 2020-12-24 Micro front-end service application method and device, storage medium and electronic equipment Pending CN114679491A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011573414.5A CN114679491A (en) 2020-12-24 2020-12-24 Micro front-end service application method and device, storage medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011573414.5A CN114679491A (en) 2020-12-24 2020-12-24 Micro front-end service application method and device, storage medium and electronic equipment

Publications (1)

Publication Number Publication Date
CN114679491A true CN114679491A (en) 2022-06-28

Family

ID=82070361

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011573414.5A Pending CN114679491A (en) 2020-12-24 2020-12-24 Micro front-end service application method and device, storage medium and electronic equipment

Country Status (1)

Country Link
CN (1) CN114679491A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115857935A (en) * 2023-02-15 2023-03-28 北京微吼时代科技有限公司 Front-end development method and device independent of framework

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109189386A (en) * 2018-07-12 2019-01-11 新华三云计算技术有限公司 A kind of application access method and device based on micro services
CN110708368A (en) * 2019-09-25 2020-01-17 北京计算机技术及应用研究所 Micro front-end system and method based on routing distribution
CN111045652A (en) * 2019-12-13 2020-04-21 中国南方电网有限责任公司 Power distribution network development and service system
CN111459503A (en) * 2020-03-30 2020-07-28 北京顺达同行科技有限公司 Web front-end item deployment method, device, server and storage medium
CN111666585A (en) * 2020-04-16 2020-09-15 北京百度网讯科技有限公司 Method and device for accessing sub-application, electronic equipment and readable storage medium
CN111737032A (en) * 2020-07-27 2020-10-02 腾讯科技(深圳)有限公司 Subprogram running method and device based on microkernel system and electronic equipment
WO2020211222A1 (en) * 2019-04-15 2020-10-22 厦门市美亚柏科信息股份有限公司 Method and device for providing micro-service based on data service platform, and storage medium
CN112114784A (en) * 2020-09-21 2020-12-22 广东电网有限责任公司电力科学研究院 Single-Spa-based front-end micro-service system

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109189386A (en) * 2018-07-12 2019-01-11 新华三云计算技术有限公司 A kind of application access method and device based on micro services
WO2020211222A1 (en) * 2019-04-15 2020-10-22 厦门市美亚柏科信息股份有限公司 Method and device for providing micro-service based on data service platform, and storage medium
CN110708368A (en) * 2019-09-25 2020-01-17 北京计算机技术及应用研究所 Micro front-end system and method based on routing distribution
CN111045652A (en) * 2019-12-13 2020-04-21 中国南方电网有限责任公司 Power distribution network development and service system
CN111459503A (en) * 2020-03-30 2020-07-28 北京顺达同行科技有限公司 Web front-end item deployment method, device, server and storage medium
CN111666585A (en) * 2020-04-16 2020-09-15 北京百度网讯科技有限公司 Method and device for accessing sub-application, electronic equipment and readable storage medium
CN111737032A (en) * 2020-07-27 2020-10-02 腾讯科技(深圳)有限公司 Subprogram running method and device based on microkernel system and electronic equipment
CN112114784A (en) * 2020-09-21 2020-12-22 广东电网有限责任公司电力科学研究院 Single-Spa-based front-end micro-service system

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115857935A (en) * 2023-02-15 2023-03-28 北京微吼时代科技有限公司 Front-end development method and device independent of framework

Similar Documents

Publication Publication Date Title
US10705942B1 (en) Simulated testing of API
Wargo PhoneGap essentials: Building cross-platform mobile apps
CN107515776A (en) The uninterrupted upgrade method of business, node to be upgraded and readable storage medium storing program for executing
CN107066631A (en) Display methods, device and the electronic equipment of the page
US20060156315A1 (en) Method, computer-readable medium and apparatus for providing a graphical user interface in a client-server environment
CN110442327B (en) Application program construction method, device and server
CN104067276A (en) Client-side minimal download and simulated page navigation features
US11741002B2 (en) Test automation systems and methods using logical identifiers
CN112765023A (en) Test case generation method and device
CN111708528A (en) Method, device and equipment for generating small program and storage medium
US10540150B2 (en) Composable context menus
CN106850650B (en) Method for accessing data by game client and client game system
JP2012104150A (en) Customizing space in network environment
CN111538659B (en) Interface testing method, system, electronic equipment and storage medium of business scene
CN102135895A (en) System upgrading method and system
CN110083366B (en) Application running environment generation method and device, computing equipment and storage medium
CN114661375A (en) Application integration method and device
CN114048415A (en) Form generation method and device, electronic equipment and computer readable storage medium
CN114679491A (en) Micro front-end service application method and device, storage medium and electronic equipment
CN110599112B (en) Network page development and maintenance method and device
CN116795679A (en) Web application testing method and device, electronic equipment and storage medium
CN114911541A (en) Configuration information processing method and device, electronic equipment and storage medium
CN115292169A (en) UI automation test method and system
CN104933019B (en) A kind of method and device that list generates
CN113961298A (en) Page switching method, device, equipment and medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination