Page jump processing method and device

By generating and storing the page stack corresponding to page jump requests, the problem of not being able to quickly return to a specific page in H5 and mini-programs is solved, achieving efficient page processing and optimized user experience in different scenarios.

CN114491347BActive Publication Date: 2026-03-17BEIJING JINGDONG TUOXIAN TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-02-10
Publication Date
2026-03-17

AI Technical Summary

Technical Problem

Existing technologies cannot enable quick return to specific pages in H5 pages and mini-programs, resulting in a poor user experience, especially when the title cannot be customized in webview H5 pages, and it is impossible to add back or close icons.

Method used

By generating and storing the page stack corresponding to the page jump request, determining whether a specific page stack exists, and replacing the page stack of the page before the jump under the condition that it is met, the system can directly return to the specific page, thus avoiding the limitation of the page stack.

Benefits of technology

Without being limited by the page's application scenario, it improves page processing efficiency and user experience, simplifies the return operation, and enhances the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114491347B_ABST
    Figure CN114491347B_ABST
Patent Text Reader

Abstract

The application provides a page jump processing method and device. The page jump processing method comprises the following steps: receiving a first page jump request; generating a page stack corresponding to the first page jump request, and storing the page stack; outputting a page corresponding to the page stack; if a page jump occurs, and there is a page stack corresponding to a specific page in the stored page stack, and neither the page before the jump nor the page after the jump is the specific page, then the page stack of the page after the jump is used to replace the page stack of the page before the jump; wherein the specific page comprises a first historical page and a designated return page. The method can improve the page processing efficiency and user experience without being limited by the page application scenario.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of information processing technology, and in particular to a method and apparatus for page redirection. Background Technology

[0002] Currently, routing or redirection to a specific page is used. In H5 pages or apps, adding a back or close icon to the title of each page would allow direct navigation to the specified page, greatly improving the user experience.

[0003] In developing this application, the inventors discovered that using routing for navigation results in a large page stack. Returning to the previous page stack instead of the desired page leads to a poor user experience. Adding a back or close icon to the title of each page only works for H5 and apps. However, in mini-programs, where pages are embedded in webviews (H5 pages), the webview cannot have a custom title, meaning a back or close icon cannot be added. This prevents quick return to the corresponding page, further complicating the user experience. Summary of the Invention

[0004] In view of this, this application provides a page redirection processing method and apparatus, which can improve page processing efficiency and user experience without being limited by the page application scenario.

[0005] To solve the above-mentioned technical problems, the technical solution of this application is implemented as follows:

[0006] In one embodiment, a page redirection processing method is provided, the method comprising:

[0007] Receive the request to redirect to the first page;

[0008] Generate and store the page stack corresponding to the first page redirection request;

[0009] Output the page corresponding to the page stack;

[0010] If a page jump occurs, and the stored page stack contains a page stack corresponding to a specific page, and neither the page before the jump nor the page after the jump is a specific page, then the page stack of the page after the jump will replace the page stack of the page before the jump.

[0011] The specific pages include: the first history page and the designated return page.

[0012] In another embodiment, a page redirection processing apparatus is provided, the apparatus comprising: a receiving unit, a generating unit, an output unit, a determining unit, and a storage unit;

[0013] The receiving unit is used to receive the first page redirection request;

[0014] The generating unit is used to generate the page stack after the redirection corresponding to the first page redirection request received by the receiving unit;

[0015] The output unit is used to output the page corresponding to the page stack generated by the generation unit;

[0016] The determining unit is used to determine whether a page jump has occurred, whether a page stack corresponding to a specific page is stored, and whether the page before the jump and the page after the jump are specific pages; wherein, the specific page includes: the first historical page and the specified return page;

[0017] The storage unit is used to store the page stack generated by the generation unit; if the determining unit determines that if a page jump occurs, there is a page stack corresponding to a specific page in the stored page stack, and neither the page before the jump nor the page after the jump is a specific page, then the page stack of the page after the jump is used to replace the page stack of the page before the jump.

[0018] In another embodiment, an electronic device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the steps of the page jump processing method.

[0019] In another embodiment, a computer-readable storage medium is provided having a computer program stored thereon that, when executed by a processor, implements the steps of the page jump processing method.

[0020] As can be seen from the above technical solutions, in the embodiments described above, without restricting the application of the page, when a page jump occurs, and the stored page stack contains a page stack corresponding to a specific page, and neither the page before nor the page after the jump is the specific page, the page stack of the page after the jump is used to replace the page stack of the page before the jump. This allows the current page to directly return to the specific page when it receives a return instruction. This solution can improve page processing efficiency and user experience without being limited by the page application scenario. Attached Figure Description

[0021] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0022] Figure 1This is a schematic diagram of the page redirection process in the embodiments of this application;

[0023] Figure 2 This is a schematic diagram illustrating the process of determining whether a page redirection occurs in the embodiments of this application;

[0024] Figure 3 This is a schematic diagram of the page return processing flow in the embodiments of this application;

[0025] Figure 4 This is a schematic diagram of the page redirection processing device in the embodiments of this application;

[0026] Figure 5 This is a schematic diagram of the physical structure of an electronic device provided in an embodiment of the present invention. Detailed Implementation

[0027] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0028] The terms “first,” “second,” “third,” “fourth,” etc. (if present) in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a particular order or sequence. It should be understood that such data can be interchanged where appropriate so that embodiments of the invention described herein can be implemented, for example, in orders other than those illustrated or described herein. Furthermore, the terms “comprising” and “having,” and any variations thereof, are intended to cover a non-exclusive inclusion. For example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0029] The technical solution of the present invention will be described in detail below with reference to specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments.

[0030] This application provides a page navigation processing method. Without restricting the application of the page, when a page navigation occurs, and the stored page stack contains a page stack corresponding to a specific page, and neither the page before nor the page after the navigation is the specific page, the page stack of the page after the navigation is used to replace the page stack of the page before the navigation. This allows the current page to directly return to the specific page when it receives a return command. This improves page processing efficiency and user experience without being limited by the page application scenario.

[0031] The page redirection process in the embodiments of this application will be described in detail below with reference to the accompanying drawings.

[0032] See Figure 1 , Figure 1 This is a schematic diagram of the page redirection process in an embodiment of this application. The specific steps are as follows:

[0033] Step 101: Receive the request to redirect to the first page.

[0034] The first page redirect request here refers to redirecting from the current page to a new page.

[0035] Step 102: Generate and store the page stack corresponding to the first page redirection request.

[0036] Generate the page stack after redirection based on the content carried in the first page redirection request.

[0037] Step 103: Output the page corresponding to the page stack.

[0038] In the existing implementation, this completes the relevant processing for the first page redirection request.

[0039] In this embodiment of the application, it is also necessary to determine whether the page stack of a specific page has been stored and whether the page before the jump is the specific page when a page jump occurs.

[0040] Step 104: If a page jump occurs, and the stored page stack contains a page stack corresponding to a specific page, and neither the page before the jump nor the page after the jump is a specific page, then the page stack of the page after the jump is used to replace the page stack of the page before the jump.

[0041] The specific pages include: the first history page and the designated return page.

[0042] If no page redirection occurs, the page stack will not be replaced.

[0043] If a page redirect occurs and the page stack corresponding to a specific page does not exist in the stored page stack, the page stack will not be replaced.

[0044] If a page redirect occurs, and a specific page stack exists in the stored page stack, then the page stack will not be replaced if the page before or after the redirect is the specific page.

[0045] In other words, if all of the following conditions are not met simultaneously, the page stack replacement operation will not be performed in this embodiment:

[0046] The page stack for page navigation and storage contains a specific page, while the page before and after the navigation is not a specific page.

[0047] When all of the above conditions are met, the page stack replacement operation is performed. Specifically, the page stack of the page after the jump is used to replace the page stack of the page before the jump.

[0048] When a specific page corresponds to multiple tabs, the following processing is also required for that specific page:

[0049] If a specific page corresponds to multiple tabs, and the returned tabs change, then modify the page stack of the specific page to point to the changed tabs.

[0050] In practical implementation, a page may have multiple tabs: tab 1, tab 2, and tab 3. If page A is a specific page, i.e. the first accessed historical page or the specified return page, and the currently accessed page is the page corresponding to tab 1 of page A, if you jump from the current page (the page corresponding to tab 1 of page A) to page B, and you want to return to the page corresponding to tab 3 of page A, then the page stack corresponding to tab 1 of page A will be replaced with the page stack corresponding to tab 3 of page A.

[0051] In practice, the page stack of the current page can be changed through an API (replaceState) of the history route, so that the page can return to the page corresponding to the tab of a previously unvisited webpage with one click.

[0052] In this embodiment, a listening mode can be enabled for the page stack to determine whether a page jump has occurred by listening to the page stack.

[0053] Specifically, determining whether a page redirect has occurred involves monitoring the page stack. Figure 2 , Figure 2 This is a schematic diagram illustrating the process of determining whether a page redirection occurs in an embodiment of this application. The specific steps are as follows:

[0054] Step 201: Monitor the length of the historical storage page stack.

[0055] In this embodiment of the application, popstate can be listened to by listening to events. popstate is triggered when the number of activity history entries (the number of pages in the stack) changes.

[0056] Step 202: If the length of the historical storage page stack increases, a page redirection is determined to have occurred. End this process.

[0057] Step 203: If the length of the historical storage page stack does not increase, it is determined that no page jump has occurred.

[0058] When monitoring the page stack, we not only listen for changes in the length of the historically stored page stack, but also for whether a new page stack is generated or whether an existing page stack is replaced. The specific processing is as follows:

[0059] Once any page stack is detected to be replaced, update the length of the historical storage page stack and end the page jump monitoring for the corresponding page stack.

[0060] In practical implementation, if a new page stack is added, a listener can be started for that page stack; when the page stack is replaced, i.e. deleted, the listener set for that page stack is destroyed.

[0061] For example, the historical pages visited are: page A, page B, page C, and page D;

[0062] In the current implementation, the page stacks of the four pages are automatically stored sequentially, specifically: page stack A, page stack B, page stack C, and page stack D.

[0063] The page stack stored in the page redirection processing scheme provided in this application embodiment is different in different scenarios:

[0064] If the specific page set is the first historical homepage, then the stored page stack is as follows:

[0065] When the current page is page A, the stored page stack is: page stack A; when the current page is page B, the stored page stack is: page stack A, page stack B; when the current page is page C, the stored page stack is: page stack A, page stack C; when the current page is page D, the stored page stack is: page stack A, page stack D. This implementation scheme allows direct return to page A when the current page is B, page A when the current page is C, and page A when the current page is D.

[0066] When the current page is page B, a first redirect request is received. The destination page corresponding to the first redirect request is page C. Then, a page stack C corresponding to page C is generated, and the stored page stacks are: page stack A, page stack B, and page stack C. The page corresponding to page stack C is then output.

[0067] If a page redirect has occurred and a page stack (page stack A) for a specific page has been stored, and neither page B before the redirect nor page C after the redirect is a specific page, then the page stack C corresponding to the page after the redirect is used to replace the page stack C before the redirect. The updated page stacks are: page stack A and page stack C.

[0068] If the specific page set is the designated return page (page C), then the stored page stack is as follows:

[0069] When the current page is page A, the stored page stack is: page stack A; when the current page is page B, the stored page stack is: page stack A, page stack B; when the current page is page C, the stored page stack is: page stack A, page stack B, page stack C; when the current page is page D, the stored page stack is: page stack A, page stack B, page C, page stack D. In this implementation, when the current page is page D, it can directly return to page C.

[0070] When the current page is page B, a first redirect request is received. The destination page corresponding to the first redirect request is page C. Then, a page stack C corresponding to page C is generated, and the stored page stacks are: page stack A, page stack B, and page stack C. The page corresponding to page stack C is then output.

[0071] At this point, it is determined that a page redirect has occurred. The page stack (page stack C) of the specific page has been stored. The page B before the redirect is not the specific page, but the page C after the redirect is the specific page. Therefore, the page stack is not replaced.

[0072] As can be seen from the above, in this embodiment, the desired specific page to return can be set according to the actual application scenario. If no page is specified, the previously accessed page is returned by default. In the specific implementation, the historical page stack is deleted by replacing the page stack. There is no need to add any return or close icon to the page title, so it is not restricted by the program or page. The specific page can be directly jumped to by routing. This solution can improve page processing efficiency and user experience.

[0073] See Figure 3 , Figure 3 This is a schematic diagram of the page return processing flow in an embodiment of this application. The specific steps are as follows:

[0074] Step 301: Receive the request to redirect to the second page.

[0075] The second page redirect request is a return instruction.

[0076] The return command in this embodiment is sent in the same way as the existing route jump method, that is, it can be triggered by triggering the existing "back" button on the page. Here, the return can be forward or backward.

[0077] Step 302: Obtain the page stack corresponding to the stored second page redirection request, and output the page corresponding to the obtained page stack.

[0078] The page stack corresponding to the second page redirection request is the corresponding page stack in the page stack adjacent to the current page's page stack.

[0079] If the second page request is a forward return, the adjacent page stack is the previous adjacent page stack; if it is a backward return, the adjacent page stack is the next adjacent page stack.

[0080] If the stored page stack is: page stack A, page stack B, page stack C, and the current page is the page corresponding to page stack B, the returned page may be the page corresponding to page stack A or the page corresponding to page stack C, depending on the specific second page redirection request.

[0081] For page return scenarios, this application embodiment does not perform any related processing on the stored page stack, which is the same as the existing implementation.

[0082] This section addresses the handling of forward return instructions, which involves returning from the current page stack to the previously stored adjacent page stack. In this embodiment, the page corresponding to the previous page stack of the current page stack is the page stack of the page to be returned to, thus avoiding the need to go back layer by layer in the order of opening.

[0083] In practice, you can use a history API (go) to return to a specific page.

[0084] Page stack navigation has always been an issue, especially for navigation within a webview embedded in a mini-program. This application's embodiment utilizes `history.replaceState` to modify the current page stack route address and `pushState` before navigating to prevent navigation from invoking previous page stack records. The implementation provided in this application significantly improves the user experience by eliminating the need for excessive and redundant navigation operations.

[0085] Based on the same inventive concept, this application also provides a page navigation processing device in its embodiments. See also Figure 4 , Figure 4 This is a schematic diagram of the page redirection processing device in an embodiment of this application. The device includes: a receiving unit 401, a generating unit 402, an output unit 403, a determining unit 404, and a storage unit 405;

[0086] Receiving unit 401 is used to receive the first page redirection request;

[0087] The generation unit 402 is used to generate the page stack after the jump corresponding to the first page jump request received by the receiving unit 401;

[0088] Output unit 403 is used to output the page corresponding to the page stack generated by generation unit 402;

[0089] The determining unit 404 is used to determine whether a page jump has occurred, whether a page stack corresponding to a specific page is stored, and whether the page before the jump and the page after the jump are specific pages; wherein, the specific page includes: the first historical page and the specified return page;

[0090] Storage unit 405 is used to store the page stack generated by generation unit 402; if determination unit 404 determines that if a page jump occurs, there is a page stack corresponding to a specific page in the stored page stack, and neither the page before the jump nor the page after the jump is a specific page, then the page stack of the page after the jump is used to replace the page stack of the page before the jump.

[0091] In another embodiment,

[0092] Storage unit 405 is further used to modify the page stack of the specific page to point to the changed tab if it is determined that a specific page corresponds to multiple tabs and the returned tabs have changed.

[0093] In another embodiment,

[0094] Unit 404 is specifically used to determine whether a page redirect has occurred by monitoring the page stack.

[0095] In another embodiment,

[0096] Unit 404 is specifically used to determine whether a page redirection has occurred by monitoring the page stack, including:

[0097] Monitor the length of the historical storage page stack;

[0098] If the length of the historical storage page stack increases, then a page jump is determined to have occurred;

[0099] If the length of the historical storage page stack does not increase, it is determined that no page jump has occurred.

[0100] In another embodiment,

[0101] Storage unit 405 is further configured to detect when any page stack is replaced, update the length of the historical storage page stack, and end the page jump monitoring of the page corresponding to the page stack.

[0102] In another embodiment, the page redirection processing apparatus further includes: an acquisition unit 406;

[0103] Receiving unit 401 is used to receive a second page redirection request;

[0104] The acquisition unit 406 is further configured to, when the receiving unit 401 receives the second page jump request, retrieve the page stack corresponding to the second page jump request from the page stack stored in the storage unit 405;

[0105] The output unit 403 is further used to output the page corresponding to the page stack obtained by the acquisition unit 406.

[0106] In another embodiment,

[0107] The page stack corresponding to the second page redirection request is the corresponding page stack in the page stack adjacent to the current page's page stack that is stored.

[0108] The units in the above embodiments can be integrated into one unit or deployed separately; they can be merged into one unit or further divided into multiple sub-units.

[0109] In another embodiment, an electronic device is also provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the steps of the page jump processing method.

[0110] In another embodiment, a computer-readable storage medium is also provided, on which computer instructions are stored, which, when executed by a processor, can implement the steps in the page jump processing method.

[0111] Figure 5 This is a schematic diagram of the physical structure of an electronic device provided in an embodiment of the present invention. Figure 5 As shown, the electronic device may include: a processor 510, a communications interface 520, a memory 530, and a communication bus 540, wherein the processor 510, the communications interface 520, and the memory 530 communicate with each other via the communication bus 540. The processor 510 can call logical instructions in the memory 530 to execute the following methods:

[0112] Receive the request to redirect to the first page;

[0113] Generate and store the page stack corresponding to the first page redirection request;

[0114] Output the page corresponding to the page stack;

[0115] If a page jump occurs, and the stored page stack contains a page stack corresponding to a specific page, and neither the page before the jump nor the page after the jump is a specific page, then the page stack of the page after the jump will replace the page stack of the page before the jump.

[0116] The specific pages include: the first history page and the designated return page.

[0117] Furthermore, the logical instructions in the aforementioned memory 530 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, essentially, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0118] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.

[0119] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.

[0120] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.

Claims

1. A page jump processing method characterized by comprising: The method comprises: receiving a first page jump request; generating a page stack corresponding to the first page jump request and storing the page stack; outputting a page corresponding to the page stack; after outputting the page corresponding to the page stack, further comprising: determining whether a page jump occurs by monitoring the page stack; the determining whether a page jump occurs by monitoring the page stack comprises: monitoring the length of a historically stored page stack; if the length of the historically stored page stack becomes longer, it is determined that a page jump occurs; if the length of the historically stored page stack does not become longer, it is determined that a page jump does not occur; if a page jump occurs, there is a page stack corresponding to a specific page in the stored page stack, and neither the page before the jump nor the page after the jump is the specific page, then the page stack of the page after the jump is used to replace the page stack of the page before the jump; if a page jump does not occur, or if a page jump occurs and there is no page stack corresponding to a specific page in the stored page stack, or if a page jump occurs and there is a page stack corresponding to a specific page in the stored page stack, and the page before the jump or the page after the jump is the specific page, then the page stack is not replaced; wherein the specific page comprises a first historical page and a designated return page.

2. The method of claim 1, wherein, The method further comprises: if the specific page corresponds to multiple tabs and the returned tab changes, the page stack of the specific page is modified to point to the changed tab.

3. The method of claim 1, wherein, The method further comprises: listening to any page stack being replaced, updating the length of the historically stored page stack, and ending the monitoring of the page jump of the page corresponding to the page stack.

4. The method according to any one of claims 1 to 3, characterized in that, The method further comprises: receiving a second page jump request; obtaining a page stack corresponding to the second page jump request from the stored page stack; outputting a page corresponding to the obtained page stack.

5. The method of claim 4, further comprising: the page stack corresponding to the second page jump request is a corresponding page stack in the stored page stack adjacent to the page stack of the current page.

6. A page jump processing apparatus characterized by comprising: The device comprises a receiving unit, a generating unit, an outputting unit, a determining unit, and a storing unit; The receiving unit is configured to receive a first page jump request; The generating unit is configured to generate a page stack corresponding to the first page jump request received by the receiving unit; The outputting unit is configured to output a page corresponding to the page stack generated by the generating unit; after outputting the page corresponding to the page stack, further comprising: determining whether a page jump occurs by monitoring the page stack; the determining whether a page jump occurs by monitoring the page stack comprises: monitoring the length of a historically stored page stack; if the length of the historically stored page stack becomes longer, it is determined that a page jump occurs; if the length of the historically stored page stack does not become longer, it is determined that a page jump does not occur; The determining unit is configured to determine whether a page jump occurs, whether a page stack corresponding to a specific page is stored, and whether the page before the jump and the page after the jump are the specific page; wherein the specific page comprises a first historical page and a designated return page; The storage unit is configured to store the page stack generated by the generation unit; if the determination unit determines that a page jump occurs, that a page stack corresponding to the specific page exists in the stored page stack, and that neither the page before the jump nor the page after the jump is the specific page, the page stack of the page after the jump is used to replace the page stack of the page before the jump; if no page jump occurs, the page stack is not replaced; or if a page jump occurs, and no page stack corresponding to the specific page exists in the stored page stack, the page stack is not replaced; or if a page jump occurs, and a page stack corresponding to the specific page exists in the stored page stack, and the page before the jump or the page after the jump is the specific page, the page stack is not replaced.

7. An electronic device comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, The processor implements the method of any one of claims 1-5 when executing the program.

8. A computer-readable storage medium having stored thereon a computer program, characterized in that, The program is executed by the processor to implement the method of any one of claims 1-5.

Citation Information

Patent Citations

  • Webpage processing method and device, computer equipment and storage medium

    CN112214697A

  • Page jumping method, terminal equipment and storage medium

    CN113312570A