Page processing method and device for hosting program, medium and electronic equipment
Through custom routing, custom routing is used to handle mini-program page jumps, and custom routing is implemented using rendering engine identifiers and page trees, which solves the problem of single routing method of mini-program interface rendering engine and improves developer customization capabilities and user experience.
Patent Information
- Application Number
- CN202310806947.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-07-03
- Publication Date
- 2025-01-03
- Estimated Expiration
- 2043-07-03
AI Technical Summary
The existing mini-program interface rendering engine uses WebView, and the page routing method is single, which is difficult to meet the developers' needs for highly customized and in-depth optimization, and the user interaction experience is not natural and smooth.
By obtaining the page jump parameters of the boarding program, if the target page supports custom routing, determine the rendering engine identity and page identity, create a page tree and call the corresponding rendering engine for rendering processing, and realize the custom routing method.
It improves the personalization, refinement and flexibility of page routing, meets the users' natural and smooth interactive experience needs, and provides higher customization and optimization possibilities.
Smart Images

Figure CN119249012A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer and communication technology, and in particular to a page processing method, device, medium and electronic device for a hosted program. Background Art
[0002] A boarding program is a program that relies on a host program and can be used without downloading and installing. Mini programs and quick apps are all boarding programs. Taking mini programs as an example, as mini program applications continue to diversify, mini program developers hope to provide users with smoother and better mini program applications. However, the current mini program interface rendering engine uses WebView (web page view), and page routing (i.e., the routing rules (paths) for jumping from one page to another) can only use the default routing method, that is, pushing the page from the right end to the left end of the interface. This routing method has a single page display effect, which is not only difficult to meet the needs of developers for highly customized and deep optimization, but also difficult to meet the needs of users for a natural and smooth interactive experience. Summary of the invention
[0003] The embodiments of the present application provide a page processing method, device, medium and electronic device for a hosted program, which can meet the developer's needs for high customization and deep optimization, improve the personalization, refinement and flexibility of page routing, and also meet the user's needs for a natural and smooth interactive experience.
[0004] Other features and advantages of the present application will become apparent from the following detailed description, or may be learned in part by the practice of the present application.
[0005] According to one aspect of an embodiment of the present application, a page processing method for a host program is provided, wherein the host program runs in a host environment provided by a host program, and the page processing method is executed by the host program, and the page processing method comprises: obtaining a page jump parameter of the host program, wherein the page jump parameter includes address information of a first target page to which the host program needs to jump, and information of a custom routing parameter of the first target page; if the first target page is rendered by a first rendering engine that supports custom routing, determining a rendering engine identifier and a page identifier corresponding to the first target page; establishing a page tree corresponding to the host program according to the page identifier, and calling a rendering engine corresponding to the rendering engine identifier to render the first target page based on the page tree and the page jump parameter.
[0006] According to one aspect of an embodiment of the present application, a page processing device for a host program is provided, wherein the host program runs in a host environment provided by a host program, and the page processing device is applied to the host program, and the page processing device includes: an acquisition unit, configured to acquire page jump parameters of the host program, wherein the page jump parameters include address information of a first target page to which the host program needs to jump, and information of custom routing parameters of the first target page; a determination unit, configured to determine a rendering engine identifier and a page identifier corresponding to the first target page if the first target page is rendered by a first rendering engine that supports custom routing; and a processing unit, configured to establish a page tree corresponding to the host program according to the page identifier, and call a rendering engine corresponding to the rendering engine identifier to perform rendering processing on the first target page based on the page tree and the page jump parameters.
[0007] In some embodiments of the present application, based on the aforementioned scheme, the acquisition unit is further configured to: acquire a page return parameter for the host program, the page return parameter including the number of pages that need to be rolled back; the determination unit is further configured to: determine a target rendering engine identifier corresponding to a second target page that needs to be returned to based on the number of pages that need to be rolled back and a page stack corresponding to the host program; the page processing device of the host program further includes: a sending unit configured to send a notification message to the rendering engine corresponding to the target rendering engine identifier to roll back the page of the host program to the second target page.
[0008] In some embodiments of the present application, based on the aforementioned scheme, the first rendering engine can render multiple pages; the determining unit is further configured to: if the rendering engine corresponding to the target rendering engine identifier is the first rendering engine, then determine the number of pages that actually need to be rolled back in the rendering engine corresponding to the target rendering engine identifier according to the number of pages that need to be rolled back and the page stack corresponding to the host program; the sending unit is further configured to: add the number of pages that actually need to be rolled back in the notification message.
[0009] In some embodiments of the present application, based on the aforementioned scheme, the page processing method further includes: if the current page of the host program and the second target page are both pages rendered in the rendering engine corresponding to the target rendering engine identifier, and the rendering engine corresponding to the target rendering engine identifier is the first rendering engine, then the notification message is also used to notify the rendering engine corresponding to the target rendering engine identifier to perform routing animation rendering processing on the second target page.
[0010] In some embodiments of the present application, based on the aforementioned scheme, the rendering engine used to render the page of the host program also includes a second rendering engine, and each of the second rendering engines can render a page; the processing unit is also configured to: if the rendering engine corresponding to the target rendering engine identifier is the second rendering engine, then the second target page is rendered by the host program. Routing animation rendering processing.
[0011] In some embodiments of the present application, based on the aforementioned scheme, the acquisition unit is configured to: in response to a trigger operation on a page return control on the host program, or in response to a gesture operation of page return, acquire a page return parameter containing a set value of the number of pages to be rolled back.
[0012] In some embodiments of the present application, based on the aforementioned scheme, multiple pages can be rendered in the first rendering engine; the acquisition unit is further configured to: upon receiving a redirection request to redirect the current page on the host program to a specified page, acquire the rendering engine corresponding to the current page; the processing unit is further configured to: if the rendering engine corresponding to the current page is the first rendering engine, and the type of the specified page is a first rendering engine page, then render the specified page in the first rendering engine.
[0013] In some embodiments of the present application, based on the aforementioned scheme, the rendering engine used to render the page of the host program also includes a second rendering engine, and each of the second rendering engines can render one page; the processing unit is further configured to: if the rendering engine corresponding to the current page is the first rendering engine, and the type of the designated page is a second rendering engine page, then establish the designated page rendered by the second rendering engine at the top of the page stack of the host program, and notify the first rendering engine to roll back one page.
[0014] In some embodiments of the present application, based on the aforementioned scheme, the rendering engine used to render the page of the host program also includes a second rendering engine, and each of the second rendering engines can render a page; the processing unit is also configured to: if the rendering engine corresponding to the current page is the second rendering engine, and the type of the specified page is a first rendering engine page, then delete the current page from the top of the page stack of the host program, and render the specified page through the newly created first rendering engine.
[0015] In some embodiments of the present application, based on the aforementioned scheme, the process in which the processing unit obtains the page jump parameters of the boarding program includes: receiving a call request sent by a basic library of the boarding program, and obtaining the page jump parameters from the call request; the process in which the processing unit establishes a page tree corresponding to the boarding program according to the page identifier, and calls a rendering engine corresponding to the rendering engine identifier to render the first target page based on the page tree and the page jump parameters includes: returning the page jump parameters, the rendering engine identifier and the page identifier to the basic library, so as to establish a page tree corresponding to the boarding program through the basic library, and calling the rendering engine corresponding to the rendering engine identifier to render the first target page based on the page tree and the page jump parameters.
[0016] In some embodiments of the present application, based on the aforementioned scheme, multiple pages can be rendered in the first rendering engine; each page rendered by the host program through the first rendering engine corresponds to a different data isolation area, and the routing context corresponding to each page is associated with the data isolation area corresponding to each page, and the routing context contains a page node tree; wherein, operations on the page node tree act on the data isolation area associated with the routing context.
[0017] In some embodiments of the present application, based on the aforementioned scheme, the page jump parameters include a routing type, and the routing type is used to call custom routing parameters of the first target page, and the custom routing parameters include routing animation effects and animation display time.
[0018] According to one aspect of an embodiment of the present application, a computer-readable medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the page processing method of the host program as described in the above embodiment is implemented.
[0019] According to one aspect of an embodiment of the present application, an electronic device is provided, comprising: one or more processors; a storage device for storing one or more computer programs, wherein when the one or more computer programs are executed by the one or more processors, the electronic device implements the page processing method of the host program as described in the above embodiment.
[0020] According to one aspect of an embodiment of the present application, a computer program product is provided, the computer program product comprising a computer program, the computer program being stored in a computer-readable storage medium. A processor of an electronic device reads and executes the computer program from the computer-readable storage medium, so that the electronic device executes the page processing method of the host program provided in the above-mentioned various optional embodiments.
[0021] In the technical solutions provided in some embodiments of the present application, by obtaining the page jump parameters of the host program, and when the first target page to be jumped to is rendered by the first rendering engine that supports custom routing, the rendering engine identifier and the page identifier corresponding to the first target page are determined, and then a page tree corresponding to the host program is established according to the page identifier, and the rendering engine corresponding to the rendering engine identifier is called to render the first target page based on the page tree and the page jump parameters, so that the developer can use the first rendering engine to implement a custom routing method for the page, thereby meeting the developer's needs for high customization and deep optimization, improving the personalization, refinement and flexibility of page routing, and also meeting the user's needs for a natural and smooth interactive experience.
[0022] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] Figure 1 A schematic diagram showing an exemplary system architecture to which the technical solution of the embodiments of the present application can be applied;
[0024] Figure 2 A flow chart showing a page processing method of a hosted program according to an embodiment of the present application is shown;
[0025] Figure 3 A flow chart showing a page processing method of a hosted program according to an embodiment of the present application is shown;
[0026] Figure 4 A schematic diagram of the page routing method rendered by the WebView engine is shown;
[0027] Figure 5 A schematic diagram of a page routing method implemented according to the technical solution of an embodiment of the present application is shown;
[0028] Figure 6 A schematic diagram of a declaration of a builder function according to an embodiment of the present application is shown;
[0029] Figure 7 A schematic diagram showing the correspondence between windowID and pageID according to an embodiment of the present application is shown;
[0030] Figure 8 A processing flow chart of a page jump process according to an embodiment of the present application is shown;
[0031] Fig. 9 A schematic diagram of implementing hybrid routing isolation according to an embodiment of the present application is shown;
[0032] Fig.10 A block diagram of a page processing device of a hosted program according to an embodiment of the present application is shown;
[0033] Fig.11 A schematic diagram of the structure of a computer system suitable for implementing an electronic device of an embodiment of the present application is shown. DETAILED DESCRIPTION
[0034] The exemplary embodiments are now described in a more comprehensive manner with reference to the accompanying drawings. However, the exemplary embodiments can be implemented in various forms and should not be understood as being limited to these examples; on the contrary, the purpose of providing these embodiments is to make this application more comprehensive and complete, and to fully convey the concept of the exemplary embodiments to those skilled in the art.
[0035] In addition, the features, structures or characteristics described in the present application may be combined in one or more embodiments in any suitable manner. In the following description, there are many specific details so that the embodiments of the present application can be fully understood. However, those skilled in the art will appreciate that when implementing the technical scheme of the present application, all the detailed features in the embodiments may not be needed, one or more specific details may be omitted, or other methods, elements, devices, steps, etc. may be adopted.
[0036] The block diagrams shown in the accompanying drawings are merely functional entities and do not necessarily correspond to physically independent entities. That is, these functional entities may be implemented in software form, or in one or more hardware modules or integrated circuits, or in different networks and / or processor devices and / or microcontroller devices.
[0037] The flowcharts shown in the accompanying drawings are only exemplary and do not necessarily include all the contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps can be decomposed, and some operations / steps can be combined or partially combined, so the actual execution order may change according to actual conditions.
[0038] It should be noted that the "multiple" mentioned in this article refers to two or more. "And / or" describes the association relationship of the associated objects, indicating that there can be three relationships. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the associated objects before and after are in an "or" relationship.
[0039] The technical solution of the embodiment of the present application involves a boarding program and a host program, wherein a boarding program is a program that relies on a host program and can be used without downloading and installing, such as mini programs, quick applications, etc. Taking mini programs as an example, since the current mini program interface rendering engine uses WebView, when jumping pages, the page can only be pushed from the right end of the interface to the left end. This page routing method results in a single page display effect, which is not only difficult to meet the needs of developers for high customization and deep optimization, but also difficult to meet the needs of users for a natural and smooth interactive experience.
[0040] Based on the above problems, the embodiment of the present application proposes a solution for customizing routing in the hosting program. Specifically, Figure 1 As shown, in an exemplary system architecture of the present application, a terminal device 101, a network 102, and a host program platform end 103 may be included. The network 102 is used to provide a medium for a communication link between the terminal device 101 and the host program platform end 103. The network 102 may include various connection types, such as a wired communication link, a wireless communication link, and the like.
[0041] In one embodiment of the present application, a host program is run on the terminal device 101, and the host program can be an application client. The host program can communicate with the host program platform end 103 through the network 102 to display the host program page and complete the corresponding business functions (such as message sending, voice call, etc.). The host program provides a host environment, and the host program can run in the host environment provided by the host program. Developers can set page jump parameters for custom routing for the host program, and then the host program can obtain the page jump parameters of the host program, which can include the address information of the first target page that the host program needs to jump to, and the information of the custom routing parameters of the first target page. If the first target page is rendered by the first rendering engine that supports custom routing, the rendering engine identifier and page identifier corresponding to the first target page can be determined, and then the page tree corresponding to the host program is established according to the page identifier, and the rendering engine corresponding to the rendering engine identifier is called to render the first target page based on the page tree and the page jump parameters.
[0042] It can be seen that the technical solution of the embodiment of the present application enables developers to use the first rendering engine to implement a customized routing method for pages, thereby meeting the developer's needs for high customization and deep optimization, improving the personalization, refinement and flexibility of page routing, and also meeting the user's needs for a natural and smooth interactive experience.
[0043] It should be noted that the host program platform end 103 involved in the embodiment of the present application can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (Content Delivery Network, CDN), and big data and artificial intelligence platforms. The terminal device 101 can be a smart phone, a tablet computer, a laptop computer, a desktop computer, a smart speaker, a smart watch, a car terminal, a smart TV, etc., but is not limited to this.
[0044] The implementation details of the technical solution of the embodiment of the present application are described in detail below:
[0045] Figure 2 A flow chart of a page processing method of a host program according to an embodiment of the present application is shown. The host program runs in a host environment provided by a host program, and the page processing method is executed by the host program or by an electronic device running the host program. Figure 2 As shown, the page processing method of the hosted program at least includes steps S210 to S230, which are described in detail as follows:
[0046] In step S210, a page jump parameter of the host program is obtained, and the page jump parameter includes address information of a first target page to which the host program needs to jump, and information of a custom routing parameter of the first target page.
[0047] In the embodiments of the present application, a host program is a program that relies on a host program and can be used without downloading and installing, such as mini-programs, quick applications, etc. In a computer environment, the software environment on which the host program depends is called the host environment, and the program that provides the host environment can be called the host program. The host program can be, for example, an open platform, an application that can run the host program, an operating system of a mobile terminal, etc.
[0048] In some optional embodiments, the page jump parameter may include a route type (i.e., routeType), which is used to call a custom route parameter of the first target page, and the custom route parameter includes a route animation effect and an animation display time. Optionally, the route animation effect may be, for example, pulling up the page from the bottom, or gradually expanding the page from a certain position (such as the side of the screen); the animation display time is used to indicate the display time of the route animation effect.
[0049] In some optional embodiments, the process of the host program obtaining the page jump parameter of the host program may be: receiving a call request sent by the basic library of the host program, and then obtaining the page jump parameter from the call request. For example, if the host program is an applet, the call request sent by the basic library may be navigateTo.
[0050] It should be noted that the basic library can be used to provide basic codes related to the VD (Virtual DOM, virtual node) rendering mechanism, and can also provide encapsulated built-in components and logic layer API (Application Programming Interface, application programming interface), and can also provide basic codes for other supplementary capabilities (such as custom components and plug-ins, etc.). In general, the basic library of the boarding program is mainly responsible for processing a series of framework logics such as data binding, component system, event system, and communication system.
[0051] In step S220, if the first target page is rendered by a first rendering engine that supports custom routing, a rendering engine identifier and a page identifier corresponding to the first target page are determined.
[0052] In some optional embodiments, the rendering engine identifier is used to identify the rendering engine, and the page identifier is used to identify the page. Since multiple pages can be rendered in a rendering engine in the embodiments of the present application, a rendering engine identifier can correspond to one or more page identifiers. If a rendering engine identifier corresponds to a page identifier, it means that one page is rendered in the rendering engine; if a rendering engine identifier corresponds to multiple page identifiers, it means that multiple pages are rendered in the rendering engine. Therefore, if the first target page is rendered by the first rendering engine that supports custom routing, then after finding the rendering engine that renders the first target page, the corresponding rendering engine identifier can be obtained, that is, the rendering engine identifier corresponding to the first target page, and then the page identifier corresponding to the first target page is obtained according to the page rendered in the rendering engine corresponding to the rendering engine identifier.
[0053] In step S230, a page tree corresponding to the host program is established according to the page identifier corresponding to the first target page, and a rendering engine corresponding to the rendering engine identifier is called to render the first target page based on the page tree and the page jump parameter.
[0054] In some optional embodiments, the page tree is used to represent the jump relationship between pages, such as representing a jump from page A to page B. After calling the rendering engine corresponding to the rendering engine identifier to render the first target page based on the page tree and the page jump parameter, the first target page can be presented in the host program through a custom routing method corresponding to the custom routing parameter.
[0055] In some optional embodiments, the host program establishes a page tree corresponding to the host program according to the page identifier, and calls the rendering engine corresponding to the rendering engine identifier to render the first target page based on the page tree and the page jump parameters. The process may specifically be: returning the page jump parameters, the rendering engine identifier, and the page identifier to the basic library to establish the page tree corresponding to the host program through the basic library, and calling the rendering engine corresponding to the rendering engine identifier to render the first target page based on the page tree and the page jump parameters.
[0056] Figure 2 The technical solution of the illustrated embodiment enables developers to use the first rendering engine to implement a customized routing method for pages, thereby meeting the developer's needs for highly customized and deep optimization, improving the personalization, refinement and flexibility of page routing, while also meeting the user's needs for a natural and smooth interactive experience.
[0057] Figure 3 A flow chart of a page processing method of a host program according to an embodiment of the present application is shown. The host program runs in a host environment provided by a host program, and the page processing method is executed by the host program. Figure 3 As shown, the page processing method of the host program at least includes steps S310 to S330, which are described in detail as follows:
[0058] In step S310, a page return parameter for the hosted program is obtained, wherein the page return parameter includes the number of pages that need to be rolled back.
[0059] In some optional embodiments, the number of pages to be rolled back contained in the page return parameter may be set, or may be triggered by a page return operation. Optionally, the page return operation may be a trigger operation for a page return control on the host program, or may be a gesture operation for page return (such as a sliding operation on the side of the screen). If it is a page return operation, the number of pages to be rolled back contained in the page return parameter may be a set value, such as 1, i.e., rolling back one page.
[0060] In step S320, the target rendering engine identifier corresponding to the second target page to be returned to is determined according to the number of pages to be rolled back and the page stack corresponding to the host program.
[0061] In some optional embodiments, the page stack corresponding to the host program is used to store pages of the host program, and these pages can be stored based on the order of jumps, wherein the first element in the page stack is the home page of the host program, and the last element (i.e., the element at the top of the stack) is the current page of the host program. Based on this, according to the number of pages that need to be rolled back and the page stack corresponding to the host program, the second target page that needs to be returned can be determined by traversing forward based on the current page, and then the target rendering engine identifier corresponding to the second target page can be determined, that is, the identifier of the rendering engine used to render the second target page.
[0062] In step S330, a notification message is sent to the rendering engine corresponding to the target rendering engine identifier to roll back the page of the host program to the second target page.
[0063] In some optional embodiments, if multiple pages can be rendered in the first rendering engine, then if the rendering engine corresponding to the target rendering engine identifier is the first rendering engine, the number of pages that actually need to be rolled back in the rendering engine corresponding to the target rendering engine identifier can be determined based on the number of pages that need to be rolled back and the page stack corresponding to the host program; then the number of pages that actually need to be rolled back is added in the notification message. This is because multiple pages are rendered in the first rendering engine. When the second target page that needs to be rolled back falls in this rendering engine, for the rendering engine, the page rollback is actually performed in the rendering engine, so the number of pages that actually need to be rolled back in the rendering engine corresponding to the target rendering engine identifier can be determined. Optionally, if the current page of the host program and the second target page are both pages rendered in the rendering engine corresponding to the target rendering engine identifier, and the rendering engine corresponding to the target rendering engine identifier is the first rendering engine, then it means that the second target page is other pages rendered in the rendering engine corresponding to the target rendering engine identifier, that is, the rendering engine corresponding to the target rendering engine identifier renders multiple pages, so the notification message can also be used to notify the rendering engine corresponding to the target rendering engine identifier to perform routing animation rendering processing on the second target page.
[0064] In some optional embodiments, the rendering engine used to render the page of the host program may also include a second rendering engine, each second rendering engine can render one page, that is, one second rendering engine can only render one page, then if the rendering engine corresponding to the target rendering engine identifier is the second rendering engine, the second target page can be rendered with a routing animation through the host program.
[0065] In some optional embodiments, if the first rendering engine can render multiple pages, then when a redirection request to redirect the current page on the host program to the specified page is received, the rendering engine corresponding to the current page can be obtained. If the rendering engine corresponding to the current page is the first rendering engine, and the type of the specified page is a first rendering engine page, the first rendering engine can be directly reused to render the specified page in the first rendering engine.
[0066] In some optional embodiments, the rendering engine used to render the page of the host program may also include a second rendering engine, each second rendering engine can render one page, that is, one second rendering engine can only render one page, then if the rendering engine corresponding to the current page is the first rendering engine, and the type of the specified page is a second rendering engine page, then the specified page rendered by the second rendering engine can be established at the top of the page stack of the host program, and the first rendering engine is notified to roll back one page to ensure the correctness of the page stack.
[0067] In some optional embodiments, the rendering engine used to render the page of the host program may also include a second rendering engine, each second rendering engine can render one page, that is, one second rendering engine can only render one page, then if the rendering engine corresponding to the current page is the second rendering engine, and the type of the specified page is the first rendering engine page, then the current page can be deleted from the top of the page stack of the host program, and the specified page can be rendered by the newly created first rendering engine.
[0068] In some optional embodiments, if multiple pages can be rendered in the first rendering engine, then each page rendered by the host program through the first rendering engine corresponds to a different data isolation area (such as Dart Isolate), and the routing context corresponding to each page is associated with the data isolation area corresponding to each page, and the routing context contains a page node tree (such as Shadow Tree). In this case, operations on the page node tree act on the data isolation area associated with the routing context, thereby ensuring data isolation between multiple pages in the first rendering engine.
[0069] The following takes the hosting program as a mini program, the host program as an application client, the first rendering engine as Flutterengine, and the second rendering engine as WebView as an example to describe the implementation details of the technical solution of the embodiment of the present application in detail:
[0070] like Figure 4As shown, the current mini-program interface rendering engine uses WebView. When jumping to a page, the page can only be pushed from the right end of the interface to the left end. This page routing method results in a single page display effect, which is not only difficult to meet the developer's needs for high customization and deep optimization, but also difficult to meet the user's needs for a natural and smooth interactive experience. In the embodiments of the present application, a higher degree of freedom and creativity can be provided to developers through custom routing. Developers can implement routing animation solutions according to their own business needs, thereby creating a more personalized and refined mini-program interactive experience. At the same time, this custom routing method also makes the mini-program page switching effect more natural and smooth, making the user's operating experience smoother. For example Figure 5 As shown, pages can be pushed upward from the bottom of the screen.
[0071] In some optional embodiments, the custom routing in this application can be implemented based on Skyline and Flutter. In order to use custom routing in continuous Skyline pages, the renderer field can be configured as Skyline in the json file of the page configuration.
[0072] When using a custom route, you can first declare the custom route, for example, you can declare a custom route through the wx.router.addRouteBuilder (add route builder) interface. In an example, a custom route can be declared as follows:
[0073] wx.router.addRouteBuilder(
[0074] "HalfScreenDialog",
[0075] customRouteBuilder )
[0077] In the above declaration, the first parameter "HalfScreenDialog" is the name of the custom route, and the second parameter customRouteBuilder is the builder function of the custom route. The builder function is the core of the developer's use of custom routes, in which animation effects, animation time, and so on can be defined.
[0078] An example builder function might look like Figure 6As shown, a user route configuration information in a builder function is specifically defined, wherein the route context information (i.e., routeContext) is shown in code segment 601. Since the old page will exit when a new page is opened, primaryAnimation is used to indicate the parameters of the new page push animation; secondaryAnimation is used to indicate the parameters of the old page push animation; and userGestureInProgress is used to identify whether the page jump process is triggered by a user gesture.
[0079] Figure 6 Code segment 602 is used to define the new page push animation, where code segment 6021 is used to indicate the value of setting the worklet animation. The default value is the value of primaryAnimation (ie, primaryAnimation.value). If it is not triggered by a user gesture, other values will be selected and the animation style will be returned. Figure 6 Code segment 603 is used to define the animation of the old page being pushed out, wherein code segment 6031 is used to indicate the value of setting the worklet animation. The default value is the value of secondaryAnimation (ie, secondaryAnimation.value). If it is not triggered by a user gesture, other values will be selected and the animation style will be returned. Figure 6 The code segment 604 is used to return the defined new page push animation and old page push animation.
[0080] After declaring a custom route, you can use the declared custom route as a page jump parameter to implement the custom page route. Specifically, when calling wx.navigateTo (i.e., the page jump function) to jump to a page, you can add a second parameter, routeType (route type), to it and set it to the name of the declared custom route "HalfScreenDialog". In this way, when the page jumps, it will follow the route animation set in the builder function. In an example, the wx.navigateTo function is defined as follows (the url is the address of the page to be jumped to):
[0081] wx.navigateTo({
[0082] url:'pageB',
[0083] routeType:'HalfScreenDialog'
[0084] })
[0085] In one embodiment of the present application, when performing page return processing, custom routing supports gestures to complete the gesture return animation effect. Specifically, the gesture component can be nested in the outermost layer of the page, and the page display state can be changed by changing the variables of the custom routing in the gesture callback. This.customRouteContext (user routing context) in the page contains all the variables when the current page defines the route builder, that is, the routeContext in the declared builder function.
[0086] In one embodiment of the present application, since Skyline is used as the rendering backend and page jumps have rich animation support, when the page is an independent flutter engine, the routing animation is controlled by the application client and the routing animation capability of Skyline is not used. When the same flutter engine is used to render consecutive pages, the routing animation capability of Skyline can be used to implement custom routing. In order to render multiple pages in the same flutter engine, the id of the flutter engine can be called windowID, the id of the page can be called pageID, and each windowID may correspond to one or more pageIDs, but each pageID belongs to only one windowID. And in an embodiment of the present application, Webview and Skyline can be supported to exist in the same mini program, that is, a hybrid routing method of WebView and Skyline is supported. Specifically, such as Figure 7 As shown, the WebView engine with id=1 corresponds to the page with id=1; the flutter engine with id=2 corresponds to the pages with id=2 and id=3; and the WebView engine with id=3 corresponds to the page with id=4.
[0087] In one embodiment of the present application, it is assumed that the order of opening the mini program page is wa->fb->fc->wd->fe, where "w-" represents the WebView rendering page and "f-" represents the flutter engine rendering page. In this example, two flutter engines are generated, flutter engine1 contains fb and fc; flutter engine2 contains fe. The application client is responsible for the routing animation between WebView and flutter engine, while the routing of pages in the flutter engine (such as fb->fc) is controlled by Skyline. This part can customize the routing animation. Since consecutive flutter engine rendering pages can reuse the same flutter engine, the system memory consumption can also be reduced. At the same time, the application client has a complete page stack, and the basic library keeps consistent with the client page stack based on onAppRoute (API triggered when the page switches) and onAppRouteDone events. When the routing animation is generated by the application client, the triggering timing of the two events is entirely determined by the client; when custom routing is performed in the flutter engine, the onAppRouteDone event is notified by Skyline to the application client. The following is an explanation of the page change scenario in the embodiment of the present application:
[0088] In one embodiment of the present application, when a page jump is required, such as Figure 8 As shown, the jump logic of the custom route includes: when the developer calls wx.navigateTo to jump to the page, the basic library calls navigateTo with parameters {url, singlePageData}. Among them, singlePageData is the name of the defined custom route, which is "HalfScreenDialog" in the aforementioned embodiment. Then, the application client triggers the onAppRoute event. If the new page to be jumped to is rendered by flutter, the parameter returned to the basic library carries the passed-in singlePageData, and fills in the windowID and pageID. Furthermore, the basic library creates a new page tree with the new pageID. After the new page tree is created, startRender is called to initiate page rendering. After the rendering backend Skyline receives startRender, it performs page layout and drawing, and completes the custom route according to the defined custom route parameters; after the rendering backend route is completed, the client is notified, and the client triggers onAppRouteDone to the basic library, and the basic library calls back to the developer to complete the callback.
[0089] It should be noted that when jumping from the WebView engine to the flutter engine, the page routing animation is completed by the application client, while when jumping within the flutter engine, that is, jumping to the flutter engine rendered page, the page routing animation is completed by Skyline.
[0090] In one embodiment of the present application, when page return processing is required, the basic library calls the navigateBack function (a function used to return the page) with a parameter delta (i.e., the number of pages to be rolled back). The application client calculates which rendering engine the target page will fall in based on delta and the page stack. If the target page falls in a flutter engine, since the flutter engine may have multiple pages, it is necessary to notify the flutter engine of the number of pages that actually need to be rolled back (calculatedDelta) and whether page animation is required. If page animation is required, the rendering backend will notify the application client after pushing the page, and the application client will trigger onAppRouteDone to the basic library.
[0091] Assume that the order of opening the mini program pages is wa->fb->fc->wd->fe, where "w-" indicates the WebView rendering page and "f-" indicates the flutter engine rendering page. Then two flutter engines will be generated. Flutterengine1 contains fb and fc; flutter engine2 contains fe.
[0092] If the current page is fe, the basic library navigateBack passes in delta:2. At this time, it is determined that it is necessary to return to the fc page. The animation is handed over to the client, and there is no need to notify Skyline. This is because the rollback from the fe page to the fc page is not a rollback between flutterengine internal pages.
[0093] If the current page is fe, the basic library navigateBack passes in delta:3, and it is determined that it needs to return to the fb page. Since the rollback from the fe page to the fb page is not a rollback between pages within the flutter engine, the animation can be handed over to the application client, and Skyline is notified of the actual number of pages to be rolled back in flutter engine1, calculatedDelta:1, and Skyline does not need to perform animation.
[0094] If the current page is fc, the basic library navigateBack passes delta:1, and it is determined that it needs to return to the fb page. Since the rollback from the fc page to the fb page is a rollback between pages within the flutter engine, Skyline can be notified that the actual number of pages to be rolled back in flutter engine1 is calculatedDelta:1, and animation is required. In other words, Skyline animation is required only when the current page and the target page are in the same flutter engine.
[0095] In one embodiment of the present application, gesture operation can also cause the page to return, such as triggering the return button through gesture, or triggering the page return through gesture sliding, etc. This situation is equivalent to delta:1, and can be processed according to the above-mentioned page return operation. It should be noted that for the first page of the flutter engine, when the return is triggered by a gesture, since it is necessary to return to the page of other rendering engines (such as a WebView page), the page routing animation can be processed by the application client; and starting from the second page of the flutter engine, if the return is triggered by a gesture, then since it is a page return operation performed in the same flutter engine, the page routing animation can be processed by Skyline. At the same time, when the page return is triggered by a gesture operation in the flutter engine, Skyline notifies the client of the start and end timing of the return, that is, the onAppRouteDone event is notified by Skyline to the application client.
[0096] In one embodiment of the present application, when page redirection processing is required, if the current page is wd and needs to be redirected to fe, the application client can delete the current webview at the top of the stack, create a new flutterengine, and notify Skyline NavigateTo to jump to page fe. If the current page is fc and needs to be redirected to fe, since it is a page rendered by the same flutter engine, the previous flutter engine can be reused, and the application client notifies Skyline RedirectTo to page fe. If the current page is fc and needs to be redirected to wd, the application client can create a new webview at the top of the stack and notify Skyline NavigateBack (i.e. return) one layer of page, but no animation is required to keep the flutter engine page stack correct.
[0097] In one embodiment of the present application, since a hybrid routing mode of WebView and Skyline is supported in the same mini program, the multi-Flutter View (i.e., Flutter page) mechanism can be used to implement a solution of mixed use of WebView and Flutter rendering framework in a mini program. The developer only needs to configure the renderer to be used for the page in the page.json file of the page in advance. When the route jumps, the client will decide whether to push WebView or Flutter View according to the configuration in the page.json file. The mechanism of multiple Flutter Views is very similar to the mechanism of multiple WebViews. The difference is that multiple Flutter Views share some resources at the bottom layer to save memory (such as texture resources and some internal objects). In order to support multiple Flutter Views, such as Fig. 9 As shown in the figure, an isolation mechanism can be designed inside Skyline. For Skyline pages, the Context and Window in Skyline are bound to the Dart Isolate of the page (each Skyline page has a Dart Isolate). A Context holds a Shadow Tree, and all operations of the Shadow Tree will act on its corresponding Dart Isolate, so as to achieve state isolation from Shadow Tree to DartIsolate.
[0098] The technical solution of the embodiment of the present application can realize the customized page routing of the mini program, bringing a better user experience to the mini program. Compared with WebView, the technical solution of the embodiment of the present application can realize routing animation effects that are closer to the native implementation, such as sinking routing, card transitions, etc. These effects can make users feel smoother interaction. And through customized routing, the mini program can obtain more possibilities and flexibility, further improving the user experience and application value.
[0099] The following describes an apparatus embodiment of the present application, which can be used to execute the page processing method of the host program in the above-mentioned embodiment of the present application. For details not disclosed in the apparatus embodiment of the present application, please refer to the above-mentioned embodiment of the page processing method of the host program of the present application.
[0100] Fig.10 A block diagram of a page processing device of a host program according to an embodiment of the present application is shown. The host program runs in a host environment provided by a host program, and the page processing device is applied to the host program.
[0101] Reference Fig.10As shown, a page processing device 1000 of a hosted program according to an embodiment of the present application includes: an acquisition unit 1002 , a determination unit 1004 and a processing unit 1006 .
[0102] Among them, the acquisition unit 1002 is configured to obtain the page jump parameters of the host program, and the page jump parameters include the address information of the first target page to which the host program needs to jump, and the information of the custom routing parameters of the first target page; the determination unit 1004 is configured to determine the rendering engine identifier and the page identifier corresponding to the first target page if the first target page is rendered by a first rendering engine that supports custom routing; the processing unit 1006 is configured to establish a page tree corresponding to the host program according to the page identifier, and call the rendering engine corresponding to the rendering engine identifier to render the first target page based on the page tree and the page jump parameters.
[0103] In some embodiments of the present application, based on the aforementioned scheme, the acquisition unit 1002 is further configured to: acquire a page return parameter for the host program, wherein the page return parameter includes the number of pages that need to be rolled back; the determination unit 1004 is further configured to: determine a target rendering engine identifier corresponding to a second target page that needs to be returned to, based on the number of pages that need to be rolled back and a page stack corresponding to the host program; the page processing device of the host program further includes: a sending unit, configured to send a notification message to the rendering engine corresponding to the target rendering engine identifier, so as to roll back the page of the host program to the second target page.
[0104] In some embodiments of the present application, based on the aforementioned scheme, the first rendering engine can render multiple pages; the determining unit 1004 is further configured to: if the rendering engine corresponding to the target rendering engine identifier is the first rendering engine, then determine the number of pages that actually need to be rolled back in the rendering engine corresponding to the target rendering engine identifier according to the number of pages that need to be rolled back and the page stack corresponding to the host program; the sending unit is further configured to: add the number of pages that actually need to be rolled back in the notification message.
[0105] In some embodiments of the present application, based on the aforementioned scheme, the page processing method further includes: if the current page of the host program and the second target page are both pages rendered in the rendering engine corresponding to the target rendering engine identifier, and the rendering engine corresponding to the target rendering engine identifier is the first rendering engine, then the notification message is also used to notify the rendering engine corresponding to the target rendering engine identifier to perform routing animation rendering processing on the second target page.
[0106] In some embodiments of the present application, based on the aforementioned solution, the rendering engine used to render the page of the host program also includes a second rendering engine, and each of the second rendering engines can render a page; the processing unit 1006 is also configured to: if the rendering engine corresponding to the target rendering engine identifier is the second rendering engine, then the second target page is rendered by the host program.
[0107] In some embodiments of the present application, based on the aforementioned scheme, the acquisition unit 1002 is configured to: in response to a trigger operation on a page return control on the host program, or in response to a gesture operation of a page return, obtain a page return parameter containing a set value of the number of pages to be rolled back.
[0108] In some embodiments of the present application, based on the aforementioned scheme, multiple pages can be rendered in the first rendering engine; the acquisition unit 1002 is further configured to: upon receiving a redirection request to redirect the current page on the host program to a specified page, acquire the rendering engine corresponding to the current page; the processing unit 1006 is further configured to: if the rendering engine corresponding to the current page is the first rendering engine, and the type of the specified page is a first rendering engine page, then render the specified page in the first rendering engine.
[0109] In some embodiments of the present application, based on the aforementioned solution, the rendering engine used to render the page of the host program also includes a second rendering engine, and each of the second rendering engines can render one page; the processing unit 1006 is further configured to: if the rendering engine corresponding to the current page is the first rendering engine, and the type of the designated page is a second rendering engine page, then establish the designated page rendered by the second rendering engine at the top of the page stack of the host program, and notify the first rendering engine to roll back one page.
[0110] In some embodiments of the present application, based on the aforementioned solution, the rendering engine used to render the page of the host program also includes a second rendering engine, and each of the second rendering engines can render a page; the processing unit 1006 is further configured to: if the rendering engine corresponding to the current page is the second rendering engine, and the type of the specified page is a first rendering engine page, then delete the current page from the top of the page stack of the host program, and render the specified page through the newly created first rendering engine.
[0111] In some embodiments of the present application, based on the aforementioned scheme, the process in which the processing unit 1006 obtains the page jump parameters of the boarding program includes: receiving a call request sent by the basic library of the boarding program, and obtaining the page jump parameters from the call request; the process in which the processing unit 1006 establishes a page tree corresponding to the boarding program according to the page identifier, and calls the rendering engine corresponding to the rendering engine identifier to render the first target page based on the page tree and the page jump parameters includes: returning the page jump parameters, the rendering engine identifier and the page identifier to the basic library, so as to establish the page tree corresponding to the boarding program through the basic library, and calling the rendering engine corresponding to the rendering engine identifier to render the first target page based on the page tree and the page jump parameters.
[0112] In some embodiments of the present application, based on the aforementioned scheme, multiple pages can be rendered in the first rendering engine; each page rendered by the host program through the first rendering engine corresponds to a different data isolation area, and the routing context corresponding to each page is associated with the data isolation area corresponding to each page, and the routing context contains a page node tree; wherein, operations on the page node tree act on the data isolation area associated with the routing context.
[0113] In some embodiments of the present application, based on the aforementioned scheme, the page jump parameters include a routing type, and the routing type is used to call custom routing parameters of the first target page, and the custom routing parameters include routing animation effects and animation display time.
[0114] Fig.11 A schematic diagram of the structure of a computer system of an electronic device suitable for implementing an embodiment of the present application is shown. The electronic device may be the electronic device running the host program in the aforementioned embodiment.
[0115] It should be noted that Fig.11 The computer system 1100 of the electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0116] like Fig.11As shown, the computer system 1100 may include a central processing unit (CPU) 1101, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 1102 or the program loaded from the storage part 1108 to the random access memory (RAM) 1103, such as executing the method described in the above embodiment. In the RAM 1103, various programs and data required for system operation are also stored. The CPU 1101, the ROM 1102 and the RAM 1103 are connected to each other through the bus 1104. The input / output (I / O) interface 1105 is also connected to the bus 1104.
[0117] The following components can be connected to the I / O interface 1105: an input section 1106 including a keyboard, a mouse, etc.; an output section 1107 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 1108 including a hard disk, etc.; and a communication section 1109 including a network interface card such as a LAN (Local Area Network) card, a modem, etc. The communication section 1109 performs communication processing via a network such as the Internet. A drive 1110 is also connected to the I / O interface 1105 as needed. A removable medium 1111, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 1110 as needed so that a computer program read therefrom is installed into the storage section 1108 as needed.
[0118] In particular, according to an embodiment of the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present application includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program is used to perform the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication section 1109, and / or installed from a removable medium 1111. When the computer program is executed by a central processing unit (CPU) 1101, various functions defined in the system of the present application are executed.
[0119] It should be noted that the computer-readable medium shown in the embodiment of the present application may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a flash memory, an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, a computer-readable storage medium may be any tangible medium containing or storing a computer program, which may be used by an instruction execution system, device or device or used in combination with it. In the present application, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, wherein a computer-readable computer program is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, which may send, propagate, or transmit programs for use by or in conjunction with an instruction execution system, apparatus, or device. The computer program contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.
[0120] The flowchart and block diagram in the accompanying drawings illustrate the possible architecture, functions and operations of the system, method and computer program product according to various embodiments of the present application. Wherein, each box in the flowchart or block diagram can represent a module, a program segment, or a part of the code, and the above-mentioned module, program segment, or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flowchart, and the combination of the boxes in the block diagram or flowchart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and a computer program.
[0121] The units involved in the embodiments described in this application may be implemented by software or hardware, and the units described may also be set in a processor. The names of these units do not, in some cases, constitute limitations on the units themselves.
[0122] As another aspect, the present application also provides a computer-readable medium, which may be included in the electronic device described in the above embodiment; or may exist independently without being assembled into the electronic device. The above computer-readable medium carries one or more computer programs, and when the above one or more computer programs are executed by an electronic device, the electronic device implements the method described in the above embodiment.
[0123] It should be noted that, although several modules or units of the equipment for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiments of the present application, the features and functions of two or more modules or units described above can be embodied in one module or unit. On the contrary, the features and functions of one module or unit described above can be further divided into being embodied by multiple modules or units.
[0124] Through the description of the above implementation methods, it is easy for those skilled in the art to understand that the example implementation methods described here can be implemented by software or by combining software with necessary hardware. Therefore, the technical solution according to the implementation methods of the present application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, and includes several instructions to enable an electronic device to execute the method according to the implementation methods of the present application.
[0125] For example, the electronic device may be an electronic device running a host program, and the electronic device may execute Figure 2 or Figure 4 The page processing method of the host program shown in .
[0126] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the embodiments disclosed herein. The present application is intended to cover any variations, uses or adaptations of the present application, which follow the general principles of the present application and include common knowledge or customary technical means in the art that are not disclosed in the present application.
[0127] It should be understood that the present application is not limited to the precise structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present application is limited only by the appended claims.
Claims
1. A page processing method for a hosted program, characterized in that: The host program runs in a host environment provided by the host program, and the page processing method is executed by the host program. The page processing method includes: Acquire page jump parameters of the host program, where the page jump parameters include address information of a first target page to which the host program needs to jump, and information of custom routing parameters of the first target page; If the first target page is rendered by a first rendering engine that supports custom routing, determining a rendering engine identifier and a page identifier corresponding to the first target page; A page tree corresponding to the hosted program is established according to the page identifier, and a rendering engine corresponding to the rendering engine identifier is called to render the first target page based on the page tree and the page jump parameter.
2. The page processing method of the hosted program according to claim 1, characterized in that: The page processing method further includes: Obtaining a page return parameter for the hosted program, wherein the page return parameter includes the number of pages that need to be rolled back; Determining a target rendering engine identifier corresponding to a second target page to be returned to according to the number of pages to be rolled back and a page stack corresponding to the host program; A notification message is sent to the rendering engine corresponding to the target rendering engine identifier to roll back the page of the hosted program to the second target page.
3. The page processing method of the hosted program according to claim 2, characterized in that: The first rendering engine can render multiple pages; the page processing method also includes: If the rendering engine corresponding to the target rendering engine identifier is the first rendering engine, determining the number of pages that actually need to be rolled back in the rendering engine corresponding to the target rendering engine identifier according to the number of pages that need to be rolled back and the page stack corresponding to the host program; The number of pages that actually need to be rolled back is added to the notification message.
4. The page processing method of the hosted program according to claim 3, characterized in that: The page processing method further includes: If the current page of the host program and the second target page are both pages rendered in the rendering engine corresponding to the target rendering engine identifier, and the rendering engine corresponding to the target rendering engine identifier is the first rendering engine, the notification message is also used to notify the rendering engine corresponding to the target rendering engine identifier to perform routing animation rendering processing on the second target page.
5. The page processing method of the hosted program according to claim 2, characterized in that: The rendering engine for rendering the page of the host program further includes a second rendering engine, each of which can render a page; and the page processing method further includes: If the rendering engine corresponding to the target rendering engine identifier is the second rendering engine, the second target page is rendered with routing animation by the host program.
6. The page processing method of the hosted program according to claim 2, characterized in that: Obtaining page return parameters for the hosted program, including: In response to a trigger operation on a page return control on the host program, or in response to a gesture operation of page return, a page return parameter including a set value of the number of pages to be rolled back is obtained.
7. The page processing method of the hosted program according to claim 1, characterized in that: The first rendering engine can render multiple pages; the page processing method also includes: When receiving a redirection request to redirect a current page on the hosted program to a specified page, obtaining a rendering engine corresponding to the current page; If the rendering engine corresponding to the current page is the first rendering engine, and the type of the designated page is a first rendering engine page, the designated page is rendered in the first rendering engine.
8. The page processing method of the hosted program according to claim 7, characterized in that: The rendering engine for rendering the page of the host program further includes a second rendering engine, each of which can render a page; and the page processing method further includes: If the rendering engine corresponding to the current page is the first rendering engine, and the type of the designated page is a second rendering engine page, the designated page rendered by the second rendering engine is established at the top of the page stack of the host program, and the first rendering engine is notified to roll back one page.
9. The page processing method of the hosted program according to claim 7, characterized in that: The rendering engine for rendering the page of the host program further includes a second rendering engine, each of which can render a page; and the page processing method further includes: If the rendering engine corresponding to the current page is the second rendering engine, and the type of the designated page is a first rendering engine page, the current page is deleted from the top of the page stack of the host program, and the designated page is rendered by the newly created first rendering engine.
10. The page processing method of a hosted program according to claim 1, characterized in that: Acquiring the page jump parameter of the boarding program, comprising: receiving a call request sent by a basic library of the boarding program, and acquiring the page jump parameter from the call request; Establishing a page tree corresponding to the hosted program according to the page identifier, and calling a rendering engine corresponding to the rendering engine identifier to render the first target page based on the page tree and the page jump parameter, including: The page jump parameter, the rendering engine identifier and the page identifier are returned to the basic library, so as to establish a page tree corresponding to the host program through the basic library, and call the rendering engine corresponding to the rendering engine identifier to render the first target page based on the page tree and the page jump parameter.
11. The page processing method of a hosted program according to any one of claims 1 to 10, characterized in that: The first rendering engine is capable of rendering multiple pages; each page rendered by the host program through the first rendering engine corresponds to a different data isolation area, and the routing context corresponding to each page is associated with the data isolation area corresponding to each page, and the routing context contains a page node tree; wherein operations on the page node tree act on the data isolation area associated with the routing context.
12. The page processing method of a hosted program according to any one of claims 1 to 10, characterized in that: The page jump parameter includes a routing type, and the routing type is used to call the custom routing parameters of the first target page. The custom routing parameters include routing animation effects and animation display time.
13. A page processing device for a hosted program, characterized in that: The host program runs in a host environment provided by the host program, and the page processing device is applied to the host program, and the page processing device includes: an acquisition unit configured to acquire page jump parameters of the host program, wherein the page jump parameters include address information of a first target page to which the host program needs to jump, and information of custom routing parameters of the first target page; a determining unit configured to determine a rendering engine identifier and a page identifier corresponding to the first target page if the first target page is rendered by a first rendering engine supporting custom routing; The processing unit is configured to establish a page tree corresponding to the hosted program according to the page identifier, and call a rendering engine corresponding to the rendering engine identifier to render the first target page based on the page tree and the page jump parameter.
14. A computer readable medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the page processing method of the hosted program according to any one of claims 1 to 12 is implemented.
15. An electronic device, characterized in that: include: one or more processors; A memory for storing one or more computer programs, which, when executed by the one or more processors, enables the electronic device to implement the page processing method of the host program as described in any one of claims 1 to 12.
16. A computer program product, characterized in that The computer program product includes a computer program, which is stored in a computer-readable storage medium. A processor of an electronic device reads and executes the computer program from the computer-readable storage medium, so that the electronic device executes the page processing method of the host program according to any one of claims 1 to 12.
Citation Information
Patent Citations
Small program page display method and device, terminal and storage medium
CN111475246A
Page rendering method and device based on applet, equipment and storage medium
CN112861057A
Page stack processing method and device, storage medium and electronic device
CN114089997A
Method and system for realizing TR181 configuration tree of AP router of OpenWrt platform
CN114513405A
Game Rendering Method, Terminal, and Non-Transitory Computer-Readable Storage Medium
US20200082608A1
Cited By
Animation rendering method and device, storage medium and computer equipment
CN121433788A