WO2021088624A1 - Procédé et appareil de pré-compilation de programmes d'application, dispositif électronique et serveur - Google Patents

Procédé et appareil de pré-compilation de programmes d'application, dispositif électronique et serveur Download PDF

Info

Publication number
WO2021088624A1
WO2021088624A1 PCT/CN2020/121552 CN2020121552W WO2021088624A1 WO 2021088624 A1 WO2021088624 A1 WO 2021088624A1 CN 2020121552 W CN2020121552 W CN 2020121552W WO 2021088624 A1 WO2021088624 A1 WO 2021088624A1
Authority
WO
WIPO (PCT)
Prior art keywords
target
hotspot
application
unit
configuration file
Prior art date
Application number
PCT/CN2020/121552
Other languages
English (en)
Chinese (zh)
Inventor
吴恒刚
Original Assignee
Oppo广东移动通信有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Oppo广东移动通信有限公司 filed Critical Oppo广东移动通信有限公司
Publication of WO2021088624A1 publication Critical patent/WO2021088624A1/fr

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • G06F8/44Encoding
    • G06F8/443Optimisation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/61Installation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates

Definitions

  • This application relates to the field of computer technology, and more specifically, to a method, device, electronic device, and server for pre-compiling an application program.
  • the operating efficiency of the application program can be improved to a certain extent by way of pre-compilation.
  • which compilation units are to be compiled in advance are determined based on the calling frequency or the number of cycles of the compilation units, which cannot effectively realize rapid optimization in the application program.
  • this application proposes a method, device, electronic device, and server for pre-compilation of application programs to improve the above-mentioned problems.
  • the present application provides a method for pre-compilation of an application program, the method includes: obtaining a plurality of first configuration files corresponding to a target application program, and the first configuration file is used to record the information of the target application program.
  • Hotspot compilation unit obtaining a plurality of target hotspot compilation units based on the plurality of hotspot compilation units recorded in the plurality of first configuration files, the plurality of target hotspot compilation units including hotspots associated with target function modules in the target application Compiling unit; generating a second configuration file including the plurality of target hotspot compiling units; compiling the plurality of target hotspot compiling units in advance based on the second configuration file.
  • the present application provides a method for pre-compilation of an application, applied to an electronic device, the method includes: obtaining a second configuration file, the second configuration file being generated by the server based on the above method; When the electronic device satisfies a specified condition, run the second configuration file to compile the hotspot compilation unit in the second configuration file.
  • the present application provides a device for pre-compiling an application program, the device including:
  • the file obtaining unit is configured to obtain multiple first configuration files corresponding to the target application, and the multiple first configuration files are used to record the hotspot compilation unit of the target application installed in the respective electronic devices, so
  • the hotspot compilation unit is a compilation unit that allows compilation in advance before the target application is run; a compilation unit processing unit for obtaining multiple target hotspot compilations based on the multiple hotspot compilation units recorded in the multiple first configuration files Unit, the plurality of target hotspot compilation units include a hotspot compilation unit belonging to a target function module in the target application; a file generation unit for generating a second configuration file including the plurality of target hotspot compilation units; pre-compilation Unit for pre-compiling the multiple target hotspot compilation units based on the second configuration file.
  • the present application provides a device for pre-compilation of an application program, which runs on an electronic device, and the device includes: a file obtaining unit for obtaining a second configuration file, the second configuration file being based on the above-mentioned device After processing, the file processing unit is configured to run the second configuration file to compile the hotspot compilation unit in the second configuration file when it is detected that the electronic device satisfies a specified condition.
  • this application provides an electronic device including one or more processors and a memory; one or more programs, wherein the one or more programs are stored in the memory and configured to be The one or more processors execute, and the one or more programs are configured to execute the above-mentioned methods.
  • the present application provides a computer-readable storage medium having program code stored in the computer-readable storage medium, wherein the above-mentioned method is executed when the program code is running.
  • FIG. 1 shows a schematic diagram of the operating environment of a method for pre-compiling an application program proposed in an embodiment of the present application
  • FIG. 2 shows a schematic diagram of the operating environment of another method for precompiling an application program proposed by an embodiment of the present application
  • FIG. 3 shows a flow chart of a method for pre-compiling an application program according to an embodiment of the present application
  • FIG. 4 shows a flowchart of a method for precompiling an application program according to another embodiment of the present application
  • FIG. 5 shows a flowchart of obtaining multiple target hotspot compilation units in a method for application precompilation proposed in another embodiment of the present application
  • FIG. 6 shows a schematic diagram of a probability model matrix in a method for application pre-compilation proposed by another embodiment of the present application
  • FIG. 7 shows a schematic diagram of a probability model in an application pre-compilation method proposed by another embodiment of the present application.
  • FIG. 8 shows a flow chart of a method for pre-compiling an application program according to another embodiment of the present application
  • FIG. 9 shows a flowchart of a method for pre-compiling an application program according to another embodiment of the present application.
  • FIG. 10 shows a structural block diagram of a device for pre-compiling an application program proposed in this application
  • FIG. 11 shows a structural block diagram of another device for pre-compiling an application program proposed by this application.
  • FIG. 12 shows a structural block diagram of another device for pre-compiling an application program proposed in this application.
  • Fig. 13 shows a structural block diagram of an electronic device of the present application for executing the method for pre-compiling an application program according to an embodiment of the present application.
  • Fig. 14 is a storage unit for storing or carrying program code for implementing the image processing method according to the embodiment of the present application according to an embodiment of the present application.
  • the application in the electronic device can be directly interpreted and executed by the interpreter at runtime. During the execution, the number of calls and the number of cycles of each compilation unit is recorded. When the number of calls and the number of cycles exceed the set threshold, the corresponding compilation unit is recorded as a hot compilation unit.
  • the compilation unit can be understood as a function, method, or class in the source code of the application.
  • the hotspot compilation unit will be identified, compiled by JIT (Just In Time, just-in-time compilation), and then stored and generate a profile file to record the information of the hotspot compilation unit.
  • JIT Just In Time, just-in-time compilation
  • the system of the electronic device scans the profile file and executes the AOT (Ahead Of Time, pre-compilation) process for compilation.
  • this method relies on the electronic device in idle mode to optimize the application according to the profile file, and because the content of the compilation unit in the profile file is related to the number of times the user uses the application, Such an optimization method generally takes a period of time (it may take several days) after the user installs or updates the application to achieve the best performance. Furthermore, the inventor also found in further research that in this related manner, the compilation units stored in the profile file corresponding to the application are usually scattered in different functional modules, which is not conducive to the centralized correction. Some common functions are optimized.
  • the application pre-compilation method, device, electronic device and server are proposed, so that the hot compilation unit associated with the target function module in the target application can be performed in advance before the target function module is run. Compilation makes it possible to improve the operating efficiency of the target function module, and also improves the efficiency of optimizing the operating efficiency of the target function module.
  • FIG. 1 Please refer to FIG. 1.
  • multiple electronic devices 100 and servers 200 are included.
  • multiple electronic devices 100 exchange data with the server 200 through the network.
  • a target application program is running in multiple electronic devices 100, and the target application program running in each electronic device 100 is correspondingly generated with a configuration file (which may be the aforementioned profile file) 120.
  • a configuration file which may be the aforementioned profile file
  • multiple electronic devices 100 can upload the configuration file 120 of the target application installed by themselves to the server 200, so that the server can obtain multiple configuration files 120 corresponding to the target application, and then configure the multiple configuration files 120.
  • the file 120 undergoes fusion processing, extracts the hotspot compilation unit to which the specified function module of the target application belongs, stores the extracted hotspot compilation unit in the newly generated configuration file 210, and then returns the configuration file 210 to the multiple electronic devices 100.
  • the server 220 may also directly send the program installation package 230 including the configuration file 210 and the target application installation program 220 to the electronic device 130 that has not yet installed the target application, so that the electronic When the device 130 installs the target application, it can obtain the configuration file 210 that can directly optimize the operation efficiency of the specified function module in the target application.
  • the server that collects multiple configuration files 120 and processes the multiple configuration files 120 to obtain the configuration file 210 may be a single server or a server cluster.
  • the server that collects multiple configuration files 120 and processes the multiple configuration files 120 to obtain the configuration file 210 may be a different server from the server that subsequently issues the program installation package 230.
  • the first configuration file mentioned in the subsequent embodiments may be the configuration file 120
  • the second configuration file mentioned may be the newly generated configuration file 210.
  • the hotspot compiling unit in the newly generated configuration file 210 may be a hotspot compiling unit compiled by the server 200, or a hotspot compiling unit that has not yet been compiled.
  • the hotspot compilation unit in the newly generated configuration file 210 is a hotspot compilation unit that has not yet been compiled, there may be electronic devices that have received the newly generated configuration file 210 to compile before running the target application, or to install Compile the target application.
  • a method for pre-compilation of an application program provided by this application is applied to a server, and the method includes:
  • Step S110 Obtain a plurality of first configuration files corresponding to the target application program, the plurality of first configuration files are used to record the hotspot compilation unit of the target application installed in the respective electronic devices, and the hotspot compilation
  • the unit is a compilation unit that allows pre-compiling before the target application program runs.
  • each application can be configured with a configuration file during its operation.
  • the configuration file is used to record the hotspot compilation unit of the application in the running process.
  • an application program A, an application program B, and an application program C are installed in the electronic device.
  • application A can correspond to a configuration file a
  • application B can correspond to a configuration file b
  • application C can correspond to a configuration file c.
  • the hotspot compilation unit of application A is recorded in configuration file a
  • the hotspot compilation unit of application B is recorded in configuration file b
  • the hotspot compilation unit of application C is recorded in configuration file c.
  • the application programs installed for different electronic devices may be different or the same.
  • application A, application B, and application C may be installed on multiple electronic devices.
  • the target application program is an application program to which the configuration file to which it belongs will be processed in subsequent steps.
  • the server may determine the target application program in multiple ways.
  • the server can use the application with a large amount of installation as the target application.
  • the electronic device may periodically upload application program installation information to the server, and the application program installation information includes applications currently installed by the electronic device. Then, the server can perform statistics on the application installation information uploaded by multiple electronic devices on a regular basis, and if it is detected that the installation amount of a certain application is greater than the installation threshold, the application with the installation amount greater than the installation threshold can be used as the target application.
  • the server can upload application A As the target application. In this way, the server can optimize the operating efficiency of the installed application program in a timely manner.
  • the electronic device can simultaneously determine the target application in combination with the amount of installation and the size of the corresponding configuration file. It should be noted that because different applications have different functions or operating frequencies, the size of their configuration files is different, and the electronic device compiles the hotspot compilation unit in the configuration file before the application runs. If a certain amount of resources and time needs to be consumed, then for applications with smaller configuration files, it can be determined that the running frequency may be lower, and the server may not process the configuration files to which these lower running frequency applications belong. Correspondingly, in this manner, in the application installation information reported by the electronic device, in addition to the installed applications, the size of the configuration file to which each application belongs may also be included. When the server detects that among multiple electronic devices, the size of the configuration file to which a certain application belongs is greater than the specified threshold and the number is greater than the threshold, the same application can be used as the target application.
  • each of the 90 electronic devices has one application A installed Configuration files (that can be understood as having 90 configuration files). If the server recognizes that 80 of its 90 configuration files are less than 1kb, then when the installation threshold is 80, the specified threshold is 10kb, and the number of thresholds is 50, the server will not use application A as the target application . However, if the server recognizes that 60 of the 90 configuration files (greater than the threshold number of 50) have a size of 11-12 kb (greater than the specified threshold of 10 kb), then the application A can be determined as the target application.
  • the server can also determine the target application according to the configuration information. In this way, you can determine which applications are the target applications through manual configuration.
  • the server may use the application involved in the application installation information reported by multiple electronic devices as the candidate application, and the operator may select one or more applications from the candidate application as the selected application.
  • the application program correspondingly, the server stores the selected application program in the configuration file. In this case, the server can use the application program configured in the configuration file as the target application program.
  • the server may further use the writing information file to which the target application belongs as the first configuration file.
  • the multiple first configuration files corresponding to the target application can be understood as the configuration files to which the same target application installed in multiple electronic devices belongs.
  • Step S120 Obtain a plurality of target hotspot compilation units based on the plurality of hotspot compilation units recorded in the plurality of first configuration files, and the plurality of target hotspot compilation units include a hotspot compilation unit belonging to a target function module in the target application. .
  • an application program usually includes multiple functions, and different functions are implemented by different functional modules.
  • the application program A may include a camera function, an instant messaging function, and a picture editing function. Then the camera function is realized by the camera module, the instant communication function is realized by the instant communication module, and the picture editing function is realized by the picture editing module.
  • the application A running on different electronic devices may have different hotspot compilation units in the respective configuration files of the application A running on different electronic devices due to the user's usage habits.
  • the application program A is installed respectively.
  • the user of the electronic device A likes to use the camera function
  • the user of the electronic device B likes to use the instant messaging function
  • the user of the electronic device C likes to use the picture editing function.
  • the configuration file to which the application A belongs is more about the hotspot compilation unit of the camera function module.
  • the configuration file to which the application A belongs is more about the hotspot compilation unit of the instant messaging function module.
  • the configuration file to which the application A belongs is more of the hotspot compilation unit of the picture editing function module.
  • the server can read the compilation information units from the multiple first configuration files to obtain multiple hotspot compilation units.
  • the multiple first configuration files obtained by the server include configuration file A, configuration file B, and configuration file C.
  • the configuration file A includes a hot spot compilation unit a1, a hot spot compilation unit a2, and a hot spot compilation unit a3.
  • the configuration file B includes a hot spot compilation unit b1, a hot spot compilation unit b2, a hot spot compilation unit b3, and a hot spot compilation unit b4.
  • the configuration file C includes a hot spot compilation unit c1, a hot spot compilation unit c2, and a hot spot compilation unit c3.
  • the obtained multiple hotspot coding units include hotspot coding unit a1, hotspot coding unit a2, hotspot coding unit a3, hotspot coding unit b1, hotspot coding unit b2, hotspot coding unit b3, and hotspot coding unit b4.
  • it can also include fewer hotspot coding units than this.
  • the acquired target hotspot compilation unit is a hotspot compilation unit belonging to a designated functional module.
  • the server may determine the target hotspot compilation unit in multiple ways.
  • the server may sequentially calculate the probability of any two hotspot compilation units appearing in the same configuration file among the multiple hotspot compilation units obtained based on the multiple first configuration files to obtain multiple calculated probabilities, and then Then, the calculated probability is converted into a probability model, so that hotspot coding units that appear together with a greater probability are taken as a set, and multiple sets of hotspot coding units are obtained.
  • the hotspot compilation units that have a greater probability of co-occurring can represent the hotspot compilation units belonging to the same function module.
  • the hotspot compilation units of the same set represent the hotspot compilation units belonging to the same function module.
  • the functional module corresponding to each set is the designated functional module.
  • the hotspot compilation unit to which the function module with higher video frequency belongs is obtained, so as to facilitate the subsequent implementation of the unified compilation of the hotspot compilation unit belonging to the function module with higher frequency of use, and at the same time. It can be estimated based on the correlation between any two hotspot compilation units (in one way, the greater the joint probability, the higher the correlation, and the correlation is higher than the specified correlation threshold, it is determined to belong to the same functional module).
  • a hotspot compilation unit for functional modules is estimated based on the correlation between any two hotspot compilation units (in one way, the greater the joint probability, the higher the correlation, and the correlation is higher than the specified correlation threshold, it is determined to belong to the same functional module).
  • each function of the application program will correspond to a running interface, and the running interface will correspond to an interface identifier.
  • the electronic device when it generates a configuration file to which a certain application program belongs, it can generate a function module frequency file correspondingly.
  • the function module frequency file is used to record the usage frequency of each function module of the application program.
  • the server when the server obtains multiple first configuration files corresponding to the target application, it can also obtain multiple function module frequency files corresponding to the target application at the same time, and then can also obtain multiple function module frequency files corresponding to the multiple function module frequencies.
  • the file calculation obtains which functional modules in the target application are the functional modules with high frequency of use as a whole, and then use the functional modules with high frequency as the designated functional modules, so that multiple hotspots based on the multiple first configuration files can be obtained
  • a target hotspot compilation unit belonging to a functional module with a high frequency of use is acquired from the compilation unit.
  • Step S130 Generate a second configuration file including the multiple target hotspot compilation units.
  • Step S140 Pre-compile the multiple target hotspot compilation units based on the second configuration file.
  • This application provides a method for pre-compilation of an application to obtain a first configuration file corresponding to a target application installed on each of multiple electronic devices, so as to obtain multiple records for recording the target application installed on the electronic device where they are located.
  • the first configuration file of the hotspot compilation unit from the plurality of hotspot compilation units included in the plurality of first configuration files, obtain a plurality of target hotspot compilation units belonging to the target function module in the target application, and generate The second configuration file of multiple target hotspot compilation units. Therefore, by this method, the hot compilation unit associated with the target function module in the target application can be compiled in advance before the target function module is run, so that the operating efficiency of the target function module can be improved, and at the same time. The efficiency of optimizing the operating efficiency of the target function module is optimized.
  • a method for pre-compilation of an application program provided by this application is applied to a server, and the method includes:
  • Step S210 Obtain a plurality of first configuration files corresponding to the target application, the plurality of first configuration files are used to record the hotspot compilation unit of the target application installed in the respective electronic devices, and the hotspot compilation
  • the unit is a compilation unit that allows pre-compiling before the target application program runs.
  • Step S220 Calculate the joint probability between any two hotspot coding units among the plurality of hotspot coding units included in the plurality of first configuration files, and the joint probability represents that any two hotspot coding units appear in the same one. The probability in the first profile.
  • the server may first obtain the number of times t of any two compilation units appearing in the same profile file. Then divide the number of times t by N to obtain the joint probability of any two coding units.
  • N is based on the number of multiple hotspot compilation units included in the multiple first configuration files.
  • Step S230 Obtain a plurality of target hotspot compilation units based on the joint probability calculation, and the plurality of target hotspot compilation units include hotspot compilation units belonging to target function modules in the target application.
  • the step of calculating multiple target hotspot coding units based on the joint probability calculation includes:
  • Step S231 Generate a joint probability matrix based on the multiple hotspot compilation units included in the multiple first configuration files.
  • the multiple hotspot compilation units included in the multiple first configuration files include Unit_a, Unit_b, Unit_c, Unit_d, Unit_e, Unit_m, Unit_o, Unit_p and other hot compilation units
  • the generated joint probability matrix can be as shown in Figure 6.
  • the area where any two hotspot coding units intersect each other is the joint probability of these two hotspot coding units.
  • the intersection area 99 is the joint probability between Unit_a and Unit_p
  • the intersection area 98 is the joint probability between Unit_d and Unit_p.
  • each intersection area may correspond to a position coordinate, so that the server can obtain the joint probability corresponding to each intersection area.
  • i can be used as the horizontal coordinate
  • j can be used as the vertical coordinate. Then in this case, if the coordinates of any two compilation units are (i, j) and (j, i), the corresponding any two compilation units (i, j) appear in the same first configuration file The number of times n i,j , then the server can obtain the joint probability that any two compilation units appear as
  • Step S232 Convert the joint probability matrix into a probability graph model, where each vertex in the probability graph model represents a hotspot coding unit, and the edge between adjacent hotspot coding units represents the adjacent hotspot The joint probability that the compilation units appear together in the same configuration file.
  • Fig. 7 exemplarily shows a probability graph model.
  • nodes a, b, c, d, e, m, o, and p there are nodes a, b, c, d, e, m, o, and p.
  • each node guarantees a hotspot compilation unit, for example, node a represents the hotspot compilation unit Unit_a, node b represents the hotspot compilation unit Unit_b, node c represents the hotspot compilation unit Unit_c, node d represents the hotspot compilation unit Unit_d, and node e represents the hotspot compilation unit.
  • Unit_e node m represents the hot spot compilation unit Unit_m, node p represents the hot spot compilation unit Unit_p, and node o represents the hot spot compilation unit Unit_o.
  • Step S233 Obtain multiple complete subgraphs by performing complete subgraph query on the probabilistic graph model, where each complete subgraph node represents a hotspot compilation unit in the same functional module of the target application, and The functional modules corresponding to the multiple complete subgraphs are target functional modules.
  • the step of obtaining multiple complete subgraphs by performing complete subgraph query on the probability graph model includes: performing complete subgraph query, and obtaining the maximum completeness in the probability graph model corresponding to the current search process.
  • the probability graph model corresponding to the first search process is the probability graph model obtained by the conversion of the joint probability matrix; the largest complete subgraph is removed from the corresponding probability graph model during the current search process to obtain The corresponding probability graph model in the next search process to obtain multiple complete subgraphs.
  • the method before performing the complete subgraph query, the method further includes: removing the edges whose joint probability is less than the target probability threshold in the probability graph model converted from the joint probability matrix to obtain the probability graph model to be queried
  • the probability graph model corresponding to the first search process is the probability graph model to be queried.
  • the value range of the target probability threshold is 0.1 to 0.9.
  • Step S234 Use the hotspot coding units represented by all the nodes of the multiple complete subgraphs as target hotspot coding units to obtain multiple target hotspot coding units.
  • the obtained target hotspot compilation units include Unit_a, Unit_b, Unit_c, Unit_d, Unit_e, Unit_m, Unit_p.
  • the step of using hotspot coding units represented by all nodes of the multiple complete subgraphs as target hotspot coding units, and obtaining multiple target hotspot coding units includes: obtaining from the multiple complete subgraphs A target complete subgraph, where the target complete subgraph is a complete subgraph whose number of nodes is not less than the number of target nodes; the hotspot compilation unit represented by all the nodes of the target complete subgraph is taken as the target hotspot compilation unit, To get multiple target hotspot compilation units.
  • the number of target nodes can be any value in the range of 1 to 100.
  • Step S240 Generate a second configuration file including the multiple target hotspot compilation units.
  • Step S250 pre-compile the multiple target hotspot compilation units based on the second configuration file.
  • This application provides a method for pre-compilation of an application to obtain a first configuration file corresponding to a target application installed on each of multiple electronic devices, so as to obtain multiple records for recording the target application installed on the electronic device where they are located.
  • the first configuration file of the hotspot compilation unit from the plurality of hotspot compilation units included in the plurality of first configuration files, obtain a plurality of target hotspot compilation units belonging to the target function module in the target application, and generate The second configuration file of multiple target hotspot compilation units. Therefore, the hotspot compilation unit associated with the target function module in the target application can be compiled in advance before the target function module is run by this method, so that the operating efficiency of the target function module can be improved, and at the same time. The efficiency of optimizing the operating efficiency of the target function module is optimized.
  • the joint probability between any two hotspot coding units among the multiple hotspot coding units included in the multiple first configuration files is calculated, and the joint probability is calculated
  • the matrix is converted into a probabilistic graph model, and then by querying the probabilistic graph model for the largest complete subgraph, multiple complete subgraphs are obtained to obtain the target hotspot compilation unit to which multiple specified functional modules belong, and then multiple target hotspots are obtained
  • the compilation unit thus realizes that the target hotspot compilation unit belonging to the same functional module can be obtained by means of probability estimation.
  • a method for pre-compilation of an application program provided by the present application is applied to a server, and the method includes:
  • Step S310 Obtain an installation rate of multiple candidate applications, where the installation rate is a ratio of the number of electronic devices installed with the candidate application to the number of all electronic devices.
  • Step S320 Obtain a storage space occupancy parameter of the configuration file of each application to be selected, where the storage space occupancy parameter is the storage space occupied by the corresponding configuration file in the electronic device where the application to be selected is installed The number of applications to be selected that are greater than the specified storage space occupancy value.
  • Step S330 Use the candidate application program whose corresponding installation rate and storage space occupancy parameter meet the specified conditions as the target application program.
  • Step S340 Obtain a plurality of first configuration files corresponding to the target application program, the plurality of first configuration files are used to record the hotspot compilation unit of the target application installed in the respective electronic devices, and the hotspot compilation
  • the unit is a compilation unit that allows pre-compiling before the target application program runs.
  • Step S350 Obtain a plurality of target hotspot compilation units based on the plurality of hotspot compilation units recorded in the plurality of first configuration files, and the plurality of target hotspot compilation units include a hotspot compilation unit belonging to a target function module in the target application. .
  • Step S360 Generate a second configuration file including the multiple target hotspot compilation units, so as to compile the multiple target hotspot compilation units in advance before running the target function module.
  • Step S370 Send the second configuration file to the electronic device where the target application is installed.
  • This application provides a method for pre-compilation of an application to obtain a first configuration file corresponding to a target application installed on each of multiple electronic devices, so as to obtain multiple records for recording the target application installed on the electronic device where they are located.
  • the first configuration file of the hotspot compilation unit from the plurality of hotspot compilation units included in the plurality of first configuration files, obtain a plurality of target hotspot compilation units belonging to the target function module in the target application, and generate The second configuration file of multiple target hotspot compilation units. Therefore, the hotspot compilation unit associated with the target function module in the target application can be compiled in advance before the target function module is run by this method, so that the operating efficiency of the target function module can be improved, and at the same time. The efficiency of optimizing the operating efficiency of the target function module is optimized.
  • it can be determined according to the installation rate of the application program and the size of the configuration file corresponding to the application program, which application programs can be used as the target application program, thereby improving the reliability of the confirmation of the target application program.
  • a method for pre-compiling an application program provided by the present application is applied to an electronic device, and the method includes:
  • Step S410 Obtain a second configuration file, which is generated by the server based on the method provided in the foregoing embodiment.
  • the electronic device may be a smart phone or a tablet computer.
  • the electronic device can obtain the second configuration file in multiple ways.
  • the electronic device can download the second configuration file at the same time when downloading the installation package of the aforementioned target application, and then can obtain the second configuration file during the process of locally installing the target application.
  • the second configuration file may be obtained when the updated configuration file pushed by the server is regularly received after the target application is installed.
  • Step S420 When it is detected that the electronic device satisfies the specified condition, run the second configuration file to compile the hotspot compilation unit in the second configuration file.
  • the specified condition may have specific content according to different ways in which the electronic device obtains the second configuration file.
  • the electronic device downloads the second configuration file while downloading the installation package of the aforementioned target application, then the corresponding specified condition is that it is detected that the electronic device is installing the installation package of the target application .
  • the specified condition may be when the electronic device is in a charging state or a screen off state, etc., when the user is less likely to use the electronic device, and then It is implemented to prevent the user from occupying the processing resources of the electronic device during the operation of the second configuration file during the use of the electronic device.
  • the application pre-compilation method provided by the present application can enable the electronic device installed with the target application to compile the target application in advance based on the functional module after receiving the second configuration file.
  • Multiple target hotspot compilation units make it possible to optimize the operating efficiency of the target function modules in them more quickly.
  • the number of multiple first configuration files and the number of multiple thermal units obtained from the multiple first configuration files can be determined according to actual conditions.
  • the number is only exemplary.
  • the various thresholds or thresholds in the foregoing embodiments are also exemplary and can be changed according to actual needs.
  • an apparatus 500 for precompiling an application program provided by the present application includes:
  • the file obtaining unit 510 is configured to obtain multiple first configuration files corresponding to the target application, and the multiple first configuration files are used to record the hotspot compilation unit of the target application installed in the respective electronic devices to which they belong,
  • the hotspot compiling unit is a compiling unit that allows compiling in advance before the target application is run;
  • the compilation unit processing unit 520 is configured to obtain a plurality of target hotspot compilation units based on the plurality of hotspot compilation units recorded in the plurality of first configuration files, and the plurality of target hotspot compilation units include target functions belonging to the target application Hotspot compilation unit of the module;
  • the file generating unit 530 is configured to generate a second configuration file including the multiple target hotspot compilation units, so as to compile the multiple target hotspot compilation units in advance before the target function module runs.
  • the pre-compilation unit 531 is configured to pre-compile the multiple target hotspot compilation units based on the second configuration file.
  • the coding unit processing unit 520 is specifically configured to calculate the joint probability between any two hotspot coding units among the multiple hotspot coding units included in the plurality of first configuration files, and the joint probability represents all the hotspot coding units.
  • the probability of any two hotspot compilation units appearing in the same first configuration file; multiple target hotspot compilation units are calculated based on the joint probability.
  • the compilation unit processing unit 520 is specifically configured to generate a joint probability matrix based on a plurality of hotspot compilation units included in the plurality of first configuration files; convert the joint probability matrix into a probability graph model, wherein Each vertex in the probability graph model represents a hotspot coding unit, and the edges between adjacent hotspot coding units represent the joint probability of the adjacent hotspot coding units appearing in the same configuration file;
  • the probabilistic graph model performs complete subgraph query to obtain multiple complete subgraphs, wherein the nodes of each complete subgraph represent a hotspot compilation unit in the same functional module of the target application, and the multiple complete subgraphs
  • the function module corresponding to the subgraph is the target function module; the hotspot compilation unit represented by all the nodes of the multiple complete subgraphs is used as the target hotspot compilation unit to obtain multiple target hotspot compilation units.
  • the compilation unit processing unit 520 is specifically configured to perform a complete subgraph query, and obtain the largest complete subgraph from the probability graph model corresponding to the current search process, where the probability graph model corresponding to the first search process is obtained by the joint probability matrix conversion The probability graph model of; remove the maximum complete subgraph from the corresponding probability graph model during the current search process to obtain the corresponding probability graph model during the next search process to obtain multiple complete subgraphs.
  • the device 500 further includes: a model optimization unit 540, configured to remove the probability graph model obtained by the joint probability matrix conversion, and the joint probability represented by the joint probability is less than the target probability threshold. Edge, get the probability graph model to be queried. In this manner, the probability graph model corresponding to the first search process is the probability graph model to be queried.
  • a model optimization unit 540 configured to remove the probability graph model obtained by the joint probability matrix conversion, and the joint probability represented by the joint probability is less than the target probability threshold. Edge, get the probability graph model to be queried. In this manner, the probability graph model corresponding to the first search process is the probability graph model to be queried.
  • the compiling unit processing unit 520 is specifically configured to obtain a target complete subgraph from the plurality of complete subgraphs, where the target complete subgraph is a complete subgraph that includes no less than the number of target nodes. ; Use the hotspot coding units represented by all nodes of the target complete subgraph as the target hotspot coding unit to obtain multiple target hotspot coding units.
  • the device 500 further includes:
  • the target application determining unit 550 is configured to obtain an installation rate of multiple candidate applications, where the installation rate is a ratio of the number of electronic devices with the candidate application installed to the number of all electronic devices;
  • the storage space occupancy parameter of the configuration file of the to-be-selected application program, the storage space occupancy parameter is that the storage space occupied by the corresponding configuration file is greater than the specified storage space occupancy value in the electronic device on which the candidate application is installed.
  • the number of applications to be selected; the application to be selected whose corresponding installation rate and storage space occupancy parameters meet the specified conditions is taken as the target application.
  • the file distribution unit 560 is configured to send the second configuration file to the electronic device where the target application is installed.
  • the electronic device 200 includes one or more (only one is shown in the figure) a processor 102, a memory 104, and a network module 106 that are coupled to each other.
  • the memory 104 stores a program that can execute the content in the foregoing embodiment, and the processor 102 can execute the program stored in the memory 104.
  • the processor 102 may include one or more processing cores.
  • the processor 102 uses various interfaces and lines to connect various parts of the entire electronic device 100, and executes by running or executing instructions, programs, code sets, or instruction sets stored in the memory 104, and calling data stored in the memory 104.
  • the processor 102 may use at least one 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).
  • DSP Digital Signal Processing
  • FPGA Field-Programmable Gate Array
  • PLA Programmable Logic Array
  • the processor 102 may be integrated with one or a combination of a central processing unit (CPU), a graphics processing unit (GPU), a modem, and the like.
  • the CPU mainly processes the operating system, user interface, and application programs;
  • the GPU is used for rendering and drawing of display content;
  • the modem is used for processing wireless communication. It can be understood that the above-mentioned modem may not be integrated into the processor 102, but may be implemented by a communication chip alone.
  • the memory 104 may include random access memory (RAM) or read-only memory (Read-Only Memory).
  • the memory 104 may be used to store instructions, programs, codes, code sets or instruction sets.
  • the memory 104 may include a storage program area and a storage data area, where the storage program area may store instructions for implementing the operating system and instructions for implementing at least one function (such as touch function, sound playback function, image playback function, etc.) , Instructions used to implement the following various method embodiments, etc.
  • the data storage area can also store data (such as phone book, audio and video data, chat record data) created by the terminal 100 during use.
  • the memory 104 may store a device for pre-compilation of application programs.
  • the device for pre-compiling the application program may be the aforementioned device 500.
  • the network module 106 is used to receive and send electromagnetic waves, realize the mutual conversion between electromagnetic waves and electrical signals, so as to communicate with a communication network or other equipment, such as communication with a wireless access point.
  • the network module 106 may include various existing circuit elements for performing these functions, for example, an antenna, a radio frequency transceiver, a digital signal processor, an encryption/decryption chip, a subscriber identity module (SIM) card, a memory, etc. .
  • SIM subscriber identity module
  • the network module 106 can also be used as a network adapter for the electronic device 200 to directly connect to the network through a line connection.
  • the network may include a cellular telephone network, a wireless local area network, or a metropolitan area network.
  • FIG. 14 shows a structural block diagram of a computer-readable storage medium provided by an embodiment of the present application.
  • the computer-readable medium 800 stores program code, and the program code can be invoked by a processor to execute the method described in the foregoing method embodiment.
  • the computer-readable storage medium 800 may be an electronic memory such as flash memory, EEPROM (Electrically Erasable Programmable Read Only Memory), EPROM, hard disk, or ROM.
  • the computer-readable storage medium 800 includes a non-transitory computer-readable storage medium.
  • the computer-readable storage medium 800 has storage space for the program code 810 for executing any method steps in the above-mentioned methods. These program codes can be read from or written into one or more computer program products.
  • the program code 810 may be compressed in a suitable form, for example.
  • This application provides a method, device, electronic device, and server for pre-compilation of an application program to obtain a first configuration file corresponding to a target application program installed by each of multiple electronic devices, so as to obtain multiple records for recording the installation of each electronic device.
  • the first configuration file of the hotspot compilation unit of the target application program from the plurality of hotspot compilation units included in the plurality of first configuration files, obtain multiple target hotspots belonging to the target function module in the target application
  • the compiling unit generates a second configuration file including the multiple target hotspot compiling units.
  • the hotspot compilation unit associated with the target function module in the target application can be compiled in advance before the target function module is run by this method, so that the operating efficiency of the target function module can be improved, and at the same time.
  • the efficiency of optimizing the operating efficiency of the target function module is optimized.

Landscapes

  • Engineering & Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Stored Programmes (AREA)

Abstract

L'invention concerne un procédé et appareil de pré-compilation de programmes d'application, un dispositif électronique et un serveur. Le procédé comporte les étapes consistant à : acquérir une pluralité de premiers fichiers de configuration correspondant à un programme d'application cible ; acquérir une pluralité d'unités de compilation de points sensibles cibles sur la base d'une pluralité d'unités de compilation de points sensibles enregistrées dans la pluralité de premiers fichiers de configuration, la pluralité d'unités de compilation de points sensibles cibles comportant une unité de compilation de point sensible qui appartient à un module fonctionnel cible dans le programme d'application cible ; et générer un second fichier de configuration, qui comporte la pluralité d'unités de compilation de points sensibles cibles, de façon à compiler à l'avance la pluralité d'unités de compilation de points sensibles cibles avant que le module fonctionnel cible s'exécute. Par conséquent, au moyen du procédé, l'unité de compilation de point sensible associée au module fonctionnel cible dans le programme d'application cible peut être compilée à l'avance avant le module fonctionnel cible, avant que le programme d'application cible s'exécute, de sorte que le rendement d'exécution du module fonctionnel cible peut être amélioré, et que le rendement d'optimisation du rendement d'exécution du module fonctionnel cible est également amélioré.
PCT/CN2020/121552 2019-11-08 2020-10-16 Procédé et appareil de pré-compilation de programmes d'application, dispositif électronique et serveur WO2021088624A1 (fr)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201911087183.4A CN112783499A (zh) 2019-11-08 2019-11-08 应用程序预编译的方法、装置、电子设备以及服务器
CN201911087183.4 2019-11-08

Publications (1)

Publication Number Publication Date
WO2021088624A1 true WO2021088624A1 (fr) 2021-05-14

Family

ID=75748377

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/121552 WO2021088624A1 (fr) 2019-11-08 2020-10-16 Procédé et appareil de pré-compilation de programmes d'application, dispositif électronique et serveur

Country Status (2)

Country Link
CN (1) CN112783499A (fr)
WO (1) WO2021088624A1 (fr)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090138847A1 (en) * 2007-03-09 2009-05-28 Objective Interface Systems Optimized code generation by eliminating unused virtual function
US20160062878A1 (en) * 2014-08-30 2016-03-03 Oracle International Corporation Speeding up dynamic language execution on a virtual machine with type speculation
CN106775893A (zh) * 2016-12-30 2017-05-31 北京小米移动软件有限公司 对程序预编译的方法及装置
CN106897080A (zh) * 2015-12-18 2017-06-27 北京国双科技有限公司 动态链接库的处理方法及装置
CN109960507A (zh) * 2017-12-14 2019-07-02 广东欧珀移动通信有限公司 编译优化方法、装置、存储介质、智能终端及服务器

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090138847A1 (en) * 2007-03-09 2009-05-28 Objective Interface Systems Optimized code generation by eliminating unused virtual function
US20160062878A1 (en) * 2014-08-30 2016-03-03 Oracle International Corporation Speeding up dynamic language execution on a virtual machine with type speculation
CN106897080A (zh) * 2015-12-18 2017-06-27 北京国双科技有限公司 动态链接库的处理方法及装置
CN106775893A (zh) * 2016-12-30 2017-05-31 北京小米移动软件有限公司 对程序预编译的方法及装置
CN109960507A (zh) * 2017-12-14 2019-07-02 广东欧珀移动通信有限公司 编译优化方法、装置、存储介质、智能终端及服务器

Also Published As

Publication number Publication date
CN112783499A (zh) 2021-05-11

Similar Documents

Publication Publication Date Title
KR102389235B1 (ko) 리소스 배치 방법, 장치, 단말기 및 저장 매체
WO2021057619A1 (fr) Procédé et appareil de récupération de mémoire, dispositif électronique et support de stockage
WO2019028992A1 (fr) Procédé de construction de relation de dépendance de version multi-module, dispositif, serveur et support de stockage
CN106453572B (zh) 基于云服务器同步图像的方法及系统
CN111061483B (zh) 编译优化方法、装置及电子设备
CN104579768A (zh) 客户端升级方法和装置
WO2021159393A1 (fr) Procédé et appareil de poussée d'informations et serveur et support de stockage
WO2021115177A1 (fr) Procédé et appareil d'installation d'application, dispositif terminal, serveur et support de stockage
CN106970816B (zh) 一种软件升级处理方法、装置及音频播放设备
CN112667405B (zh) 信息处理方法、装置、设备及存储介质
CN113159145A (zh) 一种特征工程编排方法及装置
WO2021179156A1 (fr) Procédé de traitement de message, dispositif et système, et serveur
CN112328592A (zh) 数据存储方法、电子设备及计算机可读存储介质
CN110738156B (zh) 一种基于消息中间件的人脸识别系统及方法
CN111813529B (zh) 数据处理方法、装置、电子设备及存储介质
WO2021088624A1 (fr) Procédé et appareil de pré-compilation de programmes d'application, dispositif électronique et serveur
US10212291B2 (en) System, method, and non-transitory computer readable storage medium for image recognition based on convolutional neural networks
WO2021129489A1 (fr) Procédé et appareil de précompilation d'application, dispositif électronique, et support de stockage
WO2021088686A1 (fr) Procédé et appareil de génération d'informations d'optimisation de compilateur et dispositif électronique
WO2022111070A1 (fr) Procédé et appareil de traitement d'images, dispositif électronique et support de stockage
WO2021115178A1 (fr) Procédé et appareil de précompilation de programme d'application, serveur et support de stockage
WO2021102849A1 (fr) Procédé et appareil d'acquisition de ressources, et dispositif électronique
WO2021218384A1 (fr) Procédé, système et dispositif de mise à jour d'algorithme
CN112114931B (zh) 深度学习程序配置方法、装置、电子设备及存储介质
WO2021129339A1 (fr) Procédé et dispositif de traitement de fichier de configuration, appareil électronique et support de stockage

Legal Events

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

Ref document number: 20884234

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20884234

Country of ref document: EP

Kind code of ref document: A1