A method, apparatus and device for applet capability use
By setting up a shared path and the mini-program SDK on the system, the problem of high failure rate in downloading mini-program capability packages was solved, enabling efficient use of mini-program capabilities and optimization of system resources.
Patent Information
- Application Number
- CN202511155425.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-10
- Publication Date
- 2025-11-21
AI Technical Summary
In existing technologies, the download failure rate of mini-program capability packages is high, resulting in high system operating pressure, and the installation package is too large, affecting memory and download success rate.
By setting a shared path on the system, the first app downloads and stores the capability package, and the second app loads it directly, avoiding duplicate downloads. Combined with the mini-program SDK, specific content is determined, reducing the data size of the installation package. The capability package is then invoked by authorization from the third app, resulting in lightweight processing.
It improved the download success rate of mini-program capability packages, reduced the system's memory and operating pressure, and enabled the efficient use and widespread application of mini-program capabilities.
Smart Images

Figure CN120994279A_ABST
Abstract
Description
[0001] This application is a divisional application of Chinese Patent Application No. 202210240521.9, filed on March 10, 2022, entitled "A method, apparatus and device for using mini-program capabilities", the entire contents of which are incorporated herein by reference. Technical Field
[0002] This specification relates to the field of Internet technology, and in particular to a method, apparatus, and device for using mini-program capabilities. Background Technology
[0003] To reduce the memory and processing load on terminal devices, many app developers have designed lighter-weight mini-programs. These mini-programs can rely on the various apps already downloaded on the terminal device to realize the various capabilities inherent in mini-programs.
[0004] However, the more capabilities a mini-program has, the larger its corresponding capability package becomes. These large capability packages are all integrated into the app's installation package, requiring the system to download an even larger app installation package during installation, placing significant pressure on system performance and memory. If the mini-program capability package is not integrated into the app's installation package, then every time a mini-program's function is invoked within the app, the capability package needs to be downloaded again. Due to network issues, downloads may be slow or even fail, reducing the success rate of mini-program capability package downloads and rendering the mini-program's capabilities unusable.
[0005] Therefore, a more efficient way to use the capabilities of mini-programs is needed. Summary of the Invention
[0006] This specification provides one or more embodiments of a method, apparatus, device, and storage medium for using mini-program capabilities, in order to solve the following technical problem: the need for a more efficient method for using mini-program capabilities.
[0007] To solve the above-mentioned technical problems, one or more embodiments of this specification are implemented as follows:
[0008] This specification provides one or more embodiments of a method for using a mini-program capability, applied to a system with a first app and a second app installed, including:
[0009] In response to a request from a mini-program within the first app to invoke a preset capability, it is determined that the capability package corresponding to the preset capability has not yet been downloaded on the system.
[0010] The first APP requests the download of the capability package from the designated server and stores the downloaded capability package in the designated shared path in the system;
[0011] The mini-program within the first APP dynamically loads the capability package and executes the call to the preset capabilities;
[0012] When a mini-program within the second app requests to invoke the preset capability, the second app dynamically loads the capability package through the shared path and executes the invocation of the preset capability.
[0013] This specification provides one or more embodiments of a device for using mini-program capabilities, including:
[0014] The module determines that, in response to a request from a mini-program within the first app to invoke a preset capability, the capability package corresponding to the preset capability has not yet been downloaded on the system.
[0015] The download module allows the first APP to request the download of the capability package from a designated server and store the downloaded capability package in a shared path specified in the system.
[0016] The execution module allows the mini-program within the first APP to dynamically load the capability package and invoke the preset capabilities.
[0017] When a mini-program within the second app requests to call the preset capability, the execution module dynamically loads the capability package through the shared path and executes the call to the preset capability.
[0018] This specification provides one or more embodiments of a device for using applet capabilities, including:
[0019] At least one processor; and,
[0020] A memory communicatively connected to the at least one processor; wherein,
[0021] The memory stores instructions that can be executed by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to:
[0022] In response to a request from a mini-program within the first app to invoke a preset capability, it is determined that the capability package corresponding to the preset capability has not yet been downloaded on the system.
[0023] The first APP requests the download of the capability package from the designated server and stores the downloaded capability package in the designated shared path in the system;
[0024] The mini-program within the first APP dynamically loads the capability package and executes the call to the preset capabilities;
[0025] When a mini-program within the second app requests to invoke the preset capability, the second app dynamically loads the capability package through the shared path and executes the invocation of the preset capability.
[0026] This specification provides one or more embodiments of a non-volatile computer storage medium storing computer-executable instructions, wherein the computer-executable instructions are configured as follows:
[0027] In response to a request from a mini-program within the first app to invoke a preset capability, it is determined that the capability package corresponding to the preset capability has not yet been downloaded on the system.
[0028] The first APP requests the download of the capability package from the designated server and stores the downloaded capability package in the designated shared path in the system;
[0029] The mini-program within the first APP dynamically loads the capability package and executes the call to the preset capabilities;
[0030] When a mini-program within the second app requests to invoke the preset capability, the second app dynamically loads the capability package through the shared path and executes the invocation of the preset capability.
[0031] The above-described at least one technical solution adopted in one or more embodiments of this specification can achieve the following beneficial effects: When a mini-program on a first APP calls a preset capability, if it is determined on the system where the first APP is installed that the capability package corresponding to the preset capability has not yet been downloaded, the first APP downloads the capability package from a designated server. This designated server can be the vendor's server corresponding to the mini-program. Thus, the first APP can use the capabilities of mini-programs designed by other vendors, and these mini-program capabilities are widely promoted and applied. Furthermore, the first APP stores the downloaded capability package on a shared path designated by the system, so that when a mini-program on a second APP on the system calls a preset capability, the second APP can directly load the capability package through this shared path, achieving sharing of the mini-program capability package with the first APP without needing to download it again. This avoids the possibility of mini-program capability package download failure, improves the success rate of mini-program capability package download, and thus achieves efficient use of mini-program capabilities. Furthermore, when downloading and installing the first and second apps, the system downloads installation packages that integrate specified content. This specified content is determined by the mini-program SDK and is smaller than the mini-program SDK's data size. This reduces the size of the app installation packages downloaded by the system, lowering system memory and operational pressure, while ensuring that the first and second apps can use mini-programs. Additionally, after the system installs a third app that authorizes the first app, mini-programs on the first app do not need to download capability packages when calling preset capabilities. Instead, they can directly invoke the mini-program within the third app to execute the mini-program's capabilities, further avoiding the possibility of capability package download failures. Simultaneously, if the first app downloads part of the capability package, the system can perform lightweight processing on the first app, reducing its data size. This further reduces system memory and operational pressure while ensuring the normal use of mini-programs. Attached Figure Description
[0032] To more clearly illustrate the technical solutions in the embodiments or prior art of this specification, the drawings used in the description of the embodiments or prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in this specification. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0033] Figure 1 A flowchart illustrating a method for using a mini-program capability provided in one or more embodiments of this specification;
[0034] Figure 2 A schematic diagram illustrating a method for using mini-program capabilities in an application scenario, provided for one or more embodiments of this specification.
[0035] Figure 3 A schematic diagram of a device for using mini-program capabilities provided in one or more embodiments of this specification;
[0036] Figure 4 This is a schematic diagram of the structure of a device for using applet capabilities, provided for one or more embodiments of this specification. Detailed Implementation
[0037] This specification provides an embodiment of a method, apparatus, device, and storage medium for using mini-program capabilities.
[0038] To enable those skilled in the art to better understand the technical solutions in this specification, the technical solutions in the embodiments of this specification will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this specification, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of this application.
[0039] Figure 1 This diagram illustrates a method for using a mini-program capability, provided in one or more embodiments of this specification. This method can be applied to various business domains, such as internet finance, e-commerce, instant messaging, gaming, and government services. The process can be executed by computing devices relevant to the domain (e.g., intelligent customer service servers or intelligent mobile terminals for payment services). Certain input parameters or intermediate results within the process can be manually adjusted to improve accuracy.
[0040] Figure 1 The process may include the following steps:
[0041] S102: In response to the request from the mini-program within the first APP to call the preset capability, it is determined that the capability package corresponding to the preset capability has not yet been downloaded on the system.
[0042] The methods for using mini-program capabilities provided in the embodiments of this specification are mainly applied to mobile terminal operating systems, such as iOS and Android systems, and a first APP and a second APP are installed on the system.
[0043] Furthermore, in the embodiments of this specification, the mini-program is hosted on the first APP, allowing users to use the capabilities of the mini-program within the first APP. For example, if a short video app A is installed on an Android phone, and a map navigation mini-program is hosted within short video app A, then the user can directly use the navigation function of the map navigation mini-program within short video app A.
[0044] Specifically, the mini-program within the first app has several functions. When a user needs to use a particular function, the mini-program is triggered to call a preset capability. This trigger can be a user clicking a function button. For example, an Android phone user clicks on a map navigation mini-program, enters the map navigation mini-program's homepage, and then clicks the navigation function button, thus triggering the map navigation mini-program to call its navigation capability. In response to the mini-program calling a preset capability, the system first determines whether the corresponding capability package has been downloaded in the system. It should be noted that each capability that a mini-program can implement requires a separate capability package for support; that is, each function of a mini-program has a corresponding capability package. Only when the capability package exists in the system can the mini-program installed in the first app on the system implement the preset function.
[0045] Furthermore, in the embodiments of this specification, it is determined that the capability package corresponding to the preset capability has not yet been downloaded on the system. This can be achieved mainly through the following two methods: Method 1: Access the specified shared path on the system and check whether the capability package corresponding to the preset capability exists in the shared path. Method 2: Access the server and query the download records of the capability package corresponding to the preset capability.
[0046] In the implementation of Method 2, the first APP accesses the server corresponding to the first APP, and the server corresponding to the first APP interacts with the server corresponding to the mini program manufacturer to obtain the download record of the capability package corresponding to the preset function of the mini program, and then informs the first APP of the download record.
[0047] S104: The first APP requests the download of the capability package from the designated server and stores the downloaded capability package on the designated shared path in the system.
[0048] After determining that the capability package corresponding to the preset function does not exist on the system, the first app requests to download the aforementioned capability package from a designated server. This designated server can be the server corresponding to the mini-program manufacturer, which stores the capability packages corresponding to all functions of the mini-program. Upon receiving the download request from the first app, the designated server checks whether the first app is qualified to download the capability package. For example, it checks whether the first app has obtained authorization from the mini-program manufacturer, or whether the first app contains the mini-program framework. If so, the server allows the download of the capability package corresponding to the preset function to the first app.
[0049] Furthermore, after downloading the capability package corresponding to the preset function, the first app stores the capability package on a shared path specified by the system. This shared path can be accessed not only by the first app but also by other apps on the system that have the aforementioned mini-program.
[0050] S106: The mini-program within the first APP dynamically loads the capability package and executes the call to the preset capability.
[0051] After the first app downloads the capability package corresponding to the preset function, the capability package will exist on the system. At this time, the mini program in the first app can load the above capability package through dynamic loading, thereby realizing the call of the preset function.
[0052] In the embodiments of this specification, the dynamic loading method refers to the fact that all capability packages corresponding to all functions within a mini-program are not downloaded to the system all at once. Instead, based on the called capability, the capability package corresponding to that capability is selected for download. That is, whatever capability the mini-program in the first app calls, the first app requests the corresponding capability package from the designated server to download, thereby avoiding the technical problem of the first app's installation package being too large. For example, a map navigation mini-program on short video software A has ride-hailing and navigation functions. When a user installs short video software A, only the overall framework of the map navigation mini-program is installed, not the ride-hailing and navigation capability packages. When the user uses the ride-hailing function of the map navigation mini-program, only the ride-hailing capability package is downloaded, and the navigation capability package is not downloaded.
[0053] S108: When a mini-program within the second APP requests to call the preset capability, the second APP dynamically loads the capability package through the shared path and executes the call to the preset capability.
[0054] If a second app on the system also has a mini-program installed, when the mini-program in the second app calls a preset function, the second app can directly access the system's shared path to load the capability package corresponding to the preset function that the first app has already downloaded, without having to download the capability package again. It can directly execute the call to the preset function of the mini-program.
[0055] based on Figure 1 In addition to the method described herein, this specification also provides some specific implementation schemes and extension schemes of this method, which will be further explained below.
[0056] In one or more embodiments of this specification, before using the mini-program capabilities of the first APP, the first APP is first installed on the system. Downloading the installation package of the first APP, which integrates all mini-program capabilities, not only puts significant download pressure on the system but also cannot guarantee a successful download rate. To avoid these problems and reduce system memory and operational pressure, in these embodiments, specified content determined by the Mini-Program Software Development Kit (SDK) is integrated into the installation package of the first APP. The system downloads and executes this integrated installation package to complete the installation of the first APP with the mini-program. It should be noted that the Mini-Program SDK provides the mini-program with various capabilities, including the aforementioned preset capabilities.
[0057] Furthermore, in the embodiments of this specification, the designated server is the server corresponding to the third APP. The third APP and the mini-program belong to the same manufacturer, and the third APP is the original APP on which the mini-program is hosted. The designated server can provide the aforementioned mini-program SDK, and the data volume of the designated content determined by the mini-program SDK is less than the original data volume of the mini-program SDK, thereby solving the technical problem of excessively large installation packages when the system installs the first APP. In the embodiments of this specification, the aforementioned designated content can be the overall framework of the mini-program, without including any capability packages. The overall framework is used to indicate all the capabilities that the mini-program has, so that users know the functions that the mini-program has. It can also be the integrated content that includes at least some capability packages and the mini-program framework. The at least some capability packages included here can be the capability package corresponding to a certain most commonly used capability of the mini-program, such as the map capability package corresponding to the map function in a map navigation mini-program.
[0058] Furthermore, after the system completes the installation of the first APP, based on the specified content integrated on the first APP installation package, users can see the mini-program within the first APP and interact with it. By clicking the mini-program icon, users can enter the mini-program interface, see all the capabilities of the mini-program, and click the function buttons corresponding to the mini-program capabilities. If a user clicks a function button corresponding to a certain mini-program capability, it will trigger the mini-program to call that function.
[0059] In one or more embodiments of this specification, for the second APP and the first APP to share the mini-program capability package, the mini-programs in the first APP and the mini-programs in the second APP must be the same mini-programs. Similarly, before the second APP calls the preset functions of the mini-program, the system also needs to install the second APP. To avoid the system downloading an excessively large installation package of the second APP, the system will first obtain the installation package of the second APP that integrates the specified content. It should be noted that since the mini-programs in the second APP and the mini-programs in the first APP are the same mini-programs, the specified content integrated on the installation package of the second APP is the same as or similar to the specified content integrated on the installation package of the first APP, and both include at least the content of the overall framework of the mini-program. The embodiments in this specification will not be elaborated here.
[0060] Furthermore, the system executes the installation package of the second app, which integrates the specified content, and completes the installation of the second app. Within the second app, the mini-program is also visible and interactive to the user.
[0061] By integrating specific content related to mini-programs into the installation packages of the first and second apps, the data size of the installation packages of the first and second apps is reduced while ensuring that users can call mini-program functions within the first and second apps. This solves the technical problem of excessively large installation packages encountered by the system when installing the first and second apps.
[0062] In one or more embodiments of this specification, multiple versions of the mini-program capability package may exist during design and development. If the mini-program capability package existing on the system's shared path is not a version-compatible capability package, then the mini-program within the first app or the mini-program within the second app will be unable to use the existing capability package when calling the preset function. Therefore, in order to ensure that all apps with mini-programs can use the mini-program capability package existing on the shared path, the mini-program capability package existing on the shared path must be a version-compatible capability package. Therefore, if the first app determines that the capability package corresponding to the preset function has not been downloaded by accessing the shared path, then the first app has determined that the compatible version of the capability package has not been downloaded.
[0063] Furthermore, since the first app is the first app on the system to use the preset function of the mini-program, the mini-program capability package is not available on the system at this time, so there is no issue of checking the compatibility of the mini-program capability package version. When the mini-program on the second app uses the preset function again, the mini-program capability package downloaded by the first app already exists on the system's shared path. At this time, the second app needs to check whether the version of the downloaded capability package is compatible, that is, whether the capability package downloaded on the system's shared path can be used. Therefore, if the mini-program in the second app needs to call the preset function, the second app, as not the first app to call the preset function, will first determine whether the capability package corresponding to the preset function has been downloaded through the shared path. If so, it will continue to check whether the version of the capability package downloaded on the shared path is compatible, that is, whether the second app can use the capability package downloaded by the first app. If the versions are compatible, the capability package is dynamically loaded and the preset function of the mini-program is called. If the versions are incompatible, a compatible capability package is downloaded from the specified server.
[0064] In one or more embodiments of this specification, after the second APP requests the download of the mini-program capability package corresponding to the preset function from the designated server, the downloaded mini-program capability package is stored on the system's shared path so that the downloaded capability package can be used by other APPs with mini-programs on the system.
[0065] Furthermore, if two or more mini-program capability packages corresponding to a preset function exist on the system's shared path, the mini-program in the app will encounter an error when calling the preset function, resulting in the preset function failing to be called. To avoid this problem, after the second app stores the version-compatible mini-program capability package to the shared path, the system will delete the other mini-program capability packages corresponding to that preset function, retaining only the most recently stored version-compatible mini-program capability package. This not only achieves the sharing of mini-program capability packages but also ensures a high success rate for mini-program capability package sharing.
[0066] In one or more embodiments of this specification, the third app serves as the original hosting app for the mini-program. The installation package of the third app integrates the mini-program SDK, meaning it contains the capability packages corresponding to all the mini-program's functions. If the third app is also installed on the system, then all the mini-program's capability packages will exist on the system. Therefore, when the mini-program within the first or second app calls a preset function, it does not need to download the capability packages again; it can directly achieve the function through the third app.
[0067] Specifically, when a mini-program on the first app calls a preset function, it determines that the corresponding capability package for that function has not yet been downloaded. This is done by two methods: first, by accessing a shared path to confirm the capability package's absence; and second, by accessing other system paths to check if the mini-program capability package exists. If a third app is installed on the system, the first app will find the corresponding mini-program capability package already present on other system paths. In this case, for the first app to use the capability package in the current path, it needs to determine its own authorization. Specifically, the first app needs to verify if it has obtained authorization from the third app. If so, the first app can then use the mini-program capability package in the current path to implement the mini-program's preset function.
[0068] Furthermore, while the first app is qualified to call the mini-program capability package in the current path, calling the mini-program capability package in the current path would put significant pressure on the system, increase system memory usage, and could not guarantee the success rate of the mini-program capability package call. In this case, the first app can wake up the mini-program within the third app, synchronizing its own mini-program's business status with the mini-program within the third app, for example, informing the mini-program within the third app of the function it is currently calling. Then, the mini-program within the third app can call the mini-program capability package in the current path and execute the preset function call. This reduces the system's operational pressure, ensures the success rate of the mini-program capability package call, and, through this method, can achieve the same function regardless of which function the mini-program within the first app calls by waking up the mini-program within the third app, achieving efficient use of mini-program capabilities. Moreover, it avoids the first app having to download the mini-program capability package again, improving the download success rate of the mini-program capability package.
[0069] In one or more embodiments of this specification, when a third app is installed on the system, to reduce system runtime and memory pressure, if the third app detects that the first app has already loaded some capability packages of the mini-program SDK, then the first app is lightweighted. Specifically, at least some of the capability packages already loaded in the first app are deleted, or the loaded capability packages in the first app are reduced in size by deleting some of the data volume of the capability packages. By lightweighting the first app, the data volume of the first app is reduced, thereby reducing system runtime and memory pressure.
[0070] Furthermore, some capability packages within the first app will be made lightweight, but the mini-programs within the first app must still remain visible and interactive to users, so as to enable the mini-program functions to be called within the first app and increase the promotion and application scope of the mini-programs.
[0071] In one or more embodiments of this specification, the method of calling preset functions by a mini-program within a first app or a mini-program within a second app includes any one or more of the following: JSAPI calling method and component calling method. This is because the mini-program capability package in the embodiments of this specification is a compressed package providing a set of native code and resources for mini-program JSAPI capabilities or component capabilities, and the calling method of the preset functions of the mini-program corresponds to the mini-program capability package.
[0072] In one or more embodiments of this specification, to avoid the first or second app requesting to download the mini-program capability package and to improve the success rate of loading the mini-program capability package, a fourth app can be installed on the system. This fourth app corresponds to the mini-programs on the first and second apps. When a mini-program within the first app calls a preset capability, it directly accesses the storage path corresponding to the fourth app's installation package, loads the mini-program capability package corresponding to the preset function, and executes the call to the mini-program's preset function. Similarly, when a mini-program within the second app calls a preset function, it can also directly access the storage path corresponding to the fourth app's installation package, load the mini-program capability package corresponding to the preset function, and execute the call to the preset function. In this way, regardless of which mini-program function the first or second app calls, it does not need to download the mini-program capability package; it can be loaded directly on the system.
[0073] Furthermore, in this embodiment, during the installation of the first and second apps, the system-obtained installation packages may not integrate any mini-program-related content; only the installation packages of the first and second apps will be downloaded, thus solving the problem of excessively large installation packages during app downloads. While the user is using the fourth app, a pop-up window asks the user whether they need to load the mini-program corresponding to the fourth app, allowing the user to select the app (first app or second app) to load the mini-program. Based on the user's selection, the mini-program is loaded within the first or second app, enabling the user to use the mini-program's functions within the first or second app. It should be noted that during the above process, the fourth app authorizes the first or second app to access the fourth app's installation package during use, supporting the execution of preset functions. Moreover, after obtaining authorization from the fourth app, the first or second app displays the overall framework of the mini-program within its own interface.
[0074] For example, the first app is short video app A, the second is short video app B, and the fourth is a map navigation app. After these three apps are installed, when a user uses short video app A or B, they are prompted by a pop-up window to install a map navigation mini-program on short video app A or B. At this point, the installed map navigation mini-program is only the overall framework, provided by the map navigation app installation package. This way, when a user needs to use map navigation, they can directly use the map navigation mini-program on short video app A or B without having to open the map navigation app separately. Furthermore, when a user needs to use the ride-hailing function of the map navigation mini-program, short video app A doesn't need to request to download the ride-hailing capability package; instead, it directly accesses the map navigation app installation package and calls the corresponding capability package to implement the ride-hailing function.
[0075] In the above example, the map navigation software only consumes some system memory and does not put additional pressure on the system. This is because when a user calls the map navigation mini-program function on short video app A or short video app B, they do not need to open the map navigation software, and the system does not need to allocate runtime resources to the map navigation software; they only need to access the map navigation software's installation package. Furthermore, in the above process, the successful invocation of the map navigation mini-program function is supported by the map navigation software installation package, and short video app A or short video app B does not need to additionally request to download the mini-program capability package.
[0076] Based on the preceding explanation, more intuitively, combined with Figure 2 The solution will be explained in more detail in one application scenario. In this scenario, the default function called by the mini-program is the map function (assuming it is the function of calling an electronic map).
[0077] Figure 2 This is a schematic diagram illustrating a method for using mini-program capabilities in an application scenario, provided for one or more embodiments of this specification.
[0078] like Figure 2 As shown, the mini-program calls the map capability via JSAPI or a component. The system checks whether the corresponding map capability package has been downloaded. If so, it further checks for version compatibility. If the map capability package has been downloaded and the version is compatible, the map capability package is dynamically loaded, and the map function is called.
[0079] Furthermore, if the system determines that the mini-program's map capability package has not been downloaded, it requests a compatible version of the map capability package from a designated server and stores the downloaded map capability package and its package information in a shared path so that mini-programs in other apps can call it. After being stored in the shared path, the map capability package is dynamically loaded, and the mini-program's map function is invoked.
[0080] Based on the same idea, one or more embodiments of this specification also provide apparatus and devices corresponding to the above methods, such as... Figure 3 , Figure 4 As shown.
[0081] Figure 3 This specification provides a schematic diagram of the structure of a device for using mini-program capabilities, according to one or more embodiments. The device includes:
[0082] The determination module 302, in response to the operation of the mini-program in the first APP to call the preset capability, determines that the capability package corresponding to the preset capability has not yet been downloaded on the system.
[0083] Download module 304: The first APP requests the download of the capability package from the designated server and stores the downloaded capability package in the designated shared path in the system;
[0084] Execution module 306: The mini-program within the first APP dynamically loads the capability package and executes the call to the preset capability;
[0085] When a mini-program within the second APP requests to call the preset capability, the execution module 306 dynamically loads the capability package through the shared path and executes the call to the preset capability.
[0086] Optionally, the designated server belongs to the server of the third-party APP, and the designated server can provide the SDK corresponding to the mini program. The SDK is used to provide a variety of capabilities, including the preset capabilities.
[0087] The device further includes:
[0088] The acquisition module 308 acquires the installation package of the first APP that integrates the specified content. The specified content is determined according to the SDK and the data volume is less than that of the SDK. The specified content does not include the capability package corresponding to the preset capability at least.
[0089] The installation module 310 installs the first APP by executing the installation package, so that the mini-program is visible and interactive to the user within the first APP on the system.
[0090] Optionally, the mini-program in the first APP and the mini-program in the second APP are the same mini-program;
[0091] The acquisition module 308 acquires the installation package of the second APP that integrates the specified content;
[0092] The installation module 310 installs the second APP by executing the installation package, so that the mini-program is visible and interactive to the user within the second APP on the system.
[0093] Optionally, determining that the capability package corresponding to the preset capability has not yet been downloaded on the system specifically includes:
[0094] It has been determined that the version-compatible capability package corresponding to the preset capability has not yet been downloaded on the system.
[0095] The second APP dynamically loads the capability package through the shared path, specifically including:
[0096] The second app determines whether the capability package has been downloaded via the shared path;
[0097] If it has already been downloaded, determine whether the downloaded capability package is version compatible;
[0098] If the versions are compatible, the capability package is dynamically loaded; otherwise, the version-compatible capability package is downloaded from the designated server and dynamically loaded.
[0099] Optionally, the device further includes:
[0100] Storage module 312, the second APP stores the version-compatible capability package to the shared path.
[0101] Optionally, the third APP is installed on the system;
[0102] If it is determined that the capability package corresponding to the preset capability has not yet been downloaded on the shared path in the system, the device further includes:
[0103] The judgment module 314 determines whether the first APP has obtained authorization from the third APP;
[0104] If so, the mini-program within the third APP is invoked, and the business status of the mini-program within the first APP is synchronized to the invoked mini-program. Through the invoked mini-program, the preset capability is invoked.
[0105] Optionally, the device further includes:
[0106] The detection module 316 detects whether the first APP has already loaded at least some of the capability packages contained in the SDK;
[0107] If so, then based on the at least part of the capability package, the first APP is subjected to capability package lightweighting processing, such that within the first APP after lightweighting processing, the mini-program is still visible and interactive to the user.
[0108] Optionally, the invocation method includes one or more of the following: jsapi invocation method and component invocation method.
[0109] Figure 4 This specification provides a schematic diagram of the structure of a device for using mini-program capabilities, as shown in one or more embodiments. The device includes:
[0110] At least one processor; and,
[0111] A memory communicatively connected to the at least one processor; wherein,
[0112] The memory stores instructions executable by the at least one processor, which, when executed by the at least one processor, enable the at least one processor to:
[0113] In response to a request from a mini-program within the first app to invoke a preset capability, it is determined that the capability package corresponding to the preset capability has not yet been downloaded on the system.
[0114] The first APP requests the download of the capability package from the designated server and stores the downloaded capability package in the designated shared path in the system;
[0115] The mini-program within the first APP dynamically loads the capability package and executes the call to the preset capabilities;
[0116] When a mini-program within the second app requests to invoke the preset capability, the second app dynamically loads the capability package through the shared path and executes the invocation of the preset capability.
[0117] Based on the same idea, one or more embodiments of this specification also provide a non-volatile computer storage medium corresponding to the above method, storing computer-executable instructions, wherein the computer-executable instructions are configured as follows:
[0118] In response to a request from a mini-program within the first app to invoke a preset capability, it is determined that the capability package corresponding to the preset capability has not yet been downloaded on the system.
[0119] The first APP requests the download of the capability package from the designated server and stores the downloaded capability package in the designated shared path in the system;
[0120] The mini-program within the first APP dynamically loads the capability package and executes the call to the preset capabilities;
[0121] When a mini-program within the second app requests to invoke the preset capability, the second app dynamically loads the capability package through the shared path and executes the invocation of the preset capability.
[0122] In the 1990s, improvements to a technology could be clearly distinguished as either hardware improvements (e.g., improvements to the circuit structure of diodes, transistors, switches, etc.) or software improvements (improvements to the methodology). However, with technological advancements, many methodological improvements today can be considered direct improvements to the hardware circuit structure. Designers almost always obtain the corresponding hardware circuit structure by programming the improved methodology into the hardware circuit. Therefore, it cannot be said that a methodological improvement cannot be implemented using hardware physical modules. For example, a Programmable Logic Device (PLD) (such as a Field Programmable Gate Array (FPGA)) is such an integrated circuit whose logic function is determined by the user programming the device. Designers can program and "integrate" a digital system onto a PLD themselves, without needing chip manufacturers to design and manufacture dedicated integrated circuit chips. Furthermore, nowadays, instead of manually manufacturing integrated circuit chips, this programming is mostly implemented using "logic compiler" software. Similar to the software compiler used in program development, the original code before compilation must be written in a specific programming language, called a Hardware Description Language (HDL). There are many HDLs, such as ABEL (Advanced Boolean Expression Language), AHDL (Altera Hardware Description Language), Confluence, CUPL (Cornell University Programming Language), HDCal, JHDL (Java Hardware Description Language), Lava, Lola, MyHDL, PALASM, and RHDL (Ruby Hardware Description Language). Currently, the most commonly used are VHDL (Very-High-Speed Integrated Circuit Hardware Description Language) and Verilog. Those skilled in the art should understand that by simply performing some logic programming on the method flow using one of these hardware description languages and programming it into an integrated circuit, the hardware circuit implementing the logical method flow can be easily obtained.
[0123] The controller can be implemented in any suitable manner. For example, it can take the form of a microprocessor or processor and a computer-readable medium storing computer-readable program code (e.g., software or firmware) executable by the (micro)processor, logic gates, switches, application-specific integrated circuits (ASICs), programmable logic controllers, and embedded microcontrollers. Examples of controllers include, but are not limited to, the following microcontrollers: ARC 625D, Atmel AT91SAM, Microchip PIC18F26K20, and Silicon Labs C8051F320. A memory controller can also be implemented as part of the control logic of the memory. Those skilled in the art will also recognize that, in addition to implementing the controller in purely computer-readable program code form, the same functionality can be achieved by logically programming the method steps to make the controller take the form of logic gates, switches, application-specific integrated circuits, programmable logic controllers, and embedded microcontrollers. Therefore, such a controller can be considered a hardware component, and the means included therein for implementing various functions can also be considered as structures within the hardware component. Alternatively, the means for implementing various functions can be considered as both software modules implementing the method and structures within the hardware component.
[0124] The systems, devices, modules, or units described in the above embodiments can be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer. Specifically, a computer can be, for example, a personal computer, laptop computer, cellular phone, camera phone, smartphone, personal digital assistant, media player, navigation device, email device, game console, tablet computer, wearable device, or any combination of these devices.
[0125] For ease of description, the above devices are described in terms of function, divided into various units. Of course, in implementing this specification, the functions of each unit can be implemented in one or more software and / or hardware components.
[0126] Those skilled in the art will understand that the embodiments of this specification can be provided as methods, systems, or computer program products. Therefore, the embodiments of this specification can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the embodiments of this specification can take the form of a computer program product implemented on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0127] This specification is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this specification. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create a machine for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0128] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0129] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0130] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0131] Memory may include non-persistent storage in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.
[0132] Computer-readable media includes both permanent and non-permanent, removable and non-removable media that can store information using any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic magnetic disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.
[0133] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0134] This specification can be described in the general context of computer-executable instructions that are executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc., that perform a specific task or implement a specific abstract data type. This specification can also be practiced in distributed computing environments, where tasks are performed by remote processing devices connected via a communication network. In distributed computing environments, program modules can reside in local and remote computer storage media, including storage devices.
[0135] The various embodiments in this specification are described in a progressive manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the embodiments of apparatus, devices, and non-volatile computer storage media are basically similar to the method embodiments, so the descriptions are relatively simple; relevant parts can be referred to the descriptions of the method embodiments.
[0136] The foregoing has described specific embodiments of this specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims may be performed in a different order than that shown in the embodiments and may still achieve the desired result. Furthermore, the processes depicted in the drawings do not necessarily require the specific or sequential order shown to achieve the desired result. In some embodiments, multitasking and parallel processing are possible or may be advantageous.
[0137] The above description is merely one or more embodiments of this specification and is not intended to limit this specification. Various modifications and variations can be made to the one or more embodiments of this specification by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principle of one or more embodiments of this specification should be included within the scope of the claims of this specification.
Claims
1. A method for using mini-program capabilities, applied to a system with a first app and a second app installed, the method comprising: The first APP requests the download of the capability package corresponding to the preset capability from the designated server, and stores the downloaded capability package in the designated shared path in the system; When a mini-program within the second app requests to call the preset capability, the second app dynamically loads the capability package through the shared path and executes the call to the preset capability; The designated server belongs to the server of the third-party APP. The designated server can provide the SDK corresponding to the mini program. The SDK is used to provide a variety of capabilities, including the preset capabilities. The third APP detects whether the first APP has already loaded at least some of the capability packages contained in the SDK; If so, then the first APP is subjected to capability package lightweighting processing, including: deleting at least a portion of the data in at least a portion of the capability package.
2. The method as described in claim 1, wherein before the first APP requests the download of the capability package corresponding to the preset capability from the designated server, the method further includes: In response to a request from a mini-program within the first app to invoke a preset capability, it is determined that the capability package corresponding to the preset capability has not yet been downloaded on the system where the first app and the second app are installed. After storing the downloaded capability package to a designated shared path in the system, the method further includes: The mini-program within the first APP dynamically loads the capability package and executes the call to the preset capabilities.
3. The method as described in claim 2, wherein before responding to the operation of requesting to invoke a preset capability in the mini-program within the first APP, the method further includes: Obtain the installation package of the first APP that integrates the specified content, wherein the specified content is determined according to the SDK and the data volume is smaller than that of the SDK, and the specified content does not include at least the capability package corresponding to the preset capability; By executing the installation package, the first APP is installed, so that the mini-program is visible and interactive to the user within the first APP on the system.
4. The method as described in claim 3, wherein the mini-program in the first APP and the mini-program in the second APP are the same mini-program; Before the mini-program within the second app requests to invoke the preset capability, the method further includes: Obtain the installation package of the second APP that integrates the specified content; By executing the installation package, the second APP is installed, so that the mini-program is visible and interactive to the user within the second APP on the system.
5. The method as described in claim 2, wherein determining that the capability package corresponding to the preset capability has not yet been downloaded on the system specifically includes: It has been determined that the version-compatible capability package corresponding to the preset capability has not yet been downloaded on the system. The second APP dynamically loads the capability package through the shared path, specifically including: The second app determines whether the capability package has been downloaded via the shared path; If it has already been downloaded, determine whether the downloaded capability package is version compatible; If the versions are compatible, the capability package is dynamically loaded; otherwise, the version-compatible capability package is downloaded from the designated server and dynamically loaded.
6. The method of claim 5, further comprising, after downloading the version-compatible capability package from the designated server: The second APP stores the version-compatible capability package on the shared path.
7. The method as described in claim 3, wherein the third APP is installed on the system; If it is determined that the capability package corresponding to the preset capability has not yet been downloaded on the shared path in the system, the method further includes: The first app determines whether it has obtained authorization from the third app; If so, the mini-program within the third APP is invoked, and the business status of the mini-program within the first APP is synchronized to the invoked mini-program. Through the invoked mini-program, the preset capability is invoked.
8. The method according to any one of claims 1 to 7, wherein the invocation method includes any one or more of the following: jsapi invocation method and component invocation method.
9. A device for using mini-program capabilities, comprising: The download module involves the first APP requesting the download of the capability package corresponding to the preset capability from the designated server, and storing the downloaded capability package in the shared path specified in the system. When a mini-program within the second app requests to call the preset capability, the execution module dynamically loads the capability package through the shared path and executes the call to the preset capability. The designated server belongs to the server of the third-party APP. The designated server can provide the SDK corresponding to the mini program. The SDK is used to provide a variety of capabilities, including the preset capabilities. The detection module detects whether the first APP has already loaded at least some of the capability packages included in the SDK; If so, then the first APP is subjected to capability package lightweighting processing, including: deleting at least a portion of the data in at least a portion of the capability package.
10. The apparatus of claim 9, further comprising: The determination module, in response to the operation of the mini-program in the first APP requesting to call the preset capability before the first APP requests to download the capability package corresponding to the preset capability from the designated server, determines that the capability package corresponding to the preset capability has not yet been downloaded on the system where the first APP and the second APP are installed; After the downloaded capability package is stored in a shared path specified in the system, the execution module dynamically loads the capability package and executes the call to the preset capability.
11. The apparatus of claim 10, further comprising: The acquisition module acquires the installation package of the first APP that integrates the specified content. The specified content is determined according to the SDK and the data volume is less than that of the SDK. The specified content does not include the capability package corresponding to the preset capability at least. The installation module installs the first APP by executing the installation package, so that the mini-program is visible and interactive to the user within the first APP on the system.
12. The apparatus of claim 11, wherein the mini-program in the first APP and the mini-program in the second APP are the same mini-program; The acquisition module acquires the installation package of the second APP that integrates the specified content; The installation module installs the second APP by executing the installation package, so that the mini-program is visible and interactive to the user within the second APP on the system.
13. The apparatus of claim 10, wherein determining that the capability package corresponding to the preset capability has not yet been downloaded on the system specifically includes: It has been determined that the version-compatible capability package corresponding to the preset capability has not yet been downloaded on the system. The second APP dynamically loads the capability package through the shared path, specifically including: The second app determines whether the capability package has been downloaded via the shared path; If it has already been downloaded, determine whether the downloaded capability package is version compatible; If the versions are compatible, the capability package is dynamically loaded; otherwise, the version-compatible capability package is downloaded from the designated server and dynamically loaded.
14. The apparatus of claim 13, further comprising: The storage module allows the second APP to store the version-compatible capability package on the shared path.
15. The apparatus of claim 11, wherein the third APP is installed on the system; If it is determined that the capability package corresponding to the preset capability has not yet been downloaded on the shared path in the system, the device further includes: The judgment module determines whether the first APP has obtained authorization from the third APP; If so, the mini-program within the third APP is invoked, and the business status of the mini-program within the first APP is synchronized to the invoked mini-program. Through the invoked mini-program, the preset capability is invoked.
16. The apparatus according to any one of claims 9 to 15, wherein the invocation method includes one or more of the following: jsapi invocation method and component invocation method.
17. A device for using mini-program capabilities, comprising: At least one processor; as well as, A memory communicatively connected to the at least one processor; wherein, The memory stores instructions executable by the at least one processor, which, when executed by the at least one processor, enable the at least one processor to: The first APP requests the download of the capability package corresponding to the preset capability from the designated server, and stores the downloaded capability package in the shared path specified in the system; When a mini-program within the second app requests to call the preset capability, the second app dynamically loads the capability package through the shared path and executes the call to the preset capability; The designated server belongs to the server of the third-party APP. The designated server can provide the SDK corresponding to the mini program. The SDK is used to provide a variety of capabilities, including the preset capabilities. The third APP detects whether the first APP has already loaded at least some of the capability packages contained in the SDK; If so, then the first APP is subjected to capability package lightweighting processing, including: deleting at least a portion of the data in at least a portion of the capability package.