Page display method and device, electronic equipment and storage medium
By reusing webpage container instances and updating global page navigation information, the problems of high memory usage and blank screen caused by frequent loading of H5 pages are solved, achieving memory saving and improved loading speed.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- BAIDU ONLINE NETWORK TECH (BEIJIBG) CO LTD
- Filing Date
- 2026-03-04
- Publication Date
- 2026-06-30
AI Technical Summary
When multiple H5 pages are opened frequently, existing technologies result in high memory usage, triggering the operating system's memory reclamation mechanism and causing frequent white screen phenomena.
By reusing instances in the web page container to load new web pages, updating global page navigation information using the web page's identifier and loading history, and injecting it into the web page container's runtime environment, memory overhead is reduced and precise rollback is achieved.
It reduced peak memory usage by 30% to 50%, improved webpage loading speed by 20% to 45%, and reduced the probability of white screens by more than 60%.
Smart Images

Figure CN122309871A_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of computer technology, and more particularly to the field of page processing technology, specifically to page display methods, apparatus, electronic devices, and storage media. Background Technology
[0002] H5 pages are web pages developed based on the Hypertext Markup Language 5 standard and are widely used in mobile applications.
[0003] When an application frequently opens multiple H5 pages, it can easily consume a high amount of memory in a short period of time, triggering the operating system's memory reclamation mechanism and causing a white screen. Summary of the Invention
[0004] This disclosure provides a page display method, apparatus, electronic device, and storage medium.
[0005] According to one aspect of this disclosure, a page display method is provided, comprising: responding to a trigger operation of jumping from a first webpage to a second webpage, invoking an instance in a webpage container already created for the first webpage to load the second webpage, and generating an identifier and loading record for the second webpage; updating global page navigation information using the identifier and loading record of the second webpage; wherein the global page navigation information indicates the jump order among multiple historical pages; the multiple historical pages include historical webpages loaded by the invoked instance, and native pages directly rendered by the operating system before the creation of the webpage container; and injecting the updated global page navigation information into the runtime environment of the webpage container, so as to jump from the second webpage to any one of the multiple historical pages based on the global page navigation information.
[0006] According to another aspect of this disclosure, a page display device is provided, including: a loading module, an updating module, and an injection module.
[0007] The loading module is used to respond to the trigger operation of jumping from the first webpage to the second webpage, call the instance in the webpage container that has been created for the first webpage to load the second webpage, and generate the identifier and loading record of the second webpage.
[0008] The update module is used to update the global page navigation information using the identifier and loading record of the second webpage; wherein, the global page navigation information indicates the jump order between multiple historical pages; the multiple historical pages include historical webpages loaded by the calling instance, and native pages rendered directly by the operating system before the webpage container is created.
[0009] The injection module is used to inject the updated global page navigation information into the runtime environment of the web page container, so that the user can jump from the second web page to any of the multiple historical pages based on the global page navigation information.
[0010] According to another aspect of this disclosure, an electronic device is provided, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform the method described above.
[0011] According to another aspect of this disclosure, a non-transitory computer-readable storage medium is provided storing computer instructions, wherein the computer instructions are used to cause the computer to perform the methods described above.
[0012] According to another aspect of this disclosure, a computer program product is provided, including a computer program that, when executed by a processor, implements the method described above.
[0013] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of this disclosure, nor is it intended to limit the scope of this disclosure. Other features of this disclosure will become readily apparent from the following description. Attached Figure Description
[0014] The accompanying drawings are provided to better understand this solution and do not constitute a limitation of this disclosure. Wherein:
[0015] Figure 1 The illustration shows an application scenario diagram of the page display method and apparatus that can be applied according to embodiments of the present disclosure;
[0016] Figure 2 A flowchart illustrating a page display method according to an embodiment of the present disclosure is shown schematically;
[0017] Figure 3 The diagram illustrates a logic block diagram of determining whether to reuse an instance in a created web page container based on route navigation during page navigation, according to an embodiment of the present disclosure.
[0018] Figure 4 This diagram illustrates global page navigation information according to an embodiment of the present disclosure.
[0019] Figure 5 This illustration schematically shows a diagram of binding a webpage identifier as an extended attribute to a loading record according to an embodiment of the present disclosure;
[0020] Figure 6 This illustration schematically depicts a closing operation performed on any historical webpage according to an embodiment of the present disclosure;
[0021] Figure 7This illustration schematically shows a network parameter transmission diagram between web pages during the closing process according to an embodiment of the present disclosure;
[0022] Figure 8 This illustration schematically shows a diagram of performing a close operation on any historical webpage according to another embodiment of this disclosure;
[0023] Figure 9 This illustration schematically shows a network parameter transmission diagram between web pages during page loading according to an embodiment of the present disclosure;
[0024] Figure 10 The diagram illustrates a logic block diagram for page navigation based on global page navigation information according to an embodiment of the present disclosure.
[0025] Figure 11 A block diagram of a page display device according to an embodiment of the present disclosure is schematically shown; and
[0026] Figure 12 A block diagram of an electronic device suitable for implementing a page display method according to an embodiment of the present disclosure is shown schematically. Detailed Implementation
[0027] The exemplary embodiments of this disclosure are described below with reference to the accompanying drawings, including various details of the embodiments to aid understanding, and 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 this disclosure. Similarly, for clarity and brevity, descriptions of well-known functions and structures are omitted in the following description.
[0028] H5 pages are web pages developed based on the Hypertext Markup Language version 5 standard, while native pages are developed based on the operating system's technology stack. Therefore, loading an H5 page requires the use of a WebView component embedded in the application; a WebView instance must be created to load the H5 page. In the relevant examples, a separate WebView instance needs to be created for each H5 page, leading to a rapid accumulation of memory overhead in a short period. This increases the application's memory pressure and can easily trigger the operating system's memory reclamation mechanism, destroying part of the WebView kernel and related resources. Consequently, when the user triggers a page back operation, a new WebView instance needs to be created and the web page reloaded, resulting in a blank screen.
[0029] In view of this, the present disclosure provides a page display method that, in response to a trigger operation of jumping from a first webpage to a second webpage, calls an instance in a webpage container already created for the first webpage to load the second webpage. In the case of consecutive jumps to multiple webpages, new webpages are loaded by reusing instances in the webpage container, saving memory overhead. Simultaneously, during webpage loading, the global page navigation information used to record the jump order of multiple historical pages is updated in real time using the identifier and loading record of the second webpage, and the updated global page navigation information is injected into the runtime environment of the webpage container. This allows the second webpage to perceive the global webpage container and page jump status in real time. Since the reduction in memory overhead eliminates the need to trigger the operating system's memory reclamation mechanism, it achieves accurate rollback from the current webpage to any historical page while reducing the probability of a blank screen.
[0030] Figure 1 The illustration shows an application scenario diagram of the page display method and apparatus that can be applied according to embodiments of the present disclosure.
[0031] It is important to note that Figure 1 The examples shown are merely illustrative of application scenarios where embodiments of this disclosure can be applied, to help those skilled in the art understand the technical content of this disclosure, but do not imply that embodiments of this disclosure cannot be used in other devices, systems, environments, or scenarios. For example, in another embodiment, an exemplary system architecture for which the page display method and apparatus can be applied may include a terminal device, but the terminal device may implement the page display method and apparatus provided by embodiments of this disclosure without interacting with a server.
[0032] like Figure 1 As shown, in application scenario 100, when a user opens the application, the application's homepage 110 is displayed. The content displayed on this homepage can be configured according to the actual needs of the application, and this disclosure does not impose specific limitations on it. This homepage can be a native page or an H5 page.
[0033] When a user triggers an action that redirects them from the homepage 110 to the details page 120, such as clicking "Enter Details," they will be redirected to details page 120. Conversely, when a user triggers an action that redirects them from details page 120 back to the homepage, such as clicking "Return to Homepage," they will be redirected to the homepage 110.
[0034] During page redirection, different operations can be triggered depending on the page type. For example, when the homepage is a native page and the details page is an H5 page, the webpage container can be initialized first, and the WebView component can be called to create a WebView instance to load details page 120. When both the homepage and details page are H5 pages, the instance already created for homepage 110 can be called to load details page 120.
[0035] The page display method provided in this disclosure can be executed by an application developed based on an operating system (Native client, also known as native client).
[0036] Since multiple H5 pages share a single webpage container, page back operations can be performed based on global page navigation information. This allows users to return to any historical page as needed, even when multiple H5 pages are frequently loaded. This historical page can be either an H5 page or a native page.
[0037] In the technical solutions disclosed herein, the collection, storage, use, processing, transmission, provision, disclosure, and application of any type of information, such as user personal information, comply with the provisions of relevant laws and regulations, necessary confidentiality measures have been taken, and they do not violate public order and good morals.
[0038] In the technical solution disclosed herein, the user's authorization or consent is obtained before acquiring or collecting the user's personal information.
[0039] Figure 2 A flowchart illustrating a page display method according to an embodiment of the present disclosure is shown schematically.
[0040] like Figure 2 As shown, the page display method 200 may include operations S210 to S230.
[0041] In operation S210, in response to the trigger operation of jumping from the first webpage to the second webpage, the instance in the webpage container already created for the first webpage is invoked to load the second webpage, and the identifier and loading record of the second webpage are generated.
[0042] In operation S220, the global page navigation information is updated using the identifier and loading record of the second webpage.
[0043] In operation S230, the updated global page navigation information is injected into the runtime environment of the web page container so that, based on the global page navigation information, one can jump from the second web page to any of the multiple historical pages.
[0044] The first and second web pages can be H5 pages, and the web page container can be a WebView container, which is the space used to hold WebView instances. This space can be a physical space, such as the layout controls of an application, or a logical space, such as a browser tab or the rendering layer of an application.
[0045] An instance within the web container already created for the first webpage can be a runnable object created by calling the Webview component when the first webpage is loaded.
[0046] In order to reduce the memory overhead of the Webview component, this embodiment of the disclosure reuses an instance of the webpage container already created for the first webpage to load the second webpage.
[0047] In single-page container mode, the number of WebView instances within the page container does not increase. To achieve precise management of navigation information for multiple page types in a hybrid development scenario combining native and H5 pages, this disclosure provides global page navigation information. The global page navigation information indicates the jump order between multiple historical pages, including historical pages loaded by the calling instance and native pages directly rendered by the operating system before the page container is created. Historical pages can be H5 pages.
[0048] Because the already created WebView instance can be reused when loading the second webpage, the frequency of WebView instance creation is reduced. Compared with the technical solutions in related examples that frequently create WebView instances, the peak memory usage is reduced by 30% to 50%, and the webpage loading speed is improved by 20% to 45%.
[0049] Due to the reduction in memory overhead, the operating system's memory reclamation mechanism is less likely to be triggered. Compared with related governance methods, the probability of a white screen during page rollback operations is reduced by more than 60%.
[0050] For native pages, there is no need to initialize the webpage container, and each native page can have an independent page identifier. For H5 pages, multiple H5 pages that are navigated to consecutively share the same webpage container. In order to accurately identify each H5 page in the same webpage container, a multi-level identifier can be used to generate a globally unique identifier for each H5 page.
[0051] In some embodiments, the identifier of the second webpage may include a container identifier and a webpage identifier. For example, the container identifier may be represented as Page Id x, and the webpage identifier may be represented as subPage Id y. For instance, the container identifier of the webpage container shared by the first and second webpages may be Page Id C, the identifier of the first webpage may be represented as (Page Id C, subPage Id 1), and the identifier of the second webpage may be represented as (Page Id C, subPage Id 2). The "x" in the container identifier may indicate the jump order between the webpage container and the native page in the global page navigation information. The "y" in the webpage identifier indicates the jump order between webpages in the local page navigation information within the webpage container Page Id C.
[0052] The loading record can be generated based on the Back Forward ListItem mechanism during the webpage loading process of the Webview component. This loading record can include at least the address and webpage name used to load the webpage.
[0053] By utilizing the identifier and loading history of the second webpage to update the global page navigation information, real-time dynamic updates of the global page navigation information are achieved.
[0054] Then, the updated global page navigation information is injected into the runtime environment of the web page container. For example, the global page navigation information can be mounted as a global communication object to the WebView's JS (JavaScript) context runtime environment through the JSBridge mechanism. The JS context runtime environment can refer to the "environment container" when JavaScript code is executed. It contains all the information required for code execution, such as variables, functions, scope, this binding, built-in objects, etc.
[0055] By injecting updated global page navigation information, complex cross-container communication between H5 pages is simplified. This global page navigation information is mounted as a global communication object into the runtime environment of the webpage container, enabling each webpage within the container to perceive the container's state and the global page navigation state in real time. This allows users to navigate from a second webpage to any of several historical pages based on the global page navigation information. This "any" historical page can be either an H5 page or a native page.
[0056] This disclosure provides a page display method. In response to a trigger operation that navigates from a first webpage to a second webpage, it calls an instance of the webpage container already created for the first webpage to load the second webpage. When navigating between multiple webpages consecutively, it saves memory by reusing instances in the webpage container to load new webpages. Simultaneously, during webpage loading, the global page navigation information used to record the navigation order of multiple historical pages is updated in real time using the identifier and loading record of the second webpage. This updated global page navigation information is then injected into the runtime environment of the webpage container, enabling the second webpage to perceive the global webpage container and page navigation status in real time. Because the reduced memory overhead eliminates the need to trigger the operating system's memory reclamation mechanism, it achieves accurate rollback from the current webpage to any historical page while reducing the probability of a blank screen.
[0057] Since the runtime environment of the web page container is an independent environment for running H5 code, the native side cannot access it directly. Information must be injected into the runtime environment of the web page container through the API interface provided by the Webview component.
[0058] Therefore, injecting the updated global page navigation information into the runtime environment of the web page container in this embodiment of the disclosure may include the following operations: assembling the updated global page navigation information into information to be injected in a predetermined format; and mounting the information to be injected to the runtime environment through the target interface provided by the instance.
[0059] For example, the predefined format can be JSON. The updated global page navigation information can be encapsulated into JSON format and injected. Then, the JavaScript code is executed through the API provided by the WebView component to mount the injected information onto the window object. This allows the WebView container engine to obtain the updated global page navigation information by accessing methods on the window object. This enables the WebView container engine to have real-time awareness of the global navigation state.
[0060] In a hybrid development scenario combining native and H5 pages, page navigation can occur between pages of different types, such as from a native page to an H5 page. It can also occur between pages of the same type, such as from one H5 page to another. H5 pages can be in a single-container or multi-container configuration.
[0061] The following is combined Figure 3 This document provides a detailed example of using route navigation to determine whether to reuse instances of an already created webpage container to load webpages in a hybrid development scenario.
[0062] Figure 3 The illustration schematically shows a logic block diagram of determining whether to reuse an instance in a created web page container based on route navigation during page navigation, according to an embodiment of the present disclosure.
[0063] like Figure 3 As shown, in embodiment 300, firstly, operation S310 is executed, which uses the JS bridge mechanism to call the routing protocol for route resolution, obtaining a page identifier to identify the current page type. The current page indicates the starting page for navigation. Then, operation S320 is executed to determine whether the current page is an H5 page. If it is, operation S340 is executed; otherwise, operation S330 is executed to load the native page.
[0064] During route resolution, a pattern identifier is also obtained to determine whether the current page is in single-container mode. Next, operation S340 is executed to determine if the current H5 page is a single-container instance. If so, operation S350 is executed to load the target page using the instance in the already created webpage container. If not, operation S360 is executed to initialize a new webpage container, create a WebView instance, and load the target page.
[0065] To enable precise navigation between different types of pages, this embodiment configures global page navigation information. The global page navigation information includes nested parent and child arrays. The parent array includes the container identifier of the webpage container and the page identifier of the native page. The child array associated with the container identifier includes the identifier of the first webpage.
[0066] According to embodiments of this disclosure, updating global page navigation information using the identifier and loading record of a second webpage may include the following operations: determining a container identifier from the global page navigation information; extracting the address of the second webpage from the loading record; and writing the identifier and address of the second webpage into a child array in the order of jumps to obtain the updated global page navigation information.
[0067] Figure 4 A schematic diagram illustrating global page navigation information according to an embodiment of the present disclosure is shown.
[0068] like Figure 4 As shown, the arrows indicate the direction of page navigation. For example, when navigating from native page A to H5 page P1, the WebView container W1 needs to be initialized and an instance created before H5 page P1 can be loaded. When navigating from H5 page P1 to H5 page P2, the already created instance of the WebView container W1 can be used to load H5 page P2 directly.
[0069] When loading a native page, a globally unique identifier for that native page is generated during the native page creation phase. For example, the identifier for native page A is Page Id A.
[0070] When navigating from native page A to H5 page P1, the WebView container W1 is initialized, and a container identifier for W1 is generated. This container identifier is at the same level as the page identifier of the native page and is generated based on the page identifier of the native page according to the navigation order. For example, the container identifier of WebView container W1 is Page Id B.
[0071] To distinguish multiple H5 pages within the same Webview container W1, a secondary identifier for H5 page P1 is generated when loading H5 page P1, for example: subPage Id 1. Therefore, the identifier for H5 page P1 is (Page Id B, subPage Id 1), and so on, the identifier for H5 page P2 is (Page Id C, subPage Id 2).
[0072] When navigating from H5 page P2 to native page C, the native page loading operation is executed, and a globally unique identifier for native page C is generated.
[0073] When navigating from the native page to the H5 page P3, the existing instance in the WebView container W1 can be reused to load the H5 page P3, or the WebView container W2 can be reinitialized to create a new WebView instance to load the H5 page P3. Although this incurs some memory overhead, it simplifies the data structure of the global page navigation information and enables a smooth transition between pages during page navigation.
[0074] The operation performed when navigating from H5 page P3 to H5 page P4 is the same as the operation performed when navigating from H5 page P1 to H5 page P2 as described above, and will not be repeated here.
[0075] The identifier for H5 page P3 can be (Page Id D, subPage Id 1), and the identifier for H5 page P4 can be (Page Id D, subPage Id 2). The identifier for native page E can be Page Id E.
[0076] For example, the first webpage could be H5 page P1, and the second webpage could be H5 page P2. When navigating from the first webpage to the second webpage, the global navigation page information already contains the identifier of the original page A and the information of the first webpage. The information of the first webpage can include its identifier and its address.
[0077] The identifier of the native page A can be located in the parent array. The identifier of the Webview container W1, which is shared by the first and second web pages, can be arranged in the parent array along with the identifier of the native page A, according to the page navigation order. The information of the first web page can be located in the child array associated with the container identifier of the Webview container W1.
[0078] For example, the global page navigation information before the update could be represented as follows:
[0079] {Page Id: Page Id A};
[0080] {Page Id: Page Id B,subPage:[ subPage Id: subPage Id1,urlPath:xxx / yyy]}
[0081] When updating the global page navigation information using the identifier and loading record of the second webpage, the container identifier "Page Id B" can be determined from the global page navigation information. Then, the address of the second webpage can be extracted from the loading record, which can be a URL (Uniform Resource Locator) address. Finally, the identifier and address of the second webpage can be written into the child array according to the jump order to obtain the updated global page navigation information.
[0082] For example, the updated global page navigation information can be represented as follows:
[0083] {Page Id: Page Id A};
[0084] {Page Id:Page Id B,subPage:[(subPageId: subPageId1,urlPath:xxx / yyy);(subPage Id: subPage Id2,urlPath:zzz / mmm)]}.
[0085] By constructing global page navigation information using nested ordered arrays, a complete bidirectional navigation system for native pages and web pages is obtained. This system can clearly and explicitly display the jump order between different types of pages and the shared state of containers, facilitating accurate jumps between different types of pages during reverse page navigation.
[0086] In addition to global page navigation information, the Back Forward List navigation information of WebView can be used to accurately record the navigation order between multiple H5 pages in the same container. To achieve precise navigation between different types of pages, updating the global page navigation information using the identifier and loading record of the second webpage can also include the following operations: encapsulating the identifier of the second webpage as an extended attribute with the loading record, and then updating the local page navigation information of the webpage container, so that based on the internal page navigation information, one can jump from the second webpage to any of the multiple historical webpages.
[0087] Figure 5 The illustration shows a schematic diagram of binding a web page identifier as an extended attribute to a loading record according to an embodiment of the present disclosure.
[0088] Partial page navigation information indicates the navigation order among multiple historical web pages loaded by the calling instance. For example, partial page navigation information could be... Figure 5 The Back Forward List navigation information shown in the Webview, that is, the history navigation information, records the address (URL) and title (Title) of each H5 page.
[0089] After being redirected from H5 page P1 to H5 page P3, the page then redirects back to H5 page P1.
[0090] The Back Forward List navigation information in the relevant examples only records the address (URL) and title of each H5 page. When a user wants to jump from H5 page P4 to H5 page P1, it is difficult to determine which H5 page P1 to jump to. Because parameter transmission between different web pages may be involved during the page jump process, the content of two H5 pages P1 with the same URL address may be different.
[0091] For example, in an image editing scenario, H5 page P1, identified as subPage Id1, displays the unedited image. After editing by H5 pages P2 and P3, H5 pages P2 and P3 will transfer the newly added parameters during the editing process to H5 page P1, identified as subPage Id4. At this point, H5 page P1, identified as subPage Id4, displays the edited image.
[0092] Therefore, the identifier of the second webpage is encapsulated with the loading record as an extended attribute, and the local page navigation information of the webpage container is updated so as to use the identifier of the second webpage to distinguish each H5 page in the Back Forward List navigation information.
[0093] For example, the secondary identifier of H5 page P1 at the starting point of the jump can be subPage Id1, while the secondary identifier of H5 page P1 located in the middle of the jump path can be subPage Id4.
[0094] Binding the identifier of the second webpage as an extended attribute to the loading record solves the problem of interference with accurate page back-to-back when the same address identifier interferes with the accurate back-to-back of the page in scenarios where the same Webview container jumps to the same H5 page at different times.
[0095] According to embodiments of this disclosure, the method may further include the following operations: in response to a closing operation on any webpage in the history of webpages, obtaining partial page navigation information; determining the page jump direction based on the partial page navigation information; and jumping from any webpage to the target page according to the page jump direction.
[0096] Figure 6 The illustration shows a schematic diagram of performing a close operation on any historical webpage according to an embodiment of the present disclosure.
[0097] like Figure 6As shown, the historical webpages can be three H5 pages within the Webview container, and any one of these webpages can be H5 page P2.
[0098] In response to a close operation on H5 page P2, the page navigation direction can be determined based on the BackForwardList navigation information. The page navigation direction can indicate a jump from any current historical webpage to a historical webpage within the container, or a jump to a native page outside the container.
[0099] In some embodiments, the page navigation direction can be determined based on the number of loaded records in the BackForwardList navigation information. For example, when the number of loaded records is greater than 0, the page back method can be called to navigate to an already loaded page adjacent to any current historical page. When the number of loaded records is less than or equal to 0, the page container containing any current historical page can be directly destroyed, and the page can navigate to the native page.
[0100] In some embodiments, determining the page jump direction based on local page navigation information may include the following operation: in response to determining that the local page navigation information indicates that a page has been loaded before any page, determining the page jump direction to jump from any page to a target page among the loaded pages that is adjacent to any page.
[0101] like Figure 6 As shown, when a close operation is performed on H5 page P2, it can be determined from the BackForwardList navigation information that H5 page P1 was loaded before H5 page P2. Therefore, it can be determined that the page jump direction is from H5 page P2 to H5 page P1.
[0102] In some embodiments, when the local page navigation information indicates that multiple web pages have been loaded before any web page, the page jump direction can be determined to jump from any web page to a target web page that is adjacent to any web page among the multiple web pages, thereby realizing step-by-step back between multiple H5 pages in the same container.
[0103] Since multiple H5 pages reside within the same container, the complexity of cross-container communication between pages is reduced compared to related examples.
[0104] Due to the lack of lifecycle management for H5 pages, the Webview container's engine (kernel) cannot perceive the real-time status of each H5 page within the container. As a result, the Webview container's engine cannot promptly trigger business operations in different states of H5 pages during the switching process.
[0105] For example, when an H5 page is interactive, the triggered business operation could be to play a video clip on the H5 page. When the H5 page is not interactive, the triggered business operation could be to pause the playback of the video clip on the H5 page.
[0106] In view of this, the embodiments of this disclosure define two hook functions in the Webview container for lifecycle management: the page display callback method—on Page Appear(subPage Id) and the page disappearance callback method—on PageDisappear(subPage Id). These two methods notify the Webview container engine of the real-time state of the H5 page through the JS bridge mechanism, so that the Webview container engine can promptly trigger business operations in different states of the H5 page.
[0107] When the H5 page P1 is loaded for the first time, the Webview container engine is notified that the H5 page P1 has entered an interactive state by calling window.onResume in the page display callback method.
[0108] When navigating between multiple H5 pages within the same WebView container, you can combine page display callback methods and page disappearance callback methods to achieve page navigation.
[0109] In some embodiments, the target page includes a target webpage. Navigation from any webpage to the target page, according to the page navigation direction, may include the following operations: Notifying the webpage container engine that any webpage is in a non-interactive state by calling a page disappearance callback method, so that the webpage container engine triggers operations when any webpage is in a non-interactive state. Notifying the webpage container engine that the target webpage is in an interactive state by calling a page display callback method, so that the webpage container engine triggers operations when the target webpage is in an interactive state.
[0110] like Figure 6 As shown, when navigating from H5 page P2 to H5 page P1, the WebView container engine can be notified by calling window.onPause in the page disappearance callback method that H5 page P2 has entered an uninteractive state. That is, the application used to display the H5 page is switched from the front end to the back end, so that the WebView container engine can trigger the operation when H5 page P2 is in an uninteractive state, such as stopping video playback.
[0111] Then, by calling window.onResume in the page display callback method, the Webview container engine is notified that the H5 page P1 has entered an interactive state. That is, the application used to display the H5 page is switched from the backend to the frontend, so that the Webview container engine can trigger the operation when the H5 page P1 is in an interactive state, such as performing a data refresh operation.
[0112] By defining hook functions in a single webpage container to manage the webpage lifecycle, the same lifecycle management mechanism as native pages is provided for webpages. This unified lifecycle time facilitates the implementation of event tracking, statistics, and interactive control in hybrid development scenarios, enabling the engine in the webpage container to accurately perceive the webpage state as in the native version and promptly trigger operations associated with different webpage states.
[0113] In hybrid development scenarios of H5 pages and native pages, in order to solve the problems of limited length of web page parameters and data security when transmitting them between different pages based on addresses, this disclosure embodiment achieves a smooth transition of parameter transmission between H5 pages by associating web page identifiers with web page parameters and storing them on the native side.
[0114] According to embodiments of this disclosure, the method may further include the following operation: in response to a close operation on any webpage in the history of webpages, storing the identifier of any webpage and a first webpage parameter in a cache. The first webpage parameter represents the webpage parameters of any webpage required for rendering the target webpage.
[0115] For example, in video or image editing scenarios, any webpage can be an image editing page, and the target webpage can be an image display page. Therefore, when closing the image editing page, the webpage parameters added during the editing process can be used as the first webpage parameter, associated with the identifier of any webpage, and stored in the cache. This way, when closing any webpage and returning to the target webpage, the target webpage can read the first webpage parameter from the cache and render the page used to display the image editing results.
[0116] In some embodiments, the process of jumping from any webpage to a target page according to the page navigation direction may further include the following operations: querying the identifier of any webpage from the global page navigation information; reading the first webpage parameters from the cache; and rendering the target page based on the first webpage parameters when jumping from any webpage to the target webpage according to the page navigation direction.
[0117] For example, the subPage ID can be retrieved from the global page navigation information, and then the first page parameter can be read from the cache based on the mapping relationship between the identifier of any webpage and the first page parameter. When navigating from any webpage to the target webpage, the target page is rendered based on the first page parameter.
[0118] Compared with the method of transmitting parameters between web pages based on URL, the embodiments of this disclosure reduce the communication coupling between different web pages. Even if the web page that generates the web page parameters has been destroyed or reloaded, any web page can read the web page parameters to be rendered from the cache based on the mapping relationship between the web page identifier and the web page parameters, thus realizing a smooth transition of parameter transmission during page jump.
[0119] The above method of transmitting web page parameters is applicable not only to navigation between adjacent pages, but also to navigation between any two pages within the same container.
[0120] In this embodiment of the disclosure, parameters in the page fallback method can be defined based on the JS bridge mechanism, for example: close Page(Page Id x, subpage Id y). This enables navigation and fallback between any two pages within the same container.
[0121] The following is combined Figure 7 This section provides a detailed explanation of the webpage parameter transfer process during the navigation and fallback between any two pages within the same container.
[0122] Figure 7 The illustration shows a schematic diagram of network parameter transmission between web pages during the closing process according to an embodiment of the present disclosure.
[0123] like Figure 7 As shown, when navigating from H5 page P3 to H5 page P1, the web page parameters that page P3 needs to transmit to page P1 are first determined, and subPageId3 is associated with these parameters and stored in the native cache. Simultaneously, the web page parameters that page P2 needs to transmit to page P1 are determined, and subPageId2 is associated with these parameters and stored in the native cache.
[0124] When returning to H5 page P1, the web page parameters that H5 pages P2 and P3 need to transmit to page P1 can be read from the cache based on the web page identifier in order to render the final web page.
[0125] In some embodiments, to release memory in a timely manner, the Webview container can be destroyed and its stored data cleared when navigating back to the first H5 page in the webpage container.
[0126] According to embodiments of this disclosure, determining the page jump direction based on local page navigation information further includes the following operation: in response to determining that the local page navigation information indicates that no page has been loaded before any page, determining that the page jump direction is from any page to the native page adjacent to any page.
[0127] Figure 8 The illustration shows a diagram of performing a close operation on any historical webpage according to another embodiment of the present disclosure.
[0128] like Figure 8 As shown, when a close operation is performed on H5 page P1, it can be determined from the BackForwardList navigation information that no webpage was loaded before H5 page P1. Therefore, it can be determined that the page jump direction is from H5 page P1 to native page A.
[0129] In some embodiments, navigating from any webpage to a target page according to the page navigation direction may include the following operation: navigating from any webpage to the target page by calling a page back method according to the page navigation direction.
[0130] For example, you can call the close Page method to jump from any webpage to the target page. When closing the first H5 page in the webpage container, you can destroy the Webview container to release memory in a timely manner.
[0131] In some embodiments, the `close Page` method can also define an identifier parameter for the page to fall back to. This allows for precise backtracking between any two pages within the same webpage container, as well as backtracking to the native page adjacent to the webpage container. This simplifies the complex backtracking operation between any two pages and further improves the response efficiency of page backtracking operations.
[0132] This tool addresses the handling of cross-page parameter transfer and lifecycle management in H5 pages, applicable not only to page navigation scenarios but also to page loading scenarios.
[0133] The following is combined Figure 9 This section provides a detailed explanation of the network parameter transmission operations between web pages during the page loading process.
[0134] According to embodiments of this disclosure, in response to a triggering operation that redirects from a first webpage to a second webpage, invoking an instance of a webpage container already created for the first webpage to load the second webpage may include the following operations: in response to the triggering operation that redirects from the first webpage to the second webpage, storing the identifier of the first webpage and the second page parameters in a cache; the second page parameters characterize the page parameters of the first webpage required for rendering the second webpage; retrieving the identifier of the first webpage from global page navigation information; reading the second page parameters from the cache; and rendering the second webpage based on the target page parameters when invoking an instance of a webpage container already created for the first webpage to load the second webpage.
[0135] Figure 9This illustration shows a schematic diagram of network parameter transmission between web pages during page loading according to an embodiment of the present disclosure.
[0136] like Figure 9 As shown, when jumping from H5 page P1 to H5 page P2, the web page parameters that page P1 needs to transmit to page P2 are first determined, and subPageId1 is associated with the web page parameters that page P1 needs to transmit to page P2 and stored in the cache of the native side.
[0137] When loading H5 page P2, the web page parameters that page P1 needs to transmit to page P2 can be read from the cache based on the web page identifier in order to render the final web page.
[0138] Compared with the method of transmitting parameters between web pages based on URL, the embodiments of this disclosure reduce the communication coupling between different web pages. Even if the web page that generates the web page parameters has been destroyed or reloaded, any web page can read the web page parameters to be rendered from the cache based on the mapping relationship between the web page identifier and the web page parameters, thus realizing a smooth transition of parameter transmission during page jump.
[0139] In some embodiments, calling an instance in a webpage container already created for the first webpage to load the second webpage based on the target page parameters may further include the following operations: notifying the webpage container engine that the first webpage is in a non-interactive state by calling a page disappearance callback method, so that the webpage container engine triggers operations when the first webpage is in a non-interactive state; and notifying the webpage container engine that the second webpage is in an interactive state by calling a page display callback method, so that the webpage container engine triggers operations when the second webpage is in an interactive state.
[0140] like Figure 9 As shown, when navigating from H5 page P1 to H5 page P2, the WebView container engine is first notified by calling window.onPause in the page disappearance callback method that H5 page P1 has entered an uninteractive state. That is, the application used to display the H5 page is switched from the front end to the back end, so that the WebView container engine can trigger the operation when H5 page P1 is in an uninteractive state, such as stopping data refresh.
[0141] Then, by calling window.onResume in the page display callback method, the Webview container engine is notified that the H5 page P2 has entered an interactive state. That is, the application used to display the H5 page is switched from the backend to the frontend, so that the Webview container engine can trigger the operation when the H5 page P2 is in an interactive state, such as starting or resuming video playback.
[0142] By defining hook functions in a single webpage container to manage the lifecycle of a webpage, the engine in the webpage container can accurately perceive the state of the webpage as in the native environment and trigger operations associated with different webpage states in a timely manner.
[0143] In addition to the step-by-step back navigation between multiple H5 pages within a webpage container based on local page navigation information as described above, this disclosure also allows for cross-level back navigation between multiple H5 pages within a container, as well as cross-container back navigation between H5 pages and native pages, by defining page identifiers in the page back navigation method.
[0144] The following is combined Figure 10 The logical operation of page back based on global page navigation information in the embodiments of this disclosure will be described in detail.
[0145] Figure 10 The diagram illustrates a logic block diagram for page navigation based on global page navigation information according to an embodiment of the present disclosure.
[0146] In some embodiments, the parameters defined for the page back method are as follows: close Page(Page Id x; subPage Id y).
[0147] like Figure 10 As shown, first, operation S1010 is executed to parse the parameters in the page back method. Then, operation S1020 is executed to determine whether Page Id has a value. If not, operation S1040 is executed to directly close the current container.
[0148] If yes, then execute operation S1030 to traverse the global navigation information to determine the container corresponding to the Page Id. Then execute operation S1050 to determine if the current container is a single container instance. If not, execute operation S1040 to directly close the current container. If yes, then execute operation S1060 to check if the subPage Id has a value. If yes, it indicates that an operation from the second webpage to a historical webpage has been triggered. Then execute operation S1070 to traverse the local page navigation information to determine the URL corresponding to the subPageId. Finally, execute operation S1080 to call the page back method to jump to the page specified by the URL. If not, then directly close the current container.
[0149] According to embodiments of this disclosure, the method may further include the following operations: in response to a triggering operation of jumping from a second webpage to a historical webpage, determining the webpage identifier of the historical webpage from global page navigation information; and based on the second address associated with the webpage identifier, jumping from the second webpage to the historical webpage by calling a page back method.
[0150] For example, the webpage identifier can be the specific value of the subPage ID, and the second address can be the URL of the H5 page corresponding to the subPage ID. The Page ID can be retrieved first from the global page navigation information. Then, the webpage container is determined based on the Page ID value. Finally, the URL corresponding to the subPage ID is matched from the local page navigation information of that webpage container, ultimately achieving precise cross-level navigation for the H5 page.
[0151] When the current container is closed, the page can be navigated back to the native page adjacent to the current container in the global page navigation information.
[0152] In some embodiments, the above method may further include the following operations: in response to a triggering operation of jumping from the second webpage to the native page, determining the page identifier of the native page from global page navigation information; and based on the first address associated with the page identifier, jumping from the second webpage to the native page by calling a page back method.
[0153] For example, the page identifier can be a specific reference to the Page Id, and the first address can be the URL of the native page corresponding to the Page Id. The Page Id can be retrieved from the global page navigation information first, and then the webpage container loaded before that Page Id in the global page navigation information can be directly destroyed, instantly redirecting to the native page.
[0154] By defining back parameters for specific pages in the page back method, cross-level back navigation between multiple H5 pages within a container and cross-container back navigation between H5 pages and native pages can be achieved based on global page navigation information.
[0155] Figure 11 A block diagram of a page display device according to an embodiment of the present disclosure is shown schematically.
[0156] like Figure 11 As shown, the page display device 1100 may include a loading module 1110, an update module 1120, and an injection module 1130.
[0157] The loading module 1110 is used to respond to a trigger operation that jumps from the first webpage to the second webpage, call the instance in the webpage container that has been created for the first webpage to load the second webpage, and generate the identifier and loading record of the second webpage.
[0158] The update module 1120 is used to update the global page navigation information using the identifier and loading record of the second webpage; wherein, the global page navigation information indicates the jump order between multiple historical pages; the multiple historical pages include historical webpages loaded by the calling instance, and native pages directly rendered by the operating system before the webpage container is created.
[0159] The injection module 1130 is used to inject the updated global page navigation information into the runtime environment of the web page container so that, based on the global page navigation information, the user can jump from the second web page to any of the multiple historical pages.
[0160] According to embodiments of this disclosure, the global page navigation information includes: a nested parent array and a child array; the parent array includes: a container identifier of the web page container and a page identifier of the native page; the child array associated with the container identifier includes: an identifier of the first web page.
[0161] The update module 1120 may include a determination submodule, an extraction submodule, and a writing submodule.
[0162] The Determine Submodule is used to determine the container identifier from the global page navigation information.
[0163] The extraction submodule is used to extract the address of the second webpage from the loaded record.
[0164] The write submodule is used to write the identifier and address of the second webpage into the child array according to the jump order, so as to obtain the updated global page navigation information.
[0165] According to an embodiment of this disclosure, the update module 1120 may further include: an update submodule, configured to encapsulate the identifier of the second webpage as an extended attribute with the loading record, and update the local page navigation information of the webpage container so as to jump from the second webpage to any one of the multiple historical webpages based on the internal page navigation information; wherein the local page navigation information indicates the jump order among the multiple historical webpages loaded by the calling instance.
[0166] According to embodiments of this disclosure, the page display device 1100 may further include: an acquisition module, a determination module, and a jump module.
[0167] The acquisition module is used to retrieve partial page navigation information in response to closing any page in the history of web pages.
[0168] The determination module is used to determine the page navigation direction based on local page navigation information.
[0169] The redirect module is used to redirect from any webpage to the target page according to the page redirection direction.
[0170] According to embodiments of this disclosure, the determining module is configured to determine the page jump direction as a jump from any webpage to a target webpage adjacent to any webpage in the already loaded webpages, in response to determining that local page navigation information indicates that a webpage has been loaded before any webpage.
[0171] According to embodiments of this disclosure, the target page includes a target webpage; the redirection module may include a first notification submodule and a second notification submodule.
[0172] The first notification submodule is used to notify the web page container engine that any web page is in an uninteractive state by calling the page disappearance callback method, so that the web page container engine can trigger the operation when any web page is in an uninteractive state.
[0173] The second notification submodule is used to notify the web page container engine that the target web page is in an interactive state by calling the page display callback method, so that the web page container engine can trigger the operation when the target web page is in an interactive state.
[0174] According to embodiments of this disclosure, the target page includes a target webpage; the page display device 1100 may further include: a storage module, configured to, in response to a closing operation on any webpage in the history of webpages, associate and store the identifier of any webpage and a first webpage parameter in a cache; the first webpage parameter represents the webpage parameters of any webpage required for rendering the target webpage.
[0175] According to embodiments of this disclosure, the jump module includes: a first query submodule, a first read submodule, and a first rendering submodule.
[0176] The first query submodule is used to retrieve the identifier of any webpage from the global page navigation information.
[0177] The first reading submodule is used to read the first webpage parameters from the cache.
[0178] The first rendering submodule is used to render the target page based on the parameters of the first webpage when the page jumps from any webpage to the target webpage according to the page jump direction.
[0179] According to embodiments of this disclosure, the determining module is configured to determine the page jump direction as a jump from any webpage to the native page adjacent to any webpage in response to determining that local page navigation information indicates that no webpage has been loaded before any webpage.
[0180] According to embodiments of this disclosure, the jump module is used to jump from any webpage to the target page by calling the page back method, according to the page jump direction.
[0181] According to embodiments of this disclosure, the loading module includes a storage submodule, a second query submodule, a second read submodule, and a second loading submodule.
[0182] The storage submodule is used to store the identifier of the first webpage and the second page parameters in the cache in response to a trigger operation that redirects from the first webpage to the second webpage; the second page parameters represent the page parameters of the first webpage required for rendering the second webpage.
[0183] The second query submodule is used to retrieve the identifier of the first webpage from the global page navigation information.
[0184] The second read submodule is used to read the second page parameters from the cache.
[0185] The second loading submodule is used to load the second webpage based on the target page parameters when calling the instance in the webpage container that has been created for the first webpage.
[0186] According to embodiments of this disclosure, the injection module includes an assembly submodule and an injection submodule.
[0187] The assembly submodule is used to assemble the updated global page navigation information into information to be injected in a predefined format.
[0188] The injection submodule is used to mount the information to be injected into the runtime environment through the target interface provided by the instance.
[0189] According to embodiments of this disclosure, the page display device 1100 may further include: a first identifier determination module and a first jump module.
[0190] The first identifier determination module is used to determine the page identifier of the native page from the global page navigation information in response to the trigger operation of jumping from the second webpage to the native page.
[0191] The first redirect module is used to redirect from the second webpage to the native page by calling the page back method based on the first address associated with the page identifier.
[0192] According to embodiments of this disclosure, the page display device 1100 may further include: a second identifier determination module and a second jump module.
[0193] The second identifier determination module is used to determine the webpage identifier of the historical webpage from the global page navigation information in response to the trigger operation of jumping from the second webpage to the historical webpage.
[0194] The second redirect module is used to redirect from the second webpage to the historical webpage by calling the page back method based on the second address associated with the webpage identifier.
[0195] According to embodiments of this disclosure, this disclosure also provides an electronic device, a readable storage medium, and a computer program product.
[0196] According to an embodiment of the present disclosure, an electronic device includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform the methods described above.
[0197] According to embodiments of the present disclosure, a non-transitory computer-readable storage medium stores computer instructions, wherein the computer instructions are used to cause a computer to perform the methods described above.
[0198] According to an embodiment of this disclosure, a computer program product includes a computer program that, when executed by a processor, implements the method described above.
[0199] Figure 12 A schematic block diagram of an example electronic device 1200 that can be used to implement embodiments of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the present disclosure described and / or claimed herein.
[0200] like Figure 12 As shown, device 1200 includes a computing unit 1201, which can perform various appropriate actions and processes according to a computer program stored in read-only memory (ROM) 1202 or a computer program loaded from storage unit 1208 into random access memory (RAM) 1203. The RAM 1203 may also store various programs and data required for the operation of device 1200. The computing unit 1201, ROM 1202, and RAM 1203 are interconnected via bus 1204. Input / output (I / O) interface 1205 is also connected to bus 1204.
[0201] Multiple components in device 1200 are connected to I / O interface 1205, including: input unit 1206, such as keyboard, mouse, etc.; output unit 1207, such as various types of monitors, speakers, etc.; storage unit 1208, such as disk, optical disk, etc.; and communication unit 1209, such as network card, modem, wireless transceiver, etc. Communication unit 1209 allows device 1200 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.
[0202] The computing unit 1201 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the computing unit 1201 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 1201 performs the various methods and processes described above, such as the page display method. For example, in some embodiments, the page display method may be implemented as a computer software program tangibly contained in a machine-readable medium, such as storage unit 1208. In some embodiments, part or all of the computer program may be loaded and / or installed on device 1200 via ROM 1202 and / or communication unit 1209. When the computer program is loaded into RAM 1203 and executed by the computing unit 1201, one or more steps of the page display method described above may be performed. Alternatively, in other embodiments, the computing unit 1201 may be configured to perform the page display method by any other suitable means (e.g., by means of firmware).
[0203] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.
[0204] The program code used to implement the methods of this disclosure may be written in any combination of one or more programming languages. This program code may be provided to a processor or controller of a general-purpose computer, special-purpose computer, or other programmable data processing apparatus, such that when executed by the processor or controller, the program code causes the functions / operations specified in the flowcharts and / or block diagrams to be implemented. The program code may be executed entirely on a machine, partially on a machine, as a standalone software package partially on a machine and partially on a remote machine, or entirely on a remote machine or server.
[0205] In the context of this disclosure, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, 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 devices, magnetic storage devices, or any suitable combination of the foregoing.
[0206] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device for displaying information to the user (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor); and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the computer. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).
[0207] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as a data server), or computing systems that include middleware components (e.g., an application server), or computing systems that include frontend components (e.g., a user computer with a graphical user interface or web browser through which a user can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., a communication network). Examples of communication networks include local area networks (LANs), wide area networks (WANs), and the Internet.
[0208] Computer systems can include clients and servers. Clients and servers are generally located far apart and typically interact via communication networks. Client-server relationships are created by computer programs running on the respective computers and having a client-server relationship with each other. Servers can be cloud servers, distributed system servers, or servers incorporating blockchain technology.
[0209] It should be understood that the various forms of processes shown above can be used to rearrange, add, or delete steps. For example, the steps described in this disclosure can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution disclosed in this disclosure can be achieved, and this is not limited herein.
[0210] The specific embodiments described above do not constitute a limitation on the scope of protection of this disclosure. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this disclosure should be included within the scope of protection of this disclosure.
Claims
1. A page display method, comprising: In response to a trigger operation that redirects from the first webpage to the second webpage, the instance in the webpage container already created for the first webpage is invoked to load the second webpage, and an identifier and loading record for the second webpage are generated; The global page navigation information is updated using the identifier and loading record of the second webpage; wherein, the global page navigation information indicates the jump order between multiple historical pages; the multiple historical pages include historical webpages loaded by calling the instance, and native pages directly rendered by the operating system before the webpage container is created; as well as The updated global page navigation information is injected into the runtime environment of the web page container so that, based on the global page navigation information, the user can jump from the second web page to any of the multiple historical pages.
2. The method of claim 1, wherein, The global page navigation information includes: nested parent arrays and child arrays; the parent array includes: the container identifier of the webpage container and the page identifier of the native page; the child array associated with the container identifier includes: the identifier of the first webpage; The step of updating the global page navigation information using the identifier and loading record of the second webpage includes: The container identifier is determined from the global page navigation information; Extract the address of the second webpage from the loading record; and The identifier and address of the second webpage are written into the child array according to the jump order to obtain the updated global page navigation information.
3. The method of claim 1 or 2, wherein, The step of updating the global page navigation information using the identifier and loading record of the second webpage also includes: The identifier of the second webpage is used as an extended attribute and encapsulated with the loading record. The local page navigation information of the webpage container is then updated so that, based on the internal page navigation information, the user can jump from the second webpage to any of the multiple historical webpages. The local page navigation information indicates the jump order among the multiple historical web pages loaded by calling the instance.
4. The method according to any one of claims 1-3, further comprising: In response to a closing operation on any of the historical web pages, obtain local page navigation information; The page navigation direction is determined based on the aforementioned local page navigation information; as well as According to the page navigation direction, you can be redirected from any of the web pages to the target page.
5. The method of claim 4, wherein, Determining the page navigation direction based on the local page navigation information includes: In response to determining that the local page navigation information indicates that a page has been loaded before any of the web pages, the page jump direction is determined to be from any of the web pages to a target web page that is adjacent to any of the loaded web pages.
6. The method of claim 5, wherein, The target page includes the target webpage; The step of redirecting from any webpage to the target page according to the page redirection direction includes: By calling the page disappearance callback method, the engine of the web page container is notified that any web page is in an uninteractive state, so that the engine of the web page container can trigger the operation when any web page is in an uninteractive state. as well as By calling the page display callback method, the engine of the webpage container is notified that the target webpage is in an interactive state, so that the engine of the webpage container can trigger the operation when the target webpage is in an interactive state.
7. The method of any one of claims 4-6, wherein, The target page includes a target webpage; the method further includes: In response to a closing operation on any of the historical web pages, the identifier of the web page and a first web page parameter are associated and stored in the cache; the first web page parameter represents the web page parameters of the web page required for rendering the target web page.
8. The method of claim 7, wherein, The step of jumping from any webpage to the target page according to the page jump direction further includes: The identifier of any webpage is retrieved from the global page navigation information; Read the first webpage parameters from the cache; and When navigating from any of the web pages to the target web page according to the page navigation direction, the target web page is rendered based on the first web page parameters.
9. The method of claim 4 or 5, wherein, The step of determining the page navigation direction based on the local page navigation information further includes: In response to determining that the local page navigation information indicates that no page has been loaded before any of the web pages, the page jump direction is determined to be from any of the web pages to the native page adjacent to any of the web pages.
10. The method of any one of claims 4-9, wherein, The step of redirecting from any webpage to the target page according to the page redirection direction includes: According to the page navigation direction, the page back method is called to navigate from any of the web pages to the target page.
11. The method of claim 1, wherein, The response to the triggering operation of jumping from the first webpage to the second webpage, invoking an instance of the webpage container already created for the first webpage to load the second webpage, includes: In response to the triggering operation of jumping from the first webpage to the second webpage, the identifier of the first webpage and the second page parameters are associated and stored in the cache; the second page parameters represent the page parameters of the first webpage required for rendering the second webpage; The identifier of the first webpage is retrieved from the global page navigation information; Read the second page parameters from the cache; When the second webpage is loaded by calling an instance in the webpage container already created for the first webpage, the second webpage is rendered based on the target page parameters.
12. The method of claim 11, wherein, The invocation targets an instance within a webpage container already created for the first webpage, and loads the second webpage based on the target page parameters, further including: By invoking the page disappearance callback method, the webpage container engine is notified that the first webpage is in an uninteractive state, so that the webpage container engine can trigger the operation when the first webpage is in an uninteractive state; and By calling the page display callback method, the engine of the webpage container is notified that the second webpage is in an interactive state, so that the engine of the webpage container can trigger the operation when the second webpage is in an interactive state.
13. The method of any one of claims 1-12, wherein, The step of injecting the updated global page navigation information into the runtime environment of the webpage container includes: The updated global page navigation information is assembled into information to be injected in a predetermined format; and The information to be injected is mounted into the runtime environment through the target interface provided by the example.
14. The method according to claims 1-13, further comprising: In response to a triggering operation that redirects from the second webpage to the native page, the page identifier of the native page is determined from the global page navigation information; Based on the first address associated with the page identifier, the user is redirected from the second webpage to the original page by calling the page back method.
15. The method according to claims 1-13, further comprising: In response to a triggering operation that redirects from the second webpage to the historical webpage, the webpage identifier of the historical webpage is determined from the global page navigation information; Based on the second address associated with the webpage identifier, the user is redirected from the second webpage to the historical webpage by calling the page back method.
16. A page display device, comprising: The loading module is used to respond to the trigger operation of jumping from the first webpage to the second webpage, call the instance in the webpage container that has been created for the first webpage to load the second webpage, and generate the identifier and loading record of the second webpage; An update module is used to update global page navigation information using the identifier and loading record of the second webpage; wherein, the global page navigation information indicates the jump order between multiple historical pages; the multiple historical pages include historical webpages loaded by calling the instance, and native pages directly rendered by the operating system before the webpage container is created; as well as An injection module is used to inject updated global page navigation information into the runtime environment of the web page container so that, based on the global page navigation information, the user can jump from the second web page to any of the multiple historical pages.
17. An electronic device comprising: At least one processor; as well as A memory communicatively connected to the at least one processor; wherein, The memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-15.
18. A non-transitory computer readable storage medium having stored thereon computer instructions, wherein, The computer instructions are used to cause the computer to perform the method according to any one of claims 1-15.
19. A computer program product comprising a computer program that, when executed by a processor, implements the method according to any one of claims 1-15.