Dual application creation method, dual application starting method, device, and medium
By generating identifiers and resource paths for cloned applications and creating cloned applications within the main application package information, the problem of relying on system cloned users in existing technologies is solved, enabling lightweight installation and independent operation, and improving user experience.
Patent Information
- Application Number
- PCT/CN2025/097809
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2024-07-19
- Filing Date
- 2025-05-28
- Publication Date
- 2026-01-22
AI Technical Summary
The existing app cloning function relies on the system's clone user function, which consumes resources and can only enable two instances of the app, resulting in a poor user experience. Furthermore, the function is complex to implement and cannot meet users' needs to create multiple cloned apps.
By generating application identifiers and resource paths for clone applications, clone applications can be created directly within the main application package information, eliminating the dependency on system sub-users and allowing clone applications to run independently of the main application using an independent runtime environment (such as a sandbox path).
It achieves lightweight installation, simplifies the installation process, saves system resources, improves user experience, and makes cloned applications independent of the main application. They will only be uninstalled if the user actively uninstalls them, thus meeting the needs of multiple cloned applications.
Smart Images

Figure CN2025097809_22012026_PF_FP_ABST
Abstract
Description
Methods for creating and launching cloned applications, devices and media.
[0001] This application claims priority to Chinese Patent Application No. 202410981472.3, filed on July 19, 2024, entitled "Method for Creating a Cloned App, Method for Launching a Cloned App, Device and Medium", the entire contents of which are incorporated herein by reference. Technical Field
[0002] This application relates to the field of software technology, and in particular to a method for creating a cloned application, a method for launching a cloned application, a device, and a medium. Background Technology
[0003] With the development of society, users have a strong demand for creating multiple clones of certain applications on their devices to log in to multiple accounts and meet different usage scenarios. Among these, the demand is strongest for social applications, where most users set up separate accounts for work and personal life.
[0004] Therefore, the "app cloning" function of existing application software has emerged. This function allows users to use multiple accounts online on the same terminal device without affecting each other, meeting the needs of most users to separate work and personal information. For example, a user can use one cloned app to log in to their work account, another to log in to their family account, and yet another to log in to their personal account on one phone, and they want all accounts to be online at the same time to avoid missing important messages.
[0005] The current "app cloning" feature primarily manages and runs cloned apps by creating a new system clone user. Cloned apps require a dedicated system clone user, consuming resources and only allowing for dual-opening of apps. Furthermore, it necessitates establishing cross-user access and navigation channels between apps, making the feature complex to implement. In addition, cloned apps created in this way are closely linked to the main app; if the main app is uninstalled, the corresponding cloned app is also uninstalled, resulting in a poor user experience. Summary of the Invention
[0006] Some embodiments of this application provide a method for creating a cloned application, a method for launching a cloned application, a device, and a medium. The following describes this application from multiple aspects, and the embodiments and beneficial effects of the following aspects can be referred to each other.
[0007] In a first aspect, embodiments of this application provide a method for creating cloned applications, applied to electronic devices, the method including:
[0008] In response to a user's request to create a clone of the main application, determine the main application corresponding to the clone creation request;
[0009] Based on the application configuration information corresponding to the main application, clone application information is generated. This clone application information includes the first application identifier and the first resource path of the clone application. The first application identifier is used to create the corresponding clone application process when the clone application is launched. The first resource path is different from the second resource path of the main application.
[0010] Add clone application information to the application package information corresponding to the main application, and create a clone application based on the clone creation request.
[0011] According to the embodiments of this application, after receiving a user's request to create a clone of the main application, the electronic device can directly generate clone application information based on the application configuration information corresponding to the main application, and add it to the application package information corresponding to the main application, thus achieving lightweight installation of the clone application. This clone application creation method does not require the creation of a specific system sub-user, does not rely on a multi-user mechanism, and can directly create multiple clone applications according to user needs, breaking the application dual-opening restriction, thereby satisfying the user's demand to create multiple application clones. Since this method removes the dependence on sub-users, the multiple applications run under the same system user, so that the interaction between the main application and other applications and the clone application does not require cross-user access, thus eliminating the need to establish cross-user access capabilities, making the implementation solution simple.
[0012] Furthermore, this method of creating cloned applications generates cloned application information directly based on the application's configuration information and performs a lightweight installation of the cloned application. It eliminates the need to install multiple installation packages, making installation simple, highly versatile, and resource-efficient with minimal impact on system performance. Moreover, cloned applications created using this method use different resource paths (e.g., sandbox paths) than the main application, allowing the cloned application process to run in an independent runtime environment. This ensures that the main application and cloned applications are independent and unrelated. In other words, cloned applications function like regular applications; they are only uninstalled when the user actively uninstalls them. Uninstalling the main application will not uninstall the cloned application, improving user convenience and enhancing the user experience.
[0013] In some implementations, based on the application configuration information corresponding to the main application, clone application information is generated, including:
[0014] Based on the application configuration information, determine the application package name corresponding to the main application;
[0015] Based on the application configuration information, configure the first application identifier corresponding to the clone application;
[0016] Based on the application package name and the first application identifier, create the first resource path of the clone application;
[0017] The first resource path is used to store the files corresponding to the clone application, and to build the runtime environment of the clone application in conjunction with the installation package of the main application when the clone application process is running.
[0018] According to the embodiments of this application, the resource path (sandbox path) can be used to store files belonging to the user or application generated during application use. The resource path (sandbox path) does not include the application's installation package. For an application, there is generally only one installation package. It should be understood that the method provided in this application will not store more installation packages in the electronic device's memory due to the creation of clone applications. The relevant resources of the installation package are loaded into the corresponding application process only when the main application or clone application is running. When the main application is uninstalled, the installation package of the clone application will still be retained because there are still clone applications, unless the main application and all clone applications are uninstalled. By sharing an installation package and the same application package name with the main application, and by configuring an application identifier to distinguish between clone applications and the main application, the electronic device enables the created clone applications to interact normally with other applications, making clone applications equivalent to ordinary applications.
[0019] In some implementations, based on the application configuration information corresponding to the main application, clone application information is generated, including:
[0020] If the main application supports the application cloning function, the clone application information is generated based on the application configuration information of the main application.
[0021] In some embodiments, the method further includes:
[0022] Output a notification message indicating that the cloned application has been installed. This notification message is used to instruct the cloned application's icon to be displayed on the desktop.
[0023] According to the embodiments of this application, after the cloned application is installed on the electronic device, a desktop event to generate the application icon of the cloned application can be triggered so that the application icon of the cloned application corresponding to the main application can be displayed on the desktop of the electronic device, which facilitates the user's use and improves the user experience.
[0024] In some implementations, this method can be performed by a package management service.
[0025] Secondly, embodiments of this application provide a method for launching cloned applications, applied to electronic devices, the method including:
[0026] In response to a user's request to launch a cloned application, the cloned application information is obtained. The cloned application information includes a first application identifier and a first resource path of the cloned application. The first resource path is different from the second resource path of the main application corresponding to the cloned application.
[0027] Based on the first application identifier, a clone application process corresponding to the clone application is created;
[0028] Based on this first resource path, when running the cloned application process, the installation package of the main application is used to build the runtime environment of the cloned application so that the cloned application process can run in the runtime environment.
[0029] According to the embodiments of this application, after receiving a user's request to launch a cloned application, the electronic device can incubate a corresponding cloned application process based on the application identifier of the cloned application. Furthermore, based on the resource path of the cloned application (e.g., sandbox path) and the installation package of the main application, it can create an independent runtime environment (e.g., mounting an independent sandbox for the cloned application) for running the cloned application process. This allows the cloned application process to run in an independent runtime environment different from the main application process, making the main application and the cloned application independent and unrelated to each other. In other words, the cloned application is treated like a regular application; it will only be uninstalled if the user actively uninstalls it. Uninstalling the main application will not uninstall the cloned application, making it more convenient for users and improving the user experience.
[0030] In some implementations, in response to a user's request to launch a cloned application, information about the cloned application is obtained, including:
[0031] In response to a user's launch request for a cloned application, determine the first application identifier of the cloned application corresponding to the launch request;
[0032] The clone application information can be obtained by querying the clone application based on the first application identifier.
[0033] According to the embodiments of this application, after an electronic device receives a user's request to launch a cloned application, it can identify the application identifier in the launch request, thereby determining the cloned application to be launched, and querying the cloned application information based on the application identifier of the cloned application, and then launching the corresponding cloned application. The implementation method is simple, highly versatile, and has little impact on system performance.
[0034] In some embodiments, the method further includes:
[0035] When a cloned application process executes a process command that requires permission, it queries the permission management data for the first permission corresponding to the first application identifier based on the first application identifier.
[0036] If the query result for first-level permissions indicates that the cloned application process has the permission to execute commands of that process, then execute those commands.
[0037] In some embodiments, the method further includes:
[0038] When the main application process corresponding to the main application executes process commands, it determines the second application identifier of the main application, which is different from the first application identifier.
[0039] Based on the second application identifier, query the second permission corresponding to the second application identifier from the permission management data;
[0040] If the query result for the second permission indicates that the main application process has the permission to execute the command of that process, then execute the command of that process.
[0041] In some implementations, the second authority is different from the first authority.
[0042] According to the embodiments of this application, electronic devices can independently manage the permissions of the main application and clone applications through application identifiers. When the main application process or the clone application process requests a certain permission, the corresponding permission can be queried according to the application identifier, thereby realizing independent permission management of applications and further reducing the dependency between clone applications and the main application.
[0043] In some implementations, the step of obtaining the clone application information in response to a user's launch request for the clone application is performed by the runtime management service; the step of creating a clone application process corresponding to the clone application based on the first application identifier, and the step of building the runtime environment of the clone application in conjunction with the installation package of the main application when running the clone application process based on the first resource path, are performed by the process incubation module.
[0044] The beneficial effects that can be achieved in the second aspect can also be referred to the beneficial effects of any embodiment of the first aspect of this application, which will not be repeated here.
[0045] Thirdly, embodiments of this application provide a clone application creation device, disposed on an electronic device, the device including:
[0046] The determination module is used to determine the main application corresponding to the user's request to create a clone of the main application.
[0047] The generation module is used to generate clone application information for the clone application based on the application configuration information corresponding to the main application. The clone application information includes the first application identifier and the first resource path of the clone application. The first application identifier is used to create the corresponding clone application process when the clone application is started. The first resource path is different from the second resource path of the main application.
[0048] The first creation module is used to add clone application information to the application package information corresponding to the main application and create a clone application based on the clone creation request.
[0049] The beneficial effects that can be achieved in the third aspect can be referred to the beneficial effects of any embodiment of the first aspect of this application, and will not be repeated here.
[0050] Fourthly, embodiments of this application provide a clone application launching device, disposed on an electronic device, the device may include:
[0051] The acquisition module is used to respond to the user's launch request for the cloned application and acquire the cloned application information, which includes the cloned application's first application identifier and first resource path. The first resource path is different from the second resource path of the main application corresponding to the cloned application.
[0052] The second creation module is used to create a clone application process corresponding to the clone application based on the first application identifier;
[0053] The build module is used to build the runtime environment of the cloned application in conjunction with the installation package of the main application when running the cloned application process, based on the first resource path, so as to run the cloned application process in the runtime environment.
[0054] The beneficial effects that can be achieved in the fourth aspect can be referred to the beneficial effects of any embodiment of the second aspect of this application, and will not be repeated here.
[0055] Fifthly, embodiments of this application provide an electronic device, including: a memory for storing instructions executable by one or more processors of the electronic device; and a processor, which, when executing the instructions in the memory, causes the electronic device to perform the method provided by any embodiment of the first or second aspect of this application. The beneficial effects achievable through the fifth aspect can be found in the beneficial effects of any embodiment of the first or second aspect of this application, and will not be repeated here.
[0056] Sixthly, embodiments of this application provide a computer-readable storage medium storing instructions that, when executed on a computer, cause the computer to perform the method provided by any embodiment of the first or second aspect of this application. The beneficial effects achievable through the sixth aspect can be found in the beneficial effects of any embodiment of the first or second aspect of this application, and will not be repeated here. Attached Figure Description
[0057] Figure 1 is a schematic diagram of an application scenario provided by an implementation example of this application;
[0058] Figure 2 is a schematic diagram of a clone application creation method provided in some embodiments;
[0059] Figure 3a is a schematic diagram of the structure of an electronic device provided in an embodiment of this application;
[0060] Figure 3b is a software structure block diagram of an electronic device provided in an embodiment of this application;
[0061] Figure 3c is a schematic diagram of the system architecture of an electronic device provided in an embodiment of this application;
[0062] Figure 4 is a flowchart of a clone application creation method provided in an embodiment of this application;
[0063] Figure 5 is a flowchart of a clone application creation method provided in a specific embodiment of this application;
[0064] Figure 6 is a flowchart of a clone application launch method provided in an embodiment of this application;
[0065] Figure 7a is a flowchart of a clone application launch method provided in a specific embodiment of this application;
[0066] Figure 7b is a schematic diagram of the application process and corresponding sandbox provided in an embodiment of this application;
[0067] Figure 8 is a schematic diagram of the structure of a clone application creation device provided in an embodiment of this application;
[0068] Figure 9 is a schematic diagram of the structure of a clone application launching device provided in an embodiment of this application;
[0069] Figure 10 is a block diagram of an electronic device provided in one embodiment of this application;
[0070] Figure 11 is a block diagram of a System on Chip (SOC) provided in one embodiment of this application. Detailed Implementation
[0071] The technical solutions in the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings.
[0072] The clone application creation method provided in this application embodiment can be applied to scenarios where electronic devices create and run clone applications. For example, referring to Figure 1 of the specification, Figure 1 shows a schematic diagram of an application scenario provided by an embodiment of this application. As shown in Figure 1, in this scenario, when a user clicks the clone creation control 111 in the clone application interface 110 used to create a clone application of the main application, the electronic device can respond to the user's click operation on the clone creation control 111, create one or more clone applications of the main application, and display the application icon 121 of the clone application on the desktop 120. When the user clicks the application icon 121 of the clone application on the desktop 120, the electronic device can respond to the user's click operation on the application icon 121 and launch the corresponding clone application.
[0073] The main application can be the application (APP) to be cloned. The type of the main application can be the application that the user needs to enable multiple accounts to be online at the same time, or other types of applications. For example, the main application can be at least one of the following: instant messaging application, game application, video application, short video application, shopping application, music application, social application, news application, etc. This application embodiment does not specifically limit the category of the main application.
[0074] In some embodiments, referring to Figure 2 of the specification, Figure 2 illustrates a schematic diagram of a method for creating cloned applications provided in some embodiments. As shown in Figure 2, electronic devices can achieve dual application operation through a multi-user mechanism, i.e., creating and running cloned applications. The key technology lies in: the application framework layer manages and runs the four major components of the cloned application process by directly creating a new system clone user, and the system service layer uses product configuration to restrict the applications that can run under the system clone user. In this application cloning method, the system clone user can be started using the `startUserInBackground` method, ensuring that there is only one current user in the system and not affecting the system services under the main user. Furthermore, when the main user installs an application, it does not affect the system clone user. When the main user uninstalls the main application, the corresponding clone application is uninstalled simultaneously. When all clone applications are uninstalled, the system clone user is deleted. In addition, interaction between the main application and the clone application requires cross-user access; therefore, it is necessary to establish cross-user access and jump channels for applications to enable data exchange such as pictures, videos, and contacts.
[0075] It's clear that this method of creating cloned applications requires a special system clone user, only allowing for dual-opening of the application, and cannot meet users' needs for creating multiple application clones, while also consuming significant system resources. Furthermore, the cloned application is closely linked to the main application; if the main application is uninstalled, the corresponding cloned application is also uninstalled, resulting in a poor user experience. Additionally, this method requires establishing cross-user access and navigation channels between applications, making its implementation complex.
[0076] In some embodiments, when creating a clone application, the electronic device can first modify the package name in the main application's installation package to obtain the clone application's package name. This allows the modified installation package to differ from the main application's package only in its package name, thus enabling the clone application to be installed. Alternatively, a preset data path can be established using the clone application's package name. The installation path in the clone application's package information can then be set to the main application's installation path, the resource path in the clone application's package information can be set to the main application's resource path, and the data path in the clone application's package information can be set to the preset data path, thereby completing the creation of the clone application. However, this method creates clone applications that share resource paths with the main application, resulting in a strong correlation. If the main application is uninstalled, the clone application will also be uninstalled. Furthermore, this method relies on the electronic device generating the clone application's package name to distinguish it from the main application, which can prevent the clone application from interacting with other applications.
[0077] To this end, this application provides a method for creating a cloned application, a method for launching a cloned application, a device, and a medium to decouple the application cloning function from the sub-user and simultaneously achieve decoupling between the main application and the cloned application.
[0078] According to one embodiment of this application, after receiving a user's request to create a clone of a main application, the electronic device can directly generate clone application information based on the application configuration information corresponding to the main application, and add it to the application package information corresponding to the main application, thus achieving lightweight installation of the clone application. This clone application creation method does not require the creation of a specific system sub-user, does not rely on a multi-user mechanism, and can directly create multiple clone applications according to user needs, breaking the application dual-opening restriction, thereby satisfying the user's demand to create multiple application clones. Since this method removes the dependency on sub-users, the multiple applications run under the same system user, so that the interaction between the main application and other applications and the clone application does not require cross-user access, thus eliminating the need to establish cross-user access capabilities, making the implementation simple.
[0079] Furthermore, this method of creating clone applications generates clone application information directly based on the application's configuration information and performs a lightweight installation of the clone application. It eliminates the need to install multiple installation packages, making installation simple, highly versatile, and resource-efficient with minimal impact on system performance. Moreover, clone applications created using this method use different resource paths (e.g., sandbox paths) than the main application, allowing the clone application process to run in an independent runtime environment. This ensures that the main application and clone applications are independent and unrelated. In other words, clone applications function like regular applications; they are only uninstalled when the user actively uninstalls them. Uninstalling the main application will not uninstall the clone application, thus improving the user experience.
[0080] According to another embodiment of this application, after receiving a user's request to launch a cloned application, the electronic device can incubate a corresponding cloned application process based on the cloned application's application identifier. Furthermore, based on the cloned application's resource path (e.g., a sandbox path), it can create an independent runtime environment (e.g., mounting an independent sandbox for the cloned application) for running the cloned application process. This allows the cloned application process to run in an independent runtime environment different from the main application process, making the main application and the cloned application independent and unrelated to each other. In other words, the cloned application is treated like a regular application; it will only be uninstalled if the user actively uninstalls it. Uninstalling the main application will not uninstall the cloned application, thus improving the user experience.
[0081] The embodiments of this application do not limit the form of the electronic device. The electronic device can be a mobile phone, tablet, laptop, TV, smart screen, vehicle equipment (e.g., car infotainment system, car navigation system), etc. The system installed in the electronic device can be Android, iOS, HarmonyOS or OpenHarmonyOS, etc., which are not limited here.
[0082] The method for creating clone applications according to embodiments of this application is described below in conjunction with the specific structure of the electronic device.
[0083] Figure 3a shows a schematic diagram of the structure of an electronic device 300 provided in one embodiment of this application. The electronic device 300 may include a processor 310, an external memory interface 320, an internal memory 321, a Universal Serial Bus (USB) interface 330, a charging management module 340, a power management module 341, a battery 342, antenna 1, antenna 2, a mobile communication module 350, a wireless communication module 360, an audio module 370, a speaker 370A, a receiver 370B, a microphone 370C, a headphone jack 370D, a sensor module 380, buttons 390, a motor 391, an indicator 392, a camera 393, a display screen 394, and a Subscriber Identification Module (SIM) card interface 395, etc. The sensor module 380 may include a pressure sensor 380A, a gyroscope sensor 380B, a barometric pressure sensor 380C, a magnetic sensor 380D, an accelerometer sensor 380E, a distance sensor 380F, a proximity light sensor 380G, a fingerprint sensor 380H, a temperature sensor 380J, a touch sensor 380K, an ambient light sensor 380L, a bone conduction sensor 380M, etc.
[0084] Processor 310 may include one or more processing units, such as an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural network processor (NPU). These different processing units may be independent devices or integrated into one or more processors. For example, processor 310 may be used to execute various steps of the clone application creation method in the embodiments of this application.
[0085] The processor 310 can generate operation control signals based on the instruction opcode and timing signals to control the instruction fetching and execution.
[0086] The processor 310 may also include a memory for storing instructions and data. In some embodiments, the memory in the processor 310 is a cache memory. This memory can store instructions or data that the processor 310 has just used or that are used repeatedly. If the processor 310 needs to use the instruction or data again, it can retrieve it directly from the memory. This avoids repeated accesses, reduces the waiting time of the processor 310, and thus improves the efficiency of the system.
[0087] In some embodiments, the processor 310 can obtain a user's request to create a clone of the main application, and in response to the request, directly generate clone application information based on the application configuration information corresponding to the main application, and add it to the application package information corresponding to the main application, thereby achieving lightweight installation of the clone application. Multiple clone applications can be created directly according to user needs, breaking the application dual-opening restriction and satisfying the user's demand for creating multiple application clones. Furthermore, the created clone applications use different resource paths (e.g., sandbox paths) than the main application, allowing the clone application process to run in an independent runtime environment different from the main application process, making the main application and clone applications independent of each other and not subordinate to each other.
[0088] In some embodiments, the processor 310 can obtain a user's launch request for the cloned application, and in response to the launch request, incubate the corresponding cloned application process according to the application identifier of the cloned application, and create an independent running environment (e.g., mounting an independent sandbox for the cloned application) for running the cloned application process according to the resource path (e.g., sandbox path) of the cloned application. This allows the cloned application process to run in an independent running environment different from the main application process, making the main application and the cloned application independent of each other and not subordinate to each other, which facilitates user use and improves user experience.
[0089] In some embodiments, the processor 310 may include one or more interfaces. These interfaces 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) interface, a General-Purpose Input / Output (GPIO) interface, and a Subscriber Identity Module (SIM) interface.
[0090] 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 310 may include multiple I2C buses. The processor 310 can couple to the touch sensor 380K, charger, flash, camera 393, etc., through different I2C bus interfaces.
[0091] The MIPI interface can be used to connect the processor 310 to peripheral devices such as the display 394 and the camera 393. The MIPI interface includes the Camera Serial Interface (CSI) and the Display Serial Interface (DSI).
[0092] It is understood that the interface connection relationships between the modules illustrated in the embodiments of this application are merely illustrative and do not constitute a structural limitation on the electronic device 300. In other embodiments of this application, the electronic device 300 may also employ different interface connection methods or combinations of multiple interface connection methods as described in the above embodiments.
[0093] Electronic device 300 implements display functions through a GPU, display screen 394, and application processor. Processor 310 may include one or more GPUs, which execute program instructions to generate or modify display information.
[0094] The display screen 394 is used to display images, videos, etc. In some embodiments, the electronic device 300 may include one or N display screens 394, where N is a positive integer greater than 1.
[0095] Internal memory 321 can be used to store executable program code, including instructions. Internal memory 321 may include a program storage area and a data storage area. The program storage area may store the operating system, at least one application program required for a function (such as sound playback, image playback, etc.). The data storage area may store data created during the use of electronic device 300 (such as audio data, phonebook, etc.). Furthermore, internal memory 321 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, Universal Flash Storage (UFS), etc. Processor 310 executes various functional applications and data processing of electronic device 300 by running instructions stored in internal memory 321 and / or instructions stored in memory located within the processor.
[0096] In some embodiments, the internal memory 321 may store instructions for creating clone applications. The processor 310 executes these instructions to obtain a user's request to create a clone of the main application. Responding to this request, the processor 310 directly generates clone application information based on the application configuration information corresponding to the main application and adds it to the application package information corresponding to the main application, thus achieving lightweight installation of the clone application. Multiple clone applications can be created directly according to user needs, breaking the application dual-opening restriction and satisfying the user's desire to create multiple application clones. Furthermore, the created clone applications use different resource paths (e.g., sandbox paths) than the main application, allowing the clone application process to run in an independent runtime environment different from the main application process, making the main application and clone applications independent and unrelated to each other.
[0097] In some embodiments, the internal memory 321 may store instructions for launching a clone application. By running the instructions for launching a clone application, the processor 310 can obtain the user's launch request for the clone application, and in response to the launch request, incubate the corresponding clone application process according to the application identifier of the clone application. Furthermore, based on the resource path of the clone application (e.g., sandbox path), an independent running environment (e.g., mounting an independent sandbox for the clone application) is created for running the clone application process. This allows the clone application process to run in an independent running environment different from the main application process, making the main application and the clone application independent of each other and not subordinate to each other, which facilitates user use and improves the user experience.
[0098] The pressure sensor 380A is used to sense pressure signals and can convert pressure signals into electrical signals.
[0099] The touch sensor 380K, also known as a "touch device," can be placed on the display screen 394. The touch sensor 380K and the display screen 394 together form a touch screen, also known as a "touchscreen." The touch sensor 380K is used to detect touch operations applied to or near it.
[0100] Button 390 includes a power button, volume buttons, etc.
[0101] The software system of electronic device 300 can adopt a layered architecture, event-driven architecture, microkernel architecture, microservice architecture, or cloud architecture. This application embodiment uses the layered architecture Android system as an example to exemplify the software structure of electronic device 300. This application does not limit the type of operating system for the electronic device. For example, Android, Linux, Windows, iOS, Harmony Operating System (HarmonyOS), etc.
[0102] Figure 3b is a software structure block diagram of an electronic device 300 provided in one embodiment of this application.
[0103] As shown in Figure 3b, the layered architecture divides the software into several layers, each with a clear role and function. 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 system library layer, and the kernel layer.
[0104] The application layer can include a series of application packages.
[0105] As shown in Figure 3b, the application package may include applications such as gallery, map, navigation, music, video, games, settings, desktop, and social networking. The application layer may also include other applications besides those shown in Figure 3b, such as camera, calendar, call, WLAN, Bluetooth, and SMS, which will not be described in detail in this embodiment.
[0106] The application framework layer provides an application programming interface (API) and programming framework for applications. The application framework layer includes some predefined functions.
[0107] As shown in Figure 3b, the application framework layer may include a window manager, content provider, view system, phone manager, resource manager, notification manager, package management service, runtime management service, and process incubation module, etc.
[0108] The window manager is used to manage windowed applications. It can retrieve screen size, determine the presence of a status bar, lock the screen, and capture screenshots, among other things.
[0109] Content providers store and retrieve data, making that data accessible to applications. This data may include videos, images, audio, made and received phone calls, browsing history and bookmarks, phone books, etc.
[0110] A view system includes visual controls, such as controls for displaying text and controls for displaying images. View systems can be used to build applications. A display interface can consist of one or more views. For example, a display interface including a text notification icon could include views for displaying text and views for displaying images.
[0111] The phone manager is used to provide communication functions for electronic devices 300. For example, it manages call status (including connection and disconnection).
[0112] The file explorer provides applications with various resources, such as localized strings, icons, images, layout files, video files, and more.
[0113] The notification manager allows applications to display notifications in the status bar. These notifications can be used to deliver informational messages and can disappear automatically after a short pause, requiring no user interaction. For example, the notification manager can be used to notify users of completed downloads or message alerts. The notification manager can also display notifications as icons or scrolling text in the top status bar, such as notifications from background applications, or as dialog boxes on the screen. Examples include displaying text messages in the status bar, emitting sounds, vibrating electronic devices, and flashing indicator lights.
[0114] System libraries can include multiple functional modules. For example: Surface Manager, Media Libraries, 3D graphics processing libraries (e.g., OpenGLES), 2D graphics engines (e.g., SGL), etc.
[0115] The Surface Manager is used to manage the display subsystem and provides the blending of 2D and 3D layers for multiple applications.
[0116] The media library supports playback and recording of various common audio and video formats, as well as still image files. It supports multiple audio and video encoding formats, such as MPEG4, H.264, MP3, AAC, and AMR.
[0117] The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, compositing, and layer processing.
[0118] A 2D graphics engine is a graphics engine for 2D drawing.
[0119] The kernel layer is the layer between hardware and software. The kernel layer contains at least the display driver, camera driver, audio driver, and sensor driver.
[0120] The system architecture of the electronic device 300 according to an embodiment of this application is explained below with reference to FIG3c.
[0121] Referring to Figure 3c in the specification, Figure 3c shows a schematic diagram of the system architecture of an electronic device provided in one embodiment of this application. As shown in Figure 3c, the system architecture of the electronic device may include a settings application 301, a package management service (BMS) 302, a desktop application 303, an operation management service (AbilityManagerService (AMS)) 304, and a process incubation module 305, etc.
[0122] In some examples, the settings application 301 can provide a clone creation control, which allows users to perform clone creation operations on the main application. The settings application 301 can generate a clone creation request for the main application in response to this clone creation operation. The package management service 302 can respond to this clone creation request, obtain application configuration information corresponding to the main application, generate clone application information for the clone application based on this configuration information, and add the clone application information to the application package information corresponding to the main application, thus creating a clone application based on the clone creation request. The clone application information may include a clone application identifier (as an example of a first application identifier) and a clone application sandbox path (as an example of a first resource path). The package management service 302 can also output a notification message indicating that the clone application installation is complete, instructing the display of the clone application's application icon on the desktop. The desktop application 303 can respond to the notification message sent by the package management service, create and display the application icon of the clone application on the desktop.
[0123] In some examples, users can launch a cloned application based on its application icon. Desktop application 303 can also generate a launch request for the cloned application in response to this launch request. Runtime management service 304 can respond to this launch request by querying the corresponding cloned application information based on the cloned application identifier, and then generate a process creation request for the cloned application based on that information. Process incubation module 305 can respond to this process creation request by determining the cloned application identifier corresponding to the request, and then create the cloned application process corresponding to that cloned application based on the identifier. Process incubation module 305 can also mount the cloned application sandbox (as an example of a runtime environment) based on the cloned application sandbox path to run the cloned application process within that sandbox.
[0124] It is understood that the structures illustrated in the embodiments of this application do not constitute a specific limitation on the electronic device 300. In other embodiments of this application, the electronic device 300 may include more or fewer components than illustrated, or combine some components, or split some components, or have different component arrangements. The illustrated components may be implemented in hardware or software.
[0125] The following details the specific process of the clone application creation method provided in the embodiments of this application.
[0126] The clone application creation method provided in this application embodiment can be applied to electronic devices with the hardware structure shown in FIG3a and the software structure shown in FIG3b, or to electronic devices with similar hardware and software structures, such as having more or fewer components than shown, combining some components, splitting some components, or having different component arrangements.
[0127] The following uses a mobile phone as an example of an electronic device to describe in detail a method for creating cloned applications according to an embodiment of this application. Multiple applications are installed on the mobile phone, some or all of which support the application cloning function. Referring to Figure 4, which shows a flowchart of a method for creating cloned applications according to an embodiment of this application, this method can be executed, for example, by a package management service on the mobile phone. As shown in Figure 4, the method may include steps S401-S404.
[0128] S401: The mobile phone responds to the user's request to create a clone of the main application and determines the main application corresponding to the request.
[0129] In this embodiment, the main application can be the application to be cloned. The type of the main application can be an application that the user needs to enable multiple accounts to be online simultaneously, or other types of applications. The main application can be at least one of the following: instant messaging application, game application, video application, short video application, shopping application, music application, social application, news application, etc. This application does not specifically limit the category of the main application. After the mobile phone obtains the user's request to create a clone for the main application, it determines the main application to be cloned based on the clone creation request, and then performs the clone creation operation on the main application.
[0130] In some embodiments, the mobile phone can receive a clone creation request sent by preset software. This clone creation request can be generated by the preset software when it detects a user's clone creation operation targeting a main application. When a user performs a clone creation operation targeting a main application, the preset software can detect the clone creation operation and generate a corresponding clone creation request for the main application based on the clone creation operation. The preset software may include at least one of system settings, desktop management systems, app stores, etc., and this application does not specifically limit the type of preset software.
[0131] For example, the system settings interface can display an application cloning function control. When this control is clicked, it displays the main application for which cloning can be performed and its corresponding cloning control. Users can trigger a cloning request by clicking the control, selecting an application from the displayed list of cloning-enabled applications, and then clicking the corresponding cloning control. In other words, a user's cloning operation for a main application can be a click operation on the cloning control corresponding to that main application. The click operation on the application cloning control and the cloning control can include the user's finger pressing on the area where the control is located, and is not considered limited to this.
[0132] In some embodiments, users can also trigger the application cloning function by long-pressing the application cloning function control, double-clicking the application cloning function control, etc., and select an application from the displayed cloneable applications. Then, they can trigger the clone creation request by long-pressing the create clone control, double-clicking the create clone control, etc. The specific implementation method is similar to the implementation method of clicking the application cloning function control and creating the clone control described above. You can refer to the relevant content of the implementation method of clicking the application cloning function control and creating the clone control. This application embodiment will not be repeated here.
[0133] For example, users can also trigger the clone creation request by long-pressing, double-clicking, or multi-clicking the application icon. This application embodiment does not specifically limit the triggering method of the clone creation request. For example, the main application's icon can be displayed on the desktop, and users can trigger the clone creation request by long-pressing, double-clicking, or multi-clicking the main application's icon.
[0134] In some embodiments, when the preset software detects a user's creation of a clone application, it can also output a prompt message asking whether to create a clone application, and generate a corresponding clone creation request for the main application upon receiving confirmation of the prompt message.
[0135] For example, taking the default software as a desktop management system, when a user long-presses, double-clicks, or taps a social application icon with two fingers, the desktop management system displays a prompt indicating whether to create a clone application for that social application. When the user clicks "Yes," that is, the user enters confirmation information from the prompt, the desktop management system can generate a clone creation request for that social application.
[0136] In this embodiment, the clone creation request may include the identification information of the main application. The mobile phone can determine the main application corresponding to the clone application request based on the identification information. The identification information may include, but is not limited to, the main application identifier, application signature, and other information that can identify the identity of the main application. This embodiment does not specifically limit the content of the identification information.
[0137] S402: The mobile phone obtains the application configuration information corresponding to the main application.
[0138] In this embodiment, the application configuration information may include, but is not limited to, global configuration information and configuration information specific to a particular device. The global configuration information may include, but is not limited to, at least one of the following: application package name, description of the application developer, version, version number, version name, and API versions that the application depends on. The configuration information specific to a particular device may include, but is not limited to, at least one of the following: the process name of the application or application instance, whether the application supports application cloning, and the maximum number of cloning instances the application supports.
[0139] In some examples, application configuration information can be stored in the configuration file corresponding to the main application. After the phone identifies the main application, it can find the corresponding configuration file based on the main application's package name or identifier information, and obtain the application configuration information corresponding to the main application from the configuration file.
[0140] S403: Based on the application configuration information, the mobile phone generates clone application information for the clone application, which includes the clone application identifier (as an example of the first application identifier) and the clone application sandbox path (as an example of the first resource path).
[0141] In this embodiment, the cloned application information can be management information generated when the application installation package is installed. This cloned application information can include static information obtained by parsing the installation package and dynamic information generated during the installation process. The mobile phone can manage the cloned application through this cloned application information. To improve the installation efficiency of cloned applications, this embodiment can directly generate the cloned application information based on the application configuration information corresponding to the main application, so that the mobile phone can directly manage the cloned application based on the generated cloned application information.
[0142] In this embodiment, the cloned application information may include, but is not limited to, the cloned application's installation information and resource path. Installation information may include, but is not limited to, the corresponding application package name and cloned application identifier. Resource path may include, but is not limited to, the cloned application's sandbox path. The cloned application identifier uniquely identifies the cloned application and can be used to create the corresponding cloned application process when the created cloned application is launched. The cloned application sandbox path can be used to store the files corresponding to the cloned application.
[0143] In some embodiments, the clone application sandbox path can also be used to build the runtime environment of the clone application in conjunction with the installation package of the main application when running the clone application process.
[0144] Furthermore, the sandbox path of the cloned application is different from the sandbox path of the main application (as an example of the second resource path), meaning that the cloned application and the main application can use independent sandbox paths and are not subordinate to each other.
[0145] In some embodiments, the installation information may also include the cloned application's user identifier (UID), access token ID (TokenID), and installation path. The cloned application information may also include dynamic information such as the data path.
[0146] It should be noted that the specific methods for generating each type of information in the clone application will be described in detail later.
[0147] S404: The phone adds clone application information to the application package information corresponding to the main application and creates a clone application based on the clone creation request.
[0148] In this embodiment, the mobile phone can add the clone application information of the clone application to the application package information corresponding to the main application by modifying a series of installation code or installation resource-related paths such as the compilation source code path and resource path in the package management service, so as to complete the installation of the clone application based on the clone creation request.
[0149] It is understood that, in this embodiment of the application, after the mobile phone receives the user's request to create a clone of the main application, it can directly generate the clone application information based on the application configuration information corresponding to the main application, and add it to the application package information corresponding to the main application, thereby achieving lightweight installation of the clone application. This clone application creation method does not require the creation of a specific system sub-user, does not rely on a multi-user mechanism, and can directly create multiple clone applications according to user needs, breaking the application dual-opening restriction, thus satisfying the user's demand to create multiple application clones. Since this method removes the dependence on sub-users, the multiple applications run under the same system user, so that the interaction between the main application and other applications and the clone application does not require cross-user access, thus eliminating the need to establish cross-user access capabilities, making the implementation solution simple.
[0150] Furthermore, this method of creating clone applications generates clone application information directly based on the application's configuration information and performs a lightweight installation of the clone application. It eliminates the need to install multiple installation packages, making installation simple, highly versatile, and resource-efficient with minimal impact on system performance. Moreover, clone applications created using this method use different resource paths (e.g., sandbox paths) than the main application, allowing the clone application process to run in an independent runtime environment. This ensures that the main application and clone applications are independent and unrelated. In other words, clone applications function like regular applications; they are only uninstalled when the user actively uninstalls them. Uninstalling the main application will not uninstall the clone application, thus improving the user experience.
[0151] In one possible embodiment, the method may further include: the mobile phone outputting a notification message indicating that the cloned application has been installed, the notification message being used to instruct the display of the cloned application's icon on the desktop. In some examples, after the cloned application is created, the mobile phone may send a notification message to the system desktop instructing the display of the cloned application's icon, so that the system desktop creates and displays the cloned application's icon on the desktop. The specific creation and display methods are not described in detail in this embodiment of the application.
[0152] The method for creating cloned applications provided in this application embodiment will be further described below in conjunction with the system architecture of the mobile phone and its modules. Referring to Figure 5, Figure 5 shows a flowchart of a method for creating cloned applications provided in a specific embodiment of this application, which is a further explanation of the embodiment shown in Figure 4. The method may include steps S501-S508.
[0153] S501: Set the application to respond to the user's operation of creating a clone of the main application, and generate a clone creation request corresponding to the main application.
[0154] In this embodiment, the settings application can provide a "Create Clone" control in the system settings interface for creating a clone application corresponding to the main application. The user can click this control in the system settings interface to trigger a clone creation request for the main application. In other words, the clone creation operation for the main application can be a click operation on the "Create Clone" control in the system settings interface. The settings application can detect this clone creation operation and, upon detection, respond to it by generating a clone creation request for the main application.
[0155] It should be noted that the above method of triggering the clone creation request by clicking the "Create Clone Control" in the system settings interface is only an example. In some embodiments, users can also trigger the clone creation request by long-pressing the "Create Clone Control" or double-clicking the "Create Clone Control". The specific implementation method is similar to the above implementation method of clicking the "Create Clone Control". You can refer to the relevant content of the implementation method of clicking the "Create Clone Control". This application embodiment will not be described in detail here.
[0156] In some examples, when the settings app detects a user's action to create a clone, it can respond to that action by determining the primary app for which the clone creation action is directed. The settings app can obtain the primary app's identification information and generate a clone creation request corresponding to the primary app based on that identification information. In other words, the clone creation request can include the primary app's identification information.
[0157] In one possible embodiment, when the application detects a user's creation of a clone, it can first determine whether the main application to which the creation of the clone is directed supports the application cloning function. If the application cloning function is supported, then the application generates a clone creation request for the main application and executes subsequent steps to create the corresponding clone application.
[0158] Optionally, the settings application can obtain application configuration information corresponding to the main application from the package management service. This application configuration information may include configuration items regarding whether the application supports application cloning. The settings application can determine whether the main application supports application cloning based on the information in these configuration items. For example, it can determine whether the information in these configuration items is preset information. If the information in these configuration items is preset information, it can be determined that the main application supports application cloning; otherwise, it can be determined that the main application does not support application cloning. The preset information can be pre-set according to actual conditions, and this embodiment of the application does not specifically limit this.
[0159] Alternatively, the settings application can also obtain the application configuration information corresponding to the main application from the package management service, and determine whether the application configuration information includes a configuration item for whether the application supports the application cloning function. If it includes a configuration item for whether the application supports the application cloning function, it can be determined that the main application supports the application cloning function; otherwise, it can be determined that the main application does not support the application cloning function.
[0160] Optionally, the settings app can also maintain its own list of apps that support app cloning and determine whether the main app is in the list. If it is, the main app can be determined to support app cloning; otherwise, the main app can be determined not to support app cloning.
[0161] S502: Configure the application to send the clone creation request to the package management service.
[0162] In this embodiment, the settings application can send a clone creation request to the package management service by calling the clone creation application interface provided by the package management service. Correspondingly, the package management service can receive the clone creation request sent by the settings application.
[0163] S503: The package management service responds to the clone creation request and determines the main application corresponding to the clone creation request.
[0164] In this embodiment of the application, since the clone creation request contains the identification information of the main application, the package management service can determine the main application corresponding to the clone application request based on the identification information after obtaining the clone creation request.
[0165] S504: Package management service obtains the application configuration information corresponding to the main application.
[0166] In this embodiment of the application, the application configuration information can be stored in the configuration file corresponding to the main application. After the main application is determined, the package management service can find the corresponding configuration file according to the application package name or identification information of the main application, and obtain the application configuration information corresponding to the main application in the configuration file.
[0167] For example, assuming the main application is a personal application of a certain application, its corresponding application configuration information can be obtained. This application configuration information may include, but is not limited to: application package name "com.xxx.xxx", version number "1000000", version name "1.0.0", and application multi-instance mode "APP_CLONE", etc.
[0168] In one possible embodiment, the package management service can also determine whether the main application supports the application cloning function. If the application cloning function is supported, the subsequent steps to create the corresponding cloned application will be executed. The specific determination method is similar to the method used in step S501 to determine whether the main application supports the application cloning function, and will not be described again in this embodiment.
[0169] S505: The package management service generates clone application information for the clone application based on the application configuration information. The clone application information includes the clone application identifier (as an example of the first application identifier) and the clone application sandbox path (as an example of the first resource path).
[0170] In this embodiment, the cloned application information may include, but is not limited to, the cloned application's installation information and resource path. Installation information may include, but is not limited to, the corresponding application package name and cloned application identifier. Resource path may include, but is not limited to, the cloned application's sandbox path.
[0171] In one possible embodiment, the package management service generates clone application information for the clone application based on the application configuration information corresponding to the main application. This may include: determining the application package name corresponding to the main application based on the application configuration information; configuring the clone application identifier corresponding to the clone application based on the application configuration information; and creating a clone application sandbox path for the clone application based on the application package name and the clone application identifier. The clone application sandbox path can be used to store files corresponding to the clone application and to build the runtime environment of the clone application in conjunction with the installation package of the main application when running the clone application process.
[0172] In some examples, the package management service can obtain the application package name corresponding to the main application from the application configuration information. The package management service can also determine the application cloning status corresponding to the main application, including but not limited to whether creating clone applications is supported and the number of clone applications to be created. Based on the application cloning status, the package management service can configure a clone application identifier corresponding to the clone application to be created. This clone application identifier can uniquely identify the clone application and can be used to create the corresponding clone application process when the created clone application is launched. For example, when the application cloning status indicates that the main application (main application identifier AppIndex = 0) has not created any clone applications, the corresponding clone application identifier AppIndex = 1 can be configured for the clone application to be created. When the application cloning status indicates that the main application has already created one clone application, the corresponding clone application identifier AppIndex = 2 can be configured for the clone application to be created.
[0173] In some examples, the package management service can also create a clone application sandbox path for the clone application based on a defined application package name and clone application identifier. This clone application sandbox path is different from the main application's main application sandbox path (as an example of a second resource path), meaning that the clone application and the main application can use independent sandbox paths and are not subordinate to each other.
[0174] It should be noted that the resource paths (sandbox paths) mentioned in the embodiments of this application can be used to store files belonging to the user or the application generated during application usage. For example, the sandbox path of a cloned application can be used to store files generated during the use of a cloned application, and the sandbox path of the main application can be used to store files generated during the use of the main application.
[0175] The resource paths (sandbox paths) mentioned in this application embodiment can also be used to build the application's runtime environment in conjunction with the application's installation package when running the application process. For example, the clone application sandbox path can be used to build the clone application's runtime environment in conjunction with the main application's installation package when running the clone application process. The main application sandbox path can be used to build the main application's runtime environment in conjunction with the main application's installation package when running the main application process. In other words, the resource paths (sandbox paths) mentioned in this application embodiment do not include the application's installation package; for an application, there is generally only one installation package. It should be understood that the method provided in this application embodiment will not store more installation packages in the electronic device's memory due to the creation of clone applications. The relevant resources of the installation package will only be loaded into the corresponding application process when the main application or clone application is running. Furthermore, when the main application is uninstalled, the installation package of the clone application will still be retained because there are still clone applications, unless the main application and all clone applications are uninstalled.
[0176] In other words, according to the method provided in the embodiments of this application, an application requires at least the following information to run: an installation package, an application identifier, and a resource path (sandbox path). The main application and its clones share the same installation package, which can be used by either the main application or the clones when they run.
[0177] In some embodiments, the installation information may also include information such as the user identifier and access identifier of the cloned application. In some examples, the package management service can generate the user identifier and access identifier of the cloned application based on the cloned application identifier. The specific generation method can be selected or determined according to the actual situation. For example, the cloned application identifier can be obtained by encrypting it with different encryption algorithms. This application embodiment does not impose specific limitations on this.
[0178] For example, assuming the main application is a personal application of a certain application, and a corresponding clone application has not yet been created, the package management service can generate office application information (as an example of clone application information) for the office application of a certain application (as an example of clone application information) based on its corresponding application configuration information. This office application information may include, but is not limited to, installation information and resource paths. In some examples, the package management service can use the application package name "com.xxx.xxx" in the application configuration information as the application package name of the office application, and configure the application identifier AppIndex of the corresponding office application as 1. Based on the application identifier "1", the service can generate the corresponding user identifier UID as "2000002", access identifier TokenID as "0x2222", and so on. The package management service can also create the office application sandbox path " / 1clone_com.xxx.xxx" for the office application based on the determined application package name "com.xxx.xxx" and application identifier "1".
[0179] It should be noted that the above configuration corresponds to the clone application identifier of the clone application to be created, which uniquely identifies the clone application, and the implementation method of creating the corresponding clone application process when the created clone application is launched is only an example. In some embodiments, the package management service can also configure other identifiers for the clone application to be created to implement the solution provided in the embodiments of this application, and the embodiments of this application do not impose specific limitations on this.
[0180] In some embodiments, the installation information may also include information such as the installation path of the cloned application. In some examples, the package management service can obtain the installation path of the main application from the application configuration information and set the installation path of the cloned application as the installation path of the main application to achieve resource reuse.
[0181] In some embodiments, clone application information may also include dynamic information such as data paths. In some examples, the package management service can also create a clone application data path based on a determined application package name and clone application identifier. This clone application data path can be used to store data related to the clone application to be created. This clone application data path is different from the main application's data path; that is, the clone application and the main application can use independent data paths to achieve categorized storage of data from different accounts.
[0182] In practical applications, based on the application configuration information, the information of the clone application is generated. Specifically, the application configuration information in JSON (JavaScript Object Notation) format is converted into a data object in memory, retaining the same information between the main application and the clone application, and resetting the different information between the clone application and the main application according to the attributes of the clone application.
[0183] As can be understood, in this embodiment of the application, the package management service allows cloned applications to share the same installation package and application package name with the main application, and distinguishes between cloned applications and the main application by configuring an application identifier. This enables the created cloned applications to interact normally with other applications, making them equivalent to ordinary applications. For example, when a user shares information such as pictures with another application through the currently used application, the currently used application can interact with both the main application and the cloned application of that application based on the corresponding application identifier, providing the user with the option to choose between the main application and the cloned application.
[0184] S506: The package management service adds the clone application information to the application package information corresponding to the main application and creates a clone application based on the clone creation request.
[0185] In this embodiment, the package management service can add the clone application information of the clone application to the application package information corresponding to the main application by modifying a series of installation code or installation resource-related paths such as the compilation source code path and resource path, so as to complete the installation of the clone application based on the clone creation request.
[0186] In some examples, the package management service can add clone application information to the application package information. This application package information can be stored in a database and may also include main application information and clone application information for other clone applications. The main application information is independent of each clone application and can be distinguished at least by an application identifier. For example, for the main application of an application (e.g., a personal application), its application information can be identified by the application package name and the main application identifier AppIndex = 0; for the first clone application of an application (e.g., an office application), its clone application information can be identified by the application package name and the clone application identifier AppIndex = 1; and for the second clone application of an application (e.g., a family application), its clone application information can be identified by the application package name and the clone application identifier AppIndex = 2.
[0187] It is understood that in this embodiment of the application, by configuring the installation information of the cloned application according to the application configuration information corresponding to the main application, and configuring the corresponding resource path and data path for the cloned application, the lightweight installation of the cloned application can be achieved. It does not require the installation of multiple installation packages, is simple to install, has strong universality, saves system resources, and has little impact on system performance.
[0188] S507: The package management service sends a notification to the desktop application indicating that the cloned application has been installed. This notification is used to instruct the application icon of the cloned application to be displayed on the desktop.
[0189] In this embodiment, after the package management service creates a cloned application, it can send a notification to the desktop application instructing it to display the cloned application's icon, thus causing the desktop application to display the cloned application's icon on the desktop. This notification may include, but is not limited to, the application package name corresponding to the cloned application and the cloned application's identifier. Accordingly, the desktop application can receive the notification sent by the package management service.
[0190] S508: The desktop application creates and displays the clone application's icon on the desktop based on this notification information.
[0191] In this embodiment, the desktop application can respond to a notification sent by the package management service, obtain information such as the application package name and clone application identifier contained in the notification, and create an application icon for the clone application based on the application package name and clone application identifier, displaying it on the desktop. The specific creation and display methods are not detailed here. For example, for a clone application of a certain application (e.g., an office application of a certain application), an application icon corresponding to the office application can be created and displayed on the desktop. Since the desktop also displays the application icon of the main application (e.g., the personal application of a certain application), two application icons of a certain application can be displayed on the desktop. These two application icons can be distinguished by different application names, or they can be undifferentiated; this embodiment does not impose specific limitations on this.
[0192] It is understood that after the cloned application is installed in this embodiment, a desktop event to generate the application icon of the cloned application can be triggered so that the application icon of the cloned application corresponding to the main application can be displayed on the desktop of the electronic device, which facilitates the user's use and improves the user experience.
[0193] It should be noted that other contents of steps S501 to S508 above can be referred to the relevant contents of the embodiment shown in Figure 4, and will not be repeated here in the embodiments of this application.
[0194] The following details the specific process of the clone application launch method provided in the embodiments of this application.
[0195] The following uses a mobile phone as an example of an electronic device to describe in detail a method for launching cloned applications provided in an embodiment of this application. Multiple apps are installed on the mobile phone, some or all of which support the app cloning function. Referring to Figure 6, Figure 6 shows a flowchart of a method for launching cloned applications provided in an embodiment of this application. As shown in Figure 6, the method may include steps S601-S604.
[0196] S601: The mobile phone responds to the user's request to launch a cloned application and determines the cloned application corresponding to the launch request.
[0197] In this embodiment of the application, the mobile phone can obtain the user's launch request for the cloned application, and after obtaining the launch request, determine the cloned application to be launched based on the launch request, and then perform the launch operation of the cloned application.
[0198] In some embodiments, the mobile phone can receive a launch request for a cloned application sent by the desktop management system. This launch request can be generated by the desktop management system when it detects a user's launch operation for a cloned application. When a user performs a launch operation for a cloned application, the desktop management system can detect the launch operation, generate a corresponding launch request for the cloned application based on the launch operation, and send it to the mobile phone.
[0199] For example, the app icon of the cloned app can be pre-presented on the desktop. The user can trigger a launch request for the cloned app by clicking its icon. In other words, launching a cloned app can be a click on its icon. This click can include pressing the area where the icon is located with the user's finger, and is not limited to this. Of course, it is understood that the main app and other app icons can also be presented on the desktop simultaneously with the cloned app's icon.
[0200] In some embodiments, users can also trigger a launch request for the cloned application by long-pressing or double-clicking the application icon of the cloned application on the desktop. This application embodiment does not specifically limit the triggering method for the launch request of the cloned application. The specific implementation method is similar to the implementation method of clicking the application icon of the cloned application on the desktop described above. Please refer to the relevant content on the implementation method of clicking the application icon of the cloned application on the desktop; this application embodiment will not repeat it here.
[0201] In this embodiment of the application, the launch request may include the clone application identifier of the clone application. After the mobile phone obtains the launch request, it can determine the clone application identifier of the clone application corresponding to the launch request, and then determine the clone application corresponding to the launch request based on the clone application identifier.
[0202] S602: The mobile phone obtains the clone application information of the clone application, which includes the clone application identifier (as an example of the first application identifier) and the clone application sandbox path (as an example of the first resource path).
[0203] In this embodiment, the mobile phone can search for and obtain the clone application information of the clone application from the corresponding application package information based on the clone application identifier of the clone application. The specific content of the clone application information can be referred to the relevant content in the embodiments shown in Figures 4 and 5, and will not be repeated here.
[0204] It should be noted that in practical applications, the above steps S601 and S602 can be executed by the mobile phone's operation management service. The specific method for obtaining clone application information will be described in detail later.
[0205] S603: The mobile phone creates a clone application process corresponding to the clone application based on the clone application identifier.
[0206] In this embodiment, after obtaining the cloned application information, the mobile phone can determine information related to process incubation based on the cloned application information, such as including but not limited to cloned application identifier, user identifier, access identifier, and application package name. The mobile phone can also incubate the cloned application process corresponding to the cloned application identifier based on the determined process incubation-related information, and can write the cloned application identifier, user identifier, access identifier, and application package name into the corresponding process information.
[0207] S604: The mobile phone uses the clone application sandbox path to build a clone application sandbox (as an example of the running environment) in conjunction with the installation package of the main application when running the clone application process, so as to run the clone application process in the clone application sandbox.
[0208] In this embodiment, when running a cloned application process, the mobile phone can mount the cloned application sandbox path to the cloned application process created based on the cloned application identifier, and load the relevant resources of the main application's installation package into the cloned application process to obtain the cloned application sandbox. This cloned application sandbox can serve as an isolated environment for the cloned application process running the corresponding cloned application, and the cloned application sandbox path can be used to store files generated during the execution of the cloned application process.
[0209] It should be noted that, in practical applications, the cloned application processes in steps S603 and S604 above can be incubated by the process incubation module in the mobile phone. Furthermore, other aspects of steps S601 to S604 above can be found in the embodiments shown in Figures 4 and 5, and will not be repeated here.
[0210] As can be understood, in this embodiment, after receiving a user's request to launch a cloned application, the mobile phone can incubate a corresponding cloned application process based on the cloned application's identifier, and mount the cloned application's independent sandbox according to the cloned application's application sandbox path. This allows the cloned application process to run in an independent runtime environment different from the main application process, making the main application and the cloned application independent and unrelated to each other. In other words, the cloned application is treated like a regular application; it will only be uninstalled if the user actively uninstalls it. Uninstalling the main application will not uninstall the cloned application, making it more convenient for users and improving the user experience.
[0211] In one possible embodiment, the method may further include: when the cloned application process executes a process command that requires permission, querying the permission management data for the cloned application process corresponding to the cloned application identifier (as an example of the first permission); when the query result of the cloned application process permission indicates that the cloned application process has the permission to execute the process command, executing the process command.
[0212] In one possible embodiment, the method may further include: when the main application process corresponding to the main application executes a process command, determining the main application identifier of the main application (as an example of a second application identifier), which is different from the clone application identifier; querying the main application process permissions corresponding to the main application identifier (as an example of a second permission) from the permission management data based on the main application identifier; and executing the process command when the query result of the main application process permissions indicates that the main application process has the permission to execute the process command.
[0213] In this embodiment, the mobile phone can independently manage the permissions of the main application and the cloned application based on the application identifier. When the main application process or the cloned application process executes a process command that requires permissions, the corresponding permissions can be queried based on the application identifier. The process command is executed only if the main application process or the cloned application process has the permissions; otherwise, the execution of the process command is abandoned.
[0214] In some examples, the phone may also include an application permission management service. This service can be exemplified as AccessTokenManager (ATManager). This service manages permission information for all application processes. It stores permission management data for each application process (including the main application process and cloned application processes) in a database. When a cloned application process executes a command requiring permissions, the phone's runtime management service generates a permission query request based on the cloned application's identifier and sends it to the application permission management service. Upon receiving the request, the service identifies the cloned application using its identifier, queries the permission management data to determine its permissions, and sends the query result back to the runtime management service. The runtime management service only allows the cloned application process to execute the command if the query result indicates that the cloned application process has the corresponding permissions; otherwise, it abandons the execution of the command.
[0215] It should be noted that, in this embodiment of the application, the permissions of the main application process and the permissions of the cloned application processes maintained by the application permission management service can be different or the same; this embodiment of the application does not impose specific restrictions on this. The method for querying the permissions of the main application process is similar to the method for querying the permissions of the cloned application; please refer to the relevant content on querying the permissions of the cloned application described above, and this implementation will not be repeated here.
[0216] It is understood that the embodiments of this application use application identifiers to perform separate permission management, thereby realizing independent permission management for applications. The permissions of the main application and the cloned applications are isolated, and the permission information between different applications will not be synchronized, further reducing the dependency between the cloned applications and the main application.
[0217] In one possible embodiment, application notifications, sharing, power consumption statistics, application locks, etc., can all be presented independently based on application identifiers to further reduce the dependency between cloned applications and the main application. The specific presentation method is similar to the implementation method of permission management; please refer to the relevant content on the implementation method of permission management, which will not be elaborated upon here.
[0218] The following description, in conjunction with the system architecture of a mobile phone and its modules, further illustrates the clone application launch method provided in this application embodiment. Referring to Figure 7a, which shows a flowchart of a clone application launch method provided in a specific embodiment of this application, it is a further illustration of the embodiment shown in Figure 6. The method may include steps S701-S711.
[0219] S701: The desktop application responds to the user's launch operation for the cloned application by generating a launch request for the cloned application.
[0220] In this embodiment of the application, the desktop application can detect a user's launch operation for a cloned application, and generate a launch request for the cloned application when the launch operation is detected.
[0221] For example, a desktop application can display the cloned application's icon on the desktop. A user can trigger a launch request for the cloned application by clicking its icon. In other words, launching a cloned application can be a click on its icon on the desktop. The desktop application can detect this click and, upon detection, generate a launch request for the corresponding cloned application in response.
[0222] The action of clicking on the application icon of a cloned application on the desktop can include the user's finger pressing on the area where the application icon is located, and is not limited to this.
[0223] In some embodiments, users can also trigger a launch request for the cloned application by long-pressing or double-clicking the application icon of the cloned application on the desktop. This application embodiment does not specifically limit the triggering method for the launch request of the cloned application. The specific implementation method is similar to the implementation method of clicking the application icon of the cloned application on the desktop described above. Please refer to the specific content of the implementation method of clicking the application icon of the cloned application on the desktop; it will not be repeated here.
[0224] In this embodiment, when the desktop application detects a user's launch operation for a cloned application, it can respond to the launch operation and determine the cloned application to which the launch operation is targeted. The desktop application can obtain the cloned application identifier (as an example of the first application identifier) and generate a launch request corresponding to the cloned application based on the cloned application identifier. That is, the launch request can contain the cloned application identifier, and thus the cloned application corresponding to the launch request can be determined based on the cloned application identifier.
[0225] S702: The desktop application sends a startup request to the Runtime Management Service.
[0226] In this embodiment, the desktop application can send a startup request to the runtime management service by calling the "Start a clone application" interface provided by the runtime management service. Correspondingly, the runtime management service can receive the startup request sent by the desktop application.
[0227] For example, a desktop application can use the startAbilityWithIndex method to call the Startup clone application interface provided by the Runtime Management Service to send a startup request to the Runtime Management Service.
[0228] S703: The Runtime Management Service responds to the startup request and identifies the clone application corresponding to the startup request.
[0229] In this embodiment of the application, since the startup request may contain the clone application identifier of the clone application, the operation management service can respond to the startup request, determine the clone application identifier of the clone application corresponding to the startup request, determine the clone application corresponding to the startup request based on the clone application identifier, and then query the clone application information of the clone application based on the clone application identifier.
[0230] S704: The runtime management service generates an information query request for the cloned application, which is used to query the cloned application information.
[0231] In this embodiment, after the runtime management service identifies the startup of a cloned application through the cloned application identifier, it can generate a corresponding information query request based on the cloned application identifier, and then query the cloned application information from the package management service. In other words, the information query request can include the cloned application identifier, and the cloned application information can be obtained based on this identifier.
[0232] S705: The operation management service sends the information query request to the package management service.
[0233] In this embodiment, the operation management service can send an information query request to the package management service by calling the information query interface provided by the package management service. Correspondingly, the package management service can receive the information query request sent by the operation management service.
[0234] S706: In response to the information query request, the package management service retrieves the clone application information of the clone application, which includes the clone application identifier and the clone application sandbox path (as an example of the first resource path).
[0235] In this embodiment, since the information query request includes the clone application identifier of the clone application, the package management service, upon receiving the information query request, can search the database for the application package information corresponding to the clone application identifier, and obtain the clone application information of the clone application from the application package information. The specific content of the clone application information can be referred to the relevant content in the embodiments shown in Figures 4 and 5, and will not be repeated here.
[0236] S707: The package management service sends the queried clone application information to the operation management service.
[0237] In this embodiment, the package management service can send the queried clone application information to the operation management service. Correspondingly, the operation management service can receive the clone application information sent by the package management service, thereby obtaining the clone application information of the clone application corresponding to the user's launch request.
[0238] S708: The Runtime Management Service generates a process creation request for the cloned application based on the cloned application information.
[0239] In this embodiment, the package management service can determine information related to process incubation based on the cloned application information, and generate a process creation request for the cloned application based on the information related to process incubation. This information related to process incubation may include, but is not limited to, the application package name (bundleName), user identifier (UID), access identifier (TokenID), and cloned application identifier.
[0240] For example, assuming the cloned application to be launched is an office application of a certain application, the runtime management service can query the application package name "com.xxx.xxx", the user identifier UID "2000002", the access identifier TokenID "0x2222", and the application identifier AppIndex 1 corresponding to the office application. The runtime management service can use the above information as information related to process incubation, and generate a process creation request for the cloned application based on the above information, thereby creating the cloned application process corresponding to the cloned application.
[0241] S709: The Runtime Management Service sends the process creation request to the Process Incubation Module.
[0242] In this embodiment, the runtime management service can send a process creation request to the process incubation module. Correspondingly, the process incubation module can receive the process creation request sent by the runtime management service, thereby obtaining information related to process incubation. For example, the runtime management service can send the process creation request to the process incubation module using the StartProcess method.
[0243] It should be noted that in practical applications, the operation management service may include an Ability lifecycle management module. All the steps executed by the operation management service (i.e., steps S703 to S705, as well as steps S708 and S709) can be executed by the Ability lifecycle management module.
[0244] S710: In response to the process creation request, the process incubation module determines the clone application identifier of the clone application corresponding to the process creation request, and creates the clone application process corresponding to the clone application based on the clone application identifier.
[0245] In this embodiment of the application, after the process incubation module obtains the process creation request, it can identify the clone application identifier of the clone application corresponding to the process creation request, and incubate the clone application process corresponding to the clone application identifier. It can also write information such as clone application identifier, user identifier, access identifier and application package name into the corresponding process information.
[0246] In some examples, a clone application process corresponding to a clone application identifier can be hatched by calling the `fork()` function. The `fork()` function creates a new process that is a child process of the original process by completely copying the memory contents of the current process to another region of memory. In other words, if the original parent process executes to a certain point in its code, the child process created by `fork()` will also begin execution from that point, with identical memory usage. The specific hatching process of calling the `fork()` function will not be described in detail in this embodiment.
[0247] It is understood that in this embodiment of the application, after obtaining the user's launch request for the cloned application, the cloned application identifier in the launch request can be determined, thereby identifying the cloned application to be launched, and the cloned application information can be obtained based on the cloned application identifier, and then the corresponding cloned application can be launched. The implementation method is simple, highly universal, and has little impact on system performance.
[0248] S711: The process incubation module, based on the clone application sandbox path corresponding to the clone application identifier, works with the main application's installation package to build a clone application sandbox (as an example of the runtime environment) for the clone application process when running the clone application process, so as to run the clone application process in the clone application sandbox.
[0249] In this embodiment, when running a cloned application process, the process incubation module can mount the cloned application sandbox path to the cloned application process created based on the cloned application identifier, and load the relevant resources of the main application's installation package into the cloned application process to obtain the cloned application sandbox. This cloned application sandbox can serve as an isolated environment for the cloned application process running the corresponding cloned application, and the cloned application sandbox path can be used to store files generated during the execution of the cloned application process.
[0250] In practical applications, a sandbox, also known as a sandbox environment, is a mechanism that provides isolated execution for target objects (such as programs). It can be implemented using virtualization technology, such as virtual machines or containers. It is a virtual system program with an independent sandbox runtime environment for the target object. This sandbox environment includes the sandbox configuration for running the target object, allowing it to run within a specified space. It provides an isolated environment for running target objects, ensuring that file operations such as creation, modification, deletion, and reading of the target object are performed within this isolated environment without affecting target objects in non-sandbox environments (such as the local environment).
[0251] In other words, a sandbox essentially runs a target object within a virtual runtime environment. Sandboxes can be implemented using the phone's actual operating system or a virtual machine. Through the isolation provided by the sandbox, the target object within the sandbox can only access resources within the sandbox and cannot access other resources on the phone, thus ensuring device security and stability.
[0252] It should be noted that "sandbox" is merely a term used in this embodiment, and its meaning has been described in this embodiment. Its name does not constitute any limitation on this embodiment, and it can also be referred to as other terms. Other content related to the sandbox will not be elaborated upon in this embodiment.
[0253] It should be noted that in practical applications, the process incubation module may include an application directory mounting management module, which can execute the above steps S710 and S711.
[0254] It is understood that, using the method provided in this application embodiment, the main application and clone applications of the same application can be incubated into corresponding application processes, and corresponding application sandboxes can be attached, thereby allowing the main application and clone applications to run in different application sandboxes. For example, referring to Figure 7b of the specification, Figure 7b shows a schematic diagram of application processes and corresponding sandboxes provided in an embodiment of this application. As shown in Figure 7b, for a certain application, when a user clicks the application icon to launch the main application (personal application), an application process corresponding to the personal application can be incubated, denoted as XXperson (index=0), and the corresponding application sandbox (i.e., the main application sandbox) can be attached for logging into the user's personal account. After the personal application is launched, if the user clicks the application icon to launch the clone application (office application), an application process corresponding to the office application can be incubated, denoted as XXoffice (index=1), and the corresponding application sandbox (i.e., the clone application sandbox) can be attached for logging into the user's office account. At this point, an application can run two application processes: the application process for XX Personal (index=0) and the application process for XX Office (index=1), and these two application processes run in independent application sandboxes. Each application process can include one or more Abilities.
[0255] It should be noted that other contents of steps S701 to S711 above can be referred to the relevant contents of the embodiments shown in Figures 4 to 6, and will not be repeated here in the embodiments of this application.
[0256] This application also provides a clone application creation device. Referring to FIG8, FIG8 shows a schematic diagram of the structure of a clone application creation device 800 provided in an embodiment of this application. The device 800 can be disposed in an electronic device. As shown in FIG8, the device 800 may include:
[0257] The determination module 810 is used to determine the main application corresponding to the user's request to create a clone of the main application.
[0258] The generation module 820 is used to generate clone application information for the clone application based on the application configuration information corresponding to the main application. The clone application information includes the clone application identifier (as an example of the first application identifier) and the clone application sandbox path (as an example of the first resource path). The clone application identifier is used to create the corresponding clone application process when the clone application is started, and the clone application sandbox path is different from the main application sandbox path of the main application (as an example of the second resource path).
[0259] The first creation module 830 is used to add clone application information to the application package information corresponding to the main application and create a clone application based on the clone creation request.
[0260] This application also provides a clone application launching device. Referring to FIG9, FIG9 shows a schematic diagram of the structure of a clone application launching device 900 provided in an embodiment of this application. The device 900 can be installed in an electronic device. As shown in FIG9, the device 900 may include:
[0261] The acquisition module 910 is used to respond to the user's launch request for the cloned application and acquire the cloned application information, which includes the cloned application identifier (as an example of the first application identifier) and the cloned application sandbox path (as an example of the first resource path). The cloned application sandbox path is different from the main application sandbox path of the main application corresponding to the cloned application (as an example of the second resource path).
[0262] The second creation module 920 is used to create a clone application process corresponding to the clone application based on the clone application identifier;
[0263] Module 930 is used to build the runtime environment of the cloned application based on the sandbox path of the cloned application, in conjunction with the installation package of the main application, so as to run the cloned application process in the runtime environment.
[0264] This application also provides an electronic device, including:
[0265] Memory, used to store instructions executed by one or more processors of an electronic device, and
[0266] The processor, when executing instructions in memory, can cause the electronic device to perform the methods shown in Figures 4 to 7a in the above embodiments.
[0267] This application also provides a computer-readable storage medium storing instructions that, when executed by a processor, cause the processor to perform the methods shown in Figures 4 to 7a of the above embodiments.
[0268] This application also provides a computer program product containing instructions that, when run on an electronic device, cause a processor to execute the methods shown in Figures 4 to 7a of the above embodiments.
[0269] Referring to Figure 10, a block diagram of an electronic device 1000 according to one embodiment of this application is shown. The electronic device 1000 may include one or more processors 1001 coupled to a controller hub 1003. In at least one embodiment, the controller hub 1003 communicates with the processor 1001 via a multi-branch bus such as a Front Side Bus (FSB), a point-to-point interface such as a Quick Path Interconnect (QPI), or a similar connection 1006. The processor 1001 executes instructions controlling general types of data processing operations. In one embodiment, the controller hub 1003 includes, but is not limited to, a Graphics Memory Controller Hub (GMCH) (not shown) and an Input / Output Hub (IOH) (which may be on a separate chip) (not shown), wherein the GMCH includes memory and a graphics controller and is coupled to the IOH.
[0270] The electronic device 1000 may also include a coprocessor 1002 and a memory 1004 coupled to a controller hub 1003. Alternatively, one or both of the memory and the GMCH may be integrated within the processor (as described in this application), with the memory 1004 and the coprocessor 1002 directly coupled to the processor 1001 and the controller hub 1003, which is located on a single chip with the IOH.
[0271] Memory 1004 may be, for example, Dynamic Random Access Memory (DRAM), Phase Change Memory (PCM), or a combination of both. As a computer-readable storage medium, memory 1004 may include one or more tangible, non-transitory computer-readable media for storing data and / or instructions. For example, memory 1004 may include any suitable non-volatile memory such as flash memory and / or any suitable non-volatile storage device, such as one or more hard-disk drives (HDD(s)), one or more compact disc (CD) drives, and / or one or more digital versatile disc (DVD) drives.
[0272] According to some embodiments of this application, the memory 1004, which is a computer-readable storage medium, stores instructions that, when executed on a computer, cause the system 1000 to execute the clone application creation method or clone application startup method according to the above embodiments. Specifically, refer to the methods shown in Figures 4 to 7a in the above embodiments, which will not be repeated here.
[0273] In one embodiment, the coprocessor 1002 is a dedicated processor, such as, for example, a high-throughput many-integrated-core (MIC) processor, a network or communication processor, a compression engine, a graphics processor, a general-purpose graphics processor (GPGPU), or an embedded processor, etc. Optional properties of the coprocessor 1002 are indicated by dashed lines in Figure 10.
[0274] In one embodiment, the electronic device 1000 may further include a Network Interface Controller (NIC) 1006. The network interface 1006 may include a transceiver for providing a radio interface for the electronic device 1000 to communicate with any other suitable device (such as a front-end module, antenna, etc.). In various embodiments, the network interface 1006 may be integrated with other components of the electronic device 1000. The network interface 1006 can implement the functions of the communication unit in the above embodiments.
[0275] Electronic device 1000 may further include input / output (I / O) device 1005. I / O 1005 may include: a user interface designed to enable a user to interact with electronic device 1000; a peripheral component interface designed to enable peripheral components to interact with electronic device 1000; and / or sensors designed to determine environmental conditions and / or location information related to electronic device 1000.
[0276] It is worth noting that Figure 10 is merely exemplary. That is, although Figure 10 shows an electronic device 1000 including multiple devices such as a processor 1001, a controller hub 1003, and a memory 1004, in actual applications, devices using the methods of this application may include only a subset of the devices in the electronic device 1000; for example, it may only include the processor 1001 and the network interface 1006. The nature of the optional devices in Figure 10 is shown with dashed lines.
[0277] Referring to Figure 11, a block diagram of a SoC (System on Chip) 1100 according to an embodiment of this application is shown. In Figure 11, similar components have the same reference numerals. Additionally, dashed boxes represent optional features of more advanced SoCs. In Figure 11, the SoC 1100 includes: an interconnect unit 1150 coupled to a processor 1110; a system proxy unit 1170; a bus controller unit 1180; an integrated memory controller unit 1140; a group or one or more coprocessors 1120, which may include integrated graphics logic, an image processor, an audio processor, and a video processor; a static random access memory (SRAM) unit 1130; and a direct memory access (DMA) unit 1160. In one embodiment, the coprocessor 1120 includes a dedicated processor, such as, for example, a network or communication processor, a compression engine, a GPGPU, a high-throughput MIC processor, or an embedded processor.
[0278] The static random access memory (SRAM) cell 1130 may include one or more tangible, non-transitory computer-readable storage media for storing data and / or instructions. The computer-readable storage media may store instructions, specifically, temporary and permanent copies of those instructions. These instructions may include, when executed by at least one unit in the processor, causing the SoC 1100 to perform the clone application creation method or clone application launch method according to the above embodiments, specifically referring to the methods shown in Figures 4 to 7a in the above embodiments, which will not be repeated here.
[0279] The various embodiments of the mechanisms disclosed in this application can be implemented in hardware, software, firmware, or a combination of these implementation methods. Embodiments of this application can be implemented as computer programs or program code executable on a programmable system, the programmable system including at least one processor, a storage system (including volatile and non-volatile memory and / or storage elements), at least one input device, and at least one output device.
[0280] Program code can be applied to input instructions to execute the functions described in this application and generate output information. The output information can be applied to one or more output devices in a known manner. For the purposes of this application, the processing system includes any system having a processor such as, for example, a Digital Signal Processor (DSP), a microcontroller, an Application Specific Integrated Circuit (ASIC), or a microprocessor.
[0281] The program code can be implemented using a high-level procedural language or an object-oriented programming language to communicate with the processing system. Assembly language or machine language can also be used when needed. In fact, the mechanisms described in this application are not limited to any particular programming language. In either case, the language can be a compiled language or an interpreted language.
[0282] In some cases, the disclosed embodiments may be implemented in hardware, firmware, software, or any combination thereof. The disclosed embodiments may also be implemented as instructions carried or stored thereon on one or more temporary or non-temporary machine-readable (e.g., computer-readable) storage media, which may be read and executed by one or more processors. For example, the instructions may be distributed via a network or through other computer-readable media. Therefore, machine-readable media may include any mechanism for storing or transmitting information in a machine-readable (e.g., computer-readable) form, including but not limited to floppy disks, optical disks, CD-ROMs, compact disc read-only memory (CD-ROMs), magneto-optical disks, read-only memory (ROM), random access memory (RAM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), magnetic cards or optical cards, flash memory, or tangible machine-readable storage for transmitting information (e.g., carrier waves, infrared signals, digital signals, etc.) using the Internet in the form of electrical, optical, acoustic, or other forms of propagated signals. Therefore, machine-readable media includes any type of machine-readable medium suitable for storing or transmitting electronic instructions or information in a machine-readable (e.g., computer-readable) form.
[0283] In the accompanying drawings, some structural or methodological features may be shown in a specific arrangement and / or order. However, it should be understood that such a specific arrangement and / or order may not be necessary. Rather, in some embodiments, these features may be arranged in a manner and / or order different from that shown in the accompanying drawings. Furthermore, including structural or methodological features in a particular figure does not imply that such features are required in all embodiments, and in some embodiments, these features may be omitted or may be combined with other features.
[0284] It should be noted that all units / modules mentioned in the device embodiments of this application are logical units / modules. Physically, a logical unit / module can be a physical unit / module, a part of a physical unit / module, or a combination of multiple physical units / modules. The physical implementation of these logical units / modules themselves is not the most important factor; the combination of functions implemented by these logical units / modules is the key to solving the technical problems proposed in this application. Furthermore, to highlight the innovative aspects of this application, the above-described device embodiments of this application have not introduced units / modules that are not closely related to solving the technical problems proposed in this application. This does not mean that the above-described device embodiments do not contain other units / modules.
[0285] It should be noted that in the examples and description of this application, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one" does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
Claims
1. A method for creating cloned applications, applied to electronic devices, characterized in that, The method comprises: in response to a user's request for creating a clone of a main application, determining the main application corresponding to the request; based on application configuration information corresponding to the main application, generating clone application information of a clone application, the clone application information comprising a first application identifier of the clone application and a first resource path; wherein the first application identifier is used to create a corresponding clone application process when the clone application is started, and the first resource path is different from a second resource path of the main application; adding the clone application information in application package information corresponding to the main application, and creating the clone application based on the request.
2. The method of claim 1, wherein, The method further comprises: based on the application configuration information, determining an application package name corresponding to the main application; based on the application configuration information, configuring a first application identifier corresponding to the clone application; based on the application package name and the first application identifier, creating a first resource path of the clone application; wherein the first resource path is used to store files corresponding to the clone application, and to build a running environment of the clone application in cooperation with an installation package of the main application when the clone application process is run.
3. The method of claim 1, wherein, The method further comprises: in the case that the main application supports an application cloning function, generating clone application information of a clone application based on application configuration information corresponding to the main application.
4. The method of claim 1, wherein, The method further comprises: outputting notification information that the clone application installation is completed, the notification information being used to indicate that an application icon of the clone application is displayed on a desktop.
5. A method for starting a clone application, applied to an electronic device, comprising: The method comprises: in response to a user's request for starting a clone application, obtaining clone application information of the clone application, the clone application information comprising a first application identifier of the clone application and a first resource path, the first resource path being different from a second resource path of a main application corresponding to the clone application; based on the first application identifier, creating a clone application process corresponding to the clone application; based on the first resource path, building a running environment of the clone application in cooperation with an installation package of the main application when the clone application process is run, so as to run the clone application process in the running environment.
6. The method of claim 5, wherein, The method further comprises: in response to a user's request for starting a clone application, determining a first application identifier of the clone application corresponding to the request; querying the clone application information of the clone application according to the first application identifier.
7. The method of claim 5, wherein, The method further comprises: when the clone application process executes a process command that requires permission, querying a first permission corresponding to the first application identifier from permission management data according to the first application identifier; when the query result of the first permission indicates that the clone application process has the permission to execute the process command, executing the process command.
8. The method of claim 7, wherein, The method further comprises: When the main application corresponding to the main application process executes the process command, a second application identifier of the main application is determined, the second application identifier being different from the first application identifier; According to the second application identifier, a second permission corresponding to the second application identifier is queried from permission management data; When the query result of the second permission indicates that the main application process has the permission to execute the process command, the process command is executed.
9. The method of claim 8, wherein, The second permission is different from the first permission.
10. An electronic device, comprising: Comprise: A memory for storing instructions executed by one or more processors of the electronic device; When the processor executes the instructions in the memory, the electronic device can execute the method for creating a secondary application according to any one of claims 1-4, or execute the method for starting a secondary application according to any one of claims 5-9.
11. A computer readable storage medium, characterized in that, The computer readable storage medium stores instructions, which, when executed on a computer, cause the computer to execute the method for creating a secondary application according to any one of claims 1-4, or execute the method for starting a secondary application according to any one of claims 5-9.
Citation Information
Patent Citations
Multi-tasking method for application program and terminal
CN105224322A
Right control method and device of application program and mobile terminal
CN106485135A
Mobile terminal control method, mobile terminal and storage medium
CN112434283A
Application duplication method and device and electronic equipment
CN117667116A