Compilation processing method, device, electronic device and storage medium
By obtaining the operation information of the application and determining the compilation mode based on multiple compilation modes, targeted precompilation of applications in electronic devices is solved, and the problem of insufficient improvement in application operation efficiency in the prior art is improved and user experience is improved.
Patent Information
- Application Number
- CN202011595428.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-12-29
- Publication Date
- 2024-11-26
- Estimated Expiration
- 2040-12-29
AI Technical Summary
The precompilation method of hot code for applications in electronic devices is difficult to meet the needs of users and cannot achieve the best results in user usage scenarios, resulting in insufficient improvement in application operation efficiency.
By obtaining the operation information of the application, determining the target compilation mode from multiple compilation modes based on this information, different precompilation processing is performed for applications with different running information, improving the operation effect and user experience of the application.
By correlating the strength of pre-compilation of the application code with the operation information, different pre-compilation of the application code for different operation information is achieved, improving the application's running effect and user experience.
Smart Images

Figure CN112540769B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and more specifically, to a compilation processing method, device, electronic device and storage medium. Background Art
[0002] In order to improve the efficiency of running applications in electronic devices, the applications can be compiled and optimized by a compiler. At present, a common method is to collect hotspot codes of specific applications in electronic devices and precompile the collected hotspot codes. However, the method of precompiling hotspot codes in this way is difficult to meet the needs of users. Summary of the invention
[0003] In view of the above problems, the present application proposes a compilation processing method, device, electronic device and storage medium to solve the above problems.
[0004] In a first aspect, an embodiment of the present application provides a compilation processing method applied to a target system service of an electronic device, wherein the target system service is used to process compilation tasks of the electronic device, the method comprising: obtaining an installed target application; obtaining operation information of the target application; based on the operation information, determining a compilation mode corresponding to the target application from a plurality of compilation modes as a target compilation mode, wherein each compilation mode in the plurality of compilation modes corresponds to a different amount of pre-compiled code; and based on the target compilation mode, compiling the code contained in the installation package of the target application.
[0005] In a second aspect, an embodiment of the present application provides a compilation processing device, which is applied to a target system service of an electronic device, wherein the target system service is used to process the compilation tasks of the electronic device, and the device includes: a target application acquisition module, which is used to acquire an installed target application; an operation information acquisition module, which is used to acquire the operation information of the target application; a target compilation mode determination module, which is used to determine, based on the operation information, the compilation mode corresponding to the target application from multiple compilation modes as the target compilation mode, wherein each compilation mode in the multiple compilation modes corresponds to a different amount of pre-compiled code; and a compilation processing module, which is used to compile and process the code contained in the installation package of the target application based on the target compilation mode.
[0006] In a third aspect, an embodiment of the present application provides an electronic device, comprising a memory and a processor, wherein the memory is coupled to the processor, the memory stores instructions, and when the instructions are executed by the processor, the processor executes the above method.
[0007] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, in which a program code is stored, and the program code can be called by a processor to execute the above method.
[0008] The compilation processing method, device, electronic device and storage medium provided in the embodiments of the present application obtain an installed target application, obtain the running information of the target application, and based on the running information, determine the compilation mode corresponding to the target application from multiple compilation modes as the target compilation mode, wherein each compilation mode in the multiple compilation modes corresponds to a different amount of pre-compiled code, and based on the target compilation mode, compile the code included in the installation package of the target application, thereby associating the strength of the application code pre-compilation with the application's running information, thereby achieving different pre-compilation of the code of applications with different running information, thereby improving the running effect of the application and the user's experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0009] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without paying any creative work.
[0010] Figure 1 A schematic diagram showing a flow chart of a compiling processing method provided by an embodiment of the present application is shown;
[0011] Figure 2 A schematic diagram showing a flow chart of a compiling method provided by another embodiment of the present application is shown;
[0012] Figure 3 A schematic diagram showing a flow chart of a compiling method provided by another embodiment of the present application is shown;
[0013] Figure 4 A schematic diagram showing a flow chart of a compiling method provided by another embodiment of the present application is shown;
[0014] Figure 5 A schematic diagram showing a flow chart of a compiling method provided by yet another embodiment of the present application is shown;
[0015] Figure 6 A schematic diagram showing a flow chart of a compiling method provided by yet another embodiment of the present application is shown;
[0016] Figure 7 A schematic diagram showing a flow chart of a compiling method provided by yet another embodiment of the present application is shown;
[0017] Figure 8 A schematic diagram showing a flow chart of a compiling method provided by yet another embodiment of the present application is shown;
[0018] Fig. 9 A module block diagram of a compiling and processing device provided in an embodiment of the present application is shown;
[0019] Fig.10 A block diagram of an electronic device for executing a compiling method according to an embodiment of the present application is shown;
[0020] Fig.11 A storage unit for storing or carrying program codes for implementing the compilation processing method according to an embodiment of the present application is shown. DETAILED DESCRIPTION
[0021] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application.
[0022] In the Android system, there are some system services for processing some scheduled tasks, which are called JobService. Among them, the target system service BackgroundDexOptService in the system service is used to process the compilation task of the electronic device. Specifically, BackgroundDexOptService is used to process the compilation task of the code in the installation package of the application installed on the electronic device. The main logic of the target system service is: when the system of the electronic device is in the charging + idle state, it will traverse the installation packages of all applications installed on the electronic device to determine whether it is necessary to re-execute the compilation (dex2oat). If the judgment result indicates that the compilation needs to be re-executed, dex2oat will be re-executed.
[0023] For an application installation package, the scenarios in which recompilation is required include the following:
[0024] 1. The system of the electronic equipment is started for the first time;
[0025] 2. The system of the electronic device has been updated, such as changes in system images such as boot.art;
[0026] 3. If the compilation condition (compiler-filter) of the application installation package is based on primary.prof (currently including speed-profile and everything-profile), and primary.prof has changed.
[0027] For BackgroundDexOptService, the installation package of the application that needs to be recompiled is generally only the third case mentioned above. That is, during the running of the application, the hot code statistics are triggered and a new primary.prof file is generated. The system determines that the newly generated primary.prof file needs to be recompiled to generate new machine code. Among them, primary.prof is used to record the hot code when the application is running, that is, the most frequently called methods. The introduction of Profile can well adjust the validity of the machine code (including the scope of the called code) and disk occupancy (the compiled machine code file is stored in the form of an odex file in the installation directory of the application. The larger the amount of compiled code, the larger the odex file will be).
[0028] The inventor has found through research that the above scheme is based on the statistical results of the profile as the judgment condition for whether recompilation is needed. However, the usage behavior of most users on electronic devices is that many applications are installed on the electronic devices, but only a few are frequently used. Therefore, if the installation package of the application is repeatedly recompiled based on the method hotspot of the application to achieve the purpose of optimization, it cannot achieve the best effect in the current user usage scenario and it is difficult to meet the needs of users.
[0029] In view of the above problems, the inventor has discovered after long-term research and proposed the compilation processing method, device, electronic device and storage medium provided in the embodiments of the present application, which associates the strength of the code pre-compilation of the application with the running information of the application, thereby achieving different pre-compilation of the code of the application with different running information, thereby improving the running effect of the application and the user's experience. Among them, the specific compilation processing method is described in detail in the subsequent embodiments.
[0030] Please refer to Figure 1 , Figure 1 A flow chart of a compilation processing method provided by an embodiment of the present application is shown. The method is used to associate the strength of the application code pre-compilation with the application's running information, thereby achieving different pre-compilations of the code for applications with different running information, thereby improving the running effect of the application and the user's experience. In a specific embodiment, the compilation processing method is applied to a compilation processing device 200 and a target system service of an electronic device 100 equipped with the compilation processing device 200, and the target system service is used to process compilation tasks of the electronic device. The specific process of this embodiment will be explained below by taking an electronic device as an example. Of course, it can be understood that the electronic device used in this embodiment may include a smart phone, a tablet computer, a wearable electronic device, etc., which is not limited here. The following will focus on Figure 1 The process shown is described in detail, and the compilation processing method may specifically include the following steps:
[0031] Step S110: Obtain the installed target application.
[0032] The target application may be any one or more applications installed on the electronic device, or may be one or more pre-specified applications, which are not limited here. When one or more pre-specified applications are successfully installed by the electronic device, they can be regarded as the target application in this embodiment. As a method, the target application can be represented by its program identifier, which may be, for example, the program name of the target application, the program number of the target application, etc., which are not limited here.
[0033] In some embodiments, the target system service can obtain the installed target application when the system is in charging and idle state. As a way, the target system service can determine the number of times to obtain the installed target application within a day according to the usage characteristic parameter value of the electronic device, wherein, when the usage characteristic parameter value of the electronic device is high, the target system service can obtain the installed target application more times within a day, for example, 3 times, and when the usage characteristic parameter value of the electronic device is low, the target system service can obtain the installed target application less times within a day, for example, 1 time.
[0034] Step S120: Acquire the running information of the target application.
[0035] In this embodiment, after obtaining the installed target application, the operation information of the target application can be obtained. The operation information of the target application may include the calling frequency and the running time. After obtaining the installed target application, the calling frequency and the running information of the target application can be obtained.
[0036] In some implementations, the electronic device may record the running information of the target application. After acquiring the installed target application, the recorded running information of the target application may be acquired locally on the electronic device.
[0037] As one way, the operation information of the target application in all historical time periods can be obtained, for example, the operation information of the target application in all time periods from the time of installation to the present can be obtained. As another way, the operation information of the target application in a specified historical time period can be obtained, for example, the operation information of the target application in the time period of the past three days, the past week, or the past month can be obtained.
[0038] Step S130: Based on the running information, determine a compilation mode corresponding to the target application from a plurality of compilation modes as a target compilation mode, wherein each compilation mode in the plurality of compilation modes corresponds to a different amount of precompiled code.
[0039] In some embodiments, the electronic device may pre-set multiple compilation modes, or the server connected to the electronic device may pre-set multiple compilation modes, wherein each of the multiple compilation modes corresponds to a different amount of pre-compiled code. As a method, the multiple compilation modes include at least a speed mode, a speed-profile mode, and a real-time compilation mode, wherein, among the speed mode, the speed-profile mode, and the real-time compilation mode, the speed mode corresponds to the largest amount of pre-compiled code, the speed-profile mode corresponds to the second largest amount of pre-compiled code, and the real-time compilation mode corresponds to the smallest amount of pre-compiled code. In specific implementation, the speed mode will pre-compile all the codes in the installation package of the application, without relying on the profile file, and can be considered as a full compilation. The speed-profile mode is compiled based on the method recorded in the profile, and only the pre-compiled code recorded in the profile will be pre-compiled, and the others will not be pre-compiled. The real-time compilation mode is to temporarily compile the code used in the installation package of the application when the application is running, and no pre-compilation is performed on all the codes in the installation package.
[0040] In this embodiment, after obtaining the running information of the target application, the compilation mode corresponding to the target application can be determined from multiple compilation modes as the target compilation mode based on the running information. As a way, when the multiple compilation modes include speed mode, speed-profile mode and real-time compilation mode, the compilation mode corresponding to the target application can be determined from the speed mode, speed-profile mode and real-time compilation mode as the target compilation mode. For example, when it is determined based on the running information of the target application that the compilation mode corresponding to the target application is the speed mode, the speed mode can be used as the target compilation mode; when it is determined based on the running information of the target application that the compilation mode corresponding to the target application is the speed-profile mode, the speed-profile mode can be used as the target compilation mode, etc., and no limitation is made here.
[0041] Step S140: compile the code contained in the installation package of the target application based on the target compilation mode.
[0042] In this embodiment, after determining the target compilation mode, the code contained in the installation package of the target application can be compiled based on the target compilation mode, so that the compilation process of the target application is associated with the running information of the target application, improving the running effect of the application and the user's experience. In some implementations, after determining the speed mode as the target compilation mode, all the code contained in the installation package of the target application can be precompiled based on the speed mode; after determining the speed-profile mode as the target compilation mode, the hotspot code contained in the installation package of the target application can be precompiled based on the speed-profile mode; after determining the real-time compilation mode as the target compilation mode, all the code in the installation package of the target application can be compiled in real time based on the real-time compilation mode, etc., which are not limited here.
[0043] A compilation processing method provided by an embodiment of the present application obtains an installed target application, obtains running information of the target application, and based on the running information, determines a compilation mode corresponding to the target application from multiple compilation modes as a target compilation mode, wherein each compilation mode in the multiple compilation modes corresponds to a different amount of precompiled code, and based on the target compilation mode, compiles the code included in the installation package of the target application, thereby associating the strength of the application code precompilation with the application's running information, thereby achieving different precompilations of the code for applications with different running information, thereby improving the running effect of the application and the user's experience.
[0044] See also Figure 2 , Figure 2 A flowchart of a compilation processing method provided by another embodiment of the present application is shown. The method is applied to the target system service of the above electronic device, and the target system service is used to process the compilation task of the electronic device. Figure 2 The process shown is described in detail, and the compilation processing method may specifically include the following steps:
[0045] Step S210: Obtain the installed target application.
[0046] Step S220: Acquire the running information of the target application.
[0047] For the detailed description of step S210 to step S220, please refer to step S110 to step S120, which will not be repeated here.
[0048] Step S230: Determine a usage characteristic parameter value of the target application based on the operation information.
[0049] In this embodiment, after the operation information of the target application is obtained, the use characteristic parameter value of the target application can be determined based on the operation information. In some implementations, the operation information of the target application may include call frequency and operation information, and the use characteristic parameter value of the target application can be determined based on the call frequency and operation time of the target application.
[0050] In some embodiments, the usage characteristic parameter value may include at least one of a usage frequency and a usage duration. For example, after obtaining the operation information of the target application, the usage frequency of the target application may be determined based on the operation information. For another example, after obtaining the operation information of the target application, the usage duration of the target application may be determined based on the operation information.
[0051] In some embodiments, when the usage characteristic parameter value of the target application indicates that the target application is opened at least once in a day, or when the running time of the target application indicates that the running time of the target application in a day exceeds 30 minutes, then the usage characteristic parameter value of the target application can be determined to be high; when the usage characteristic parameter value of the target application indicates that the target application is opened at least once within three days, or when the running time of the target application indicates that the running time of the target application within three days exceeds 30 minutes, then the usage characteristic parameter value of the target application can be determined to be low; when the usage characteristic parameter value of the target application indicates that the target application has not been opened within a week, then the usage characteristic parameter value of the target application can be determined to be extremely low.
[0052] Step S240: Based on the usage characteristic parameter value, determine the compilation mode corresponding to the target application from the multiple compilation modes as the target compilation mode, wherein the usage characteristic parameter value of the target application is positively correlated with the amount of precompiled code corresponding to the target compilation mode.
[0053] In some implementations, the electronic device may pre-set multiple compilation modes and the relationship between each of the multiple compilation modes and the usage characteristic parameter value, or the server connected to the electronic device may pre-set multiple compilation modes and the relationship between each of the multiple compilation modes and the usage characteristic parameter value. Therefore, in this embodiment, after obtaining the usage characteristic parameter value of the target application, the compilation mode corresponding to the target application may be determined from the multiple compilation modes as the target compilation mode based on the pre-set corresponding relationship between the usage characteristic parameter value and the compilation mode.
[0054] In some embodiments, the usage characteristic parameter value of the target application is positively correlated with the amount of precompiled code corresponding to the target compilation mode, that is, the higher the usage characteristic parameter value of the target application, the more the amount of precompiled code corresponding to the target compilation mode, and the lower the usage characteristic parameter value of the target application, the less the amount of precompiled code corresponding to the target compilation mode. For example, the higher the usage frequency of the target application, the more the amount of precompiled code corresponding to the target compilation mode, and the lower the usage frequency of the target application, the less the amount of precompiled code corresponding to the target compilation mode. For another example, the higher the usage time of the target application, the more the amount of precompiled code corresponding to the target compilation mode, and the lower the usage time of the target application, the less the amount of precompiled code corresponding to the target compilation mode. As a way, when multiple compilation modes include speed mode, speed-profile mode and real-time compilation mode, if the usage characteristic parameter value of the target application is high, the speed mode can be determined as the target compilation mode, if the usage characteristic parameter value of the target application is low, the speed-profile mode can be determined as the target compilation mode, and if the usage characteristic parameter value of the target application is extremely low, the real-time compilation mode can be determined as the target compilation mode.
[0055] Step S250: Based on the target compilation mode, compile the code contained in the installation package of the target application.
[0056] For the detailed description of step S250, please refer to step S140, which will not be repeated here.
[0057] Another embodiment of the present application provides a compilation processing method, which obtains an installed target application, obtains the running information of the target application, determines the usage characteristic parameter value of the target application based on the running information, and determines the compilation mode corresponding to the target application from multiple compilation modes as the target compilation mode based on the usage characteristic parameter value, wherein the usage characteristic parameter value of the target application is positively correlated with the amount of precompiled code corresponding to the target compilation mode, and compiles the code contained in the installation package of the target application based on the target compilation mode. Figure 1 The compilation processing method shown, this embodiment also determines the usage characteristic parameter value of the application based on the running information of the application, and determines the target compilation mode based on the usage characteristic parameter value, so as to improve the suitability of the code precompilation of the application, thereby improving the running effect of the application and the user's experience.
[0058] See also Figure 3 , Figure 3A flowchart of a compilation processing method provided by another embodiment of the present application is shown. The method is applied to the target system service of the above electronic device, and the target system service is used to process the compilation task of the electronic device. Figure 3 The process shown is described in detail, and the compilation processing method may specifically include the following steps:
[0059] Step S310: Obtain the installed target application.
[0060] Step S320: Acquire the running information of the target application.
[0061] For the detailed description of step S310 to step S320, please refer to step S110 to step S120, which will not be repeated here.
[0062] Step S330: Determine a usage characteristic parameter value of the target application based on the operation information.
[0063] For the detailed description of step S330, please refer to step S230, which will not be repeated here.
[0064] Step S340: When the usage characteristic parameter value is greater than the first specified parameter value, determine the speed mode from the multiple coding modes as the target coding mode.
[0065] In some embodiments, the electronic device may be pre-set and stored with a first specified parameter value, and the first specified parameter value is used as a basis for determining the usage characteristic parameter value of the target application. Therefore, in this embodiment, after obtaining the usage characteristic parameter value of the target application, the usage characteristic parameter value of the target application may be compared with the first specified parameter value to determine whether the usage characteristic parameter value of the target application is greater than the first specified parameter value, wherein when the judgment result indicates that the usage characteristic parameter value of the target application is greater than the first specified parameter value, it may be determined that the usage characteristic parameter value of the target application is higher, and the speed mode may be determined as the target compilation mode from multiple compilation modes.
[0066] Step S350: precompile all codes included in the installation package of the target application based on the speed mode.
[0067] In some implementations, after the speed mode is determined as the target compilation mode, all codes included in the installation package of the target application can be precompiled based on the speed mode, where all codes can indicate all codes or most codes, which is not limited here.
[0068] Step S360: Scan all installed applications, wherein all the applications include the target application.
[0069] In some embodiments, when the electronic device is in a charging and idle state, the target system service can scan all applications installed on the electronic device, including the target application, to determine whether hotspot code statistics are triggered during the operation of all applications to generate a new primary.prof file, wherein when a certain application among all applications is scanned to generate a new primary.prof file, it can be determined that the certain application has generated a new hotspot code, and when a certain application among all applications is scanned to not generate a new primary.prof file, it can be determined that the certain application has not generated a new hotspot code.
[0070] Step S370: when it is detected that the target application generates new hotspot codes, all codes included in the installation package of the target application are not precompiled again.
[0071] In this embodiment, when a new hotspot code is generated by scanning a target application, since all codes in the target application have been precompiled into machine code, all codes included in the installation package of the target application do not need to be precompiled again to reduce power consumption of the electronic device.
[0072] Another embodiment of the present application provides a compilation processing method, which obtains an installed target application, obtains the running information of the target application, determines the usage characteristic parameter value of the target application based on the running information, and when the usage characteristic parameter value is greater than the first specified parameter value, determines the speed mode as the target compilation mode from multiple compilation modes, and precompiles all codes contained in the installation package of the target application based on the speed mode. Figure 1 The compilation processing method shown, this embodiment also determines the speed mode to precompile all the codes contained in the installation package of the application when the usage characteristic parameter value of the application is greater than the first specified parameter value, so as to precompile as many high-frequency used applications as possible to meet the high-performance requirements of users when they use them frequently. In addition, this embodiment does not re-precompile the target application when scanning the high-frequency application to generate new hot spot codes, so as to reduce the power consumption of the electronic device.
[0073] See also Figure 4 , Figure 4 A flow chart of a compiling processing method provided by another embodiment of the present application is shown. The method is applied to the target system service of the above electronic device, and the target system service is used to process the compiling task of the electronic device. Figure 4 The process shown is described in detail, and the compilation processing method may specifically include the following steps:
[0074] Step S410: Obtain the installed target application.
[0075] Step S420: Acquire the running information of the target application.
[0076] For the detailed description of step S410 to step S420, please refer to step S110 to step S120, which will not be repeated here.
[0077] Step S430: Determine a usage characteristic parameter value of the target application based on the operation information.
[0078] For the detailed description of step S430, please refer to step S230, which will not be repeated here.
[0079] Step S440: When the usage characteristic parameter value is greater than the first specified parameter value, determine the speed mode from the multiple coding modes as the target coding mode.
[0080] Step S450: precompile all codes included in the installation package of the target application based on the speed mode.
[0081] For the detailed description of step S440 to step S450, please refer to step S340 to step S350, which will not be repeated here.
[0082] Step S460: Scan multiple installed applications, wherein the multiple applications do not include the target application.
[0083] In some embodiments, when the electronic device is in a charging and idle state, the target system service can scan multiple applications installed on the electronic device, excluding the target application, to determine whether hotspot code statistics are triggered during the operation of each application to generate a new primary.prof file, wherein when a certain application among the multiple applications is scanned to generate a new primary.prof file, it can be determined that the certain application has generated a new hotspot code, and when a certain application among the multiple applications is scanned to not generate a new primary.prof file, it can be determined that the certain application has not generated a new hotspot code.
[0084] Among them, since all the codes in the target application have been precompiled into machine code, the newly generated hot spot code of the target application has also been precompiled into machine code, and there is no need to recompile. The target application can be excluded from the scanning scope of the target system service, saving the scanning time of the entire process.
[0085] Another embodiment of the present application provides a compilation processing method, which obtains an installed target application, obtains the running information of the target application, determines the usage characteristic parameter value of the target application based on the running information, and when the usage characteristic parameter value is greater than the first specified parameter value, determines the speed mode as the target compilation mode from multiple compilation modes, and precompiles all codes included in the installation package of the target application based on the speed mode, and scans multiple installed applications, wherein the multiple applications do not include the target application. Compared to Figure 1 The compilation processing method shown, this embodiment also determines the speed mode to precompile all the codes contained in the installation package of the application when the usage characteristic parameter value of the application is greater than the first specified parameter value, so as to precompile as many high-frequency used applications as possible to meet the high performance requirements of users when they use them frequently. In addition, this embodiment directly does not scan the high-frequency used applications during scanning to reduce the power consumption of the electronic device.
[0086] See also Figure 5 , Figure 5 A flowchart of a compilation processing method provided by another embodiment of the present application is shown. The method is applied to the target system service of the above electronic device, and the target system service is used to process the compilation task of the electronic device. Figure 5 The process shown is described in detail, and the compilation processing method may specifically include the following steps:
[0087] Step S510: Obtain the installed target application.
[0088] Step S520: Acquire the running information of the target application.
[0089] For the detailed description of step S510 to step S520, please refer to step S110 to step S120, which will not be repeated here.
[0090] Step S530: Determine a usage characteristic parameter value of the target application based on the operation information.
[0091] For the detailed description of step S530, please refer to step S230, which will not be repeated here.
[0092] Step S540: When the usage characteristic parameter value is greater than the second specified parameter value and not greater than the first specified parameter value, determine a speed-profile mode from the multiple coding modes as the target coding mode.
[0093] In some embodiments, the electronic device may be pre-set and store a first specified parameter value and a second specified parameter value, and the first specified parameter value and the second specified parameter value are used as a basis for determining the usage characteristic parameter value of the target application. Therefore, in this embodiment, after obtaining the usage characteristic parameter value of the target application, the usage characteristic parameter value of the target application may be compared with the first specified parameter value and the second specified parameter value, respectively, to determine whether the usage characteristic parameter value of the target application is greater than the second specified parameter value and not greater than the first specified parameter value, wherein when the judgment result indicates that the usage characteristic parameter value of the target application is greater than the second specified parameter value and not greater than the first specified parameter value, it can be determined that the usage characteristic parameter value of the target application is low, and the speed-profile mode can be determined as the target compilation mode from multiple compilation modes.
[0094] Step S550: precompile the hotspot code contained in the installation package of the target application based on the speed-profile mode.
[0095] In some implementations, after the speed-profile mode is determined as the target compilation mode, the hotspot codes included in the installation package of the target application may be precompiled based on the speed-profile mode.
[0096] Step S560: Scan all installed applications or scan the target application, wherein all applications include the target application.
[0097] In some embodiments, when the electronic device is in a charging and idle state, the target system service can scan all applications installed on the electronic device, including the target application, to determine whether hotspot code statistics are triggered during the operation of all applications to generate a new primary.prof file, wherein when a certain application among all applications is scanned to generate a new primary.prof file, it can be determined that the certain application has generated a new hotspot code, and when a certain application among all applications is scanned to not generate a new primary.prof file, it can be determined that the certain application has not generated a new hotspot code.
[0098] In some embodiments, when the electronic device is in a charging and idle state, the target system service can scan the target applications installed on the electronic device to determine whether hotspot code statistics are triggered during the operation of the target application to generate a new primary.prof file. When it is scanned that an application among the target applications generates a new primary.prof file, it can be determined that the target application generates a new hotspot code. When it is scanned that an application among the target applications does not generate a new primary.prof file, it can be determined that the target application does not generate a new hotspot code.
[0099] Step S570: When it is scanned that the target application generates a new hotspot code, the hotspot code included in the installation package of the target application is precompiled again.
[0100] In this embodiment, when it is scanned that the target application generates new hotspot code, since the newly generated hotspot code of the target application has not been precompiled into machine code, the hotspot code contained in the installation package of the target application can be precompiled again, that is, the machine code previously precompiled by the target application is deleted, and all the hotspot codes included in the target application are precompiled again.
[0101] The present application provides a compilation processing method in another embodiment, which obtains an installed target application, obtains the running information of the target application, determines the usage characteristic parameter value of the target application based on the running information, and when the usage characteristic parameter value is greater than the second specified parameter value and not greater than the first specified parameter value, determines the speed-profile mode as the target compilation mode from multiple compilation modes, and precompiles the hotspot code contained in the installation package of the target application based on the speed-profile mode, scans all installed applications or scans the target application, wherein all applications include the target application, and when the target application is scanned to generate a new hotspot code, re-precompiles the hotspot code contained in the installation package of the target application. Compared to Figure 1 The compilation processing method shown, this embodiment also determines the speed mode to precompile the hotspot code contained in the installation package of the application when the usage characteristic parameter value of the application is greater than the second specified parameter value and not greater than the first usage characteristic parameter value, thereby precompiling the hotspot code of the low-frequency used application to meet the basic performance requirements of the user when using it and reduce the storage space occupied by the electronic device. In addition, this embodiment also re-precompiles the hotspot code of the target application when scanning the low-frequency application to generate a new hotspot code to optimize the performance of the application.
[0102] See also Figure 6 , Figure 6 A flowchart of a compilation processing method provided by another embodiment of the present application is shown. The method is applied to the target system service of the above electronic device, and the target system service is used to process the compilation task of the electronic device. Figure 6 The process shown is described in detail, and the compilation processing method may specifically include the following steps:
[0103] Step S610: Obtain the installed target application.
[0104] Step S620: Acquire the running information of the target application.
[0105] For the detailed description of step S610 to step S620, please refer to step S110 to step S120, which will not be repeated here.
[0106] Step S630: Determine a usage characteristic parameter value of the target application based on the operation information.
[0107] For the detailed description of step S630, please refer to step S230, which will not be repeated here.
[0108] Step S640: When the usage characteristic parameter value is not greater than the second specified parameter value, determining a real-time compilation mode from the multiple compilation modes as the target compilation mode.
[0109] In some implementations, the electronic device may be pre-set and store a second specified parameter value, which is used as a basis for determining the usage characteristic parameter value of the target application. Therefore, in this embodiment, after obtaining the usage characteristic parameter value of the target application, the usage characteristic parameter value of the target application may be compared with the second specified parameter value to determine whether the usage characteristic parameter value of the target application is not greater than the second specified parameter value, wherein when the judgment result indicates that the usage characteristic parameter value of the target application is not greater than the second specified parameter value, it may be determined that the usage characteristic parameter value of the target application is extremely low, and the real-time compilation mode may be determined from multiple compilation modes as the target compilation mode.
[0110] Step S650: Based on the real-time compilation mode, the code included in the installation package of the target application is compiled in real time.
[0111] In some implementations, after the real-time compilation mode is determined as the target compilation mode, the code included in the installation package of the target application may be compiled in real time based on the real-time compilation mode.
[0112] In some embodiments, when the electronic device is in a charging and idle state, the target system service can scan multiple applications installed on the electronic device, excluding the target application, to determine whether hotspot code statistics are triggered during the operation of each application to generate a new primary.prof file, wherein when a certain application among the multiple applications is scanned to generate a new primary.prof file, it can be determined that the certain application has generated a new hotspot code, and when a certain application among the multiple applications is scanned to not generate a new primary.prof file, it can be determined that the certain application has not generated a new hotspot code.
[0113] Among them, since all the codes in the target application do not need to be compiled into machine code, the newly generated hot spot code of the target application does not need to be pre-compiled into machine code, and there is no need to re-compile. The target application can be excluded from the scanning scope of the target system service, saving the scanning time of the entire process.
[0114] Another embodiment of the present application provides a compilation processing method, which obtains an installed target application, obtains the operation information of the target application, determines the usage characteristic parameter value of the target application based on the operation information, and when the usage characteristic parameter value is not greater than the second specified frequency, determines the real-time compilation mode from multiple compilation modes as the target compilation mode, and compiles the code contained in the installation package of the target application in real time based on the real-time compilation mode. Figure 1 The compilation processing method shown, this embodiment also determines the real-time compilation mode to perform real-time compilation on the code contained in the installation package of the application when the usage characteristic parameter value of the application is not greater than the second usage characteristic parameter value, thereby performing real-time compilation on the code of the application that has not been used for a long time to reduce the storage space occupied by the electronic device.
[0115] See also Figure 7 , Figure 7 A flowchart of a compilation processing method provided by yet another embodiment of the present application is shown. The method is applied to the target system service of the above electronic device, and the target system service is used to process the compilation task of the electronic device. Figure 7 The process shown is described in detail, and the compilation processing method may specifically include the following steps:
[0116] Step S710: Obtain the installed target application.
[0117] Step S720: Obtain the running information of the target application.
[0118] For the detailed description of step S710 to step S720, please refer to step S110 to step S120, which will not be repeated here.
[0119] Step S730: Determine a usage characteristic parameter value of the target application based on the operation information.
[0120] For the detailed description of step S730, please refer to step S230, which will not be repeated here.
[0121] Step S740: When the usage characteristic parameter value is greater than the first specified parameter value, obtaining the remaining storage space.
[0122] In some embodiments, the electronic device may be pre-set and stored with a first specified parameter value, and the first specified parameter value is used as a basis for determining the usage characteristic parameter value of the target application. Therefore, in this embodiment, after obtaining the usage characteristic parameter value of the target application, the usage characteristic parameter value of the target application may be compared with the first specified parameter value to determine whether the usage characteristic parameter value of the target application is greater than the first specified parameter value, wherein when the determination result indicates that the usage characteristic parameter value of the target application is greater than the first specified parameter value, the remaining storage space of the electronic device may be obtained.
[0123] Step S750: When the remaining storage space is greater than the designated storage space, determine the speed mode from the multiple compilation modes as the target compilation mode.
[0124] In some embodiments, the electronic device may be pre-set and store a designated storage space, and the designated storage space is used as a basis for judging the remaining storage space of the electronic device. Therefore, in this embodiment, after obtaining the remaining storage space of the electronic device, the remaining storage space of the electronic device and the designated storage space may be compared to determine whether the remaining storage space of the electronic device is greater than the designated storage space, wherein, when the judgment result indicates that the remaining storage space of the electronic device is greater than the designated storage space, it indicates that even if all the codes in the installation package of the target application are pre-compiled into machine code, the electronic device has enough remaining storage space for storage, and the speed mode may be determined as the target compilation mode from multiple compilation modes.
[0125] Step S760: Based on the speed mode, precompile all codes included in the installation package of the target application.
[0126] In some implementations, after the speed mode is determined as the target compilation mode, all codes included in the installation package of the target application may be precompiled based on the speed mode.
[0127] Step S770: When the remaining storage space is not greater than the designated storage space, determine a speed-profile mode from the multiple coding modes as the target coding mode.
[0128] In some embodiments, the electronic device may be pre-set and store a designated storage space, and the designated storage space is used as a basis for judging the remaining storage space of the electronic device. Therefore, in this embodiment, after obtaining the remaining storage space of the electronic device, the remaining storage space of the electronic device and the designated storage space may be compared to determine whether the remaining storage space of the electronic device is greater than the designated storage space, wherein when the judgment result indicates that the remaining storage space of the electronic device is not greater than the designated storage space, it indicates that if all codes in the installation package of the target application are pre-compiled into machine code, the electronic device does not have enough remaining storage space for storage, then the speed-profile mode may be determined from multiple compilation modes as the target compilation mode to pre-compile the hotspot code in the installation package of the target application into machine code, thereby reducing the amount of machine code.
[0129] Step S780: precompile the hotspot code included in the installation package of the target application based on the speed-profile mode.
[0130] In some implementations, after the speed-profile mode is determined as the target compilation mode, the hotspot codes included in the installation package of the target application may be precompiled based on the speed-profile mode.
[0131] Yet another embodiment of the present application provides a compilation processing method, which obtains an installed target application, obtains the running information of the target application, determines the usage characteristic parameter value of the target application based on the running information, obtains the remaining storage space when the usage characteristic parameter value is greater than the first specified parameter value, and when the remaining storage space is greater than the specified storage space, determines the speed mode from multiple compilation modes as the target compilation mode, and based on the speed mode, precompiles all the codes contained in the installation package of the target application; when the remaining storage space is not greater than the specified storage space, determines the speed-profile mode from multiple compilation modes as the target compilation mode, and precompiles the hotspot codes contained in the installation package of the target application based on the speed-profile mode. Compared to Figure 1The compilation processing method shown, this embodiment also determines the speed mode or speed-profile mode as the target compilation mode according to the size of the remaining storage space of the electronic device when the usage characteristic parameter value of the application is greater than the first specified parameter value, thereby ensuring that the electronic device has good remaining storage space and improving the intelligence of the compilation mode selection.
[0132] See also Figure 8 , Figure 8 A flowchart of a compilation processing method provided by yet another embodiment of the present application is shown. The method is applied to the target system service of the above electronic device, and the target system service is used to process the compilation task of the electronic device. Figure 8 The process shown is described in detail, and the compilation processing method may specifically include the following steps:
[0133] Step S810: Obtain the installed target application.
[0134] Step S820: Acquire the running information of the target application.
[0135] The specific description of step S810 can be found in step S110 and will not be repeated here.
[0136] Step S830: Obtain the application type of the target application.
[0137] In some implementations, after obtaining the installed target application, the application type of the target application can be obtained. For example, the application type of the target application can be obtained as video, game, instant messaging, news, etc., which is not limited here.
[0138] Step S840: Determine a usage characteristic parameter value of the target application based on the operation information and the application type.
[0139] In this embodiment, after the operation information and application type of the target application are obtained, the use characteristic parameter value of the target application can be determined based on the operation information and application type of the target application. For example, assuming that the target application includes a first target application and a second target application, and the operation information of the first target application and the second target application are the same, and the application types of the first target application and the second target application are different, then the use characteristic parameter values of the first target application and the second target application are different. For another example, assuming that the target application includes a third target application and a fourth target application, and the operation information of the third target application and the fourth target application are different, and the application types of the third target application and the fourth target application are the same, then the use characteristic parameter values of the third target application and the fourth target application are different.
[0140] For example, when the first target application and the second target application are both opened at least once within three days, or when the running time of the target application indicates that the running time of the target application within three days exceeds 30 minutes, and the application type of the first target application is a game type and the application type of the second target application is an instant messaging type, it can be determined that the usage characteristic parameter value of the first target application is higher and the usage characteristic parameter value of the second target application is lower.
[0141] Step S850: Based on the usage characteristic parameter value, determine a compilation mode corresponding to the target application from multiple compilation modes as a target compilation mode.
[0142] For the detailed description of step S850, please refer to step S240, which will not be repeated here.
[0143] Step S860: Based on the target compilation mode, compile the code included in the installation package of the target application.
[0144] For the detailed description of step S860, please refer to step S140, which will not be repeated here.
[0145] Step S870: When the usage characteristic parameter value changes from greater than the second specified parameter value to not greater than the second specified parameter value, the locally stored target machine code is deleted, wherein the target machine code is obtained by pre-compiling the code contained in the installation package of the target application through the target compilation mode.
[0146] In some embodiments, the change of the usage characteristic parameter value of the target application from being greater than the second specified parameter value to being not greater than the second specified parameter value may include: the usage characteristic parameter value of the target application changes from being greater than the first specified parameter value to being not greater than the second specified parameter value, and the usage characteristic parameter value of the target application changes from being greater than the second specified parameter value and not greater than the first specified parameter value to being not greater than the second specified parameter value. Wherein, when the usage characteristic parameter value of the target application changes from being greater than the first specified parameter value to being not greater than the second specified parameter value, the usage characteristic parameter value characterizing the target application changes from being relatively high to being extremely low, and when the usage characteristic parameter value of the target application changes from being greater than the second specified parameter value and not greater than the first specified parameter value to being not greater than the second specified parameter value, the usage characteristic parameter value characterizing the target application changes from being relatively low to being extremely low.
[0147] In some embodiments, when the usage characteristic parameter value of the target application is greater than the first specified parameter value, all codes in the installation package of the target application are precompiled to generate target machine code and stored in the electronic device. When the usage characteristic parameter value of the target application is greater than the second specified parameter value and not greater than the first specified parameter value, the hotspot code in the installation package of the target application is precompiled to generate target machine code and stored in the electronic device. Therefore, when the usage characteristic parameter value of the target application changes from greater than the second specified parameter value to not greater than the second specified parameter value, it indicates that the probability of the target application being used is extremely low, and the locally stored target machine code can be deleted to free up storage space of the electronic device.
[0148] Yet another embodiment of the present application provides a compilation processing method, which obtains an installed target application, obtains an application type of the target application, determines a usage characteristic parameter value of the target application based on the operation information and the application type, determines a compilation mode corresponding to the target application from multiple compilation modes as a target compilation mode based on the usage characteristic parameter value, compiles the code included in the installation package of the target application based on the target compilation mode, and deletes the locally stored target machine code when the usage characteristic parameter value changes from being greater than a second specified parameter value to being less than the second specified parameter value, wherein the target machine code is obtained by pre-compiling the code included in the installation package of the target application using the target compilation mode. Compared to Figure 1 In the compilation processing mode shown, this embodiment also determines the usage characteristic parameter value of the application program based on the type and operation information of the application program, thereby improving the accuracy of the determined usage characteristic parameter value. In addition, this embodiment also deletes the corresponding machine code when the usage characteristic parameter value of the target application program decreases to a certain level, thereby freeing up storage space of the electronic device.
[0149] See also Fig. 9 , Fig. 9The module block diagram of the compiling processing device provided by the embodiment of the present application is shown. The compiling processing device 200 is applied to the target system service of the above electronic device, and the target system service is used to process the compiling task of the electronic device. Fig. 9 The module block diagram shown in FIG. 1 is used to illustrate that the compiling and processing device 200 includes: a target application acquisition module 210, an operation information acquisition module 220, a target compilation mode determination module 230, and a compiling and processing module 240, wherein:
[0150] The target application acquisition module 210 is used to acquire installed target applications.
[0151] The operation information acquisition module 220 is used to acquire the operation information of the target application.
[0152] The target compilation mode determination module 230 is used to determine, based on the running information, a compilation mode corresponding to the target application from a plurality of compilation modes as a target compilation mode, wherein each compilation mode in the plurality of compilation modes corresponds to a different amount of precompiled code.
[0153] Furthermore, the target compilation mode determination module 230 includes: a feature parameter value determination submodule and a target compilation mode determination submodule, wherein:
[0154] The usage characteristic parameter value determination submodule is used to determine the usage characteristic parameter value of the target application based on the operation information.
[0155] The target compilation mode determination submodule is used to determine the compilation mode corresponding to the target application from the multiple compilation modes as the target compilation mode based on the usage characteristic parameter value, wherein the usage characteristic parameter value of the target application is positively correlated with the amount of precompiled code corresponding to the target compilation mode.
[0156] Further, the target compilation mode determination submodule includes: a first target compilation mode determination unit, wherein:
[0157] The first target coding mode determining unit is configured to determine a speed mode from the plurality of coding modes as the target coding mode when the usage characteristic parameter value is greater than a first specified parameter value.
[0158] Further, the first target coding mode determining unit includes: a storage space obtaining subunit, a first target coding mode determining subunit, a second target coding mode determining subunit and a pre-coding subunit, wherein:
[0159] The storage space acquisition subunit is used to acquire the remaining storage space when the usage characteristic parameter value is greater than the first specified parameter value.
[0160] The first target compilation mode determination subunit is configured to determine a speed mode from the plurality of compilation modes as the target compilation mode when the remaining storage space is greater than a specified storage space.
[0161] The second target coding mode determining subunit is configured to determine a speed-profile mode from the plurality of coding modes as the target coding mode when the remaining storage space is not greater than a specified storage space.
[0162] The pre-compilation sub-unit is used to pre-compile the hotspot code contained in the installation package of the target application based on the speed-profile mode.
[0163] Further, the target compilation mode determination submodule includes: a second target compilation mode determination unit, wherein:
[0164] The second target coding mode determining unit is configured to determine a speed-profile mode from the plurality of coding modes as the target coding mode when the usage characteristic parameter value is greater than a second specified parameter value and not greater than the first specified parameter value.
[0165] Further, the target compilation mode determination submodule includes: a third target compilation mode determination unit, wherein:
[0166] The third target compilation mode determination unit is configured to determine the real-time compilation mode from the multiple compilation modes as the target compilation mode when the usage characteristic parameter value is not greater than the second specified parameter value.
[0167] Furthermore, the target compilation mode determination module 230 includes: an application acquisition submodule and a first usage characteristic parameter value determination submodule, wherein:
[0168] The application type acquisition submodule is used to acquire the application type of the target application program.
[0169] The first usage characteristic parameter value determination submodule is used to determine the usage characteristic parameter value of the target application program based on the operation information and the application type.
[0170] Furthermore, the operation information includes the calling frequency and the running time, and the target compilation mode determination module 230 includes: a second use characteristic parameter value determination submodule, wherein:
[0171] The second usage characteristic parameter value determination submodule is used to determine the usage characteristic parameter value of the target application based on the calling frequency and the running time.
[0172] The compiling processing module 240 is used to compile the code contained in the installation package of the target application based on the target compiling mode.
[0173] Furthermore, the compiling processing module 240 includes: a first compiling processing submodule, wherein:
[0174] The first compile processing submodule is used to precompile all codes contained in the installation package of the target application based on the speed mode.
[0175] Furthermore, the compiling processing module 240 includes: a first scanning submodule and a second compiling processing submodule, wherein:
[0176] The first scanning submodule is used to scan all installed applications, wherein all the applications include the target application.
[0177] The second compilation processing submodule is used for not re-precompiling all the codes included in the installation package of the target application when it is scanned that the target application generates new hotspot codes.
[0178] Furthermore, the compiling processing module 240 includes: a second scanning submodule, wherein:
[0179] The second scanning submodule is used to scan multiple installed applications, wherein the multiple applications do not include the target application.
[0180] Furthermore, the compiling processing module 240 includes: a second compiling processing submodule, wherein:
[0181] The second compilation processing submodule is used to precompile the hotspot code contained in the installation package of the target application based on the speed-profile mode.
[0182] Furthermore, the compiling processing module 240 includes: a third scanning submodule and a third compiling processing submodule, wherein:
[0183] The third scanning submodule is used to scan all installed applications or scan the target application, wherein all applications include the target application.
[0184] The third compilation processing submodule is used to re-precompile the hotspot code contained in the installation package of the target application when it is scanned that the target application generates new hotspot code.
[0185] Furthermore, the compiling processing module 240 includes: a fourth compiling processing submodule, wherein:
[0186] The fourth compilation processing submodule is used to compile the code contained in the installation package of the target application in real time based on the real-time compilation mode.
[0187] Furthermore, the compiling and processing device 200 includes: a machine code deletion module, wherein:
[0188] A machine code deletion module is used to delete the locally stored target machine code when the usage characteristic parameter value changes from greater than the second specified parameter value to not greater than the second specified parameter value, wherein the target machine code is obtained by pre-compiling the code contained in the installation package of the target application program through the target compilation mode.
[0189] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the above-described devices and modules can refer to the corresponding processes in the aforementioned method embodiments, and will not be repeated here.
[0190] In several embodiments provided in the present application, the coupling between modules may be electrical, mechanical or other forms of coupling.
[0191] In addition, each functional module in each embodiment of the present application can be integrated into a processing module, or each module can exist physically separately, or two or more modules can be integrated into one module. The above integrated modules can be implemented in the form of hardware or software functional modules.
[0192] See also Fig.10 , which shows a structural block diagram of an electronic device 100 provided in an embodiment of the present application. The electronic device 100 may be an electronic device capable of running applications, such as a smart phone, a tablet computer, an e-book, etc. The electronic device 100 in the present application may include one or more of the following components: a processor 110, a memory 120, and one or more applications, wherein the one or more applications may be stored in the memory 120 and configured to be executed by one or more processors 110, and the one or more programs are configured to execute the method described in the aforementioned method embodiment.
[0193] Among them, the processor 110 may include one or more processing cores. The processor 110 uses various interfaces and lines to connect various parts of the entire electronic device 100, and executes various functions and processes data of the electronic device 100 by running or executing instructions, programs, code sets or instruction sets stored in the memory 120, and calling data stored in the memory 120. Optionally, the processor 110 can be implemented in at least one hardware form of digital signal processing (Digital Signal Processing, DSP), field programmable gate array (Field-Programmable Gate Array, FPGA), and programmable logic array (Programmable Logic Array, PLA). The processor 110 can integrate one or a combination of a central processing unit (Central Processing Unit, CPU), a graphics processing unit (Graphics Processing Unit, GPU) and a modem. Among them, the CPU mainly processes the operating system, user interface and application programs; the GPU is responsible for rendering and drawing the content to be displayed; and the modem is used to process wireless communications. It can be understood that the above-mentioned modem may not be integrated into the processor 110, but may be implemented separately through a communication chip.
[0194] The memory 120 may include a random access memory (RAM) or a read-only memory (ROM). The memory 120 may be used to store instructions, programs, codes, code sets or instruction sets. The memory 120 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for implementing at least one function (such as a touch function, a sound playback function, an image playback function, etc.), instructions for implementing the following various method embodiments, etc. The data storage area may also store data (such as a phone book, audio and video data, chat record data) created by the electronic device 100 during use.
[0195] See also Fig.11 , which shows a structural block diagram of a computer-readable storage medium provided in an embodiment of the present application. The computer-readable medium 300 stores program codes, which can be called by a processor to execute the method described in the above method embodiment.
[0196] The computer readable storage medium 300 may be an electronic memory such as a flash memory, an EEPROM (electrically erasable programmable read-only memory), an EPROM, a hard disk, or a ROM. Optionally, the computer readable storage medium 300 includes a non-transitory computer-readable storage medium. The computer readable storage medium 300 has storage space for program code 310 that performs any method steps in the above method. These program codes can be read from or written to one or more computer program products. The program code 310 can be compressed, for example, in an appropriate form.
[0197] In summary, the compilation processing method, device, electronic device and storage medium provided in the embodiments of the present application obtain an installed target application, obtain the running information of the target application, and based on the running information, determine the compilation mode corresponding to the target application from multiple compilation modes as the target compilation mode, wherein each compilation mode in the multiple compilation modes corresponds to a different amount of pre-compiled code, and based on the target compilation mode, compile the code contained in the installation package of the target application, thereby associating the strength of the application code pre-compilation with the application's running information, thereby achieving different pre-compilation of the code of applications with different running information, thereby improving the running effect of the application and the user's experience.
[0198] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present application.
Claims
1. A compiling method, characterized in that: A target system service applied to an electronic device, the target system service being used to process a compilation task of the electronic device, the method comprising: Get the installed target application; Obtaining the running information of the target application; Based on the operation information, determining a usage characteristic parameter value of the target application; When the usage characteristic parameter value is greater than the first specified parameter value, determining the speed mode as the target compilation mode from the plurality of compilation modes, wherein the usage characteristic parameter value of the target application is positively correlated with the amount of precompiled code corresponding to the target compilation mode, wherein the amount of precompiled code corresponding to each compilation mode in the plurality of compilation modes is different; When the usage characteristic parameter value is greater than a second specified parameter value and not greater than the first specified parameter value, determining a speed-profile mode from the plurality of coding modes as the target coding mode; When the usage characteristic parameter value is not greater than the second specified parameter value, determining a real-time compilation mode from the multiple compilation modes as the target compilation mode; Based on the target compilation mode, the code included in the installation package of the target application is compiled.
2. The method according to claim 1, characterized in that The compiling of the code contained in the installation package of the target application based on the target compilation mode includes: Based on the speed mode, all codes included in the installation package of the target application are precompiled.
3. The method according to claim 2, characterized in that After precompiling all codes included in the installation package of the target application based on the speed mode, the method further includes: Scanning all installed applications, wherein all the applications include the target application; When it is scanned that the target application generates new hotspot codes, all codes included in the installation package of the target application are not precompiled again.
4. The method according to claim 2, characterized in that: After precompiling all codes included in the installation package of the target application based on the speed mode, the method further includes: A plurality of installed applications is scanned, wherein the plurality of applications do not include the target application.
5. The method according to claim 2, characterized in that: When the usage characteristic parameter value is greater than the first specified parameter value, determining the speed mode from the multiple compilation modes as the target compilation mode includes: When the usage characteristic parameter value is greater than the first specified parameter value, obtaining the remaining storage space; When the remaining storage space is greater than the designated storage space, a speed mode is determined from the multiple compilation modes as the target compilation mode.
6. The method according to claim 5, characterized in that The method further comprises: When the remaining storage space is not greater than the designated storage space, determining a speed-profile mode from the plurality of compilation modes as the target compilation mode; The compiling of the code contained in the installation package of the target application based on the target compilation mode includes: Based on the speed-profile mode, the hotspot codes included in the installation package of the target application are precompiled.
7. The method according to claim 1, characterized in that The compiling of the code contained in the installation package of the target application based on the target compilation mode includes: Based on the speed-profile mode, the hotspot codes included in the installation package of the target application are precompiled.
8. The method according to claim 7, characterized in that After precompiling the hotspot code contained in the installation package of the target application based on the speed-profile mode, the method further includes: Scanning all installed applications or scanning the target application, wherein all applications include the target application; When it is scanned that the target application generates new hotspot codes, the hotspot codes contained in the installation package of the target application are precompiled again.
9. The method according to claim 1, characterized in that: The compiling of the code contained in the installation package of the target application based on the target compilation mode includes: Based on the real-time compilation mode, the code included in the installation package of the target application is compiled in real time.
10. The method according to claim 1, characterized in that After compiling the code included in the installation package of the target application based on the target compilation mode, the method further includes: When the usage characteristic parameter value changes from being greater than the second specified parameter value to being less than the second specified parameter value, the locally stored target machine code is deleted, wherein the target machine code is obtained by pre-compiling the code contained in the installation package of the target application program through the target compilation mode.
11. The method according to any one of claims 1 to 10, characterized in that: The determining, based on the operation information, a usage characteristic parameter value of the target application program includes: Obtaining an application type of the target application; Based on the operation information and the application type, a usage characteristic parameter value of the target application program is determined.
12. The method according to any one of claims 1 to 10, characterized in that: The operation information includes a calling frequency and an operation duration, and determining a usage characteristic parameter value of the target application based on the operation information includes: Based on the calling frequency and the running time, a usage characteristic parameter value of the target application is determined.
13. A compiling and processing device, characterized in that: A target system service applied to an electronic device, the target system service being used to process a compilation task of the electronic device, the device comprising: A target application acquisition module is used to acquire installed target applications; An operation information acquisition module, used to acquire the operation information of the target application; A usage characteristic parameter value determination submodule, used to determine a usage characteristic parameter value of the target application based on the operation information; a first target compilation mode determination unit, configured to determine a speed mode from a plurality of compilation modes as a target compilation mode when the usage characteristic parameter value is greater than a first specified parameter value, wherein the usage characteristic parameter value of the target application is positively correlated with an amount of precompiled code corresponding to the target compilation mode, and wherein each of the plurality of compilation modes corresponds to a different amount of precompiled code; a second target coding mode determining unit, configured to determine a speed-profile mode from the plurality of coding modes as the target coding mode when the usage characteristic parameter value is greater than a second specified parameter value and not greater than the first specified parameter value; a third target compilation mode determination unit, configured to determine the real-time compilation mode from the plurality of compilation modes as the target compilation mode when the usage characteristic parameter value is not greater than the second specified parameter value; The compiling processing module is used to compile the code contained in the installation package of the target application based on the target compiling mode.
14. An electronic device, characterized in that: The method comprises a memory and a processor, wherein the memory is coupled to the processor, the memory stores instructions, and when the instructions are executed by the processor, the processor executes the method according to any one of claims 1 to 12.
15. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores program codes, and the program codes can be called by a processor to execute the method according to any one of claims 1 to 12.
