CN113010172A - Method, device and system for processing configuration file and storage medium - Google Patents
Method, device and system for processing configuration file and storage medium Download PDFInfo
- Publication number
- CN113010172A CN113010172A CN201911312519.2A CN201911312519A CN113010172A CN 113010172 A CN113010172 A CN 113010172A CN 201911312519 A CN201911312519 A CN 201911312519A CN 113010172 A CN113010172 A CN 113010172A
- Authority
- CN
- China
- Prior art keywords
- configuration file
- target
- hot spot
- code
- target application
- Prior art date
- Legal status (The legal status 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 status listed.)
- Granted
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/40—Transformation of program code
- G06F8/41—Compilation
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/70—Software maintenance or management
- G06F8/71—Version control; Configuration management
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D10/00—Energy efficient computing, e.g. low power processors, power management or thermal management
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)
- Information Transfer Between Computers (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The application discloses a method, a device, a system and a storage medium for processing a configuration file, wherein the method for processing the configuration file is applied to a server and comprises the following steps: the method comprises the steps of obtaining the heat degree of a target application when an obtaining request sent by terminal equipment is received, wherein the obtaining request is used for obtaining a hot spot code of the target application; determining at least one configuration file in a plurality of configuration files corresponding to the target application as a target configuration file according to the heat degree, wherein the plurality of configuration files are generated in advance according to a hot spot code of the target application, and the size of each configuration file in the plurality of configuration files is different; and sending the target configuration file to the terminal equipment, wherein the target configuration file is used for indicating the terminal equipment to pre-compile the hot spot codes in the target configuration file. The method can avoid the waste of the storage space of the terminal equipment.
Description
Technical Field
The present application relates to the field of computer technologies, and in particular, to a method, an apparatus, a system, and a storage medium for processing a configuration file.
Background
In the use of the application program of the terminal device, a frequently used method or code of the application program is usually used as a hot spot code, the hot spot code is compiled into a binary machine code in advance, and the compiled binary machine code can be directly executed by a processor when the application program is run next time, so that the running speed of the application program is improved. Some manufacturers collect the hot spot codes of the applications and push the hot spot codes to the terminal equipment of the user, and for the terminal equipment, the hot spot codes of the applications are all compiled. However, for an application that is not commonly used by a user, hot spot codes are all compiled, and a storage space is wasted due to a compiled file.
Disclosure of Invention
In view of the foregoing problems, the present application provides a method, an apparatus, a system, and a storage medium for processing a configuration file.
In a first aspect, an embodiment of the present application provides a method for processing a configuration file, which is applied to a server, and the method includes: the method comprises the steps of obtaining the heat degree of a target application when an obtaining request sent by terminal equipment is received, wherein the obtaining request is used for obtaining a hot spot code of the target application; determining at least one configuration file in a plurality of configuration files corresponding to the target application as a target configuration file according to the heat degree, wherein the plurality of configuration files are generated in advance according to a hot spot code of the target application, and the size of each configuration file in the plurality of configuration files is different; and sending the target configuration file to the terminal equipment, wherein the target configuration file is used for indicating the terminal equipment to pre-compile the hot spot codes in the target configuration file.
In a second aspect, an embodiment of the present application provides a method for processing a configuration file, which is applied to a terminal device, and the method includes: sending an acquisition request to a server, wherein the acquisition request is used for acquiring a hotspot code of a target application; receiving a target configuration file issued by the server, wherein the target configuration file is determined by the server from a plurality of configuration files corresponding to the target application according to the heat degree of the target application, the plurality of configuration files are generated in advance according to a hot spot code of the target application, and the size of each configuration file in the plurality of configuration files is different; and pre-compiling the hot spot codes in the target configuration file, and storing the compiled file obtained after pre-compiling.
In a third aspect, an embodiment of the present application provides a device for processing a configuration file, where the device is applied to a server, and the device includes: the system comprises a request receiving module, a file acquiring module and a file sending module, wherein the request receiving module is used for acquiring the heat of a target application when receiving an acquiring request sent by terminal equipment, and the acquiring request is used for acquiring a hot spot code of the target application; the file acquisition module is used for determining at least one configuration file in a plurality of configuration files corresponding to the target application as a target configuration file according to the heat degree, the plurality of configuration files are generated in advance according to the hot spot code of the target application, and the size of each configuration file in the plurality of configuration files is different; the file sending module is used for sending the target configuration file to the terminal equipment, and the target configuration file is used for indicating the terminal equipment to pre-compile the hot spot codes in the target configuration file.
In a fourth aspect, an embodiment of the present application provides a device for processing a configuration file, where the device is applied to a terminal device, and the device includes: the system comprises a request sending module, a file receiving module and a code compiling module, wherein the request sending module is used for sending an acquisition request to a server, and the acquisition request is used for acquiring a hot spot code of a target application; the file receiving module is used for receiving a target configuration file issued by the server, the target configuration file is determined by the server from a plurality of configuration files corresponding to the target application according to the heat degree of the target application, the plurality of configuration files are generated in advance according to a hot spot code of the target application, and the size of each configuration file in the plurality of configuration files is different; the code compiling module is used for pre-compiling the hot spot codes in the target configuration file and storing the compiled file obtained after pre-compiling.
In a fifth aspect, an embodiment of the present application provides a system for processing a configuration file, where the system includes a server and a terminal device, where the server is in communication connection with the terminal device, the terminal device is configured to send an acquisition request to the server, and the acquisition request is used to acquire a hotspot code of a target application; the server is used for receiving the acquisition request, acquiring the heat of the target application when receiving the acquisition request sent by the terminal equipment, determining at least one configuration file in a plurality of configuration files corresponding to the target application as a target configuration file according to the heat, wherein the plurality of configuration files are generated in advance according to a hot spot code of the target application, and the size of each configuration file in the plurality of configuration files is different; the server is also used for sending the target configuration file to the terminal equipment; the terminal device is further configured to receive the target configuration file, perform pre-compilation on the hotspot codes in the target configuration file, and store the compiled file obtained after the pre-compilation.
In a sixth aspect, an embodiment of the present application provides a server, including: one or more processors; a memory; one or more application programs, wherein the one or more application programs are stored in the memory and configured to be executed by the one or more processors, the one or more programs configured to perform the method of processing a configuration file as provided in the first aspect above.
In a seventh aspect, an embodiment of the present application provides a terminal device, including: one or more processors; a memory; one or more application programs, wherein the one or more application programs are stored in the memory and configured to be executed by the one or more processors, the one or more programs configured to perform the method of processing a configuration file provided by the second aspect described above.
In an eighth aspect, an embodiment of the present application provides a computer-readable storage medium, where a program code is stored in the computer-readable storage medium, and the program code may be called by a processor to execute a processing method of the configuration file provided in the first aspect or execute a processing method of the configuration file provided in the second aspect.
According to the scheme, when receiving an acquisition request sent by terminal equipment, a server acquires the heat of a target application, wherein the acquisition request is used for acquiring the hot spot codes of the target application, then at least one configuration file in a plurality of configuration files corresponding to the target application is determined according to the heat and serves as a target configuration file, the configuration files are generated in advance according to the hot spot codes of the target application, the size of each configuration file in the configuration files is different, the target configuration file is sent to the terminal equipment, and the target configuration file is used for indicating the terminal equipment to pre-compile the hot spot codes in the target configuration file. Therefore, when the server pushes the configuration file of the application to the terminal equipment, the size of the pushed configuration file is determined by the heat of the application, and the waste of the storage space of the terminal equipment caused by the fact that the pushed configuration file is large and the heat of the application is small is avoided.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 shows a schematic diagram of an application scenario provided according to an embodiment of the present application.
Fig. 2 shows another schematic diagram of an application scenario provided according to an embodiment of the present application.
FIG. 3 shows a flow diagram of a method of processing a configuration file according to one embodiment of the present application.
FIG. 4 shows a flowchart of a method for processing a configuration file according to another embodiment of the present application.
FIG. 5 shows a flowchart of a method of processing a configuration file according to yet another embodiment of the present application.
FIG. 6 shows a flowchart of a method for processing a configuration file according to yet another embodiment of the present application.
FIG. 7 shows a flowchart of a method of processing a configuration file according to yet another embodiment of the present application.
FIG. 8 shows a block diagram of a device for processing a configuration file according to an embodiment of the present application.
FIG. 9 shows a block diagram of a device for processing a configuration file according to another embodiment of the present application.
Fig. 10 is a block diagram of a terminal device for executing a method for processing a configuration file according to an embodiment of the present application.
Fig. 11 is a block diagram of a server for executing a method for processing a configuration file according to an embodiment of the present application.
Fig. 12 is a storage unit for storing or carrying program codes for implementing a processing method of a configuration file according to an embodiment of the present application.
Detailed Description
In order to make the technical solutions better understood by those skilled in the art, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application.
Android (Android) has two virtual machine execution environments: dalvik virtual machine and Art virtual machine. In the execution environment of the Dalvik virtual machine, each Time an application runs, the bytecode needs to be converted into machine code by a Just In Time compiler (JIT compiler) to be run by the device, which slows down the execution efficiency of the application. In the Android 4.4 version, the Art virtual machine starts to replace a Dalvik virtual machine, and in the initial Art virtual machine, when an application is installed for the first time, the system compiles a dex file in an APK into an oat file containing a local machine code through a tool named dex2oat and stores the oat file. In doing so, when the program is executed, the compiled machine code can be directly used to accelerate the efficiency, and this mechanism Of pre-compiling machine code is called before-run compilation (AOT). The drawback of AOT is that the application optimization process after application installation and system upgrade is time consuming (it is necessary to recompile the dex bytecode into local machine code), and the optimized file takes up extra storage space.
Therefore, it is adjusted later, and in the environment of the Art virtual machine, the original AOT is changed into Interpreter (Interpreter) + JIT + AOT hybrid compilation. The execution speed of the JAVA program is relatively slow when it is initially executed only by interpretation of the JAVA Interpreter (Interpreter), i.e. byte code by byte code, and especially when a certain method or code block is executed very frequently, the execution efficiency is very low. Then, a JIT compiler is later introduced into the virtual machine, when the virtual machine finds that a certain method or code block runs particularly frequently, the code is regarded as a hot spot code and is recorded and saved in a profile file (configuration file), and in order to improve the execution efficiency of the hot spot code, the virtual machine compiles the code into machine code related to a local platform during running, and the JIT compiler is responsible for the task. In brief, the profile file records a method or a code block frequently run by an application, and is compiled by JIT or AOT to obtain an odex/oat file, which stores binary machine codes compiled by the hot spot codes and can be directly submitted to a Central Processing Unit (CPU) for execution, thereby increasing the running speed.
In the JIT architecture, the oat file can be run directly by the Art virtual machine due to the machine code it contains that runs in a program. In the dex file, if the CODE is a cold CODE (non-hot CODE), the CODE is delivered to a JAVA interpreter for execution, if the CODE is a hot CODE (hot CODE), the CODE is delivered to JIT for real-time compilation and then stored in a JIT CODE CACHE, and the hot CODE can be directly executed from the CACHE after the hot CODE is accessed again next time.
Most manufacturers generally adopt the above-mentioned Interpreter + JIT + AOT hybrid compilation mode, in this hybrid compilation mode, when an application is installed, a dex file is not compiled, when the application is running, the dex file is directly run through the Interpreter, frequently-running functions or CODE blocks are identified as hot CODEs, the hot CODEs are JIT compiled and then stored in a JIT CODE CACHE, a profile file is generated to record information of a hotspot function, when a mobile terminal enters an IDLE state and a Charging state, the system scans the profile file under an application directory and executes AOT process compilation, and a binary machine CODE compiled by AOT can be directly handed to a Central Processing Unit (CPU) for execution, thereby increasing the running speed. In this way, the mobile terminal is required to collect the hotspot code by itself, and the compiling of the hotspot code is triggered only in an idle maintenance mode depending on the device, so that the device can enjoy the performance improvement after using the application for a period of time.
Of course, some vendors collect configuration files of applications from the mobile terminals of users and upload the configuration files to the cloud. The user can use the mobile terminal to download the configuration file from the cloud, the mobile terminal can compile the hot spot codes in the configuration file after receiving the configuration file, the compiled file (binary machine code) can be stored, so that the binary machine code can be directly executed when the hot spot codes of the application program are operated, the mobile terminal can be directly compiled according to the downloaded configuration file, the mobile terminal does not need to collect the hot spot codes for a long time and compile the hot spot codes, and the performance improvement during application operation can be immediately enjoyed.
The inventor finds that, through long-term research, all hotspot codes acquired from a server are compiled for a terminal device, and a compiled file is stored. For many applications, some applications may not be common to the user, but for applications that are not common to the user, if the hot spot codes are all compiled, the compiled files will cause waste of storage space.
In view of the above problems, the inventor proposes a method, an apparatus, a system, and a storage medium for processing a configuration file according to an embodiment of the present application, where when a server pushes an application configuration file to a terminal device, the size of the pushed configuration file is determined by the heat of the application, so as to avoid waste of a storage space of the terminal device due to a large pushed configuration file and a small heat of the application. The specific processing method of the configuration file is described in detail in the following embodiments.
The following describes an application scenario provided in the embodiment of the present application.
In some embodiments, referring to fig. 1, fig. 1 is a schematic diagram illustrating an application scenario provided by an embodiment of the present application, where the application scenario includes a processing system 10 for a configuration file, and the processing system 10 for the configuration file includes: a terminal device 100 and a first server 200. Wherein the terminal device 100 communicates with the first server 200 through a network. The terminal device 100 may perform data interaction with the first server 200 to acquire file data such as a configuration file of the application program from the first server 200.
In other embodiments, referring to fig. 2, fig. 2 shows another schematic diagram of an application scenario provided in this embodiment of the present application, and the processing system 10 for configuration files may also include: terminal device 100, first server 200, and second server 300. Data interaction is performed between the terminal device 100 and the first server 200, and data interaction may also be performed between the first server 200 and the second server 300. The first server 200 may be configured to process a request of the terminal device 100, the second server 300 may be configured to store and manage file data of a configuration file, an installation package, and the like of the application, and when the terminal device 100 acquires the file of the application from the first server 200, the first server 200 may acquire the file of the application from the second server 300 and transmit the file of the application to the terminal device 100.
Of course, other servers may also be included in the profile processing system 10. For example, the profile processing system 10 may further include a third server, and the third server may be configured to collect a profile of an application from a terminal device of a user, and transmit the collected profile to the second server 200 for sorting, storage, and the like; for another example, the configuration file processing system 10 may further include a fourth server, and the fourth server may be configured to store and manage an installation package of the application program, and in this case, the configuration file of the application program may be stored and managed by the second server 200, and the installation package of the application program and the configuration file may be managed and stored separately.
In some embodiments, the terminal device 100 may be a smart phone, a tablet computer, an electronic book, a smart watch, or the like; the servers such as the first server 200 and the second server 300 may be conventional servers, or may be cloud servers, which is not limited herein.
The following describes in detail a processing method of a configuration file provided in an embodiment of the present application.
Referring to fig. 3, fig. 3 is a flowchart illustrating a method for processing a configuration file according to an embodiment of the present application. The processing method of the configuration file can be applied to the server in the processing system of the configuration file. The following will describe a specific flow of the present embodiment by taking a terminal device as an example. As will be described in detail with respect to the flow shown in fig. 3, the method for processing the configuration file may specifically include the following steps:
step S110: the method comprises the steps of obtaining the heat degree of a target application when an obtaining request sent by a terminal device is received, wherein the obtaining request is used for obtaining a hot spot code of the target application.
In this embodiment, the obtaining request may be generated by the terminal device, and the obtaining request is used to obtain the file data of the target application from the server. In some approaches, the fetch request may be used at least to fetch the hotspot code of the target application. The application may be an application that is not installed in the terminal device, or may be an application that is installed in the terminal device and is not compiled for the hotspot code, which is not limited herein.
In some embodiments, the terminal device may generate the obtaining request according to a user operation of the user, and then send the obtaining request to the server, so that the server receives the obtaining request, for example, the terminal device detects an obtaining operation of a hotspot code of a target application in an interface of a software store, and then generates the obtaining request of the hotspot code of the target application.
In other embodiments, after the target application is installed and before the target application is not used, the terminal device may actively generate an acquisition request for acquiring a hotspot code of the target application, and then send the acquisition request to the server, so that the server receives the acquisition request.
Of course, in some embodiments, the terminal device may also generate an acquisition request for acquiring the installation package and the hotspot code at the same time when downloading the application, and send the acquisition request to the server, so that the server receives the acquisition request.
In the embodiment of the application, the server can acquire the heat of the target application when receiving the above acquisition request of the terminal device. The popularity can be used to represent the downloading amount of the application, and the larger the downloading amount is, the higher the popularity is, and the lower the downloading amount is, the lower the popularity is. The expression form of the popularity may be the ranking from top to bottom, or may be the download number, etc., and is not limited herein.
In some embodiments, the server may determine the popularity of the target application based on popularity data of the target application in the application store. When the server is a server of an application store, the heat data of the target application can be directly acquired from the local; when the server is not the server of the application store, the heat data of the target application can be acquired from the server of the application store.
In other embodiments, the server may also obtain the heat data of the target application from the service platform that counts the heat of the application, and determine the heat of the target application.
Of course, the specific way in which the server obtains the heat of the target application may not be limiting.
Step S120: and determining at least one configuration file in a plurality of configuration files corresponding to the target application as a target configuration file according to the heat degree, wherein the plurality of configuration files are generated in advance according to the hot spot code of the target application, and the size of each configuration file in the plurality of configuration files is different.
In the embodiment of the application, after the server acquires the heat degree of the target application, the server may determine the configuration file to be pushed to the terminal device according to the heat degree of the target application. The server can determine the configuration file to be pushed from a plurality of configuration files corresponding to the target application.
In some embodiments, a plurality of configuration files corresponding to the target application are generated in advance according to the hotspot code of the target application, and each configuration file includes the hotspot code of the target application, that is, the profile file for recording the hotspot code of the application. And the size of each of the plurality of profiles is different, i.e. the size of the hotspot code in the profile is different.
As an implementation manner, according to all the hot spot codes corresponding to the target application, according to a set rule, all the hot spot codes are divided into a plurality of parts, and the hot spot codes of each part have different sizes, and then according to the hot spot codes of each part, a configuration file is generated, so that a plurality of configuration files with different sizes are obtained.
As another embodiment, all the hot spot codes corresponding to the target application may be divided into multiple hot spot codes according to different functions implemented by the hot spot codes, and then different configuration files are generated according to the sizes of the hot spot codes and according to the combination of one or more hot spot codes, and the hot spot codes in each configuration file are different in size. Of course, the manner in which the specific plurality of profiles are formed may not be limiting.
In some embodiments, the server obtains at least one configuration file from a plurality of configuration files of the target application as the target configuration file according to the heat of the target application, where the server selects a configuration file of a target size corresponding to the heat according to the size of the configuration file according to the heat of the target application. The configuration file with the target size corresponding to the heat may be one configuration file, or a combination of multiple configuration files, that is, one configuration file with the target size may be selected, or multiple configuration files with the sum of the target sizes may be selected, which is not limited herein. So that the size of the target profile can correspond to the heat.
As an embodiment, the correspondence relationship between the heat degree and the target size may be a relationship in which the target size is proportional to the heat degree, that is, the larger the heat degree is, the larger the size of the target profile is. As another embodiment, the heat in the same section may correspond to the same target size, that is, the configuration files with the same size may be obtained, and in the section with the high heat, the size of the target configuration file to be pushed may be distinguished by the section with the high heat as the corresponding target size is larger, or when the heat of the application is smaller than a certain value, the size of the target configuration file to be pushed may be reduced accordingly, thereby avoiding waste of storage space. Of course, the rule for obtaining at least one configuration file according to the heat may not be limited, for example, when the heat is less than the first threshold, one or more configuration files with a first size may be selected as the target configuration file, and when the heat is less than the second threshold, one or more configuration files with a second size may be selected, the first size is greater than the second size, and the first threshold is greater than the second threshold, so that the size of the target configuration file may correspond to the heat of the application, and when the heat is less than a certain value, the size of the pushed target configuration file is correspondingly reduced, thereby avoiding waste of storage space.
In some embodiments, the plurality of profiles of the target application are stored in a server, and the server may obtain at least one profile from the plurality of profiles as the target profile directly according to the degree of heat. In other embodiments, multiple configuration files of the target application are stored in other servers, the server that receives the obtaining request may store an identifier of each configuration file, and at least one configuration file corresponding to the degree of heat may be obtained from another server as the target configuration file according to the identifier of the at least one configuration file corresponding to the degree of heat.
Step S130: and sending the target configuration file to the terminal equipment, wherein the target configuration file is used for indicating the terminal equipment to pre-compile the hot spot codes in the target configuration file.
In this embodiment of the application, after the server that receives the acquisition request acquires the target configuration file, the server may send the target configuration file to be pushed to the terminal device, so that the terminal device that sends the acquisition request can acquire the target configuration file. The server sends a target configuration file of the terminal device, the target configuration file comprises hot spot codes with corresponding sizes, and the target configuration file can instruct the terminal device to pre-compile the hot spot codes and store a compiled file obtained by pre-compiling. The file in the compiled file is a binary machine code, so that when the terminal device runs the hot spot code in the target configuration file, the binary machine code in the compiled file can be directly executed, and the efficiency of running the target application is improved. In addition, the size of the target configuration file pushed to the terminal device corresponds to the heat degree, so that the configuration files corresponding to all the hot spot codes of the target application are prevented from being pushed, the situation that the pushed configuration files are large is avoided, and the storage space of the terminal device is wasted when the heat degree of the application is small is avoided.
According to the method for processing the configuration file, when receiving an acquisition request sent by a terminal device, a server acquires the heat of a target application, wherein the acquisition request is used for acquiring the hot spot code of the target application, then determines at least one configuration file in a plurality of configuration files corresponding to the target application according to the heat, the configuration file is used as a target configuration file, the configuration files are generated in advance according to the hot spot code of the target application, the size of each configuration file in the configuration files is different, the target configuration file is sent to the terminal device, and the target configuration file is used for indicating the terminal device to pre-compile the hot spot code in the target configuration file. The size of the target configuration file pushed to the terminal device corresponds to the heat degree, so that the situation that the configuration file pushed is large due to the fact that the configuration file corresponding to all hot spot codes of the target application is pushed is avoided, but when the heat degree of the application is low, the terminal device stores the compiled file obtained by compiling all the hot spot codes in the configuration file, and then the storage space of the terminal device is wasted is avoided.
Referring to fig. 4, fig. 4 is a schematic flowchart illustrating a method for processing a configuration file according to another embodiment of the present application. The processing method of the configuration file is applied to the server in the processing system of the configuration file. As will be described in detail with respect to the flow shown in fig. 4, the method for processing the configuration file may specifically include the following steps:
step S210: the method comprises the steps of obtaining the heat degree of a target application when an obtaining request sent by a terminal device is received, wherein the obtaining request is used for obtaining a hot spot code of the target application.
In the embodiment of the present application, step S210 may refer to the contents of the foregoing embodiments, which are not described herein again.
Step S220: and determining the heat range to which the heat belongs.
In this embodiment of the application, when the server determines the target configuration file for pushing from the plurality of configuration files corresponding to the target application according to the heat degree of the target application, the server may determine the target configuration file according to the heat degree range to which the heat degree belongs.
In some implementations, the popularity can be a ranking of the download size of the application. The specific heat range can be divided according to the ranking of the downloading amount. For example, the first N names are in a hot range, the (N + 1) th to M (M + 1) th names are in a hot range, and the ranking after the M +1 is taken as a hot range, wherein M and N are positive integers, and M is greater than N. Of course, the specific manner of dividing the ranking may not be limiting.
In some embodiments, the popularity may be the download volume of the application. The specific heat range may be divided directly according to the download amount, for example, the download amount higher than the first threshold is a heat range, the download amount between the first threshold and the second threshold is a heat range, and the download amount between the second threshold and the third threshold is a heat range. Of course, the specific manner of dividing the download amount may not be limited.
Step S230: and acquiring at least one configuration file corresponding to the heat range from a plurality of configuration files corresponding to the target application as a target configuration file.
In the embodiment of the present application, the heat degrees in the same heat degree range correspond to the same configuration file, and the sizes of the configuration files corresponding to different heat degree ranges are different. In addition, the larger the hot range, the larger the size of the corresponding profile. The sizes of the target configuration files needing to be pushed are distinguished through the heat range, and when the heat of the application is smaller than a certain value, the sizes of the pushed target configuration files are correspondingly reduced, so that the waste of storage space is avoided.
In some embodiments, the size of the hotspot code in each of the multiple configuration files of the target application is different, and the server may obtain a target number of configuration files from the multiple configuration files as the target configuration file, where the target number corresponds to the heat range.
Further, the configuration file corresponding to the heat range in the plurality of configuration files is a combination of the plurality of configuration files, and when there are a plurality of combinations, the server may further determine, from the plurality of combinations, a combination with a relatively high use frequency of the hot spot codes of the configuration files according to the use frequency of the hot spot codes in the configuration files of the plurality of combinations, as the target configuration file, that is, the use frequency of the hot spot codes in the selected combination is higher than the use frequency of the hot spot codes in other combinations. Wherein the frequency of use can be obtained by the server from other terminal devices installed with the target application. Therefore, the size of the pushed configuration file can be ensured to correspond to the heat range, and the pushed configuration file can better meet the requirements of users.
In some embodiments, the obtaining, by the server, at least one profile corresponding to the heat range from a plurality of profiles corresponding to the target application may include:
when the heat range to which the heat belongs is a first heat range, acquiring a first configuration file and a second configuration file from the plurality of configuration files as the target configuration file, wherein the plurality of configuration files are generated in advance according to the hot spot code of the target application, and the size of each configuration file in the plurality of configuration files is different; when the heat range to which the heat belongs is a second heat range, acquiring a third configuration file and the first configuration file from the plurality of configuration files as the target configuration file, wherein the size of the third configuration file is smaller than that of the second configuration file, and the minimum heat in the first heat range is larger than the maximum heat in the second heat range; and when the heat range to which the heat belongs is a third heat range, acquiring the first configuration file from the plurality of configuration files as the target configuration file, wherein the minimum heat in the second heat range is greater than the maximum heat in the third heat range.
In this embodiment, the first heat range, the second heat range, and the third heat range are ranges in which the heat degree decreases in order, and for example, when the heat degree is a download amount ranking, the first heat range may be a top 50 ranking, the second heat range may be a 51-100 ranking, and the third heat range may be a 101 ranking or more ranking. It can be seen that the target configuration files corresponding to the first heat range, the second heat range and the third heat range each include the first configuration file, and the target configuration files corresponding to the first heat range and the second heat range also include other configuration files (the second configuration file or the third configuration file), because the heat of the second heat range is smaller than the heat of the first heat range, the size of the third configuration file is smaller than the size of the second configuration file, which ensures that the sizes of the target configuration files corresponding to the first heat range, the second heat range and the third heat range are sequentially reduced, and after the target configuration files are pushed to the terminal device, the heat can be smaller than a certain heat, the size of the pushed configuration files is correspondingly reduced, so that for applications with lower heat, all hot spot codes are not compiled, therefore, the waste of the storage space of the terminal equipment caused by the storage of the compiled file after the compiling is carried out can not be caused.
It should be noted that target configuration files corresponding to different hot ranges may include the same hot spot code, or may not include the same hot spot code, that is, the hot spot codes in the target configuration files corresponding to different hot ranges are different from each other.
Step S240: and sending the target configuration file to the terminal equipment, wherein the target configuration file is used for indicating the terminal equipment to pre-compile the hot spot codes in the target configuration file.
In the embodiment of the application, after the server receiving the acquisition request acquires the target configuration file, the server may send the target configuration file to the terminal device, so that the terminal device sending the acquisition request can acquire the target configuration file, compile the hotspot code in the target configuration file, and store the compiled file generated by compiling.
In some embodiments, when at least two profiles are included in the target profile, the at least two profiles are used for instructing the terminal device to perform staged precompilation on the hotspot codes in the at least two profiles; when the target configuration file comprises a configuration file, the target configuration file is used for indicating the terminal equipment to perform one-time pre-compiling on the hot spot codes in the target configuration file. It can be understood that when the target configuration file includes at least two configuration files, the compiling time may be long, if the application is installed, the compiling may be performed, and the installation time may be long, and by compiling in stages, the installation time may be avoided from being long; if the terminal device is in a state capable of being compiled (an idle state and a charging state), compiling is performed, and hot spot codes in at least two configuration files are compiled once, which may cause that when the compiling time is too long and the compiling is not completed, the terminal device is in a state incapable of being compiled, so that the compiling fails, and when the compiling is satisfied again next time, the hot spot codes in at least two configuration files are compiled again, and the problem can be solved well by staged compiling.
In some embodiments, the obtaining request may also be used to obtain the installation package of the target application, that is, the obtaining request is used to obtain the installation package of the target application and the hotspot code at the same time. The server can also send the installation package to the terminal device. When the target configuration file comprises at least two configuration files, the hot spot code of one configuration file can be compiled when the target application is installed according to the installation package, and the hot spot codes of other configuration files are compiled when the terminal equipment is in a state capable of being compiled after the installation is finished.
As a specific implementation manner, in the above manner that the server determines the target configuration file according to whether the heat range is in the first heat range, the second heat range, or the third heat range, the hot spot code in the first configuration file at least includes the boot code, and the size of the second configuration file is larger than the size of the first configuration file. The method for processing the configuration file can further comprise the following steps: and sending the installation package of the target application to the terminal equipment. In this embodiment, the first configuration file is used to instruct the terminal device to perform pre-compilation on the boot code in the first configuration file while installing the target application according to the installation package; the second configuration file and the third configuration file are used for indicating the terminal device to perform pre-compiling on the hotspot codes in the second configuration file or the third configuration file after the target application is installed. By the mode, when the terminal equipment downloads the application, the server can simultaneously push the installation package and the target configuration file, the start codes are compiled when the application is installed, hot spot codes in the rest configuration files are compiled after the installation, and the problem that the installation time is long due to the fact that all hot spot codes in the pushed target configuration files are compiled when the hot spot codes are installed can be effectively solved.
According to the method for processing the configuration files, when an acquisition request sent by the terminal device is received, the server acquires the heat of the target application, the acquisition request is used for acquiring the hot spot codes of the target application, the heat range of the target application is determined according to the heat, at least one configuration file corresponding to the heat range in a plurality of configuration files corresponding to the target application is determined to serve as the target configuration file, the plurality of configuration files are generated according to the hot spot codes of the target application in advance, the size of each configuration file in the plurality of configuration files is different, the target configuration file is sent to the terminal device, and the target configuration file is used for indicating the terminal device to pre-compile the hot spot codes in the target configuration file. The size of the target configuration file pushed to the terminal device corresponds to the heat degree, so that the situation that the configuration file pushed is large due to the fact that the configuration file corresponding to all hot spot codes of the target application is pushed is avoided, but when the heat degree of the application is low, the terminal device stores the compiled file obtained by compiling all the hot spot codes in the configuration file, and then the storage space of the terminal device is wasted is avoided.
Referring to fig. 5, fig. 5 is a flowchart illustrating a method for processing a configuration file according to another embodiment of the present application. The processing method of the configuration file is applied to the server in the processing system of the configuration file. As will be described in detail with respect to the flow shown in fig. 5, the method for processing the configuration file may specifically include the following steps:
step S310: and acquiring the hot spot code of the target application.
In the embodiment of the application, a mode of generating a plurality of configuration files in advance according to the hot spot codes of the target application is further provided. First, the server may obtain a hotspot code for the target application.
In some embodiments, the server may receive the configuration file of the target application sent by the other terminal, and store the configuration file. It is understood that the server may collect the configuration file of the target application from other terminals and store the configuration file of the target application. Specifically, the server may integrate the configuration files from the plurality of terminal devices to obtain the integrated configuration file, so that the hotspot codes in the pushed configuration file are more accurate during subsequent pushing. The server may be a server for processing the acquisition request, or may be another server for storing a configuration file, which is not limited herein. After the server obtains the configuration file of the target application, the hotspot code of the target application can be obtained from the configuration file.
Step S320: and generating a plurality of configuration files according to the functions of the hot spot codes in the hot spot codes, wherein the number of the functions realized by the hot spot codes in each configuration file is different, and the sizes of the hot spot codes in each configuration file are different.
In this embodiment of the application, the server may generate a plurality of configuration files according to the functions of the hotspot codes in the hotspot codes, where the number of functions implemented by the hotspot codes in each configuration file is different, and the size of the hotspot codes in each configuration file is different. Therefore, when the target configuration file is determined from the plurality of configuration files subsequently, the target configuration file can be determined according to the functions realized by the hotspot codes so as to fit the requirements of users.
In some embodiments, the generating, by the server, a plurality of configuration files according to the function of the hot spot code in the hot spot code may include: separating a plurality of hot spot codes from the hot spot codes according to the functions of the hot spot codes in the hot spot codes, wherein the functions of each hot spot code are different; acquiring a first part of hot spot codes, a second part of hot spot codes and a third part of hot spot codes from the plurality of hot spot codes, wherein the first part of hot spot codes comprise hot spot codes for realizing a starting function, the first part of hot spot codes comprise hot spot codes for realizing the starting function, the number of the hot spot codes in the second part of hot spot codes is more than that of the hot spot codes in the third part of hot spot codes, and the size of the second part of hot spot codes is larger than that of the third part of hot spot codes; and generating a configuration file according to the hot spot codes of the first part, the second part and the third part respectively.
In this embodiment, the server generates the configuration file according to the hotspot code of the first portion, the hotspot code of the second portion, and the hotspot code of the third portion, respectively, and may obtain three configuration files, where one configuration file includes the hotspot code of the first portion, one configuration file includes the hotspot code of the second portion, and one configuration file includes the hotspot code of the third portion, and since the boot code is used to implement the boot function and its size is usually smaller than the hotspot code used to implement other functions, the sizes of the hotspot code of the second portion and the hotspot code of the third portion may be larger than the size of the hotspot code of the first portion, and the size of the hotspot code of the second portion is larger than the size of the hotspot code of the third portion, so that the sizes of the generated three configuration files are different from each other, that is, the size, the length, and the length of the configuration file corresponding to the hotspot code of the second, The size of the configuration file corresponding to the hot spot code of the third part and the size of the configuration file corresponding to the hot spot code of the first part are sequentially decreased progressively.
In addition, as the number of the hot spot codes in the hot spot code of the second part is greater than that of the hot spot codes in the hot spot code of the third part, the functions which can be realized by the hot spot codes in the hot spot code of the second part are redundant to the functions which can be realized by the hot spot codes in the hot spot code of the third part. Therefore, when pushing is carried out, not only can configuration files with different sizes be selected according to the heat degree, but also the configuration files corresponding to the hot spot codes with different numbers of functions realized by pushing can be realized.
In a specific embodiment, neither the hot spot code of the second portion nor the hot spot code of the third portion may include the hot spot code of the first portion, and the hot spot code of the second portion may include the hot spot code of the third portion. For example, a second portion of hot spot code may be used to implement most of the functionality of the target application (except for the start-up functionality), and a third portion of hot spot code may be used to implement the basic functionality of the target application. In this way, by generating a plurality of configuration files with different sizes according to the function of the hotspot code, the server can push the configuration files with different sizes according to the popularity of the target application when determining the target configuration file.
Step S330: the method comprises the steps of obtaining the heat degree of a target application when an obtaining request sent by a terminal device is received, wherein the obtaining request is used for obtaining a hot spot code of the target application.
In the embodiment of the present application, step S330 may refer to the contents of the foregoing embodiments, and is not described herein again.
Step S340: and determining at least one configuration file in a plurality of configuration files corresponding to the target application as a target configuration file according to the heat degree, wherein the plurality of configuration files are generated in advance according to the hot spot code of the target application, and the size of each configuration file in the plurality of configuration files is different.
In this embodiment of the application, the number of functions implemented by the hotspot codes of different configuration files is also different, so that when the server pushes configuration files of different sizes, the number of functions implemented by the hotspot codes in the pushed configuration files can also correspond to the size of the configuration files, that is, the larger the size of the configuration files is, the larger the number of functions implemented by the hotspot codes in the configuration files is.
In some embodiments, when the server determines at least one of the multiple configuration files corresponding to the target application according to the heat degree of the target application, if the multiple configuration files of the target application are generated according to the hot spot code of the first part, the hot spot code of the second part, and the hot spot code of the third part in the above embodiments, the server may select one or at least two configuration files from the three configuration files as the target configuration file.
As an implementation, this implementation may be combined with the implementation of the previous embodiment, where the implementation of the previous embodiment is: the heat range to which the heat belongs is in a first heat range, and the target configuration files are a first configuration file and a second configuration file; the heat range to which the heat belongs is in a second heat range, and the target configuration files are a first configuration file and a third configuration file; the heat range to which the heat belongs is in a third heat range, and the target configuration file is the first configuration file. The first configuration file may be a configuration file corresponding to the hot spot code of the first part, the second configuration file may be a configuration file corresponding to the hot spot code of the second part, and the third configuration file is a configuration file corresponding to the hot spot code of the third part.
For example, when the download amount of the application is 50 th of the top rank (that is, the hot range is the first hot range), the server may push a configuration file corresponding to the boot code and a configuration file corresponding to the hot spot code of most functions; when the application download amount is in the ranking range of 51-100 (namely the hot degree range is the second hot degree range), the server can push a configuration file corresponding to the start code and a configuration file corresponding to the hot spot code of most functions; when the download amount of the application is in a ranking above 100 (i.e., the hot range is the third hot range), the server may push a configuration file corresponding to the boot code and a configuration file corresponding to the hot spot code of the basic function.
Step S350: and sending the target configuration file to the terminal equipment, wherein the target configuration file is used for indicating the terminal equipment to pre-compile the hot spot codes in the target configuration file.
In the embodiment of the present application, the step S350 may refer to the contents of the foregoing embodiments, and is not described herein again.
According to the method for processing the configuration file, the hot spot code of the target application is obtained, the plurality of configuration files are generated according to the function in the hot spot code of the target application, and the function and the size of the hot spot code in different configuration files are different. Therefore, the server can push configuration files with different sizes to the terminal equipment according to the heat degree of the target application, and the number of functions realized by the hot spot codes in the pushed configuration files can correspond to the size of the hot spot codes, namely, the larger the size of the configuration files is, the more the number of the functions realized by the hot spot codes in the configuration files is, the requirements of users can be met, and the user experience is improved.
Referring to fig. 6, fig. 6 is a flowchart illustrating a method for processing a configuration file according to still another embodiment of the present application. The method for processing the configuration file is applied to the terminal device in the system for processing the configuration file, and will be described in detail with reference to the flow shown in fig. 6, where the method for processing the configuration file may specifically include the following steps:
step S410: and sending an acquisition request to a server, wherein the acquisition request is used for acquiring the hotspot code of the target application.
Step S420: receiving a target configuration file issued by the server, wherein the target configuration file is determined by the server from a plurality of configuration files corresponding to the target application according to the heat degree of the target application, the plurality of configuration files are generated in advance according to the hot spot code of the target application, and the size of each configuration file in the plurality of configuration files is different.
In this embodiment, step S410 and step S420 correspond to the content of the interaction between the server and the terminal device in the foregoing embodiment, and are not described herein again.
Step S430: and pre-compiling the hot spot codes in the target configuration file, and storing the compiled file obtained after pre-compiling.
In the embodiment of the application, after receiving the target configuration file pushed by the server, the target configuration file includes the hot spot codes with corresponding sizes, and the terminal device can perform pre-compiling on the hot spot codes therein and store the compiled file obtained by the pre-compiling. The file in the compiled file is a binary machine code, so that when the terminal device runs the hot spot code in the target configuration file, the binary machine code in the compiled file can be directly executed, and the efficiency of running the target application is improved. In addition, the size of the target configuration file obtained by the terminal device corresponds to the heat degree, so that the situation that the configuration file which is pushed to be larger due to pushing of the configuration files corresponding to all the hot spot codes of the target application is avoided, but when the heat degree of the application is lower, the waste of the storage space of the terminal device is caused after the terminal device stores the compiled file which is compiled of all the hot spot codes in the configuration file.
Referring to fig. 7, fig. 7 is a flowchart illustrating a method for processing a configuration file according to yet another embodiment of the present application. The method for processing the configuration file is applied to the terminal device in the system for processing the configuration file, and will be described in detail with reference to the flow shown in fig. 7, where the method for processing the configuration file may specifically include the following steps:
step S510: and sending an acquisition request to a server, wherein the acquisition request is used for acquiring the hotspot code of the target application.
Step S520: receiving a target configuration file issued by the server, wherein the target configuration file is determined by the server from a plurality of configuration files corresponding to the target application according to the heat degree of the target application, the plurality of configuration files are generated in advance according to the hot spot code of the target application, and the size of each configuration file in the plurality of configuration files is different.
In the embodiment of the present application, step S510 and step S520 may refer to the contents of the foregoing embodiments, and are not described herein again.
Step S530: when the target configuration file comprises at least two configuration files, hot spot codes in the at least two configuration files are precompiled in stages, and a compiled file obtained after precompiling is stored.
In the embodiment of the application, the target configuration file pushed by the server to the terminal device may include at least two configuration files, so that when the target configuration file includes at least two configuration files, the compiling time may be longer, if the application is installed, the installing time may be longer, and by compiling in stages, the installing time may be prevented from being too long; if the terminal device is in a state capable of being compiled (an idle state and a charging state), compiling is performed, and hot spot codes in at least two configuration files are compiled once, which may cause that when the compiling time is too long and the compiling is not completed, the terminal device is in a state incapable of being compiled, so that the compiling fails, and when the compiling is satisfied again next time, the hot spot codes in at least two configuration files are compiled again, and the problem can be solved well by staged compiling.
In some embodiments, the obtaining request is further used to obtain an installation package of the target application, the server may further send the installation package to the terminal device, and correspondingly, the terminal device may further receive the installation package of the target application sent by the server. When the target configuration file comprises at least two configuration files, the hot spot code of one configuration file can be compiled when the target application is installed according to the installation package, and the hot spot codes of other configuration files are compiled when the terminal equipment is in a state capable of being compiled after the installation is finished.
In one specific embodiment, the target configuration file includes a first target configuration file and a second target configuration file. The hot spot codes in the first target configuration file include a start code, and the size of the second target configuration file is larger than that of the first target configuration file, at this time, the pre-compiling the hot spot codes in at least two configuration files by the terminal device in stages may include: the method comprises the steps that when a target application is installed according to an installation package, a start code in a first target configuration file is pre-compiled; and after the target application is installed, pre-compiling the hot spot codes in the second target configuration file. Therefore, after the terminal equipment downloads the application and installs the application, only the starting code can be compiled, and other hot spot codes are compiled after the compiling is completed, so that the problem that the installation time is long due to the fact that all hot spot codes in the pushed target configuration file are compiled during installation can be effectively solved.
Further, after the target application is installed, when the terminal device meets a specified state, the hotspot code in the second target configuration file is pre-compiled. The specified state may refer to a state in which the terminal device may pre-compile the hotspot code, and the specified state may be a state in which the terminal device is idle and charged, for example, in a charging state of the terminal device, after the screen is turned off for a certain time, the specified state may be satisfied.
Step S540: when the target configuration file comprises a configuration file, performing one-time pre-compiling on the hot spot codes in the target configuration file, and storing a compiled file obtained after the pre-compiling.
In this embodiment of the application, when the target configuration file pushed by the server only includes one configuration file, the terminal device may perform pre-compiling on the hotspot code in the configuration file at one time. For example, if the terminal device obtains the target configuration file when downloading the target application, the boot code in the configuration file may be pre-compiled when installing the target application, and the compiled file generated by compiling may be stored.
According to the method for processing the configuration files, the request for acquiring the hot spot codes is sent to the server, then the target configuration files returned by the server are received, when the target configuration files comprise at least two configuration files, the hot spot codes in the at least two configuration files can be precompiled in stages, and the problem of long installation time or the problem of repeated compilation caused by compiling failure can be effectively avoided.
Referring to fig. 8, a block diagram of a device 400 for processing a configuration file according to an embodiment of the present application is shown. The processing means 400 of the profile applies the server in the processing of the profile. The configuration file processing apparatus 400 includes: a request receiving module 410, a file obtaining module 420 and a file sending module 430. The request receiving module 410 is configured to, when receiving an obtaining request sent by a terminal device, obtain a hot spot code of a target application; the file obtaining module 420 is configured to determine, according to the heat degree, at least one configuration file of a plurality of configuration files corresponding to the target application, as a target configuration file, where the plurality of configuration files are generated in advance according to a hotspot code of the target application, and each configuration file of the plurality of configuration files has a different size; the file sending module 430 is configured to send the target configuration file to the terminal device, where the target configuration file is used to instruct the terminal device to pre-compile the hotspot code in the target configuration file.
In some embodiments, when at least two profiles are included in the target profile, the at least two profiles are used to instruct the terminal device to perform staged precompilation on hotspot codes in the at least two profiles; and when the target configuration file comprises a configuration file, the target configuration file is used for indicating the terminal equipment to perform one-time pre-compiling on the hot spot codes in the target configuration file.
In some embodiments, the file acquisition module 420 may include: a first obtaining unit, configured to obtain, when a heat range to which the heat belongs is a first heat range, a first configuration file and a second configuration file from the plurality of configuration files as the target configuration file; a second obtaining unit, configured to obtain, as the target configuration file, a third configuration file and the first configuration file from the plurality of configuration files when a heat range to which the heat belongs is a second heat range, where a size of the third configuration file is smaller than a size of the second configuration file, and a minimum heat in the first heat range is greater than a maximum heat in the second heat range.
In this embodiment, the file obtaining module 420 may further include a third obtaining unit, configured to obtain the first profile from the plurality of profiles as the target profile when the heat range to which the heat belongs is a third heat range, where a minimum heat in the second heat range is greater than a maximum heat in the third heat range.
Further, the obtaining request is further used for obtaining the installation package of the target application, the hotspot code in the first configuration file at least comprises a start code, and the size of the second configuration file is larger than that of the first configuration file. The file sending module 430 may be further configured to send the installation package of the target application to the terminal device. At this time, the first configuration file is used for instructing the terminal device to perform pre-compiling on the start code in the first configuration file while installing the target application according to the installation package; the second configuration file and the third configuration file are used for indicating the terminal device to perform pre-compiling on the hotspot codes in the second configuration file or the third configuration file after the target application is installed.
In some embodiments, the processing device 400 of the configuration file may further include: the device comprises a code acquisition module and a file generation module. The code acquisition module is used for acquiring a hot spot code of the target application; the file generation module is used for generating a plurality of configuration files according to the functions of the hot spot codes in the hot spot codes, the number of the functions realized by the hot spot codes in each configuration file is different, and the sizes of the hot spot codes in each configuration file are different.
Further, the code obtaining module may include: the code separation unit is used for separating a plurality of hot spot codes from the hot spot codes according to the functions of the hot spot codes in the hot spot codes, wherein the functions of each hot spot code are different; a code determination unit, configured to determine a hot spot code of a third portion, where the hot spot code of the first portion includes a hot spot code for implementing a boot function, a number of the hot spot codes in the hot spot code of the second portion is greater than a number of the hot spot codes in the hot spot code of the third portion, and a size of the hot spot code of the second portion is greater than a size of the hot spot code of the third portion; and the generating and executing unit is used for generating a configuration file according to the hot spot codes of the first part, the second part and the third part respectively.
Referring to fig. 9, a block diagram of a device 500 for processing a configuration file according to another embodiment of the present application is shown. The processing means 500 of the configuration file applies the terminal device in the above-mentioned processing of the configuration file. The device 500 for processing the configuration file comprises: a request sending module 510, a file receiving module 520, and a code compiling module 530. The request sending module 510 is configured to send an obtaining request to a server, where the obtaining request is used to obtain a hotspot code of a target application; the file receiving module 520 is configured to receive a target configuration file issued by the server, where the target configuration file is determined by the server according to the heat of the target application from a plurality of configuration files corresponding to the target application, the plurality of configuration files are generated in advance according to a hot spot code of the target application, and each of the plurality of configuration files has a different size; the code compiling module 530 is configured to perform pre-compiling on the hot spot codes in the target configuration file, and store a compiled file obtained after the pre-compiling.
In some embodiments, the code compiling module 530 may include: the first compiling unit is used for pre-compiling the hot spot codes in at least two configuration files in stages when the target configuration files comprise at least two configuration files; and the second compiling unit is used for performing one-time pre-compiling on the hot spot codes in the target configuration file when the target configuration file comprises one configuration file.
In some embodiments, the obtaining request is further configured to obtain an installation package of the target application, where the target configuration file includes a first target configuration file and a second target configuration file, a hotspot code in the first target configuration file includes a start code, and a size of the second target configuration file is larger than a size of the first target configuration file.
In this manner, the apparatus 500 for processing configuration files may further include: and the installation package receiving module is used for receiving the installation package of the target application sent by the server. The code compiling module 430 may include: the third compiling unit is used for pre-compiling the starting code in the first target configuration file while installing the target application according to the installation package; and the fourth compiling unit is used for pre-compiling the hot spot codes in the second target configuration file after the target application is installed.
Further, the fourth compiling unit may be specifically configured to: after the target application is installed, when the terminal device meets the specified state, the hot spot codes in the second target configuration file are pre-compiled.
It can be clearly understood by those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described apparatuses and modules may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the several embodiments provided in the present application, the coupling between the modules may be electrical, mechanical or other type of coupling.
In addition, functional modules in the embodiments of the present application may be integrated into one processing module, or each of the modules may exist alone physically, or two or more modules are integrated into one module. The integrated module can be realized in a hardware mode, and can also be realized in a software functional module mode.
The embodiment of the application also provides a processing system of the configuration file, which comprises the terminal equipment and the server. The server is communicatively connected to the terminal device, for example, referring again to fig. 1, the server may be the first server 200. The terminal equipment is used for sending an acquisition request to a server, wherein the acquisition request is used for acquiring a hotspot code of a target application; the server is used for receiving the acquisition request, acquiring the heat of the target application when receiving the acquisition request sent by the terminal equipment, determining at least one configuration file in a plurality of configuration files corresponding to the target application as a target configuration file according to the heat, wherein the plurality of configuration files are generated in advance according to a hot spot code of the target application, and the size of each configuration file in the plurality of configuration files is different; the server is also used for sending the target configuration file to the terminal equipment; the terminal device is further configured to receive the target configuration file, perform pre-compilation on the hotspot codes in the target configuration file, and store the compiled file obtained after the pre-compilation.
To sum up, according to the scheme provided by the application, when receiving an acquisition request sent by a terminal device, a server acquires a heat of a target application, where the acquisition request is used to acquire a hotspot code of the target application, and then determines, according to the heat, at least one of a plurality of configuration files corresponding to the target application as a target configuration file, where the plurality of configuration files are generated in advance according to the hotspot code of the target application, and each of the plurality of configuration files has a different size, and sends the target configuration file to the terminal device, where the target configuration file is used to instruct the terminal device to pre-compile the hotspot code in the target configuration file. Therefore, when the server pushes the configuration file of the application to the terminal equipment, the size of the pushed configuration file is determined by the heat of the application, and the waste of the storage space of the terminal equipment caused by the fact that the pushed configuration file is large and the heat of the application is small is avoided.
Referring to fig. 10, a block diagram of a terminal device according to an embodiment of the present application is shown. The terminal device 100 may be an electronic device capable of running an application, such as a smart phone, a tablet computer, or a smart watch. The terminal device 100 in the present application may include one or more of the following components: a processor 110, a memory 120, and one or more applications, wherein the one or more applications may be stored in the memory 120 and configured to be executed by the one or more processors 110, the one or more programs configured to perform a method as described in the aforementioned method embodiments.
Processor 110 may include one or more processing cores. The processor 110 connects various parts within the entire terminal device 100 using various interfaces and lines, and performs various functions of the terminal device 100 and processes data by executing or executing instructions, programs, code sets, or instruction sets stored in the memory 120 and calling data stored in the memory 120. Alternatively, the processor 110 may be implemented in hardware using at least one of Digital Signal Processing (DSP), Field-Programmable Gate Array (FPGA), and Programmable Logic Array (PLA). The processor 110 may integrate one or more of a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), a modem, and the like. Wherein, the CPU mainly processes an operating system, a user interface, an application program and the like; the GPU is used for rendering and drawing display content; the modem is used to handle wireless communications. It is understood that the modem may not be integrated into the processor 110, but may be implemented by a communication chip.
The Memory 120 may include a Random Access Memory (RAM) or a Read-Only Memory (Read-Only Memory). The memory 120 may be used to store instructions, programs, code sets, or instruction sets. The memory 120 may include a stored program area and a stored data area, wherein the stored program area may store instructions for implementing an operating system, instructions for implementing at least one function (such as a touch function, a sound playing function, an image playing function, etc.), instructions for implementing various method embodiments described below, and the like. The storage data area may also store data created by the terminal 100 in use, such as a phonebook, audio-video data, chat log data, and the like.
Referring to fig. 11, a block diagram of a server according to an embodiment of the present disclosure is shown. The server 600 may be a conventional server, a cloud server, or the like. The server 600 in the present application may include one or more of the following components: a processor 610, a memory 620, and one or more applications, wherein the one or more applications may be stored in the memory 620 and configured to be executed by the one or more processors 610, the one or more programs configured to perform the methods as described in the aforementioned method embodiments.
The processor 610 may include one or more processing cores. The processor 610, using various interfaces and lines to connect various parts throughout the server 600, performs various functions of the server 600 and processes data by executing or executing instructions, programs, code sets, or instruction sets stored in the memory 620 and invoking data stored in the memory 620. Alternatively, the processor 610 may be implemented in hardware using at least one of Digital Signal Processing (DSP), Field-Programmable Gate Array (FPGA), and Programmable Logic Array (PLA). The processor 610 may integrate one or more of a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), a modem, and the like. Wherein, the CPU mainly processes an operating system, a user interface, an application program and the like; the GPU is used for rendering and drawing display content; the modem is used to handle wireless communications. It is understood that the modem may not be integrated into the processor 610, but may be implemented by a communication chip.
The Memory 620 may include a Random Access Memory (RAM) or a Read-Only Memory (Read-Only Memory). The memory 620 may be used to store instructions, programs, code sets, or instruction sets. The memory 620 may include a stored program area and a stored data area, wherein the stored program area may store instructions for implementing an operating system, instructions for implementing at least one function (such as a touch function, a sound playing function, an image playing function, etc.), instructions for implementing various method embodiments described below, and the like. The storage data area may also store data created by the server 600 in use, and the like.
Referring to fig. 12, a block diagram of a computer-readable storage medium according to an embodiment of the present application is shown. The computer-readable medium 800 has stored therein a program code that can be called by a processor to execute the method described in the above-described method embodiments.
The computer-readable storage medium 800 may be an electronic memory such as a flash memory, an EEPROM (electrically erasable programmable read only memory), an EPROM, a hard disk, or a ROM. Alternatively, the computer-readable storage medium 800 includes a non-volatile computer-readable storage medium. The computer readable storage medium 800 has storage space for program code 810 to perform any of the method steps of the method described above. The program code can be read from or written to one or more computer program products. The program code 810 may be compressed, for example, in a suitable form.
Finally, it should be noted that: the above embodiments are only used to illustrate the technical solutions of the present application, and not to limit the same; although the present application has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications and substitutions do not necessarily depart from the spirit and scope of the corresponding technical solutions in the embodiments of the present application.
Claims (17)
1. A method for processing a configuration file is applied to a server, and comprises the following steps:
the method comprises the steps of obtaining the heat degree of a target application when an obtaining request sent by terminal equipment is received, wherein the obtaining request is used for obtaining a hot spot code of the target application;
determining at least one configuration file in a plurality of configuration files corresponding to the target application as a target configuration file according to the heat degree, wherein the plurality of configuration files are generated in advance according to a hot spot code of the target application, and the size of each configuration file in the plurality of configuration files is different;
and sending the target configuration file to the terminal equipment, wherein the target configuration file is used for indicating the terminal equipment to pre-compile the hot spot codes in the target configuration file.
2. The method according to claim 1, wherein when at least two profiles are included in the target profile, the at least two profiles are used for instructing the terminal device to perform staged precompilation of hotspot codes in the at least two profiles;
and when the target configuration file comprises a configuration file, the target configuration file is used for indicating the terminal equipment to perform one-time pre-compiling on the hot spot codes in the target configuration file.
3. The method of claim 1, wherein determining a target profile of the plurality of profiles corresponding to the target application according to the heat comprises:
when the heat range to which the heat belongs is a first heat range, acquiring a first configuration file and a second configuration file from the plurality of configuration files as the target configuration file;
when the heat range to which the heat belongs is a second heat range, a third configuration file and the first configuration file are obtained from the plurality of configuration files and are used as the target configuration file, the size of the third configuration file is smaller than that of the second configuration file, and the minimum heat in the first heat range is larger than the maximum heat in the second heat range.
4. The method according to claim 3, wherein determining at least one of a plurality of profiles corresponding to the target application as a target profile according to the heat degree further comprises:
and when the heat range to which the heat belongs is a third heat range, acquiring the first configuration file from the plurality of configuration files as the target configuration file, wherein the minimum heat in the second heat range is greater than the maximum heat in the third heat range.
5. The method of claim 3, wherein the obtaining request is further used for obtaining an installation package of the target application, the hotspot code in the first configuration file at least comprises a boot code, and the size of the second configuration file is larger than that of the first configuration file, and the method further comprises:
sending the installation package of the target application to the terminal equipment, wherein the first configuration file is used for indicating the terminal equipment to pre-compile a starting code in the first configuration file while installing the target application according to the installation package;
the second configuration file and the third configuration file are used for indicating the terminal device to perform pre-compiling on the hotspot codes in the second configuration file or the third configuration file after the target application is installed.
6. The method according to any of claims 1-5, wherein prior to said determining a target profile of a plurality of profiles corresponding to the target application based on the heat, the method further comprises:
acquiring a hot spot code of the target application;
and generating a plurality of configuration files according to the functions of the hot spot codes in the hot spot codes, wherein the number of the functions realized by the hot spot codes in each configuration file is different, and the sizes of the hot spot codes in each configuration file are different.
7. The method of claim 6, wherein generating a plurality of configuration files according to the function of the hot spot code in the hot spot code comprises:
separating a plurality of hot spot codes from the hot spot codes according to the functions of the hot spot codes in the hot spot codes, wherein the functions of each hot spot code are different;
acquiring a first part of hot spot codes, a second part of hot spot codes and a third part of hot spot codes from the plurality of hot spot codes, wherein the first part of hot spot codes comprise hot spot codes for realizing a starting function, the first part of hot spot codes comprise hot spot codes for realizing the starting function, the number of the hot spot codes in the second part of hot spot codes is more than that of the hot spot codes in the third part of hot spot codes, and the size of the second part of hot spot codes is larger than that of the third part of hot spot codes;
and generating a configuration file according to the hot spot codes of the first part, the second part and the third part respectively.
8. A processing method of a configuration file is applied to a terminal device, and the method comprises the following steps:
sending an acquisition request to a server, wherein the acquisition request is used for acquiring a hotspot code of a target application;
receiving a target configuration file issued by the server, wherein the target configuration file is determined by the server from a plurality of configuration files corresponding to the target application according to the heat degree of the target application, the plurality of configuration files are generated in advance according to a hot spot code of the target application, and the size of each configuration file in the plurality of configuration files is different;
and pre-compiling the hot spot codes in the target configuration file, and storing the compiled file obtained after pre-compiling.
9. The method of claim 8, wherein pre-compiling the hot spot code in the target configuration file comprises:
when the target configuration file comprises at least two configuration files, precompiling hot spot codes in the at least two configuration files in a staged manner;
when the target configuration file comprises a configuration file, performing one-time pre-compiling on the hot spot codes in the target configuration file.
10. The method of claim 9, wherein the get request is further used to get an installation package of the target application, the target configuration file comprises a first target configuration file and a second target configuration file, the hotspot code in the first target configuration file comprises a boot code, and the size of the second target configuration file is larger than the size of the first target configuration file;
the method further comprises the following steps:
receiving an installation package of the target application sent by the server;
the pre-compiling hot spot codes in the at least two configuration files in stages comprises the following steps:
pre-compiling the boot code in the first target configuration file while installing the target application according to the installation package;
and after the target application is installed, pre-compiling the hot spot codes in the second target configuration file.
11. The method of claim 10, wherein pre-compiling the hot spot code in the second target configuration file after the installation of the target application is completed comprises:
after the target application is installed, when the terminal device meets the specified state, the hot spot codes in the second target configuration file are pre-compiled.
12. An apparatus for processing a configuration file, applied to a server, the apparatus comprising: a request receiving module, a file acquiring module and a file sending module, wherein,
the request receiving module is used for acquiring the heat degree of the target application when receiving an acquisition request sent by the terminal equipment, wherein the acquisition request is used for acquiring the hotspot code of the target application;
the file acquisition module is used for determining at least one configuration file in a plurality of configuration files corresponding to the target application as a target configuration file according to the heat degree, the plurality of configuration files are generated in advance according to the hot spot code of the target application, and the size of each configuration file in the plurality of configuration files is different;
the file sending module is used for sending the target configuration file to the terminal equipment, and the target configuration file is used for indicating the terminal equipment to pre-compile the hot spot codes in the target configuration file.
13. An apparatus for processing a configuration file, applied to a terminal device, the apparatus comprising: a request sending module, a file receiving module and a code compiling module, wherein,
the request sending module is used for sending an acquisition request to a server, wherein the acquisition request is used for acquiring a hotspot code of a target application;
the file receiving module is used for receiving a target configuration file issued by the server, the target configuration file is determined by the server from a plurality of configuration files corresponding to the target application according to the heat degree of the target application, the plurality of configuration files are generated in advance according to a hot spot code of the target application, and the size of each configuration file in the plurality of configuration files is different;
the code compiling module is used for pre-compiling the hot spot codes in the target configuration file and storing the compiled file obtained after pre-compiling.
14. A system for processing configuration files, the system comprising a server and a terminal device, the server being communicatively connected to the terminal device, wherein,
the terminal equipment is used for sending an acquisition request to the server, wherein the acquisition request is used for acquiring a hotspot code of a target application;
the server is used for receiving the acquisition request, acquiring the heat of the target application when receiving the acquisition request sent by the terminal equipment, determining at least one configuration file in a plurality of configuration files corresponding to the target application as a target configuration file according to the heat, wherein the plurality of configuration files are generated in advance according to a hot spot code of the target application, and the size of each configuration file in the plurality of configuration files is different;
the server is also used for sending the target configuration file to the terminal equipment;
the terminal device is further configured to receive the target configuration file, perform pre-compilation on the hotspot codes in the target configuration file, and store the compiled file obtained after the pre-compilation.
15. A server, comprising:
one or more processors;
a memory;
one or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the one or more processors, the one or more programs configured to perform the method of any of claims 1-7.
16. A terminal device, comprising:
one or more processors;
a memory;
one or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the one or more processors, the one or more programs configured to perform the method of any of claims 8-11.
17. A computer-readable storage medium, in which a program code is stored, which program code can be invoked by a processor to perform the method according to any of claims 1-7, or to perform the method according to any of claims 8-11.
Priority Applications (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201911312519.2A CN113010172B (en) | 2019-12-18 | 2019-12-18 | Processing method, device and system of configuration file and storage medium |
PCT/CN2020/136154 WO2021121188A1 (en) | 2019-12-18 | 2020-12-14 | Configuration file processing method, apparatus and system, and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201911312519.2A CN113010172B (en) | 2019-12-18 | 2019-12-18 | Processing method, device and system of configuration file and storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN113010172A true CN113010172A (en) | 2021-06-22 |
CN113010172B CN113010172B (en) | 2023-08-29 |
Family
ID=76382478
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201911312519.2A Active CN113010172B (en) | 2019-12-18 | 2019-12-18 | Processing method, device and system of configuration file and storage medium |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN113010172B (en) |
WO (1) | WO2021121188A1 (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113377378A (en) * | 2021-07-02 | 2021-09-10 | 北京百度网讯科技有限公司 | Processing method, device and equipment for small program and storage medium |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20150178054A1 (en) * | 2013-12-20 | 2015-06-25 | Oracle International Corporation | Executable code for constrained computing environments |
CN105843664A (en) * | 2016-04-20 | 2016-08-10 | 中国工程物理研究院计算机应用研究所 | TransCache management method based on hot degree of code in dynamic binary translation |
US9477451B1 (en) * | 2015-11-06 | 2016-10-25 | International Business Machines Corporation | Generating dynamic measurement metadata for efficient compilation and optimization on a target device |
CN106775893A (en) * | 2016-12-30 | 2017-05-31 | 北京小米移动软件有限公司 | To the method and device of program precompile |
CN110543338A (en) * | 2019-09-09 | 2019-12-06 | 北京安云世纪科技有限公司 | dynamic loading method and device for files |
Family Cites Families (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US8301868B2 (en) * | 2005-09-23 | 2012-10-30 | Intel Corporation | System to profile and optimize user software in a managed run-time environment |
CN104360858A (en) * | 2014-11-12 | 2015-02-18 | 华为技术有限公司 | Method and device for calculating hotness of application |
CN104572969A (en) * | 2014-12-31 | 2015-04-29 | 乐视致新电子科技(天津)有限公司 | Cross-application related resource information acquisition method and device |
CN107861732A (en) * | 2016-09-22 | 2018-03-30 | 法乐第(北京)网络科技有限公司 | Application program silence update method and device |
CN110162319A (en) * | 2019-04-15 | 2019-08-23 | 深圳壹账通智能科技有限公司 | Application program update method, apparatus, computer equipment and storage medium |
-
2019
- 2019-12-18 CN CN201911312519.2A patent/CN113010172B/en active Active
-
2020
- 2020-12-14 WO PCT/CN2020/136154 patent/WO2021121188A1/en active Application Filing
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20150178054A1 (en) * | 2013-12-20 | 2015-06-25 | Oracle International Corporation | Executable code for constrained computing environments |
US9477451B1 (en) * | 2015-11-06 | 2016-10-25 | International Business Machines Corporation | Generating dynamic measurement metadata for efficient compilation and optimization on a target device |
CN105843664A (en) * | 2016-04-20 | 2016-08-10 | 中国工程物理研究院计算机应用研究所 | TransCache management method based on hot degree of code in dynamic binary translation |
CN106775893A (en) * | 2016-12-30 | 2017-05-31 | 北京小米移动软件有限公司 | To the method and device of program precompile |
CN110543338A (en) * | 2019-09-09 | 2019-12-06 | 北京安云世纪科技有限公司 | dynamic loading method and device for files |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113377378A (en) * | 2021-07-02 | 2021-09-10 | 北京百度网讯科技有限公司 | Processing method, device and equipment for small program and storage medium |
Also Published As
Publication number | Publication date |
---|---|
CN113010172B (en) | 2023-08-29 |
WO2021121188A1 (en) | 2021-06-24 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN111078318B (en) | Processing method, device and system of configuration file and storage medium | |
CN111061484B (en) | Code compiling method, device, server, user terminal and readable medium | |
CN107967139B (en) | Hot updating method and device for game | |
WO2021115177A1 (en) | Application installation method and apparatus, terminal device, server and storage medium | |
CN112948026A (en) | Hotspot code processing method and device, server, electronic equipment and storage medium | |
CN104375849A (en) | Core loading method and device | |
CN111897564A (en) | Application updating method and system | |
CN110968331B (en) | Method and device for running application program | |
CN112631622A (en) | Application installation method and device, server and computer readable medium | |
WO2021135947A1 (en) | Hotspot code processing method and apparatus, electronic device and storage medium | |
CN110532016B (en) | Version management method, version updating method and version management system | |
CN116643778B (en) | Application program optimization method and electronic equipment | |
CN110888658A (en) | Dynamic method and device for functional module in application program and storage medium | |
US20150186128A1 (en) | Preventing application downgrade in an application store | |
CN111258557A (en) | Code processing method and device, electronic equipment and computer readable medium | |
CN112559088A (en) | Configuration file optimization method, device, server and storage medium | |
CN112235132A (en) | Method, device, medium and server for dynamically configuring service | |
WO2021115178A1 (en) | Application program pre-compilation method and apparatus, server and storage medium | |
CN113010172B (en) | Processing method, device and system of configuration file and storage medium | |
CN107423093B (en) | Control method and apparatus, computer apparatus, and computer-readable storage medium | |
KR101164465B1 (en) | Method and apparatus for continuation-passing in a virtual machine | |
CN113377382B (en) | Processing method and device of software installation package, electronic equipment and storage medium | |
CN111338633B (en) | Method and device for generating installation-free file and electronic equipment | |
WO2021088686A1 (en) | Compiler optimization information generating method and apparatus, and electronic device | |
CN112540768A (en) | File processing method and device, server, electronic equipment and storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |