WO2020077487A1 - Procédé et appareil associé pour optimiser et exécuter une application android - Google Patents

Procédé et appareil associé pour optimiser et exécuter une application android Download PDF

Info

Publication number
WO2020077487A1
WO2020077487A1 PCT/CN2018/110212 CN2018110212W WO2020077487A1 WO 2020077487 A1 WO2020077487 A1 WO 2020077487A1 CN 2018110212 W CN2018110212 W CN 2018110212W WO 2020077487 A1 WO2020077487 A1 WO 2020077487A1
Authority
WO
WIPO (PCT)
Prior art keywords
file
target
apk
optimized
android application
Prior art date
Application number
PCT/CN2018/110212
Other languages
English (en)
Chinese (zh)
Inventor
程帅
王刚
陈辉
张魁
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Priority to PCT/CN2018/110212 priority Critical patent/WO2020077487A1/fr
Priority to CN201880079787.1A priority patent/CN111492345A/zh
Publication of WO2020077487A1 publication Critical patent/WO2020077487A1/fr

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating

Definitions

  • This application relates to the field of application programs, and more specifically, to a method of optimizing an Android application (APP), a device for running an Android application, a server, a terminal device, and a computer-readable storage medium.
  • APP Android application
  • Android applications mainly include: developers submit Android installation packages (Android packages) of applications to the application market; users download APKs of Android applications from the application market through terminal devices.
  • the terminal device downloads the APK of the Android application, it can optimize the Android application when installing the Android application or running the Android application.
  • an Android virtual machine (Dalvik or ART) is installed on the terminal device, when the Android virtual machine starts running or installs Android applications, it will pass just-in-time (JIT) or ahead (ahead- of-time (AOT) and other technologies compile and convert the bytecode in the * .dex file in the APK of the Android application into machine code that can be quickly executed directly in the central processing unit (CPU) of the terminal device .
  • JIT just-in-time
  • AOT ahead- of-time
  • other technologies compile and convert the bytecode in the * .dex file in the APK of the Android application into machine code that can be quickly executed directly in the central processing unit (CPU) of the terminal device .
  • This application provides a method for optimizing an Android application, a method for running an Android application, a server, a terminal device, a computer-readable storage medium, a computer program product, and a chip system, which can reduce the operating burden of the terminal device, thereby improving the user experience.
  • a method for optimizing Android applications includes: the server optimizes the file to be optimized in the source APK of the Android application to obtain the target optimized file corresponding to the file to be optimized; the server sends the target APK of the Android application to the terminal device, and the target APK includes the target optimized file.
  • the APK of the Android application program is optimized by the server, so that the terminal device can download the optimized APK of the Android application program from the server.
  • the terminal device does not need to optimize the APK of the Android application program by itself, thereby reducing the operating burden of the terminal and thereby improving the user experience.
  • the Android application is optimized by the server, so that when the optimization is improved, it is only necessary to update the optimization tool on the server without upgrading the software version of the terminal device one by one.
  • the target APK further includes the file to be optimized.
  • This implementation method enables the terminal device to optimize the optimized file by itself and run the Android application according to the file optimized by itself when it cannot run the Android application according to the target optimized file or fails to run the Android application according to the target optimized file, which can improve The success rate of running Android applications.
  • the file to be optimized includes a dex file, and the dex file is an executable file in the Android virtual machine.
  • the file to be optimized includes a library file.
  • At least one of the following optimized tool chains is deployed on the server: Maple tool chain, underlying virtual machine LLVM tool chain, and AOT compilation Optimization tool chain; the server optimizes the files to be optimized in the source APK of the Android application, including: the server uses the optimization tool chain in the at least one optimization tool chain to optimize the files to be optimized in the source APK.
  • the server can use each of the deployed optimization tool chains to optimize the files to be optimized in the source APK, or use part of the deployed optimization tool chain to optimize the files to be optimized in the source APK, or can use deployment All or part of the optimization tool chain in turn optimizes the files to be optimized in the source APK.
  • the method before the server sends the target APK of the Android application to the terminal device, the method further includes: the server receives the Request message to download the Android application.
  • a method for running an Android application includes: the terminal device receives the target APK of the Android application from the server, and the target APK includes the first target optimization file obtained by optimizing the file to be optimized in the source APK of the Android application; the terminal device according to the target APK The first target optimization file runs the Android application.
  • the terminal device can run the optimized Android application without optimizing the Android application by itself. This can reduce the operating burden of the terminal device.
  • the target APK further includes a file to be optimized.
  • This implementation method enables the terminal device to optimize the optimized file by itself and run the Android application according to the file optimized by itself when it cannot run the Android application according to the target optimized file or fails to run the Android application according to the target optimized file, which can improve The success rate of running Android applications.
  • the method further includes: the terminal device determines whether it is necessary to run the Android according to the first target optimization file in the target APK Application; wherein the terminal device runs the Android application according to the first target optimization file in the target APK, including: the terminal device determines that the first target in the target APK needs to be determined When the optimized file runs the Android application, the Android application is run according to the first target optimized file in the target APK; the method further includes: the terminal device determines that it does not need to be based on the target APK When the first target optimization file runs the Android application, the terminal device optimizes the file to be optimized in the target APK to obtain a second target optimization file; the terminal device runs the Android according to the second target optimization file application.
  • the terminal device when the terminal device does not run the Android application according to the target optimization file or the terminal device fails to run the Android application according to the target optimization file in the target APK, the terminal device can optimize the file to be optimized and run the Android application according to the optimized file program.
  • the file to be optimized includes a dex file, and the dex file is an executable file in the Android virtual machine.
  • the file to be optimized includes a library file.
  • the method before the terminal device receives the target APK of the Android application from the server, the method further includes: the terminal device sends the Request message to download the Android application.
  • an apparatus for optimizing an Android application program includes a module for performing the method in the first aspect or any possible implementation manner of the first aspect.
  • An example of this device is a server.
  • an apparatus for running an Android application program includes a module for executing the method in the second aspect or any possible implementation manner of the second aspect.
  • An example of this device is a terminal device.
  • an apparatus for optimizing an Android application program includes a processor and a transmitter.
  • the processor is used to execute a program.
  • the processor and the transmitter implement the first aspect or the first aspect Method in any possible implementation.
  • the device may also include a memory.
  • the memory is used to store programs executed by the processor.
  • the device may also include a receiver.
  • the receiver is used to receive messages or data sent by other equipment or devices.
  • An example of this device is a server, such as a computer.
  • an apparatus for running an Android application program includes a processor and a receiver.
  • the processor is used to execute a program.
  • the processor and the receiver implement the second aspect or the second aspect.
  • the device may also include a memory.
  • the memory is used to store programs executed by the processor.
  • the device may also include a transmitter.
  • the transmitter is used to send messages or data to other devices or devices.
  • An example of this device is a terminal device.
  • a computer-readable storage medium stores program code for execution by a computing device, where the program code includes any possible implementation for implementing the first aspect or the first aspect Instruction of the method in the way.
  • a computer-readable storage medium stores program code for execution by a computing device, and the program code includes any possible implementation for implementing the second aspect or the second aspect Instruction of the method in the way.
  • a chip includes a processor and a communication interface.
  • the communication interface is used to communicate with an external device.
  • the processor is used to implement the first aspect or any possible implementation manner of the first aspect. Methods.
  • the chip may further include a memory that stores instructions, and the processor is used to execute the instructions stored in the memory.
  • the processor is used to implement the first aspect or any one of the first aspects Possible implementation methods.
  • the chip may be integrated on the server.
  • a chip is provided.
  • the chip includes a processor and a communication interface.
  • the communication interface is used to communicate with an external device.
  • the processor is used to implement the second aspect or any possible implementation manner of the second aspect. Methods.
  • the chip may further include a memory, the memory stores instructions, and the processor is used to execute the instructions stored in the memory, and when the instruction is executed, the processor is used to implement the second aspect or any one of the second aspect Possible implementation methods.
  • the chip may be integrated on the terminal device.
  • an embodiment of the present application provides a computer program product containing instructions, which when executed on a computing device or computing device, causes the computing device or computing device to execute the method described in the first aspect.
  • an embodiment of the present application provides a computer program product containing instructions, which when executed on a terminal device, causes a computing device or computing device to perform the method described in the second aspect.
  • Figure 1 is a schematic flow chart of Android application from development to operation
  • FIG. 2 is a schematic flowchart of a method for optimizing an Android application program according to an embodiment of the present application
  • FIG. 3 is a schematic composition diagram of an optimized APK according to an embodiment of this application.
  • FIG. 4 is a schematic flowchart of a method for running an Android application according to an embodiment of the present application
  • FIG. 5 is a schematic structural diagram of an apparatus for optimizing an Android application program according to an embodiment of the present application
  • FIG. 6 is a schematic structural diagram of an apparatus for running an Android application program according to another embodiment of the present application.
  • FIG. 7 is a schematic structural diagram of an apparatus for optimizing an Android application according to an embodiment of the present application.
  • FIG. 8 is a schematic structural diagram of an apparatus for running an Android application according to another embodiment of the present application.
  • FIG. 1 is a schematic flowchart of Android application from development to operation. As shown in FIG. 1, after the developer develops the APK of the Android application, the APK can be published to the application market. The terminal device can download the APK of the Android application from the application market, and install the Android application and run the Android application according to the APK.
  • Android applications can also be referred to simply as Android applications.
  • the Android software development kit (SDK) tool is required to compile the Android application code together with any data and resource files into a file that can be recognized by the Android operating system.
  • the file format that can be recognized and run by the Android operating system is the APK.
  • the application market in the embodiments of the present application is also called an application store (APP STORE), which is an electronic application store that provides paid (or free) games or application download services for mobile devices, phones, and tablets.
  • APP STORE is an electronic application store that provides paid (or free) games or application download services for mobile devices, phones, and tablets.
  • the application market can perform operations such as storage, management, and detection of the APK, thereby providing an application developer or application development company with a way to publish the Android application channel.
  • the application market can be deployed on the server.
  • An example of a server is a computer.
  • the server may be a cloud server.
  • the cloud server can also be called the cloud, and the terminal device can be called the end.
  • the terminal devices in the embodiments of the present application may refer to user equipment, mobile devices, user terminals, terminals, wireless communication devices, handheld devices with communication functions, computing devices or vehicle-mounted devices, wearable devices, and routing devices.
  • the terminal device in the embodiment of the present application may be a smartphone, a netbook, a tablet computer, a personal computer, a notebook computer, a TV, a digital video conversion box (also called a set-top box), an e-book, an MP3 player, an MP4 player, a palm Game consoles, home game consoles, electronic watches, electronic radios, headphones, car equipment, navigators, DVD players, smart speakers, smart home equipment, and other devices.
  • the embodiment of the present application does not limit the specific form of the terminal device, as long as the device can run the Android application program, all fall within the scope of the terminal device of the embodiment of the present application.
  • the terminal device and the server can communicate in a wireless or wired manner.
  • the terminal device can optimize the Android application when installing the Android application or running the Android application.
  • an Android virtual machine (Dalvik or ART) is installed on the terminal device, when the Android virtual machine starts running or installs an Android application, it will use the technology such as JIT or AOT in the APK of the Android application *
  • the bytecode in the .dex file is compiled and converted into machine code that can be executed quickly on the CPU of the terminal device.
  • this application proposes a method for optimizing an Android application and a method for running an Android application, so as to reduce the operating burden of the terminal device, thereby improving the user experience.
  • a set of APK optimization frameworks deployed in the application market (server) can be constructed.
  • a variety of APK optimization tools or optimization tool chains can be inserted in the framework.
  • the method proposed in this application can optimize the Android application on the server side.
  • the optimization of the Android application may refer to the adjustment and improvement of the Android application (for example, the APK of the Android application) by using software tools. According to the focus of optimization, the optimization of Android applications can be divided into optimization of running speed and efficiency and optimization of code size.
  • Optimization of running speed and efficiency refers to the use of compiler front-end and back-end compilation optimization to reduce the number of codes or instructions required to complete specified tasks and improve the execution of specified tasks based on fully grasping the characteristics of software and hardware. Efficiency, or reduce the program running memory, or both. On the same processor, applications that have been optimized for running speed take less time to complete specified tasks than applications that have not been optimized, that is, the former has higher operating efficiency than the latter.
  • Code size optimization means that the application program compiles and optimizes through the compiler to reduce the code amount of the application program or the number of redundant instructions as much as possible under the premise that the required functions can be completed correctly, and reduces the final code volume occupation.
  • the optimized Android application has less code than the optimized Android application, and / or the optimized Android application has fewer instructions than the optimized instruction, and / Or, the optimized Android application consumes less memory when running.
  • the Maple tool chain optimized for the dex file in the APK can be inserted into the APK optimization framework on the server.
  • the Maple toolchain can directly compile and convert the dex bytecode in the APK into binary machine code executable by the target machine, and package it as a static SO file.
  • the Maple tool chain will reduce the number of instructions through a specific algorithm during compilation and conversion to improve the efficiency of the program.
  • the LLVM compiler tool chain (low level virtual machine, LLVM) can be deployed in the APK optimization framework on the server.
  • LLVM can optimize the SO library files in the APK, or, in conjunction with the Maple tool chain, optimize the intermediate representation (IR) for the dex files to reduce the number of instructions and improve the efficiency of the program.
  • IR intermediate representation
  • LLVM is a framework system that constructs a compiler, written in C ++, and is used to optimize the compile-time, link-time, and run-time of programs written in any programming language. time) and idle-time.
  • AOT Ahead-of-time compilation optimization tools
  • APK optimization framework in the server, such as: OpenJDK AOT, Angular AOT compiler, or Android ART.
  • the AOT compilation and optimization tool can perform AOT compilation and optimization on the programs or bytecodes in the APK to reduce the number of instructions, thereby improving the efficiency of the program.
  • the end-side can download the optimized Android application from the application market, and install the optimized Android application to the end-side device.
  • the end-side can download the optimized APK from the application market and install the optimized APK into the end-side device.
  • a runtime environment capable of executing the server-optimized Android application can be constructed on the end side.
  • the process of directly executing the optimized file in the APK can be added to the running process of the Android application on the side.
  • the optimized file can be loaded to run the optimized Android application.
  • a switch that switches the terminal device to execute the Android application before being optimized by the application market and the Android application after being optimized by the application market may also be built on the end side.
  • the end side can choose to execute the APK before optimization or the APK after optimization.
  • the end-side chooses to execute the APK before optimization
  • the APK can be optimized on the end-side, and the files optimized on the end-side can be executed, so as to achieve the purpose of improving operation efficiency.
  • the end can also be compatible with the original optimization mode.
  • FIG. 2 is a schematic flowchart of a method for optimizing an Android application program according to an embodiment of the present application. It should be understood that FIG. 2 shows steps or operations of the method, but these steps or operations are merely examples, and other operations or variations of the operations in FIG. 2 may be performed in the embodiments of the present application.
  • the server optimizes the file to be optimized in the source APK of the Android application to obtain the target optimized file corresponding to the file to be optimized.
  • the server can be understood as the application market, and the source APK of the Android application can refer to the APK released or uploaded by the developer to the server.
  • the source APK includes files to be optimized.
  • the file to be optimized may be understood as a file that needs to be optimized, such as a dex file and / or a library file.
  • the code size of the target optimization file is less than the code size of the file to be optimized, and / or the number of instructions corresponding to the target optimization file is less than the number of instructions corresponding to the file to be optimized.
  • the file to be optimized and the target optimized file may have a one-to-one correspondence.
  • the server sends the target APK of the Android application to the terminal device, and the target APK includes the target optimization file obtained by the server optimization.
  • the target APK of the Android application refers to an APK obtained by optimizing the source APK by the server.
  • the target APK includes the target optimization file obtained after the file to be optimized is optimized.
  • the target APK includes a target optimized file obtained by optimizing the dex file, and / or a target optimized file obtained after the library file is optimized.
  • the optimized Android application can consume less memory resources when running.
  • the server optimizes the source APK of the Android application and sends the optimized target APK to the terminal device, so that the terminal device does not need to optimize the Android application by itself, thereby reducing the operation of the terminal device
  • the burden can ultimately improve the user experience.
  • the source APK of the Android application has been published or uploaded to the server (or application market).
  • a software tool for optimizing the APK of the Android application should be deployed or installed on the server (or application market).
  • a series of software tools or software modules that optimize the APK of the Android application can be called an optimization tool chain.
  • the server optimizes the source APK of the Android application through the optimization tool chain, thereby obtaining the target APK of the Android application. Specifically, the server optimizes the file to be optimized in the source APK through the optimization tool chain, thereby obtaining the target optimized file in the target APK.
  • One or more optimization tool chains can be deployed in the server.
  • at least one optimization tool chain among the maple tool chain, the AOT compilation optimization tool chain, and the LLVM tool chain may be deployed on the server.
  • At least one type described herein may be understood as one or more types.
  • the server optimizing the source APK of the Android application may include: the server uses the optimization tool chain in the at least one optimization tool chain to optimize the file to be optimized in the source APK.
  • the server when the server optimizes the APK of the Android application, in some possible implementation manners, the server may use multiple optimization tool chains deployed on the server to optimize the APK of the Android application, Multiple target APKs are obtained, and the multiple optimization tool chains correspond to the multiple target APKs. Each target APK is obtained by optimizing the source APK with its corresponding optimization tool chain.
  • the server uses these four optimization toolchains to optimize the source APK of the Android application, and you can get Four target APKs, which correspond to these four optimization tool chains one by one.
  • the first of the four target APKs is obtained by the server using the maple tool chain to optimize the source APK; the second APK of the four APKs is the server using the Java tool chain to optimize the source APK To; the third of the four target APKs is obtained by the server using the AOT tool chain to optimize the source APK; the fourth APK of the four target APKs is obtained by the server using the LLVM tool chain to optimize the source APK of.
  • optimization tool chains can also be combined to optimize the source APK and finally generate a target APK.
  • the optimized file obtained by optimizing the Maple tool chain in the source APK can be used as the input of the LLVM tool chain, and the target optimized file can be obtained after the LLVM tool chain is optimized.
  • the server row may preset an optimization strategy, and select one or more optimization tool chains deployed on the server to optimize the source APK according to the optimization strategy.
  • the optimization strategy includes rules of which tool chains are called by the server application to optimize the files to be optimized in the source APK.
  • the optimization strategy may be input to the server after being specified by the optimizer, or may be a strategy generated by the machine through artificial intelligence (AI) algorithm as the server optimization strategy.
  • AI artificial intelligence
  • the server may add the path information of the target optimization file to the configuration file of the source APK to obtain a new configuration file, and include the new configuration file in the target APK, so that the terminal device can Path information acquisition target optimization file.
  • the server may configure a flag in the configuration file or other files of the target APK, and the flag indicates that the target APK is an optimized APK, including the target optimized file.
  • the obtained target APK may include files to be optimized in the source APK, files other than files to be optimized, and files to be optimized The target optimization file obtained after optimization.
  • the target APK may include all the files in the source APK and the optimized target files obtained after optimization.
  • the obtained target APK may include a resource file, a configuration file, a dex file, and a dex file after optimization Get the file.
  • the dex file is a file to be optimized, and the file obtained after the dex file is optimized is a target optimization file, and the target optimization file may include the optimized machine code.
  • the APK of the Android application released by the developer to the application market includes a resource file, a dex file, and a library file. It should be understood that the APK may also include other related files.
  • the target APK obtained may include resource files, configuration files, dex files, library files before optimization, files obtained after optimization of the dex files, and library files obtained after optimization .
  • the dex file is the file to be optimized
  • the file obtained after the optimization of the dex file and the library file obtained after the optimization are the target optimization file
  • the target optimization file may include the machine code obtained by the optimization
  • the library file obtained after the optimization and the optimization Compared with the library file, the number of instructions is less.
  • the target optimization file corresponding to the dex file and the target optimization file corresponding to the library file can be obtained.
  • the target APK sent by the application market to the terminal device may include a file in the source APK, a target optimization file corresponding to the dex file, and a target optimization file corresponding to the library file.
  • This implementation method enables the terminal device to optimize the files to be optimized in the source APK and execute the target optimized files obtained after optimization by itself even if the optimized files in the APK cannot be directly executed, so that the Android application can be normally started .
  • the obtained target APK may include only files other than the file to be optimized in the source APK and the file to be optimized after optimization Optimized files.
  • the target APK may not include the file to be optimized in the source APK.
  • the APK released by the developer to the server includes a resource file (resource), a configuration file, and a dex file.
  • the dex file is the file to be optimized.
  • the target APK obtained may include resources Target optimization files corresponding to files, configuration files and dex files.
  • this possible implementation manner can reduce the size of the target APK.
  • the method may further include: the server receives a message requesting to download the Android application from the terminal device. That is, the server sends the target APK of the Android application to the terminal device after receiving the request to download the Android application from the terminal device.
  • FIG. 4 is a schematic flowchart of a method for running an Android application according to an embodiment of the present application. It should be understood that FIG. 4 shows steps or operations of the method, but these steps or operations are only examples, and other operations or variations of the operations in FIG. 4 may be performed in the embodiments of the present application.
  • the terminal device receives the target APK of the Android application from the server, and the target APK includes the target optimization file obtained by optimizing the file to be optimized in the source APK of the Android application.
  • the terminal device downloads the target APK of the Android application from the server.
  • the server can be understood as an application market.
  • the source APK of an Android application can refer to an APK published or uploaded by a developer to the server.
  • the target APK of the Android application can refer to an APK obtained by optimizing the source APK by the server.
  • the source APK includes files to be optimized.
  • the file to be optimized may be understood as a file that needs to be optimized, such as a dex file and / or a library file.
  • the target APK includes the target optimized file obtained after the file to be optimized is optimized, for example, the file obtained after the optimization of the dex file and / or library file is the target optimized file.
  • the file to be optimized and the target optimized file may have a one-to-one correspondence.
  • the code size of the target optimization file is less than the code size of the file to be optimized, and / or the number of instructions corresponding to the target optimization file is less than the number of instructions corresponding to the file to be optimized.
  • the terminal device runs the Android application according to the target optimized file in the target APK.
  • a runtime environment capable of directly loading the target optimization file from the target APK should be deployed on the terminal device.
  • the terminal device since the APK downloaded from the server by the terminal device is optimized, the terminal device does not need to optimize the APK by itself, thereby reducing the burden on the terminal device and improving the user experience.
  • the target optimization file obtained by the server optimizing the file to be optimized in the source APK is referred to as the first target optimization file.
  • an implementation manner may include: reading the target optimization file according to the path information of the first target optimization file recorded in the configuration file, and then running the first Target optimization files.
  • the terminal device may first determine whether the APK downloaded by the terminal device from the application market is an optimized target APK, or, the terminal device may first determine whether the APK downloaded by the terminal device from the application market includes the first target optimization file . If so, you can read the first target optimization file and run the first target optimization file.
  • the terminal device may choose to start the Android application according to the target optimization file in the target APK; or the terminal device may choose to optimize the file to be optimized in the source APK by itself, and optimize it according to its own Get the file to start the Android application.
  • the terminal device can optimize the files to be optimized in the APK by itself, and according to Start the Android application with the optimized file.
  • This implementation mode enables the terminal device to normally start the Android application even if it is downloaded from the application market without an optimized source APK.
  • the terminal device may determine to start the Android application according to the target optimization file in the target APK, or may determine that it has optimized the source APK To optimize the file, and start the Android application according to the file obtained after optimization.
  • the terminal device may be pre-configured with an execution strategy or downloaded from the server, and the terminal device may determine whether to start the Android application according to the target optimization file in the target APK or optimize the file to be optimized in the source APK by itself. , And start the Android application based on the files you have optimized.
  • the execution strategy may include the following: the terminal device defaults to start the Android application according to the target optimization file in the target APK; in the case of failing to start or run the Android application according to the target optimization file in the target APK, the terminal device optimization The files to be optimized in the source APK, and start the Android application according to the files obtained after optimization.
  • the target APK may include only files other than the file to be optimized in the source APK and the target optimized file obtained through optimization of the file to be optimized. In other words, the target APK may not include the file to be optimized in the source APK.
  • the APK released by the developer to the server includes a resource file (resource), a configuration file, and a dex file, and the dex file is a file to be optimized.
  • the target APK obtained may include the resource file, Target optimization file obtained by optimizing configuration file and dex file.
  • the download volume of the terminal device is relatively small, so that the download speed can be improved, thereby improving the user experience.
  • the target APK may include a file to be optimized in the source APK, a file other than the file to be optimized, and a first target optimization obtained through optimization of the file to be optimized file.
  • the target APK may include all files in the source APK and the first target optimized file obtained by optimization of the file to be optimized.
  • the target APK may include a resource target, a configuration file, a dex file, and a first target optimized file obtained by optimization .
  • the APK of the Android application released by the developer to the application market includes resource files, dex files, and library files.
  • the target APK downloaded from the application market by the terminal device may include the file in the source APK, the first target optimized file obtained by optimizing the dex file, and the first target optimized file obtained by optimizing the library file.
  • the terminal device may determine that the Android application needs to be started according to the first target optimization file in the target APK; or determine that the file to be optimized in the target APK needs to be optimized by itself, and start Android based on the file obtained after optimization application.
  • the file optimized by the terminal device itself may be referred to as a second target optimization file.
  • the terminal device determines that the Android application needs to be run according to the first target optimization file in the target APK, it can run the Android application according to the first target optimization file in the target APK; if the terminal device determines that it does not need to run according to the first target in the target APK If the target optimized file runs the Android application, the terminal device can optimize the file to be optimized in the target APK to obtain the second target optimized file, and run the Android application according to the second target optimized file.
  • the method may further include: the terminal device sends a request message for downloading the Android application to the server, so that the server can respond to the request The message sends the APK of the Android application to the terminal device.
  • FIG. 5 is a schematic block diagram of an apparatus 500 for optimizing an Android running program according to an embodiment of the present application. It should be understood that the device 500 is only an example. The device in the embodiment of the present application may further include other modules or units, or include modules with similar functions to the modules in FIG. 5, or not necessarily include all modules in FIG. 5.
  • the optimization module 510 is used for optimizing the files to be optimized in the source Android installation package APK of the Android application to obtain the target optimization file corresponding to the files to be optimized.
  • the sending module 520 is configured to send a target APK of the Android application to a terminal device, where the target APK includes the target optimization file.
  • the target APK further includes the file to be optimized.
  • the file to be optimized includes a dex file
  • the dex file is an executable file in an Android virtual machine.
  • the file to be optimized includes a library file.
  • At least one of the following optimization tool chains is deployed on the server: the Maple tool chain, the underlying virtual machine LLVM tool chain, and the AOT compilation optimization tool chain in advance.
  • the optimization module is specifically configured to: use the optimization tool chain in the at least one optimization tool chain to optimize the files to be optimized in the source APK.
  • the apparatus further includes a receiving module 530, configured to: before the optimization module optimizes the file to be optimized in the source APK of the Android application, receive a request from the terminal device to download the Android Application request message.
  • a receiving module 530 configured to: before the optimization module optimizes the file to be optimized in the source APK of the Android application, receive a request from the terminal device to download the Android Application request message.
  • the apparatus 500 may be used to perform the steps of the method described in FIG. 2, and for the sake of brevity, details are not described here.
  • FIG. 6 is a schematic block diagram of an apparatus 600 for running an Android application program according to an embodiment of the present application. It should be understood that the device 600 is only an example. The device in the embodiment of the present application may further include other modules or units, or include modules with similar functions to the modules in FIG. 6, or not necessarily include all modules in FIG. 6.
  • the receiving module 610 is configured to receive the target Android installation package APK of the Android application from the server, where the target APK includes the first target optimized file obtained by optimizing the file to be optimized in the source APK of the Android application.
  • the running module 620 is configured to run the Android application according to the first target optimization file in the target APK.
  • the target APK further includes the file to be optimized.
  • the device further includes: a determining module, configured to determine whether the Android application needs to be run according to the first target optimization file in the target APK.
  • the running module is specifically configured to: according to the first in the target APK when the determining module determines that the Android application needs to be run according to the first target optimization file in the target APK
  • the target optimization file runs the Android application.
  • the device further includes an optimization module 630 for optimizing the file to be optimized when the determination module determines that it is not necessary to run the Android application according to the first target optimization file in the target APK, A second target optimization file is obtained; at this time, the running module is also used to run the Android application according to the second target optimization file.
  • the file to be optimized includes a dex file
  • the dex file is an executable file in an Android virtual machine.
  • the file to be optimized includes a library file.
  • the device further includes a sending module 640, which is configured to: before the download module receives the target APK of the Android application from the server, send a request message for requesting download of the Android application to the server.
  • a sending module 640 which is configured to: before the download module receives the target APK of the Android application from the server, send a request message for requesting download of the Android application to the server.
  • the apparatus 600 may be used to perform the steps of the method described in FIG. 4, and for the sake of brevity, details are not described here.
  • An example of the device 600 is a terminal device.
  • FIG. 7 is a schematic structural diagram of an apparatus for running an Android application program according to another embodiment of the present application. It should be understood that the apparatus 700 shown in FIG. 7 is only an example, and the apparatus in the embodiment of the present application may further include other modules or units, or include modules with similar functions as the modules in FIG. 7.
  • the apparatus 700 may include one or more processors 710, one or more memories 720, and a transmitter 740.
  • the memory 720 is used to store program codes executed by the processor 710.
  • the processor 710 is used to retrieve instructions in the memory 720.
  • the transmitter 740 is used to transmit information.
  • the processor 710 may be integrated with a memory 720, or the processor 710 is coupled to one or more memories 720.
  • the apparatus 700 may further include a receiver 730.
  • the receiver 730 and the transmitter 740 may be integrated together, called a transceiver.
  • the processor 710 may be used to implement operations or steps that the optimization module 510 in FIG. 5 can implement; the transmitter 740 may be used to implement operations or steps that the transmission module 520 in FIG. 5 may implement; The operations or steps that the receiving module 530 in 5 can implement.
  • An example of the device 700 is a server.
  • FIG. 8 is a schematic structural diagram of an apparatus for running an Android application according to another embodiment of the present application. It should be understood that the apparatus 800 shown in FIG. 8 is only an example, and the apparatus in the embodiment of the present application may further include other modules or units, or include modules with similar functions as the modules in FIG.
  • the device 800 may include one or more processors 810, one or more memories 820, and a receiver 830.
  • the memory 820 is used to store program codes executed by the processor 810.
  • the processor 810 is used to retrieve instructions in the memory 820.
  • the transmitter 840 is used to transmit information.
  • the processor 810 may be integrated with a memory 820, or the processor 810 is coupled to one or more memories 720.
  • the device 800 may further include a transmitter 840.
  • the receiver 830 and the transmitter 840 may be integrated together, called a transceiver.
  • the processor 810 may be used to implement operations or steps that can be implemented by the running module 620 and the optimization module 630 in FIG. 6; the receiver 830 may be used to implement operations or steps that can be implemented by the receiving module 610 in FIG. It is used to implement operations or steps that can be implemented by the sending module 640 in FIG. 6.
  • An example of the device 800 is a terminal device.
  • the disclosed system, device, and method may be implemented in other ways.
  • the device embodiments described above are only schematic.
  • the division of the units is only a division of logical functions.
  • there may be other divisions for example, multiple units or components may be combined or Can be integrated into another system, or some features can be ignored, or not implemented.
  • the displayed or discussed mutual coupling or direct coupling or communication connection may be indirect coupling or communication connection through some interfaces, devices or units, and may be in electrical, mechanical or other forms.
  • the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or may be distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
  • each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit.
  • the function is implemented in the form of a software functional unit and sold or used as an independent product, it may be stored in a computer-readable storage medium.
  • the technical solution of the present application essentially or part of the contribution to the existing technology or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including Several instructions are used to enable a computer device (which may be a personal computer, server, or network device, etc.) to perform all or part of the steps of the methods described in the embodiments of the present application.
  • the aforementioned storage media include: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), magnetic disk or optical disk and other media that can store program code .
  • the processor in the embodiments of the present application may be an integrated circuit chip, which has signal processing capabilities.
  • each step of the foregoing method embodiment may be completed by an integrated logic circuit of hardware in a processor or instructions in the form of software.
  • the aforementioned processor may be a general-purpose processor, a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA), or other available Programming logic devices, discrete gates or transistor logic devices, discrete hardware components.
  • DSP digital signal processor
  • ASIC application specific integrated circuit
  • FPGA field programmable gate array
  • the methods, steps, and logical block diagrams disclosed in the embodiments of the present application may be implemented or executed.
  • the general-purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
  • the steps of the method disclosed in conjunction with the embodiments of the present application may be directly embodied and executed by a hardware decoding processor, or may be executed and completed by a combination of hardware and software modules in the decoding processor.
  • the software module may be located in a mature storage medium in the art, such as a random access memory, flash memory, read-only memory, programmable read-only memory, or electrically erasable programmable memory, and register.
  • the storage medium is located in the memory, and the processor reads the information in the memory and completes the steps of the above method in combination with its hardware.

Abstract

La présente invention concerne un procédé et un appareil associé pour optimiser et exécuter une application Android. Dans la solution technique décrite dans la présente invention, un serveur optimise un fichier à optimiser dans un APK source de l'application Android, et envoie un APK cible à un dispositif terminal, l'APK cible comprenant un fichier d'optimisation cible obtenu par optimisation du fichier à optimiser ; après que le dispositif terminal a reçu l'APK cible, l'application Android est exécutée selon le fichier d'optimisation cible dans l'APK cible. Selon la solution technique de la présente invention, le serveur optimise l'APK, le dispositif terminal peut non seulement exécuter l'application Android optimisée de façon à améliorer l'efficacité d'exécution de l'application Android, mais peut également réduire une charge d'exécution du dispositif terminal, de façon à améliorer l'expérience de l'utilisateur.
PCT/CN2018/110212 2018-10-15 2018-10-15 Procédé et appareil associé pour optimiser et exécuter une application android WO2020077487A1 (fr)

Priority Applications (2)

Application Number Priority Date Filing Date Title
PCT/CN2018/110212 WO2020077487A1 (fr) 2018-10-15 2018-10-15 Procédé et appareil associé pour optimiser et exécuter une application android
CN201880079787.1A CN111492345A (zh) 2018-10-15 2018-10-15 优化和运行安卓应用程序的方法以及相关装置

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2018/110212 WO2020077487A1 (fr) 2018-10-15 2018-10-15 Procédé et appareil associé pour optimiser et exécuter une application android

Publications (1)

Publication Number Publication Date
WO2020077487A1 true WO2020077487A1 (fr) 2020-04-23

Family

ID=70283370

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/110212 WO2020077487A1 (fr) 2018-10-15 2018-10-15 Procédé et appareil associé pour optimiser et exécuter une application android

Country Status (2)

Country Link
CN (1) CN111492345A (fr)
WO (1) WO2020077487A1 (fr)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113031957A (zh) * 2020-12-16 2021-06-25 深圳市欢太科技有限公司 应用程序的安装方法、客户端、终端、服务器及存储介质
CN113568634B (zh) * 2021-06-28 2022-05-17 荣耀终端有限公司 应用优化的处理方法及处理装置

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104182255A (zh) * 2014-08-20 2014-12-03 青岛海信宽带多媒体技术有限公司 一种系统应用的库文件升级方法及终端
CN105100191A (zh) * 2015-05-22 2015-11-25 华为技术有限公司 一种云编译实现Java应用安装的方法、装置及系统
CN107168742A (zh) * 2017-05-19 2017-09-15 中南大学 基于定制安卓平台的应用快速部署方法

Family Cites Families (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
GB201405755D0 (en) * 2014-03-31 2014-05-14 Irdeto Bv Optimizing and protecting software
CN104462959B (zh) * 2014-12-04 2017-09-01 北京奇虎科技有限公司 一种安卓应用的加固保护方法、服务器和系统
CN105391763B (zh) * 2015-10-13 2019-01-04 北京奇虎科技有限公司 对多个apk文件进行加固的方法和服务器
CN106933610B (zh) * 2015-12-30 2021-07-30 北京金山安全软件有限公司 一种应用程序安装包生成方法、装置及电子设备
CN105915623A (zh) * 2016-05-20 2016-08-31 努比亚技术有限公司 应用安装包处理装置及方法
CN106775893B (zh) * 2016-12-30 2020-03-17 北京小米移动软件有限公司 对程序预编译的方法及装置
CN107220083B (zh) * 2017-05-22 2020-12-18 南京航空航天大学 一种安卓系统中免安装运行应用程序的方法和系统
CN107766061A (zh) * 2017-11-20 2018-03-06 烽火通信科技股份有限公司 一种安卓应用程序的安装方法和安装系统
CN108536488B (zh) * 2018-04-17 2021-12-07 Oppo广东移动通信有限公司 应用启动优化方法、装置、存储介质及终端设备

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104182255A (zh) * 2014-08-20 2014-12-03 青岛海信宽带多媒体技术有限公司 一种系统应用的库文件升级方法及终端
CN105100191A (zh) * 2015-05-22 2015-11-25 华为技术有限公司 一种云编译实现Java应用安装的方法、装置及系统
CN107168742A (zh) * 2017-05-19 2017-09-15 中南大学 基于定制安卓平台的应用快速部署方法

Also Published As

Publication number Publication date
CN111492345A (zh) 2020-08-04

Similar Documents

Publication Publication Date Title
CN110569106B (zh) 代码加载方法、装置、电子设备及计算机可读介质
CN107025559B (zh) 一种业务处理方法及装置
RU2643484C2 (ru) Генерация собственного кода из кода на промежуточном языке для приложения
CN111078318B (zh) 配置文件的处理方法、装置、系统及存储介质
WO2017185606A1 (fr) Procédé et système de développement d'apk basé sur un mécanisme de superposition
RU2486579C2 (ru) Устройство терминала, имеющее основанную на виртуальной машине (vm) структуру уровней для выполнения разнородных приложений
US10846073B2 (en) Methods, apparatuses, terminals, servers, and systems for container generation
US9392051B2 (en) Application distribution supplying a dedicated application to a terminal from an application deposited by the developer
CN104375849A (zh) 加载内核的方法及装置
US11327739B2 (en) Method and apparatus for improving runtime performance after application update in electronic device
WO2021115177A1 (fr) Procédé et appareil d'installation d'application, dispositif terminal, serveur et support de stockage
WO2020077487A1 (fr) Procédé et appareil associé pour optimiser et exécuter une application android
US20230185554A1 (en) Application installation method and electronic device for supporting same
WO2012034421A1 (fr) Procédé et dispositif de compilation de navigateur webkit
CN106020882A (zh) 一种应用升级方法、智能终端及升级系统
CN111427617A (zh) 数据处理方法、装置及设备
CN112650665A (zh) 无线调试器及无线调试系统
CN107423093B (zh) 控制方法及装置、计算机装置和计算机可读存储介质
WO2023226720A1 (fr) Procédé et appareil de transmission de fichier de ressources, dispositif et support de stockage
CN111290740B (zh) 应用程序的开发方法、装置、计算机设备和存储介质
US11875035B2 (en) Electronic device and method for managing memory using the same
KR101412614B1 (ko) 웹 애플리케이션에 포함되는 자바스크립트를 aot 방식으로 컴파일하기 위한 방법, 단말 장치 및 컴퓨터 판독 가능한 기록 매체
CN108958795B (zh) 一种嵌入式系统中BootLoader代码重利用方法和开发板
WO2019157891A1 (fr) Procédé d'installation d'application et procédé de génération d'installateur d'application
KR20110108143A (ko) 스크립트 프로그래밍 언어 기반의 임베디드 시스템 및 그 구동 방법

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 18937455

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 18937455

Country of ref document: EP

Kind code of ref document: A1