[go: up one dir, main page]

CN115408050A - Micro front terminal application publishing method, device, equipment and storage medium - Google Patents

Micro front terminal application publishing method, device, equipment and storage medium Download PDF

Info

Publication number
CN115408050A
CN115408050A CN202211046903.4A CN202211046903A CN115408050A CN 115408050 A CN115408050 A CN 115408050A CN 202211046903 A CN202211046903 A CN 202211046903A CN 115408050 A CN115408050 A CN 115408050A
Authority
CN
China
Prior art keywords
environment
application
sub
production line
release
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
CN202211046903.4A
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.)
Shanghai Fupei Technology Co ltd
Original Assignee
Beijing Shareit 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 Beijing Shareit Information Technology Co Ltd filed Critical Beijing Shareit Information Technology Co Ltd
Priority to CN202211046903.4A priority Critical patent/CN115408050A/en
Publication of CN115408050A publication Critical patent/CN115408050A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; 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/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44505Configuring for program initiating, e.g. using registry, configuration files
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; 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/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44521Dynamic linking or loading; Link editing at or after load time, e.g. Java class loading

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Stored Programmes (AREA)

Abstract

本公开提供一种微前端子应用的发布方法、装置、设备即存储介质。该发布方法应用于微前端主应用,包括:接收对第一子应用的加载指令;根据加载指令,获取第一子应用的配置信息;根据配置信息,确定第一子应用的目标发布环境;加载第一子应用针对目标发布环境的应用资源;本公开通过上述方法实现了微前端子应用的独立发布,降低了灰度成本。

Figure 202211046903

The present disclosure provides a release method, device, and equipment for a micro front end application, that is, a storage medium. The publishing method is applied to the main application of the micro front end, and includes: receiving a loading instruction for the first sub-application; obtaining configuration information of the first sub-application according to the loading instruction; determining the target publishing environment of the first sub-application according to the configuration information; loading The first sub-application is aimed at the application resources of the target release environment; the present disclosure realizes the independent release of micro-frontend sub-applications through the above-mentioned method, and reduces the gray scale cost.

Figure 202211046903

Description

一种微前端子应用的发布方法、装置、设备及存储介质A publishing method, device, equipment, and storage medium for micro-front end applications

技术领域technical field

本公开涉及但不限于计算机技术领域,尤其涉及一种微前端子应用的发布方法、装置、设备及存储介质。The present disclosure relates to but not limited to the field of computer technology, and in particular relates to a method, device, device, and storage medium for releasing micro-frontend applications.

背景技术Background technique

灰度发布(又名金丝雀发布)是指在黑与白之间,能够平滑过渡的一种发布方式。在其上可以进行A/B测试,即让一部分用户继续用产品特性A,一部分用户开始用产品特性B,如果用户对B没有什么反对意见,那么逐步扩大范围,把所有用户都迁移到B上面来。灰度发布可以保证整体系统的稳定,在初始灰度的时候就可以发现、调整问题,以保证其影响度。Grayscale release (also known as canary release) refers to a release method that can smoothly transition between black and white. A/B testing can be carried out on it, that is, let some users continue to use product feature A, and some users start to use product feature B. If users have no objection to B, then gradually expand the scope and migrate all users to B. Come. Grayscale publishing can ensure the stability of the overall system, and problems can be found and adjusted at the initial grayscale to ensure their impact.

目前,微前端子应用有重大升级,需要进行灰度发布,并且平滑切换流量来保证稳定性时,微前端的所有子应用都需要灰度发布并且需要主应用灰度配合,这增加了发布工作量以及灰度发布的成本,并且降低了系统的稳定性,使得系统的灵活性不高。At present, the sub-applications of the micro-frontend have major upgrades, which need to be released in grayscale, and when the traffic is switched smoothly to ensure stability, all sub-applications of the micro-frontend need to be released in grayscale and need the cooperation of the main application in grayscale, which increases the release work The volume and the cost of gray scale release, and reduce the stability of the system, making the system less flexible.

发明内容Contents of the invention

本公开提供一种微前端子应用的发布方法、装置、设备及存储介质,以实现微前端子应用的独立发布。The present disclosure provides a release method, device, equipment and storage medium for micro front end applications, so as to realize the independent release of micro front end applications.

第一方面,本公开提供一种微前端子应用的发布方法,该发布方法应用于微前端主应用,包括:接收对第一子应用的加载指令;根据加载指令,获取第一子应用的配置信息;根据配置信息,确定第一子应用的目标发布环境;加载第一子应用针对目标发布环境的应用资源,其中,目标发布环境为灰度发布环境或产线发布环境。In the first aspect, the present disclosure provides a publishing method for a micro-frontend sub-application. The publishing method is applied to the micro-frontend main application, including: receiving a loading instruction for the first sub-application; and obtaining the configuration of the first sub-application according to the loading instruction information; according to the configuration information, determine the target release environment of the first sub-application; load the application resources of the first sub-application for the target release environment, wherein the target release environment is a gray scale release environment or a production line release environment.

在一种可能的实施方式中,根据配置信息,确定第一子应用的目标发布环境,包括:根据配置信息,确定第一子应用是否启用灰度发布环境;当确定启用灰度发布环境时,确定目标发布环境为灰度发布环境;当确定不启用灰度发布环境时,确定目标发布环境为产线发布环境。In a possible implementation manner, determining the target publishing environment of the first sub-application according to the configuration information includes: determining whether the grayscale publishing environment is enabled for the first sub-application according to the configuration information; when it is determined that the grayscale publishing environment is enabled, Determine that the target release environment is the grayscale release environment; when it is determined not to enable the grayscale release environment, determine that the target release environment is the production line release environment.

在一种可能的实施方式中,配置信息包括:第一指示信息和第一子应用的资源信息,其中,第一指示信息用于指示第一子应用是否启用灰度发布环境;资源信息包括:灰度发布环境对应的灰度资源地址和产线发布环境对应的产线资源地址。In a possible implementation manner, the configuration information includes: first indication information and resource information of the first sub-application, where the first indication information is used to indicate whether the first sub-application enables a gray scale release environment; the resource information includes: The grayscale resource address corresponding to the grayscale release environment and the production line resource address corresponding to the production line release environment.

在一种可能的实施方式中,当第一指示信息为第一值时,第一指示信息表示启用灰度发布环境;或,当第一指示信息为第二值时,第一指示信息表示不启用灰度发布环境。In a possible implementation manner, when the first indication information is the first value, the first indication information indicates that the grayscale publishing environment is enabled; or, when the first indication information is the second value, the first indication information indicates that the Enable grayscale publishing environment.

在一种可能的实施方式中,该发布方法还包括:获取修改指令,修改指令用于将第一指示信息由指示启用灰度发布环境切换为指示不启用灰度发布环境;根据修改指令,修改第一指示信息。In a possible implementation, the publishing method further includes: acquiring a modification instruction, the modification instruction is used to switch the first indication information from indicating that the grayscale publishing environment is enabled to indicating that the grayscale publishing environment is not enabled; according to the modification instruction, modifying The first instruction message.

在一种可能的实施方式中,响应于目标发布环境为灰度发布环境,加载第一子应用针对目标发布环境的应用资源,包括:通过访问灰度发布环境对应的灰度资源地址,获取灰度发布环境对应的应用资源。In a possible implementation manner, in response to the fact that the target publishing environment is a grayscale publishing environment, loading the application resources of the first sub-application for the target publishing environment includes: obtaining the grayscale resource address corresponding to the grayscale publishing environment, obtaining the grayscale The application resources corresponding to the release environment.

在一种可能的实施方式中,响应于目标发布环境为产线发布环境,加载第一子应用针对目标发布环境的应用资源,包括:通过访问产线发布环境对应的产线资源地址,获取产线发布环境对应的应用资源。In a possible implementation manner, in response to the fact that the target release environment is the production line release environment, loading the application resources of the first sub-application for the target release environment includes: obtaining the production line resource address corresponding to the production line release environment to obtain the Application resources corresponding to the online publishing environment.

在一种可能的实施方式中,在接收对第一子应用的加载指令之前,该发布方法还包括:接收对第一子应用的配置指令;根据配置指令,在第一子应用的源配置文件中配置灰度发布环境的环境参数和/或产线发布环境的环境参数;对配置后的第一子应用的源配置文件进行编辑,得到灰度发布环境对应的应用资源和/或产线发布环境对应的应用资源。In a possible implementation manner, before receiving the loading instruction for the first sub-application, the issuing method further includes: receiving a configuration instruction for the first sub-application; according to the configuration instruction, in the source configuration file of the first sub-application Configure the environment parameters of the grayscale release environment and/or the environment parameters of the production line release environment in ; edit the configured source configuration file of the first sub-application to obtain the application resources and/or production line releases corresponding to the grayscale release environment Application resources corresponding to the environment.

第二方面,本公开提供一种微前端子应用的发布装置,该发布装置包括:处理模块,用于接收对第一子应用的加载指令;第一处理模块,用于根据加载指令,获取第一子应用的配置信息;第二处理模块,用于根据配置信息,确定第一子应用的目标发布环境;发送模块,用于加载第一子应用针对目标发布环境的应用资源,其中,目标发布环境为灰度发布环境或产线发布环境。In a second aspect, the present disclosure provides a publishing device for micro-frontend sub-applications. The publishing device includes: a processing module, configured to receive a loading instruction for the first sub-application; a first processing module, configured to obtain the first sub-application according to the loading instruction. Configuration information of a sub-application; a second processing module, configured to determine the target publishing environment of the first sub-application according to the configuration information; a sending module, used to load application resources of the first sub-application for the target publishing environment, wherein the target publishing environment The environment is grayscale release environment or production line release environment.

在一种可能的实施方式中,第二处理模块,还用于:根据配置信息,确定第一子应用是否启用灰度发布环境;当确定启用灰度发布环境时,确定目标发布环境为灰度发布环境;当确定不启用灰度发布环境时,确定目标发布环境为产线发布环境。In a possible implementation manner, the second processing module is further configured to: determine whether the first sub-application enables the grayscale publishing environment according to the configuration information; when it is determined that the grayscale publishing environment is enabled, determine that the target publishing environment is grayscale Release environment; when it is determined not to enable the grayscale release environment, determine that the target release environment is the production line release environment.

在一种可能的实施方式中,配置信息包括:第一指示信息和第一子应用的资源信息,其中,第一指示信息用于指示第一子应用是否启用灰度发布环境;资源信息包括:灰度发布环境对应的灰度资源地址和产线发布环境对应的产线资源地址。In a possible implementation manner, the configuration information includes: first indication information and resource information of the first sub-application, where the first indication information is used to indicate whether the first sub-application enables a gray scale release environment; the resource information includes: The grayscale resource address corresponding to the grayscale release environment and the production line resource address corresponding to the production line release environment.

在一种可能的实施方式中,当第一指示信息为第一值时,第一指示信息表示启用灰度发布环境;或,当第一指示信息为第二值时,第一指示信息表示不启用灰度发布环境。In a possible implementation manner, when the first indication information is the first value, the first indication information indicates that the grayscale publishing environment is enabled; or, when the first indication information is the second value, the first indication information indicates that the Enable grayscale publishing environment.

在一种可能的实施方式中,第一处理模块,还用于获取修改指令,修改指令用于将第一指示信息由指示启用灰度发布环境切换为指示不启用灰度发布环境;该发布装置还包括:修改模块,用于根据修改指令,修改第一指示信息。In a possible implementation manner, the first processing module is also used to obtain a modification instruction, and the modification instruction is used to switch the first indication information from indicating that the grayscale publishing environment is enabled to indicating that the grayscale publishing environment is not enabled; the publishing device It also includes: a modification module, configured to modify the first indication information according to the modification instruction.

在一种可能的实施方式中,响应于目标发布环境为灰度发布环境,发送模块,还用于:通过访问灰度发布环境对应的灰度资源地址,获取灰度发布环境对应的应用资源。In a possible implementation manner, in response to the target publishing environment being a grayscale publishing environment, the sending module is further configured to: obtain the application resource corresponding to the grayscale publishing environment by accessing the grayscale resource address corresponding to the grayscale publishing environment.

在一种可能的实施方式中,响应于目标发布环境为产线发布环境,发送模块,还用于:通过访问产线发布环境对应的产线资源地址,获取产线发布环境对应的应用资源。In a possible implementation manner, in response to the target release environment being the production line release environment, the sending module is further configured to: obtain the application resource corresponding to the production line release environment by accessing the production line resource address corresponding to the production line release environment.

在一种可能的实施方式中,处理模块,还用于接收对第一子应用的配置指令;装置还包括:配置模块,用于根据配置指令,在第一子应用的源配置文件中配置灰度发布环境的环境参数和/或产线发布环境的环境参数;编辑模块,用于对配置后的第一子应用的源配置文件进行编辑,得到灰度发布环境对应的应用资源和/或产线发布环境对应的应用资源。In a possible implementation manner, the processing module is further configured to receive a configuration instruction for the first sub-application; the device further includes: a configuration module configured to configure gray information in the source configuration file of the first sub-application according to the configuration instruction. The environment parameters of the high-level release environment and/or the environment parameters of the production line release environment; the editing module is used to edit the source configuration file of the first sub-application after configuration, and obtain the application resources and/or product corresponding to the gray-scale release environment. Application resources corresponding to the online publishing environment.

第三方面,本公开提供一种电子设备,该电子设备包括:用于存储处理器可执行指令的存储器;处理器;其中,处理器被配置为:用于执行可执行指令时,以实现如第一方面及其任一可能的实施方式的方法。In a third aspect, the present disclosure provides an electronic device, which includes: a memory for storing processor-executable instructions; a processor; wherein, the processor is configured to: when executing the executable instructions, to implement the following: The method of the first aspect and any possible implementation thereof.

第四方面,本公开提供一种计算机可读存储介质,其特征在于,可读存储介质存储有可执行程序,其中,可执行程序被处理器执行时实现如第一方面及其任一种可能的实施方式的方法。In a fourth aspect, the present disclosure provides a computer-readable storage medium, which is characterized in that the readable storage medium stores an executable program, wherein, when the executable program is executed by a processor, the first aspect and any possible method of implementation.

本公开提供的技术方案可以包括以下有益效果:The technical solution provided by the present disclosure may include the following beneficial effects:

在本公开中,根据第一子应用的配置信息,确定第一子应用的目标发布环境,并加载第一子应用的目标发布环境的应用资源,实现了微前端子应用的独立发布,降低了灰度成本。进一步地,通过部署微前端子应用的配置信息,确定微前端子应用是否进行灰度发布可以控制用户的访问节点,在灰度发布环境与产线发布环境之间平滑切换流量,提升灰度发布的灵活性。In this disclosure, according to the configuration information of the first sub-application, the target publishing environment of the first sub-application is determined, and the application resources of the target publishing environment of the first sub-application are loaded, so that the independent publishing of micro-front sub-applications is realized, reducing the gray cost. Furthermore, by deploying the configuration information of the micro-frontend sub-applications, it is determined whether the micro-frontend sub-applications can be released in grayscale, which can control the user's access node, smoothly switch traffic between the grayscale release environment and the production line release environment, and improve the grayscale release flexibility.

应当理解的是,以上的一般描述和后文的细节描述仅是示例性和解释性的,并不能限制本公开的保护范围。It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not intended to limit the scope of the present disclosure.

附图说明Description of drawings

此处的附图被并入说明书中并构成本说明书的一部分,示出了符合本公开的实施例,并与说明书一起用于解释本公开的原理。The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the disclosure and together with the description serve to explain the principles of the disclosure.

图1为本公开实施例中的微前端子应用的发布方法的第一种实施流程示意图;FIG. 1 is a schematic diagram of the first implementation flow of the release method of the micro-front end application in the embodiment of the present disclosure;

图2为本公开实施例中的微前端主应用的一种操作界面示意图;FIG. 2 is a schematic diagram of an operation interface of the main application of the micro front end in an embodiment of the present disclosure;

图3为本公开实施例中的微前端子应用的发布方法的第二种实施流程示意图;FIG. 3 is a schematic diagram of the second implementation flow of the publishing method of the micro-front terminal application in the embodiment of the present disclosure;

图4为本公开实施例中的微前端子应用的发布方法的第三种实施流程示意图;FIG. 4 is a schematic diagram of the third implementation flow of the release method of the micro-front end application in the embodiment of the present disclosure;

图5为本公开实施例中的微前端子应用的发布方法的第四种实施流程示意图;FIG. 5 is a schematic diagram of the fourth implementation flow of the release method of the micro-front end application in the embodiment of the present disclosure;

图6为本公开实施例中微前端子应用的发布装置的一种结构示意图;FIG. 6 is a schematic structural diagram of a release device for a micro-front end application in an embodiment of the present disclosure;

图7为本公开实施例中的一种电子设备的结构示意图。FIG. 7 is a schematic structural diagram of an electronic device in an embodiment of the present disclosure.

具体实施方式Detailed ways

这里将详细地对示例性实施例进行说明,其示例表示在附图中。下面的描述涉及附图时,除非另有表示,不同附图中的相同数字表示相同或相似的要素。以下示例性实施例中所描述的实施方式并不代表与本公开相一致的所有实施方式。相反,它们仅是与如所附权利要求书中所详述的、本公开的一些方面相一致的装置的例子。Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, the same numerals in different drawings refer to the same or similar elements unless otherwise indicated. The implementations described in the following exemplary examples do not represent all implementations consistent with the present disclosure. Rather, they are merely examples of devices consistent with aspects of the present disclosure as recited in the appended claims.

本领域技术人员在考虑说明书及实践这里公开的发明后,将容易想到本公开的其它实施方案。本公开旨在涵盖本公开的任何变型、用途或者适应性变化,这些变型、用途或者适应性变化遵循本公开的一般性原理并包括本公开未公开的本技术领域中的公知常识或惯用技术手段。说明书和实施例仅被视为示例性的,本公开的真正范围和精神由上面的权利要求指出。Other embodiments of the present disclosure will be readily apparent to those skilled in the art from consideration of the specification and practice of the invention disclosed herein. The present disclosure is intended to cover any modification, use or adaptation of the present disclosure. These modifications, uses or adaptations follow the general principles of the present disclosure and include common knowledge or conventional technical means in the technical field not disclosed in the present disclosure. . The specification and examples are to be considered exemplary only, with the true scope and spirit of the disclosure being indicated by the following claims.

为了说明本公开所述的技术方案,下面通过具体实施例来进行说明。In order to illustrate the technical solutions described in the present disclosure, specific examples are used below to illustrate.

互联网产品需要不停的进行升级,但系统升级总是伴随着风险,如新旧版本兼容的风险、用户使用习惯的改变而造成用户流失的风险以及系统宕机的风险等。为了避免这些风险,很多互联网产品都采用了灰度发布的策略,其主要思想就是把影响集中到一个点,然后再发散到一个面,出现意外情况时,很容易回退,避免造成大范围的影响。Internet products need to be continuously upgraded, but system upgrades are always accompanied by risks, such as the risk of compatibility between old and new versions, the risk of user loss due to changes in user usage habits, and the risk of system downtime. In order to avoid these risks, many Internet products have adopted the strategy of grayscale release. The main idea is to concentrate the impact on one point and then spread it to one surface. When unexpected situations occur, it is easy to roll back and avoid causing large-scale influences.

当增加新功能或采用改进技术的互联网产品上线发布前,如果新的发布影响面较大时,会考虑先切分部分用户流量进来,让这部分用户先体验新的互联网产品,开发人员可以根据这部分用户产生的数据对新的互联网产品进行不断优化,最终正式上线发布,然后再让所有用户使用。这种灰度发布方法降低了发布新功能的风险,实现了平滑的发布。Before Internet products with new functions or improved technologies are released online, if the new release has a large impact, they will consider dividing part of the user traffic first, so that these users can experience the new Internet products first. The data generated by this part of users continuously optimizes new Internet products, and finally officially releases them online, and then allows all users to use them. This grayscale release method reduces the risk of releasing new functions and achieves smooth release.

但是,传统的灰度发布方案,只针对微前端主应用,无法应用到微前端子应用的复杂场景,即缺少单个微前端子应用的灰度发布方案,也缺少微前端主应用和微前端子应用之间的应用灰度解耦的灰度发布方案。However, the traditional gray-scale publishing scheme is only for the main application of the micro-frontend, and cannot be applied to the complex scenarios of the micro-frontend terminal application. A gray-scale release scheme for application gray-scale decoupling between applications.

为了解决上述问题,本公开提供一种微前端子应用的发布方法,该发布方法可以应用于微前端主应用,以实现微前端子应用的独立发布。In order to solve the above problems, the present disclosure provides a micro-frontend sub-application release method, which can be applied to a micro-frontend main application to realize independent release of micro-frontend sub-applications.

需要说明的是,微前端是一种应用于前端的设计类型,它允许我们将其划分为更小的、独立的、半独立的应用程序,并一起工作,即将单页面前端应用(即微前端主应用)由单一的单体应用转变为把多个小型前端应用(即微前端子应用)聚合为一的应用。各个前端应用还可以独立开发、独立部署。To clarify, a micro frontend is a type of design applied to the frontend that allows us to divide it into smaller, independent, semi-independent applications and work together, i.e. a single page frontend The main application) is transformed from a single single application to an application that aggregates multiple small front-end applications (ie, micro front-end sub-applications). Each front-end application can also be developed and deployed independently.

图1为本公开实施例中的微前端子应用的发布方法的第一种实施流程示意图,参见图1所示,该发布方法可以包括:Fig. 1 is a schematic diagram of the first implementation flow of the release method of the micro-front end application in the embodiment of the present disclosure. Referring to Fig. 1, the release method may include:

S101,接收对第一子应用的加载指令。S101. Receive a loading instruction for a first sub-application.

可以理解的,在对微前端子应用进行灰度发布或产线发布之前,微前端主应用先接收来自用户的加载指令,该加载指令用于指示在若干个微前端子应用中加载其中一个子应用(即第一子应用),也就是说,第一子应用是用户选择进行加载的微前端子应用。It can be understood that before the micro-frontend sub-application is released in gray scale or production line, the micro-frontend main application first receives a loading instruction from the user, and the loading instruction is used to instruct to load one of the micro-frontend sub-applications. The application (ie, the first sub-application), that is to say, the first sub-application is a micro-frontier sub-application selected by the user to be loaded.

示例性的,图2为本公开实施例中的微前端主应用的一种操作界面示意图,参见图2所示,在用户登录微前端后,首先加载微前端主应用200,并显示微前端主应用的导航菜单201。在微前端主应用200的导航菜单201中展示有已注册的一个或者多个子应用,每一个子应用对应于导航菜单201中的一个控件。那么,用户可以对导航菜单201中“payment”这一控件进行点击操作,以表示用户请求加载“payment”这一子应用(即第一子应用)。Exemplarily, FIG. 2 is a schematic diagram of an operation interface of the micro-frontend main application in an embodiment of the present disclosure. Referring to FIG. Navigation menu 201 of the application. In the navigation menu 201 of the micro frontend main application 200 , there are one or more registered sub-applications, and each sub-application corresponds to a control in the navigation menu 201 . Then, the user may click on the "payment" control in the navigation menu 201 to indicate that the user requests to load the "payment" sub-application (ie, the first sub-application).

需要说明的是,微前端主应用与微前端子应用的接口为应用程序接口(application programming interface,API),微前端主应用通过API进入微前端子应用的可视界面202。微前端主应用与微前端子应用的接口也可以通过其它可以提供通用编程环境的装置来实现,本公开实施例对此不作具体限定。It should be noted that the interface between the micro-frontend main application and the micro-frontend sub-application is an application programming interface (application programming interface, API), and the micro-frontend main application enters the visual interface 202 of the micro-frontend sub-application through the API. The interface between the micro-frontend main application and the micro-frontend sub-application may also be implemented by other devices that can provide a general programming environment, which is not specifically limited in the embodiments of the present disclosure.

S102,根据加载指令,获取第一子应用的配置信息。S102. Acquire configuration information of the first sub-application according to the loading instruction.

可以理解的,微前端主应用接收到来自用户的指向第一子应用的加载指令之后,响应该加载指令,从微前端主应用的数据库中获取第一子应用的配置信息。It can be understood that after receiving a loading instruction directed to the first sub-application from the user, the micro-frontend main application obtains configuration information of the first sub-application from the database of the micro-frontend main application in response to the loading instruction.

示例性的,参见图2所示,微前端主应用200接收到用户对导航菜单201中的“payment”这一控件的点击操作,响应于这一点击操作,在数据库203中获取“payment”这一子应用的配置信息。Exemplarily, as shown in FIG. 2 , the micro-frontend main application 200 receives the user's click operation on the "payment" control in the navigation menu 201, and in response to the click operation, acquires the "payment" item in the database 203. Configuration information of a sub-application.

在一种可能的实施方式中,第一子应用的配置信息可以包括:第一指示信息和第一子应用的资源信息。其中,第一指示信息可以用于指示第一子应用是否启用灰度发布环境;第一子应用的资源信息可以包括:灰度发布环境对应的灰度资源地址和产线发布环境对应的产线资源地址。In a possible implementation manner, the configuration information of the first sub-application may include: first indication information and resource information of the first sub-application. Wherein, the first indication information may be used to indicate whether the first sub-application enables the gray-scale release environment; the resource information of the first sub-application may include: the gray-scale resource address corresponding to the gray-scale release environment and the production line corresponding to the production line release environment resource address.

需要说明的是,配置信息可以包括但不限于第一指示信息和第一子应用的资源信息。It should be noted that the configuration information may include but not limited to first indication information and resource information of the first sub-application.

示例性的,假设第一子应用为payment子应用,那么,payment子应用的配置信息可以包括:是否启用灰度发布环境:是(即第一指示信息,并且,该第一指示信息指示payment子应用启用灰度发布环境)、子应用名称:payment(即版本信息)、子应用产线地址:www-payment.app.com(即第一子应用的资源信息中的产线发布环境对应的产线资源地址)和子应用灰度地址:www-payment-gray.app.com(即第一子应用的资源信息中的灰度发布环境对应的灰度资源地址)。Exemplarily, assuming that the first sub-application is a payment sub-application, then the configuration information of the payment sub-application may include: whether to enable gray-scale publishing environment: yes (that is, the first indication information, and the first indication information indicates that the payment sub-application The application enables gray-scale publishing environment), sub-application name: payment (that is, version information), sub-application production line address: www-payment.app.com (that is, the product line corresponding to the production line release environment in the resource information of the first sub-application online resource address) and sub-application gray-scale address: www-payment-gray.app.com (that is, the gray-scale resource address corresponding to the gray-scale publishing environment in the resource information of the first sub-application).

在一种可能的实施方式中,当第一指示信息为第一值时,第一指示信息表示启用灰度发布环境;或,当第一指示信息为第二值时,第一指示信息表示不启用所述灰度发布环境。In a possible implementation manner, when the first indication information is the first value, the first indication information indicates that the grayscale publishing environment is enabled; or, when the first indication information is the second value, the first indication information indicates that the Enable the grayscale publishing environment.

可以理解的,第一指示信息用于指示第一子应用是否启用灰度发布环境,那么相应的,第一指示信息可以为对应于指示第一子应用启用灰度发布环境的第一值和指示第一子应用不启用灰度发布环境的第二值。It can be understood that the first indication information is used to indicate whether the first sub-application enables the gray-scale publishing environment, then correspondingly, the first indication information may be the first value corresponding to indicating that the first sub-application enables the gray-scale publishing environment and the indication The first sub-application does not enable the second value of the gray scale publishing environment.

示例性的,第一值的表现形式可以为“是否启用灰度发布环境:是”,第二值的表现形式可以为“是否启用灰度发布环境:否”。Exemplarily, the expression form of the first value may be "whether to enable the grayscale publishing environment: yes", and the expression form of the second value may be "whether to enable the grayscale publishing environment: no".

需要说明的是,上述第一指示信息的第一值和第二值的表现形式也可为其他形式,本公开实施例对此不作具体限定。It should be noted that, the expression forms of the first value and the second value of the first indication information may also be in other forms, which are not specifically limited in this embodiment of the present disclosure.

S103,根据配置信息,确定第一子应用的目标发布环境。S103. Determine a target publishing environment of the first sub-application according to the configuration information.

可以理解的,微前端主应用获取到微前端子应用的配置信息之后,可以根据该配置信息,确定第一子应用的目标发布环境。It can be understood that after the micro frontend main application obtains the configuration information of the micro frontend sub-application, it can determine the target publishing environment of the first sub-application according to the configuration information.

在一种可能的实施方式中,上述S103可以包括S301至S303,具体来说,图3为本公开实施例中的微前端子应用的发布方法的第二种实施流程示意图,参见图3所示,在执行S103时,执行S301至S303。In a possible implementation manner, the above S103 may include S301 to S303. Specifically, FIG. 3 is a schematic flowchart of the second implementation of the release method of the micro-front terminal application in the embodiment of the present disclosure, as shown in FIG. 3 , when executing S103, execute S301 to S303.

S301,根据配置信息,确定第一子应用是否启用灰度发布环境。S301. According to the configuration information, determine whether the first sub-application enables a gray-scale publishing environment.

可以理解的,微前端主应用获取第一子应用的配置信息后,根据配置信息中的第一指示信息,确定第一子应用是否启用灰度发布环境。It can be understood that, after obtaining the configuration information of the first sub-application, the main application of the micro frontend determines whether the first sub-application enables the gray-scale publishing environment according to the first indication information in the configuration information.

S302,当确定启用灰度发布环境时,确定目标发布环境为灰度发布环境。S302. When it is determined to enable the grayscale publishing environment, determine that the target publishing environment is the grayscale publishing environment.

可以理解的,配置信息中的第一指示信息指向启用灰度发布环境时,此时,微前端主应用可以确定第一子应用的目标发布环境为灰度发布环境。It can be understood that when the first indication information in the configuration information points to enabling the gray scale publishing environment, at this time, the micro frontend main application can determine that the target publishing environment of the first sub-application is the gray scale publishing environment.

示例性的,微前端主应用获取payment子应用的配置信息,payment子应用的第一指示信息为“是否启用灰度发布环境:是”,那么,微前端主应用确定payment子应用启用灰度发布环境。Exemplarily, the micro-frontend main application obtains the configuration information of the payment sub-application, and the first indication information of the payment sub-application is "whether to enable gray-scale publishing environment: yes", then the micro-frontend main application determines that the payment sub-application enables gray-scale publishing surroundings.

S303,当确定不启用灰度发布环境时,确定目标发布环境为产线发布环境。S303. When it is determined not to enable the grayscale release environment, determine that the target release environment is the production line release environment.

可以理解的,配置信息中的第一指示信息指向不启用灰度发布环境时,此时,微前端主应用可以确定第一子应用的目标发布环境为产线发布环境。It can be understood that when the first indication information in the configuration information indicates that the gray scale publishing environment is not enabled, at this time, the micro frontend main application can determine that the target publishing environment of the first sub-application is the production line publishing environment.

示例性的,微前端主应用获取collection子应用的配置信息,collection子应用的第一指示信息为“是否启用灰度发布环境:否”,那么,微前端主应用确定collection子应用启用产线发布环境。Exemplarily, the micro-frontend main application obtains the configuration information of the collection sub-application, and the first indication information of the collection sub-application is "whether to enable gray-scale release environment: No", then the micro-frontend main application determines that the collection sub-application enables production line release surroundings.

S104,加载第一子应用针对目标发布环境的应用资源。S104. Load the application resources of the first sub-application for the target publishing environment.

其中,目标发布环境为灰度发布环境或产线发布环境。Among them, the target release environment is the grayscale release environment or the production line release environment.

可以理解的,微前端主应用根据配置信息确定第一子应用的目标发布环境之后,可以根据配置信息中的资源信息加载第一子应用的应用资源。It can be understood that after the micro frontend main application determines the target publishing environment of the first sub-application according to the configuration information, it can load the application resources of the first sub-application according to the resource information in the configuration information.

在一实施例中,在执行上述S302之后,响应于目标发布环境为灰度发布环境,上述S104可以包括:通过访问灰度发布环境对应的灰度资源地址,获取灰度发布环境对应的应用资源。In an embodiment, after performing the above S302, in response to the target publishing environment being a grayscale publishing environment, the above S104 may include: obtaining the application resource corresponding to the grayscale publishing environment by accessing the grayscale resource address corresponding to the grayscale publishing environment .

示例性的,微前端主应用确定payment子应用的目标发布环境为灰度发布环境之后,便可以通过访问payment子应用的灰度资源地址,即www-payment-gray.app.com,来获取payment子应用的灰度发布环境的应用资源。Exemplarily, after the micro-frontend main application determines that the target publishing environment of the payment sub-application is the gray publishing environment, it can obtain the payment by accessing the gray resource address of the payment sub-application, namely www-payment-gray.app.com The application resources of the sub-application's gray scale publishing environment.

在另一实施例中,在执行上述S302之后,响应于目标发布环境为产线发布环境,上述S104可以包括:通过访问产线发布环境对应的产线资源地址,获取产线发布环境对应的应用资源。In another embodiment, after performing the above S302, in response to the target release environment being the production line release environment, the above S104 may include: obtaining the application corresponding to the production line release environment by accessing the production line resource address corresponding to the production line release environment resource.

示例性的,微前端主应用确定collection子应用的目标发布环境为产线发布环境之后,便可以通过访问collection子应用的产线资源地址,即www-collection.app.com,来获取collection子应用的产线发布环境的应用资源。Exemplarily, after the micro-frontend main application determines that the target release environment of the collection sub-application is the production line release environment, it can obtain the collection sub-application by accessing the production line resource address of the collection sub-application, namely www-collection.app.com The application resources of the production line release environment.

需要说明的是,应用资源可以包括图片、超文本标记语言(hyper text markuplanguage,HTML)、层叠样式表(cascading style sheets、CSS)和Java脚本(javascript,JS)等静态资源,静态资源可以存储于内容分发网络(content delivery network,CDN)中,通过CDN来加载静态资源;应用资源还可以包括在服务器端运行的程序、网页、组件等动态资源,微前端主应用可以将动态资源挂载于window.global上,微前端子应用通过直接调用window.global来加载动态资源。It should be noted that application resources may include static resources such as pictures, hypertext markup language (hyper text markup language, HTML), cascading style sheets (cascading style sheets, CSS) and Java script (javascript, JS), and static resources may be stored in In a content delivery network (CDN), static resources are loaded through the CDN; application resources can also include dynamic resources such as programs, web pages, and components running on the server side, and the main micro-frontend application can mount dynamic resources on the window On .global, the micro-frontend sub-application loads dynamic resources by directly calling window.global.

可以理解的,微前端子应用的发布环境是可以进行切换的,如由灰度发布环境切换至产线发布环境。那么,微前端主应用在切换微前端子应用的发布环境时,需要修改微前端子应用的配置信息。It can be understood that the publishing environment of the micro-frontend sub-application can be switched, such as switching from a gray scale publishing environment to a production line publishing environment. Then, when the micro-frontend main application switches the publishing environment of the micro-frontend sub-application, it needs to modify the configuration information of the micro-frontend sub-application.

在一种可能的实施方式中,上述微前端子应用的发布方法还可以包括:获取修改指令,修改指令用于将第一指示信息由指示启用灰度发布环境切换为指示不启用灰度发布环境;根据修改指令,修改第一指示信息。In a possible implementation manner, the publishing method of the above-mentioned micro-frontier sub-application may further include: obtaining a modification instruction, the modification instruction is used to switch the first indication information from indicating that the gray-scale publishing environment is enabled to indicating that the gray-scale publishing environment is not enabled ; Modify the first indication information according to the modification instruction.

可以理解的,微前端主应用将第一子应用的目标发布环境由灰度发布环境切换至产线发布环境时,微前端主应用获取来自用户的修改指令,然后根据上述修改指令修改第一子应用的配置信息中的第一指示信息。It can be understood that when the micro-frontend main application switches the target publishing environment of the first sub-application from the grayscale publishing environment to the production line publishing environment, the micro-frontend main application obtains modification instructions from the user, and then modifies the first sub-application according to the above modification instructions. The first indication information in the configuration information of the application.

示例性的,微前端主应用获取来自用户的修改指令,根据修改指令将payment子应用的第一指示信息,即“是否启用灰度发布环境:是”,修改为“是否启用灰度发布环境:否”。Exemplarily, the micro-frontend main application obtains a modification instruction from the user, and according to the modification instruction, modifies the first instruction information of the payment sub-application, that is, "whether to enable the gray-scale publishing environment: yes", to "whether to enable the gray-scale publishing environment: no".

执行上述S101至S104之前,微前端子应用的配置信息可以在微前端主应用中部署,此时,执行S401至S403的步骤。图4为本公开实施例中的微前端子应用的发布方法的第三种实施流程示意图,参见图4所示,在执行S101至S104之前,执行S401至S403。Before executing the above S101 to S104, the configuration information of the micro frontend sub-application can be deployed in the micro frontend main application, at this time, the steps of S401 to S403 are executed. FIG. 4 is a schematic flowchart of a third implementation of the release method of the micro front end application in the embodiment of the present disclosure. Referring to FIG. 4 , before executing S101 to S104 , execute S401 to S403 .

S401,接收对第一子应用的配置指令。S401. Receive a configuration instruction for a first sub-application.

可以理解的,部署微前端子应用的配置信息时,微前端主应用先接收对第一子应用的配置指令。It can be understood that when deploying the configuration information of the micro-frontend sub-application, the micro-frontend main application first receives a configuration instruction for the first sub-application.

S402,根据配置指令,在第一子应用的源配置文件中配置灰度发布环境的环境参数和/或产线发布环境的环境参数。S402. According to the configuration instruction, configure the environment parameters of the gray scale release environment and/or the environment parameters of the production line release environment in the source configuration file of the first sub-application.

可以理解的,当第一子应用要进行灰度发布时,微前端主应用根据配置指令,给第一子应用的源配置文件中配置灰度发布环境和产线发布环境的环境参数;当第一子应用只进行产线发布时,给第一子应用的源配置文件中配置产线发布环境的环境参数。It can be understood that when the first sub-application is to be released in grayscale, the micro frontend main application configures the environment parameters of the grayscale release environment and the production line release environment in the source configuration file of the first sub-application according to the configuration instructions; When a sub-application is only released to the production line, configure the environment parameters of the production line release environment in the source configuration file of the first sub-application.

示例性的,当payment子应用要进行灰度发布时,微前端主应用根据配置指令,在微前端项目根目录/config中找到payment子应用的gray.env.js文件(即源配置文件),配置环境变量,例:ENV_CONFIG=“gray”(即灰度发布环境的环境参数);同时,微前端主应用还根据配置指令,在微前端项目根目录/config中找到payment子应用的prod.env.js文件,配置环境变量,例:ENV_CONFIG=“prod”。当collection子应用要进行产线发布时,微前端主应用根据配置指令,在微前端项目根目录/config中找到collection子应用的prod.env.js文件,配置环境变量,例:ENV_CONFIG=“prod”。Exemplarily, when the payment sub-application is to be published in gray scale, the main application of the micro-frontend finds the gray. Configure environment variables, for example: ENV_CONFIG="gray" (i.e. the environment parameters of the gray release environment); at the same time, the micro-frontend main application also finds the prod.env of the payment sub-application in the micro-frontend project root directory /config according to the configuration instructions .js file, configure environment variables, for example: ENV_CONFIG="prod". When the collection sub-application is going to be released to the production line, the micro-frontend main application finds the prod.env.js file of the collection sub-application in the micro-frontend project root directory /config according to the configuration instructions, and configures environment variables, for example: ENV_CONFIG="prod ".

S403,对配置后的第一子应用的源配置文件进行编辑,得到灰度发布环境对应的应用资源和/或产线发布环境对应的应用资源。S403. Edit the configured source configuration file of the first sub-application to obtain the application resources corresponding to the gray scale release environment and/or the application resources corresponding to the production line release environment.

可以理解的,微前端主应用根据配置指令对第一子应用的的源配置文件进行配置之后,编辑配置后的源配置文件,就可以得到第一子应用的灰度发布环境对应的应用资源和/或产线发布环境对应的应用资源。It can be understood that after the main micro-frontend application configures the source configuration file of the first sub-application according to the configuration instructions, and then edits the configured source configuration file, the application resources and /or the application resources corresponding to the production line release environment.

示例性的,微前端主应用部署payment子应用的配置信息时,在配置好payment子应用的环境参数后,微前端主应用通过jenkins触发payment子应用的微前端程序打包命令,该微程序打包命令为“npm run build”,生成payment子应用的灰度发布环境代码和产线发布环境代码,上述代码中包含payment子应用的应用资源。Exemplarily, when the micro-frontend main application deploys the configuration information of the payment sub-application, after configuring the environment parameters of the payment sub-application, the micro-frontend main application triggers the micro-frontend program packaging command of the payment sub-application through jenkins, and the micro-program packaging command For "npm run build", generate the gray release environment code and production line release environment code of the payment sub-application. The above code contains the application resources of the payment sub-application.

下面以payment子应用的发布方法对上述发布方法进行具体说明。The above publishing method will be described in detail below using the publishing method of the payment sub-application.

图5为本公开实施例中的微前端子应用的发布方法的第四种实施流程示意图,参见图5所示,上述方法可以包括:Fig. 5 is a schematic diagram of the fourth implementation flow of the release method of the micro-front terminal application in the embodiment of the present disclosure. Referring to Fig. 5, the above method may include:

S501,微前端主应用接收来自用户的对payment子应用的配置指令。S501. The main micro-frontend application receives a configuration instruction for the payment sub-application from a user.

S502,微前端主应用根据S501的配置指令,配置payment子应用的灰度发布环境和产线发布环境的环境参数。S502. According to the configuration instruction in S501, the micro-frontend main application configures the environment parameters of the payment sub-application's gray scale release environment and production line release environment.

S503,微前端主应用编辑S502中的环境参数,生成payment子应用的灰度发布代码和产线发布环境代码,得到灰度发布环境的应用资源和产线发布环境的应用资源。S503, the micro-frontend main application edits the environment parameters in S502, generates grayscale release codes and production line release environment codes of the payment sub-application, and obtains application resources of the grayscale release environment and production line release environment.

S504,执行上述S503,即部署好payment子应用的配置信息后,再次登录微前端主应用,接收来自用户的对于payment子应用的记载指令。S504. Execute the above S503, that is, after deploying the configuration information of the payment sub-application, log in to the micro-frontend main application again, and receive a recording instruction for the payment sub-application from the user.

S505,微前端主应用根据S504中的加载指令,获取payment子应用的配置信息。S505, the micro-frontend main application acquires configuration information of the payment sub-application according to the loading instruction in S504.

S506,根据S505中的配置信息,确定payment子应用的目标发布环境为灰度发布环境。S506. According to the configuration information in S505, determine that the target publishing environment of the payment sub-application is the grayscale publishing environment.

S507,微前端主应用加载S503中的payment子应用的灰度发布环境的应用资源。S507, the micro-frontend main application loads the application resources of the gray scale publishing environment of the payment sub-application in S503.

S508,微前端主应用接收到来自用户的修改指令。S508, the micro frontend main application receives a modification instruction from the user.

S509,微前端主应用根据S508中的修改指令,将payment子应用的第一指示信息由第一值修改为第二值。S509, the micro frontend main application modifies the first indication information of the payment sub-application from the first value to the second value according to the modification instruction in S508.

S510,再次登录微端主应用,加载payment子应用的产线发布环境的应用资源。S510, log in to the micro-terminal main application again, and load the application resources of the production line publishing environment of the payment sub-application.

至此,便实现了微前端子应用的发布方法。So far, the release method of the micro-frontend sub-application has been realized.

在本公开实施例中,根据第一子应用的配置信息,确定第一子应用的目标发布环境,并加载第一子应用的目标发布环境的应用资源,实现了微前端子应用的独立发布,降低了灰度成本。进一步地,通过部署微前端子应用的配置信息,确定微前端子应用是否进行灰度发布可以控制用户的访问节点,在灰度发布环境与产线发布环境之间平滑切换流量,提升灰度发布的灵活性。In the embodiment of the present disclosure, according to the configuration information of the first sub-application, the target publishing environment of the first sub-application is determined, and the application resources of the target publishing environment of the first sub-application are loaded, realizing the independent publishing of micro-frontier sub-applications, Reduced gray scale cost. Furthermore, by deploying the configuration information of the micro-frontend sub-applications, it is determined whether the micro-frontend sub-applications can be released in grayscale, which can control the user's access node, smoothly switch traffic between the grayscale release environment and the production line release environment, and improve the grayscale release flexibility.

基于相同的发明构思,本公开实施例还提供一种微前端子应用的发布装置,该发布装置可以为电子设备中的芯片或者片上系统,还可以为电子设备中用于实现上述一个或者多个实施例及其任一种可能的实施方式所述方法的功能模块。该发布装置可以实现上述一个或者多个实施例及其任一种可能的实施方式所述电子设备所执行的功能,上述功能可以通过硬件执行相应的软件实现。这些硬件或软件包括一个或多个上述功能相应的模块。图6为本公开实施例中微前端子应用的发布装置的一种结构示意图,参见图6所示,微前端子应用的发布装置600可以包括:处理模块601,可以用于接收对第一子应用的加载指令;第一处理模块602,可以用于根据加载指令,获取第一子应用的配置信息;第二处理模块603,可以用于根据配置信息,确定第一子应用的目标发布环境;发送模块604,可以用于加载第一子应用针对目标发布环境的应用资源,其中,目标发布环境为灰度发布环境或产线发布环境。Based on the same inventive concept, an embodiment of the present disclosure also provides a release device for a micro-front end application. The release device can be a chip or a system-on-a-chip in an electronic device, and can also be used in an electronic device to implement one or more of the above. The functional modules of the method described in the embodiment and any possible implementation thereof. The publishing apparatus may realize the functions performed by the electronic device in the foregoing one or more embodiments and any possible implementation manner thereof, and the foregoing functions may be realized by executing corresponding software through hardware. These hardware or software include one or more modules with corresponding functions mentioned above. Fig. 6 is a schematic structural diagram of a release device for a micro-front end application in an embodiment of the present disclosure. Referring to Fig. 6 , the release device 600 for a micro-front end application may include: The loading instruction of the application; the first processing module 602 can be used to obtain the configuration information of the first sub-application according to the loading instruction; the second processing module 603 can be used to determine the target publishing environment of the first sub-application according to the configuration information; The sending module 604 may be configured to load application resources of the first sub-application for a target release environment, where the target release environment is a gray scale release environment or a production line release environment.

在一种可能的实施方式中,第二处理模块603,还可以用于:根据配置信息,确定第一子应用是否启用灰度发布环境;当确定启用灰度发布环境时,确定目标发布环境为灰度发布环境;当确定不启用灰度发布环境时,确定目标发布环境为产线发布环境。In a possible implementation manner, the second processing module 603 may also be configured to: determine whether the first sub-application enables the grayscale publishing environment according to the configuration information; when it is determined that the grayscale publishing environment is enabled, determine that the target publishing environment is Grayscale release environment; when it is determined not to enable the grayscale release environment, determine that the target release environment is the production line release environment.

在一种可能的实施方式中,配置信息可以包括:第一指示信息和第一子应用的资源信息,其中,第一指示信息可以用于指示第一子应用是否启用灰度发布环境;资源信息可以包括:灰度发布环境对应的灰度资源地址和产线发布环境对应的产线资源地址。In a possible implementation manner, the configuration information may include: first indication information and resource information of the first sub-application, where the first indication information may be used to indicate whether the first sub-application enables gray-scale release environment; resource information It may include: the grayscale resource address corresponding to the grayscale release environment and the production line resource address corresponding to the production line release environment.

在一种可能的实施方式中,当第一指示信息为第一值时,第一指示信息表示启用灰度发布环境;或,当第一指示信息为第二值时,第一指示信息表示不启用灰度发布环境。In a possible implementation manner, when the first indication information is the first value, the first indication information indicates that the grayscale publishing environment is enabled; or, when the first indication information is the second value, the first indication information indicates that the Enable grayscale publishing environment.

在一种可能的实施方式中,第一处理模块602,还可以用于获取修改指令,修改指令用于将第一指示信息由指示启用灰度发布环境切换为指示不启用灰度发布环境;微前端子应用的发布装置500还可以包括:修改模块,用于根据修改指令,修改第一指示信息。In a possible implementation manner, the first processing module 602 may also be used to obtain a modification instruction, and the modification instruction is used to switch the first indication information from indicating that the grayscale publishing environment is enabled to indicating that the grayscale publishing environment is not enabled; The apparatus 500 for issuing front-end sub-applications may further include: a modification module, configured to modify the first indication information according to the modification instruction.

在一种可能的实施方式中,响应于目标发布环境为灰度发布环境,发送模块504,还可以用于:通过访问灰度发布环境对应的灰度资源地址,获取灰度发布环境对应的应用资源。In a possible implementation manner, in response to the target publishing environment being a grayscale publishing environment, the sending module 504 may also be configured to: obtain the application corresponding to the grayscale publishing environment by accessing the grayscale resource address corresponding to the grayscale publishing environment resource.

在一种可能的实施方式中,响应于目标发布环境为产线发布环境,发送模块504,还可以用于:通过访问产线发布环境对应的产线资源地址,获取产线发布环境对应的应用资源。In a possible implementation manner, in response to the fact that the target release environment is the production line release environment, the sending module 504 may also be configured to: obtain the application corresponding to the production line release environment by accessing the production line resource address corresponding to the production line release environment resource.

在一种可能的实施方式中,处理模块501,还可以用于接收对第一子应用的配置指令;微前端子应用的发布装置500还可以包括:配置模块,可以用于根据配置指令,在第一子应用的源配置文件中配置灰度发布环境的环境参数和/或产线发布环境的环境参数;编辑模块,可以用于对配置后的第一子应用的源配置文件进行编辑,得到灰度发布环境对应的应用资源和/或产线发布环境对应的应用资源。In a possible implementation manner, the processing module 501 may also be configured to receive a configuration instruction for the first sub-application; the device 500 for releasing the micro-frontier sub-application may further include: a configuration module configured to, according to the configuration instruction, In the source configuration file of the first sub-application, the environment parameters of the gray release environment and/or the environment parameters of the production line release environment are configured; the editing module can be used to edit the configured source configuration file of the first sub-application to obtain The application resources corresponding to the gray release environment and/or the application resources corresponding to the production line release environment.

需要说明的是,处理模块601、第一处理模块602、第二处理模块603以及发送模块604的具体实现流程可参考图1至图5实施例的详细描述,为了说明书的简洁,这里不再赘述。It should be noted that, the specific implementation process of the processing module 601, the first processing module 602, the second processing module 603, and the sending module 604 can refer to the detailed descriptions of the embodiments in Fig. 1 to Fig. 5 , and for the sake of brevity, details are not repeated here. .

本公开实施例中提到的第一处理模块602和第二处理模块603可以为接收接口、接收电路或者接收器等;发送模块604可以为发送接口、发送电路或者发送器等;处理模块601可以为一个或者多个处理器。The first processing module 602 and the second processing module 603 mentioned in the embodiment of the present disclosure may be a receiving interface, a receiving circuit, or a receiver, etc.; the sending module 604 may be a sending interface, a sending circuit, or a transmitter, etc.; the processing module 601 may be for one or more processors.

基于相同的发明构思,本公开实施例提供一种电子设备,该电子设备可以为上述一个或者多个实施例中所述的微前端子应用的发布装置,也可以是数据处理芯片。图7为本公开实施例中的一种电子设备的结构示意图,参见图7所示,电子设备700,可以采用通用的计算机硬件,包括处理器701、存储器702。Based on the same inventive concept, an embodiment of the present disclosure provides an electronic device, which may be a release device for micro-front end applications described in one or more embodiments above, or may be a data processing chip. FIG. 7 is a schematic structural diagram of an electronic device in an embodiment of the present disclosure. Referring to FIG. 7 , the electronic device 700 may use general-purpose computer hardware, including a processor 701 and a memory 702 .

在一种可能的实施方式中,至少一个处理器701可以构成具有对一个或多个输入执行逻辑运算的电路的任何物理设备。例如,至少一个处理器可以包括一个或多个集成电路(integrated circuit,IC),包括专用集成电路(application specific integratedcircuit,ASIC)、微芯片、微控制器、微处理器、中央处理单元(central processing unit,CPU)的全部或部分、图形处理单元(graphics processing unit,GPU)、数字信号处理器(digital signal process,DSP)、现场可编程门阵列(field programmable gate array,FPGA)或者适于执行指令或执行逻辑运算的其它电路。由至少一个处理器执行的指令可以例如被预加载到与控制器集成的或嵌入在控制器中的存储器中,或者可以存储在分离的存储器中。存储器可以包括随机存取存储器(random access memory,RAM)、只读存储器(read-only memory,ROM)、硬盘、光盘、磁介质、闪存,其它永久、固定或易失性存储器,或者能够存储指令的任何其它机制。在一些实施例中,至少一个处理器可以包括多于一个处理器。每个处理器可以具有相似的结构,或者处理器可以具有彼此电连接或断开的不同构造。例如,处理器可以是分离的电路或集成在单个电路中。当使用多于一个处理器时,处理器可以被配置为独立地或协作地操作。处理器可以以电、磁、光学、声学、机械或通过允许它们交互的其它手段来耦合。根据本公开的一个实施例,本公开还提供了一种计算机可读存储介质,其上存储有计算机指令,该指令被处理器执行上述标定方法的步骤。存储器702可以包括以易失性和/或非易失性存储器形式的计算机存储媒体,如只读存储器和/或随机存取存储器。存储器702可以存储操作系统、应用程序、其他程序模块、可执行代码、程序数据、用户数据等。In a possible implementation manner, at least one processor 701 may constitute any physical device having a circuit for performing logical operations on one or more inputs. For example, at least one processor may include one or more integrated circuits (ICs), including application specific integrated circuits (ASICs), microchips, microcontrollers, microprocessors, central processing units (central processing units) unit (CPU), all or part of a graphics processing unit (graphics processing unit, GPU), digital signal processor (digital signal process, DSP), field programmable gate array (field programmable gate array, FPGA) or suitable for executing instructions Or other circuits that perform logic operations. The instructions executed by the at least one processor may, for example, be preloaded into a memory integrated with or embedded in the controller, or may be stored in a separate memory. The memory may include random access memory (RAM), read-only memory (ROM), hard disk, optical disk, magnetic media, flash memory, other permanent, fixed, or volatile memory, or capable of storing instructions any other mechanism. In some embodiments, at least one processor may include more than one processor. Each processor may have a similar structure, or the processors may have different configurations that are electrically connected or disconnected from each other. For example, a processor may be a separate circuit or integrated in a single circuit. When more than one processor is used, the processors may be configured to operate independently or cooperatively. Processors may be coupled electrically, magnetically, optically, acoustically, mechanically or by other means allowing their interaction. According to an embodiment of the present disclosure, the present disclosure also provides a computer-readable storage medium, on which computer instructions are stored, and the instructions are executed by a processor to perform the steps of the above-mentioned calibration method. Memory 702 may include computer storage media in the form of volatile and/or non-volatile memory, such as read-only memory and/or random-access memory. Memory 702 may store operating systems, application programs, other program modules, executable code, program data, user data, and the like.

此外,上述存储器702中存储有用于实现图6中的处理模块601、第一处理模块602、第二处理模块603和发送模块604的功能的计算机执行指令。图6中的处理模块601、第一处理模块602、第二处理模块603和发送模块604的功能/实现过程均可以通过图7中的处理器701调用存储器702中存储的计算机执行指令来实现,具体实现过程和功能参考上述相关实施例。In addition, the memory 702 stores computer-executed instructions for realizing the functions of the processing module 601 , the first processing module 602 , the second processing module 603 and the sending module 604 in FIG. 6 . The functions/implementation processes of the processing module 601, the first processing module 602, the second processing module 603 and the sending module 604 in FIG. 6 can all be implemented by calling the computer execution instructions stored in the memory 702 by the processor 701 in FIG. 7, For the specific implementation process and functions, refer to the related embodiments above.

基于相同的发明构思,本公开实施例提供一种电子设备,包括:存储器,存储有计算机可执行指令;处理器,与存储器相连,用于通过执行计算机可执行指令,并能够实现如上述一个或者多个实施例所述的微前端子应用的发布方法。Based on the same inventive concept, an embodiment of the present disclosure provides an electronic device, including: a memory storing computer-executable instructions; a processor connected to the memory for executing the computer-executable instructions, and capable of implementing the above one or The release method of the micro-frontier sub-application described in multiple embodiments.

基于相同的发明构思,本公开实施例提供一种计算机可读存储介质,计算机可读存储介质存储有计算机可执行指令,计算机可执行指令被处理器执行后,能够实现如上述一个或者多个实施例所述的微前端子应用的发布方法。Based on the same inventive concept, an embodiment of the present disclosure provides a computer-readable storage medium, the computer-readable storage medium stores computer-executable instructions, and after the computer-executable instructions are executed by a processor, one or more implementations as described above can be implemented. The release method of the micro front end application described in the example.

本领域技术人员可以理解,上述实施例中各步骤的序号的大小并不意味着执行顺序的先后,各过程的执行顺序应以其功能和内在逻辑确定,而不应对本公开实施例的实施过程构成任何限定。Those skilled in the art can understand that the sequence numbers of the steps in the above embodiments do not mean the order of execution, and the execution order of each process should be determined by its functions and internal logic, rather than the implementation process of the embodiments of the present disclosure. constitute any limitation.

以上所述实施例仅用以说明本公开的技术方案,而非对其限制;尽管参照前述实施例对本公开进行了详细的说明,本领域的普通技术人员应当理解,其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本公开各实施例技术方案的精神和范围,均应包含在本公开的保护范围之内。The above-described embodiments are only used to illustrate the technical solutions of the present disclosure, rather than to limit them; although the present disclosure has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still implement the foregoing embodiments Modifications to the technical solutions described in the examples, or equivalent replacements for some of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the various embodiments of the present disclosure, and should be included in the within the protection scope of the present disclosure.

Claims (18)

1. A method for issuing micro front end application, which is applied to micro front end main application, the method comprises:
receiving a load instruction for a first sub-application;
acquiring configuration information of the first sub-application according to the loading instruction;
determining a target issuing environment of the first sub-application according to the configuration information;
loading the application resources of the first sub-application for the target publishing environment,
the target issuing environment is a gray level issuing environment or a production line issuing environment.
2. The method of claim 1, wherein determining the target publishing environment of the first sub-application according to the configuration information comprises:
determining whether the first sub-application enables the gray scale publishing environment according to the configuration information;
when the gray scale issuing environment is determined to be started, determining the target issuing environment as the gray scale issuing environment;
and when the gray scale publishing environment is determined not to be started, determining the target publishing environment as the production line publishing environment.
3. The method of claim 1, wherein the configuration information comprises: first indication information and resource information of the first sub-application, wherein,
the first indication information is used for indicating whether the first sub-application enables a gray scale release environment or not;
the resource information includes: and the gray resource address corresponding to the gray release environment and the production line resource address corresponding to the production line release environment.
4. The method according to claim 3, wherein when the first indication information is a first value, the first indication information represents that the grayness issue environment is enabled; or, when the first indication information is a second value, the first indication information represents that the gray scale issuing environment is not enabled.
5. The method of claim 3, further comprising:
acquiring a modification instruction, wherein the modification instruction is used for switching the first indication information from indicating to enable the gray scale issuing environment to indicating not to enable the gray scale issuing environment;
and modifying the first indication information according to the modification instruction.
6. The method of claim 3, wherein in response to the target publication environment being the grayscale publication environment, the loading the application resources of the first sub-application for the target publication environment comprises:
and acquiring the application resource corresponding to the gray scale release environment by accessing the gray scale resource address corresponding to the gray scale release environment.
7. The method of claim 3, wherein, in response to the target publishing environment being the production line publishing environment, the loading the application resources of the first sub-application for the target publishing environment comprises:
and acquiring the application resource corresponding to the production line publishing environment by accessing the production line resource address corresponding to the production line publishing environment.
8. The method of claim 1, wherein prior to said receiving a load instruction for a first sub-application, the method further comprises:
receiving a configuration instruction for the first sub-application;
according to the configuration instruction, configuring the environmental parameters of the gray scale release environment and/or the environmental parameters of the production line release environment in the source configuration file of the first sub-application;
and editing the configured source configuration file of the first sub-application to obtain the application resource corresponding to the gray scale release environment and/or the application resource corresponding to the production line release environment.
9. A device for issuing micro front end applications, the device comprising:
the processing module is used for receiving a loading instruction of the first sub-application;
the first processing module is used for acquiring the configuration information of the first sub-application according to the loading instruction;
the second processing module is used for determining a target issuing environment of the first sub-application according to the configuration information;
a sending module, configured to load application resources of the first sub-application for the target publishing environment,
the target issuing environment is a gray level issuing environment or a production line issuing environment.
10. The apparatus of claim 9, wherein the second processing module is further configured to: determining whether the first sub-application enables the gray scale publishing environment according to the configuration information; when the gray scale issuing environment is determined to be started, determining the target issuing environment as the gray scale issuing environment; and when the gray scale release environment is determined not to be started, determining that the target release environment is the production line release environment.
11. The apparatus of claim 9, wherein the configuration information comprises: first indication information and resource information of the first sub-application, wherein the first indication information is used for indicating whether the first sub-application enables a grey scale release environment or not; the resource information includes: the gray resource address corresponding to the gray release environment and the production line resource address corresponding to the production line release environment.
12. The apparatus of claim 11, wherein when the first indication information is a first value, the first indication information indicates that the grayscale issuing environment is enabled; or, when the first indication information is a second value, the first indication information represents that the gray scale issuing environment is not enabled.
13. The apparatus according to claim 11, wherein the first processing module is further configured to obtain a modification instruction, where the modification instruction is configured to switch the first indication information from indicating that the grayscale issuing environment is enabled to indicating that the grayscale issuing environment is not enabled;
the device further comprises: and the modification module is used for modifying the first indication information according to the modification instruction.
14. The apparatus of claim 11, wherein in response to the target publication environment being the grayscale publication environment, the sending module is further configured to: and acquiring the application resource corresponding to the gray scale release environment by accessing the gray scale resource address corresponding to the gray scale release environment.
15. The apparatus of claim 11, wherein in response to the target publishing environment being the production line publishing environment, the sending module is further configured to: and obtaining the application resource corresponding to the production line release environment by accessing the production line resource address corresponding to the production line release environment.
16. The apparatus of claim 9, wherein the processing module is further configured to receive a configuration instruction for the first sub-application;
the device further comprises: the configuration module is used for configuring the environmental parameters of the gray scale release environment and/or the environmental parameters of the production line release environment in the source configuration file of the first sub-application according to the configuration instruction; and the editing module is used for editing the configured source configuration file of the first sub-application to obtain the application resource corresponding to the gray scale release environment and/or the application resource corresponding to the production line release environment.
17. An electronic device, comprising:
a memory for storing processor-executable instructions;
a processor; wherein the processor is configured to: when being executed, implement the method of any one of claims 1 to 8.
18. A computer-readable storage medium, characterized in that the readable storage medium stores an executable program, wherein the executable program, when executed by a processor, implements the method of any one of claims 1 to 8.
CN202211046903.4A 2022-08-30 2022-08-30 Micro front terminal application publishing method, device, equipment and storage medium Pending CN115408050A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211046903.4A CN115408050A (en) 2022-08-30 2022-08-30 Micro front terminal application publishing method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211046903.4A CN115408050A (en) 2022-08-30 2022-08-30 Micro front terminal application publishing method, device, equipment and storage medium

Publications (1)

Publication Number Publication Date
CN115408050A true CN115408050A (en) 2022-11-29

Family

ID=84162417

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211046903.4A Pending CN115408050A (en) 2022-08-30 2022-08-30 Micro front terminal application publishing method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN115408050A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116450535A (en) * 2023-06-20 2023-07-18 中国联合网络通信集团有限公司 Sub-application debugging method and device, computer equipment and storage medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116450535A (en) * 2023-06-20 2023-07-18 中国联合网络通信集团有限公司 Sub-application debugging method and device, computer equipment and storage medium
CN116450535B (en) * 2023-06-20 2023-08-29 中国联合网络通信集团有限公司 Sub-application debugging method, device, computer equipment and storage medium

Similar Documents

Publication Publication Date Title
JP2022525831A (en) Page pre-rendering methods, devices, electronic devices, computer programs and storage media
CN102362261B (en) Enter content into the application via a web browser
US20130219383A1 (en) Using an Application Cache to Update Resources of Installed Applications
JP6728691B2 (en) Software and firmware download and installation support calculation processing system and software download support method
CN104038520B (en) A kind of multi version distributive resource managing method and system
US10789111B2 (en) Message oriented middleware with integrated rules engine
CN104572114A (en) Binding device, application updating device and method and application
KR101907837B1 (en) Application activation framework
CN101944032A (en) Microware updating method, client, server and system
WO2017107851A1 (en) Method and device for releasing and updating desktop application component
CN114490103A (en) Operating system interface calling method, device and electronic device
CN114020490B (en) Inter-process communication system, method and computing device
EP3289451A1 (en) Cross-platform command extensibility
JP2021064359A (en) Web page processing method, web page processing device, electronic device, non-temporary computer-readable storage medium, and computer program
EP3872630A2 (en) Request processing method and apparatus, electronic device, and computer storage medium
CN112235132B (en) Method, device, medium and server for dynamically configuring service
CN113656041A (en) Data processing method, apparatus, equipment and storage medium
US11379201B2 (en) Wrapping method, registration method, device, and rendering apparatus
CN113127361A (en) Application program development method and device, electronic equipment and storage medium
CN115408050A (en) Micro front terminal application publishing method, device, equipment and storage medium
US10628513B2 (en) Providing isolated extensibility for webpages with a unified manifest and omni-accessible platform script
CN117707583A (en) Page updating method, electronic device and page updating system
CN113805878A (en) Plug-in engineering method, device, computer system and medium
US20230409306A1 (en) Systems and methods for independent application design and deployment to platform host
CN113760384B (en) Application environment switching method, device, computer system and readable storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
TA01 Transfer of patent application right
TA01 Transfer of patent application right

Effective date of registration: 20241231

Address after: 6th Floor, No. 130, Lane 91, Eshan Road, China (Shanghai) Pilot Free Trade Zone, Pudong New Area, Shanghai, 200127

Applicant after: Shanghai Fupei Technology Co.,Ltd.

Country or region after: China

Address before: 100193 room 402-1, 4th floor, building 23, yard 8, Dongbeiwang West Road, Haidian District, Beijing

Applicant before: BEIJING SHAREIT INFORMATION TECHNOLOGY Co.,Ltd.

Country or region before: China