Compilation method, device, terminal and storage medium
By backing up the hotspot description file before the Android system is updated, and compiling the generated local code in the terminal target running state after the system is updated, the problem that the hotspot code cannot be compiled in time after the system is updated, and the operation performance of the application is improved.
Patent Information
- Application Number
- CN202110008343.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-01-05
- Publication Date
- 2024-12-10
- Estimated Expiration
- 2041-01-05
AI Technical Summary
The Android system deletes hotspot codes and native codes after the system is updated, resulting in a degradation of application performance. Especially when the battery capacity increases and the charging speed is fast, the probability of the phone entering the charging and idle state is reduced, and the hotspot code cannot be compiled in time.
Create a backup file of the application's hotspot description file before the system is updated, and after the system is updated, compile the hotspot code of the target application based on the backup file to generate the local code.
It avoids the problem that hotspot description files cannot be compiled in time due to system updates being deleted, improves the operation performance of the application, and does not need to wait until the terminal is charged and is idle before compiling hotspot code.
Smart Images

Figure CN112631608B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technology, and in particular to a compilation method, device, terminal and storage medium. Background Art
[0002] The Android system can record frequently used codes during the execution of an application, namely hotspot codes, and compile the hotspot codes to generate native codes when the terminal is in charging and idle state, which will improve the performance of the application in the next use.
[0003] However, on the one hand, when the mobile phone updates the system version by downloading the update package from the remote server through Over-the-Air (OTA) technology, the file recording the hotspot code and the native code generated based on the hotspot code will be deleted, and the hotspot code can only be recompiled when the updated mobile phone is in charging and idle state again; on the other hand, with the development of battery technology, battery capacity is getting larger and charging speed is getting faster, and fewer and fewer users charge their mobile phones all night, resulting in a decrease in the situation where the mobile phone enters the charging and idle state, which makes it easy for the hotspot code to not be compiled in time, thereby affecting the performance of the application. Summary of the invention
[0004] This summary is provided to introduce concepts in a brief form that will be described in detail in the detailed description below. This summary is not intended to identify key features or essential features of the claimed technical solution, nor is it intended to limit the scope of the claimed technical solution.
[0005] According to one or more embodiments of the present disclosure, a compilation method is provided, including:
[0006] Before the terminal system is updated, a backup file of a hotspot description file of the application is created, wherein the hotspot description file is used to record the hotspot code of the application;
[0007] After the system is updated, when the terminal is in the target running state, the hotspot code of the target application is compiled based on the backup file to generate native code.
[0008] According to one or more embodiments of the present disclosure, there is provided a compilation-based device, comprising:
[0009] A backup unit, used to create a backup file of a hotspot description file of an application before the terminal system is updated, wherein the hotspot description file is used to record the hotspot code of the application;
[0010] A compiling unit is used to compile the hotspot code of the target application based on the backup file to generate native code when the terminal is in the target running state after the system is updated.
[0011] According to one or more embodiments of the present disclosure, a mobile terminal is provided, wherein the mobile terminal includes:
[0012] at least one memory and at least one processor;
[0013] The memory is used to store program codes, and the processor is used to call the program codes stored in the memory to execute the compilation method provided according to one or more embodiments of the present disclosure.
[0014] According to one or more embodiments of the present disclosure, a non-transitory computer storage medium is provided, wherein the non-transitory computer storage medium stores program code, and when the program code is executed on a computer device, the computer device executes the compilation method provided according to one or more embodiments of the present disclosure.
[0015] According to the compilation method provided by one or more embodiments of the present disclosure, a backup file is created for the hotspot description file of the application before the system is updated, and after the system is updated, when the terminal is in the target running state, the hotspot code of the target application is compiled based on the backup file to generate native code. This can avoid the hotspot description file being deleted due to the system update and resulting in failure to compile in time, and there is no need to wait until the terminal is in a charging and idle state to compile the hotspot code, thereby timely improving the running performance of the application after the system is updated. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] The above and other features, advantages and aspects of the embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the accompanying drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and the originals and elements are not necessarily drawn to scale.
[0017] Figure 1 A flowchart of a compilation method provided in one embodiment of the present disclosure;
[0018] Figure 2 A flowchart of a compilation method provided by another embodiment of the present disclosure;
[0019] Figure 3 An exemplary structural diagram of a compiling device provided in an embodiment of the present disclosure
[0020] Figure 4 A schematic diagram of the structure of a terminal device used to implement an embodiment of the present disclosure. DETAILED DESCRIPTION
[0021] Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as being limited to the embodiments described herein, which are instead provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes and are not intended to limit the scope of protection of the present disclosure.
[0022] It should be understood that the various steps described in the method embodiments of the present disclosure may be performed in different orders and / or in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present disclosure is not limited in this respect.
[0023] As used herein, the term "including" and its variations are open inclusions, i.e., "including but not limited to". The term "based on" means "based at least in part on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one other embodiment"; the term "some embodiments" means "at least some embodiments". The term "responsive to" and related terms refer to a signal or event being affected to a certain extent by another signal or event, but not necessarily completely or directly. If event x occurs "responsive to" event y, x may be directly or indirectly responsive to y. For example, the occurrence of y may ultimately lead to the occurrence of x, but there may be other intermediate events and / or conditions. In other cases, y may not necessarily lead to the occurrence of x, and x may occur even if y has not yet occurred. In addition, the term "responsive to" may also mean "at least partially responsive to". The term "determine" broadly covers a variety of actions, which may include calculating, computing, processing, deriving, investigating, searching (e.g., searching in a table, database or other data structure), ascertaining, and similar actions, and may also include receiving (e.g., receiving information), accessing (e.g., accessing data in a memory) and similar actions, as well as parsing, selecting, choosing, establishing and similar actions, etc. The relevant definitions of other terms will be given in the following description.
[0024] It should be noted that the concepts such as "first" and "second" mentioned in the present disclosure are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.
[0025] It should be noted that the modifications of "one" and "plurality" mentioned in the present disclosure are illustrative rather than restrictive, and those skilled in the art should understand that unless otherwise clearly indicated in the context, it should be understood as "one or more".
[0026] The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only used for illustrative purposes and are not used to limit the scope of these messages or information.
[0027] Below, several technical terms involved in the present disclosure are first explained.
[0028] 1. Hot Spot Code
[0029] Hot code may refer to code that is executed more than a preset threshold number of times during the startup or use of an application, including but not limited to functions, methods, code blocks, classes, etc. For example, in client mode, the Android system regards code that is executed more than 1,500 times as hot code; in server mode, the Android system regards code that is executed more than 10,000 times as hot code.
[0030] 2. Native Code
[0031] Native code is computer programming code that is compiled to run on a specific processor (such as an Intel x86-class processor) and its specific instruction set. Native code is code that has been compiled into processor-specific machine code and can be executed directly by a virtual machine.
[0032] 3. Ahead-of-time compilation
[0033] Ahead of time compilation refers to the act of converting a higher-level programming language (such as C or C++) or intermediate code (such as Java bytecode or .NET Framework Common Intermediate Language (CIL) code) into native code to generate a binary file that can be executed natively. Compiling intermediate code during program execution (such as Just-in-time compilation) may reduce the performance of the application, and ahead of time compilation eliminates the need for this step by occurring before execution rather than during execution.
[0034] Figure 1 A compilation method 100 provided based on one or more embodiments of the present disclosure is shown. The compilation method 100 includes steps S101 to S102:
[0035] Step S101: before the terminal system is updated, a backup file of the hotspot description file of the application is created, wherein the hotspot description file is used to record the hotspot code of the application.
[0036] Exemplarily, the hotspot description file is a profile file, which is used to record the hotspot code of a certain application and can be used for profile-guide compilation.
[0037] In some implementations, the created backup file can be stored in a local designated folder according to a preset storage path, or stored in a cloud server, so that the backup file is not deleted during the system update process.
[0038] It should be noted that, in this embodiment, the hotspot description files of all applications installed in the terminal may be backed up, or one or more specified application hotspot description files may be backed up, and the present disclosure does not impose any limitation thereto.
[0039] Step S102: After the system is updated, when the terminal is in the target running state, the hotspot code of the target application is compiled based on the backup file to generate native code.
[0040] Exemplarily, AOT compilation may be used to compile the dalvik bytecode (dalvikbytecode) as the hot code in the dex file into assembly instructions that can be recognized and executed by the processor, that is, native code (Native Code).
[0041] In some embodiments, the target operating state may be an operating state pre-specified before the terminal leaves the factory, and may be updated or modified in real time according to instructions from the user or an instruction from a remote server.
[0042] In some embodiments, the backup file can be obtained locally based on a preset storage path or downloaded from a cloud server to the local computer.
[0043] In some embodiments, the target operating state is that the screen of the terminal is in an off state, the battery level of the terminal is not less than a preset battery threshold, and the CPU occupancy rate of the terminal is not greater than a preset occupancy threshold. In this embodiment, the compilation of the hotspot code is triggered when the terminal meets the following three conditions at the same time: the screen of the terminal is in an off state, the battery level is not less than a preset battery threshold, and the CPU occupancy rate is not greater than a preset occupancy rate. On the one hand, compiling the hotspot code when the terminal is in the above-mentioned target operating state will not affect the terminal's performance, and the compilation process is imperceptible to the user; on the other hand, the probability of the terminal entering the above-mentioned target operating state is higher than the probability that the terminal is in a charging and idle state, so that the hotspot code of the target application can be compiled into native code in a timely manner.
[0044] In this way, according to the compilation method provided by one or more embodiments of the present disclosure, a backup file is created for the hotspot description file of the application before the system is updated, and after the system is updated, when the terminal is in the target running state, the hotspot code of the target application is compiled based on the backup file to generate native code, thereby avoiding the hotspot description file being deleted due to the system update and resulting in failure to compile in time, and there is no need to wait until the terminal is in a charging and idle state to compile the hotspot code, thereby timely improving the running performance of the application after the system is updated.
[0045] In some embodiments, the target application is determined based on at least one of the following: the number of times the application is used, the duration of use of the application, the installation time of the application, and whether the application has been launched.
[0046] In some embodiments, the target application may be determined by:
[0047] Step A1: determining a first application set based on the number of times the application is used and / or the duration of use;
[0048] Step A2: determining a second application set based on application programs whose installation time is not greater than a preset time threshold;
[0049] Step A3: Determine the target application based on the union of the first application set and the second application set.
[0050] Exemplarily, the applications in the terminal can be sorted based on the number of times the applications are used and / or the duration of use, and the N applications most frequently used by users can be determined; the applications can be sorted based on the installation time of the applications, and the M applications most recently installed can be determined; and duplicate applications can be eliminated to obtain no more than (N+M) target applications.
[0051] According to the compilation method provided by one or more embodiments of the present disclosure, when the terminal is in the target running state, only the hotspot codes of the applications frequently used and recently installed by the user are compiled. On the one hand, it can prevent too many compiled applications from causing excessive power consumption of the terminal and high CPU load; on the other hand, it can enable the application that the user may use next to be compiled in time.
[0052] In some embodiments, the method further includes: after the system is updated, saving the backup file to a directory of the corresponding application for use in compiling the hotspot code of the corresponding application. By saving the backup file to a directory of the corresponding application after the system is updated, it is convenient for the terminal to edit the hotspot code of the corresponding application based on the backup file.
[0053] refer to Figure 2 , Figure 2 A compilation method 200 provided according to another embodiment of the present disclosure is shown. The compilation method 200 includes steps S201 to S206:
[0054] Step S201: before the terminal system is updated, a backup file of the hotspot description file of the application is created, wherein the hotspot description file is used to record the hotspot code of the application;
[0055] Step S202: after the system is updated, the backup file is saved in a directory of a corresponding application, and a third application set is determined based on the application with the hotspot description file;
[0056] Step S203: determining a first application set based on the number of times the application is used and / or the duration of use;
[0057] Step S204: determining a second application set based on application programs whose installation time is not greater than a preset time threshold;
[0058] Step S205: Taking the intersection of the union of the first application set and the second application set and the third application set to obtain a target application set; wherein the target application set may include one or more target application programs to be compiled.
[0059] Step S206: When the screen of the terminal is in an off state, the power of the terminal is not less than a preset power threshold, and the CPU occupancy of the terminal is not greater than a preset occupancy threshold, the hotspot codes of the target application programs in the target application set are compiled one by one based on the backup file to generate native code.
[0060] In this way, according to the compilation method provided by one or more embodiments of the present disclosure, a backup file is created for the hotspot description file of the application before the system is updated, and the target application set is determined based on the number of times the application is used and / or the length of time it is used, the installation time, and whether there is a hotspot description file. After the system is updated, when the screen of the terminal is in an off state, the power level is not less than a preset power threshold, and the CPU occupancy rate is not greater than a preset occupancy rate threshold, the hotspot codes of the target applications in the target application set are compiled one by one based on the backup hotspot description file to generate native code. This can avoid the hotspot description file being deleted due to the system update and resulting in the inability to compile in a timely manner, and there is no need to wait until the terminal is in a charging and idle state to compile the hotspot code, thereby timely improving the running performance of the application after the system is updated.
[0061] Correspondingly, Figure 3 A compiling device 300 provided based on one or more embodiments of the present disclosure is shown, comprising:
[0062] A backup unit 301 is used to create a backup file of a hotspot description file of an application before the terminal system is updated, wherein the hotspot description file is used to record the hotspot code of the application;
[0063] The compiling unit 302 is used to compile the hotspot code of the target application based on the backup file to generate native code when the terminal is in the target running state after the system is updated.
[0064] According to the compilation device provided by one or more embodiments of the present disclosure, by creating a backup file for the hotspot description file of the application before the system is updated, and after the system is updated, when the terminal is in the target running state, the hotspot code of the target application is compiled based on the backup file to generate native code, so that the hotspot description file can be prevented from being deleted by the system update and cannot be compiled in time, and there is no need to wait until the terminal is in a charging and idle state to compile the hotspot code, so that the running performance of the application can be improved in time after the system is updated. In some embodiments, the target running state is that the screen of the terminal is in a screen-off state, the power of the terminal is not less than a preset power threshold, and the CPU occupancy rate of the terminal is not greater than a preset occupancy threshold. In this embodiment, the compilation of the hotspot code is triggered when the terminal meets the following three conditions at the same time: the screen of the terminal is in a screen-off state, the power is not less than a preset power threshold, and the CPU occupancy rate is not greater than a preset occupancy rate. On the one hand, when the terminal is in the above-mentioned target running state, compiling the hotspot code will not affect the terminal's performance, and the compilation process is imperceptible to the user; on the other hand, the probability of the terminal entering the above-mentioned target running state is higher than the probability of the terminal being in a charging and idle state, so that the hotspot code of the target application can be compiled into native code in time.
[0065] In some embodiments, the target application is determined based on at least one of the following: the number of times the application is used, the duration of use of the application, the installation time of the application, and whether the application has been launched.
[0066] In some embodiments, the apparatus 300 further comprises:
[0067] A first application determination unit, configured to determine a first application set based on the number of times the application program is used and / or the duration of use;
[0068] A second application determination unit, configured to determine a second application set based on application programs whose installation time is not greater than a preset time threshold;
[0069] A target application determining unit is configured to determine the target application based on a union of the first application set and the second application set.
[0070] Exemplarily, the first application determination unit may sort the applications in the terminal based on the number of times the applications are used and / or the duration of use, and determine the N applications most frequently used by users; the second application determination unit may sort the applications based on the installation time of the applications, and determine the M most recently installed applications; the target application determination unit may exclude duplicate applications to obtain no more than (N+M) target applications.
[0071] In this way, according to the compilation device provided by one or more embodiments of the present disclosure, when the terminal is in the target running state, only the hotspot codes of the applications frequently used and recently installed by the user are compiled. On the one hand, it can prevent too many compiled applications from causing excessive terminal power consumption and high CPU load; on the other hand, it can enable the application that the user may use next to be compiled in time.
[0072] In some embodiments, the apparatus 300 further comprises:
[0073] A saving unit is used to save the backup file to the directory of the corresponding application after the system is updated, so as to be used for compiling the hotspot code of the corresponding application. By saving the backup file to the directory of the corresponding application after the system is updated, it is convenient for the terminal to edit the hotspot code of the corresponding application based on the backup file.
[0074] For the embodiments of the device, since they basically correspond to the method embodiments, the relevant parts refer to the partial description of the method embodiments. The device embodiments described above are merely illustrative, and the modules described as separation modules may or may not be separated. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of the present embodiment. Those of ordinary skill in the art can understand and implement without paying creative work.
[0075] Accordingly, according to one or more embodiments of the present disclosure, a terminal device is provided, including:
[0076] at least one memory and at least one processor;
[0077] The memory is used to store program codes, and the processor is used to call the program codes stored in the memory to execute the compilation method provided according to one or more embodiments of the present disclosure.
[0078] Reference below Figure 4, which shows a schematic diagram of the structure of a mobile terminal 400 suitable for implementing the embodiment of the present disclosure. The terminal device in the embodiment of the present disclosure may include but is not limited to a television, a smart screen, a mobile phone, a computer, an e-reader, a PDA (personal digital assistant), a PAD (tablet computer), etc. Figure 4 The terminal shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.
[0079] like Figure 4 As shown, the terminal device 400 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 401, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 402 or a program loaded from a storage device 408 into a random access memory (RAM) 403. In the RAM 403, various programs and data required for the operation of the terminal device 400 are also stored. The processing device 401, the ROM 402, and the RAM 403 are connected to each other via a bus 404. An input / output (I / O) interface 405 is also connected to the bus 404.
[0080] Typically, the following devices may be connected to the I / O interface 405: an input device 406 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 407 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 408 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 409. The communication device 409 may allow the terminal device 400 to communicate with other devices wirelessly or by wire to exchange data. Although Figure 4 The terminal device 400 is shown to have various devices, but it should be understood that it is not required to implement or possess all the devices shown. More or fewer devices may be implemented or possessed instead.
[0081] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a non-transitory computer-readable medium, and the computer program contains program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication device 409, or installed from the storage device 408, or installed from the ROM402. When the computer program is executed by the processing device 401, the above-mentioned functions defined in the method of the embodiment of the present disclosure are executed.
[0082] It should be noted that the computer-readable medium disclosed above may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in combination with an instruction execution system, device or device. In the present disclosure, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, in which a computer-readable program code is carried. This propagated data signal may take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. The computer readable signal medium may also be any computer readable medium other than a computer readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer readable medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.
[0083] In some embodiments, the client and the server may communicate using any currently known or future developed network protocol such as HTTP (HyperTextTransferProtocol), and may be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), an internet (e.g., the Internet), and a peer-to-peer network (e.g., an adhoc peer-to-peer network), as well as any currently known or future developed network.
[0084] The computer-readable medium may be included in the terminal device, or may exist independently without being installed in the terminal device.
[0085] The above-mentioned computer-readable medium carries one or more programs. When the above-mentioned one or more programs are executed by the terminal device, the terminal device: creates a backup file of the hotspot description file of the application before the terminal system is updated, and the hotspot description file is used to record the hotspot code of the application; after the system is updated, when the terminal is in the target running state, the hotspot code of the target application is compiled based on the backup file to generate native code.
[0086] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages or a combination thereof, including, but not limited to, object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer device, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0087] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some implementations as replacements, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0088] The units involved in the embodiments described in the present disclosure may be implemented by software or hardware. The name of the unit does not limit the unit itself in some cases. For example, the backup unit may also be described as "a unit for creating a backup file of the hotspot description file of the application before the terminal system is updated".
[0089] The functions described above herein may be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), and the like.
[0090] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. According to one or more embodiments of the present disclosure, a compilation method is provided, comprising: before a terminal system is updated, creating a backup file of a hotspot description file of an application, wherein the hotspot description file is used to record the hotspot code of the application; after the system is updated, when the terminal is in a target running state, compiling the hotspot code of the target application based on the backup file to generate native code.
[0091] According to one or more embodiments of the present disclosure, the target operating state includes: the screen of the terminal is in an off state, the battery level of the terminal is not less than a preset battery threshold, and the CPU occupancy rate of the terminal is not greater than a preset occupancy rate threshold.
[0092] According to one or more embodiments of the present disclosure, the target application is determined based on at least one of the following: the number of times the application is used, the duration of use of the application, the installation time of the application, and whether the application has been started.
[0093] The compilation method provided according to one or more embodiments of the present disclosure also includes: determining a first application set based on the number of times the application is used and / or the duration of use; determining a second application set based on applications whose installation time is not greater than a preset time threshold; and determining the target application based on the union of the second application set and the third application set.
[0094] According to one or more embodiments of the present disclosure, the compiling method further includes: after the system is updated, saving the backup file to a directory of the corresponding application program.
[0095] According to one or more embodiments of the present disclosure, a compilation device is provided, characterized in that it includes: a backup unit, used to create a backup file of a hotspot description file of an application before a terminal system is updated, wherein the hotspot description file is used to record the hotspot code of the application; and a compilation unit, used to compile the hotspot code of the target application based on the backup file to generate native code when the terminal is in a target running state after the system is updated.
[0096] According to one or more embodiments of the present disclosure, a terminal is provided, characterized in that the mobile terminal comprises: at least one memory and at least one processor; wherein the memory is used to store program code, and the processor is used to call the program code stored in the memory to execute the compilation method according to one or more embodiments of the present disclosure.
[0097] According to one or more embodiments of the present disclosure, a non-transitory computer storage medium is provided, characterized in that the non-transitory computer storage medium stores program code, and when the program code is run on a computer device, the computer device executes the compilation method according to one or more embodiments of the present disclosure.
[0098] The above description is only a preferred embodiment of the present disclosure and an explanation of the technical principles used. Those skilled in the art should understand that the scope of disclosure involved in the present disclosure is not limited to the technical solutions formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above disclosed concept. For example, the above features are replaced with the technical features with similar functions disclosed in the present disclosure (but not limited to) by each other to form a technical solution.
[0099] In addition, although each operation is described in a specific order, this should not be understood as requiring these operations to be performed in the specific order shown or in a sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Similarly, although some specific implementation details are included in the above discussion, these should not be interpreted as limiting the scope of the present disclosure. Some features described in the context of a separate embodiment can also be implemented in a single embodiment in combination. On the contrary, the various features described in the context of a single embodiment can also be implemented in multiple embodiments individually or in any suitable sub-combination mode.
[0100] Although the subject matter has been described in language specific to structural features and / or methodological logical actions, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. On the contrary, the specific features and actions described above are merely example forms of implementing the claims.
Claims
1. A compiling method, characterized in that: The method is applied to a terminal, and the method includes: Before the terminal system is updated, creating a backup file of a hotspot description file of one or more applications installed in the terminal, wherein the hotspot description file is used to record the hotspot code of the application; After the system is updated, when the terminal is in a target running state, compiling the hotspot code of the target application based on a backup file of the target application among the one or more applications to generate native code; The target application is determined based on at least one of the following: the number of times the application is used, the duration of use of the application, the installation time of the application, and whether the application has been started.
2. The compiling method according to claim 1, characterized in that: The target operating state includes: The screen of the terminal is in an off state, the power of the terminal is not less than a preset power threshold, and the CPU occupancy rate of the terminal is not greater than a preset occupancy rate threshold.
3. The compiling method according to claim 2, characterized in that: Also includes: Determine a first application set based on the number of times the application is used and / or the duration of use; Determining a second application set based on application programs whose installation time is not greater than a preset time threshold; The target application is determined based on a union of the first application set and the second application set.
4. The compiling method according to claim 1, wherein: Also includes: After the system is updated, the backup file is saved in a directory of the corresponding application.
5. A compiling device, characterized in that: The device is applied to a terminal, and the device includes: A backup unit, used to create a backup file of a hotspot description file of one or more applications installed in the terminal before the terminal system is updated, wherein the hotspot description file is used to record the hotspot code of the application; a compiling unit, configured to compile the hotspot code of the target application program based on a backup file of the target application program among the one or more applications to generate a native code when the terminal is in a target running state after the system is updated; The target application is determined based on at least one of the following: the number of times the application is used, the duration of use of the application, the installation time of the application, and whether the application has been started.
6. A terminal, characterized in that: The terminal comprises: at least one memory and at least one processor; The memory is used to store program codes, and the processor is used to call the program codes stored in the memory to execute the compiling method according to any one of claims 1 to 4.
7. A non-transitory computer storage medium, characterized in that The non-transitory computer storage medium stores a program code, and when the program code is executed on a computer device, the computer device executes the compiling method according to any one of claims 1 to 4.
