Micro-front-end system gray release method and device, computer device and medium

By obtaining user information and determining the grayscale identifiers of the main application and sub-applications in the micro-frontend system, and selecting and publishing the corresponding version files, the problem of inaccurate results in the traditional grayscale release method is solved, achieving higher release accuracy and efficiency.

CN115421771BActive Publication Date: 2026-05-12SHENZHEN KEMAI TECH
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
SHENZHEN KEMAI TECH
Filing Date
2022-08-31
Publication Date
2026-05-12

AI Technical Summary

Technical Problem

Traditional canary deployment methods have the problem of inaccurate deployment results in micro-frontend systems, especially after the user's terminal cookies are cleared, the user may be assigned to a completely different application version than before.

Method used

By obtaining user information, the main grayscale identifier of the main application and the sub-grayscale identifier of each sub-application in the micro-frontend system are determined, thereby selecting and publishing the corresponding version file from the candidate version file, ensuring that the grayscale release results match the user information.

Benefits of technology

It improves the accuracy of canary releases in micro-frontend systems, ensures that release results match user information, reduces the cost of main application integration, and solves the style isolation problem.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115421771B_ABST
    Figure CN115421771B_ABST
Patent Text Reader

Abstract

The application relates to a micro-frontend system gray release method and device, computer equipment, a computer readable storage medium and a computer program product. The method comprises the following steps: obtaining user information, and determining a main gray identifier of a main application and a sub gray identifier corresponding to each sub application in a micro-frontend system according to the user information; determining and releasing a main application version file corresponding to the main gray identifier from each candidate main application version file of the main application; and in response to a sub application access request initiated in a running environment of a main application program corresponding to the main application version file, obtaining a sub application version file of a to-be-accessed sub application according to a sub gray identifier of the to-be-accessed sub application corresponding to the sub application access request, and releasing the sub application version file. The above method can improve the accuracy of the release result.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and in particular to a method, apparatus, computer equipment, computer-readable storage medium, and computer program product for grayscale deployment of a micro-frontend system. Background Technology

[0002] With the rapid development of computer technology, front-end development projects are becoming increasingly large-scale, and product functions are becoming increasingly complex, giving rise to micro-frontends. Micro-frontends borrow the concept of back-end microservices, breaking down a large front-end project into smaller projects, each fully capable of independent development and operation. The entire system is achieved through the collaborative efforts of these smaller projects, enabling the display and interaction of all pages. Canary release refers to releasing a new version of an application to a subset of users first, allowing for subsequent updates based on user feedback before gradually expanding the release to all users.

[0003] Traditional canary deployment methods rely on cookies stored on the user's terminal to verify and switch to the target version. However, when applied to micro-frontend systems, once the user's cookies are cleared, the user needs to re-enter via Nginx's weighted round-robin, potentially being assigned a completely different application version than before. Therefore, applying traditional canary deployment methods to micro-frontend systems suffers from inaccurate deployment results. Summary of the Invention

[0004] Therefore, it is necessary to provide a method, apparatus, computer equipment, computer-readable storage medium, and computer program product for gray-scale deployment of micro-frontend systems that can improve the accuracy of deployment results, in order to address the above-mentioned technical problems.

[0005] Firstly, this application provides a method for canary deployment of a micro-frontend system. The method includes:

[0006] Obtain user information, and determine the main grayscale identifier of the main application in the micro-frontend system and the corresponding sub-grayscale identifier of each sub-application based on the user information.

[0007] From each candidate main application version file of the main application, determine and publish the main application version file corresponding to the main grayscale identifier;

[0008] In response to a sub-application access request, the sub-application version file of the sub-application to be accessed is obtained according to the sub-grayscale identifier of the sub-application to be accessed corresponding to the sub-application access request; the sub-application access request is initiated in the runtime environment of the main application corresponding to the main application version file;

[0009] Release the sub-application version file.

[0010] In some embodiments, obtaining the sub-application version file of the sub-application to be accessed based on the sub-grayscale identifier of the sub-application to be accessed corresponding to the sub-application access request includes:

[0011] Determine the sub-application to be accessed requested by the sub-application access request, and the sub-grayscale identifier of the sub-application to be accessed;

[0012] The file access address of the sub-application to be accessed is determined based on the sub-grayscale identifier of the sub-application to be accessed;

[0013] Based on the file access address, obtain the sub-application version file of the sub-application to be accessed.

[0014] In some embodiments, the method further includes:

[0015] Obtain the initial access address and candidate sub-grayscale identifier corresponding to each of the sub-applications;

[0016] For each sub-application, each candidate sub-grayscale identifier is added to the initial access address to obtain multiple candidate access addresses corresponding to each sub-application.

[0017] In some embodiments, determining the file access address of the sub-application to be accessed based on its sub-grayscale identifier includes:

[0018] Extract the candidate sub-grayscale identifier carried in each candidate access address corresponding to the sub-application to be accessed;

[0019] Based on the identifier matching result obtained by matching the sub-grayscale identifier of the sub-application to be accessed with each of the candidate sub-grayscale identifiers, the file access address of the sub-application to be accessed is determined from each of the candidate access addresses.

[0020] In some embodiments, determining the main grayscale identifier of the main application in the micro-frontend system and the corresponding sub-grayscale identifier of each sub-application based on the user information includes:

[0021] Obtain the correspondence between user information and the main grayscale identifier, as well as the correspondence between user information and the sub-grayscale identifier;

[0022] Based on the acquired user information and the correspondence between the user information and the main grayscale identifier, the main grayscale identifier of the main application in the micro-frontend system is determined.

[0023] Based on the acquired user information and the correspondence between user information and sub-grayscale identifiers, the sub-grayscale identifier corresponding to each sub-application in the micro-frontend system is determined.

[0024] In some embodiments, the user information includes user identification information. In this embodiment, the method further includes;

[0025] Obtain historical user identification information and the historical user equipment information corresponding to the historical user identification information;

[0026] Based on the device matching results obtained by matching the historical user device information with the device requirements for grayscale version release of the micro-frontend system, a correspondence between user identification information and main grayscale identifier, as well as a correspondence between user identification information and sub-grayscale identifier, is established.

[0027] Secondly, this application provides a canary deployment device for a micro-frontend system. The device includes:

[0028] The grayscale identifier determination module is used to obtain user information and determine the main grayscale identifier of the main application in the micro-frontend system and the corresponding sub-grayscale identifier of each sub-application based on the user information.

[0029] The main application publishing module is used to determine and publish the main application version file corresponding to the main grayscale identifier from each candidate main application version file of the main application;

[0030] The sub-application version file acquisition module is used to respond to a sub-application access request and acquire the sub-application version file of the sub-application to be accessed according to the sub-grayscale identifier of the sub-application to be accessed corresponding to the sub-application access request; the sub-application access request is initiated in the runtime environment of the main application corresponding to the main application version file.

[0031] The sub-application publishing module is used to publish the version file of the sub-application.

[0032] In some embodiments, the sub-application version file acquisition module includes: a sub-application to be accessed determination unit, configured to determine the sub-application to be accessed requested by the sub-application access request, and the sub-grayscale identifier of the sub-application to be accessed; a file access address determination unit, configured to determine the file access address of the sub-application to be accessed based on the sub-grayscale identifier of the sub-application to be accessed; and a sub-application version file determination unit, configured to acquire the sub-application version file of the sub-application to be accessed based on the file access address.

[0033] In some embodiments, the apparatus further includes a candidate access address configuration module, configured to: obtain the initial access address and candidate sub-grayscale identifier corresponding to each of the sub-applications; and for each sub-application, add each candidate sub-grayscale identifier to the initial access address to obtain multiple candidate access addresses corresponding to each sub-application.

[0034] In some embodiments, the file access address determination unit is specifically used to: extract the candidate sub-grayscale identifier carried in each candidate access address corresponding to the sub-application to be accessed; and determine the file access address of the sub-application to be accessed from each candidate access address based on the identifier matching result obtained by matching the sub-grayscale identifier of the sub-application to be accessed with each of the candidate sub-grayscale identifiers.

[0035] In some embodiments, the grayscale identifier determination module is specifically used to: obtain the correspondence between user information and the main grayscale identifier, and the correspondence between user information and the sub-grayscale identifier; determine the main grayscale identifier of the main application in the micro-frontend system based on the obtained user information and the correspondence between user information and the main grayscale identifier; and determine the sub-grayscale identifier corresponding to each sub-application in the micro-frontend system based on the obtained user information and the correspondence between user information and the sub-grayscale identifier.

[0036] In some embodiments, the user information includes user identification information. In this embodiment, the device further includes a correspondence determination module, configured to: acquire historical user identification information and historical user device information corresponding to the historical user identification information; and establish a correspondence between user identification information and a primary grayscale identifier, and a correspondence between user identification information and a secondary grayscale identifier, based on a device matching result obtained by matching the historical user device information with the device requirements for grayscale version release of the micro-frontend system.

[0037] Thirdly, this application also provides a computer device. The computer device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement the aforementioned micro-frontend system canary deployment method.

[0038] Fourthly, this application also provides a computer-readable storage medium. The computer-readable storage medium stores a computer program thereon, which, when executed by a processor, implements the aforementioned micro-frontend system canary deployment method.

[0039] Fifthly, this application also provides a computer program product. The computer program product includes a computer program that, when executed by a processor, implements the aforementioned micro-frontend system canary deployment method.

[0040] The aforementioned micro-frontend system canary deployment method, apparatus, computer equipment, computer-readable storage medium, and computer program product acquire user information and determine the main canary identifier of the main application and the corresponding sub-canary identifiers for each sub-application based on the user information. Then, from the candidate main application version files of the main application, the main application version file corresponding to the main canary identifier is determined and published. Next, in response to a sub-application access request initiated in the runtime environment of the main application corresponding to the main application version file, the sub-application version file of the sub-application to be accessed is obtained based on the sub-canary identifier of the sub-application to be accessed corresponding to the sub-application access request, and the sub-application version file is published. Different main and sub-canary identifiers can be configured for different user information, thereby determining the main application version file corresponding to the main canary identifier and the sub-application version file corresponding to the sub-canary identifier. This ensures the matching degree between the canary deployment results of the micro-frontend system and the user information, which is beneficial to improving the accuracy of the deployment results. Attached Figure Description

[0041] Figure 1 This is an application environment diagram of the canary deployment method of the micro-frontend system in some embodiments;

[0042] Figure 2 This is a flowchart illustrating the canary deployment method of the micro-frontend system in some embodiments;

[0043] Figure 3 This is a flowchart illustrating the canary deployment method of the micro-frontend system in some other embodiments;

[0044] Figure 4 This is a schematic diagram illustrating the canary deployment process of a micro-frontend system based on the Qiankun architecture in some embodiments;

[0045] Figure 5 Here are some structural block diagrams of the grayscale publishing device for the micro-frontend system in certain embodiments;

[0046] Figure 6 This is a diagram showing the internal structure of a computer device in some embodiments. Detailed Implementation

[0047] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.

[0048] The micro-frontend system canary deployment method provided in this application embodiment can be applied to, for example... Figure 1In the application environment shown, terminal 102 communicates with server 104 via a network. A data storage system can store the data that server 104 needs to process. The data storage system can be integrated onto server 104, or it can be located in the cloud or on other servers. Terminal 102 includes, but is not limited to, mobile phones, computers, smart voice interaction devices, smart home appliances, and in-vehicle terminals. Server 104 can be implemented using a standalone server or a server cluster consisting of multiple servers.

[0049] Specifically, a micro-frontend system is installed on terminal 102, which can access the main application and sub-applications within the micro-frontend system. This micro-frontend system refers to a frontend application developed based on a micro-frontend architecture. During the canary release of the micro-frontend system, server 104 obtains user information and determines the main canary identifier of the main application and the corresponding sub-canary identifier for each sub-application based on the user information. Then, it determines and publishes the main application version file corresponding to the main canary identifier from the candidate main application version files of the main application. Finally, in response to sub-application access requests initiated within the runtime environment of the main application corresponding to the main application version file, it obtains the sub-application version file of the sub-application to be accessed based on the sub-canary identifier of the sub-application to be accessed corresponding to the sub-application access request, and publishes the sub-application version file.

[0050] In some embodiments, such as Figure 2 As shown, a method for canary deployment of a micro-frontend system is provided. This method can be executed by a terminal or a server, or by both a terminal and a server. This method can be applied to... Figure 1 Taking server 104 as an example, the following steps are included:

[0051] Step S202: Obtain user information and determine the main grayscale identifier of the main application in the micro-frontend system and the corresponding sub-grayscale identifier of each sub-application based on the user information.

[0052] In this context, "micro-frontend system" refers to a frontend application developed based on a micro-frontend architecture. "User information" refers to the information of users within the micro-frontend system. This user information includes, but is not limited to, user identification information, user device information, basic attribute information, and behavioral information. User device information includes operating system type, device RAM, and remaining storage space. Basic attribute information includes name, gender, age, and city of residence. Behavioral information includes browsing behavior information and click behavior information. It should be noted that the user information (including but not limited to user device information and user personal information) and data (including but not limited to data used for analysis, stored data, and displayed data) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use, and processing of related data must comply with the relevant laws, regulations, and standards of the relevant countries and regions.

[0053] Furthermore, a micro-frontend system typically includes a main application and multiple sub-applications that interface with the main application. Within the main application's runtime environment, the terminal can load and run any sub-application, enabling access to it. Grayscale identifiers refer to identification information used to identify the version of an application. Specifically, in this application, grayscale identifiers include a main grayscale identifier to identify the main application version and sub-grayscale identifiers to identify the sub-application versions. Application versions include official versions and grayscale versions under test; correspondingly, grayscale identifiers can include official version identifiers and grayscale version identifiers. In a specific application, the official version identifier can be represented by "pro," and the grayscale version identifier can be represented by "prey." Moreover, the number of grayscale version identifiers can be one or multiple. For example, grayscale version identifiers can include "prey1," "prey2," etc. That is, the main application can have multiple candidate main grayscale identifiers, and sub-applications can also have multiple candidate sub-grayscale identifiers.

[0054] It is understandable that in practical applications, one or more grayscale versions of the micro-frontend system can be set up for testing, and the improvements of each grayscale version compared to the official version will be different. The grayscale version of the micro-frontend system can be represented by the main grayscale identifier of the main application in the micro-frontend system, and the corresponding sub-grayscale identifiers of each sub-application. The improvements of each grayscale version compared to the official version will be different; it can mean that each grayscale version contains grayscale versions of different applications, and / or, it can contain different grayscale versions of the same application. For example, consider a micro-frontend system including a main application C, sub-applications d, e, and f, where sub-application d corresponds to grayscale versions d1 and d2, and sub-application e corresponds to grayscale version e1. Then, the grayscale version of the micro-frontend system can include any one of grayscale versions d1, d2, and e1, or it can include either grayscale versions d1 and d2, and grayscale version e1.

[0055] Specifically, the user's device has the official version of the micro-frontend system installed. When the user logs into the micro-frontend system, the server can obtain user information and determine the main grayscale identifier for the main application and the corresponding sub-grayscale identifiers for each sub-application within the micro-frontend system. It can be understood that, because the main application and each sub-application in the micro-frontend system are relatively independent, during development, updates can be made only to the main application or only to some sub-applications. Similarly, during grayscale releases, grayscale releases can also be made only to the main application or only to some sub-applications. That is, at least one of the main grayscale identifier and each sub-grayscale identifier is a grayscale version identifier.

[0056] Furthermore, different gray-scale versions offer different improvements over the official version, and their corresponding testing requirements also differ. For example, if a gray-scale version differs from the official version by changing the interactive voice information to the dialect of region B, then users in region B can be matched to participate in the testing of this gray-scale version. Similarly, if a gray-scale version differs from the official version by increasing the display resolution, then users whose devices have sufficient memory can be matched to test this gray-scale version. Based on this, the server can determine the main gray-scale identifier for the main application in the micro-frontend system that matches the user information, as well as the corresponding sub-gray-scale identifiers for each sub-application, based on user information and the testing requirements for each gray-scale version. The application to be tested refers to an application with gray-scale versions; this application can be either the main application or a sub-application.

[0057] In one embodiment, the server can determine the testing requirements corresponding to each grayscale version based on the improvements of each grayscale version of the application under test compared to the official version, and then match the acquired user information with each testing requirement to determine the grayscale version that matches the user information, and then determine the main grayscale identifier and the sub-grayscale identifier.

[0058] In one embodiment, the server can determine the user information of the target users that meet the test requirements corresponding to each grayscale version, and then establish a correspondence between grayscale identifiers and user information. Based on the obtained user information and the correspondence between grayscale identifiers and user information, the server can determine the primary grayscale identifier and the secondary grayscale identifier that match the obtained user information.

[0059] Step S204: From each candidate main application version file of the main application, determine and publish the main application version file corresponding to the main grayscale identifier.

[0060] The main application can have multiple candidate main grayscale identifiers, each corresponding to a unique candidate main application version file. Each candidate main application version file carries the corresponding version of the main application. Specifically, after determining the main grayscale identifier of the main application, the server can determine the main application version file corresponding to the main grayscale identifier from the candidate main application version files of the main application, and publish the main application version file to the terminal.

[0061] Step S206: In response to the sub-application access request, obtain the sub-application version file of the sub-application to be accessed according to the sub-grayscale identifier of the sub-application to be accessed corresponding to the sub-application access request.

[0062] Step S208: Publish the sub-application version file.

[0063] A sub-application access request is an access request initiated by the terminal for the sub-application to be accessed. This sub-application access request is initiated in the runtime environment of the main application corresponding to the main application version file. Similar to the main application, a sub-application can have multiple candidate sub-grayscale identifiers, each candidate sub-grayscale identifier corresponds to a unique candidate sub-application version file, and each candidate sub-application version file carries the corresponding version of the sub-application.

[0064] Specifically, in the main application runtime environment, the terminal can initiate a sub-application access request to the server. In response to the sub-application access request, the server can determine the sub-application to be accessed, and retrieve the sub-grayscale identifier of the sub-application to be accessed from the sub-grayscale identifiers corresponding to each sub-application. Then, from the candidate sub-application version files of the sub-application to be accessed, the server can determine the sub-application version file corresponding to the sub-grayscale identifier, obtain and publish the sub-application version file to the terminal.

[0065] The aforementioned canary deployment method for micro-frontend systems obtains user information and determines the main canary identifier of the main application and the corresponding sub-canary identifiers for each sub-application based on the user information. Then, it determines and publishes the main application version file corresponding to the main canary identifier from the candidate main application version files of the main application. Subsequently, in response to sub-application access requests initiated in the runtime environment of the main application corresponding to the main application version file, it obtains the sub-application version file of the sub-application to be accessed based on the sub-canary identifier of the sub-application to be accessed corresponding to the sub-application access request, and publishes the sub-application version file. Different main and sub-canary identifiers can be configured for different user information, thereby determining the main application version file corresponding to the main canary identifier and the sub-application version file corresponding to the sub-canary identifier. This ensures the matching degree between the canary deployment results of the micro-frontend system and the user information, which helps to improve the accuracy of the deployment results.

[0066] In some embodiments, determining the main grayscale identifier of the main application in the micro-frontend system and the corresponding sub-grayscale identifier of each sub-application based on user information includes: obtaining the correspondence between user information and the main grayscale identifier, and the correspondence between user information and the sub-grayscale identifier; determining the main grayscale identifier of the main application in the micro-frontend system based on the obtained user information and the correspondence between user information and the main grayscale identifier; and determining the corresponding sub-grayscale identifier of each sub-application in the micro-frontend system based on the obtained user information and the correspondence between user information and the sub-grayscale identifier.

[0067] The specific limitations regarding user information, main grayscale identifier, and sub-grayscale identifier are detailed above and will not be repeated here. Specifically, the server can obtain the correspondence between user information and the main grayscale identifier, as well as the correspondence between user information and sub-grayscale identifiers. Then, based on the obtained user information and the correspondence between user information and the main grayscale identifier, the server determines the main grayscale identifier of the main application in the micro-frontend system. Furthermore, based on the obtained user information and the correspondence between user information and the sub-grayscale identifiers, the server determines the corresponding sub-grayscale identifier for each sub-application in the micro-frontend system.

[0068] Furthermore, the specific methods by which the server obtains the correspondence between user information and the main grayscale identifier, and the correspondence between user information and the sub-grayscale identifier, are not unique. In one embodiment, the server can obtain the correspondence between user information, the main grayscale identifier, and the sub-grayscale identifier, and then determine the correspondence between user information and the main grayscale identifier, and the correspondence between user information and the sub-grayscale identifier. In another embodiment, considering the certain correlation between the main application and the sub-application, the server can obtain the correspondence between the main grayscale identifier and the sub-grayscale identifier, and the correspondence between user information and either the main grayscale identifier or the sub-grayscale identifier, to obtain the correspondence between user information and the main grayscale identifier, and the correspondence between user information and the sub-grayscale identifier.

[0069] In the above embodiments, the main grayscale identifier and the sub-grayscale identifier that match the user information are determined based on the correspondence between user information and the main grayscale identifier, as well as the correspondence between user information and the sub-grayscale identifier. The algorithm is simple and helps to improve efficiency.

[0070] In some embodiments, user information includes user identification information. In this embodiment, the micro-frontend system canary release method further includes: obtaining historical user identification information and historical user device information corresponding to the historical user identification information; and establishing a correspondence between user identification information and main canary identifiers, and a correspondence between user identification information and sub-canary identifiers, based on the device matching result obtained by matching the historical user device information with the canary version release device requirements of the micro-frontend system.

[0071] Here, "historical users" refers to users who have previously accessed the micro-frontend system. Historical user identification information refers to the identification information used to identify historical users; historical user device information refers to the device information of the user device used by the historical user when accessing the micro-frontend system. This historical user device information may specifically include the user device's operating system type, device RAM, and remaining storage space.

[0072] Specifically, for each grayscale version, the server can determine the device requirements for grayscale version release, and these device requirements match the runtime requirements of the application corresponding to that grayscale version. Based on this, the server can obtain historical user identification information and the corresponding historical user device information from the historical access records of the micro-frontend system. Then, it matches the historical user device information with the grayscale version release device requirements of the micro-frontend system to obtain the device matching result. Based on the device matching result, it establishes the correspondence between user identification information and the main grayscale identifier, as well as the correspondence between user identification information and the sub-grayscale identifier.

[0073] In the above embodiments, by matching the historical user device information corresponding to the historical user identification information with the device requirements for the grayscale release of the micro-frontend system, a correspondence between user identification information and the main grayscale identifier, as well as a correspondence between user identification information and the sub-grayscale identifier, can be established. This ensures that the performance of user devices matches the testing requirements of the grayscale version, which is beneficial to further improve the accuracy of grayscale release.

[0074] In some embodiments, obtaining the sub-application version file of the sub-application to be accessed based on the sub-grayscale identifier of the sub-application to be accessed corresponding to the sub-application access request includes: determining the sub-application to be accessed requested by the sub-application access request and the sub-grayscale identifier of the sub-application to be accessed; determining the file access address of the sub-application to be accessed based on the sub-grayscale identifier of the sub-application to be accessed; and obtaining the sub-application version file of the sub-application to be accessed based on the file access address.

[0075] In this context, the file access address refers to the access address of the sub-application version file used to host the sub-application. In a micro-frontend architecture, the sub-application version file can be obtained based on different file access addresses. Taking the Qiankun micro-frontend architecture as an example, the main application can fetch the static resources of the sub-application using `fetch html`, and simultaneously add the HTML document as a child node to the main frame of the main application to enable access to the sub-application. Specifically, the server can determine the sub-application requested in the sub-application access request, as well as the sub-grayscale identifier of that sub-application. Then, based on the sub-grayscale identifier of the sub-application, it determines the file access address of that sub-application, and then obtains the sub-application version file based on that file access address, ensuring that the sub-application version file matches the sub-grayscale identifier of the sub-application.

[0076] In the above embodiments, obtaining the sub-application version file of the sub-application to be accessed based on the file access address can not only reduce the access cost of the main application, but also continue the original development and packaging methods of the sub-application, and solve the style isolation problem between different sub-applications, which is conducive to improving the scientific nature of the canary release method of the micro-frontend system.

[0077] It is understandable that before determining the file access address of the sub-application to be accessed based on its sub-grayscale identifier, candidate access addresses need to be configured for each sub-application. In some embodiments, the micro-frontend system canary deployment method further includes: obtaining the initial access address and candidate sub-grayscale identifiers corresponding to each sub-application; and for each sub-application, adding each candidate sub-grayscale identifier to the initial access address to obtain multiple candidate access addresses corresponding to each sub-application.

[0078] The initial access address refers to the access address of the sub-application version file without introducing grayscale indicators. This initial access address is the file access address of the official version file of the sub-application when there is no grayscale version. That is, for the same sub-application, the initial access address is the same for all sub-application versions. Specifically, the server can obtain the initial access address and candidate grayscale indicators for each sub-application. Then, for each sub-application, the server adds each candidate grayscale indicator to the initial access address of that sub-application, obtaining multiple candidate access addresses for each sub-application. Taking the Qiankun micro-frontend architecture as an example, the server can add the candidate grayscale indicators as headers to the initial HTML address of the sub-application, thereby obtaining multiple candidate HTML addresses for that sub-application.

[0079] In the above embodiments, by adding candidate sub-grayscale identifiers to the initial access address, multiple candidate access addresses corresponding to each sub-application are obtained. The algorithm is simple and can improve the release efficiency while ensuring the accuracy of the release results.

[0080] Furthermore, the specific method by which the server determines the file access address of the sub-application to be accessed based on its sub-grayscale identifier is not unique. For example, the server can establish a mapping between sub-grayscale identifiers and file access addresses, and determine the file access address of the sub-application to be accessed based on its sub-grayscale identifier and the mapping between the sub-grayscale identifiers and file access addresses.

[0081] In some embodiments, determining the file access address of the sub-application to be accessed based on the sub-grayscale identifier of the sub-application to be accessed includes: extracting the candidate sub-grayscale identifier carried in each candidate access address corresponding to the sub-application to be accessed; and determining the file access address of the sub-application to be accessed from each candidate access address based on the identifier matching result obtained by matching the sub-grayscale identifier of the sub-application to be accessed with each candidate sub-grayscale identifier.

[0082] Specifically, after the server determines the sub-application requested in the sub-application access request and its sub-grayscale identifier, it can extract the candidate sub-grayscale identifier carried in each candidate access address corresponding to the sub-application. Then, it performs identifier matching between the sub-grayscale identifier of the sub-application and each candidate sub-grayscale identifier to obtain an identifier matching result. Based on the identifier matching result, it determines the file access address that matches the sub-grayscale identifier of the sub-application from the candidate access addresses. The candidate sub-grayscale identifier carried in this file access address is consistent with the sub-grayscale identifier of the sub-application.

[0083] In the above embodiments, the candidate sub-grayscale identifiers carried in each candidate access address corresponding to the sub-application to be accessed are extracted. Then, based on the identifier matching result obtained by matching the sub-grayscale identifiers of the sub-application to be accessed with each candidate sub-grayscale identifier, the file access address of the sub-application to be accessed is determined from each candidate access address. This can ensure that the candidate sub-grayscale identifiers carried in the file access address are consistent with the sub-grayscale identifiers of the sub-application to be accessed, thereby ensuring the accuracy of the publishing results.

[0084] In some embodiments, such as Figure 3 As shown, the methods for canary deployment of a micro-frontend system include:

[0085] Step S301: Obtain historical user identification information and historical user equipment information corresponding to the historical user identification information;

[0086] Step S302: Match the historical user device information with the device requirements for the grayscale release of the micro-frontend system to obtain the device matching result;

[0087] Step S303: Based on the device matching results, establish the correspondence between user identification information and main grayscale identifier, as well as the correspondence between user identification information and sub-grayscale identifier;

[0088] Step S304: Obtain the initial access address and candidate sub-grayscale identifier corresponding to each sub-application;

[0089] Step S305: For each sub-application, add each candidate sub-grayscale identifier to the initial access address to obtain multiple candidate access addresses corresponding to each sub-application.

[0090] Step S306: Obtain user identification information;

[0091] Step S307: Determine the main grayscale identifier of the main application in the micro-frontend system based on the obtained user identifier information and the correspondence between the user identifier information and the main grayscale identifier.

[0092] Step S308: Based on the obtained user identification information and the correspondence between the user identification information and the sub-grayscale identifier, determine the sub-grayscale identifier corresponding to each sub-application in the micro-frontend system.

[0093] Step S309: From each candidate main application version file of the main application, determine and publish the main application version file corresponding to the main grayscale identifier;

[0094] Step S310: Obtain the sub-application access request initiated in the runtime environment of the main application corresponding to the main application version file;

[0095] Step S311: Determine the sub-application to be accessed requested by the sub-application access request, and the sub-grayscale identifier of the sub-application to be accessed.

[0096] Step S312: Extract the candidate sub-grayscale identifier carried in each candidate access address corresponding to the sub-application to be accessed;

[0097] Step S313: Based on the identifier matching result obtained by matching the sub-grayscale identifier of the sub-application to be accessed with each candidate sub-grayscale identifier, determine the file access address of the sub-application to be accessed from each candidate access address.

[0098] Step S314: Based on the file access address, obtain the sub-application version file of the sub-application to be accessed;

[0099] Step S315: Publish the sub-application version file.

[0100] To facilitate understanding, the following section uses a micro-frontend system based on the qiankun micro-frontend architecture as an example to explain in detail the canary release method of the micro-frontend system.

[0101] Specifically, such as Figure 4 As shown, when a user accesses the application and logs in, the server can obtain the user ID and determine the primary and secondary grayscale identifiers corresponding to that user ID. Then, through the nginx server forwarding, it hits and publishes the main application version file corresponding to the primary grayscale identifier. Next, when a user initiates a sub-application access request through the main application base, based on the secondary grayscale identifier of the sub-application to be accessed, the server determines the HTML entry point of the sub-application to be accessed, and through the nginx server forwarding, hits and publishes the sub-application version file corresponding to that secondary grayscale identifier.

[0102] The sub-applications are loaded using the HTML entry method, and the framework provides a corresponding start API to load the sub-applications. Furthermore, a pre-established mapping relationship is established between the user ID, the main grayscale identifier, and the sub-grayscale identifiers. A custom header is used to add the corresponding candidate sub-grayscale identifiers for each sub-application to their respective initial HTML address.

[0103] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.

[0104] Based on the same inventive concept, this application also provides a micro-frontend system canary deployment device for implementing the aforementioned micro-frontend system canary deployment method. The solution provided by this device is similar to the implementation described in the above method; therefore, the specific limitations in one or more micro-frontend system canary deployment device embodiments provided below can be found in the limitations of the micro-frontend system canary deployment method described above, and will not be repeated here.

[0105] In some embodiments, such as Figure 5 As shown, a micro-frontend system canary deployment device 500 is provided, including: a canary identification determination module 502, a main application deployment module 504, a sub-application version file acquisition module 506, and a sub-application deployment module 508, wherein:

[0106] The grayscale identifier determination module 502 is used to obtain user information and determine the main grayscale identifier of the main application in the micro-frontend system and the corresponding sub-grayscale identifier of each sub-application based on the user information.

[0107] The main application publishing module 504 is used to determine and publish the main application version file corresponding to the main grayscale identifier from each candidate main application version file of the main application.

[0108] The sub-application version file acquisition module 506 is used to respond to the sub-application access request and obtain the sub-application version file of the sub-application to be accessed according to the sub-grayscale identifier of the sub-application to be accessed corresponding to the sub-application access request; the sub-application access request is initiated in the runtime environment of the main application corresponding to the main application version file.

[0109] Sub-application publishing module 508 is used to publish sub-application version files.

[0110] In some embodiments, the sub-application version file acquisition module 506 includes: a sub-application to be accessed determination unit, configured to determine the sub-application to be accessed requested by the sub-application access request, and the sub-grayscale identifier of the sub-application to be accessed; a file access address determination unit, configured to determine the file access address of the sub-application to be accessed based on the sub-grayscale identifier of the sub-application to be accessed; and a sub-application version file determination unit, configured to acquire the sub-application version file of the sub-application to be accessed based on the file access address.

[0111] In some embodiments, the micro-frontend system canary deployment device 500 further includes a candidate access address configuration module, used to: obtain the initial access address and candidate sub-canary identifier corresponding to each sub-application; and for each sub-application, add each candidate sub-canary identifier to the initial access address to obtain multiple candidate access addresses corresponding to each sub-application.

[0112] In some embodiments, the file access address determination unit is specifically used to: extract the candidate sub-grayscale identifier carried in each candidate access address corresponding to the sub-application to be accessed; and determine the file access address of the sub-application to be accessed from each candidate access address based on the identifier matching result obtained by matching the sub-grayscale identifier of the sub-application to be accessed with each candidate sub-grayscale identifier.

[0113] In some embodiments, the grayscale identifier determination module 502 is specifically used to: obtain the correspondence between user information and the main grayscale identifier, and the correspondence between user information and the sub-grayscale identifier; determine the main grayscale identifier of the main application in the micro-frontend system based on the obtained user information and the correspondence between user information and the main grayscale identifier; and determine the sub-grayscale identifier corresponding to each sub-application in the micro-frontend system based on the obtained user information and the correspondence between user information and the sub-grayscale identifier.

[0114] In some embodiments, user information includes user identification information. In this embodiment, the micro-frontend system canary release device 500 further includes a correspondence determination module, used for: obtaining historical user identification information and historical user device information corresponding to the historical user identification information; and establishing a correspondence between user identification information and main canary identifiers, and a correspondence between user identification information and sub-canary identifiers, based on the device matching result obtained by matching the historical user device information with the canary version release device requirements of the micro-frontend system.

[0115] Each module in the aforementioned micro-frontend system canary deployment device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in the processor of a computer device in hardware form or independent of it, or stored in the memory of a computer device in software form, so that the processor can call and execute the corresponding operations of each module.

[0116] In some embodiments, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 6 As shown, the computer device includes a processor, memory, input / output (I / O) interfaces, and a communication interface. The processor, memory, and I / O interfaces are connected via a system bus, and the communication interface is also connected to the system bus via the I / O interfaces. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and a database. The internal memory provides the environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The database stores data involved in the canary deployment method of the micro-frontend system. The I / O interfaces are used for exchanging information between the processor and external devices. The communication interface is used for communication with external terminals via a network connection. When the computer program is executed by the processor, it implements a canary deployment method for a micro-frontend system.

[0117] Those skilled in the art will understand that Figure 6 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0118] In some embodiments, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps in the above-described micro-frontend system canary release method.

[0119] In some embodiments, a computer-readable storage medium is provided, on which a computer program is stored, which, when executed by a processor, implements the steps in the above-described micro-frontend system canary deployment method.

[0120] In some embodiments, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps in the above-described micro-frontend system canary release method.

[0121] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.

[0122] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0123] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.

Claims

1. A method for canary deployment of a micro-frontend system, characterized in that, The method includes: Obtain user information, and determine the main grayscale identifier of the main application in the micro-frontend system and the corresponding sub-grayscale identifier of each sub-application based on the user information. From each candidate main application version file of the main application, determine and publish the main application version file corresponding to the main grayscale identifier; In response to a sub-application access request, the sub-application version file of the sub-application to be accessed is obtained according to the sub-grayscale identifier of the sub-application to be accessed corresponding to the sub-application access request; the sub-application access request is initiated in the runtime environment of the main application corresponding to the main application version file; Release the sub-application version file.

2. The method according to claim 1, characterized in that, The step of obtaining the sub-application version file of the sub-application to be accessed based on the sub-grayscale identifier of the sub-application to be accessed corresponding to the sub-application access request includes: Determine the sub-application to be accessed requested by the sub-application access request, and the sub-grayscale identifier of the sub-application to be accessed; The file access address of the sub-application to be accessed is determined based on the sub-grayscale identifier of the sub-application to be accessed; Based on the file access address, obtain the sub-application version file of the sub-application to be accessed.

3. The method according to claim 2, further comprising: Obtain the initial access address and candidate sub-grayscale identifier corresponding to each of the sub-applications; For each sub-application, each candidate sub-grayscale identifier is added to the initial access address to obtain multiple candidate access addresses corresponding to each sub-application.

4. The method according to claim 3, characterized in that, Determining the file access address of the sub-application to be accessed based on its sub-grayscale identifier includes: Extract the candidate sub-grayscale identifier carried in each candidate access address corresponding to the sub-application to be accessed; Based on the identifier matching result obtained by matching the sub-grayscale identifier of the sub-application to be accessed with each of the candidate sub-grayscale identifiers, the file access address of the sub-application to be accessed is determined from each of the candidate access addresses.

5. The method according to any one of claims 1 to 4, characterized in that, The step of determining the main grayscale identifier of the main application in the micro-frontend system and the corresponding sub-grayscale identifier of each sub-application based on the user information includes: Obtain the correspondence between user information and the main grayscale identifier, as well as the correspondence between user information and the sub-grayscale identifier; Based on the acquired user information and the correspondence between the user information and the main grayscale identifier, the main grayscale identifier of the main application in the micro-frontend system is determined. Based on the acquired user information and the correspondence between user information and sub-grayscale identifiers, the sub-grayscale identifier corresponding to each sub-application in the micro-frontend system is determined.

6. The method according to claim 5, characterized in that, The user information includes user identification information; the method further includes; Obtain historical user identification information and the historical user equipment information corresponding to the historical user identification information; Based on the device matching results obtained by matching the historical user device information with the device requirements for grayscale version release of the micro-frontend system, a correspondence between user identification information and main grayscale identifier, as well as a correspondence between user identification information and sub-grayscale identifier, is established.

7. A grayscale publishing device for a micro-frontend system, characterized in that, The device includes: The grayscale identifier determination module is used to obtain user information and determine the main grayscale identifier of the main application in the micro-frontend system and the corresponding sub-grayscale identifier of each sub-application based on the user information. The main application publishing module is used to determine and publish the main application version file corresponding to the main grayscale identifier from each candidate main application version file of the main application; The sub-application version file acquisition module is used to respond to a sub-application access request and acquire the sub-application version file of the sub-application to be accessed according to the sub-grayscale identifier of the sub-application to be accessed corresponding to the sub-application access request; the sub-application access request is initiated in the runtime environment of the main application corresponding to the main application version file. The sub-application publishing module is used to publish the version file of the sub-application.

8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 6.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 6.

10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 6.