Page embedding method and related device

By obtaining and rendering the native page and adding it to the mini program container, the problem of slow response speed and poor interactive experience of the mini program is solved, and the user experience is improved.

CN118605986APending Publication Date: 2024-09-06HUNAN HAPPLY SUNSHINE INTERACTIVE ENTERTAINMENT MEDIA CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410740999.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-07
Publication Date
2024-09-06

AI Technical Summary

Technical Problem

Mini programs respond slowly when processing large amounts of interactive content pages, and the interactive experience is not as good as native pages, resulting in poor user experience.

Method used

By obtaining the path of the target page requested to be opened by the mini program, if it is a native page path, obtain and render the native page, and add it to the mini program container to improve loading efficiency and interactive experience.

Benefits of technology

It realizes the direct embedding of native rendering pages into mini programs, improves loading efficiency and interactive experience, and enhances user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118605986A
    Figure CN118605986A
Patent Text Reader

Abstract

The invention discloses a page embedding method and a related device. The page embedding method comprises the following steps: obtaining a page path corresponding to a target page requested to be opened by an applet; if the page path is a native page path, obtaining a native page corresponding to the page path; rendering the native page to obtain a native rendered page; and adding the native rendering page into a container of the applet, so that the applet loads the native rendering page from the container. Therefore, it can be seen that the native rendering page can be directly embedded into the applet, the loading efficiency is high, the interaction experience of the native rendering page is high, and the user experience is improved to a certain extent.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the front-end field, and in particular to a page embedding method and related devices. Background Art

[0002] With the development of mobile Internet and mini-programs, users have higher requirements for the interactive experience of some mini-programs. The advantage of mini-programs is that they can be used and updated immediately. The disadvantage is that for content pages with a large number of interactions, the response speed is slow and the interactive experience is not as good as the native page, resulting in a poor user experience. Summary of the invention

[0003] In view of the above problems, the present invention provides a page embedding method and related devices that overcome the above problems or at least partially solve the above problems.

[0004] In a first aspect, a page embedding method includes:

[0005] Get the page path corresponding to the target page requested to be opened by the mini program;

[0006] If the page path is a native page path, obtaining the native page corresponding to the page path;

[0007] Rendering the native page to obtain a native rendered page;

[0008] The native rendering page is added to the container of the mini program so that the mini program can load the native rendering page from the container.

[0009] Optionally, in some optional implementations, before obtaining the corresponding native page if the page path is a native page path, the method further includes:

[0010] Determine whether the page path is a native page path;

[0011] If the page path carries an identifier of a native page path, determining that the page path is the native page path;

[0012] If the page path does not carry an identifier of a native page path, it is determined that the page path is a mini-program page path.

[0013] Optionally, in some optional implementations, after determining that the page path is a mini-program page path if the page path does not carry an identifier of a native page path, the method further includes:

[0014] The mini program page corresponding to the page path is added to the container of the mini program.

[0015] Optionally, in some optional implementations, rendering the native page to obtain a native rendered page includes:

[0016] According to the type of the native page, a component of a corresponding type is called to render the native page to obtain the corresponding native rendered page.

[0017] In a second aspect, a page embedding device includes: a page path obtaining unit, a native page obtaining unit, a native page rendering unit, and a native page embedding unit;

[0018] The page path obtaining unit is used to obtain the page path corresponding to the target page requested to be opened by the mini program;

[0019] The native page obtaining unit is used to obtain the native page corresponding to the page path if the page path is a native page path;

[0020] The native page rendering unit is used to render the native page to obtain a native rendered page;

[0021] The native page embedding unit is used to add the native rendering page to the container of the mini program so that the mini program can load the native rendering page from the container.

[0022] Optionally, in certain optional implementations, the device further comprises: a path determination unit, a native path determination unit, and a mini-program path determination unit;

[0023] The path judgment unit is used to judge whether the page path is a native page path before obtaining the corresponding native page if the page path is a native page path;

[0024] The native path determination unit is configured to determine that the page path is the native page path if the page path carries an identifier of the native page path;

[0025] The mini-program path determination unit is used to determine that the page path is a mini-program page path if the page path does not carry an identifier of a native page path.

[0026] Optionally, in some optional implementations, the device further includes: a mini-program page adding unit;

[0027] The mini-program page adding unit is used to add the mini-program page corresponding to the page path to the container of the mini-program after determining that the page path is the mini-program page path if the page path does not carry the identifier of the native page path.

[0028] Optionally, in certain optional implementations, the native page rendering unit includes: a native page rendering subunit;

[0029] The native page rendering subunit is used to call a component of a corresponding type to render the native page according to the type of the native page, so as to obtain the corresponding native rendering page.

[0030] In a third aspect, a computer-readable storage medium stores a program, wherein the program, when executed by a processor, implements any of the page embedding methods described above.

[0031] In a fourth aspect, an electronic device comprises at least one processor, and at least one memory and a bus connected to the processor; wherein the processor and the memory communicate with each other via the bus; and the processor is used to call program instructions in the memory to execute any of the page embedding methods described above.

[0032] By means of the above technical solution, a page embedding method and related devices provided by the present invention can obtain the page path corresponding to the target page requested to be opened by the mini program; if the page path is a native page path, then the native page corresponding to the page path is obtained; the native page is rendered to obtain a native rendered page; the native rendered page is added to the container of the mini program so that the mini program can load the native rendered page from the container. It can be seen from this that the present invention can embed the native rendered page directly into the mini program, with high loading efficiency and high interactive experience of the native rendered page, which improves the user experience to a certain extent.

[0033] The above description is only an overview of the technical solution of the present invention. In order to more clearly understand the technical means of the present invention, it can be implemented according to the contents of the specification. In order to make the above and other purposes, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are listed below. BRIEF DESCRIPTION OF THE DRAWINGS

[0034] Various other advantages and benefits will become apparent to those of ordinary skill in the art by reading the detailed description of the preferred embodiments below. The accompanying drawings are only for the purpose of illustrating the preferred embodiments and are not to be considered as limiting the present invention. Moreover, the same reference symbols are used throughout the accompanying drawings to represent the same components. In the accompanying drawings:

[0035] Figure 1 A flow chart of a first page embedding method provided by the present invention is shown;

[0036] Figure 2 A flow chart of a second page embedding method provided by the present invention is shown;

[0037] Figure 3 A flow chart showing a third page embedding method provided by the present invention is shown;

[0038] Figure 4 A flowchart of a fourth page embedding method provided by the present invention is shown;

[0039] Figure 5 A schematic diagram of a page display provided by the present invention is shown;

[0040] Figure 6 A flow chart of a fifth page embedding method provided by the present invention is shown;

[0041] Figure 7 A schematic diagram of the structure of a page embedding device provided by the present invention is shown;

[0042] Figure 8 A structural schematic diagram of an electronic device provided by the present invention is shown. DETAILED DESCRIPTION

[0043] The exemplary embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present invention are shown in the accompanying drawings, it should be understood that the present invention can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided in order to enable a more thorough understanding of the present invention and to enable the scope of the present invention to be fully communicated to those skilled in the art.

[0044] like Figure 1 As shown, the present invention provides a page embedding method, including: S100, S200, S300 and S400;

[0045] S100, obtaining a page path corresponding to a target page requested to be opened by the mini program;

[0046] Optionally, when using the mini program described in the present invention, the user may click to open other pages. After receiving the user's operation instruction, the mini program can parse and obtain the corresponding page path, which is not limited by the present invention.

[0047] S200: If the page path is a native page path, obtain a native page corresponding to the page path;

[0048] Optionally, the present invention may pre-determine a corresponding identifier to distinguish between a native page path and a mini-program page path. For example, the present invention may stipulate that if a page path begins with "native", it indicates that the page path is a native page path; if the page path does not begin with "native", it indicates that the page path is a mini-program page path, and the present invention does not limit this.

[0049] Optionally, generally speaking, one page corresponds to a unique page path, and the corresponding page can be found through the page path, and the present invention does not impose any limitation on this.

[0050] For example, Figure 2 As shown, in some optional embodiments, before S200, the method further includes: S110, S110 and S112;

[0051] S110, determining whether the page path is a native page path;

[0052] Optionally, the present invention may use regular matching or other text matching search methods to match whether there is an agreed identifier in the page path, so as to determine whether the page path is a native page path, and the present invention is not limited to this.

[0053] S111. If the page path carries an identifier of a native page path, determining that the page path is the native page path;

[0054] Optionally, as mentioned above, in order to improve the user experience of the applet, the present invention can directly load the native page when necessary to improve the interactive experience. Therefore, after determining that the above page path is a native page path, the present invention can further perform subsequent S300, and the present invention does not limit this.

[0055] S112: If the page path does not carry an identifier of a native page path, determine that the page path is a mini-program page path.

[0056] Optionally, if it is determined that the above page path is a mini-program page path, the present invention can load the corresponding mini-program page in the existing manner of the mini-program, and the present invention is not limited to this.

[0057] That is, Figure 3 As shown, in some optional embodiments, after S112, the method further includes: S113;

[0058] S113: Add the mini-program page corresponding to the page path to the mini-program container.

[0059] Optionally, the container mentioned in the present invention is a well-known technical concept in the art, and the present invention will not make any detailed description on this. Please refer to the relevant description in the art for details. The present invention does not limit this.

[0060] S300, rendering the native page to obtain a native rendering page;

[0061] Optionally, the present invention does not impose any specific restrictions on the rendering process, and any feasible method belongs to the protection scope of the present invention. Figure 4 As shown, in some optional implementations, the S300 includes: S310;

[0062] S310: According to the type of the native page, call a component of a corresponding type to render the native page to obtain the corresponding native rendering page.

[0063] Optionally, the types of native pages can be divided into: text, pictures, and videos, etc., and the present invention does not limit this. For different types of native pages, the present invention can call components of corresponding types for rendering. For example, for a native page of text type, the present invention can call a textView component for rendering, and the present invention does not limit this.

[0064] S400: Add the native rendering page to the container of the mini program, so that the mini program can load the native rendering page from the container.

[0065] Optionally, after being rendered, the page can be directly loaded into the applet for display. Therefore, the present invention can first place the native rendering page in the container, and when the page needs to be displayed later, it can be directly loaded and displayed from the container, which is more efficient and responsive, and the present invention does not limit this.

[0066] Optionally, the native rendering page mentioned in the present invention is also called a native page. Native pages are interfaces developed using the native development language of each platform. These interfaces can directly access various hardware of the mobile phone, such as the camera, microphone, and GPS, thereby providing a richer and smoother user interaction experience.

[0067] Optionally, the present invention can add the ability to support embedded native pages to the mini program SDK (i.e., add the execution process of the present invention) to solve the problem that some scenarios are not suitable for using mini program pages. In this scenario, the pages are directly handed over to native pages, which can greatly improve the user experience.

[0068] Optional, Figure 5 Shows the applet page ( Figure 5 Mini Program Page) and native rendering page ( Figure 5 The difference between the native page in the native rendering page is that the native rendering page can not only display the content, but also perform various interactions efficiently, and the user experience is high.

[0069] Optionally, in order to further clearly describe the execution process of the present invention, the execution body of the present invention can be divided into two parts: the mini program module and the native page module. The execution process of the mini program module and the native page module can be seen in FIG. Figure 6The flowchart shown, Figure 6 Please refer to the above content for the explanation of each process node, which will not be repeated in this article.

[0070] like Figure 7 As shown, the present invention provides a page embedding device, including: a page path obtaining unit 100, a native page obtaining unit 200, a native page rendering unit 300 and a native page embedding unit 400;

[0071] The page path obtaining unit 100 is used to obtain the page path corresponding to the target page requested to be opened by the mini program;

[0072] The native page obtaining unit 200 is used to obtain the native page corresponding to the page path if the page path is a native page path;

[0073] The native page rendering unit 300 is used to render the native page to obtain a native rendered page;

[0074] The native page embedding unit 400 is used to add the native rendering page to the container of the mini program so that the mini program can load the native rendering page from the container.

[0075] Optionally, in certain optional implementations, the device further comprises: a path determination unit, a native path determination unit, and a mini-program path determination unit;

[0076] The path judgment unit is used to judge whether the page path is a native page path before obtaining the corresponding native page if the page path is a native page path;

[0077] The native path determination unit is configured to determine that the page path is the native page path if the page path carries an identifier of the native page path;

[0078] The mini-program path determination unit is used to determine that the page path is a mini-program page path if the page path does not carry an identifier of a native page path.

[0079] Optionally, in some optional implementations, the device further includes: a mini-program page adding unit;

[0080] The mini-program page adding unit is used to add the mini-program page corresponding to the page path to the container of the mini-program after determining that the page path is the mini-program page path if the page path does not carry the identifier of the native page path.

[0081] Optionally, in some optional implementations, the native page rendering unit 300 includes: a native page rendering subunit;

[0082] The native page rendering subunit is used to call a component of a corresponding type to render the native page according to the type of the native page, so as to obtain the corresponding native rendering page.

[0083] The present invention provides a computer-readable storage medium on which a program is stored. When the program is executed by a processor, any of the page embedding methods described above is implemented.

[0084] like Figure 8 As shown, the present invention provides an electronic device 70, which includes at least one processor 701, and at least one memory 702 and a bus 703 connected to the processor 701; wherein the processor 701 and the memory 702 communicate with each other through the bus 703; the processor 701 is used to call the program instructions in the memory 702 to execute any of the page embedding methods described above.

[0085] In the present invention, relational terms such as first and second, etc. are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "comprise", "include" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the statement "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.

[0086] Each embodiment in this specification is described in a related manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0087] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present invention. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined in the present invention may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown in the present invention, but will conform to the widest scope consistent with the principles and novel features disclosed in the present invention.

[0088] The above description is only a preferred embodiment of the present invention and is not intended to limit the protection scope of the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention are included in the protection scope of the present invention.

Claims

1. A page embedding method, characterized in that: include: Get the page path corresponding to the target page requested to be opened by the mini program; If the page path is a native page path, obtaining the native page corresponding to the page path; Rendering the native page to obtain a native rendered page; The native rendering page is added to the container of the mini program so that the mini program can load the native rendering page from the container.

2. The method according to claim 1, characterized in that Before obtaining the corresponding native page if the page path is a native page path, the method further includes: Determine whether the page path is a native page path; If the page path carries an identifier of a native page path, determining that the page path is the native page path; If the page path does not carry an identifier of a native page path, it is determined that the page path is a mini-program page path.

3. The method according to claim 2, characterized in that After determining that the page path is a mini-program page path if the page path does not carry an identifier of a native page path, the method further includes: The mini program page corresponding to the page path is added to the container of the mini program.

4. The method according to claim 1, characterized in that: The rendering of the native page to obtain a native rendered page includes: According to the type of the native page, a component of a corresponding type is called to render the native page to obtain the corresponding native rendered page.

5. A page embedding device, characterized in that: include: A page path obtaining unit, a native page obtaining unit, a native page rendering unit and a native page embedding unit; The page path obtaining unit is used to obtain the page path corresponding to the target page requested to be opened by the mini program; The native page obtaining unit is used to obtain the native page corresponding to the page path if the page path is a native page path; The native page rendering unit is used to render the native page to obtain a native rendered page; The native page embedding unit is used to add the native rendering page to the container of the mini program so that the mini program can load the native rendering page from the container.

6. The device according to claim 5, characterized in that The device further comprises: a path judgment unit, a native path determination unit and a mini-program path determination unit; The path judgment unit is used to judge whether the page path is a native page path before obtaining the corresponding native page if the page path is a native page path; The native path determination unit is configured to determine that the page path is the native page path if the page path carries an identifier of the native page path; The mini-program path determination unit is used to determine that the page path is a mini-program page path if the page path does not carry an identifier of a native page path.

7. The device according to claim 6, characterized in that The device further comprises: a mini-program page adding unit; The mini-program page adding unit is used to add the mini-program page corresponding to the page path to the container of the mini-program after determining that the page path is the mini-program page path if the page path does not carry the identifier of the native page path.

8. The device according to claim 5, characterized in that The native page rendering unit includes: a native page rendering subunit; The native page rendering subunit is used to call a component of a corresponding type to render the native page according to the type of the native page, so as to obtain the corresponding native rendering page.

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

10. An electronic device, characterized in that: The electronic device includes at least one processor, and at least one memory and a bus connected to the processor; wherein the processor and the memory communicate with each other through the bus; the processor is used to call program instructions in the memory to execute the page embedding method as described in any one of claims 1 to 4.