Multi-page management method, system and related device

By using routing lists and tab cache lists to manage page paths and resource file paths in single-page applications, cache loaded page components, solving the problem of inefficiency of single-page applications in multi-page operations, and achieving fast page switching and resources manage.

CN119226647APending Publication Date: 2024-12-31JIALIAN PAYMENTS CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202411070907.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-06
Publication Date
2024-12-31

AI Technical Summary

Technical Problem

When a single page application operates on multiple pages, frequent page switching results in inefficiency, resource loading repeatedly, and page switching cannot be effectively managed.

Method used

By creating route lists and tab cache lists, managing the mapping relationship between page paths and resource file paths, cache loaded page components, quickly locate and render target pages, avoiding duplicate loading.

Benefits of technology

It improves the efficiency of multi-page switching of single-page applications, reduces duplicate resource loading, and improves user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119226647A_ABST
    Figure CN119226647A_ABST
Patent Text Reader

Abstract

The invention discloses a multi-page management method, a multi-page management system and a related device, which are used for achieving the purpose of quickly switching pages under a single-page framework application. The method comprises the steps that a routing list and a tab cache list are created, the routing list is used for storing the mapping relation between a page path and a resource file path, and an identifier of the page path of a page corresponding to a tab comprises a loading state and an activation state; obtaining a target page; when the page path of the target page does not exist in the tab cache list, adding the page path of the target page to the tab cache list; marking an identifier of a page path of the target page as an activated state in a tab cache list; obtaining a resource file path of the target page through a routing list according to the page path of the target page; initializing an instance of the target page according to the configuration information of the resource file path of the target page, and generating a target page component; and caching the target page component into the page cache plug-in, and rendering the target page component.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data processing, and in particular to a multi-page management method, system and related devices. Background Art

[0002] With the development of technology, users have higher and higher requirements for the fluency of applications. Therefore, the design of applications is more implemented in a small-scale and multi-functional way. Among them, single-page applications are increasingly appearing in the application market. Single-page application (SPA) is a modern web application design pattern that allows users to interact with the application on a single page through dynamic content loading without reloading the entire page.

[0003] In the prior art, when multiple tasks and information need to be processed efficiently, frequent page switching will occur. However, when a single-page application switches pages, it is necessary to reload the content of the switched page and clear the display information of the switched page at the same time. As a result, the switching efficiency of the single-page application is too low when there is a need for multi-page operations, and page loading is repeated and loading resources are wasted. Summary of the invention

[0004] In order to solve the above technical problems, the present application provides a multi-page management method, system and related devices for achieving the purpose of fast page switching in a single-page application environment.

[0005] The technical solution provided in this application is described below:

[0006] The first aspect of the present application provides a multi-page management method, comprising:

[0007] Create a routing list and a tab cache list, wherein the routing list is used to store the mapping relationship between the page path and the resource file path, and the tab cache list is used to store the page path of the page corresponding to the tab, and the identifier of the page path of the page corresponding to the tab includes a loading state and an activation state;

[0008] Get the target page, which is the page corresponding to the tab that needs to be displayed currently;

[0009] When the page path of the target page does not exist in the tab cache list, adding the page path of the target page to the tab cache list;

[0010] Marking the page path identifier of the target page in the tab cache list as activated;

[0011] Acquire the resource file path of the target page through the routing list according to the page path of the target page;

[0012] Initializing an instance of the target page according to the configuration information of the resource file path of the target page, and generating a target page component;

[0013] The target page component is cached into a page cache plug-in, and the target page component is rendered.

[0014] Optionally, the method further includes:

[0015] When a page closing instruction is received, the path of the page to be closed corresponding to the closing instruction is obtained at the location of the tab cache list;

[0016] When the to-be-closed page path is at the first position in the tab cache list, the page corresponding to the second page path in the tab cache list is determined as the display page.

[0017] Optionally, the method further includes: obtaining the path identifier of the page to be closed corresponding to the close instruction after the position of the tab cache list;

[0018] When the position of the to-be-closed page path in the tab cache list is not the first, the page corresponding to the previous page path of the to-be-closed page path is confirmed as the display page.

[0019] Optionally, after the page corresponding to the previous page path identifier of the to-be-closed page path identifier is confirmed as a display page, the method further includes:

[0020] Remove the to-be-closed page path from the tab cache list;

[0021] Destroy the instance of the page to be closed;

[0022] Remove the page component of the page to be closed in the page cache plug-in.

[0023] Optionally, before rendering the target page component, the method further includes:

[0024] When there is a currently displayed page, ending the activation state of the identifier of the page path of the currently displayed page in the tab cache list;

[0025] The page components of the currently displayed page are hidden by the page cache plug-in.

[0026] Optionally, after terminating the activation state of the currently displayed page in the tab cache list, the method further includes:

[0027] If the currently displayed page has not completed loading, the loading state of the currently displayed page is maintained after the activation state ends until a page component is generated in the page cache plug-in so that the target page is switched to the currently displayed page again, and the currently displayed page is rendered according to the page component in the page cache plug-in.

[0028] Optionally, after obtaining the target page path identifier, the method further includes:

[0029] When the target page path exists in the tab cache list, activating the identifier of the target page path;

[0030] The target page component is rendered through the page cache plug-in.

[0031] The second aspect of the present application provides a multi-page management system, including:

[0032] A creation unit, used to create a routing list and a tab cache list, wherein the routing list is used to store a mapping relationship between a page path and a resource file path, and the tab cache list is used to store a page path of a page corresponding to a tab, wherein the identifier of the page path of the page corresponding to the tab includes a loading state and an activation state;

[0033] A first acquisition unit is used to acquire a target page, where the target page is a page corresponding to a tab that needs to be displayed currently;

[0034] an adding unit, configured to add the page path of the target page to the page cache list when the page path of the target page does not exist in the page cache list;

[0035] A marking unit, used to mark the identifier of the page path of the target page as an activated state in the tab cache list;

[0036] A second acquisition unit, configured to acquire a resource file path of the target page through the routing list according to the page path of the target page;

[0037] An initialization unit, used to initialize the instance of the target page according to the configuration information of the resource file path of the target page, and generate a target page component;

[0038] The first rendering unit is used to cache the target page component into a page cache plug-in and render the target page component.

[0039] Optionally, the multi-page management system further includes:

[0040] A third acquisition unit is used for, when receiving a page closing instruction, acquiring the position of the to-be-closed page path of the to-be-closed page corresponding to the closing instruction at the tab cache list;

[0041] The first determining unit is configured to determine, when the position of the to-be-closed page path in the tab cache list is the first, a page corresponding to the second page path in the tab cache list as a display page.

[0042] Optionally, the multi-page management system further includes:

[0043] The second determining unit is used to confirm the page corresponding to the previous page path of the to-be-closed page path as the display page when the to-be-closed page path is not at the first position in the tab cache list.

[0044] Optionally, the multi-page management system further includes:

[0045] A first removing unit, used to remove the to-be-closed page path from the tab cache list;

[0046] A destroying unit, used to destroy the instance of the page to be closed;

[0047] The second removing unit is used for the page component of the to-be-closed page in the page cache plug-in.

[0048] Optionally, the multi-page management system further includes:

[0049] An ending unit, used for ending the activation state of the identifier of the page path of the currently displayed page in the tab cache list when there is a currently displayed page;

[0050] The second rendering unit is used to hide the page components of the currently displayed page through the page cache plug-in.

[0051] Optionally, the multi-page management system further includes:

[0052] A maintaining unit is used to maintain the loading state of the currently displayed page after ending the activation state if the currently displayed page has not completed loading, until a page component is generated in the page cache plug-in so that the target page is switched to the currently displayed page again, and the currently displayed page is rendered according to the page component in the page cache plug-in.

[0053] Optionally, the multi-page management system further includes:

[0054] an activation unit, configured to activate the identifier of the target page path when the target page path exists in the tab cache list;

[0055] The third rendering unit is used to render the target page component through the page cache plug-in.

[0056] A third aspect of the present application provides a multi-page management device, the multi-page management method device comprising:

[0057] Processor, memory, input-output unit, and bus;

[0058] The processor is connected to the memory, the input and output unit, and the bus;

[0059] The memory stores a program, and the processor calls the program to execute the first aspect and any optional method in the first aspect.

[0060] A fourth aspect of the present application provides a computer-readable storage medium, on which a program is stored. When the program is executed on a computer, the program executes the first aspect and any optional method in the first aspect.

[0061] It can be seen from the above technical solutions that this application has the following advantages:

[0062] By creating a routing list and a tab cache list, the display status of the pages that have been loaded or need to be loaded is associated, and by caching the page components of the loaded pages in the tab cache plug-in, when the user switches to the page that has been loaded, he can quickly locate the page components of the target page from the tab cache list according to the page path of the target page, thereby achieving the purpose of quickly rendering the target page. BRIEF DESCRIPTION OF THE DRAWINGS

[0063] In order to more clearly illustrate the technical solution in the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0064] Figure 1 A schematic diagram of a flow chart of an embodiment of a multi-page management method in this application;

[0065] Figure 2 A flow chart of another embodiment of a cache page deletion method of a multi-page management method in the present application;

[0066] Figure 3 This is a flowchart of another embodiment of the multi-page management method in this application;

[0067] Figure 4This is a schematic diagram of the structure of an embodiment of the multi-page management system in this application;

[0068] Figure 5 This is a schematic diagram of another embodiment of the multi-page management system in this application;

[0069] Figure 6 This is a schematic diagram of the structure of an embodiment of a multi-page management device in the present application. DETAILED DESCRIPTION

[0070] It should be noted that the multi-page management method provided in this application can be applied to a terminal, a system, or a server. For example, the terminal can be a smart phone or a computer, a tablet computer, a smart TV, a smart watch, a portable computer terminal, or a fixed terminal such as a desktop computer. For the convenience of explanation, this application uses the terminal as the execution subject for example.

[0071] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0072] See also Figure 1 The present application first provides an embodiment of a multi-page management method, which includes:

[0073] S101, creating a routing list and a tab cache list, the routing list is used to store the mapping relationship between the page path and the resource file path, the tab cache list is used to store the page path of the page corresponding to the tab, and the identifier of the page path of the page corresponding to the tab includes a loading state and an activation state;

[0074] When a user opens an application, the terminal creates a routing list and a tab cache list. The routing list records the mapping relationship between the page path and the resource file path, while the tab cache list is used to track the loading and activation status of the page.

[0075] The routing list is a data structure that exists in the form of an object or a mapping. It is used to define the paths of all pages in the application and the corresponding resource file paths. In the application, each page path has a corresponding resource file path. Resource files usually contain page configuration information, such as the JSON configuration of the Amis framework. When a page needs to be loaded, the corresponding resource file path is found from the routing list according to the page path, and the resource is loaded to initialize the page.

[0076] The tab cache list is a data structure used to track the page loading and activation status through the tab status. It usually exists in the form of an object or mapping. Each page path identifier is associated with a tab object. The tab cache list contains the loading status (loaded) and activation status (active) of the page corresponding to a tab. When the page is loaded, its loading status is updated to true. When the page is activated (that is, the user switches to the page), its activation status is updated to true. During the page loading and switching process, the terminal will check and update the status of the corresponding page in the tab cache list.

[0077] The terminal uses the activation status of the tabs in the tab cache list to determine whether the page needs to be restored from the cache or whether the page needs to be reloaded from the resource file.

[0078] S102, obtaining a target page, where the target page is a page corresponding to the tab currently to be displayed;

[0079] Acquiring the target page enables the terminal to obtain the page path of the target page, and the page path of the target page is the index basis of the target page and its related components.

[0080] When the terminal obtains the target page, it will index it in the tab cache list according to the page path of the target page, and determine whether the target page corresponding to the target path exists in the tab cache list based on the index result. That is, the page path is used as the identification bit of the target page in the tab cache list.

[0081] In actual situations, after the terminal obtains the target page, if the target page has not been loaded, a page identifier corresponding to the page path of the target page will be generated in the tab cache list.

[0082] Specifically, the page identifier can confirm the page path of the page displayed by the corresponding tab in the tab cache list, so as to quickly obtain the information required for the page through the corresponding relationship between the page path and the tab.

[0083] The page path of the target page is usually obtained from the user's interactive behavior, such as clicking a tab, entering a URL, or generating a new page through a navigation link in the application. The specifics are not limited here. The application captures the user's interactive behavior and parses the corresponding page path. For example, if the user clicks a link, the application will extract the page path from the link.

[0084] Specifically, after the terminal obtains the target page, it obtains the storage information of the target page in the tab cache list according to the page path of the target page.

[0085] S103, when the page path of the target page does not exist in the tab cache list, adding the page path of the target page to the tab cache list;

[0086] Before switching tabs, first check whether the page path of the target page already exists in the tab cache list. If the page path of the target page does not exist in the tab cache list, add the page path of the target page to the tab cache list so that the terminal can quickly locate the cached resources of the target page through the page path of the target page when performing multi-page operations on a single-page application.

[0087] Specifically, when the terminal determines that the page path of the target page does not exist in the tab cache list, it will create a new entry in the tab cache list, which contains the page loading status, activation status and the corresponding relationship with the tab. The tab is a function in the browser that allows users to open multiple pages in the same browser window. Each tab can represent an independent page, and users can switch between different pages by clicking the tab.

[0088] For a newly added page in the tab cache list, the terminal will generate a new entry with the page path of the added page as the identifier, and initialize the state data of the added page in the new entry. Usually, the initial loading state of the page is false (uncompleted loading), and the initial activation state is false (inactive).

[0089] S104, marking the identifier of the page path of the target page as activated in the tab cache list;

[0090] After determining the target page that the user needs to activate or view according to the above steps, the terminal will use this page as the target page, store the page path of the target page and the mapping relationship it carries in the tab cache list, and mark the page path of the target page in the tab cache list as activated, that is, change the activation state to true (activated), in order to determine that the target page is the currently displayed page.

[0091] S105, obtaining the resource file path of the target page through the routing list according to the page path of the target page;

[0092] The application performs subsequent page loading processing on the activated page according to the activation status of the page path of the target page in the tab cache list.

[0093] When the page path of the target page is activated in the tab cache list, it means that the corresponding tab of the target page in the application is selected as the display tab, and the page displayed by the current program is the target page. At this time, because the page path of the target page is stored in the tab cache list for the first time, it means that the target page is in a state that needs to be loaded. In order to load the target page, it is necessary to obtain the resource file path of the target page through the routing list.

[0094] Specifically, because the routing list stores the mapping relationship between all page paths and resource file paths of the application, when the target page is determined to be a display page, the terminal will simultaneously obtain the page path of the target page based on the target page information, and find the corresponding resource file path in the routing list based on the page path and load the resource file path to obtain the data resources required to generate the target page.

[0095] S106, initializing an instance of the target page according to the configuration information of the resource file path of the target page, and generating a target page component;

[0096] After the terminal determines the resource file path of the target page through the routing list, it loads the resource file. The resource file contains the JSON configuration information of the page. The obtained resource file is parsed to extract the configuration data of the page. Taking the Amis framework as an example, the terminal uses the parsed JSON configuration information to initialize the Amis instance of the target page. The Amis instance is an abstract representation of the page, which contains all the necessary information of the page. The Amis instance is used to generate the actual page components according to the configuration information.

[0097] S107: Cache the target page component into the page cache plug-in, and render the target page component.

[0098] The terminal generates the React component of the target page using the framework of the current application according to the page configuration information of the application (such as the JSON configuration of Amis). The React component is the page component cached in the tab cache plug-in.

[0099] Specifically, the terminal uses the page path of the target page as the key value, and caches the page components of the target page through the page cache plug-in (react-router-cache-route plug-in), so that when the page needs to be switched later, the cached page components can be obtained through the page cache plug-in.

[0100] It should be noted that the present application is suitable for use in an application environment built with a single-page framework. In this environment, when a page is switched, the page data before the switch will be cleared, and the page needs to be reloaded when switching back to the previous page. The present application adds a page cache plug-in to the single-page framework, so that the terminal can quickly obtain the page components to be displayed based on the page path of the target page in the tab cache list and the index relationship between the page cache plug-in, thereby improving the switching efficiency of multiple pages in a single-page environment by avoiding reloading the loaded pages.

[0101] The above describes in detail how to use the cache system to cache pages in a single-page framework. The following describes in detail how to delete cached data when closing a page. For details, please refer to Figure 2 , the present application embodiment provides an embodiment of a cache page deletion method of a multi-page management method, the embodiment comprising:

[0102] S201, when a page closing instruction is received, obtaining the position of the page path of the page to be closed corresponding to the closing instruction in the tab cache list;

[0103] The page closing instruction is an instruction generated by clicking the tab button. When the instruction is received, it means that a page needs to be closed. After the terminal receives the page closing instruction, the terminal will determine the tab and page to be closed according to the closing instruction. Specifically, because the page to be closed is not necessarily the currently displayed page, the undisplayed page can be closed by operating the tab. Therefore, it is necessary to determine the page to be closed and its page path identifier according to the closing instruction, and determine the page path of the page and the resources stored in the page cache plug-in through the path representation.

[0104] S202: When the path of the page to be closed is at the first position in the tab cache list, the page corresponding to the second path of the page in the tab cache list is determined as the display page.

[0105] The tab cache list stores data for all tabs. The activated tab in the list is the currently displayed page. The sequence of the tab cache list is sorted according to the order in which the pages are loaded. Generally, the first page displayed when the application is opened is ranked first in the sequence of the tab cache list.

[0106] After closing a page, if the page is the currently displayed page, there may be a situation where the display requirement cannot be found after closing. To avoid this situation, after generating a close instruction, the terminal will obtain the page for display from the tab cache list.

[0107] Specifically, if the page path of the page to be closed is not the first in the tab cache list, the terminal will activate the page path of the page corresponding to the previous tab in the tab cache list, so that after the page to be closed is closed, the program displays the page corresponding to the previous tab.

[0108] S203: When the position of the page path to be closed is not the first in the tab cache list, the page corresponding to the previous page path of the page path to be closed is confirmed as the display page.

[0109] When the page path of the page to be closed is not the first in the tab cache list, the terminal will activate the page path of the page corresponding to the next tab in the tab cache list, so that after the page to be closed is closed, the program displays the page corresponding to the next tab.

[0110] S204, removing the path of the page to be closed from the tab cache list;

[0111] The process of closing a page includes: determining the page to be closed, finding the page path of the page to be closed, removing the page path of the page to be closed from the tab cache list, and deleting the object or entry associated with the page path in the page cache plug-in.

[0112] S205, destroying the instance of the page to be closed;

[0113] The single page framework will generate instances based on the page. For example, in the Amis framework, one Amis instance corresponds to one page. When the page is closed, the corresponding Amis instance is identified by the page path identifier and the Amis instance is destroyed.

[0114] In the present application, the instance generated for the page under the single-page framework is related to the corresponding page. That is, when the focus is on confirming the corresponding data of the page to be closed in the tab cache list and the page cache plug-in according to the page path of the page to be closed, the instance corresponding to the page to be closed generated according to the single-page framework will be obtained, and the instance will be destroyed to achieve the purpose of releasing the cache.

[0115] S206: Remove the page component of the page to be closed in the page cache plug-in.

[0116] Removing the page component corresponding to the page to be closed in the page cache plug-in is to ensure that resources related to the page are released, avoid memory leaks, and optimize application performance.

[0117] Specifically, the terminal locates the page component of the to-be-closed page stored in the page cache plug-in through the key value associated with the page path, and then deletes the page component determined by the key value through an API call.

[0118] See also Figure 3 , the present application embodiment provides another embodiment of a multi-page management method, the embodiment comprising:

[0119] S301, creating a routing list and a tab cache list, the routing list is used to store the mapping relationship between the page path and the resource file path, the tab cache list is used to store the page path of the page corresponding to the tab, and the identifier of the page path of the page corresponding to the tab includes a loading state and an activation state;

[0120] S302: Get a target page, where the target page is the page corresponding to the tab that needs to be displayed currently;

[0121] S303: When the page path of the target page does not exist in the tab cache list, add the page path of the target page to the tab cache list;

[0122] S304, marking the identifier of the page path of the target page as activated in the tab cache list;

[0123] S305, obtaining the resource file path of the target page through the routing list according to the page path of the target page;

[0124] S306, initializing an instance of the target page according to the configuration information of the resource file path of the target page, and generating a target page component;

[0125] S307, caching the target page component into the page cache plug-in;

[0126] Steps S301 to S307 in this embodiment are similar to steps S101 to S107 in the aforementioned embodiment, and will not be described in detail here.

[0127] S308, when there is a currently displayed page, ending the activation state of the identifier of the page path of the currently displayed page in the tab cache list;

[0128] In actual use, a navigation page will be generated when the program starts. Therefore, when the program starts, the navigation page has been stored in the tab cache list through the aforementioned process. The page component of the navigation page stored in the page cache plug-in will not be removed when the page is closed.

[0129] Specifically, in the application's state management and tab cache list, a special identifier is set for the navigation page. The special identifier is used so that the page carrying the special identifier will not be removed during a regular shutdown operation. In the page cache plug-in, the navigation page component is set as a persistent component so that the page component of the navigation page will not be automatically removed when the page is closed. The navigation page is activated in the tab cache list when the program is first started.

[0130] In addition, in the usage scenario where the program is not opened for the first time, the current page is the page displayed before the target page is determined. Therefore, the current page has been stored in the tab cache list before the target page is determined and is active in the tab cache list.

[0131] After the terminal confirms the target page to be displayed, the page in the activated state will end the activation state in the tab cache list.

[0132] S309: If the currently displayed page has not finished loading, then after the activation state ends, the loading state of the currently displayed page is maintained until the page cache plug-in generates a page component so that the target page switches to the currently displayed page again, and the currently displayed page is rendered according to the page component in the page cache plug-in.

[0133] When the target page is opened, the currently displayed page will end its activation state. However, if the currently displayed page is not a navigation page at this time, the loading of the currently displayed page is not complete. The incomplete loading of the page will result in the absence of the page components of the current page in the page cache plug-in. Therefore, when the current page is not completely loaded, switch tabs. The currently displayed page corresponding to the unloaded tab will continue to load until the loading is complete. When the loading is complete, the page components of the currently displayed page will be cached in the page cache plug-in, so that when you need to switch back to the currently displayed page, you can directly obtain the page components of the currently displayed page from the page cache plug-in, thereby achieving the purpose of quickly rendering the page that was not completely loaded when switching tabs.

[0134] S310, hiding the page component of the currently displayed page through the page cache plug-in, and rendering the target page component;

[0135] After determining the target display page, the current display page will end the activation state, and after the target page is stored in the tab cache list and activated, the terminal will find the file resource path corresponding to the target display page according to the page path and routing list of the target page and load the display resources therein, and render the display resources at the same time. The rendered display resources will be organized into page components by the terminal and cached in the page cache plug-in.

[0136] The hidden page components of the currently displayed page will remain in the page cache plug-in until the page is closed.

[0137] S311, when the target page path exists in the tab cache list, activating the identifier of the target page path;

[0138] When the target page already exists in the tab cache list, the terminal will hide the page components of the current page through the page cache plug-in and take out the page components of the target page from the cache of the page cache plug-in and complete the rendering.

[0139] S312. Render the target page component through the page cache plug-in.

[0140] If the page path of the target page exists in the tab cache list, it means that the page components of the corresponding target page can be obtained from the page cache plug-in through the path of the target page. Therefore, the terminal can directly obtain the page components of the target page from the page cache plug-in for rendering and display, thereby achieving the purpose of quickly rendering the target page.

[0141] The multi-page management method in the embodiment of the present application is described in detail above, and the multi-page management system and device will be described in detail below.

[0142] See also Figure 4 The present application provides an embodiment of a multi-page management system, which includes:

[0143] The creation unit 401 is used to create a routing list and a tab cache list, the routing list is used to store the mapping relationship between the page path and the resource file path, the tab cache list is used to store the page path of the page corresponding to the tab, and the identification of the page path of the page corresponding to the tab includes a loading state and an activation state;

[0144] The first acquisition unit 402 is used to acquire a target page, where the target page is a page corresponding to the tab currently to be displayed;

[0145] An adding unit 403, configured to add the page path of the target page to the page cache list when the page path of the target page does not exist in the page cache list;

[0146] A marking unit 404 is used to mark the identifier of the page path of the target page as being in an activated state in the page tab cache list;

[0147] A second acquisition unit 406 is used to acquire the resource file path of the target page through the routing list according to the page path of the target page;

[0148] Initialization unit 407, used to initialize the instance of the target page according to the configuration information of the resource file path of the target page, and generate the target page component;

[0149] The first rendering unit 408 is used to cache the target page component into the page cache plug-in and render the target page component.

[0150] In this embodiment, the functions of each unit are the same as those described above. Figure 1 The steps in the illustrated embodiments correspond to each other and will not be described again here.

[0151] See also Figure 5, the present application embodiment provides another embodiment of a multi-page management system, the embodiment comprising:

[0152] The creation unit 501 is used to create a routing list and a tab cache list, the routing list is used to store the mapping relationship between the page path and the resource file path, the tab cache list is used to store the page path of the page corresponding to the tab, and the identifier of the page path of the page corresponding to the tab includes a loading state and an activation state;

[0153] The first acquisition unit 502 is used to acquire a target page, where the target page is a page corresponding to the tab currently to be displayed;

[0154] An adding unit 503 is used to add the page path of the target page to the page cache list when the page path of the target page does not exist in the page cache list;

[0155] A marking unit 504, used to mark the identifier of the page path of the target page as activated in the page tab cache list;

[0156] The second acquisition unit 505 is used to acquire the resource file path of the target page through the routing list according to the page path of the target page;

[0157] Initialization unit 506, used to initialize the instance of the target page according to the configuration information of the resource file path of the target page, and generate the target page component;

[0158] The first rendering unit 507 is used to cache the target page component into the page cache plug-in and render the target page component.

[0159] Ending unit 508, used to end the activation state of the identifier of the page path of the currently displayed page in the tab cache list when there is a currently displayed page

[0160] The maintaining unit 509 is used to maintain the loading state of the currently displayed page after the activation state ends if the currently displayed page has not been loaded, until the page cache plug-in generates a page component so that the target page switches to the currently displayed page again, and the currently displayed page is rendered according to the page component in the page cache plug-in.

[0161] The second rendering unit 510 is used to hide the page component of the currently displayed page through the page cache plug-in and render the target page component;

[0162] An activation unit 511 is used to activate the identifier of the target page path when the target page path exists in the tab cache list;

[0163] The third rendering unit 512 is used to render the target page component through the page cache plug-in.

[0164] The multi-page management system also includes:

[0165] The third acquisition unit 513 is used to acquire the position of the to-be-closed page path of the to-be-closed page corresponding to the to-be-closed page instruction in the tab cache list when receiving the to-be-closed page instruction;

[0166] The first determining unit 514 is configured to determine the page corresponding to the second page path in the tab cache list as the display page when the page path to be closed is at the first position in the tab cache list.

[0167] The second determining unit 515 is configured to determine, when the position of the page path to be closed is not the first in the tab cache list, the page corresponding to the previous page path of the page path to be closed as the display page.

[0168] A first removing unit 516, configured to remove the to-be-closed page path from the tab cache list;

[0169] A destroying unit 517, used to destroy the instance of the page to be closed;

[0170] The second removing unit 518 is used for removing the page component of the page to be closed in the page cache plug-in.

[0171] In this embodiment, the functions of each unit are the same as those described above. Figures 2 to 3 The steps in the illustrated embodiments correspond to each other and will not be described again here.

[0172] See also Figure 6 The present application provides another embodiment of a multi-page management device, including:

[0173] Processor 601, memory 602, input and output unit 603, bus 604;

[0174] The processor 601 is connected to the memory 602, the input and output unit 603 and the bus 604;

[0175] Processor 601 specifically executes Figures 1 to 3 The operations corresponding to the steps in the method are not described in detail here.

[0176] The present application also relates to a computer-readable storage medium on which a program is stored, wherein when the program is run on a computer, the computer is caused to execute any of the above methods.

[0177] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0178] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.

[0179] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0180] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0181] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, read-only memory), random access memory (RAM, random access memory), disk or optical disk, etc. Various media that can store program codes.

Claims

1. A multi-page management method, characterized in that: The method comprises: Create a routing list and a tab cache list, wherein the routing list is used to store the mapping relationship between the page path and the resource file path, and the tab cache list is used to store the page path of the page corresponding to the tab, and the identifier of the page path of the page corresponding to the tab includes a loading state and an activation state; Get the target page, which is the page corresponding to the tab that needs to be displayed currently; When the page path of the target page does not exist in the tab cache list, adding the page path of the target page to the tab cache list; Marking the page path identifier of the target page in the tab cache list as activated; Acquire the resource file path of the target page through the routing list according to the page path of the target page; Initializing an instance of the target page according to the configuration information of the resource file path of the target page, and generating a target page component; The target page component is cached into a page cache plug-in, and the target page component is rendered.

2. The multi-page management method according to claim 1, characterized in that: The method further comprises: When a page closing instruction is received, the path of the page to be closed corresponding to the closing instruction is obtained at the location of the tab cache list; When the to-be-closed page path is at the first position in the tab cache list, the page corresponding to the second page path in the tab cache list is determined as the display page.

3. The multi-page management method according to claim 2, characterized in that: The method further comprises: obtaining the path of the page to be closed corresponding to the close instruction after the position of the tab cache list; When the position of the to-be-closed page path in the tab cache list is not the first, the page corresponding to the previous page path of the to-be-closed page path is confirmed as the display page.

4. The multi-page management method according to claim 3, characterized in that: After confirming the page corresponding to the previous page path of the page path to be closed as the display page, the method further includes: Remove the to-be-closed page path from the tab cache list; Destroy the instance of the page to be closed; Remove the page component of the page to be closed in the page cache plug-in.

5. The multi-page management method according to claim 1, characterized in that: Before rendering the target page component, the method further includes: When there is a currently displayed page, ending the activation state of the identifier of the page path of the currently displayed page in the tab cache list; The page components of the currently displayed page are hidden by the page cache plug-in.

6. The multi-page management method according to claim 5, characterized in that: After the identification of the page path of the currently displayed page is terminated and activated in the tab cache list, the method further includes: If the currently displayed page has not completed loading, the loading state of the currently displayed page is maintained after the activation state ends until a page component is generated in the page cache plug-in so that the target page is switched to the currently displayed page again, and the currently displayed page is rendered according to the page component in the page cache plug-in.

7. The multi-page management method according to any one of claims 1 to 6, characterized in that: After obtaining the target page, the method further includes: When the target page path exists in the tab cache list, activating the identifier of the target page path; The target page component is rendered through the page cache plug-in.

8. A multi-page management system, characterized in that: The multi-page management system comprises: A creation unit, used to create a routing list and a tab cache list, wherein the routing list is used to store a mapping relationship between a page path and a resource file path, and the tab cache list is used to store a page path of a page corresponding to a tab, wherein the identifier of the page path of the page corresponding to the tab includes a loading state and an activation state; A first acquisition unit is used to acquire a target page, where the target page is a page corresponding to a tab that needs to be displayed currently; an adding unit, configured to add the page path of the target page to the page cache list when the page path of the target page does not exist in the page cache list; A marking unit, used to mark the identifier of the page path of the target page as an activated state in the tab cache list; A second acquisition unit, configured to acquire a resource file path of the target page through the routing list according to the page path of the target page; An initialization unit, used to initialize the instance of the target page according to the configuration information of the resource file path of the target page, and generate a target page component; The first rendering unit is used to cache the target page component into a page cache plug-in and render the target page component.

9. A multi-page management device, characterized in that: The multi-page management device comprises: Processor, memory, input-output unit, and bus; The processor is connected to the memory, the input and output unit, and the bus; The memory stores a program, and the processor calls the program to execute the method according to any one of claims 1 to 7.

10. A computer-readable storage medium having a program stored thereon, wherein the program, when executed on a computer, performs the method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • SPA multi-tab management method based on VUE

    CN112685663A

  • Vue-based multi-tab instance caching method

    CN113900628A

  • Label page state management method and device, electronic equipment and storage medium

    CN115422483A

  • Caching method and device for multiple pages of dynamic routing

    CN117579549A