Method and device for optimizing cloud application startup speed

By mounting the application files and resource files in the host host into the container in the cloud application, the dex optimization process is avoided, and the problems of increased startup time and lag in the cloud application are solved, achieving faster startup speed and lower storage usage.

CN119376819BActive Publication Date: 2025-04-15BEIJING HAIYUDONGXIANG TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202411909731.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-24
Publication Date
2025-04-15
Estimated Expiration
2044-12-24

AI Technical Summary

Technical Problem

The problem of increased startup time and lag in cloud applications is mainly due to the removal of the dex optimization process during the installation of applications in containers, which causes resource file access to pass through the network, which affects startup speed and performance.

Method used

By installing the base.apk package and OAT files of the application in the host host into the container, and using joint mount technology to mount the directory in the host host to the default installation package directory, data resource directory and sdcard resource directory of the application in the container, the dex optimization process in the container is avoided, so that resource files are accessed directly through disk I/O operations.

Benefits of technology

This improves the startup speed of cloud applications, reduces operational lags, and saves storage space because access to resource files is no longer required to go through the network.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119376819B_ABST
    Figure CN119376819B_ABST
Patent Text Reader

Abstract

The present application provides a method and device for optimizing the startup speed of cloud applications, the method comprising: installing the base.apk package of an application in a host into a container on the host, mapping the seventh directory in the host and the eighth directory in the host to the default data resource directory and the default sdcard resource directory of the application in the container respectively, and starting the application, wherein the application in the container uses the oat file of the application in the host, the process of installing the application in the container removes the dex optimization process, and the data resource file and sdcard resource file of the application exist in the seventh directory and the eighth directory respectively, which can reduce the startup time and operation jam of the cloud application.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of cloud applications, and in particular to a method and device for optimizing the startup speed of cloud applications. Background Art

[0002] Cloud applications (such as cloud games, cloud phones, etc.) are an emerging online application model. It places the application running, rendering and processing processes on a remote cloud server and transmits the application screen to the user's device, allowing users to enjoy high-quality application experience on various devices without the need for high-performance hardware support.

[0003] With the development of cloud applications, mainstream companies use containerization solutions to run Android systems and run applications in containers on cloud servers. In this solution, application data is often stored on storage servers, and multiple containers can share the same application data by mounting the NFS network file system, thereby saving storage space on cloud servers and launching services as soon as possible. When an application loads a large resource file, it accesses the resource file in the storage server through the network. At the same time, in order to complete the installation of the application as quickly as possible, this solution optimizes the installation process of the application in the container and removes the time-consuming dex optimization process. This results in an increase in the startup time of the application under this solution, and problems such as operation jams.

[0004] Therefore, how to provide a solution to reduce the startup time and operation delay of cloud applications has become a technical problem that needs to be solved urgently. Summary of the invention

[0005] In view of the technical problems existing in the prior art, the embodiments of the present application provide a method and device for optimizing the startup speed of cloud applications.

[0006] In a first aspect, an embodiment of the present application provides a method for optimizing the startup speed of a cloud application, comprising:

[0007] S10, install the base.apk package of the application in the host into the container on the host, use the joint mounting technology to mount the first directory in the host as the lower layer and the second directory in the container as the upper layer to the directory where the oat file is located under the default installation package directory of the application in the container, and mount the third directory in the host as the lower layer and the fourth directory in the container as the upper layer to the default data resource directory of the application in the container, mount the fifth directory in the host as the lower layer and the sixth directory in the container as the upper layer to the default sdcard resource directory of the application in the container, and start the application, wherein the dex optimization process is removed during the installation of the application in the container, the oat file of the application exists in the first directory, and the data resource file and sdcard resource file of the application exist in the third directory and the fifth directory respectively; and / or

[0008] S11. Install the base.apk package of the application in the host into the container on the host, map the seventh directory in the host and the eighth directory in the host to the default data resource directory and the default sdcard resource directory of the application in the container respectively, and start the application. The application in the container uses the oat file of the application in the host. The process of installing the application in the container removes the dex optimization process. The data resource file and sdcard resource file of the application exist in the seventh directory and the eighth directory respectively.

[0009] In a second aspect, an embodiment of the present application further provides a device for optimizing the startup speed of a cloud application, including:

[0010] The first startup unit is used to install the base.apk package of the application in the host into the container on the host, and use the joint mounting technology to mount the first directory in the host as the lower layer and the second directory in the container as the upper layer to the directory where the oat file is located under the default installation package directory of the application in the container, and to mount the third directory in the host as the lower layer and the fourth directory in the container as the upper layer to the default data resource directory of the application in the container, and to mount the fifth directory in the host as the lower layer and the sixth directory in the container as the upper layer to the default sdcard resource directory of the application in the container to start the application, wherein the dex optimization process is removed during the process of installing the application in the container, the oat file of the application exists in the first directory, and the data resource file and sdcard resource file of the application exist in the third directory and the fifth directory respectively; and / or

[0011] The second startup unit is used to install the base.apk package of the application in the host into the container on the host, map the seventh directory in the host and the eighth directory in the host to the default data resource directory and the default sdcard resource directory of the application in the container respectively, and start the application, wherein the application in the container uses the oat file of the application in the host, and the process of installing the application in the container removes the dex optimization process, and the data resource file and sdcard resource file of the application exist in the seventh directory and the eighth directory respectively.

[0012] In a third aspect, an embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the method for optimizing the startup speed of cloud applications as described in the first aspect are executed.

[0013] In a fourth aspect, an embodiment of the present application further provides an electronic device, comprising: a processor, a storage medium and a bus, wherein the storage medium stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor communicates with the storage medium through the bus, and the processor executes the machine-readable instructions to perform the steps of the method for optimizing the startup speed of cloud applications as described in the first aspect.

[0014] In summary, the method and device for optimizing the startup speed of cloud applications provided in the embodiments of the present application place the files in the default installation package directory of the application after the application is normally installed (i.e., the base.apk package and the oat file) in the host host, and also place the resource files of the application in the host host (i.e., in the third directory and the fifth directory, and / or in the seventh directory and the eighth directory), and realize the use of the application data in the host by the application in the container through mounting. In this way, the dex optimization process can be omitted when the application in the container is installed, thereby ensuring a faster installation speed of the application. At the same time, dex optimization does not need to be performed during the startup and operation of the application. The access to the resource files is performed through disk I / O operations, and there is no need to access the data in the storage server through the network. Therefore, the startup speed of the cloud application can be improved and the operation jams can be reduced. BRIEF DESCRIPTION OF THE DRAWINGS

[0015] Figure 1 A flowchart of an embodiment of a method for optimizing cloud application startup speed provided in an embodiment of the present application;

[0016] Figure 2 A schematic diagram of a structure of an embodiment of a device for optimizing cloud application startup speed provided in an embodiment of the present application;

[0017] Figure 3A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0018] To make the purpose, technical scheme and advantages of the embodiments of the present application clearer, the technical scheme in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. It should be understood that the drawings in the present application only serve the purpose of explanation and description and are not used to limit the scope of protection of the present application. In addition, it should be understood that the schematic drawings are not drawn in real proportion. The flowchart used in this application shows the operations implemented according to some embodiments of the present application. It should be understood that the operations of the flowchart can be implemented out of sequence, and the steps without logical context can be reversed in order or implemented simultaneously. In addition, those skilled in the art can add one or more other operations to the flowchart under the guidance of the content of the present application, or remove one or more operations from the flowchart.

[0019] In addition, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. The components of the embodiments of the present application described and shown in the drawings here can be arranged and designed in various configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the application claimed for protection, but merely represents the selected embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present application.

[0020] It should be noted that the term "comprising" will be used in the embodiments of the present application to indicate the existence of the features declared thereafter, but does not exclude the addition of other features.

[0021] Reference Figure 1 As shown, an embodiment of the present application provides a flow chart of a method for optimizing the startup speed of a cloud application, the method comprising:

[0022] S10, install the base.apk package of the application in the host into the container on the host, use the joint mounting technology to mount the first directory in the host as the lower layer and the second directory in the container as the upper layer to the directory where the oat file is located under the default installation package directory of the application in the container, and mount the third directory in the host as the lower layer and the fourth directory in the container as the upper layer to the default data resource directory of the application in the container, mount the fifth directory in the host as the lower layer and the sixth directory in the container as the upper layer to the default sdcard resource directory of the application in the container, and start the application, wherein the dex optimization process is removed during the installation of the application in the container, the oat file of the application exists in the first directory, and the data resource file and sdcard resource file of the application exist in the third directory and the fifth directory respectively; and / or

[0023] S11. Install the base.apk package of the application in the host into the container on the host, map the seventh directory in the host and the eighth directory in the host to the default data resource directory and the default sdcard resource directory of the application in the container respectively, and start the application. The application in the container uses the oat file of the application in the host. The process of installing the application in the container removes the dex optimization process. The data resource file and sdcard resource file of the application exist in the seventh directory and the eighth directory respectively.

[0024] In this embodiment, for step S10, it should be noted that the oat file of the application exists in the first directory of the host (i.e., the cloud server). Therefore, the dex optimization process can be removed in the process of installing the base.apk package of the application in the host into the container on the host (the dex optimization process will eventually generate an oat file). By using the joint mounting technology, the first directory in the host is used as the lower layer, and the second directory in the container is used as the upper layer, and is mounted to the directory where the oat file is located under the default installation package directory of the application in the container, so that the application startup and operation process in the container can access the oat file in the first directory. In addition, by using the joint mounting technology, the third directory in the host is used as the lower layer, and the fourth directory in the container is used as the upper layer, and is mounted to the default data resource directory of the application in the container, and the fifth directory in the host is used as the lower layer, and the sixth directory in the container is used as the upper layer, and is mounted to the default sdcard resource directory of the application in the container, so that the resource files in the host can be directly accessed through disk I / O operations during the startup and operation of the application in the container. By mounting, the application in the container can read the files in the first directory, the third directory, and the fifth directory during startup and operation, and modify the files in the second directory, the fourth directory, and the sixth directory, so that the oat file, data resource file, and sdcard resource file in the host can be shared by the applications in multiple containers, that is, the storage space of the host can be saved. When the application in the container is started, dex optimization is no longer performed, and the resource file is accessed through disk I / O operations, and the data in the storage server is no longer accessed through the network, so the startup speed of the cloud application can be improved. In addition, the access to resource files during the operation of the application is also performed through disk I / O operations, and it is no longer necessary to access the data in the storage server through the network. Therefore, in the scenario of loading large resource files, the operation jam can be greatly reduced. It should also be noted that when installing an application in a container, the user identifier uid of the application can be fixed or not fixed to a preset value. If the user identification uid of the fixed application is the preset value, the user identification uid of the oat file in the first directory, the data resource file in the third directory, and the user identification uid of the sdcard resource file in the fifth directory (the user identification uid of the file is the user identification uid of the application to which the file belongs) are all preset values, and the installation logic of the application in the container needs to be modified to set the user identification uid of the application written in the process of parsing the base.apk package and writing the application information into the system's package.list to the preset value.If the user identification uid of the application is not fixed to the preset value, when mounting the directory where the oat file is located, the data resource directory, and the sdcard resource directory, it is necessary to pass the user identification uid assigned by the system to the application when the application is installed in the container to the system kernel, and modify the system's file access logic. Specifically, when the application accesses the file under the directory / data resource directory / sdcard resource directory where the oat file is located by calling the system interface, the system determines that the user identification uid passed to the kernel when the corresponding directory is mounted is the same as the user identification uid of the application, and then allows the application to access. This can solve the problem that the application cannot access the file when the user identification uid of the application is different from the user identification uid of the file under the directory / data resource directory / sdcard resource directory where the oat file is located. If the application wants to modify the file under the directory / data resource directory / sdcard resource directory where the oat file is located, it will first copy the file under the directory / data resource directory / sdcard resource directory where the oat file is located to the second directory / fourth directory / sixth directory, and then modify the file under the second directory / fourth directory / sixth directory. This will cause the container to greatly occupy the host's storage space when the file to be modified by the application is large. In order to solve this problem, the solution of step S11 is implemented.

[0025] In step S11, the base.apk package and oat file of the application are stored in the host, and the base.apk package needs to be installed in the container. Since the application in the container uses the oat file of the application in the host, the process of installing the application in the container can remove the dex optimization process. In addition, mapping the seventh directory in the host to the default data resource directory of the application in the container includes: softly connecting the data resource file under the seventh directory to the default data resource directory of the application in the container or mounting the seventh directory to the default data resource directory of the application in the container in a read-write manner; mapping the eighth directory in the host to the default sdcard resource directory of the application in the container includes: softly connecting the sdcard resource file under the eighth directory to the default sdcard resource directory of the application in the container or mounting the eighth directory to the default sdcard resource directory of the application in the container in a read-write manner. By mapping the seventh directory and the eighth directory in the host to the default data resource directory and the sdcard resource directory of the application in the container respectively, the resource files in the host can be directly accessed through disk I / O operations during the startup and operation of the application in the container. Similar to step S10, when the application in the container is started, dex optimization is no longer performed, and resource files are accessed through disk I / O operations, and data in the storage server is no longer accessed through the network, thereby improving the startup speed of cloud applications. In addition, during the startup and operation of the application, access to resource files is also performed through disk I / O operations, and there is no need to access data in the storage server through the network, so in the scenario of loading large resource files, the operation jam can be greatly reduced. If the resource file needs to be modified during the startup and operation of the application, the files under the seventh directory / eighth directory are modified, so the seventh directory / eighth directory cannot be shared by other containers.

[0026] The method for optimizing the startup speed of cloud applications provided in the embodiment of the present application places the files in the default installation package directory of the application after the application is normally installed (i.e., the base.apk package and the oat file) in the host host, and also places the resource files of the application in the host host (i.e., in the third directory and the fifth directory, and / or in the seventh directory and the eighth directory), and enables the application in the container to use the application data in the host through mounting. In this way, the dex optimization process can be omitted when the application in the container is installed, thereby ensuring a faster installation speed of the application. At the same time, dex optimization does not need to be performed during the startup and operation of the application. The access to the resource files is performed through disk I / O operations, and there is no need to access the data in the storage server through the network. Therefore, the startup speed of the cloud application can be improved and the operation jams can be reduced.

[0027] Based on the aforementioned method embodiment, step S10 may further include: when mounting using the joint mounting technology, transmitting the uid allocated by the system to the application when the application is installed in the container to the kernel.

[0028] In this embodiment, it should be noted that when mounting the directory where the oat file is located, the data resource directory, and the sdcard resource directory, the user identifier uid assigned to the application by the system when the application is installed can be passed to the system kernel, and the system's file access logic can be modified (the specific logic implementation can refer to the description in the previous embodiment, which will not be repeated here), so that when the user identifier uid of the application is different from the user identifier uid of the file to be accessed by the application, the application can access the file.

[0029] Based on the aforementioned method embodiment, in step S11, the uid of the application is specified as a preset value during the installation of the application in the container, and the user identifier uid of the oat file of the application in the host host, the files under the seventh directory and the eighth directory is the preset value.

[0030] In this embodiment, it should be noted that when installing an application in a container, it is necessary to fix the user identification uid of the application to a preset value, that is, the user identification uid of the application written in the process of writing the application information into the system's package.list is set to a preset value. At the same time, the user identification uid of the oat file used by the application in the container, the data resource file under the seventh directory, and the sdcard resource file under the eighth directory are all preset values.

[0031] On the basis of the foregoing method embodiment, step S10 installs the base.apk package of the application in the host host into the container on the host host, which may include: mounting the ninth directory in the host host to the directory where the base.apk package is located under the default installation package directory of the application in the container, or soft-connecting the base.apk package under the ninth directory in the host host to the directory where the base.apk package is located under the default installation package directory of the application in the container, and installing the application in the container, wherein the base.apk package exists under the ninth directory;

[0032] Step S11 installs the base.apk package of the application in the host into the container on the host, which may include:

[0033] Mount the tenth directory in the host to the default installation package directory of the application in the container and install the application in the container; or

[0034] Soft-link the base.apk package in the tenth directory of the host to the directory where the base.apk package is located in the default installation package directory of the application in the container, and soft-link the oat file in the tenth directory of the host to the directory where the oat file is located in the default installation package directory of the application in the container, and install the application in the container, wherein the base.apk package and the oat file exist in the tenth directory.

[0035] In this embodiment, in step S10, there is a base.apk package in the ninth directory. In addition to the base.apk package, there may or may not be a lib file of the application in the ninth directory. If there is a lib file of the application in the ninth directory, the base.apk package in the ninth directory in the host host is soft-connected to the directory where the base.apk package is located in the default installation package directory of the application in the container. It can also include: soft-connecting the lib file in the ninth directory to the directory where the lib file is located in the default installation package directory of the application in the container; when installing the application in the container, the installation logic of the application can be modified. Specifically, the base.apk package of the application is no longer copied to the default installation package directory of the application in the container during the installation process, and lib files and oat files are no longer generated, that is, the installation process only requires parsing the base.apk package and writing the application information into the system's package.list, thereby increasing the installation speed of the application. If the application's lib file does not exist in the ninth directory, and the application in the container cannot use the application's lib file, the process of generating the lib file needs to be retained when installing the application in the container, that is, the installation process only requires decompressing the base.apk package, generating the lib file, parsing the base.apk package, and writing the application information into the system's package.list. Compared with the normal application installation process, the process of copying the base.apk package to the default installation package directory of the application in the container (this process takes a long time) is omitted, and the application installation speed can still be improved.

[0036] In step S11, there are base.apk packages and oat files in the tenth directory. In addition to the base.apk packages and oat files, there may or may not be lib files of the application in the tenth directory. If there are lib files of the application in the tenth directory, the base.apk package in the tenth directory in the host is soft-connected to the directory where the base.apk package is located in the default installation package directory of the application in the container, and the oat file in the tenth directory in the host is soft-connected to the directory where the oat file is located in the default installation package directory of the application in the container. It can also include: soft-connecting the lib file in the tenth directory in the host to the directory where the lib file is located in the default installation package directory of the application in the container; when installing the application in the container, the installation logic of the application can be modified. Specifically, during the installation process, the base.apk package of the application is no longer copied to the default installation package directory of the application in the container, and lib files and oat files are no longer generated, that is, the installation process only needs to parse the base.apk package and write the application information into the system's package.list, thereby improving the installation speed of the application. If the application's lib file does not exist in the tenth directory and the application in the container cannot use the application's lib file, the process of generating the lib file needs to be retained when installing the application in the container. That is, the installation process only requires decompressing the base.apk package, generating the lib file, parsing the base.apk package, and writing the application information into the system's package.list, which can still improve the application installation speed.

[0037] Based on the aforementioned method embodiment, step S10 may also include: writing the user's login information file into the fourth directory or the sixth directory; step S11 may also include: writing the user's login information file into the seventh directory or the eighth directory, and after writing, the uid of the login information file is the preset value.

[0038] In this embodiment, it should be noted that in order to realize the login-free function of the user using the cloud application, the user's login information file can be uploaded to the storage server when the user exits the cloud application for the first time / once. When the user subsequently applies to use the cloud application, after mounting the resource directory, the user's login information file in the storage server is downloaded and written to the corresponding directory. Specifically, for step S10, the user's login information file needs to be written to the fourth directory or the sixth directory; for step S11, the user's login information file needs to be written to the seventh directory or the eighth directory. In addition, it should be noted that in order to ensure that the application can access the login information file, in step S11, the uid of the login information file after writing is the preset value.

[0039] Based on the foregoing method embodiment, step S11 may further include: after the user exits, deleting the newly added files in the seventh directory and the eighth directory, and restoring the modified files in the seventh directory and the eighth directory.

[0040] In this embodiment, it should be noted that after the user exits, in order for other users to use the cloud application normally through the same container, the newly added files in the seventh and eighth directories need to be deleted, and the modified files in the seventh and eighth directories need to be restored. When restoring, the original files can be copied from the data source to the seventh and eighth directories, and the files can be replaced.

[0041] Based on the foregoing method embodiment, the method may further include:

[0042] The eleventh directory in the storage server is used as a lower layer, and the twelfth directory in the container is used as an upper layer, and is mounted to the directory where the default specified resource file of the application in the container is located, wherein the specified resource file exists under the eleventh directory.

[0043] In this embodiment, it should be noted that in order to further save storage space in the host, some resource files (such as language pack files, etc.) can be placed in the storage server, and multiple containers can share these resource files through mounting.

[0044] Based on the foregoing method embodiment, the method may further include:

[0045] Mount the installation package directory of the application in the storage server to the thirteenth directory in the host host, use the thirteenth directory to install the application in the host host, copy the files under the default installation package directory of the application in the host host to the ninth directory and the first directory in the host host and / or copy the files under the default installation package directory of the application in the host host to the tenth directory in the host host, wherein the base.apk package of the application is located in the installation package directory of the application in the storage server, the base.apk package and oat file of the application are located in the default installation package directory of the application in the host host, the base.apk package exists in the ninth directory, and the base.apk package and oat file exist in the tenth directory.

[0046] In this embodiment, it should be noted that when the thirteenth directory is used to install the application, a complete installation process can be executed. After installation, the base.apk package, lib file, and oat file of the application will exist in the default installation package directory of the application in the host host. When copying the files in the default installation package directory of the application in the host host to the ninth directory and the first directory in the host, the base.apk package and the oat file can be copied to the ninth directory and the first directory respectively, or the base.apk package and the lib file can be copied to the ninth directory, and the oat file can be copied to the first directory. When copying the files in the default installation package directory of the application in the host host to the tenth directory in the host, the base.apk package and the oat file can be copied to the tenth directory, or the base.apk package, the lib file, and the oat file can be copied to the tenth directory.

[0047] Based on the foregoing method embodiment, the method may further include:

[0048] Copy the base.apk package in the installation package directory of the application in the storage server to the ninth directory in the host host, and use the ninth directory to install the application in the host host, copy the oat file in the default installation package directory of the application in the host host to the first directory and / or copy the file in the default installation package directory of the application in the host host to the tenth directory in the host host, where the base.apk package and the oat file exist in the tenth directory.

[0049] In this embodiment, it should be noted that copying the base.apk package under the installation package directory of the application in the storage server to the ninth directory in the host host may also include: copying the lib file under the installation package directory of the application in the storage server to the ninth directory. The complete installation process can be performed by installing the application in the host host using the ninth directory. After installation, the base.apk package, lib file and oat file of the application will exist in the default installation package directory of the application in the host host. After that, it is necessary to copy the oat file under the default installation package directory of the application in the host to the first directory and / or copy the base.apk package and oat file under the default installation package directory of the application in the host to the tenth directory in the host. Among them, copying the base.apk package and oat file under the default installation package directory of the application in the host to the tenth directory in the host may also include: copying the lib file under the default installation package directory of the application in the host to the tenth directory.

[0050] Based on the foregoing method embodiment, the method may further include:

[0051] Copy the files in the data resource directory and the sdcard resource directory of the storage server application to the third directory and the fifth directory of the host host respectively; and / or copy the files in the data resource directory and the sdcard resource directory of the storage server application to the seventh directory and the eighth directory of the host host respectively.

[0052] In this embodiment, it should be noted that when copying files under the data resource directory and the sdcard resource directory applied in the storage server to the host, the data resource directory and the sdcard resource directory applied in the storage server can be mounted to the host first, and then the files can be copied through the mounted directory, that is, the files can be copied to the third directory and the fifth directory in the host host, or the files can be copied to the seventh directory and the eighth directory in the host host.

[0053] Reference Figure 2 FIG. 1 is a schematic diagram of a structure of a device for optimizing cloud application startup speed provided in an embodiment of the present application, the device comprising:

[0054] The first startup unit 20 is used to install the base.apk package of the application in the host into the container on the host, and use the joint mounting technology to mount the first directory in the host as the lower layer and the second directory in the container as the upper layer to the directory where the oat file is located under the default installation package directory of the application in the container, and to mount the third directory in the host as the lower layer and the fourth directory in the container as the upper layer to the default data resource directory of the application in the container, and to mount the fifth directory in the host as the lower layer and the sixth directory in the container as the upper layer to the default sdcard resource directory of the application in the container to start the application, wherein the dex optimization process is removed during the process of installing the application in the container, the oat file of the application exists in the first directory, and the data resource file and sdcard resource file of the application exist in the third directory and the fifth directory respectively; and / or

[0055] The second startup unit 21 is used to install the base.apk package of the application in the host into the container on the host, map the seventh directory in the host and the eighth directory in the host to the default data resource directory and the default sdcard resource directory of the application in the container respectively, and start the application, wherein the application in the container uses the oat file of the application in the host, and the process of installing the application in the container removes the dex optimization process, and the data resource file and sdcard resource file of the application exist in the seventh directory and the eighth directory respectively.

[0056] The device for optimizing the startup speed of cloud applications provided in the embodiment of the present application places the files in the default installation package directory of the application after the application is normally installed (i.e., the base.apk package and the oat file) in the host host, and also places the resource files of the application in the host host (i.e., in the third directory and the fifth directory, and / or in the seventh directory and the eighth directory), and realizes the use of the application data in the host by the application in the container through mounting, so that the dex optimization process can be omitted when the application in the container is installed, thereby ensuring a faster installation speed of the application. At the same time, dex optimization does not need to be performed during the startup and operation of the application. The access to the resource files is performed through disk I / O operations, and there is no need to access the data in the storage server through the network, thereby improving the startup speed of the cloud application and reducing operation jams.

[0057] The device for optimizing the startup speed of cloud applications provided in the embodiment of the present application has an implementation process that is consistent with the method for optimizing the startup speed of cloud applications provided in the embodiment of the present application, and the effect that can be achieved is also the same as the method for optimizing the startup speed of cloud applications provided in the embodiment of the present application, and will not be repeated here.

[0058] like Figure 3 As shown, an electronic device provided by an embodiment of the present application includes: a processor 30, a memory 31 and a bus 32, wherein the memory 31 stores machine-readable instructions executable by the processor 30, and when the electronic device is running, the processor 30 communicates with the memory 31 through the bus 32, and the processor 30 executes the machine-readable instructions to perform the steps of the method for optimizing the startup speed of cloud applications as described above.

[0059] Specifically, the above-mentioned memory 31 and processor 30 can be general-purpose memory and processor, which are not specifically limited here. When the processor 30 runs the computer program stored in the memory 31, the above-mentioned method for optimizing the startup speed of cloud applications can be executed.

[0060] Corresponding to the above-mentioned method for optimizing the startup speed of cloud applications, an embodiment of the present application also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the above-mentioned method for optimizing the startup speed of cloud applications are executed.

[0061] The above are only specific implementations of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

Claims

1. A method for optimizing cloud application startup speed, characterized in that: include: S10, install the base.apk package of the application in the host into the container on the host, use the joint mounting technology to mount the first directory in the host as the lower layer and the second directory in the container as the upper layer to the directory where the oat file is located under the default installation package directory of the application in the container, and mount the third directory in the host as the lower layer and the fourth directory in the container as the upper layer to the default data resource directory of the application in the container, mount the fifth directory in the host as the lower layer and the sixth directory in the container as the upper layer to the default sdcard resource directory of the application in the container, and start the application, wherein the dex optimization process is removed during the installation of the application in the container, the oat file of the application exists in the first directory, and the data resource file and sdcard resource file of the application exist in the third directory and the fifth directory respectively; and / or S11. Install the base.apk package of the application in the host into the container on the host, map the seventh directory in the host and the eighth directory in the host to the default data resource directory and the default sdcard resource directory of the application in the container respectively, and start the application. The application in the container uses the oat file of the application in the host. The process of installing the application in the container removes the dex optimization process. The data resource file and sdcard resource file of the application exist in the seventh directory and the eighth directory respectively.

2. The method according to claim 1, characterized in that Step S10 also includes: when mounting using the joint mounting technology, transmitting the uid assigned by the system to the application when the application is installed in the container to the kernel; In step S11, the uid of the application is specified as a preset value during the installation of the application in the container, and the user identifier uid of the oat file of the application in the host host and the files under the seventh directory and the eighth directory is the preset value.

3. The method according to claim 1 or 2, characterized in that Step S10 installs the base.apk package of the application in the host into the container on the host, including: mounting the ninth directory in the host to the directory where the base.apk package is located under the default installation package directory of the application in the container or soft-connecting the base.apk package under the ninth directory in the host to the directory where the base.apk package is located under the default installation package directory of the application in the container, and installing the application in the container, wherein the base.apk package exists under the ninth directory; Step S11 installs the base.apk package of the application in the host into the container on the host, including: Mount the tenth directory in the host to the default installation package directory of the application in the container and install the application in the container; or Soft-link the base.apk package in the tenth directory of the host to the directory where the base.apk package is located in the default installation package directory of the application in the container, and soft-link the oat file in the tenth directory of the host to the directory where the oat file is located in the default installation package directory of the application in the container, and install the application in the container, wherein the base.apk package and the oat file exist in the tenth directory.

4. The method according to claim 2, characterized in that Step S10 also includes: writing the user's login information file into the fourth directory or the sixth directory; Step S11 also includes: writing the user's login information file into the seventh directory or the eighth directory, and the uid of the login information file after writing is the preset value.

5. The method according to claim 1, characterized in that Step S11 also includes: after the user exits, deleting the newly added files in the seventh directory and the eighth directory, and restoring the modified files in the seventh directory and the eighth directory.

6. The method according to claim 1, characterized in that Also includes: The eleventh directory in the storage server is used as a lower layer, and the twelfth directory in the container is used as an upper layer, and is mounted to the directory where the default specified resource file of the application in the container is located, wherein the specified resource file exists under the eleventh directory.

7. The method according to claim 1, characterized in that Also includes: Mount the installation package directory of the application in the storage server to the thirteenth directory in the host host, use the thirteenth directory to install the application in the host host, copy the files under the default installation package directory of the application in the host host to the ninth directory and the first directory in the host host and / or copy the files under the default installation package directory of the application in the host host to the tenth directory in the host host, wherein the base.apk package of the application is located in the installation package directory of the application in the storage server, the base.apk package and oat file of the application are located in the default installation package directory of the application in the host host, the base.apk package exists in the ninth directory, and the base.apk package and oat file exist in the tenth directory.

8. The method according to claim 1, characterized in that Also includes: Copy the base.apk package in the installation package directory of the application in the storage server to the ninth directory in the host host, and use the ninth directory to install the application in the host host, copy the oat file in the default installation package directory of the application in the host host to the first directory and / or copy the file in the default installation package directory of the application in the host host to the tenth directory in the host host, where the base.apk package and the oat file exist in the tenth directory.

9. The method according to claim 1, characterized in that Also includes: Copy the files in the data resource directory and sdcard resource directory of the storage server application to the third directory and the fifth directory of the host respectively; And / or copy the files in the data resource directory and the sdcard resource directory of the application in the storage server to the seventh directory and the eighth directory in the host host respectively.

10. A device for optimizing cloud application startup speed, characterized in that: include: The first startup unit is used to install the base.apk package of the application in the host into the container on the host, and use the joint mounting technology to mount the first directory in the host as the lower layer and the second directory in the container as the upper layer to the directory where the oat file is located under the default installation package directory of the application in the container, and to mount the third directory in the host as the lower layer and the fourth directory in the container as the upper layer to the default data resource directory of the application in the container, and to mount the fifth directory in the host as the lower layer and the sixth directory in the container as the upper layer to the default sdcard resource directory of the application in the container to start the application, wherein the dex optimization process is removed during the process of installing the application in the container, the oat file of the application exists in the first directory, and the data resource file and sdcard resource file of the application exist in the third directory and the fifth directory respectively; and / or The second startup unit is used to install the base.apk package of the application in the host into the container on the host, map the seventh directory in the host and the eighth directory in the host to the default data resource directory and the default sdcard resource directory of the application in the container respectively, and start the application, wherein the application in the container uses the oat file of the application in the host, and the process of installing the application in the container removes the dex optimization process, and the data resource file and sdcard resource file of the application exist in the seventh directory and the eighth directory respectively.

Citation Information

Patent Citations

  • Application running method and device, electronic equipment and storage medium

    CN117076005A