Page generation method and apparatus and front-end fusion system

By introducing common components and callback function mechanisms, combined with AJAX and a front-end server, the technical challenges of iframe in the front-end subsystem were solved, achieving non-intrusive page layout and unified interaction logic, improving user experience and reducing integration costs.

CN116955861BActive Publication Date: 2026-04-14BEIJING WODONG TIANJUN INFORMATION TECH CO LTD +1
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202210388462.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-04-14
Publication Date
2026-04-14
Estimated Expiration
2042-04-14

AI Technical Summary

Technical Problem

In existing technologies, the iframe technology of front-end subsystems has problems such as difficulty in controlling the window size, difficulty in solving multiple scrollbars, failure of browser URL recording function, resulting in poor user experience, and difficulty in achieving a unified page layout and interaction logic.

Method used

Non-intrusive integration is achieved by introducing common components. Page templates are generated using preset link addresses and menu item mapping relationships. Combined with callback functions and AJAX mechanisms, a unified page layout and interaction logic are achieved. A front-end server is used to intercept and forward access requests, and a unified domain name and unique identifier are configured to generate independent URLs.

Benefits of technology

It achieves non-intrusive integration of multiple front-end subsystems, avoids the defects of iframes, improves user experience, reduces system integration costs and difficulties, and ensures the effectiveness of URL recording function and the consistency of page layout.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116955861B_ABST
    Figure CN116955861B_ABST
Patent Text Reader

Abstract

The application discloses a page generation method and device and a front-end fusion system, and relates to the technical field of cloud computing. A specific embodiment of the method comprises the following steps: in response to an access request sent by a client and directed to any front-end subsystem in the plurality of front-end subsystems, determining a menu item corresponding to a link address of the access request by using a preset mapping relationship between the link address and the menu item, and forming a page template based on second page data generated according to the determined menu item; obtaining a specific node for mounting special page data of the any front-end subsystem from the page template and sending the specific node to the front-end subsystem, so that the front-end subsystem generates the special page data and mounts the special page data to the specific node, and forms page data for returning to the client. The embodiment can realize non-invasive fusion of the plurality of front-end subsystems without depending on an iframe technology.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of cloud computing technology, and in particular to a page generation method and apparatus, as well as a front-end fusion system. Background Technology

[0002] In current website architectures, the front-end, as the front-end component, is used to present pages to users on PCs, mobile devices, etc., while the back-end handles the actual logic behind the application. The front-end and back-end need to cooperate to complete website functionality. In practice, the front-end system often includes multiple front-end subsystems with specific functions. These subsystems may be developed by different teams, using different front-end frameworks and routing systems, with independent codebases and deployments. In certain scenarios, it is necessary to integrate these front-end subsystems, giving them a unified domain name, a unified page layout, and the same interactive processing logic. Current technology primarily uses the browser's iframe technology to achieve this integration. This technology uses a single page to provide a unified interface (i.e., page layout) and common interactive logic, while the unique parts of each front-end subsystem are displayed in the window provided by the iframe.

[0003] In the process of developing this invention, the inventors discovered that the prior art has at least the following problems: First, the size of the window provided by the iframe is difficult to control, which easily leads to multiple scrollbars, and it is difficult to center the pop-up layer horizontally and vertically relative to the entire screen. Second, the browser URL (Uniform Resource Locator) recording function is ineffective: the browser URL does not change when the page jumps; when refreshing a page, the content of the currently viewed page is lost, and the homepage content is displayed; after a page is bookmarked, the browser displays the homepage content when it is reopened. Summary of the Invention

[0004] In view of this, embodiments of the present invention provide a page generation method and apparatus, as well as a front-end fusion system, which can achieve non-intrusive fusion of multiple front-end subsystems without relying on iframe technology.

[0005] To achieve the above objectives, according to one aspect of the present invention, a page generation method is provided.

[0006] The page generation method of this invention is executed by a common component pre-introduced by multiple front-end subsystems. The method includes: responding to an access request sent by a client for any one of the multiple front-end subsystems; determining the menu item corresponding to the link address of the access request using a preset mapping relationship between link addresses and menu items; forming a page template based on second page data generated according to the determined menu item; wherein the multiple front-end subsystems have a consistent page layout, which includes the area where the menu item is located and the dedicated page area of ​​the front-end subsystem; obtaining a specific node from the page template for mounting the dedicated page data of any one of the front-end subsystems and sending it to the front-end subsystem, so that the front-end subsystem generates the dedicated page data and mounts it to the specific node, forming page data for returning to the client.

[0007] Optionally, the mapping relationship is embodied in a second callback function pre-configured in any of the front-end subsystems, and the address of the second callback function is pre-sent to the common component; and the step of determining the menu item corresponding to the link address of the access request using the preset mapping relationship between the link address and the menu item includes: calling the second callback function according to the address of the second callback function, and sending the menu item stored locally to any of the front-end subsystems, so that the front-end subsystem determines the menu item corresponding to the link address of the access request by executing the second callback function.

[0008] Optionally, the menu item includes a first-level menu item corresponding to the plurality of front-end subsystems and a second-level menu item as a submenu of the first-level menu item, and the area where the menu item is located includes a first-level menu item area and a second-level menu item area; and the method further includes: when it is determined that there is no menu item corresponding to the link address of the access request, generating no-permission page data and returning it to any of the front-end subsystems; the second page data is generated according to the following steps: detecting whether the determined menu item is a first-level menu item or a second-level menu item; if it is detected as a first-level menu item, generating second page data to make the second-level menu item area display each second-level menu item of the first-level menu item, and highlighting the first-level menu item and the first second-level menu item of the first-level menu item; if it is detected as a second-level menu item, obtaining the first-level menu item to which the second-level menu item belongs, generating second page data to make the second-level menu item area display each second-level menu item of the obtained first-level menu item, and highlighting the first-level menu item and the detected second-level menu item.

[0009] Optionally, the step of forming a page template based on the second page data generated according to the determined menu items includes: obtaining first page data provided by any of the front-end subsystems, including header nodes and body nodes; and attaching the second page data to the body nodes in the first page data to form the page template.

[0010] Optionally, the logic for generating the proprietary page data is embodied in a first callback function pre-configured in any front-end subsystem, and the address of the first callback function is pre-sent to the common component; and the step of obtaining a specific node from the page template for mounting the proprietary page data of any front-end subsystem and sending it to the front-end subsystem so that the front-end subsystem generates the proprietary page data includes: querying the page template using a preset identifier of the specific node to obtain the specific node; calling the first callback function to send the obtained specific node to the any front-end subsystem and notifying the front-end subsystem to generate the proprietary page data.

[0011] Optionally, each of the plurality of front-end subsystems interacts with a preset back-end system via an AJAX mechanism; and the method further includes: creating a proxy request object that references a preset real request object to override the AJAX request object of each front-end subsystem; wherein the real request object has a pre-defined login check function; using the real request object to receive response data returned by the back-end system to the front-end subsystem, and executing the login check function to determine whether the current user is not logged in: if so, instructing the front-end subsystem to return a login page to the client; otherwise, returning the response data to the front-end subsystem.

[0012] Optionally, the link addresses of the multiple front-end subsystems have the same domain name, and the link address of any front-end subsystem further contains a unique identifier for that front-end subsystem; after an access request for any front-end subsystem is intercepted by a pre-set front-end server corresponding to the domain name, the front-end server forwards the access request to the front-end subsystem corresponding to the unique identifier in the link address of the access request.

[0013] Optionally, the public component includes a Javascript file, and the second page data further includes: software copyright information and information of the currently logged-in user obtained from the backend system.

[0014] To achieve the above objectives, according to another aspect of the present invention, a page generation apparatus is provided.

[0015] The page generation device of this invention is set in a common component pre-introduced in multiple front-end subsystems. The device may include: a page template forming unit, configured to: in response to an access request sent by a client for any of the multiple front-end subsystems, determine the menu item corresponding to the link address of the access request using a preset mapping relationship between link addresses and menu items, and form a page template based on second page data generated according to the determined menu item; wherein the multiple front-end subsystems have a consistent page layout, the page layout including the area where the menu item is located and the dedicated page area of ​​the front-end subsystem; and a page assembly unit, configured to: obtain a specific node from the page template for mounting the dedicated page data of any of the front-end subsystems and send it to the front-end subsystem, so that the front-end subsystem generates the dedicated page data and mounts it to the specific node, forming page data for returning to the client.

[0016] Optionally, the logic for generating the proprietary page data is embodied in a first callback function pre-configured in any of the front-end subsystems, and the address of the first callback function is pre-sent to the common component in any of the front-end subsystems; the mapping relationship is embodied in a second callback function pre-configured in any of the front-end subsystems, and the address of the second callback function is pre-sent to the common component in any of the front-end subsystems; the menu item includes a first-level menu item corresponding to the plurality of front-end subsystems and a second-level menu item as a submenu of the first-level menu item, and the area where the menu item is located includes a first-level menu item area and a second-level menu item area; and the page template forming unit is further configured to: call the second callback function according to the address of the second callback function, and send the menu item stored locally to any of the front-end subsystems, so that the front-end subsystem determines the menu item corresponding to the link address of the access request by executing the second callback function; when it is determined that there is no menu item corresponding to the link address of the access request, generate unauthorized page data and return it to any of the front-end subsystems; when it is determined that there is a link address of the access request... When dealing with the corresponding menu item, the system detects whether the identified menu item is a first-level menu item or a second-level menu item: if it is a first-level menu item, it generates second page data to display the second-level menu items of the first-level menu item in the second-level menu item area, and highlights the first-level menu item and its first second-level menu item; if it is a second-level menu item, it obtains the first-level menu item to which the second-level menu item belongs, generates second page data to display the obtained second-level menu items of the first-level menu item in the second-level menu item area, and highlights the first-level menu item and the detected second-level menu item; the page assembly unit is further configured to: obtain first page data, including a header node and a body node, provided by any front-end subsystem; mount the second page data to the body node in the first page data to form the page template; query the page template using a preset identifier of the specific node to obtain the specific node; call a first callback function to send the obtained specific node to any front-end subsystem, and notify the front-end subsystem to generate the proprietary page data.

[0017] To achieve the above objectives, according to another aspect of the present invention, a front-end fusion system is provided.

[0018] The front-end fusion system of this invention may include: multiple front-end subsystems and a common component introduced by the multiple front-end subsystems; wherein, after the client sends an access request to any one of the multiple front-end subsystems, the common component determines the menu item corresponding to the link address of the access request using a preset mapping relationship between link addresses and menu items, and forms a page template based on second page data generated according to the determined menu item; wherein, the multiple front-end subsystems have a consistent page layout, which includes the area where the menu item is located and the dedicated page area of ​​the front-end subsystem; the common component obtains a specific node from the page template for mounting the dedicated page data of any one of the front-end subsystems and sends it to the front-end subsystem; the front-end subsystem generates the dedicated page data and mounts it to the specific node, forming page data for returning to the client.

[0019] Optionally, the logic for generating the proprietary page data is embodied in a first callback function pre-configured in any of the front-end subsystems, and the address of the first callback function is pre-sent to the common component; the mapping relationship is embodied in a second callback function pre-configured in any of the front-end subsystems, and the address of the second callback function is pre-sent to the common component; the menu item includes a first-level menu item corresponding to the plurality of front-end subsystems and a second-level menu item as a submenu of the first-level menu item, and the area where the menu item is located includes a first-level menu item area and a second-level menu item area; and the common component calls the second callback function according to the address of the second callback function and sends the menu item stored locally to any of the front-end subsystems; the front-end subsystem determines the menu item corresponding to the link address of the access request by executing the second callback function and returns it to the common component; if it is determined that there is no menu item corresponding to the link address of the access request, the common component generates unauthorized page data and returns it to any of the front-end subsystems; if it is determined that there is a menu item corresponding to the link address of the access request... When a menu item is detected, the common component determines whether it is a first-level menu item or a second-level menu item. If it is a first-level menu item, the common component generates second-page data to display the second-level menu items of the first-level menu item in the second-level menu item area, and highlights the first-level menu item and its first second-level menu item. If it is a second-level menu item, the common component obtains the first-level menu item to which the second-level menu item belongs, generates second-page data to display the obtained second-level menu items of the first-level menu item in the second-level menu item area, and highlights the first-level menu item and the detected second-level menu item. The common component obtains first-page data, including a header node and a body node, provided by any front-end subsystem. The second-page data is mounted to the body node in the first-page data to form the page template. The common component uses the preset identifier of the specific node to query the page template, obtains the specific node, calls a first callback function to send the obtained specific node to any front-end subsystem, and notifies the front-end subsystem to generate the proprietary page data.

[0020] Optionally, each of the multiple front-end subsystems interacts with a preset back-end system via an AJAX mechanism; the link addresses of the multiple front-end subsystems share the same domain name, and the link address of any front-end subsystem further contains a unique identifier for that front-end subsystem; the front-end fusion system further includes a front-end server corresponding to the domain name; the common component includes a Javascript file, and the second page data further includes: software copyright information and information of the currently logged-in user obtained from the back-end system; and the common component creates a proxy request object referencing a preset real request object to override the AJAX request object of each front-end subsystem; wherein, the real request object pre-contains an unlogged-in check function; the common component uses the real request object to receive the response data returned by the back-end system to the front-end subsystem, and executes the unlogged-in check function to determine whether the current user is in an unlogged-in state: if so, the common component instructs the front-end subsystem to return a login page to the client; otherwise, the common component returns the response data to the front-end subsystem; the front-end server intercepts access requests for any front-end subsystem and forwards the access request to the front-end subsystem uniquely identified in the link address of the access request.

[0021] To achieve the above objectives, according to another aspect of the present invention, an electronic device is provided.

[0022] An electronic device according to the present invention includes: one or more processors; and a storage device for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the page generation method provided by the present invention.

[0023] To achieve the above objectives, according to another aspect of the present invention, a computer-readable storage medium is provided.

[0024] The present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the page generation method provided by the present invention.

[0025] According to the technical solution of the present invention, the embodiments described above have the following advantages or beneficial effects:

[0026] By referencing pre-written common components in multiple front-end subsystems, a unified page layout, page rendering control, menu display control, and login failure checks are implemented across all front-end subsystems. Each front-end subsystem is configured with a unified domain name and a unique identifier to generate its own independent URL. A front-end server corresponding to the unified domain name intercepts access requests from each subsystem and forwards them based on the unique identifier in the URL. This achieves the fusion of multiple front-end subsystems without relying on iframes, avoiding the inherent drawbacks of iframes such as difficulty in controlling window size, the appearance of multiple scrollbars, difficulty in centering pop-ups, and the failure of URL recording functionality. Furthermore, the non-intrusive fusion solution avoids significant modifications to the original system code, thereby reducing the cost and difficulty of system fusion and improving the user experience of the merged system. Furthermore, in this embodiment of the invention, a callback function is used to enable collaboration between the common components and the front-end subsystems to generate menu item page data (second page data) and front-end subsystem-specific page data, ultimately forming the page data returned to the user, thereby achieving unified control over the page generation process of each front-end subsystem; a proxy request object referencing the real request object is used to override the AJAX request objects of each front-end subsystem to achieve the unlogged-in check in the back-end response data, thereby achieving unlogged-in checks covering all front-end subsystems without modifying the AJAX request code of each front-end subsystem.

[0027] The further effects of the aforementioned unconventional alternative methods will be explained below in conjunction with specific implementation methods. Attached Figure Description

[0028] The accompanying drawings are provided to better understand the invention and are not intended to unduly limit the scope of the invention. Wherein:

[0029] Figure 1 This is a schematic diagram of the first architecture of the front-end fusion system in an embodiment of the present invention;

[0030] Figure 2 This is a schematic diagram of the unified page layout according to an embodiment of the present invention;

[0031] Figure 3 This is a schematic diagram illustrating the working principle of the front-end server in an embodiment of the present invention;

[0032] Figure 4 This is a schematic diagram of the second architecture of the front-end fusion system in an embodiment of the present invention;

[0033] Figure 5 This is a schematic diagram of the login status processing flow according to an embodiment of the present invention;

[0034] Figure 6 This is a schematic diagram of menu display control according to an embodiment of the present invention;

[0035] Figure 7 This is a schematic diagram of the page generation process in an embodiment of the present invention;

[0036] Figure 8 This is a schematic diagram of the first callback function call in an embodiment of the present invention;

[0037] Figure 9 This is a schematic diagram illustrating the principle of the unregistered user check in an embodiment of the present invention;

[0038] Figure 10 This is a schematic diagram of the main steps of the page generation method in an embodiment of the present invention;

[0039] Figure 11 This is a schematic diagram of the components of the page generation device in an embodiment of the present invention;

[0040] Figure 12 This is an exemplary system architecture diagram that can be applied thereto according to embodiments of the present invention;

[0041] Figure 13 This is a schematic diagram of the electronic device structure used to implement the page generation method in the embodiments of the present invention. Detailed Implementation

[0042] The following description, in conjunction with the accompanying drawings, illustrates exemplary embodiments of the present invention, including various details to aid understanding. These details should be considered merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of the invention. Similarly, for clarity and brevity, descriptions of well-known functions and structures are omitted in the following description.

[0043] It should be noted that, unless otherwise specified, the embodiments of the present invention and the technical features thereof can be combined with each other.

[0044] Figure 1 This is a schematic diagram of the first architecture of the front-end fusion system in an embodiment of the present invention, as shown below. Figure 1 As shown, the front-end fusion system of this embodiment may include: multiple front-end subsystems ( Figure 1 The diagram exemplarily illustrates three front-end systems and common components introduced by multiple front-end systems.

[0045] A front-end subsystem is a part of a complete front-end system, and different front-end subsystems can be used to implement different specific functions. For example, a website's front-end system consists of front-end subsystems for product display, orders, logistics, etc. Common components refer to one or more general-purpose components pre-developed for each front-end subsystem. These can be various applicable forms such as JAR files, Javascript files (JS files), and CSS (Cascading Style Sheets) files, which are easy for each front-end subsystem to import. The following explanation mainly focuses on the case where the common component is a Javascript file. Common components are used to implement unified interaction logic across all front-end subsystems, such as unified page rendering logic, unified menu control logic, and unified unlogged-in check logic. Based on the above common components and unified interaction logic applied to each front-end subsystem, non-intrusive integration of each front-end subsystem and the formation of a unified page structure can be achieved.

[0046] Figure 2 This is a schematic diagram of the unified page layout according to an embodiment of the present invention. See also: Figure 2 Each front-end subsystem can have the same layout structure and visual style when presented on the browser or client. The layout structure is as follows: Header: From left to right, it displays the system logo icon, the first-level menu items corresponding to each front-end subsystem (this page area is the first-level menu item area, and the content of this page area can be fixed), and the right side displays the information of the currently logged-in user and sub-menus such as logout. Left Sub-Menu Area (i.e., Second-Level Menu Item Area): Displays all sub-menus (i.e., second-level menu items) of the selected first-level menu item. Bottom: Displays software copyright information. Dedicated Page Area: Displays the dedicated pages of each front-end subsystem, including the default homepage of the front-end integration system. It should be understood that the above page layout is only an example to illustrate that each front-end subsystem can achieve integration based on a unified page layout through common components and unified interaction logic. In actual applications, the unified page layout of each front-end subsystem can be any other form and style, such as the first-level menu item area on the left and the second-level menu item area in the header, etc.

[0047] In practical applications, relevant tools can be used to merge all the JS files implementing the common component functionality into a single common component (referred to as x.js), and also merge all the CSS files implementing the common component functionality into a single common component (referred to as x.css). The generated two common components can then be published as URLs. The HTML (HyperText Markup Language) provided by the front-end subsystem references the common component through the src attribute of the script tag and the href attribute of the link tag, respectively. <script src="x.js的url”>< / script> and <link href="x.css的URL”>Include these two common components; they should be placed before other JS and CSS files in the HTML document.

[0048] In practical applications, users can send access requests to any front-end subsystem or front-end converged system on the client side by entering a URL or through actions such as clicking or touching. Specifically, all front-end subsystems can be pre-configured with the same domain name and distinguished by their unique identifiers. The link address of each front-end subsystem will then include the unified domain name and the unique identifier, which can be located at the beginning of the URL's path portion. For example, the URL of front-end subsystem 1 might be: www.xxx.com / systme1 / user, and the URL of front-end subsystem 2 might be: www.xxx.com / systme2 / user. Here, www.xxx.com is the same domain name used across all front-end subsystems, systme1 is the unique identifier for front-end subsystem 1, and system2 is the unique identifier for front-end subsystem 2.

[0049] After the above access requests enter the front-end fusion system, they are first intercepted by the pre-established front-end server. See also Figure 3 The front-end server can be an Nginx server based on reverse proxy technology, which can intercept all access requests with a preset domain name (i.e., the same domain name for all front-end subsystems). After intercepting the access request, the front-end server forwards the access request to the front-end subsystem corresponding to the unique identifier in the access request's URL address for appropriate processing. The front-end server can configure the mapping between URL characteristics (such as unique identifiers in the URL) and the IP address of the front-end subsystem server in its local URL interceptor to perform the above forwarding. In practical scenarios, the front-end server can also use web server software such as Apache or IIS to implement access to all front-end subsystems using a unified domain name and URL-based access request forwarding. Furthermore, response data returned from each front-end subsystem will also enter the front-end server and then be returned to the client. Through the above settings, a unified domain name and independent URL are achieved for each front-end subsystem, solving the problem of URL recording functionality failure in existing iframe technology.

[0050] In this embodiment of the invention, the access request can be directed to the front-end subsystem itself, a specific function of the front-end subsystem, or the aforementioned front-end fusion system. Upon receiving the access request, the front-end subsystem invokes common components to execute unified interaction logic such as menu control, page generation, and login verification.

[0051] Specifically, after being called by the front-end subsystem, the public component first uses a preset mapping relationship between link addresses and menu items to determine the menu item corresponding to the link address of the access request. For example, the menu items may include the aforementioned first-level menu items and second-level menu items that are submenus of the first-level menu items. The following uses first-level and second-level menu items as examples to illustrate the technical solution of the present invention. It is understood that in practical applications, the menu data of each front-end subsystem may have only one level or any number of levels. The following description does not impose limitations on the menu data hierarchy of the present invention.

[0052] Specifically, a second callback function can be pre-configured in the front-end subsystem to reflect the mapping relationship between the above link addresses and menu items. When the front-end subsystem calls the public component, it sends the address of the second callback function to the public component. When the public component generates the page, it can first obtain the first page data provided by the front-end subsystem. The first page data can include the page's header nodes such as declaration nodes (e.g., <!DOCTYPE html>), head nodes, title nodes, etc., and can also include body nodes with only tags (i.e., body nodes). Subsequently, the public component calls the second callback function according to its address, and when calling the second callback function, it sends all the menu items stored locally to the front-end subsystem one by one. The front-end subsystem then executes the second callback function to match the menu items with the access request link addresses. After the matching is complete, the front-end subsystem returns the matching result to the public component.

[0053] After receiving the matching results from the front-end subsystem, the common component attempts to generate second-page data related to the menu. This second-page data can include page data for first-level and second-level menu items, as well as page data for the currently logged-in user's information and the footer area. The user information and footer area data can be obtained by the common component from the back-end system. Specifically, when it is determined that there is no menu item corresponding to the requested link address, the common component generates "no permission" page data and returns it to the front-end subsystem, indicating that the user does not have permission to access the page corresponding to the clicked or entered URL. When determining that there is a menu item corresponding to a requested link address, the common component further checks whether the identified menu item is a first-level or second-level menu item.

[0054] If the detected item is a first-level menu item, it indicates that the access request is directed to the front-end subsystem itself. The common component then generates second-page data to display all the second-level menu items of the detected first-level menu item in the second-level menu item area, highlighting the first-level menu item and its first second-level menu item (e.g., highlighting). Alternatively, only the first-level menu item can be highlighted without highlighting any of its second-level menu items. If the detected item is a second-level menu item, it indicates that the access request is directed to a specific function of the front-end subsystem. The common component then retrieves the first-level menu item to which the second-level menu item belongs, generates second-page data to display all the retrieved second-level menu items of the first-level menu item in the second-level menu item area, and highlights both the first-level menu item and the detected second-level menu item.

[0055] It should be noted that the second page data may also include specific nodes for mounting front-end subsystem-specific page data. For example, these specific nodes could be div nodes. After generating the second page data, the common component mounts the second page data to the main node in the first page data, thus forming a page template. This page template already contains the header node's page data and menu-related page data, and may also contain the currently logged-in user information and the footer area's page data. By combining this with the front-end subsystem's proprietary page data, a complete HTML page can be formed. It can be understood that the page template also contains these specific nodes.

[0056] After the page template is generated, the public component retrieves the specific node from the page template for mounting the proprietary page data of the front-end subsystem and sends it to the front-end subsystem. The front-end subsystem generates the proprietary page data and mounts it to the specific node, forming the page data to be returned to the client. Specifically, the front-end subsystem pre-configures a first callback function to reflect the logic for generating the proprietary page data. When the front-end subsystem calls the public component, it sends the address of the first callback function to the public component. After the page template is generated, the public component uses the preset identifier of the specific node to query the page template, obtains the specific node, and calls the first callback function to send the obtained specific node to the front-end subsystem. It also notifies the front-end subsystem to generate proprietary page data by calling the first callback function. After receiving the notification, the front-end subsystem executes the first callback function to generate proprietary page data (if the access request points to the front-end fusion system, the proprietary page data is the default homepage of the front-end fusion system), mounts the generated proprietary page data to the page template provided by the public component, forms the final page data, and returns it to the client via the front-end server.

[0057] In this way, through the collaboration between common components and front-end subsystems, as well as the above callback function mechanism, this invention realizes a unified menu display control logic and page generation process applied to various front-end subsystems, which helps to achieve effective integration of various front-end subsystems.

[0058] The following describes the login absence check process according to an embodiment of the present invention. In specific applications, each of the multiple front-end subsystems interacts with a preset back-end system through an AJAX (Asynchronous JavaScript and XML) mechanism. To execute a unified login absence check logic for all front-end subsystems, a common component pre-creates a proxy request object to override the AJAX request object of each front-end subsystem. The proxy request object references a preset real request object, which pre-encapsulates a login absence check function. The common component uses the real request object to receive response data returned by the back-end system to the front-end subsystems and executes the login absence check function in the real request object to determine whether the current user is not logged in: if so, the common component instructs the front-end subsystem to return a login page to the client (i.e., a page requiring the user to enter login information); otherwise, the common component returns the response data to the front-end subsystem for further processing. Through the above settings, login absence checks covering all front-end subsystems can be implemented without modifying the AJAX request code of each front-end subsystem.

[0059] The following describes a specific embodiment of the present invention applied to SaaS (Software-as-a-Service). See [link to SaaS documentation]. Figures 4 to 9 .

[0060] First, let's explain the background technology of this embodiment. In the field of cloud computing, thanks to the maturity of cloud computing technology, enterprises can quickly transform existing systems into SaaS to realize technology monetization. An important step in the SaaS transformation process is to integrate existing front-end subsystems to form a flexible matrix-style version pool system. These front-end subsystems are usually developed by different teams, using different front-end frameworks and routing systems, with independent code repositories and deployments. From a front-end engineering perspective, the integration process means giving these front-end subsystems a unified interface and the same interaction logic. The integrated system is accessed using a unified domain name, and users enter each front-end subsystem from a menu entry provided by a common interface. Currently, the above integration work is mainly accomplished using the browser's iframe technology. This technology uses a single page to provide a unified interface and common interaction logic, while the unique parts of each page are displayed in the window provided by the iframe.

[0061] The disadvantages of using iframes are as follows: First, the size of the viewport provided by an iframe is difficult to control, easily leading to multiple scrollbars, and centering the pop-up horizontally and vertically relative to the entire screen is difficult. This is because each page must be viewed through a viewport when using iframes, requiring the viewport's width and height to be specified. However, each page has different width and height, and even the same page will have different heights under different interactive conditions. Therefore, developers need to consider all factors affecting page height changes, and after an event causing a page height change occurs, they need to measure the page height using JavaScript and then modify the iframe's height. This results in low development efficiency, a high risk of bugs, and a poor user experience. Second, the browser's URL recording function fails: the browser's URL address bar does not change when navigating between pages; when refreshing a page, the currently viewed page content is lost, and the homepage content is displayed; after a page is bookmarked, the browser displays the homepage content when reopened. This is because, with iframe technology, the display of each front-end subsystem page is achieved by changing the iframe's src attribute, and the browser does not record changes to this attribute. Therefore, the address recorded by the browser is always the system homepage address.

[0062] In this embodiment, the backend interfaces of each frontend subsystem are managed through a unified interface management platform (located in the backend system). The interface management platform provides basic interfaces such as user login, logout, user menu data retrieval, and user information retrieval. When a backend interface is called by the frontend, the interface management platform needs to determine whether the user is logged in. The frontend can call the backend's business interfaces through the interface management platform. The frontend calls the backend interfaces by sending AJAX requests using an XMLHttpRequest object (i.e., an AJAX request object). Each subsystem is a frontend-backend separated project; that is, the backend only provides data interfaces, generated by JS frameworks such as React, Vue, and Angular. The unified interface of this embodiment is shown below. Figure 2 .

[0063] The common interaction logic in this embodiment includes: First, calling the user information interface of the backend system to obtain information such as the name of the currently logged-in user, and displaying it on the right side of the header after successful retrieval; when the user moves the mouse to the arrow to the right of the username, a logout submenu is displayed; when the logout option is clicked, the frontend calls the backend interface to clear the login information and then redirects to the login page. Second, checking the AJAX response information of each backend interface except for "Login" and "Logout"; if it indicates not logged in (including login timeout), redirecting to the system login page. The specific process is as follows... Figure 5As shown. Specifically, the login status checker of the interface management platform determines whether the current user is already logged in: if so, it calls the business API (Application Programming Interface) to obtain business data and sends the business data to the front-end data receiver; otherwise, it sends "not logged in" data to the data receiver. After receiving the data, the front-end data receiver displays the login page if it finds that the user is not logged in; otherwise, it executes other corresponding logic.

[0064] Third, retrieve and display the menu items available to the currently logged-in user. Fourth, check if the current user has permission to access a specific page. If not, redirect to the page for users with no permission; otherwise, highlight (select) the header menu (the first-level menu items) of the page, and display the sub-menus (second-level menu items) of the selected header menu in the left-hand sub-menu area. The detailed process is as follows... Figure 6 As shown. First, the front-end subsystem and common components collaboratively perform URL and menu item matching. If the match fails, meaning no menu item corresponding to the URL is found, it indicates that the user does not have permission to access the corresponding menu item, and an "no permission" page is displayed to the user. If the match succeeds, it further checks whether the item matched in the URL is a first-level menu item or a second-level menu item: if it is the former, the second-level menu item area displays all the second-level menu items of the first-level menu item, and the first-level menu item and its first second-level menu item are highlighted; if it is the latter, the first-level menu item to which the detected second-level menu item belongs is obtained, and second page data is generated to make the second-level menu item area display all the second-level menu items of the obtained first-level menu item, and the first-level menu item and the detected second-level menu item are highlighted.

[0065] The following describes the unified page generation logic and interaction control logic of this embodiment. In this embodiment, a page template with a "slot" (i.e., the aforementioned specific node) function is provided through a public component. After the front-end subsystem loads the page template, it mounts the proprietary page HTML to the "slot" position specified in the page template, thus creating a unified interface. The "slot" is an HTML element with flexible height, so the height of the "slot" is equal to the height rendered by the page HTML, which can be automatically calculated by the browser.

[0066] First, let's explain how to ensure that the pages in a subsystem have the same common interface. A complete subsystem page HTML structure is shown below:

[0067]

[0068]

[0069] Each front-end subsystem server needs to provide an HTML document, namely the first page data, abbreviated as html-1, which includes the above declaration node, html node, head node and body node.

[0070] The html in the body node above is the second page data, abbreviated as html-2. It is the implementation of the unified interface layout (including the header, left submenu area, and footer). It is provided by the common component and mounted to the body node of html-1. There is a node with the id "sub-page" in html-2, which is a specific node. This node is a container for the page data of the front-end subsystem and acts as the "slot" function mentioned above. When the common component mounts html-2 to the body node of html-1, it provides the page template that all front-end subsystem pages need to use.

[0071] The "bottom content pseudo-HTML" in a specific node is proprietary page data of the front-end subsystem, which can be called third-party page data, or simply HTML-3. It is provided by the front-end subsystem's JS framework and mounted into the "slot" specified by HTML-2. Developers do not need to worry about how HTML-3 is mounted or replaced; they only need to call the framework's API in the system initialization JS code and instruct the API to mount the generated HTML-3 to the specific node.

[0072] The page generation process based on cross-platform collaboration is as follows: Figure 7 As shown, in Figure 7 In the process, the front-end subsystem server first returns html-1 to the common component. Then, the common component generates html-2 and attaches html-2 to the body node of html-1 to form the page template. Finally, the front-end subsystem's JS framework generates html-3 and attaches html-3 to a specific node of the page template to form the final html, which is then returned to the client.

[0073] When a page switch occurs, if the front-end subsystem uses single-page technology, its JS framework will find and call the corresponding HTML-3 generator according to the URL rules agreed upon by the developers. After the HTML-3 is generated, the JS framework will replace the HTML-3 in the specific node of the current HTML document. If the front-end subsystem uses multi-page technology, it will redirect to... Figure 7 The process is re-executed at the starting node.

[0074] The following explains the specific implementation of the common components and the collaboration mechanism between the common components and the front-end subsystem.

[0075] If a common component is provided to the front-end subsystem in HTML tag format, the component tag is not a standard HTML element and cannot be recognized by the browser. A JS framework is needed to convert the component tag to HTML tags. However, each JS framework can only convert components developed using its own syntax standard, and obviously, not all front-end subsystems use the same JS framework. This means that even for common components with the same functionality, multiple implementations are required, resulting in extremely high maintenance costs. Therefore, this embodiment uses a JS function (referred to as docker) to implement the common component. The method for integrating the front-end subsystem into the SaaS system is to call the docker function.

[0076] from Figure 7 As can be seen, the public component doesn't need to know how HTML-3 is generated or replaced. Its task is to notify the front-end subsystem to initialize after HTML-2 is inserted into the body node. To enable the public component to notify and pass specific nodes to the front-end subsystem, a parameter needs to be defined for the `docker` function. This parameter is a JS object (referred to as `config`). `config` defines a property called `mount`, whose value is a function (i.e., the first callback function, abbreviated as `fn11`) that meets the following characteristics:

[0077] a.fn11 has a parameter (called slot) for receiving a specific node, the value of which (i.e., the specific node) is provided by a public component.

[0078] The function body b.fn11 needs to contain code that calls the JS framework API to generate front-end subsystem-specific page data.

[0079] To allow the front-end subsystem's initialization routine fn11 to be called by the docker function, each front-end subsystem needs to pass fn11 as a parameter to the docker function when calling it. For example, the code for a front-end subsystem calling the docker function could be:

[0080] docker({mount:fn11})

[0081] When the docker function executes, it first generates html-2 and calls the browser's document.body.prepend() method (used to insert html) to mount html-2 to the body node of html-1. The mounted node will then become the first child node of the body node. Next, it calls document.querySelector('#sub-page') (used to query nodes) to retrieve a specific node and assigns it to a variable (denoted as domObj). This variable will then be used as the value of the slot parameter in the fn11 function. Since the specific node in html-2 has an id attribute named "sub-page", it can be retrieved using the methods provided by the browser. Finally, the public component calls the fn11 function via config.mount(domObj) to achieve a notification effect and pass the specific node to the front-end subsystem.

[0082] The above calling process of the first callback function is as follows: Figure 8 As shown, in Figure 8 In the process, when the front-end subsystem executes docker({mount:fn11}) to call the common component, it passes fn11 to the common component. After generating html-2 and the page template, the common component executes config.mount(domObj) to notify the front-end subsystem and passes the specific node. After receiving the notification, the front-end subsystem generates html-3 and mounts it to the page template to form the final page data.

[0083] The following explains the unified logic for menu display control. An attribute named `menuMatch` can be defined for the `config` parameter of the `docker` function, with its value being a function (denoted as `fn2`) that meets specific characteristics. These characteristics are as follows:

[0084] a. It has one parameter that is used to receive menu items passed in by the public component.

[0085] b. Implement the matching logic between menu items and the current page URL within the function body. If a match is found, return true to the public component; otherwise, return false.

[0086] When the docker function executes Figure 6 During the process, all menu items are iterated over. During each iteration, `config.menuMatch(menuItem)` is called on `fn2`, passing the menu item as a parameter. `fn2` then matches the menu item with the URL. After `fn2` returns the matching result to the common component, the common component executes... Figure 6 The process generates HTML2.

[0087] The following explains the unified logic for checking for not being logged in. Under normal circumstances, to intercept AJAX response data from all front-end subsystems, it's necessary to provide the front-end subsystems with an AJAX library that includes AJAX response interception functionality and specific judgment logic. The front-end subsystems would then need to replace their existing AJAX libraries with this new AJAX library and modify the corresponding calling code, which would waste significant development costs.

[0088] To solve this problem, a proxy request object needs to be defined inside the docker function (i.e., Figure 9 The XMLHttpRequest Proxy is used to override the XMLHttpRequest object (i.e., the AJAX request object of the front-end subsystem). When the front-end subsystem calls `new XMLHttpRequest` to create an AJAX instance (assuming the instance name is `xhr`), it is actually creating an instance of the proxy request object (see...). Figure 9 The marker (1) in the middle creates and references a Real XMLHttpRequest instance (i.e., the aforementioned real request object, see the example) inside the proxy request object instance. Figure 9 Marker (2), aka realXHR), therefore when the front-end subsystem's xhr calls the corresponding method, the proxy request object instance will call the method corresponding to realXHR (see Figure 9 The marker (3) includes known methods or properties such as open, send, and onload. To listen for response data, a function containing response data checking code (i.e., the login failure check function, denoted as fun1) can be assigned to realXHR.onload inside the proxy request object instance. When realXHR receives the response data event, fun1 is automatically called, performing the login failure check before calling the function specified by xhr.onload to return data control to the front-end subsystem's AJAX handler. It should be noted that the above docker function is... Figure 4 The entry function of the common component interface layer, and the addresses of fn11 and fn2 above are the configuration objects of the common component interface layer. The basic data acquisition of the common component function layer can include user information acquisition.

[0089] After implementing the above functionalities of the common component, a tool can be used to merge all the JS files implementing the common component into a single file (denoted as x.js), and all the CSS files into a single file (denoted as x.css). The generated JS and CSS can then be published as a URL. The HTML provided by the front-end subsystem server can be accessed via... <script src="x.js的url”>< / script> and <link href="x.css的URL”> The two files are included as public components and are placed before other JS and CSS files in the HTML document.

[0090] Finally, the unified domain name and independent URLs for each front-end subsystem can be achieved through the following steps. First, assign a unique identifier to each front-end subsystem and apply this unique identifier to the beginning of the path portion of the URL. Second, resolve the unified domain name to an Nginx server used for relaying (i.e., the front-end server). Add a series of URL interceptors to the front-end server, each starting with the unique identifier of its respective front-end subsystem. Each URL interceptor specifies the server that should be proxied for URLs that meet certain characteristics. Thus, when a URL request from a browser reaches the front-end server, the front-end server will, according to the agreed-upon configuration, use reverse proxy technology to forward the URL request to the corresponding service.

[0091] Through the above settings, this embodiment of the invention enables multiple front-end subsystems to have a unified interface and menu display, page generation, and non-login check, etc., based on common components, and to access them using the same domain name. This achieves a new way of integrating multiple front-end subsystems, realizing non-intrusive integration while avoiding the aforementioned defects of iframe technology, reducing the cost and difficulty of system integration, and improving the user experience of the integrated system.

[0092] Figure 10 This is a schematic diagram illustrating the main steps of the page generation method according to an embodiment of the present invention. Figure 10 As shown, the page generation method of this embodiment of the invention is executed by a common component pre-introduced by multiple front-end subsystems, and can be specifically executed according to the following steps:

[0093] Step S1001: In response to an access request sent by the client for any of the multiple front-end subsystems, determine the menu item corresponding to the link address of the access request using a preset mapping relationship between link addresses and menu items, and form a page template based on the second page data generated according to the determined menu item; wherein, the multiple front-end subsystems have a consistent page layout, which includes the area where the menu item is located and the dedicated page area of ​​the front-end subsystem; Step S1002: Obtain a specific node from the page template for mounting the dedicated page data of any of the front-end subsystems and send it to the front-end subsystem, so that the front-end subsystem generates the dedicated page data and mounts it to the specific node, forming page data for returning to the client.

[0094] In this embodiment of the invention, the mapping relationship is embodied in a second callback function pre-configured in any front-end subsystem, and the address of the second callback function is pre-sent to the common component; and the step of determining the menu item corresponding to the link address of the access request using the preset mapping relationship between the link address and the menu item includes: calling the second callback function according to the address of the second callback function, and sending the menu item stored locally to the any front-end subsystem, so that the front-end subsystem determines the menu item corresponding to the link address of the access request by executing the second callback function.

[0095] As a preferred embodiment, the menu item includes a first-level menu item corresponding to the plurality of front-end subsystems and a second-level menu item as a submenu of the first-level menu item. The area where the menu item is located includes a first-level menu item area and a second-level menu item area. The method further includes: when it is determined that there is no menu item corresponding to the link address of the access request, generating no-permission page data and returning it to any of the front-end subsystems; the second page data is generated according to the following steps: detecting whether the determined menu item is a first-level menu item or a second-level menu item; if it is detected as a first-level menu item, generating second page data to display each second-level menu item of the first-level menu item in the second-level menu item area, and highlighting the first-level menu item and its first second-level menu item; if it is detected as a second-level menu item, obtaining the first-level menu item to which the second-level menu item belongs, generating second page data to display each second-level menu item of the obtained first-level menu item in the second-level menu item area, and highlighting the first-level menu item and the detected second-level menu item.

[0096] Preferably, the step of forming a page template based on the second page data generated according to the determined menu items includes: obtaining first page data provided by any of the front-end subsystems, including header nodes and body nodes; and attaching the second page data to the body nodes in the first page data to form the page template.

[0097] In specific applications, the logic for generating the proprietary page data is embodied in a first callback function pre-configured in any front-end subsystem. The address of the first callback function is pre-sent to the common component. Furthermore, obtaining a specific node from the page template for mounting the proprietary page data of any front-end subsystem and sending it to that front-end subsystem to generate the proprietary page data includes: querying the page template using a preset identifier of the specific node to obtain the specific node; calling the first callback function to send the obtained specific node to the any front-end subsystem and notifying the front-end subsystem to generate the proprietary page data.

[0098] In practical applications, each of the multiple front-end subsystems interacts with a preset back-end system via an AJAX mechanism; and the method further includes: creating a proxy request object that references a preset real request object to override the AJAX request object of each front-end subsystem; wherein the real request object pre-contains an unlogged-in check function; using the real request object to receive response data returned by the back-end system to the front-end subsystem, and executing the unlogged-in check function to determine whether the current user is in an unlogged-in state: if so, instructing the front-end subsystem to return a login page to the client; otherwise, returning the response data to the front-end subsystem.

[0099] In one optional technical solution, the link addresses of the multiple front-end subsystems have the same domain name, and the link address of any front-end subsystem further contains a unique identifier for that front-end subsystem; after an access request for any front-end subsystem is intercepted by a pre-set front-end server corresponding to the domain name, the front-end server forwards the access request to the front-end subsystem corresponding to the unique identifier in the link address of the access request.

[0100] Furthermore, in this embodiment of the invention, the public component includes a Javascript file, and the second page data further includes: software copyright information and information of the currently logged-in user obtained from the backend system. Since the specific details of the above steps have already been described above, they will not be repeated here.

[0101] In the technical solution of this invention, pre-written common components are referenced in multiple front-end subsystems. These common components are used to implement a unified page layout for each front-end subsystem, as well as unified interactive logic such as page rendering control, menu display control, and login failure checks. A unified domain name and unique identifier are configured for each front-end subsystem to generate an independent URL for each front-end subsystem. A front-end server corresponding to the unified domain name intercepts access requests from each front-end subsystem and forwards them according to the unique identifier in the URL. This achieves the fusion of multiple front-end subsystems without relying on iframes, avoiding the inherent defects of iframes such as difficulty in controlling the window size, the tendency for multiple scrollbars to appear, difficulty in centering pop-ups, and the failure of URL recording functions. Furthermore, the non-intrusive fusion solution avoids significant modifications to the original system code, thereby reducing the cost and difficulty of system fusion and improving the user experience of the fused system. Furthermore, in this embodiment of the invention, a callback function is used to enable collaboration between common components and front-end subsystems to generate menu item page data and front-end subsystem-specific page data, ultimately forming the page data returned to the user, thereby achieving unified control over the page generation process of each front-end subsystem; a proxy request object referencing the real request object is used to override the AJAX request objects of each front-end subsystem to achieve the unlogged-in check in the back-end response data, thereby achieving unlogged-in checks covering all front-end subsystems without modifying the AJAX request code of each front-end subsystem.

[0102] It should be noted that, for the sake of ease of description, the foregoing method embodiments are described as a series of actions. However, those skilled in the art should understand that the present invention is not limited to the described order of actions, and some steps may actually be performed in other orders or simultaneously. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions and modules involved are not necessarily essential for implementing the present invention.

[0103] To facilitate better implementation of the above-described solutions of the embodiments of the present invention, related apparatus for implementing the above-described solutions is also provided below.

[0104] Please see Figure 11 As shown, the page generation device 1100 provided in this embodiment of the invention is set in a common component pre-introduced in multiple front-end subsystems, and may include: a page template forming unit 1101 and a page assembly unit 1102.

[0105] The page template forming unit 1101 can be used to: respond to an access request sent by a client for any of the plurality of front-end subsystems, determine the menu item corresponding to the link address of the access request using a preset mapping relationship between link addresses and menu items, and form a page template based on second page data generated according to the determined menu item; wherein the plurality of front-end subsystems have a consistent page layout, the page layout including the area where the menu item is located and the dedicated page area of ​​the front-end subsystem; the page assembly unit 1102 can be used to: obtain a specific node from the page template for mounting the dedicated page data of any of the front-end subsystems and send it to the front-end subsystem, so that the front-end subsystem generates the dedicated page data and mounts it to the specific node, forming page data for returning to the client.

[0106] In this embodiment of the invention, the logic for generating the proprietary page data is embodied in a first callback function pre-configured in any front-end subsystem, and the address of the first callback function is pre-sent to the common component in any front-end subsystem; the mapping relationship is embodied in a second callback function pre-configured in any front-end subsystem, and the address of the second callback function is pre-sent to the common component in any front-end subsystem; the menu item includes a first-level menu item corresponding to the plurality of front-end subsystems and a second-level menu item as a submenu of the first-level menu item, and the area where the menu item is located includes a first-level menu item area and a second-level menu item area.

[0107] In specific applications, the page template forming unit 1101 can be further used to: call the second callback function according to the address of the second callback function, and send the menu item stored locally to any front-end subsystem, so that the front-end subsystem determines the menu item corresponding to the link address of the access request by executing the second callback function; when it is determined that there is no menu item corresponding to the link address of the access request, generate no-permission page data and return it to any front-end subsystem; when it is determined that there is a menu item corresponding to the link address of the access request, detect whether the determined menu item is a first-level menu item or a second-level menu item: if it is detected as a first-level menu item, generate second page data to display each second-level menu item of the first-level menu item in the second-level menu item area, and highlight the first-level menu item and the first second-level menu item of the first-level menu item; if it is detected as a second-level menu item, obtain the first-level menu item to which the second-level menu item belongs, generate second page data to display each second-level menu item of the obtained first-level menu item in the second-level menu item area, and highlight the first-level menu item and the detected second-level menu item.

[0108] In practical applications, the page assembly unit 1102 can be further used to: obtain first page data, including header nodes and main nodes, provided by any front-end subsystem; mount second page data to the main nodes in the first page data to form the page template; query the page template using a preset identifier of the specific node to obtain the specific node; call a first callback function to send the obtained specific node to any front-end subsystem and notify the front-end subsystem to generate the proprietary page data.

[0109] As a preferred embodiment, each of the plurality of front-end subsystems interacts with a preset back-end system via an AJAX mechanism; and the device 1100 may further include: an unlogged-in check unit, which is used to: create a proxy request object referencing a preset real request object to override the AJAX request object of each front-end subsystem; wherein the real request object has a pre-defined unlogged-in check function; using the real request object to receive response data returned by the back-end system to the front-end subsystem, and executing the unlogged-in check function to determine whether the current user is in an unlogged-in state: if so, instructing the front-end subsystem to return a login page to the client; otherwise, returning the response data to the front-end subsystem.

[0110] Preferably, the link addresses of the multiple front-end subsystems have the same domain name, and the link address of any front-end subsystem further contains a unique identifier for that front-end subsystem; after an access request for any front-end subsystem is intercepted by a pre-set front-end server corresponding to the domain name, the front-end server forwards the access request to the front-end subsystem corresponding to the unique identifier in the link address of the access request.

[0111] Furthermore, in this embodiment of the invention, the public component includes a Javascript file, and the second page data further includes: software copyright information and information of the currently logged-in user obtained from the backend system.

[0112] According to the technical solution of this invention, pre-written common components are referenced in multiple front-end subsystems. These common components are used to implement a unified page layout for each front-end subsystem, as well as unified interactive logic such as page rendering control, menu display control, and login failure checks. A unified domain name and unique identifier are configured for each front-end subsystem to generate an independent URL for each front-end subsystem. A front-end server corresponding to the unified domain name intercepts access requests from each front-end subsystem and forwards them according to the unique identifier in the URL. This achieves the fusion of multiple front-end subsystems without relying on iframes, avoiding the inherent defects of iframes such as difficulty in controlling the window size, the tendency for multiple scrollbars to appear, difficulty in centering pop-ups, and the failure of URL recording functions. Furthermore, the non-intrusive fusion solution avoids significant modifications to the original system code, thereby reducing the cost and difficulty of system fusion and improving the user experience of the fused system. In addition, callback functions are used to enable collaboration between common components and front-end subsystems to generate menu item page data and front-end subsystem-specific page data, ultimately forming the page data returned to the user, thereby achieving unified control over the page generation process of each front-end subsystem; proxy request objects referencing the real request objects are used to override the AJAX request objects of each front-end subsystem to implement the unlogged-in check in the back-end response data, thus achieving unlogged-in checks covering all front-end subsystems without modifying the AJAX request code of each front-end subsystem.

[0113] Figure 12 An exemplary system architecture 1200 is shown that can be applied to the page generation method or page generation apparatus of the present invention.

[0114] like Figure 12 As shown, system architecture 1200 may include terminal devices 1201, 1202, and 1203, network 1204, and server 1205 (this architecture is merely an example; the components included in a specific architecture may be adjusted according to the specific application). Network 1204 serves as the medium for providing communication links between terminal devices 1201, 1202, and 1203 and server 1205. Network 1204 may include various connection types, such as wired or wireless communication links or fiber optic cables.

[0115] Users can use terminal devices 1201, 1202, and 1203 to interact with server 1205 via network 1204 to receive or send messages, etc. Various client applications, such as cloud computing applications (for example only), can be installed on terminal devices 1201, 1202, and 1203.

[0116] Terminal devices 1201, 1202, and 1203 can be various electronic devices with displays and web browsing capabilities, including but not limited to smartphones, tablets, laptops, and desktop computers.

[0117] Server 1205 can be a server providing various services, such as a cloud server (for example only) supporting cloud computing applications operated by users using terminal devices 1201, 1202, and 1203. Server 1205 may include a front-end converged system and a back-end system. The cloud server can process received access requests and feed back the processing results (such as page data – for example only) to terminal devices 1201, 1202, and 1203.

[0118] It should be noted that the page generation method provided in this embodiment of the invention is generally executed by server 1205, and correspondingly, the page generation device is generally set in server 1205.

[0119] It should be understood that Figure 12 The number of terminal devices, networks, and servers shown is merely illustrative. Depending on implementation needs, any number of terminal devices, networks, and servers can be included.

[0120] The present invention also provides an electronic device. The electronic device according to an embodiment of the present invention includes: one or more processors; and a storage device for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the page generation method provided by the present invention.

[0121] The following is for reference. Figure 13 It shows a schematic diagram of the structure of a computer system 1300 suitable for implementing an electronic device according to embodiments of the present invention. Figure 13 The electronic device shown is merely an example and should not be construed as limiting the functionality and scope of use of the embodiments of the present invention.

[0122] like Figure 13 As shown, the computer system 1300 includes a central processing unit (CPU) 1301, which can perform various appropriate actions and processes based on programs stored in read-only memory (ROM) 1302 or programs loaded from storage section 1308 into random access memory (RAM) 1303. The RAM 1303 also stores various programs and data required for the operation of the computer system 1300. The CPU 1301, ROM 1302, and RAM 1303 are interconnected via a bus 1304. An input / output (I / O) interface 1305 is also connected to the bus 1304.

[0123] The following components are connected to I / O interface 1305: an input section 1306 including a keyboard, mouse, etc.; an output section 1307 including a cathode ray tube (CRT), liquid crystal display (LCD), etc., and speakers, etc.; a storage section 1308 including a hard disk, etc.; and a communication section 1309 including a network interface card such as a LAN card, modem, etc. The communication section 1309 performs communication processing via a network such as the Internet. Drive 1310 is also connected to I / O interface 1305 as needed. Removable media 1311, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., are installed on drive 1310 as needed so that computer programs read from them can be installed into storage section 1308 as needed.

[0124] In particular, according to the embodiments disclosed in this invention, the processes described in the above main step diagrams can be implemented as computer software programs. For example, embodiments of this invention include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the main step diagrams. In the above embodiments, the computer program can be downloaded and installed from a network via the communication section 1309, and / or installed from the removable medium 1311. When the computer program is executed by the central processing unit 1301, it performs the functions defined in the system of this invention.

[0125] It should be noted that the computer-readable medium shown in this invention can be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. A computer-readable storage medium can be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this invention, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In this invention, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium may be transmitted using any suitable medium, including but not limited to: wireless, wire, optical fiber, RF, etc., or any suitable combination thereof.

[0126] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of the present invention. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram or flowchart, and combinations of blocks in a block diagram or flowchart, may be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.

[0127] The units described in the embodiments of the present invention can be implemented in software or hardware. The described units can also be housed in a processor; for example, a processor can be described as including a page template forming unit and a page assembly unit. The names of these units do not necessarily limit the specific unit; for example, the page template forming unit can also be described as "a unit that provides a page template to the page assembly unit."

[0128] In another aspect, the present invention also provides a computer-readable medium, which may be included in the device described in the above embodiments; or it may exist independently and not assembled into the device. The computer-readable medium carries one or more programs, and when the device executes the one or more programs, the steps performed by the device include: responding to an access request sent by a client for any one of a plurality of front-end subsystems; determining the menu item corresponding to the link address of the access request using a preset mapping relationship between link addresses and menu items; forming a page template based on second page data generated according to the determined menu item; wherein the plurality of front-end subsystems have a consistent page layout, the page layout including the area where the menu item is located and the dedicated page area of ​​the front-end subsystem; obtaining a specific node from the page template for mounting the dedicated page data of any one of the front-end subsystems and sending it to the front-end subsystem, so that the front-end subsystem generates the dedicated page data and mounts it to the specific node, forming page data for returning to the client.

[0129] In the technical solution of this invention, pre-written common components are referenced in multiple front-end subsystems. These common components are used to implement a unified page layout for each front-end subsystem, as well as unified interactive logic such as page rendering control, menu display control, and login failure checks. A unified domain name and unique identifier are configured for each front-end subsystem to generate an independent URL for each front-end subsystem. A front-end server corresponding to the unified domain name intercepts access requests from each front-end subsystem and forwards them according to the unique identifier in the URL. This achieves the fusion of multiple front-end subsystems without relying on iframes, avoiding the inherent defects of iframes such as difficulty in controlling the window size, the tendency for multiple scrollbars to appear, difficulty in centering pop-ups, and the failure of URL recording functions. Furthermore, the non-intrusive fusion solution avoids significant modifications to the original system code, thereby reducing the cost and difficulty of system fusion and improving the user experience of the fused system. In addition, callback functions are used to enable collaboration between common components and front-end subsystems to generate menu item page data and front-end subsystem-specific page data, ultimately forming the page data returned to the user, thereby achieving unified control over the page generation process of each front-end subsystem; proxy request objects referencing the real request objects are used to override the AJAX request objects of each front-end subsystem to implement the unlogged-in check in the back-end response data, thus achieving unlogged-in checks covering all front-end subsystems without modifying the AJAX request code of each front-end subsystem.

[0130] The specific embodiments described above do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can occur depending on design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.

Claims

1. A page generation method, characterized in that, The method, performed by a common component pre-introduced from multiple front-end subsystems, includes: In response to an access request sent by a client for any of the multiple front-end subsystems, the menu item corresponding to the link address of the access request is determined using a preset mapping relationship between link addresses and menu items. A page template is then formed based on second page data generated according to the determined menu item. The multiple front-end subsystems have a consistent page layout, which includes the area containing the menu item and the dedicated page area of ​​each front-end subsystem. The mapping relationship is embodied in a pre-configured second callback function in any of the front-end subsystems, and each front-end subsystem pre-sends the address of the second callback function to the common component. A specific node for mounting proprietary page data of any front-end subsystem is obtained from the page template and sent to the front-end subsystem, so that the front-end subsystem generates the proprietary page data and mounts it to the specific node, forming page data for returning to the client.

2. The method according to claim 1, characterized in that, The step of determining the menu item corresponding to the access request's link address using a preset mapping relationship between link addresses and menu items includes: The second callback function is invoked based on its address, and the menu item stored locally is sent to any of the front-end subsystems, so that the front-end subsystem determines the menu item corresponding to the link address of the access request by executing the second callback function.

3. The method according to claim 1, characterized in that, The menu item includes a first-level menu item corresponding to the plurality of front-end subsystems and a second-level menu item that is a submenu of the first-level menu item. The area where the menu item is located includes a first-level menu item area and a second-level menu item area. as well as, The method further includes: when it is determined that there is no menu item corresponding to the link address of the access request, generating no-permission page data and returning it to any of the front-end subsystems; The data on the second page is generated according to the following steps: The detection determines whether the identified menu item is a first-level menu item or a second-level menu item. If the item is detected as a first-level menu item, second page data is generated to display each second-level menu item of the first-level menu item in the second-level menu item area, and to highlight the first-level menu item and its first second-level menu item. If a second-level menu item is detected, the first-level menu item to which the second-level menu item belongs is obtained, and second page data is generated so that the second-level menu item area displays each second-level menu item of the obtained first-level menu item, and the first-level menu item and the detected second-level menu item are highlighted.

4. The method according to claim 1, characterized in that, The process of forming a page template based on the second page data generated according to the determined menu items includes: Obtain the first page data, including header and body nodes, provided by any of the front-end subsystems; The data from the second page is mounted onto the main node of the data from the first page to form the page template.

5. The method according to claim 1, characterized in that, The logic for generating the proprietary page data is embodied in a first callback function pre-configured in any front-end subsystem, wherein the address of the first callback function is pre-sent to the common component; and the step of obtaining a specific node from the page template for mounting the proprietary page data of any front-end subsystem and sending it to the front-end subsystem to enable the front-end subsystem to generate the proprietary page data includes: The specific node is retrieved by querying the page template using the preset identifier of the specific node; The first callback function is invoked to send the obtained specific node to any of the front-end subsystems and to notify the front-end subsystem to generate the proprietary page data.

6. The method according to claim 1, characterized in that, Each of the plurality of front-end subsystems interacts with a preset back-end system via an AJAX mechanism; and the method further includes: Create a proxy request object that references a pre-defined real request object, overriding the AJAX request object of each front-end subsystem; wherein, the real request object contains a pre-defined unlogged-in check function; The real request object is used to receive the response data returned by the backend system to the frontend subsystem, and the not-login check function is executed to determine whether the current user is not logged in: if so, the frontend subsystem is instructed to return the login page to the client; otherwise, the response data is returned to the frontend subsystem.

7. The method according to claim 1, characterized in that, The link addresses of the multiple front-end subsystems have the same domain name, and the link address of any one front-end subsystem further contains the unique identifier of that front-end subsystem. Once an access request for any front-end subsystem is intercepted by a pre-defined front-end server corresponding to the domain name, the front-end server forwards the access request to the front-end subsystem uniquely identified in the link address of the access request.

8. The method according to claim 6, characterized in that, The public components include Javascript files, and the second page data further includes: software copyright information and information of the currently logged-in user obtained from the backend system.

9. A page generation device, characterized in that, The device, situated within a common component pre-introduced in multiple front-end subsystems, comprises: A page template forming unit is configured to: respond to an access request sent by a client for any of the plurality of front-end subsystems; determine the menu item corresponding to the link address of the access request using a preset mapping relationship between link addresses and menu items; and form a page template based on second page data generated according to the determined menu item; wherein the plurality of front-end subsystems have a consistent page layout, which includes the area where the menu item is located and the dedicated page area of ​​the front-end subsystem; the mapping relationship is embodied in a second callback function pre-configured in any of the front-end subsystems, and any of the front-end subsystems pre-sends the address of the second callback function to the common component; The page assembly unit is configured to: obtain a specific node from the page template for mounting proprietary page data of any front-end subsystem and send it to the front-end subsystem, so that the front-end subsystem generates the proprietary page data and mounts it to the specific node, forming page data for returning to the client.

10. The apparatus according to claim 9, characterized in that, The logic for generating the proprietary page data is embodied in a first callback function pre-configured in any of the front-end subsystems, and the address of the first callback function is pre-sent to the common component; the menu item includes first-level menu items corresponding to the multiple front-end subsystems and second-level menu items that are submenus of the first-level menu items, and the area where the menu item is located includes a first-level menu item area and a second-level menu item area; and, The page template forming unit is further used for: The second callback function is invoked based on its address, and the menu item stored locally is sent to any of the front-end subsystems, so that the front-end subsystem determines the menu item corresponding to the link address of the access request by executing the second callback function. If it is determined that there is no menu item corresponding to the link address of the access request, generate no-permission page data and return it to any of the front-end subsystems; When determining whether a menu item corresponds to the link address of the access request exists, the system checks whether the determined menu item is a first-level menu item or a second-level menu item: if it is a first-level menu item, the system generates second-page data to display the second-level menu item area for each second-level menu item of the first-level menu item, and highlights the first-level menu item and its first second-level menu item; if it is a second-level menu item, the system obtains the first-level menu item to which the second-level menu item belongs, generates second-page data to display the obtained second-level menu items for each second-level menu item of the first-level menu item in the second-level menu item area, and highlights the first-level menu item and the detected second-level menu item. The page assembly unit is further used for: Obtain first page data, including header node and main node, provided by any of the front-end subsystems; mount second page data to the main node in the first page data to form the page template. The specific node is retrieved by querying the page template using the preset identifier of the specific node; The first callback function is invoked to send the obtained specific node to any of the front-end subsystems and to notify the front-end subsystem to generate the proprietary page data.

11. A front-end fusion system, characterized in that, include: Multiple front-end subsystems and common components introduced in the multiple front-end subsystems; wherein, After the client sends an access request to any one of the multiple front-end subsystems, the common component uses a preset mapping relationship between link addresses and menu items to determine the menu item corresponding to the link address of the access request, and forms a page template based on the second page data generated according to the determined menu item; wherein, the multiple front-end subsystems have a consistent page layout, which includes the area where the menu item is located and the dedicated page area of ​​the front-end subsystem; the mapping relationship is reflected in the second callback function pre-configured in any one of the front-end subsystems, and the address of the second callback function is sent to the common component in advance by any one of the front-end subsystems; The public component obtains a specific node from the page template for mounting proprietary page data of any front-end subsystem and sends it to the front-end subsystem; the front-end subsystem generates the proprietary page data and mounts it to the specific node to form page data for returning to the client.

12. The front-end fusion system according to claim 11, characterized in that, The logic for generating the proprietary page data is embodied in a first callback function pre-configured in any of the front-end subsystems, and the address of the first callback function is pre-sent to the common component; the menu item includes first-level menu items corresponding to the multiple front-end subsystems and second-level menu items that are submenus of the first-level menu items, and the area where the menu item is located includes a first-level menu item area and a second-level menu item area; and, The public component invokes the second callback function based on its address and sends the menu item stored locally to any of the front-end subsystems; the front-end subsystem determines the menu item corresponding to the link address of the access request by executing the second callback function and returns it to the public component. If it is determined that there is no menu item corresponding to the link address of the access request, the public component generates no-permission page data and returns it to any of the front-end subsystems; When determining whether a menu item corresponds to the link address of the access request exists, the common component detects whether the determined menu item is a first-level menu item or a second-level menu item: if it is detected as a first-level menu item, the common component generates second-page data to display each second-level menu item of the first-level menu item in the second-level menu item area, and highlights the first-level menu item and its first second-level menu item; if it is detected as a second-level menu item, the common component obtains the first-level menu item to which the second-level menu item belongs, generates second-page data to display each second-level menu item of the obtained first-level menu item in the second-level menu item area, and highlights the first-level menu item and the detected second-level menu item. The common component obtains the first page data, including the header node and the main node, provided by any of the front-end subsystems. The second page data is attached to the main node in the first page data to form the page template; The public component uses the preset identifier of the specific node to query the page template, obtains the specific node, calls the first callback function to send the obtained specific node to any of the front-end subsystems, and notifies the front-end subsystem to generate the proprietary page data.

13. The front-end fusion system according to claim 11, characterized in that, Each of the multiple front-end subsystems interacts with a preset back-end system via an AJAX mechanism; the link addresses of the multiple front-end subsystems share the same domain name, and each front-end subsystem's link address further contains its unique identifier; the front-end fusion system further includes a front-end server corresponding to the domain name; the common components include Javascript files, and the second page data further includes: software copyright information and information about the currently logged-in user obtained from the back-end system; and... The common component creates a proxy request object that references a preset real request object, overriding the AJAX request object of each front-end subsystem; wherein, the real request object contains a pre-defined function for checking if the user is not logged in. The common component uses the real request object to receive the response data returned by the backend system to the frontend subsystem, and executes the not-login check function to determine whether the current user is not logged in: if so, the common component instructs the frontend subsystem to return the login page to the client; otherwise, the common component returns the response data to the frontend subsystem. The front-end server intercepts access requests for any front-end subsystem and forwards the access request to the front-end subsystem that is uniquely identified in the link address of the access request.

14. An electronic device, characterized in that, include: One or more processors; Storage device for storing one or more programs. When the one or more programs are executed by the one or more processors, the one or more processors implement the method as described in any one of claims 1-8.

15. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the method as described in any one of claims 1-8.

Citation Information

Patent Citations

  • Page loading method and device, storage medium and electronic equipment

    CN110941779A

  • Front-end deployment system and method for multi-system integrated deployment and interface unification keeping

    CN112965717A

  • Application page loading method, storage medium and related equipment

    CN113536185A