CN112948026A - Hotspot code processing method and device, server, electronic equipment and storage medium - Google Patents

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

Info

Publication number
CN112948026A
CN112948026A CN201911176570.5A CN201911176570A CN112948026A CN 112948026 A CN112948026 A CN 112948026A CN 201911176570 A CN201911176570 A CN 201911176570A CN 112948026 A CN112948026 A CN 112948026A
Authority
CN
China
Prior art keywords
code
hot spot
configuration file
target
codes
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.)
Pending
Application number
CN201911176570.5A
Other languages
Chinese (zh)
Inventor
帅朝春
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangdong Oppo Mobile Telecommunications Corp Ltd
Original Assignee
Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangdong Oppo Mobile Telecommunications Corp Ltd filed Critical Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority to CN201911176570.5A priority Critical patent/CN112948026A/en
Publication of CN112948026A publication Critical patent/CN112948026A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/448Execution paradigms, e.g. implementations of programming paradigms
    • G06F9/4482Procedural
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44505Configuring for program initiating, e.g. using registry, configuration files
    • G06F9/4451User profiles; Roaming

Abstract

The application discloses a hotspot code processing method and device, a server, electronic equipment and a storage medium, and relates to the technical field of computers. The method comprises the following steps: the method comprises the steps of obtaining a starting code of a target application program in a starting process, obtaining a plurality of hot spot codes of the target application program in a using process, carrying out segmentation processing on the hot spot codes according to specified conditions to obtain at least two hot spot code blocks, generating a target configuration file based on the starting code and the at least two hot spot code blocks, and sending the target configuration file to a client, wherein the target configuration file is used for indicating the client to compile the starting code and the at least two hot spot code blocks in stages. According to the method and the device, the plurality of hot spot codes of the application program are segmented to obtain at least two hot spot code blocks, and the target configuration file is generated based on the starting code and the at least two hot spot code blocks, so that the installation speed of the application program is accelerated, and the performance of the application program is optimized.

Description

Hotspot code processing method and device, server, electronic equipment and storage medium
Technical Field
The present application relates to the field of computer technologies, and in particular, to a hotspot code processing method and apparatus, a server, an electronic device, and a storage medium.
Background
Electronic devices, such as tablet computers, smart terminals, etc., have become one of the most common consumer electronic products in people's daily life. Various applications are often installed in electronic devices to meet different requirements. In the use of the application program, 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. However, when the hot spot code is too much, the installation of the application program may occupy too much bandwidth and time, which may adversely affect the user.
Disclosure of Invention
In view of the above problems, the present application provides a hotspot code processing method, device, server, electronic device, and storage medium to solve the above problems.
In a first aspect, an embodiment of the present application provides a hotspot code processing method, where the method includes: acquiring a starting code of a target application program in a starting process, and acquiring a plurality of hot spot codes of the target application program in a using process; the hot spot codes are segmented according to specified conditions to obtain at least two hot spot code blocks; generating a target configuration file based on the boot code and the at least two hotspot code blocks; and issuing the target configuration file to a client, wherein the target configuration file is used for instructing the client to compile the start code and the at least two hot spot code blocks in stages.
In a second aspect, an embodiment of the present application provides a hotspot code processing method, where the method includes: receiving a target configuration file issued by a server, wherein the target configuration file is generated based on a starting code of a target application program in the starting process and at least two hot spot code blocks, and the at least two hot spot code blocks are obtained by dividing a plurality of hot spot codes of the target application program in the using process; compiling the boot code and the at least two hotspot code blocks in stages based on the target configuration file.
In a third aspect, an embodiment of the present application provides a hot spot code processing apparatus, where the code obtaining module is configured to obtain a start code of a target application program in a start process, and obtain multiple hot spot codes of the target application program in a use process; the code segmentation module is used for segmenting the plurality of hot spot codes according to specified conditions to obtain at least two hot spot code blocks; a configuration file generating module, configured to generate a target configuration file based on the boot code and the at least two hotspot code blocks; and the configuration file issuing module is used for issuing the target configuration file to a client, and the target configuration file is used for indicating the client to compile the start code and the at least two hot spot code blocks in stages.
In a fourth aspect, an embodiment of the present application provides an apparatus for processing a hotspot code, where the apparatus includes: the configuration file receiving module is used for receiving a target configuration file issued by a server, wherein the target configuration file is generated based on a starting code of a target application program in the starting process and at least two hot spot code blocks, and the at least two hot spot code blocks are obtained by dividing a plurality of hot spot codes of the target application program in the using process; and the code compiling module is used for compiling the boot code and the at least two hot spot code blocks in stages based on the target configuration file.
In a fifth aspect, embodiments of the present application provide a server, including a memory and a processor, the memory being coupled to the processor, the memory storing instructions, the processor performing the above method when the instructions are executed by the processor.
In a sixth aspect, embodiments of the present application provide an electronic device, including a memory and a processor, the memory being coupled to the processor, the memory storing instructions, the processor performing the above method when the instructions are executed by the processor.
In a seventh 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 the foregoing method.
The hot spot code processing method, the hot spot code processing device, the server, the electronic device and the storage medium provided by the embodiment of the application acquire the starting code of the target application program in the starting process, acquiring a plurality of hot spot codes of a target application program in the using process, segmenting the hot spot codes according to specified conditions to obtain at least two hot spot code blocks, generating a target configuration file based on a start code and the at least two hot spot code blocks, issuing the target configuration file to a client, wherein the target configuration file is used for instructing the client to compile the start code and the at least two hot spot code blocks in stages, therefore, the plurality of hot spot codes of the application program are divided to obtain at least two hot spot code blocks, and then the target configuration file is generated based on the starting code and the at least two hot spot code blocks, so that the installation speed of the application program is accelerated, and the performance of the application program is optimized.
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 is a schematic diagram of an application environment that can be used in the hot spot code determination method provided by the embodiment of the present application;
FIG. 2 is a schematic diagram of another application environment that can be used in the hot spot code determination method provided by the embodiment of the present application;
fig. 3 is a schematic flowchart illustrating a hot spot code determination method according to an embodiment of the present application;
fig. 4 is a flowchart illustrating a hot spot code determination method according to another embodiment of the present application;
fig. 5 is a flowchart illustrating a hot spot code determination method according to still another embodiment of the present application;
fig. 6 is a schematic flowchart illustrating a hot spot code determination method according to another embodiment of the present application;
fig. 7 shows a block diagram of a hot spot code determination apparatus according to an embodiment of the present application;
fig. 8 shows a block diagram of a hot spot code determination apparatus according to another embodiment of the present application;
fig. 9 is a block diagram illustrating a server for executing a hotspot code processing method according to an embodiment of the present application;
fig. 10 is a block diagram illustrating an electronic device for executing a hotspot code processing method according to an embodiment of the present application;
fig. 11 illustrates a storage unit, according to an embodiment of the present application, for storing or carrying program codes for implementing a hot spot code processing method 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.
The Java is run on a Java virtual machine, so that Java codes have stronger portability, and most of application degrees of the Android platform are written by using Java language, so that the Android platform has a JVM virtual machine or realizes a JVM virtual machine of the Android platform. Used before Android 5.0 was a Dalvik virtual machine that supported the running of Java applications in the dex (Dalvik executables) format. Starting from Android 5.0, ART completely replaces the original Dalvik, and becomes a new virtual machine on the Android system. ART uses Advanced (AOT) compilation and employs a JIT + AOT + interpretation execution compilation mode from the Android N version and introduces a Profile-Guide-optimization (pgo) mechanism as follows:
1. when an application program is initially installed, the system cannot perform AOT compiling on the dex file;
2. when the application program runs, codes (cold codes) which are not identified by hot spots are directly executed through a JAVA parser, and when a virtual machine finds that a certain method or code block runs particularly frequently in the execution process, the method or code block is identified as a hot code (hot code), and the hot code or code block is stored in a cache after JIT compiling, so that if the codes are encountered when the application program is started next time, the compiled codes are preferentially executed from the cache. In addition, the system also generates a configuration file (profile file) to record the information of the hot spot code (hot spot function);
3. in addition to JIT compilation, the AOT compiler may also recompile application generation using profile information when the device is idle and in a charging state.
With the PGO mechanism, the code to be compiled in an application will only be the part of java bytecode that is most frequently executed in the program, and not the code in the whole program. By the method, the running performance of the program can be improved to a large extent, the influence on the application installation speed and the extra space occupation can be reduced as much as possible, and the possible defects caused by single JIT or AOT compiling can be reduced.
However, the Dalvik virtual machine using the conventional JIT compiler has the following problems: 1. the dex file is compiled into machine code and then executed (no caching mechanism exists, and non-hot point code is executed in an interpretation operation mode), and the operation is time-consuming, so that the Dalvik virtual machine is always considered by a user as the root of slowing down the Android system speed and having a fluency difference with the IOS; 2. running an application uses more CPU resources, which also causes problems of endurance and heat generation.
The ART virtual machine using the AOT mechanism solves the problems brought by the Dalvik virtual machine, but also brings new defects: 1. the time for installing the application program and optimizing the application after upgrading the system version is long (after installing a new application program and upgrading the system, the application program needs to be pre-compiled and machine codes are generated every time), and the installation or optimization time of a single application program can even reach several minutes as the size of the application program is larger and larger; the machine code generated after the dex file is precompiled occupies extra storage space (the severity of the defect is weakened in the presence of rapidly developing mobile phone storage space and performance).
The JIT + AOT + interpretation execution mechanism is used for solving the defects brought by a single JIT or single AOT compiling mode, but the perfect mechanism also has certain limitations: 1. each time a user installs an application and uses it for the first time, the application is not optimized. Only after the user uses the application for a period of time, the system can generate profile information which accords with the use habit of the user, so that the application program is optimized, and the speed is increased. This problem is evident when the user first uses the handset. 2. The profile information of the application program can only be optimized for the application of the current version, if the version of the application program is upgraded, the system is required to collect the profile information of the application program again to optimize the program, and if the frequency of upgrading the application program is high, the time for actually optimizing the application program is greatly reduced. Because the upgrade frequency of most mainstream application programs is between 1 week and 1 month at present, the improvement of the fluency of the system by the optimization mechanism is difficult to reach an ideal level. In addition, the hot code information is recorded through the profile file, the larger the profile file is, the more hot code information is contained, the more java byte codes need to be compiled in the dex file, the more opportunities for directly executing machine codes after compiling are available, the fewer processes need to be subjected to interpretation execution and JIT compiling optimization, and the greater the application program performance is improved. However, the larger the profile hotspot file is, the longer the compiling time during installation is, the greater the influence on the installation speed is, and a certain influence is caused on the user experience.
In view of the above problems, the inventors have found and proposed a hot spot code processing method, an apparatus, a server, an electronic device, and a storage medium provided in the embodiments of the present application through long-term research, and obtain at least two hot spot code blocks by splitting a plurality of hot spot codes of an application program, and then generate a target configuration file based on a boot code and the at least two hot spot code blocks, so as to accelerate installation of the application program and optimize performance of the application program. The specific hot spot code processing method is described in detail in the following embodiments.
Referring to fig. 3, fig. 3 is a flowchart illustrating a hot spot code processing method according to an embodiment of the present application. The hot spot code processing method is used for obtaining at least two hot spot code blocks by dividing a plurality of hot spot codes of an application program, and then generating a target configuration file based on a starting code and the at least two hot spot code blocks so as to accelerate the installation speed of the application program and optimize the performance of the application program. In a specific embodiment, the hot spot code processing method is applied to the hot spot code processing apparatus 300 shown in fig. 7 and the server 100 (fig. 9) configured with the hot spot code processing apparatus 300. The specific flow of the embodiment will be described below by taking a server as an example, and it is understood that the server applied in the embodiment may be a cloud server, a traditional server, and the like, and is not limited herein. As will be described in detail with respect to the flow shown in fig. 3, the hotspot code processing method may specifically include the following steps:
step S101: the method comprises the steps of obtaining a starting code of a target application program in a starting process, and obtaining a plurality of hot spot codes of the target application program in a using process.
In this embodiment, the target application may be an application installed and used at the client, for example, when the client installs and uses the first application, the second application, and the third application, then the target application may include the first application, the second application, and the third application. The target application program generally comprises a starting code in the starting process and a function code in the using process, wherein the function code in the using process can be divided into a hot spot code and a non-hot spot code according to the using times of the function code, the using frequency of the function code, the importance degree of the function code and the like.
In some embodiments, the boot code of the target application during the boot process may be obtained, and the plurality of hot spot codes of the target application during the use process may be obtained. In one way, the server may obtain a first configuration file related to the target application program uploaded by the electronic device, and obtain a start code of the target application program during a start process and a plurality of hot spot codes of the target application program during a use process from the first configuration file. Alternatively, the server may collect a second configuration file of the target application used by the user, and obtain the start code of the target application during the start process and the plurality of hot spot codes of the target application during the use process from the second configuration file.
In some embodiments, the boot code of the target application during the boot process may include: all code related to the launching of the target application, for example, code related to a launch path of the target application, code related to a main interface Activity component (Activity) of the target application, and the like. The hot spot codes of the target application program in the using process can be acquired in one or more of the following ways: the opening times of each active component of the target application program, the jumping times of each jumping path of the target application program, the opening frequency of each active component of the target application program, the jumping frequency of each jumping path of the target application program, the importance degree of each active component of the target application program and the like. When the opening times of the active component of the target application program reach a first time threshold value, determining a code corresponding to the active component as a hot spot code; when the jumping times of the jumping path of the target application program reach the second time threshold value, determining the code corresponding to the jumping path as a hot spot code; when the opening frequency of an active component of a target application program reaches a first frequency threshold, determining a code corresponding to the active component as a hot spot code; when the jump frequency of the jump path of the target application program reaches a second frequency threshold, determining the code corresponding to the active component as a hot spot code; when the importance degree of each activity component of the target application reaches the importance degree threshold, the code corresponding to the activity component can be determined as the hot spot code.
The importance degree of each active component of the target application program can be determined by the functional description information of the target application program, for example, the functional description information of the application program can be obtained by "application information" or "application tag" of the application program. In some embodiments, a description of the target application program in the application store may be acquired, and the description of the target application program in the application store may be determined as the functional description information of the target application program. For example, the functional description information of the WeChat includes: voice, text information, pictures, etc.; a friend circle shares a life infusion; scanning; public numbers, etc. In some embodiments, after obtaining the function description information of the target application, an active component referred to by the function description information may be determined from a plurality of active components, and a code corresponding to the active component referred to by the function description information may be determined as a hotspot code. The number of the active components related to the functional description information may be one or more, and is not limited herein. For example, when the functional description information of the WeChat application includes a sweep and a friend circle sharing drip, a code corresponding to an active component involved in the sweep in the WeChat application may be determined as a hotspot code, and a code corresponding to an active component involved in the friend circle in the WeChat application may be determined as a hotspot code, and the like, which is not limited herein.
Step S102: and carrying out segmentation processing on the plurality of hot spot codes according to a specified condition to obtain at least two hot spot code blocks.
In some embodiments, the server is preset and stores a specified condition, and the specified condition is used as a division basis of the plurality of hot spot codes. Therefore, in this embodiment, after the boot code of the target application program in the boot process is acquired, and the plurality of hot spot codes of the target application program in the use process are acquired, the plurality of hot spot codes may be divided according to the specified condition, so as to obtain at least two hot spot code blocks. In this embodiment, the number of the split hot spot code blocks may be determined according to the number or size of the multiple hot spot codes, for example, when the number of the multiple hot spot codes is large, the multiple hot spot codes may be split into a large number of hot spot code blocks, and when the number of the multiple hot spot codes is small, the multiple hot spot codes may be split into a small number of hot spot code blocks. For another example, when the sizes of the plurality of hot spot codes are large, the plurality of hot spot codes may be divided into a large number of hot spot code blocks, and when the sizes of the plurality of hot spot codes are small, the plurality of hot spot codes may be divided into a small number of hot spot code blocks.
In some embodiments, the start code of the target application in the starting process may or may not be subjected to the splitting process, which is not limited herein.
Step S103: and generating a target configuration file based on the starting code and the at least two hot spot code blocks.
In some embodiments, after obtaining the boot code of the target application and the at least two hotspot code blocks of the target application, the server may generate a target configuration file based on the boot code and the at least two hotspot code blocks, where the target configuration file may include a plurality of configuration files. As one manner, the plurality of configuration files may respectively include a boot code, a first hot spot code block of the at least two hot spot code blocks, a second hot spot code block of the at least two hot spot code blocks, a third hot spot code block … … of the at least two hot spot code blocks, and an nth hot spot code block of the at least two hot spot code blocks. As another way, the plurality of profiles may include the boot code and a first hotspot code block of the at least two hotspot code blocks, a second hotspot code block of the at least two hotspot code blocks, a third hotspot code block … … of the at least two hotspot code blocks, and an nth hotspot code block of the at least two hotspot code blocks, respectively.
Step S104: and issuing the target configuration file to a client, wherein the target configuration file is used for instructing the client to compile the start code and the at least two hot spot code blocks in stages.
In some embodiments, after the server generates the target configuration file, the server may send the target configuration file to the client to instruct the client to compile the start code and the at least two hot code blocks in stages, so as to reduce the influence of the installation stage on the installation speed, and at the same time, more hot codes may be sampled to be compiled, thereby avoiding the influence of excessive sampling on the installation speed, and optimizing the performance of the application program to the maximum extent.
As a manner, the server may issue the target configuration file to the client to instruct the client to compile the start code at an installation stage of the target application program, and sequentially compile a plurality of hot spot code blocks at a background idle stage of the electronic device, which is not limited herein.
As another way, the target profile may include a startup-profile that characterizes startup and layout related hotspot code, which may include only startup code or boot code and partial hotspot code blocks, and an other-profile that characterizes the remaining profiles other than startup-profile. After the target application program is downloaded, firstly, a hotspot code startup-profile related to the starting of the target application program needs to be compiled, so that the starting speed of the application is improved, and the subsequent other profiles can be gradually compiled according to the importance degree of the other profiles, so that the performance of the application program is gradually improved.
The hot spot code processing method provided in an embodiment of the present application obtains a start code of a target application program in a start process, obtains a plurality of hot spot codes of the target application program in a use process, performs segmentation processing on the plurality of hot spot codes according to a specified condition to obtain at least two hot spot code blocks, generates a target configuration file based on the start code and the at least two hot spot code blocks, and sends the target configuration file to a client, where the target configuration file is used to instruct the client to compile the start code and the at least two hot spot code blocks in stages, so that the at least two hot spot code blocks are obtained by performing segmentation processing on the plurality of hot spot codes of the application program, and then generates the target configuration file based on the start code and the at least two hot spot code blocks, so as to accelerate an installation speed of the application program and optimize performance of the application program.
Referring to fig. 4, fig. 4 is a flowchart illustrating a hot spot code processing method according to another embodiment of the present application. The method is applied to the server, and will be described in detail with respect to the flow shown in fig. 4, where the hotspot code processing method may specifically include the following steps:
step S201: and acquiring the attribute information and the current configuration file of the target application program.
In some embodiments, after determining the target application used by the user, the attribute information and the current configuration file of the target application may be obtained. In some embodiments, the attribute information of the target application program and the configuration file (app profile) in the using process may be collected, and the collected configuration file may be used as the current configuration file corresponding to the target application program. Specifically, the target application may include a plurality of different applications, and thus, the current configuration file may include a plurality of different configuration files, one application corresponds to one configuration file, the attribute information may include a plurality of different attribute information, and one application corresponds to one attribute information. The attribute information and the current configuration file corresponding to the target application program can be collected by the client and then uploaded to the server, and correspondingly, the server can obtain the attribute information and the current configuration file corresponding to the target application program uploaded by the client. The attribute information of the target application may include a package name, a version number, and the like of the target application, which is not limited herein. The current configuration file of the target application program may record a start code identifier, a hot spot code identifier, and the like of the target application program, which is not limited herein.
In some embodiments, after acquiring the current configuration file of the target application, the server may further perform a cleaning on the current configuration file to remove incomplete configuration files and invalid configuration files in the acquired current configuration file, so as to ensure validity of the determined current configuration file.
Step S202: and extracting a code record file from the installation package corresponding to the target application program based on the attribute information, and acquiring all codes recorded in the code record file.
In some embodiments, according to the obtained attribute information of the target application, an installation package (APK) file corresponding to the target application may be obtained, a code record (dex) file is extracted from the installation package file, and all codes (methods) recorded in the code record file are found out, which may be recorded as a method set. For example, the attribute information of the target application includes a version number of the target application, and the installation package file corresponding to the version number may be obtained, and the code record file is extracted from the installation package file, and all codes of the target application of the version recorded in the code record file are found.
Step S203: and extracting the starting code identification of the target application program in the starting process from the current configuration file.
In some embodiments, after obtaining the current configuration file of the target application program, the start code identifier of the target application program in the starting process can be extracted from the current configuration file. Wherein, the numbers recorded in the current configuration file are as follows: in the form of 10021, 10022, 10023, etc., which indicate a serial number in all the codes, in this embodiment, it is necessary to find the startup _ method _ ids of each application corresponding to each configuration file in the current configuration file. A plurality of code record files (dex) exist in an application, the startup _ method _ ids correspond to each code record file, and then all codes are listed in the code record file of the application program according to the id, and the codes can be restored into specific codes.
In this embodiment, in the current configuration file, if the hot spot code used during startup is marked as startup methods, and if the non-hot spot function used during startup is marked as post startup methods, the two method ids are extracted and recorded as startup _ method _ ids, which represents the code representation related to startup, and the ids are stored in a digital form, which represents the index of each method in the method _ ids list, that is, the code record file has a method _ ids list structure storing all the related information of the method, where the index is the serial number of the corresponding method in the table. The part of the code is related to obtaining the starting-up related code and may be called startup methods, and the part of the code does not necessarily satisfy the number of execution times in the JIT (the number of execution times in the JIT reaches a default value and is recorded as the hot spot code), but is related to starting up the target application program and affects the starting-up speed of the application program, so the part of the code is also considered as the hot spot code. Thus, the start code identification of all code involved in the start-up process of the target application may be obtained.
Step S204: and extracting the starting code corresponding to the starting code identification from all the codes.
In some embodiments, after all the codes and the boot code identifications of the code record file are obtained, the boot code corresponding to the boot code identification can be extracted from all the codes to obtain a specific boot code.
Step S205: and acquiring the attribute information and the current configuration file of the target application program.
Step S206: and extracting a code record file from the installation package corresponding to the target application program based on the attribute information, and acquiring all codes recorded in the code record file.
For detailed description of steps S205 to S206, please refer to steps S201 to S202, which are not described herein again.
Step S207: and extracting a plurality of hot spot code identifications of the target application program in the using process from the current configuration file.
In some embodiments, after obtaining the current configuration file of the target application program, the hotspot code identification of the target application program in the using process can be extracted from the current configuration file. Wherein, the current configuration file records numbers, such as hot methods: 10000, 10031, 10151, etc. indicate a serial number in all codes, and in this embodiment, it is necessary to find out how _ method _ ids of each application corresponding to each configuration file in the current configuration file. A plurality of code record files (dex) exist in an application, the hot _ method _ ids correspond to each code record file, and then all codes are listed in the code record files of the application program according to the ids and can be restored into specific codes.
In this embodiment, the method id in each configuration file in the current configuration file may be extracted, and recorded as hot _ method _ ids, which indicates that all hotspot codes in the current configuration file are represented, and the id is stored in a digital form, which indicates that in each code record file, an index of each method in a method _ ids list is included, that is, a structure of the method _ ids list in the code record file stores all related information of the method, where the index is a serial number of the corresponding method in the list.
Step S208: and extracting a plurality of hot spot codes corresponding to the hot spot code identifications from all the codes, wherein the hot spot code identifications are in one-to-one correspondence with the hot spot codes.
In some embodiments, after obtaining all the codes recorded in the code record file and the plurality of hot spot code identifiers, a plurality of hot spot codes corresponding to the plurality of hot spot code identifiers may be extracted from all the codes, where the plurality of hot spot code identifiers correspond to the plurality of hot spot codes one to one, so as to obtain a specific plurality of hot spot codes.
Step S209: and acquiring the number of the plurality of hot spot codes.
In some embodiments, after obtaining the plurality of hot spot codes, the number of the plurality of hot spot codes may be obtained, the size of the plurality of hot spot codes may be obtained, and the like, which is not limited herein.
Step S210: and when the number of the plurality of hot spot codes is larger than a number threshold, carrying out segmentation processing on the plurality of hot spot codes according to the specified condition to obtain at least two hot spot code blocks.
In some embodiments, the server presets and stores a quantity threshold, and the quantity threshold is used as a judgment basis for the quantity of the plurality of hot spot codes. Therefore, in this embodiment, after the number of the plurality of hot spot codes is obtained, the number of the plurality of hot spot codes may be compared with the number threshold to determine whether the number of the plurality of hot spot codes is greater than the number threshold. When the judgment result indicates that the number of the plurality of hot spot codes is larger than the number threshold, it can be determined that the number of the plurality of hot spot codes is too large, and if the plurality of hot spot codes are not segmented, the installation speed of the target application program is affected, and the user experience is affected. When the judgment result indicates that the number of the plurality of hot spot codes is not greater than the number threshold, it can be determined that the number of the plurality of hot spot codes is normal, if the plurality of hot spot codes are not subjected to segmentation processing, the installation speed of the target application program is not influenced, and the plurality of hot spot codes are not subjected to segmentation processing.
Step S211: and generating a target configuration file based on the starting code and the at least two hot spot code blocks.
Step S212: and issuing the target configuration file to a client, wherein the target configuration file is used for instructing the client to compile the start code and the at least two hot spot code blocks in stages.
For the detailed description of steps S211 to S212, refer to steps S103 to S104, which are not described herein again.
In another embodiment of the present application, a hotspot code processing method obtains attribute information and a current configuration file of a target application program, extracts a code record file from an installation package corresponding to the target application program based on the attribute information, obtains all codes recorded in the code record file, extracts a start code identifier of the target application program in a start process from the current configuration file, and extracts a start code corresponding to the start code identifier from all codes. The method comprises the steps of obtaining attribute information and a current configuration file of a target application program, extracting a code record file from an installation package corresponding to the target application program based on the attribute information, obtaining all codes recorded in the code record file, extracting a plurality of hot spot code identifications of the target application program in the using process from the current configuration file, and extracting a plurality of hot spot codes corresponding to the hot spot code identifications from all the codes. The method comprises the steps of obtaining the number of a plurality of hot spot codes, when the number of the hot spot codes is larger than a number threshold value, carrying out segmentation processing on the hot spot codes according to specified conditions to obtain at least two hot spot code blocks, generating a target configuration file based on a starting code and the at least two hot spot code blocks, and sending the target configuration file to a client to compile the starting code and the at least two hot spot code blocks in stages. Compared with the hot spot code processing method shown in fig. 3, in the embodiment, the start code is extracted from the code record file through the start code identifier, and the hot spot codes are extracted from the code record file through the hot spot code identifiers, so that the accuracy of the obtained start code and the hot spot codes is improved.
Referring to fig. 5, fig. 5 is a schematic flowchart illustrating a hot spot code processing method according to still another embodiment of the present application. The method is applied to the server, and will be described in detail with respect to the flow shown in fig. 5, where the hotspot code processing method may specifically include the following steps:
step S301: and acquiring the attribute information and the current configuration file of the target application program.
Step S302: and extracting a code record file from the installation package corresponding to the target application program based on the attribute information, and acquiring all codes recorded in the code record file.
Step S303: and extracting the starting code identification of the target application program in the starting process from the current configuration file.
Step S304: and extracting the starting code corresponding to the starting code identification from all the codes.
Step S305: and acquiring the attribute information and the current configuration file of the target application program.
Step S306: and extracting a code record file from the installation package corresponding to the target application program based on the attribute information, and acquiring all codes recorded in the code record file.
Step S307: and extracting a plurality of hot spot code identifications of the target application program in the using process from the current configuration file.
Step S308: and extracting a plurality of hot spot codes corresponding to the hot spot code identifications from all the codes, wherein the hot spot code identifications are in one-to-one correspondence with the hot spot codes.
For detailed description of steps S301 to S308, refer to steps S201 to S208, which are not described herein again.
Step S309: and respectively acquiring a hot value corresponding to each hot spot code in the plurality of hot spot codes.
In some embodiments, after obtaining the plurality of hot spot codes, a hot value corresponding to each hot spot code in the plurality of hot spot codes may be obtained respectively. For example, if the plurality of hot spot codes include a hot spot code a, a hot spot code B, and a hot spot code C, a hot value corresponding to the hot spot code a, a hot value corresponding to the hot spot code B, and a hot value corresponding to the hot spot code C may be obtained respectively. In this embodiment, the hot value corresponding to each hot code may be determined according to the number of times of use, the degree of importance, the number of times of occurrence of the hot code, and the number of configuration files of each hot code, and the more the number of times of use of the hot code is, the higher the hot value corresponding to the hot code is; the fewer the use times of the hot spot codes are, the lower the corresponding hot value of the hot spot codes is; the higher the importance degree of the hot spot code is, the higher the corresponding hot value of the hot spot code is; the lower the importance degree of the hot spot code is, the lower the corresponding hot value of the hot spot code is; the larger the occurrence frequency of the hot spot code/the number of the configuration files is, the higher the corresponding hot value of the hot spot code is; the smaller the number of occurrence times of the hotspot codes/the number of configuration files is, the lower the corresponding hot value of the hotspot codes is.
Step S310: and based on the heat value corresponding to each hot spot code and a plurality of preset heat intervals, carrying out segmentation processing on the plurality of hot spot codes to obtain at least two hot spot code blocks, wherein one heat interval corresponds to one hot spot code block.
In some embodiments, the server is preset and stores a plurality of hot degree intervals, and the hot degree intervals are used as the basis for distinguishing the hot degree value of each hot spot code. Therefore, in this embodiment, after obtaining the hot value of each of the hot codes, the hot codes may be divided based on the hot value of each hot code and a plurality of preset hot intervals to obtain at least two hot code blocks, for example, a plurality of hot method files such as hot _ methods _01, hot _ methods _02, and hot _ methods _03 … ….
For example, if the hot intervals include hot interval 1, hot interval 2, and hot interval 3, and the hot codes include hot code a, hot code B, and hot code C, when the hot value corresponding to hot code a is within hot interval 1, hot code a may be divided into hot interval 1; when the hot value corresponding to the hot spot code B is within the hot range 2, the hot spot code B may be divided into the hot ranges 2; when the hot value corresponding to the hot spot code C is within the hot range 3, the hot spot code C may be divided into the hot ranges 3, and the like.
Step S311: based on the boot code, a first target profile is generated that includes the boot code.
In some implementations, upon determining the boot code, a first target profile including the boot code can be generated. As one mode, the first target configuration file may be a configuration file recording an index or an identifier of the start code, or may be a configuration file recording the start code, which is not limited herein.
Step S312: and generating at least two second target configuration files based on the at least two hot spot code blocks, wherein one second target configuration file comprises one hot spot code block.
In some embodiments, after determining at least two hot spot code blocks, at least two second target profiles may be generated, wherein one second target profile includes one hot spot code block. As a manner, the second target configuration file may be a configuration file recording an index or an identifier of a hot code block, or may be a configuration file recording a hot code block, which is not limited herein.
Step S313: determining the first target profile and the at least two second target profiles together as the target profile.
Optionally, after the multiple hot spot codes are divided, one hot range may correspond to one hot spot code block. The purpose of explicitly cutting the hot spot code is to avoid compiling at once during installation, consuming too long time (compiling during installation, and a user can or optimize experience after installation), or if not, compiling during first starting (the application is usually required to be popped to grant permission when being started for the first time, and compiling can avoid influencing user experience as much as possible at this time). The target configuration files are divided into a plurality of target configuration files, namely a plurality of hot spot information carriers, and only need to be compiled and utilized at different stages, and finally, after the compiling, a file (or contents which are continuously added to the same file) can be synthesized, namely the target configuration files.
Step S314: and issuing the first target configuration file to the client, wherein the first target configuration file is used for indicating the client to compile the starting code in advance in an installation stage.
In some embodiments, since the first target profile includes the start-up code, that is, the first profile is related to the start-up of the target application, the client may be instructed to pre-compile the start-up code through AOT in the installation stage, so as to increase the start-up speed of the target application.
Step S315: and issuing the at least two second target configuration files to the client, wherein the second target configuration files are used for indicating the client to gradually pre-compile the at least two hot code blocks according to the sequence of the importance degrees of the at least two second target configuration files from high to low in a background idle stage.
In some embodiments, since the second target profile includes the hot code blocks, i.e., the second profile is related to the usage of the target application, the client may be instructed not to pre-compile in the installation phase, but may pre-compile the hot code blocks by AOT in the background idle phase, so as to reduce the impact of the installation phase on the installation speed. In the background idle stage of the client, the at least two hot spot code blocks can be precompiled step by step according to the order of the importance degrees of the at least two second target configuration files from high to low. The background idle phase of the client may include, but is not limited to: the electronic device is in a charging phase, a night phase, etc., and is not limited herein.
In another embodiment of the present application, a hotspot code processing method obtains attribute information and a current configuration file of a target application program, extracts a code record file from an installation package corresponding to the target application program based on the attribute information, obtains all codes recorded in the code record file, extracts a start code identifier of the target application program in a start process from the current configuration file, and extracts a start code corresponding to the start code identifier from all codes. The method comprises the steps of obtaining attribute information and a current configuration file of a target application program, extracting a code record file from an installation package corresponding to the target application program based on the attribute information, obtaining all codes recorded in the code record file, extracting a plurality of hot spot code identifications of the target application program in the using process from the current configuration file, and extracting a plurality of hot spot codes corresponding to the hot spot code identifications from all the codes. Respectively obtaining a hot value corresponding to each hot code in a plurality of hot codes, segmenting the hot codes based on the hot value corresponding to each hot code and a plurality of preset hot intervals, obtaining at least two hot code blocks, generating a first target configuration file comprising a start code based on the start code, generating at least two second target configuration files based on the at least two hot code blocks, determining the first target configuration file and the at least two second target configuration files as target configuration files together, sending the first target configuration file to a client, wherein the first target configuration file is used for indicating the client to compile the start code in advance in an installation stage, the at least two second target configuration files are sent to the client, and the second target configuration files are used for indicating the client to compile at least two hot generation generations from high to low according to the importance degrees of the at least two second target configuration files in a background idle stage step by step Code blocks. Compared with the hot spot code processing method shown in fig. 3, in the embodiment, the start code is extracted from the code record file through the start code identifier, and the hot spot codes are extracted from the code record file through the hot spot code identifiers, so that the accuracy of the obtained start code and the hot spot codes is improved. In addition, the embodiment also divides a plurality of hot spot codes according to the hot degree interval so as to improve the accuracy of hot spot code division.
Referring to fig. 6, fig. 6 is a schematic flowchart illustrating a hot spot code processing method according to another embodiment of the present application. The hot spot code processing method is used for obtaining at least two hot spot code blocks by dividing a plurality of hot spot codes of an application program, and then generating a target configuration file based on a starting code and the at least two hot spot code blocks so as to accelerate the installation speed of the application program and optimize the performance of the application program. In a specific embodiment, the hot spot code processing method is applied to the hot spot code processing apparatus 400 shown in fig. 8 and the server 100 (fig. 10) configured with the hot spot code processing apparatus 400. The specific process of the present embodiment will be described below by taking an electronic device as an example, and it is understood that the server applied in the present embodiment may be a smart phone, a tablet computer, a wearable electronic device, and the like, which is not limited herein. As will be described in detail with respect to the flow shown in fig. 6, the hotspot code processing method may specifically include the following steps:
step S410: receiving a target configuration file issued by a server, wherein the target configuration file is generated based on a starting code of a target application program in the starting process and at least two hot spot code blocks, and the at least two hot spot code blocks are obtained by dividing a plurality of hot spot codes of the target application program in the using process.
Step S420: compiling the boot code and the at least two hotspot code blocks in stages based on the target configuration file.
For detailed description of steps S410 to S420, please refer to steps S101 to S104, which are not described herein again.
In another embodiment of the present application, a hot spot code processing method receives a target configuration file sent by a server, where the target configuration file is generated based on a start code and at least two hot spot code blocks of a target application program in a start process, the at least two hot spot code blocks are obtained by dividing a plurality of hot spot codes of the target application program in a use process, and the start code and the at least two hot spot code blocks are compiled in stages based on the target configuration file, so that the at least two hot spot code blocks are obtained by dividing the plurality of hot spot codes of the application program, and then the target configuration file is generated based on the start code and the at least two hot spot code blocks, so as to accelerate an installation speed of the application program and optimize performance of the application program.
Referring to fig. 7, fig. 7 is a block diagram illustrating a hot spot code processing apparatus 300 according to an embodiment of the present application. The hot spot code processing apparatus 300 is applied to the above-mentioned server, and will be explained with reference to the block diagram shown in fig. 7, where the hot spot code processing apparatus 300 includes: a code obtaining module 310, a code dividing module 320, a configuration file generating module 330, and a configuration file issuing module 340, wherein:
the code obtaining module 310 is configured to obtain a start code of a target application in a start process, and obtain a plurality of hot spot codes of the target application in a use process.
Further, the code obtaining module 310 includes: the first acquisition submodule, the first code acquisition submodule, the start code identification extraction submodule and the start code extraction submodule, wherein:
and the first obtaining submodule is used for obtaining the attribute information and the current configuration file of the target application program.
And the first code obtaining submodule is used for extracting a code record file from the installation package corresponding to the target application program based on the attribute information and obtaining all codes recorded in the code record file.
And the starting code identification extraction submodule is used for extracting the starting code identification of the target application program in the starting process from the current configuration file.
And the starting code extraction submodule is used for extracting the starting code corresponding to the starting code identification from all the codes.
Further, the code obtaining module 310 includes: a second obtaining sub-module, a second code obtaining sub-module, a hot spot code identification extracting sub-module and a hot spot code extracting sub-module, wherein:
and the second obtaining submodule is used for obtaining the attribute information and the current configuration file of the target application program.
And the second code obtaining submodule is used for extracting a code record file from the installation package corresponding to the target application program based on the attribute information and obtaining all codes recorded in the code record file.
And the hot spot code identification extraction submodule is used for extracting a plurality of hot spot code identifications of the target application program in the using process from the current configuration file.
And the hot spot code extraction submodule is used for extracting a plurality of hot spot codes corresponding to the hot spot code identifications from all the codes, wherein the hot spot code identifications are in one-to-one correspondence with the hot spot codes.
The code splitting module 320 is configured to split the multiple hot spot codes according to a specified condition, so as to obtain at least two hot spot code blocks.
Further, the code division module 320 includes: a quantity acquisition submodule and a first code segmentation submodule, wherein:
and the quantity obtaining submodule is used for obtaining the quantity of the plurality of hot spot codes.
And the first code segmentation sub-module is used for segmenting the plurality of hot spot codes according to the specified condition to obtain at least two hot spot code blocks when the number of the plurality of hot spot codes is greater than the number threshold.
Further, the code division module 320 includes: the hot value obtains submodule and second code segmentation submodule, wherein:
and the hot value acquisition submodule is used for respectively acquiring the hot value corresponding to each hot code in the plurality of hot codes.
And the second code segmentation sub-module is used for segmenting the plurality of hot spot codes based on the corresponding hot value of each hot spot code and a plurality of preset hot range intervals to obtain at least two hot spot code blocks, wherein one hot range corresponds to one hot spot code block.
A configuration file generating module 330, configured to generate a target configuration file based on the boot code and the at least two hot spot code blocks.
Further, the configuration file generating module 330 includes: a first configuration file generation submodule, a second configuration file generation submodule and a target configuration file generation submodule, wherein:
and the first configuration file generation submodule is used for generating a first target configuration file comprising the starting code based on the starting code.
And the second configuration file generation submodule is used for generating at least two second target configuration files based on the at least two hot spot code blocks, wherein one second target configuration file comprises one hot spot code block.
And the target configuration file generation submodule is used for determining the first target configuration file and the at least two second target configuration files as the target configuration files.
A configuration file issuing module 340, configured to issue the target configuration file to a client, where the target configuration file is used to instruct the client to compile the start code and the at least two hot code blocks in stages.
Further, the configuration file issuing module 340 includes: the device comprises a first configuration file issuing submodule and a second configuration file issuing submodule, wherein:
and the first configuration file issuing sub-module is used for issuing the first target configuration file to the client, and the first target configuration file is used for indicating the client to compile the starting code in advance in an installation stage.
And the second configuration file issuing sub-module is used for issuing the at least two second target configuration files to the client, and the second target configuration files are used for indicating the client to gradually pre-compile the at least two hot code blocks according to the sequence of the importance degrees of the at least two second target configuration files from high to low in a background idle stage.
Referring to fig. 8, fig. 8 is a block diagram illustrating a hot spot code processing apparatus 400 according to another embodiment of the present application. The hot spot code processing apparatus 400 is applied to the above electronic device, and will be explained with reference to the block diagram shown in fig. 8, where the hot spot code processing apparatus 400 includes: a configuration file receiving module 410 and a code compiling module 420, wherein:
the configuration file receiving module 410 is configured to receive a target configuration file issued by a server, where the target configuration file is generated based on a start code of a target application program in a start process and at least two hot spot code blocks, and the at least two hot spot code blocks are obtained by dividing a plurality of hot spot codes of the target application program in a use process.
A code compiling module 420, configured to compile the boot code and the at least two hot spot code blocks in stages based on the target configuration file.
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.
Referring to fig. 9, a block diagram of a server 100 according to an embodiment of the present disclosure is shown. The server 100 may be a conventional server, a cloud server, or the like. The server 100 in the present application may include one or more of the following components: a processor 130, a memory 140, and one or more applications, wherein the one or more applications may be stored in the memory 140 and configured to be executed by the one or more processors 130, the one or more programs configured to perform the methods as described in the aforementioned method embodiments.
Processor 130 may include one or more processing cores, among others. The processor 130 connects various parts within the overall server 100 using various interfaces and lines, performs various functions of the server 100 and processes data by executing or executing instructions, programs, code sets, or instruction sets stored in the memory 140, and calling data stored in the memory 140. Alternatively, the processor 130 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 the content to be displayed; the modem is used to handle wireless communications. It is understood that the modem may not be integrated into the processor 130, but may be implemented by a communication chip.
The Memory 140 may include a Random Access Memory (RAM) or a Read-Only Memory (Read-Only Memory). The memory 140 may be used to store instructions, programs, code sets, or instruction sets. The memory 140 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 100 in use (such as phone books, audio and video data, chat log data), and the like.
Referring to fig. 10, a block diagram of an electronic device 200 according to an embodiment of the present disclosure is shown. The electronic device 200 may be a smart phone, a tablet computer, an electronic book, or other electronic devices capable of running an application program. The electronic device 200 in the present application may include one or more of the following components: a processor 210, a memory 220, and one or more applications, wherein the one or more applications may be stored in the memory 220 and configured to be executed by the one or more processors 210, the one or more programs configured to perform a method as described in the aforementioned method embodiments.
Processor 210 may include one or more processing cores, among other things. The processor 210 connects various parts within the overall electronic device 200 using various interfaces and lines, and performs various functions of the electronic device 200 and processes data by executing or executing instructions, programs, code sets, or instruction sets stored in the memory 220 and calling data stored in the memory 220. Alternatively, the processor 210 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 210 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 the content to be displayed; the modem is used to handle wireless communications. It is understood that the modem may not be integrated into the processor 210, but may be implemented by a communication chip.
The Memory 220 may include a Random Access Memory (RAM) or a Read-Only Memory (Read-Only Memory). The memory 220 may be used to store instructions, programs, code, sets of codes, or sets of instructions. The memory 220 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 data storage area may also store data created by the electronic device 200 during use (e.g., phone book, audio-video data, chat log data), etc.
Referring to fig. 11, a block diagram of a computer-readable storage medium according to an embodiment of the present application is shown. The computer-readable medium 500 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 500 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 500 includes a non-volatile computer-readable storage medium. The computer readable storage medium 500 has storage space for program code 510 for performing 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 510 may be compressed, for example, in a suitable form.
To sum up, the hot spot code processing method, apparatus, server, electronic device, and storage medium provided in this embodiment of the present application obtain a start code of a target application program in a start process, obtain a plurality of hot spot codes of the target application program in a use process, perform division processing on the plurality of hot spot codes according to a specified condition, obtain at least two hot spot code blocks, generate a target configuration file based on the start code and the at least two hot spot code blocks, send the target configuration file to a client, the target configuration file is used to instruct the client to compile the start code and the at least two hot spot code blocks in stages, so as to obtain the at least two hot spot code blocks by dividing the plurality of hot spot codes of the application program, generate the target configuration file based on the start code and the at least two hot spot code blocks, and accelerate installation speed of the application program, optimizing the performance of the application.
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 (13)

1. A hotspot code processing method is characterized by comprising the following steps:
acquiring a starting code of a target application program in a starting process, and acquiring a plurality of hot spot codes of the target application program in a using process;
the hot spot codes are segmented according to specified conditions to obtain at least two hot spot code blocks;
generating a target configuration file based on the boot code and the at least two hotspot code blocks;
and issuing the target configuration file to a client, wherein the target configuration file is used for instructing the client to compile the start code and the at least two hot spot code blocks in stages.
2. The method of claim 1, wherein obtaining the boot code of the target application during the boot process comprises:
acquiring attribute information and a current configuration file of the target application program;
extracting a code record file from the installation package corresponding to the target application program based on the attribute information, and acquiring all codes recorded in the code record file;
extracting a starting code identifier of the target application program in the starting process from the current configuration file;
and extracting the starting code corresponding to the starting code identification from all the codes.
3. The method of claim 1, wherein the obtaining the plurality of hot spot codes of the target application in the using process comprises:
acquiring attribute information and a current configuration file of the target application program;
extracting a code record file from the installation package corresponding to the target application program based on the attribute information, and acquiring all codes recorded in the code record file;
extracting a plurality of hot spot code identifications of the target application program in the using process from the current configuration file;
and extracting a plurality of hot spot codes corresponding to the hot spot code identifications from all the codes, wherein the hot spot code identifications are in one-to-one correspondence with the hot spot codes.
4. The method of claim 1, wherein the splitting the plurality of hotspot codes according to the specified condition to obtain at least two hotspot code blocks comprises:
acquiring the number of the plurality of hot spot codes;
and when the number of the plurality of hot spot codes is larger than a number threshold, carrying out segmentation processing on the plurality of hot spot codes according to the specified condition to obtain at least two hot spot code blocks.
5. The method of claim 1, wherein the splitting the plurality of hotspot codes according to the specified condition to obtain at least two hotspot code blocks comprises:
respectively acquiring a hot value corresponding to each hot spot code in the plurality of hot spot codes;
and based on the heat value corresponding to each hot spot code and a plurality of preset heat intervals, carrying out segmentation processing on the plurality of hot spot codes to obtain at least two hot spot code blocks, wherein one heat interval corresponds to one hot spot code block.
6. The method of claim 5, wherein generating a target configuration file based on the boot code and the at least two hot spot code blocks comprises:
generating a first target profile comprising the boot code based on the boot code;
generating at least two second target configuration files based on the at least two hot spot code blocks, wherein one second target configuration file comprises one hot spot code block;
determining the first target profile and the at least two second target profiles together as the target profile.
7. The method of claim 6, wherein issuing the target configuration file to a client, the target configuration file being used to instruct the client to compile the boot code and the at least two hotspot code blocks in stages, comprises:
issuing the first target configuration file to the client, wherein the first target configuration file is used for indicating the client to compile the starting code in advance in an installation stage;
and issuing the at least two second target configuration files to the client, wherein the second target configuration files are used for indicating the client to gradually pre-compile the at least two hot code blocks according to the sequence of the importance degrees of the at least two second target configuration files from high to low in a background idle stage.
8. A hotspot code processing method is characterized by comprising the following steps:
receiving a target configuration file issued by a server, wherein the target configuration file is generated based on a starting code of a target application program in the starting process and at least two hot spot code blocks, and the at least two hot spot code blocks are obtained by dividing a plurality of hot spot codes of the target application program in the using process;
compiling the boot code and the at least two hotspot code blocks in stages based on the target configuration file.
9. An apparatus for hotspot code processing, the apparatus comprising:
the code acquisition module is used for acquiring a starting code of a target application program in a starting process and acquiring a plurality of hot spot codes of the target application program in a using process;
the code segmentation module is used for segmenting the plurality of hot spot codes according to specified conditions to obtain at least two hot spot code blocks;
a configuration file generating module, configured to generate a target configuration file based on the boot code and the at least two hotspot code blocks;
and the configuration file issuing module is used for issuing the target configuration file to a client, and the target configuration file is used for indicating the client to compile the start code and the at least two hot spot code blocks in stages.
10. An apparatus for hotspot code processing, the apparatus comprising:
the configuration file receiving module is used for receiving a target configuration file issued by a server, wherein the target configuration file is generated based on a starting code of a target application program in the starting process and at least two hot spot code blocks, and the at least two hot spot code blocks are obtained by dividing a plurality of hot spot codes of the target application program in the using process;
and the code compiling module is used for compiling the boot code and the at least two hot spot code blocks in stages based on the target configuration file.
11. A server comprising a memory and a processor, the memory coupled to the processor, the memory storing instructions that, when executed by the processor, the processor performs the method of any of claims 1-7.
12. An electronic device comprising a memory and a processor, the memory coupled to the processor, the memory storing instructions that, when executed by the processor, the processor performs the method of claim 8.
13. A computer-readable storage medium, in which a program code is stored, which program code can be called by a processor to execute the method according to any one of claims 1 to 7 or to execute the method according to claim 8.
CN201911176570.5A 2019-11-26 2019-11-26 Hotspot code processing method and device, server, electronic equipment and storage medium Pending CN112948026A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911176570.5A CN112948026A (en) 2019-11-26 2019-11-26 Hotspot code processing method and device, server, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911176570.5A CN112948026A (en) 2019-11-26 2019-11-26 Hotspot code processing method and device, server, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN112948026A true CN112948026A (en) 2021-06-11

Family

ID=76224921

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911176570.5A Pending CN112948026A (en) 2019-11-26 2019-11-26 Hotspot code processing method and device, server, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN112948026A (en)

Cited By (6)

* Cited by examiner, † Cited by third party
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
CN114398102A (en) * 2022-01-18 2022-04-26 杭州米络星科技(集团)有限公司 Application package generation method and device, compiling server and computer readable storage medium
CN115080151A (en) * 2022-07-22 2022-09-20 平安银行股份有限公司 APP starting process control method, computer readable storage medium and terminal
CN115563015A (en) * 2022-11-09 2023-01-03 科东(广州)软件科技有限公司 Code popularity statistical method, device, equipment and storage medium
CN116521180A (en) * 2023-06-28 2023-08-01 荣耀终端有限公司 Compiling optimization method, electronic equipment and storage medium
CN117130617A (en) * 2023-01-19 2023-11-28 荣耀终端有限公司 Compiling method and device of application program

Cited By (8)

* Cited by examiner, † Cited by third party
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
CN114398102A (en) * 2022-01-18 2022-04-26 杭州米络星科技(集团)有限公司 Application package generation method and device, compiling server and computer readable storage medium
CN114398102B (en) * 2022-01-18 2023-08-08 杭州米络星科技(集团)有限公司 Application package generation method and device, compiling server and computer readable storage medium
CN115080151A (en) * 2022-07-22 2022-09-20 平安银行股份有限公司 APP starting process control method, computer readable storage medium and terminal
CN115563015A (en) * 2022-11-09 2023-01-03 科东(广州)软件科技有限公司 Code popularity statistical method, device, equipment and storage medium
CN117130617A (en) * 2023-01-19 2023-11-28 荣耀终端有限公司 Compiling method and device of application program
CN116521180A (en) * 2023-06-28 2023-08-01 荣耀终端有限公司 Compiling optimization method, electronic equipment and storage medium
CN116521180B (en) * 2023-06-28 2024-03-08 荣耀终端有限公司 Compiling optimization method, electronic equipment and storage medium

Similar Documents

Publication Publication Date Title
CN112948026A (en) Hotspot code processing method and device, server, electronic equipment and storage medium
CN111061484B (en) Code compiling method, device, server, user terminal and readable medium
CN111078318B (en) Processing method, device and system of configuration file and storage medium
CN108536524B (en) Resource updating method, device, terminal and storage medium
CN105975311B (en) Application starting method and device
CN105763602A (en) Data request processing method, server and cloud interactive system
CN111258557B (en) Code processing method, device, electronic equipment and computer readable medium
CN111176717B (en) Method and device for generating installation package and electronic equipment
CN108647032B (en) Application loading method and device, computer device and computer readable storage medium
WO2021115177A1 (en) Application installation method and apparatus, terminal device, server and storage medium
CN112559088A (en) Configuration file optimization method, device, server and storage medium
CN112473144A (en) Game resource data processing method and device
CN109032685B (en) Method and terminal for accelerating startup of android system
CN112631622A (en) Application installation method and device, server and computer readable medium
CN109947450A (en) System file upgrade method, device, mobile terminal and readable storage medium storing program for executing
US10503430B2 (en) Method and device for clearing data and electronic device
CN115659340B (en) Counterfeit applet identification method and device, storage medium and electronic equipment
CN109976754B (en) Information display method and terminal thereof
CN116069366A (en) Client application program updating method and device, storage medium and electronic equipment
CN111338633B (en) Method and device for generating installation-free file and electronic equipment
CN113849269A (en) Method and device for adding GPU (graphics processing Unit) resources in virtual machine
CN114911541A (en) Configuration information processing method and device, electronic equipment and storage medium
CN112783500B (en) Method and device for generating compiling optimization information and electronic equipment
CN112799690A (en) Information processing method, device, equipment and storage medium
CN113849195A (en) Application program loading method and device, storage medium and terminal

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