Method for executing a sub-application, device for executing a sub-application, computer equipment, and computer program
The method of executing sub-applications within an application by initiating a request and retrieving compiled packages addresses inefficiencies in manual scanning, enhancing efficiency and user experience.
Patent Information
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- TENCENT TECHNOLOGY (SHENZHEN) CO LTD
- Filing Date
- 2024-03-04
- Publication Date
- 2026-04-14
AI Technical Summary
The cumbersome process of scanning graphic codes to launch sub-applications on mobile terminals is inefficient and cumbersome.
A method and apparatus for executing sub-applications within an application by initiating a sub-application execution request upon a trigger operation on an icon, retrieving a compiled program package, and executing the sub-application based on obtained file data, eliminating the need for manual scanning and compilation.
This approach significantly reduces operational complexity and increases efficiency by allowing direct execution of sub-applications within an application, providing a smoother user experience and saving development resources.
Smart Images

Figure 2026511375000001_ABST
Abstract
Description
Technical Field
[0001] This application claims priority based on a Chinese patent application filed with the China National Intellectual Property Administration on May 23, 2023, with the application number 2023105949799 and the invention title "Method, Apparatus, Computer Device, and Storage Medium for Executing Sub-Applications", and all of its contents are incorporated herein by reference.
[0002] This application relates to the technical field of computers, and particularly to a method, apparatus, computer device, storage medium, and computer program product for executing sub-applications.
Background Art
[0003] With the development of computer technology, various applications have brought a lot of convenience to users, and performing duties, obtaining information, and online shopping through applications have become an essential part of daily life.
[0004] Currently, when a user needs to use a sub-application during the process of browsing a web page, usually, the user needs to scan the graphic code of the sub-application on the mobile terminal and use the sub-application on the mobile terminal. However, such an operation is cumbersome and inefficient.
Summary of the Invention
Problems to be Solved by the Invention
[0005] According to various embodiments provided in this application, a method, apparatus, computer device, computer-readable storage medium, and computer program product for executing a sub-application are provided.
Means for Solving the Problems
[0006] According to a first aspect, this application provides a method for executing a sub-application executed by a terminal. The method includes: If a service page displayed by the application includes a sub-application icon, the process includes: initiating a sub-application execution request in response to a trigger operation on the sub-application icon; when the sub-application execution request is received by the virtual server, the virtual server retrieves the compiled program package corresponding to the sub-application icon and obtains file data by parsing the program package; and within the application, executing a sub-application icon sub-application based on the file data.
[0007] According to a second aspect, the present invention further provides an execution device for a sub-application. The device is If the service page displayed by the application includes a sub-application icon, a trigger module will initiate a sub-application execution request in response to a trigger operation on the sub-application icon. When a sub-application execution request is received by the virtual server, the virtual server retrieves the compiled program package corresponding to the sub-application icon, and a file data retrieval module obtains file data by parsing the program package. The application includes a subapplication executable module that runs a subapplication with a subapplication icon based on file data.
[0008] According to a third aspect, the present invention further provides a computer device comprising a memory and one or more processors, wherein the memory stores computer-readable instructions, and when the computer-readable instructions are executed by the processors, they are transmitted to one or more processors. If a service page displayed by the application includes a sub-application icon, the following steps are performed in response to a trigger operation on the sub-application icon: initiating a sub-application execution request; when the sub-application execution request is received by the virtual server, the virtual server retrieves the compiled program package corresponding to the sub-application icon, parses the program package to obtain file data, and then executes the sub-application icon's sub-application within the application based on the file data.
[0009] According to a fourth aspect, the present invention provides one or more non-volatile readable storage media storing computer-readable instructions. When the computer-readable instructions are executed by the processor, If a service page displayed by the application includes a sub-application icon, the system implements the following steps in response to a trigger operation on the sub-application icon: when the sub-application execution request is received by the virtual server, the virtual server retrieves the compiled program package corresponding to the sub-application icon, parses the program package to obtain file data, and then executes the sub-application icon's sub-application within the application based on the file data.
[0010] According to a fifth aspect, the present application further provides a computer program product that includes computer-readable instructions. When these computer-readable instructions are executed by a processor, If a service page displayed by the application includes a sub-application icon, the system implements the following steps in response to a trigger operation on the sub-application icon: when the sub-application execution request is received by the virtual server, the virtual server retrieves the compiled program package corresponding to the sub-application icon, parses the program package to obtain file data, and then executes the sub-application icon's sub-application within the application based on the file data.
[0011] Details of one or more embodiments of the present application are described in the following drawings and description. Other features, purposes, and advantages of the present application will become apparent from the specification, drawings, and claims. [Brief explanation of the drawing]
[0012] To more clearly explain the configuration of the embodiments of this application, the following is a brief introduction of the drawings necessary for describing the embodiments. Clearly, the drawings in the following description are merely illustrative examples of the embodiments of this application, and those skilled in the art can obtain other drawings from these without any creative work.
[0013] [Figure 1] This is a diagram illustrating the application environment for the execution method of a sub-application in one embodiment. [Figure 2a] This is a schematic diagram illustrating the application scenario of the execution method for a sub-application in one embodiment. [Figure 2b] This is a schematic diagram illustrating the execution flow of a sub-application in one embodiment. [Figure 3] This is a schematic diagram illustrating the display of a sub-application icon on a service page in one embodiment. [Figure 4] This is a schematic diagram illustrating the execution of a sub-application within a new page in one embodiment. [Figure 5]A schematic diagram of executing a sub-application within a sub-page of a service page in one embodiment. [Figure 6] A schematic diagram of the structure of a sub-application runtime in one embodiment. [Figure 7] A schematic diagram of a virtual server acquiring file data in one embodiment. [Figure 8] A schematic diagram of the process of an application executing a sub-application in one embodiment. [Figure 9] A schematic diagram of the process of sending a parent application interface call request in one embodiment. [Figure 10] A schematic diagram of a browser launching a mini-program in one embodiment. [Figure 11] A schematic diagram of the problem details page of a mini-program in one embodiment. [Figure 12] A schematic diagram of a mobile device in the related art scanning the graphic code of a mini-program in a browser to launch the mini-program. [Figure 13] A schematic diagram of the process of an execution method of a sub-application in other embodiments. [Figure 14] A block diagram of the configuration of an execution device of a sub-application in one embodiment. [Figure 15] An internal configuration diagram of a computer device in one embodiment.
Embodiments for Carrying Out the Invention
[0014] To make the objectives, configurations, and advantages of the present application clearer, the present application will be described in more detail below with reference to the drawings and embodiments. It should be understood that the specific embodiments described herein are merely for interpreting the present application and do not limit the present application.
[0015] In this specification and drawings, steps and elements that are essentially the same or similar are represented by the same or similar reference numerals, and redundant descriptions of these steps and elements are omitted. Furthermore, in this description, terms such as "first," "second," etc., are used merely for distinction and should not be understood as indicating or suggesting relative importance or rank.
[0016] The method for executing the sub-application provided in the embodiment of the present invention is applicable to the application environment shown in Figure 1. Here, terminal 102 communicates with server 104 via a network. The data storage system can store data that server 104 needs to process. The data storage system may be integrated into server 104, or it may be located in the cloud or on another network server.
[0017] The terminal displays a sub-application icon on the application's service page. The terminal can initiate a sub-application execution request in response to a trigger operation on the sub-application icon. When the sub-application execution request is received by the virtual server, the terminal obtains the compiled program package corresponding to the sub-application icon from the virtual server and parses the program package to obtain file data. Within the application, the terminal executes the sub-application icon's sub-application based on the file data.
[0018] Here, terminal 102 may be a smartphone, tablet computer, laptop computer, desktop computer, smart speaker, smartwatch, Internet of Things device, or portable wearable device. Internet of Things devices may include smart speakers, smart TVs, smart air conditioners, smart in-car devices, etc. Portable wearable devices may include smartwatches, smart bracelets, head-mounted devices, etc.
[0019] Server 104 may be an independent physical server or a service node within the blockchain system. Each service node within the blockchain system constitutes a peer-to-peer (P2P) network, and the P2P protocol is an application layer protocol that runs on top of a protocol called the Transmission Control Protocol (TCP).
[0020] Furthermore, server 104 may be a server cluster consisting of multiple physical servers, or it may be a cloud server that provides cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDNs), and base cloud computing services such as big data and artificial intelligence platforms.
[0021] The terminal 102 and the server 104 can be connected using a communication method such as Bluetooth, Universal Serial Bus (USB), or a network. This invention is not limited thereto.
[0022] The method for executing a sub-application provided in the embodiment of the present invention is applicable to the application scenario shown in Figure 2a. The terminal application displays service page a02. The service page a04 displays the sub-application icon a04. In response to a trigger operation on the sub-application icon a04, a sub-application execution request is initiated. When the sub-application execution request is received by the virtual server, the virtual server obtains the compiled program package corresponding to the sub-application icon a04 and obtains file data by parsing the program package. Within the application, the sub-application icon's sub-application a06 is executed based on the file data.
[0023] In some embodiments, a method for executing a sub-application is provided, as shown in Figure 2b. Using the example of this method being executed by the terminal in Figure 1, the method includes the following steps:
[0024] In step 202, if the service page displayed by the application includes a sub-application icon, a sub-application execution request is initiated in response to a trigger operation on the sub-application icon.
[0025] Here, the application may be a browser. A page is a page displayed within the browser, i.e., a network page. A service page is a page for executing a certain service. That is, a certain service can be executed within the browser's service page. For example, a service page can be developed for a certain service, and the service page can be displayed within the browser using the service page's access address.
[0026] For example, the service may be a service for developing sub-applications. The browser may display a service page for developing sub-applications, and furthermore, the sub-applications can be developed within the service page displayed in the browser. The service may also be a service for customizing official accounts. The browser may display a service page for customizing official accounts, and furthermore, the official accounts can be customized within the service page displayed in the browser.
[0027] Here, a sub-application relates to a service that runs within a service page. For example, a service that runs within a service page may have multiple parts, and a sub-application can be used to run at least one of those parts. A sub-application icon may be an icon that launches a sub-application, and can be understood as the style of a sub-application entry displayed on a service page. That is, triggering a sub-application icon is equivalent to triggering a sub-application entry. A sub-application entry is for launching a sub-application. In other words, a sub-application icon displayed on a service page allows a sub-application to be executed within the application.
[0028] In practical applications, the sub-application may be a mini-program. That is, at least one part of the service executed within a service page may be implemented by a mini-program. Furthermore, if the application is a browser and the sub-application is a mini-program, the embodiment of this application can be used to implement the execution of a mini-program within a browser. Because the amount of data required to execute the mini-program is small, the time required to load the data necessary when the browser executes the mini-program is reduced, and furthermore, it is possible to quickly and easily access the mini-program.
[0029] Exemplary, an application is a browser, and a sub-application is a mini-program. As shown in Figure 3, a browser can be run on a terminal, a service page 301 can be displayed within the browser, and the service page 301 can execute the corresponding service. The service page 301 contains a sub-application icon 302 that corresponds to a mini-program entry.
[0030] Here, the trigger operation may be a click, a long press, a slide, or, of course, any other operation that indicates that the sub-application icon is selected. The trigger operation may be performed by the target object on the sub-application icon on the service page. The target object may be an object that logs into the service account via the service page. The service account is the account of the target object on the service page.
[0031] For example, the target object logs into its service account within the service page. While browsing the service page, the target object triggers an action on the sub-application icon by clicking, long-pressing, or sliding on the sub-application icon on the service page.
[0032] A sub-application execution request is used to launch a sub-application, and specifically, it can be used to obtain the data necessary to launch the sub-application.
[0033] In some embodiments, when an application is run on a terminal and a service page displayed within the application contains a sub-application icon, the terminal initiates a sub-application execution request in response to a target object performing a trigger operation on the sub-application icon on the service page.
[0034] For example, if the application is a browser and the sub-application is a mini-program, the terminal initiates a sub-application execution request in response to a trigger operation on the sub-application icon displayed on the browser's service page by the target object. The sub-application execution request is intended to launch the mini-program within the application.
[0035] In step 204, when a sub-application execution request is received by the virtual server, the virtual server retrieves the compiled program package corresponding to the sub-application icon and obtains file data by parsing the program package.
[0036] Here, the terminal includes a virtual server, which runs on the application's service thread. The service thread is the application's resident thread, and the virtual server can provide static resource processing services to the application.
[0037] The program package obtained by the virtual server is a compiled program package necessary for launching a sub-application. Because it is a compiled program package, the sub-application can be executed directly using this package, eliminating the need to compile the sub-application's source code. This increases the efficiency of executing sub-applications within an application and makes the process of triggering sub-applications by the application smoother.
[0038] Here, file data is the data obtained by analyzing a program package, and it is also the data necessary for executing a sub-application. In practical applications, a program package is also called a code package. Accordingly, file data is the data obtained by unpacking a code package.
[0039] In some embodiments, the terminal further includes a class library, which encapsulates each method for executing the subapplication, and the class library runs on the application's main thread. The class library generates a subapplication execution request and sends it to a virtual server running on a service thread. Based on the subapplication execution request, the virtual server retrieves the compiled program package of the subapplication and obtains file data by parsing the program package.
[0040] In some embodiments, a subapplication execution request includes the subapplication's identity number (AppID). The identity number is a unique number for the subapplication. The identity number allows for the association of the subapplication icon with its program package. When the virtual server receives a subapplication execution request, it retrieves the AppID contained in the subapplication execution request. The virtual server retrieves the compiled program package corresponding to the AppID.
[0041] In some embodiments, the application is the first parent application of the subapplication. The subapplication may run within the second parent application. The compiled program package of the subapplication may be the program package used to run the subapplication within the second parent application. That is, the subapplication can be run with the same program package in both the first and second parent applications. Furthermore, there is no need to develop a separate program package for the first parent application, saving development resources. In addition, since the subapplication used by the first parent application and the subapplication used by the second parent application have similar human-computer interaction interfaces and user functions, the subapplication used by the first parent application can achieve a similar user experience to the subapplication used by the second parent application.
[0042] In some embodiments, the second parent application may be an instant messaging application. If the application is a browser and the sub-application is a miniprogram, the virtual server retrieves the compiled program package of the miniprogram based on the miniprogram's AppID. This program package may be the program package used to run the miniprogram within the instant messaging application. This provides a similar user experience when running the miniprogram within a browser as when running it within an instant messaging application.
[0043] In step 206, within the application, execute the sub-application of the sub-application icon based on the file data.
[0044] In some embodiments, after obtaining file data by analyzing a program package using a virtual server, the virtual server retrieves the data necessary for executing a sub-application from the file data, and the terminal executes the sub-application within the application based on the data necessary for executing the sub-application.
[0045] In some embodiments, a terminal initiates a resource request, a virtual server intercepts the resource request, returns a corresponding sub-application entry file based on the resource request, the terminal executes the sub-application entry file, and during the execution of the sub-application entry file, the virtual server obtains data necessary for executing the sub-application from the file data obtained based on the sub-application entry file, and the terminal executes the sub-application within the application based on the data necessary for executing the sub-application.
[0046] In some embodiments, the application is a browser, and the service page is a page displayed within the browse. In response to a trigger operation on a sub-application icon displayed on the service page, the terminal displays a new page in the browser and initiates a sub-application execution request. When the sub-application execution request is received by the virtual server, the virtual server retrieves the compiled program package corresponding to the sub-application icon, parses the program package to obtain file data, and then executes the sub-application based on the file data within the new browse page. In other words, invoking a sub-application by the browser may also mean displaying the sub-application to be executed on the browser's new page.
[0047] For example, a sub-application is a mini-program. Referring to Figures 3 and 4, a service page 301 is displayed in the browser, and in response to a trigger operation on the application icon 302 on the service page 301, a new page 401 is displayed in the browser to show the mini-program that will be executed on the subsequent new page 401. Once the browser has finished launching the mini-program, what was displayed on the new page 401 becomes the mini-program's top page 402.
[0048] In some embodiments, the terminal responds to a trigger operation on a sub-application icon displayed on the service page by displaying a subpage on the service page, initiating a sub-application execution request, retrieving file data by a virtual server, and then executing the sub-application within the subpage of the service page based on the file data. In other words, invoking a sub-application by the browser may also mean displaying the sub-application to be executed on the subpage of the service page.
[0049] For example, a sub-application is a mini-program. Referring to Figures 3 and 5, the browser displays a service page 301, and in response to a trigger operation on the application icon 302 on the service page 301, the subpage 501 is displayed to show the mini-program that will subsequently be executed on the subpage 501. The subpage 501 is the top page of the mini-program.
[0050] In the above method of executing sub-applications, if a sub-application icon is included in the service page displayed by the application, a trigger operation on the sub-application icon initiates a sub-application execution request. When the sub-application execution request is received by the virtual server, the virtual server retrieves the compiled program package corresponding to the sub-application icon, parses the program package to obtain file data, and executes the sub-application within the application using the file data. In other words, by triggering the sub-application icon on the application's service page, the sub-application can be executed directly within the application. Compared to related technologies where a mobile device scans the graphic code of the sub-application displayed within the application and executes the sub-application on the mobile device, directly executing the sub-application within the application significantly reduces the complexity of the operation to execute the sub-application and improves the efficiency of sub-application execution. Furthermore, since what is obtained by the virtual server is a compiled program package, the program package can be directly parsed, and the sub-application can be executed using the parsed file data, eliminating the need to perform the compilation process. This increases the efficiency of executing sub-applications within the application and makes the process of triggering sub-applications by the application smoother.
[0051] In some embodiments, the step of initiating a subapplication execution request in response to a trigger operation on a subapplication icon includes the step of initiating a class library interface call request by the application component of the application in response to a trigger operation on the subapplication icon, wherein the class library interface call request is for instructing the class library to initiate a subapplication execution request to the virtual server.
[0052] Here, an application component is a part of a service page, meaning the service page may be a complete page that packs multiple components together. An application component may also be a component that encapsulates a sub-application entry, and a sub-application icon can be understood as the visual style of the application component.
[0053] In practical applications, application components may be built on Vue or on React. Both Vue and React are user interface frameworks for JavaScript (a programming language) and can be used to develop components. This makes it easy to implement sub-application execution methods on pages built on Vue and React.
[0054] Here, the class library encapsulates each method for executing a subapplication, and the class library runs on the application's main thread and can be used to initiate subapplication execution requests. A class library interface call request is a request to invoke the class library interface.
[0055] In some embodiments, a trigger operation on a sub-application icon can be understood as a trigger operation on the application component corresponding to the sub-application icon. When the application component corresponding to the sub-application icon receives the trigger operation, the application component initiates a class library interface call request. The class library interface call request invokes the class library interface and provides access to the class library. When the class library receives the class library interface call request initiated by the application component, it initiates a sub-application execution request to the virtual server.
[0056] In some embodiments, a subapplication execution request is a request to initialize the subapplication. When the application component corresponding to the subapplication icon receives a trigger operation, the application component initiates a class library interface call request. Upon receiving this class library interface call request, the class library triggers the initialization of the subapplication and further initiates a subapplication execution request to the virtual server to request the initialization of the subapplication.
[0057] In some embodiments, the sub-application may be a mini-program. The application component initiates a class library interface call request by triggering the sub-application icon displayed on the service page. When the class library receives the class library interface call request initiated by the application component, it initiates a sub-application execution request to the virtual server, requesting the initialization of the mini-program.
[0058] In the above embodiment, the service page may be a complete page that packs multiple components. Sub-application entries are encapsulated in application components corresponding to the sub-application icons. This allows sub-application entries to be introduced to different service pages without making additional improvements to the service page implementation framework, enabling the sub-application execution method to be directly applied to existing pages and improving the adaptability of the sub-application execution method.
[0059] In some embodiments, the application is the first parent application of the subapplication. When a subapplication execution request is received by the virtual server, the virtual server obtains the compiled program package corresponding to the subapplication icon and parses the program package to obtain file data, which includes the virtual server downloading the compiled program package corresponding to the subapplication icon from the target server. Here, the target server is for executing the second parent application of the subapplication, and the first and second parent applications are different applications.
[0060] Here, the fact that the target server is for executing the second parent application of the sub-application means that when executing the second parent application, it is necessary to communicate with the target server to obtain the data required for the execution of the second parent application and to provide other services to the second parent application. Furthermore, when executing a sub-application within the second parent application, it is also necessary to communicate with the target server to obtain the data required for the execution of the sub-application. The target server can be understood as the backend server of the second parent application.
[0061] Here, the program package of the sub-application may be a program package compiled with the public development tools of the second parent application. That is, the program package obtained by the virtual server is the same as the program package loaded when the sub-application is launched within the second parent application.
[0062] In related technologies, subapplications are typically executed within a second parent application, so the compiled program package for the subapplication is an existing program package. A virtual server can directly obtain the program package used to execute the subapplication within the second parent application, eliminating the need to develop a separate program package for the application and saving time and cost in implementing the subapplication execution method.
[0063] For example, the second parent application is an instant messaging application, and the sub-application is a miniprogram. In practical applications, miniprograms primarily run within the instant messaging application, and the program package for the miniprogram resides on the instant messaging application's backend server (target server). When running a miniprogram in a browser, the virtual server can directly retrieve the miniprogram's program package from the instant messaging application's backend server.
[0064] In some embodiments, the virtual server determines the download address of the program package based on the sub-application execution request, and retrieves the compiled program package of the sub-application from the target server based on the program package download address.
[0065] In some embodiments, the subapplication execution request includes the subapplication's identity number. The virtual server retrieves the subapplication's identity number included in the subapplication execution request and determines the program package download address based on the subapplication's identity number. Based on the download address, the virtual server generates a program package retrieval request, sends the request to the target server, and receives the compiled program package sent from the target server.
[0066] In the above embodiment, the program package obtained by the virtual server is the same as the program package loaded when the sub-application is launched within the second parent application. This gives the sub-application launched within the application based on this program package a native effect of launching the sub-application within the second parent application, eliminating the need to develop a separate program package for the sub-application within the application, thus saving time and cost in implementing the sub-application execution method. Furthermore, since the program package is a compiled program package, there is no need to perform a compilation process based on the sub-application's source code. This increases the efficiency of running the sub-application within the application and makes the experience of triggering the sub-application by the application smoother.
[0067] In some embodiments, the step of a virtual server downloading a compiled program package corresponding to a sub-application icon from a target server includes the steps of the virtual server obtaining a program package download address corresponding to the sub-application icon from a proxy server, and downloading the compiled program package corresponding to the sub-application icon from the target server based on the program package download address.
[0068] Here, the terminal further includes a proxy server, which can provide an address lookup service for program packages.
[0069] In some embodiments, when a virtual server receives a sub-application execution request, it sends an address lookup request to a proxy server, which, based on the address lookup request, returns the program package download address corresponding to the sub-application icon. Upon obtaining the program package download address, the virtual server downloads the compiled program package corresponding to the sub-application icon from the target server based on the program package download address.
[0070] In some embodiments, the subapplication execution request includes the subapplication's identity number. The step of the virtual server obtaining the program package download address corresponding to the subapplication icon from the proxy server includes the steps of the virtual server generating an address lookup request corresponding to the identity number, sending the address lookup request to the proxy server to instruct the proxy server to obtain the program package download address corresponding to the subapplication icon, and obtaining the program package download address corresponding to the subapplication icon returned by the proxy server. By sending the address lookup request to the proxy server, the program package download address corresponding to the subapplication icon can be obtained quickly.
[0071] In one possible scenario, the virtual server retrieves the identity number included in the sub-application execution request, generates an address lookup request based on the identity number, and sends the address lookup request to the proxy server. The proxy server retrieves the identity number in the address lookup request, looks up the version number of the sub-application icon based on the identity number, and retrieves the program package download address corresponding to the version number. The proxy server may also send the program package download address corresponding to the version number to the virtual server so that the virtual server retrieves the program package download address corresponding to the sub-application icon. The version number may be the current latest version number of the sub-application.
[0072] In other possible scenarios, the proxy server, after obtaining the identity number in the address lookup request, searches for the program package list based on the identity number. The program package list contains the download address for each program package. Each program package download address is the download address for each compiled program package required to launch the subapplication corresponding to the version number. The proxy server sends the program package list to the virtual server. Furthermore, the virtual server can determine the program package download addresses based on the program package list.
[0073] In some embodiments, the terminal includes a sub-application runtime, which can be the engine for running sub-applications within an application. If the sub-application is a miniprogram, the sub-application runtime can also be referred to as the miniprogram runtime.
[0074] Exemplary, as shown in Figure 6, the sub-application runtime includes an application component, a class library, a virtual server, and a proxy server. As shown in Figure 7, in response to a trigger operation on the sub-application icon, the sub-application runtime initiates a class library interface call request via the application component, and the class library, based on the class library interface call request, initiates a sub-application execution request to the virtual server. The sub-application execution request is for initializing the sub-application.
[0075] When the virtual server receives a sub-application execution request, it sends an address lookup request to the proxy server based on the sub-application execution request. The proxy server returns a program package list to the virtual server based on the address lookup request, and the virtual server determines the program package download address based on the program package list. After determining the program package download address, the virtual server creates a static service instance, downloads the program package from the target server based on the program package download address, parses the program package to obtain file data, and completes the creation of the static service instance. The virtual server returns the instance identifier of the static service instance to the class library. If the class library has obtained the instance identifier, it initializes the sub-application instance and controller corresponding to the instance identifier and completes the initialization of the sub-application.
[0076] Static service instances provide file data obtained by parsing program packages, while sub-application instances implement the functionality of sub-applications. For example, a sub-application instance encapsulates code injector techniques for injecting customization scripts into the sub-application's native components. A sub-application instance further encapsulates an event emitter that can be used to process communication messages from virtual and proxy servers and to emit events. A sub-application instance further encapsulates a reference utility that can be used to reference concrete objects of native components. The controller provides the application with the ability to control sub-applications, for example, by creating, destroying, and restarting them.
[0077] In the above embodiment, the virtual server obtains the program package download address from the proxy server and then downloads the compiled program package corresponding to the program package download address from the target server. This gives the sub-application launched within the application based on the program package a native effect of launching the sub-application within the second parent application, eliminating the need to perform a compilation process based on the sub-application's source code. This increases the efficiency of running the sub-application within the application and makes the experience of triggering the sub-application by the application smoother.
[0078] In some embodiments, the step of executing a sub-application of a sub-application icon based on file data within an application includes the steps of: initiating a resource request that includes a virtual resource locator; when the resource request is received by the virtual server, having the virtual server obtain a sub-application entry file corresponding to the virtual resource locator; obtaining the response data required for the sub-application entry file from the file data; and executing a sub-application of a sub-application icon within the application based on the sub-application entry file and the response data.
[0079] Here, a resource locator refers to a Uniform Resource Location (URL), which can be used to pinpoint the specific location of a resource. A virtual resource locator (virtual URL) refers to a virtual server where the specific location of a resource is located.
[0080] Here, the subapplication entry file is generated by the virtual server. The subapplication entry file can be understood as the main directory of the subapplication and contains, but is not limited to, the base libraries, native components, and file paths necessary for the subapplication's execution. The base libraries and native components contained in the subapplication entry file provide the framework necessary for the subapplication's execution. The file paths contained in the subapplication entry file can introduce the response data necessary for the subapplication's execution. The response data is the page resource data necessary for the subapplication's execution. The subapplication can be executed using the subapplication entry file and the response data. In practical applications, the subapplication entry file can be written as index.html, i.e., the main directory of the subapplication.
[0081] In some embodiments, a terminal can initiate a resource request via a class library. When the class library initiates a resource request, a capture event is triggered. If the virtual server detects the capture event, it can intercept the resource request initiated by the class library. That is, the resource request is captured by the virtual server. To ensure that the virtual server can intercept the resource request initiated by the class library, the virtual server may continuously detect the capture event.
[0082] The virtual server obtains the virtual URL included in the resource request, retrieves the corresponding sub-application entry file based on the virtual URL, and returns the sub-application entry file to the class library, causing the class library to retrieve the sub-application entry file. The terminal executes the sub-application entry file using the class library, and in the process of executing the sub-application entry file, retrieves response data from the virtual server's file data based on the file path included in the sub-application entry file. The class library then executes the sub-application within the application based on the sub-application entry file and the response data.
[0083] In the above embodiment, the virtual server intercepts the resource request, so that the resource request is not actually sent, but the virtual server processes the resource request, obtains a sub-application entry file, obtains the response data necessary to execute the sub-application from the sub-application entry file, and executes the sub-application directly within the application based on the sub-application entry file and response data, thereby significantly reducing the complexity of the operation to execute the sub-application.
[0084] In some embodiments, the step of initiating a resource request that includes a virtual resource locator includes the steps of creating an inline frame instance, wherein the location of the external resource pointed to by the inline frame instance is the virtual resource locator, and initiating a resource request that includes the virtual resource locator using the inline frame instance. By creating an inline frame instance and initiating a resource request using the inline frame instance, it is possible to subsequently load the inline frame instance with the retrieved data, embed the page that runs the subapplication into a service page, and directly run the subapplication within the application, thereby significantly reducing the complexity of the operation of running the subapplication.
[0085] Here, an inline frame instance refers to an iframe instance, where an iframe is an HTML tag, HTML is a language for describing network pages, and an iframe instance can be used to embed a page into another page. In the embodiments of this invention, a page that runs a subapplication is embedded into a service page by creating an inline frame instance.
[0086] Here, the location of the external resource being referred to is an attribute of the inline frame instance and is used to specify the address of the document embedded in the iframe instance.
[0087] The terminal creates an iframe instance using the class library, and the src (location of the external resource it points to) of the iframe instance is a virtual URL. The class library initiates a resource request containing the virtual URL by executing the iframe instance. The class library may also create the iframe instance after completing the initialization of the sub-application instance and controller.
[0088] In some embodiments, the step of obtaining the response data required for a subapplication entry file from file data includes the step of initiating a file retrieval request based on the file path contained in the subapplication entry file using an inline frame instance, and the step of obtaining the response data required for the subapplication entry file from the file data using the file retrieval request.
[0089] Here, the sub-application entry file contains a file path. Since the sub-application entry file is generated by the virtual server, and the file path is the storage path for file data on the virtual server, the corresponding response data can be retrieved from the file data of the virtual server based on the file path contained in the sub-application entry file.
[0090] A resource request initiated from the class library is intercepted by the virtual server, which then returns a sub-application entry file based on the virtual URL included in the resource request. The terminal executes the sub-application entry file using an iframe instance created by the class library, generates a file retrieval request based on the file path included in the sub-application entry file, and sends the request to the virtual server. Upon receiving the file retrieval request, the virtual server retrieves the corresponding response data from the file data based on the file path included in the request and sends the response data to the class library. The class library then executes the sub-application within the application by loading an iframe instance based on the sub-application entry file and the response data.
[0091] In the above embodiment, an inline frame instance is used to execute a sub-application entry file, initiating a file retrieval request that includes the file path. Response data corresponding to the file path is obtained from the virtual server. Furthermore, based on the sub-application entry file and response data, the inline frame instance is loaded, embedding the page that executes the sub-application into the service page. This enables direct execution of the sub-application within the application, significantly reducing the complexity of the operation required to execute the sub-application. Additionally, because less data is involved in the execution of the sub-application, it can be quickly launched and executed within the application.
[0092] In some embodiments, after obtaining file data by parsing a program package, the sub-application execution method further includes the step of storing the file data in a buffer area of a virtual server. The step of obtaining the response data required for the sub-application entry file from the file data includes the step of obtaining the response data required for the sub-application entry file based on the file data in the buffer area.
[0093] In some embodiments, a virtual server downloads the program package of a sub-application and parses the program package. The virtual server stores the parsed file data in a buffer area. The terminal sends a file retrieval request to the virtual server via a class library. The virtual server retrieves response data corresponding to the file retrieval request from the buffer area.
[0094] In some implementations, a file retrieval request includes a file path, and when the virtual server receives the file retrieval request, it retrieves the file path included in the request and, based on the file path, retrieves the corresponding response data from the file data stored in the buffer area.
[0095] In the above embodiment, the virtual server stores the file data obtained by parsing the program package in a buffer area and manages the file data in the buffer area. The virtual server, acting as a resident service thread for the application, provides the application with resource processing services for sub-applications, allowing the application to obtain the data necessary for executing sub-applications from the virtual server. This facilitates the application to execute sub-applications based on the file data in the buffer area, enabling direct execution of sub-applications within the application and significantly reducing the complexity of the operation to execute sub-applications.
[0096] In some embodiments, the sub-application execution method further includes the step of having the virtual server download the response data required for the sub-application entry file from the target server if the response data required for the sub-application entry file has not been obtained from the buffer area. By having the virtual server provide the application with a sub-application resource processing service, the application can obtain the data required for the execution of the sub-application from the virtual server. This enables the direct execution of sub-applications within the application and significantly reduces the complexity of the operation of executing sub-applications.
[0097] As can be seen from the above example, obtaining the response data required for the sub-application entry file from the buffer area involves initiating a file retrieval request using the file path contained in the sub-application entry file, and then obtaining the response data corresponding to the file path from the buffer area. Therefore, if the response data required for the sub-application entry file is not obtained from the buffer area, it indicates that the response data corresponding to the file path is missing from the buffer area, suggesting that the program package download was unsuccessful or that the program package may have been unexpectedly lost. The virtual server may redownload the response data required for the sub-application entry file from the target server.
[0098] In some embodiments, the step of a virtual server downloading response data required for a sub-application entry file from a target server includes the steps of: the virtual server downloading an additional program package from the target server and obtaining additional file data by parsing the additional program package; storing the additional file data in a buffer area; and obtaining response data required for a sub-application entry file based on the additional file data in the buffer area.
[0099] The virtual server may generate an address lookup request based on the file path and send the address lookup request to the proxy server. The proxy server returns the download address for the additional program package based on the address lookup request. The virtual server obtains the download address for the additional program package from the target server. The virtual server downloads the additional program package from the target server based on the download address for the additional program package.
[0100] The virtual server generating an address lookup request based on a file path may also mean that the virtual server searches for the download address of an additional program package in the program package list based on the file path, and if the download address of the additional program package is not found in the program package list, it generates an address lookup request based on the file path.
[0101] Exemplary, as shown in Figure 8, the class library creates an inline frame instance (iframe instance) after completing the initialization of the sub-application instance and controller. The class library executes the iframe instance and initiates a resource request containing a virtual URL. The virtual server intercepts the resource request and returns a sub-application entry file based on the resource request. The class library executes the sub-application entry file via the iframe instance and initiates a file retrieval request to the virtual server based on the file path contained in the sub-application entry file. Based on the file retrieval request, the virtual server retrieves the corresponding response data from the file data in the buffer area and sends the response data to the class library. If the corresponding response data is not retrieved from the file data in the buffer area, the virtual server downloads an additional program package from the target server based on the file path. The virtual server parses the additional program package to retrieve additional file data, saves the additional file data to the buffer area, retrieves the response data corresponding to the file retrieval request from the buffer area, and sends the response data to the class library. Based on the sub-application entry file and response data, the class library loads the iframe instance to execute the sub-application within the application.
[0102] In the above embodiment, if response data is not retrieved from the buffer area, the virtual server can download additional program packages again from the target server and save them to the buffer area. This allows the necessary response data to be directly retrieved from the buffer area if a sub-application needs to be executed later within the application. This avoids duplicate data retrieval, reduces resource consumption, and improves the efficiency of executing sub-applications within the application.
[0103] In some embodiments, the execution method of a subapplication further includes the steps of: obtaining a target identity ticket in response to a target interface call operation triggered within the subapplication running within the application, wherein the target identity ticket is the identity ticket of a target object in a second parent application; generating a target interface call request that includes the target identity ticket; and verifying the target identity ticket with a proxy server, and if the target identity ticket passes verification, forwarding the target interface call request to the target server.
[0104] Here, the target interface call operation is for calling the interface of the target server. In practical applications, calling the target server interface may be used to obtain the communication number of a target object associated with a second parent application, or to obtain the friendship status of a target object in the second parent application. Furthermore, operations that are achieved by calling the target server interface when executing a subapplication within a second parent application can also be achieved by calling the target server interface when executing a subapplication within an application.
[0105] Here, the target identity ticket can reflect the identity information of the target object in the second parent application.
[0106] If a subapplication running within an application needs to call the target server's interface, the initiated target interface call request must include a target identity ticket. This allows the proxy server to authenticate based on the target identity ticket, and if authentication is successful, forward the interface call request to the target server. The target object can then call the target server's interface based on the target identity ticket when the subapplication is running within the application. Furthermore, the operations performed when the subapplication is running within the application are the same as those performed when the subapplication is running within a second parent application, i.e., they have the native effect of running the subapplication within a second parent application.
[0107] In some embodiments, the method for executing a subapplication further includes the steps of: obtaining a target identity ticket in response to a login operation triggered within the subapplication running within the application, wherein the target identity ticket is the identity ticket of a target object in a second parent application; generating a parent application interface call request that includes the target identity ticket; and having a proxy server validate the target identity ticket, and if the target identity ticket passes validation, having the proxy server send a parent application interface call request to a target server, wherein the parent application interface call request instructs the target server to log in to the subapplication based on the target account of the target object in the second parent application.
[0108] Here, the target account is the account that the target object has registered with the second parent application; that is, the target object can log in to the second parent application using the target account. The login operation refers to logging in to a sub-application running within the application using the target account.
[0109] A parent application interface call request is for calling the parent application interface, and the parent application interface is an interface belonging to the target server.
[0110] In some embodiments, for subapplications running within an application, a login component is included on the subapplication's top page, which can trigger a login operation. When a login operation is triggered by this login component, it retrieves the target identity ticket of the target object in the second parent application, generates a parent application interface call request, sends the parent application interface call request containing the target identity ticket to a proxy server, and the proxy server verifies the target identity ticket. If the verification is successful, it indicates that the identity of the target object corresponding to the target identity ticket is valid. Furthermore, the proxy server sends a parent application interface call request to the target server, which, in response to the parent application interface call request, retrieves the target account of the target object in the second parent application and logs into the subapplication within the application based on the target account of the target object.
[0111] Furthermore, the target server logging into a sub-application within the application based on the target account of the target object may also be done by the target server setting the login status of the target object in the sub-application (running within the application) to logged in and sending the post-login page data to the terminal. As a result, the terminal displays the post-login page of the sub-application within the application based on the post-login page data.
[0112] For example, the first parent application is a browser, the second parent application is an instant messaging application, and the sub-application is a miniprogram. If, during the process of running the miniprogram in the browser, it is necessary to log in to the miniprogram in the browser using the target account of the target object in the instant messaging application, the target identity ticket of the target object in the instant messaging application is obtained, the target identity ticket is authenticated by a proxy server, and if authentication is successful, the proxy server sends a parent application interface call request to the target server, and the target server logs in to the miniprogram running in the browser using the target account of the target object in the instant messaging application.
[0113] In the above embodiment, when a sub-application running within the application needs to call the parent application interface of the target server, a parent application interface call request containing a target identity ticket is generated, the target identity ticket is authenticated by the proxy server, and if authentication is successful, the parent application interface call request is sent to the target server, ensuring the data security of the target server. Furthermore, the sub-application running within the application can call the target server's interface. As a result, all the functions used when running a sub-application within a second parent application can be used when running a sub-application within the application. Moreover, this process does not require the participation of the second parent application, reducing the complexity of the operation of running a sub-application and improving the efficiency of running a sub-application.
[0114] In some embodiments, the step of obtaining a target identity ticket includes the step of obtaining a service identity ticket for the target object in the service page, and the step of obtaining a target identity ticket for the target object in the second parent application by the virtual server based on the service identity ticket.
[0115] Here, the virtual server is further used to manage tickets, and the service identity ticket can be used to reflect the identity information of the target object in the service page. In a real application, the identity information of the target object in the service page may differ from the identity information of the target object in the second parent application.
[0116] In some embodiments, the terminal obtains a service identity ticket for the target object on the service page from the service server of the service page, sends the service identity ticket to the virtual server, and the virtual server determines the target identity ticket for the target object in the second parent application based on the service identity ticket. This enables the acquisition of a target identity ticket in exchange for a service identity ticket.
[0117] In some embodiments, the terminal obtaining a service identity ticket for a target object on a service page from the service server of the service page may occur if the terminal obtains a ticket acquisition request from a proxy server via the frontend of the service page, the proxy server forwards the ticket acquisition request to the service server of the service page, the service server returns the service identity ticket for the target object on the service page based on the ticket acquisition request, and the terminal thereby obtains the service identity ticket on the service page.
[0118] In some embodiments, the terminal may obtain a service identity ticket in advance and exchange it for a target identity ticket. For example, the terminal may obtain a service identity ticket for the target object on the service page at the same time as initiating a sub-application execution request and exchange it for a target identity ticket, or it may obtain a service identity ticket for the target object on the service page after launching a sub-application within the application and exchange it for a target identity ticket.
[0119] In some embodiments, the service identity tickets of a target object differ across different service pages, while the target identity ticket obtained in exchange for these different service identity tickets is the same. This allows the target object to invoke the target server interface using the same target identity ticket when executing its subapplication within different service pages.
[0120] In some embodiments, the execution method of a subapplication further includes the step of obtaining an expiration ticket corresponding to a target identity ticket. The step of generating a parent application interface call request that includes the target identity ticket includes the step of generating a parent application interface call request that includes the target identity ticket if it is determined, based on the expiration ticket, that the target identity ticket is valid.
[0121] In some embodiments, the execution method of a subapplication further includes the steps of: obtaining an updated target identity ticket based on the validity ticket if it is determined that the target identity ticket is valid or invalid based on the validity ticket; and generating a parent application interface call request that includes the updated target identity ticket.
[0122] In some embodiments, a virtual server may obtain a target identity ticket for a target object in a second parent application, and simultaneously obtain an expiration ticket corresponding to the target identity ticket. The expiration ticket contains the expiration time corresponding to the target identity ticket. Before generating a parent application interface call request that includes the target identity ticket, the terminal may first determine, based on the expiration ticket, whether the target identity ticket is valid or not. If the time between the current time and the time the target identity ticket was obtained is less than or equal to the expiration time, the terminal determines that the target identity ticket is valid and then generates a parent application interface call request that includes the target identity ticket. If the time between the current time and the time the target identity ticket was obtained is greater than the expiration time, the terminal determines that the target identity ticket has expired, and then sends the expiration ticket to the virtual server, which obtains an updated target identity ticket, and the terminal can then generate a parent application interface call request that includes the updated target identity ticket.
[0123] Exemplary, as shown in Figure 9, the terminal obtains a service identity ticket for the target object on the service page, and the frontend of the service page initiates a ticket acquisition request. The backend of the service page obtains a service identity ticket based on the ticket acquisition request and sends the service identity ticket to the virtual server. Based on the service identity ticket, the virtual server returns the target identity ticket and the corresponding expiration ticket to the application component. In response to a login operation triggered within the sub-application, if the frontend determines that the target identity ticket is valid based on the expiration ticket, it generates a parent application interface call request containing the target identity ticket, sends the parent application interface call request containing the target identity ticket to the proxy server, the proxy server verifies the target identity ticket, and if the verification is successful, the proxy server sends the parent application interface call request to the target server. This enables the target account to log in to the sub-application. If the target identity ticket is determined to be invalid based on the expiration ticket (content within the dotted box 901 in Figure 9), the frontend sends the expiration ticket to the virtual server. The virtual server returns an updated target identity ticket to the application component. By replacing the expired target identity ticket with the updated target identity ticket, the frontend enables login to the sub-application using the target account based on the updated target identity ticket.
[0124] In the above embodiment, the virtual server obtains the target identity ticket of the target object in the second parent application in exchange for the service identity ticket of the target object in the service page, and subsequently calls the target server interface using the target identity ticket.
[0125] In some embodiments, the execution method of a subapplication further includes the steps of: having a proxy server send a service interface call request to a service server in response to a service interface call operation triggered within the subapplication running within the application, the service interface call request instructing the service server to return corresponding service data; and receiving the service data and displaying a service subpage within the subapplication based on the service data.
[0126] Here, a service interface call request is for calling a service interface, and the service interface is an interface belonging to the service server.
[0127] Service data is data obtained from the service interface and is used to display the service subpage of a sub-application. A service subpage may be a second-level page within the sub-application. For example, one can access a service subpage from the sub-application's top page. That is, a service subpage is a second-level page relative to the top page.
[0128] In some embodiments, the top page of a subapplication includes a subservice entry component, and in response to a service interface call operation triggered on the subservice entry component of the subapplication, the class library generates a service interface call request. The class library sends the service interface call request to a proxy server, the proxy server forwards this service interface call request to a service server, the service server responds to the service interface call request by retrieving the corresponding service data and sending the service data to the proxy server, the proxy server returns the service data to the class library, and the class library displays a service subpage based on the service data.
[0129] In some embodiments, the top page of a sub-application contains multiple sub-service entry components, each of which can access a different service subpage, and each different service subpage requires different service data to display. The service interface call request includes a page identifier for the service subpage, and the service server retrieves the corresponding service data based on the page identifier. Based on this service data, the class library can then display the service subpage corresponding to the page identifier.
[0130] In some embodiments, a page identifier is associated with a subservice entry component. When the subservice entry component is triggered, the class library retrieves the page identifier associated with this subservice entry component. Based on this page identifier, the class library generates a service interface call request. The proxy server forwards the service interface call request to the service server, which retrieves the page identifier included in the service interface call request and obtains the corresponding service data based on the page identifier.
[0131] In the above embodiment, when a sub-application running within the application needs to retrieve service data, the proxy server forwards the service interface call request to the service server because the application and the service server belong to different autonomous systems. The proxy server retrieves the service data and displays the service subpage based on the service data. The proxy server eliminates the constraint of applications that cannot make interface calls between systems, allowing sub-applications running within the application to call the service server's interface, and furthermore, all functions in the sub-application that require the involvement of the service server can be used normally.
[0132] In some embodiments, the method for executing a sub-application can be applied to scenarios where a mini-program is executed within a browser. As shown in Figure 10, in the process of executing a service by the browser's service page 1001, the service needs must be announced by the mini-program corresponding to the service page 1001. The service page 1001 contains a mini-program icon (sub-application icon) 1002. When this mini-program icon 1002 is triggered, it displays a subpage on the service page 1001, initiates a sub-application execution request, and a virtual server retrieves the compiled program package, parses the program package to obtain file data, executes the mini-program within the browser based on the file data, and displays the mini-program's top page 1003 via the service page's subpage.
[0133] The top page 1003 of a sub-application running within the application contains each sub-service entry component. Here, sub-service entry component 1004 is the entry component for the problem details page. In response to a service interface call operation triggered on sub-service entry component 1004, a service interface call request is generated. The service interface call request contains the page identifier of the problem details page. The proxy server sends the service interface call request to the service server. The service server retrieves the service data for the problem details page using the page identifier, sends the service data for the problem details page to the proxy server, and the proxy server returns the service data to the class library. The class library displays the problem details page based on the service data. The problem details page is as shown in Figure 11.
[0134] In the related technology, as shown in Figure 12, the terminal runs a browser, the browser displays a service page 1201, and the service is executed within the service page 1201. If at least one part of the service being executed within the service page 1201 needs to be completed by a miniprogram, the graphic code 1202 of the miniprogram may be displayed on the service page 1201, and this graphic code 1202 may be scanned by a second parent application running on a mobile device (e.g., a mobile phone), which then displays the miniprogram's top page 1203 within the second parent application.
[0135] Clearly, in the embodiments of the present application, the application can directly execute subapplications, significantly reducing the complexity of the operation required to execute subapplications compared to related technologies.
[0136] In some embodiments, as shown in Figure 13, the method for executing the sub-application is as follows:
[0137] Step 1301, in response to a trigger operation on the subapplication icon, if the service page displayed by the application includes a subapplication icon, the application component of the application initiates a class library interface call request, the class library interface call request instructs the class library to initiate a subapplication execution request to the virtual server, the application is the first parent application of the subapplication, and the subapplication execution request includes the identity number of the subapplication.
[0138] Step 1302: When a sub-application execution request is received by the virtual server, the virtual server generates an address lookup request corresponding to the identity number, sends the address lookup request to the proxy server instructing the proxy server to obtain the program package download address corresponding to the sub-application icon, and obtains the program package download address corresponding to the sub-application icon returned by the proxy server.
[0139] Step 1303 involves downloading a compiled program package corresponding to a sub-application icon from a target server based on the program package download address, obtaining file data by parsing the program package, and storing the file data in a buffer area of a virtual server, wherein the target server is for executing the second parent application of the sub-application, and the first parent application and the second parent application are different applications.
[0140] Step 1304 involves creating an inline frame instance and using the inline frame instance to initiate a resource request that includes a virtual resource locator, wherein the location of the external resource pointed to by the inline frame instance is the virtual resource locator.
[0141] Step 1305: When a resource request is obtained by the virtual server, the virtual server obtains the sub-application entry file corresponding to the virtual resource locator, and the inline frame instance initiates a file retrieval request based on the file path contained in the sub-application entry file.
[0142] Step 1306A, based on the file acquisition request, acquires the response data required for the sub-application entry file based on the file data in the buffer area.
[0143] If the response data required for the sub-application entry file is not obtained from the buffer area, the virtual server downloads an additional program package from the target server, parses the additional program package to obtain additional file data, saves the additional file data to the buffer area, and obtains the response data required for the sub-application entry file based on the additional file data in the buffer area (step 1306B).
[0144] Step 1307, within the application, executes the sub-application of the sub-application icon based on the sub-application entry file and response data.
[0145] Step 1308A, in response to a target interface call operation triggered within a sub-application running within the application, retrieves a service identity ticket for the target object in the service page, retrieves a target identity ticket for the target object in the second parent application by the virtual server based on the service identity ticket, retrieves an expiration ticket corresponding to the target identity ticket, and if it is determined that the target identity ticket is valid based on the expiration ticket, generates a target interface call request containing the target identity ticket, verifies the target identity ticket by the proxy server, and if the target identity ticket passes verification, forwards the target interface call request to the target server.
[0146] Step 1308B, in response to a login operation triggered within a sub-application running within the application, obtains a service identity ticket for the target object on the service page, obtains a target identity ticket for the target object in the second parent application based on the service identity ticket by the virtual server, obtains an expiration ticket corresponding to the target identity ticket, and if it is determined that the target identity ticket is valid based on the expiration ticket, generates a parent application interface call request containing the target identity ticket, validates the target identity ticket by the proxy server, and if the target identity ticket passes validation, sends the parent application interface call request to the target server, wherein the parent application interface call request instructs the target server to log in to the sub-application based on the target account of the target object in the second parent application,
[0147] Step 1309 includes, in response to a service interface call operation triggered within a sub-application running within the application, sending a service interface call request by a proxy server to a service server, receiving service data, and displaying a service subpage within the sub-application based on the service data, wherein the service interface call request is for instructing the service server to return the corresponding service data.
[0148] In the above method of executing sub-applications, a sub-application icon is displayed on the application's service page. In response to a trigger operation on the sub-application icon, a sub-application execution request is initiated. When the sub-application execution request is received by the virtual server, the virtual server retrieves the compiled program package corresponding to the sub-application icon, parses the program package to obtain file data, and executes the sub-application within the application using the file data. In other words, by triggering the sub-application icon on the application's service page, the sub-application can be executed directly within the application. Compared to related technologies where a mobile device scans the graphic code of the sub-application displayed within the application and executes the sub-application on the mobile device, directly executing the sub-application within the application significantly reduces the complexity of the operation to execute the sub-application and improves the efficiency of sub-application execution. Furthermore, since what is obtained by the virtual server is a compiled program package, the program package can be directly parsed, and the sub-application can be executed using the parsed file data, eliminating the need to perform the compilation process. This increases the efficiency of executing sub-applications within the application and makes the process of triggering sub-applications by the application smoother.
[0149] It should be understood that, although the steps in the flowcharts for each embodiment described above are shown sequentially according to the arrows, these steps are not necessarily performed sequentially in the order indicated by the arrows. Unless explicitly stated otherwise in this specification, there are no strict restrictions on the order in which these steps are performed. These steps may be performed in other orders. Furthermore, at least some of the steps in the flowcharts for each embodiment described above may include multiple steps or stages. These steps or stages do not necessarily have to be completed at the same time, but may be performed at different times. The order in which these steps or stages are performed also does not necessarily have to be sequential, but may be performed alternately with or in exchange for other steps, or at least some of the steps or stages in other steps.
[0150] Based on a similar inventive concept, embodiments of the present application further provide a sub-application execution device for realizing the method of executing the sub-application described above. Since the implementation configuration for solving the problem provided by this device is similar to the implementation configuration described in the method described above, specific limitations in the embodiments of one or more sub-application execution devices provided below should be referred to the limitations of the method of executing the sub-application described above. Further explanation is omitted here.
[0151] In one embodiment, as shown in Figure 14, a sub-application execution device is provided that includes a display module 1401, a trigger module 1401, a file data acquisition module 1402, and a sub-application execution module 1403.
[0152] The trigger module 1401, if the service page displayed by the application includes a sub-application icon, initiates a sub-application execution request in response to a trigger operation on the sub-application icon.
[0153] When a sub-application execution request is received by the virtual server, the file data acquisition module 1402 obtains the compiled program package corresponding to the sub-application icon from the virtual server and parses the program package to acquire the file data.
[0154] The sub-application execution module 1403 executes a sub-application of a sub-application icon within the application based on file data.
[0155] In some embodiments, the trigger module 1401 further initiates a class library interface call request by the application's application component in response to a trigger operation on the sub-application icon, and the class library interface call request instructs the class library to initiate a sub-application execution request to the virtual server.
[0156] In some embodiments, the application is the first parent application of the subapplication. The file data acquisition module 1402 includes a program package download unit. The program package download unit retrieves the compiled program package corresponding to the subapplication icon from the target server via a virtual server. Here, the target server is for running the second parent application of the subapplication, and the first and second parent applications are different applications.
[0157] In some embodiments, the program package download unit further obtains the program package download address corresponding to the sub-application icon from the proxy server via a virtual server, and downloads the compiled program package corresponding to the sub-application icon from the target server based on the program package download address.
[0158] In some embodiments, the subapplication execution request includes the subapplication's identity number. The program package download unit further generates an address lookup request corresponding to the identity number via a virtual server, sends the address lookup request to a proxy server instructing the proxy server to obtain the program package download address corresponding to the subapplication icon, and obtains the program package download address corresponding to the subapplication icon returned by the proxy server.
[0159] In some embodiments, the sub-application execution module 1403 is A resource request sending unit that initiates a resource request that includes a virtual resource locator,
[0160] When a resource request is obtained by the virtual server, the virtual server retrieves a sub-application entry file that corresponds to the virtual resource locator, and A response data acquisition unit that obtains the response data required for the sub-application entry file from the file data,
[0161] The application includes an execution unit that executes a sub-application of a sub-application icon based on a sub-application entry file and response data.
[0162] In some embodiments, the resource request transmission unit further creates an inline frame instance and uses the inline frame instance to send a resource request that includes a virtual resource locator, where the location of the external resource pointed to by the inline frame instance is the virtual resource locator. The response data acquisition unit further uses the inline frame instance to initiate a file acquisition request based on the file path contained in the sub-application entry file, and uses the file acquisition request to acquire the response data required for the sub-application entry file from the file data.
[0163] In some embodiments, the file data acquisition module 1402 further stores the file data in the buffer area of the virtual server, and the response data acquisition unit further acquires the response data required for the sub-application entry file based on the file data in the buffer area.
[0164] In some embodiments, if the response data acquisition unit has not acquired the necessary response data for the sub-application entry file from the buffer area, the virtual server will download the necessary response data for the sub-application entry file from the target server.
[0165] In some embodiments, the response data acquisition unit further downloads additional program packages from the target server via a virtual server, parses the additional program packages to acquire additional file data, stores the additional file data in a buffer area, and acquires the response data required for the sub-application entry file based on the additional file data in the buffer area.
[0166] In some embodiments, the execution device of a subapplication further includes an interface call module that, in response to a target interface call operation triggered within the subapplication running within the application, obtains a target identity ticket, generates a target interface call request containing the target identity ticket, has the target identity ticket validated by a proxy server, and, if the target identity ticket passes validation, forwards the target interface call request to the target server, wherein the target identity ticket is the identity ticket of the target object in the second parent application.
[0167] In some embodiments, the execution device of a subapplication further includes a login module that, in response to a login operation triggered within the subapplication running within the application, obtains a target identity ticket, generates a parent application interface call request containing the target identity ticket, has the target identity ticket validated by a proxy server, and if the target identity ticket passes validation, has the proxy server send the parent application interface call request to the target server, wherein the target identity ticket is the identity ticket of the target object in the second parent application, and the parent application interface call request instructs the target server to log in to the subapplication based on the target account of the target object in the second parent application.
[0168] In some embodiments, the login module further obtains a service identity ticket for the target object on the service page, and based on the service identity ticket, the virtual server obtains a target identity ticket for the target object in the second parent application.
[0169] In some embodiments, the execution device of the sub-application further includes a ticket validity verification module that obtains an expiration ticket corresponding to the target identity ticket. The step of generating a parent application interface call request that includes the target identity ticket includes the step of generating a parent application interface call request that includes the target identity ticket if it is determined, based on the expiration ticket, that the target identity ticket is valid.
[0170] In some embodiments, the execution device of a subapplication further includes a service subpage display module 1401 that, in response to a service interface call operation triggered within the subapplication running within the application, sends a service interface call request to a service server via a proxy server, receives service data, and displays a service subpage within the subapplication based on the service data, wherein the service interface call request is intended to instruct the service server to return the corresponding service data.
[0171] Each module of the execution device for the above sub-applications may be implemented in whole or in part by software, hardware, or a combination thereof. Each of the above modules may be embedded in the processor of the computer device in hardware form or independently, or stored in the memory of the computer device in software form. This facilitates the processor to call and execute the operations corresponding to each of the above modules.
[0172] In one embodiment, a computer device is provided. This computer device may be a terminal, and its internal configuration may be as shown in Figure 15. The computer device includes a processor, memory, an input / output interface, a communication interface, a display unit, and an input device. Here, the processor, memory, and input / output interface are connected via a system bus, and the communication interface, display unit, and input device are connected to the system bus via the input / output interface. Here, the processor of the computer device provides computation and control functions. The memory of the computer device includes a non-volatile storage medium, internal memory. The non-volatile storage medium stores an operating system and computer programs. The internal memory provides an environment for the execution of the operating system and computer programs on the non-volatile storage medium. The input / output interface of the computer device is for exchanging information between the processor and external devices. The communication interface of the computer device is for wired or wireless communication with an external terminal, and the wireless method may be implemented by Wi-Fi, a mobile cellular network, near-field communication (NFC), or other technology. When the computer program is executed by the processor, it implements a method for executing sub-applications. The display unit of the computer equipment is for forming a visually visible screen and may be a display screen, a projection device, or a virtual reality imaging device. The display screen may be a liquid crystal display screen or an E-ink display screen. The input device of the computer equipment may be a touch layer superimposed on the display screen, a button, trackball, or touchpad provided on the housing of the computer equipment, or an external keyboard, touchpad, or mouse.
[0173] As those skilled in the art will understand, the configuration shown in Figure 15 is merely a block diagram of some of the configurations relating to the present invention and does not limit the computer equipment to which the present invention applies. Specific computer equipment may include more or fewer components than those shown, or may be a combination of some components, or may have different arrangements of components.
[0174] In one embodiment, a computer device is provided comprising memory and one or more processors, wherein the memory stores computer-readable instructions, and when these instructions are executed by the processors, they cause one or more processors to implement the method for executing the above-described sub-application.
[0175] In one embodiment, one or more non-volatile readable storage media storing computer-readable instructions are provided, and when the computer-readable instructions are executed by the processor, one or more processors are made to implement the execution method of the above-mentioned sub-application.
[0176] In one embodiment, a computer program product is provided that includes computer-readable instructions. When these computer-readable instructions are executed by a processor, they enable the execution of the above-described sub-application.
[0177] Furthermore, user information (including, but not limited to, user equipment information and user personal information) and data (including, but not limited to, analytical data, storage data, and display data) relating to this application are all information and data authorized by the user or fully authorized by each party, and the collection, use, and processing of the relevant data must comply with the relevant laws, regulations, and standards of the relevant countries and regions.
[0178] As those skilled in the art will understand, all or part of the method flow according to the above embodiments may be executed by instructing the relevant hardware via a computer program. The computer program may be stored in a non-volatile computer-readable storage medium. When this computer program is executed, the flow of each embodiment of the method described above is executed. Here, any reference to memory, database, or other medium used in each embodiment provided herein may include at least one of non-volatile and volatile memory. Non-volatile memory may include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory may include random access memory (RAM) or external cache, etc. For illustrative purposes only, rather than being limited, RAM may take many forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The databases relating to each embodiment provided herein may include at least one of relational databases and non-relational databases. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors relating to each embodiment provided herein may include, but are not limited to, general-purpose processors, central processing units, graphics processors, digital signal processors, programmable logic units, quantum computing-based data processing logic units, and the like.
[0179] The constituent elements of the embodiments described above may be combined in any way. For the sake of brevity, not all possible combinations of the constituent elements of the embodiments described above are described. However, these combinations of constituent elements should be considered to fall within the scope described herein, as long as they do not contradict each other.
[0180] The embodiments described above are merely examples of some embodiments of the present application, and although the descriptions are specific and detailed, they should not be understood as limiting the scope of the patent. It should be noted that, for those skilled in the art, some modifications and improvements are possible without departing from the concept of the present application. All of these modifications and improvements fall within the scope of protection of the present application. Therefore, the scope of protection of the present application should be in accordance with the appended claims.
Claims
1. A method for executing a sub-application on a terminal, If the service page displayed by the application includes a sub-application icon, the step of initiating a sub-application execution request in response to a trigger operation on the sub-application icon, When the sub-application execution request is received by the virtual server, the virtual server obtains the compiled program package corresponding to the sub-application icon, and obtains file data by analyzing the program package. The application includes the step of executing the sub-application of the sub-application icon based on the file data, How to run a sub-application.
2. The step of initiating a sub-application execution request in response to a trigger operation on the sub-application icon is: The step of initiating a class library interface call request by the application component of the application in response to a trigger operation on the sub-application icon, wherein the class library interface call request instructs the class library to initiate a sub-application execution request to the virtual server, A method for executing the sub-application described in claim 1.
3. The application is the first parent application of the subapplication, and the step of obtaining the compiled program package corresponding to the subapplication icon by the virtual server is: The virtual server includes the step of downloading a compiled program package corresponding to the sub-application icon from the target server, The target server is for executing the second parent application of the sub-application, and the first parent application and the second parent application are different applications. A method for executing the sub-application according to claim 1 or 2.
4. The step of downloading the compiled program package corresponding to the sub-application icon from the target server using the virtual server is as follows: The virtual server obtains the program package download address corresponding to the sub-application icon from the proxy server, The process includes the step of downloading a compiled program package corresponding to the sub-application icon from a target server based on the program package download address. A method for executing the sub-application described in claim 3.
5. The sub-application execution request includes the identity number of the sub-application, and the step of the virtual server obtaining the program package download address corresponding to the sub-application icon from the proxy server is as follows: The steps include: generating an address lookup request corresponding to the identity number using the virtual server; The steps include sending the address lookup request to the proxy server and instructing the proxy server to obtain the program package download address corresponding to the sub-application icon, The steps include obtaining the program package download address corresponding to the sub-application icon, which is returned from the proxy server, A method for executing the sub-application described in claim 4.
6. The step of executing the sub-application of the sub-application icon based on the file data within the aforementioned application is: Steps include initiating a resource request that includes a virtual resource locator, When the resource request is obtained by the virtual server, the virtual server obtains a sub-application entry file corresponding to the virtual resource locator. The steps include obtaining the response data required for the sub-application entry file from the aforementioned file data, The application includes the step of executing the sub-application of the sub-application icon based on the sub-application entry file and the response data, A method for executing a sub-application according to any one of claims 1 to 5.
7. The step of initiating a resource request that includes a virtual resource locator is: A step of creating an inline frame instance, wherein the location of the external resource pointed to by the inline frame instance is a virtual resource locator. The inline frame instance includes the step of initiating a resource request that includes the virtual resource locator, A method for executing the sub-application described in claim 6.
8. The step of obtaining the response data required for the sub-application entry file from the aforementioned file data is: The inline frame instance initiates a file retrieval request based on the file path contained in the sub-application entry file, The file acquisition request includes the step of obtaining the response data required for the sub-application entry file from the file data, A method for executing the sub-application described in claim 7.
9. By analyzing the aforementioned program package, after the step of obtaining file data, The step further includes storing the aforementioned file data in the buffer area of the virtual server, The step of obtaining the response data required for the sub-application entry file from the aforementioned file data is: The step includes obtaining the response data required for the sub-application entry file based on the file data in the buffer area, A method for executing the sub-application described in claim 6.
10. If the response data required for the sub-application entry file is not obtained from the buffer area, the virtual server further includes the step of downloading the response data required for the sub-application entry file from the target server. A method for executing the sub-application described in claim 9.
11. The step of downloading the response data required for the sub-application entry file from the target server using the virtual server is as follows: The virtual server downloads an additional program package from the target server and obtains additional file data by analyzing the additional program package. The steps include saving the additional file data to the buffer area, The step of obtaining the response data required for the sub-application entry file based on the additional file data in the buffer area, A method for executing the sub-application according to claim 10.
12. A step of obtaining a target identity ticket in response to a target interface call operation triggered within the sub-application running within the aforementioned application, wherein the target identity ticket is the identity ticket of the target object in the second parent application. The steps include generating a target interface call request that includes the aforementioned target identity ticket, The process further includes the steps of verifying the target identity ticket with a proxy server, and if the target identity ticket passes verification, forwarding the target interface call request to the target server, A method for executing a sub-application according to any one of claims 1 to 10.
13. A step of obtaining a target identity ticket in response to a login operation triggered within a sub-application running within the aforementioned application, wherein the target identity ticket is the identity ticket of a target object in a second parent application. The steps include generating a parent application interface call request that includes the target identity ticket, The process further includes the steps of: verifying the target identity ticket by a proxy server, and if the target identity ticket passes verification, having the proxy server send the parent application interface call request to the target server, the parent application interface call request instructing the target server to log in to the subapplication based on the target account of the target object in the second parent application; A method for executing a sub-application according to any one of claims 1 to 10.
14. The aforementioned step of obtaining a target identity ticket is The steps include obtaining the service identity ticket for the target object on the aforementioned service page, The steps include: obtaining the target identity ticket of the target object in the second parent application by the virtual server based on the service identity ticket; A method for executing the sub-application according to claim 12 or 13.
15. After the step of obtaining the target identity ticket, The process further includes the step of obtaining an expiration ticket corresponding to the aforementioned target identity ticket, The step of generating a parent application interface call request that includes the target identity ticket is: If it is determined that the target identity ticket is valid based on the validity period ticket, the step includes generating a parent application interface call request that includes the target identity ticket. A method for executing the sub-application according to claim 13.
16. The steps include: sending a service interface call request to a service server by a proxy server in response to a service interface call operation triggered within the sub-application running within the application, wherein the service interface call request instructs the service server to return service data; The further step includes receiving the service data and displaying a service subpage within the sub-application based on the service data. A method for executing a sub-application according to any one of claims 1 to 15.
17. A sub-application execution device, If the service page displayed by the application includes a sub-application icon, a trigger module initiates a sub-application execution request in response to a trigger operation on the sub-application icon, When the aforementioned sub-application execution request is received by the virtual server, the virtual server obtains the compiled program package corresponding to the sub-application icon, and a file data acquisition module obtains file data by analyzing the program package. The application includes a sub-application execution module that executes the sub-application of the sub-application icon based on the file data, Execution device for sub-applications.
18. A computer device comprising memory and one or more processors, wherein the memory stores computer-readable instructions, and when the computer-readable instructions are executed by the processors, the computer device causes one or more processors to perform the steps of the method for executing a subapplication described in any one of claims 1 to 16.
19. One or more non-volatile readable storage media storing computer-readable instructions, wherein, when executed by the processor, the computer-readable instructions cause one or more processors to implement the steps of the method for executing a sub-application described in any one of claims 1 to 16.
20. A computer program product comprising computer-readable instructions, wherein, when executed by a processor, the computer-readable instructions realize the steps of the method for executing a subapplication described in any one of claims 1 to 16.