Application program installation method and device based on compilation optimization, equipment and medium

By splitting the application's baseline configuration files by scenes and compiling them staggeredly, the system memory usage problem caused by excessive baseline configuration files is solved, resource saving and performance improvement are achieved, and user experience and compilation stability are ensured.

CN119127233AActive Publication Date: 2024-12-13ECARX (HUBEI) TECHCO LTD
View PDF 10 Cites 0 Cited by

Patent Information

Application Number
CN202411150267.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-21
Publication Date
2024-12-13
Estimated Expiration
2044-08-21

AI Technical Summary

Technical Problem

When the existing technology improves the response speed and fluency of applications, the large baseline configuration file leads to excessive system memory usage, affecting system performance and user experience.

Method used

By splitting the application's baseline configuration file by scene and staggering the peak compilation in the idle state of the electronic device, the number of hot codes processed at one time is reduced, and the compilation optimization is avoided from squeezing system resources.

Benefits of technology

Effectively save resource consumption, improve system performance and user experience, and ensure the compilation and optimization effect of large applications.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119127233A_ABST
    Figure CN119127233A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides an application program installation method and device based on compilation optimization, equipment and a medium, and relates to the technical field of computers. The method comprises the following steps: in response to an installation operation on a target application program, obtaining an application program package corresponding to the target application program; extracting a baseline configuration file in each scene included in an application package corresponding to the target application; installing the target application program based on the application program package, and compiling a hotspot code corresponding to a first configuration file based on the first configuration file meeting the compiling requirement during installation in the baseline configuration files under each scene; and when it is determined that the electronic equipment is in the idle state, compiling a hotspot code corresponding to a second configuration file based on the second configuration file except the first configuration file in the baseline configuration file in each scene, and completing installation of the target application program. The method is used for achieving the effects of saving resources, improving performance and improving user experience.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a method, device, equipment and medium for installing an application based on compilation optimization. Background Art

[0002] With the development of computer technology, how to improve the fluency of applications by improving the response speed of applications, thereby improving the user experience has become a technical problem that needs to be solved urgently.

[0003] In a possible implementation, a baseline configuration file (i.e., baseline profile file) may be generated based on the hotspot code of the application and then integrated into the APK file (Android application package) of the application. At this time, while installing the application based on the APK file, the hotspot code of the application may be pre-compiled into machine code that can be directly run according to the guidance of the baseline configuration file, thereby improving the running speed of the application.

[0004] However, this implementation method will occupy a large amount of system memory resources when the baseline configuration file is large, thereby affecting system performance and user experience. Summary of the invention

[0005] The embodiments of the present application provide an application installation method, device, equipment and medium based on compilation optimization, so as to save resources, improve performance and enhance user experience.

[0006] In a first aspect, an embodiment of the present application provides an application installation method based on compilation optimization, comprising:

[0007] In response to an installation operation on a target application, obtaining an application package corresponding to the target application; wherein the application package is used to install the target application into the electronic device;

[0008] Extracting the baseline configuration files for each scenario included in the application package corresponding to the target application; wherein each scenario indicates the application interface at each level corresponding to the target application; and the baseline configuration file indicates the hotspot code for implementing the functions supported by the application interface;

[0009] The target application is installed based on the application package, and based on a first configuration file that meets the compilation requirement during installation in the baseline configuration files under the various scenarios, a hotspot code corresponding to the first configuration file is compiled;

[0010] When it is determined that the electronic device is in an idle state, based on a second configuration file other than the first configuration file in the baseline configuration files under the various scenarios, hotspot codes corresponding to the second configuration file are compiled to complete the installation of the target application.

[0011] In a possible implementation manner, determining that the electronic device is in an idle state includes:

[0012] Acquiring resource consumption information of the electronic device according to a status monitoring service running in the electronic device;

[0013] If it is determined that the resource consumption information of the electronic device meets the preset resource consumption requirement, it is determined that the electronic device is in an idle state.

[0014] In a possible implementation manner, after compiling the hotspot code corresponding to the first configuration file, the method further includes:

[0015] If it is determined that the electronic device is in a non-idle state, then after a preset time interval, it is detected again whether the electronic device is in an idle state.

[0016] In a possible implementation manner, before compiling the hotspot code corresponding to the first configuration file, the method further includes:

[0017] Obtaining a target mapping table included in the application package; wherein the target mapping table is used to indicate the association between each baseline configuration file and the corresponding compilation mode; the compilation mode is used to indicate whether to compile the baseline configuration file during installation;

[0018] Based on the baseline configuration file associated with the compilation mode indicating the installation-time compilation included in the target mapping table, a first configuration file that meets the installation-time compilation requirement is determined from the baseline configuration files in each scenario.

[0019] In a possible implementation, in response to the installation operation on the target application, before obtaining the application package corresponding to the target application, the method further includes:

[0020] Determine the hotspot codes in each scenario included in the target application; wherein the hotspot codes in each scenario indicate the codes called when executing the functions supported by the application interfaces at each level;

[0021] Based on the hotspot codes in each scenario, generate a baseline configuration file corresponding to each scenario;

[0022] Based on the baseline configuration files corresponding to the various scenarios, an application package corresponding to the target application is determined.

[0023] In a possible implementation, determining hotspot codes in various scenarios included in the target application includes:

[0024] Acquire test log data corresponding to the target application; wherein the test log data indicates log data acquired when the target application executes functions supported by application interfaces at various levels during the test phase;

[0025] Based on the test log data, the hotspot codes in each scenario are determined.

[0026] In a second aspect, an embodiment of the present application provides an application installation device based on compilation optimization, comprising:

[0027] A response unit, configured to obtain an application package corresponding to the target application in response to an installation operation on the target application; wherein the application package is used to install the target application into the electronic device;

[0028] An extraction unit, used to extract baseline configuration files under various scenarios included in the application package corresponding to the target application; wherein the various scenarios indicate application interfaces at various levels corresponding to the target application; and the baseline configuration files indicate hotspot codes for implementing functions supported by the application interfaces;

[0029] A first compiling unit is configured to install the target application based on the application package, and compile hotspot codes corresponding to a first configuration file that meets the compilation requirement during installation in the baseline configuration files under the various scenarios;

[0030] The second compilation unit is used to compile hotspot codes corresponding to a second configuration file other than the first configuration file in the baseline configuration files under the various scenarios to complete the installation of the target application program when it is determined that the electronic device is in an idle state.

[0031] In a possible implementation manner, the second compilation unit is used to:

[0032] Acquiring resource consumption information of the electronic device according to a status monitoring service running in the electronic device;

[0033] If it is determined that the resource consumption information of the electronic device meets the preset resource consumption requirement, it is determined that the electronic device is in an idle state.

[0034] In a possible implementation manner, after compiling the hotspot code corresponding to the first configuration file, the second compilation unit is further configured to:

[0035] If it is determined that the electronic device is in a non-idle state, then after a preset time interval, it is detected again whether the electronic device is in an idle state.

[0036] In a possible implementation manner, the device further includes a first determining unit, configured to:

[0037] Before compiling the hotspot code corresponding to the first configuration file, obtaining a target mapping table included in the application package; wherein the target mapping table is used to indicate the association between each of the baseline configuration files and the corresponding compilation mode; the compilation mode is used to indicate whether to compile the baseline configuration file during installation;

[0038] Based on the baseline configuration file associated with the compilation mode indicating the installation-time compilation included in the target mapping table, a first configuration file that meets the installation-time compilation requirement is determined from the baseline configuration files in each scenario.

[0039] In a possible implementation manner, the device further includes a second determining unit, configured to:

[0040] In response to the installation operation of the target application, before obtaining the application package corresponding to the target application, determine the hotspot code in each scenario included in the target application; wherein the hotspot code in each scenario indicates the code called when executing the functions supported by the application interface at each level;

[0041] Based on the hotspot codes in each scenario, generate a baseline configuration file corresponding to each scenario;

[0042] Based on the baseline configuration files corresponding to the various scenarios, an application package corresponding to the target application is determined.

[0043] In a possible implementation manner, the second determining unit is configured to:

[0044] Acquire test log data corresponding to the target application; wherein the test log data indicates log data acquired when the target application executes functions supported by application interfaces at various levels during the test phase;

[0045] Based on the test log data, the hotspot codes in each scenario are determined.

[0046] In a third aspect, an embodiment of the present application provides an electronic device, including: a memory, a processor;

[0047] The memory stores computer-executable instructions;

[0048] The processor executes the computer-executable instructions stored in the memory, so that the processor executes the above first aspect and / or various possible implementations of the first aspect.

[0049] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, in which computer-executable instructions are stored. When the computer-executable instructions are executed by a processor, they are used to implement the first aspect above and / or various possible implementations of the first aspect.

[0050] In a fifth aspect, an embodiment of the present application provides a computer program product, including a computer program, which, when executed by a processor, implements the above first aspect and / or various possible implementation methods of the first aspect.

[0051] The application installation method, device, equipment and medium based on compilation optimization provided by the embodiment of the present application can save the baseline configuration files in each scenario included in the target application in the application package before installing the target application, so as to realize the splitting of the baseline configuration files by scenario. Afterwards, in response to the installation operation of the target application, the application package corresponding to the target application can be obtained, and then the baseline configuration files in each scenario included in the application package corresponding to the target application can be extracted. At this time, on the one hand, the target application can be installed based on the application package, and based on the first configuration file that meets the compilation requirements during installation in the baseline configuration files in each scenario, the hotspot code corresponding to the first configuration file is compiled. This implementation method can reduce the number of hotspot codes processed by one compilation, thereby reducing the memory pressure, so that the user's experience of the target application can be guaranteed while ensuring the system performance and compilation stability. On the other hand, when it is determined that the electronic device is in an idle state, based on the second configuration file in the baseline configuration files in each scenario, except the first configuration file, the hotspot code corresponding to the second configuration file is compiled to complete the installation of the target application. At this time, the remaining hotspot code can be compiled in the idle state of the electronic device to avoid the problem of system performance degradation caused by the compilation optimization occupying system resources, thereby affecting the user experience of the electronic device. Through the above implementation, the compilation optimization effect of large-scale application programs can also be effectively guaranteed. BRIEF DESCRIPTION OF THE DRAWINGS

[0052] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0053] Figure 1 A flowchart of an application installation method based on compilation optimization provided in an embodiment of the present application;

[0054] Figure 2 A flowchart of another application installation method based on compilation optimization provided in an embodiment of the present application;

[0055] Figure 3 A schematic diagram of the structure of a target mapping table provided in an embodiment of the present application;

[0056] Figure 4 A schematic diagram of the structure of an application installation device based on compilation optimization provided for the implementation of this application;

[0057] Figure 5 A structural diagram of another application installation device based on compilation optimization provided for the implementation of this application;

[0058] Figure 6 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application.

[0059] The above drawings have shown clear embodiments of the present application, which will be described in more detail later. These drawings and text descriptions are not intended to limit the scope of the present application in any way, but to illustrate the concept of the present application to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION

[0060] Here, exemplary embodiments will be described in detail, and examples thereof are shown in the accompanying drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. Instead, they are only examples of devices and methods consistent with some aspects of the present application.

[0061] In the Android system of the smart cockpit, the fluency of users' use of applications has become an important indicator. Therefore, how to improve the fluency of applications by improving the response speed of applications, and thus improve the user experience, has become a technical problem that needs to be solved urgently.

[0062] In one possible implementation, the response speed of the application can be improved based on the hotspot code optimization method of the configuration file, thereby improving the fluency of the application. Specifically, the hotspot code of the application can be determined during the development and design phase of the application, and a baseline configuration file can be generated based on the determined hotspot code of the application, and then the baseline configuration file can be integrated into the APK file of the application. At this time, while installing the application based on the APK file, the baseline configuration file can also be extracted from the APK file, and then the ART (Android Runtime, Android operating environment) virtual machine compiles the hotspot code of the application in advance into machine code that can be directly run through AOT (Ahead of Time) compilation according to the guidance of the baseline configuration file, thereby improving the running speed and efficiency of the application, thereby improving the fluency of the application.

[0063] However, this implementation method will occupy a large amount of system memory resources when the baseline configuration file is large, and may easily cause slow compilation problems, which not only affects the installation efficiency of the application, but also easily affects the performance of the system, thereby affecting the user experience.

[0064] The application installation method based on compilation optimization provided in this application splits the baseline configuration file corresponding to the application according to the various scenarios included in the application, obtains the baseline configuration file under each scenario, and saves resource consumption and improves system performance through staggered installation, thereby solving the above technical problems.

[0065] The technical solution of the present application and how the technical solution of the present application solves the above-mentioned technical problems are described in detail below with specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present application will be described below in conjunction with the accompanying drawings.

[0066] Figure 1 A flowchart of an application installation method based on compilation optimization provided in an embodiment of the present application is shown in FIG. Figure 1 As shown, the method includes:

[0067] S101. In response to an installation operation on a target application, an application package corresponding to the target application is obtained.

[0068] The application package is used to install the target application into the electronic device.

[0069] In one example, an application package can be understood as an APK file.

[0070] In one example, before responding to the installation operation of the target application, the target application needs to be developed and tested, and an application package of the target application needs to be generated, so that the target application can be installed according to the application package.

[0071] At this time, the application package corresponding to the target application may include not only the files and resources required for the application to run, but also the baseline configuration files corresponding to the hotspot codes in various scenarios of the target application.

[0072] At this time, after responding to the installation operation of the target application, the application package corresponding to the target application can be obtained to install the target application according to the application package. For details, see the following steps.

[0073] S102: Extracting baseline configuration files for various scenarios included in an application package corresponding to the target application.

[0074] Among them, each scenario indicates the application interface of each level corresponding to the target application; the baseline configuration file indicates the hot code when implementing the functions supported by the application interface.

[0075] At this point, the baseline configuration files in each scenario can be understood as baseline configuration files of hotspot codes corresponding to application interfaces at all levels.

[0076] In one example, the various levels of application interfaces corresponding to the target application may indicate a startup interface, a home page interface, and various levels of menu interfaces of the target application.

[0077] The startup interface may indicate an interface for starting a target application. For example, the startup interface may be an interface including a program identifier corresponding to the target application. In this case, the target application may be started by triggering the program identifier.

[0078] The home page interface can be understood as the home page of the target application entered after the target application is started. At this time, the hotspot code that implements the functions supported by the home page interface is the hotspot code in the scene corresponding to the home page interface.

[0079] Each level of menu interface can be understood as the interface to which you jump after triggering the functions supported by the home page interface. At this time, the hotspot codes that implement the functions supported by each level of menu interface are the hotspot codes in the scenarios corresponding to each level of menu interface.

[0080] In one example, each level of menu interface may include N levels of menu interface, where the value of N is a natural number greater than 0, and the value of N is not specifically limited here. For example, if the value of N is 3, then each level of menu interface may include: a first-level menu interface, a second-level menu interface, and a third-level menu interface. Among them, the first-level menu interface indicates the first interface to jump to after triggering the function supported by the homepage interface; the second-level menu interface indicates the interface to jump to after triggering the function supported by the first-level menu interface; the third-level menu interface indicates the interface to jump to after triggering the function supported by the second-level menu interface.

[0081] S103: Install the target application based on the application package, and compile the hotspot code corresponding to the first configuration file that meets the compilation requirement during installation in the baseline configuration files in each scenario.

[0082] In an example, in order to avoid the problem of memory pressure caused by compiling multiple baseline configuration files at the same time when installing the target application, thereby affecting system performance, the compilation method can be pre-set for the baseline configuration files in each scenario, so as to determine the baseline configuration files in each scenario, which baseline configuration files need to be compiled during installation and which baseline configuration files do not need to be compiled during installation.

[0083] In one example, the baseline configuration file that needs to be compiled during installation is used to quickly respond to the user's trigger operation on the target application, thereby improving the response speed of the target application. Therefore, one or more application interfaces that need to respond quickly can be selected from the application interfaces of each level corresponding to the target application, and the baseline configuration file in the scenario corresponding to the interface that needs to respond quickly can be determined as the baseline configuration file that needs to be compiled during installation.

[0084] Among them, the interfaces that need to respond quickly among the application interfaces at all levels corresponding to the target application can be determined according to the usage frequency of the application interfaces at all levels of the target application. For example, the interfaces that need to respond quickly can include only the startup interface, or the startup interface and the first-level menu interface, etc.

[0085] In one example, after determining the baseline configuration file (ie, the first configuration file) that needs to be compiled during installation, the hotspot code corresponding to the first configuration file can be compiled while installing the target application to obtain the machine code that can be directly executed and then stored.

[0086] S104: When it is determined that the electronic device is in an idle state, based on a second configuration file other than the first configuration file in the baseline configuration files under various scenarios, compile hotspot codes corresponding to the second configuration file to complete the installation of the target application.

[0087] In one example, when there are a large number of second configuration files, each second configuration file can be compiled in sequence according to the execution order of each scenario. At this time, the second configuration files can be compiled once or multiple times, and after the baseline configuration files in each scenario are compiled, the installation process of the target application is completed.

[0088] It can be seen from the above description that, in the embodiment of the present application, before installing the target application, the baseline configuration files in each scenario included in the target application can be saved in the application package, so as to realize the splitting of the baseline configuration files by scenario. Afterwards, in response to the installation operation of the target application, the application package corresponding to the target application can be obtained, and then the baseline configuration files in each scenario included in the application package corresponding to the target application can be extracted. At this time, on the one hand, the target application can be installed based on the application package, and based on the first configuration file in the baseline configuration files in each scenario that meets the compilation requirements during installation, the hotspot code corresponding to the first configuration file can be compiled. This implementation method can reduce the number of hotspot codes processed by one compilation, thereby reducing the memory pressure, so that the user's experience of the target application can be guaranteed while ensuring the system performance and compilation stability. On the other hand, when it is determined that the electronic device is in an idle state, based on the second configuration file in the baseline configuration files in each scenario, except the first configuration file, the hotspot code corresponding to the second configuration file can be compiled to complete the installation of the target application. At this time, the remaining hotspot code can be compiled in the idle state of the electronic device to avoid the problem of system performance degradation caused by the compilation optimization occupying system resources, thereby affecting the user experience of the electronic device. Through the above implementation method, the compilation optimization effect of large applications can also be effectively guaranteed.

[0089] Figure 2 A flowchart of another application installation method based on compilation optimization provided in an embodiment of the present application is shown in FIG. Figure 2 As shown, the method includes:

[0090] S201: Determine hotspot codes in various scenarios included in the target application.

[0091] Among them, the hotspot code in each scenario indicates the code called when executing the functions supported by the application interface at each level.

[0092] In one example, the hotspot code in each scenario indicates the code whose calling frequency / number of times meets the preset quantity requirement when executing the functions supported by the application interface at each level. At this time, the hotspot code can be used to implement one or more functions.

[0093] In one example, when determining the hotspot codes in each scenario included in the target application, the test log data corresponding to the target application may be obtained first; then, based on the test log data, the hotspot codes in each scenario may be determined.

[0094] The test log data indicates log data acquired when the target application executes functions supported by application interfaces at various levels during the test phase.

[0095] In an embodiment of the present application, log printing codes can be embedded in different locations of the target application during the development and design phase of the target program. At this time, the test log data corresponding to the target application can be obtained through the embedded log printing code. At this time, the obtained test log data includes the called code.

[0096] At this time, assuming that the application interfaces of the target application correspond to the following levels: startup interface, home page interface, first-level menu interface and second-level menu interface, then, during the testing phase of the target application, all functions supported by the startup interface of the target application, all functions supported by the home page interface, all functions supported by the first-level menu interface and all functions supported by the second-level menu interface can be triggered in turn to obtain the test log data for each scenario.

[0097] After that, the hot code in each scenario can be determined based on the test log data in each scenario and the code call frequency / number of times determined by the test log data.

[0098] This implementation can accurately and effectively determine the relevant information of the code called by the target application when executing various functions by pre-embedding log printing codes in different locations of the target application, thereby improving the comprehensiveness and accuracy of the determined hotspot codes.

[0099] S202: Generate a baseline configuration file corresponding to each scenario based on the hotspot code in each scenario.

[0100] At this point, the baseline configuration file can be used to locate the location of the hotspot code to compile the hotspot code.

[0101] S203: Determine an application package corresponding to the target application based on the baseline configuration files corresponding to each scenario.

[0102] In one example, after obtaining the baseline configuration files corresponding to each scenario, the compilation method of the baseline configuration files corresponding to each scenario can be determined according to the usage frequency of each scenario, thereby determining whether to compile the baseline configuration files during installation. After that, the baseline configuration files corresponding to each scenario and the compilation methods corresponding to each baseline configuration files can be packaged into the application package corresponding to the target application.

[0103] This implementation method can first obtain the hotspot code in each scenario, and then determine the baseline configuration file corresponding to each scenario based on the hotspot code in each scenario, thereby avoiding the single baseline configuration file corresponding to the target application being too large, resulting in more memory resources being occupied when compiling the hotspot code according to the baseline configuration file. At the same time, the compilation method of the baseline configuration file corresponding to each scenario can also be set to avoid compiling multiple baseline configuration files at the same time. At this time, when installing the target application according to the application package, the compilation optimization of the target application can be achieved by file and time period.

[0104] S204: In response to the installation operation on the target application, obtain an application package corresponding to the target application.

[0105] The application package is used to install the target application into the electronic device.

[0106] In an example, this step can refer to the content described in S101 above, and will not be described in detail here.

[0107] S205: Extracting baseline configuration files for various scenarios included in the application package corresponding to the target application.

[0108] Among them, each scenario indicates the application interface of each level corresponding to the target application; the baseline configuration file indicates the hotspot code corresponding to the application interface.

[0109] In an example, this step can refer to the content described in S102 above, and will not be described in detail here.

[0110] S206: Install the target application based on the application package.

[0111] In one example, while the target application is installed based on the application package, the steps described in S207 to S209 below may also be executed.

[0112] S207: Obtain the target mapping table included in the application package.

[0113] The target mapping table is used to indicate the association between each baseline configuration file and the corresponding compilation mode; the compilation mode is used to indicate whether to compile the baseline configuration file during installation.

[0114] In one example, the compilation mode may be compilation at installation time or delayed compilation. In this case, if the compilation mode is delayed compilation, it indicates that the baseline configuration file is not compiled at installation time.

[0115] In another example, the compilation mode may also indicate a compilation priority, for example, the compilation mode may be any one of the following: first priority, second priority, ..., and so on, and the number of compilation priorities indicated by the compilation mode is not limited here, and is subject to actual needs. At this time, the baseline configuration file corresponding to the "first priority" may be compiled during installation, and the remaining baseline configuration files may be compiled in sequence according to the compilation priority order when the electronic device is in an idle state.

[0116] At this time, the target mapping table may include file identification information of the baseline configuration file (wherein the file identification information is used to uniquely identify the baseline configuration file, and at this time, the file identification information may be associated with the scene), and include a compilation method corresponding to the file identification information of the baseline configuration file. For example, the file identification information of the baseline configuration file corresponding to the startup interface may be a "startup file" (or a "startup interface scene", etc.). At this time, the compilation method associated with the "startup file" may be "compile at installation time" or "first priority", etc.

[0117] For an example, see Figure 3 , Figure 3 A schematic diagram of the structure of a target mapping table provided in an embodiment of the present application is shown in FIG. Figure 3 As shown, it is assumed that the target application includes the following scenes: startup interface scene, home page interface scene, other interface scene 1 (for example, first-level menu interface scene), and other interface scene N (for example, N-level menu interface scene). Figure 3 As shown, the compilation method corresponding to each scene / baseline configuration file of each scene can be: startup interface scene->compile at installation time, home page interface scene->compile at installation time, other interface scene 1->delayed compilation, other interface scene N->delayed compilation.

[0118] S208: Based on the baseline configuration files associated with the compilation mode indicating installation-time compilation included in the target mapping table, determine a first configuration file that meets the installation-time compilation requirement from the baseline configuration files in various scenarios.

[0119] In a possible implementation, the embodiment of the present application can also determine the naming method of the baseline configuration file according to the usage frequency of the application interface corresponding to each scenario when generating the baseline configuration file corresponding to each scenario, so that the first configuration file that meets the compilation requirements during installation can be determined according to the naming of the baseline configuration file.

[0120] In this implementation, the first configuration file that meets the compilation requirements during installation can be determined from the baseline configuration files in each scenario based on the target mapping table or the file name of the baseline configuration file. Therefore, the baseline configuration file that needs to be compiled during installation can be determined based on the actual scenario usage requirements. This not only improves the flexibility and diversity of compilation optimization during installation, but also ensures the smoothness of use of the target application, reduces the pressure of compilation optimization during installation, and thus improves the performance of the system.

[0121] S209: Based on the first configuration file that meets the compilation requirement during installation in the baseline configuration files in each scenario, compile the hotspot code corresponding to the first configuration file.

[0122] S210: Obtain resource consumption information of the electronic device according to a status monitoring service running in the electronic device.

[0123] In one example, the status monitoring service may continuously monitor the resource consumption information of the system in the electronic device, wherein the resource consumption information may include but is not limited to the following information: CPU usage, memory usage, IO (Input Output) operation frequency, and other information.

[0124] S211: If it is determined that the resource consumption information of the electronic device meets the preset resource consumption requirement, determine that the electronic device is in an idle state.

[0125] In one example, the preset resource consumption requirement indicates the minimum resource consumption information corresponding to the electronic device, and may also indicate the maximum value of the minimum resource consumption information within the error tolerance range. The minimum resource consumption information corresponding to the electronic device may be obtained by averaging the minimum value of the daily resource consumption of the electronic device within the preset historical time range, or may be determined by the resource consumption information corresponding to the electronic device based on the time when the electronic device consumes the least resources specified by the staff based on their experience.

[0126] At this time, after the resource consumption information of the electronic device is obtained, it can be determined whether the electronic device is in an idle state according to the resource consumption information of the electronic device.

[0127] Specifically, when it is determined that the resource consumption information of the electronic device is less than or equal to the resource consumption information corresponding to the preset resource consumption requirement, it can be determined that the resource consumption information of the electronic device meets the preset resource consumption requirement. At this time, it can be determined that the electronic device is in an idle state.

[0128] For example, if it is determined that the electronic device consumes the least resources at 2 a.m., then the resource consumption information corresponding to 2 a.m. can be determined as the minimum resource consumption information. At this time, if it is determined that the current resource consumption information of the electronic device is the same as the minimum resource consumption information, it can be confirmed that the electronic device is in an idle state.

[0129] Alternatively, assume that the allowable error range indicates that the minimum resource consumption information fluctuates within a range of 5% (the allowable error range is not limited here and is based on actual needs). At this time, if the current resource consumption information of the electronic device is less than or equal to the value of the minimum resource consumption information after floating up by 5%, it is confirmed that the electronic device is in an idle state, etc.

[0130] S212: When it is determined that the electronic device is in an idle state, based on a second configuration file other than the first configuration file in the baseline configuration files under various scenarios, compile hotspot codes corresponding to the second configuration file to complete the installation of the target application.

[0131] This implementation manner can compile the second configuration file when the electronic device is in an idle state, which not only improves the compilation efficiency but also ensures the performance of the system in the electronic device, thereby ensuring the user experience.

[0132] In one example, if it is determined that the electronic device is in a non-idle state, then after a preset time interval, it is detected again whether the electronic device is in an idle state.

[0133] This implementation can poll whether the electronic device is in a non-idle state at a preset time interval until the baseline configuration files for each scenario included in the target application are compiled, thereby completing the compilation optimization of the target application. At the same time, polling can further save system resources and improve system performance.

[0134] Figure 4 A schematic diagram of the structure of an application installation device based on compilation optimization provided for the implementation of this application, such as Figure 4 As shown, the application installation device 400 based on compilation optimization provided in this embodiment includes:

[0135] The response unit 401 is used to obtain an application package corresponding to the target application in response to an installation operation on the target application; wherein the application package is used to install the target application into the electronic device.

[0136] The extraction unit 402 is used to extract the baseline configuration files under various scenarios included in the application package corresponding to the target application; wherein each scenario indicates the application interface at each level corresponding to the target application; and the baseline configuration file indicates the hotspot code when implementing the functions supported by the application interface.

[0137] The first compiling unit 403 is used to install the target application based on the application package, and compile the hotspot code corresponding to the first configuration file that meets the compilation requirement during installation in the baseline configuration files in various scenarios.

[0138] The second compiling unit 404 is used to compile hotspot codes corresponding to a second configuration file other than the first configuration file in the baseline configuration files in various scenarios to complete the installation of the target application program when it is determined that the electronic device is in an idle state.

[0139] Figure 5 A structural diagram of another application installation device based on compilation optimization provided for the implementation of this application, such as Figure 5 As shown, the application installation device 500 based on compilation optimization provided in this embodiment includes:

[0140] The response unit 501 is used to obtain an application package corresponding to the target application in response to an installation operation on the target application; wherein the application package is used to install the target application into the electronic device.

[0141] The extraction unit 502 is used to extract the baseline configuration files under various scenarios included in the application package corresponding to the target application; wherein each scenario indicates the application interface at each level corresponding to the target application; and the baseline configuration file indicates the hotspot code when implementing the functions supported by the application interface.

[0142] The first compiling unit 503 is used to install the target application based on the application package, and compile the hotspot code corresponding to the first configuration file that meets the compilation requirement during installation in the baseline configuration files in various scenarios.

[0143] The second compiling unit 504 is used to compile hotspot codes corresponding to a second configuration file other than the first configuration file in the baseline configuration files in various scenarios to complete the installation of the target application program when it is determined that the electronic device is in an idle state.

[0144] In a possible implementation manner, the second compiling unit 504 is configured to:

[0145] Obtaining resource consumption information of the electronic device according to a status monitoring service running in the electronic device;

[0146] If it is determined that the resource consumption information of the electronic device meets the preset resource consumption requirement, it is determined that the electronic device is in an idle state.

[0147] In a possible implementation, after compiling the hotspot code corresponding to the first configuration file, the second compiling unit 504 is further configured to:

[0148] If it is determined that the electronic device is in a non-idle state, then after a preset time interval, it is detected again whether the electronic device is in an idle state.

[0149] In a possible implementation manner, the device further includes a first determining unit 505, configured to:

[0150] Before compiling the hotspot code corresponding to the first configuration file, obtaining a target mapping table included in the application package; wherein the target mapping table is used to indicate the association between each baseline configuration file and the corresponding compilation mode; the compilation mode is used to indicate whether to compile the baseline configuration file during installation;

[0151] Based on the baseline configuration file associated with the compilation mode indicating the installation-time compilation included in the target mapping table, a first configuration file that meets the installation-time compilation requirement is determined from the baseline configuration files in each scenario.

[0152] In a possible implementation manner, the device further includes a second determining unit 506, configured to:

[0153] In response to the installation operation of the target application, before obtaining the application package corresponding to the target application, determine the hotspot code in each scenario included in the target application; wherein the hotspot code in each scenario indicates the code called when executing the functions supported by the application interface at each level;

[0154] Generate baseline configuration files corresponding to each scenario based on the hotspot codes in each scenario;

[0155] Based on the baseline configuration files corresponding to each scenario, the application package corresponding to the target application is determined.

[0156] In a possible implementation manner, the second determining unit 506 is configured to:

[0157] Acquire test log data corresponding to the target application; wherein the test log data indicates log data acquired when the target application executes functions supported by application interfaces at various levels during the test phase;

[0158] Based on the test log data, determine the hot code in each scenario.

[0159] The application installation device based on compilation optimization provided in this embodiment can execute the method provided in the above method embodiment. Its implementation principle and technical effect are similar, and this embodiment will not be described in detail here.

[0160] Figure 6 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. Figure 6 As shown, the electronic device 600 provided in this embodiment includes: at least one processor 601 and a memory 602. Optionally, the electronic device 600 further includes a communication component 603. The processor 601, the memory 602 and the communication component 603 are connected via a bus 604.

[0161] In a specific implementation process, at least one processor 601 executes the computer execution instructions stored in the memory 602, so that at least one processor 601 executes the above method.

[0162] The specific implementation process of the processor 601 can be found in the above method embodiment, and its implementation principle and technical effect are similar, so this embodiment will not be repeated here.

[0163] In the above embodiments, it should be understood that the processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), etc. A general-purpose processor may be a microprocessor or any conventional processor. The steps of the method disclosed in the invention may be directly implemented as being executed by a hardware processor, or may be executed by a combination of hardware and software modules in the processor.

[0164] The memory may include a high-speed memory (Random Access Memory, RAM), and may also include a non-volatile memory (Non-volatile Memory, NVM), such as at least one disk memory.

[0165] The bus may be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, the bus in the drawings of the present application is not limited to only one bus or one type of bus.

[0166] The present application also provides a computer program product, including a computer program, which implements the above method when executed by a processor.

[0167] The present application also provides a computer-readable storage medium, in which computer-executable instructions are stored. When a processor executes the computer-executable instructions, the above method is implemented.

[0168] The above-mentioned readable storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk. The readable storage medium can be any available medium that can be accessed by a general or special-purpose computer.

[0169] An exemplary readable storage medium is coupled to a processor so that the processor can read information from the readable storage medium and write information to the readable storage medium. Of course, the readable storage medium can also be a component of the processor. The processor and the readable storage medium can be located in an application specific integrated circuit (Application Specific Integrated Circuits, referred to as: ASIC). Of course, the processor and the readable storage medium can also exist in the device as discrete components.

[0170] The division of units is only a logical function division, and there may be other divisions in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interface, device or unit, which can be electrical, mechanical or other forms.

[0171] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0172] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

[0173] If the function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for enabling an electronic device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the methods of various embodiments of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, and other media that can store program codes.

[0174] Those skilled in the art can understand that all or part of the steps of implementing the above-mentioned method embodiments can be completed by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, the steps of the above-mentioned method embodiments are executed; and the aforementioned storage medium includes: ROM, RAM, disk or optical disk and other media that can store program codes.

[0175] Finally, it should be noted that those skilled in the art will readily conceive of other embodiments of the present invention after considering the specification and practicing the invention disclosed herein. The present invention is intended to cover any variations, uses or adaptations of the present invention, which follow the general principles of the present invention and include common knowledge or customary technical means in the art not disclosed by the present invention, are not limited to the precise structure described above and shown in the drawings, and may be modified and changed in various ways without departing from the scope thereof. The scope of the present invention is limited only by the appended claims.

Claims

1. A method for installing an application based on compilation optimization, characterized in that: include: In response to an installation operation on a target application, obtaining an application package corresponding to the target application; wherein the application package is used to install the target application into the electronic device; Extracting the baseline configuration files for each scenario included in the application package corresponding to the target application; wherein each scenario indicates the application interface at each level corresponding to the target application; and the baseline configuration file indicates the hotspot code for implementing the functions supported by the application interface; Installing the target application based on the application package, and compiling hotspot codes corresponding to a first configuration file that meets the compilation requirement during installation in the baseline configuration files under the various scenarios; When it is determined that the electronic device is in an idle state, based on a second configuration file other than the first configuration file in the baseline configuration files under the various scenarios, hotspot codes corresponding to the second configuration file are compiled to complete the installation of the target application.

2. The method according to claim 1, characterized in that Determining that the electronic device is in an idle state includes: Acquiring resource consumption information of the electronic device according to a status monitoring service running in the electronic device; If it is determined that the resource consumption information of the electronic device meets the preset resource consumption requirement, it is determined that the electronic device is in an idle state.

3. The method according to claim 2, characterized in that After compiling the hotspot code corresponding to the first configuration file, the method further includes: If it is determined that the electronic device is in a non-idle state, then after a preset time interval, it is detected again whether the electronic device is in an idle state.

4. The method according to claim 1, characterized in that Before compiling the hotspot code corresponding to the first configuration file, the method further includes: Obtaining a target mapping table included in the application package; wherein the target mapping table is used to indicate the association between each baseline configuration file and the corresponding compilation mode; the compilation mode is used to indicate whether to compile the baseline configuration file during installation; Based on the baseline configuration file associated with the compilation mode indicating the installation-time compilation included in the target mapping table, a first configuration file that meets the installation-time compilation requirement is determined from the baseline configuration files in each scenario.

5. The method according to claim 1, characterized in that In response to the installation operation of the target application, before obtaining the application package corresponding to the target application, the method further includes: Determine the hotspot codes in each scenario included in the target application; wherein the hotspot codes in each scenario indicate the codes called when executing the functions supported by the application interfaces at each level; Based on the hotspot codes in each scenario, generate a baseline configuration file corresponding to each scenario; Based on the baseline configuration files corresponding to the various scenarios, an application package corresponding to the target application is determined.

6. The method according to claim 5, characterized in that Identify the hotspot codes in various scenarios included in the target application, including: Acquire test log data corresponding to the target application; wherein the test log data indicates log data acquired when the target application executes functions supported by application interfaces at various levels during the test phase; Based on the test log data, the hotspot codes in each scenario are determined.

7. An application installation device based on compilation optimization, characterized in that: include: A response unit, configured to obtain an application package corresponding to the target application in response to an installation operation on the target application; wherein the application package is used to install the target application into the electronic device; An extraction unit, used to extract baseline configuration files under various scenarios included in the application package corresponding to the target application; wherein the various scenarios indicate application interfaces at various levels corresponding to the target application; and the baseline configuration files indicate hotspot codes for implementing functions supported by the application interfaces; A first compiling unit is configured to install the target application based on the application package, and compile hotspot codes corresponding to a first configuration file that meets the compilation requirement during installation in the baseline configuration files under the various scenarios; The second compilation unit is used to compile hotspot codes corresponding to a second configuration file other than the first configuration file in the baseline configuration files under the various scenarios to complete the installation of the target application program when it is determined that the electronic device is in an idle state.

8. An electronic device, characterized in that: include: Memory, processor; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory, so that the processor performs the method according to any one of claims 1 to 6.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, which are used to implement the method according to any one of claims 1 to 6 when executed by a processor.

10. A computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.

Citation Information

Patent Citations

  • Program implementation method and device of customized baseline separation

    CN107450923A

  • Code compiling method and device, server, user terminal and readable medium

    CN111061484A

  • Configuration file optimization method and device, server and storage medium

    CN112559088A

  • Hotspot code processing method and device, server, electronic equipment and storage medium

    CN112948026A

  • Hotspot code processing method and device, electronic equipment and storage medium

    CN113126994A