WO2023178952A1 - Method and apparatus for integrating native program with applet, and device and medium - Google Patents

Method and apparatus for integrating native program with applet, and device and medium Download PDF

Info

Publication number
WO2023178952A1
WO2023178952A1 PCT/CN2022/119712 CN2022119712W WO2023178952A1 WO 2023178952 A1 WO2023178952 A1 WO 2023178952A1 CN 2022119712 W CN2022119712 W CN 2022119712W WO 2023178952 A1 WO2023178952 A1 WO 2023178952A1
Authority
WO
WIPO (PCT)
Prior art keywords
applet
program
page
information
native
Prior art date
Application number
PCT/CN2022/119712
Other languages
French (fr)
Chinese (zh)
Inventor
王钰
陈卓
黄河
谢治民
徐鑫源
叶樟源
黄永生
周继恩
李伟
沈玺
汤之雄
Original Assignee
中国银联股份有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 中国银联股份有限公司 filed Critical 中国银联股份有限公司
Publication of WO2023178952A1 publication Critical patent/WO2023178952A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44505Configuring for program initiating, e.g. using registry, configuration files
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/955Retrieval from the web using information identifiers, e.g. uniform resource locators [URL]
    • G06F16/9566URL specific, e.g. using aliases, detecting broken or misspelled links
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/957Browsing optimisation, e.g. caching or content distillation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4843Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
    • G06F9/4881Scheduling strategies for dispatcher, e.g. round robin, multi-level priority queues
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Definitions

  • This application belongs to the field of data processing, and in particular relates to a method, device, equipment and medium for integrating native programs and applets.
  • Mini programs are lightweight applications that can be used without downloading and installation.
  • the development difficulty is lower than that of native programs. It can reduce the development difficulty and save device memory space on the basis of realizing lightweight functions.
  • due to the characteristics of small programs their functions are relatively simple, and their interaction with users and visual experience cannot be compared with native programs. In other words, mini programs are less effective in terms of interaction with users and visual experience.
  • Embodiments of the present application provide a method, device, equipment and medium for integrating native programs and mini programs, which can improve the interaction between mini programs and users and the visual experience.
  • embodiments of the present application provide a method for integrating native programs and mini programs, including: in response to a switching selection input for a page of a native program in a terminal device, selecting a representative target mini program from a list of mini programs provided by the native program.
  • the applet information of the program ; obtain the long-term static information of the target applet and save it locally; obtain the short-term dynamic information of the target applet, and make the target applet appear in the applet of the terminal device based on the long-term static information and short-term dynamic information of the target applet.
  • Run in the program container and switch the display page from the page of the native program to the page of the target applet; in response to the applet startup input, the native program is called to read the long-term static information of the target applet, and the main task and root of the native program are The page is set as an applet container so that the terminal device displays the page of the target applet through the native program.
  • embodiments of the present application provide a method for integrating native programs and mini programs, including: a selection module, configured to select input in response to switching selection input of the page of the native program in the terminal device, and select the mini program provided by the native program in the terminal device.
  • the acquisition module is used to obtain the long-term static information of the target applet and save it locally; the acquisition module is also used to obtain the short-term dynamic information of the target applet; the control module is used to obtain the target applet's short-term dynamic information based on The long-term static information and short-term dynamic information of the target applet enable the target applet to run in the applet container of the terminal device and switch the display page from the page of the native program to the page of the target applet; the control module is also used to respond to The applet starts the input, calls the native program to read the long-term static information of the target applet, and sets the main task and root page of the native program as the applet container, so that the terminal device displays the page of the target applet through the native program.
  • embodiments of the present application provide a terminal device, including: a processor and a memory storing computer program instructions; when the processor executes the computer program instructions, the integration method of the native program and the applet of the first aspect is implemented.
  • embodiments of the present application provide a computer-readable storage medium.
  • Computer program instructions are stored on the computer-readable storage medium.
  • the integration method of the native program and the applet of the first aspect is implemented. .
  • Embodiments of the present application provide a method, device, equipment and medium for integrating native programs and applets.
  • the user can perform switching selection input on the page of the native program in the terminal device, and the terminal device responds to the switching selection input to determine the target applet that needs to be switched.
  • the program saves the long-term static information of the target applet locally, obtains the short-term dynamic information of the target applet, and makes the target applet run in the applet container based on the long-term static information and short-term dynamic information of the target applet.
  • the page of the native program is switched to the page of the target applet, and the page of the target applet is displayed using the native program.
  • the terminal device calls the native program to read the long-term static information, sets the main task and root page of the native program as the mini program container, and displays the target mini program through the native program
  • the page enables the mini program to be consistent or consistent with the native program in terms of interaction with the user and visual experience, and improves the interaction between the mini program and the user and the visual experience.
  • Figure 1 is a schematic diagram of an example of an application scenario of the integration method of native programs and mini programs provided by the embodiment of the present application;
  • Figure 2 is a flow chart of an embodiment of the integration method of native programs and mini programs provided by this application;
  • Figure 3 is a flow chart of an example of the process of switching from a native program page to a mini program page provided by an embodiment of the present application
  • Figure 4 is a schematic diagram of the logical architecture of an example of coexistence of native programs and applets in a terminal device provided by an embodiment of the present application;
  • Figure 5 is a flow chart of an example of the native program restart process provided by the embodiment of the present application.
  • Figure 6 is a flow chart of another embodiment of the integration method of native programs and mini programs provided by this application.
  • Figure 7 is a flow chart of an example of the process of starting an applet through the desktop icon of the applet provided by the embodiment of the present application;
  • Figure 8 is a flow chart of another embodiment of the integration method of native programs and mini programs provided by this application.
  • Figure 9 is a flow chart of an example of the process of starting a mini program through link information provided by the embodiment of the present application.
  • Figure 10 is a flow chart of yet another embodiment of the integration method of native programs and mini programs provided by this application.
  • Figure 11 is a flow chart of an example of the process of starting a mini program through push information provided by the embodiment of the present application;
  • Figure 12 is a schematic structural diagram of an embodiment of an integrated device for native programs and applets provided by this application;
  • Figure 13 is a schematic structural diagram of an embodiment of the terminal device provided by this application.
  • terminal devices such as mobile phones, tablet computers, and electronic computers
  • Users can complete various functions through terminal devices.
  • users can complete various functions such as document processing, payment, instant messaging, and image processing through terminal devices.
  • the terminal device can realize various functions through native programs.
  • native programs need to be downloaded and installed, occupy a large amount of storage space on the terminal device, and are difficult to develop.
  • Mini programs are lightweight applications that can be used without downloading and installation.
  • the development difficulty is lower than that of native programs. It can reduce the development difficulty and save device memory space on the basis of realizing lightweight functions.
  • mini programs do not require downloading and installation that while reducing the difficulty of development and saving device memory space, they also make mini programs relatively simple in function and unable to implement more complex functions. In terms of interaction with users and visual experience, etc. Compared to native programs.
  • Embodiments of the present application provide a method, device, equipment, and medium for integrating native programs and mini programs.
  • the mini program can be selected from the mini program list provided by the native program, and the native program can be used to display the page of the mini program. After the display page has been switched to the page of the mini program and the native program is closed, when the mini program is launched again, the user does not need to enter the page of the native program first and then the page of the mini program. The user can directly enter the page of the mini program through the native program. , thereby making the interaction between the mini program and the user and the visual experience effects consistent or tending to be consistent with the native program effects, and improving the effects of the mini program on the user interaction and visual experience.
  • FIG. 1 is a schematic diagram of an example of an application scenario of the integration method of native programs and mini programs provided by the embodiment of the present application.
  • the user 11 can operate the terminal device 12, and the terminal device 12 has native programs installed.
  • the terminal device 12 may include a mobile phone, a tablet computer, an electronic computer, a wearable device, etc., which is not limited here.
  • the terminal device 12 can communicate and interact with the background system 14 of the native program through the gateway 13, and the terminal device 12 can also communicate and interact with the applet platform 15 through the gateway 13 to obtain applet information.
  • the operator of the native program can manage and maintain the backend system 14 of the native program through the management system 16 .
  • Users of the mini program platform 15 can upload the developed mini programs to the mini program platform 15 and manage and maintain the mini programs they have developed.
  • FIG. 2 is a flow chart of an embodiment of the integration method of native programs and mini programs provided by this application. As shown in Figure 2, the program and applet integration method may include steps S201 to S204.
  • step S201 in response to a switching selection input to the page of the native program in the terminal device, applet information representing the target applet is selected from the applet list provided by the native program.
  • the terminal device currently displays the page of the native program.
  • the mini program list can be evoked.
  • the page of the native program includes a human-computer interaction control that evokes a list of mini-programs.
  • the human-computer interaction control is clicked, the display of the mini-program list is triggered.
  • the applet list may include applet information for at least one applet.
  • Mini program information can characterize the mini program.
  • the mini program information may include the mini program name, the mini program version name, the mini program type, the mini program graphic logo, the mini program page thumbnail, the mini program introduction, the mini program logo, the native program version supported by the mini program, the mini program One or more of the following information: owner identification, mini program priority, etc.
  • the mini program type can represent the function type of the mini program, such as payment type, game type, shopping type, etc., which is not limited here.
  • the mini program graphic logo can be implemented as the mini program graphic logo or the Uniform Resource Locator (URL) address of the mini program graphic logo in the mini program list.
  • URL Uniform Resource Locator
  • the mini program page thumbnail can be implemented as the mini program page thumbnail or the URL address of the mini program page thumbnail in the mini program list.
  • the mini program page thumbnail can be displayed.
  • the applet identifier is used to identify the applet, and can be an identifier such as the number of the applet. In some examples, the applet identifier can be an encryption identifier, which is not limited here.
  • the mini program owner identifier can be the organization number of the mini program developer.
  • the priority of the mini program can be the priority set by the owner of the native program or the priority set by the owner of the mini program platform, which is not limited here; in some examples, the priority of the mini program can be represented by a number, and the value of the number is higher. The larger the value, the higher the priority. Mini Program information allows users to better understand Mini Programs and facilitates users to make choices.
  • the applet list may be obtained.
  • the applet list can be stored in the terminal device.
  • the terminal device can directly obtain the applet list from itself.
  • the terminal device may send an applet acquisition request to the background system of the native program to obtain the applet list from the background system of the native program.
  • the mini program list may include mini program information of the mini programs arranged in descending order of recommendation. Recommendation can be determined based on the user's function usage information.
  • Function usage information includes information related to users' use of native program functions and information related to users' use of mini program functions. Based on the function usage information, the user's function usage can be profiled to obtain the user's function usage habits, and then based on the user's function usage habits, the recommendation degree of the mini program can be obtained.
  • Function usage information may include one or more of the following: mini program version name, mini program region, mini program priority, mini program binding resource information, mini program attention volume, payment information, payment institution information, user personal information information.
  • the level of recommendation can be determined based on this piece of information.
  • the function usage information includes a mini program version name.
  • the mini program version name indicates that the closer the mini program is to the native program, the higher the recommendation of the mini program. For example, the recommendation degree of a mini program that is a derivative of a native program is higher than that of a mini program that has nothing to do with the native program.
  • the function usage information includes the region where the mini program belongs. The closer the current geographical location of the terminal device is to the region where the mini program belongs, the higher the recommendation degree of the mini program. For example, the recommendation degree of a Mini Program whose region includes the current geographical location of the terminal device is higher than the recommendation degree of an Mini Program whose region does not include the current geographical location of the terminal device.
  • the function usage information includes the applet priority.
  • the higher the applet priority the higher the applet recommendation.
  • the recommendation degree of a mini program with a mini program priority of 5 is higher than the recommendation degree of a mini program with a mini program priority of 2.
  • the function usage information includes applet binding resource information.
  • Mini program binding resource information can be obtained from the resource binding completion page when the user completes resource binding, which is not limited here.
  • Mini program binding resource information is information related to mini program binding resources.
  • mini program binding resource information may include mini program binding resources, the frequency of mini program binding resources being used by users, the number of mini program binding resources, etc. . The more frequently the resources bound to a mini program are used by users, the higher the recommendation degree of the mini program; the greater the number of resources bound to a mini program, the higher the recommendation degree of the mini program.
  • the resource bound to the mini program is a payment card or merchant bound to the mini program.
  • the recommendation degree of the mini program matching the payment card or merchant bound to the mini program is higher than that of the payment card or merchant not bound to the mini program.
  • the recommendation degree of the matching mini program; the recommendation degree of the mini program with high usage frequency of the payment card or merchant bound to the mini program is higher than the recommendation degree of the mini program with low usage frequency of the payment card or merchant bound to the mini program; and
  • the recommendation degree of a Mini Program with a large number of payment cards or merchants bound to the Mini Program is higher than that of a Mini Program with a small number of payment cards or merchants bound to the Mini Program.
  • the function usage information includes the number of followers of the mini program.
  • the recommendation degree of a mini program with a high number of mini program followers is higher than the recommendation degree of a mini program with a low number of mini program followers.
  • feature usage information includes payment information.
  • the payment information can be obtained from the payment completion page when the user completes the payment, which is not limited here.
  • Payment information is information related to user payment, and payment information may include payment cards or payment merchants. For example, if the payment information includes a payment card, the recommendation degree of the mini program that matches the payment card is higher than the recommendation degree of the mini program that does not match the payment card; if the payment information includes a payment merchant, the recommendation degree of the mini program that matches the payment merchant is higher. degree, higher than the recommendation degree of mini programs that do not match the payment merchant.
  • the function usage information includes payment affiliation information.
  • the payment institution information can be obtained from the payment details page when the user views the payment details, and is not limited here.
  • the payment institution information may represent the institution to which the payment belongs. For example, the recommendation degree of a mini program that matches the payment institution information is higher than the recommendation degree of a mini program that does not match the payment institution information.
  • feature usage information includes user personal information.
  • the recommendation degree of the mini program suitable for the user's personal information can be obtained.
  • the recommendation degree of the mini program that matches the user's personal information is higher than the recommendation degree of the mini program that does not match the user's personal information. For example, if the user's personal information includes age, and the age in the user's personal information is 26, then the recommendation degree of a mini program matching the age group of 20 to 30 years old is higher than the recommendation degree of a mini program matching the age group of 40 to 50 years old. .
  • the degree of recommendation can be determined based on the two or more pieces of information and the weight corresponding to each piece of information.
  • the applet list may include applet information for a first type of applet and/or applet information for a second type of applet.
  • the first category of mini programs includes mini programs that are mini-programmed versions of native programs.
  • the mini-programmed version of a native program refers to a specific version derived from a native program.
  • the mini-programmed version of a native program is a specific version of a mini program derived from a native program.
  • the first type of mini-program may include a native program. Simple version of the program, mini programs based on native programs that retain and enhance some functions for specific groups of people, etc. are not limited here.
  • the embodiment of the present application implements a derivative version of the native program through a mini program.
  • the users do not need to download the derivative version of the native program and can switch to the corresponding derivative version of the mini program according to their own needs.
  • the storage space occupied in the terminal device is reduced, and the applet can also reduce the difficulty of developing derivative versions of the native program.
  • the effects of the mini-programmed version of the native program on user interaction and visual experience can be consistent or similar to those of the native program, thereby further improving the user experience.
  • the second category of mini programs includes mini programs that are owned by a different party than the original program.
  • Native programs can also integrate mini programs from different owners.
  • the terminal device receives the user's operation input and can evoke a mini program in the native program whose owner is different from the owner of the native program.
  • the functions of mini programs whose owners are different from those of the native program can be similar to the functions of the native program, or they can be different from the functions of the native program, which is not limited here.
  • the native program is an application of a payment platform, and the mini program list of the native program may include mini program information of multiple banks' mini programs.
  • the mini program list of the native program may include the itinerary code to query the mini program information of the mini program.
  • the list of mini programs that the native program can provide may include the mini program information of the simplified version of the program A1, mini program B1, the mini program information of the senior version of the program A1, B2, and the mini program C1 of Bank1.
  • the toggle selection input is used to select an applet in the list of applets.
  • the target applet is the applet selected in the applet list for the toggle selection input.
  • the switching selection input can be single click input, multiple click input, sliding input, etc., which is not limited here.
  • step S202 long-term static information of the target applet is obtained and saved locally.
  • Long-term static information is information that is effective for a long time in a mini program and is relatively difficult to change.
  • long-term static information may include the mini program identifier, configuration information of the mini program, fixed display information of the mini program, etc., which is not limited here.
  • the terminal device can request long-term static information of the target applet from the applet platform.
  • step S203 obtain the short-term dynamic information of the target applet, make the target applet run in the applet container of the terminal device based on the long-term static information and short-term dynamic information of the target applet, and change the display page from the page of the native program Switch to the page of the target applet.
  • Short-term dynamic information is real-time information of a mini program that is relatively easy to change.
  • short-term dynamic information may include policy lists, URL addresses of dynamically changing pages, etc., which is not limited here.
  • the terminal device can request short-term dynamic information of the target applet from the applet platform.
  • the applet container can be regarded as the framework of the applet.
  • Long-term static information and short-term dynamic information work together to enable the mini program to run in the mini program container.
  • the page of the target applet can be obtained based on the long-term static information and short-term dynamic information of the target applet, so that the display page of the native program can be switched from the page of the native program to the page of the target applet. page. Specifically, the page of the native program can be switched to the homepage of the target applet.
  • step S204 in response to the applet startup input, the native program is called to read the long-term static information of the target applet, and the main task and root page of the native program are set as the applet container, so that the terminal device displays the target applet through the native program. program page.
  • the applet startup input is an input operation used to start the applet.
  • the terminal device receives the applet startup input, calls the native program, reads the long-term static message of the target applet saved in step S202 through the native program, and saves the main program of the native program.
  • the task and root page are set as mini program containers, so that after the native program is triggered and opened, the main task is to run the target mini program.
  • the root page that is, the first page loaded is the page of the target mini program, so that after the native program is called and opened, the terminal The device directly displays the page of the target applet.
  • the terminal device may determine whether the applet container is open.
  • the mini program container needs to be opened so that the mini program can run. By determining whether the mini program container is open, it can be determined whether the displayed page of the native program after the latest switch is the page of the mini program or the page of the native program.
  • the applet container If the applet container is open, it can be determined that the display page of the native program after the latest switch is the page of the applet, which means that the applet can be displayed directly through the native program; if the applet container is not open, it can be determined The displayed page of the native program after the latest switch is the page of the native program. If the applet container is open, read the long-term static information of the target applet.
  • the address of the front page of the target mini program can be obtained, so that the terminal device Display the front page of the target applet before displaying the page of the target applet.
  • the terminal device can request the mini program platform to obtain the address of the front page of the target mini program.
  • the front page of a mini program is a page that is displayed before the page of the mini program during the startup process of the mini program.
  • the front page may include an opening page and/or an advertising page, etc.
  • the front page can be displayed according to the address of the front page before the display page is switched to the page of the target applet.
  • the front page can fill in the gap that may occur when the page of the native program is switched to the page of the target applet. Shows blank.
  • the terminal device can display the page of the target applet through the native program according to the address of the front page. Front page to further realize the display effect of mini program native program.
  • the user can perform a switching selection input on the page of the target applet, and the terminal device calls the native program from the terminal device in response to the switching selection input.
  • Select the program information of the native program from the updated list of mini programs provided, and switch the display page of the native program from the page of the target mini program to the page of the native program. Specifically, switch from the page of the target mini program to the home page of the native program. .
  • the updated applet list can include program information for native programs.
  • Program information may include one or more of program name, program version, program type, program graphic logo, program page thumbnail, program introduction description, program logo, program owner logo and other information, which is not limited here.
  • the page of the native program when the display page of the native program is the page of the target applet, the page of the native program can be loaded asynchronously to quickly switch from the page of the target applet to the page of the native program. Complete the display of the native program page.
  • the user can perform switching selection input on the page of the native program in the terminal device, and the terminal device responds to the switching selection input to determine the target applet that needs to be switched, and saves the long-term static information of the target applet locally. And obtain the short-term dynamic information of the target applet, based on the long-term static information and short-term dynamic information of the target applet, make the target applet run in the applet container, switch from the page of the native program to the page of the target applet, and use the native program Display the page of the target applet.
  • the terminal device calls the native program to read the long-term static information, sets the main task and root page of the native program as the mini program container, and displays the target mini program through the native program
  • the page enables the mini program to be consistent or consistent with the native program in terms of interaction with the user and visual experience, and improves the interaction between the mini program and the user and the visual experience.
  • the method of the embodiment of the present application can be used to call the native program to switch and display any one of the mini program lists, thereby realizing a native program. The effect of coexistence of multiple small program-like native programs in the program.
  • FIG. 3 is a flowchart of an example of the process of switching from a native program page to a mini program page provided by an embodiment of the present application.
  • the process of switching the page of the native program to the page of the applet may include steps S301 to step S317.
  • step S301 the terminal device receives a startup input for the native program and displays the homepage of the native program.
  • step S302 the terminal device determines the target applet in response to the switching selection input.
  • step S303 the terminal device obtains and locally saves the long-term static information of the target applet.
  • step S304 if the user does not pay attention to the target applet, the terminal device adds attention to the target applet.
  • step S305 the terminal device obtains the address of the front page of the target applet.
  • step S306 the terminal device determines whether the applet container is in an open state. If the applet container is open, jump to step S308; if the applet container is not open, jump to step S307.
  • step S307 the terminal device closes the tasks related to the applet in the native program and jumps to step S308.
  • step S308 the terminal device returns to the home page of the native program.
  • step S309 the terminal device opens the applet container and starts the target applet.
  • step S310 the terminal device determines whether the user's login to the target applet is successful. If the login is successful, jump to step S311; if the login fails, jump to step S309, or prompt the user to log in manually.
  • step S311 the terminal device displays the loading page.
  • step S312 the terminal device obtains short-term dynamic information of the target applet.
  • step S313 the terminal device determines whether the short-term dynamic information is successfully obtained. If the acquisition is successful, jump to step S315; if the acquisition fails, jump to step S314.
  • step S314 the terminal device sends a prompt message indicating that the short-term dynamic information acquisition failed.
  • step S315 the terminal device caches short-term dynamic information.
  • step S316 the terminal device loads the target applet and runs the target applet in the applet container.
  • step S317 the terminal device displays the homepage of the target applet through a native program.
  • steps S301 to S317 may be omitted, or the order of the steps may be appropriately changed, which is not limited here.
  • the applet can use the common functions of the native program while the terminal device is running.
  • General functions are functions that are required by native programs and mini programs.
  • general functions may include encryption functions, decryption functions, network request functions, local access functions, user data management functions, terminal device hardware capability usage functions, etc.
  • One or more items are not limited here.
  • the applet container can be provided with an application programming interface (Application Programming Interface, API). This API is used by the applet in the applet container to call the common functions of the native program.
  • the mini program can call the common functions of the native program through the API of the mini program container.
  • FIG. 4 is a schematic logical architecture diagram of an example of coexistence of native programs and applets in a terminal device provided by an embodiment of the present application.
  • native programs, mini programs 1, mini programs 2, and mini programs 3 can be run on the terminal device.
  • the terminal device has a mini program container, and the mini program container has API and user interface (UI) components.
  • the common functions of the native program can include encryption and decryption functions, network request functions, local access functions, user data management functions, and hardware capabilities. Usage functions and other features.
  • Mini Program 1, Mini Program 2, and Mini Program 3 can call the common functions of native programs through APIs while the Mini Program container is running.
  • the methods of starting the mini program triggered by the mini program startup input are also different.
  • the following uses different scenarios as examples to illustrate the integration method of native programs and mini programs.
  • the applet startup input includes a startup input to a native program in the terminal device.
  • the terminal device will call the native program to read the last time
  • the long-term static information of the target applet is saved when the native program is opened and switched to the target applet page, and the main task and root page of the native program are set as the applet container, so that the display page of the native program is the homepage of the target applet.
  • FIG. 5 is a flow chart of an example of a native program restart process provided by an embodiment of the present application. As shown in FIG. 5 , the process of restarting the native program may include steps S401 to S415.
  • step S401 the terminal device starts the native program in response to the user's input to start the native program.
  • step S402 the terminal device loads native program running logic.
  • step S403 the terminal device determines whether the display page of the last startup of the native program has been switched to the page of the applet. If the native program has not switched to the page of the mini program when it was launched last time, jump to step S404; if the native program has been switched to the page of the mini program when it was launched last time, jump to step S405.
  • step S404 the terminal device displays the home page of the native program.
  • step S405 the terminal device starts the target applet.
  • step S406 the terminal device asynchronously loads the home page of the native program so that it can be quickly switched when it is necessary to switch back to the page of the native program.
  • step S407 the terminal device loads the front page of the target applet.
  • step S408 the terminal device determines whether the user's login to the target applet is successful. If the login is successful, jump to step S409; if the login fails, jump to step S405, or prompt the user to log in manually.
  • step S409 the terminal device displays the loading page.
  • step S410 the terminal device obtains short-term dynamic information of the target applet.
  • step S411 the terminal device determines whether the short-term dynamic information is successfully obtained. If the acquisition is successful, jump to step S413; if the acquisition fails, jump to step S412.
  • step S412 the terminal device sends a prompt message indicating that the acquisition of short-term dynamic information failed.
  • step S413 the terminal device caches short-term dynamic information.
  • step S414 the terminal device loads the target applet and runs the target applet in the applet container.
  • step S415 the terminal device displays the homepage of the target applet through a native program.
  • the terminal device can display the homepage of the target applet through the native program by setting the main task and root page of the native program as the applet container.
  • steps S401 to S415 may be omitted, or the order of the steps may be appropriately changed, which is not limited here.
  • the applet startup input includes a startup input to a desktop icon of the applet displayed by the terminal device. Users can create a desktop icon for the mini program on the terminal device, and quickly call up the native program and enter the mini program through the desktop icon of the mini program.
  • Figure 6 is a flow chart of another embodiment of the integration method of native programs and mini programs provided by this application. The difference between Figure 6 and Figure 2 is that step S204 in Figure 2 can be specifically refined into steps S2041a to step S2044a in Figure 6 .
  • the integration method of native programs and mini programs shown in Figure 6 can also include step S205 and step S206.
  • step S2041a in response to a startup input to the desktop icon of the applet displayed on the terminal device, jump to the transfer page.
  • the startup input to the desktop icon of the applet is used to launch the applet corresponding to the desktop icon.
  • the startup input may specifically include click input on desktop icons, long press input, etc., which is not limited here.
  • the terminal device When the terminal device receives the startup input for the desktop icon of the applet, the terminal device will first jump to the transfer page, and then jump to other pages from the transfer page.
  • the transfer page can be a transparent page and not displayed explicitly.
  • the desktop icon of the mini program can be generated when the display page of the native program is switched to the page of the mini program.
  • the terminal device can respond to the desktop icon generation input of the applet page, jump to the icon generation transfer page, trigger the generation and display of the desktop icon of the applet on the terminal device.
  • the icon generation transfer page can be an H5 page or other types of pages, which is not limited here.
  • step S2042a it is determined whether the applet container is in an open state.
  • the mini program container When the display page of the native program is switched to the page of the mini program, the mini program container will be opened. When the display page of the native program is switched to the page of the native program, the applet container will be closed. You can determine whether the display page of the native program has been switched to the page of the mini program before by determining whether the mini program container is open.
  • step S2043a when the applet container is open, jump from the transfer page to the native program, read the long-term static information of the target applet, and set the main task and root page of the native program as the applet container.
  • the applet container is open, which means that the display page of the native program has been switched to the page of the applet before. You can jump from the transfer page to the native program to call the native program to read the long-term static information of the target applet that was previously saved locally. .
  • step S2044a if the applet corresponding to the desktop icon is the target applet, the page of the target applet is displayed.
  • the terminal device can display the page of the target applet through the native program. From the perspective of user experience, after the user enters the startup input for the desktop icon of the mini program, what opens is the display page of the native program, and the display page is the page of the target mini program. Specifically, the display page is the homepage of the target mini program.
  • whether the applet corresponding to the desktop icon is the target applet can be determined by whether the applet ID of the applet corresponding to the desktop icon is consistent with the applet ID previously stored locally in long-term static information.
  • step S205 if the applet corresponding to the desktop icon is not the target applet, jump from the page of the target applet to the page of the applet corresponding to the desktop icon.
  • the long-term static information and short-term dynamic information of the applet corresponding to the desktop icon can be obtained.
  • the main task and root page of the native program have been set as the applet container.
  • the page of the applet corresponding to the desktop icon can be displayed through the native program to jump from the page of the target applet. Go to the page of the applet corresponding to the desktop icon.
  • the page of the target applet can be used as a transfer page that is not displayed explicitly.
  • the terminal device can first display the page of the target applet through a native program, and then receive the user's switching input. In response to the switching input, the terminal device can obtain the long-term static information and short-term dynamic information of the applet corresponding to the desktop icon, so that Run the applet corresponding to the desktop icon in the applet container, and display the page of the applet corresponding to the desktop icon through the native program, so as to jump from the page of the target applet to the page of the applet corresponding to the desktop icon.
  • step S206 when the applet container is not in an open state, the applet corresponding to the desktop icon is jumped from the transfer page and loaded.
  • the applet container is not open, which means that the display page of the native program has been switched to the page of the native program before.
  • the applet can be loaded and run according to the ordinary applet loading method.
  • FIG. 7 is a flowchart of an example of the process of starting an applet through the desktop icon of the applet provided by the embodiment of the present application. As shown in Figure 7, the process of starting the applet through the desktop icon of the applet may include steps S501 to S516.
  • step S501 the terminal device jumps to the transfer page in response to the startup input of the desktop icon of the applet.
  • step S502 the terminal device determines whether the display page of the last startup of the native program has been switched to the page of the applet. If the native program has not switched to the page of the mini program when it was launched last time, jump to step S503; if the native program has been switched to the page of the mini program when it was launched last time, jump to step S504.
  • step S503 the terminal device loads the applet corresponding to the desktop icon according to the ordinary applet loading method and runs it.
  • step S504 the terminal device starts the applet corresponding to the desktop icon.
  • step S505 the terminal device determines whether the user's login to the applet corresponding to the desktop icon is successful. If the login is successful, jump to step S506; if the login fails, jump to step 504, or prompt the user to log in manually.
  • step S506 the terminal device displays the loading page.
  • step S507 the terminal device determines whether the applet corresponding to the desktop icon is the target applet based on the locally stored long-term static information; if the applet corresponding to the desktop icon is the target applet, jump to step S508; if the applet corresponding to the desktop icon is the target applet, The applet is not the target applet, jump to step S510.
  • the page of the mini program that the native program was previously switched to is the page of the target mini program.
  • step S508 the terminal device obtains short-term dynamic information of the applet corresponding to the desktop icon.
  • step S509 the terminal device determines whether the short-term dynamic information is successfully obtained. If the acquisition is successful, jump to step S513; if the acquisition fails, jump to step S512.
  • step S510 the terminal device obtains long-term static information and short-term dynamic information of the applet corresponding to the desktop icon.
  • step S511 the terminal device determines whether the long-term static information and short-term dynamic information are successfully obtained. If the acquisition is successful, jump to step S514; if the acquisition fails, jump to step S512.
  • step S512 the terminal device sends a prompt message indicating that the information acquisition fails.
  • step S513 the terminal device caches short-term dynamic information.
  • step S514 the terminal device locally stores long-term dynamic information and caches short-term dynamic information.
  • step S515 the terminal device loads the applet corresponding to the desktop icon and runs the applet corresponding to the desktop icon in the applet container.
  • step S516 the terminal device displays the home page of the applet corresponding to the desktop icon through a native program. Specifically, the terminal device can display the home page of the applet corresponding to the desktop icon through the native program by setting the main task and root page of the native program as the applet container.
  • steps S501 to S516 may be omitted, or the order of the steps may be appropriately changed, which is not limited here.
  • the terminal device may also, in response to a search input to the display page of the native program, look for the applet indicated by the search input in the applet integrated with the native program. It can determine whether the current display page of the native program has been switched to the page of the mini program. If the page of the mini program is not switched, the mini program will be loaded and run according to the normal mini program loading method. If the page has been switched to the applet, start the applet indicated by the search input, obtain the long-term static information and short-term dynamic information of the applet indicated by the search input, and run the search in the applet container based on the long-term static information and short-term dynamic information.
  • Input the applet indicated by the input and set the main task of the native program as the applet container, so that the terminal device can display a page for searching the applet indicated by the input through the native program.
  • the process of loading the applet indicated by the search input and the process of displaying the page of the applet indicated by the search input may refer to steps S408 to S415 in the above embodiment, and will not be described again here.
  • the applet activation input may include activation input for link information. Users can quickly call up the native program and enter the mini program through the received link information.
  • Figure 8 is a flow chart of another embodiment of the integration method of native programs and mini programs provided by this application. The difference between Figure 8 and Figure 2 is that step S204 in Figure 2 can be specifically refined into steps S2041b to S2043b in Figure 8 .
  • the integration method of native programs and mini programs shown in Figure 8 can also include step S207 and step S208.
  • step S2041b in response to the startup input of the link information, the native program is called up to determine whether the applet container is in an open state.
  • the startup input of the link information is used to start the applet corresponding to the link information. Further, the startup input of the link information can be used to call up the specified page of the applet indicated by the link information.
  • Link information may include external scheme links, etc., which is not limited here.
  • the link information may include the URL address of the specified page of the applet indicated by the link information.
  • the link information can be carried in text messages, multimedia messages, instant messaging messages, etc., and is not limited here.
  • the startup input may specifically include click input, long press input, etc. for link information, which is not limited here.
  • step S2042b when the applet container is open, the long-term static information of the target applet is read, and the main task and root page of the native program are set as the applet container.
  • the applet container is open, which means that the display page of the native program has been switched to the page of the applet.
  • the native program can be called to read the long-term static information of the target applet that was previously saved locally.
  • step S2043b if the applet indicated by the link information is the target applet, the page indicated by the link information in the target applet is opened according to the link information.
  • the terminal device can display the page of the target applet through the native program.
  • the link information can specifically indicate the specified page in the target applet
  • the specified page indicated by the link information in the target applet can be opened and displayed through the native program according to the connection information. From the perspective of user experience, after the user inputs the link information, what opens is the display page of the native program, and the display page is the page of the target applet. Specifically, the display page is the designation indicated by the link information in the target applet. page.
  • whether the applet indicated by the link information is the target applet can be determined by whether the applet ID of the applet indicated by the link information is consistent with the applet ID previously stored locally in long-term static information.
  • step S207 if the applet indicated by the link information is not the target applet, jump from the page of the target applet to the page of the applet indicated by the link information.
  • the long-term static information and short-term dynamic information of the applet indicated by the link information can be obtained.
  • the main task and root page of the native program have been set as the applet container.
  • the page of the applet indicated by the link information can be displayed through the native program to jump from the page of the target applet. Go to the page of the applet indicated by the link information.
  • the page of the target applet can be used as a transfer page that is not displayed explicitly.
  • the terminal device can first display the page of the target applet through a native program, then receive the user's switching input, and in response to the switching input, obtain the long-term static information and short-term dynamic information of the applet indicated by the link information, so that The applet indicated by the link information is run in the applet container, and the specified page of the applet indicated by the link information is displayed through the native program, so as to jump from the page of the target applet to the specified page of the applet indicated by the link information.
  • step S208 when the applet container is not in an open state, the page of the applet indicated by the link information is opened through the browser.
  • the applet container is not open, which means that the display page of the native program has been switched to the page of the native program before.
  • the browser can be used to open the specified page of the applet indicated by the link information.
  • Figure 9 is a flow chart of an example of the process of starting a mini program through link information provided by the embodiment of the present application. As shown in Figure 9, the process of starting the applet through link information may include steps S601 to S606.
  • step S601 the terminal device starts the native program in response to the startup input of the link information.
  • step S602 the terminal device loads native program running logic.
  • step S603 the terminal device determines whether the display page of the last startup of the native program has been switched to the page of the applet. If the native program has not switched to the page of the mini program when it was launched last time, jump to step S604; if the native program has been switched to the page of the mini program when it was launched last time, jump to step S605.
  • step S604 the terminal device opens the page of the applet indicated by the link information through the browser.
  • step S605 the terminal device starts the applet indicated by the link information, and synchronously opens and displays the designated page of the applet indicated by the link information.
  • the applet indicated by the link information in step S605 for the startup of the applet indicated by the link information in step S605 and the opening and display of the specified page of the applet indicated by the link information, please refer to the relevant content in steps S504 to step S516 in the above embodiment.
  • the applet indicated by the link information is the target applet
  • the specified page of the applet indicated by the link information can be directly displayed through the native program according to the link information.
  • the applet indicated by the link information is not the target applet, the native program can be used to jump from the page of the target applet to the specified page of the applet indicated by the link information.
  • step S606 the terminal device asynchronously loads the relevant information of the native program so that it can be quickly switched when it is necessary to switch from the page of the applet to the page of the native program.
  • step S606 and step S605 are not limited here, and the two steps can be performed asynchronously.
  • steps S601 to S606 may be omitted, or the order of the steps may be appropriately changed, which is not limited here.
  • the target applet activation input includes activation input for push information. Users can quickly launch the native program and enter the mini program through the received push information.
  • Figure 10 is a flow chart of yet another embodiment of the integration method of native programs and mini programs provided by this application. The difference between Figure 10 and Figure 2 is that step S204 in Figure 2 can be specifically refined into steps S2041c to S2044c in Figure 10 .
  • the integration method of native programs and applets shown in Figure 10 can also include step S209 Go to step S211.
  • step S2041c in response to the startup input of the push information, it is determined whether the native program is running in the background.
  • the launch input for push information is used to launch the applet indicated by the push information. Further, the startup input of the push information can be used to call up the specified page of the applet indicated by the push information.
  • Push information may include push information in the notification bar, push information in pop-up windows, push information on the lock screen interface, etc., and is not limited here.
  • the startup input may include click input for push information, long press input, etc., which is not limited here.
  • the running status of the native program can be determined. Running status can include background running status and front-end running status.
  • step S2042c when the native program is running in the background, the native program is called up to determine whether the applet container is open.
  • the native program is running in the background, that is, the native program is not currently displayed on the terminal device. You need to call up the native program to determine whether the mini program container is open. By determining whether the mini program container is open, it is possible to determine whether the display page of the native program has been switched to the mini program page before.
  • step S2043c when the applet container is open, the long-term static information of the target applet is read, and the main task and root page of the native program are set as the applet container.
  • the applet container is open.
  • the applet container is open, which means that the display page of the native program has been switched to the page of the applet before.
  • the native program can be called to read the long-term static information of the target applet that was previously saved locally.
  • step S2044c if the applet indicated by the push information is the target applet, the page indicated by the push information in the target applet is opened according to the push information.
  • the terminal device can display the page of the target applet through the native program.
  • the push information can specifically indicate the specified page in the target applet
  • the specified page indicated by the push information in the target applet can be opened and displayed through the native program according to the connection information.
  • the display page is the page of the target applet.
  • the display page is the designation indicated by the push information in the target applet. page.
  • whether the applet indicated by the push information is the target applet can be determined by whether the applet ID of the applet indicated by the push information is consistent with the applet ID previously stored locally in long-term static information.
  • step S209 if the applet indicated by the push information is not the target applet, jump from the page of the target applet to the page of the applet indicated by the push information.
  • the long-term static information and short-term dynamic information of the applet indicated by the push information can be obtained.
  • the long-term static information and short-term dynamic information of the applet indicated by the push information make the applet indicated by the push information run in the applet container.
  • the main task and root page of the native program have been set as the applet container.
  • the page of the applet indicated by the push information can be displayed through the native program to jump from the page of the target applet. Go to the page of the applet indicated by the push message.
  • the page of the target applet can be used as a transfer page that is not displayed explicitly.
  • the terminal device can first display the page of the target applet through a native program, then receive the user's switching input, and in response to the switching input, obtain the long-term static information and short-term dynamic information of the applet indicated by the push information, so that The applet indicated by the link information is run in the applet container, and the specified page of the applet indicated by the push information is displayed through the native program, so as to jump from the page of the target applet to the specified page of the applet indicated by the push information.
  • step S210 when the native program is in the front-end running state, jump to the page of the applet indicated by the push information.
  • the native program is in the front-end running state, that is, the native program is currently displayed on the terminal device. There is no need to call up the native program. You can directly use the native program to jump to the specified page of the mini program indicated by the push information.
  • step S211 when the applet container is not in an open state, the browser is used to open the page of the applet indicated by the push information.
  • the applet container is not open, which means that the display page of the native program has been switched to the page of the native program before.
  • the browser can be used to open the specified page of the applet indicated by the push information.
  • FIG 11 is a flowchart of an example of the process of starting a mini program through push information provided by the embodiment of the present application. As shown in Figure 11, the process of starting the applet by pushing information may include steps S701 to S707.
  • step S701 the terminal device determines whether the native program is running in the background in response to the startup input of the push information. If the native program is in the background running state, jump to step S703; if the native program is in the front-end running state, jump to step S702.
  • step S702 the terminal device jumps to the designated page of the applet indicated by the push information in the native program.
  • step S703 the terminal device enters the native program running logic.
  • step S704 the terminal device determines whether the display page of the last startup of the native program has been switched to the page of the applet. If the native program was not switched to the page of the mini program when it was launched last time, jump to step S705; if the native program was switched to the page of the mini program when it was launched last time, jump to step S707.
  • step S705 the terminal device opens the page of the applet indicated by the push information through the browser.
  • step S706 the terminal device loads the home page of the native program.
  • step S707 the terminal device starts the applet indicated by the push information, opens and displays the designated page of the applet indicated by the push information.
  • the startup of the applet indicated by the push information in step S707 and the opening and display of the specified page of the applet indicated by the push information may refer to the relevant content in steps S504 to step S516 in the above embodiment. If the applet indicated by the push information is the target applet, the specified page of the applet indicated by the push information can be directly displayed through the native program according to the push information. If the applet indicated by the push information is not the target applet, you can use the native program to jump from the page of the target applet to the specified page of the applet indicated by the push information.
  • steps S701 to S707 may be omitted, or the order of the steps may be appropriately changed, which is not limited here.
  • FIG. 12 is a schematic structural diagram of an embodiment of an integrated device for native programs and applets provided by this application.
  • the device 800 for integrating native programs and small programs may include a selection module 801 , an acquisition module 802 and a control module 803 .
  • the selection module 801 may be configured to select applet information representing the target applet from the applet list provided by the native program in response to a switching selection input to a page of the native program in the terminal device.
  • the acquisition module 802 can be used to acquire long-term static information of the target applet and save it locally.
  • the acquisition module 802 is also used to acquire short-term dynamic information of the target applet.
  • the control module 803 can be used to make the target applet run in the applet container of the terminal device based on the long-term static information and short-term dynamic information of the target applet, and switch the display page from the page of the native program to the page of the target applet.
  • the control module 803 is also used to respond to the applet startup input, call the native program to read the long-term static information of the target applet, and set the main task and root page of the native program as the applet container, so that the terminal device displays the target through the native program Mini program page.
  • the user can perform switching selection input on the page of the native program in the terminal device.
  • the terminal device responds to the switching selection input to determine the target applet that needs to be switched, and changes the target applet to the page of the native program.
  • the long-term static information is saved locally, and the short-term dynamic information of the target applet is obtained.
  • the target applet is run in the applet container, and the page of the native program is switched to the target applet.
  • the page of the program uses the native program to display the page of the target applet.
  • the terminal device calls the native program to read the long-term static information, sets the main task and root page of the native program as the mini program container, and displays the target mini program through the native program
  • the page enables the mini program to be consistent or consistent with the native program in terms of interaction with the user and visual experience, and improves the interaction between the mini program and the user and the visual experience.
  • the method of the embodiment of the present application can be used to call the native program to switch and display any one of the mini program lists, thereby realizing a native program. The effect of coexistence of multiple small program-like native programs in the program.
  • control module 803 may also be used to determine whether the applet container is open.
  • the control module 803 may be used to read long-term static information of the target applet when the applet container is in an open state.
  • the obtaining module 802 may also be used to obtain the address of the front page of the target applet, so that the terminal device displays the front page of the target applet before displaying the page of the target applet.
  • the applet container is provided with an application programming interface API, which is used by the applet in the applet container to call common functions of the native program.
  • the control module 803 can also be used to call the common function of the native program through the API when the target applet runs in the applet container and needs to perform a common function.
  • the applet startup input includes a startup input to a native program in the terminal device.
  • the applet startup input includes a startup input to a desktop icon of the applet displayed on the terminal device.
  • the control module 803 may be used to: jump to the transfer page in response to the startup input of the desktop icon of the applet displayed on the terminal device; determine whether the applet container is in an open state; when the applet container is in an open state, transfer from The page jumps to the native program, reads the long-term static information of the target applet, and sets the main task and root page of the native program as the applet container; if the applet corresponding to the desktop icon is the target applet, control the terminal device to display the target applet. program page.
  • control module 803 can also be used to jump from the page of the target applet to the page of the applet corresponding to the desktop icon when the applet corresponding to the desktop icon is not the target applet.
  • the applet activation input includes activation input for link information.
  • the control module 803 can be used to: respond to the startup input of the link information, call up the native program, and determine whether the applet container is in the open state; when the applet container is in the open state, read the long-term static information of the target applet, Set the main task and root page of the native program as the applet container; if the applet indicated by the link information is the target applet, open the page indicated by the link information in the target applet based on the link information.
  • control module 803 may also be configured to jump from the page of the target applet to the page of the applet indicated by the link information when the applet indicated by the link information is not the target applet.
  • the target applet activation input includes activation input for push information.
  • the control module 803 can be used to: respond to the startup input of the push information, determine whether the native program is in the background running state; when the native program is in the background running state, call up the native program, and determine whether the applet container is in the open state; When the mini program container is open, read the long-term static information of the target mini program, and set the main task and root page of the native program as the mini program container; if the mini program indicated by the push information is the target mini program, according to the push Information, open the page indicated by the push information in the target applet.
  • control module 803 may also be configured to jump from the page of the target applet to the page of the applet indicated by the push information when the applet indicated by the push information is not the target applet.
  • control module 803 can also be used to jump to the page of the applet indicated by the push information when the native program is in the front-end running state.
  • the obtaining module 802 can also be used to obtain the applet list.
  • the mini program list includes mini program information arranged from high to low in terms of recommendation.
  • Recommendation is determined based on the user's function usage information, which includes one or more of the following: mini program version type, mini program region, mini program priority, mini program binding resource information, mini program attention, payment Information, payment institution information, and user personal information.
  • the applet list includes applet information of the first type of applet and/or applet information of the second type of applet.
  • the first category of mini programs includes mini programs that are mini-programmed versions of native programs, and the second category of mini programs includes mini programs that are owned by a different party than the original program.
  • FIG. 13 is a schematic structural diagram of an embodiment of the terminal device provided by this application.
  • the terminal device 900 includes a memory 901, a processor 902, and a computer program stored on the memory 901 and executable on the processor 902.
  • the above-mentioned processor 902 may include a central processing unit (CPU), or an Application Specific Integrated Circuit (ASIC), or may be configured to implement one or more integrated circuits of embodiments of the present application.
  • CPU central processing unit
  • ASIC Application Specific Integrated Circuit
  • the memory 901 may include read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), magnetic disk storage media device, optical storage media device, flash memory device, electrical, optical or other physical/tangible devices Memory storage device.
  • ROM read-only memory
  • RAM random access memory
  • magnetic disk storage media device magnetic disk storage media device
  • optical storage media device flash memory device
  • electrical, optical or other physical/tangible devices Memory storage device may include read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), magnetic disk storage media device, optical storage media device, flash memory device, electrical, optical or other physical/tangible devices Memory storage device.
  • memory includes one or more tangible (non-transitory) computer-readable storage media (e.g., memory devices) encoded with software including computer-executable instructions, and when the software is executed (e.g., by one or multiple processors), it is operable to perform operations described with reference to the integration of native programs and applets according to embodiments of
  • the processor 902 reads the executable program code stored in the memory 901 to run the computer program corresponding to the executable program code, so as to realize the integration of the native program and the applet in the above embodiment.
  • the terminal device 900 may also include a communication interface 903 and a bus 904. Among them, as shown in Figure 13, the memory 901, the processor 902, and the communication interface 903 are connected through the bus 904 and complete communication with each other.
  • the communication interface 903 is mainly used to implement communication between modules, devices, units and/or equipment in the embodiments of this application. Input devices and/or output devices may also be accessed through the communication interface 903.
  • Bus 904 includes hardware, software, or both, coupling the components of terminal device 900 to each other.
  • the bus 904 may include an Accelerated Graphics Port (AGP) or other graphics bus, an Enhanced Industry Standard Architecture (EISA) bus, a Front Side Bus (FSB), Hyper Transport (HT) interconnect, Industry Standard Architecture (ISA) bus, infinite bandwidth interconnect, low pin count (LPC) bus, memory bus, Micro Channel architecture Architecture, MCA) bus, Peripheral Component Interconnect (PCI) bus, PCI-Express (PCI-E) bus, Serial Advanced Technology Attachment (SATA) bus, Video Electronics Standards Association part ( Video Electronics Standards Association Local Bus, VLB) bus or other suitable bus or a combination of two or more of these.
  • bus 904 may include one or more buses.
  • the fourth aspect of the present application also provides a computer-readable storage medium.
  • the computer-readable storage medium stores computer program instructions.
  • the native program and the applet in the above embodiment can be realized. Integrated methods can achieve the same technical effect. To avoid duplication, they will not be described again here.
  • the above-mentioned computer-readable storage media may include non-transitory computer-readable storage media, such as read-only memory (Read-Only Memory, referred to as ROM), random access memory (Random Access Memory, referred to as RAM), magnetic disks or optical disks etc. are not limited here.
  • the present application can also provide a computer program product.
  • the terminal device When instructions in the computer program product are executed by a processor of a terminal device, the terminal device causes the terminal device to execute the integration method of the native program and the applet in the above embodiment.
  • the integration method of the native program and the applet for specific details, please refer to the relevant descriptions in the above embodiments and will not be described again here.
  • Such a processor may be, but is not limited to, a general-purpose processor, a special-purpose processor, a special application processor, or a field-programmable logic circuit. It will also be understood that each block in the block diagrams and/or flowchart illustrations, and combinations of blocks in the block diagrams and/or flowchart illustrations, can also be implemented by special purpose hardware that performs the specified functions or actions, or can be implemented by special purpose hardware and A combination of computer instructions.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Databases & Information Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Stored Programmes (AREA)

Abstract

The present application belongs to the field of data processing. Disclosed are a method and apparatus for integrating a native program with an applet, and a device and a medium. The method comprises: in response to a switching selection input for a page of a native program, selecting, from an applet list provided by the native program, applet information that represents a target applet; acquiring long-term static information of the target applet, and locally storing same; acquiring short-term dynamic information of the target applet, and according to the long-term static information and the short-term dynamic information, making the target applet run in an applet container, and switching a display page from the page of the native program to a page of the target applet; and in response to an applet start input, calling the native program to read the long-term static information of the target applet, and setting a main task and a root page of the native program to be the applet container, such that a terminal device displays the page of the target applet by means of the native program.

Description

原生程序与小程序的集成方法、装置、设备及介质Integration methods, devices, equipment and media for native programs and mini programs
相关申请的交叉引用Cross-references to related applications
本申请要求享有于2022年03月24日提交的名称为“原生程序与小程序的集成方法、装置、设备及介质”的中国专利申请202210293530.4的优先权,该申请的全部内容通过引用并入本文中。This application claims priority to Chinese patent application 202210293530.4 titled "Integration Method, Device, Equipment and Medium of Native Programs and Mini Programs" submitted on March 24, 2022. The entire content of this application is incorporated herein by reference. middle.
技术领域Technical field
本申请属于数据处理领域,尤其涉及一种原生程序与小程序的集成方法、装置、设备及介质。This application belongs to the field of data processing, and in particular relates to a method, device, equipment and medium for integrating native programs and applets.
背景技术Background technique
小程序是一种不需要下载安装即可使用的轻量应用,开发难度低于原生程序,可在实现轻量级功能的基础上降低开发难度以及节约设备内存空间。但由于小程序的自身特性,其功能较为简单,与用户的交互以及视觉体验等方面无法与原生程序相比。也就是说,小程序在与用户的交互以及视觉体验等方面的效果较差。Mini programs are lightweight applications that can be used without downloading and installation. The development difficulty is lower than that of native programs. It can reduce the development difficulty and save device memory space on the basis of realizing lightweight functions. However, due to the characteristics of small programs, their functions are relatively simple, and their interaction with users and visual experience cannot be compared with native programs. In other words, mini programs are less effective in terms of interaction with users and visual experience.
发明内容Contents of the invention
本申请实施例提供一种原生程序与小程序的集成方法、装置、设备及介质,能够提高小程序与用户的交互以及视觉体验等方面的效果。Embodiments of the present application provide a method, device, equipment and medium for integrating native programs and mini programs, which can improve the interaction between mini programs and users and the visual experience.
第一方面,本申请实施例提供一种原生程序与小程序的集成方法,包括:响应于对终端设备中原生程序的页面的切换选择输入,在原生程序提供的小程序列表中选择表征目标小程序的小程序信息;获取目标小程序的长期静态信息并在本地保存;获取目标小程序的短期动态信息,根据目标小程序的长期静态信息和短期动态信息,使目标小程序在终端设备的小程序容器中运行,并将显示页面从原生程序的页面切换为目标小程序的页 面;响应于小程序启动输入,调用原生程序读取目标小程序的长期静态信息,将原生程序的主任务和根页面设置为小程序容器,以使终端设备通过原生程序显示目标小程序的页面。In a first aspect, embodiments of the present application provide a method for integrating native programs and mini programs, including: in response to a switching selection input for a page of a native program in a terminal device, selecting a representative target mini program from a list of mini programs provided by the native program. The applet information of the program; obtain the long-term static information of the target applet and save it locally; obtain the short-term dynamic information of the target applet, and make the target applet appear in the applet of the terminal device based on the long-term static information and short-term dynamic information of the target applet. Run in the program container, and switch the display page from the page of the native program to the page of the target applet; in response to the applet startup input, the native program is called to read the long-term static information of the target applet, and the main task and root of the native program are The page is set as an applet container so that the terminal device displays the page of the target applet through the native program.
第二方面,本申请实施例提供一种原生程序与小程序的集成方法,包括:选定模块,用于响应于对终端设备中原生程序的页面的切换选择输入,在原生程序提供的小程序列表中选择表征目标小程序的小程序信息;获取模块,用于获取目标小程序的长期静态信息并在本地保存;获取模块还用于获取目标小程序的短期动态信息;控制模块,用于根据目标小程序的长期静态信息和短期动态信息,使目标小程序在终端设备的小程序容器中运行,并将显示页面从原生程序的页面切换为目标小程序的页面;控制模块还用于响应于小程序启动输入,调用原生程序读取目标小程序的长期静态信息,将原生程序的主任务和根页面设置为小程序容器,以使终端设备通过原生程序显示目标小程序的页面。In the second aspect, embodiments of the present application provide a method for integrating native programs and mini programs, including: a selection module, configured to select input in response to switching selection input of the page of the native program in the terminal device, and select the mini program provided by the native program in the terminal device. Select the small program information that represents the target applet from the list; the acquisition module is used to obtain the long-term static information of the target applet and save it locally; the acquisition module is also used to obtain the short-term dynamic information of the target applet; the control module is used to obtain the target applet's short-term dynamic information based on The long-term static information and short-term dynamic information of the target applet enable the target applet to run in the applet container of the terminal device and switch the display page from the page of the native program to the page of the target applet; the control module is also used to respond to The applet starts the input, calls the native program to read the long-term static information of the target applet, and sets the main task and root page of the native program as the applet container, so that the terminal device displays the page of the target applet through the native program.
第三方面,本申请实施例提供一种终端设备,包括:处理器以及存储有计算机程序指令的存储器;处理器执行计算机程序指令时实现第一方面的原生程序与小程序的集成方法。In a third aspect, embodiments of the present application provide a terminal device, including: a processor and a memory storing computer program instructions; when the processor executes the computer program instructions, the integration method of the native program and the applet of the first aspect is implemented.
第四方面,本申请实施例提供一种计算机可读存储介质,计算机可读存储介质上存储有计算机程序指令,计算机程序指令被处理器执行时实现第一方面的原生程序与小程序的集成方法。In a fourth aspect, embodiments of the present application provide a computer-readable storage medium. Computer program instructions are stored on the computer-readable storage medium. When the computer program instructions are executed by a processor, the integration method of the native program and the applet of the first aspect is implemented. .
本申请实施例提供一种原生程序与小程序的集成方法、装置、设备及介质,用户可对终端设备中原生程序的页面进行切换选择输入,终端设备响应该切换选择输入确定需要切换的目标小程序,将该目标小程序的长期静态信息在本地保存,并获取目标小程序的短期动态信息,根据目标小程序的长期静态信息和短期动态信息,使目标小程序在小程序容器中运行,从原生程序的页面切换为目标小程序的页面,利用原生程序显示目标小程序的页面。在响应于小程序启动输入,重新启动小程序的情况下,终端设备调用原生程序读取长期静态信息,并将原生程序的主任务和根页面设置为小程序容器,通过原生程序展示目标小程序的页面,使得小程序在与用户的交互以及视觉体验等方面的效果可以与原生程序一致或趋于一致,提 高小程序与用户的交互以及视觉体验等方面的效果。Embodiments of the present application provide a method, device, equipment and medium for integrating native programs and applets. The user can perform switching selection input on the page of the native program in the terminal device, and the terminal device responds to the switching selection input to determine the target applet that needs to be switched. The program saves the long-term static information of the target applet locally, obtains the short-term dynamic information of the target applet, and makes the target applet run in the applet container based on the long-term static information and short-term dynamic information of the target applet. The page of the native program is switched to the page of the target applet, and the page of the target applet is displayed using the native program. When the mini program is restarted in response to the mini program startup input, the terminal device calls the native program to read the long-term static information, sets the main task and root page of the native program as the mini program container, and displays the target mini program through the native program The page enables the mini program to be consistent or consistent with the native program in terms of interaction with the user and visual experience, and improves the interaction between the mini program and the user and the visual experience.
附图说明Description of the drawings
为了更清楚地说明本申请实施例的技术方案,下面将对本申请实施例中所需要使用的附图作简单的介绍,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to explain the technical solutions of the embodiments of the present application more clearly, the drawings required to be used in the embodiments of the present application will be briefly introduced below. For those of ordinary skill in the art, without exerting creative efforts, they can also Additional drawings can be obtained from these drawings.
图1为本申请实施例提供的原生程序与小程序的集成方法的应用场景的一示例的示意图;Figure 1 is a schematic diagram of an example of an application scenario of the integration method of native programs and mini programs provided by the embodiment of the present application;
图2为本申请提供的原生程序与小程序的集成方法的一实施例的流程图;Figure 2 is a flow chart of an embodiment of the integration method of native programs and mini programs provided by this application;
图3为本申请实施例提供的从原生程序的页面切换为小程序的页面流程的一示例的流程图;Figure 3 is a flow chart of an example of the process of switching from a native program page to a mini program page provided by an embodiment of the present application;
图4为本申请实施例提供的终端设备中原生程序与小程序共存的一示例的逻辑架构示意图;Figure 4 is a schematic diagram of the logical architecture of an example of coexistence of native programs and applets in a terminal device provided by an embodiment of the present application;
图5为本申请实施例提供的原生程序重新启动流程的一示例的流程图;Figure 5 is a flow chart of an example of the native program restart process provided by the embodiment of the present application;
图6为本申请提供的原生程序与小程序的集成方法的另一实施例的流程图;Figure 6 is a flow chart of another embodiment of the integration method of native programs and mini programs provided by this application;
图7为本申请实施例提供的通过小程序的桌面图标启动小程序流程的一示例的流程图;Figure 7 is a flow chart of an example of the process of starting an applet through the desktop icon of the applet provided by the embodiment of the present application;
图8为本申请提供的原生程序与小程序的集成方法的又一实施例的流程图;Figure 8 is a flow chart of another embodiment of the integration method of native programs and mini programs provided by this application;
图9为本申请实施例提供的通过链接信息启动小程序流程的一示例的流程图;Figure 9 is a flow chart of an example of the process of starting a mini program through link information provided by the embodiment of the present application;
图10为本申请提供的原生程序与小程序的集成方法的再一实施例的流程图;Figure 10 is a flow chart of yet another embodiment of the integration method of native programs and mini programs provided by this application;
图11为本申请实施例提供的通过推送信息启动小程序流程的一示例的流程图;Figure 11 is a flow chart of an example of the process of starting a mini program through push information provided by the embodiment of the present application;
图12为本申请提供的原生程序与小程序的集成装置的一实施例的结 构示意图;Figure 12 is a schematic structural diagram of an embodiment of an integrated device for native programs and applets provided by this application;
图13为本申请提供的终端设备的一实施例的结构示意图。Figure 13 is a schematic structural diagram of an embodiment of the terminal device provided by this application.
具体实施方式Detailed ways
下面将详细描述本申请的各个方面的特征和示例性实施例,为了使本申请的目的、技术方案及优点更加清楚明白,以下结合附图及具体实施例,对本申请进行进一步详细描述。应理解,此处所描述的具体实施例仅意在解释本申请,而不是限定本申请。对于本领域技术人员来说,本申请可以在不需要这些具体细节中的一些细节的情况下实施。下面对实施例的描述仅仅是为了通过示出本申请的示例来提供对本申请更好的理解。Features and exemplary embodiments of various aspects of the present application will be described in detail below. In order to make the purpose, technical solutions and advantages of the present application clearer, the present application will be described in further detail below with reference to the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described here are only intended to explain the application, but not to limit the application. It will be apparent to one skilled in the art that the present application may be practiced without some of these specific details. The following description of embodiments is merely intended to provide a better understanding of the present application by illustrating examples thereof.
随着网络技术的发展,手机、平板电脑、电子计算机等终端设备的应用越来越普遍。用户通过终端设备可完成各类功能,例如,用户可通过终端设备完成文档处理、支付、即时通讯、图像处理等各类功能。具体地,终端设备可通过原生程序来实现各类功能。但原生程序需要下载和安装,占用终端设备的存储空间比较大,且开发难度较大。为了能更加简单地实现功能,降低占用的存储空间,以及降低难度,小程序应运而生。小程序是一种不需要下载安装即可使用的轻量应用,开发难度低于原生程序,可在实现轻量级功能的基础上降低开发难度以及节约设备内存空间。但是,正是由于小程序不需下载安装,在降低开发难度、节约设备内存空间的同时,也使得小程序功能较为简单,无法实现较为复杂的功能,在与用户的交互以及视觉体验等方面无法与原生程序相比。With the development of network technology, the application of terminal devices such as mobile phones, tablet computers, and electronic computers is becoming more and more common. Users can complete various functions through terminal devices. For example, users can complete various functions such as document processing, payment, instant messaging, and image processing through terminal devices. Specifically, the terminal device can realize various functions through native programs. However, native programs need to be downloaded and installed, occupy a large amount of storage space on the terminal device, and are difficult to develop. In order to implement functions more simply, reduce the storage space occupied, and reduce difficulty, small programs came into being. Mini programs are lightweight applications that can be used without downloading and installation. The development difficulty is lower than that of native programs. It can reduce the development difficulty and save device memory space on the basis of realizing lightweight functions. However, it is precisely because mini programs do not require downloading and installation that while reducing the difficulty of development and saving device memory space, they also make mini programs relatively simple in function and unable to implement more complex functions. In terms of interaction with users and visual experience, etc. Compared to native programs.
本申请实施例提供一种原生程序与小程序的集成方法、装置、设备及介质,能够在原生程序提供的小程序列表中选择小程序,利用原生程序来展示小程序的页面。在显示页面已切换至小程序的页面,原生程序关闭后,再次启动小程序时,不需用户先进入原生程序的页面,再进入小程序的页面,可直接通过原生程序直接进入小程序的页面,从而使得小程序与用户的交互以及视觉体验方面的效果与原生程序效果一致或趋于一致,提高小程序在于用户的交互以及视觉体验等方面的效果。Embodiments of the present application provide a method, device, equipment, and medium for integrating native programs and mini programs. The mini program can be selected from the mini program list provided by the native program, and the native program can be used to display the page of the mini program. After the display page has been switched to the page of the mini program and the native program is closed, when the mini program is launched again, the user does not need to enter the page of the native program first and then the page of the mini program. The user can directly enter the page of the mini program through the native program. , thereby making the interaction between the mini program and the user and the visual experience effects consistent or tending to be consistent with the native program effects, and improving the effects of the mini program on the user interaction and visual experience.
本申请实施例提供的原生程序与小程序的集成方法主要涉及终端设 备,终端设备中安装有原生程序。终端设备可通过网关与原生程序的后台系统、小程序平台等进行通信,以实现原生程序和小程序的功能。图1为本申请实施例提供的原生程序与小程序的集成方法的应用场景的一示例的示意图。如图1所示,用户11可对终端设备12进行操作,终端设备12中安装有原生程序。终端设备12可包括手机、平板电脑、电子计算机、可穿戴设备等,在此并不限定。终端设备12可通过网关13与原生程序的后台系统14通信交互,终端设备12也可通过网关13与小程序平台15通信交互,以获取小程序信息。原生程序的运营方可通过管理系统16对原生程序的后台系统14进行管理、维护等。小程序平台15的使用者可将开发的小程序上传小程序平台15,并对自己开发的小程序进行管理、维护。The integration method of native programs and small programs provided by the embodiments of this application mainly involves terminal devices, and native programs are installed in the terminal devices. The terminal device can communicate with the background system of the native program, the mini program platform, etc. through the gateway to realize the functions of the native program and the mini program. FIG. 1 is a schematic diagram of an example of an application scenario of the integration method of native programs and mini programs provided by the embodiment of the present application. As shown in Figure 1, the user 11 can operate the terminal device 12, and the terminal device 12 has native programs installed. The terminal device 12 may include a mobile phone, a tablet computer, an electronic computer, a wearable device, etc., which is not limited here. The terminal device 12 can communicate and interact with the background system 14 of the native program through the gateway 13, and the terminal device 12 can also communicate and interact with the applet platform 15 through the gateway 13 to obtain applet information. The operator of the native program can manage and maintain the backend system 14 of the native program through the management system 16 . Users of the mini program platform 15 can upload the developed mini programs to the mini program platform 15 and manage and maintain the mini programs they have developed.
下面本申请提供的原生程序与小程序的集成方法、装置、设备及介质依次进行说明。The integration methods, devices, equipment and media of native programs and mini programs provided by this application will be described in sequence below.
本申请提供一种原生程序与小程序的集成方法,可应用于终端设备,即该原生程序与小程序的集成方法可由终端设备执行。图2为本申请提供的原生程序与小程序的集成方法的一实施例的流程图。如图2所示,该程序与小程序集成方法可包括步骤S201至步骤S204。This application provides an integration method of native programs and mini programs, which can be applied to terminal devices, that is, the integration method of native programs and mini programs can be executed by terminal devices. Figure 2 is a flow chart of an embodiment of the integration method of native programs and mini programs provided by this application. As shown in Figure 2, the program and applet integration method may include steps S201 to S204.
在步骤S201中,在响应于对终端设备中原生程序的页面的切换选择输入,在原生程序提供的小程序列表中选择表征目标小程序的小程序信息。In step S201, in response to a switching selection input to the page of the native program in the terminal device, applet information representing the target applet is selected from the applet list provided by the native program.
终端设备当前显示的是原生程序的页面。通过对原生程序的页面的输入,可唤起小程序列表。例如,原生程序的页面上包括唤起小程序列表的人机交互控件,在该人机交互控件被点击时触发显示小程序列表。The terminal device currently displays the page of the native program. By inputting the page of the native program, the mini program list can be evoked. For example, the page of the native program includes a human-computer interaction control that evokes a list of mini-programs. When the human-computer interaction control is clicked, the display of the mini-program list is triggered.
小程序列表可包括至少一个小程序的小程序信息。小程序信息可表征小程序。例如,小程序信息可包括小程序名称、小程序版本名称、小程序类型、小程序图形标志、小程序页面缩略图、小程序介绍说明、小程序标识、小程序支持的原生程序版本、小程序所属方标识、小程序优先级等信息中的一项或两项以上。小程序类型可表征小程序的功能类型,如可包括支付类、游戏类、购物类等,在此并不限定。小程序图形标志在小程序列表中可实现为小程序图形标志或小程序图形标志的统一资源定位器 (Uniform Resource Locator,URL)地址,小程序图形标志的URL地址被触发,可显示小程序图形标志。小程序页面缩略图在小程序列表中可实现为小程序页面缩略图或小程序页面缩略图的URL地址,小程序页面缩略图的URL地址被触发,可显示小程序页面缩略图。小程序标识用于标识小程序,可为小程序的编号等标识,在一些示例中,小程序标识可为加密标识,在此并不限定。小程序所属方标识可为小程序开发方的机构号。小程序优先级可为原生程序的所属方制定的优先级或小程序平台的所属方制定的优先级,在此并不限定;在一些示例中,小程序优先级可用数字表示,数字的值越大,表示优先级越高。小程序信息可使用户更好地了解小程序,便于用户进行选择。The applet list may include applet information for at least one applet. Mini program information can characterize the mini program. For example, the mini program information may include the mini program name, the mini program version name, the mini program type, the mini program graphic logo, the mini program page thumbnail, the mini program introduction, the mini program logo, the native program version supported by the mini program, the mini program One or more of the following information: owner identification, mini program priority, etc. The mini program type can represent the function type of the mini program, such as payment type, game type, shopping type, etc., which is not limited here. The mini program graphic logo can be implemented as the mini program graphic logo or the Uniform Resource Locator (URL) address of the mini program graphic logo in the mini program list. When the URL address of the mini program graphic logo is triggered, the mini program graphic can be displayed. logo. The mini program page thumbnail can be implemented as the mini program page thumbnail or the URL address of the mini program page thumbnail in the mini program list. When the URL address of the mini program page thumbnail is triggered, the mini program page thumbnail can be displayed. The applet identifier is used to identify the applet, and can be an identifier such as the number of the applet. In some examples, the applet identifier can be an encryption identifier, which is not limited here. The mini program owner identifier can be the organization number of the mini program developer. The priority of the mini program can be the priority set by the owner of the native program or the priority set by the owner of the mini program platform, which is not limited here; in some examples, the priority of the mini program can be represented by a number, and the value of the number is higher. The larger the value, the higher the priority. Mini Program information allows users to better understand Mini Programs and facilitates users to make choices.
在一些实施例中,在执行步骤S201之前,可获取小程序列表。在一些示例中,小程序列表可存储在终端设备中,在需要调起小程序列表的情况下,终端设备可从自身直接获取该小程序列表。在另一些示例中,终端设备可向原生程序的后台系统发送小程序获取请求,以从原生程序的后台系统获取小程序列表。In some embodiments, before performing step S201, the applet list may be obtained. In some examples, the applet list can be stored in the terminal device. When the applet list needs to be called up, the terminal device can directly obtain the applet list from itself. In other examples, the terminal device may send an applet acquisition request to the background system of the native program to obtain the applet list from the background system of the native program.
小程序列表可包括按照推荐度由高至低排列的小程序的小程序信息。推荐度可根据用户的功能使用信息确定。功能使用信息包括与用户使用原生程序功能相关的信息和用户使用小程序功能相关的信息。根据功能使用信息可对用户的功能使用进行画像,得到用户的功能使用习惯,进而根据用户的功能使用习惯,得到小程序的推荐度。The mini program list may include mini program information of the mini programs arranged in descending order of recommendation. Recommendation can be determined based on the user's function usage information. Function usage information includes information related to users' use of native program functions and information related to users' use of mini program functions. Based on the function usage information, the user's function usage can be profiled to obtain the user's function usage habits, and then based on the user's function usage habits, the recommendation degree of the mini program can be obtained.
功能使用信息可包括以下一项或两项以上:小程序版本名称、小程序所属地区、小程序优先级、小程序绑定资源信息、小程序关注量、支付信息、支付所属机构信息、用户个人信息。Function usage information may include one or more of the following: mini program version name, mini program region, mini program priority, mini program binding resource information, mini program attention volume, payment information, payment institution information, user personal information information.
在功能使用信息包括一项信息的情况下,可根据这一项信息,来确定推荐度的高低。When the function usage information includes one piece of information, the level of recommendation can be determined based on this piece of information.
在一些示例中,功能使用信息包括小程序版本名称,小程序版本名称表示该小程序与原生程序的关系越紧密,小程序的推荐度越高。例如,原生程序的衍生版小程序的推荐度,高于与原生程序无关版本的小程序的推荐度。In some examples, the function usage information includes a mini program version name. The mini program version name indicates that the closer the mini program is to the native program, the higher the recommendation of the mini program. For example, the recommendation degree of a mini program that is a derivative of a native program is higher than that of a mini program that has nothing to do with the native program.
在一些示例中,功能使用信息包括小程序所属地区,终端设备当前的地理位置与小程序所属地区越近,小程序的推荐度越高。例如,小程序所属地区包括终端设备当前的地理位置的小程序的推荐度,高于小程序所属地区不包括终端设备当前的地理位置的小程序的推荐度。In some examples, the function usage information includes the region where the mini program belongs. The closer the current geographical location of the terminal device is to the region where the mini program belongs, the higher the recommendation degree of the mini program. For example, the recommendation degree of a Mini Program whose region includes the current geographical location of the terminal device is higher than the recommendation degree of an Mini Program whose region does not include the current geographical location of the terminal device.
在一些示例中,功能使用信息包括小程序优先级,小程序优先级越高,小程序的推荐度越高。例如,小程序优先级为5的小程序的推荐度,高于小程序优先级为2的小程序的推荐度。In some examples, the function usage information includes the applet priority. The higher the applet priority, the higher the applet recommendation. For example, the recommendation degree of a mini program with a mini program priority of 5 is higher than the recommendation degree of a mini program with a mini program priority of 2.
在一些示例中,功能使用信息包括小程序绑定资源信息。小程序绑定资源信息可在用户完成资源绑定的时候从资源绑定完成页获取,在此并不限定。小程序绑定资源信息为小程序绑定资源相关的信息,如小程序绑定资源信息可包括小程序绑定资源、小程序绑定资源被用户使用的频率、小程序绑定资源的数量等。小程序绑定资源被用户使用的频率越高,小程序的推荐度越高;小程序绑定资源的数量越多,小程序的推荐度越高。例如,小程序绑定资源为与小程序绑定的支付卡或商户,与小程序绑定的支付卡或商户匹配的小程序的推荐度,高于与小程序绑定的支付卡或商户不匹配的小程序的推荐度;与小程序绑定的支付卡或商户的使用频率高的小程序的推荐度,高于与小程序绑定的支付卡或商户的使用频率低的小程序;与小程序绑定的支付卡或商户的数量多的小程序的推荐度,高于与小程序绑定的支付卡或商户的数量少的小程序。In some examples, the function usage information includes applet binding resource information. Mini program binding resource information can be obtained from the resource binding completion page when the user completes resource binding, which is not limited here. Mini program binding resource information is information related to mini program binding resources. For example, mini program binding resource information may include mini program binding resources, the frequency of mini program binding resources being used by users, the number of mini program binding resources, etc. . The more frequently the resources bound to a mini program are used by users, the higher the recommendation degree of the mini program; the greater the number of resources bound to a mini program, the higher the recommendation degree of the mini program. For example, the resource bound to the mini program is a payment card or merchant bound to the mini program. The recommendation degree of the mini program matching the payment card or merchant bound to the mini program is higher than that of the payment card or merchant not bound to the mini program. The recommendation degree of the matching mini program; the recommendation degree of the mini program with high usage frequency of the payment card or merchant bound to the mini program is higher than the recommendation degree of the mini program with low usage frequency of the payment card or merchant bound to the mini program; and The recommendation degree of a Mini Program with a large number of payment cards or merchants bound to the Mini Program is higher than that of a Mini Program with a small number of payment cards or merchants bound to the Mini Program.
在一些示例中,功能使用信息包括小程序关注量,小程序关注量越高,小程序的推荐度越高。例如,小程序关注量高的小程序的推荐度,高于小程序关注量低的小程序的推荐度。In some examples, the function usage information includes the number of followers of the mini program. The higher the number of followers of the mini program, the higher the recommendation degree of the mini program. For example, the recommendation degree of a mini program with a high number of mini program followers is higher than the recommendation degree of a mini program with a low number of mini program followers.
在一些示例中,功能使用信息包括支付信息。支付信息可在用户完成支付的时候从支付完成页获取,在此并不限定。支付信息为用户支付的相关信息,支付信息可包括支付卡或支付商户。例如,若支付信息包括支付卡,与支付卡匹配的小程序的推荐度,高于与支付卡不匹配的小程序的推荐度;若支付信息包括支付商户,与支付商户匹配的小程序的推荐度,高于与支付商户不匹配的小程序的推荐度。In some examples, feature usage information includes payment information. The payment information can be obtained from the payment completion page when the user completes the payment, which is not limited here. Payment information is information related to user payment, and payment information may include payment cards or payment merchants. For example, if the payment information includes a payment card, the recommendation degree of the mini program that matches the payment card is higher than the recommendation degree of the mini program that does not match the payment card; if the payment information includes a payment merchant, the recommendation degree of the mini program that matches the payment merchant is higher. degree, higher than the recommendation degree of mini programs that do not match the payment merchant.
在一些示例中,功能使用信息包括支付所属机构信息。支付所属机构 信息可在用户查看支付详情的时候从支付详情页获取,在此并不限定。支付所属机构信息可表征支付所属的机构。例如,与支付所属机构信息匹配的小程序的推荐度,高于与支付所属机构信息不匹配的小程序的推荐度。In some examples, the function usage information includes payment affiliation information. The payment institution information can be obtained from the payment details page when the user views the payment details, and is not limited here. The payment institution information may represent the institution to which the payment belongs. For example, the recommendation degree of a mini program that matches the payment institution information is higher than the recommendation degree of a mini program that does not match the payment institution information.
在一些示例中,功能使用信息包括用户个人信息。可根据大数据中普遍的用户特征与小程序匹配的推荐度,得到适用于用户个人信息的小程序的推荐度。与用户个人信息匹配的小程序的推荐度,高于与用户个人信息不匹配的小程序的推荐度。例如,用户个人信息包括年龄,用户个人信息中的年龄为26岁,则与20至30岁年龄段匹配的小程序的推荐度,高于与40至50岁年龄段匹配的小程序的推荐度。In some examples, feature usage information includes user personal information. Based on the recommendation degree matching the common user characteristics in big data with the mini program, the recommendation degree of the mini program suitable for the user's personal information can be obtained. The recommendation degree of the mini program that matches the user's personal information is higher than the recommendation degree of the mini program that does not match the user's personal information. For example, if the user's personal information includes age, and the age in the user's personal information is 26, then the recommendation degree of a mini program matching the age group of 20 to 30 years old is higher than the recommendation degree of a mini program matching the age group of 40 to 50 years old. .
在功能使用信息包括两项以上的信息的情况下,可根据两项以上的信息和各信息对应的权重,来确定推荐度的高低。When the function usage information includes two or more pieces of information, the degree of recommendation can be determined based on the two or more pieces of information and the weight corresponding to each piece of information.
在一些实施例中,小程序列表可包括第一类小程序的小程序信息和/或第二类小程序的小程序信息。In some embodiments, the applet list may include applet information for a first type of applet and/or applet information for a second type of applet.
第一类小程序包括原生程序的小程序化版本的小程序。原生程序的小程序化版本指基于原生程序衍生出的特定版本,原生程序的小程序化版本的小程序为基于原生程序衍生出的特定版本的小程序,例如,第一类小程序可包括原生程序的简易版小程序、基于原生程序针对特定人群保留及强化部分功能的小程序等,在此并不限定。与通过原生程序实现衍生版本的方案相比,本申请实施例通过小程序实现原生程序的衍生版本,用户不需下载衍生版本的原生程序,可根据自身的需求切换对应的衍生版本的小程序,在能够实现多个版本的功能的情况下,减少了终端设备中占用的存储空间,而且小程序也可减少对原生程序的衍生版本的开发难度。在本申请实施例中,原生程序的小程序化版本与用户的交互以及视觉体验等方面的效果可达到与原生程序的效果一致或趋于一致,从而进一步提高用户体验。The first category of mini programs includes mini programs that are mini-programmed versions of native programs. The mini-programmed version of a native program refers to a specific version derived from a native program. The mini-programmed version of a native program is a specific version of a mini program derived from a native program. For example, the first type of mini-program may include a native program. Simple version of the program, mini programs based on native programs that retain and enhance some functions for specific groups of people, etc. are not limited here. Compared with the solution of implementing a derivative version through a native program, the embodiment of the present application implements a derivative version of the native program through a mini program. Users do not need to download the derivative version of the native program and can switch to the corresponding derivative version of the mini program according to their own needs. When multiple versions of functions can be implemented, the storage space occupied in the terminal device is reduced, and the applet can also reduce the difficulty of developing derivative versions of the native program. In the embodiments of this application, the effects of the mini-programmed version of the native program on user interaction and visual experience can be consistent or similar to those of the native program, thereby further improving the user experience.
第二类小程序包括所属方与原生程序的所属方不同的小程序。原生程序也可集成所属方不同的小程序。终端设备接收用户的操作输入,可在原生程序中唤起所属方与原生程序的所属方不同的小程序。所属方与原生程序的所属方不同的小程序的功能可与原生程序的功能相似,也可与原生程 序的功能不同,在此并不限定。例如,原生程序为支付平台的应用程序,原生程序的小程序列表可包括多家银行的小程序的小程序信息。又例如,原生程序为第三支付平台的应用程序,原生程序的小程序列表可包括行程码查询小程序的小程序信息。通过在小程序列表中加入所属方与原生程序不同的小程序的小程序信息,可进一步丰富借助原生程序能够实现的功能,使得终端设备功能实现更加灵活。The second category of mini programs includes mini programs that are owned by a different party than the original program. Native programs can also integrate mini programs from different owners. The terminal device receives the user's operation input and can evoke a mini program in the native program whose owner is different from the owner of the native program. The functions of mini programs whose owners are different from those of the native program can be similar to the functions of the native program, or they can be different from the functions of the native program, which is not limited here. For example, the native program is an application of a payment platform, and the mini program list of the native program may include mini program information of multiple banks' mini programs. For another example, if the native program is an application of a third payment platform, the mini program list of the native program may include the itinerary code to query the mini program information of the mini program. By adding the mini program information of the mini program whose owner is different from the native program in the mini program list, the functions that can be realized with the help of the native program can be further enriched, making the terminal device function implementation more flexible.
例如,原生程序为程序A1,原生程序可提供的小程序列表可包括程序A1的简易版小程序B1的小程序信息、程序A1的老年版小程序B2的小程序信息、银行Bank1的小程序C1的小程序信息、银行Bank2的小程序C2的小程序信息、行程码查询小程序D1的小程序信息和商户购物小程序D2的小程序信息。For example, if the native program is program A1, the list of mini programs that the native program can provide may include the mini program information of the simplified version of the program A1, mini program B1, the mini program information of the senior version of the program A1, B2, and the mini program C1 of Bank1. The applet information of Bank2, the applet information of Bank2, the applet information of itinerary code query applet D1 and the applet information of merchant shopping applet D2.
切换选择输入用于在小程序列表中选择一个小程序。目标小程序为切换选择输入在小程序列表中选择的小程序。切换选择输入可为单次点击输入、多次点击输入、滑动输入等,在此并不限定。The toggle selection input is used to select an applet in the list of applets. The target applet is the applet selected in the applet list for the toggle selection input. The switching selection input can be single click input, multiple click input, sliding input, etc., which is not limited here.
在步骤S202中,获取目标小程序的长期静态信息并在本地保存。In step S202, long-term static information of the target applet is obtained and saved locally.
长期静态信息为小程序的长期生效的相对难以发生变化的信息,例如,长期静态信息可包括小程序标识、小程序的配置信息、小程序的固定展示信息等,在此并不限定。终端设备可向小程序平台请求目标小程序的长期静态信息。Long-term static information is information that is effective for a long time in a mini program and is relatively difficult to change. For example, long-term static information may include the mini program identifier, configuration information of the mini program, fixed display information of the mini program, etc., which is not limited here. The terminal device can request long-term static information of the target applet from the applet platform.
将长期静态信息保存在本地,直至下一次切换选择输入选择不同的目标小程序或选择原生程序。在本次切换选择输入选择目标小程序后且未发生下一次切换选择输入的情况下,长期静态信息始终保存在本地。在本次切换选择输入选择目标小程序后且发生下一次切换选择输入的情况下,若下一次切换选择输入选择的目标小程序与本次切换选择输入选择的目标小程序不同,则在本地删除本次切换选择输入选择的目标小程序的长期静态信息,并在本地保存下一次切换选择输入选择的目标小程序的长期静态信息。Save long-term static information locally until the next time you switch the selection input to select a different target applet or select a native program. After this switching selection input selects the target applet and the next switching selection input does not occur, long-term static information is always saved locally. After the current switching selection input selects the target applet and the next switching selection input occurs, if the target applet selected by the next switching selection input is different from the target applet selected by this switching selection input, it will be deleted locally. The long-term static information of the target applet selected by the input selection of this switch is saved locally, and the long-term static information of the target applet selected by the input selection of the next switch is saved locally.
在步骤S203中,获取目标小程序的短期动态信息,根据目标小程序的长期静态信息和短期动态信息,使目标小程序在终端设备的小程序容器 中运行,并将显示页面从原生程序的页面切换为目标小程序的页面。In step S203, obtain the short-term dynamic information of the target applet, make the target applet run in the applet container of the terminal device based on the long-term static information and short-term dynamic information of the target applet, and change the display page from the page of the native program Switch to the page of the target applet.
目标小程序的运行还需要获取目标小程序的短期动态信息。短期动态信息为小程序的实时的相对易于发生变化的信息,例如,短期动态信息可包括策略列表、动态变化页面的URL地址等,在此并不限定。终端设备可向小程序平台请求目标小程序的短期动态信息。The operation of the target applet also requires the acquisition of short-term dynamic information of the target applet. Short-term dynamic information is real-time information of a mini program that is relatively easy to change. For example, short-term dynamic information may include policy lists, URL addresses of dynamically changing pages, etc., which is not limited here. The terminal device can request short-term dynamic information of the target applet from the applet platform.
小程序容器可视为小程序的框架。长期静态信息和短期动态信息共同作用,才能够使小程序在小程序容器中运行。获取目标小程序的短期动态信息后,根据目标小程序的长期静态信息和短期动态信息可共同得到目标小程序的页面,从而可将原生程序的显示页面从原生程序的页面切换为目标小程序的页面。具体地,可从原生程序的页面切换为目标小程序的首页。The applet container can be regarded as the framework of the applet. Long-term static information and short-term dynamic information work together to enable the mini program to run in the mini program container. After obtaining the short-term dynamic information of the target applet, the page of the target applet can be obtained based on the long-term static information and short-term dynamic information of the target applet, so that the display page of the native program can be switched from the page of the native program to the page of the target applet. page. Specifically, the page of the native program can be switched to the homepage of the target applet.
在步骤S204中,响应于小程序启动输入,调用原生程序读取目标小程序的长期静态信息,将原生程序的主任务和根页面设置为小程序容器,以使终端设备通过原生程序显示目标小程序的页面。In step S204, in response to the applet startup input, the native program is called to read the long-term static information of the target applet, and the main task and root page of the native program are set as the applet container, so that the terminal device displays the target applet through the native program. program page.
小程序启动输入是用于启动小程序的输入操作,终端设备接收小程序启动输入,调用原生程序,通过原生程序读取步骤S202中保存的目标小程序的长期静态消息,并将原生程序的主任务和根页面设置为小程序容器,使得原生程序被触发开启后主任务是运行目标小程序,根页面即加载的第一个页面是目标小程序的页面,使得原生程序被调用打开后,终端设备直接显示的是目标小程序的页面。The applet startup input is an input operation used to start the applet. The terminal device receives the applet startup input, calls the native program, reads the long-term static message of the target applet saved in step S202 through the native program, and saves the main program of the native program. The task and root page are set as mini program containers, so that after the native program is triggered and opened, the main task is to run the target mini program. The root page, that is, the first page loaded is the page of the target mini program, so that after the native program is called and opened, the terminal The device directly displays the page of the target applet.
在一些实施例中,在调用原生程序读取目标小程序的长期静态信息之前,终端设备可判断小程序容器是否处于开启状态。在原生程序的显示页面从原生程序的页面切换为小程序的页面的情况下,需要开启小程序容器,以使小程序能够运行。通过判断小程序容器是否处于开启状态,可判断最近一次切换后原生程序的显示页面是小程序的页面还是原生程序的页面。若小程序容器处于开启状态,则可确定最近一次切换后原生程序的显示页面是小程序的页面,是可直接通过原生程序显示小程序的情况;若小程序容器未处于开启状态,则可确定最近一次切换后原生程序的显示页面是原生程序的页面。若小程序容器处于开启状态,读取目标小程序的长期 静态信息。In some embodiments, before calling the native program to read the long-term static information of the target applet, the terminal device may determine whether the applet container is open. When the display page of the native program is switched from the page of the native program to the page of the mini program, the mini program container needs to be opened so that the mini program can run. By determining whether the mini program container is open, it can be determined whether the displayed page of the native program after the latest switch is the page of the mini program or the page of the native program. If the applet container is open, it can be determined that the display page of the native program after the latest switch is the page of the applet, which means that the applet can be displayed directly through the native program; if the applet container is not open, it can be determined The displayed page of the native program after the latest switch is the page of the native program. If the applet container is open, read the long-term static information of the target applet.
在一些实施例中,为了进一步实现小程序的类原生程序的交互及显示效果,可在获取目标小程序的短期动态信息之前,获取目标小程序的前置页面的地址,以使所述终端设备在显示所述目标小程序的页面之前显示所述目标小程序的前置页面。终端设备可向小程序平台请求获取目标小程序的前置页面的地址。小程序的前置页面为小程序启动过程中先于小程序的页面显示的页面,例如,前置页面可包括开屏页面和/或广告页面等。在一些示例中,可在显示页面切换为目标小程序的页面之前,根据前置页面的地址显示前置页面,前置页面可填补原生程序的页面切换为目标小程序的页面过程中可能产生的显示空白。在另一些示例中,获取目标小程序的前置页面的地址后,在执行上述步骤S204,终端设备通过原生程序显示目标小程序的页面之前,可先根据前置页面的地址,通过原生程序显示前置页面,以进一步实现小程序类原生程序的显示效果。In some embodiments, in order to further realize native program-like interaction and display effects of the mini program, before obtaining the short-term dynamic information of the target mini program, the address of the front page of the target mini program can be obtained, so that the terminal device Display the front page of the target applet before displaying the page of the target applet. The terminal device can request the mini program platform to obtain the address of the front page of the target mini program. The front page of a mini program is a page that is displayed before the page of the mini program during the startup process of the mini program. For example, the front page may include an opening page and/or an advertising page, etc. In some examples, the front page can be displayed according to the address of the front page before the display page is switched to the page of the target applet. The front page can fill in the gap that may occur when the page of the native program is switched to the page of the target applet. Shows blank. In other examples, after obtaining the address of the front page of the target applet, before performing the above step S204, the terminal device can display the page of the target applet through the native program according to the address of the front page. Front page to further realize the display effect of mini program native program.
在一些实施例中,如果用户需要从目标小程序的页面切换回原生程序的页面,用户可对目标小程序的页面进行切换选择输入,终端设备响应于该切换选择输入,从终端设备调用原生程序提供的更新后的小程序列表中选择原生程序的程序信息,将原生程序的显示页面从目标小程序的页面切换为原生程序的页面,具体地,从目标小程序的页面切换为原生程序的首页。In some embodiments, if the user needs to switch from the page of the target applet back to the page of the native program, the user can perform a switching selection input on the page of the target applet, and the terminal device calls the native program from the terminal device in response to the switching selection input. Select the program information of the native program from the updated list of mini programs provided, and switch the display page of the native program from the page of the target mini program to the page of the native program. Specifically, switch from the page of the target mini program to the home page of the native program. .
更新后的小程序列表可包括原生程序的程序信息。程序信息可包括程序名称、程序版本、程序类型、程序图形标志、程序页面缩略图、程序介绍说明、程序标识、程序所属方标识等信息中的一项或两项以上,在此并不限定。在原生程序的页面与小程序的页面之间的切换的过程中,或者,在小程序的页面和小程序的页面之间的切换的过程中,可更新小程序列表,将切换后的原生程序的程序信息或小程序的小程序信息从小程序列表中消除,并在小程序列表中增添切换前的原生程序的程序信息或小程序的小程序信息。The updated applet list can include program information for native programs. Program information may include one or more of program name, program version, program type, program graphic logo, program page thumbnail, program introduction description, program logo, program owner logo and other information, which is not limited here. During the process of switching between the page of the native program and the page of the mini program, or during the process of switching between the page of the mini program and the page of the mini program, the mini program list can be updated, and the switched native program The program information or the applet information of the applet is eliminated from the applet list, and the program information of the native program or the applet information of the applet before switching is added to the applet list.
在一些示例中,在从原生程序的显示页面为目标小程序的页面的情况下,可异步加载原生程序的页面,以在从目标小程序的页面切换至原生程 序的页面的情况下,能够快速完成原生程序的页面的显示。In some examples, when the display page of the native program is the page of the target applet, the page of the native program can be loaded asynchronously to quickly switch from the page of the target applet to the page of the native program. Complete the display of the native program page.
在本申请实施例中,用户可对终端设备中原生程序的页面进行切换选择输入,终端设备响应该切换选择输入确定需要切换的目标小程序,将该目标小程序的长期静态信息在本地保存,并获取目标小程序的短期动态信息,根据目标小程序的长期静态信息和短期动态信息,使目标小程序在小程序容器中运行,从原生程序的页面切换为目标小程序的页面,利用原生程序显示目标小程序的页面。在响应于小程序启动输入,重新启动小程序的情况下,终端设备调用原生程序读取长期静态信息,并将原生程序的主任务和根页面设置为小程序容器,通过原生程序展示目标小程序的页面,使得小程序在与用户的交互以及视觉体验等方面的效果可以与原生程序一致或趋于一致,提高小程序与用户的交互以及视觉体验等方面的效果。而且,在原生程序提供的小程序列表包括多个小程序的小程序信息的情况下,采用本申请实施例的方法,可调用原生程序切换显示小程序列表中的任意一个,实现了在一个原生程序中多个小程序类原生程序共存的效果。In the embodiment of the present application, the user can perform switching selection input on the page of the native program in the terminal device, and the terminal device responds to the switching selection input to determine the target applet that needs to be switched, and saves the long-term static information of the target applet locally. And obtain the short-term dynamic information of the target applet, based on the long-term static information and short-term dynamic information of the target applet, make the target applet run in the applet container, switch from the page of the native program to the page of the target applet, and use the native program Display the page of the target applet. When the mini program is restarted in response to the mini program startup input, the terminal device calls the native program to read the long-term static information, sets the main task and root page of the native program as the mini program container, and displays the target mini program through the native program The page enables the mini program to be consistent or consistent with the native program in terms of interaction with the user and visual experience, and improves the interaction between the mini program and the user and the visual experience. Moreover, in the case where the mini program list provided by the native program includes the mini program information of multiple mini programs, the method of the embodiment of the present application can be used to call the native program to switch and display any one of the mini program lists, thereby realizing a native program. The effect of coexistence of multiple small program-like native programs in the program.
为了更全面的对本方案中原生程序与小程序的集成方法进行说明,下面对首次打开原生程序,从原生程序的页面切换为小程序的页面的过程进行说明。图3为本申请实施例提供的从原生程序的页面切换为小程序的页面流程的一示例的流程图。如图3所示,该原生程序的页面切换为小程序的页面的流程可包括步骤S301至步骤S317。In order to more comprehensively explain the integration method of the native program and the mini program in this solution, the process of opening the native program for the first time and switching from the page of the native program to the page of the mini program is explained below. FIG. 3 is a flowchart of an example of the process of switching from a native program page to a mini program page provided by an embodiment of the present application. As shown in Figure 3, the process of switching the page of the native program to the page of the applet may include steps S301 to step S317.
在步骤S301中,终端设备接收对原生程序的启动输入,显示原生程序的首页。In step S301, the terminal device receives a startup input for the native program and displays the homepage of the native program.
在步骤S302中,终端设备响应于切换选择输入,确定目标小程序。In step S302, the terminal device determines the target applet in response to the switching selection input.
在步骤S303中,终端设备获取并在本地保存目标小程序的长期静态信息。In step S303, the terminal device obtains and locally saves the long-term static information of the target applet.
在步骤S304中,若用户未关注目标小程序,终端设备添加对目标小程序的关注。In step S304, if the user does not pay attention to the target applet, the terminal device adds attention to the target applet.
在步骤S305中,终端设备获取目标小程序的前置页面的地址。In step S305, the terminal device obtains the address of the front page of the target applet.
在步骤S306中,终端设备判断小程序容器是否处于开启状态。若小程序容器处于开启状态,跳转至步骤S308;若小程序容器未处于开启状 态,跳转至步骤S307。In step S306, the terminal device determines whether the applet container is in an open state. If the applet container is open, jump to step S308; if the applet container is not open, jump to step S307.
在步骤S307中,终端设备关闭原生程序中与小程序相关的任务,跳转至步骤S308。In step S307, the terminal device closes the tasks related to the applet in the native program and jumps to step S308.
在步骤S308中,终端设备返回原生程序的首页。In step S308, the terminal device returns to the home page of the native program.
在步骤S309中,终端设备开启小程序容器,启动目标小程序。In step S309, the terminal device opens the applet container and starts the target applet.
在步骤S310中,终端设备判断用户登录目标小程序是否成功。若登录成功,跳转至步骤S311;若登录失败,跳转至步骤S309,或者,提示用户手动登录。In step S310, the terminal device determines whether the user's login to the target applet is successful. If the login is successful, jump to step S311; if the login fails, jump to step S309, or prompt the user to log in manually.
在步骤S311中,终端设备显示加载中页面。In step S311, the terminal device displays the loading page.
在步骤S312中,终端设备获取目标小程序的短期动态信息。In step S312, the terminal device obtains short-term dynamic information of the target applet.
在步骤S313中,终端设备判断短期动态信息是否获取成功。若获取成功,跳转至步骤S315;若获取失败,跳转至步骤S314。In step S313, the terminal device determines whether the short-term dynamic information is successfully obtained. If the acquisition is successful, jump to step S315; if the acquisition fails, jump to step S314.
在步骤S314中,终端设备发出提示信息,提示短期动态信息获取失败。In step S314, the terminal device sends a prompt message indicating that the short-term dynamic information acquisition failed.
在步骤S315中,终端设备缓存短期动态信息。In step S315, the terminal device caches short-term dynamic information.
在步骤S316中,终端设备加载目标小程序,在小程序容器中运行目标小程序。In step S316, the terminal device loads the target applet and runs the target applet in the applet container.
在步骤S317中,终端设备通过原生程序显示目标小程序的首页。In step S317, the terminal device displays the homepage of the target applet through a native program.
根据实际应用场景和操作情况,上述步骤S301至步骤S317中有部分步骤可省略,也可适当更改步骤之间的顺序,在此并不限定。Depending on the actual application scenario and operating conditions, some of the above-mentioned steps S301 to S317 may be omitted, or the order of the steps may be appropriately changed, which is not limited here.
在上述实施例中,小程序在终端设备运行的过程中可使用原生程序的通用功能。通用功能为原生程序与小程序共同需要的功能,例如,通用功能可包括加密功能、解密功能、网络请求功能、本地存取功能、用户数据管理功能、终端设备的硬件能力使用功能等功能中的一项或多项,在此并不限定。小程序容器可设置有应用程序编程接口(Application Programming Interface,API)。该API用于小程序容器中的小程序调用原生程序的通用功能。也就是说,小程序可通过小程序容器的API来调用原生程序的通用功能。从而将原生程序的部分能力开放给小程序,使得在不增加小程序开发难度的基础上,减少小程序与原生程序在功能方面的效果 的差距,提高小程序在功能方面的效果,使得小程序的功能更加丰富。在目标小程序在小程序容器中运行且需要执行通用功能的情况下,可通过API调用原生程序的通用功能,丰富目标小程序的功能。In the above embodiment, the applet can use the common functions of the native program while the terminal device is running. General functions are functions that are required by native programs and mini programs. For example, general functions may include encryption functions, decryption functions, network request functions, local access functions, user data management functions, terminal device hardware capability usage functions, etc. One or more items are not limited here. The applet container can be provided with an application programming interface (Application Programming Interface, API). This API is used by the applet in the applet container to call the common functions of the native program. In other words, the mini program can call the common functions of the native program through the API of the mini program container. This opens up some capabilities of native programs to mini programs, thereby reducing the functional gap between mini programs and native programs without increasing the difficulty of mini program development, improving the functional effects of mini programs, and making mini programs more functional. The functions are richer. When the target applet runs in the applet container and needs to perform common functions, the common functions of the native program can be called through the API to enrich the functions of the target applet.
例如,图4为本申请实施例提供的终端设备中原生程序与小程序共存的一示例的逻辑架构示意图。如图4所示,终端设备中可运行原生程序、小程序1、小程序2和小程序3。终端设备具有小程序容器,小程序容器具有API和用户界面(User Interface,UI)组件,原生程序的通用功能可包括加解密功能、网络请求功能、本地存取功能、用户数据管理功能、硬件能力使用功能和其他功能。小程序1、小程序2和小程序3在小程序容器运行的过程中,可通过API调用原生程序的通用功能。For example, FIG. 4 is a schematic logical architecture diagram of an example of coexistence of native programs and applets in a terminal device provided by an embodiment of the present application. As shown in Figure 4, native programs, mini programs 1, mini programs 2, and mini programs 3 can be run on the terminal device. The terminal device has a mini program container, and the mini program container has API and user interface (UI) components. The common functions of the native program can include encryption and decryption functions, network request functions, local access functions, user data management functions, and hardware capabilities. Usage functions and other features. Mini Program 1, Mini Program 2, and Mini Program 3 can call the common functions of native programs through APIs while the Mini Program container is running.
在不同的场景下,小程序启动输入触发的小程序启动的方式也不同,下面以不同的场景为例对原生程序与小程序的集成方法进行说明。In different scenarios, the methods of starting the mini program triggered by the mini program startup input are also different. The following uses different scenarios as examples to illustrate the integration method of native programs and mini programs.
在一些实施例中,小程序启动输入包括对终端设备中原生程序的启动输入。在当前原生程序已经关闭,原生程序上一次被打开显示页面最终切换为目标小程序的页面的情况下,若通过对原生程序的启动输入再次启动原生程序,终端设备会调用原生程序读取上一次原生程序被打开切换至目标小程序页面情况下保存的目标小程序的长期静态信息,并将原生程序的主任务和根页面设置为小程序容器,使得原生程序的显示页面为目标小程序的首页。In some embodiments, the applet startup input includes a startup input to a native program in the terminal device. When the current native program has been closed and the display page of the last time the native program was opened is finally switched to the page of the target applet, if the native program is started again through the startup input of the native program, the terminal device will call the native program to read the last time The long-term static information of the target applet is saved when the native program is opened and switched to the target applet page, and the main task and root page of the native program are set as the applet container, so that the display page of the native program is the homepage of the target applet. .
为了更全面的对本方案中原生程序与小程序的集成方法进行说明,下面对原生程序的显示页面切换为目标小程序的页面后,原生程序重新启动的过程进行说明。图5为本申请实施例提供的原生程序重新启动流程的一示例的流程图。如图5所示,该原生程序重新启动的流程可包括步骤S401至步骤S415。In order to more comprehensively explain the integration method of the native program and the mini program in this solution, the following describes the process of restarting the native program after the display page of the native program is switched to the page of the target mini program. FIG. 5 is a flow chart of an example of a native program restart process provided by an embodiment of the present application. As shown in FIG. 5 , the process of restarting the native program may include steps S401 to S415.
在步骤S401中,终端设备响应于用户对原生程序的启动输入,启动原生程序。In step S401, the terminal device starts the native program in response to the user's input to start the native program.
在步骤S402中,终端设备加载原生程序运行逻辑。In step S402, the terminal device loads native program running logic.
在步骤S403中,终端设备判断原生程序上次启动显示页面是否已切换为小程序的页面。若原生程序上次启动未切换为小程序的页面,跳转至 步骤S404;若原生程序上次启动已切换为小程序的页面,跳转至步骤S405。In step S403, the terminal device determines whether the display page of the last startup of the native program has been switched to the page of the applet. If the native program has not switched to the page of the mini program when it was launched last time, jump to step S404; if the native program has been switched to the page of the mini program when it was launched last time, jump to step S405.
其中,可通过判断小程序容器是否处于开启状态,确定原生程序上次启动显示页面是否已切换为小程序的页面,还可通过本地保存的长期静态信息,确定原生程序上次启动切换成的小程序的页面是否为目标小程序的页面。Among them, you can determine whether the applet container is open to determine whether the display page of the native program has been switched to the page of the applet when it was last started. You can also determine the applet page that the native program was switched to when it was last started through the long-term static information saved locally. Whether the page of the program is the page of the target applet.
在步骤S404中,终端设备显示原生程序的首页。In step S404, the terminal device displays the home page of the native program.
在步骤S405中,终端设备启动目标小程序。In step S405, the terminal device starts the target applet.
在步骤S406中,终端设备异步加载原生程序的首页,以便于在需要切换回原生程序的页面时可快速切换。In step S406, the terminal device asynchronously loads the home page of the native program so that it can be quickly switched when it is necessary to switch back to the page of the native program.
在步骤S407中,终端设备加载目标小程序的前置页面。In step S407, the terminal device loads the front page of the target applet.
在步骤S408中,终端设备判断用户登录目标小程序是否成功。若登录成功,跳转至步骤S409;若登录失败,跳转至步骤S405,或者,提示用户手动登录。In step S408, the terminal device determines whether the user's login to the target applet is successful. If the login is successful, jump to step S409; if the login fails, jump to step S405, or prompt the user to log in manually.
在步骤S409中,终端设备显示加载中页面。In step S409, the terminal device displays the loading page.
在步骤S410中,终端设备获取目标小程序的短期动态信息。In step S410, the terminal device obtains short-term dynamic information of the target applet.
在步骤S411中,终端设备判断短期动态信息是否获取成功。若获取成功,跳转至步骤S413;若获取失败,跳转至步骤S412。In step S411, the terminal device determines whether the short-term dynamic information is successfully obtained. If the acquisition is successful, jump to step S413; if the acquisition fails, jump to step S412.
在步骤S412中,终端设备发出提示信息,提示短期动态信息获取失败。In step S412, the terminal device sends a prompt message indicating that the acquisition of short-term dynamic information failed.
在步骤S413中,终端设备缓存短期动态信息。In step S413, the terminal device caches short-term dynamic information.
在步骤S414中,终端设备加载目标小程序,在小程序容器中运行目标小程序。In step S414, the terminal device loads the target applet and runs the target applet in the applet container.
在步骤S415中,终端设备通过原生程序显示目标小程序的首页。具体地,终端设备可通过将原生程序的主任务和根页面设置为小程序容器,以通过原生程序显示目标小程序的首页。In step S415, the terminal device displays the homepage of the target applet through a native program. Specifically, the terminal device can display the homepage of the target applet through the native program by setting the main task and root page of the native program as the applet container.
根据实际应用场景和操作情况,上述步骤S401至步骤S415中有部分步骤可省略,也可适当更改步骤之间的顺序,在此并不限定。Depending on the actual application scenario and operating conditions, some of the above-mentioned steps S401 to S415 may be omitted, or the order of the steps may be appropriately changed, which is not limited here.
在一些实施例中,小程序启动输入包括对终端设备显示的小程序的桌 面图标的启动输入。用户可在终端设备上创建小程序的桌面图标,通过小程序的桌面图标快速调起原生程序进入小程序。图6为本申请提供的原生程序与小程序的集成方法的另一实施例的流程图。图6与图2的不同之处在于,图2中的步骤S204可具体细化为图6中的步骤S2041a至步骤S2044a,图6所示的原生程序与小程序的集成方法还可包括步骤S205和步骤S206。In some embodiments, the applet startup input includes a startup input to a desktop icon of the applet displayed by the terminal device. Users can create a desktop icon for the mini program on the terminal device, and quickly call up the native program and enter the mini program through the desktop icon of the mini program. Figure 6 is a flow chart of another embodiment of the integration method of native programs and mini programs provided by this application. The difference between Figure 6 and Figure 2 is that step S204 in Figure 2 can be specifically refined into steps S2041a to step S2044a in Figure 6 . The integration method of native programs and mini programs shown in Figure 6 can also include step S205 and step S206.
在步骤S2041a中,响应于对终端设备显示的小程序的桌面图标的启动输入,跳转至中转页面。In step S2041a, in response to a startup input to the desktop icon of the applet displayed on the terminal device, jump to the transfer page.
对小程序的桌面图标的启动输入用于启动桌面图标对应的小程序。该启动输入具体可包括对桌面图标的点击输入、长按输入等,在此并不限定。在终端设备接收对小程序的桌面图标的启动输入时,终端设备会先跳转至中转页面,再从中转页面跳转至其他页面。中转页面可为透明页面,并不显性显示。The startup input to the desktop icon of the applet is used to launch the applet corresponding to the desktop icon. The startup input may specifically include click input on desktop icons, long press input, etc., which is not limited here. When the terminal device receives the startup input for the desktop icon of the applet, the terminal device will first jump to the transfer page, and then jump to other pages from the transfer page. The transfer page can be a transparent page and not displayed explicitly.
小程序的桌面图标可在原生程序的显示页面切换为小程序的页面的情况下生成。终端设备可响应于对小程序的页面的桌面图标生成输入,跳转至图标生成中转页面,触发生成并在终端设备显示该小程序的桌面图标。图标生成中转页面可为H5页面或其他类型的页面,在此并不限定。The desktop icon of the mini program can be generated when the display page of the native program is switched to the page of the mini program. The terminal device can respond to the desktop icon generation input of the applet page, jump to the icon generation transfer page, trigger the generation and display of the desktop icon of the applet on the terminal device. The icon generation transfer page can be an H5 page or other types of pages, which is not limited here.
在步骤S2042a中,判断小程序容器是否处于开启状态。In step S2042a, it is determined whether the applet container is in an open state.
在原生程序的显示页面切换至小程序的页面的情况下,会开启小程序容器。在原生程序的显示页面切换至原生程序的页面的情况下,会关闭小程序容器。可通过判断小程序容器是否处于开启状态,来判断原生程序的显示页面之前是否已切换至小程序的页面。When the display page of the native program is switched to the page of the mini program, the mini program container will be opened. When the display page of the native program is switched to the page of the native program, the applet container will be closed. You can determine whether the display page of the native program has been switched to the page of the mini program before by determining whether the mini program container is open.
在步骤S2043a中,在小程序容器处于开启状态的情况下,从中转页面跳转至原生程序,读取目标小程序的长期静态信息,将原生程序的主任务和根页面设置为小程序容器。In step S2043a, when the applet container is open, jump from the transfer page to the native program, read the long-term static information of the target applet, and set the main task and root page of the native program as the applet container.
小程序容器处于开启状态,表示原生程序的显示页面之前已切换至小程序的页面,可从中转页面跳转至原生程序,以调用原生程序读取之前保存在本地的目标小程序的长期静态信息。将原生程序的主任务和根页面设置为小程序容器,小程序容器中是目标小程序,使得终端设备有能够显示 目标小程序的页面的能力。The applet container is open, which means that the display page of the native program has been switched to the page of the applet before. You can jump from the transfer page to the native program to call the native program to read the long-term static information of the target applet that was previously saved locally. . Set the main task and root page of the native program as a mini program container, and the mini program container is the target mini program, so that the terminal device has the ability to display the page of the target mini program.
在步骤S2044a中,若桌面图标对应的小程序为目标小程序,显示目标小程序的页面。In step S2044a, if the applet corresponding to the desktop icon is the target applet, the page of the target applet is displayed.
在桌面图标对应的小程序为目标小程序的情况下,终端设备可通过原生程序显示目标小程序的页面。从用户体验而言,用户在对小程序的桌面图标进行启动输入后,打开的是原生程序的显示页面,且显示页面是目标小程序的页面,具体的,显示页面是目标小程序的首页。When the applet corresponding to the desktop icon is the target applet, the terminal device can display the page of the target applet through the native program. From the perspective of user experience, after the user enters the startup input for the desktop icon of the mini program, what opens is the display page of the native program, and the display page is the page of the target mini program. Specifically, the display page is the homepage of the target mini program.
在一些示例中,可通过桌面图标对应的小程序的小程序标识与之前保存在本地的长期静态信息中的小程序标识是否一致,来确定桌面图标对应的小程序是否为目标小程序。In some examples, whether the applet corresponding to the desktop icon is the target applet can be determined by whether the applet ID of the applet corresponding to the desktop icon is consistent with the applet ID previously stored locally in long-term static information.
在步骤S205中,若桌面图标对应的小程序不是目标小程序,从目标小程序的页面跳转至桌面图标对应的小程序的页面。In step S205, if the applet corresponding to the desktop icon is not the target applet, jump from the page of the target applet to the page of the applet corresponding to the desktop icon.
在一些示例中,若桌面图标对应的小程序不是目标小程序,可获取桌面图标对应的小程序的长期静态信息和短期动态信息,根据桌面图标对应的小程序的长期静态信息和短期动态信息,使小程序容器中运行桌面图标对应的小程序,原生程序的主任务和根页面已设置为小程序容器,可通过原生程序显示桌面图标对应的小程序的页面,以从目标小程序的页面跳转至桌面图标对应的小程序的页面。其中,目标小程序的页面可作为一个并不显性显示的中转页面。In some examples, if the applet corresponding to the desktop icon is not the target applet, the long-term static information and short-term dynamic information of the applet corresponding to the desktop icon can be obtained. According to the long-term static information and short-term dynamic information of the applet corresponding to the desktop icon, Let the applet corresponding to the desktop icon run in the applet container. The main task and root page of the native program have been set as the applet container. The page of the applet corresponding to the desktop icon can be displayed through the native program to jump from the page of the target applet. Go to the page of the applet corresponding to the desktop icon. Among them, the page of the target applet can be used as a transfer page that is not displayed explicitly.
在另一些示例中,终端设备可通过原生程序先显示目标小程序的页面,再接收用户的切换输入,响应于该切换输入,获取桌面图标对应的小程序的长期静态信息和短期动态信息,使小程序容器中运行桌面图标对应的小程序,通过原生程序显示桌面图标对应的小程序的页面,以从目标小程序的页面跳转至桌面图标对应的小程序的页面。In other examples, the terminal device can first display the page of the target applet through a native program, and then receive the user's switching input. In response to the switching input, the terminal device can obtain the long-term static information and short-term dynamic information of the applet corresponding to the desktop icon, so that Run the applet corresponding to the desktop icon in the applet container, and display the page of the applet corresponding to the desktop icon through the native program, so as to jump from the page of the target applet to the page of the applet corresponding to the desktop icon.
在步骤S206中,在小程序容器未处于开启状态的情况下,从中转页面跳转加载桌面图标对应的小程序。In step S206, when the applet container is not in an open state, the applet corresponding to the desktop icon is jumped from the transfer page and loaded.
小程序容器未处于开启状态,表示原生程序的显示页面之前已切换至原生程序的页面。在此情况下,可按照普通的小程序加载方式加载小程序并运行。The applet container is not open, which means that the display page of the native program has been switched to the page of the native program before. In this case, the applet can be loaded and run according to the ordinary applet loading method.
为了更全面的对本方案中原生程序与小程序的集成方法进行说明,下面对通过小程序的桌面图标启动小程序的过程进行说明。图7为本申请实施例提供的通过小程序的桌面图标启动小程序流程的一示例的流程图。如图7所示,通过小程序的桌面图标启动小程序的流程可包括步骤S501至步骤S516。In order to more comprehensively explain the integration method of native programs and mini programs in this solution, the process of starting the mini program through the desktop icon of the mini program is explained below. FIG. 7 is a flowchart of an example of the process of starting an applet through the desktop icon of the applet provided by the embodiment of the present application. As shown in Figure 7, the process of starting the applet through the desktop icon of the applet may include steps S501 to S516.
在步骤S501中,终端设备响应于对小程序的桌面图标的启动输入,跳转中转页面。In step S501, the terminal device jumps to the transfer page in response to the startup input of the desktop icon of the applet.
在步骤S502中,终端设备判断原生程序上次启动显示页面是否已切换为小程序的页面。若原生程序上次启动未切换为小程序的页面,跳转至步骤S503;若原生程序上次启动已切换为小程序的页面,跳转至步骤S504。In step S502, the terminal device determines whether the display page of the last startup of the native program has been switched to the page of the applet. If the native program has not switched to the page of the mini program when it was launched last time, jump to step S503; if the native program has been switched to the page of the mini program when it was launched last time, jump to step S504.
其中,可通过判断小程序容器是否处于开启状态,确定原生程序上次启动显示页面是否已切换为小程序的页面,还可通过本地保存的长期静态信息,确定原生程序上次启动切换成的小程序的页面是否为桌面图标对应的小程序的页面。Among them, you can determine whether the applet container is open to determine whether the display page of the native program has been switched to the page of the applet when it was last started. You can also determine the applet page that the native program was switched to when it was last started through the long-term static information saved locally. Whether the page of the program is the page of the applet corresponding to the desktop icon.
在步骤S503中,终端设备按照普通的小程序加载方式加载桌面图标对应的小程序并运行。In step S503, the terminal device loads the applet corresponding to the desktop icon according to the ordinary applet loading method and runs it.
在步骤S504中,终端设备启动桌面图标对应的小程序。In step S504, the terminal device starts the applet corresponding to the desktop icon.
在步骤S505中,终端设备判断用户登录桌面图标对应的小程序是否成功。若登录成功,跳转至步骤S506;若登录失败,跳转至步骤504,或者,提示用户手动登录。In step S505, the terminal device determines whether the user's login to the applet corresponding to the desktop icon is successful. If the login is successful, jump to step S506; if the login fails, jump to step 504, or prompt the user to log in manually.
在步骤S506中,终端设备显示加载中页面。In step S506, the terminal device displays the loading page.
在步骤S507中,终端设备根据本地存储的长期静态信息,判断桌面图标对应的小程序是否是目标小程序;若桌面图标对应的小程序是目标小程序,跳转至步骤S508;若桌面图标对应的小程序不是目标小程序,跳转至步骤S510。In step S507, the terminal device determines whether the applet corresponding to the desktop icon is the target applet based on the locally stored long-term static information; if the applet corresponding to the desktop icon is the target applet, jump to step S508; if the applet corresponding to the desktop icon is the target applet, The applet is not the target applet, jump to step S510.
本示例中默认,若原生程序之前的显示页面切换为小程序的页面,则原生程序之前切换为的小程序的页面为目标小程序的页面。By default in this example, if the display page of the native program is switched to the page of the mini program, the page of the mini program that the native program was previously switched to is the page of the target mini program.
在步骤S508中,终端设备获取桌面图标对应的小程序的短期动态信 息。In step S508, the terminal device obtains short-term dynamic information of the applet corresponding to the desktop icon.
在步骤S509中,终端设备判断短期动态信息是否获取成功。若获取成功,跳转至步骤S513;若获取失败,跳转至步骤S512。In step S509, the terminal device determines whether the short-term dynamic information is successfully obtained. If the acquisition is successful, jump to step S513; if the acquisition fails, jump to step S512.
在步骤S510中,终端设备获取桌面图标对应的小程序的长期静态信息和短期动态信息。In step S510, the terminal device obtains long-term static information and short-term dynamic information of the applet corresponding to the desktop icon.
在步骤S511中,终端设备判断长期静态信息和短期动态信息是否获取成功。若获取成功,跳转至步骤S514;若获取失败,跳转至步骤S512。In step S511, the terminal device determines whether the long-term static information and short-term dynamic information are successfully obtained. If the acquisition is successful, jump to step S514; if the acquisition fails, jump to step S512.
在步骤S512中,终端设备发出提示信息,提示信息获取失败。In step S512, the terminal device sends a prompt message indicating that the information acquisition fails.
在步骤S513中,终端设备缓存短期动态信息。In step S513, the terminal device caches short-term dynamic information.
在步骤S514中,终端设备在本地保存长期动态信息,缓存短期动态信息。In step S514, the terminal device locally stores long-term dynamic information and caches short-term dynamic information.
在步骤S515中,终端设备加载桌面图标对应的小程序,在小程序容器中运行桌面图标对应的小程序。In step S515, the terminal device loads the applet corresponding to the desktop icon and runs the applet corresponding to the desktop icon in the applet container.
在步骤S516中,终端设备通过原生程序显示桌面图标对应的小程序的首页。具体地,终端设备可通过将原生程序的主任务和根页面设置为小程序容器,以通过原生程序显示桌面图标对应的小程序的首页。In step S516, the terminal device displays the home page of the applet corresponding to the desktop icon through a native program. Specifically, the terminal device can display the home page of the applet corresponding to the desktop icon through the native program by setting the main task and root page of the native program as the applet container.
根据实际应用场景和操作情况,上述步骤S501至步骤S516中有部分步骤可省略,也可适当更改步骤之间的顺序,在此并不限定。Depending on the actual application scenario and operating conditions, some of the above steps S501 to S516 may be omitted, or the order of the steps may be appropriately changed, which is not limited here.
在一些实施例中,终端设备还可响应对原生程序的显示页面的搜索输入,在与原生程序集成的小程序中查找搜索输入指示的小程序。可判断原生程序当前的显示页面是否已切换为小程序的页面。若未切换为小程序的页面,则按照普通的小程序加载方式加载小程序并运行。若已切换为小程序的页面,则启动搜索输入指示的小程序,获取搜索输入指示的小程序的长期静态信息和短期动态信息,根据长期静态信息和短期动态信息,在小程序容器中运行搜索输入指示的小程序,将原生程序的主任务设置为小程序容器,以使终端设备可通过原生程序显示搜索输入指示的小程序的页面。加载搜索输入指示的小程序的过程以及显示搜索输入指示的小程序的页面的过程可参考上述实施例中的步骤S408至步骤S415,在此不再赘 述。In some embodiments, the terminal device may also, in response to a search input to the display page of the native program, look for the applet indicated by the search input in the applet integrated with the native program. It can determine whether the current display page of the native program has been switched to the page of the mini program. If the page of the mini program is not switched, the mini program will be loaded and run according to the normal mini program loading method. If the page has been switched to the applet, start the applet indicated by the search input, obtain the long-term static information and short-term dynamic information of the applet indicated by the search input, and run the search in the applet container based on the long-term static information and short-term dynamic information. Input the applet indicated by the input, and set the main task of the native program as the applet container, so that the terminal device can display a page for searching the applet indicated by the input through the native program. The process of loading the applet indicated by the search input and the process of displaying the page of the applet indicated by the search input may refer to steps S408 to S415 in the above embodiment, and will not be described again here.
在一些实施例中,小程序启动输入可包括对链接信息的启动输入。用户可通过接收到的链接信息快速调起原生程序进入小程序。图8为本申请提供的原生程序与小程序的集成方法的又一实施例的流程图。图8与图2的不同之处在于,图2中的步骤S204可具体细化为图8中的步骤S2041b至步骤S2043b,图8所示的原生程序与小程序的集成方法还可包括步骤S207和步骤S208。In some embodiments, the applet activation input may include activation input for link information. Users can quickly call up the native program and enter the mini program through the received link information. Figure 8 is a flow chart of another embodiment of the integration method of native programs and mini programs provided by this application. The difference between Figure 8 and Figure 2 is that step S204 in Figure 2 can be specifically refined into steps S2041b to S2043b in Figure 8 . The integration method of native programs and mini programs shown in Figure 8 can also include step S207 and step S208.
在步骤S2041b中,响应于对链接信息的启动输入,调起原生程序,判断小程序容器是否处于开启状态。In step S2041b, in response to the startup input of the link information, the native program is called up to determine whether the applet container is in an open state.
对链接信息的启动输入用于启动链接信息对应的小程序。进一步地,对链接信息的启动输入可用于调起链接信息指示的小程序的指定页面。链接信息可包括外部scheme链接等,在此并不限定。链接信息可包括链接信息指示的小程序的指定页面的URL地址。链接信息可承载于短信、彩信、即时通讯消息等,在此并不限定。该启动输入具体可包括对链接信息的点击输入、长按输入等,在此并不限定。在终端设备接收对链接信息的启动输入时,会调用原生程序判断小程序容器是否处于开启状态。可通过判断小程序容器是否处于开启状态,来判断原生程序的显示页面之前是否已切换至小程序的页面。The startup input of the link information is used to start the applet corresponding to the link information. Further, the startup input of the link information can be used to call up the specified page of the applet indicated by the link information. Link information may include external scheme links, etc., which is not limited here. The link information may include the URL address of the specified page of the applet indicated by the link information. The link information can be carried in text messages, multimedia messages, instant messaging messages, etc., and is not limited here. The startup input may specifically include click input, long press input, etc. for link information, which is not limited here. When the terminal device receives the startup input of the link information, it will call the native program to determine whether the applet container is open. You can determine whether the display page of the native program has been switched to the page of the mini program before by determining whether the mini program container is open.
在步骤S2042b中,在小程序容器处于开启状态的情况下,读取目标小程序的长期静态信息,将原生程序的主任务和根页面设置为小程序容器。In step S2042b, when the applet container is open, the long-term static information of the target applet is read, and the main task and root page of the native program are set as the applet container.
小程序容器处于开启状态,表示原生程序的显示页面之前已切换至小程序的页面,可调用原生程序读取之前保存在本地的目标小程序的长期静态信息。将原生程序的主任务和根页面设置为小程序容器,小程序容器中是目标小程序,使得终端设备有能够显示目标小程序的页面的能力。The applet container is open, which means that the display page of the native program has been switched to the page of the applet. The native program can be called to read the long-term static information of the target applet that was previously saved locally. Set the main task and root page of the native program as a mini program container, and the mini program container is the target mini program, so that the terminal device has the ability to display the page of the target mini program.
在步骤S2043b中,若链接信息指示的小程序为目标小程序,根据链接信息,打开目标小程序中链接信息指示的页面。In step S2043b, if the applet indicated by the link information is the target applet, the page indicated by the link information in the target applet is opened according to the link information.
在链接信息指示的小程序为目标小程序的情况下,终端设备可通过原生程序显示目标小程序的页面。而且,由于链接信息可具体指示目标小程 序中的指定页面,可根据连接信息,通过原生程序打开并显示目标小程序中链接信息指示的指定页面。从用户体验而言,用户在对链接信息进行启动输入后,打开的是原生程序的显示页面,且显示页面是目标小程序的页面,具体地,显示页面是目标小程序中链接信息指示的指定页面。When the applet indicated by the link information is the target applet, the terminal device can display the page of the target applet through the native program. Moreover, since the link information can specifically indicate the specified page in the target applet, the specified page indicated by the link information in the target applet can be opened and displayed through the native program according to the connection information. From the perspective of user experience, after the user inputs the link information, what opens is the display page of the native program, and the display page is the page of the target applet. Specifically, the display page is the designation indicated by the link information in the target applet. page.
在一些示例中,可通过链接信息指示的小程序的小程序标识与之前保存在本地的长期静态信息中的小程序标识是否一致,来确定链接信息指示的小程序是否为目标小程序。In some examples, whether the applet indicated by the link information is the target applet can be determined by whether the applet ID of the applet indicated by the link information is consistent with the applet ID previously stored locally in long-term static information.
在步骤S207中,若链接信息指示的小程序不是目标小程序,从目标小程序的页面跳转至链接信息指示的小程序的页面。In step S207, if the applet indicated by the link information is not the target applet, jump from the page of the target applet to the page of the applet indicated by the link information.
在一些示例中,若链接信息指示的小程序不是目标小程序,可获取链接信息指示的小程序的长期静态信息和短期动态信息,根据链接信息指示的小程序的长期静态信息和短期动态信息,使小程序容器中运行链接信息指示的小程序,原生程序的主任务和根页面已设置为小程序容器,可通过原生程序显示链接信息指示的小程序的页面,以从目标小程序的页面跳转至链接信息指示的小程序的页面。其中,目标小程序的页面可作为一个并不显性显示的中转页面。In some examples, if the applet indicated by the link information is not the target applet, the long-term static information and short-term dynamic information of the applet indicated by the link information can be obtained. According to the long-term static information and short-term dynamic information of the applet indicated by the link information, Make the applet indicated by the link information run in the applet container. The main task and root page of the native program have been set as the applet container. The page of the applet indicated by the link information can be displayed through the native program to jump from the page of the target applet. Go to the page of the applet indicated by the link information. Among them, the page of the target applet can be used as a transfer page that is not displayed explicitly.
在另一些示例中,终端设备可通过原生程序先显示目标小程序的页面,再接收用户的切换输入,响应于该切换输入,获取链接信息指示的小程序的长期静态信息和短期动态信息,使小程序容器中运行链接信息指示的小程序,通过原生程序显示链接信息指示的小程序的指定页面,以从目标小程序的页面跳转至链接信息指示的小程序的指定页面。In other examples, the terminal device can first display the page of the target applet through a native program, then receive the user's switching input, and in response to the switching input, obtain the long-term static information and short-term dynamic information of the applet indicated by the link information, so that The applet indicated by the link information is run in the applet container, and the specified page of the applet indicated by the link information is displayed through the native program, so as to jump from the page of the target applet to the specified page of the applet indicated by the link information.
在步骤S208中,在小程序容器未处于开启状态的情况下,通过浏览器打开链接信息指示的小程序的页面。In step S208, when the applet container is not in an open state, the page of the applet indicated by the link information is opened through the browser.
小程序容器未处于开启状态,表示原生程序的显示页面之前已切换至原生程序的页面。在此情况下,可利用浏览器打开链接信息指示的小程序的指定页面。The applet container is not open, which means that the display page of the native program has been switched to the page of the native program before. In this case, the browser can be used to open the specified page of the applet indicated by the link information.
为了更全面的对本方案中原生程序与小程序的集成方法进行说明,下面对通过链接信息启动小程序的过程进行说明。图9为本申请实施例提供的通过链接信息启动小程序流程的一示例的流程图。如图9所示,通过链 接信息启动小程序的流程可包括步骤S601至步骤S606。In order to more comprehensively explain the integration method of native programs and mini programs in this solution, the process of starting the mini program through link information is explained below. Figure 9 is a flow chart of an example of the process of starting a mini program through link information provided by the embodiment of the present application. As shown in Figure 9, the process of starting the applet through link information may include steps S601 to S606.
在步骤S601中,终端设备响应于对链接信息的启动输入,启动原生程序。In step S601, the terminal device starts the native program in response to the startup input of the link information.
在步骤S602中,终端设备加载原生程序运行逻辑。In step S602, the terminal device loads native program running logic.
在步骤S603中,终端设备判断原生程序上次启动显示页面是否已切换为小程序的页面。若原生程序上次启动未切换为小程序的页面,跳转至步骤S604;若原生程序上次启动已切换为小程序的页面,跳转至步骤S605。In step S603, the terminal device determines whether the display page of the last startup of the native program has been switched to the page of the applet. If the native program has not switched to the page of the mini program when it was launched last time, jump to step S604; if the native program has been switched to the page of the mini program when it was launched last time, jump to step S605.
其中,可通过判断小程序容器是否处于开启状态,确定原生程序上次启动显示页面是否已切换为小程序的页面,还可通过本地保存的长期静态信息,确定原生程序上次启动切换成的小程序的页面是否为链接信息指定的小程序的页面。Among them, you can determine whether the applet container is open to determine whether the display page of the native program has been switched to the page of the applet when it was last started. You can also determine the applet page that the native program was switched to when it was last started through the long-term static information saved locally. Whether the page of the program is the page of the applet specified by the link information.
在步骤S604中,终端设备通过浏览器打开链接信息指示的小程序的页面。In step S604, the terminal device opens the page of the applet indicated by the link information through the browser.
在步骤S605中,终端设备启动链接信息指示的小程序,同步打开并显示链接信息指示的小程序的指定页面。In step S605, the terminal device starts the applet indicated by the link information, and synchronously opens and displays the designated page of the applet indicated by the link information.
在一些示例中,步骤S605中链接信息指示的小程序的启动以及链接信息指示的小程序的指定页面的打开和显示可参见上述实施例中步骤S504至步骤S516中的相关内容。若链接信息指示的小程序是目标小程序,可根据链接信息,通过原生程序直接显示链接信息指示的小程序的指定页面。若链接信息指示的小程序不是目标小程序,可通过原生程序从目标小程序的页面跳转至链接信息指示的小程序的指定页面。In some examples, for the startup of the applet indicated by the link information in step S605 and the opening and display of the specified page of the applet indicated by the link information, please refer to the relevant content in steps S504 to step S516 in the above embodiment. If the applet indicated by the link information is the target applet, the specified page of the applet indicated by the link information can be directly displayed through the native program according to the link information. If the applet indicated by the link information is not the target applet, the native program can be used to jump from the page of the target applet to the specified page of the applet indicated by the link information.
在步骤S606中,终端设备异步加载原生程序的相关信息,以便于在需要从小程序的页面切换为原生程序的页面时可快速切换。In step S606, the terminal device asynchronously loads the relevant information of the native program so that it can be quickly switched when it is necessary to switch from the page of the applet to the page of the native program.
在此并不限定步骤S606与步骤S605之间的执行顺序,两步骤可异步进行。The execution order between step S606 and step S605 is not limited here, and the two steps can be performed asynchronously.
根据实际应用场景和操作情况,上述步骤S601至步骤S606中有部分步骤可省略,也可适当更改步骤之间的顺序,在此并不限定。Depending on the actual application scenario and operating conditions, some of the above-mentioned steps S601 to S606 may be omitted, or the order of the steps may be appropriately changed, which is not limited here.
在一些实施例中,目标小程序启动输入包括对推送信息的启动输入。 用户可通过接收到的推送信息快速调起原生程序进入小程序。图10为本申请提供的原生程序与小程序的集成方法的再一实施例的流程图。图10与图2的不同之处在于,图2中的步骤S204可具体细化为图10中的步骤S2041c至步骤S2044c,图10所示的原生程序与小程序的集成方法还可包括步骤S209至步骤S211。In some embodiments, the target applet activation input includes activation input for push information. Users can quickly launch the native program and enter the mini program through the received push information. Figure 10 is a flow chart of yet another embodiment of the integration method of native programs and mini programs provided by this application. The difference between Figure 10 and Figure 2 is that step S204 in Figure 2 can be specifically refined into steps S2041c to S2044c in Figure 10 . The integration method of native programs and applets shown in Figure 10 can also include step S209 Go to step S211.
在步骤S2041c中,响应于对对推送信息的启动输入,判断原生程序是否处于后台运行状态。In step S2041c, in response to the startup input of the push information, it is determined whether the native program is running in the background.
对推送信息的启动输入用于启动推送信息指示的小程序。进一步地,对推送信息的启动输入可用于调起推送信息指示的小程序的指定页面。推送信息可包括通知栏中的推送信息、弹窗中的推送信息、锁屏界面上的推送信息等,在此并不限定。该启动输入可包括对推送信息的点击输入、长按输入等,在此并不限定。在终端设备接收对链接信息的启动输入时,可确定原生程序的运行状态。运行状态可包括后台运行状态和前端运行状态。The launch input for push information is used to launch the applet indicated by the push information. Further, the startup input of the push information can be used to call up the specified page of the applet indicated by the push information. Push information may include push information in the notification bar, push information in pop-up windows, push information on the lock screen interface, etc., and is not limited here. The startup input may include click input for push information, long press input, etc., which is not limited here. When the terminal device receives startup input for link information, the running status of the native program can be determined. Running status can include background running status and front-end running status.
在步骤S2042c中,在原生程序处于后台运行状态的情况下,调起原生程序,判断小程序容器是否处于开启状态。In step S2042c, when the native program is running in the background, the native program is called up to determine whether the applet container is open.
原生程序处于后台运行状态,即原生程序当前未在终端设备显示,需要将原生程序调起,判断小程序容器是否处于开启状态。通过判断小程序容器是否处于开启状态,来判断原生程序的显示页面之前是否已切换至小程序的页面。The native program is running in the background, that is, the native program is not currently displayed on the terminal device. You need to call up the native program to determine whether the mini program container is open. By determining whether the mini program container is open, it is possible to determine whether the display page of the native program has been switched to the mini program page before.
在步骤S2043c中,在小程序容器处于开启状态的情况下,读取目标小程序的长期静态信息,将原生程序的主任务和根页面设置为小程序容器。In step S2043c, when the applet container is open, the long-term static information of the target applet is read, and the main task and root page of the native program are set as the applet container.
小程序容器处于开启状态,小程序容器处于开启状态,表示原生程序的显示页面之前已切换至小程序的页面,可调用原生程序读取之前保存在本地的目标小程序的长期静态信息。将原生程序的主任务和根页面设置为小程序容器,小程序容器中是目标小程序,使得终端设备有能够显示目标小程序的页面的能力。The applet container is open. The applet container is open, which means that the display page of the native program has been switched to the page of the applet before. The native program can be called to read the long-term static information of the target applet that was previously saved locally. Set the main task and root page of the native program as a mini program container, and the mini program container is the target mini program, so that the terminal device has the ability to display the page of the target mini program.
在步骤S2044c中,若推送信息指示的小程序为目标小程序,根据推 送信息,打开目标小程序中推送信息指示的页面。In step S2044c, if the applet indicated by the push information is the target applet, the page indicated by the push information in the target applet is opened according to the push information.
在推送信息指示的小程序为目标小程序的情况下,终端设备可通过原生程序显示目标小程序的页面。而且,由于推送信息可具体指示目标小程序中的指定页面,可根据连接信息,通过原生程序打开并显示目标小程序中推送信息指示的指定页面。从用户体验而言,用户在对推送信息进行启动输入后,打开的是原生程序的显示页面,且显示页面是目标小程序的页面,具体地,显示页面是目标小程序中推送信息指示的指定页面。When the applet indicated by the push information is the target applet, the terminal device can display the page of the target applet through the native program. Moreover, since the push information can specifically indicate the specified page in the target applet, the specified page indicated by the push information in the target applet can be opened and displayed through the native program according to the connection information. From the perspective of user experience, after the user inputs the push information, he or she opens the display page of the native program, and the display page is the page of the target applet. Specifically, the display page is the designation indicated by the push information in the target applet. page.
在一些示例中,可通过推送信息指示的小程序的小程序标识与之前保存在本地的长期静态信息中的小程序标识是否一致,来确定推送信息指示的小程序是否为目标小程序。In some examples, whether the applet indicated by the push information is the target applet can be determined by whether the applet ID of the applet indicated by the push information is consistent with the applet ID previously stored locally in long-term static information.
在步骤S209中,若推送信息指示的小程序不是目标小程序,从目标小程序的页面跳转至推送信息指示的小程序的页面。In step S209, if the applet indicated by the push information is not the target applet, jump from the page of the target applet to the page of the applet indicated by the push information.
在一些示例中,若推送信息指示的小程序不是目标小程序,可获取推送信息指示的小程序的长期静态信息和短期动态信息,根据推送信息指示的小程序的长期静态信息和短期动态信息,使小程序容器中运行推送信息指示的小程序,原生程序的主任务和根页面已设置为小程序容器,可通过原生程序显示推送信息指示的小程序的页面,以从目标小程序的页面跳转至推送信息指示的小程序的页面。其中,目标小程序的页面可作为一个并不显性显示的中转页面。In some examples, if the applet indicated by the push information is not the target applet, the long-term static information and short-term dynamic information of the applet indicated by the push information can be obtained. According to the long-term static information and short-term dynamic information of the applet indicated by the push information, Make the applet indicated by the push information run in the applet container. The main task and root page of the native program have been set as the applet container. The page of the applet indicated by the push information can be displayed through the native program to jump from the page of the target applet. Go to the page of the applet indicated by the push message. Among them, the page of the target applet can be used as a transfer page that is not displayed explicitly.
在另一些示例中,终端设备可通过原生程序先显示目标小程序的页面,再接收用户的切换输入,响应于该切换输入,获取推送信息指示的小程序的长期静态信息和短期动态信息,使小程序容器中运行链接信息指示的小程序,通过原生程序显示推送信息指示的小程序的指定页面,以从目标小程序的页面跳转至推送信息指示的小程序的指定页面。In other examples, the terminal device can first display the page of the target applet through a native program, then receive the user's switching input, and in response to the switching input, obtain the long-term static information and short-term dynamic information of the applet indicated by the push information, so that The applet indicated by the link information is run in the applet container, and the specified page of the applet indicated by the push information is displayed through the native program, so as to jump from the page of the target applet to the specified page of the applet indicated by the push information.
在步骤S210中,在原生程序处于前端运行状态的情况下,跳转至推送信息指示的小程序的页面。In step S210, when the native program is in the front-end running state, jump to the page of the applet indicated by the push information.
原生程序处于前端运行状态,即原生程序当前在终端设备显示,不需要再将原生程序调起,可直接利用原生程序跳转至推送信息指示的小程序的指定页面。The native program is in the front-end running state, that is, the native program is currently displayed on the terminal device. There is no need to call up the native program. You can directly use the native program to jump to the specified page of the mini program indicated by the push information.
在步骤S211中,在小程序容器未处于开启状态的情况下,利用浏览器打开推送信息指示的小程序的页面。In step S211, when the applet container is not in an open state, the browser is used to open the page of the applet indicated by the push information.
小程序容器未处于开启状态,表示原生程序的显示页面之前已切换至原生程序的页面。在此情况下,可利用浏览器打开推送信息指示的小程序的指定页面。The applet container is not open, which means that the display page of the native program has been switched to the page of the native program before. In this case, the browser can be used to open the specified page of the applet indicated by the push information.
为了更全面的对本方案中原生程序与小程序的集成方法进行说明,下面对通过推送信息启动小程序的过程进行说明。图11为本申请实施例提供的通过推送信息启动小程序流程的一示例的流程图。如图11所示,通过推送信息启动小程序的流程可包括步骤S701至步骤S707。In order to more comprehensively explain the integration method of native programs and mini programs in this solution, the process of launching mini programs through push information is explained below. Figure 11 is a flowchart of an example of the process of starting a mini program through push information provided by the embodiment of the present application. As shown in Figure 11, the process of starting the applet by pushing information may include steps S701 to S707.
在步骤S701中,终端设备响应于对推送信息的启动输入,判断原生程序是否处于后台运行状态。若原生程序处于后台运行状态,跳转至步骤S703;若原生程序处于前端运行状态,跳转至步骤S702。In step S701, the terminal device determines whether the native program is running in the background in response to the startup input of the push information. If the native program is in the background running state, jump to step S703; if the native program is in the front-end running state, jump to step S702.
在步骤S702中,终端设备在原生程序中跳转至推送信息指示的小程序的指定页面。In step S702, the terminal device jumps to the designated page of the applet indicated by the push information in the native program.
在步骤S703中,终端设备进入原生程序运行逻辑。In step S703, the terminal device enters the native program running logic.
在步骤S704,终端设备判断原生程序上次启动显示页面是否已切换为小程序的页面。若原生程序上次启动未切换为小程序的页面,跳转至步骤S705;若原生程序上次启动已切换为小程序的页面,跳转至步骤S707。In step S704, the terminal device determines whether the display page of the last startup of the native program has been switched to the page of the applet. If the native program was not switched to the page of the mini program when it was launched last time, jump to step S705; if the native program was switched to the page of the mini program when it was launched last time, jump to step S707.
在步骤S705中,终端设备通过浏览器打开推送信息指示的小程序的页面。In step S705, the terminal device opens the page of the applet indicated by the push information through the browser.
在步骤S706中,终端设备加载原生程序的首页。In step S706, the terminal device loads the home page of the native program.
在步骤S707中,终端设备启动推送信息指示的小程序,打开并显示推送信息指示的小程序的指定页面。In step S707, the terminal device starts the applet indicated by the push information, opens and displays the designated page of the applet indicated by the push information.
在一些示例中,步骤S707中推送信息指示的小程序的启动以及推送信息指示的小程序的指定页面的打开和显示可参见上述实施例中步骤S504至步骤S516中的相关内容。若推送信息指示的小程序是目标小程序,可根据推送信息,通过原生程序直接显示推送信息指示的小程序的指定页面。若推送信息指示的小程序不是目标小程序,可通过原生程序从目标小程序的页面跳转至推送信息指示的小程序的指定页面。In some examples, the startup of the applet indicated by the push information in step S707 and the opening and display of the specified page of the applet indicated by the push information may refer to the relevant content in steps S504 to step S516 in the above embodiment. If the applet indicated by the push information is the target applet, the specified page of the applet indicated by the push information can be directly displayed through the native program according to the push information. If the applet indicated by the push information is not the target applet, you can use the native program to jump from the page of the target applet to the specified page of the applet indicated by the push information.
根据实际应用场景和操作情况,上述步骤S701至步骤S707中有部分步骤可省略,也可适当更改步骤之间的顺序,在此并不限定。Depending on the actual application scenario and operating conditions, some of the above-mentioned steps S701 to S707 may be omitted, or the order of the steps may be appropriately changed, which is not limited here.
本申请还提供一种原生程序与小程序的集成装置,该原生程序与小程序的集成装置可设置于终端设备中。图12为本申请提供的原生程序与小程序的集成装置的一实施例的结构示意图。如图12所示,该原生程序与小程序的集成装置800可包括选定模块801、获取模块802和控制模块803。This application also provides an integration device of native programs and mini programs, which can be installed in a terminal device. FIG. 12 is a schematic structural diagram of an embodiment of an integrated device for native programs and applets provided by this application. As shown in FIG. 12 , the device 800 for integrating native programs and small programs may include a selection module 801 , an acquisition module 802 and a control module 803 .
选定模块801可用于响应于对终端设备中原生程序的页面的切换选择输入,在原生程序提供的小程序列表中选择表征目标小程序的小程序信息。The selection module 801 may be configured to select applet information representing the target applet from the applet list provided by the native program in response to a switching selection input to a page of the native program in the terminal device.
获取模块802可用于获取目标小程序的长期静态信息并在本地保存。The acquisition module 802 can be used to acquire long-term static information of the target applet and save it locally.
获取模块802还用于获取目标小程序的短期动态信息。The acquisition module 802 is also used to acquire short-term dynamic information of the target applet.
控制模块803可用于根据目标小程序的长期静态信息和短期动态信息,使目标小程序在终端设备的小程序容器中运行,并将显示页面从原生程序的页面切换为目标小程序的页面。The control module 803 can be used to make the target applet run in the applet container of the terminal device based on the long-term static information and short-term dynamic information of the target applet, and switch the display page from the page of the native program to the page of the target applet.
控制模块803还用于响应于小程序启动输入,调用原生程序读取目标小程序的长期静态信息,将原生程序的主任务和根页面设置为小程序容器,以使终端设备通过原生程序显示目标小程序的页面。The control module 803 is also used to respond to the applet startup input, call the native program to read the long-term static information of the target applet, and set the main task and root page of the native program as the applet container, so that the terminal device displays the target through the native program Mini program page.
在本申请实施例中,在本申请实施例中,用户可对终端设备中原生程序的页面进行切换选择输入,终端设备响应该切换选择输入确定需要切换的目标小程序,将该目标小程序的长期静态信息在本地保存,并获取目标小程序的短期动态信息,根据目标小程序的长期静态信息和短期动态信息,使目标小程序在小程序容器中运行,从原生程序的页面切换为目标小程序的页面,利用原生程序显示目标小程序的页面。在响应于小程序启动输入,重新启动小程序的情况下,终端设备调用原生程序读取长期静态信息,并将原生程序的主任务和根页面设置为小程序容器,通过原生程序展示目标小程序的页面,使得小程序在与用户的交互以及视觉体验等方面的效果可以与原生程序一致或趋于一致,提高小程序与用户的交互以及视觉体验等方面的效果。而且,在原生程序提供的小程序列表包括多个小程序 的小程序信息的情况下,采用本申请实施例的方法,可调用原生程序切换显示小程序列表中的任意一个,实现了在一个原生程序中多个小程序类原生程序共存的效果。In the embodiment of the present application, in the embodiment of the present application, the user can perform switching selection input on the page of the native program in the terminal device. The terminal device responds to the switching selection input to determine the target applet that needs to be switched, and changes the target applet to the page of the native program. The long-term static information is saved locally, and the short-term dynamic information of the target applet is obtained. Based on the long-term static information and short-term dynamic information of the target applet, the target applet is run in the applet container, and the page of the native program is switched to the target applet. The page of the program uses the native program to display the page of the target applet. When the mini program is restarted in response to the mini program startup input, the terminal device calls the native program to read the long-term static information, sets the main task and root page of the native program as the mini program container, and displays the target mini program through the native program The page enables the mini program to be consistent or consistent with the native program in terms of interaction with the user and visual experience, and improves the interaction between the mini program and the user and the visual experience. Moreover, in the case where the mini program list provided by the native program includes the mini program information of multiple mini programs, the method of the embodiment of the present application can be used to call the native program to switch and display any one of the mini program lists, thereby realizing a native program. The effect of coexistence of multiple small program-like native programs in the program.
在一些实施例中,控制模块803还可用于判断小程序容器是否处于打开状态。In some embodiments, the control module 803 may also be used to determine whether the applet container is open.
控制模块803可用于在小程序容器处于开启状态的情况下,读取目标小程序的长期静态信息。The control module 803 may be used to read long-term static information of the target applet when the applet container is in an open state.
在一些实施例中,获取模块802还可用于获取目标小程序的前置页面的地址,以使终端设备在显示目标小程序的页面之前显示目标小程序的前置页面。In some embodiments, the obtaining module 802 may also be used to obtain the address of the front page of the target applet, so that the terminal device displays the front page of the target applet before displaying the page of the target applet.
在一些实施例中,小程序容器设置有应用程序编程接口API,API用于小程序容器中的小程序调用原生程序的通用功能。In some embodiments, the applet container is provided with an application programming interface API, which is used by the applet in the applet container to call common functions of the native program.
控制模块803还可用于在目标小程序在小程序容器中运行且需要执行通用功能的情况下,通过API调用原生程序的通用功能。The control module 803 can also be used to call the common function of the native program through the API when the target applet runs in the applet container and needs to perform a common function.
在一些实施例中,小程序启动输入包括对终端设备中原生程序的启动输入。In some embodiments, the applet startup input includes a startup input to a native program in the terminal device.
在一些实施例中,小程序启动输入包括对终端设备显示的小程序的桌面图标的启动输入。In some embodiments, the applet startup input includes a startup input to a desktop icon of the applet displayed on the terminal device.
控制模块803可用于:响应于对终端设备显示的小程序的桌面图标的启动输入,跳转至中转页面;判断小程序容器是否处于开启状态;在小程序容器处于开启状态的情况下,从中转页面跳转至原生程序,读取目标小程序的长期静态信息,将原生程序的主任务和根页面设置为小程序容器;若桌面图标对应的小程序为目标小程序,控制终端设备显示目标小程序的页面。The control module 803 may be used to: jump to the transfer page in response to the startup input of the desktop icon of the applet displayed on the terminal device; determine whether the applet container is in an open state; when the applet container is in an open state, transfer from The page jumps to the native program, reads the long-term static information of the target applet, and sets the main task and root page of the native program as the applet container; if the applet corresponding to the desktop icon is the target applet, control the terminal device to display the target applet. program page.
在一些示例中,控制模块803还可用于在桌面图标对应的小程序不是目标小程序的情况下,从目标小程序的页面跳转至桌面图标对应的小程序的页面In some examples, the control module 803 can also be used to jump from the page of the target applet to the page of the applet corresponding to the desktop icon when the applet corresponding to the desktop icon is not the target applet.
在一些实施例中,小程序启动输入包括对链接信息的启动输入。In some embodiments, the applet activation input includes activation input for link information.
控制模块803可用于:响应于对链接信息的启动输入,调起原生程 序,判断小程序容器是否处于开启状态;在小程序容器处于开启状态的情况下,读取目标小程序的长期静态信息,将原生程序的主任务和根页面设置为小程序容器;若链接信息指示的小程序为目标小程序,根据链接信息,打开目标小程序中链接信息指示的页面。The control module 803 can be used to: respond to the startup input of the link information, call up the native program, and determine whether the applet container is in the open state; when the applet container is in the open state, read the long-term static information of the target applet, Set the main task and root page of the native program as the applet container; if the applet indicated by the link information is the target applet, open the page indicated by the link information in the target applet based on the link information.
在一些示例中,控制模块803还可用于在链接信息指示的小程序不是目标小程序的情况下,从目标小程序的页面跳转至链接信息指示的小程序的页面。In some examples, the control module 803 may also be configured to jump from the page of the target applet to the page of the applet indicated by the link information when the applet indicated by the link information is not the target applet.
在一些实施例中,目标小程序启动输入包括对推送信息的启动输入。In some embodiments, the target applet activation input includes activation input for push information.
控制模块803可用于:响应于对对推送信息的启动输入,判断原生程序是否处于后台运行状态;在原生程序处于后台运行状态的情况下,调起原生程序,判断小程序容器是否处于开启状态;在小程序容器处于开启状态的情况下,读取目标小程序的长期静态信息,将原生程序的主任务和根页面设置为小程序容器;若推送信息指示的小程序为目标小程序,根据推送信息,打开目标小程序中推送信息指示的页面。The control module 803 can be used to: respond to the startup input of the push information, determine whether the native program is in the background running state; when the native program is in the background running state, call up the native program, and determine whether the applet container is in the open state; When the mini program container is open, read the long-term static information of the target mini program, and set the main task and root page of the native program as the mini program container; if the mini program indicated by the push information is the target mini program, according to the push Information, open the page indicated by the push information in the target applet.
在一些示例中,控制模块803还可用于在推送信息指示的小程序不是目标小程序的情况下,从目标小程序的页面跳转至推送信息指示的小程序的页面。In some examples, the control module 803 may also be configured to jump from the page of the target applet to the page of the applet indicated by the push information when the applet indicated by the push information is not the target applet.
在一些示例中,控制模块803还可用于在原生程序处于前端运行状态的情况下,跳转至推送信息指示的小程序的页面。In some examples, the control module 803 can also be used to jump to the page of the applet indicated by the push information when the native program is in the front-end running state.
在一些实施例中,获取模块802还可用于获取小程序列表。In some embodiments, the obtaining module 802 can also be used to obtain the applet list.
小程序列表包括按照推荐度由高至低排列小程序的小程序信息。The mini program list includes mini program information arranged from high to low in terms of recommendation.
推荐度根据用户的功能使用信息确定,功能使用信息包括以下一项或两项以上:小程序版本类型、小程序所属地区、小程序优先级、小程序绑定资源信息、小程序关注量、支付信息、支付所属机构信息、用户个人信息。Recommendation is determined based on the user's function usage information, which includes one or more of the following: mini program version type, mini program region, mini program priority, mini program binding resource information, mini program attention, payment Information, payment institution information, and user personal information.
在一些示例中,小程序列表包括第一类小程序的小程序信息和/或第二类小程序的小程序信息。第一类小程序包括原生程序的小程序化版本的小程序,第二类小程序包括所属方与原生程序的所属方不同的小程序。In some examples, the applet list includes applet information of the first type of applet and/or applet information of the second type of applet. The first category of mini programs includes mini programs that are mini-programmed versions of native programs, and the second category of mini programs includes mini programs that are owned by a different party than the original program.
本申请还提供一种终端设备。图13为本申请提供的终端设备的一实 施例的结构示意图。如图13所示,终端设备900包括存储器901、处理器902及存储在存储器901上并可在处理器902上运行的计算机程序。This application also provides a terminal device. Figure 13 is a schematic structural diagram of an embodiment of the terminal device provided by this application. As shown in Figure 13, the terminal device 900 includes a memory 901, a processor 902, and a computer program stored on the memory 901 and executable on the processor 902.
在一些示例中,上述处理器902可以包括中央处理器(CPU),或者特定集成电路(Application Specific Integrated Circuit,ASIC),或者可以被配置成实施本申请实施例的一个或多个集成电路。In some examples, the above-mentioned processor 902 may include a central processing unit (CPU), or an Application Specific Integrated Circuit (ASIC), or may be configured to implement one or more integrated circuits of embodiments of the present application.
存储器901可包括只读存储器(Read-Only Memory,ROM),随机存取存储器(Random Access Memory,RAM),磁盘存储介质设备,光存储介质设备,闪存设备,电气、光学或其他物理/有形的存储器存储设备。因此,通常,存储器包括一个或多个编码有包括计算机可执行指令的软件的有形(非暂态)计算机可读存储介质(例如,存储器设备),并且当该软件被执行(例如,由一个或多个处理器)时,其可操作来执行参考根据本申请实施例中原生程序与小程序的集成所描述的操作。The memory 901 may include read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), magnetic disk storage media device, optical storage media device, flash memory device, electrical, optical or other physical/tangible devices Memory storage device. Thus, generally, memory includes one or more tangible (non-transitory) computer-readable storage media (e.g., memory devices) encoded with software including computer-executable instructions, and when the software is executed (e.g., by one or multiple processors), it is operable to perform operations described with reference to the integration of native programs and applets according to embodiments of the present application.
处理器902通过读取存储器901中存储的可执行程序代码来运行与可执行程序代码对应的计算机程序,以用于实现上述实施例中的原生程序与小程序的集成。The processor 902 reads the executable program code stored in the memory 901 to run the computer program corresponding to the executable program code, so as to realize the integration of the native program and the applet in the above embodiment.
在一些示例中,终端设备900还可包括通信接口903和总线904。其中,如图13所示,存储器901、处理器902、通信接口903通过总线904连接并完成相互间的通信。In some examples, the terminal device 900 may also include a communication interface 903 and a bus 904. Among them, as shown in Figure 13, the memory 901, the processor 902, and the communication interface 903 are connected through the bus 904 and complete communication with each other.
通信接口903,主要用于实现本申请实施例中各模块、装置、单元和/或设备之间的通信。也可通过通信接口903接入输入设备和/或输出设备。The communication interface 903 is mainly used to implement communication between modules, devices, units and/or equipment in the embodiments of this application. Input devices and/or output devices may also be accessed through the communication interface 903.
总线904包括硬件、软件或两者,将终端设备900的部件彼此耦接在一起。举例来说而非限制,总线904可包括加速图形端口(Accelerated Graphics Port,AGP)或其他图形总线、增强工业标准架构(Enhanced Industry Standard Architecture,EISA)总线、前端总线(Front Side Bus,FSB)、超传输(Hyper Transport,HT)互连、工业标准架构(Industry Standard Architecture,ISA)总线、无限带宽互连、低引脚数(Low pin count,LPC)总线、存储器总线、微信道架构(Micro Channel Architecture,MCA)总线、外围组件互连(Peripheral Component Interconnect,PCI)总线、PCI-Express(PCI-E)总线、串行高级技术附件 (Serial Advanced Technology Attachment,SATA)总线、视频电子标准协会局部(Video Electronics Standards Association Local Bus,VLB)总线或其他合适的总线或者两个或更多个以上这些的组合。在合适的情况下,总线904可包括一个或多个总线。尽管本申请实施例描述和示出了特定的总线,但本申请考虑任何合适的总线或互连。Bus 904 includes hardware, software, or both, coupling the components of terminal device 900 to each other. By way of example, but not limitation, the bus 904 may include an Accelerated Graphics Port (AGP) or other graphics bus, an Enhanced Industry Standard Architecture (EISA) bus, a Front Side Bus (FSB), Hyper Transport (HT) interconnect, Industry Standard Architecture (ISA) bus, infinite bandwidth interconnect, low pin count (LPC) bus, memory bus, Micro Channel architecture Architecture, MCA) bus, Peripheral Component Interconnect (PCI) bus, PCI-Express (PCI-E) bus, Serial Advanced Technology Attachment (SATA) bus, Video Electronics Standards Association part ( Video Electronics Standards Association Local Bus, VLB) bus or other suitable bus or a combination of two or more of these. Where appropriate, bus 904 may include one or more buses. Although the embodiments of this application describe and illustrate a specific bus, this application contemplates any suitable bus or interconnection.
本申请第四方面还提供一种计算机可读存储介质,该计算机可读存储介质上存储有计算机程序指令,该计算机程序指令被处理器执行时可实现上述实施例中的原生程序与小程序的集成方法,且能达到相同的技术效果,为避免重复,这里不再赘述。其中,上述计算机可读存储介质可包括非暂态计算机可读存储介质,如只读存储器(Read-Only Memory,简称ROM)、随机存取存储器(Random Access Memory,简称RAM)、磁碟或者光盘等,在此并不限定。The fourth aspect of the present application also provides a computer-readable storage medium. The computer-readable storage medium stores computer program instructions. When the computer program instructions are executed by the processor, the native program and the applet in the above embodiment can be realized. Integrated methods can achieve the same technical effect. To avoid duplication, they will not be described again here. Among them, the above-mentioned computer-readable storage media may include non-transitory computer-readable storage media, such as read-only memory (Read-Only Memory, referred to as ROM), random access memory (Random Access Memory, referred to as RAM), magnetic disks or optical disks etc. are not limited here.
本申请还可提供一种计算机程序产品,该计算机程序产品中的指令由终端设备的处理器执行时,使得所述终端设备执行上述实施例中原生程序与小程序的集成方法。具体内容可参见上述实施例中的相关说明,在此不再赘述。The present application can also provide a computer program product. When instructions in the computer program product are executed by a processor of a terminal device, the terminal device causes the terminal device to execute the integration method of the native program and the applet in the above embodiment. For specific details, please refer to the relevant descriptions in the above embodiments and will not be described again here.
需要明确的是,本说明书中的各个实施例均采用递进的方式描述,各个实施例之间相同或相似的部分互相参见即可,每个实施例重点说明的都是与其他实施例的不同之处。对于装置实施例、设备实施例、计算机可读存储介质实施例、计算机程序产品实施例而言,相关之处可以参见方法实施例的说明部分。本申请并不局限于上文所描述并在图中示出的特定步骤和结构。本领域的技术人员可以在领会本申请的精神之后,作出各种改变、修改和添加,或者改变步骤之间的顺序。并且,为了简明起见,这里省略对已知方法技术的详细描述。It should be noted that each embodiment in this specification is described in a progressive manner, and the same or similar parts between the various embodiments can be referred to each other. Each embodiment focuses on its differences from other embodiments. place. For apparatus embodiments, equipment embodiments, computer-readable storage medium embodiments, and computer program product embodiments, relevant information may be found in the description of the method embodiments. This application is not limited to the specific steps and structures described above and illustrated in the drawings. Those skilled in the art can make various changes, modifications and additions, or change the order between steps after understanding the spirit of the present application. Also, for the sake of brevity, detailed descriptions of known method techniques are omitted here.
上面参考根据本申请的实施例的方法、装置(系统)和计算机程序产品的流程图和/或框图描述了本申请的各方面。应当理解,流程图和/或框图中的每个方框以及流程图和/或框图中各方框的组合可以由计算机程序指令实现。这些计算机程序指令可被提供给通用计算机、专用计算机、或其它可编程数据处理装置的处理器,以产生一种机器,使得经由计算机或其 它可编程数据处理装置的处理器执行的这些指令使能对流程图和/或框图的一个或多个方框中指定的功能/动作的实现。这种处理器可以是但不限于是通用处理器、专用处理器、特殊应用处理器或者现场可编程逻辑电路。还可理解,框图和/或流程图中的每个方框以及框图和/或流程图中的方框的组合,也可以由执行指定的功能或动作的专用硬件来实现,或可由专用硬件和计算机指令的组合来实现。Aspects of the present application are described above with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the 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 may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine such that execution of the instructions via the processor of the computer or other programmable data processing apparatus enables Implementation of the functions/actions specified in one or more blocks of a flowchart and/or block diagram. Such a processor may be, but is not limited to, a general-purpose processor, a special-purpose processor, a special application processor, or a field-programmable logic circuit. It will also be understood that each block in the block diagrams and/or flowchart illustrations, and combinations of blocks in the block diagrams and/or flowchart illustrations, can also be implemented by special purpose hardware that performs the specified functions or actions, or can be implemented by special purpose hardware and A combination of computer instructions.
本领域技术人员应能理解,上述实施例均是示例性而非限制性的。在不同实施例中出现的不同技术特征可以进行组合,以取得有益效果。本领域技术人员在研究附图、说明书及权利要求书的基础上,应能理解并实现所揭示的实施例的其他变化的实施例。在权利要求书中,术语“包括”并不排除其他装置或步骤;数量词“一个”不排除多个;术语“第一”、“第二”用于标示名称而非用于表示任何特定的顺序。权利要求中的任何附图标记均不应被理解为对保护范围的限制。权利要求中出现的多个部分的功能可以由一个单独的硬件或软件模块来实现。某些技术特征出现在不同的从属权利要求中并不意味着不能将这些技术特征进行组合以取得有益效果。Those skilled in the art should understand that the above embodiments are illustrative rather than restrictive. Different technical features appearing in different embodiments can be combined to achieve beneficial effects. Those skilled in the art should be able to understand and implement other modified embodiments of the disclosed embodiments based on studying the drawings, description and claims. In the claims, the term "comprising" does not exclude other means or steps; the quantifier "a" does not exclude a plurality; the terms "first" and "second" are used to indicate names rather than to indicate any specific order. . Any reference signs in the claims shall not be construed as limiting the scope. The functions of several parts appearing in the claims may be implemented by a single hardware or software module. The appearance of certain technical features in different dependent claims does not mean that these technical features cannot be combined to achieve beneficial effects.

Claims (17)

  1. 一种原生程序与小程序的集成方法,包括:An integration method of native programs and mini programs, including:
    响应于对终端设备中原生程序的页面的切换选择输入,在所述原生程序提供的小程序列表中选择表征目标小程序的小程序信息;In response to a switching selection input to the page of the native program in the terminal device, select the applet information representing the target applet from the applet list provided by the native program;
    获取所述目标小程序的长期静态信息并在本地保存;Obtain the long-term static information of the target applet and save it locally;
    获取所述目标小程序的短期动态信息,根据所述目标小程序的长期静态信息和短期动态信息,使所述目标小程序在所述终端设备的小程序容器中运行,并将显示页面从原生程序的页面切换为所述目标小程序的页面;Obtain the short-term dynamic information of the target applet, make the target applet run in the applet container of the terminal device according to the long-term static information and short-term dynamic information of the target applet, and change the display page from the native The page of the program is switched to the page of the target applet;
    响应于小程序启动输入,调用所述原生程序读取所述目标小程序的长期静态信息,将所述原生程序的主任务和根页面设置为所述小程序容器,以使所述终端设备通过所述原生程序显示所述目标小程序的页面。In response to the applet startup input, the native program is called to read the long-term static information of the target applet, and the main task and root page of the native program are set as the applet container, so that the terminal device passes The native program displays the page of the target applet.
  2. 根据权利要求1所述的方法,在所述调用所述原生程序读取所述目标小程序的长期静态信息之前,还包括:The method according to claim 1, before calling the native program to read the long-term static information of the target applet, further comprising:
    判断所述小程序容器是否处于打开状态;Determine whether the applet container is open;
    所述读取所述目标小程序的长期静态信息,包括:The reading of long-term static information of the target applet includes:
    若所述小程序容器处于开启状态,读取所述目标小程序的长期静态信息。If the applet container is open, read the long-term static information of the target applet.
  3. 根据权利要求1所述的方法,在所述获取所述目标小程序的短期动态信息之前,还包括:The method according to claim 1, before obtaining the short-term dynamic information of the target applet, further comprising:
    获取所述目标小程序的前置页面的地址,以使所述终端设备在显示所述目标小程序的页面之前显示所述目标小程序的前置页面。Obtain the address of the front page of the target applet, so that the terminal device displays the front page of the target applet before displaying the page of the target applet.
  4. 根据权利要求1所述的方法,其中,所述小程序容器设置有应用程序编程接口API,所述API用于所述小程序容器中的小程序调用所述原生程序的通用功能,The method according to claim 1, wherein the applet container is provided with an application programming interface API, and the API is used for the applet in the applet container to call the general functions of the native program,
    所述方法还包括:The method also includes:
    在所述目标小程序在所述小程序容器中运行且需要执行通用功能的情况下,通过所述API调用所述原生程序的通用功能。When the target applet runs in the applet container and needs to perform a general function, the general function of the native program is called through the API.
  5. 根据权利要求1所述的方法,其中,所述小程序启动输入包括对 所述终端设备中所述原生程序的启动输入。The method according to claim 1, wherein the applet startup input includes a startup input to the native program in the terminal device.
  6. 根据权利要求1所述的方法,其中,所述小程序启动输入包括对所述终端设备显示的小程序的桌面图标的启动输入,The method according to claim 1, wherein the applet startup input includes a startup input to the desktop icon of the applet displayed by the terminal device,
    所述响应于小程序启动输入,调用所述原生程序读取所述目标小程序的长期静态信息,将所述原生程序的主任务和根页面设置为所述小程序容器,以使所述终端设备显示所述目标小程序的页面,包括:In response to the applet startup input, the native program is called to read the long-term static information of the target applet, and the main task and root page of the native program are set as the applet container, so that the terminal The device displays the page of the target applet, including:
    响应于对所述终端设备显示的小程序的所述桌面图标的启动输入,跳转至中转页面;In response to a startup input to the desktop icon of the applet displayed on the terminal device, jump to the transfer page;
    判断所述小程序容器是否处于开启状态;Determine whether the applet container is open;
    在所述小程序容器处于开启状态的情况下,从所述中转页面跳转至所述原生程序,读取所述目标小程序的长期静态信息,将所述原生程序的主任务和根页面设置为所述小程序容器;When the applet container is open, jump from the transfer page to the native program, read the long-term static information of the target applet, and set the main task and root page of the native program. Be the applet container;
    若所述桌面图标对应的小程序为所述目标小程序,显示所述目标小程序的页面。If the applet corresponding to the desktop icon is the target applet, display the page of the target applet.
  7. 根据权利要求1所述的方法,还包括:The method of claim 1, further comprising:
    若所述桌面图标对应的小程序不是所述目标小程序,从所述目标小程序的页面跳转至所述桌面图标对应的小程序的页面。If the applet corresponding to the desktop icon is not the target applet, jump from the page of the target applet to the page of the applet corresponding to the desktop icon.
  8. 根据权利要求1所述的方法,其中,所述小程序启动输入包括对链接信息的启动输入,The method according to claim 1, wherein the applet startup input includes a startup input for link information,
    所述响应于小程序启动输入,调用所述原生程序读取所述目标小程序的长期静态信息,将所述原生程序的主任务和根页面设置为所述小程序容器,以使所述终端设备显示所述目标小程序的页面,包括:In response to the applet startup input, the native program is called to read the long-term static information of the target applet, and the main task and root page of the native program are set as the applet container, so that the terminal The device displays the page of the target applet, including:
    响应于对所述链接信息的启动输入,调起所述原生程序,判断所述小程序容器是否处于开启状态;In response to the startup input of the link information, call up the native program and determine whether the applet container is in an open state;
    在所述小程序容器处于开启状态的情况下,读取所述目标小程序的长期静态信息,将所述原生程序的主任务和根页面设置为所述小程序容器;When the applet container is in an open state, read the long-term static information of the target applet, and set the main task and root page of the native program as the applet container;
    若所述链接信息指示的小程序为所述目标小程序,根据所述链接信息,打开所述目标小程序中所述链接信息指示的页面。If the applet indicated by the link information is the target applet, open the page indicated by the link information in the target applet according to the link information.
  9. 根据权利要求8所述的方法,还包括:The method of claim 8, further comprising:
    若所述链接信息指示的小程序不是所述目标小程序,从所述目标小程序的页面跳转至所述链接信息指示的小程序的页面。If the applet indicated by the link information is not the target applet, jump from the page of the target applet to the page of the applet indicated by the link information.
  10. 根据权利要求1所述的方法,其中,所述目标小程序启动输入包括对推送信息的启动输入,The method according to claim 1, wherein the target applet startup input includes a startup input for push information,
    所述响应于小程序启动输入,调用所述原生程序读取所述目标小程序的长期静态信息,将所述原生程序的主任务和根页面设置为所述小程序容器,以使所述终端设备显示所述目标小程序的页面,包括:In response to the applet startup input, the native program is called to read the long-term static information of the target applet, and the main task and root page of the native program are set as the applet container, so that the terminal The device displays the page of the target applet, including:
    响应于对所述对推送信息的启动输入,判断所述原生程序是否处于后台运行状态;In response to the startup input of the push information, determine whether the native program is running in the background;
    在所述原生程序处于所述后台运行状态的情况下,调起所述原生程序,判断所述小程序容器是否处于开启状态;When the native program is in the background running state, call up the native program and determine whether the applet container is in an open state;
    在所述小程序容器处于开启状态的情况下,读取所述目标小程序的长期静态信息,将所述原生程序的主任务和根页面设置为所述小程序容器;When the applet container is in an open state, read the long-term static information of the target applet, and set the main task and root page of the native program as the applet container;
    若所述推送信息指示的小程序为所述目标小程序,根据所述推送信息,打开所述目标小程序中所述推送信息指示的页面。If the applet indicated by the push information is the target applet, open the page indicated by the push information in the target applet according to the push information.
  11. 根据权利要求10所述的方法,还包括:The method of claim 10, further comprising:
    若所述推送信息指示的小程序不是所述目标小程序,从所述目标小程序的页面跳转至所述推送信息指示的小程序的页面。If the applet indicated by the push information is not the target applet, jump from the page of the target applet to the page of the applet indicated by the push information.
  12. 根据权利要求10所述的方法,还包括:The method of claim 10, further comprising:
    在所述原生程序处于前端运行状态的情况下,跳转至所述推送信息指示的小程序的页面。When the native program is in the front-end running state, jump to the page of the mini program indicated by the push information.
  13. 根据权利要求1所述的方法,在所述原生程序提供的小程序列表中选择目标小程序之前,还包括:The method according to claim 1, before selecting the target applet from the applet list provided by the native program, further comprising:
    获取所述小程序列表,所述小程序列表包括按照推荐度由高至低排列小程序的小程序信息,Obtain the mini program list, which includes mini program information arranged from high to low in terms of recommendation,
    所述推荐度根据用户的功能使用信息确定,所述功能使用信息包括以下一项或两项以上:小程序版本类型、小程序所属地区、小程序优先级、小程序绑定资源信息、小程序关注量、支付信息、支付所属机构信息、用户个人信息。The recommendation degree is determined based on the user's function usage information, which includes one or more of the following: mini program version type, mini program region, mini program priority, mini program binding resource information, mini program Number of followers, payment information, payment institution information, and user personal information.
  14. 根据权利要求1所述的方法,其中,所述小程序列表包括第一类小程序的小程序信息和/或第二类小程序的小程序信息,The method according to claim 1, wherein the applet list includes applet information of the first type of applet and/or applet information of the second type of applet,
    所述第一类小程序包括所述原生程序的小程序化版本的小程序,所述第二类小程序包括所属方与所述原生程序的所属方不同的小程序。The first type of small program includes a small program that is a mini-programmed version of the native program, and the second type of small program includes a small program whose owner is different from the owner of the original program.
  15. 一种原生程序与小程序的集成装置,包括:An integrated device for native programs and mini programs, including:
    选定模块,用于响应于对终端设备中原生程序的页面的切换选择输入,在所述原生程序提供的小程序列表中选择表征目标小程序的小程序信息;A selection module configured to select applet information representing the target applet from the applet list provided by the native program in response to the switching selection input of the page of the native program in the terminal device;
    获取模块,用于获取所述目标小程序的长期静态信息并在本地保存;The acquisition module is used to obtain the long-term static information of the target applet and save it locally;
    所述获取模块还用于获取所述目标小程序的短期动态信息;The acquisition module is also used to acquire short-term dynamic information of the target applet;
    控制模块,用于根据所述目标小程序的长期静态信息和短期动态信息,使所述目标小程序在所述终端设备的小程序容器中运行,并将显示页面从原生程序的页面切换为所述目标小程序的页面;A control module configured to make the target applet run in the applet container of the terminal device based on the long-term static information and short-term dynamic information of the target applet, and switch the display page from the native program page to the target applet. Describe the page of the target applet;
    所述控制模块还用于响应于小程序启动输入,调用所述原生程序读取所述目标小程序的长期静态信息,将所述原生程序的主任务和根页面设置为所述小程序容器,以使所述终端设备通过所述原生程序显示所述目标小程序的页面。The control module is also configured to respond to the applet startup input, call the native program to read the long-term static information of the target applet, and set the main task and root page of the native program as the applet container, So that the terminal device displays the page of the target applet through the native program.
  16. 一种终端设备,包括:处理器以及存储有计算机程序指令的存储器;A terminal device includes: a processor and a memory storing computer program instructions;
    所述处理器执行所述计算机程序指令时实现如权利要求1至14中任意一项所述的原生程序与小程序的集成方法。When the processor executes the computer program instructions, the integration method of the native program and the applet as described in any one of claims 1 to 14 is implemented.
  17. 一种计算机可读存储介质,所述计算机可读存储介质上存储有计算机程序指令,所述计算机程序指令被处理器执行时实现如权利要求1至14中任意一项所述的原生程序与小程序的集成方法。A computer-readable storage medium. Computer program instructions are stored on the computer-readable storage medium. When the computer program instructions are executed by a processor, the native program and applet as described in any one of claims 1 to 14 are implemented. Integrated approach to the program.
PCT/CN2022/119712 2022-03-24 2022-09-19 Method and apparatus for integrating native program with applet, and device and medium WO2023178952A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202210293530.4 2022-03-24
CN202210293530.4A CN114691236B (en) 2022-03-24 2022-03-24 Method, device, equipment and medium for integrating native program and applet

Publications (1)

Publication Number Publication Date
WO2023178952A1 true WO2023178952A1 (en) 2023-09-28

Family

ID=82140089

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/119712 WO2023178952A1 (en) 2022-03-24 2022-09-19 Method and apparatus for integrating native program with applet, and device and medium

Country Status (2)

Country Link
CN (1) CN114691236B (en)
WO (1) WO2023178952A1 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114691236B (en) * 2022-03-24 2024-04-19 中国银联股份有限公司 Method, device, equipment and medium for integrating native program and applet

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110187913A (en) * 2019-05-17 2019-08-30 北京百度网讯科技有限公司 Publication, operation method and the device of small routine
CN111367581A (en) * 2020-02-28 2020-07-03 上海盛付通电子支付服务有限公司 Method and equipment for providing hosted program
CN112181510A (en) * 2020-08-18 2021-01-05 微民保险代理有限公司 Applet page data processing method and device, computer equipment and storage medium
CN112364266A (en) * 2020-11-11 2021-02-12 平安科技(深圳)有限公司 Seamless navigation method, device, electronic equipment and medium for applet and host application
CN113391854A (en) * 2021-06-16 2021-09-14 湖南快乐阳光互动娱乐传媒有限公司 Communication method and device for host application program and applet
CN114691236A (en) * 2022-03-24 2022-07-01 中国银联股份有限公司 Method, device, equipment and medium for integrating native program and applet

Family Cites Families (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108804158A (en) * 2018-06-05 2018-11-13 珠海市魅族科技有限公司 Application call method, the control method of terminal device, terminal device and computer readable storage medium
CN110222263B (en) * 2019-05-24 2021-08-24 苏州达家迎信息技术有限公司 Application program maintenance control method, device, server, terminal and storage medium
CN111586126B (en) * 2020-04-28 2023-06-02 百度在线网络技术(北京)有限公司 Applet pre-downloading method, device, equipment and storage medium
CN111708990A (en) * 2020-05-15 2020-09-25 支付宝(杭州)信息技术有限公司 Applet starting method, signature method, device, server and medium
CN111880701B (en) * 2020-06-19 2022-04-22 维沃移动通信有限公司 Page switching method and device and electronic equipment
CN111782328A (en) * 2020-07-02 2020-10-16 支付宝(杭州)信息技术有限公司 Application processing method and device
CN112100481A (en) * 2020-09-25 2020-12-18 百度国际科技(深圳)有限公司 Search method, search device, electronic device, and storage medium
CN112084395A (en) * 2020-09-25 2020-12-15 百度国际科技(深圳)有限公司 Search method, search device, electronic device, and storage medium
CN112269607A (en) * 2020-11-17 2021-01-26 北京百度网讯科技有限公司 Applet control method, system, server and terminal device
CN113032703B (en) * 2021-02-24 2024-04-26 腾讯科技(深圳)有限公司 Resource data processing method, device, computer equipment and storage medium
CN113190155A (en) * 2021-04-29 2021-07-30 上海掌门科技有限公司 Information processing method, device and storage medium
CN114090118B (en) * 2021-11-11 2023-09-15 北京百度网讯科技有限公司 Method, device, equipment and storage medium for starting applet

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110187913A (en) * 2019-05-17 2019-08-30 北京百度网讯科技有限公司 Publication, operation method and the device of small routine
CN111367581A (en) * 2020-02-28 2020-07-03 上海盛付通电子支付服务有限公司 Method and equipment for providing hosted program
CN112181510A (en) * 2020-08-18 2021-01-05 微民保险代理有限公司 Applet page data processing method and device, computer equipment and storage medium
CN112364266A (en) * 2020-11-11 2021-02-12 平安科技(深圳)有限公司 Seamless navigation method, device, electronic equipment and medium for applet and host application
CN113391854A (en) * 2021-06-16 2021-09-14 湖南快乐阳光互动娱乐传媒有限公司 Communication method and device for host application program and applet
CN114691236A (en) * 2022-03-24 2022-07-01 中国银联股份有限公司 Method, device, equipment and medium for integrating native program and applet

Also Published As

Publication number Publication date
CN114691236A (en) 2022-07-01
CN114691236B (en) 2024-04-19

Similar Documents

Publication Publication Date Title
KR102255138B1 (en) Message processing method and device, storage medium, and computer device
CN107256509B (en) Price comparison method and device, terminal, server and storage medium
JP2014519632A (en) Customized launch of application
KR20110086064A (en) Textual disambiguation using social connections
CN106897937B (en) Method and device for displaying social sharing information
CN111026491B (en) Interface display method, device, electronic equipment, server and storage medium
CN106547547B (en) data acquisition method and device
CN106293961B (en) Text information processing method and device
CN109922098B (en) Content sharing method and device for content sharing
US20180089230A1 (en) Search system, method and apparatus
US10606477B1 (en) Intelligent keyboard
CN109710259B (en) Data processing method, device and storage medium
WO2023178952A1 (en) Method and apparatus for integrating native program with applet, and device and medium
CN107402767B (en) Method and device for displaying push message
CN110413169B (en) Information display method, device and medium
CN111159615A (en) Webpage processing method and device
CN110658962A (en) Starting method and device of fast application, electronic equipment and storage medium
CN106789832B (en) Data processing method, device and system in call process
CN112148395A (en) Page display method, device, equipment and storage medium
CN110442416B (en) Method, electronic device and computer-readable medium for presenting information
CN113391856B (en) Cross-task-stack page processing method, device, equipment and medium
CN112256445A (en) Data processing method, device and equipment based on application program and storage medium
CN112306596A (en) Information interaction method and device and electronic equipment
CN113378022A (en) In-station search platform, search method and related device
CN110989987A (en) Portal webpage generation method, portal webpage generation device, client, server and storage medium

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 22933004

Country of ref document: EP

Kind code of ref document: A1