Data processing method and device, electronic equipment and storage medium

The data processing method updates and encrypts address information in a cache to resolve conflicts in micro frontend architectures, ensuring consistent address handling and efficient sub-application management.

CN119155283APending Publication Date: 2024-12-17MASHANG CONSUMER FINANCE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411025754.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-29
Publication Date
2024-12-17

AI Technical Summary

Technical Problem

In micro frontend architectures, simultaneous activation of multiple sub-applications can cause conflicts in browser address information due to shared routing, leading to abnormal displays and inefficient manual management.

Method used

A data processing method involving updating and encrypting address information in a cache, establishing a mapping relationship, and storing it in a separate cache to associate multiple address information with the same ciphertext data, ensuring consistency and avoiding conflicts.

Benefits of technology

This method ensures consistent address information in the cache with the currently activated sub-application, preventing conflicts and improving development efficiency by automating the management of multiple sub-applications.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119155283A_ABST
    Figure CN119155283A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a data processing method and device, electronic equipment and a storage medium, and the method comprises the steps: obtaining updated first address information under the condition that it is detected that the first address information of a browser is updated; if the second address information in the first cache of the browser is not matched with the updated first address information, updating the first cache according to the updated first address information; encrypting the updated address information in the first cache to obtain first address ciphertext data; establishing a first mapping relationship between each piece of address information in the updated first cache and the first address ciphertext data; and storing the first mapping relation to a second cache different from the first cache. Therefore, the problem that the address information of the multiple sub-applications activated by the micro front end at the same time conflicts with one another is avoided.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data processing technology, and in particular to a data processing method, device, electronic device and storage medium. Background Art

[0002] Micro frontend is a web (network) frontend architecture, which refers to microservices that exist in the browser. Micro frontend can build a complete web application by combining multiple web frontend projects developed with different technology stacks and released independently. In the process of developing work through the micro frontend framework, the micro frontend has a unique main application, which can be used to manage multiple sub-applications, for example, activating and uninstalling each sub-application.

[0003] Each sub-application that relies on the browser's routing shares the browser's address bar. When a sub-application is activated, the address information of the activated sub-application occupies the browser's address bar. If another sub-application is activated, the old address information in the browser's address bar may be switched to the new address information, and the sub-application that was activated first may be uninstalled. Therefore, if the browser activates multiple sub-applications at the same time, the addresses of the sub-applications may conflict with each other, resulting in abnormal display. Summary of the invention

[0004] The embodiments of the present application provide a data processing method, device, electronic device and storage medium, which can avoid the problem of conflicting address information of multiple sub-applications activated simultaneously by a micro-front end.

[0005] In a first aspect, an embodiment of the present application provides a data processing method, including:

[0006] When detecting that the first address information of the browser is updated, obtaining the updated first address information;

[0007] If the second address information in the first cache of the browser does not match the updated first address information, updating the first cache according to the updated first address information;

[0008] Encrypting the updated address information in the first cache to obtain first address ciphertext data;

[0009] Establishing a first mapping relationship between each address information in the updated first cache and the first address ciphertext data;

[0010] The first mapping relationship is stored in a second cache different from the first cache.

[0011] In a second aspect, an embodiment of the present application provides a data processing device, including:

[0012] An acquiring unit, configured to acquire updated first address information when detecting that the first address information of the browser is updated;

[0013] an updating unit, configured to update the first cache according to the updated first address information if the second address information in the first cache of the browser does not match the updated first address information;

[0014] An encryption unit, used for encrypting the address information in the updated first cache to obtain first address ciphertext data;

[0015] An establishing unit, configured to establish a first mapping relationship between each address information in the updated first cache and the first address ciphertext data;

[0016] A storage unit is used to store the first mapping relationship in a second cache different from the first cache.

[0017] In a third aspect, an embodiment of the present application provides an electronic device, comprising: a processor; and a memory configured to store computer-executable instructions, wherein the computer-executable instructions, when executed, cause the processor to execute the data processing method as described in the first aspect.

[0018] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium for storing computer-executable instructions, which, when executed by a processor, implement the data processing method as described in the first aspect.

[0019] In a fifth aspect, an embodiment of the present application provides a computer program product, including a computer program, which, when executed by a processor, implements the data processing method as described in the first aspect.

[0020] It can be seen that in the embodiment of the present application, first, when the browser's first address information is detected to be updated, the updated first address information is obtained; second, if the second address information in the browser's first cache does not match the updated first address information, the first cache is updated according to the updated first address information; then, the address information in the updated first cache is encrypted to obtain the first address ciphertext data; then, a first mapping relationship between each address information in the updated first cache and the first address ciphertext data is established; finally, the first mapping relationship is stored in a second cache different from the first cache. In this way, by detecting the update of the browser's first address information, and updating the first cache according to the updated first address information when it is determined that the second address information in the browser's first cache does not match the updated first address information, the address information stored in the first cache can be changed regularly with the change of the browser's first address information, and then, by encrypting the address information in the updated first cache to obtain the first address ciphertext data, establishing the first mapping relationship between each address information in the updated first cache and the first address ciphertext data, and storing the first mapping relationship in the second cache, multiple address information can be associated with the same first address ciphertext data. Considering that in the application scenario of the micro-frontend, the change of the first address information of the browser may occur along with the activation or uninstallation of the sub-application by the main application of the micro-frontend, and the micro-frontend activates multiple sub-applications at the same time, which may cause the address information of multiple sub-applications that share the address bar of the browser through the routing mechanism to conflict with each other. Through the data processing method provided in the embodiment of the present application, the address information stored in the first cache changes regularly with the change of the first address information of the browser, which is conducive to making the address information currently stored in the first cache consistent with the currently activated sub-application, and then, the multiple address information in the updated first cache are associated with the same first address ciphertext data, which is conducive to avoiding the problem of conflicting address information of multiple sub-applications activated at the same time. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the drawings required for use in the embodiments or the prior art descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in this specification. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative labor.

[0022] Figure 1 A schematic diagram of an implementation environment of a data processing method provided in an embodiment of the present application;

[0023] Figure 2 A processing flow chart of a data processing method provided in an embodiment of the present application;

[0024] Figure 3 A processing flow chart of another data processing method provided in an embodiment of the present application;

[0025] Figure 4 A schematic diagram of a data processing device provided in an embodiment of the present application;

[0026] Figure 5 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0027] In order to enable those skilled in the art to better understand the technical solutions in the embodiments of the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of this specification, not all of the embodiments. Based on the embodiments of the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.

[0028] This specification provides a data processing method embodiment:

[0029] Qiankun is a micro-frontend framework based on single-spa. It provides encapsulation of sub-application loading, isolation, and master-sub-application communication functions on the basis of single-spa, allowing web developers to build a production-available micro-frontend architecture system more simply and painlessly. single-spa is a solution for web front-end microservices, which defines a set of protocols including configuration information of master and sub-applications, the life cycle of sub-applications, and when to activate and uninstall sub-applications.

[0030] According to the existing design of Qiankun and single-spa, multiple sub-applications that rely on browser routing cannot be displayed on the page at the same time, because the browser has only one URL (uniform resource location). If multiple sub-applications that rely on browser routing are activated at the same time, most of the sub-applications will display error pages, and only one sub-application that occupies the browser's URL can be displayed normally. The reason for the above problem is that the sub-applications all rely on the browser URL. There is a corresponding relationship between the URL and the routing configuration of the sub-application. If the routing configuration is different, the URL must be different. The routing configuration of multiple sub-applications cannot be exactly the same at the same time. Therefore, if the micro-frontend activates multiple sub-applications at the same time, the pages of most sub-applications cannot be displayed normally, which is not conducive to the development work based on the micro-frontend.

[0031] Based on the Qiankun micro-frontend technology stack, if you want to activate multiple sub-applications at the same time, the following conditions must be met:

[0032] On the one hand, the sub-application must be activated manually by loading MicroApp (manual loading of micro-applications), and the automatic control management based on browser route changes by register MicroApps (routing configuration micro-applications) cannot be used. In the process of activating multiple sub-applications, users need to manually mount and uninstall.

[0033] On the other hand, if the activated sub-application has a routing jump requirement, for example, jumping from one sub-application to another, in this case, the memory routing mode must be used. After the page is refreshed, the sub-application using this routing mode will lose the page path and parameter status. In addition, there is also the problem that the micro front-end does not support the angular technology stack, because the angular technology stack routing library does not support the memory routing mode.

[0034] Without manual intervention, if the micro frontend currently activates more than one sub-application, the addresses of the sub-applications may conflict with each other, and the sub-applications cannot be displayed normally. If the micro frontend is activated with manual configuration at the same time, there are many problems such as cumbersome process, low manual operation efficiency, easy loss of information after page refresh, and failure to support specific development frameworks.

[0035] Therefore, in order to solve the above problems, an embodiment of the present application provides a data processing method.

[0036] The data processing method provided in one or more embodiments of this specification may be applicable to the implementation environment of the data processing method, such as Figure 1 As shown, the implementation environment at least includes a server 101 for processing data.

[0037] The server 101 may be a single server, or a server cluster consisting of a plurality of servers, or one or more cloud servers in a cloud computing platform, for processing data.

[0038] In the implementation environment, when the server 101 processes data, first, when the browser's first address information is detected to be updated, the updated first address information is obtained; second, if the second address information in the browser's first cache does not match the updated first address information, the first cache is updated according to the updated first address information; then, the address information in the updated first cache is encrypted to obtain the first address ciphertext data; then, a first mapping relationship between each address information in the updated first cache and the first address ciphertext data is established; finally, the first mapping relationship is stored in a second cache different from the first cache. In this way, by detecting the browser's first address information update, and updating the first cache according to the updated first address information when it is determined that the second address information in the browser's first cache does not match the updated first address information, the address information stored in the first cache can be changed regularly with the change of the browser's first address information, and then, by encrypting the address information in the updated first cache to obtain the first address ciphertext data, establishing the first mapping relationship between each address information in the updated first cache and the first address ciphertext data, and storing the first mapping relationship in the second cache, multiple address information can be associated with the same first address ciphertext data. Considering that in the application scenario of the micro-frontend, the change of the first address information of the browser may occur along with the activation or uninstallation of the sub-application by the main application of the micro-frontend, and the micro-frontend activates multiple sub-applications at the same time, which may cause the address information of multiple sub-applications that share the address bar of the browser through the routing mechanism to conflict with each other. Through the data processing method provided in the embodiment of the present application, the address information stored in the first cache changes regularly with the change of the first address information of the browser, which is conducive to making the address information currently stored in the first cache consistent with the currently activated sub-application, and then, the multiple address information in the updated first cache are associated with the same first address ciphertext data, which is conducive to avoiding the problem of conflicting address information of multiple sub-applications activated at the same time.

[0039] Figure 2 A processing flow chart of a data processing method provided in an embodiment of the present application. Figure 2 The data processing method provided in this embodiment specifically includes steps S202 to S210:

[0040] Step S202: when it is detected that the first address information of the browser is updated, the updated first address information is obtained.

[0041] The first address information may represent the address information corresponding to the sub-application to be activated by the main application of the micro-frontend or the address information corresponding to the sub-application already activated by the main application of the micro-frontend.

[0042] The ordinal numbers such as "first" and "second" in this specification are used to distinguish different technical features and have no actual meaning, so they will not be elaborated below.

[0043] The browser can be any browser running a front-end application developed based on the micro-front-end architecture.

[0044] The number of browsers can be one or more. When there are more than one browsers, the data processing flow corresponding to each browser is the same. This specification uses one browser as an example to illustrate the data processing method.

[0045] Micro Frontends is a front-end architecture pattern that draws on the concept of Microservices and aims to split a large front-end application into multiple smaller, more independent, easier to manage and develop parts. Each part can be independently developed, tested, deployed and maintained by different teams, and finally integrated together in some way to form a complete front-end application.

[0046] Micro Frontends Frameworks are a class of tools or libraries designed specifically to support micro frontend architecture. Micro frontend architecture is a methodology for splitting a large frontend application into multiple small, independent, independently developed and deployed sub-applications. Micro frontend frameworks provide a series of functions and mechanisms to help developers build, manage and integrate these sub-applications more conveniently.

[0047] Micro frontend is an architectural pattern or methodology that guides how to split a large frontend application into multiple small, independent sub-applications, and how to combine these sub-applications to form a complete frontend application. Micro frontend frameworks are tools or libraries that implement this architectural pattern. They provide a series of functions and mechanisms to help developers build and manage micro frontend applications more conveniently. Micro frontend frameworks are important tools for implementing micro frontend architectures. They simplify the development and integration process of micro frontend applications, improve development efficiency and application maintainability.

[0048] It should be noted that the micro-frontend framework is one of the means to implement the micro-frontend architecture, that is, the application of the micro-frontend is not limited to the micro-frontend framework, and the micro-frontend architecture can also be implemented through other front-end frameworks, tools or libraries. In this specification, the data processing method is applied to the micro-frontend framework as an example to illustrate the implementation process of the data processing method. Other front-end frameworks, tools or libraries with the architectural style of the micro-frontend can refer to the corresponding description part of the micro-frontend framework.

[0049] The micro front-end framework can have a unique main application and multiple sub-applications. The main application can be used to manage the multiple sub-applications. Each sub-application can run in a browser, and each sub-application can share the address information of the browser through a routing mechanism. The routing mechanism refers to how to manage navigation and page switching between different sub-applications in the micro front-end architecture.

[0050] Each sub-application of the micro-frontend framework can be regarded as an independent front-end application developed based on the micro-frontend framework. At the same time, the main application and sub-applications of the micro-frontend framework can be used to jointly constitute a complete front-end application developed based on the micro-frontend framework.

[0051] Exemplarily, the aforementioned browser running a front-end application developed based on the micro-front-end architecture can be a browser that is on the same electronic device as the micro-front-end framework, can interact with the micro-front-end framework, and runs a front-end application developed based on the micro-front-end framework. The micro-front-end framework itself does not include a browser, but their design and implementation need to consider the browser environment. The micro-front-end framework can use the functions of the browser to achieve the collaborative work of multiple independent sub-applications to ensure consistent behavior in different browsers.

[0052] Each sub-application of the micro-frontend framework can be an independent and independently deployable front-end application unit in the micro-frontend architecture. Each sub-application has its own code base, development process and deployment cycle, but together they constitute a larger overall application. Each sub-application can have a corresponding data processing process.

[0053] For example, the micro front-end framework has a main application X1, a sub-application x1, a sub-application x2, and a sub-application x3, wherein the sub-application x1, the sub-application x2, and the sub-application x3 share the first address information of the browser through a routing mechanism.

[0054] The first address information of the browser may be the address information displayed in the address bar of the browser.

[0055] The first address information may be a URL (uniform resource locator) or other information used to locate a network resource.

[0056] URL is an addressing method specially set up to identify the location of Internet resources. URL is a concise representation of the location and access method of resources that can be obtained from the Internet. It is the address of standard resources on the Internet. Every file on the Internet has a unique URL, which contains information indicating the location of the file and how the browser should handle it.

[0057] Acquiring the updated first address information may be acquiring the address information displayed in the address bar of the browser after the update, and using the address information as the updated first address information.

[0058] The micro front-end framework can detect the update of the first address information of the browser. In the case where the first address information of the browser is updated, the first address information before the update may be the same as or different from the first address information after the update.

[0059] For example, when a user triggers a browser to jump from one sub-application to another sub-application, the first address information of the browser is updated from address 1 to address 2, and the first address information of the browser is different before and after the update.

[0060] For another example, when the browser is refreshed, the first address information of the browser is updated from address 1 to address 1, and the first address information of the browser before and after the update is the same.

[0061] The browser's first address information update may occur when the micro-frontend's main application activates the sub-application, or it may occur when the micro-frontend's main application unloads the sub-application, or it may occur without any main application loading / unloading the sub-application.

[0062] For example, triggering the main application to activate a new sub-application through user operation causes the first address information of the browser to be updated. In this case, the update of the first address information of the browser occurs along with the main application of the micro-frontend activating the sub-application.

[0063] Alternatively, jumping from an activated sub-application to another inactivated sub-application causes the first address information of the browser to be updated. In this case, the update of the first address information of the browser occurs along with the activation of the sub-application by the main application of the micro-frontend.

[0064] Alternatively, the browser back triggers the browser's first address information to be updated. In this case, the browser's first address information is updated as the main application of the micro-frontend uninstalls the sub-application.

[0065] Alternatively, jumping from one activated sub-application to another activated sub-application causes the first address information of the browser to be updated. In this case, no main application loads / unloads the sub-application when the first address information of the browser is updated.

[0066] It should be noted that in the case of a browser refresh, although the first address information before the refresh is the same as the first address information after the refresh, the micro-frontend framework can detect that the first address information of the browser is updated, and the status information representing whether each sub-application is activated remains unchanged before and after the browser refresh.

[0067] If the browser's first address information is updated along with the activation of a sub-application by the main application of the micro-frontend, for example, jumping from an activated sub-application to another inactivated sub-application causes the browser's first address information to be updated, then the first address information can represent the address information corresponding to the sub-application to be activated by the main application of the micro-frontend.

[0068] The above-mentioned "sub-application to be activated by the main application" refers to a sub-application that is in an inactive state before the first address information of the browser is updated, which is converted from an inactive state to an active state when the first address information of the browser is updated, and which is in an active state after the first address information of the browser is updated and after the activation operation is completed.

[0069] For any sub-application in the micro-frontend framework, the state information of the sub-application at any point in time can be either an activated state or an inactivated state. When the sub-application is in an activated state, the interface of the sub-application can be displayed in the browser interface, and the user can interact with the interface of the sub-application; when the sub-application is in an inactivated state, the interface of the sub-application is not displayed in the browser interface, and the user cannot interact with the sub-application in any way.

[0070] If the browser's first address information is updated when the micro-frontend's main application uninstalls the sub-application, for example, the browser's first address information is updated when the browser is rewound, then the first address information may represent the address information corresponding to the sub-application that has been activated by the micro-frontend's main application.

[0071] In a specific implementation, obtaining the updated first address information includes: intercepting a request from an activated sub-application to jump to an inactivated sub-application; extracting the address information of the inactivated sub-application from the request, and using the address information of the inactivated sub-application as the updated first address information.

[0072] Exemplarily, a request from an activated sub-application to an inactivated sub-application can be used to request to jump from a first sub-application to a second sub-application. The first sub-application and the second sub-application are two different sub-applications of the micro-frontend framework. The first sub-application is in an activated state, and the second sub-application is in an inactivated state.

[0073] The jump between the two sub-applications mentioned above will cause the main application to activate a new sub-application, and the second sub-application is the sub-application to be activated by the main application.

[0074] The request for the activated sub-application to jump to the inactivated sub-application may carry address information, and the address information may be address information of the second sub-application.

[0075] Exemplarily, the address information of the second sub-application may be a static routing path of the second sub-application. A static routing path is a pre-configured routing path with a fixed value. The static routing path may reflect the real address of the page of the corresponding sub-application.

[0076] To intercept the sub-application jump request, the main application can call the hijacking function to hijack the routing jump function called by the sub-application in the global scope of the micro frontend.

[0077] Function hijacking refers to controlling or tampering with program logic by modifying or replacing the behavior of a function. Function hijacking can be achieved in the following ways:

[0078] (1) Modify the definition of a function: Change the behavior of a function by modifying its code or properties. Specifically, this may include adding, deleting, or modifying the function's parameters, return values, execution logic, etc.

[0079] (2) Proxy function: Create a proxy function to wrap the original function and perform additional operations or modifications before or after execution. The proxy function can perform pre-processing before calling the original function or post-processing after the call.

[0080] (3) Execution context hijacking: Controlling the behavior of a function by changing its execution context (this value). In practice, you can use the call, apply, or bind methods to bind a function to a different object, thereby changing the reference of this, and so on.

[0081] The above-mentioned method of implementing the hijacking function is only exemplary, and any method can be used in this implementation to implement the call of the hijacking function.

[0082] The internal jump logic of each sub-application is a fixed jump logic pre-configured based on the static routing path of each sub-application. On this basis, the main application of the micro-frontend framework can hijack all routing jump functions globally, such as push, replace, go, etc. When any sub-application calls the aforementioned jump function, the paths and parameters of these jump functions will first pass through the hijacking function, and then be uniformly summarized to the main application by the hijacking function.

[0083] Step S204: if the second address information in the first cache of the browser does not match the updated first address information, the first cache is updated according to the updated first address information.

[0084] The second address information may represent the address information corresponding to the sub-application that has been activated by the main application of the micro front-end.

[0085] The first cache of the browser can be a cache object declared in the main application of the micro front-end and used to cache the address information corresponding to the activated sub-application.

[0086] Cache Object generally refers to a temporary storage area used in computer science and software development to store data for quick access and retrieval.

[0087] The main application of a micro frontend can be the main application of a micro frontend framework, or it can be the main application of other frontend frameworks, tools, or libraries with a micro frontend architecture style.

[0088] One or more second address information may be stored in the first cache of the browser, and the second address information indicates address information corresponding to the sub-application that has been activated by the main application of the micro-frontend.

[0089] In the micro frontend framework, the main application activates the sub-application, which refers to the process of the main application dynamically loading and initializing one or more sub-applications based on user operations or application status changes.

[0090] It should be emphasized that the second address information in the first cache represents the address information corresponding to the activated sub-application of the main application of the micro-frontend, where "activated" means that the corresponding sub-application is in an activated state before detecting that the first address information of the browser is updated.

[0091] Exemplarily, if the update of the first address information of the browser is triggered by activating a new sub-application, that is, the main application controls a sub-application to transition from an inactive state to an active state, so that the first address information of the browser is updated, then during the execution of step S204, the sub-application in the state transition is in an inactive state before detecting the update of the first address information of the browser, so the sub-application in the state transition does not belong to an "activated" sub-application, but a "sub-application in the process of activation", and the second address information of the sub-application in the state transition is not stored in the first cache.

[0092] If the update of the first address information of the browser is triggered by the browser backing off, the browser backing off will cause the main application to control an activated sub-application to transition from an activated state to an inactivated state, and the first address information of the browser is updated. Then, during the execution of step S204, the sub-application in the state transition is in an activated state before detecting the update of the first address information of the browser, so the sub-application in the state transition belongs to an "activated" sub-application, and the first cache stores the second address information of the sub-application in the state transition.

[0093] The second address information may be a routing path of the activated sub-application.

[0094] In the micro frontend architecture, the routing path of an activated sub-application refers to the path defined by the sub-application in its independent routing system, which is used to navigate and display different content of the sub-application. Each sub-application has its own routing configuration, and frameworks are usually used to define and manage these routes.

[0095] Routing is a core concept in web development. It refers to the process of deciding how to handle user requests and display corresponding content based on the URL. Front-end routing is a technology that implements page navigation in single-page applications. The routing path is part of the front-end routing, which can be used to locate pages or components in the application.

[0096] Before executing step S204, it may be determined whether the second address information in the first cache of the browser matches the updated first address information.

[0097] If the second address information in the first cache of the browser does not match the updated first address information, the first cache is updated according to the updated first address information; if the second address information in the first cache of the browser matches the updated first address information, no special operation is required, nor is it necessary to continue to execute subsequent steps S206-S210.

[0098] In the process of determining whether the second address information in the first cache of the browser matches the updated first address information, the updated first address information may be used directly, that is, matching processing is performed on the updated first address information and the second address information.

[0099] In the process of determining whether the second address information in the first cache of the browser matches the updated first address information, the preset address parameter corresponding to the updated first address information can also be determined based on the updated first address information, and the preset address parameter is matched with the second address information.

[0100] For example, when the first address information is a URL, the preset address parameter may be a pathname parameter value. When a URL update of the browser is detected, the updated URL is obtained, and the pathname parameter value of the updated URL is determined.

[0101] Pathname is part of the URL. Pathname can be used to indicate the location of a resource on the server. The pathname parameter value can be a string used to specify the location of a file or directory.

[0102] In the process of matching the updated first address information with the second address information, if there is at least one second address information in the first cache that is the same as the updated first address information, it can be determined that the second address information in the first cache of the browser matches the updated first address information; conversely, if each second address information in the first cache is different from the updated first address information, it can be determined that the second address information in the first cache of the browser does not match the updated first address information.

[0103] For example, the main application controls an activated sub-application 1 to jump to another activated sub-application 2. The updated first address information obtained is the address information S2 of the sub-application 2. The first cache stores the second address information S2 of the sub-application 2. The updated first address information S2 is the same as the second address information S2 in the first cache. It can be determined that the second address information in the first cache of the browser matches the updated first address information.

[0104] Alternatively, the main application controls an activated sub-application 1 to jump to another inactivated sub-application 3, and the updated first address information obtained is the address information S3 of the sub-application 3. The first cache stores the second address information S1 of the activated sub-application 1 and the second address information S2 of the activated sub-application 2. Then, each second address information in the first cache is different from the updated first address information S3, and it can be determined that the second address information in the first cache of the browser does not match the updated first address information.

[0105] In the process of matching the preset address parameters corresponding to the updated first address information with the second address information, if there is at least one second address information in the first cache that has an inclusion relationship with the preset address parameter, it can be determined that the second address information in the first cache of the browser matches the updated first address information; conversely, if there is no inclusion relationship between each second address information in the first cache and the preset address parameter, it can be determined that the second address information in the first cache of the browser does not match the updated first address information.

[0106] For example, the second address information is "S1.XXXX", the preset address parameter corresponding to the updated first address information is "S1", the prefix of the second address information is the same as the preset address parameter, and the second address information includes the preset address parameter. It can be determined that the second address information in the first cache of the browser matches the updated first address information.

[0107] The first cache is updated according to the updated first address information. The updating method may be to add new address information, to delete old address information, or to both add new address information and delete old address information.

[0108] The old address information refers to the second address information in the first cache.

[0109] In a specific implementation, when the update of the first address information of the browser is triggered by activating a sub-application, the first cache is updated according to the updated first address information, including: adding the updated first address information to the first cache; when the update of the first address information of the browser is triggered by the browser going back, the first cache is updated according to the updated first address information, including: determining the address information of the sub-application that has been activated and become inactivated when the browser goes back according to the updated first address information and the second address information, and deleting the address information of the sub-application that has been activated and become inactivated in the first cache.

[0110] Activating a sub-application means that the main application performs a state transition on a sub-application in an inactive state, so that the sub-application is in an active state after the transition is completed. Activating a sub-application can be understood as the main application loading and starting a sub-application so that the sub-application can be presented on the user interface and begin to respond to user interactions. When the main application activates any sub-application at any point in time, the browser's first address information will be updated once.

[0111] When the update of the browser's first address information is triggered by activating a sub-application, and the updated first address information is the address information of the sub-application that is being activated, updating the first cache based on the updated first address information may be to add the address information of the sub-application that is being activated as a second address information to the first cache.

[0112] After the update is completed, and after the sub-application that is being activated completes activation, each second address information in the updated first cache still represents the address information corresponding to the sub-application that has been activated by the main application of the micro-frontend.

[0113] For example, when a user operation triggers the main application to activate a new sub-application, causing the browser's first address information to be updated, the url before the browser update is X, and the url after the update is X', and the updated url "X'" is obtained. Before the browser's url is updated, the first cache stores: the second address information x1 of the activated sub-application 1, the second address information x2 of the activated sub-application 2, and the second address information x3 of the activated sub-application 3. The updated url "X'" is used as a second address information and added to the first cache, and the updated first cache stores: x1, x2, x3 and X'.

[0114] Browser back refers to the operation of returning to a previously browsed web page by clicking the "back" button on the browser interface or using keyboard shortcuts when using a web browser.

[0115] When a user clicks a link, enters a URL, or searches in a browser, the browser records these actions in the history. Each time you navigate to a new page, the information about that page is added to the history stack. When a user clicks the "Back" button, the browser pops the most recently visited page from the history stack and loads that page, returning the user to the previous browsing state. The browser back function is one of the basic features of web browsing, allowing users to easily go back to previous pages while browsing web pages without having to re-enter the URL or re-search.

[0116] In the case where the update of the first address information of the browser is triggered by the browser backing out, the address information of the sub-application that has been activated and become inactive when the browser backs out is determined based on the updated first address information and the second address information, and the address information of the sub-application that has been activated and become inactive is deleted from the first cache.

[0117] The browser back may cause a sub-application to be uninstalled by the main application. For example, clicking the back control can trigger a browser back, so that the most recently activated sub-application is uninstalled by the main application when the browser backs up.

[0118] The browser back may cause multiple sub-applications to be uninstalled by the main application. For example, a "continuous back" control is pre-configured. When the control is clicked, it automatically triggers N browser backs, where N is an integer greater than 1, so that the most recently activated N sub-applications are uninstalled by the main application when the browser backs.

[0119] The sub-application that changes from activated to inactivated refers to a sub-application whose state information changes from an activated state to an inactivated state.

[0120] For example, before time point T1, the browser's URL is X1. At time point T1, the main application is triggered by user operation to activate a sub-application A, so that the browser's URL is updated to X2. At time point T2, the main application uninstalls the sub-application A by executing the browser back operation, and the browser's URL is updated to X1.

[0121] In the above example, the sub-application A is the sub-application that changes from activated to inactive when the browser is backed up, and X1 is the updated first address information.

[0122] When the browser rewinds, the updated first address information may be a first address ciphertext data generated by executing the data processing method provided in this embodiment. The first address ciphertext data may be used to determine the corresponding one or more address information. Based on the one or more address information and the second address information in the first cache, the address information of the sub-application that has been activated and become inactive when the browser rewinds may be determined, and then, the address information of the sub-application that has been activated and become inactive may be deleted from the first cache.

[0123] For example, before the first address information of the browser is updated, three sub-applications are activated at the same time: sub-application 1, sub-application 2, and sub-application 3. The first cache stores address information x1 of activated sub-application 1, address information x2 of activated sub-application 2, and address information x3 of activated sub-application 3.

[0124] The update of the browser's first address information is triggered by the browser's back operation. After the browser's first address information is updated, it returns to the previous step from having three sub-applications activated at the same time, that is, sub-application 1 and sub-application 3 are activated at the same time. The back operation causes the main application to uninstall sub-application 2.

[0125] The url before the browser is updated is X, and the url after the update is X'. In this case, X' is a common address information generated by executing the data processing method provided by this embodiment and associated with sub-application 1 and sub-application 3. Therefore, according to X', it can be determined that the corresponding address information includes x1 and x3. Furthermore, it can be determined that the address information of the sub-application that has been activated and turned inactive when the browser is backed up is x2, and x2 is deleted from the first cache, so that the updated first cache stores: x1 and x3.

[0126] Step S206, encrypting the updated address information in the first cache to obtain first address ciphertext data.

[0127] The updated first cache is obtained by executing step S204 “updating the first cache according to the updated first address information”.

[0128] The updated first cache may store one or more address information.

[0129] When the number of address information in the updated first cache is one, the address information is encrypted to obtain ciphertext data representing the address information, and the ciphertext data is used as first address ciphertext data of the address information in the updated first cache.

[0130] In the case where there are multiple address information in the updated first cache, the multiple address information are first assembled to obtain a data set, and then the data set is encrypted to obtain ciphertext data representing the data set, and the ciphertext data is used as the first address ciphertext data of the address information in the updated first cache.

[0131] For each update of the first address information of the browser, the number of first address ciphertext data of the address information in the updated first cache is only one.

[0132] The encryption method used in the encryption process may be hash encryption, for example, md5 (Message-Digest Algorithm 5). The encryption process may also use any reversible encryption algorithm. Encrypting the address information in the updated first cache by a reversible encryption algorithm is helpful for parsing the first address ciphertext data to obtain page parameters when necessary.

[0133] In a specific implementation, before encrypting the address information in the updated first cache to obtain the first address ciphertext data, the data processing method also includes: for each address information in the updated first cache, if there is pre-stored address information that is the same as the address information in the updated first cache, then retain the address information in the updated first cache; if there is no pre-stored address information that is the same as the address information in the updated first cache, then delete the address information in the updated first cache.

[0134] By comparing the updated address information in the first cache with the pre-stored address information before encrypting the updated address information in the first cache, it is possible to avoid using erroneous address information as an encryption object when there may be unrecognizable address information in the address information in the first cache.

[0135] For example, if the browser URL is modified by user operation and garbled characters are inserted into the original URL, the URL with garbled characters obviously does not match the second address information of the activated sub-application stored in the first cache, and will be regarded as a new address by the micro-frontend framework, but the micro-frontend framework cannot actually recognize the URL with garbled characters inserted. Therefore, before encrypting the address information in the updated first cache, it is necessary to determine whether there is pre-stored address information that is the same as the address information to delete the wrong address information.

[0136] Before encrypting the address information in the updated first cache, the address information in the updated first cache is compared with the pre-stored address information. In the case where the browser is continuously rewound multiple times, resulting in the main application uninstalling multiple sub-applications in batches, it is also possible to repeatedly verify that the address information of the sub-application that has been activated and turned inactive when the browser is rewound during the execution of step S204 is correct.

[0137] For example, the main application originally activated K sub-applications at the same time: sub-application 1, sub-application 2, ..., sub-application K, where K is an integer greater than 1. The browser continuously backs off for multiple times, causing the main application to batch uninstall multiple sub-applications and update the first address information of the browser. Before encryption, the address information in the updated first cache is compared with the pre-stored address information to repeatedly verify that the address information of the sub-application that has been activated and turned inactive when the browser backs off is correct as determined in the previous step S204.

[0138] The number of pre-stored address information can be one or more. The specific number can be determined by the number of sub-applications of the micro-frontend. Each pre-stored address information is pre-configured for a sub-application of the micro-frontend framework.

[0139] In the main application of the micro-frontend framework, the conditions for each sub-application to be activated can be configured, and the conditions for each sub-application to be activated include the pre-stored address information of the sub-application.

[0140] For example, the conditions for (a1) sub-application nlpweb to be activated are:

[0141] The route path prefixed with / nlpweb / * will activate the sub-application nlpweb.

[0142] In this condition, the pre-stored address information of the sub-application nlpweb is "a routing path with / nlpweb / * as the prefix".

[0143] (a2) The conditions under which the sub-application OCRWEB is allowed to be activated are:

[0144] The routing path prefixed with / ocrweb / * will activate the sub-application ocrweb.

[0145] In this condition, the pre-stored address information of the sub-application ocrweb is "the routing path with / ocrweb / * as the prefix".

[0146] (a3) The conditions for the sub-application inferweb to be activated are:

[0147] The routing path prefixed with / inferweb / * will activate the sub-application inferweb.

[0148] In this condition, the pre-stored address information of the sub-application inferweb is "a routing path with / inferweb / * as the prefix".

[0149] The plurality of pre-stored address information includes: "a routing path prefixed with / nlpweb / *", "a routing path prefixed with / ocrweb / *", and "a routing path prefixed with / inferweb / *".

[0150] In specific implementation, the conditions under which each sub-application of the above custom configuration is allowed to be activated can be represented by a regular expression.

[0151] Before encrypting the address information in the updated first cache to obtain the first address ciphertext data, it can be determined for each address information in the updated first cache whether there is pre-stored address information that is the same as the address information in the updated first cache.

[0152] Alternatively, before encrypting the address information in the updated first cache to obtain the first address ciphertext data, it is also possible to determine, for each address information in the updated first cache, whether there is pre-stored address information that matches the address information in the updated first cache.

[0153] The method for determining whether a match is made can be freely set. For example, the pre-stored address information matches the address information in the updated first cache. The address information in the updated first cache may belong to the pre-stored address information, or there may be an inclusion relationship between the address information in the updated first cache and the pre-stored address information, and so on.

[0154] For example, the first cache after update stores:

[0155] Routing path 1: / nlpweb / x1;

[0156] Routing path 2: / ocrweb / x2;

[0157] Routing path 3: / nlp123web / x1.

[0158] The plurality of pre-stored address information includes: "a routing path prefixed with / nlpweb / *", "a routing path prefixed with / ocrweb / *", and "a routing path prefixed with / inferweb / *".

[0159] That is, the updated address information in the first cache includes routing path 1 and routing path 2.

[0160] By comparing routing path 1 and the condition "routing paths prefixed with / nlpweb / * will activate the sub-application nlpweb", it can be seen that the sub-application nlpweb is allowed to be activated by the main application, and routing path 1 belongs to "routing paths prefixed with / nlpweb / *", that is, there is a pre-stored address information "routing path prefixed with / nlpweb / *" that matches routing path 1.

[0161] By comparing routing path 2 and the condition "routing paths prefixed with / ocrweb / * will activate the sub-application OCRweb", it can be seen that the sub-application OCRweb is allowed to be activated by the main application, and routing path 2 belongs to the "routing path prefixed with / ocrweb / *", that is, there is a pre-stored address information "routing path prefixed with / ocrweb / *" that matches routing path 2.

[0162] By comparing routing path 3 and the condition "routing path prefixed with / nlpweb / * will activate sub-application nlpweb", it can be seen that routing path 3 does not belong to "routing path prefixed with / nlpweb / *", and therefore, there is no pre-stored address information "routing path prefixed with / nlpweb / *" that matches routing path 1.

[0163] For each address information in the updated first cache, if there is pre-stored address information that is the same as the address information in the updated first cache, the address information in the updated first cache is retained; if there is no pre-stored address information that is the same as the address information in the updated first cache, the address information is deleted from the updated first cache.

[0164] For example, when it is detected that the first address information of the browser is updated, the updated first address information S1' is obtained, the first cache stores: S1, S2 and S3, and S1' is added to the first cache. The updated first cache stores: S1', S1, S2 and S3.

[0165] In the main application of the micro frontend framework, the conditions for each sub-application to be activated are configured, including:

[0166] (b1) The routing path is "S1" which will activate sub-application 1;

[0167] (b2) The routing path is "S2" which will activate sub-application 2;

[0168] (b3) A routing path of "S3" will activate sub-application 3, and so on.

[0169] The plurality of pre-stored address information includes: S1, S2, and S3, and so on.

[0170] For each address information in the updated first cache, in the process of determining whether there is pre-stored address information that is the same as the address information in the updated first cache:

[0171] (c1) For S1', S1' is compared with S1, S2 and S3 respectively to obtain the comparison result corresponding to S1'.

[0172] (c2) For S1, compare S1 with S1, S2 and S3 respectively to obtain the comparison result corresponding to S1.

[0173] (c3) For S2, compare S2 with S1, S2 and S3 respectively to obtain the comparison result corresponding to S2.

[0174] (c4) For S3, S3 is compared with S1, S2 and S3 respectively to obtain the comparison result corresponding to S3.

[0175] As shown in (c1), based on the comparison result corresponding to S1', it can be determined that the conditions for allowing each sub-application to be activated are not met. Furthermore, it can be determined that there is an abnormality in S1', and there is no pre-stored address information that is the same as the address information S1' in the updated first cache. The address information S1' is deleted in the updated first cache.

[0176] As shown in (c2), according to the comparison result corresponding to S1, it can be determined that the conditions for sub-application 1 to be activated are met, the pre-stored address information S1 is the same as the address information S1 in the updated first cache, and the address information S1 in the updated first cache is retained.

[0177] As shown in (c3), according to the comparison result corresponding to S2, it can be determined that the conditions for sub-application 2 to be activated are met, the pre-stored address information S2 is the same as the address information S2 in the updated first cache, and the address information S2 in the updated first cache is retained.

[0178] As shown in (c4), according to the comparison result corresponding to S3, it can be determined that the conditions for sub-application 3 to be activated are met, the pre-stored address information S3 is the same as the address information S3 in the updated first cache, and the address information S3 in the updated first cache is retained.

[0179] In summary, when the address information in the updated first cache is encrypted to obtain the first address ciphertext data, the updated first cache stores: S1, S2 and S3.

[0180] For another example, the first cache stores: X1, X2 and X3. When the browser's first address information is detected to be updated, the updated first address information X' is obtained, and the first cache is updated according to X'. The updated first cache stores: X1 and X2.

[0181] In the main application of the micro frontend framework, the conditions for each sub-application to be activated are configured, including:

[0182] (d1) The routing path is "X1" which will activate sub-application 1;

[0183] (d2) The routing path is "X2" which will activate sub-application 2;

[0184] (d3) A routing path of "X3" will activate sub-application 3, and so on.

[0185] The plurality of pre-stored address information includes: X1, X2, and X3, and so on.

[0186] For each address information in the updated first cache, in the process of determining whether there is pre-stored address information that is the same as the address information in the updated first cache:

[0187] (e1) For X1, compare X1 with X1, X2 and X3 respectively to obtain the comparison result corresponding to X1.

[0188] (e2) For X2, compare X2 with X1, X2 and X3 respectively to obtain the comparison result corresponding to X2.

[0189] As shown in (e1), according to the comparison result corresponding to X1, it can be determined that the conditions for sub-application 1 to be activated are met, the pre-stored address information X1 is the same as the address information X1 in the updated first cache, and the address information X1 in the updated first cache is retained.

[0190] As shown in (e2), the comparison result corresponding to X2 can determine that the conditions for sub-application 2 to be activated are met, the pre-stored address information X2 is the same as the address information X2 in the updated first cache, and the address information X2 in the updated first cache is retained.

[0191] In summary, when the address information in the updated first cache is encrypted to obtain the first address ciphertext data, the updated first cache stores: X1 and X2.

[0192] For each address information in the updated first cache, judging whether there is pre-stored address information that is the same as the address information in the updated first cache can also be achieved in the following way: for each address information in the updated first cache, determining the sub-application corresponding to the address information, using the address information as a parameter of a custom function passed into the sub-application, calling the custom function to compare the address information with the pre-stored address information of the sub-application, and obtaining a return value; if the return value is the first return value, determining whether there is pre-stored address information that is the same as the address information in the updated first cache; if the return value is the second return value, determining whether there is pre-stored address information that is the same as the address information in the updated first cache.

[0193] In addition, if there is no pre-stored address information that is identical to the address information in the updated first cache, it means that the address information may have been misjudged during the execution of step S204, and the address information of an unrecognizable or inactive sub-application was mistakenly added to the first cache, or the address information of a sub-application that has been activated and turned into an inactive sub-application that should have been deleted was mistakenly retained in the first cache. In this case, the address information can be determined as abnormal address information and recorded for subsequent analysis of the cause of the misjudgment.

[0194] Each sub-application of the micro-frontend framework may have a corresponding custom function, which is used to determine whether the pre-stored address information of the sub-application is the same as the address information in the updated first cache.

[0195] Exemplarily, the parameter passed into the custom function may be the address object location of the sub-application, and the return value of the custom function may be a Boolean value.

[0196] Location is a property of the window object. Because it returns an object, the location property is also called the location object. Its function is to get or set the URL of the window. The window object represents the window opened in the browser.

[0197] The address object location passed into the custom function is the address information in the first cache after the update.

[0198] For each sub-application, when the custom function corresponding to the sub-application is called, a match is performed based on the address object and the pre-stored address information of the sub-application. If the match succeeds, the return value of the custom function is the first Boolean value. If the match fails, the return value of the custom function is the second Boolean value.

[0199] A successful match may be when the value of the address object is the same as the pre-stored address information. Conversely, a failed match may be when the value of the address object is different from the pre-stored address information.

[0200] A successful match may also mean that the pre-stored address information and the value of the address object have an inclusive relationship. Conversely, a failed match may mean that the pre-stored address information and the value of the address object do not have an inclusive relationship.

[0201] The matching process may refer to the aforementioned corresponding description part for each address information in the updated first cache to determine whether there is a matching pre-stored address information with the address information in the updated first cache.

[0202] Boolean is a basic data type in computer science that has only two possible values: True and False. Boolean values ​​are often used to represent the results of logical conditions, such as comparison operations, logical operations, and conditional judgments.

[0203] For example, the sub-application nlpweb has a corresponding custom function 1. When calling the custom function 1, matching processing is performed according to the address object and the pre-stored address information of the sub-application nlpweb. The custom function 1 returns a Boolean value based on the matching result, and the Boolean value is one of true and false. If the Boolean value returned by the custom function 1 is true, it can be determined that the pre-stored address information of the sub-application nlpweb matches the address information in the updated first cache; if the Boolean value returned by the custom function 1 is false, the micro framework can determine that the pre-stored address information of the sub-application nlpweb does not match the address information in the updated first cache.

[0204] In a specific implementation, the address information in the updated first cache is encrypted to obtain first address ciphertext data, including: constructing the address information in the updated first cache into address information in a preset format; and hashing the address information in the preset format to obtain first address ciphertext data.

[0205] The address information in the preset format may be obtained by assembling a plurality of address information.

[0206] Exemplarily, the preset format may be JSON (JavaScript Object Notation) format. JSON is a lightweight data exchange format that is based on a subset of the JavaScript programming language but has become a language-independent text format. The design goal of JSON is to be easy for humans to read and write, and also easy for machines to parse and generate.

[0207] Taking the preset format as JSON format as an example, the specific implementation process of constructing the updated address information in the first cache into the address information in the preset format is exemplarily described:

[0208] (f1) Define the structure of JSON:

[0209] The JSON structure can be a nested object or array.

[0210] (f2) Create a JSON object:

[0211] Use data structures in programming languages ​​such as dictionaries, hash tables, objects, etc. to create JSON objects.

[0212] (f3) Fill in data:

[0213] Fill each address information in the updated first cache into the JSON object.

[0214] (f4) Convert to JSON string:

[0215] Use the JSON library provided by your programming language to convert the populated JSON object into a JSON string.

[0216] (f5) Save the JSON file:

[0217] Write the generated JSON string into a file to obtain the address information in JSON format.

[0218] The address information in a preset format is hashed to obtain first address ciphertext data.

[0219] For example, the updated first cache stores: address information x1 of sub-application 1, address information x2 of sub-application 2, and address information x3 of sub-application 3. A JSON-formatted address information is constructed based on x1, x2, and x3, and the JSON-formatted address information is hashed to obtain a ciphertext data, which is used as the first address ciphertext data.

[0220] Step S208: establishing a first mapping relationship between each address information in the updated first cache and the first address ciphertext data.

[0221] The first address ciphertext data is obtained by executing step S206 to encrypt the address information in the updated first cache, and accordingly, a first mapping relationship between each address information in the updated first cache and the first address ciphertext data can be established.

[0222] For example, the updated first cache stores: x1, x2, x3. The three address information x1, x2 and x3 are assembled to obtain the address information X in JSON format, and the address information X is encrypted to obtain the first address ciphertext data S. A first mapping relationship between the data set (x1, x2, x3) and S is established.

[0223] Step S210: storing the first mapping relationship in a second cache different from the first cache.

[0224] The first cache and the second cache are two different cache objects.

[0225] The first mapping relationship is added to the second cache, which may be a local cache SessionStorage (session storage object) of the browser, or other custom-configured storage areas.

[0226] The second cache may store one or more first mapping relationships. Except for the first mapping relationship stored in the second cache during the current execution of step S210, each first mapping relationship stored in the second cache is a first mapping relationship generated in historical data by executing the data processing method provided by this embodiment.

[0227] For example, at time point T1, the first address information of the browser is updated. In the process of executing the data processing method provided in the embodiment of the present application, after executing step 208, a new first address ciphertext data 1 is generated, and a first mapping relationship 1 between the address information in the updated first cache and the first address ciphertext data 1 is established, and step S210 is executed to store the first mapping relationship 1 in the second cache.

[0228] At time point T2 (T2 is after T1), the first address information of the browser is updated again, and at this time, a first mapping relationship is stored in the second cache, namely, the first mapping relationship 1. In the process of executing the data processing method provided by the embodiment of the present application, after executing step 208, a new first address ciphertext data 2 is generated, a first mapping relationship 2 between the address information in the updated first cache and the first address ciphertext data 2 is established, and step S210 is executed to store the first mapping relationship 2 in the second cache.

[0229] At time point T3 (T3 is after T2), the first address information of the browser is updated again. At this time, two first mapping relationships are stored in the second cache: first mapping relationship 1 and first mapping relationship 2. In the process of executing the data processing method provided by the embodiment of the present application, after executing step 206, a new first address ciphertext data 3 is generated, a first mapping relationship 3 between the address information in the updated first cache and the first address ciphertext data 3 is established, and step S210 is executed to store the first mapping relationship 3 in the second cache, and so on.

[0230] In a specific implementation, obtaining the updated first address information includes: obtaining the third address information of the browser, the third address information including the second address ciphertext data; querying the address information corresponding to the second address ciphertext data in the second cache according to the second address ciphertext data and the first mapping relationship; and using the address information corresponding to the second address ciphertext data as the updated first address information.

[0231] The third address information may be address information acquired from the address bar of the browser when it is detected that the first address information of the browser is updated.

[0232] The third address information may include second address ciphertext data. The second address ciphertext data may be first address ciphertext data generated in the historical data after executing the data processing method provided by this embodiment.

[0233] The definition of the second address ciphertext data is explained below with reference to a specific example.

[0234] One or more first mapping relationships may be stored in the second cache, and each first mapping relationship is generated and stored in the second cache after executing the data processing method provided in this embodiment.

[0235] For example, the second cache stores:

[0236] First mapping relationship 1: (address S1, address S2, address S3)<——>first address ciphertext data 1;

[0237] First mapping relationship 2: (address S1, address S2)<——>first address ciphertext data 2;

[0238] The first mapping relationship 3: (address S1, address S2, address S4)<——>first address ciphertext data 3, and so on.

[0239] The second address ciphertext data may be one of the first address ciphertext data 1 , the first address ciphertext data 2 and the first address ciphertext data 3 mentioned above.

[0240] The first mapping relationship stored in the second cache can be used as a "historical snapshot". Each update of the browser's first address information may result in the generation of a new first address ciphertext data. Considering that refreshing or rewinding the browser will result in the update of the browser's first address information, storing the first mapping relationship set in the second cache is conducive to the reuse of historical data when the browser is refreshed or rewinded, without the need to query the status information of each sub-application, reducing redundant operations and improving data processing efficiency.

[0241] For example, the first cache stores: address information X1 of sub-application 1, address information X2 of sub-application 2, and address information X3 of sub-application 3. After the browser goes back, the updated first address information is obtained and the first cache is updated according to the updated first address information. The updated first cache stores: address information X1 of sub-application 1 and address information X3 of sub-application 3.

[0242] Before the first address information of the browser is updated due to the browser backing off, the first address information of the browser is the first address ciphertext data 1. After the first address information of the browser is updated, the third address information obtained from the address bar of the browser is the first address ciphertext data 2. The first address ciphertext data 2 is the aforementioned second address ciphertext data.

[0243] The first mapping relationship may include the second address ciphertext data and the address information corresponding to the second address ciphertext data. For example, the first mapping relationship 2: (address S1, address S2) <——> first address ciphertext data 2.

[0244] According to the second address ciphertext data and the first mapping relationship, the address information corresponding to the second address ciphertext data can be queried in the second cache, and the address information corresponding to the second address ciphertext data can be used as the updated first address information.

[0245] For example, the second address ciphertext data is the first address ciphertext data 2. In the second cache, the first mapping relationship 2: (address S1, address S2) <——> first address ciphertext data 2. According to the second address ciphertext data and the first mapping relationship, the address information corresponding to the second address ciphertext data can be queried in the second cache, including: address S1 and address S2, and then the updated first address information is determined to include: address S1 and address S2.

[0246] In some implementations, after the address information corresponding to the second address ciphertext data is used as the updated first address information, before executing step S204, the following method may be used to determine whether the second address information in the first cache of the browser matches the updated first address information:

[0247] In the process of matching the updated first address information with the second address information, if there is at least one second address information in the first cache that is the same as the updated first address information, it can be determined that the second address information in the first cache of the browser matches the updated first address information; conversely, if each second address information in the first cache is different from the updated first address information, it can be determined that the second address information in the first cache of the browser does not match the updated first address information.

[0248] Alternatively, in the process of matching the preset address parameters corresponding to the updated first address information with the second address information, if there is at least one second address information in the first cache that has an inclusion relationship with the preset address parameter, it can be determined that the second address information in the first cache of the browser matches the updated first address information; conversely, if there is no inclusion relationship between each second address information in the first cache and the preset address parameter, it can be determined that the second address information in the first cache of the browser does not match the updated first address information.

[0249] Considering that there is at least one second address information in the first cache that is the same as the "address information having a first mapping relationship with the second address ciphertext data", if the above-mentioned matching method is used, it can be determined that the second address information in the first cache of the browser matches the updated first address information, and then, the second address ciphertext data can be reused without continuing to execute steps S204-210. The advantage of doing so is that it can reduce repeated operations, reuse historical data, and improve data processing efficiency.

[0250] In some other implementations, after the address information having a first mapping relationship with the second address ciphertext data is used as the updated first address information, before executing step S204, the following method may be used to determine whether the second address information in the first cache of the browser matches the updated first address information:

[0251] In the case where the first address information before updating is different from the third address information, in the process of matching the updated first address information with the second address information, if there is at least one second address information in the first cache that is the same as the third address information, it can be determined that the second address information in the first cache of the browser matches the updated first address information; conversely, if each second address information in the first cache is different from the third address information, it can be determined that the second address information in the first cache of the browser does not match the updated first address information.

[0252] Considering that the third address information includes the second address ciphertext data, it is obvious that each second address information in the first cache is different from the third address information. If the above-mentioned matching method is used, after excluding the possibility of browser refresh, it can be determined that the second address information in the first cache of the browser does not match the updated first address information, and then, continue to execute steps S204-210. The advantage of this is that when the ciphertext data is time-sensitive, the browser backoff will trigger the generation of new first address ciphertext data, which is conducive to keeping the first address ciphertext data in use within the validity period as much as possible.

[0253] After obtaining the third address information of the browser, the third address information includes the second address ciphertext data; according to the second address ciphertext data and the first mapping relationship, querying the address information corresponding to the second address ciphertext data in the second cache; after using the address information corresponding to the second address ciphertext data as the updated first address information, the above-mentioned specific implementation method of determining the address information of the sub-application that has been activated and turned into inactive when the browser is backed up according to the updated first address information and the second address information, and deleting the address information of the sub-application that has been activated and turned into inactive in the first cache when the browser is backed up can be further explained:

[0254] Based on the updated first address information and the second address information, the address information of the sub-application that is changed from activated to inactivated when the browser is backed up is determined. This can be that, for each second address information, it is determined whether there is address information identical to the second address information in each address information corresponding to the second address ciphertext data; if not, the second address information is determined as the address information of the sub-application that is changed from activated to inactivated when the browser is backed up, and the address information of the sub-application that is changed from activated to inactivated is deleted from the first cache.

[0255] For example, the updated first address information includes: S1, S2. The first cache stores: S1, S2 and S3.

[0256] For S1, it can be determined that the same address information as S1 exists in S1 and S2 corresponding to the second address ciphertext data; for S2, it can be determined that the same address information as S2 exists in S1 and S2 corresponding to the second address ciphertext data; for S3, it can be determined that the same address information as S3 does not exist in S1 and S2 corresponding to the second address ciphertext data, then S3 is determined as the address information of the sub-application that is activated and becomes inactive when the browser goes back, and S3 is deleted in the first cache.

[0257] If the updated first address information is completely consistent with the second address information, it can be determined that the update of the first address information of the browser is triggered by a browser refresh, and there is no need to perform subsequent steps.

[0258] For example, the updated first address information includes: S1, S2 and S3. The first cache stores: S1, S2 and S3.

[0259] For S1, it can be determined that the same address information as S1 exists in S1, S2 and S3 corresponding to the second address ciphertext data; for S2, it can be determined that the same address information as S2 exists in S1, S2 and S3 corresponding to the second address ciphertext data; for S3, it can be determined that the same address information as S3 exists in S1, S2 and S3 corresponding to the second address ciphertext data. It can be seen that the updated first address information is completely consistent with the second address information, and there is no need to perform subsequent steps.

[0260] In the case where the browser refresh results in the update of the first address information, the corresponding description part of the browser backing out can be referred to. It should be noted that in this case, the second address information in the first cache of the browser matches the updated first address information, and the second address ciphertext data can be reused without continuing to perform steps S204 to 210.

[0261] After step S206 is executed, the updated first address information may be updated according to the first address ciphertext data.

[0262] In specific implementation, the main application of the micro-frontend framework can change the first address information of the browser into the first address ciphertext data through pushState, or change a part of the first address information of the browser into the first address ciphertext data.

[0263] PushState is a new API (Application Programming Interface) in HTML5 (Hyper Text Markup Language 5) for manipulating browser history. It allows users to change the browser's URL by modifying the browser's history without reloading the page.

[0264] After the updated first address information is updated according to the first address ciphertext data, any activated sub-application can obtain the first address ciphertext data through the address bar of the browser, and query the address information of the sub-application in the first mapping relationship in the second cache, thereby realizing the parameter passing of the page.

[0265] By establishing a first mapping relationship between the address information in the updated first cache and the first address ciphertext data, and updating the updated first address information according to the first address ciphertext data, it is possible to associate multiple sub-applications through a common address information of the browser without the sub-applications affecting each other.

[0266] For example, when a sub-application 1 has been activated, if you want to keep the activation status of the sub-application and continue to activate the new sub-application 2, by executing the data processing method provided in this embodiment, you can generate a first address ciphertext data, establish a first mapping relationship between the sub-application 1 and sub-application 2 that are simultaneously activated and the first address ciphertext data, store the first mapping relationship in the second cache, and update the address information of the sub-application 1 in the address bar of the browser to the first address ciphertext data. Then, the sub-application 1 and sub-application 2 that are simultaneously activated can share the first address ciphertext data, and there is no need to uninstall the old sub-application 1 in order to activate the new sub-application 2. This avoids the problem of conflict between the address information of the activated sub-applications, and multiple simultaneously activated sub-applications can be displayed normally in the browser interface.

[0267] In addition, this data processing method does not rely on manual operation, which improves data processing efficiency. If the activated sub-application has a routing jump requirement, the memory routing mode is not adopted, but the browser routing mode is adopted to avoid information loss after page refresh, and support the angular technology stack.

[0268] The browser's first address information update may occur with the micro-frontend's main application activating the sub-application, or it may also occur with the micro-frontend's main application unloading the sub-application, or it may also occur without any main application loading / unloading the sub-application. By determining that the second address information in the browser's first cache does not match the updated first address information, the possibility of the browser's first address information being updated without any main application loading / unloading the sub-application can be ruled out. Therefore, if the second address information in the browser's first cache does not match the updated first address information, it can be determined that the main application is activating / unloading the sub-application when the browser's first address information is updated. By updating the first cache according to the updated first address information, the address information in the updated first cache can be made consistent with the sub-application that is in an activated state after the main application completes the activation / unloading of the sub-application. By encrypting the address information in the updated first cache to obtain first address ciphertext data, establishing a first mapping relationship between each address information in the updated first cache and the first address ciphertext data, and storing the first mapping relationship in the second cache, each sub-application that is activated after the main application completes activation / uninstallation of the sub-application can be associated with the first address ciphertext data, thereby avoiding the problem of conflict between address information of different sub-applications.

[0269] In a specific implementation, after storing the first mapping relationship in a second cache different from the first cache, the data processing method also includes: sending a broadcast notification to the sub-application, the broadcast notification is used to notify the sub-application to query the address information of the sub-application from the second cache; if the address information of the sub-application is queried in the second cache, then querying the page component of the sub-application in the static routing configuration information corresponding to the sub-application based on the address information of the sub-application; if the page component of the sub-page is queried, then constructing the routing configuration information of the sub-application based on the first address ciphertext data and the page component of the sub-page; and adding the routing configuration information of the sub-application to the routing matcher of the sub-application.

[0270] The sub-application collection can include various sub-applications that the micro-frontend framework has.

[0271] The sub-application set may include multiple sub-applications, some of which are activated sub-applications, which can find their own address information in the first mapping relationship in the second cache, and another part of which are inactive sub-applications, which cannot find their own address information in the first mapping relationship in the second cache.

[0272] Sending a broadcast notification means sending a notification to all receiving objects within a specified range.

[0273] Sending a broadcast notification to a sub-application set means sending the broadcast notification to each sub-application in the sub-application set, that is, the aforementioned specified scope is the sub-application set, and the receiving object is the sub-application.

[0274] The broadcast notification is used to notify the sub-application to query the address information of the sub-application from the second cache.

[0275] The second cache stores a first mapping relationship, which is stored in the second cache by executing step S210. The first mapping relationship represents a mapping relationship between the updated address information in the first cache and the first address ciphertext data.

[0276] Regardless of whether the sub-application receiving the broadcast notification is an activated sub-application or an inactivated sub-application, the sub-application will perform a query operation after receiving the broadcast notification to query whether the address information of the sub-application exists in the second cache.

[0277] For each sub-application, the sub-application may perform a query operation by querying whether address information of the sub-application exists in the first mapping relationship in the second cache according to the identification information of the sub-application.

[0278] If the address information of the sub-application is queried in the second cache, it can be determined that the sub-application is in an activated state, and the first address ciphertext data and the address information of the sub-application are obtained. Then, the sub-application can query the page component of the sub-application in the static routing configuration information corresponding to the sub-application according to the address information of the sub-application; if the page component of the sub-page is queried, the routing configuration information of the sub-application is constructed according to the first address ciphertext data and the page component of the sub-page; and the routing configuration information of the sub-application is added to the routing matcher of the sub-application.

[0279] If the address information of the sub-application is not found in the second cache, it can be determined that the sub-application is in an inactive state, and the sub-application can end the data processing flow.

[0280] For each sub-application, the static routing configuration information of the sub-application can be pre-configured. For example, the static routing configuration information of sub-application 1 includes the static routing configuration item (path1, page component 1), the static routing configuration information of sub-application 2 includes the static routing configuration item (path2, page component 2), and the static routing configuration information of sub-application 3 includes the static routing configuration item (path3, page component 3).

[0281] According to the address information of the sub-application, the page component of the sub-application is queried in the static routing configuration information corresponding to the sub-application.

[0282] For example, the address information of sub-application 1 is path1.

[0283] The static routing configuration information of sub-application 1 includes static routing configuration items (path1, page component 1).

[0284] Sub-application 1 queries the static routing configuration item according to path1 to obtain the page component of the sub-application: page component 1.

[0285] For another example, the address information of sub-application 2 is path2.

[0286] The static routing configuration information of sub-application 2 includes static routing configuration items (path2', page component 2).

[0287] Sub-application 2 cannot query the page component of the sub-application in the static routing configuration item according to path2. The reason is that the address information queried from the second cache does not match the address information in the static routing configuration item. The operation record of this query can be saved for subsequent analysis.

[0288] For another example, the address information of sub-application 3 is path3.

[0289] The static route configuration information of sub-application 2 includes a static route configuration item (path3, / ).

[0290] Sub-application 2 cannot query the sub-application page component in the static routing configuration item according to path3. The reason is that the pre-configured static routing configuration item is incomplete. The operation record of this query can be saved for subsequent analysis.

[0291] If the page component of the sub-page is queried, the first address encrypted data can be used as the path, and the page component of the sub-application can be used as the component. The route configuration item of the sub-application is constructed according to the path and component, and the route configuration item is added to the route matcher of the sub-application by dynamically adding routes.

[0292] It should be noted that the routing configuration information of the sub-application constructed according to the first address ciphertext data and the page components of the sub-page belongs to the dynamic routing configuration information.

[0293] Dynamic routing refers to the process of network devices automatically discovering and updating routing information by running specific routing protocols. Unlike static routing, dynamic routing does not require network administrators to manually configure each route. Instead, it exchanges routing information between network devices through routing protocols and automatically calculates the best path to the destination network.

[0294] Static routing configuration information can be routing information manually configured by a network administrator to guide the transmission path of data packets in the network. Static routing does not rely on routing protocols to automatically discover and update routing information.

[0295] Dynamic routing configuration and static routing configuration can be effective at the same time, and they can coexist on the same network device. This configuration method is very common in actual network environments because they each have different advantages and applicable scenarios.

[0296] When the number of sub-applications activated at the same time is greater than one, the first mapping relationship is stored in the second cache by executing the data processing method provided in this embodiment, and then each sub-application is notified to use the data in the second cache to automatically add dynamic routes, which can be independent of manual dependence and better adapt to dynamic changes in the network; when there is only one sub-application activated at the same time, pre-configured static routing configuration information is used to guide the transmission path of the data packet in the network. Static routing can be used to specify a specific path and provide a stable path that is not affected by network fluctuations.

[0297] In such Figure 2In the embodiment shown, first, when the browser's first address information is detected to be updated, the updated first address information is obtained; second, if the second address information in the browser's first cache does not match the updated first address information, the first cache is updated according to the updated first address information; then, the address information in the updated first cache is encrypted to obtain the first address ciphertext data; then, a first mapping relationship between each address information in the updated first cache and the first address ciphertext data is established; finally, the first mapping relationship is stored in a second cache different from the first cache. In this way, by detecting the browser's first address information update, and updating the first cache according to the updated first address information when it is determined that the second address information in the browser's first cache does not match the updated first address information, the address information stored in the first cache can be changed regularly as the browser's first address information changes, and then, by encrypting the address information in the updated first cache to obtain the first address ciphertext data, establishing the first mapping relationship between each address information in the updated first cache and the first address ciphertext data, and storing the first mapping relationship in the second cache, multiple address information can be associated with the same first address ciphertext data. Considering that in the application scenario of the micro-frontend, the change of the first address information of the browser may occur along with the activation or uninstallation of the sub-application by the main application of the micro-frontend, and the micro-frontend activates multiple sub-applications at the same time, which may cause the address information of multiple sub-applications that share the address bar of the browser through the routing mechanism to conflict with each other. Through the data processing method provided in the embodiment of the present application, the address information stored in the first cache changes regularly with the change of the first address information of the browser, which is conducive to making the address information currently stored in the first cache consistent with the currently activated sub-application, and then, the multiple address information in the updated first cache are associated with the same first address ciphertext data, which is conducive to avoiding the problem of conflicting address information of multiple sub-applications activated at the same time.

[0298] Based on the same technical concept, the embodiment of the present application also provides another data processing method. Figure 3 A processing flow chart of another data processing method provided in an embodiment of the present application.

[0299] like Figure 3 As shown, step S302, registering the sub-application.

[0300] In the process of initializing the micro front-end application, the main application of the micro front-end registers one or more sub-applications. The concept of micro front-end can refer to the corresponding description part of the above method embodiment.

[0301] A micro frontend can include a main application and one or more sub-applications.

[0302] Step S304, globally hijacking the sub-application jump function.

[0303] When the sub-application jump function is called, it can jump from one sub-application to another sub-application.

[0304] Global hijacking can be understood as, in the same electronic device, any sub-application of the micro-frontend will be hijacked by the main application of the micro-frontend when calling the sub-application jump function.

[0305] Step S306, obtaining the jump path and parameters.

[0306] Steps S304 to S306 are executed when jumping to each activated micro-application.

[0307] An activated microapp refers to an activated subapp of a microfrontend.

[0308] In addition, "internal jumps in each activated micro-application" can be a jump from an activated sub-application to another inactivated sub-application, that is, triggering the micro-frontend to activate a new sub-application through the main application by jumping.

[0309] The local data processing flow consisting of steps S04 to S306 can refer to the corresponding description part of the aforementioned method embodiment of "intercepting the request of the activated sub-application to jump to the inactivated sub-application; extracting the address information of the inactivated sub-application from the request, and using the address information of the inactivated sub-application as the updated first address information".

[0310] Step S308: whether there is data corresponding to the current address information.

[0311] The current address information refers to the first address information after the browser is updated, for example, the URL after the browser is updated.

[0312] Check whether the browser cache has data corresponding to the current address information.

[0313] If yes, execute step S310; if no, execute step S312.

[0314] In this step, the “browser cache” may refer to the corresponding description of the second cache in the aforementioned method embodiment, and the “current address information” is the updated first address information.

[0315] To query whether data corresponding to the current address information is stored in the browser cache, reference may be made to the corresponding description section of "querying address information corresponding to the second address ciphertext data in the second cache based on the second address ciphertext data and the first mapping relationship" in the aforementioned method embodiment.

[0316] Step S310, obtaining the real prefix of each sub-application.

[0317] Step S312, directly adopt the address information prefix of the current browser.

[0318] For example, the address information of the current browser may be a URL, and the address information prefix may be a pathname parameter value determined by the URL.

[0319] The local data processing flow consisting of steps S308 to S312 can refer to the corresponding description part of the aforementioned method embodiment of "obtaining the third address information of the browser, the third address information including the second address ciphertext data; querying the address information corresponding to the second address ciphertext data in the second cache according to the second address ciphertext data and the first mapping relationship; using the address information corresponding to the second address ciphertext data as the updated first address information".

[0320] Step S314: whether the corresponding sub-application is activated.

[0321] If yes, execute step S316.

[0322] If at least one sub-application is activated by the main application, it means that the number of sub-applications activated simultaneously increases, and the first cache needs to be updated.

[0323] Steps S308 to S314 are automatically executed by the framework when the address changes due to browser backing, refreshing, etc.

[0324] Step S316, object-oriented recording / modification of the paths and parameters of each currently activated sub-application.

[0325] The paths and parameters of the currently activated sub-applications may refer to the corresponding description parts of the aforementioned first cache and the updated first cache.

[0326] This step may refer to the corresponding description of step S204 in the aforementioned method embodiment.

[0327] Step S318, performing hash encryption based on the data to obtain encrypted characters.

[0328] This step may refer to the corresponding description of step S206 in the aforementioned method embodiment. The encrypted character is the aforementioned first address ciphertext data.

[0329] Step S320, the encrypted characters are used as keys, and the data of each sub-application path and parameter are used as values, and stored in the browser cache.

[0330] Keys and values ​​can form key-value pairs.

[0331] A key-value pair is a data structure that consists of two parts: a key and a corresponding value. Key-value pairs are widely used in various programming languages ​​and data storage systems to store and retrieve data.

[0332] The browser cache may refer to the aforementioned second cache.

[0333] For example, the browser cache stores:

[0334] Address encrypted data 1<——>

[0335] {

[0336] Sub-application 1: {routing path: "x1", query information: {name: "XXXX", id: 001}}

[0337] Sub-application 2: {routing path: "x2", query information: {name: "YYYY", id: 002}}

[0338] Sub-application 3: {routing path: "x3", query information: {name: "ZZZZ", id: 003}}

[0339] }

[0340] This step may refer to the corresponding description parts of steps S208-S210 in the aforementioned method embodiment.

[0341] Step S322: Each sub-application obtains page parameters according to the location object and cache information.

[0342] The location object is the aforementioned location object.

[0343] Step S324, obtaining routing configuration data corresponding to the path according to the path and the static routing table of each sub-application.

[0344] Step S326: Each sub-application replaces the encrypted characters with the paths in the acquired routing configuration data to form a new routing configuration item.

[0345] Step S328: Each sub-application is dynamically added to its own route matcher.

[0346] The local data processing flow consisting of steps S322-S328 can refer to the corresponding description part of the aforementioned method embodiment: "Sending a broadcast notification to the sub-application, the broadcast notification is used to notify the sub-application to query the address information of the sub-application from the second cache; if the address information of the sub-application is queried in the second cache, then querying the page component of the sub-application in the static routing configuration information corresponding to the sub-application based on the address information of the sub-application; if the page component of the sub-page is queried, constructing the routing configuration information of the sub-application based on the first address ciphertext data and the page component of the sub-page; adding the routing configuration information of the sub-application to the routing matcher of the sub-application."

[0347] Step S330, synchronizing the encrypted characters to the browser address bar.

[0348] This step may refer to the corresponding description part of "updating the updated first address information according to the first address ciphertext data" in the aforementioned method embodiment.

[0349] After step S322 and step S330 are executed, multi-instance operation can be achieved, that is, the main application of the micro-frontend framework activates multiple sub-applications at the same time, and each sub-application can be displayed normally.

[0350] Since the technical concept is the same, the description in this embodiment is relatively simple, and the relevant parts may refer to the corresponding description of the method embodiment provided above.

[0351] An embodiment of a data processing device provided in this specification is as follows:

[0352] In the above-mentioned embodiment, a data processing method is provided. Based on the same technical concept, the embodiment of the present application also provides a data processing device, which is described below in conjunction with the accompanying drawings.

[0353] Figure 4 A schematic diagram of a data processing device provided in an embodiment of the present application. This embodiment provides a data processing device 400, including:

[0354] An acquiring unit 402 is configured to acquire updated first address information when detecting that the first address information of the browser is updated;

[0355] An updating unit 404, configured to update the first cache according to the updated first address information if the second address information in the first cache of the browser does not match the updated first address information;

[0356] The encryption unit 406 is used to encrypt the address information in the updated first cache to obtain first address ciphertext data;

[0357] An establishing unit 408, configured to establish a first mapping relationship between each address information in the updated first cache and the first address ciphertext data;

[0358] The storage unit 410 is configured to store the first mapping relationship in a second cache different from the first cache.

[0359] Optionally, the data processing device 400 further includes:

[0360] a sending unit, configured to send a broadcast notification to the sub-application, wherein the broadcast notification is used to notify the sub-application to query the address information of the sub-application from the second cache;

[0361] A query unit, configured to query the page component of the sub-application in the static routing configuration information corresponding to the sub-application according to the address information of the sub-application if the address information of the sub-application is queried in the second cache;

[0362] A construction unit, configured to construct routing configuration information of the sub-application according to the first address ciphertext data and the page component of the sub-page if a page component of the sub-page is found;

[0363] The adding unit is used to add the routing configuration information of the sub-application to the routing matcher of the sub-application.

[0364] Optionally, when the updating of the first address information of the browser is triggered by activating a sub-application, the updating unit 404 performs the following steps when updating the first cache according to the updated first address information:

[0365] adding the updated first address information to the first cache;

[0366] In the case where the updating of the first address information of the browser is triggered by the browser backing up, the updating unit 404 performs the following steps when updating the first cache according to the updated first address information:

[0367] According to the updated first address information and the second address information, the address information of the sub-application that has been activated and become inactive is determined when the browser is rolled back, and the address information of the sub-application that has been activated and become inactive is deleted from the first cache.

[0368] Optionally, when acquiring the updated first address information, the acquiring unit 402 performs the following steps:

[0369] Acquire third address information of the browser, wherein the third address information includes the second address ciphertext data;

[0370] According to the second address ciphertext data and the first mapping relationship, querying the second cache for address information corresponding to the second address ciphertext data;

[0371] The address information corresponding to the second address ciphertext data is used as the updated first address information.

[0372] Optionally, when acquiring the updated first address information, the acquiring unit 402 performs the following steps:

[0373] Intercept the request from the activated sub-application to jump to the inactivated sub-application;

[0374] The address information of the inactive sub-application is extracted from the request, and the address information of the inactive sub-application is used as the updated first address information.

[0375] Optionally, the updating unit 404 is further configured to:

[0376] For each address information in the updated first cache, if there is pre-stored address information that is the same as the address information in the updated first cache, retaining the address information in the updated first cache;

[0377] If there is no pre-stored address information that is the same as the address information in the updated first cache, the address information is deleted in the updated first cache.

[0378] Optionally, when the encryption unit 406 encrypts the address information in the updated first cache to obtain the first address ciphertext data, the encryption unit 406 performs the following steps:

[0379] constructing the updated address information in the first cache into address information in a preset format;

[0380] The address information in the preset format is hashed to obtain the first address ciphertext data.

[0381] In an embodiment of the present application, the data processing device includes: an acquisition unit, which is used to acquire the updated first address information when it is detected that the first address information of the browser is updated; an update unit, which is used to update the first cache according to the updated first address information if the second address information in the first cache of the browser does not match the updated first address information; an encryption unit, which is used to encrypt the address information in the updated first cache to obtain the first address ciphertext data; an establishment unit, which is used to establish a first mapping relationship between each address information in the updated first cache and the first address ciphertext data; and a storage unit, which is used to store the first mapping relationship in a second cache different from the first cache. In this way, by detecting the update of the first address information of the browser, and updating the first cache according to the updated first address information when it is determined that the second address information in the first cache of the browser does not match the updated first address information, the address information stored in the first cache can be changed regularly as the first address information of the browser changes. Furthermore, by encrypting the address information in the updated first cache to obtain the first address ciphertext data, establishing the first mapping relationship between each address information in the updated first cache and the first address ciphertext data, and storing the first mapping relationship in the second cache, multiple address information can be associated with the same first address ciphertext data. Considering that in the application scenario of the micro-frontend, the change of the first address information of the browser may occur along with the activation or uninstallation of the sub-application by the main application of the micro-frontend, and the micro-frontend activates multiple sub-applications at the same time, which may cause the address information of multiple sub-applications that share the address bar of the browser through the routing mechanism to conflict with each other. Through the data processing method provided in the embodiment of the present application, the address information stored in the first cache changes regularly with the change of the first address information of the browser, which is conducive to making the address information currently stored in the first cache consistent with the currently activated sub-application, and then, the multiple address information in the updated first cache are associated with the same first address ciphertext data, which is conducive to avoiding the problem of conflicting address information of multiple sub-applications activated at the same time.

[0382] Corresponding to the data processing method described above, based on the same technical concept, an embodiment of the present application further provides an electronic device, which is used to execute the data processing method provided above. Figure 5 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application.

[0383] like Figure 5As shown, the electronic device may have relatively large differences due to different configurations or performances, and may include one or more processors 501 and memory 502, and the memory 502 may store one or more storage applications or data. Among them, the memory 502 can be a temporary storage or a permanent storage. The application stored in the memory 502 may include one or more modules (not shown in the figure), and each module may include a series of computer executable instructions in the electronic device. Furthermore, the processor 501 can be configured to communicate with the memory 502 to execute a series of computer executable instructions in the memory 502 on the electronic device. The electronic device may also include one or more power supplies 503, one or more wired or wireless network interfaces 504, one or more input / output interfaces 505, one or more keyboards 506, etc.

[0384] In a specific embodiment, the electronic device includes a memory and one or more programs, wherein the one or more programs are stored in the memory, and the one or more programs may include one or more modules, and each module may include a series of computer executable instructions for the electronic device, and the one or more programs configured to be executed by one or more processors include the following computer executable instructions:

[0385] When detecting that the first address information of the browser is updated, obtaining the updated first address information;

[0386] If the second address information in the first cache of the browser does not match the updated first address information, updating the first cache according to the updated first address information;

[0387] Encrypting the updated address information in the first cache to obtain first address ciphertext data;

[0388] Establishing a first mapping relationship between each address information in the updated first cache and the first address ciphertext data;

[0389] The first mapping relationship is stored in a second cache different from the first cache.

[0390] The computer-readable storage medium provided in this embodiment is used to store computer-executable instructions. When the computer-executable instructions are executed by a processor, the following process is implemented:

[0391] When detecting that the first address information of the browser is updated, obtaining the updated first address information;

[0392] If the second address information in the first cache of the browser does not match the updated first address information, updating the first cache according to the updated first address information;

[0393] Encrypting the updated address information in the first cache to obtain first address ciphertext data;

[0394] Establishing a first mapping relationship between each address information in the updated first cache and the first address ciphertext data;

[0395] The first mapping relationship is stored in a second cache different from the first cache.

[0396] It should be noted that the embodiments of the computer-readable storage medium in this specification and the embodiments of the data processing method in this specification are based on the same inventive concept, so the specific implementation of this embodiment can refer to the implementation of the corresponding method mentioned above, and the repeated parts will not be repeated.

[0397] Another embodiment of the present disclosure further provides a computer program product, the computer program product comprising a computer program, and when the computer program is executed by a processor, the following process is implemented:

[0398] When detecting that the first address information of the browser is updated, obtaining the updated first address information;

[0399] If the second address information in the first cache of the browser does not match the updated first address information, updating the first cache according to the updated first address information;

[0400] Encrypting the updated address information in the first cache to obtain first address ciphertext data;

[0401] Establishing a first mapping relationship between each address information in the updated first cache and the first address ciphertext data;

[0402] The first mapping relationship is stored in a second cache different from the first cache.

[0403] The computer program product in the embodiments of the present disclosure can implement the various processes of the above-mentioned data processing method embodiments and achieve the same effects and functions, which will not be repeated here.

[0404] In the embodiment of the present application, first, when the browser's first address information is detected to be updated, the updated first address information is obtained; second, if the second address information in the browser's first cache does not match the updated first address information, the first cache is updated according to the updated first address information; then, the address information in the updated first cache is encrypted to obtain the first address ciphertext data; then, a first mapping relationship between each address information in the updated first cache and the first address ciphertext data is established; finally, the first mapping relationship is stored in a second cache different from the first cache. In this way, by detecting the browser's first address information update, and updating the first cache according to the updated first address information when it is determined that the second address information in the browser's first cache does not match the updated first address information, the address information stored in the first cache can be changed regularly with the change of the browser's first address information, and then, by encrypting the address information in the updated first cache to obtain the first address ciphertext data, establishing the first mapping relationship between each address information in the updated first cache and the first address ciphertext data, and storing the first mapping relationship in the second cache, multiple address information can be associated with the same first address ciphertext data. Considering that in the application scenario of the micro-frontend, the change of the first address information of the browser may occur along with the activation or uninstallation of the sub-application by the main application of the micro-frontend, and the micro-frontend activates multiple sub-applications at the same time, which may cause the address information of multiple sub-applications that share the address bar of the browser through the routing mechanism to conflict with each other. Through the data processing method provided in the embodiment of the present application, the address information stored in the first cache changes regularly with the change of the first address information of the browser, which is conducive to making the address information currently stored in the first cache consistent with the currently activated sub-application, and then, the multiple address information in the updated first cache are associated with the same first address ciphertext data, which is conducive to avoiding the problem of conflicting address information of multiple sub-applications activated at the same time.

[0405] The above is a description of a specific embodiment of the specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0406] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems or computer program products. Therefore, the embodiments of the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, this specification may adopt the form of a computer program product implemented on one or more computer-readable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0407] This specification is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of this specification. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable electronic device to produce a machine, so that the instructions executed by the processor of the computer or other programmable electronic device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0408] These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable electronic device to work in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0409] These computer program instructions may also be loaded onto a computer or other programmable electronic device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for executing on the computer or other programmable device to implement the process. Figure 1 A process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.

[0410] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0411] The memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.

[0412] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.

[0413] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.

[0414] Embodiments of the present application may 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. One or more embodiments of the present specification may also be practiced in distributed computing environments where tasks are performed by remote processing devices connected via a communications network. In a distributed computing environment, program modules may be located in local and remote computer storage media, including storage devices.

[0415] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0416] The above description is only an embodiment of this document and is not intended to limit this document. For those skilled in the art, this document may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of this document should be included in the scope of the claims of this document.

Claims

1. A data processing method, characterized in that: include: When detecting that the first address information of the browser is updated, obtaining the updated first address information; If the second address information in the first cache of the browser does not match the updated first address information, updating the first cache according to the updated first address information; Encrypting the updated address information in the first cache to obtain first address ciphertext data; Establishing a first mapping relationship between each address information in the updated first cache and the first address ciphertext data; The first mapping relationship is stored in a second cache different from the first cache.

2. The method according to claim 1, characterized in that After storing the first mapping relationship in a second cache different from the first cache, the method further includes: Sending a broadcast notification to the sub-application, where the broadcast notification is used to notify the sub-application to query the second cache for address information of the sub-application; If the address information of the sub-application is queried in the second cache, querying the page component of the sub-application in the static routing configuration information corresponding to the sub-application according to the address information of the sub-application; If the page component of the sub-page is found, constructing the routing configuration information of the sub-application according to the first address ciphertext data and the page component of the sub-page; Add the routing configuration information of the sub-application to the routing matcher of the sub-application.

3. The method according to claim 1, characterized in that: In a case where the updating of the first address information of the browser is triggered by activating a sub-application, updating the first cache according to the updated first address information includes: adding the updated first address information to the first cache; In a case where the updating of the first address information of the browser is triggered by the browser backing up, updating the first cache according to the updated first address information includes: According to the updated first address information and the second address information, the address information of the sub-application that has been activated and become inactive is determined when the browser is rolled back, and the address information of the sub-application that has been activated and become inactive is deleted from the first cache.

4. The method according to claim 1, characterized in that: The obtaining of updated first address information includes: Acquire third address information of the browser, wherein the third address information includes the second address ciphertext data; According to the second address ciphertext data and the first mapping relationship, querying the second cache for address information corresponding to the second address ciphertext data; The address information corresponding to the second address ciphertext data is used as the updated first address information.

5. The method according to claim 1, characterized in that The obtaining of updated first address information includes: Intercept the request from the activated sub-application to jump to the inactivated sub-application; The address information of the inactive sub-application is extracted from the request, and the address information of the inactive sub-application is used as the updated first address information.

6. The method according to claim 1, characterized in that Before encrypting the address information in the updated first cache to obtain the first address ciphertext data, the method further includes: For each address information in the updated first cache, if there is pre-stored address information that is the same as the address information in the updated first cache, retaining the address information in the updated first cache; If there is no pre-stored address information that is the same as the address information in the updated first cache, the address information is deleted in the updated first cache.

7. The method according to claim 1, characterized in that The step of encrypting the address information in the updated first cache to obtain first address ciphertext data includes: constructing the updated address information in the first cache into address information in a preset format; The address information in the preset format is hashed to obtain the first address ciphertext data.

8. A data processing device, characterized in that: include: An acquiring unit, configured to acquire updated first address information when detecting that the first address information of the browser is updated; an updating unit, configured to update the first cache according to the updated first address information if the second address information in the first cache of the browser does not match the updated first address information; An encryption unit, used to encrypt the address information in the updated first cache to obtain first address ciphertext data; An establishing unit, configured to establish a first mapping relationship between each address information in the updated first cache and the first address ciphertext data; A storage unit is used to store the first mapping relationship in a second cache different from the first cache.

9. An electronic device, characterized in that: include: processor; And, a memory configured to store computer executable instructions, which, when executed, cause the processor to perform the data processing method according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium is used to store computer-executable instructions, and the computer-executable instructions, when executed by a processor, implement the data processing method according to any one of claims 1 to 7.

11. A computer program product, characterized in that The invention comprises a computer program, which, when executed by a processor, implements the data processing method according to any one of claims 1 to 7.