Operation method and device of micro-front-end item and related equipment

By deploying the file system on a proxy server, receiving and executing browser operation requests, and directly operating micro front-end projects in the file system, the problem of low operation efficiency in the prior art is solved, the process is simplified and efficiency is improved.

CN119127306APending Publication Date: 2024-12-13BEIJING QIYI CENTURY SCI & TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411232813.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-04
Publication Date
2024-12-13

AI Technical Summary

Technical Problem

In the prior art, the operation efficiency of micro front-end projects is low, mainly due to the complex environment configuration and the steep command line learning curve, resulting in complex and multi-step operations.

Method used

By deploying the file system on the proxy server, receiving the browser's operation requests, generating and executing operation instructions, directly operating the target micro front-end project in the file system, and sending the execution results to the browser to display, simplifying the operation process.

Benefits of technology

It realizes direct operation of micro front-end projects in the browser, reducing operation steps, improving operation efficiency, reducing complexity and resource usage.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119127306A_ABST
    Figure CN119127306A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides an operation method and device of a micro-front-end project and related equipment, the operation method and device are applied to a proxy server, a file system is deployed on the proxy server, and the method comprises the steps that an operation request sent by a browser is received; generating an operation instruction according to the target micro-front-end item and the operation content; obtaining an execution result of the operation instruction according to the operation instruction; and sending the execution result to the browser for display. The operation request generated by the browser is received, the operation instruction is generated according to the operation request, the target micro-front-end item selected according to the operation option is operated in the file system of the proxy server, the execution result is obtained, and the execution result is displayed in the browser. Therefore, the micro-front-end item is directly operated in the browser, the operation process is reduced, the problem that in the prior art, the efficiency of operating the micro-front-end item is low is solved, and the efficiency of operating the micro-front-end item is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of micro-frontend technology, and in particular to an operation method, device and related equipment of a micro-frontend project. Background Art

[0002] Micro-frontend projects are a front-end architecture style that belongs to the microservice architecture. Currently, when developers perform batch iteration or modification on micro-frontend projects, they mainly rely on command lines or integrated development environments (IDEs) to operate local projects. Specific operations on micro-frontend projects include code writing, version control, service startup, and other operations. In the prior art, due to the complex environment configuration, steep command line learning curve, and the IDE occupying more system resources, the operation of micro-frontend projects is complicated and there are many operation processes, resulting in low efficiency in operating micro-frontend projects. Summary of the invention

[0003] The purpose of the embodiment of the present invention is to provide a method, device and related equipment for operating a micro front-end project, so as to improve the efficiency of operating a micro front-end project. The specific technical solution is as follows:

[0004] In a first aspect of the implementation of the present invention, a method for operating a micro-frontend project is first provided, which is applied to a proxy server, and a file system is deployed on the proxy server. The method includes:

[0005] Receive an operation request sent by a browser, the operation request including a target micro-frontend project and operation content determined based on an operation option of the browser, the file system including the target micro-frontend project, the operation option including a plurality of selectable micro-frontend projects and the operation content, and the target micro-frontend project is at least one of the plurality of micro-frontend projects;

[0006] Generate an operation instruction according to the target micro-frontend project and the operation content, wherein the operation instruction is used to execute the operation content on the target micro-frontend project;

[0007] Performing an operation on the target micro-frontend project according to the operation instruction to obtain an execution result of the operation instruction, where the execution result is used to indicate whether the execution of the operation instruction is successful;

[0008] The execution result is sent to the browser for display.

[0009] Optionally, before receiving the operation request sent by the browser, the method further includes:

[0010] Receive an add request sent by the browser, where the add request includes multiple path information, where the multiple path information is used to indicate storage locations of multiple micro-frontend projects in the file system;

[0011] Execute a read instruction on the multiple micro-frontend projects according to the add request to obtain multiple project information, where the multiple project information is used to indicate project content and project size of the multiple micro-frontend projects, and the read instruction is used to read the multiple micro-frontend projects in the file system;

[0012] The plurality of project information is sent to the browser for display.

[0013] Optionally, after sending the plurality of project information to the browser for display, the method further includes:

[0014] Determine, according to the multiple micro-frontend projects, multiple candidate operation codes matching the multiple micro-frontend projects, wherein the multiple candidate operation codes are used to generate operation instructions for operating the multiple micro-frontend projects;

[0015] The multiple candidate operation codes are packaged and saved to obtain multiple candidate operation instructions, and the operation instruction is at least one of the multiple candidate operation instructions.

[0016] Optionally, executing the operation instruction on the target micro-frontend project to obtain the execution result of the operation instruction includes:

[0017] Matching the multiple candidate operation instructions according to the operation request, and determining the operation instruction corresponding to the operation request among the multiple candidate operation instructions;

[0018] Querying the target storage location of the target micro-frontend project in the file system according to the operation request, where the target storage location is the storage address of the target micro-frontend project in the file system;

[0019] Based on the storage location, the operation instruction is executed on the target micro-frontend project to obtain an execution result of the operation instruction.

[0020] Optionally, after performing the operation on the target micro-frontend project according to the operation instruction and obtaining the execution result of the operation instruction, the method further includes:

[0021] Generate a modification instruction based on the execution result, where the modification instruction is used to update the execution result in the target micro-frontend project;

[0022] Modify the target micro-frontend project according to the modification instruction, and obtain a modification result of the modification instruction, where the modification result is used to indicate whether the execution result is successfully updated;

[0023] Sending a code push request to a code control system based on the modification result, the code control system including the target micro-frontend project that has not been operated according to the operation instruction, the code push request being used to update the target micro-frontend project that has not been operated according to the operation instruction in the code control system;

[0024] Receiving a push result sent by the code control system, the push result is used to indicate whether the code push request is executed successfully;

[0025] The execution result and the push result are sent to the browser for display.

[0026] Optionally, sending the execution result and the push result to the browser for display includes:

[0027] When the push result indicates that the code push request is successfully executed, an update request is sent to the code control system, where the update request is used to update the target micro-frontend project and is saved in the code control system;

[0028] Receive an update link generated by the code control system based on the update request, where the update link is used to update the target micro-frontend project in the code control system;

[0029] Based on the update link, the target micro-frontend project is updated in the code control system, and an update result is generated;

[0030] The execution result and the update result are sent to the browser for display.

[0031] In a second aspect of the implementation of the present invention, there is also provided an operating device for a micro-frontend project, which is applied to a proxy server, on which a file system is deployed, and the device includes:

[0032] A receiving module, configured to receive an operation request sent by a browser, wherein the operation request includes a target micro-frontend project and an operation content determined based on an operation option of the browser, the file system includes the target micro-frontend project, the operation option includes a plurality of selectable micro-frontend projects and the operation content, and the target micro-frontend project is at least one of the plurality of micro-frontend projects;

[0033] A generation module, used to generate an operation instruction according to the target micro-frontend project and the operation content, wherein the operation instruction is used to execute the operation content on the target micro-frontend project;

[0034] An execution module, used to perform an operation on the target micro-frontend project according to the operation instruction, and obtain an execution result of the operation instruction, wherein the execution result is used to indicate whether the execution of the operation instruction is successful;

[0035] The sending module is used to send the execution result to the browser for display.

[0036] In a third aspect of an embodiment of the present application, an electronic device is also provided, comprising a processor, a memory, and a program or instruction stored in the memory and executable on the processor, wherein when the program or instruction is executed by the processor, the steps of the operating method of the micro-front-end project as described in any one of the first aspects are implemented.

[0037] In a fourth aspect of an embodiment of the present application, a computer-readable storage medium is further provided, on which a program or instruction is stored. When the program or instruction is executed by a processor, the steps of the operating method of the micro-front-end project as described in any one of the first aspects are implemented.

[0038] In a fifth aspect of an embodiment of the present application, an embodiment of the present application further provides a computer program product, which is stored in a storage medium and is executed by at least one processor to implement the steps of the operating method of a micro-frontend project as described in any one of the first aspects.

[0039] The embodiment of the present invention provides an operation method, device and related equipment of a micro-frontend project, which is applied to a proxy server, and a file system is deployed on the proxy server. The method includes: receiving an operation request sent by a browser, the operation request includes a target micro-frontend project and an operation content determined based on the operation options of the browser, and the file system includes the target micro-frontend project; generating an operation instruction according to the target micro-frontend project and the operation content, and the operation instruction is used to execute the operation content on the target micro-frontend project; performing an operation on the target micro-frontend project according to the operation instruction, and obtaining an execution result of the operation instruction, and the execution result is used to indicate whether the execution of the operation instruction is successful; and sending the execution result to the browser for display. The present application receives an operation request generated by a browser, generates an operation instruction according to the operation request, operates the target micro-frontend project selected according to the operation option in the file system of the proxy server, obtains the execution result, and displays the execution result in the browser, thereby realizing the direct operation of the micro-frontend project in the browser, reducing the operation process, solving the problem of low efficiency in operating the micro-frontend project in the prior art, and improving the efficiency of operating the micro-frontend project. BRIEF DESCRIPTION OF THE DRAWINGS

[0040] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art are briefly introduced below.

[0041] Figure 1 This is a flowchart of the operation method of the micro front-end project in the embodiment of the present application;

[0042] Figure 2 This is a schematic diagram of a browser page in an embodiment of the present application;

[0043] Figure 3 A schematic diagram of dependent operations in an embodiment of the present application;

[0044] Figure 4 This is one of the interactive schematic diagrams in the embodiment of the present application;

[0045] Figure 5 This is the second interactive diagram in the embodiment of the present application;

[0046] Figure 6 This is a schematic diagram of the structure of the operating device of the micro-front-end project in the embodiment of the present application;

[0047] Figure 7 Schematic diagram of the structure of an electronic device in an embodiment of the present application. DETAILED DESCRIPTION

[0048] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0049] It should be mentioned before discussing the exemplary embodiments in more detail that some exemplary embodiments are described as processes or methods depicted as flow charts. Although the flow charts describe the steps as sequential processes, many of the steps therein can be implemented in parallel, concurrently or simultaneously. In addition, the order of the steps can be rearranged. The process can be terminated when its operation is completed, but can also have additional steps not included in the accompanying drawings. The process can correspond to a method, function, procedure, subroutine, subprogram, etc.

[0050] In addition, the terms "first", "second", etc. can be used in this article to describe various directions, actions, steps or elements, but these directions, actions, steps or elements are not limited by these terms. These terms are only used to distinguish a first direction, action, step or element from another direction, action, step or element. For example, without departing from the scope of the present application, the first speed difference can be referred to as the second speed difference, and similarly, the second speed difference can be referred to as the first speed difference. Both the first speed difference and the second speed difference are speed differences, but they are not the same speed difference. The terms "first", "second", etc. cannot be understood as indicating or implying relative importance or implicitly indicating the number of indicated technical features. Thus, the features defined as "first" and "second" can explicitly or implicitly include one or more of the features. In the description of the present application, the meaning of "multiple" is at least two, such as two, three, etc., unless otherwise clearly and specifically defined.

[0051] The present application embodiment provides an operation method of a micro front-end project. The method of the present embodiment can be executed by a proxy server, and a file system is deployed on the proxy server, such as Figure 1 As shown, the method includes:

[0052] Step 101: Receive an operation request sent by a browser, wherein the operation request includes a target micro-frontend project and operation content determined based on an operation option of the browser, the file system includes the target micro-frontend project, the operation option includes multiple selectable micro-frontend projects and the operation content, and the target micro-frontend project is at least one of the multiple micro-frontend projects.

[0053] In this embodiment, the proxy server refers to a proxy server set up in a local network, which is used to forward network requests, filter content or provide other network services. It should be noted that the proxy server is a lightweight local proxy server that can receive and process HTTP requests from browsers. By setting up a local proxy server, users can control network traffic, strengthen security, increase access speed, etc. A file system is deployed on the proxy server, and the file system generally includes multiple micro-frontend projects, wherein the micro-frontend is an architectural style that splits the front-end application into smaller and more independent parts (micro-frontend applications) so that the team can independently develop, deploy and maintain these parts. A micro-frontend project is usually composed of multiple micro-frontend applications, each of which can be independently developed, built and deployed, and then integrated into a unified user interface. Through the direct interaction between the browser and the proxy server, the traditional cross-domain restrictions can be bypassed to achieve direct interaction between the browser and the local system. This simplifies the communication process between the browser and the local system without the need for additional remote servers or complex configurations.

[0054] In this embodiment, the operator can select the micro-frontend project to be operated on the browser, as well as the operation content of the micro-frontend project, so as to determine the operation options, wherein the operation options include multiple micro-frontend projects and the operation content of the corresponding micro-frontend projects. Through the operation options, the operator can accurately select the target micro-frontend project and the operation of the target micro-frontend project, thereby improving the operation efficiency.

[0055] like Figure 2 As shown, Figure 2 This is the display content in the browser in this embodiment, where the left side of the display interface is an optional micro-frontend project, and the right side of the display interface is optional operation content, including cloning to local, managing dependencies, updating MASTER locally, local dependency INSTALL, creating TAG, batch workflow, local update and INSTALL, and batch command line. Specifically, cloning to local means copying the micro-frontend project to the local. Managing dependencies is used to upgrade the dependency packages of the micro-frontend project. Local update MASTER refers to updating the micro-frontend project in the remote code repository. Local dependency INSTALL refers to installing the dependency packages of the micro-frontend project. Creating TAG is to create a new tag in the code repository. Batch workflow refers to the automated processing of a large number of micro-frontend projects. Local update and INSTALL refers to updating and installing the micro-frontend project locally. Batch command line refers to the automated running of a large number of commands.

[0056] The operator selects the target micro-frontend project to be operated and the operation content to be operated on it on the browser, thereby generating an operation request. It should be noted that multiple target micro-frontend projects can be selected for operation at the same time, and multiple operation contents can also be selected at the same time, which is not specifically limited in this embodiment.

[0057] Step 102: Generate an operation instruction according to the target micro-frontend project and the operation content, wherein the operation instruction is used to execute the operation content on the target micro-frontend project.

[0058] In this embodiment, after the proxy server receives the operation request sent by the browser, it parses the operation request, determines the micro-frontend project and operation content that need to be operated, and generates corresponding operation instructions.

[0059] It should be further explained that the operation instruction is a coded instruction that can directly operate the target micro-frontend project. The operation instruction can be written in advance and stored in the proxy server and called when needed.

[0060] In the prior art, when it is necessary to operate a micro-frontend project, it is generally necessary to rebuild the configuration environment and perform a series of operations such as determining the running version and code writing. In this embodiment, the preset saved operation instructions can be directly matched according to the operation content and the target micro-frontend project, thereby improving the efficiency of processing micro-frontend projects.

[0061] Step 103: perform an operation on the target micro-frontend project according to the operation instruction to obtain an execution result of the operation instruction, where the execution result is used to indicate whether the execution of the operation instruction is successful.

[0062] In this embodiment, after generating the operation instruction, it is necessary to query the storage address of the target micro-frontend project in the deployed file system. It should be noted that the storage address is generally sent to the proxy server by the browser at the same time when the operation request is generated. After the proxy server receives the operation request, it determines the location of the target micro-frontend project in the file system according to the storage address of the target micro-frontend project.

[0063] After determining the location of the target micro-frontend project, an operation instruction is executed on the target micro-frontend project, and an execution result corresponding to the operation instruction is generated, wherein the execution result indicates whether the operation instruction is successfully executed. Figure 3 As shown, Figure 3A schematic diagram of the interface of an operation instruction. For example, the operation instruction is a dependency management instruction. The dependency packages of the target micro-frontend project are further refined through the dependency management instruction. Specifically, the dependency package that needs to be updated and the corresponding version of the dependency package can be selected. Finally, the dependency type is selected and then executed to generate an execution result.

[0064] Step 104: Send the execution result to the browser for display.

[0065] In this embodiment, the generated execution result is sent to the user interface in the browser for display, and the operator can determine whether the current execution is successful or continue to operate the micro-frontend project based on the execution result.

[0066] It should be noted that an intuitive and unified browser graphical interface can be developed to enable users to manage local projects through the browser.

[0067] The present application receives an operation request generated by a browser, generates an operation instruction according to the operation request, operates the target micro-front-end project selected according to the operation option in the file system of the proxy server, obtains the execution result, and displays the execution result in the browser, thereby realizing the direct operation of the micro-front-end project in the browser, reducing the operation process, solving the problem of low efficiency in operating the micro-front-end project in the prior art, and improving the efficiency of operating the micro-front-end project.

[0068] The present application also includes the following implementation modes, wherein each optional implementation mode can be combined or merged with the above steps. Specifically, optionally, before receiving the operation request sent by the browser, the method also includes:

[0069] Receive an add request sent by the browser, where the add request includes multiple path information, where the multiple path information is used to indicate storage locations of multiple micro-frontend projects in the file system;

[0070] Execute a read instruction on the multiple micro-frontend projects according to the add request to obtain multiple project information, where the multiple project information is used to indicate project content and project size of the multiple micro-frontend projects, and the read instruction is used to read the multiple micro-frontend projects in the file system;

[0071] The plurality of project information is sent to the browser for display.

[0072] In this embodiment, before operating a micro front-end project, it is necessary to determine the path information of all micro front-end projects in the file system. The file system includes multiple micro front-end projects, and the target micro front-end project is at least one of the multiple micro front-end projects. Figure 4 As shown, in Figure 4 Each micro front-end project corresponds to a path information, which indicates the storage location of each micro front-end project in the file system. The storage location can be saved in the form of an address.

[0073] The add request is initiated by the browser, and the storage locations of multiple micro-frontend projects in the file system are read to generate project information corresponding to the multiple micro-frontend projects, and the project information is displayed in the browser. Specifically, after receiving the add request sent by the browser, the proxy server determines the storage locations of the multiple micro-frontend projects included in the add request in the file system, and then reads in the file system according to the multiple storage locations to determine the project information of each micro-frontend project. The project information is used to indicate the project size, project content, and other data of the multiple micro-frontend projects, which is not specifically limited in this embodiment.

[0074] For example, a general browser will send the path information of all micro-frontend projects that can be operated to the proxy server, and read it in the file system through the proxy server. When a micro-frontend project is not read, it will generate unreadable project information. When it is successfully read, it will include the relevant data information of the micro-frontend project. By adding the project information of all micro-frontend projects to the browser in advance, the micro-frontend projects that can be operated can be intuitively displayed in the browser, so that it is convenient to operate the micro-frontend projects directly through the browser later.

[0075] Optionally, after sending the plurality of project information to the browser for display, the method further includes:

[0076] Determine, according to the multiple micro-frontend projects, multiple candidate operation codes matching the multiple micro-frontend projects, wherein the multiple candidate operation codes are used to generate operation instructions for operating the multiple micro-frontend projects;

[0077] The multiple candidate operation codes are packaged and saved to obtain multiple candidate operation instructions, and the operation instruction is at least one of the multiple candidate operation instructions.

[0078] In this embodiment, after the browser receives multiple project information, it can determine multiple micro-frontend projects that can be operated based on the multiple project information, thereby encoding the operations of these micro-frontend projects to generate multiple candidate operation codes. Specifically, the operation commands of the local project of the proxy server (such as npminstall, git operations, etc.) can be encapsulated into an application programming interface (Application Programming Interface, API) that can be accessed through the browser HTTP request.

[0079] Thus, after encapsulating multiple candidate operation codes, multiple candidate operation instructions are generated. When a certain operation instruction needs to be executed on the target micro-frontend project, the operation instruction can be queried or matched from multiple candidate operation instructions, thereby saving the time of rewriting the operation instruction and simplifying the complex command line operation, making it easier to call and integrate. The operation complexity is further reduced, and users do not need to be familiar with and enter complex commands.

[0080] Optionally, executing the operation instruction on the target micro-frontend project to obtain the execution result of the operation instruction includes:

[0081] Matching the multiple candidate operation instructions according to the operation request, and determining the operation instruction corresponding to the operation request among the multiple candidate operation instructions;

[0082] Querying the target storage location of the target micro-frontend project in the file system according to the operation request, where the target storage location is the storage address of the target micro-frontend project in the file system;

[0083] Based on the storage location, the operation instruction is executed on the target micro-frontend project to obtain an execution result of the operation instruction.

[0084] In this embodiment, when an operation instruction is needed, multiple candidate operation instructions can be matched and the corresponding candidate operation instruction can be directly determined as the operation instruction, thereby saving the time of rewriting the operation instruction. Figure 5 As shown, Figure 5 The flowchart is a schematic diagram of executing the operation instruction. In this embodiment, the operation instruction is explained by taking the npminstall command as an example, where the npminstall command is used to install the dependency packages required for the project. The selected installation package can be downloaded and installed in the target micro-frontend project.

[0085] Specifically, the local server receives an HTTP request sent by the browser through AJAX or Fetch API, determines the storage path of the target micro-frontend project through the request, and thereby determines the location of the target micro-frontend project in the file system. According to the HTTP request, the npminstall command is determined from multiple candidate operation instructions, and is executed in the target micro-frontend project to obtain an execution result, which is used to indicate whether the npm install command is successfully executed.

[0086] In this embodiment, integrated automated operations (such as npm install, git commit, push, and Merge Request) are implemented through multiple candidate operation instructions, simplifying the workflow. Integrated automated operations significantly reduce the steps of manual intervention, improve work efficiency, reduce human errors, implement one-click operations, and improve the consistency and reliability of workflows.

[0087] Optionally, after performing the operation on the target micro-frontend project according to the operation instruction and obtaining the execution result of the operation instruction, the method further includes:

[0088] Generate a modification instruction based on the execution result, where the modification instruction is used to update the execution result in the target micro-frontend project;

[0089] Modify the target micro-frontend project according to the modification instruction, and obtain a modification result of the modification instruction, where the modification result is used to indicate whether the execution result is successfully updated;

[0090] Sending a code push request to a code control system based on the modification result, the code control system including the target micro-frontend project that has not been operated according to the operation instruction, the code push request being used to update the target micro-frontend project that has not been operated according to the operation instruction in the code control system;

[0091] Receiving a push result sent by the code control system, wherein the push result is used to indicate whether the code push request is executed successfully;

[0092] The execution result and the push result are sent to the browser for display.

[0093] In this embodiment, in the above embodiment, after the execution result is generated, a modification instruction is generated according to the execution result, and the modification instruction is used to record the execution result in the target micro-frontend project, and the modification instruction is executed on the target micro-frontend project. It should be noted that the operation instruction may update the dependency package of the target micro-frontend project or update the version of the dependency package more finely, so code modification is required, that is, generating a modification instruction. Specifically, the modification instruction can be a gitcommit instruction, wherein the git commit instruction is a command in the Git version control system, which is used to save changes in the temporary storage area to the local repository.

[0094] The git commit command is used to make changes in the file system and generate a change result, which is used to indicate whether the git commit command is successfully executed.

[0095] In addition, a code push request is sent to the code control system according to the modification result, wherein the code control system is illustrated in this embodiment by taking a version control system as an example, such as GitLab or GitHub, GitLab is a web-based Git warehouse management tool that provides functions such as code hosting, issue tracking, and continuous integration. GitHub is a web-based Git warehouse hosting service that provides code hosting, issue tracking, code review, collaboration functions, etc., enabling developers to collaborate on development projects more easily. The code control system also includes the target micro-frontend project. Since the target micro-frontend project has been modified in the local proxy server, it needs to be modified synchronously in the code control system so that the modifications can be synchronized to all users who can query the code control system.

[0096] Specifically, a push result sent by the code control system is received, and the push result is used to indicate whether the code push request is executed successfully; after receiving the push result, the push result is sent to the browser for display.

[0097] Optionally, sending the execution result and the push result to the browser for display includes:

[0098] When the push result indicates that the code push request is successfully executed, an update request is sent to the code control system, where the update request is used to update the target micro-frontend project and is saved in the code control system;

[0099] Receive an update link generated by the code control system based on the update request, where the update link is used to update the target micro-frontend project in the code control system;

[0100] Based on the update link, the target micro-frontend project is updated in the code control system, and an update result is generated;

[0101] The execution result and the update result are sent to the browser for display.

[0102] In this embodiment, when the push result indicates that the code push request is executed successfully, an update request is sent to the code control system, and the target micro-frontend project in the code control system is updated according to the update request to keep it consistent with the target micro-frontend project in the proxy server. Specifically, an update link generated based on the update request is received, and the update link can be a merge request link, wherein a merge request refers to an operation in software development, when developers want to merge their changes into the main branch of the code base (usually the master branch), they will create a merge request or a pull request. This request will show the changes they have made, and other team members can review these changes and provide feedback. Once the review is passed, the changes will be merged into the main branch, thereby improving teamwork during the development process.

[0103] By feeding the update link back to the browser, the update link can be directly displayed in the browser, so that the target micro-frontend project in the code control system can be updated directly in the browser, reducing the operation process.

[0104] The present application receives an operation request generated by a browser, generates an operation instruction according to the operation request, operates the target micro-front-end project selected according to the operation option in the file system of the proxy server, obtains the execution result, and displays the execution result in the browser, thereby realizing the direct operation of the micro-front-end project in the browser, reducing the operation process, solving the problem of low efficiency in operating the micro-front-end project in the prior art, and improving the efficiency of operating the micro-front-end project.

[0105] like Figure 6 As shown, the embodiment of the present application also provides an operating device for a micro front-end project, such as Figure 6 As shown, the operating device 600 of the micro front-end project includes:

[0106] A receiving module 610 is configured to receive an operation request sent by a browser, wherein the operation request includes a target micro-frontend project and an operation content determined based on an operation option of the browser, the file system includes the target micro-frontend project, the operation option includes a plurality of selectable micro-frontend projects and the operation content, and the target micro-frontend project is at least one of the plurality of micro-frontend projects;

[0107] A generating module 620, configured to generate an operation instruction according to the target micro-frontend project and the operation content, wherein the operation instruction is used to execute the operation content on the target micro-frontend project;

[0108] An execution module 630 is used to perform an operation on the target micro-frontend project according to the operation instruction, and obtain an execution result of the operation instruction, where the execution result is used to indicate whether the execution of the operation instruction is successful;

[0109] The sending module 640 is used to send the execution result to the browser for display.

[0110] Optionally, also include:

[0111] An adding receiving module is used to receive an adding request sent by the browser, wherein the adding request includes a plurality of path information, and the plurality of path information is used to indicate a storage location of a plurality of micro-frontend projects in the file system;

[0112] An adding execution module is used to execute a read instruction on the multiple micro-frontend projects according to the adding request to obtain multiple project information, where the multiple project information is used to indicate the project content and project size of the multiple micro-frontend projects, and the read instruction is used to read the multiple micro-frontend projects in the file system;

[0113] A display module is added to send the plurality of project information to the browser for display.

[0114] Optionally, also include:

[0115] A code generation module, used to determine, according to the multiple micro-frontend projects, multiple candidate operation codes matching the multiple micro-frontend projects, wherein the multiple candidate operation codes are used to generate operation instructions for operating the multiple micro-frontend projects;

[0116] The encoding saving module is used to encapsulate and save the multiple candidate operation codes to obtain multiple candidate operation instructions, and the operation instruction is at least one of the multiple candidate operation instructions.

[0117] Optionally, the execution module 630 includes:

[0118] A matching submodule, configured to match the multiple candidate operation instructions according to the operation request, and determine the operation instruction corresponding to the operation request among the multiple candidate operation instructions;

[0119] A query submodule, used to query a target storage location of the target micro-frontend project in the file system according to the operation request, wherein the target storage location is a storage address of the target micro-frontend project in the file system;

[0120] The acquisition submodule is used to execute the operation instruction on the target micro-front-end project based on the storage location to obtain the execution result of the operation instruction.

[0121] Optionally, also include:

[0122] A modification generation module, used to generate a modification instruction based on the execution result, wherein the modification instruction is used to update the execution result in the target micro-frontend project;

[0123] A modification execution module, used to modify the target micro-frontend project according to the modification instruction, and obtain a modification result of the modification instruction, wherein the modification result is used to indicate whether the execution result is successfully updated;

[0124] A push sending module, configured to send a code push request to a code control system based on the modification result, wherein the code control system includes the target micro-frontend project that has not been operated according to the operation instruction, and the code push request is used to update the target micro-frontend project that has not been operated according to the operation instruction in the code control system;

[0125] A push receiving module, used to receive a push result sent by the code control system, wherein the push result is used to indicate whether the code push request is executed successfully;

[0126] The push display module is used to send the execution result and the push result to the browser for display.

[0127] Optionally, the push display module includes:

[0128] An update sending submodule, used for sending an update request to the code control system when the push result indicates that the code push request is successfully executed, wherein the update request is used to update the target micro-frontend project and is saved in the code control system;

[0129] A link generation submodule, configured to receive an update link generated by the code control system based on the update request, wherein the update link is used to update the target micro-frontend project in the code control system;

[0130] An update submodule, used to update the target micro-frontend project in the code control system based on the update link and generate an update result;

[0131] The link display submodule is used to send the execution result and the update result to the browser for display.

[0132] The present application receives an operation request generated by a browser, generates an operation instruction according to the operation request, operates the target micro-front-end project selected according to the operation option in the file system of the proxy server, obtains the execution result, and displays the execution result in the browser, thereby realizing the direct operation of the micro-front-end project in the browser, reducing the operation process, solving the problem of low efficiency in operating the micro-front-end project in the prior art, and improving the efficiency of operating the micro-front-end project.

[0133] Figure 7 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application is shown in FIG. Figure 7 As shown, the electronic device 700 includes a memory 710 and a processor 720. The number of the processor 720 in the electronic device 700 may be one or more. Figure 7 A processor 720 is taken as an example; the memory 710 and the processor 720 in the server can be connected via a bus or other means. Figure 7 The example of connecting through bus is taken in the following.

[0134] The memory 710, as a computer-readable storage medium, can be used to store software programs, computer executable programs and modules, such as the program instructions / modules corresponding to the member push method in the embodiment of the present application. The processor 720 executes various functional applications and data processing of the server / terminal / server by running the software programs, instructions and modules stored in the memory 710, thereby realizing the operation method of the above-mentioned micro-front-end project.

[0135] The processor 720 is used to run the computer program stored in the memory 710 to implement the following steps:

[0136] Receive an operation request sent by a browser, the operation request including a target micro-frontend project and operation content determined based on an operation option of the browser, the file system including the target micro-frontend project, the operation option including a plurality of selectable micro-frontend projects and the operation content, and the target micro-frontend project is at least one of the plurality of micro-frontend projects;

[0137] Generate an operation instruction according to the target micro-frontend project and the operation content, wherein the operation instruction is used to execute the operation content on the target micro-frontend project;

[0138] Performing an operation on the target micro-frontend project according to the operation instruction to obtain an execution result of the operation instruction, where the execution result is used to indicate whether the execution of the operation instruction is successful;

[0139] The execution result is sent to the browser for display.

[0140] Optionally, before receiving the operation request sent by the browser, the method further includes:

[0141] Receive an add request sent by the browser, where the add request includes multiple path information, where the multiple path information is used to indicate storage locations of multiple micro-frontend projects in the file system;

[0142] Execute a read instruction on the multiple micro-frontend projects according to the add request to obtain multiple project information, where the multiple project information is used to indicate project content and project size of the multiple micro-frontend projects, and the read instruction is used to read the multiple micro-frontend projects in the file system;

[0143] The plurality of project information is sent to the browser for display.

[0144] Optionally, after sending the plurality of project information to the browser for display, the method further includes:

[0145] Determine, according to the multiple micro-frontend projects, multiple candidate operation codes matching the multiple micro-frontend projects, wherein the multiple candidate operation codes are used to generate operation instructions for operating the multiple micro-frontend projects;

[0146] The multiple candidate operation codes are packaged and saved to obtain multiple candidate operation instructions, and the operation instruction is at least one of the multiple candidate operation instructions.

[0147] Optionally, executing the operation instruction on the target micro-frontend project to obtain the execution result of the operation instruction includes:

[0148] Matching the multiple candidate operation instructions according to the operation request, and determining the operation instruction corresponding to the operation request among the multiple candidate operation instructions;

[0149] Querying the target storage location of the target micro-frontend project in the file system according to the operation request, where the target storage location is the storage address of the target micro-frontend project in the file system;

[0150] Based on the storage location, the operation instruction is executed on the target micro-frontend project to obtain an execution result of the operation instruction.

[0151] Optionally, after performing the operation on the target micro-frontend project according to the operation instruction and obtaining the execution result of the operation instruction, the method further includes:

[0152] Generate a modification instruction based on the execution result, where the modification instruction is used to update the execution result in the target micro-frontend project;

[0153] Modify the target micro-frontend project according to the modification instruction, and obtain a modification result of the modification instruction, where the modification result is used to indicate whether the execution result is successfully updated;

[0154] Sending a code push request to a code control system based on the modification result, the code control system including the target micro-frontend project that has not been operated according to the operation instruction, the code push request being used to update the target micro-frontend project that has not been operated according to the operation instruction in the code control system;

[0155] Receiving a push result sent by the code control system, the push result is used to indicate whether the code push request is executed successfully;

[0156] The execution result and the push result are sent to the browser for display.

[0157] Optionally, sending the execution result and the push result to the browser for display includes:

[0158] When the push result indicates that the code push request is successfully executed, an update request is sent to the code control system, where the update request is used to update the target micro-frontend project and is saved in the code control system;

[0159] Receive an update link generated by the code control system based on the update request, where the update link is used to update the target micro-frontend project in the code control system;

[0160] Based on the update link, the target micro-frontend project is updated in the code control system, and an update result is generated;

[0161] The execution result and the update result are sent to the browser for display.

[0162] The present application receives an operation request generated by a browser, generates an operation instruction according to the operation request, operates the target micro-front-end project selected according to the operation option in the file system of the proxy server, obtains the execution result, and displays the execution result in the browser, thereby realizing the direct operation of the micro-front-end project in the browser, reducing the operation process, solving the problem of low efficiency in operating the micro-front-end project in the prior art, and improving the efficiency of operating the micro-front-end project.

[0163] The computer-readable storage medium of the embodiment of the present application can adopt any combination of one or more computer-readable media. The computer-readable medium can be a computer-readable signal medium or a computer-readable storage medium. The computer-readable storage medium can be, for example, - but not limited to - a system, device or device of electricity, magnetism, light, electromagnetic, infrared, or semiconductor, or any combination of the above. More specific examples (non-exhaustive lists) of computer-readable storage media include: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this document, a computer-readable storage medium can be any tangible medium containing or storing a program, which can be used by an instruction execution system, a device or a device or used in combination with it.

[0164] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, which carry computer-readable program code. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.

[0165] The program code contained on the storage medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.

[0166] Computer program code for performing the operation of the present application can be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as an independent software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or terminal. In the case of a remote computer, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computer (e.g., using an Internet service provider to connect through the Internet).

[0167] An embodiment of the present application further provides a computer program product, which is stored in a storage medium. The computer program product is executed by at least one processor to implement the various processes of the above-mentioned micro-front-end project operation method embodiment, and can achieve the same technical effect. To avoid repetition, it will not be repeated here.

[0168] Note that the above are only preferred embodiments of the present application and the technical principles used. Those skilled in the art will understand that the present application is not limited to the specific embodiments described herein, and that various obvious changes, readjustments and substitutions can be made by those skilled in the art without departing from the scope of protection of the present application. Therefore, although the present application is described in more detail through the above embodiments, the present application is not limited to the above embodiments, and may include more other equivalent embodiments without departing from the concept of the present application, and the scope of the present application is determined by the scope of the appended claims.

Claims

1. An operation method of a micro front-end project, applied to a proxy server, wherein a file system is deployed on the proxy server, characterized in that: The method comprises: Receive an operation request sent by a browser, the operation request including a target micro-frontend project and operation content determined based on an operation option of the browser, the file system including the target micro-frontend project, the operation option including a plurality of selectable micro-frontend projects and the operation content, and the target micro-frontend project is at least one of the plurality of micro-frontend projects; Generate an operation instruction according to the target micro-frontend project and the operation content, wherein the operation instruction is used to execute the operation content on the target micro-frontend project; Performing an operation on the target micro-frontend project according to the operation instruction to obtain an execution result of the operation instruction, where the execution result is used to indicate whether the execution of the operation instruction is successful; The execution result is sent to the browser for display.

2. The method according to claim 1, characterized in that Before receiving the operation request sent by the browser, the method further includes: Receive an add request sent by the browser, where the add request includes multiple path information, where the multiple path information is used to indicate storage locations of multiple micro-frontend projects in the file system; Execute a read instruction on the multiple micro-frontend projects according to the add request to obtain multiple project information, where the multiple project information is used to indicate project content and project size of the multiple micro-frontend projects, and the read instruction is used to read the multiple micro-frontend projects in the file system; The plurality of project information is sent to the browser for display.

3. The method according to claim 2, characterized in that After sending the plurality of project information to the browser for display, the method further comprises: Determine, according to the multiple micro-frontend projects, multiple candidate operation codes matching the multiple micro-frontend projects, wherein the multiple candidate operation codes are used to generate operation instructions for operating the multiple micro-frontend projects; The multiple candidate operation codes are packaged and saved to obtain multiple candidate operation instructions, and the operation instruction is at least one of the multiple candidate operation instructions.

4. The method according to claim 3, characterized in that The executing the operation instruction on the target micro-frontend project to obtain the execution result of the operation instruction includes: Matching the multiple candidate operation instructions according to the operation request, and determining the operation instruction corresponding to the operation request among the multiple candidate operation instructions; Querying the target storage location of the target micro-frontend project in the file system according to the operation request, where the target storage location is the storage address of the target micro-frontend project in the file system; Based on the storage location, the operation instruction is executed on the target micro-frontend project to obtain an execution result of the operation instruction.

5. The method according to claim 1, characterized in that After performing the operation on the target micro-frontend project according to the operation instruction and obtaining the execution result of the operation instruction, the method further includes: Generate a modification instruction based on the execution result, where the modification instruction is used to update the execution result in the target micro-frontend project; Modify the target micro-frontend project according to the modification instruction, and obtain a modification result of the modification instruction, where the modification result is used to indicate whether the execution result is successfully updated; Sending a code push request to a code control system based on the modification result, the code control system including the target micro-frontend project that has not been operated according to the operation instruction, the code push request being used to update the target micro-frontend project that has not been operated according to the operation instruction in the code control system; Receiving a push result sent by the code control system, the push result is used to indicate whether the code push request is executed successfully; The execution result and the push result are sent to the browser for display.

6. The method according to claim 5, characterized in that The sending the execution result and the push result to the browser for display includes: When the push result indicates that the code push request is successfully executed, an update request is sent to the code control system, where the update request is used to update the target micro-frontend project and is saved in the code control system; Receive an update link generated by the code control system based on the update request, where the update link is used to update the target micro-frontend project in the code control system; Based on the update link, the target micro-frontend project is updated in the code control system, and an update result is generated; The execution result and the update result are sent to the browser for display.

7. An operating device for a micro-frontend project, applied to a proxy server, wherein a file system is deployed on the proxy server, characterized in that: The device comprises: A receiving module, configured to receive an operation request sent by a browser, wherein the operation request includes a target micro-frontend project and an operation content determined based on an operation option of the browser, the file system includes the target micro-frontend project, the operation option includes a plurality of selectable micro-frontend projects and the operation content, and the target micro-frontend project is at least one of the plurality of micro-frontend projects; A generation module, used to generate an operation instruction according to the target micro-frontend project and the operation content, wherein the operation instruction is used to execute the operation content on the target micro-frontend project; An execution module, used to perform an operation on the target micro-frontend project according to the operation instruction, and obtain an execution result of the operation instruction, wherein the execution result is used to indicate whether the execution of the operation instruction is successful; The sending module is used to send the execution result to the browser for display.

8. An electronic device, characterized in that: It includes a processor, a memory, and a program or instruction stored in the memory and executable on the processor, wherein when the program or instruction is executed by the processor, the steps of the operating method of the micro-frontend project as described in any one of claims 1 to 6 are implemented.

9. A computer-readable storage medium, characterized in that: The readable storage medium stores a program or instruction, and when the program or instruction is executed by the processor, the steps of the operating method of the micro-frontend project according to any one of claims 1 to 6 are implemented.

10. A computer program product, characterized in that The computer program product is stored in a storage medium, and the computer program product is executed by at least one processor to implement the steps in the operating method of the micro-frontend project according to any one of claims 1 to 6.