Application module multiplexing method, device, system, electronic device and storage medium

文档序号:134960 发布日期:2021-10-22 浏览:22次 中文

阅读说明:本技术 应用模块复用的方法、装置、系统、电子装置和存储介质 (Application module multiplexing method, device, system, electronic device and storage medium ) 是由 何卓凡 范渊 黄进 于 2021-07-13 设计创作,主要内容包括:本申请涉及一种应用模块复用的方法、装置、系统、电子装置和存储介质,其中,该应用模块复用的方法包括:过获取路由结构;基于该路由结构,根据预设的页面模板将单体应用拆分为至少两个原子应用;其中,该页面模板由该单体应用构建生成;该原子应用和该路由结构相对应;根据该原子应用生成模块复用结果。通过本申请,解决了应用模块复用的成本高的问题,实现了基于微前端构建的应用模块复用。(The application relates to a method, a device, a system, an electronic device and a storage medium for multiplexing an application module, wherein the method for multiplexing the application module comprises the following steps: obtaining a routing structure; splitting the single application into at least two atomic applications according to a preset page template based on the routing structure; wherein, the page template is constructed and generated by the single application; the atomic application corresponds to the routing structure; and generating a module multiplexing result according to the atomic application. By the application, the problem of high cost of application module multiplexing is solved, and application module multiplexing based on micro front-end construction is realized.)

1. A method for application module multiplexing, the method comprising:

obtaining a routing structure;

splitting a single application into at least two atomic applications according to a preset page template based on the routing structure; wherein the page template is generated by the single application construction; the atomic application corresponds to the routing structure;

and generating a module multiplexing result according to the atomic application.

2. The method of claim 1, wherein generating module multiplexing results from the atomic application comprises:

acquiring a preset main application;

acquiring an application list of the atomic application, and acquiring a target atomic application in the atomic application based on the application list;

generating a configuration file according to the target atomic application and the preset main application;

and acquiring the packaging results of the target atomic application and the main application according to the configuration file.

3. The method of claim 2, wherein the primary application comprises a first primary application and a second primary application; after the target atomic application in the atomic applications is obtained based on the application list, the method further includes:

generating a first configuration file according to the target atomic application and the first main application, and acquiring a first packing result according to the first configuration file; wherein the first packed result comprises the target atomic application and the first master application;

generating a second configuration file according to the target atomic application and the second main application, and acquiring a second packing result according to the second configuration file; wherein the second packed result includes the target atomic application and the second master application.

4. The method of claim 1, wherein the splitting a monolithic application into at least two atomic applications according to a preset page template based on the routing structure comprises:

traversing all the routing structures, and performing structure conversion processing on the routing structures based on a traversal result to obtain list routing structures after the structure conversion processing;

and generating the atomic application constructed according to the page module based on the list routing structure.

5. The method of claim 1, wherein the splitting a monolithic application into at least two atomic applications according to a preset page template based on the routing structure comprises:

acquiring the page template;

and generating an entry file by using the page template through the routing structure, and generating the atomic application based on the entry file.

6. The method according to any one of claims 1 to 5, wherein after splitting the monolithic application into at least two atomic applications according to a preset page template, the method further comprises:

and acquiring hierarchical structure information corresponding to each atomic application, and storing all the atomic applications in a blocking manner according to the hierarchical structure information.

7. An apparatus for application module multiplexing, the apparatus comprising: the system comprises a first acquisition module, a splitting module and a multiplexing module;

the first obtaining module is used for obtaining a routing structure;

the splitting module is used for splitting the single application into atomic applications according to a preset page template based on the routing structure; wherein the page template is generated by the single application construction; the atomic application corresponds to the routing structure;

and the multiplexing module is used for generating a module multiplexing result according to the atomic application.

8. A system for application module multiplexing, the system comprising: a terminal device, a transmission device and a server device; the terminal equipment is connected with the server equipment through the transmission equipment;

the terminal equipment is used for receiving the atomic application and displaying the atomic application;

the transmission device is used for transmitting the atomic application;

the server device is configured to perform the method of application module multiplexing according to any of claims 1 to 6.

9. An electronic device comprising a memory and a processor, wherein the memory has stored therein a computer program, and wherein the processor is configured to execute the computer program to perform the method of application module multiplexing according to any of claims 1 to 6.

10. A storage medium having stored thereon a computer program, wherein the computer program is arranged to perform the method of application module multiplexing of any of claims 1 to 6 when executed.

Technical Field

The present application relates to the field of computer software technologies, and in particular, to a method, an apparatus, a system, an electronic apparatus, and a storage medium for multiplexing application modules.

Background

With the rapid development of the internet, the number of users is continuously increased, and the application scale is also continuously enlarged. Maintenance and construction are also increasingly becoming an important component in application development. The advent of micro front-end technology has split a single application into multiple application modules. To save development and maintenance costs, the same application module needs to be developed in multiple applications.

In the related art, a Node Package Manager (NPM Package) is usually adopted to develop a NPM Package for a multiplexed module, and then install the NPM Package in a required application, so as to realize multiplexing of the application module. However, the method needs to install the NPM packet in each application, and each application needs to maintain the module version by itself, which has the problem of version difference; if a new application needs to be developed, the installation is also needed. And the NPM packet can be cracked with the service system during development, and is not suitable for module development strongly related to the service system, so that the multiplexing cost of the application module is higher.

At present, no effective solution is provided for the problem of high cost of application module multiplexing in the related technology.

Disclosure of Invention

The embodiment of the application provides a method, a device, a system, an electronic device and a storage medium for multiplexing an application module, so as to at least solve the problem of high cost of multiplexing the application module in the related art.

In a first aspect, an embodiment of the present application provides a method for multiplexing application modules, where the method includes:

obtaining a routing structure;

splitting a single application into at least two atomic applications according to a preset page template based on the routing structure; wherein the page template is generated by the single application construction; the atomic application corresponds to the routing structure;

and generating a module multiplexing result according to the atomic application.

In some embodiments, the generating module multiplexing results according to the atomic application comprises:

acquiring a preset main application;

acquiring an application list of the atomic application, and acquiring a target atomic application in the atomic application based on the application list;

generating a configuration file according to the target atomic application and the preset main application;

and acquiring the packaging results of the target atomic application and the main application according to the configuration file.

In some of these embodiments, the primary application comprises a first primary application and a second primary application; after the target atomic application in the atomic applications is obtained based on the application list, the method further includes:

generating a first configuration file according to the target atomic application and the first main application, and acquiring a first packing result according to the first configuration file; wherein the first packed result comprises the target atomic application and the first master application;

generating a second configuration file according to the target atomic application and the second main application, and acquiring a second packing result according to the second configuration file; wherein the second packed result includes the target atomic application and the second master application.

In some embodiments, the splitting, based on the routing structure, a monolithic application into at least two atomic applications according to a preset page template includes:

traversing all the routing structures, and performing structure conversion processing on the routing structures based on a traversal result to obtain list routing structures after the structure conversion processing;

and generating the atomic application constructed according to the page module based on the list routing structure.

In some embodiments, the splitting, based on the routing structure, a monolithic application into at least two atomic applications according to a preset page template includes:

acquiring the page template;

and generating an entry file by using the page template through the routing structure, and generating the atomic application based on the entry file.

In some embodiments, after the splitting the monolithic application into at least two atomic applications according to the preset page template, the method further includes:

and acquiring hierarchical structure information corresponding to each atomic application, and storing all the atomic applications in a blocking manner according to the hierarchical structure information.

In a second aspect, an embodiment of the present application provides an apparatus for multiplexing application modules, where the apparatus includes: the system comprises a first acquisition module, a splitting module and a multiplexing module;

the first obtaining module is used for obtaining a routing structure;

the splitting module is used for splitting the single application into atomic applications according to a preset page template based on the routing structure; wherein the page template is generated by the single application construction; the atomic application corresponds to the routing structure;

and the multiplexing module is used for generating a module multiplexing result according to the atomic application.

In a third aspect, an embodiment of the present application provides a system for multiplexing application modules, where the system includes: a terminal device, a transmission device and a server device; the terminal equipment is connected with the server equipment through the transmission equipment;

the terminal equipment is used for receiving the atomic application and displaying the atomic application;

the transmission device is used for transmitting the atomic application;

the server device is configured to perform the method for application module multiplexing as described in the first aspect above.

In a fourth aspect, an embodiment of the present application provides an electronic device, which includes a memory, a processor, and a computer program stored on the memory and executable on the processor, and when the processor executes the computer program, the method for multiplexing application modules as described in the first aspect is implemented.

In a fifth aspect, the present application provides a storage medium, on which a computer program is stored, where the program is executed by a processor to implement the method for multiplexing application modules as described in the first aspect.

Compared with the related art, the method, the device, the system, the electronic device and the storage medium for multiplexing the application module provided by the embodiment of the application module acquire the routing structure; splitting the single application into at least two atomic applications according to a preset page template based on the routing structure; wherein, the page template is constructed and generated by the single application; the atomic application corresponds to the routing structure; and generating a module multiplexing result according to the atomic application, thereby solving the problem of high multiplexing cost of the application module.

The details of one or more embodiments of the application are set forth in the accompanying drawings and the description below to provide a more thorough understanding of the application.

Drawings

The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the application and together with the description serve to explain the application and not to limit the application. In the drawings:

fig. 1 is a schematic diagram of an application scenario of an application module multiplexing method according to an embodiment of the present application;

FIG. 2 is a flow chart of a method for application module reuse according to an embodiment of the present application;

FIG. 3 is a flow chart of another method for application module reuse according to an embodiment of the present application;

FIG. 4 is a flow chart of an atomic application acquisition method according to an embodiment of the application;

FIG. 5 is a flow chart of a method of atomic application multiplexing according to an embodiment of the application;

FIG. 6 is a block diagram of an apparatus for application module multiplexing according to an embodiment of the present application;

FIG. 7 is a block diagram of a system for application module multiplexing according to an embodiment of the present application;

fig. 8 is a block diagram of the inside of a computer device according to an embodiment of the present application.

Detailed Description

In order to make the objects, technical solutions and advantages of the present application more apparent, the present application will be described and illustrated below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments provided in the present application without any inventive step are within the scope of protection of the present application. Moreover, it should be appreciated that in the development of any such actual implementation, as in any engineering or design project, numerous implementation-specific decisions must be made to achieve the developers' specific goals, such as compliance with system-related and business-related constraints, which may vary from one implementation to another.

Reference in the specification to "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment can be included in at least one embodiment of the specification. The appearances of the phrase in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. Those of ordinary skill in the art will explicitly and implicitly appreciate that the embodiments described herein may be combined with other embodiments without conflict.

Unless defined otherwise, technical or scientific terms referred to herein shall have the ordinary meaning as understood by those of ordinary skill in the art to which this application belongs. Reference to "a," "an," "the," and similar words throughout this application are not to be construed as limiting in number, and may refer to the singular or the plural. The present application is directed to the use of the terms "including," "comprising," "having," and any variations thereof, which are intended to cover non-exclusive inclusions; for example, a process, method, system, article, or apparatus that comprises a list of steps or modules (elements) is not limited to the listed steps or elements, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus. Reference to "connected," "coupled," and the like in this application is not intended to be limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. Reference herein to "a plurality" means greater than or equal to two. "and/or" describes an association relationship of associated objects, meaning that three relationships may exist, for example, "A and/or B" may mean: a exists alone, A and B exist simultaneously, and B exists alone. Reference herein to the terms "first," "second," "third," and the like, are merely to distinguish similar objects and do not denote a particular ordering for the objects.

In this embodiment, an application scenario of an application module multiplexing method is provided, and fig. 1 is a schematic diagram of an application scenario of an application module multiplexing method according to an embodiment of the present application, as shown in fig. 1, in this application environment, including a terminal device 12 and a server device 14. The terminal device 12 communicates with the server device 14 via a network. The server device 14 splits the single application into at least two atomic applications according to a preset page template based on the obtained routing structure, obtains a target atomic application and a preset main application in the atomic applications selected by the user on the configuration interface of the terminal device 12, and finally generates a packing result of the target atomic application and the main application. The terminal device 12 may be, but is not limited to, various smart phones, personal computers, notebook computers, and tablet computers, and the server device 14 may be implemented by a stand-alone server device or a server device cluster composed of a plurality of server devices.

The present embodiment provides a method for multiplexing application modules, and fig. 2 is a flowchart of a method for multiplexing application modules according to an embodiment of the present application, and as shown in fig. 2, the flowchart includes the following steps:

step S210, a routing structure is obtained.

The above-mentioned routing structure is generated according to the file structure of the project when the service project is constructed, for example, if a certain file path in the project is/users/detail, then the corresponding routing structure is/users/detail. It should be noted that the business project in this embodiment may be built based on a micro front end framework, and each route is an independent micro front end application. The front-end micro-service is a technology of the front end in the continuous development of network technology, and can split a large front-end application into a plurality of sub-applications. The problems that the single application amount is overlarge, the maintenance cost is overlarge, and the whole application needs to be reconstructed when a small part of content is changed can be solved. When different modules of different sub-applications need to be multiplexed, each module in the sub-applications can be reconstructed into a single atomic application by means of a micro front-end construction scheme during application construction, and finally, the atomic applications are assembled in a continuous integration mode to complete module multiplexing.

Step S220, based on the routing structure, splitting the single application into at least two atomic applications according to a preset page template; wherein, the page template is constructed and generated by the single application; the atomic application corresponds to the routing structure.

It should be noted that, in this embodiment, after the route structure is obtained, it may be detected whether the obtained route is legal, for example, it may be determined whether a special character is inserted into the route structure, if the special character exists, because a route error may be caused at this time, that is, a route is detected to be illegal, a terminal device program is executed, and a process of splitting a single application is ended; if it is detected that the route is legal, the plurality of atomic applications can be generated based on the routing structure. The method for generating the atom application may be as follows: acquiring the page template; and generating an entry file by using the page template through the routing structure, and generating the atomic application based on the entry file. Specifically, in the process of building a service project based on the micro front-end architecture, a page module which is edited in advance and is used for building atomic applications may be provided by the service project, the page module may select a HyperText Markup Language (HTML) page template, that is, each routing module in the routing structure uses the HTML page template to generate an atomic application, and inserts the compiled javascript and Cascading Style Sheets (CSSs) into the HTML page template to form an entry file in an HTML format, so that the javascript and CSS are packaged into the atomic application through the entry file, and each atomic application corresponds to the routing module one to one.

Step S230, generating a module multiplexing result according to the atomic application.

After the single application is split into the atomic applications with relatively small volumes, project construction based on the atomic applications can be achieved in an automatic mode, and module multiplexing results obtained through packing and delivery are achieved, so that an efficient multiplexing mode is provided, and different applications can multiplex the same modules.

In the related technology, module multiplexing is usually realized in a node-JavaScript-written software package management system, namely, an NPM package mode, and because the NPM has the problems of complex installation, splitting with a service system and the like, the multiplexing cost of an application module is higher. In the embodiment of the present application, through the above steps S210 to S230, the monolithic application is split into at least two atomic applications through the obtained routing structure and the preset page template, so that module splitting based on routing is implemented, the monolithic application can be packaged into a plurality of atomic applications in a project construction phase, multiplexing is facilitated, the problem of high cost of application module multiplexing is solved, and an application module multiplexing method based on micro front-end construction is implemented.

In some embodiments, a method for multiplexing application modules is provided, and fig. 3 is a flowchart of another method for multiplexing application modules according to an embodiment of the present application, as shown in fig. 3, the flowchart includes steps S210 and S230 shown in fig. 2, and further includes the following steps:

step S231, a preset master application is acquired.

The main application refers to a main project engineering catalog of a business project built based on a micro front end architecture. The master application may be preset in advance; if a plurality of established service items exist, a user can select a main application corresponding to one of the service items in a configuration interface displayed by the terminal equipment; and if only one business item exists, acquiring the main application of the business item.

Step S232, obtain the application list of the atomic application, and obtain the target atomic application in the atomic application based on the application list.

Specifically, all atomic applications are read and all available atomic applications are listed in a list. The available atomic application refers to an atomic application which has legal routing and HTML entry files, and each atomic application can be arranged in an application list according to a three-level structure of items, branches and modules. And after the application list is obtained, obtaining the target atomic application based on the application list. The acquisition mode of the target atom application may be: sending the application list to the terminal equipment by the processor, and displaying the application list in a configuration interface by the terminal equipment; for example, the application list may be displayed on the configuration interface in a form with a filter box and a drop-down box, so that the user may view all the available atomic applications in the drop-down box and select a desired atomic application in the filter box by interacting with the configuration interface; and at the moment, the terminal equipment takes the atom application stored in the screening box as a target atom application and sends the target atom application to the processor, so that the target atom application is obtained. It is understood that the number of the target atomic applications may be one or more.

Step S233, generating a configuration file according to the target atomic application and the preset master application; and acquiring the packaging results of the target atomic application and the main application according to the configuration file.

The mode of calling the generated atomic application by other business project applications can be realized by one construction page. Specifically, the processor may generate a configuration file of the micro front end according to the selected target atomic application and the master application; the configuration file may be generated from information and HTML entry files, such as: { name: "users/detail" }, entry: "dist/users/detail. HTML" }, i.e. the name of the configuration file is the routing information users/detail, and the entity is the HTML entry file.

In some embodiments, the primary application comprises a first primary application and a second primary application; after the step S232 is executed, the method further includes the following steps: generating a first configuration file according to the target atomic application and the first main application, and acquiring a first packing result according to the first configuration file; wherein the first packing result comprises the target atomic application and the first master application; generating a second configuration file according to the target atomic application and the second main application, and acquiring a second packing result according to the second configuration file; wherein the second packed result includes the target atomic application and the second master application. Specifically, the first master application and the second master application may be deployed in two different service projects respectively; there is a distinction in the project structure between these two business projects, but the contents of the projects can be multiplexed with one another. In the implementation of the application, the user may select the first main application or the second main application on the configuration interface of the terminal device, and if the user has selected the first main application, the processor generates a first configuration file according to the first main application and the target atomic application selected by the user after receiving a result of selecting the first main application sent by the terminal device, and performs packaging and construction according to the first configuration file. Similarly, if the user selects the second main application, the processor packages and constructs the second main application and the target atomic application after receiving a result of selecting the second main application sent by the terminal device.

Through the steps S231 to S233, the configuration file is generated by the acquired main application and the target atomic application, and the target atomic application and the main application are packaged and constructed according to the configuration file, so that other applications can be conveniently configured and taken when the project is constructed, the multiplexing efficiency of the application module is improved, and the user experience is improved.

In some embodiments, the step S220 further includes the following steps:

step S221, traversing all the routing structures, and performing structure conversion processing on the routing structures based on the traversal result to obtain a list routing structure after the structure conversion processing.

After the routing structure is obtained in step S210, the processor may traverse all routes, and store each node in the traversed routing structure in the same level, so as to convert the routes in the tree structure into a list routing structure in which all routes are in the same level, which is convenient for generating atomic applications.

Step S222, based on the list routing structure, generating the atomic application constructed according to the page module.

And after traversing to obtain the list routing structure, generating the atomic application corresponding to each layer of nodes by using the page module provided by the project.

Through the steps S221 to S222, the structure conversion processing is performed on the routing structure to obtain a routing with a list structure, so that subsequent atomic applications are generated and correspond to each file path, and the multiplexing efficiency of the application module is effectively improved.

In some embodiments, after the step S220, the method for multiplexing the application modules further includes the following steps: and acquiring hierarchical structure information corresponding to each atomic application, and storing all the atomic applications in a blocking manner according to the hierarchical structure information.

Specifically, after the single application is split into a plurality of atomic applications through the step S220, all the atomic applications may be stored according to the hierarchical structure information, so as to facilitate the call of other applications. Wherein the hierarchical structure information may include: service item information, branch information and module information; the service item information comprises an item identifier, wherein the item identifier is used for indicating a service item to which the atomic application belongs; the branch information includes a branch identification for indicating a specific branch in the project management directory to which the atomic application belongs; the module information includes information such as the name of the atomic application. The processor may obtain, based on the routing structure, content included in the hierarchical structure information corresponding to each atomic application, and further store the atomic application in blocks to the server device.

Through the embodiment, the atomic application obtained by splitting is stored in blocks based on the hierarchical structure information, so that the constructed atomic application is stored through a three-level structure of a project, a branch and a module, a user can conveniently select and configure the atomic application in a terminal interface, other applications can conveniently and efficiently call all the atomic applications, and the multiplexing efficiency of the application module is further improved.

An embodiment of the present application is described in detail below with reference to an actual application scenario, and fig. 4 is a flowchart of an atomic application obtaining method according to the embodiment of the present application, and as shown in fig. 4, the flowchart includes the following steps:

step S401 starts the process, and acquires the routing structure.

Step S402, whether the route is legal is detected. If not, the process of obtaining the atomic application is ended. After the route acquisition is finished, whether the acquired route is legal or not is detected and judged, and whether special characters are inserted or not is judged according to the judgment. If the route is illegal, the program is interrupted and the process is ended.

In step S403, if the determination result in step S402 is yes, an atomic application is generated based on the routing information. The business project provides an HTML page template for constructing the atomic application, i.e., each routing module will use the template to generate the atomic application.

Step S404, store the atom application to the server device.

The execution steps of the steps S401 to S404 are all performed on the server device, and finally, the single application is constructed into a plurality of atomic applications through the routes, each route corresponds to one atomic application, and the atomic applications are stored in the server device, thereby implementing the method for obtaining the atomic applications.

Fig. 5 is a flowchart of an atomic application multiplexing method according to an embodiment of the present application, and as shown in fig. 5, the flowchart includes the following steps:

step S501, start the process, and obtain an application list of the atomic application.

Step S502, acquiring the main application and the target atomic application that need to be constructed and selected by the user through the terminal device. Selecting an atomic application and a main application which need to be used; since the final package build needs to be built along with the master application, the master application needs to be selected in the configuration interface.

Step S503, a micro front end configuration file is generated. And generating a configuration file of the micro front end according to the selected target atomic application and the selected main application.

And step S504, packaging the main application and the target atomic application together according to the configuration file, and ending the process.

It should be noted that the steps illustrated in the above-described flow diagrams or in the flow diagrams of the figures may be performed in a computer system, such as a set of computer-executable instructions, and that, although a logical order is illustrated in the flow diagrams, in some cases, the steps illustrated or described may be performed in an order different than here. For example, in fig. 3, the above step S231 may be executed before the step S232, may be executed after the step S232, or may be executed simultaneously with the step S232.

The present embodiment further provides a device for multiplexing application modules, where the device is used to implement the foregoing embodiments and preferred embodiments, and the description of the device that has been already made is omitted. As used hereinafter, the terms "module," "unit," "subunit," and the like may implement a combination of software and/or hardware for a predetermined function. Although the means described in the embodiments below are preferably implemented in software, an implementation in hardware, or a combination of software and hardware is also possible and contemplated.

Fig. 6 is a block diagram of an apparatus for applying module multiplexing according to an embodiment of the present application, and as shown in fig. 6, the apparatus includes: a first acquisition module 62, a splitting module 64, and a multiplexing module 66. The first obtaining module 62 is configured to obtain a routing structure; the splitting module 64 is configured to split the monolithic application into the atomic applications according to a preset page template based on the routing structure; wherein, the page template is constructed and generated by the single application; the atomic application corresponds to the routing structure; the multiplexing module 66 is configured to generate a module multiplexing result according to the atomic application.

Through the embodiment, the splitting module 64 splits the single application into at least two atomic applications through the acquired routing structure and the preset page template, so that the routing-based module splitting is realized, the single application can be packaged into a plurality of atomic applications in the project construction stage, the multiplexing is facilitated, the problem of high cost of application module multiplexing is solved, and the application module multiplexing device constructed based on the micro front end is realized.

In some embodiments, the apparatus for multiplexing application modules further includes: the device comprises a second acquisition module, a list module, a configuration module and a packaging module; the second obtaining module is used for obtaining a preset main application; the list module is used for acquiring an application list of the atomic application and acquiring a target atomic application in the atomic application based on the application list; the configuration module is used for generating a configuration file according to the target atomic application and the preset main application; the packaging module is used for acquiring the packaging results of the target atomic application and the main application according to the configuration file.

In some embodiments, the primary application comprises a first primary application and a second primary application; the configuration module is further configured to generate a first configuration file according to the target atomic application and the first master application, and the packing module obtains a first packing result according to the first configuration file; wherein the first packing result comprises the target atomic application and the first master application; the configuration module generates a second configuration file according to the target atomic application and the second main application, and the packaging module acquires a second packaging result according to the second configuration file; wherein the second packed result includes the target atomic application and the second master application.

In some embodiments, the splitting module 64 is further configured to traverse all the routing structures, and perform structure transformation processing on the routing structures based on a traversal result to obtain a list routing structure after the structure transformation processing; the splitting module 64 generates the atomic application built from the page module based on the list routing structure.

In some embodiments, the splitting module 64 is further configured to obtain the page template; the splitting module 64 generates an entry file using the page template through the routing structure and generates the atomic application based on the entry file.

In some embodiments, the apparatus for multiplexing application modules further includes a storage module; the storage module is used for acquiring the hierarchical structure information corresponding to each atomic application and storing all the atomic applications in blocks according to the hierarchical structure information.

The above modules may be functional modules or program modules, and may be implemented by software or hardware. For a module implemented by hardware, the modules may be located in the same processor; or the modules can be respectively positioned in different processors in any combination.

This embodiment also provides a system for multiplexing application modules, and fig. 7 is a block diagram of a structure of a system for multiplexing application modules according to an embodiment of the present application, and as shown in fig. 7, the system includes: the terminal device 12, the transmission device 72, and the server device 14; wherein the terminal device 12 is connected to the server device 14 via the transmission device 72; the terminal device 12 is configured to receive an atomic application and display the atomic application; the transport device 72 is used to transport the atomic application; the server device 14 is configured to obtain a routing structure; the server device 14 splits the monolithic application into at least two atomic applications according to a preset page template based on the routing structure; wherein, the page template is constructed and generated by the single application; the atomic application corresponds to the routing structure; the server device 14 generates a module multiplexing result from the atomic application.

Through the embodiment, the server device 14 splits the single application into at least two atomic applications through the acquired routing structure and the preset page template, so that module splitting based on routing is realized, the single application can be packaged into a plurality of atomic applications in a project construction phase, multiplexing is facilitated, the problem of high cost of application module multiplexing is solved, and an application module multiplexing system constructed based on a micro front end is realized.

In some embodiments, the server device 14 is further configured to obtain a preset host application; the server device 14 obtains an application list of the atomic application, and obtains a target atomic application in the atomic application based on the application list; the server device 14 generates a configuration file according to the target atomic application and the preset master application; the server device 14 obtains the packaged results of the target atomic application and the primary application according to the configuration file.

In some embodiments, the primary application comprises a first primary application and a second primary application; the server device 14 is further configured to generate a first configuration file according to the target atomic application and the first main application, and obtain a first package result according to the first configuration file; wherein the first packing result comprises the target atomic application and the first master application; the server device 14 generates a second configuration file according to the target atomic application and the second master application, and obtains a second packing result according to the second configuration file; wherein the second packed result includes the target atomic application and the second master application.

In some embodiments, the server device 14 is further configured to traverse all the routing structures, and perform structure transformation processing on the routing structures based on a traversal result, so as to obtain a list routing structure after the structure transformation processing; the server device 14 generates the atomic application built from the page module based on the list routing structure.

In some embodiments, the server device 14 is further configured to obtain the page template; the server device 14 generates a portal file using the page template through the routing structure and generates the atomic application based on the portal file.

In some embodiments, the server device 14 is further configured to obtain hierarchical structure information corresponding to each of the atomic applications, and store all the atomic applications in blocks according to the hierarchical structure information.

In this embodiment, a computer device is provided, and the computer device may be a server device, and fig. 8 is a structural diagram of the inside of a computer device according to an embodiment of the present application, as shown in fig. 8. The computer device includes a processor, a memory, a network interface, and a database connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device comprises a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of an operating system and computer programs in the non-volatile storage medium. The database of the computer device is for storing an atomic application. The network interface of the computer device is used for connecting and communicating with an external terminal device through a network. The computer program is executed by a processor to implement the above-described method of application module multiplexing.

Those skilled in the art will appreciate that the architecture shown in fig. 8 is merely a block diagram of some of the structures associated with the disclosed aspects and is not intended to limit the computing devices to which the disclosed aspects apply, as particular computing devices may include more or less components than those shown, or may combine certain components, or have a different arrangement of components.

The present embodiment also provides an electronic device comprising a memory having a computer program stored therein and a processor configured to execute the computer program to perform the steps of any of the above method embodiments.

Optionally, the electronic apparatus may further include a transmission device and an input/output device, wherein the transmission device is connected to the processor, and the input/output device is connected to the processor.

Optionally, in this embodiment, the processor may be configured to execute the following steps by a computer program:

and S1, acquiring the routing structure.

S2, splitting the single application into at least two atomic applications according to a preset page template based on the routing structure; wherein, the page template is constructed and generated by the single application; the atomic application corresponds to the routing structure.

And S3, generating a module multiplexing result according to the atom application.

It should be noted that, for specific examples in this embodiment, reference may be made to examples described in the foregoing embodiments and optional implementations, and details of this embodiment are not described herein again.

In addition, in combination with the method for multiplexing the application modules in the foregoing embodiments, the embodiments of the present application may provide a storage medium to implement. The storage medium having stored thereon a computer program; the computer program, when executed by a processor, implements any of the above-described embodiments of the method for application module reuse.

It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware instructions of a computer program, which can be stored in a non-volatile computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. Any reference to memory, storage, database, or other medium used in the embodiments provided herein may include non-volatile and/or volatile memory, among others. Non-volatile memory can include read-only memory (ROM), Programmable ROM (PROM), Electrically Programmable ROM (EPROM), Electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDRSDRAM), Enhanced SDRAM (ESDRAM), Synchronous Link DRAM (SLDRAM), Rambus Direct RAM (RDRAM), direct bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).

It should be understood by those skilled in the art that various features of the above-described embodiments can be combined in any combination, and for the sake of brevity, all possible combinations of features in the above-described embodiments are not described in detail, but rather, all combinations of features which are not inconsistent with each other should be construed as being within the scope of the present disclosure.

The above-mentioned embodiments only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present patent shall be subject to the appended claims.

17页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:一种用户界面生成方法及装置

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!