Applet interaction method and device, equipment and storage medium
Patent Information
- Application Number
- CN202211117412.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-14
- Publication Date
- 2026-10-09
- Estimated Expiration
- 2042-09-14
AI Technical Summary
若小程序A想要使用小程序B的页面功能,小程序A的开发团队需要利用小程序A的技术框架重新实现小程序B的页面功能,这种方式效率较低
[0008] In this embodiment, for the first and second mini-programs implemented using different framework languages, pages in the first mini-program are configured as sub-pages of the second mini-program. The second mini-program includes a host page, and the sub-pages have the same target function controls as the host page. A global object, callable by both the host page and the sub-pages, is set on an intermediate page of the second mini-program. Interaction parameters associated with the target function controls are attached to this global object. When any target function control on the sub-page is triggered, the page function corresponding to that target function control can be displayed through the global object on the intermediate page. Throughout this process, interaction between the first and second mini-programs is achieved based on the global object of the intermediate page. This eliminates the need to develop new modules for each mini-program, improving the interaction efficiency of the mini-programs.
Smart Images

Figure CN115454551B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data processing technology, and in particular to a method, apparatus, device and storage medium for mini-program interaction. Background Technology
[0002] Mini-programs A and B may be developed by different teams, and therefore, the technical frameworks used by different mini-programs are not entirely the same. If mini-program A wants to use the page functions of mini-program B, the development team of mini-program A needs to reimplement the page functions of mini-program B using the technical framework of mini-program A, which is inefficient. Summary of the Invention
[0003] This application provides a method, apparatus, device, and storage medium for mini-program interaction to improve the interaction efficiency of mini-programs.
[0004] This application provides a method for interacting with a mini-program, including: displaying a second page of a second mini-program; wherein the second mini-program further includes a first page, which is generated by configuring a page in the first mini-program as a sub-package page of the second mini-program, the first page and the second page have at least one identical target function control, each target function control is associated with interaction parameters, and the first mini-program and the second mini-program are implemented based on different framework languages; in response to a first operation instruction to switch from the second page to the first page, obtaining the interaction parameters associated with each target function control and loading an intermediate page of the second mini-program, the intermediate page including: a global object pointing to the first page; mounting the interaction parameters associated with each target function control to the global object of the intermediate page and displaying the first page; in response to a second operation instruction on the first page for any target function control, displaying the page function corresponding to any target function control based on the interaction parameters associated with any target function control in the global object.
[0005] This application embodiment also provides a mini-program interaction device, including: a display module, an acquisition module, a loading module, and a mounting module; the display module is used to display a second page of a second mini-program; wherein, the second mini-program further includes a first page, which is generated by configuring a page in the first mini-program as a sub-package page of the second mini-program, the first page and the second page have the same at least one target function control, each target function control is associated with interaction parameters, and the first mini-program and the second mini-program are implemented based on different framework languages; the acquisition module is used to acquire the interaction parameters associated with each target function control in response to a first operation instruction to switch from the second page to the first page; the loading module is used to load an intermediate page of the second mini-program, the intermediate page including: a global object pointing to the first page; the mounting module is used to mount the interaction parameters associated with each target function control to the global object of the intermediate page; the display module is also used to: display the first page; and in response to a second operation instruction on the first page for any target function control, display the page function corresponding to any target function control based on the interaction parameters associated with any target function control in the global object.
[0006] This application also provides a mini-program interaction device, including: a memory and a processor; the memory for storing a computer program; and the processor, coupled to the memory, for executing the computer program, causing the processor to implement the steps in the mini-program interaction method provided in this application.
[0007] This application also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, causes the processor to implement the steps in the applet interaction method provided in this application.
[0008] In this embodiment, for the first and second mini-programs implemented using different framework languages, pages in the first mini-program are configured as sub-pages of the second mini-program. The second mini-program includes a host page, and the sub-pages have the same target function controls as the host page. A global object, callable by both the host page and the sub-pages, is set on an intermediate page of the second mini-program. Interaction parameters associated with the target function controls are attached to this global object. When any target function control on the sub-page is triggered, the page function corresponding to that target function control can be displayed through the global object on the intermediate page. Throughout this process, interaction between the first and second mini-programs is achieved based on the global object of the intermediate page. This eliminates the need to develop new modules for each mini-program, improving the interaction efficiency of the mini-programs. Attached Figure Description
[0009] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings:
[0010] Figure 1 A flowchart illustrating a mini-program interaction method provided as an exemplary embodiment of this application;
[0011] Figure 2 A schematic diagram of a mini-program interaction provided for an exemplary embodiment of this application;
[0012] Figure 3 A schematic diagram of the structure of a mini-program interaction device provided for an exemplary embodiment of this application;
[0013] Figure 4 This is a schematic diagram of the structure of a mini-program interactive device provided as an exemplary embodiment of this application. Detailed Implementation
[0014] To make the objectives, technical solutions, and advantages of this application clearer, the technical solutions of this application will be clearly and completely described below in conjunction with specific embodiments and corresponding drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of them. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0015] To address the issue of low interaction efficiency in related technologies for mini-programs, this application embodiment addresses the problem of low interaction efficiency in mini-programs. For a first mini-program and a second mini-program implemented using different framework languages, pages in the first mini-program are configured as sub-pages of the second mini-program. The second mini-program includes a host page, and the sub-pages have the same target function controls as the host page. A global object, callable by both the host page and the sub-pages, is set on an intermediate page of the second mini-program. Interaction parameters associated with the target function controls are attached to this global object. When any target function control on the sub-page is triggered, the corresponding page function can be displayed through the global object on the intermediate page. Throughout this process, interaction between the first and second mini-programs is achieved based on the global object of the intermediate page. This eliminates the need to develop new modules for each mini-program, thus improving the interaction efficiency of mini-programs.
[0016] The technical solutions provided by the various embodiments of this application are described in detail below with reference to the accompanying drawings.
[0017] Figure 1 This is a flowchart illustrating a mini-program interaction method provided as an exemplary embodiment of this application. Figure 1 As shown, the method includes:
[0018] 101. Display the second page of the second mini-program; wherein, the second mini-program also includes the first page, the first page is generated by configuring the page in the first mini-program as a sub-package page of the second mini-program, the first page and the second page have the same at least one target function control, each target function control is associated with interactive parameters, and the first mini-program and the second mini-program are implemented based on different framework languages;
[0019] 102. In response to the first operation command to switch from the second page to the first page, obtain the interaction parameters associated with each target function control, and load the intermediate page of the second mini program, which includes: a global object pointing to the first page;
[0020] 103. Attach the interactive parameters associated with each target function control to the global object of the intermediate page, and display the first page;
[0021] 104. In response to a second operation instruction on any target functional control on the first page, display the page function corresponding to any target functional control based on the interaction parameters associated with any target functional control in the global object.
[0022] In this embodiment, the first and second mini-programs are developed based on different framework languages. The following examples illustrate the application scenarios of the first and second mini-programs.
[0023] Application Scenario X1: The first mini-program is developed based on the uni-app framework, a unified framework for developing mini-programs, H5, and apps using Vue syntax. The second mini-program is developed based on the Chameleon framework, a multi-platform mini-program development framework. In this application scenario, to improve code reusability, the first and second mini-programs need to reuse functional modules. For example, the first mini-program can configure one of its functional modules as a subpackage of the second mini-program for use by the second mini-program, or the second mini-program can configure one of its functional modules as a subpackage of the first mini-program for use by the second mini-program.
[0024] Application Scenario X2:In the early stages of developing Mini Program A, it was developed using the native language of the platform on which it ran. As Mini Program A's functionality increased, the platform's native language could no longer meet its development needs, leading to the emergence of numerous frameworks, such as mpvue, uni-app, and taro. mpvue is a front-end framework using Vue.js for developing Mini Programs, while taro is a multi-platform development framework that adheres to React syntax. To meet the development requirements of Mini Program A, the original framework needs to be upgraded to obtain the upgraded framework, and Mini Program A will be developed based on this upgraded framework. For ease of description, Mini Program A developed using the original framework will be referred to as the first Mini Program, and Mini Program developed using the upgraded framework will be referred to as the second Mini Program.
[0025] Application Scenario X3: In the early stages of developing Mini Program C, framework language D1 was used. For example, framework language D1 was implemented using the mpvue framework. However, the mpvue framework was not updated for a period of time, while Vue underwent several upgrades during that period. Therefore, developing Mini Program C using the Vue-based mpvue framework may have unforeseen risks. Thus, it is necessary to migrate the framework of Mini Program C, switching its development framework from framework language D1 to framework language D2. For example, framework language D2 can be implemented using the Taro framework. For ease of description and distinction, Mini Program C before framework migration will be referred to as the first Mini Program, and Mini Program C after framework migration will be referred to as the second Mini Program.
[0026] In this embodiment, since mini-programs have a capacity limit, such as 2MB, if the mini-program package size exceeds 2MB, a main package and one or more sub-packages are typically built during mini-program development. The main package usually stores common resources needed by all sub-packages, and the sub-packages are configured according to the developer's needs. When the mini-program starts, it will download the main package by default and launch a page within the main package. When a user needs to access a page within a sub-package, the corresponding sub-package can be downloaded, and then the corresponding page will be displayed. Based on the above, regardless of the application scenario, the first mini-program can be implemented as a sub-package of the second mini-program. When the second mini-program is implemented as a sub-package of the first mini-program, the pages of the sub-package (first mini-program) are displayed based on the main package (second mini-program).
[0027] In this embodiment, when the first mini-program is a sub-package of the second mini-program, when the mini-program starts, it will default to launching the pages within the main package (i.e., the second mini-program). During user interaction, pages within the sub-package (i.e., the first mini-program) will be launched as needed. Since the first and second mini-programs are developed using different framework languages, when they need to interact, the first mini-program cannot recognize the framework language of the second mini-program. Therefore, the first mini-program cannot directly call the functions of the second mini-program, and interaction between the two mini-programs is impossible.
[0028] Based on this, in this embodiment of the application, one or more pages in the first mini-program can be configured as sub-package pages of the second mini-program. Then the second mini-program includes the first page, which is generated by configuring the pages in the first mini-program as sub-package pages of the second mini-program. The framework language for implementing the first page is the framework language used by the first mini-program.
[0029] In this embodiment, the second mini-program also includes a second page, which is a page within the main package of the second mini-program; that is, the second page is implemented as the host page, and the framework language used to implement the second page is the same framework language used by the second mini-program. Both the first and second pages contain functional controls, i.e., controls that can perform certain functions, such as voice call controls, online chat controls, or page sharing controls. The identical functional controls on the first and second pages are referred to as target functional controls. The number of target functional controls contained on the first and second pages is at least one; for example, it can be one or more, such as two, three, or seven, without limitation. The target functional controls may include, but are not limited to, voice call controls, online chat controls, or page sharing controls. Figure 2 The first page is implemented as a sub-package page. The target functional controls contained on the sub-package page are: "Share" control, "WeChat" control and "Telephone" control. The illustration is for example, but it is not limited to these.
[0030] Each target function control is associated with interaction parameters. These parameters can be methods or variables required for interaction between the first and second pages. A method can be understood as a function that implements certain functionalities; in other words, based on the methods in the interaction parameters, functionalities such as voice calls, online chat, or page sharing can be implemented. Variables can be understood as user attributes; in other words, based on the variables in the interaction parameters, some user attribute status information can be obtained, such as whether the user is logged in, whether they have completed real-name authentication, the number of times the user has visited the page, or the number of times the user has clicked a control.
[0031] It should be noted that the interaction parameters associated with each target function control refer to the interaction parameters provided by the second mini-program to the first page. The framework language of these interaction parameters is the framework language of the second mini-program, which the first mini-program corresponding to the first page cannot recognize. Based on this, in this embodiment, when entering the second mini-program, the second page of the second mini-program can be displayed, and a first operation instruction to switch from the second page to the first page can be executed. This first operation instruction can be any operation instruction that can switch from the second page to the first page. For example, it can be a switching control on the second page that points to the first page. This first operation instruction can be implemented as triggering (e.g., clicking, swiping, dragging, etc.) the switching control. When the first operation instruction to switch to the first page is received on the second page, the interaction parameters associated with each target function control can be obtained in response to the first operation instruction, and an intermediate page of the second mini-program can be loaded. This intermediate page includes a global object pointing to the first page. For example, the global object can be a global data object. Both the first and second mini-programs can call this global object, that is, both the framework language corresponding to the first page and the framework language corresponding to the second page can recognize this global object.
[0032] Optionally, after loading the intermediate page of the second mini-program, the intermediate page can be displayed for a preset time, such as 1 second, 2 seconds, or 3 seconds, without limitation. During the display time, the intermediate page may or may not be visible (the display time is so short that the intermediate page cannot be distinguished by the naked eye).
[0033] In this embodiment, after loading the intermediate page of the second mini-program, the interactive parameters associated with each target functional control can be mounted onto the global object of the intermediate page, and the first page is displayed. The first page includes at least one target functional control, and may also include other functional controls (e.g., controls not present on the second page). A second operation instruction can be executed for any target functional control on the first page. The second operation instruction is an operation instruction that calls the function corresponding to the target functional control, such as clicking, double-clicking, sliding, rotating, or dragging, or it can be a voice control instruction for any target functional control; there are no limitations on this. When a second operation instruction is initiated for any target functional control on the first page, in response to the second operation instruction for any target functional control on the first page, the page function corresponding to any target functional control can be displayed based on the interactive parameters associated with that target functional control in the global object.
[0034] Optionally, the implementation method for displaying the page function corresponding to any target function control is not limited. For example, the page function of the target function control corresponding to the second operation instruction can be displayed on the first page; or, for another example, the user can navigate to the third page of the second mini-program and display the page function corresponding to the target function control corresponding to the second operation instruction on the third page.
[0035] For example, each target function control is associated with interactive parameters. For instance, the "WeChat" control is associated with interactive parameters that implement the WeChat function. These parameters could be functions or variables that implement the WeChat function, or functions and variables that implement the video display function. By triggering any target function control, the interactive parameters associated with that target function control can be called based on the global object of the intermediate page, displaying the page function corresponding to that target function control. For example, for... Figure 2 The "WeChat" control in the middle page, when triggered, allows the interaction parameters associated with the "WeChat" control to be called based on the global object of the intermediate page, displaying the online chat function corresponding to the "WeChat" control. For example, the online chat function corresponding to the "WeChat" control can be displayed through a third page provided by the second mini-program, or a pop-up window can be displayed on the first page to display the online chat function corresponding to the "WeChat" control; there are no limitations on this. Figure 2 The "Telephone" control in the middle page can be triggered to call the interactive parameters associated with the "Telephone" control based on the global object of the middle page, so as to display the voice call function corresponding to the "Telephone" control.
[0036] For example, if the target function control is a display control, by triggering the display control, a second operation command for the display control on the first page can be responded to. The interactive parameters associated with the display control can be called based on the global object to obtain the user's status information and display the user's status information on the first page without having to jump to the second page provided by the second mini program.
[0037] In this embodiment, for the first and second mini-programs implemented using different framework languages, pages in the first mini-program are configured as sub-pages of the second mini-program. The second mini-program includes a host page, and the sub-pages have the same target function controls as the host page. A global object, callable by both the host page and the sub-pages, is set on an intermediate page of the second mini-program. Interaction parameters associated with the target function controls are attached to this global object. When any target function control on the sub-page is triggered, the page function corresponding to that target function control can be displayed through the global object on the intermediate page. Throughout this process, interaction between the first and second mini-programs is achieved based on the global object of the intermediate page. This eliminates the need to develop new modules for each mini-program, improving the interaction efficiency of the mini-programs.
[0038] In one alternative embodiment, the method for obtaining the N interaction parameters required for the first page interaction is not limited. An example is given below.
[0039] Example B1: The second page contains a switching control that points to the first page. The first operation instruction to switch from the second page to the first page is to trigger the switching control. When the switching control is triggered, in response to the switching operation, based on the page identifier of the first page, at least one target functional control that is the same as that on the second page is determined. The page identifier of the first page can be the name, ID, or IP address of the first page, etc. The switching control on the second page is bound to the page identifier of the first page. The second mini-program maintains the association relationship between the page identifier of the first page and the functional controls. At the same time, the second mini-program maintains the functional controls on the second page. Therefore, based on the functional controls on the first page and the functional controls on the second page, the target functional control contained in the first page can be determined, that is, at least one target functional control that is the same as that on the second page is contained in the first page. The second mini-program also maintains the correspondence between the page identifier of the second page and the interaction parameters of its associated functional controls. Therefore, based on the page identifier of the second page, the interaction parameters associated with at least one target functional control on the second page can be obtained.
[0040] like Figure 2 As shown, the second page is implemented as the host page, which can be the agent QA's WeChat store. The host page displays the number of visitors to the current page, "share" controls, "chat" controls, "phone" controls, and a list of new homes, including Residence X1 and Residence X2. A sub-package page is associated with Residence X2, which is implemented as a toggle control. When Residence X2 is triggered, the host intermediate page of the host mini-program can be loaded. The host intermediate page corresponds to a global object, on which the interactive parameters required by the sub-package page can be attached, namely the functions and variables corresponding to the "share" control, "chat" control, and "phone" control. After mounting is complete, you can be redirected to the sub-package page provided by the second mini-program. This sub-package page contains detailed information about Residential X2, such as its price, opening date, and address. The sub-package page also includes target function controls: a "Share" control, a "WeChat" control, and a "Phone" control. Triggering any of these target function controls on the sub-package page will display the corresponding page function based on a global object on the intermediate page. For example, if the "Phone" control on the sub-package page is triggered, the corresponding function can be called through the global object to display the voice call function provided by the second mini-program.
[0041] Example B2:Pre-obtain all sub-pages of the second mini-program (including the first page), determine the interaction parameters of all sub-pages, and mount the interaction parameters of all sub-pages of the second mini-program onto the global object of the intermediate page.
[0042] In this embodiment, the implementation of mounting the interaction parameters associated with each target functional control to the global object of the intermediate page is not limited. In one optional embodiment, the interaction parameters associated with each target functional control are mounted to the global object of the intermediate page each time. In another optional embodiment, it is determined whether all interaction parameters associated with at least one target functional control are mounted to the global object of the intermediate page; if there is a first interaction parameter that is not mounted to the global object, then the first interaction parameter is mounted to the global object of the intermediate page. The first interaction parameter is one or more of the interaction parameters associated with at least one target functional control.
[0043] In one optional embodiment, all or part of the pages of the first mini-program are configured as at least one sub-package page of the second mini-program. The at least one sub-package page includes the first page. The configuration of all or part of the pages of the first mini-program as at least one sub-package page of the second mini-program is achieved by the following steps: encapsulating all the pages of the first mini-program into a first mini-program file, or encapsulating part of the pages of the first mini-program into a first mini-program file, wherein the part of the pages of the first mini-program includes the pages in the first mini-program that correspond to the first page. The first mini-program file can be a file with the extension ".zip" or ".tsx", etc. Both the first and second mini-programs can run on a mini-program platform. The language used by the mini-program platform is the target platform's native language. The framework language used by the first and second mini-programs is continuously updated, upgraded, or iterated based on the target platform's native language. The first mini-program file is compiled into a second mini-program file based on the target platform's native language. Both the first and second mini-programs can recognize this target platform's native language. The extension of the second mini-program file can include, but is not limited to, ".WXML (description file)", ".WXSS (style file)", ".JSON (configuration file)", or ".JS (logic file)", etc. Based on the configuration information of the second mini-program file, it is configured as at least one sub-package page of the second mini-program. Optionally, the configuration information includes, but is not limited to, the storage address information, version number information, and name of the second mini-program file.
[0044] It should be noted that the execution subject of each step of the method provided in the above embodiments can be the same device, or the method can be executed by different devices. For example, the execution subject of steps 101 to 103 can be device A; or the execution subject of steps 101 and 102 can be device A, and the execution subject of step 103 can be device B; and so on.
[0045] Furthermore, some processes described in the above embodiments and accompanying drawings include multiple operations appearing in a specific order. However, it should be clearly understood that these operations may not be executed in the order they appear herein, or they may be executed in parallel. The operation numbers, such as 101, 102, etc., are merely used to distinguish different operations and do not represent any execution order. Additionally, these processes may include more or fewer operations, and these operations may be executed sequentially or in parallel. It should be noted that the descriptions such as "first" and "second" in this document are used to distinguish different messages, devices, modules, etc., and do not represent a sequential order, nor do they limit "first" and "second" to different types.
[0046] Figure 3 A schematic diagram of the structure of a mini-program interaction device provided for an exemplary embodiment of this application, such as... Figure 3 As shown, the interactive device of the mini-program includes: a display module 31, an acquisition module 32, a loading module 33, and a mounting module 34.
[0047] The display module 31 is used to display the second page of the second mini-program; wherein, the second mini-program also includes a first page, which is generated by configuring a page in the first mini-program as a sub-package page of the second mini-program, the first page and the second page have the same at least one target function control, each target function control is associated with an interaction parameter, and the first mini-program and the second mini-program are implemented based on different framework languages;
[0048] The acquisition module 32 is used to acquire the interaction parameters associated with each target function control in response to a first operation instruction to switch from the second page to the first page; the loading module 33 is used to load the intermediate page of the second mini-program, the intermediate page including: a global object pointing to the first page;
[0049] The mounting module 34 is used to mount the interaction parameters associated with each target function control to the global object of the intermediate page; the display module 31 is further used to: display the first page; and in response to a second operation instruction on the first page for any target function control, display the page function corresponding to any target function control based on the interaction parameters associated with the any target function control in the global object.
[0050] In an optional embodiment, the acquisition module is specifically configured to: in response to a trigger operation that switches from the second page to the first page, determine, based on the page identifier of the first page, the at least one target functional control contained in the first page that is the same as that on the second page; and acquire, according to the page identifier of the second page, the interaction parameters associated with the at least one target functional control on the second page.
[0051] In an optional embodiment, the mounting module is specifically used to: determine whether all interactive parameters associated with the at least one target function control are mounted to the global object; if there is a first interactive parameter that is not mounted to the global object, then mount the first interactive parameter to the global object of the intermediate page.
[0052] In an optional embodiment, the display module is specifically used to: display the page function of the target function control corresponding to the second operation instruction on the first page, or jump to the third page of the second mini-program and display the page function corresponding to any of the target function controls on the third page.
[0053] In an optional embodiment, all or some pages of the first mini-program are configured as at least one sub-package page of the second mini-program, wherein the at least one sub-package page includes the first page. Configuring all or some pages of the first mini-program as at least one sub-package page of the second mini-program is achieved through the following steps: encapsulating all or some pages of the first mini-program into a first mini-program file, wherein the partial pages include pages in the first mini-program corresponding to the first page; compiling the first mini-program file into a second mini-program file based on the target platform's native language, wherein both the first and second mini-programs can recognize the target platform's native language; and configuring the second mini-program file as at least one sub-package page of the second mini-program according to the configuration information of the second mini-program file.
[0054] In one optional embodiment, the configuration information includes at least: the storage address information, version number information, and name of the second mini-program file.
[0055] In an optional embodiment, after loading the intermediate page of the second mini-program, the display module is further configured to: display the intermediate page of the second mini-program at a preset time.
[0056] For detailed implementation methods of the mini-program interactive device, please refer to the foregoing embodiments, which will not be repeated here.
[0057] The mini-program interaction device provided in this application, for a first mini-program and a second mini-program implemented based on different framework languages, configures a page in the first mini-program as a sub-page of the second mini-program. The second mini-program includes a host page, and the sub-page has the same target function controls as the host page. A global object that can be called by both the host page and the sub-page is set on an intermediate page of the second mini-program. The interaction parameters associated with the aforementioned target function controls are attached to this global object. When any target function control on the sub-page is triggered, the page function corresponding to that target function control can be displayed through the global object on the intermediate page. Throughout the process, the interaction between the first and second mini-programs is realized based on the global object of the intermediate page. This eliminates the need to develop new modules for each mini-program, thus improving the efficiency of mini-program interaction.
[0058] Figure 4 This is a schematic diagram of the structure of a mini-program interactive device provided as an exemplary embodiment of this application. For example... Figure 4 As shown, the device includes a memory 44 and a processor 45.
[0059] Memory 44 is used to store computer programs and can be configured to store various other data to support operation on the applet interactive device. Examples of this data include instructions for any application or method used to operate on the applet interactive device, contact data, phonebook data, messages, pictures, videos, etc.
[0060] The memory 44 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk or optical disk.
[0061] Processor 45, coupled to memory 44, is configured to execute a computer program in memory 44 for: displaying a second page of a second miniprogram; wherein the second miniprogram further includes a first page, the first page being generated by configuring a page in the first miniprogram as a sub-package page of the second miniprogram, the first page and the second page having the same at least one target function control, each target function control being associated with interaction parameters, the first miniprogram and the second miniprogram being implemented based on different framework languages; in response to a first operation instruction to switch from the second page to the first page, obtaining the interaction parameters associated with each target function control and loading an intermediate page of the second miniprogram, the intermediate page including: a global object pointing to the first page; attaching the interaction parameters associated with each target function control to the global object of the intermediate page and displaying the first page; in response to a second operation instruction on the first page for any target function control, displaying the page function corresponding to the any target function control based on the interaction parameters associated with the any target function control in the global object.
[0062] In an optional embodiment, when the processor 45 obtains the interaction parameters associated with each of the target functional controls in response to a first operation instruction to switch from the second page to the first page, it is specifically configured to: in response to a trigger operation to switch from the second page to the first page, determine, based on the page identifier of the first page, the at least one target functional control included in the first page that is the same as that on the second page; and obtain the interaction parameters associated with the at least one target functional control on the second page according to the page identifier of the second page.
[0063] In an optional embodiment, when the processor 45 mounts the interaction parameters associated with each target function control to the global object of the intermediate page, it is specifically configured to: determine whether all the interaction parameters associated with the at least one target function control are mounted to the global object; if there is a first interaction parameter that is not mounted to the global object, then mount the first interaction parameter to the global object of the intermediate page.
[0064] In an optional embodiment, when the processor 45 displays the page function corresponding to any of the target function controls, it is specifically configured to: display the page function of the target function control corresponding to the second operation instruction on the first page, or jump to the third page of the second mini-program and display the page function corresponding to any of the target function controls on the third page.
[0065] In an optional embodiment, all or some pages of the first mini-program are configured as at least one sub-package page of the second mini-program, wherein the at least one sub-package page includes the first page. Configuring all or some pages of the first mini-program as at least one sub-package page of the second mini-program is achieved through the following steps: encapsulating all or some pages of the first mini-program into a first mini-program file, wherein the partial pages include pages in the first mini-program corresponding to the first page; compiling the first mini-program file into a second mini-program file based on the target platform's native language, wherein both the first and second mini-programs can recognize the target platform's native language; and configuring the second mini-program file as at least one sub-package page of the second mini-program according to the configuration information of the second mini-program file.
[0066] In one optional embodiment, the configuration information includes at least: the storage address information, version number information, and name of the second mini-program file.
[0067] In an optional embodiment, after loading the intermediate page of the second mini-program, the processor 45 is further configured to: display the intermediate page of the second mini-program at a preset time.
[0068] For detailed implementation methods of the mini-program interactive device, please refer to the foregoing embodiments, which will not be repeated here.
[0069] The mini-program interaction device provided in this application, for a first mini-program and a second mini-program implemented based on different framework languages, configures a page in the first mini-program as a sub-page of the second mini-program. The second mini-program includes a host page, and the sub-page has the same target function controls as the host page. A global object that can be called by both the host page and the sub-page is set on an intermediate page of the second mini-program. The interaction parameters associated with the aforementioned target function controls are attached to this global object. When any target function control on the sub-page is triggered, the page function corresponding to that target function control can be displayed through the global object on the intermediate page. Throughout the process, the interaction between the first and second mini-programs is realized based on the global object of the intermediate page. This eliminates the need to develop new modules for each mini-program, thus improving the efficiency of mini-program interaction.
[0070] Furthermore, such as Figure 4 As shown, the interactive device of the mini-program also includes: communication component 46, display 47, power component 48, audio component 49 and other components. Figure 4 The diagram only shows a portion of the components and does not imply that the interactive devices for the mini-program only include... Figure 4 The components shown. It should be noted that... Figure 4 The components within the dashed box are optional, not mandatory, and their selection depends on the product form of the device through which the mini-program interacts.
[0071] Accordingly, embodiments of this application also provide a computer-readable storage medium storing a computer program, which, when executed by a processor, enables the processor to perform... Figure 1 The steps in the method shown.
[0072] The above Figure 4 The communication component is configured to facilitate wired or wireless communication between the device containing the communication component and other devices. The device containing the communication component can access wireless networks based on communication standards, such as WiFi, 2G, 3G, 4G / LTE, 5G, or combinations thereof. In one exemplary embodiment, the communication component receives broadcast signals or broadcast-related information from an external broadcast management system via a broadcast channel. In one exemplary embodiment, the communication component further includes a Near Field Communication (NFC) module to facilitate short-range communication. For example, the NFC module may be implemented based on Radio Frequency Identification (RFID), Infrared Data Association (IrDA) technology, Ultra-Wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.
[0073] The above Figure 4 The display includes a screen, which may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen can be implemented as a touchscreen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touches, swipes, and gestures on the touch panel. The touch sensors can sense not only the boundaries of the touch or swipe action, but also the duration and pressure associated with the touch or swipe operation.
[0074] The above Figure 4 The power supply component provides power to the various components of the device in which it resides. The power supply component may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to the device in which it resides.
[0075] The above Figure 4 The audio component can be configured to output and / or input audio signals. For example, the audio component includes a microphone (MIC) configured to receive external audio signals when the device containing the audio component is in an operating mode, such as call mode, recording mode, or voice recognition mode. The received audio signals can be further stored in memory or transmitted via a communication component. In some embodiments, the audio component also includes a speaker for outputting audio signals.
[0076] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0077] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0078] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0079] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0080] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0081] Memory may include non-persistent storage in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.
[0082] Computer-readable media includes both permanent and non-permanent, removable and non-removable media that can store information using any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.
[0083] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0084] The above description is merely an embodiment of this application and is not intended to limit the scope of this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of the claims of this application.
Claims
1. A method for interacting with a mini-program, characterized in that, include: The second page of the second mini-program is displayed; wherein, the second mini-program also includes a first page, which is generated by configuring a page in the first mini-program as a sub-package page of the second mini-program. The first page and the second page have at least one identical target function control, and each target function control is associated with an interaction parameter. The first mini-program and the second mini-program are implemented based on different framework languages; the interaction parameter associated with each target function control includes at least: the method or variable required for the interaction between the first page and the second page; In response to a first operation instruction to switch from the second page to the first page, the interaction parameters associated with each of the target function controls are obtained, and an intermediate page of the second mini-program is loaded. The intermediate page includes a global object pointing to the first page. Both the first mini-program and the second mini-program can call the global object, that is, both the framework language corresponding to the first page and the framework language corresponding to the second page can recognize the global object. The interactive parameters associated with each of the target functional controls are attached to the global object of the intermediate page, and the first page is displayed. In response to a second operation instruction on the first page for any target function control, the page function corresponding to the target function control is displayed by calling the interaction parameters associated with the target function control based on the global object.
2. The method according to claim 1, characterized in that, In response to a first operation instruction to switch from the second page to the first page, the interaction parameters associated with each of the target functional controls are obtained, including: In response to a triggering operation that switches to the first page from the second page, the at least one target function control that is the same as that on the second page is determined based on the page identifier of the first page; Based on the page identifier of the second page, obtain the interaction parameters associated with the at least one target function control on the second page.
3. The method according to claim 1, characterized in that, The interactive parameters associated with each of the target functional controls are attached to the global object of the intermediate page, including: Determine whether all interactive parameters associated with the at least one target functional control are mounted onto the global object; If there is a first interaction parameter that is not attached to the global object, then the first interaction parameter is attached to the global object of the intermediate page.
4. The method according to claim 1, characterized in that, The page functions corresponding to any of the target function controls are displayed, including: The first page displays the page function of the target function control corresponding to the second operation instruction, or jumps to the third page of the second mini-program, where the page function corresponding to any of the target function controls is displayed.
5. The method according to claim 1, characterized in that, All or some pages of the first mini-program are configured as at least one sub-package page of the second mini-program, and the at least one sub-package page includes the first page. This configuration of all or some pages of the first mini-program as at least one sub-package page of the second mini-program is achieved through the following steps: Encapsulate all or part of the pages of the first mini-program into a first mini-program file, wherein the part of the pages includes the pages in the first mini-program that correspond to the first page; The first mini-program file is compiled into a second mini-program file based on the target platform's native language, and both the first and second mini-programs can recognize the target platform's native language; Based on the configuration information of the second mini-program file, the second mini-program file is configured as at least one sub-page of the second mini-program.
6. The method according to claim 5, characterized in that, The configuration information includes at least: the storage address information, version number information, and name of the second mini-program file.
7. The method according to claim 1, characterized in that, After loading the intermediate page of the second mini-program, the following is also included: The intermediate page of the second mini-program is displayed at a preset time.
8. A mini-program interactive device, characterized in that, include: Display module, acquisition module, loading module, and mounting module; The display module is used to display the second page of the second mini-program; wherein, the second mini-program further includes a first page, which is generated by configuring a page in the first mini-program as a sub-package page of the second mini-program. The first page and the second page have at least one identical target function control, and each target function control is associated with an interaction parameter. The first mini-program and the second mini-program are implemented based on different framework languages; the interaction parameter associated with each target function control includes at least: the method or variable required for the interaction between the first page and the second page; The acquisition module is used to acquire the interaction parameters associated with each target function control in response to a first operation instruction to switch from the second page to the first page; the loading module is used to load the intermediate page of the second mini-program, the intermediate page including: a global object pointing to the first page; both the first mini-program and the second mini-program can call the global object, that is, both the framework language corresponding to the first page and the framework language corresponding to the second page can recognize the global object; The mounting module is used to mount the interaction parameters associated with each target function control to the global object of the intermediate page; the display module is also used to: display the first page; and in response to a second operation instruction on the first page for any target function control, call the interaction parameters associated with any target function control based on the global object to display the page function corresponding to any target function control.
9. A mini-program interactive device, characterized in that, include: Memory and processor; The memory is used to store a computer program; the processor is coupled to the memory and is used to execute the computer program, causing the processor to perform the steps of the method according to any one of claims 1-7.
10. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it causes the processor to perform the steps of the method according to any one of claims 1-7.
Citation Information
Patent Citations
Applet cross-application migration method, device, terminal, system and storage medium
CN113805890A
Small program construction method and device
CN114706616A