Page Jump Method, Device, Electronic Device, and Storage Medium

When page redirection requests, cross-platform routing is used to search for matching pages in the routing table of the cross-platform page, and call back the native route if it is not found, solving the problem of high coupling between the Flutter engine and the native page, and realizing the separate operation and unified maintenance of native pages and cross-platform pages.

CN114595009BActive Publication Date: 2025-08-01SHENZHEN XIAOMAN TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210121481.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-02-09
Publication Date
2025-08-01
Estimated Expiration
2042-02-09

AI Technical Summary

Technical Problem

In the prior art, the Flutter engine has a high degree of coupling with native pages, making it difficult to achieve flexible use of separate debugging and cross-platform pages.

Method used

When receiving page jump requests, search for matching pages in the routing table of the cross-platform page based on cross-platform routing. If not found, call back the native route to realize jumping of the native page and reduce coupling.

Benefits of technology

It realizes separate operation and debugging of native pages and cross-platform pages, and supports unified maintenance and flexible use across multiple platforms.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114595009B_ABST
    Figure CN114595009B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of computer application technologies, and specifically to a page jump method and device, an electronic device, and a storage medium. The method includes: when receiving a page jump request, determining a target jump page corresponding to the page jump request; in a case where the target jump page is not a native page, searching, based on cross-platform routing, for a page matching the target jump page in all routing tables of the cross-platform page; in a case where there is no page matching the target jump page in all routing tables of the cross-platform page and there is a page matching the target jump page in all routing tables of the native routing, calling back the native routing based on the cross-platform routing and jumping to the target native page in all routing tables of the native page to complete the jump to the target jump page.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer application technologies, and particularly to a page jump method, a device, an electronic device, and a storage medium. Background Art

[0002] Flutter is a new cross-platform front-end engine. For an existing project to access the Flutter engine, it is necessary to handle the page stack information well. When cross-platform pages and native pages are used in combination, whether it is cross-platform routing or native routing, it is necessary to rewrite the Flutter routing component, resulting in strong coupling in native operation, and also causing problems such as it being difficult for the Flutter module to be independently run and debugged, the native module depending on the Flutter engine, and the page launched by Flutter needing to use the native stack. Summary of the Invention

[0003] The present invention provides a page jump method, a device, an electronic device, and a storage medium, which reduce the coupling degree with the Flutter engine when cross-platform pages and native pages are used simultaneously, so as to meet flexible operation requirements.

[0004] To solve the above technical problems, the embodiments of the present invention propose the following technical solutions:

[0005] In a first aspect, an embodiment of the present invention provides a page jump method, the method including: when receiving a page jump request, determining a target jump page corresponding to the page jump request; when the target jump page is not a native page, searching for a page matching the target jump page in all route tables of cross-platform pages based on cross-platform routing; when there is no page matching the target jump page in all route tables of cross-platform pages and there is a page matching the target jump page in all route tables of native routing, calling back the native routing based on the cross-platform routing, and jumping to the target native page in all route tables of the native page to complete the jump to the target jump page.

[0006] Second aspect, an embodiment of the present invention provides a page jump device, the device comprising: a receiving module, configured to determine a target jump page corresponding to the page jump request when receiving the page jump request; a judging module, configured to, when the target jump page is not a native page, search for a page matching the target jump page in all routing tables of the cross-platform page based on cross-platform routing; a callback module, configured to, when there is no page matching the target jump page in all routing tables of the cross-platform page and there is a page matching the target jump page in all routing tables of the native routing, callback the native routing based on the cross-platform routing and jump to the target native page in all routing tables of the native page to complete the jump to the target jump page.

[0007] Third aspect, an embodiment of the present invention provides an electronic device, comprising a memory and a processor, where a computer program is stored on the memory, and when the computer program is executed by the processor, the above-mentioned page jump method is executed.

[0008] Fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, on which a computer program is stored, and characterized in that when the program is executed by a processor, the above-mentioned page jump method is implemented.

[0009] The page jump method, device, electronic device and storage medium provided by the present invention, compared with the prior art, at least have the following beneficial effects:

[0010] In a technology stack where native pages and cross-platform pages are used in combination, both native pages and cross-platform pages can be independently run and debugged. In addition, in the callback process, native pages also rely on the cross-platform engine to be realized, which is also beneficial to the unified maintenance of the application program when used across multiple platforms. Description of the Drawings

[0011] Hereinafter, the present invention will be described in more detail based on embodiments and with reference to the drawings.

[0012] Figure 1 It is a schematic flowchart of a page jump method provided by an embodiment of the present invention.

[0013] Figure 2 It is another schematic flowchart of a page jump method provided by an embodiment of the present invention.

[0014] Figure 3 It is still another schematic flowchart of a page jump method provided by an embodiment of the present invention.

[0015] Figure 4 It is a schematic structural diagram of a page jump device provided by an embodiment of the present invention.

[0016] In the accompanying drawings, like reference numerals are used for like components, and the drawings are not drawn to actual scale. Detailed Embodiment

[0017] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the following will describe in detail the implementation manners of the present invention in conjunction with the accompanying drawings and embodiments, so as to fully understand how the present invention applies technical means to solve technical problems and the implementation process of achieving corresponding technical effects and implement it accordingly. Each feature in the embodiments of the present application and the embodiments can be combined with each other on the premise of not conflicting, and the formed technical solutions are all within the protection scope of the present invention.

[0018] It should be noted that like reference numerals and letters denote like items in the following drawings. Therefore, once an item is defined in one drawing, it does not need to be further defined and explained in subsequent drawings.

[0019] Most applications have multiple pages or views and run on different system platforms. The routing and navigator functions of Flutter can manage the naming and transitions between screens in an application. Among them, a Route is an abstraction of a screen or page, and a Navigator is a Widget that manages Routes. The Navigator can implement jumps between pages by pushing and popping Routes.

[0020] Please refer to Figure 1 , an embodiment of the present invention provides a page jump method. The electronic device may be, but is not limited to, a computer, a mobile phone, a television, etc. When this method is applied to the above-mentioned electronic device, steps S110 to S130 are executed:

[0021] S110: When receiving a page jump request, determine a target jump page corresponding to the page jump request.

[0022] The received page jump request may be a page that needs to jump after the system executes a timer; it may also be a page corresponding to a target Widge that needs to jump after receiving a specific request or input from the user (such as a touch on a certain Widge on the current page).

[0023] S120: When the target jump page is not a native page, search for a page that matches the target jump page in all routing tables of cross-platform pages based on cross-platform routing.

[0024] Under normal circumstances, for each page, it can be generated and created based on the native routing of each system (such as IOS, Android, HarmonyOS, etc.), or it can be generated and created based on cross-platform routing of cross-platform tools (Flutter) to achieve cross-platform page jumps.

[0025] A page includes at least one Widge (Web widget). In this way, each page and each page's Widge can be regarded as a "page", and each "page" corresponds to a type of routing, namely native routing and cross-platform routing. Among them, each native page corresponds to a native route, and each cross-platform page corresponds to a cross-platform route; the native routes of all native pages are stored in all routing tables of the native routes, and the cross-platform routes of all cross-platform pages are stored in all routing tables of the cross-platform pages.

[0026] After confirming the target page to be jumped, manage the push and pop of its corresponding route based on its corresponding navigation function to achieve page jumping.

[0027] S130: In the case where there is no page matching the target jump page in all routing tables of the cross-platform page and there is a page matching the target jump page in all routing tables of the native route, call back the native route based on the cross-platform route and jump to the target native page in all routing tables of the native page to complete the jump to the target jump page.

[0028] If each page itself or the page corresponding to each Widge in the page is not a native page (i.e., not a self-end engine page), that is, there is a target cross-platform page matching the target jump page in all routing tables of the cross-platform page, use the cross-platform route to generate and create the corresponding page. On this basis, if there is no target jump page in all routing tables of the cross-platform page, continue to judge whether there is a target native page matching the target jump page in all routing tables of the native page, call back the native route using the cross-platform route, and generate and create the corresponding page. Thus, it is more flexible to manage the hybrid stack of native and cross-platform.

[0029] Please combine Figure 2 , before executing step S130, the method further includes step S210, and step S210 is another branch of step S120:

[0030] S210: In the case where the target jump page is a native page, jump to the target native page based on the native route to complete the jump to the target jump page.

[0031] Combining step S120 and step S210, it can be seen that if the target jump page is a page not supported by the native route, the cross-platform page (i.e., Flutter page) will be jumped to. The cross-platform route (i.e., Flutter page route) preferentially opens the Flutter page to complete the page jump.

[0032] Specifically, please combine Figure 3 , in the case where the target jump page is not a native page, search for the page matching the target jump page in all route tables of the cross-platform page based on the cross-platform route, including the following steps:

[0033] S310: In the case where the target jump page is not a native page, determine whether there is a page matching the target jump page in all route tables of the cross-platform page.

[0034] In this way, it is confirmed whether the target jump page is registered in all route tables of the cross-platform pages maintained in the system.

[0035] S320: When there is a page matching the target jump page in all route tables of the cross-platform page, confirm it as the target cross-platform page.

[0036] S330: Based on the cross-platform route, jump to the target cross-platform page to complete the jump to the target jump page.

[0037] From steps S320 - S330, it can be seen that when the target jump page can be queried in all route tables of the cross-platform page, the cross-platform route of this page is called to complete the page jump.

[0038] S340: When there is no page matching the target jump page in all route tables of the cross-platform page, determine whether there is a native target page matching the target jump page in all route tables of the native page.

[0039] Among them, step S320 and step S340 are two judgment branches of step S310. Through the above two steps, the type of the target jump page is judged and the corresponding jump is completed.

[0040] S350: In the case where there is a page matching the native target page in all route tables of the native page, confirm it as the target native page.

[0041] S360: Based on the cross-platform route, call back the native route and jump to the target native page to complete the jump to the target jump page.

[0042] As can be seen from steps S350 - S360, when the target jump page cannot be found in all routing tables of the cross - platform page but can be found in all routing tables of the native page, the native route of that page is called to complete the page jump.

[0043] S370: When there is no page in all routing tables of the native page that matches the target jump page, a 404 route interception is generated based on the cross - platform route and the 404 prompt page is jumped to.

[0044] Among them, steps S350 and S370 are two judgment branches of step S340. When the target jump page cannot be found in all routing tables of both the cross - platform page and the native page, a route interception is generated, that is, the target page to be jumped to is an unknown page.

[0045] As mentioned above, in the technology stack where native pages and cross - platform pages are used in combination, both native pages and cross - platform pages can be run and debugged separately. In addition, in the callback process, native pages also rely on the cross - platform engine to be realized, which is also conducive to the unified maintenance of the application when used across multiple platforms.

[0046] In the process of implementing the UI of the application, corresponding types of page routes will be registered for each page in advance, including the following steps:

[0047] S410: Based on the content in the page, judge the type of the page;

[0048] S420: Based on the type of the page, register the route of the page; among them, the route includes the native route and the cross - platform route.

[0049] Correspondingly, if a page is of a type supported by the system native page, register the native page type for it and maintain the corresponding content of the page in all routing tables of the corresponding native page; if a page is of a type not supported by the system native page, register the cross - platform page type for it and maintain the content of the page in all routing tables of the corresponding cross - platform.

[0050] S430: According to the routing type of each widget in the target jump page and the page routing type, jump the page and the widgets in the page.

[0051] Among them, when there are multiple widgets in a page, the page jump is realized by uniformly calling the page routes of each widget through the cross - platform route.

[0052] Each page includes a parent route corresponding to its type, and sub - pages (including widgets in the page) can inherit the routes of the corresponding parent pages. Specifically, step S410 judges the type of the page based on the content in the page, including:

[0053] S411: Confirm the widgets included in each page and the type of each widget;

[0054] S412: When the type of the widget is the same as the type of the page, the widget inherits the type of the page parent class and generates its sub-routing.

[0055] S413: When the type of the widget is different from the type of the page, generate a sub-routing corresponding to its type based on the type of the widget.

[0056] By steps S411 - S413, corresponding page routes are registered for each page of the application, and page jumps within the application are implemented through the navigation function corresponding to the cross-platform page routes.

[0057] Please refer to Figure 4 , the schematic structural diagram of a page jump device provided by an embodiment of the present invention. The device includes: a receiving module 510, a judging module 520, and a judging module 530.

[0058] Among them, the receiving module 510 is used to determine a target jump page corresponding to the page jump request when receiving the page jump request; the judging module 520 is used to search for a page matching the target jump page in all routing tables of the cross-platform page based on the cross-platform routing when the target jump page is not a native page; the callback module 530 is used to callback the native routing based on the cross-platform routing and jump to the target native page in all routing tables of the native page to complete the jump to the target jump page when there is no page matching the target jump page in all routing tables of the cross-platform page and there is a page matching the target jump page in all routing tables of the native routing.

[0059] Optionally, the callback module 530 is further used to jump to the target native page based on the native routing to complete the jump to the target jump page when the target jump page is a native page.

[0060] Optionally, the judging module 520 is further used to judge whether there is a page matching the target jump page in all routing tables of the cross-platform page when the target jump page is not a native page; when there is a page matching the target jump page in all routing tables of the cross-platform page, confirm it as the target cross-platform page; the callback module 530 is further used to jump to the target cross-platform page based on the cross-platform routing to complete the jump to the target jump page.

[0061] Optionally, the determination module 520 is further configured to determine whether there is a native target page that matches the target jump page in all the routing tables of the native page when there is no page that matches the target jump page in all the routing tables of the cross-platform page; when there is a page that matches the native target page in all the routing tables of the native page, confirm it as the target native page; the callback module 530 is further configured to callback the native route based on the cross-platform route and jump to the target native page to complete the jump to the target jump page.

[0062] Optionally, when there is no page that matches the target jump page in all the routing tables of the native page, the callback module 530 is further configured to generate a 404 route interception based on the cross-platform route and jump to a 404 prompt page.

[0063] In the technical solution of the embodiment of the present invention, in the technology stack where the native page and the cross-platform page are used in combination, both the native page and the cross-platform page can be independently run and debugged. In addition, in the callback process, the native page also depends on the cross-platform engine to implement, which is also beneficial to the unified maintenance of the application when used across multiple platforms.

[0064] The page jump device provided by the embodiment of the present invention can execute the page jump method provided by any embodiment of the present invention, and has corresponding functional modules and beneficial effects for executing the method.

[0065] It should be noted that the various units and modules included in the above device are only divided according to functional logic, but are not limited to the above division, as long as the corresponding functions can be realized; in addition, the specific names of the functional units are only for the convenience of mutual distinction and do not limit the protection scope of the embodiment of the present invention.

[0066] On the above basis, the present invention further provides an electronic device, the electronic device includes a memory and a processor, and a computer program is stored on the memory, and when the computer program is executed by the processor, it executes the page jump method as described above.

[0067] The memory and the processor are directly or indirectly electrically connected to each other to realize data transmission or interaction. For example, these components can be electrically connected to each other through one or more communication buses or signal lines.

[0068] Among them, the memory may be, but is not limited to, a random access memory (RAM), a read only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), etc.

[0069] The processor may be an integrated circuit chip with signal processing capabilities. The processor may also be a general-purpose processor, such as a central processing unit (CPU), a network processor (NP), a microprocessor, etc.; it may also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components; the processor may also be any conventional processor that can implement or execute the various methods, steps, and logic block diagrams disclosed in the embodiments of the present invention.

[0070] The electronic device may be, but is not limited to, a computer, a mobile phone, or a television, and is not specifically limited herein, and can be set according to actual needs.

[0071] The embodiments of the present invention also provide a computer-readable storage medium, on which a computer program is stored, and when the program is executed by a processor, the above-mentioned page jump method is implemented.

[0072] In several embodiments provided by the embodiments of the present invention, it should be understood that the disclosed systems and methods may also be implemented in other ways. The system and method embodiments described above are merely illustrative.

[0073] It should be noted that in this document, the terms "including", "comprising", or any other variant thereof are intended to cover a non-exclusive inclusion, such that a process, method, article, or device including a series of elements not only includes those elements, but also includes other elements not expressly listed, or further includes elements inherent to such process, method, article, or device. Without further limitation, an element defined by the phrase "including a..." does not exclude the existence of additional identical elements in the process, method, article, or device including the element.

[0074] Although the embodiments disclosed in the present invention are as described above, the content described is only an embodiment adopted for the convenience of understanding the present invention and is not used to limit the present invention. Any person skilled in the art within the technical field to which the present invention pertains may make any modifications and changes in the form of implementation and details without departing from the spirit and scope disclosed by the present invention. However, the scope of patent protection of the present invention shall still be subject to the scope defined by the appended claims.

Claims

1. A page jump method, characterized in that, The method includes: When receiving a page jump request, determining a target jump page corresponding to the page jump request; When the target jump page is not a native page, searching for a page matching the target jump page in all routing tables of the cross-platform page based on cross-platform routing; When there is no page matching the target jump page in all routing tables of the cross-platform page and there is a page matching the target jump page in all routing tables of the native routing, calling back the native routing based on the cross-platform routing and jumping to the target native page in all routing tables of the native page to complete the jump to the target jump page.

2. The method according to claim 1, wherein The method further includes: When the target jump page is a native page, jumping to the target native page based on the native routing to complete the jump to the target jump page.

3. The method according to claim 1, wherein When the target jump page is not a native page, searching for a page matching the target jump page in all routing tables of the cross-platform page based on cross-platform routing includes: When the target jump page is not a native page, determining whether all routing tables of the cross-platform page include a page matching the target jump page; When there is a page matching the target jump page in all routing tables of the cross-platform page, identifying it as the target cross-platform page; Jumping to the target cross-platform page based on the cross-platform routing to complete the jump to the target jump page.

4. The method according to any one of claims 1 to 3, characterized in that The method further includes: When there is no page matching the target jump page in all routing tables of the cross-platform page, determining whether there is a native target page matching the target jump page in all routing tables of the native page; When there is a page matching the native target page in all routing tables of the native page, identifying it as the target native page; Calling back the native routing based on the cross-platform routing and jumping to the target native page to complete the jump to the target jump page.

5. The method according to claim 4, wherein The method further includes: When there is no page matching the target jump page in all routing tables of the native page, generating a 404 routing interception based on the cross-platform routing and jumping to a 404 prompt page.

6. The method according to claim 1, characterized in that, The method further includes: Based on the content in the page, determining the type of the page; Based on the type of the page, registering the routing of the page; wherein, the routing includes native routing and cross-platform routing.

7. The method according to claim 6, wherein Each page includes a parent routing corresponding to its type; based on the content in the page, determining the type of the page includes: Confirming the widgets included in each page and the type of each widget; When the type of the widget is the same as the type of the page, the widget inherits the type of the parent routing of the page and generates its child routing.

8. The method according to claim 7, wherein The method further includes: When the type of the widget is different from the type of the page, generating a child routing corresponding to its type based on the type of the widget.

9. The method according to any one of claims 6 - 8, characterized in that The method further includes: According to the routing type of each widget in the target jump page and the page routing type, jumping to the page and the widgets in the page.

10. A page jump device, characterized in that, The device includes: a receiving module, configured to determine a target jump page corresponding to the page jump request when receiving the page jump request; a judging module, configured to search for a page matching the target jump page in all routing tables of the cross-platform page based on cross-platform routing when the target jump page is not a native page; a callback module, configured to, when there is no page matching the target jump page in all routing tables of the cross-platform page and there is a page matching the target jump page in all routing tables of the native routing, callback the native routing based on the cross-platform routing and jump to the target native page in all routing tables of the native page to complete the jump to the target jump page.

11. An electronic device, characterized in that, It includes a memory and a processor, and a computer program is stored on the memory. When the computer program is executed by the processor, it executes the page jump method according to any one of claims 1-9.

12. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the page jump method according to any one of claims 1-9.

Citation Information

Patent Citations

  • Page processing method and device

    CN112631482A

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

    CN112905933A