Application running method, electronic equipment and storage medium
Through the shared function package and the loading shared implementation package API, the problem of excessive application installation package is solved, faster download and startup speed is achieved, and the independent operation and security of the application are ensured.
Patent Information
- Application Number
- CN202310802854.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-30
- Publication Date
- 2024-12-31
AI Technical Summary
As the application functions become richer, the application's installation package becomes larger and larger, resulting in longer download time and poor user experience.
By sharing function packages, different applications can share the same function package, reduce the size of the installation package, and realize the operation of the application through the API of the shared implementation package.
It reduces the size and download speed of application installation packages, speeds up the startup speed of application, and ensures independent operation and security of application.
Smart Images

Figure CN119225746A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of terminal technology, and in particular to an application running method, an electronic device and a storage medium. Background Art
[0002] With the advancement of technology and the development of smart electronic devices, in order to meet the needs of users, developers have developed a variety of functional applications. Users can download and install applications on electronic devices and experience different application features through installed applications, such as playing music, playing videos, etc.
[0003] Currently, an installation package of an application may include multiple different function packages, and different function packages may implement different functions. For example, a function package of an application may include but is not limited to a basic package, a configuration package, an entry function package, or a feature function package.
[0004] As applications become more and more functional, the number of application function packages increases, resulting in application installation packages being too large. It takes a long time for electronic devices to download application installation packages, and users also need to wait a long time to download application installation packages, resulting in poor user experience. Summary of the invention
[0005] The present application provides an application running method, an electronic device and a storage medium, which enable different applications to share the same function package, reduce the size of the application installation package, and speed up the download speed of the application installation package.
[0006] In a first aspect, the present application provides an application running method, the method comprising: the electronic device obtains a first storage path of an installation package of the first application, and a second storage path of a shared implementation package that the first application depends on, in response to a user's opening operation of the first application; wherein the electronic device is installed with the first application and the shared implementation package, wherein the shared implementation package is used to implement a preset function, and the first storage path is different from the second storage path; the electronic device obtains the installation package of the first application based on the first storage path, and the installation package of the first application is configured with reference information to the shared implementation package; the electronic device runs the first application based on the first storage path, the reference information and the second storage path.
[0007] The reference information of the shared implementation package may include an API for the electronic device to call the shared implementation package, and the electronic device may derive the shared implementation package based on the API of the shared implementation package, and then load and run the shared implementation package. The reference information of the shared implementation package is not limited to the API of the shared implementation package, and may also include other information, which is not limited in this application.
[0008] The storage paths of the installation package of the first application and the shared implementation package that the first application depends on are different. The shared implementation package can be used by different applications. When the first application is started, the electronic device can obtain the second storage path of the shared implementation package that the first application depends on, and then run the first application based on the installation package of the first application and the shared implementation package that the first application depends on. Through this method, different applications can share the same function package, reducing the size of the application installation package and speeding up the download speed of the application installation package.
[0009] In combination with the first aspect, in a possible implementation, the method also includes: the electronic device obtains a third storage path of the installation package of the second application, and a second storage path of the shared implementation package that the second application depends on, in response to the user's opening operation of the second application; wherein the electronic device is installed with the second application and the shared implementation package, and the third storage path is different from the second storage path; the electronic device obtains the installation package of the second application based on the third storage path, and the installation package of the second application is configured with reference information to the shared implementation package; the electronic device runs the second application based on the third storage path, the reference information and the second storage path.
[0010] The same shared implementation package can be used by different applications. When different applications call the same shared implementation package, it is necessary to record the reference information of the shared implementation package that the application depends on in the installation package of each application, so that when the second application is opened, the electronic device can obtain the second storage path of the shared implementation package that the second application depends on, and then run the first application based on the installation package of the second application and the shared implementation package that the second application depends on. In this way, different applications can share the same function package, reducing the size of the application installation package and speeding up the download speed of the application installation package.
[0011] In combination with the first aspect, in a possible implementation, before the electronic device runs the first application based on the first storage path, reference information and the second storage path, the method also includes: the electronic device loads the first storage path and the second storage path into the process sandbox of the first application; the electronic device runs the first application based on the first storage path, reference information and the second storage path, specifically including: the electronic device runs the first application in the process sandbox of the first application based on the first storage path, reference information and the second storage path.
[0012] In some embodiments, the electronic device may also load the reference information of the shared implementation package that the first application depends on into the process sandbox of the first application, or may not load the reference information of the shared implementation package that the first application depends on into the process sandbox of the first application. This application does not limit this.
[0013] When the first application is started, the electronic device can load the first storage path of the installation package of the first application and the second storage path of the shared implementation package that the first application depends on into the process sandbox of the first application. Only the first application can access the data in the process sandbox of the first application, and other applications cannot access the data in the process sandbox of the first application, so that different applications can run independently and the security of application operation can be guaranteed.
[0014] In combination with the first aspect, in a possible implementation, before the electronic device responds to the user's opening operation of the first application, the method also includes: the electronic device receives and responds to a third user operation, downloads and installs the installation package of the first application, and stores the installation package of the first application in the first storage area, the storage path of the installation package of the first application stored in the first storage area is the first storage path, the installation package of the first application includes a shared interface package, and the shared interface package includes an identifier of a shared implementation package that the first application depends on; when the electronic device determines that the shared implementation package is not installed on the electronic device based on the identifier of the shared implementation package, the electronic device downloads the shared implementation package; the electronic device installs the shared implementation package and stores the shared implementation package in the second storage area, and the storage path of the shared implementation package stored in the second storage area is the second storage path.
[0015] In combination with the first aspect, in a possible implementation manner, the method also includes: when the electronic device determines that the shared implementation package is installed on the electronic device based on the identifier of the shared implementation package, the electronic device obtains a second storage path of the shared implementation package based on the identifier of the shared implementation package.
[0016] Optionally, the electronic device may send an identifier of the shared implementation package to the server, and the electronic device receives the shared implementation package sent by the server and installs the shared implementation package.
[0017] In this way, when the electronic device downloads and installs the first application, only the installation package of the first application can be downloaded. When determining whether the electronic device has a shared implementation package that the first application depends on locally, if the electronic device has a shared implementation package that the first application depends on locally stored, the electronic device may not download the shared implementation package to reduce the amount of data downloaded for the installation package of the first application. If the electronic device does not have a shared implementation package that the first application depends on locally stored, the electronic device will download the shared implementation package.
[0018] In combination with the first aspect, in a possible implementation method, the shared interface package also includes reference information of the shared implementation package; before the electronic device runs the first application based on the first storage path, the reference information and the second storage path, the method also includes: the electronic device obtains the shared interface package from the installation package of the first application; the electronic device obtains the reference information of the shared implementation package from the shared interface package.
[0019] The same shared implementation package can be used by different applications. When different applications call the same shared implementation package, the reference information of the shared implementation package that the application depends on needs to be recorded in the installation package of each application.
[0020] In combination with the first aspect, in a possible implementation method, after the electronic device obtains the second storage path of the shared implementation package and before the electronic device responds to the user's opening operation on the first application, the method also includes: the electronic device obtains the installation information of the first application based on the first storage path of the installation package of the first application and the second storage path of the shared implementation package that the first application depends on; the electronic device obtains the first storage path of the installation package of the first application and the second storage path of the shared implementation package that the first application depends on in response to the user's opening operation on the first application, specifically including: the electronic device obtains the installation information of the first application in response to the user's opening operation on the first application; the electronic device obtains the first storage path of the installation package of the first application and the second storage path of the shared implementation package that the first application depends on from the installation information of the first application.
[0021] In this way, before starting the first application, the electronic device can obtain the installation information of the first application based on the first storage path of the installation package of the first application and the second storage path of the shared implementation package that the first application depends on. After starting the first application, the electronic device can quickly obtain the first storage path of the installation package of the first application and the second storage path of the shared implementation package that the first application depends on from the installation information of the first application to speed up the startup speed of the first application.
[0022] In combination with the first aspect, in a possible implementation method, the electronic device obtains a first storage path of the installation package of the first application and a second storage path of the shared implementation package that the first application depends on in response to the user's opening operation of the first application, specifically including: in response to the user's opening operation of the first application, the electronic device obtains the first storage path of the installation package of the first application based on the identifier of the first application; the electronic device obtains the installation package of the first application based on the first storage path; the electronic device obtains the identifier of the shared implementation package that the first application depends on from the installation package of the first application; the electronic device obtains the second storage path of the shared implementation package based on the identifier of the shared implementation package.
[0023] In other possible implementations, before the first application is started, the electronic device does not pre-acquire the installation information of the first application. After the first application is started, the electronic device can obtain in real time the first storage path of the installation package of the first application and the second storage path of the shared implementation package that the first application depends on.
[0024] In combination with the first aspect, in a possible implementation manner, after the electronic device runs the first application based on the first storage path, reference information and the second storage path, the method also includes: if the shared implementation package is not used within a first time period, the electronic device uninstalls the shared implementation package.
[0025] In this way, the electronic device can dynamically delete the shared implementation package that has not been used for a long time. For example, the shared implementation package that has not been used for a long time may be a shared implementation package before the version is updated, so as to save the storage space of the electronic device.
[0026] In combination with the first aspect, in a possible implementation method, an electronic device installs a shared implementation package, specifically including: when the electronic device determines that the installation package of the first application includes a shared interface package, the electronic device obtains, from the shared interface package, an identifier and a first version number of the shared implementation package that the first application depends on; when the electronic device determines, based on the identifier and the first version number of the shared implementation package, that the first version of the shared implementation package is not stored on the electronic device, the electronic device downloads the first version of the shared implementation package; the electronic device installs the first version of the shared implementation package, and stores the first version of the shared implementation package in a second storage area, and the storage path of the first version of the shared implementation package stored in the second storage area is the second storage path.
[0027] In other possible implementations, when the electronic device determines that a first version of a shared implementation package is stored on the electronic device based on the identifier of the shared implementation package and the first version number, the electronic device obtains a second storage path of the first version of the shared implementation package based on the identifier of the shared implementation package and the first version number.
[0028] In this way, the shared implementation package that the first application depends on can be distinguished by version numbers. When the electronic device downloads and installs the first application, only the installation package of the first application can be downloaded. When judging whether the electronic device has a shared implementation package that the first application depends on locally, if the electronic device has a first version of the shared implementation package that the first application depends on stored locally, the electronic device may not download the first version of the shared implementation package to reduce the amount of downloaded data of the installation package of the first application. If the electronic device does not have a first version of the shared implementation package that the first application depends on stored locally, the electronic device downloads the first version of the shared implementation package.
[0029] In combination with the first aspect, in a possible implementation method, the electronic device downloads the first version of the shared implementation package, which specifically includes: the electronic device sends the identifier and the first version number of the shared implementation package to the server; and the electronic device receives the first version of the shared implementation package sent by the server.
[0030] In combination with the first aspect, in a possible implementation method, after the electronic device receives the first version of the shared implementation package sent by the server, the method also includes: the electronic device receives the second version of the shared implementation package sent by the server, and updates the first version of the shared implementation package to the second version of the shared implementation package.
[0031] In this way, the electronic device can also automatically update the latest version. When the first application needs to use the second version of the shared implementation package, the electronic device does not need to download the second version of the shared implementation package from the server in real time.
[0032] In combination with the first aspect, in one possible implementation method, the preset functions include any one of the following: login function, payment function, map function, navigation function, networking function, advertising display function, data storage function, image recognition function, connection function, screen projection function, communication function, camera function, multimedia function, device virtualization function, and device security function.
[0033] In a second aspect, the present application provides an application running method, the method comprising: in response to a user opening operation of a first application, the electronic device obtains a storage path of a shared implementation package that the first application depends on, wherein the electronic device is installed with the first application and the shared implementation package; the electronic device loads the shared implementation package into the process sandbox of the first application; the electronic device displays the user interface of the first application; in response to a user clicking operation on the user interface, the electronic device implements a preset function of the click operation based on the shared implementation package; wherein the preset function includes any one of the following: login function, payment function, map function, navigation function, networking function, advertising display function, data storage function, image recognition function, connection function, screen projection function, communication function, camera function, multimedia function, device virtualization function, and device security function.
[0034] In combination with the second aspect, in a possible implementation, before responding to the user's operation of opening the first application, the method also includes: the electronic device receives and responds to the user's operation of downloading the first application, downloads and installs the installation package of the first application, and stores the installation package of the first application in a first storage area; the electronic device obtains a shared interface package from the installation package of the first application, and obtains an identifier of the shared implementation package from the shared interface package; when the electronic device determines that the shared implementation package is not stored on the electronic device based on the identifier of the shared implementation package, the electronic device downloads the shared implementation package; the electronic device installs the shared implementation package, and stores the shared implementation package in a second storage area; the electronic device obtains the storage path of the shared implementation package based on the shared implementation package stored in the second storage area.
[0035] In combination with the second aspect, in a possible implementation method, the method also includes: when the electronic device determines that the shared implementation package is stored in the second storage area on the electronic device based on the identifier of the shared implementation package, the electronic device obtains the storage path of the shared implementation package based on the shared implementation package stored in the second storage area.
[0036] In combination with the second aspect, in a possible implementation method, the electronic device implements the preset function of the click operation based on the shared implementation package, specifically including: the electronic device obtains the shared interface package from the installation package of the first application; the electronic device obtains the reference information of the shared implementation package from the shared interface package; the electronic device implements the preset function of the click operation based on the reference information of the shared implementation package and the shared implementation package.
[0037] It should be noted that any possible implementation of the application running method provided in the first aspect may also be applicable to an application running method provided in the second aspect.
[0038] In a third aspect, the present application provides an electronic device, the electronic device comprising a processor and a memory; the memory is coupled to the processor, the memory is used to store computer program code, the computer program code comprises computer instructions, and the processor calls the computer instructions to execute an application running method provided in any possible implementation of any of the above aspects.
[0039] In a fourth aspect, the present application provides a computer-readable storage medium for storing computer instructions. When the computer instructions are executed on an electronic device, the electronic device executes an application running method provided in any possible implementation of any of the above aspects.
[0040] In a fifth aspect, the present application provides a computer program product. When the computer program product is run on an electronic device, the electronic device executes an application running method provided in any possible implementation of any of the above aspects.
[0041] For the beneficial effects of the second to fifth aspects, reference may be made to the description of the beneficial effects in the first aspect, and this application will not repeat them here. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] Figure 1 A schematic diagram of the composition structure of an installation package of a first application and an installation package of a second application provided in an embodiment of the present application;
[0043] Figure 2 A schematic diagram provided for an embodiment of the present application;
[0044] Figure 3 Another schematic diagram provided for an embodiment of the present application;
[0045] Figure 4A-4DA schematic diagram showing the electronic device 100 receiving a user operation to download and install a first application;
[0046] Figure 5A A schematic diagram showing the electronic device 100 downloading an installation package of a first application;
[0047] Figure 5B A schematic diagram showing an electronic device 100 storing an HSP package and an application installation package;
[0048] Fig. 6A A schematic diagram showing how another electronic device 100 downloads an installation package of a first application;
[0049] Figure 6B A schematic diagram showing another electronic device 100 storing an HSP package and an application installation package;
[0050] Figure 7 A schematic diagram of the interaction of functional modules for running an hsp package is shown;
[0051] Figure 8 Another schematic diagram of the interaction of functional modules running hsp package is shown;
[0052] Fig. 9 A schematic flow chart of a method for running a first application is shown;
[0053] Fig.10 A schematic diagram showing an application startup module running a first application;
[0054] Fig.11 A schematic diagram of the hardware structure of an electronic device is shown;
[0055] Fig.12 A schematic diagram of the software structure of the electronic device is shown. DETAILED DESCRIPTION
[0056] The technical solutions in the embodiments of the present application will be described clearly and in detail below in conjunction with the accompanying drawings. In the description of the embodiments of the present application, unless otherwise specified, " / " means or, for example, A / B can mean A or B; "and / or" in the text is only a description of the association relationship of associated objects, indicating that there can be three relationships, for example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, in the description of the embodiments of the present application, "multiple" means two or more than two.
[0057] In the following, the terms "first" and "second" are used for descriptive purposes only and are not to be understood as suggesting or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features, and in the description of the embodiments of the present application, unless otherwise specified, "plurality" means two or more.
[0058] The term "user interface (UI)" in the following embodiments of the present application refers to a medium interface for interaction and information exchange between an application or operating system and a user, which realizes the conversion between the internal form of information and the form acceptable to the user. A common form of user interface is a graphical user interface (GUI), which refers to a user interface related to computer operation displayed in a graphical manner. It can be a visual interface element such as text, icons, buttons, menus, tabs, text boxes, dialog boxes, status bars, navigation bars, widgets, etc. displayed on the display screen of an electronic device.
[0059] like Figure 1 As shown in (a) and (b), the installation package of the first application may include multiple different function packages, and different function packages may implement different functional characteristics. For example, the first application may include a first function package, a second function package, and a third function package. Among them, different function packages may implement different functional characteristics. Exemplarily, the first function package may include a basic function package of the first application or an Entry function package of the first application, and the second function package may include a configuration function package of the first application, such as a resource package related to the language configuration of the first application, a resource package related to the central processing unit (CPU) configuration of the first application, etc. The third function package may include a Feature function package, such as a resource package that provides map capabilities, networking capabilities, advertising capabilities, etc.
[0060] Similarly, the installation package of the second application may also include multiple different function packages. For example, the second application may include a fourth function package, a fifth function package, and a third function package. Different function packages may implement different functional characteristics. Exemplarily, the fourth function package may include a basic function package of the second application or an Entry function package of the second application, and the fifth function package may include a configuration function package of the second application, such as a resource package related to the language configuration of the second application, a resource package related to the CPU configuration of the second application, etc. The second application also includes a third function package, and the third function package in the second application is the same as the third function package in the first application.
[0061] When the electronic device 100 downloads the first application, it needs to download all of the multiple function packages of the first application, such as the first function package, the second function package and the third function package.
[0062] When the electronic device 100 downloads the second application, it is also necessary to download all of the multiple function packages of the second application, such as the fourth function package, the fifth function package and the third function package.
[0063] The first application and the second application have the same third function package, but when downloading the first application and the second application, the same third function package needs to be downloaded multiple times, and the electronic device 100 also needs to store multiple third function packages.
[0064] In other possible implementations, the developer may develop a sixth function package with the same or similar functions as the third function package, and the sixth function package is integrated with the second application. When the electronic device 100 downloads the first application and the second application, it is necessary to download the third function package and the sixth function package with the same or similar functions, and store the third function package and the sixth function package with the same or similar functions.
[0065] This not only wastes the memory space of the electronic device 100 , but also requires the user to wait longer to download multiple function packages in the first application and the second application when there are many function packages in the first application and the second application.
[0066] Based on this, the following embodiments of the present application provide a shared function package and an application running method based on the shared function package. The shared function package can realize preset functions, such as login function, payment function, map function, navigation function, networking function, advertising display function, data storage function, image recognition function, connection function, screen projection function, communication function, camera function, multimedia function, device virtualization function, device security function, etc. The shared function package can be shared between different applications. For example, the first application needs to use the first shared package. If the first shared package is already stored on the electronic device 100, then when downloading the installation package of the first application, there is no need to download the first shared package to reduce the amount of download data of the installation package of the first application.
[0067] Next, a detailed introduction is given to the development stage, download stage and usage stage of the shared function package.
[0068] Shared function package development stage
[0069] Shared functionality packages may include shared implementation packages and shared interface packages.
[0070] The shared implementation package may include files that implement the functional characteristics of the first shared function package, such as but not limited to js / ts files, standard program libraries, configuration files, resource files, etc. The shared implementation package can be shared between different applications.
[0071] The shared interface package is used to be integrated in the installation package of the application, and the electronic device can obtain the shared implementation package based on the shared interface package mapping. The shared interface package may include but is not limited to: the shared implementation package information that the application depends on, the reference information of the shared implementation package that the application depends on, etc. Among them, the shared implementation package information that the application depends on includes but is not limited to the identifier of the shared implementation package that the application depends on, or the identifier of the shared implementation package that the application depends on and the version number of the shared implementation package that the application depends on, etc. The reference information of the shared implementation package may include the application programming interface (API) that the electronic device calls the shared implementation package. The electronic device can export the shared implementation package based on the API of the shared implementation package, and then load and run the shared implementation package.
[0072] Not limited to API, the reference information of the shared implementation package can also be other implementation methods, which is not limited in this application.
[0073] For example, in the HarmonyOS system, the shared implementation package can be referred to as an hsp package, and the shared interface package can be referred to as a har package. Figure 2 As shown, the har package may include but is not limited to: hsp package information that the application depends on, the API of the hsp package that the application depends on, etc. Among them, the hsp package information that the application depends on includes but is not limited to the identifier of the hsp package that the application depends on, or the identifier of the hsp package that the application depends on and the version number of the hsp package that the application depends on, etc. The har package is used for application integration of electronic devices.
[0074] In some embodiments, the hsp package information that the application depends on can also be called a configuration file of the har package, and the API of the hsp package that the application depends on can be called an interface exposed by the har package.
[0075] The following embodiments of the present application are illustrated by taking the hsp package and har package in the HarmonyOS system as examples.
[0076] In a possible implementation, the HSP package may be pre-installed on the electronic device. If the HSP package is not pre-installed on the electronic device, the electronic device may also download the HSP package of the shared function package from the application store server.
[0077] Table 1
[0078]
[0079] Table 1 exemplifies the composition of two shared function packages. For example, the first shared function package may include a first har package and a first hsp package. The second shared function package may include a second har package and a second hsp package.
[0080] When an application needs to use a shared function package, the har package of the shared function package needs to be integrated into the installation package of the application.
[0081] For example, Figure 3 As described in (a), when the third function package is a shared function package (such as the first shared function package), the installation package of the first application may not integrate the third function package, but integrate the first HAR package of the third function package, the first HAR package does not include code files, and the data volume of the first HAR package is relatively small. In this way, the data volume of the installation package of the first application can be reduced.
[0082] Similarly, if Figure 3 As described in (b), the installation package of the second application may not integrate the third function package, but may integrate the first har package of the third function package. In this way, the data volume of the installation package of the second application can be reduced.
[0083] Optionally, the application of the electronic device may also integrate the har packages of multiple shared function packages. For example, when the first application needs to use the second shared function package, the second har package of the second shared function package may be integrated into the installation package of the first application.
[0084] Optionally, when the application of the electronic device needs to use multiple shared function packages, for example, the application of the electronic device needs to use the first shared function package and the second shared function package, the first HAR package of the first shared function package and the second HAR package of the second shared function package can be combined into one HAR package, and only one HAR package needs to be integrated in the installation package of the application of the electronic device.
[0085] The following embodiments of the present application are explained by taking the example that when an application of an electronic device uses a shared function package, the installation package of the application of the electronic device must contain a har package corresponding to each shared function package.
[0086] hsp package download stage
[0087] First, the application download scenario involved in this application is described.
[0088] Figure 4A-4D A schematic diagram showing the electronic device 100 receiving a user operation to download and install a first application.
[0089] The electronic device 100 may receive a user operation to download an installation package of the first application from the application store, and install the first application on the electronic device based on the installation package of the first application. After the first application is installed on the electronic device 100, the electronic device 100 may display an application icon of the first application on the desktop.
[0090] Exemplarily, the first application may be a Huawei video application.
[0091] like Figure 4A As shown, Figure 4A The main interface 310 of the electronic device 100 before the Huawei video application is installed is shown. The main interface 310 includes icons of multiple applications, such as an icon of a weather application, an icon of a Huawei store application, an icon of a smart home application, an icon of a sports and health application, an icon of a memo application, an icon of a calendar application, an icon of a life service application, an icon of a camera application, an icon of an address book application, an icon of a phone application, and an icon of a message application, etc. The main interface 310 also shows a battery indicator, a weather indicator, a date indicator, a network signal indicator, a page indicator, etc.
[0092] like Figure 4A As shown, the electronic device 100 can receive an input operation (such as a click) from a user on an icon of the Huawei Store application. In response to the user's input operation, the electronic device 100 can display Figure 4B The user interface 320 shown. The user interface 320 is the main interface of the Huawei Store application. The user interface 320 includes an application search bar 3201 and recommended applications, and the recommended applications may be Huawei music applications, sports health applications, etc. Among them, the electronic device 100 can receive the user's input operation in the search bar 3201 (for example, entering the application keyword in the search bar 3201), and the electronic device 100 will display the application search interface.
[0093] Exemplarily, the electronic device 100 receives the keyword "Huawei Video" entered by the user in the search bar, and then the electronic device 100 can display the download interface or opening interface of Huawei Video. If the application 1 has been installed locally, in response to the keyword "Huawei Video" entered by the user, the electronic device 100 will display the opening interface of the application 1. Among them, the interface may include the icon of Huawei Video, the introduction information of Huawei Video, the control for opening Huawei Video, etc.
[0094] For example, Figure 4C As shown, the electronic device 100 receives the keyword "Huawei Video" entered by the user in the search bar, and then the electronic device 100 can display the download interface of Huawei Video. The download interface of Huawei Video can include the icon of Huawei Video, the introduction information of Huawei Video, the download control of Huawei Video installation package, etc.
[0095] For example, Figure 4C As shown, the electronic device 100 can receive a user input operation (eg, a single click) for a download control of the Huawei video installation package. In response to the user's input operation, the electronic device 100 can download the installation package of the Huawei video application and install the Huawei video application.
[0096] like Figure 4D As shown, after the electronic device 100 has installed the Huawei video application, the electronic device 100 can display the icon 3101 of the Huawei video application in the main interface 310. The electronic device 100 can receive a user input operation (e.g., a single click) on the icon 3101 of the Huawei video application in the main interface 310. In response to the user's input operation, the electronic device 100 can display the content of the Huawei video application, such as playing a video provided by the Huawei video application.
[0097] Figure 5A A schematic diagram showing the electronic device 100 downloading the installation package of the first application.
[0098] S501 : The electronic device 100 sends an application identifier of a first application to the server 200 .
[0099] Exemplarily, the first application may be a Huawei video application.
[0100] like Figure 4A-4D As shown, when the electronic device 100 needs to download the first application, the electronic device 100 can receive the user's Figure 4C Enter the keyword "Huawei Video" in the search bar shown. Afterwards, the electronic device 100 can receive the user's search results. Figure 4C The input operation of the download control shown (for example, a single click) is performed. In response to the user's input operation, the electronic device 100 can send the application identifier “Huawei Video” of the Huawei Video application to the server 200 .
[0101] S502 : The electronic device 100 receives an installation package of a first application sent by the server 200 .
[0102] In some embodiments, after the electronic device 100 sends the application identifier of the first application to the server 200, the server 200 can obtain the installation package of the first application based on the application identifier of the first application. The server 200 then sends the installation package of the first application to the electronic device 100.
[0103] The installation package of the first application may include one or more function packages.
[0104] The installation package of the first application may also include one or more function packages and one or more har packages of shared function packages.
[0105] The function package may be a unique function package of the first application and cannot be used by other applications. The hsp package of the shared function package can be used not only by the application itself but also by other applications.
[0106] S503 : The electronic device 100 installs a first application and stores an installation package of the first application in a first storage area of the electronic device 100 .
[0107] After the electronic device 100 obtains the installation package of the first application sent by the server 200, the electronic device 100 can install the first application and install the installation package of the first application in the first storage area of the electronic device 100. The installation package of the first application installed in the first storage area is limited to the first application and cannot be used by other applications (such as the second application).
[0108] The storage path of the installation package of the first application stored in the first storage area is the first storage path.
[0109] S504: The electronic device 100 needs to confirm whether the electronic device 100 locally stores a first hsp package that the first application depends on.
[0110] When the electronic device 100 confirms that the first hsp package that the first application depends on is locally stored in the electronic device 100, the electronic device 100 does not need to download the first hsp package that the first application depends on from the server 200, and the process ends.
[0111] When the electronic device 100 confirms that the first hsp package that the first application depends on is not stored locally in the electronic device 100, the electronic device 100 needs to download the first hsp package that the first application depends on from the server 200 and execute S505.
[0112] Optionally, before executing S504, the electronic device 100 may determine whether the installation package of the first application includes a har package. If the electronic device 100 determines that the installation package of the first application does not include a har package, it means that the first application does not use a shared function package. After the electronic device 100 installs the first application and stores the installation package of the first application in the first storage area of the electronic device 100, the process ends, and the electronic device 100 does not need to execute S505.
[0113] When the electronic device 100 determines that the installation package of the first application includes the har package, it means that the first application needs to use the shared function package. After the electronic device 100 installs the first application and stores the installation package of the first application in the first storage area of the electronic device 100, the electronic device 100 also needs to execute S505.
[0114] When the electronic device 100 determines that the installation package of the first application includes a HAR package, for example, the HAR package is the first HAR package, the electronic device 100 can obtain the first HAR package. The electronic device 100 can obtain the HSP package information that the first application depends on from the first HAR package, and then obtain the name or ID of the first HSP package that the first application depends on from the HSP package information that the first application depends on. The HSP package information that the first application depends on can include the name or ID of the HSP package that the first application depends on, or the name or ID of the HSP package that the first application depends on and the version number of the HSP package that the first application depends on.
[0115] Figure 5A In the embodiment, the hsp package information that the first application depends on includes the name or ID of the hsp package that the first application depends on as an example for description.
[0116] The electronic device 100 can obtain the name or ID of the first hsp package that the first application depends on based on the hsp package information that the first application depends on, and based on the name or ID of the first hsp package, confirm whether the first hsp package that the first application depends on is stored on the electronic device 100.
[0117] S505 : The electronic device 100 sends a download notification to the server 200 .
[0118] When the electronic device 100 confirms that the first hsp package that the first application depends on is not stored locally in the electronic device 100, the electronic device 100 can send a download notification to the server 200, and the download notification is used for the server 200 to download and obtain the first hsp package.
[0119] In a possible implementation, the download notification may carry the name or ID of the first hsp package. In other possible implementations, the name of the first hsp package may also be sent to the server 200 separately with the download notification. This application does not limit this.
[0120] S506 . The electronic device 100 receives the first HSP packet sent by the server 200 .
[0121] In some embodiments, after receiving the download notification sent by the electronic device 100, the server 200 can obtain the name of the first HSP package in response to the download notification, and obtain the first HSP package based on the name of the first HSP package. The server 200 then sends the first HSP package to the electronic device 100.
[0122] S507: The electronic device 100 installs the first HSP package and stores the first HSP package in a second storage area, which is different from the first storage area.
[0123] After the electronic device 100 obtains the first HSP package sent by the server 200, the electronic device 100 can install the first HSP package and store the first HSP package in the second storage area, which is different from the first storage area. In this way, the first HSP package stored in the second storage area is not limited to being used by the first application, but can also be used by other applications (such as the second application).
[0124] Optionally, multiple hsp packages can be stored in the electronic device 100. In order to facilitate the management of multiple hsp packages, the electronic device 100 can create an hsp package parent directory, and the hsp package parent directory can include multiple hsp package subdirectories. Different hsp packages can be stored in different hsp package subdirectories. For example, when the electronic device 100 installs the first hsp package, the electronic device 100 can create a subdirectory of the hsp package parent directory (for example, the first hsp package subdirectory), and install and store the first hsp package in the first hsp package subdirectory. For another example, when the electronic device 100 installs the second hsp package, the electronic device 100 can create a subdirectory of the hsp package parent directory (for example, the second hsp package subdirectory), and install and store the second hsp package in the second hsp package subdirectory. The first hsp package subdirectory is different from the second hsp package subdirectory.
[0125] Optionally, in other embodiments, the electronic device 100 may not include an upper-level directory of the hsp package, but only include sub-directories of different hsp packages, and this application does not limit this.
[0126] The first hsp package subdirectory may be referred to as a second storage area. The storage path of the first hsp package stored in the first hsp package subdirectory is the second storage path.
[0127] The second hsp package subdirectory may be referred to as a third storage area. The storage path of the first hsp package stored in the second hsp package subdirectory is a fifth storage path.
[0128] In some examples, each hap package subdirectory in the hsp package parent directory can be mounted by non-hsp package applications when needed to implement corresponding functions.
[0129] Optionally, before the electronic device 100 installs the first HSP package, the electronic device 100 can verify whether the first HSP package is an installation package of a shared function package. In this way, the security of the HSP package can be guaranteed. Specifically, when the server 200 sends the first HSP package to the electronic device 100, it can also send a first verification value to the electronic device 100. The electronic device 100 can obtain the second verification value locally. When the first verification value sent by the server 200 is the same as the second verification value stored locally or meets a preset condition, the electronic device 100 can determine that the first HSP package is an installation package of a shared function package, and the electronic device 100 stores the first HSP package in the second storage area.
[0130] Optionally, after the electronic device 100 installs the first application, the electronic device 100 can obtain the first storage path of the installation package of the first application and the second storage path of the first hsp package. The first storage path of the installation package of the first application and the second storage path of the first hsp package are stored in the package management module. In this way, when the electronic device 100 needs to use the first application, the electronic device 100 can directly obtain the first storage path of the installation package of the first application and the second storage path of the first hsp package from the package management module to speed up the startup speed of the first application.
[0131] Optionally, S503 and S507 may be executed simultaneously.
[0132] Figure 5B A schematic diagram showing an electronic device 100 storing an HSP package and an application installation package.
[0133] like Figure 5B As shown, the first storage area stores the installation packages of various applications, and the installation packages of applications include the function packages of the applications and the HAR packages of the shared function packages that the applications depend on. For example, the first storage area stores the installation packages of the first application and the second application. The installation package of the first application includes the first function package, the second function package and the first HAR package. The installation package of the second application includes the third function package, the fourth function package and the first HAR package.
[0134] Stored in the second storage area are HSP packages of shared function packages that the application depends on, such as a first HSP package of a first shared function package and a second HSP package of a second shared function package.
[0135] In some embodiments, the hsp package information that the first application depends on may include, in addition to the name or ID of the hsp package that the first application depends on, a version number of the hsp package that the first application depends on.
[0136] Then the electronic device 100 not only needs to determine whether the electronic device 100 locally stores the hsp package that the first application depends on, but also needs to determine whether the version number of the hsp package is the same as the version number of the hsp package that the first application depends on.
[0137] Fig. 6A A schematic diagram showing how another electronic device 100 downloads an installation package of a first application.
[0138] For S601-S603, please refer to the description in S501-S503, which will not be repeated in this application.
[0139] S604: The electronic device 100 obtains the name of the first hsp package that the first application depends on and the first version number of the first hsp package based on the hsp package information that the first application depends on.
[0140] S605: The electronic device 100 needs to determine whether the electronic device 100 locally stores a first hsp package that the first application depends on.
[0141] In some examples, the electronic device 100 can obtain the first har package from the installation package of the first application. The first har package may include the hsp package information that the first application depends on and the API of the hsp package that the first application depends on.
[0142] The hsp package information that the first application depends on may include the name of the first hsp package that the first application depends on and the version number of the first hsp package that the first application depends on.
[0143] After obtaining the first HAR package, the electronic device 100 can obtain the first HSP package information that the first application depends on from the first HAR package, and then obtain the name of the first HSP package that the first application depends on and the first version number of the first HSP package based on the first HSP package information that the first application depends on.
[0144] After obtaining the name of the first hsp package that the first application depends on, the electronic device 100 can confirm whether the first hsp package that the first application depends on is stored on the electronic device 100 based on the name of the first hsp package.
[0145] When the electronic device 100 confirms that the electronic device 100 locally stores the first hsp package that the first application depends on, the electronic device 100 also needs to determine whether the version number of the first hsp package locally stored in the electronic device 100 is the same as the version number of the first hsp package recorded in the first har package, and execute S606.
[0146] When the electronic device 100 confirms that the first hsp package that the first application depends on is not stored locally in the electronic device 100, the electronic device 100 needs to download the first version of the first hsp package that the first application depends on from the server 200 and execute S607.
[0147] S606: The electronic device 100 needs to determine whether the second version number of the first hsp package stored locally in the electronic device 100 is the same as the first version number.
[0148] The functional characteristics of the shared function package can be updated. After the functional characteristics of the shared function package are updated, the version number of the shared function package also needs to be updated. The electronic device 100 needs to determine whether the second version number of the first hsp package locally stored in the electronic device 100 is the same as the first version number.
[0149] When the second version number of the first hsp package stored locally in the electronic device 100 is the same as the first version number, the electronic device 100 does not need to download the first version of the first hsp package from the server 200, and the process ends.
[0150] In the case where the second version number of the first hsp package stored locally in the electronic device 100 is different from the first version number, the electronic device 100 needs to download the first version of the first hsp package from the server 200 and execute S607. In some examples, the first version number is higher than the second version number, and the first hsp package of the second version number can be updated to the first hsp package of the first version.
[0151] S607 : The electronic device 100 sends a download notification to the server 200 .
[0152] When the electronic device 100 confirms that the second version number of the first HSP package stored locally in the electronic device 100 is different from the first version number, the electronic device 100 can send a download notification to the server 200, which is used for the server 200 to download the first version of the first HSP package.
[0153] In a possible implementation, the download notification may carry the name of the first hsp package and the first version number of the first hsp package. In other possible implementations, the name of the first hsp package and the first version number of the first hsp package may also be sent to the server 200 separately with the download notification. This application does not limit this.
[0154] S608 . The electronic device 100 receives the first hsp packet of the first version sent by the server 200 .
[0155] In some embodiments, the electronic device 100 may send a download notification to the server 200. After receiving the download notification, the server 200 may obtain the name of the first hsp package and the first version number of the first hsp package, and obtain the first version of the first hsp package based on the name of the first hsp package and the first version number of the first hsp package.
[0156] S609: The electronic device 100 installs the first hsp package of the first version, and stores the first hsp package of the first version in a second storage area, which is different from the first storage area.
[0157] After the electronic device 100 obtains the first version of the first hsp package sent by the server 200, the electronic device 100 can install the first version of the first hsp package and store the first version of the first hsp package in the second storage area, which is different from the first storage area. In this way, the first version of the first hsp package stored in the second storage area is not limited to being used by the first application, but can also be used by other applications (such as the second application).
[0158] The storage path of the first hsp package of the first version stored in the second storage area is the second storage path.
[0159] Optionally, before the electronic device 100 stores the first hsp package of the first version in the second storage area, the electronic device 100 can verify whether the first hsp package of the first version is an installation package of the shared function package. In this way, the security of the hsp package can be guaranteed. Specifically, when the server 200 sends the first hsp package of the first version to the electronic device 100, it can also send a third verification value to the electronic device 100. The electronic device 100 can obtain the second verification value locally. When the third verification value sent by the server 200 is the same as the second verification value stored locally or meets the preset conditions, the electronic device 100 can determine that the first hsp package of the first version is an installation package of the shared function package, and the electronic device 100 stores the first hsp package of the first version in the second storage area.
[0160] Optionally, after the electronic device 100 installs the first hsp package of the first version and stores the first hsp package of the first version in the second storage area, the electronic device 100 can obtain the first storage path of the installation package of the first application and the second storage path of the first hsp package of the first version. The first storage path of the installation package of the first application and the second storage path of the first hsp package of the first version are stored in the package management module. In this way, when the electronic device 100 needs to use the first application, the electronic device 100 can obtain the first storage path of the installation package of the first application and the second storage path of the first hsp package of the first version from the package management module to speed up the startup speed of the first application.
[0161] Optionally, S604 and S609 may be executed simultaneously.
[0162] Figure 6B A schematic diagram showing another electronic device 100 storing an HSP package and an application installation package is shown.
[0163] like Figure 6B As shown, the first storage area stores the installation packages of various applications, and the installation packages of applications include the function packages of the applications and the HAR packages of the shared function packages that the applications depend on. For example, the first storage area stores the installation packages of the first application and the second application. The installation package of the first application includes the first function package, the second function package and the first HAR package. The installation package of the second application includes the third function package, the fourth function package and the first HAR package.
[0164] The second storage area stores the installation packages of the shared function packages, such as the first hsp package of the first version of the first shared function package and the first hsp package of the second version of the first shared function package. For example, the first version number may be app version 1.0, and the second version number may be app version 2.0.
[0165] hsp package update and deletion
[0166] After storing the HSP package in the second storage area, the electronic device 100 can manage the HSP package, for example, update or delete it.
[0167] 1. The server 200 can automatically send HSP packets whose usage frequency is greater than a preset value to the electronic device 100.
[0168] The server 200 stores multiple HSP packages, and different electronic devices can download multiple HSP packages from the server 200. The server 200 can count the usage frequency of each HSP package, determine the HSP package with a usage frequency greater than a preset value, and automatically send the HSP package with a usage frequency greater than the preset value to each electronic device.
[0169] Exemplarily, after the server 200 determines that the usage frequency of the first hsp package or the first version of the first hsp package is greater than a preset value, the server 200 may send the first hsp package or the first version of the first hsp package to the electronic device 100. The electronic device 100 may store the first hsp package or the first version of the first hsp package in the second storage area. In this way, when the electronic device 100 receives a user operation to download the first application, the first application depends on the first hsp package or the first version of the first hsp package. The electronic device 100 does not need to download the first hsp package or the first version of the first hsp package from the server 200, and only needs to download the installation package of the first application. As a result, the speed at which the electronic device 100 downloads and installs the first application can be accelerated.
[0170] 2. After the version of the hsp package is updated, the server 200 can automatically send the latest version of the hsp package to the electronic device 100.
[0171] The hsp package stored in the server 200 has a version number. After the hsp package is upgraded, the version number of the hsp package also needs to be updated accordingly. The server 200 can automatically send the hsp package with the updated version number to each electronic device.
[0172] For example, the server 200 stores the first hsp package of the second version. After the first hsp package of the second version is upgraded, the first hsp package of the first version can be obtained. The server 200 can automatically send the first hsp package of the first version to the electronic device 100. In this way, when the electronic device 100 receives the user operation to download the first application, the first application depends on the first hsp package of the first version. The electronic device 100 no longer needs to download the first hsp package of the first version from the server 200, and only needs to download the installation package of the first application. The speed of downloading and installing the first application by the electronic device 100 can be accelerated.
[0173] 3. The electronic device 100 can also automatically delete the HSP packets that have not been used for more than the first time period.
[0174] Multiple HSP packages are stored on the electronic device 100. These HSP packages may be downloaded from the server 200 when the electronic device 100 downloads an application, or these HSP packages may be preset by the system, or these HSP packages may be automatically sent to the electronic device 100 by the server 200, or these HSP packages may be periodically / irregularly downloaded from the server 200 when the electronic device 100 responds to an automatic update request set by the user.
[0175] The electronic device 100 can count the usage frequencies of the multiple HSP packages stored in the electronic device 100. The HSP packages that have not been used for more than the first time length are deleted to save the storage space of the electronic device 100.
[0176] Exemplarily, the electronic device 100 stores the first HSP package of the first version and the first HSP package of the second version. If the electronic device 100 determines that the first HSP package of the second version has not been used for more than the first time length, the electronic device 100 can delete the first HSP package of the second version to save storage space of the electronic device 100.
[0177] hsp package usage stage
[0178] Figure 7 A schematic diagram of the interaction of functional modules for running an hsp package is shown.
[0179] like Figure 7 As shown, the functional modules include but are not limited to a storage module, a package management module, an application operation management module, an application spawn module, and the like.
[0180] The storage module is used to store the installation package of the application and the hsp package that the application depends on.
[0181] The first storage area in the storage module stores the installation package of the application. The second storage area in the storage module stores the hsp package that the application depends on.
[0182] For example, Figure 7 The first storage area stores an installation package of the first application, and the second storage area stores a first hsp package that the first application depends on.
[0183] The storage module is also used to send the first storage path of the installation package of the first application and the second storage path of the first hsp package to the package management module.
[0184] The package management module is also used to store a first storage path of the installation package of the first application and a second storage path of the first hsp package.
[0185] The application operation management module is used to respond to user operations and start the first application.
[0186] The application operation management module is also used to send application startup notifications to the package management module.
[0187] In one possible implementation, the application startup notification may carry the identifier of the first application. In other possible implementations, the identifier of the first application may also be sent to the package management module independently of the application startup notification. This application does not limit this.
[0188] The package management module is also used to obtain the first storage path of the installation package of the first application and the second storage path of the first hsp package based on the identifier of the first application in response to the application startup notification.
[0189] In one possible implementation, after receiving the application startup notification sent by the application execution management module, the package management module can obtain the first storage path of the installation package of the first application based on the identifier of the first application, obtain the installation package of the first application, determine the identifier of the first hsp package that the first application depends on recorded in the installation package of the first application, and then obtain the second storage path of the first hsp package based on the identifier of the first hsp package.
[0190] In other possible implementations, the package management module may bind and store the first storage path of the installation package of the first application and the second storage path of the first hsp package that the first application depends on in advance. Afterwards, upon receiving the application startup notification sent by the application operation management module, the package management module may directly obtain the first storage path of the installation package of the first application and the second storage path of the first hsp package based on the identifier of the first application, so as to reduce the time for the package management module to search for the second storage path of the first hsp package that the first application depends on, and speed up the startup of the application.
[0191] The package management module is also used to send the first storage path of the installation package of the first application and the second storage path of the first hsp package that the first application depends on to the application startup module after obtaining the first storage path of the installation package of the first application and the second storage path of the first hsp package that the first application depends on.
[0192] The application startup module is used to receive the first storage path of the installation package of the first application and the second storage path of the first hsp package that the first application depends on sent by the package management module, and create a process sandbox of the first application.
[0193] The application startup module is also used to store a first storage path of the installation package of the first application and a second storage path of the first hsp package that the first application depends on in the process sandbox of the first application.
[0194] In this way, after the first application is running, it can obtain the installation package of the first application and the first hsp package that the first application depends on based on the first storage path of the installation package of the first application in the process sandbox of the first application and the second storage path of the first hsp package that the first application depends on, and run the installation package of the first application and the first hsp package that the first application depends on to realize the functional characteristics of the first application.
[0195] Figure 8 Another schematic diagram of the interaction of functional modules for running an hsp package is shown.
[0196] Figure 8 The corresponding embodiments and Figure 7 The corresponding embodiments are similar, except that: Figure 8 In the embodiment, it is necessary to distinguish the version numbers of the hsp packages.
[0197] The storage module is used to store the installation package of the application and the hsp package that the application depends on.
[0198] like Figure 8 The first storage area in the storage module stores the installation package of the application, and the second storage area in the storage module stores the hsp package that the application depends on.
[0199] Exemplarily, the first storage area stores an installation package of the first application. The second storage area stores a first version of the first hsp package and a second version of the first hsp package. Exemplarily, the first version number may be app version 1.0, and the second version number may be app version 2.0.
[0200] The storage module is also used to send the first storage path of the installation package of the first application, the second storage path of the first hsp package of the first version, and the fourth storage path of the first hsp package of the second version to the package management module.
[0201] The package management module is also used to store the first storage path of the installation package of the first application, the second storage path of the first hsp package of the first version, and the fourth storage path of the first hsp package of the second version.
[0202] The application operation management module is used to respond to user operations and start the first application.
[0203] The application operation management module is also used to send application startup notifications to the package management module.
[0204] In one possible implementation, the application startup notification may carry the identifier of the first application. In other possible implementations, the identifier of the first application may also be sent to the package management module independently of the application startup notification. This application does not limit this.
[0205] The package management module is further used to obtain, in response to the application startup notification, a first storage path of the installation package of the first application and a second storage path of the first version of the first hsp package based on the identifier of the first application.
[0206] In one possible implementation, after receiving the application startup notification sent by the application execution management module, the package management module can obtain the first storage path of the installation package of the first application based on the identifier of the first application, obtain the installation package of the first application, determine the identifier of the first hsp package of the first version that the first application depends on recorded in the installation package of the first application, and then obtain the second storage path of the first hsp package of the first version based on the identifier of the first hsp package of the first version.
[0207] In other possible implementations, the package management module may bind and store the first storage path of the installation package of the first application and the second storage path of the first hsp package of the first version that the first application depends on in advance. Afterwards, upon receiving the application startup notification sent by the application operation management module, the package management module may directly obtain the first storage path of the installation package of the first application and the second storage path of the first hsp package of the first version based on the identifier of the first application, so as to reduce the time for the package management module to search for the second storage path of the first hsp package of the first version that the first application depends on, and speed up the startup of the application.
[0208] The package management module is also used to send the first storage path of the installation package of the first application and the second storage path of the first hsp package on which the first application depends to the application startup module after obtaining the first storage path of the installation package of the first application and the second storage path of the first hsp package on which the first application depends.
[0209] The application startup module is used to receive the first storage path of the installation package of the first application and the second storage path of the first hsp package of the first version sent by the package management module, and create a process sandbox of the first application.
[0210] The application startup module is further used to store a first storage path of the installation package of the first application and a second storage path of the first hsp package of the first version in the process sandbox of the first application.
[0211] In this way, after the first application is running, it can obtain the installation package of the first application and the first hsp package of the first version that the first application depends on based on the first storage path of the installation package of the first application in the process sandbox of the first application and the second storage path of the first hsp package of the first version that the first application depends on, and run the installation package of the first application and the first hsp package of the first version that the first application depends on to realize the functional characteristics of the first application.
[0212] Fig. 9 A schematic flow chart of a method for running a first application is shown.
[0213] S901. The package management module stores storage paths of one or more application installation packages and storage paths of one or more HSP packages. The storage area of the application installation package is different from the storage area of the HSP package. For example, the application installation package can be stored in a first storage area, and the HSP package can be stored in a second storage area. The first storage area is different from the second storage area.
[0214] Table 2
[0215] Application ID The storage path of the application installation package First application First storage path Second application The third storage path
[0216] Table 2 shows a storage path of an application installation package stored in a package management module. The storage path of the application installation package is stored in a one-to-one correspondence with the application identification. The electronic device 100 can obtain the storage path of the application installation package based on the application identification.
[0217] Exemplarily, the electronic device 100 may obtain the storage path of the installation package of the first application as the first storage path based on the application identifier of the first application. The electronic device 100 may obtain the storage path of the installation package of the second application as the third storage path based on the application identifier of the second application.
[0218] Table 3
[0219] Identification of hsp package Storage path of hsp package The first hsp package Second storage path The second hsp package Fifth storage path
[0220] Table 3 shows a storage path of an HSP package stored in a package management module. The storage path of the HSP package is stored in a one-to-one correspondence with the identifier of the HSP package. The electronic device 100 can obtain the storage path of the HSP package based on the identifier of the HSP package.
[0221] Exemplarily, the electronic device 100 can obtain the storage path of the first HSP package as the second storage path based on the HSP package identifier of the first HSP package. The electronic device 100 can obtain the storage path of the second HSP package as the fifth storage path based on the HSP package identifier of the second HSP package.
[0222] Table 4
[0223] Identification of hsp package Version number of the hsp package Storage path of hsp package The first hsp package First version number Second storage path The first hsp package Second version number Fourth storage path
[0224] Table 4 shows another storage path of an hsp package stored in a package management module. The difference between Table 4 and Table 3 is that in Table 4, the hsp package stored in the electronic device 100 also needs to distinguish the version number. The storage path of the hsp package is stored in a one-to-one correspondence with the identifier of the hsp package and the identifier of the hsp package. The electronic device 100 can obtain the storage path of the hsp package based on the identifier of the hsp package and the version number of the hsp package.
[0225] Exemplarily, the electronic device 100 can obtain the storage path of the first version of the first hsp package as the second storage path based on the hsp package identifier of the first hsp package and the first version number of the first hsp package. The electronic device 100 can obtain the storage path of the second version of the first hsp package as the fourth storage path based on the hsp package identifier of the first hsp package and the second version number of the first hsp package.
[0226] In a possible implementation, the package management module may not store the storage path of the installation package of one or more applications and the storage path of one or more hsp packages, or the package management module may store the installation information of the application in addition to storing the storage path of the installation package of one or more applications and the storage path of one or more hsp packages. The installation information of the application records the storage path of the installation package of the application and the storage path of the hsp package on which the application depends.
[0227] Table 5
[0228]
[0229] Table 5 shows the installation information of an application stored in a package management module. The installation information of the application and the identification of the application are stored in a one-to-one correspondence. The electronic device 100 can obtain the installation information of the application based on the identification of the application.
[0230] Exemplarily, the electronic device 100 may obtain installation information of the first application based on the application identifier of the first application. The installation information of the first application may include a first storage path of the installation package of the first application and a second storage path of the first hsp package that the first application depends on.
[0231] The electronic device 100 may also obtain the installation information of the second application based on the application identifier of the second application. The installation information of the second application may include the third storage path of the installation package of the second application and the second storage path of the first hsp package that the second application depends on.
[0232] The package management module can also store installation information of more other applications, which is not limited in this application.
[0233] Table 6
[0234]
[0235] Table 6 shows another type of application installation information stored in a package management module. The application installation information and the application identification are stored in a one-to-one correspondence. The electronic device 100 can obtain the application installation information based on the application identification.
[0236] The difference between Table 6 and Table 5 is that in Table 5, the HSP package stored in the electronic device 100 also needs to distinguish the version number.
[0237] Exemplarily, the electronic device 100 can obtain the installation information of the first application based on the application identifier of the first application. The installation information of the first application can include the first storage path of the installation package of the first application and the second storage path of the first version of the first hsp package that the first application depends on.
[0238] The electronic device 100 can also obtain the installation information of the second application based on the application identifier of the second application. The installation information of the second application may include the third storage path of the installation package of the second application and the second storage path of the first version of the first hsp package that the second application depends on.
[0239] The package management module can also store installation information of more other applications, which is not limited in this application.
[0240] S902: The application operation management module obtains an activation notification.
[0241] The electronic device 100 may receive an operation from the user and start the first application.
[0242] For example, the first application may be a Huawei video application, and the operation of opening the first application may be for Figure 4D An input operation (eg, single click) is performed on the icon 3101 of the Huawei Video application shown.
[0243] In response to the user's operation, the application execution management module may obtain an activation notification, where the activation notification is used to activate the first application.
[0244] When the application execution management module obtains the start notification, the application execution management module may also obtain the identifier of the first application.
[0245] In a possible implementation, the identifier of the first application may be carried in an activation notification and sent to the application execution management module.
[0246] In other possible implementations, the identifier of the first application may also be sent to the application execution management module independently of the start notification, and this application does not limit this.
[0247] S903: The application operation management module sends an opening notification to the package management module.
[0248] Likewise, the application execution management module also needs to send the identifier of the first application to the package management module.
[0249] In a possible implementation, the identifier of the first application may be carried in an opening notification and sent to the package management module.
[0250] In other possible implementations, the identifier of the first application may also be sent to the package management module independently of the start notification, and this application does not limit this.
[0251] S904: The package management module obtains installation information of the first application based on the identifier of the first application.
[0252] After obtaining the start notification sent by the application execution management module and the identifier of the first application, the package management module can obtain the installation information of the first application based on the identifier of the first application in response to the start notification.
[0253] As can be seen from S901, in some embodiments, the package management module stores installation information of multiple applications, and the package management module can directly obtain the installation information of the first application from Table 5 or Table 6 based on the identifier of the first application. Exemplarily, the installation information of the first application may include the first storage path of the installation package of the first application and the second storage path of the first hsp package that the first application depends on. Exemplarily, the installation information of the first application may also include the first storage path of the installation package of the first application and the second storage path of the first version of the first hsp package that the first application depends on.
[0254] In other embodiments, the package management module does not store the installation information of multiple applications. The package management module can obtain the installation information of the first application from the storage path of the installation package of one or more applications and the storage path of one or more hsp packages stored in the package management module based on the identifier of the first application. Specifically, the package management module can obtain the first storage path of the installation package of the first application from Table 2 based on the identifier of the first application. Then, based on the first storage path of the installation package of the first application, the installation package of the first application is obtained, and the package management module can obtain the hsp package information that the first application depends on from the installation package of the first application.
[0255] In a possible implementation, the hsp package information that the first application depends on may include the hsp package identifier (e.g., the first hsp package) that the first application depends on. The package management module may obtain the second storage path of the first hsp package from Table 3 based on the identifier of the first hsp package. The package management module may generate the installation information of the first application based on the first storage path of the installation package of the first application and the second storage path of the first hsp package.
[0256] In other possible implementations, the hsp package information that the first application depends on may include the hsp package identifier (e.g., the first hsp package) and the version number (e.g., the first version number) that the first application depends on. The package management module may obtain the second storage path of the first hsp package of the first version from Table 4 based on the identifier of the first hsp package and the first version number. The package management module may then generate the installation information of the first application based on the first storage path of the installation package of the first application and the second storage path of the first hsp package of the first version.
[0257] Optionally, the HSP package stored on the electronic device 100 can be updated. For example, if the HSP package is not used for a long time, it can be deleted. Then, before executing S904, the package management module can determine whether the HSP package that the first application depends on exists. If it does not exist, the package management module can download the HSP package that the first application depends on from the server 200. This can avoid the situation where the HSP package that the first application depends on is deleted and the first application fails to start.
[0258] S905. The package management module sends the installation information of the first application to the application startup module.
[0259] After the package management module obtains the installation information of the first application, the package management module sends the installation information of the first application to the application startup module, so that the application startup module can start the first application based on the installation information of the first application.
[0260] S906: The application startup module creates a process sandbox for the first application.
[0261] S907: The application startup module stores the installation information of the first application in the process sandbox of the first application.
[0262] Before the first application is started, the application startup module needs to create a process sandbox for the first application. The installation information of the first application sent by the package management module is stored / mounted in the process sandbox of the first application. In this way, only the first application can access the information in the process sandbox of the first application, and other application processes cannot access the information in the process sandbox of the first application, thereby ensuring the security of process operation.
[0263] S908: The application startup module sends the process ID of the first application to the package management module.
[0264] S909: The package management module sends the process ID of the first application to the application startup module.
[0265] After creating the process sandbox of the first application, the application startup module can obtain the process ID of the first application and send the process ID of the first application to the package management module. After receiving the process ID of the first application sent by the application startup module, the package management module sends the process ID of the first application to the application startup module. In this way, the application startup module can inform the package management module and the application startup module that the first application has been started.
[0266] S910. The application startup module obtains the first storage path of the installation package of the first application from the installation information of the first application, obtains the installation package of the first application based on the first storage path, and obtains the API of the first hsp package that the first application depends on or the API of the first version of the first hsp package from the installation package of the first application.
[0267] The API of the first hsp package may include one or more APIs. The electronic device may export the first hsp package based on the API of the first hsp package, and then load and run the first hsp package.
[0268] S911. The application startup module runs the first application in the process sandbox of the first application based on the API of the first hsp package or the API of the first version of the first hsp package and the installation information of the first application.
[0269] After the first application is started, if the first application needs to use the hsp package, the application startup module can obtain the first storage path of the installation package of the first application from the installation information of the first application, and obtain the installation package of the first application based on the first storage path. The application startup module can obtain the API of the first hsp package that the first application depends on or the API of the first version of the first hsp package that the first application depends on from the installation package of the first application. The application startup module then runs the first application based on the API of the first hsp package and the second storage path of the first hsp package in the process sandbox of the first application and the first storage path of the installation package of the first application in the process sandbox of the first application. Or the application startup module runs the first application based on the API of the first hsp package of the first version and the second storage path of the first hsp package of the first version in the process sandbox of the first application and the first storage path of the installation package of the first application in the process sandbox of the first application. In this way, the preset function of the hsp package is realized through the API of the hsp package recorded in the installation package of the first application.
[0270] Next, how the application startup module runs the first application is described.
[0271] Fig.10 A schematic diagram showing an application startup module running a first application.
[0272] S1001. The package management module obtains a first data packet based on installation information of a first application.
[0273] S1002: The packet management module sends the first data packet to the application startup module.
[0274] Exemplarily, the installation information of the first application may include a first storage path of the installation package of the first application.
[0275] Exemplarily, the installation information of the first application may include a first storage path of the installation package of the first application and a second storage path of a first hsp package that the first application depends on.
[0276] Exemplarily, the installation information of the first application may also include a first storage path of the installation package of the first application and a second storage path of a first version of a first hsp package that the first application depends on.
[0277] The package management module can obtain the first data packet based on the installation information of the first application, and send the installation information of the first application to the application startup module through the first data packet.
[0278] The first data packet may include a first field, and the value of the first field is used to indicate whether the first application depends on the hsp package.
[0279] Exemplarily, the first field may be the HspList.totalLength field. If the value of the HspList.totalLength field is 1, it indicates that the first application depends on the HSP package. If the value of the HspList.totalLength field is 0, it indicates that the first application does not depend on the HSP package.
[0280] In the case where the first application depends on an HSP package, the first data packet can identify a unique HSP package through multiple fields. Because the first application may depend on multiple HSP packages, different HSP packages can be identified by the values of the multiple fields.
[0281] For example, the multiple fields used to uniquely identify an hsp package may be a bundles field, a modules field, and a versions field. Among them, the bundles field is used to fill in the name of the hsp package, the modules field is used to fill in the module name to which the hsp package belongs, and the versions field is used to fill in the version number of the hsp package. Optionally, the modules field may not be included, or the modules field and the versions field may not be included. Each hsp package can be uniquely identified by the values of the bundles field, the modules field, and the versions field, and then the storage path of each hsp package can be determined.
[0282] Optionally, the installation information of the first application can also be sent to the application startup module through multiple different data packets. Exemplarily, the first storage path of the installation package of the first application is sent to the application startup module through a data packet. The storage paths of one or more hsp packages that the first application depends on can be sent to the application startup module through multiple data packets respectively, and the storage paths of one or more hsp packages that the first application depends on can also be sent to the application startup module through a data packet, which is not limited in this application.
[0283] The following embodiments of the present application are described by taking a data packet (eg, a first data packet) as an example.
[0284] Optionally, the packet management module may send the one or more data packets to the application startup module through a socket channel.
[0285] S1003: The application startup module determines from the first field in the first data packet whether the first application depends on the hsp packet.
[0286] Optionally, the first field may be an HspList.totalLength field. If the value of the HspList.totalLength field is 1, it indicates that the first application depends on an HSP package, and S1010-S1015 are executed.
[0287] If the value of the HspList.totalLength field is 0, it means that the first application has no dependent hsp package, and S1004-S1009 is executed.
[0288] S1004: The application startup module obtains a first storage path of an installation package of a first application from a first data packet.
[0289] S1005: The application startup module creates a first temporary storage area, and stores a first storage path of the installation package of the first application in the first temporary storage area.
[0290] S1006: The application startup module calls the DoStartAPP() method to create a process for the first application.
[0291] Optionally, the process of creating the first application is not limited to calling the DoStartAPP() method. The application startup module can also create the process of the first application through other methods, which is not limited in this application.
[0292] S1007: The application startup module calls the SetAppSandbox() method to create a process sandbox for the first application.
[0293] Optionally, the process sandbox of the first application is not limited to being created by calling the SetAppSandbox() method. The application startup module may also create the process sandbox of the first application by other methods, and this application does not limit this.
[0294] S1008. The application startup module calls SetAppSandbox() to mount the first storage path of the installation package of the first application into the process sandbox of the first application.
[0295] S1009: The application startup module clears and releases the first temporary storage area.
[0296] In this way, after the application startup module mounts the first storage path of the installation package of the first application into the process sandbox of the first application, the data in the first temporary storage area can be cleared and the first temporary storage area can be released to save storage space of the electronic device 100.
[0297] If the value of the HspList.totalLength field is 1, it means that the first application has a dependent hsp package, and S1010-S1015 can be executed.
[0298] S1010. The application startup module obtains a first storage path of an installation package of a first application and a second storage path of a first hsp package that the first application depends on from a first data packet.
[0299] S1011. The application startup module creates a first temporary storage area and a second temporary storage area, stores a first storage path of the installation package of the first application in the first temporary storage area, and stores a second storage path of the first hsp package that the first application depends on in the second temporary storage area.
[0300] Optionally, the application startup module may not create a second temporary storage area, and store the first storage path of the installation package of the first application and the second storage path of the first hsp package that the first application depends on in the first temporary storage area. This application does not limit this.
[0301] S1012. Call the DoStartAPP() method to create a process for the first application.
[0302] Optionally, the process of creating the first application is not limited to calling the DoStartAPP() method. The application startup module can also create the process of the first application through other methods, which is not limited in this application.
[0303] S1013. Call the SetAppSandbox() method to create a process sandbox for the first application.
[0304] Optionally, the process sandbox of the first application is not limited to being created by calling the SetAppSandbox() method. The application startup module may also create the process sandbox of the first application by other methods, and this application does not limit this.
[0305] S1014. Call SetAppSandbox() to mount the first storage path of the installation package of the first application and the second storage path of the first hsp package that the first application depends on into the process sandbox of the first application.
[0306] S1015: Clear and release the first temporary storage area and the second temporary storage area.
[0307] In this way, after the application startup module mounts the first storage path of the installation package of the first application and the second storage path of the first hsp package that the first application depends on into the process sandbox of the first application, the data in the first temporary storage area and the second temporary storage area can be cleared, and the first temporary storage area and the second temporary storage area can be released, saving storage space of the electronic device 100.
[0308] refer to Fig.11 , Fig.11 A schematic structural diagram of an electronic device is shown.
[0309] The electronic device 100 may be a mobile phone, a tablet computer, a desktop computer, a laptop computer, a handheld computer, a notebook computer, an ultra-mobile personal computer (UMPC), a netbook, a cellular phone, a personal digital assistant (PDA), an augmented reality (AR) device, a virtual reality (VR) device, an artificial intelligence (AI) device, a wearable device, an in-vehicle device, a smart home device and / or a smart city device. The embodiments of the present application do not impose any special restrictions on the specific type of the electronic device.
[0310] The electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.
[0311] It is to be understood that the structure illustrated in the embodiment of the present invention does not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may include more or fewer components than shown in the figure, or combine some components, or separate some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.
[0312] The processor 110 may include one or more processing units, for example, the processor 110 may include an application processor (AP), a modem processor, a graphics processor (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Different processing units may be independent devices or integrated into one or more processors.
[0313] The controller can generate operation control signals according to the instruction operation code and timing signal to complete the control of instruction fetching and execution.
[0314] The processor 110 may also be provided with a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may store instructions or data that the processor 110 has just used or cyclically used. If the processor 110 needs to use the instruction or data again, it may be directly called from the memory. This avoids repeated access, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.
[0315] In some embodiments, the processor 110 may include one or more interfaces. The interface may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface, etc.
[0316] The I2C interface is a bidirectional synchronous serial bus, including a serial data line (SDA) and a serial clock line (SCL). In some embodiments, the processor 110 may include multiple groups of I2C buses. The processor 110 may be coupled to the touch sensor 180K, the charger, the flash, the camera 193, etc. through different I2C bus interfaces. For example: the processor 110 may be coupled to the touch sensor 180K through the I2C interface, so that the processor 110 communicates with the touch sensor 180K through the I2C bus interface, thereby realizing the touch function of the electronic device 100.
[0317] The I2S interface can be used for audio communication. In some embodiments, the processor 110 can include multiple I2S buses. The processor 110 can be coupled to the audio module 170 via the I2S bus to achieve communication between the processor 110 and the audio module 170. In some embodiments, the audio module 170 can transmit an audio signal to the wireless communication module 160 via the I2S interface to achieve the function of answering a call through a Bluetooth headset.
[0318] The PCM interface can also be used for audio communication, sampling, quantizing and encoding analog signals. In some embodiments, the audio module 170 and the wireless communication module 160 can be coupled via a PCM bus interface. In some embodiments, the audio module 170 can also transmit audio signals to the wireless communication module 160 via the PCM interface to realize the function of answering calls via a Bluetooth headset. Both the I2S interface and the PCM interface can be used for audio communication.
[0319] The UART interface is a universal serial data bus for asynchronous communication. The bus can be a bidirectional communication bus. It converts the data to be transmitted between serial communication and parallel communication. In some embodiments, the UART interface is generally used to connect the processor 110 and the wireless communication module 160. For example, the processor 110 communicates with the Bluetooth module in the wireless communication module 160 through the UART interface to implement the Bluetooth function. In some embodiments, the audio module 170 can transmit an audio signal to the wireless communication module 160 through the UART interface to implement the function of playing music through a Bluetooth headset.
[0320] The MIPI interface can be used to connect the processor 110 with peripheral devices such as the display screen 194 and the camera 193. The MIPI interface includes a camera serial interface (CSI), a display serial interface (DSI), etc. In some embodiments, the processor 110 and the camera 193 communicate via the CSI interface to implement the shooting function of the electronic device 100. The processor 110 and the display screen 194 communicate via the DSI interface to implement the display function of the electronic device 100.
[0321] The GPIO interface can be configured by software. The GPIO interface can be configured as a control signal or as a data signal. In some embodiments, the GPIO interface can be used to connect the processor 110 with the camera 193, the display 194, the wireless communication module 160, the audio module 170, the sensor module 180, etc. The GPIO interface can also be configured as an I2C interface, an I2S interface, a UART interface, a MIPI interface, etc.
[0322] The USB interface 130 is an interface that complies with the USB standard specification, and specifically can be a Mini USB interface, a Micro USB interface, a USB Type C interface, etc. The USB interface 130 can be used to connect a charger to charge the electronic device 100, and can also be used to transfer data between the electronic device 100 and a peripheral device. It can also be used to connect headphones to play audio through the headphones. The interface can also be used to connect other electronic devices, such as AR devices, etc.
[0323] It is understandable that the interface connection relationship between the modules illustrated in the embodiment of the present invention is only a schematic illustration and does not constitute a structural limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may also adopt different interface connection methods in the above embodiments, or a combination of multiple interface connection methods.
[0324] The charging management module 140 is used to receive charging input from a charger. The charger may be a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 140 may receive charging input from a wired charger through the USB interface 130. In some wireless charging embodiments, the charging management module 140 may receive wireless charging input through a wireless charging coil of the electronic device 100. While the charging management module 140 is charging the battery 142, it may also power the electronic device through the power management module 141.
[0325] The power management module 141 is used to connect the battery 142, the charging management module 140 and the processor 110. The power management module 141 receives input from the battery 142 and / or the charging management module 140, and supplies power to the processor 110, the internal memory 121, the display screen 194, the camera 193, and the wireless communication module 160. The power management module 141 can also be used to monitor parameters such as battery capacity, battery cycle number, battery health status (leakage, impedance), etc. In some other embodiments, the power management module 141 can also be set in the processor 110. In other embodiments, the power management module 141 and the charging management module 140 can also be set in the same device.
[0326] The wireless communication function of the electronic device 100 can be implemented through the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor and the baseband processor.
[0327] Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in electronic device 100 can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve the utilization of antennas. For example, antenna 1 can be reused as a diversity antenna for a wireless local area network. In some other embodiments, the antenna can be used in combination with a tuning switch.
[0328] The mobile communication module 150 can provide solutions for wireless communications including 2G / 3G / 4G / 5G, etc., applied to the electronic device 100. The mobile communication module 150 may include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves from the antenna 1, and filter, amplify, and process the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modulation and demodulation processor, and convert it into electromagnetic waves for radiation through the antenna 1. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the processor 110. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the same device as at least some of the modules of the processor 110.
[0329] The modem processor may include a modulator and a demodulator. Among them, the modulator is used to modulate the low-frequency baseband signal to be sent into a medium-high frequency signal. The demodulator is used to demodulate the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low-frequency baseband signal to the baseband processor for processing. After the low-frequency baseband signal is processed by the baseband processor, it is passed to the application processor. The application processor outputs a sound signal through an audio device (not limited to a speaker 170A, a receiver 170B, etc.), or displays an image or video through a display screen 194. In some embodiments, the modem processor may be an independent device. In other embodiments, the modem processor may be independent of the processor 110 and be set in the same device as the mobile communication module 150 or other functional modules.
[0330] The wireless communication module 160 can provide wireless communication solutions including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR), etc., which are applied to the electronic device 100. The wireless communication module 160 can be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, modulates the frequency of the electromagnetic wave signal and performs filtering, and sends the processed signal to the processor 110. The wireless communication module 160 can also receive the signal to be sent from the processor 110, modulate the frequency of it, amplify it, and convert it into electromagnetic waves for radiation through the antenna 2.
[0331] In some embodiments, the antenna 1 of the electronic device 100 is coupled to the mobile communication module 150, and the antenna 2 is coupled to the wireless communication module 160, so that the electronic device 100 can communicate with the network and other devices through wireless communication technology. The wireless communication technology may include global system for mobile communications (GSM), general packet radio service (GPRS), code division multiple access (CDMA), wideband code division multiple access (WCDMA), time-division code division multiple access (TD-CDMA), long term evolution (LTE), BT, GNSS, WLAN, NFC, FM, and / or IR technology. The GNSS may include a global positioning system (GPS), a global navigation satellite system (GLONASS), a Beidou navigation satellite system (BDS), a quasi-zenith satellite system (QZSS) and / or a satellite based augmentation system (SBAS).
[0332] The electronic device 100 implements the display function through a GPU, a display screen 194, and an application processor. The GPU is a microprocessor for image processing, which connects the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 may include one or more GPUs that execute program instructions to generate or change display information.
[0333] The display screen 194 is used to display images, videos, etc. The display screen 194 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode or an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), Miniled, MicroLed, Micro-oLed, a quantum dot light-emitting diode (QLED), etc. In some embodiments, the electronic device 100 may include 1 or N display screens 194, where N is a positive integer greater than 1.
[0334] The electronic device 100 can realize the shooting function through ISP, camera 193, video codec, GPU, display screen 194 and application processor.
[0335] The ISP is used to process the data fed back by the camera 193. For example, when taking a photo, the shutter is opened, and the light is transmitted to the camera photosensitive element through the lens. The light signal is converted into an electrical signal, and the camera photosensitive element transmits the electrical signal to the ISP for processing and converts it into an image visible to the naked eye. The ISP can also perform algorithm optimization on the noise and brightness of the image. The ISP can also optimize the exposure, color temperature and other parameters of the shooting scene. In some embodiments, the ISP can be set in the camera 193.
[0336] The camera 193 is used to capture still images or videos. The object generates an optical image through the lens and projects it onto the photosensitive element. The photosensitive element can be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the optical signal into an electrical signal, and then passes the electrical signal to the ISP to be converted into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into an image signal in a standard RGB, YUV or other format. In some embodiments, the electronic device 100 may include 1 or N cameras 193, where N is a positive integer greater than 1.
[0337] The digital signal processor is used to process digital signals, and can process not only digital image signals but also other digital signals. For example, when the electronic device 100 is selecting a frequency point, the digital signal processor is used to perform Fourier transform on the frequency point energy.
[0338] Video codecs are used to compress or decompress digital videos. The electronic device 100 may support one or more video codecs. Thus, the electronic device 100 may play or record videos in a variety of coding formats, such as Moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, MPEG4, etc.
[0339] NPU is a neural network (NN) computing processor. By drawing on the structure of biological neural networks, such as the transmission mode between neurons in the human brain, it can quickly process input information and can also continuously self-learn. Through NPU, applications such as intelligent cognition of electronic device 100 can be realized, such as image recognition, face recognition, voice recognition, text understanding, etc.
[0340] The internal memory 121 may include one or more random access memories (RAM) and one or more non-volatile memories (NVM).
[0341] Random access memory may include static random-access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM, for example, the fifth generation DDR SDRAM is generally referred to as DDR5 SDRAM), etc.; non-volatile memory may include disk storage devices and flash memory.
[0342] Flash memory can be divided into NOR FLASH, NAND FLASH, 3D NAND FLASH, etc. according to the operating principle; single-level cell (SLC), multi-level cell (MLC), triple-level cell (TLC), quad-level cell (QLC), etc. according to the storage unit potential level; universal flash storage (UFS), embedded multi media card (eMMC), etc. according to the storage specification.
[0343] The random access memory can be directly read and written by the processor 110, and can be used to store executable programs (such as machine instructions) of the operating system or other running programs, and can also be used to store user and application data.
[0344] The non-volatile memory may also store executable programs and user and application data, etc., and may be loaded into the random access memory in advance for direct reading and writing by the processor 110 .
[0345] The external memory interface 120 can be used to connect to an external non-volatile memory to expand the storage capacity of the electronic device 100. The external non-volatile memory communicates with the processor 110 through the external memory interface 120 to implement a data storage function. For example, files such as music and videos are stored in the external non-volatile memory.
[0346] The electronic device 100 can implement audio functions such as music playing and recording through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the headphone jack 170D, and the application processor.
[0347] The audio module 170 is used to convert digital audio information into analog audio signal output, and is also used to convert analog audio input into digital audio signals. The audio module 170 can also be used to encode and decode audio signals. In some embodiments, the audio module 170 can be arranged in the processor 110, or some functional modules of the audio module 170 can be arranged in the processor 110.
[0348] The speaker 170A, also called a "speaker", is used to convert an audio electrical signal into a sound signal. The electronic device 100 can listen to music or listen to a hands-free call through the speaker 170A.
[0349] The receiver 170B, also called a "earpiece", is used to convert audio electrical signals into sound signals. When the electronic device 100 receives a call or voice message, the voice can be received by placing the receiver 170B close to the human ear.
[0350] Microphone 170C, also called "microphone" or "microphone", is used to convert sound signals into electrical signals. When making a call or sending a voice message, the user can speak by putting their mouth close to microphone 170C to input the sound signal into microphone 170C. The electronic device 100 can be provided with at least one microphone 170C. In other embodiments, the electronic device 100 can be provided with two microphones 170C, which can not only collect sound signals but also realize noise reduction function. In other embodiments, the electronic device 100 can also be provided with three, four or more microphones 170C to collect sound signals, reduce noise, identify the sound source, realize directional recording function, etc.
[0351] The earphone interface 170D is used to connect a wired earphone and can be a USB interface 130 or a 3.5 mm open mobile terminal platform (OMTP) standard interface or a cellular telecommunications industry association of the USA (CTIA) standard interface.
[0352] The pressure sensor 180A is used to sense the pressure signal and can convert the pressure signal into an electrical signal. In some embodiments, the pressure sensor 180A can be set on the display screen 194. There are many types of pressure sensors 180A, such as resistive pressure sensors, inductive pressure sensors, capacitive pressure sensors, etc. The capacitive pressure sensor can be a parallel plate including at least two conductive materials. When a force acts on the pressure sensor 180A, the capacitance between the electrodes changes. The electronic device 100 determines the intensity of the pressure according to the change in capacitance. When a touch operation acts on the display screen 194, the electronic device 100 detects the touch operation intensity according to the pressure sensor 180A. The electronic device 100 can also calculate the touch position according to the detection signal of the pressure sensor 180A. In some embodiments, touch operations acting on the same touch position but with different touch operation intensities can correspond to different operation instructions. For example: when a touch operation with a touch operation intensity less than the first pressure threshold acts on the short message application icon, an instruction to view the short message is executed. When a touch operation with a touch operation intensity greater than or equal to the first pressure threshold acts on the short message application icon, an instruction to create a new short message is executed.
[0353] The gyro sensor 180B can be used to determine the motion posture of the electronic device 100. In some embodiments, the angular velocity of the electronic device 100 around three axes (e.g., x, y, and z axes) can be determined by the gyro sensor 180B. The gyro sensor 180B can be used for anti-shake shooting. For example, when the shutter is pressed, the gyro sensor 180B detects the angle of the electronic device 100 shaking, calculates the distance that the lens module needs to compensate based on the angle, and allows the lens to offset the shaking of the electronic device 100 through reverse movement to achieve anti-shake. The gyro sensor 180B can also be used for navigation and somatosensory game scenes.
[0354] The air pressure sensor 180C is used to measure air pressure. In some embodiments, the electronic device 100 calculates the altitude through the air pressure value measured by the air pressure sensor 180C to assist positioning and navigation.
[0355] The magnetic sensor 180D includes a Hall sensor. The electronic device 100 can use the magnetic sensor 180D to detect the opening and closing of the flip leather case. In some embodiments, when the electronic device 100 is a flip phone, the electronic device 100 can detect the opening and closing of the flip cover according to the magnetic sensor 180D. Then, according to the detected opening and closing state of the leather case or the opening and closing state of the flip cover, the flip cover can be automatically unlocked.
[0356] The acceleration sensor 180E can detect the magnitude of the acceleration of the electronic device 100 in all directions (generally three axes). When the electronic device 100 is stationary, the magnitude and direction of gravity can be detected. It can also be used to identify the posture of the electronic device and is applied to applications such as horizontal and vertical screen switching and pedometers.
[0357] The distance sensor 180F is used to measure the distance. The electronic device 100 can measure the distance by infrared or laser. In some embodiments, when shooting a scene, the electronic device 100 can use the distance sensor 180F to measure the distance to achieve fast focusing.
[0358] The proximity light sensor 180G may include, for example, a light emitting diode (LED) and a light detector, such as a photodiode. The light emitting diode may be an infrared light emitting diode. The electronic device 100 emits infrared light outward through the light emitting diode. The electronic device 100 uses a photodiode to detect infrared reflected light from nearby objects. When sufficient reflected light is detected, it can be determined that there is an object near the electronic device 100. When insufficient reflected light is detected, the electronic device 100 can determine that there is no object near the electronic device 100. The electronic device 100 can use the proximity light sensor 180G to detect that the user holds the electronic device 100 close to the ear to talk, so as to automatically turn off the screen to save power. The proximity light sensor 180G can also be used in leather case mode and pocket mode to automatically unlock and lock the screen.
[0359] The ambient light sensor 180L is used to sense the ambient light brightness. The electronic device 100 can adaptively adjust the brightness of the display screen 194 according to the perceived ambient light brightness. The ambient light sensor 180L can also be used to automatically adjust the white balance when taking pictures. The ambient light sensor 180L can also cooperate with the proximity light sensor 180G to detect whether the electronic device 100 is in a pocket to prevent accidental touches.
[0360] The fingerprint sensor 180H is used to collect fingerprints. The electronic device 100 can use the collected fingerprint characteristics to implement fingerprint unlocking, access application locks, fingerprint photography, fingerprint call answering, etc.
[0361] The temperature sensor 180J is used to detect temperature. In some embodiments, the electronic device 100 uses the temperature detected by the temperature sensor 180J to execute a temperature processing strategy. For example, when the temperature reported by the temperature sensor 180J exceeds a threshold, the electronic device 100 reduces the performance of a processor located near the temperature sensor 180J to reduce power consumption and implement thermal protection. In other embodiments, when the temperature is lower than another threshold, the electronic device 100 heats the battery 142 to avoid abnormal shutdown of the electronic device 100 due to low temperature. In other embodiments, when the temperature is lower than another threshold, the electronic device 100 performs a boost on the output voltage of the battery 142 to avoid abnormal shutdown caused by low temperature.
[0362] The touch sensor 180K is also called a "touch control device". The touch sensor 180K can be set on the display screen 194. The touch sensor 180K and the display screen 194 form a touch screen, also called a "touch control screen". The touch sensor 180K is used to detect touch operations acting on or near it. The touch sensor can pass the detected touch operation to the application processor to determine the type of touch event. Visual output related to the touch operation can be provided through the display screen 194. In other embodiments, the touch sensor 180K can also be set on the surface of the electronic device 100, which is different from the position of the display screen 194.
[0363] The bone conduction sensor 180M can obtain a vibration signal. In some embodiments, the bone conduction sensor 180M can obtain a vibration signal of a vibrating bone block of the vocal part of the human body. The bone conduction sensor 180M can also contact the human pulse to receive a blood pressure beat signal. In some embodiments, the bone conduction sensor 180M can also be set in an earphone and combined into a bone conduction earphone. The audio module 170 can parse out a voice signal based on the vibration signal of the vibrating bone block of the vocal part obtained by the bone conduction sensor 180M to realize a voice function. The application processor can parse the heart rate information based on the blood pressure beat signal obtained by the bone conduction sensor 180M to realize a heart rate detection function.
[0364] The key 190 includes a power key, a volume key, etc. The key 190 may be a mechanical key or a touch key. The electronic device 100 may receive key input and generate key signal input related to user settings and function control of the electronic device 100.
[0365] Motor 191 can generate vibration prompts. Motor 191 can be used for incoming call vibration prompts, and can also be used for touch vibration feedback. For example, touch operations acting on different applications (such as taking pictures, audio playback, etc.) can correspond to different vibration feedback effects. For touch operations acting on different areas of the display screen 194, motor 191 can also correspond to different vibration feedback effects. Different application scenarios (for example: time reminders, receiving messages, alarm clocks, games, etc.) can also correspond to different vibration feedback effects. The touch vibration feedback effect can also support customization.
[0366] Indicator 192 may be an indicator light, which may be used to indicate charging status, power changes, messages, missed calls, notifications, etc.
[0367] The SIM card interface 195 is used to connect a SIM card. The SIM card can be connected to and separated from the electronic device 100 by inserting it into the SIM card interface 195 or pulling it out from the SIM card interface 195. The electronic device 100 can support 1 or N SIM card interfaces, where N is a positive integer greater than 1. The SIM card interface 195 can support Nano SIM cards, Micro SIM cards, SIM cards, and the like. Multiple cards can be inserted into the same SIM card interface 195 at the same time. The types of the multiple cards can be the same or different. The SIM card interface 195 can also be compatible with different types of SIM cards. The SIM card interface 195 can also be compatible with external memory cards. The electronic device 100 interacts with the network through the SIM card to implement functions such as calls and data communications. In some embodiments, the electronic device 100 uses an eSIM, such as an embedded SIM card. The eSIM card can be embedded in the electronic device 100 and cannot be separated from the electronic device 100.
[0368] The software system of the electronic device 100 may adopt a layered architecture, an event-driven architecture, a micro-core architecture, a micro-service architecture, or a cloud architecture. In the embodiment of the present invention, the Android system of the layered architecture is taken as an example to exemplify the software structure of the electronic device 100.
[0369] Fig.12 1 is a software structure block diagram of the electronic device 100 according to an embodiment of the present invention.
[0370] The layered architecture divides the software into several layers, each with clear roles and division of labor. The layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into four layers, from top to bottom: the application layer, the application framework layer, the Android runtime and system library, and the kernel layer.
[0371] The application layer can include a series of application packages.
[0372] like Fig.12 As shown, the application package may include camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, short message and other applications.
[0373] The application framework layer provides an application programming interface (API) and a programming framework for the applications in the application layer. The application framework layer includes some predefined functions.
[0374] like Fig.12 As shown, the application framework layer may include a window manager, a content provider, a view system, a phone manager, a resource manager, a notification manager, and the like.
[0375] The window manager is used to manage window programs. The window manager can obtain the display screen size, determine whether there is a status bar, lock the screen, capture the screen, etc.
[0376] Content providers are used to store and retrieve data and make it accessible to applications. The data may include videos, images, audio, calls made and received, browsing history and bookmarks, phone books, etc.
[0377] The view system includes visual controls, such as controls for displaying text, controls for displaying images, etc. The view system can be used to build applications. A display interface can be composed of one or more views. For example, a display interface including a text notification icon can include a view for displaying text and a view for displaying images.
[0378] The phone manager is used to provide communication functions of the electronic device 100, such as management of call status (including connecting, hanging up, etc.).
[0379] The resource manager provides various resources for applications, such as localized strings, icons, images, layout files, video files, and so on.
[0380] The notification manager enables applications to display notification information in the status bar. It can be used to convey notification-type messages and can disappear automatically after a short stay without user interaction. For example, the notification manager is used to notify download completion, message reminders, etc. The notification manager can also be a notification that appears in the system top status bar in the form of a chart or scroll bar text, such as notifications of applications running in the background, or a notification that appears on the screen in the form of a dialog window. For example, a text message is displayed in the status bar, a prompt sound is emitted, an electronic device vibrates, an indicator light flashes, etc.
[0381] Android Runtime includes core libraries and virtual machines. Android runtime is responsible for scheduling and management of the Android system.
[0382] The core library consists of two parts: one part is the function that needs to be called by the Java language, and the other part is the Android core library.
[0383] The application layer and the application framework layer run in a virtual machine. The virtual machine executes the Java files of the application layer and the application framework layer as binary files. The virtual machine is used to perform functions such as object life cycle management, stack management, thread management, security and exception management, and garbage collection.
[0384] The system library may include multiple functional modules, such as surface manager, media library, 3D graphics processing library (such as OpenGL ES), 2D graphics engine (such as SGL), etc.
[0385] The surface manager is used to manage the display subsystem and provide the fusion of 2D and 3D layers for multiple applications.
[0386] The media library supports playback and recording of a variety of commonly used audio and video formats, as well as static image files, etc. The media library can support a variety of audio and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.
[0387] The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, compositing, and layer processing.
[0388] A 2D graphics engine is a drawing engine for 2D drawings.
[0389] The kernel layer is the layer between hardware and software. The kernel layer contains at least display driver, camera driver, audio driver, and sensor driver.
[0390] The various implementation modes of the present application can be combined arbitrarily to achieve different technical effects.
[0391] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from a website site, computer, server or data center to another website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line) or wireless (e.g., infrared, wireless, microwave, etc.) mode. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrated. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state disk (SSD)), etc.
[0392] Those skilled in the art can understand that to implement all or part of the processes in the above-mentioned embodiments, the processes can be completed by computer programs to instruct related hardware, and the programs can be stored in computer-readable storage media. When the programs are executed, they can include the processes of the above-mentioned method embodiments. The aforementioned storage media include: ROM or random access memory RAM, magnetic disk or optical disk and other media that can store program codes.
[0393] The above description is only an embodiment of the technical solution of the present invention, and is not intended to limit the protection scope of the present invention. Any modification, equivalent replacement, improvement, etc. made according to the disclosure of the present invention shall be included in the protection scope of the present invention.
Claims
1. An application running method, characterized in that: The method comprises: The electronic device, in response to a user opening operation on a first application, obtains a first storage path of an installation package of the first application and a second storage path of a shared implementation package on which the first application depends; wherein the electronic device is installed with the first application and the shared implementation package, wherein the shared implementation package is used to implement a preset function, and the first storage path is different from the second storage path; The electronic device obtains the installation package of the first application based on the first storage path, where the installation package of the first application is configured with reference information to the shared implementation package; The electronic device runs the first application based on the first storage path, the reference information and the second storage path.
2. The method according to claim 1, characterized in that The method further comprises: The electronic device, in response to the user's opening operation of the second application, obtains a third storage path of the installation package of the second application and the second storage path of the shared implementation package on which the second application depends; wherein the electronic device is installed with the second application and the shared implementation package, and the third storage path is different from the second storage path; The electronic device obtains the installation package of the second application based on the third storage path, where the installation package of the second application is configured with reference information to the shared implementation package; The electronic device runs the second application based on the third storage path, the reference information and the second storage path.
3. The method according to claim 1 or 2, characterized in that: Before the electronic device runs the first application based on the first storage path, the reference information and the second storage path, the method further includes: The electronic device loads the first storage path and the second storage path into a process sandbox of the first application; The electronic device runs the first application based on the first storage path, the reference information and the second storage path, specifically including: The electronic device runs the first application in a process sandbox of the first application based on the first storage path, the reference information and the second storage path.
4. The method according to any one of claims 1 to 3, characterized in that: Before the electronic device responds to the user's opening operation on the first application, the method further includes: The electronic device receives and responds to a third user operation, downloads and installs an installation package of the first application, and stores the installation package of the first application in the first storage area, the storage path of the installation package of the first application stored in the first storage area is the first storage path, the installation package of the first application includes a shared interface package, and the shared interface package includes an identifier of the shared implementation package that the first application depends on; When the electronic device determines that the shared implementation package is not installed on the electronic device based on the identifier of the shared implementation package, the electronic device downloads the shared implementation package; The electronic device installs the shared implementation package and stores the shared implementation package in the second storage area. The storage path of the shared implementation package stored in the second storage area is the second storage path.
5. The method according to claim 4, characterized in that The method further comprises: When the electronic device determines that the shared implementation package is installed on the electronic device based on the identifier of the shared implementation package, the electronic device acquires the second storage path of the shared implementation package based on the identifier of the shared implementation package.
6. The method according to claim 4 or 5, characterized in that: The shared interface package also includes the reference information of the shared implementation package; Before the electronic device runs the first application based on the first storage path, the reference information and the second storage path, the method further includes: The electronic device obtains the shared interface package from the installation package of the first application; The electronic device obtains reference information of the shared implementation package from the shared interface package.
7. The method according to any one of claims 4 to 6, characterized in that: After the electronic device acquires the second storage path of the sharing implementation package and before the electronic device responds to the user's opening operation on the first application, the method further includes: The electronic device obtains the installation information of the first application based on the first storage path of the installation package of the first application and the second storage path of the shared implementation package on which the first application depends; The electronic device, in response to a user opening operation of a first application, obtains a first storage path of an installation package of the first application and a second storage path of a shared implementation package that the first application depends on, specifically including: The electronic device obtains installation information of the first application in response to the user opening the first application; The electronic device obtains the first storage path of the installation package of the first application and the second storage path of the shared implementation package that the first application depends on from the installation information of the first application.
8. The method according to any one of claims 4 to 6, characterized in that: The electronic device, in response to a user opening operation of a first application, obtains a first storage path of an installation package of the first application and a second storage path of a shared implementation package that the first application depends on, specifically including: In response to the user opening the first application, the electronic device acquires the first storage path of the installation package of the first application based on the identifier of the first application; The electronic device obtains the installation package of the first application based on the first storage path; The electronic device obtains, from the installation package of the first application, an identifier of the shared implementation package on which the first application depends; The electronic device acquires the second storage path of the sharing implementation package based on the identifier of the sharing implementation package.
9. The method according to any one of claims 1 to 8, characterized in that: After the electronic device runs the first application based on the first storage path, the reference information and the second storage path, the method further includes: When the shared implementation package is not used within a first period of time, the electronic device uninstalls the shared implementation package.
10. The method according to claim 4 or 5, characterized in that: The electronic device installing the shared implementation package specifically includes: When the electronic device determines that the installation package of the first application includes the shared interface package, the electronic device obtains, from the shared interface package, an identifier and a first version number of the shared implementation package on which the first application depends; When the electronic device determines that the first version of the shared implementation package is not stored on the electronic device based on the identifier of the shared implementation package and the first version number, the electronic device downloads the first version of the shared implementation package; The electronic device installs the shared implementation package of the first version and stores the shared implementation package of the first version in the second storage area, and the storage path of the shared implementation package of the first version stored in the second storage area is the second storage path.
11. The method according to claim 10, characterized in that The electronic device downloading the shared implementation package of the first version specifically includes: The electronic device sends the identifier of the shared implementation package and the first version number to a server; The electronic device receives the shared implementation package of the first version sent by the server.
12. The method according to any one of claims 1 to 11, characterized in that: The preset functions include any one of the following: login function, payment function, map function, navigation function, networking function, advertising display function, data storage function, image recognition function, connection function, screen projection function, communication function, camera function, multimedia function, device virtualization function, and device security function.
13. An application running method, characterized in that: The method comprises: In response to a user opening operation on a first application, the electronic device obtains a storage path of a shared implementation package that the first application depends on, wherein the electronic device has the first application and the shared implementation package installed; The electronic device loads the shared implementation package into the process sandbox of the first application; The electronic device displays a user interface of a first application; In response to a user clicking operation on the user interface, the electronic device implements a preset function of the clicking operation based on the shared implementation package; Among them, the preset functions include any one of the following: login function, payment function, map function, navigation function, networking function, advertising display function, data storage function, image recognition function, connection function, screen projection function, communication function, camera function, multimedia function, device virtualization function, and device security function.
14. The method according to claim 13, characterized in that Before responding to the user's opening operation on the first application, the method further includes: The electronic device receives and responds to an operation by a user to download the first application, downloads and installs an installation package of the first application, and stores the installation package of the first application in a first storage area; The electronic device obtains a shared interface package from the installation package of the first application, and obtains an identifier of the shared implementation package from the shared interface package; When the electronic device determines that the sharing implementation package is not stored on the electronic device based on the identifier of the sharing implementation package, the electronic device downloads the sharing implementation package; The electronic device installs the shared implementation package and stores the shared implementation package in the second storage area; The electronic device acquires a storage path of the shared implementation package based on the shared implementation package stored in the second storage area.
15. The method according to claim 14, characterized in that The method further comprises: When the electronic device determines that the shared implementation package is stored in the second storage area on the electronic device based on the identifier of the shared implementation package, the electronic device obtains the storage path of the shared implementation package based on the shared implementation package stored in the second storage area.
16. The method according to claim 14 or 15, characterized in that The electronic device implements the preset function of the click operation based on the shared implementation package, specifically including: The electronic device obtains the shared interface package from the installation package of the first application; The electronic device obtains reference information of the shared implementation package from the shared interface package; The electronic device implements a preset function of the click operation based on the reference information of the shared implementation package and the shared implementation package.
17. An electronic device, characterized in that: The electronic device includes a processor and a memory; the memory is coupled to the processor, the memory is used to store computer program code, the computer program code includes computer instructions, and the processor calls the computer instructions to execute the method described in any one of claims 1-12 or 13-16 above.
18. A computer-readable storage medium, characterized in that: Used to store computer instructions, when the computer instructions are executed on an electronic device, the electronic device executes the method described in any one of claims 1-12 or 13-16.
Citation Information
Cited By
Application running method, electronic device and storage medium
EP4650947A1
