Unidirectional data communication method, device and equipment of micro front end and storage medium

By adopting a one-way data communication method in the micro front-end architecture, the problems of state chaos and state pool pollution in the micro front-end architecture are solved, and more efficient data management and system stability are achieved.

CN119537048AActive Publication Date: 2025-02-28PING AN BANK CO LTD

Patent Information

Application Number
CN202411412911.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-10
Publication Date
2025-02-28
Estimated Expiration
2044-10-10

AI Technical Summary

Technical Problem

In the micro front-end architecture, state chaos and state pool pollution problems caused by monitoring global state changes are adopted.

Method used

A micro front-end unidirectional data communication method is proposed. By acquiring the front-end business requirements, configuring sub-applications, generating and encapsulating one-way data communication rules, loading sub-applications into the micro front-end framework, and unidirectional data communication is achieved using asynchronous message queues and state pools.

Benefits of technology

Strictly control the access of sub-applications to the main application state pool, avoiding state pollution problems, improving data management efficiency and system maintainability, and enhancing the overall stability and scalability under the micro front-end architecture.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119537048A_ABST
    Figure CN119537048A_ABST
Patent Text Reader

Abstract

The invention discloses a one-way data communication method, device and equipment of a micro front end and a storage medium, and belongs to the technical field of research and development frameworks. The method comprises the following steps: firstly, configuring and generating an adaptive sub-application according to a front-end service demand, and packaging a one-way data communication rule for the sub-application; then the sub-applications are loaded into the micro-front-end framework, and it is ensured that the sub-applications can cooperatively work with the main application and other sub-applications. Next, when the sub-applications in the micro-front-end framework need to communicate, the system stores a communication instruction in an asynchronous message queue, and takes out the instruction from the queue in an asynchronous loading mode; and the system identifies the state parameters of the target sub-application in the state pool, analyzes the transmission parameters in the instruction, and updates the state of the target sub-application based on the parameters. The invention further relates to the technical field of block chains, and the state parameters are stored in a block chain network. According to the invention, the pollution problem of the state pool is effectively avoided, the maintainability of the system is enhanced, and the system is convenient to expand and update.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the technical field of R&D framework, and specifically relates to a one-way data communication method, device, equipment and storage medium of a micro front end. Background Art

[0002] As the project progresses, the number of people involved in development, maintenance, and operations will gradually increase. The increase and change of personnel may lead to inconsistencies in code style, architectural understanding, and maintenance methods, increasing the complexity and difficulty of the project. And as the business develops, the front-end application needs to continuously add new functions and features. These new functions may gradually accumulate, making the originally simple application large and complex. When the application becomes large and complex, maintenance and updating become very difficult. Any small change may affect other parts, leading to unforeseen errors and problems.

[0003] In order to solve the maintenance and update problems of front-end applications, the Micro Frontends architecture is usually used to split and decouple front-end applications so that each sub-application can be independently deployed and maintained. Micro Frontend is a front-end architecture model that draws on the idea of ​​the back-end microservice architecture to split a complex single front-end application into multiple small front-end applications that can be independently developed, deployed, and maintained. The use of micro frontends improves the development efficiency, flexibility, and maintainability of front-end applications, and is an effective solution to the complexity of large front-end projects.

[0004] However, currently micro-frontends usually use the method of monitoring global state changes to achieve data synchronization between different sub-applications, but this method will lead to state confusion and state pool pollution problems. For example, multiple sub-applications may modify the global state at the same time, resulting in state confusion, which in turn causes unpredictable behavior and conflicts. Summary of the invention

[0005] The purpose of the embodiments of the present application is to propose a one-way data communication method, device, computer equipment and storage medium for a micro front end to solve the technical problems of state confusion and state pool pollution caused by monitoring global state changes.

[0006] In order to solve the above technical problems, the embodiment of the present application provides a one-way data communication method of a micro front end, which adopts the following technical solution:

[0007] A one-way data communication method for a micro front-end, comprising:

[0008] Obtain the front-end business requirements, configure the corresponding sub-application according to the front-end business requirements, and obtain the first target sub-application;

[0009] Generate a data communication rule adapted to the first target sub-application, and encapsulate the data communication rule into the first target sub-application, wherein the data communication rule is a unidirectional data communication rule;

[0010] Load the first target sub-application that completes the data communication rule encapsulation into the preset micro-frontend framework;

[0011] Responding to the data communication demand of the second target sub-application, obtaining the data communication instruction, and storing the data communication instruction in a preset asynchronous message queue;

[0012] Loading the data communication instruction from the asynchronous message queue in an asynchronous loading manner, and identifying the state parameter corresponding to the second target sub-application in a preset state pool;

[0013] Parse the data communication instruction, obtain the carried transfer parameters, and update the state parameters corresponding to the second target sub-application based on the transfer parameters.

[0014] In order to solve the above technical problems, the embodiment of the present application also provides a one-way data communication device of a micro front end, which adopts the following technical solution:

[0015] A one-way data communication device for a micro front end, comprising:

[0016] The sub-application configuration module is used to obtain the front-end business requirements, configure the corresponding sub-application according to the front-end business requirements, and obtain the first target sub-application;

[0017] A communication rule configuration module, used to generate a data communication rule adapted to the first target sub-application, and encapsulate the data communication rule into the first target sub-application, wherein the data communication rule is a unidirectional data communication rule;

[0018] A sub-application loading module, used to load the first target sub-application that completes the data communication rule encapsulation into a preset micro-frontend framework;

[0019] An instruction asynchronous storage module, used to respond to the data communication demand of the second target sub-application, obtain the data communication instruction, and store the data communication instruction in a preset asynchronous message queue;

[0020] An instruction asynchronous loading module, used to load the data communication instruction from the asynchronous message queue in an asynchronous loading manner, and identify the state parameter corresponding to the second target sub-application in a preset state pool;

[0021] The state parameter updating module is used to parse the data communication instruction, obtain the carried transfer parameters, and update the state parameters corresponding to the second target sub-application based on the transfer parameters.

[0022] In order to solve the above technical problems, the embodiment of the present application further provides a computer device, which adopts the following technical solution:

[0023] A computer device comprises a memory and a processor, wherein the memory stores computer-readable instructions, and when the processor executes the computer-readable instructions, the steps of the one-way data communication method of a micro front end as described in any one of the above items are implemented.

[0024] In order to solve the above technical problems, the embodiment of the present application further provides a computer-readable storage medium, which adopts the following technical solution:

[0025] A computer-readable storage medium having computer-readable instructions stored thereon, wherein the computer-readable instructions, when executed by a processor, implement the steps of the one-way data communication method of a micro-front end as described in any one of the above.

[0026] Compared with the prior art, the embodiments of the present application have the following beneficial effects:

[0027] The present application discloses a one-way data communication method, device, equipment and storage medium of a micro front-end, and belongs to the technical field of research and development framework. First, configure and generate an adapted sub-application according to the front-end business requirements, and encapsulate the one-way data communication rules for it. Then load the sub-application into the micro front-end framework to ensure that the sub-application can work with the main application and other sub-applications. Next, when the sub-application in the micro front-end framework needs to communicate, the system will store the communication instruction in the asynchronous message queue and take the instruction from the queue by asynchronous loading. The system identifies the state parameters of the target sub-application in the state pool, parses the transfer parameters in the instruction, and updates the state of the target sub-application based on these parameters. Through one-way data communication, the present application strictly controls the access of the sub-application to the main application state pool, avoids the state pollution problem caused by the sub-application modifying the main application state pool at will, and the sub-application can only operate the state pool through the specific method exposed by the main application, thereby reducing the communication and operation costs, improving the efficiency of data management, and the high degree of decoupling between the sub-application and the main application, enhancing the maintainability of the system, and improving the overall stability and scalability under the micro front-end architecture. At the same time, an asynchronous loading method is used to handle the data communication of each sub-application, which can load and process tasks on demand and avoid unnecessary performance overhead. BRIEF DESCRIPTION OF THE DRAWINGS

[0028] In order to more clearly illustrate the scheme in the present application, a brief introduction is given below to the drawings required for use in the description of the embodiments of the present application. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0029] Figure 1 An exemplary system architecture diagram is shown in which the present application can be applied;

[0030] Figure 2 A flowchart of an embodiment of a one-way data communication method of a micro front end according to the present application is shown;

[0031] Figure 3 A structural schematic diagram of an embodiment of a one-way data communication device of a micro front end according to the present application is shown;

[0032] Figure 4 A schematic structural diagram of an embodiment of a computer device according to the present application is shown. DETAILED DESCRIPTION

[0033] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by technicians in the technical field of the present application; the terms used in the specification of the application herein are only for the purpose of describing specific embodiments and are not intended to limit the present application; the terms "including" and "having" and any variations thereof in the specification and claims of the present application and the above-mentioned drawings are intended to cover non-exclusive inclusions. The terms "first", "second", etc. in the specification and claims of the present application or the above-mentioned drawings are used to distinguish different objects, not to describe a specific order.

[0034] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.

[0035] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the accompanying drawings.

[0036] like Figure 1 As shown, the system architecture 100 may include a terminal device 101, a network 102 and a server 103. The terminal device 101 may be a laptop 1011, a tablet computer 1012 or a mobile phone 1013. The network 102 is used to provide a medium for a communication link between the terminal device 101 and the server 103. The network 102 may include various connection types, such as wired, wireless communication links or optical fiber cables.

[0037] The user can use the terminal device 101 to interact with the server 103 through the network 102 to receive or send messages, etc. Various communication client applications can be installed on the terminal device 101, such as web browser applications, shopping applications, search applications, instant messaging tools, email clients, social platform software, etc.

[0038] The terminal device 101 can be any electronic device with a display screen and supporting web browsing. In addition to a laptop computer 1011, a tablet computer 1012 or a mobile phone 1013, the terminal device 101 can also be an e-book reader, an MP3 player (Moving Picture Experts Group Audio Layer III), an MP4 (Moving Picture Experts Group Audio Layer IV), a laptop computer, a desktop computer, etc.

[0039] The server 103 may be a server that provides various services, such as a background server that provides support for a web page displayed on the terminal device 101 .

[0040] It should be noted that the one-way data communication method of the micro front end provided in the embodiment of the present application is generally executed by a server / terminal device, and accordingly, the one-way data communication device of the micro front end is generally arranged in the server / terminal device.

[0041] It should be understood that Figure 1 The numbers of terminal devices, networks and servers in the embodiment are merely illustrative. The above system may have any number of terminal devices, networks and servers according to implementation requirements.

[0042] Continue to refer Figure 2 , shows a flow chart of an embodiment of a method for one-way data communication of a micro front end according to the present application. The one-way data communication method of the micro front end comprises the following steps:

[0043] S201, obtaining front-end business requirements, configuring corresponding sub-applications according to the front-end business requirements, and obtaining a first target sub-application.

[0044] Specifically, obtaining front-end business requirements means clarifying the interface display and interaction logic based on user needs or specific functional requirements of the system. Business requirements can come from user feedback, market research, or detailed descriptions in product design documents. Based on these business requirements, the development team needs to determine the sub-applications that need to be configured, including determining the functional scope of the sub-application, interaction mode, and communication method with other sub-applications.

[0045] In the micro-frontend architecture, sub-applications are independent modules, and each sub-application is responsible for a specific business function. By analyzing business needs, selecting appropriate technology stacks, modular tools, etc. to configure the sub-application, and determining the communication interface between it and other sub-applications or the main framework, we ultimately obtain the first target sub-application suitable for a specific scenario. The high degree of decoupling between the sub-application and the main application enhances the maintainability of the system and improves the overall stability and scalability under the micro-frontend architecture.

[0046] S202: Generate a data communication rule adapted to the first target sub-application, and encapsulate the data communication rule into the first target sub-application, wherein the data communication rule is a unidirectional data communication rule.

[0047] Specifically, when generating data communication rules, it is necessary to consider the independence and flexibility in the micro-frontend architecture. The core function of data communication rules is to specify how to transfer and update data between sub-applications and main applications. For one-way data communication rules, the characteristic is that data can only flow in a fixed direction, usually from the parent application to the sub-application, or from the sub-application to the main application. The benefit of one-way data communication is that it can ensure the controllability of data flow and reduce the uncertainty and complexity caused by two-way data binding, thereby reducing the state pollution problem.

[0048] In the process of configuring one-way data communication rules, it is also necessary to consider the data format, data verification, error handling and other mechanisms to ensure the security and stability of communication. Finally, these rules are encapsulated into the code of the first target sub-application so that it can communicate data with other modules in a predefined manner at runtime.

[0049] In a specific embodiment of the present application, the unidirectional data communication rule is implemented based on the unidirectional data communication method postMessageToBaseApp. The postMessageToBaseApp method is a mechanism for implementing communication between a sub-application and a main application in a micro-frontend architecture. The sub-application transmits data to the main application by sending messages, but the data flow is limited to the unidirectional channel from the sub-application to the main application. That is, the sub-application can only send information to the main application, but cannot directly read or modify the status of the main application.

[0050] S203, loading the first target sub-application that completes the data communication rule encapsulation into a preset micro-frontend framework.

[0051] Specifically, in a micro-frontend architecture, the framework usually plays a role in managing and coordinating multiple sub-applications. The encapsulated sub-applications need to be loaded into a unified micro-frontend framework in order to work with other sub-applications. The loading process includes injecting the sub-application's resources (such as HTML, CSS, JavaScript files, etc.) into the framework's execution environment and ensuring that these resources are loaded on demand to avoid unnecessary resource waste and performance issues.

[0052] In addition, during the loading process, the system also needs to ensure that the initialization process of the sub-application is completed normally, including the activation of its data communication rules, the registration of event listeners, and the initialization of the state. Through the coordination of the micro-frontend framework, efficient communication and functional collaboration can be achieved between the sub-application and the framework and other sub-applications.

[0053] S204, responding to the data communication demand of the second target sub-application, obtaining a data communication instruction, and storing the data communication instruction in a preset asynchronous message queue.

[0054] Specifically, when the second target sub-application issues a data communication demand, the system needs to perform corresponding processing, and the second target sub-application is any sub-application in the micro-frontend architecture. The data communication demand is usually manifested as the sub-application wanting to exchange data or update status with other modules.

[0055] The system will generate corresponding data communication instructions according to the data communication requirements. The data communication instructions include the type of operation, related data, and the identification of the target module. In order to support the asynchronous communication mechanism of the micro-frontend system, realize on-demand loading and processing tasks, and avoid unnecessary performance overhead, these data communication instructions will not be executed immediately, but will be stored in an asynchronous message queue. The existence of asynchronous message queues can ensure the non-blocking nature of the communication process and avoid the normal operation of other functions affected by data communication delays or blockages. The design of asynchronous message queues enables loosely coupled data exchange between sub-applications and improves the responsiveness and scalability of the entire system.

[0056] S205: Load the data communication instruction from the asynchronous message queue in an asynchronous loading manner, and identify the state parameter corresponding to the second target sub-application in a preset state pool.

[0057] Specifically, the communication instructions stored in the asynchronous message queue will be asynchronously loaded according to the system's scheduling mechanism. The system will take these instructions out of the message queue at the appropriate time and process them step by step. The first step of processing is to parse the instruction content and clarify the sub-application and status update requirements targeted by the instruction. By comparing with the preset state pool, the system can identify the state parameters currently used by the second target sub-application.

[0058] The state pool is usually an area that centrally stores the state of each sub-application in the system, ensuring visibility and consistency of multiple sub-applications sharing the same state. In this case, the data in the state pool is dynamic and updated as communication instructions are executed. In this way, communication delays can be handled without affecting the real-time performance of the system.

[0059] S206, parsing the data communication instruction, acquiring the carried transfer parameters, and updating the state parameters corresponding to the second target sub-application based on the transfer parameters.

[0060] Specifically, when a data communication instruction is loaded from an asynchronous message queue, the system needs to parse the instruction to obtain the specific transmission parameters carried therein. The parsing process involves operations such as decoding, data format conversion, and parameter verification to ensure the integrity and correctness of the transmission parameters.

[0061] Next, the system will update the current state of the second target sub-application based on these passed parameters. State updates are usually manifested as changes in certain interface elements, interaction logic, or functional states within the sub-application. By applying the passed parameters, the behavior of the sub-application will be adjusted responsively to complete data synchronization with other sub-applications or frameworks. Throughout the process, the one-way data communication mechanism can ensure the certainty of data flow and avoid problems caused by inconsistent or conflicting states. The ultimate goal of this update process is to maintain the overall coordination of the system and the consistency of data.

[0062] In the above embodiment, the present application strictly controls the access of the sub-application to the main application state pool through one-way data communication, avoiding the state pollution problem caused by the sub-application modifying the main application state pool at will. The sub-application can only operate the state pool through the specific method exposed by the main application, thereby reducing communication and operation costs, improving the efficiency of data management, and the high degree of decoupling between the sub-application and the main application enhances the maintainability of the system and improves the overall stability and scalability under the micro-frontend architecture. At the same time, the asynchronous loading method is used to handle the data communication of each sub-application, which can load and process tasks on demand and avoid unnecessary performance overhead.

[0063] Furthermore, the step of generating a data communication rule adapted to the first target sub-application and encapsulating the data communication rule into the first target sub-application specifically includes:

[0064] Determine the data transmission direction of the first target sub-application according to the front-end business requirements, and determine the parent application of the first target sub-application;

[0065] Determining a data transmission path according to the first target sub-application and a parent application of the first target sub-application;

[0066] A unidirectional data communication rule adapted to the first target sub-application is generated according to the data transmission direction and the data transmission path.

[0067] In this embodiment, the specific data transmission direction of the first target sub-application is first determined by analyzing the front-end business needs, that is, the system needs to clarify whether the sub-application only needs to receive data, send data, or exchange data with the parent application through one-way data flow. The determination of the data transmission direction is the basis for the formulation of the entire data communication rules, and defines the interaction mode between the sub-application and the main application. Then, the system will further confirm the parent application of the first target sub-application. The parent application is usually the core module responsible for coordinating multiple sub-applications, responsible for receiving and processing data requests issued by the sub-application. The confirmation of the parent application helps to establish a master-slave relationship and ensure a clear hierarchy of the communication structure.

[0068] Then, based on the association between the sub-application and its parent application, the system generates a data transfer path, which defines how data flows from the sub-application to the parent application, emphasizing the one-way flow of data. Finally, based on the data transfer direction and transfer path, the system generates a set of one-way data communication rules that are compatible with the first target sub-application. This rule ensures that the communication of the sub-application follows the predefined path and direction, ensuring the integrity and security of the data while avoiding state pollution.

[0069] Through the above steps, an adaptive one-way data communication rule is effectively generated for the first target sub-application, ensuring that data flows in a clear direction between applications and avoiding data conflicts or state pollution problems.

[0070] Furthermore, the step of loading the first target sub-application that completes the data communication rule encapsulation into a preset micro-frontend framework specifically includes:

[0071] Identify the location of the parent application in the micro-frontend framework and obtain the location information of the parent application;

[0072] Calculate the position of the first target sub-application in the micro-frontend framework according to the parent application position information to obtain the sub-application position information;

[0073] Based on the sub-application location information, the first target sub-application is loaded onto the micro-frontend framework.

[0074] In this embodiment, the system first obtains the location information of the parent application by identifying its location in the micro-frontend framework. The location information of the parent application usually includes its hierarchy and physical location in the overall layout. Next, based on the location information of the parent application, the system calculates the relative position of the first target sub-application in the micro-frontend framework to obtain the specific location information of the sub-application. This calculation process ensures that the sub-application can be reasonably nested and coordinated with the parent application according to the established logic and layout. Finally, based on the calculated location information, the first target sub-application is correctly loaded into the micro-frontend framework so that it can work with other modules in the appropriate context.

[0075] Through the above steps, it is ensured that the sub-application is loaded accurately and the layout and integrity of the system module are guaranteed.

[0076] Furthermore, before the step of responding to the data communication demand of the second target sub-application, acquiring the data communication instruction, and storing the data communication instruction in the preset asynchronous message queue, the method further includes:

[0077] Determine the sub-application with data communication requirements of the micro-frontend framework as the second target sub-application;

[0078] Determine the data transmission direction of the second target sub-application according to the data communication requirement, and determine the parent application of the second target sub-application;

[0079] According to the one-way data communication rule and the data transmission direction of the second target sub-application, a one-way data communication channel is established between the second target sub-application and the parent application of the second target sub-application;

[0080] Instruct the second target sub-application to upload the data communication instruction through the unidirectional data communication channel.

[0081] In this embodiment, firstly, the sub-applications with data communication requirements in the micro-frontend framework are detected and determined as the second target sub-applications, usually based on the requirements of business logic or the state changes within the application, such as a sub-application needs to pass information to the main application or other sub-applications. Then, the system will determine the data transmission direction of the second target sub-application based on the data communication requirements. At the same time, the parent application will also be determined as the receiving end or initiating end of the data communication.

[0082] On this basis, the system relies on the preset one-way data communication rules and combines the data transmission direction to build a one-way data communication channel between the second target sub-application and the parent application. This channel ensures that data can only flow in the set direction, avoiding the complexity and state conflict problems caused by two-way communication. Finally, the system will instruct the second target sub-application to upload communication instructions through this one-way data communication channel. These instructions can be specific business data, status update requests, or event trigger information. The main application or parent application responds accordingly based on the instructions received.

[0083] Through the above steps, the system implements strict one-way data transmission between the child application and the parent application, ensures the orderliness and security of the data communication channel, avoids state pollution problems, and improves the reliability and maintainability of the system.

[0084] Further, the step of parsing the data communication instruction, obtaining the carried transfer parameters, and updating the state parameters corresponding to the second target sub-application based on the transfer parameters specifically includes:

[0085] Decoding the data communication instruction and filtering the transmission parameters from the decoded data, wherein the transmission parameters include communication subject parameters and communication content carrier parameters;

[0086] Determine the state of the second target sub-application according to the communication subject parameter and the communication content carrier parameter;

[0087] According to the state of the second target sub-application, the state parameter corresponding to the second target sub-application is updated.

[0088] In this embodiment, the system will first decode the received data communication instructions and extract the valid information therein. Through decoding, the system can filter out the transmission parameters from the original instructions. These parameters mainly include the communication subject parameters and the communication content carrier parameters. The communication subject parameters are used to identify the intention or purpose of this communication, while the communication content carrier parameters carry the specific data content. Next, based on the communication subject and content carrier obtained by parsing, the system will determine the status of the second target sub-application. The clarification of the status enables the sub-application to clearly know the current business context and perform corresponding processing based on this status. Finally, the system updates the corresponding status parameters according to the status of the second target sub-application.

[0089] Through the above steps, it is ensured that the sub-application can accurately receive and process data communication instructions, which improves the timeliness and accuracy of status updates and enhances the overall flexibility and responsiveness of the system.

[0090] Further, the communication topic parameters include a first communication topic, a second communication topic, and a third communication topic, and the communication content carrier parameters include a first content carrier, a second content carrier, and a third content carrier. According to the communication topic parameters and the communication content carrier parameters, the step of determining the state of the second target sub-application specifically includes:

[0091] When the communication subject parameter is the first communication subject, and the communication content carrier parameter is the first content carrier, determining that the state of the second target sub-application is a session timeout state;

[0092] When the communication subject parameter is the second communication subject, and the communication content carrier parameter is the first content carrier, determining that the state of the second target sub-application is the identification loading state;

[0093] When the communication topic parameter is the third communication topic, and the communication content carrier parameter is the second content carrier or the third content carrier, it is determined that the state of the second target sub-application is the page jump state.

[0094] In this embodiment, the system dynamically determines the state of the second target sub-application for different communication subject parameters and content carrier parameters by parsing the transmission parameters. Specifically, when the communication subject parameter is the first communication subject and the communication content carrier parameter is the first content carrier, the system confirms the state of the second target sub-application as the session timeout state, that is, the system will prompt the user that his session has timed out and needs to log in again, which enhances the security of the system and the user experience.

[0095] When the communication topic parameter is the second communication topic, and the communication content carrier parameter is still the first content carrier, the state of the sub-application is determined to be the identification loading state, which indicates that the sub-application is loading or processing data, and the user interface may display a loading animation or progress bar to prompt the user to wait patiently. The switching of the identification loading state ensures that the user can get visual feedback during the waiting process, thereby reducing the anxiety caused by loading.

[0096] Finally, when the communication topic parameter is the third communication topic and the communication content carrier parameter is the second content carrier or the third content carrier, the system identifies the status of the sub-application as a page jump status. In this case, the system will process the page jump request to ensure that the user can smoothly navigate to the new page or functional module.

[0097] Through the above steps, accurate judgment and dynamic response to the status of the sub-application are achieved, so that it can flexibly adjust its own status according to different communication topics and content carriers, thereby improving the timeliness and effectiveness of user interaction.

[0098] Furthermore, according to the state of the second target sub-application, the step of updating the state parameter corresponding to the second target sub-application specifically includes:

[0099] Obtain the state parameter corresponding to the session timeout state to obtain the first update parameter;

[0100] Using the first update parameter to update the state parameter corresponding to the second target sub-application;

[0101] Obtain a state parameter corresponding to the identification loading state to obtain a second update parameter;

[0102] Using the second update parameter to update the state parameter corresponding to the second target sub-application;

[0103] Obtain the state parameter corresponding to the page jump state, and obtain the third update parameter;

[0104] The state parameters corresponding to the second target sub-application are updated using the third update parameters.

[0105] In this embodiment, the system obtains state parameters of different states to ensure that the second target sub-application can accurately update its state according to actual needs. First, the system obtains state parameters corresponding to the session timeout state, which include messages to prompt users, timeout countdown information, etc., and stores them as first update parameters. Then, the system uses the first update parameters to update the state parameters of the second target sub-application to ensure that the user can get corresponding prompts and perform corresponding operations, such as re-login, when the session times out.

[0106] Subsequently, the system obtains the state parameters corresponding to the identified loading state and obtains the second update parameters. These parameters include the display state of the loading animation and the progress bar information, etc., in order to inform the user that the system is processing the request. The state parameters of the second target sub-application are updated using the second update parameters to ensure a smooth user experience.

[0107] Finally, the system obtains the state parameters corresponding to the page jump state and obtains the third update parameters. At this time, the state parameters include the new page address, routing information, jump conditions, etc. The state parameters of the second target sub-application are updated using the third update parameters to ensure that it can perform page jumps at the appropriate time and under the appropriate conditions.

[0108] Through the above steps, effective management of the state of the second target sub-application is achieved, so that it can respond to the needs of session timeout, loading status and page jump in a timely manner, thereby improving the flexibility of the system and user satisfaction.

[0109] In a specific embodiment of the present application, taking the postMessageToBaseApp method to implement one-way data communication between the main application and the sub-application in the micro-frontend architecture as an example, the postMessageToBaseApp method provides a communication channel between the main and sub-applications, similar to the postMessage method in the browser environment, with the purpose of enabling the sub-application to send information to the main application to trigger specific functions or operations. This design uses a one-way data communication mechanism, which means that data is only sent from the sub-application to the main application, rather than a two-way interaction, which helps to simplify data flow and avoid complex two-way data synchronization and possible state conflicts.

[0110] The postMessageToBaseApp method provides two key parameters, theme (communication theme parameter) and param (communication content carrier parameter), which are used to define the communication theme and the data to be transmitted.

[0111] Theme, as a communication theme, defines the context and type of information sent by the sub-application to the main application. In different scenarios, different theme values ​​will trigger different response behaviors of the main application. The theme is actually a predefined event identifier, and the main application will select the appropriate processing logic based on the theme value.

[0112] As a carrier of communication content, param transmits specific data related to the theme. Depending on the theme, param can be a Boolean value, a string, or a more complex JSON object, which is used to provide additional information required by the main application to perform corresponding operations.

[0113] When the theme value is loginTimeOut (first communication theme) and param is true (first content carrier), the sub-application notifies the main application that the user session has timed out. The main application will invoke the session timeout prompt function based on the received information, and will display a prompt box or guide the user to log in again. This communication method ensures that the main application can uniformly manage the user's login status, and the sub-application only needs to send a simple instruction to complete the operation, which simplifies the logic of the sub-application so that it does not need to manage the details of the session status, but only needs to issue a session timeout notification.

[0114] When theme is loading (second communication theme) and param is true (first content carrier), the sub-application notifies the main application through this message to enter the "loading" state, and the main application will display a global loading animation or progress bar to prompt the user that data is loading. On the contrary, if param is false, the loading state can be ended. This method allows the main application to centrally manage the loading state of the entire system, avoiding multiple sub-applications from displaying inconsistent loading animations, thereby improving the consistency of user experience.

[0115] When theme is jumpCertainUrl (third communication theme) and param is a transaction code string (second content carrier) or a JSON object containing a transaction code and other parameters (third content carrier), the sub-application notifies the main application to perform a page jump operation through the jumpCertainUrl theme. param can be a transaction code string or a JSON object containing a transaction code and other parameters. The main application determines the jump target page based on the passed transaction code. The transaction code may correspond to a specific business function or page module, and the additional parameters in the JSON object (such as bsnCode and otherParams) can provide additional page context or customized jump logic. This design provides a concise and flexible way for sub-applications to hand over navigation control to the main application, ensuring the uniformity and security of jump operations.

[0116] The above embodiment scheme provides flexible expansion capability. The theme can be expanded to more communication themes to adapt to different business scenarios. By adding different theme values, the sub-application can interact with the main application in more dimensions, and the behavior of each theme can be dynamically adjusted according to demand. In addition, the design of the param parameter is also very flexible. It can be a simple Boolean value or a complex JSON object to adapt to data transmission requirements of different complexities.

[0117] In the above embodiment, the present application discloses a one-way data communication method for a micro front-end, which belongs to the technical field of R&D framework. First, an adapted sub-application is configured and generated according to the front-end business requirements, and a one-way data communication rule is encapsulated for it. Then the sub-application is loaded into the micro front-end framework to ensure that the sub-application can work with the main application and other sub-applications. Next, when the sub-application in the micro front-end framework needs to communicate, the system stores the communication instruction in the asynchronous message queue and takes out the instruction from the queue by asynchronous loading. The system identifies the state parameters of the target sub-application in the state pool, parses the transfer parameters in the instruction, and updates the state of the target sub-application based on these parameters. Through one-way data communication, the present application strictly controls the access of the sub-application to the main application state pool, avoids the state pollution problem caused by the sub-application modifying the main application state pool at will, and the sub-application can only operate the state pool through the specific method exposed by the main application, thereby reducing the communication and operation costs, improving the efficiency of data management, and the high degree of decoupling between the sub-application and the main application, enhancing the maintainability of the system, and improving the overall stability and scalability under the micro front-end architecture. At the same time, an asynchronous loading method is used to handle the data communication of each sub-application, which can load and process tasks on demand and avoid unnecessary performance overhead.

[0118] In this embodiment, the one-way data communication method of the micro front end runs on the electronic device (e.g. Figure 1 The server shown in the figure) can receive instructions or obtain data through a wired connection or a wireless connection. It should be noted that the above wireless connection method may include but is not limited to 3G / 4G connection, WiFi connection, Bluetooth connection, WiMAX connection, Zigbee connection, UWB (ultra wideband) connection, and other wireless connection methods currently known or to be developed in the future.

[0119] It should be emphasized that in order to further ensure the privacy and security of the above-mentioned state parameter information, the above-mentioned state parameter information can also be stored in a node of a blockchain.

[0120] The blockchain referred to in this application is a new application model of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanism, encryption algorithm, etc. Blockchain is essentially a decentralized database, a string of data blocks generated by cryptographic methods. Each data block contains a batch of network transaction information, which is used to verify the validity of its information (anti-counterfeiting) and generate the next block. Blockchain can include the underlying blockchain platform, platform product service layer, and application service layer.

[0121] The embodiments of the present application can acquire and process relevant data based on artificial intelligence technology. Among them, artificial intelligence (AI) is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results.

[0122] AI basic technologies generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing technology, operation / interaction systems, mechatronics, etc. AI software technologies mainly include computer vision technology, robotics technology, biometrics technology, speech processing technology, natural language processing technology, and machine learning / deep learning.

[0123] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through computer-readable instructions, and the computer-readable instructions can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, the aforementioned storage medium can be a non-volatile storage medium such as a disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM).

[0124] It should be understood that, although the steps in the flowchart of the accompanying drawings are displayed in sequence as indicated by the arrows, these steps are not necessarily executed in sequence in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least a part of the steps in the flowchart of the accompanying drawings may include multiple sub-steps or multiple stages, and these sub-steps or stages are not necessarily executed at the same time, but can be executed at different times, and their execution order is not necessarily sequential, but can be executed in turn or alternately with other steps or at least a part of the sub-steps or stages of other steps.

[0125] Further references Figure 3 , as a response to the above Figure 2 The present application provides an embodiment of a one-way data communication device for a micro front end. Figure 2 Corresponding to the method embodiment shown, the device can be specifically applied to various electronic devices.

[0126] like Figure 3 As shown, the one-way data communication device 300 of the micro front end described in this embodiment includes:

[0127] The sub-application configuration module 301 is used to obtain the front-end business requirements, configure the corresponding sub-application according to the front-end business requirements, and obtain the first target sub-application;

[0128] A communication rule configuration module 302 is used to generate a data communication rule adapted to the first target sub-application and encapsulate the data communication rule into the first target sub-application, wherein the data communication rule is a one-way data communication rule;

[0129] The sub-application loading module 303 is used to load the first target sub-application that completes the data communication rule encapsulation into a preset micro-frontend framework;

[0130] The instruction asynchronous storage module 304 is used to respond to the data communication demand of the second target sub-application, obtain the data communication instruction, and store the data communication instruction in a preset asynchronous message queue;

[0131] The instruction asynchronous loading module 305 is used to load the data communication instruction from the asynchronous message queue in an asynchronous loading manner, and identify the state parameter corresponding to the second target sub-application in a preset state pool;

[0132] The state parameter updating module 306 is used to parse the data communication instruction, obtain the carried transfer parameters, and update the state parameters corresponding to the second target sub-application based on the transfer parameters.

[0133] Furthermore, the communication rule configuration module 302 is specifically used for:

[0134] Determine the data transmission direction of the first target sub-application and the parent application of the first target sub-application according to the front-end business needs; determine the data transmission path according to the first target sub-application and the parent application of the first target sub-application; generate a unidirectional data communication rule adapted to the first target sub-application according to the data transmission direction and the data transmission path.

[0135] Furthermore, the sub-application loading module 303 is specifically used for:

[0136] Identify the position of the parent application in the micro front-end framework and obtain the parent application position information; calculate the position of the first target sub-application in the micro front-end framework according to the parent application position information and obtain the sub-application position information; based on the sub-application position information, load the first target sub-application onto the micro front-end framework.

[0137] Furthermore, the one-way data communication device 300 of the micro front end further includes a communication instruction upload module, which is specifically used for:

[0138] Determine a sub-application that has data communication requirements in the micro-frontend framework as a second target sub-application; determine a data transmission direction of the second target sub-application according to the data communication requirements, and determine a parent application of the second target sub-application; build a unidirectional data communication channel between the second target sub-application and the parent application of the second target sub-application according to a unidirectional data communication rule and the data transmission direction of the second target sub-application; instruct the second target sub-application to upload data communication instructions through the unidirectional data communication channel.

[0139] Furthermore, the state parameter updating module 306 is specifically used for:

[0140] Decode the data communication instruction and filter the transmission parameters from the decoded data, wherein the transmission parameters include communication subject parameters and communication content carrier parameters; determine the status of the second target sub-application according to the communication subject parameters and the communication content carrier parameters; and update the status parameters corresponding to the second target sub-application according to the status of the second target sub-application.

[0141] Further, the communication topic parameters include the first communication topic, the second communication topic and the third communication topic, the communication content carrier parameters include the first content carrier, the second content carrier and the third content carrier, and the state parameter updating module 306 is further used to:

[0142] When the communication topic parameter is the first communication topic and the communication content carrier parameter is the first content carrier, the state of the second target sub-application is determined to be the session timeout state; when the communication topic parameter is the second communication topic and the communication content carrier parameter is the first content carrier, the state of the second target sub-application is determined to be the identification loading state; when the communication topic parameter is the third communication topic and the communication content carrier parameter is the second content carrier or the third content carrier, the state of the second target sub-application is determined to be the page jump state.

[0143] Furthermore, the state parameter updating module 306 is further used for:

[0144] Obtain the status parameter corresponding to the session timeout status to obtain the first update parameter; use the first update parameter to update the status parameter corresponding to the second target sub-application; obtain the status parameter corresponding to the logo loading status to obtain the second update parameter; use the second update parameter to update the status parameter corresponding to the second target sub-application; obtain the status parameter corresponding to the page jump status to obtain the third update parameter; use the third update parameter to update the status parameter corresponding to the second target sub-application.

[0145] In the above embodiment, the present application discloses a one-way data communication device for a micro front-end, which belongs to the technical field of R&D framework. First, an adapted sub-application is configured and generated according to the front-end business requirements, and a one-way data communication rule is encapsulated for it. Then the sub-application is loaded into the micro front-end framework to ensure that the sub-application can work with the main application and other sub-applications. Next, when the sub-application in the micro front-end framework needs to communicate, the system stores the communication instruction in the asynchronous message queue and takes out the instruction from the queue by asynchronous loading. The system identifies the state parameters of the target sub-application in the state pool, parses the transfer parameters in the instruction, and updates the state of the target sub-application based on these parameters. Through one-way data communication, the present application strictly controls the access of the sub-application to the main application state pool, avoids the state pollution problem caused by the sub-application modifying the main application state pool at will, and the sub-application can only operate the state pool through the specific method exposed by the main application, thereby reducing the communication and operation costs, improving the efficiency of data management, and the high degree of decoupling between the sub-application and the main application, enhancing the maintainability of the system, and improving the overall stability and scalability under the micro front-end architecture. At the same time, an asynchronous loading method is used to handle the data communication of each sub-application, which can load and process tasks on demand and avoid unnecessary performance overhead.

[0146] To solve the above technical problems, the present application also provides a computer device. Figure 4 , Figure 4 This is a basic structural block diagram of the computer device in this embodiment.

[0147] The computer device 4 includes a memory 41, a processor 42, and a network interface 43 that are interconnected and communicated through a system bus. It should be noted that the figure only shows a computer device 4 with a memory 41, a processor 42, and a network interface 43, but it should be understood that it is not required to implement all the components shown, and more or fewer components can be implemented instead. Among them, those skilled in the art can understand that the computer device here is a device that can automatically perform numerical calculations and / or information processing according to pre-set or stored instructions, and its hardware includes but is not limited to microprocessors, application specific integrated circuits (Application Specific Integrated Circuit, ASIC), programmable gate arrays (Field-Programmable Gate Array, FPGA), digital processors (Digital Signal Processor, DSP), embedded devices, etc.

[0148] The computer device may be a desktop computer, a notebook, a PDA, a cloud server, etc. The computer device may interact with the user through a keyboard, a mouse, a remote controller, a touch pad, or a voice control device.

[0149] The memory 41 includes at least one type of readable storage medium, and the readable storage medium includes flash memory, hard disk, multimedia card, card-type memory (for example, SD or DX memory, etc.), random access memory (RAM), static random access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, disk, optical disk, etc. In some embodiments, the memory 41 can be an internal storage unit of the computer device 4, such as a hard disk or memory of the computer device 4. In other embodiments, the memory 41 can also be an external storage device of the computer device 4, such as a plug-in hard disk equipped on the computer device 4, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (FlashCard), etc. Of course, the memory 41 can also include both the internal storage unit of the computer device 4 and its external storage device. In this embodiment, the memory 41 is generally used to store the operating system and various application software installed on the computer device 4, such as computer-readable instructions of the one-way data communication method of the micro front end, etc. In addition, the memory 41 can also be used to temporarily store various types of data that have been output or are to be output.

[0150] The processor 42 may be a central processing unit (CPU), a controller, a microcontroller, a microprocessor, or other data processing chip in some embodiments. The processor 42 is generally used to control the overall operation of the computer device 4. In this embodiment, the processor 42 is used to run computer-readable instructions stored in the memory 41 or process data, such as computer-readable instructions for running the one-way data communication method of the micro front end.

[0151] The network interface 43 may include a wireless network interface or a wired network interface. The network interface 43 is generally used to establish a communication connection between the computer device 4 and other electronic devices.

[0152] In the above embodiment, the present application discloses a computer device, which belongs to the technical field of R&D framework. First, an adapted sub-application is configured and generated according to the front-end business requirements, and a one-way data communication rule is encapsulated for it. Then the sub-application is loaded into the micro-front-end framework to ensure that the sub-application can work with the main application and other sub-applications. Next, when the sub-application in the micro-front-end framework needs to communicate, the system stores the communication instruction in the asynchronous message queue and takes out the instruction from the queue by asynchronous loading. The system identifies the state parameters of the target sub-application in the state pool, parses the transfer parameters in the instruction, and updates the state of the target sub-application based on these parameters. The present application strictly controls the access of the sub-application to the main application state pool through one-way data communication, avoids the state pollution problem caused by the sub-application modifying the main application state pool at will, and the sub-application can only operate the state pool through the specific method exposed by the main application, thereby reducing the communication and operation costs, improving the efficiency of data management, and the high degree of decoupling between the sub-application and the main application, enhancing the maintainability of the system, and improving the overall stability and scalability under the micro-front-end architecture. At the same time, an asynchronous loading method is used to handle the data communication of each sub-application, which can load and process tasks on demand and avoid unnecessary performance overhead.

[0153] The present application also provides another implementation, namely, providing a computer-readable storage medium, which stores computer-readable instructions, and the computer-readable instructions can be executed by at least one processor to enable the at least one processor to perform the steps of the one-way data communication method of the micro-front end as described above.

[0154] In the above embodiment, the present application discloses a computer-readable storage medium, which belongs to the technical field of R&D framework. First, according to the front-end business requirements, an adapted sub-application is configured and generated, and a one-way data communication rule is encapsulated for it. Then the sub-application is loaded into the micro-front-end framework to ensure that the sub-application can work with the main application and other sub-applications. Next, when the sub-application in the micro-front-end framework needs to communicate, the system will store the communication instruction in the asynchronous message queue and take out the instruction from the queue by asynchronous loading. The system identifies the state parameters of the target sub-application in the state pool, parses the transfer parameters in the instruction, and updates the state of the target sub-application based on these parameters. Through one-way data communication, the present application strictly controls the access of the sub-application to the main application state pool, avoids the state pollution problem caused by the sub-application modifying the main application state pool at will, and the sub-application can only operate the state pool through the specific method exposed by the main application, thereby reducing the communication and operation costs, improving the efficiency of data management, and the high degree of decoupling between the sub-application and the main application, enhancing the maintainability of the system, and improving the overall stability and scalability under the micro-front-end architecture. At the same time, an asynchronous loading method is used to handle the data communication of each sub-application, which can load and process tasks on demand and avoid unnecessary performance overhead.

[0155] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in each embodiment of the present application.

[0156] The present application can be used in many general or special computer system environments or configurations. For example: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronic devices, network PCs, minicomputers, mainframe computers, distributed computing environments including any of the above systems or devices, etc. The present application can be described in the general context of computer executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. The present application can also be practiced in distributed computing environments, in which tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules can be located in local and remote computer storage media including storage devices.

[0157] Obviously, the embodiments described above are only some embodiments of the present application, rather than all embodiments. The preferred embodiments of the present application are given in the accompanying drawings, but they do not limit the patent scope of the present application. The present application can be implemented in many different forms. On the contrary, the purpose of providing these embodiments is to make the understanding of the disclosure of the present application more thorough and comprehensive. Although the present application is described in detail with reference to the aforementioned embodiments, for those skilled in the art, it is still possible to modify the technical solutions recorded in the aforementioned specific implementation methods, or to perform equivalent replacement of some of the technical features therein. Any equivalent structure made using the contents of the specification and drawings of this application, directly or indirectly used in other related technical fields, is similarly within the scope of patent protection of this application.

Claims

1. A one-way data communication method for a micro front end, characterized in that: include: Acquire the front-end business requirements, configure the corresponding sub-application according to the front-end business requirements, and obtain the first target sub-application; generating a data communication rule adapted to the first target sub-application, and encapsulating the data communication rule into the first target sub-application, wherein the data communication rule is a unidirectional data communication rule; Loading the first target sub-application that completes data communication rule encapsulation into a preset micro-frontend framework; Responding to the data communication demand of the second target sub-application, obtaining the data communication instruction, and storing the data communication instruction in a preset asynchronous message queue; Loading the data communication instruction from the asynchronous message queue in an asynchronous loading manner, and identifying a state parameter corresponding to the second target sub-application in a preset state pool; The data communication instruction is parsed to obtain the carried transfer parameters, and the state parameters corresponding to the second target sub-application are updated based on the transfer parameters.

2. The one-way data communication method of a micro front end according to claim 1, characterized in that: The step of generating a data communication rule adapted to the first target sub-application and encapsulating the data communication rule into the first target sub-application specifically includes: Determine the data transmission direction of the first target sub-application according to the front-end business requirements, and determine the parent application of the first target sub-application; Determining a data transmission path according to the first target sub-application and a parent application of the first target sub-application; A unidirectional data communication rule adapted to the first target sub-application is generated according to the data transmission direction and the data transmission path.

3. The one-way data communication method of a micro front end according to claim 2, characterized in that: The step of loading the first target sub-application that completes the data communication rule encapsulation into a preset micro-frontend framework specifically includes: Identify the location of the parent application in the micro front-end framework and obtain the parent application location information; Calculate the position of the first target sub-application in the micro front-end framework according to the parent application position information to obtain the sub-application position information; Based on the sub-application location information, the first target sub-application is loaded onto the micro front-end framework.

4. The one-way data communication method of a micro front end according to claim 2, characterized in that: Before the step of responding to the data communication demand of the second target sub-application, acquiring the data communication instruction, and storing the data communication instruction in the preset asynchronous message queue, the method further includes: Determine a sub-application of the micro-front-end framework that has data communication requirements as the second target sub-application; Determine the data transfer direction of the second target sub-application according to the data communication requirement, and determine the parent application of the second target sub-application; According to the one-way data communication rule and the data transfer direction of the second target sub-application, a one-way data communication channel is established between the second target sub-application and a parent application of the second target sub-application; Instruct the second target sub-application to upload the data communication instruction through the unidirectional data communication channel.

5. The one-way data communication method of a micro front end according to claim 1, characterized in that: The step of parsing the data communication instruction, acquiring the carried transfer parameters, and updating the state parameters corresponding to the second target sub-application based on the transfer parameters specifically includes: Decoding the data communication instruction and selecting the transmission parameters from the decoded data, wherein the transmission parameters include communication subject parameters and communication content carrier parameters; Determining the state of the second target sub-application according to the communication subject parameter and the communication content carrier parameter; According to the state of the second target sub-application, a state parameter corresponding to the second target sub-application is updated.

6. The one-way data communication method of a micro front end according to claim 5, characterized in that: The communication topic parameters include a first communication topic, a second communication topic, and a third communication topic, the communication content carrier parameters include a first content carrier, a second content carrier, and a third content carrier, and the step of determining the state of the second target sub-application according to the communication topic parameters and the communication content carrier parameters specifically includes: When the communication subject parameter is the first communication subject, and the communication content carrier parameter is the first content carrier, determining that the state of the second target sub-application is a session timeout state; When the communication subject parameter is the second communication subject, and the communication content carrier parameter is the first content carrier, determining that the state of the second target sub-application is an identification loading state; When the communication subject parameter is the third communication subject, and the communication content carrier parameter is the second content carrier or the third content carrier, it is determined that the state of the second target sub-application is a page jump state.

7. The one-way data communication method of a micro front end according to claim 6, characterized in that: The step of updating the state parameter corresponding to the second target sub-application according to the state of the second target sub-application specifically includes: Acquire a state parameter corresponding to the session timeout state to obtain a first update parameter; Using the first update parameter to update the state parameter corresponding to the second target sub-application; Acquire a state parameter corresponding to the identification loading state to obtain a second update parameter; Using the second update parameter to update the state parameter corresponding to the second target sub-application; Obtaining a state parameter corresponding to the page jump state to obtain a third update parameter; The state parameters corresponding to the second target sub-application are updated using the third update parameters.

8. A one-way data communication device for a micro front end, characterized in that: include: A sub-application configuration module, used to obtain front-end business requirements, configure corresponding sub-applications according to the front-end business requirements, and obtain a first target sub-application; a communication rule configuration module, configured to generate a data communication rule adapted to the first target sub-application, and encapsulate the data communication rule into the first target sub-application, wherein the data communication rule is a unidirectional data communication rule; A sub-application loading module, used to load the first target sub-application that completes data communication rule encapsulation into a preset micro-frontend framework; An instruction asynchronous storage module, used to respond to the data communication demand of the second target sub-application, obtain the data communication instruction, and store the data communication instruction in a preset asynchronous message queue; An instruction asynchronous loading module, used for loading the data communication instruction from the asynchronous message queue in an asynchronous loading manner, and identifying a state parameter corresponding to the second target sub-application in a preset state pool; The state parameter updating module is used to parse the data communication instruction, obtain the carried transfer parameters, and update the state parameters corresponding to the second target sub-application based on the transfer parameters.

9. A computer device, characterized in that: It includes a memory and a processor, the memory stores computer-readable instructions, and the processor implements the steps of the one-way data communication method of the micro front end as described in any one of claims 1 to 7 when executing the computer-readable instructions.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-readable instructions, and when the computer-readable instructions are executed by the processor, the steps of the one-way data communication method of the micro-front end as described in any one of claims 1 to 7 are implemented.

Citation Information

Patent Citations

  • One-way information transfer for performing secure information updates

    CN102986188A

  • A front-end microservice module communication method based on iframe

    CN109460529A

  • Front-end micro-service communication method and system, terminal equipment and storage medium

    CN115617545A

  • Method and system for realizing micro-front-end architecture, storage medium, equipment and terminal

    CN117675781A

  • Mutual page jump / closing method and system, and electronic device and storage medium

    WO2024148838A1

Cited By

  • Cross-framework development system and method, electronic equipment, storage medium and product

    CN120029596A