[go: up one dir, main page]
More Web Proxy on the site http://driver.im/

CN114756229A - Development page generation method based on micro front end and related device thereof - Google Patents

Development page generation method based on micro front end and related device thereof Download PDF

Info

Publication number
CN114756229A
CN114756229A CN202111666563.0A CN202111666563A CN114756229A CN 114756229 A CN114756229 A CN 114756229A CN 202111666563 A CN202111666563 A CN 202111666563A CN 114756229 A CN114756229 A CN 114756229A
Authority
CN
China
Prior art keywords
sub
group
thread
module
module group
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
CN202111666563.0A
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.)
Shenzhen Zhenai Jieyun Information Technology Co ltd
Original Assignee
Shenzhen Zhenai Jieyun Information Technology 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 Shenzhen Zhenai Jieyun Information Technology Co ltd filed Critical Shenzhen Zhenai Jieyun Information Technology Co ltd
Priority to CN202111666563.0A priority Critical patent/CN114756229A/en
Publication of CN114756229A publication Critical patent/CN114756229A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/38Creation or generation of source code for implementing user interfaces
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/958Organisation or management of web site content, e.g. publishing, maintaining pages or automatic linking
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4843Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5027Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Databases & Information Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Human Computer Interaction (AREA)
  • Stored Programmes (AREA)

Abstract

The application relates to a development page generation method based on a micro front end and a related device thereof. The method comprises the following steps: detecting the connection state of a system, and running a preset deployment script to determine a sub-module group when detecting the connection of a user; calling a node screening thread group to operate the sub-module group; acquiring a common module group corresponding to the preset deployment script, and calling webpack to pack the common module group and the sub-module groups to obtain an environment deployment package; and executing page rendering according to the environment deployment package to generate a development page. The embodiment of the application has the advantage of improving the deployment efficiency of the front-end development environment.

Description

Development page generation method based on micro front end and related device thereof
Technical Field
The present application relates to the field of front-end technologies, and in particular, to a development page generation method based on a micro front-end and a related apparatus thereof.
Background
With the development of internet technology, internet products are coming out endlessly, the front end is used as an important component of the internet products, and with the increase of products and business projects, the front end needs to develop new projects while maintaining old projects.
In the traditional front-end technology, when front-end technicians carry out front-end development, the projects are constructed and packaged locally and then are pushed to a server, but only one module in the projects is required to be developed frequently, the project local construction and packaging in the traditional scheme can be only constructed for full packages, when the projects are overlarge, the volume of the full packages is overlarge, the construction time is overlong, and a lot of irrelevant services are constructed, so that development resources are wasted, and the development efficiency is not high.
Disclosure of Invention
The embodiment of the application provides a development page generation method based on a micro front end and a related device thereof, which are used for improving the utilization rate of front-end development resources.
In a first aspect, an embodiment of the present application provides a method for generating a development page based on a micro front end, where the system includes:
detecting the connection state of a system, and when detecting that a user is connected, running a preset deployment script to determine a sub-module group;
calling a node screening thread group to operate the sub-module group;
acquiring a common module group corresponding to the preset deployment script, and calling webpack to pack the common module group and the sub-module groups to obtain an environment deployment package;
And performing page rendering according to the environment deployment package to generate a development page.
In one embodiment, the running the sub module group on the calling node screening thread group includes: calling a node to start a thread pool, acquiring an idle thread group in an idle state from the thread pool, and acquiring the number of idle threads of the idle thread group; judging whether the idle thread number is larger than the cpu core number; if so, screening the thread group from the idle thread group, wherein the thread number contained in the thread group is equal to the cpu core number; if not, determining the idle thread group as the thread group; and running the sub-module group based on the thread group.
In one embodiment, the running the sub-module group based on the thread group includes: acquiring the number of submodules of the submodule group and the number of threads of the thread group; judging whether the number of the sub-modules is larger than the number of the threads or not; if the number of the sub-modules is larger than the number of the threads, dividing the sub-module group into a first sub-module group and a second sub-module group, wherein the number of the first sub-modules contained in the first sub-module group is consistent with the number of the threads; running the first sub-module group through the thread group; when the fact that the operation of any first submodule in the first submodule group is finished is detected, a second submodule of the second submodule group is operated through a thread corresponding to the first submodule
In one embodiment, after the invoking node screening thread group runs the sub-module group, the method further includes: and calling the sub module group through the thread group, and releasing the thread group when the calling is detected to be completed.
In one embodiment, after the calling webpack packs the common module group and the sub-module group, the method further includes: and acquiring a port number corresponding to each submodule in the submodule group through the nginx and the IP loopback address, and generating a reverse proxy port of the submodule based on the port number.
In a second aspect, an embodiment of the present application provides a development page generation apparatus based on a micro front end, where the apparatus includes:
the detection unit is used for detecting the connection state of the system, running a preset deployment script when the connection of a user is detected, and determining the sub-module group;
the thread unit is used for calling the node screening thread group to operate the sub-module group;
the packaging unit is used for acquiring a common module group corresponding to the preset deployment script, and calling webpack to package the common module group and the sub-module groups to obtain an environment deployment package;
and the rendering unit is used for executing page rendering according to the environment deployment package and generating a development page.
In a third aspect, embodiments of the present application provide a server, where the electronic device includes a processor, a memory, a communication interface, and one or more programs stored in the memory and configured to be executed by the processor, where the program includes instructions for performing some or all of the steps described in the method according to the first aspect of the embodiments of the present application.
In a fourth aspect, the present application provides a computer-readable storage medium, where the computer-readable storage medium is used to store a computer program, where the computer program is executed by a processor to implement part or all of the steps described in the method according to the first aspect of the present application.
It can be seen that, in the embodiment of the application, the electronic device detects the connection state of the system, and when detecting that a user is connected, runs a preset deployment script to determine a sub-module group; calling a node screening thread group to operate the sub-module group; acquiring a common module group corresponding to the preset deployment script, and calling webpack to pack the common module group and the sub-module groups to obtain an environment deployment package; and performing page rendering according to the environment deployment package to generate a development page. Through front-end modularization, all applications of the front end can be isolated from each other, so that a sub-module group to be developed can be determined according to a script when a user is connected, and the sub-module group is operated through a thread group, so that the starting of each sub-module group is carried out asynchronously, and the starting efficiency of a development module is improved; the public module group and the sub-module group are packed through webpack to generate the environment deployment package, so that the construction of a full package in the development process is avoided, the volume of the package is reduced, and the construction time is shortened, thereby being beneficial to improving the development efficiency and improving the utilization rate of development resources.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings used in the embodiments or the prior art descriptions will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative efforts.
FIG. 1 is a block diagram of a micro front end architecture according to an embodiment of the present disclosure;
fig. 2 is a schematic flowchart of a development page generation method based on a micro front end according to an embodiment of the present application;
fig. 3 is a schematic flowchart of another method for generating a page based on micro front-end development according to an embodiment of the present application;
fig. 4 is a schematic structural diagram of a server 400 according to an embodiment of the present application;
fig. 5 is a schematic structural diagram of a development page generating apparatus based on a micro front end according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention. All other embodiments, which can be obtained by a person skilled in the art without inventive step based on the embodiments of the present invention, are within the scope of protection of the present invention.
The terms "first," "second," "third," and "fourth," etc. in the description and claims of the invention and in the accompanying drawings are used for distinguishing between different elements and not for describing a particular sequential order. Furthermore, the terms "include" and "have," as well as any variations thereof, are intended to cover a non-exclusive inclusion. For example, a process, method, system, article, or apparatus that comprises a list of steps or elements is not limited to only those steps or elements listed, but may alternatively include other steps or elements not listed, or inherent to such process, method, article, or apparatus.
Reference herein to "an embodiment" means that a particular feature, result, or characteristic described in connection with the embodiment can be included in at least one embodiment of the invention. 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. It is explicitly and implicitly understood by one skilled in the art that the embodiments described herein may be combined with other embodiments.
Hereinafter, some terms in the present application are explained to facilitate understanding by those skilled in the art.
Electronic devices may include a variety of handheld devices, vehicle mounted devices, wearable devices (e.g., smartwatches, smartbands, pedometers, etc.), computing devices or other processing devices communicatively connected to wireless modems, as well as various forms of User Equipment (UE), Mobile Stations (MS), terminal Equipment (terminal device), and so forth having wireless communication capabilities. For convenience of description, the above-mentioned devices are collectively referred to as electronic devices.
Referring to fig. 1, fig. 1 is a schematic architecture diagram of a micro front end architecture for implementing a development page generation method based on a micro front end according to an embodiment of the present disclosure, where as shown in the figure, the micro front end architecture includes a main module, a registration module, sub-modules, a routing registry, and a rendering module; the main module is used for being connected with a user and receiving the injection of the public module, the public module is injected into the registration module, the registration module is used for carrying out module registration on the public module and the sub-modules to generate a routing registration table, the routing registration table is used for providing routing information for the rendering module, and the rendering module is used for executing page rendering based on the public module and the sub-modules to generate a development page.
As shown in fig. 2, fig. 2 is a schematic flowchart of a development page generation method based on a micro front end according to an embodiment of the present application, where the method is applied to the micro front end architecture in fig. 1, and includes the following steps:
step 201, detecting the connection state of a system, and when detecting the connection of a user, running a preset deployment script to determine a sub-module group;
optionally, when detecting a user connection, obtaining user information corresponding to the user, where the user information includes: the method comprises the steps of obtaining a deployment script corresponding to a user based on user identity information, obtaining a development deployment script if the user identity information is a developer, wherein the development deployment script is used for constructing a development environment, and operating the development deployment script to determine a development sub-module group.
Therefore, the user identity can be determined through the user information, the sub-module group needing to be loaded is determined based on the user identity, the development page is constructed based on the sub-module group needing to be loaded, construction of a development environment deployment full package is avoided, the size of the environment deployment package is reduced, the construction time of the development environment is shortened, and the front-end development efficiency is improved.
Step 202, calling a node screening thread group to operate the sub-module group;
optionally, the calling the node screening thread group to run the sub-module group includes: calling a node to start a thread pool, acquiring an idle thread group in an idle state from the thread pool, and acquiring the number of idle threads of the idle thread group; judging whether the idle thread number is larger than the cpu core number; if so, screening the thread group from the idle thread group, wherein the thread number contained in the thread group is equal to the cpu core number; if not, determining the idle thread group as the thread group; and running the sub-module group based on the thread group.
Further, screening the thread group from the idle thread group includes: and randomly selecting a plurality of threads corresponding to the cpu core number from the idle thread group to form the thread group.
Optionally, the running the sub-module group based on the thread group includes: acquiring the number of submodules of the submodule group and the number of threads of the thread group; judging whether the number of the sub-modules is larger than the number of the threads or not; if the number of the sub-modules is larger than the number of the threads, dividing the sub-module group into a first sub-module group and a second sub-module group, wherein the number of the first sub-modules contained in the first sub-module group is consistent with the number of the threads; running the first sub-module group through the thread group; and when the fact that the operation of any first submodule in the first submodule group is finished is detected, operating a second submodule of the second submodule group through a thread corresponding to the first submodule.
The thread pool is an asynchronous thread pool, each thread is used for starting a sub-module, and each thread starts an express service at the same time, the express service is used for suspending a hot update tool, and the hot update tool is used for automatically updating the code when a developer modifies the code.
Further, when it is detected that the operation of any first sub-module in the first sub-module group is finished, operating a second sub-module of the second sub-module group through a thread corresponding to the first sub-module, including: and controlling the thread to start the first sub-module through a promise mode, wherein the promise mode is an asynchronous programming mode, executing a task in the promise mode and obtaining an evidence object for obtaining the task execution result, obtaining the execution result through the evidence object when the thread task is executed, and continuously controlling the thread to start the second sub-module through the promise mode when the execution result is obtained.
Optionally, after the node screening thread group is called to run the sub-module group, the method further includes: and releasing the thread group when the completion of the calling of the sub-module group is detected.
So, select the thread number based on the cpu core number, ensure that the thread number that is in the running state is less than the cpu core number, thereby ensure asynchronous execution between each process, avoid many processes to influence each other, and, when the submodule number is greater than the thread number, through the progress control thread group, the submodule is started in batches, thereby ensure that the thread number that is in the running state is less than or equal to the cpu core number, thereby avoid because too much of thread leads to the server to block up, thereby be favorable to improving development environment and deploy efficiency.
Step 203, obtaining a common module group corresponding to the preset deployment script, and calling webpack to pack the common module group and the sub-module groups to obtain an environment deployment package;
optionally, after the webpack is called to pack the common module group and the sub-module group, the method further includes: and acquiring a port number corresponding to each submodule in the submodule group through the nginx and the IP loopback address, and generating a reverse proxy port of the submodule based on the port number.
Therefore, the submodule can be directly accessed through the reverse proxy port of the submodule, so that the operating submodule can be protected while the development environment is deployed, and the stability of the development environment based on micro front-end deployment is improved.
And 204, performing page rendering according to the environment deployment package to generate a development page.
It can be seen that, in the embodiment of the application, the electronic device detects the connection state of the system, and when detecting that a user is connected, runs a preset deployment script to determine a sub-module group; calling a node screening thread group to operate the sub-module group; acquiring a common module group corresponding to the preset deployment script, and calling webpack to pack the common module group and the sub-module groups to obtain an environment deployment package; and performing page rendering according to the environment deployment package to generate a development page. Through front-end modularization, all applications of a front end can be isolated from each other, so that a sub-module group required to be developed can be determined according to a script when a user is connected, and the sub-module group is operated through a thread group, so that the starting of each sub-module group is asynchronously carried out, and the starting efficiency of a development module is improved; the public module group and the sub-module group are packed through webpack to generate the environment deployment package, so that the construction of a full package in the development process is avoided, the volume of the package is reduced, and the construction time is shortened, thereby being beneficial to improving the development efficiency and improving the utilization rate of development resources.
It should be understood that, although the steps in the flowchart of fig. 2 are shown in order as indicated by the arrows, the steps are not necessarily performed in order as indicated by the arrows. The steps are not limited to being performed in the exact order illustrated and, unless explicitly stated herein, may be performed in other orders. Moreover, at least a portion of the steps in fig. 2 may include multiple sub-steps or multiple stages that are not necessarily performed at the same time, but may be performed at different times, and the order of performance of the sub-steps or stages is not necessarily sequential, but may be performed in turn or alternately with other steps or at least a portion of the sub-steps or stages of other steps.
Referring to fig. 3, fig. 3 is a schematic flowchart of another micro front-end development page generation method according to an embodiment of the present disclosure. As shown in the figure, when a user is connected, a script corresponding to the user is obtained, the script is run, a sub-module group needing to be loaded is obtained, wherein the sub-module group comprises at least one sub-module, multithreading is started through a node, an asynchronous thread pool is started, a thread group is screened out based on the asynchronous thread pool and a cpu core number, the thread group comprises at least one thread, each thread in the thread group is in an idle state, the idle state indicates that the thread is not in a task execution state and does not have a task to be executed, the I/0 startup sub-module group is executed through the thread group, when the calling of the thread group is finished, the IOCP is informed to release the thread after the calling is finished, after the starting of the sub-module group is finished, reverse proxy is carried out on the sub-module group through a nignx multi-port, a common module is obtained, the webpack is called to compile and pack the sub-module group and the common module, and an environment deployment package is obtained, and performing page rendering based on the environment deployment package to generate a development page.
Referring to fig. 4, fig. 4 is a schematic structural diagram of a server 400 according to an embodiment of the present application, and as shown in the figure, the server 400 includes an application processor 410, a memory 420, a communication interface 430, and one or more programs 421, where the one or more programs 421 are stored in the memory 420 and configured to be executed by the application processor 410, and the one or more programs 421 include instructions for:
detecting the connection state of a system, and running a preset deployment script to determine a sub-module group when detecting the connection of a user;
calling a node screening thread group to operate the sub-module group;
acquiring a common module group corresponding to the preset deployment script, and calling webpack to pack the common module group and the sub-module groups to obtain an environment deployment package;
and performing page rendering according to the environment deployment package to generate a development page.
It can be seen that, in the embodiment of the application, the electronic device detects the connection state of the system, and when detecting that the user is connected, runs the preset deployment script to determine the sub-module group; calling a node screening thread group to operate the sub-module group; acquiring a common module group corresponding to the preset deployment script, and calling webpack to pack the common module group and the sub-module groups to obtain an environment deployment package; and executing page rendering according to the environment deployment package to generate a development page. Through front-end modularization, all applications of the front end can be isolated from each other, so that a sub-module group to be developed can be determined according to a script when a user is connected, and the sub-module group is operated through a thread group, so that the starting of each sub-module group is carried out asynchronously, and the starting efficiency of a development module is improved; the public module group and the sub-module group are packed through webpack to generate the environment deployment package, so that the construction of a full package in the development process is avoided, the volume of the package is reduced, and the construction time is shortened, thereby being beneficial to improving the development efficiency and improving the utilization rate of development resources.
In a possible example, the calling node screening thread group runs the sub-module group, and the instructions in the program are specifically configured to perform the following operations: calling a node to start a thread pool, acquiring an idle thread group in an idle state from the thread pool, and acquiring the number of idle threads of the idle thread group; judging whether the idle thread number is larger than the cpu core number; if so, screening the thread group from the idle thread group, wherein the thread number contained in the thread group is equal to the cpu core number; if not, determining the idle thread group as the thread group; and running the sub-module group based on the thread group.
In a possible example, the running the sub-module group based on the thread group, the instructions in the program are specifically configured to: acquiring the number of submodules of the submodule group and the number of threads of the thread group; judging whether the number of the sub-modules is larger than the number of the threads or not; if the number of the sub-modules is larger than the number of the threads, dividing the sub-module group into a first sub-module group and a second sub-module group, wherein the number of the first sub-modules contained in the first sub-module group is consistent with the number of the threads; running the first sub-module group through the thread group; and when the fact that the operation of any first submodule in the first submodule group is finished is detected, operating a second submodule of the second submodule group through a thread corresponding to the first submodule.
In a possible example, after the calling node screening thread group runs the sub-module group, the instructions in the program are further configured to: and releasing the thread group when the completion of the calling of the sub-module group is detected.
In a possible example, after the calling webpack packs the common module group and the sub-module group, the fingers in the program are further configured to: and acquiring a port number corresponding to each submodule in the submodule group through the nginx and the IP loopback address, and generating a reverse proxy port of the submodule based on the port number.
The above description has introduced the solution of the embodiment of the present application mainly from the perspective of the method-side implementation process. It is understood that the electronic device comprises corresponding hardware structures and/or software modules for performing the respective functions in order to realize the functions. Those of skill in the art will readily appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as hardware or combinations of hardware and computer software. Whether a function is performed in hardware or computer software drives hardware depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
In the embodiment of the present application, the electronic device may be divided into the functional units according to the method example, for example, each functional unit may be divided corresponding to each function, or two or more functions may be integrated into one control unit. The integrated unit may be implemented in the form of hardware, or may also be implemented in the form of a software functional unit. It should be noted that, in the embodiment of the present application, the division of the unit is schematic, and is only one logic function division, and when the actual implementation is realized, another division manner may be provided.
Referring to fig. 5, fig. 5 is a schematic structural diagram of a development page generating device based on a micro front end according to an embodiment of the present disclosure, including a detecting unit 501, a thread unit 502, a packing unit 503, and a rendering unit 504, where:
the detecting unit 501 is configured to detect a system connection state, run a preset deployment script when detecting that a user is connected, and determine a sub-module group;
a thread unit 502, configured to invoke a node screening thread group to run the sub-module group;
a packing unit 503, configured to obtain a common module group corresponding to the preset deployment script, and call webpack to pack the common module group and the sub-module groups, so as to obtain an environment deployment package;
And a rendering unit 504, configured to perform page rendering according to the environment deployment package, and generate a development page.
It can be seen that, in the embodiment of the application, the electronic device detects the connection state of the system, and when detecting that a user is connected, runs a preset deployment script to determine a sub-module group; calling a node screening thread group to operate the sub-module group; acquiring a common module group corresponding to the preset deployment script, and calling webpack to pack the common module group and the sub-module groups to obtain an environment deployment package; and performing page rendering according to the environment deployment package to generate a development page. Through front-end modularization, all applications of a front end can be isolated from each other, so that a sub-module group required to be developed can be determined according to a script when a user is connected, and the sub-module group is operated through a thread group, so that the starting of each sub-module group is asynchronously carried out, and the starting efficiency of a development module is improved; the public module group and the sub-module group are packed through the webpack to generate the environment deployment package, so that the construction of a full package in the development process is avoided, the volume of the package is reduced, and the construction time is shortened, thereby being beneficial to improving the development efficiency and improving the utilization rate of development resources.
In a possible example, in terms of invoking the node screening thread group to run the sub-module group, the thread unit 502 is specifically configured to: calling a node to start a thread pool, acquiring an idle thread group in an idle state from the thread pool, and acquiring the number of idle threads of the idle thread group; judging whether the idle thread number is larger than the cpu core number; if the number of the idle thread groups is larger than the preset number, screening the thread groups from the idle thread groups, wherein the number of the threads contained in the thread groups is equal to the number of the CPU cores; if not, determining the idle thread group as the thread group; and running the sub-module group based on the thread group.
In a possible example, in the aspect of running the sub-module group based on the thread group, the thread unit 502 is specifically configured to: acquiring the number of submodules of the submodule group and the number of threads of the thread group; judging whether the number of the sub-modules is larger than the number of the threads or not; if the sub-module number is larger than the thread number, dividing the sub-module group into a first sub-module group and a second sub-module group, wherein the first sub-module number contained in the first sub-module group is consistent with the thread number; running the first sub-module group through the thread group; and when the fact that the operation of any first submodule in the first submodule group is finished is detected, operating a second submodule of the second submodule group through a thread corresponding to the first submodule.
In a possible example, in terms of the calling node screening thread group running the sub-module group, the thread unit 502 is specifically configured to: and releasing the thread group when the completion of the calling of the sub-module group is detected.
In a possible example, in terms of the packing of the common module group and the sub-module group by the invocation webpack, the packing unit 503 is specifically configured to: and acquiring a port number corresponding to each submodule in the submodule group through nginx and an IP loopback address, and generating a reverse proxy port of the submodule based on the port number.
Embodiments of the present application also provide a computer storage medium, where the computer storage medium stores a computer program for electronic data exchange, the computer program enabling a computer to execute part or all of the steps of any one of the methods described in the above method embodiments, and the computer includes an electronic device.
Embodiments of the present application also provide a computer program product comprising a non-transitory computer readable storage medium storing a computer program operable to cause a computer to perform some or all of the steps of any of the methods as described in the above method embodiments. The computer program product may be a software installation package, the computer comprising an electronic device.
It should be noted that for simplicity of description, the above-mentioned embodiments of the method are described as a series of acts, but those skilled in the art should understand that the present application is not limited by the described order of acts, as some steps may be performed in other orders or simultaneously according to the present application. Further, those skilled in the art will recognize that the embodiments described in this specification are preferred embodiments and that acts or modules referred to are not necessarily required for this application.
In the foregoing embodiments, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to the related descriptions of other embodiments.
In the several embodiments provided in the present application, it should be understood that the disclosed apparatus may be implemented in other manners. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the above-described units is only one type of logical functional division, and other divisions may be realized in practice, for example, multiple units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed coupling or direct coupling or communication connection between each other may be through some interfaces, indirect coupling or communication connection between devices or units, and may be in an electrical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit may be implemented in the form of hardware, or may also be implemented in the form of a software functional unit.
The integrated unit may be stored in a computer readable memory if it is implemented in the form of a software functional unit and sold or used as a stand-alone product. Based on such understanding, the technical solution of the present application may be substantially implemented or a part of or all or part of the technical solution contributing to the prior art may be embodied in the form of a software product stored in a memory, and including several instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the above-mentioned method of the embodiments of the present application. And the aforementioned memory comprises: a U-disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a removable hard disk, a magnetic or optical disk, and other various media capable of storing program codes.
Those skilled in the art will appreciate that all or part of the steps of the methods of the above embodiments may be implemented by a program, which is stored in a computer-readable memory, the memory including: flash Memory disks, Read-Only memories (ROMs), Random Access Memories (RAMs), magnetic or optical disks, and the like.
The foregoing detailed description of the embodiments of the present application has been presented to illustrate the principles and implementations of the present application, and the above description of the embodiments is only provided to help understand the method and the core concept of the present application; meanwhile, for a person skilled in the art, according to the idea of the present application, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present application.

Claims (10)

1. A development page generation method based on a micro front end is characterized in that the system comprises the following steps:
detecting the connection state of a system, and running a preset deployment script to determine a sub-module group when detecting the connection of a user;
Calling a node screening thread group to operate the sub-module group;
acquiring a common module group corresponding to the preset deployment script, and calling webpack to pack the common module group and the sub-module groups to obtain an environment deployment package;
and performing page rendering according to the environment deployment package to generate a development page.
2. The method of claim 1, wherein running the sub-module group on a calling node screening thread group comprises:
calling a node to start a thread pool, acquiring an idle thread group in an idle state from the thread pool, and acquiring the number of idle threads of the idle thread group;
judging whether the idle thread number is larger than the cpu core number;
if so, screening the thread group from the idle thread group, wherein the thread number contained in the thread group is equal to the cpu core number;
if not, determining the idle thread group as the thread group;
and running the sub-module group based on the thread group.
3. The method of claim 2, wherein the running the set of submodules based on the set of threads comprises:
acquiring the number of submodules of the submodule group and the number of threads of the thread group;
Judging whether the number of the sub-modules is larger than the number of the threads or not;
if the sub-module number is larger than the thread number, dividing the sub-module group into a first sub-module group and a second sub-module group, wherein the first sub-module number contained in the first sub-module group is consistent with the thread number
Running the first sub-module group through the thread group;
and when the fact that the operation of any first sub-module in the first sub-module group is finished is detected, operating a second sub-module of the second sub-module group through a thread corresponding to the first sub-module.
4. The method of claim 1, wherein after the invoking node screening thread group runs the sub-module group, further comprising:
and releasing the thread group when the completion of the calling of the sub-module group is detected.
5. The method of claim 1, wherein after the calling webpack packs the common module group and the sub-module groups, further comprising:
and acquiring a port number corresponding to each submodule in the submodule group through the nginx and the IP loopback address, and generating a reverse proxy port of the submodule based on the port number.
6. A micro front end based development page generation apparatus, the apparatus comprising:
The detection unit is used for detecting the connection state of the system, running a preset deployment script when the connection of a user is detected, and determining the sub-module group;
the thread unit is used for calling the node screening thread group to operate the sub-module group;
the packaging unit is used for acquiring a common module group corresponding to the preset deployment script, and calling webpack to package the common module group and the sub-module groups to obtain an environment deployment package;
and the rendering unit is used for executing page rendering according to the environment deployment package and generating a development page.
7. The apparatus of claim 1, wherein the thread unit is further configured to:
and calling the sub module group through the thread group, and releasing the thread group when the calling is detected to be completed.
8. The apparatus of claim 1, further comprising:
and the reverse proxy unit is used for acquiring the port number corresponding to each submodule in the submodule group through the nginx and the IP loopback address and generating a reverse proxy port of the submodule based on the port number.
9. An electronic device comprising a processor, a memory, a communication interface, and one or more programs stored in the memory and configured to be executed by the processor, the programs comprising instructions for performing the steps in the method of any of claims 1-5.
10. A computer-readable storage medium, characterized in that it stores a computer program which is executed by a processor to implement the method of any one of claims 1 to 5.
CN202111666563.0A 2021-12-31 2021-12-31 Development page generation method based on micro front end and related device thereof Pending CN114756229A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111666563.0A CN114756229A (en) 2021-12-31 2021-12-31 Development page generation method based on micro front end and related device thereof

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111666563.0A CN114756229A (en) 2021-12-31 2021-12-31 Development page generation method based on micro front end and related device thereof

Publications (1)

Publication Number Publication Date
CN114756229A true CN114756229A (en) 2022-07-15

Family

ID=82325858

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111666563.0A Pending CN114756229A (en) 2021-12-31 2021-12-31 Development page generation method based on micro front end and related device thereof

Country Status (1)

Country Link
CN (1) CN114756229A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20220374225A1 (en) * 2018-12-18 2022-11-24 Palantir Technologies Inc. Systems and methods for coordinating the deployment of components to defined user groups

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20220374225A1 (en) * 2018-12-18 2022-11-24 Palantir Technologies Inc. Systems and methods for coordinating the deployment of components to defined user groups
US11762652B2 (en) * 2018-12-18 2023-09-19 Palantir Technologies Inc. Systems and methods for coordinating the deployment of components to defined user groups

Similar Documents

Publication Publication Date Title
EP2966566B1 (en) Driver program loading method and embedded device
CN108121594B (en) Process management method and device
CN107203419A (en) Intermodule call method, apparatus and system in application program
CN109933350B (en) Method and device for embedding codes in application and electronic equipment
CN106844213A (en) A kind of front end method of testing and device
CN109582385A (en) Application program launching method and device, storage medium and electronic equipment
CN110825448A (en) Method, device, electronic equipment and storage medium for realizing mutual calling of multiple service modules
CN111143034B (en) Method, device and system for controlling network data forwarding plane
CN108509273A (en) A kind of internal memory processing method and device
CN111865978B (en) Method, device, equipment and medium for updating request identifier of micro-service
CN113467905A (en) Task processing method and system
CN114756229A (en) Development page generation method based on micro front end and related device thereof
CN112882794A (en) pod capacity expansion method, device, node and storage medium
CN107526636B (en) Resource identification method and device
CN115729673A (en) Cluster management method, management module, electronic device and medium
CN109976751A (en) Model manipulation method, relevant apparatus and computer-readable medium
CN108228310B (en) Balanced deployment method and device of virtual network function
CN107450907A (en) Compatibility method, mobile terminal and the device with store function of fingerprint module
CN112738181A (en) Method, device and server for cluster external IP access
CN114416219B (en) System function calling method, device, electronic equipment and readable medium
CN105550050A (en) Hardware communication method and apparatus
CN113961194B (en) Flutter cross-application-based engineering construction method, system, terminal and medium
CN116009898A (en) State determination method, device, equipment and medium for K8s deployment task
CN113971073A (en) Data calling method and device, electronic equipment and computer storage medium
CN114756379A (en) Method and system for task training based on hybrid accelerator card

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