Hotspot code processing method, device, server, electronic device and storage medium
By segmenting hotspot codes and compiling them in stages, the method addresses slow installation and optimization issues in Android devices, improving installation speed and performance.
Patent Information
- Application Number
- CN201911176570.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-11-26
- Publication Date
- 2024-12-27
- Estimated Expiration
- 2039-11-26
AI Technical Summary
Existing virtual machine systems for Android devices face issues with slow application installation times and performance optimization due to the need for full recompilation of applications during installation and upgrades, which affects user experience and resource usage.
A method and device for segmenting hotspot codes into blocks and generating a configuration file to instruct staged compilation, optimizing the installation process by compiling startup and hotspot codes separately.
This approach speeds up application installation and improves performance by reducing the impact of compilation on installation time and resource usage, enhancing user experience.
Smart Images

Figure CN112948026B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and more specifically, to a hotspot code processing method, device, server, electronic device and storage medium. Background Art
[0002] Electronic devices, such as tablet computers and smart terminals, have become one of the most commonly used consumer electronic products in people's daily lives. People usually install various applications in electronic devices to meet different needs. In the use of applications, frequently used methods or codes of the application are usually used as hot code, and the hot code is pre-compiled into binary machine code. The compiled binary machine code can be used to be directly executed by the processor when the application is run next time, thereby improving the running speed of the application. However, when there are too many hot codes, the installation of the application will take up too much bandwidth and time, causing adverse effects on users. Summary of the invention
[0003] In view of the above problems, the present application proposes a hotspot code processing method, device, server, electronic device and storage medium to solve the above problems.
[0004] In the first aspect, an embodiment of the present application provides a hotspot code processing method, the method comprising: obtaining the startup code of a target application during the startup process, and obtaining multiple hotspot codes of the target application during use; segmenting the multiple hotspot codes according to specified conditions to obtain at least two hotspot code blocks; generating a target configuration file based on the startup code and the at least two hotspot code blocks; and sending the target configuration file to a client, wherein the target configuration file is used to instruct the client to compile the startup code and the at least two hotspot code blocks in stages.
[0005] In the second aspect, an embodiment of the present application provides a hotspot code processing method, the method comprising: receiving a target configuration file sent by a server, the target configuration file being generated based on a startup code and at least two hotspot code blocks of a target application during startup, the at least two hotspot code blocks being obtained by segmenting multiple hotspot codes of the target application during use; based on the target configuration file, compiling the startup code and the at least two hotspot code blocks in stages.
[0006] In the third aspect, an embodiment of the present application provides a hotspot code processing device, including a code acquisition module for acquiring the startup code of a target application during the startup process, and acquiring multiple hotspot codes of the target application during use; a code segmentation module for segmenting the multiple hotspot codes according to specified conditions to obtain at least two hotspot code blocks; a configuration file generation module for generating a target configuration file based on the startup code and the at least two hotspot code blocks; a configuration file sending module for sending the target configuration file to a client, wherein the target configuration file is used to instruct the client to compile the startup code and the at least two hotspot code blocks in stages.
[0007] In a fourth aspect, an embodiment of the present application provides a hotspot code processing device, the device comprising: a configuration file receiving module, used to receive a target configuration file issued by a server, the target configuration file is generated based on the startup code of the target application during the startup process and at least two hotspot code blocks, the at least two hotspot code blocks are obtained by segmenting multiple hotspot codes of the target application during use; a code compilation module, used to compile the startup code and the at least two hotspot code blocks in stages based on the target configuration file.
[0008] In a fifth aspect, an embodiment of the present application provides a server, comprising a memory and a processor, wherein the memory is coupled to the processor, the memory stores instructions, and when the instructions are executed by the processor, the processor executes the above method.
[0009] In a sixth aspect, an embodiment of the present application provides an electronic device, comprising a memory and a processor, wherein the memory is coupled to the processor, the memory stores instructions, and when the instructions are executed by the processor, the processor executes the above method.
[0010] In a seventh aspect, an embodiment of the present application provides a computer-readable storage medium, in which a program code is stored, and the program code can be called by a processor to execute the above method.
[0011] The hotspot code processing method, device, server, electronic device and storage medium provided in the embodiments of the present application obtain the startup code of the target application during the startup process, and obtain multiple hotspot codes of the target application during use, segment the multiple hotspot codes according to specified conditions, obtain at least two hotspot code blocks, generate a target configuration file based on the startup code and the at least two hotspot code blocks, and send the target configuration file to the client. The target configuration file is used to instruct the client to compile the startup code and the at least two hotspot code blocks in stages, so as to obtain at least two hotspot code blocks by segmenting the multiple hotspot codes of the application, and then generate the target configuration file based on the startup code and the at least two hotspot code blocks, so as to speed up the installation speed of the application and optimize the performance of the application. BRIEF DESCRIPTION OF THE DRAWINGS
[0012] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without paying any creative work.
[0013] Figure 1 A schematic diagram of an application environment that can be used for the hotspot code determination method provided in an embodiment of the present application is shown;
[0014] Figure 2 A schematic diagram showing another application environment that can be used for the hotspot code determination method provided in the embodiment of the present application is shown;
[0015] Figure 3 A schematic diagram of a hotspot code determination method provided by an embodiment of the present application is shown;
[0016] Figure 4 A schematic diagram of a hotspot code determination method provided by another embodiment of the present application is shown;
[0017] Figure 5 A schematic diagram of a hotspot code determination method provided in another embodiment of the present application is shown;
[0018] Figure 6 A schematic diagram of a hotspot code determination method provided by another embodiment of the present application is shown;
[0019] Figure 7 A module block diagram of a hotspot code determination device provided by an embodiment of the present application is shown;
[0020] Figure 8 A module block diagram of a hotspot code determination device provided by another embodiment of the present application is shown;
[0021] Fig. 9 A block diagram of a server for executing a hotspot code processing method according to an embodiment of the present application is shown;
[0022] Fig.10 A block diagram of an electronic device for executing a hotspot code processing method according to an embodiment of the present application is shown;
[0023] Fig.11 A storage unit for storing or carrying program codes for implementing the hotspot code processing method according to an embodiment of the present application is shown. DETAILED DESCRIPTION
[0024] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application.
[0025] Among them, Java runs on the Java virtual machine, so Java code has strong portability, and most of the applications on the Android platform are written in Java. Therefore, the Android platform has a JVM virtual machine or implements its own JVM virtual machine. Before Android 5.0, the Dalvik virtual machine was used, which supports the running of Java applications in the dex (Dalvik Executable) format. Starting from Android 5.0, ART completely replaced the original Dalvik and became the new virtual machine on the Android system. ART uses pre-compilation (AOT), and from the Android N version, it adopts the JIT+AOT+interpreted execution compilation mode, and introduces the Profile-Guide-Optimization (PGO) mechanism. The process is as follows:
[0026] 1. When the application is initially installed, the system does not perform AOT compilation on the .dex files;
[0027] 2. When the application is running, the code that has not been identified by the hotspot (cold code) will be directly executed through the JAVA parser first. During the execution process, when the virtual machine finds that a method or code block is running very frequently, it will be identified as hot code (hot code), and stored in the cache after JIT compilation. In this way, if these codes are encountered when the application is started next time, the compiled code will be executed from the cache first. In addition, the system will also generate a configuration file (profile file) to record the information of hot code (hot function);
[0028] 3. In addition to JIT compilation, when the device is idle and charging, the AOT compiler will also use the profile information to recompile the application to generate an .oat file, so that these hot code will no longer need JIT optimization at runtime after the next startup.
[0029] With the PGO mechanism, the code that needs to be compiled in an application is only the most frequently executed Java bytecode in the program, rather than the entire program code. This approach can greatly improve the program's running performance while minimizing the impact on the application installation speed and additional space occupied, alleviating the drawbacks that may be caused by single JIT or AOT compilation.
[0030] However, the Dalvik virtual machine using the traditional JIT compiler has the following problems: 1. Each time an application is started, the .dex file needs to be recompiled into machine code and then executed (there is no caching mechanism, and non-hot code is executed in interpreted mode). This operation is time-consuming, so the Dalvik virtual machine has always been considered by users to be the root cause of slowing down the Android system and the difference in fluency with IOS; 2. More CPU resources are used when running applications, which will also cause problems with battery life and heating.
[0031] Although the ART virtual machine using the AOT mechanism solves the problems brought by the Dalvik virtual machine, it also brings new defects: 1. Application installation and application optimization after upgrading the system version is time-consuming (each time a new application is installed and the system is upgraded, the application needs to be precompiled to generate machine code). As the size of the application becomes larger and larger, the installation or optimization time of a single application can even reach several minutes; 2. The machine code generated after the .dex file is precompiled will take up additional storage space (the severity of this defect is weakened in the face of the rapid development of mobile phone storage space and performance).
[0032] The JIT+AOT+interpretation execution mechanism solves the defects brought by a single JIT or a single AOT compilation mode. However, this seemingly perfect mechanism also has certain limitations: 1. Whenever a user installs an application and uses it for the first time, the application is not optimized. Only after the user has used the application for a period of time can the system generate profile information that conforms to the user's usage habits, thereby optimizing the application and improving the speed. This problem will be more obvious when the user uses the phone for the first time. 2. The profile information of the application can only be optimized for the current version of the application. If the version of the application is upgraded, the system needs to collect the profile information of the application again to optimize the program. If the frequency of application upgrades is high, the actual optimization time of the application will be greatly reduced. Since the upgrade frequency of most mainstream applications is between 1 week and 1 month, it is difficult for this optimization mechanism to achieve the ideal level of system fluency. In addition, the hot code information is recorded through the profile file. The larger the profile file, the more hot code information it contains, the more Java bytecodes need to be compiled in the dex file, and the more opportunities to directly execute machine code after compilation. The fewer processes that need to be optimized through interpretation execution and JIT compilation, the greater the performance improvement of the application. However, the larger the profile hotspot file is, the longer the compilation time will be during installation, the greater the impact on installation speed will be, and the user experience will be affected to a certain extent.
[0033] In view of the above problems, the inventor has discovered after long-term research and proposed the hotspot code processing method, device, server, electronic device and storage medium provided in the embodiments of the present application, which obtains at least two hotspot code blocks by segmenting multiple hotspot codes of the application, and then generates a target configuration file based on the startup code and at least two hotspot code blocks to speed up the installation speed of the application and optimize the performance of the application. Among them, the specific hotspot code processing method is described in detail in the subsequent embodiments.
[0034] See also Figure 3 , Figure 3 The flowchart of a hotspot code processing method provided by an embodiment of the present application is shown. The hotspot code processing method is used to obtain at least two hotspot code blocks by segmenting multiple hotspot codes of an application, and then generate a target configuration file based on the startup code and the at least two hotspot code blocks to speed up the installation speed of the application and optimize the performance of the application. In a specific embodiment, the hotspot code processing method is applied to Figure 7 The hotspot code processing device 300 and the server 100 ( Fig. 9). The following will take the server as an example to illustrate the specific process of this embodiment. Of course, it can be understood that the server used in this embodiment can be a cloud server or a traditional server, etc., which is not limited here. Figure 3 The process shown is described in detail, and the hotspot code processing method may specifically include the following steps:
[0035] Step S101: obtaining a startup code of a target application during startup, and obtaining a plurality of hotspot codes of the target application during use.
[0036] In this embodiment, the target application may be an application installed and used on the client. For example, when the client installs and uses the first application, the second application, and the third application, the target application may include the first application, the second application, and the third application. The target application generally includes a startup code during the startup process and a function code during the use process. The function code during the use process can be divided into a hotspot code and a non-hotspot code according to the number of times the function code is used, the frequency of use of the function code, the importance of the function code, etc.
[0037] In some embodiments, the startup code of the target application during the startup process and the multiple hotspot codes of the target application during use can be obtained. As one way, the server can obtain a first configuration file related to the target application uploaded by the electronic device, and obtain the startup code of the target application during the startup process and the multiple hotspot codes of the target application during use from the first configuration file. As another way, the server can collect a second configuration file of the target application used by the user, and obtain the startup code of the target application during the startup process and the multiple hotspot codes of the target application during use from the second configuration file.
[0038] In some embodiments, the startup code of the target application during the startup process may include: all codes related to the startup of the target application, for example, codes related to the startup path of the target application, codes related to the main interface activity component (Activity) of the target application, etc. Multiple hotspot codes of the target application during use can be obtained in one or more of the following ways: the number of times each activity component of the target application is opened, the number of jumps of each jump path of the target application, the frequency of opening each activity component of the target application, the frequency of jumps of each jump path of the target application, the importance of each activity component of the target application, etc. Among them, when the number of times an active component of the target application is opened reaches a first number threshold, the code corresponding to the active component can be determined as a hotspot code; when the number of jumps of the jump path of the target application reaches a second number threshold, the code corresponding to the jump path can be determined as a hotspot code; when the opening frequency of the active component of the target application reaches a first frequency threshold, the code corresponding to the active component can be determined as a hotspot code; when the jump frequency of the jump path of the target application reaches a second frequency threshold, the code corresponding to the active component can be determined as a hotspot code; when the importance of each active component of the target application reaches an importance threshold, the code corresponding to the active component can be determined as a hotspot code.
[0039] Among them, the importance of each activity component of the target application can be determined by the functional description information of the target application. For example, the functional description information of the application can be obtained through the "application information" or "application tag" of the application. In some embodiments, the description of the target application in the application store can be obtained, and the description of the target application in the application store is determined as the functional description information of the target application. For example, the functional description information of WeChat includes: sending voice, text messages, pictures, etc.; sharing life in the circle of friends; scanning; public accounts, etc. In some embodiments, after obtaining the functional description information of the target application, the activity components involved in the functional description information can be determined from multiple activity components, and the code corresponding to the activity components involved in the functional description information is determined as a hotspot code. Among them, the number of activity components involved in the functional description information can be one or more, which is not limited here. For example, when the functional description information of the WeChat application includes scanning and sharing life in the circle of friends, the code corresponding to the activity component involved in scanning in the WeChat application can be determined as a hotspot code, and the code corresponding to the activity component involved in the circle of friends in the WeChat application can be determined as a hotspot code, etc., which is not limited here.
[0040] Step S102: Segment the plurality of hotspot codes according to specified conditions to obtain at least two hotspot code blocks.
[0041] In some embodiments, the server pre-sets and stores a specified condition, which is used as a basis for segmenting multiple hotspot codes. Therefore, in this embodiment, after obtaining the startup code of the target application during the startup process and obtaining multiple hotspot codes of the target application during use, the multiple hotspot codes can be segmented according to the specified conditions to obtain at least two hotspot code blocks. Among them, in this embodiment, the number of hotspot code blocks after segmentation can be determined according to the number or size of the multiple hotspot codes. For example, when the number of multiple hotspot codes is large, the multiple hotspot codes can be segmented into a large number of hotspot code blocks, and when the number of multiple hotspot codes is small, the multiple hotspot codes can be segmented into a small number of hotspot code blocks. For another example, when the size of the multiple hotspot codes is large, the multiple hotspot codes can be segmented into a large number of hotspot code blocks, and when the size of the multiple hotspot codes is small, the multiple hotspot codes can be segmented into a small number of hotspot code blocks.
[0042] In some implementations, the startup code of the target application during the startup process may be split or may not be split, which is not limited here.
[0043] Step S103: Generate a target configuration file based on the startup code and the at least two hotspot code blocks.
[0044] In some embodiments, after obtaining the startup code of the target application and at least two hotspot code blocks of the target application, the server can generate a target configuration file based on the startup code and the at least two hotspot code blocks, wherein the target configuration file can include multiple configuration files. As one way, the multiple configuration files can respectively include the startup code, the first hotspot code block in the at least two hotspot code blocks, the second hotspot code block in the at least two hotspot code blocks, the third hotspot code block in the at least two hotspot code blocks..., the Nth hotspot code block in the at least two hotspot code blocks. As another way, the multiple configuration files can respectively include the startup code and the first hotspot code block in the at least two hotspot code blocks, the second hotspot code block in the at least two hotspot code blocks, the third hotspot code block in the at least two hotspot code blocks..., the Nth hotspot code block in the at least two hotspot code blocks.
[0045] Step S104: Send the target configuration file to the client, where the target configuration file is used to instruct the client to compile the startup code and the at least two hotspot code blocks in stages.
[0046] In some embodiments, after generating the target configuration file, the server can send the target configuration file to the client to instruct the client to compile the startup code and at least two hotspot code blocks in stages to reduce the impact of the installation phase on the installation speed. At the same time, more hotspot codes can be sampled for compilation, avoiding the impact of excessive sampling on the installation speed and optimizing the performance of the application to the greatest extent.
[0047] As a method, the server can send the target configuration file to the client to instruct the client to compile the startup code during the installation phase of the target application, and then compile multiple hotspot code blocks in sequence during the background idle phase of the electronic device, etc., without limitation here.
[0048] As another way, the target configuration file may include startup-profile and other-profiles, wherein startup-profile represents hotspot codes related to startup and layout, which may include only startup code, or startup code and some hotspot code blocks, and other-profiles represents the remaining configuration files different from startup-profile. After downloading the target application, the first thing that needs to be compiled is the startup-profile of the hotspot code related to the startup of the target application, in order to improve the startup speed of the application. Subsequent other profiles can be compiled step by step according to the importance of other profiles to gradually improve the performance of the application.
[0049] A hotspot code processing method provided by an embodiment of the present application obtains the startup code of the target application during the startup process, and obtains multiple hotspot codes of the target application during use, splits the multiple hotspot codes according to specified conditions to obtain at least two hotspot code blocks, generates a target configuration file based on the startup code and the at least two hotspot code blocks, and sends the target configuration file to the client. The target configuration file is used to instruct the client to compile the startup code and the at least two hotspot code blocks in stages, so as to obtain at least two hotspot code blocks by splitting the multiple hotspot codes of the application, and then generating the target configuration file based on the startup code and the at least two hotspot code blocks, so as to speed up the installation speed of the application and optimize the performance of the application.
[0050] See also Figure 4 , Figure 4 A flowchart of a hotspot code processing method provided by another embodiment of the present application is shown. The method is applied to the above server. Figure 4 The process shown is described in detail, and the hotspot code processing method may specifically include the following steps:
[0051] Step S201: Acquire the attribute information and current configuration file of the target application.
[0052] In some embodiments, after determining the target application used by the user, the attribute information and current configuration file of the target application can be obtained. In some embodiments, the attribute information of the target application and the configuration file (app profile) during use can be collected, and the collected configuration file can be used as the current configuration file corresponding to the target application. Specifically, the target application can include multiple different applications, so the current configuration file can include multiple different configuration files, one application corresponds to one configuration file, and the attribute information can include multiple different attribute information, one application corresponds to one attribute information. Among them, the attribute information and the current configuration file corresponding to the target application can be collected by the client and uploaded to the server, and accordingly, the server can obtain the attribute information and the current configuration file corresponding to the target application uploaded by the client. Among them, the attribute information of the target application can include the package name, version number, etc. of the target application, which is not limited here. Among them, the current configuration file of the target application can record the startup code identifier and hotspot code identifier of the target application, etc., which are not limited here.
[0053] In some implementations, after obtaining the current configuration file of the target application, the server may also clean the current configuration file to remove incomplete configuration files and invalid configuration files in the obtained current configuration file to ensure the validity of the determined current configuration file.
[0054] Step S202: extracting a code record file from the installation package corresponding to the target application based on the attribute information, and obtaining all codes recorded in the code record file.
[0055] In some implementations, based on the acquired attribute information of the target application, the installation package (APK) file corresponding to the target application can be acquired, and the code record (dex) file can be extracted from the installation package file to find all the codes (methods) recorded in the code record file, which can be recorded as a method set. For example, the attribute information of the target application includes the version number of the target application, and the installation package file corresponding to the version number can be acquired, and the code record file can be extracted from the installation package file to find all the codes of the target application of this version recorded in the code record file.
[0056] Step S203: extracting the startup code identifier of the target application during the startup process from the current configuration file.
[0057] In some implementations, after obtaining the current configuration file of the target application, the startup code identifier of the target application during the startup process can be extracted from the current configuration file. Among them, the current configuration file records numbers, such as startup methods: 10021, 10022, 10023, etc., which represent a serial number in all codes. In this embodiment, it is necessary to find out the startup_method_ids of each application corresponding to each configuration file in the current configuration file. An application has multiple code record files (dex), and this startup_method_ids corresponds to each code record file. Later, according to this id, after listing all the codes in the code record file of the application, it can be restored to the specific code.
[0058] In this embodiment, in the current configuration file, if the hot code used at startup is marked as startup methods, if the non-hot function used at startup is marked as post startup methods, these two parts of method id are extracted and recorded as startup_method_ids, which indicates the startup-related code representation. The id is saved in digital form, indicating the index of each method in the method_ids list in each code recording file, that is, there is a method_ids list structure in the code recording file that saves all the method related information. The index here is the serial number of the corresponding method in the table. Among them, this part is to obtain the startup-related code, which can be called startupmethods. This part of the code does not necessarily meet the execution times in JIT (when the execution times in JIT reach the default value, it will be recorded as hot code), but because it is related to the startup of the target application and affects the startup speed of the application, it is also considered to be a hot code. Therefore, the startup code identifier of all the codes involved in the startup process of the target application can be obtained.
[0059] Step S204: extracting the startup code corresponding to the startup code identifier from all the codes.
[0060] In some implementations, after all codes and the boot code identifier recorded in the code record file are obtained, the boot code corresponding to the boot code identifier may be extracted from all the codes to obtain a specific boot code.
[0061] Step S205: Acquire the attribute information and current configuration file of the target application.
[0062] Step S206: based on the attribute information, extract the code record file from the installation package corresponding to the target application, and obtain all the codes recorded in the code record file.
[0063] For the detailed description of step S205 - step S206 , please refer to step S201 - step S202 , which will not be repeated here.
[0064] Step S207: extracting multiple hotspot code identifiers of the target application during use from the current configuration file.
[0065] In some implementations, after obtaining the current configuration file of the target application, the hot code identifiers of the target application during use can be extracted from the current configuration file. Among them, the current configuration file records numbers, such as hot methods: 10000, 10031, 10151, etc., which represent a serial number in all codes. In this embodiment, it is necessary to find out the hot_method_ids of each application corresponding to each configuration file in the current configuration file. An application has multiple code record files (dex), and this hot_method_ids corresponds to each code record file. Later, according to this id, after listing all the codes in the code record file of the application, it can be restored to the specific code.
[0066] In this embodiment, the method id in each configuration file in the current configuration file can be extracted and recorded as hot_method_ids, which represents all hot code representations in the current configuration file. The id is saved in digital form, indicating the index of each method in the method_ids list in each code recording file, that is, there is a method_ids list structure in the code recording file that saves all method related information. The index here is the serial number of the corresponding method in the table.
[0067] Step S208: extracting a plurality of hotspot codes corresponding to the plurality of hotspot code identifiers from the plurality of codes, wherein the plurality of hotspot code identifiers correspond one-to-one to the plurality of hotspot codes.
[0068] In some embodiments, after obtaining all codes recorded in the code record file and multiple hotspot code identifiers, multiple hotspot codes corresponding to the multiple hotspot code identifiers can be extracted from all the codes, wherein the multiple hotspot code identifiers correspond one-to-one to the multiple hotspot codes to obtain specific multiple hotspot codes.
[0069] Step S209: Obtain the number of the multiple hotspot codes.
[0070] In some implementations, after extracting a plurality of hotspot codes, the number of the plurality of hotspot codes may be obtained, the size of the plurality of hotspot codes may be obtained, etc., which are not limited here.
[0071] Step S210: When the number of the plurality of hotspot codes is greater than the number threshold, the plurality of hotspot codes are segmented according to the specified condition to obtain at least two hotspot code blocks.
[0072] In some embodiments, the server pre-sets and stores a quantity threshold, which is used as a basis for judging the number of multiple hotspot codes. Therefore, in this embodiment, after obtaining the number of multiple hotspot codes, the number of multiple hotspot codes can be compared with the quantity threshold to determine whether the number of multiple hotspot codes is greater than the quantity threshold. Among them, when the judgment result indicates that the number of multiple hotspot codes is greater than the quantity threshold, it can be determined that the number of multiple hotspot codes is too large. If the multiple hotspot codes are not segmented, the installation speed of the target application will be affected, affecting the user experience. Therefore, the multiple hotspot codes can be segmented according to specified conditions to obtain at least two hotspot code blocks. When the judgment result indicates that the number of multiple hotspot codes is not greater than the quantity threshold, it can be determined that the number of multiple hotspot codes is normal. If the multiple hotspot codes are not segmented, the installation speed of the target application will not be affected, and the multiple hotspot codes may not be segmented.
[0073] Step S211: Generate a target configuration file based on the startup code and the at least two hotspot code blocks.
[0074] Step S212: Send the target configuration file to the client, where the target configuration file is used to instruct the client to compile the startup code and the at least two hotspot code blocks in stages.
[0075] For the detailed description of step S211 - step S212 , please refer to step S103 - step S104 , which will not be repeated here.
[0076] Another embodiment of the present application provides a hotspot code processing method, which obtains the attribute information and current configuration file of the target application, extracts the code recording file from the installation package corresponding to the target application based on the attribute information, obtains all the codes recorded in the code recording file, extracts the startup code identifier of the target application during the startup process from the current configuration file, and extracts the startup code corresponding to the startup code identifier from all the codes. Obtain the attribute information and current configuration file of the target application, extracts the code recording file from the installation package corresponding to the target application based on the attribute information, obtains all the codes recorded in the code recording file, extracts multiple hotspot code identifiers of the target application during use from the current configuration file, and extracts multiple hotspot codes corresponding to the multiple hotspot code identifiers from all the codes. Obtain the number of multiple hotspot codes, and when the number of hotspot codes is greater than the number threshold, split the multiple hotspot codes according to the specified conditions to obtain at least two hotspot code blocks, generate a target configuration file based on the startup code and the at least two hotspot code blocks, and send the target configuration file to the client to compile the startup code and at least two hotspot code blocks in stages. Compared to Figure 3 The hotspot code processing method shown in this embodiment also extracts the startup code from the code recording file through the startup code identifier, and extracts multiple hotspot codes from the code recording file through multiple hotspot code identifiers to improve the accuracy of the acquired startup code and multiple hotspot codes.
[0077] See also Figure 5 , Figure 5 A flowchart of a hotspot code processing method provided by another embodiment of the present application is shown. The method is applied to the above server. Figure 5 The process shown is described in detail, and the hotspot code processing method may specifically include the following steps:
[0078] Step S301: Acquire the attribute information and current configuration file of the target application.
[0079] Step S302: based on the attribute information, extract a code record file from the installation package corresponding to the target application, and obtain all codes recorded in the code record file.
[0080] Step S303: extracting the startup code identifier of the target application during the startup process from the current configuration file.
[0081] Step S304: extracting the startup code corresponding to the startup code identifier from all the codes.
[0082] Step S305: Acquire the attribute information and current configuration file of the target application.
[0083] Step S306: based on the attribute information, extract the code record file from the installation package corresponding to the target application, and obtain all the codes recorded in the code record file.
[0084] Step S307: extracting multiple hotspot code identifiers of the target application during use from the current configuration file.
[0085] Step S308: extracting a plurality of hotspot codes corresponding to the plurality of hotspot code identifiers from the plurality of codes, wherein the plurality of hotspot code identifiers correspond one-to-one to the plurality of hotspot codes.
[0086] For the detailed description of steps S301 to S308 , please refer to steps S201 to S208 , which will not be repeated here.
[0087] Step S309: respectively obtain the heat value corresponding to each of the multiple hotspot codes.
[0088] In some embodiments, after obtaining multiple hotspot codes, the heat value corresponding to each hotspot code in the multiple hotspot codes can be obtained respectively. For example, if the multiple hotspot codes include hotspot code A, hotspot code B and hotspot code C, the heat value corresponding to hotspot code A, the heat value corresponding to hotspot code B and the heat value corresponding to hotspot code C can be obtained respectively. Among them, in this embodiment, the heat value corresponding to each hotspot code can be determined according to the number of times each hotspot code is used, the importance, the number of hotspot code occurrences / the number of configuration files, and the more times the hotspot code is used, the higher the heat value corresponding to the hotspot code; the fewer times the hotspot code is used, the lower the heat value corresponding to the hotspot code; the higher the importance of the hotspot code, the higher the heat value corresponding to the hotspot code; the lower the importance of the hotspot code, the lower the heat value corresponding to the hotspot code; the greater the number of hotspot code occurrences / the number of configuration files, the higher the heat value corresponding to the hotspot code; the smaller the number of hotspot code occurrences / the number of configuration files, the lower the heat value corresponding to the hotspot code.
[0089] Step S310: Based on the heat value corresponding to each hotspot code and a plurality of pre-set heat intervals, the plurality of hotspot codes are segmented to obtain at least two hotspot code blocks, wherein one heat interval corresponds to one hotspot code block.
[0090] In some embodiments, the server pre-sets and stores multiple heat intervals, which are used as the basis for distinguishing the heat value of each hot code. Therefore, in this embodiment, after obtaining the heat value of each hot code in the multiple hot codes, the multiple hot codes can be segmented based on the heat value of each hot code and the pre-set multiple heat intervals to obtain at least two hot code blocks, for example, multiple hot method files such as hot_methods_01, hot_methods_02, hot_methods_03, etc. are segmented.
[0091] For example, if multiple heat intervals include heat interval 1, heat interval 2, and heat interval 3, and multiple hot spot codes include hot spot code A, hot spot code B, and hot spot code C, when the heat value corresponding to hot spot code A is within heat interval 1, hot spot code A can be divided into heat interval 1; when the heat value corresponding to hot spot code B is within heat interval 2, hot spot code B can be divided into heat interval 2; when the heat value corresponding to hot spot code C is within heat interval 3, hot spot code C can be divided into heat interval 3, and so on.
[0092] Step S311: Based on the startup code, generate a first target configuration file including the startup code.
[0093] In some implementations, after determining the boot code, a first target configuration file including the boot code may be generated. As a method, the first target configuration file may be a configuration file recording an index or identifier of the boot code, or a configuration file recording the boot code, which is not limited here.
[0094] Step S312: generating at least two second target configuration files based on the at least two hotspot code blocks, wherein one second target configuration file includes one hotspot code block.
[0095] In some embodiments, after determining at least two hot code blocks, at least two second target configuration files may be generated, wherein one second target configuration file includes one hot code block. As a method, the second target configuration file may be a configuration file that records the index or identifier of the hot code block, or may be a configuration file that records the hot code block, which is not limited here.
[0096] Step S313: jointly determining the first target configuration file and the at least two second target configuration files as the target configuration file.
[0097] Optionally, after multiple hotspot codes are segmented, a hotspot code block can correspond to a hotspot interval. Among them, it is necessary to clarify that the purpose of cutting hotspot codes is to avoid compiling at once during installation, which takes too long (compile during installation, and users can use it after installation or optimize the experience), or if it is not compiled during installation, it is compiled at the first startup (the first startup of the application usually requires a pop-up window to grant permissions, and the compilation at this time can also try to avoid affecting the user experience). In order to reduce the impact of compilation (it will take time, power, CPU, etc.), it is proposed to cut hotspots and compile in stages. Dividing into multiple target configuration files is equivalent to dividing into multiple hotspot information carriers, which can be compiled and used at different stages. Finally, after compilation, they can be synthesized into one file (or understood as constantly adding content to the same file), that is, the target configuration file.
[0098] Step S314: Send the first target configuration file to the client, where the first target configuration file is used to instruct the client to precompile the startup code during the installation phase.
[0099] In some implementations, since the first target configuration file includes a startup code, that is, the first configuration file is related to the startup of the target application, the client may be instructed to precompile the startup code through AOT during the installation phase to increase the startup speed of the target application.
[0100] Step S315: Send the at least two second target configuration files to the client, where the second target configuration files are used to instruct the client to precompile the at least two hot code blocks step by step in a background idle phase according to the order of importance of the at least two second target configuration files from high to low.
[0101] In some embodiments, since the second target configuration file includes a hotspot code block, that is, the second configuration file is related to the use of the target application, the client can be instructed not to pre-compile during the installation phase, but to pre-compile the hotspot code block through AOT during the background idle phase to reduce the impact of the installation phase on the installation speed. In the background idle phase of the client, the at least two hotspot code blocks can be pre-compiled step by step in the order of importance of at least two second target configuration files from high to low. In the background idle phase of the client, it can include but is not limited to: the electronic device is in the charging phase, the night phase, etc., which is not limited here.
[0102] Another embodiment of the present application provides a hotspot code processing method, which obtains the attribute information and current configuration file of the target application, extracts the code record file from the installation package corresponding to the target application based on the attribute information, obtains all the codes recorded in the code record file, extracts the startup code identifier of the target application during the startup process from the current configuration file, and extracts the startup code corresponding to the startup code identifier from all the codes. The attribute information and current configuration file of the target application are obtained, and the code record file is extracted from the installation package corresponding to the target application based on the attribute information, and obtains all the codes recorded in the code record file, extracts multiple hotspot code identifiers of the target application during use from the current configuration file, and extracts multiple hotspot codes corresponding to the multiple hotspot code identifiers from all the codes. Respectively obtain the heat value corresponding to each of the multiple hotspot codes, segment the multiple hotspot codes based on the heat value corresponding to each hotspot code and the pre-set multiple heat intervals, obtain at least two hotspot code blocks, generate a first target configuration file including the startup code based on the startup code, generate at least two second target configuration files based on the at least two hotspot code blocks, jointly determine the first target configuration file and the at least two second target configuration files as the target configuration file, send the first target configuration file to the client, the first target configuration file is used to instruct the client to precompile the startup code during the installation phase, send at least two second target configuration files to the client, the second target configuration file is used to instruct the client to gradually compile at least two hotspot code blocks in the background idle phase according to the order of importance of the at least two second target configuration files from high to low. Compared to Figure 3 In the hotspot code processing method shown in the figure, this embodiment further extracts the startup code from the code recording file through the startup code identifier, and extracts multiple hotspot codes from the code recording file through multiple hotspot code identifiers to improve the accuracy of the acquired startup code and multiple hotspot codes. In addition, this embodiment also divides multiple hotspot codes according to heat intervals to improve the accuracy of hotspot code segmentation.
[0103] See also Figure 6 , Figure 6 A flowchart of a hotspot code processing method provided by another embodiment of the present application is shown. The hotspot code processing method is used to obtain at least two hotspot code blocks by segmenting multiple hotspot codes of an application, and then generate a target configuration file based on the startup code and the at least two hotspot code blocks to speed up the installation speed of the application and optimize the performance of the application. In a specific embodiment, the hotspot code processing method is applied to Figure 8 The hotspot code processing device 400 and the server 100 ( Fig.10). The following will take an electronic device as an example to illustrate the specific process of this embodiment. Of course, it can be understood that the server used in this embodiment can be a smart phone, a tablet computer, a wearable electronic device, etc., which is not limited here. Figure 6 The process shown is described in detail, and the hotspot code processing method may specifically include the following steps:
[0104] Step S410: receiving a target configuration file sent by a server, wherein the target configuration file is generated based on a startup code of a target application during startup and at least two hotspot code blocks, wherein the at least two hotspot code blocks are obtained by segmenting multiple hotspot codes during use of the target application.
[0105] Step S420: Based on the target configuration file, compile the startup code and the at least two hotspot code blocks in stages.
[0106] For the detailed description of step S410 to step S420, please refer to step S101 to step S104, which will not be repeated here.
[0107] Another embodiment of the present application provides a hotspot code processing method, which receives a target configuration file sent by a server, wherein the target configuration file is generated based on a startup code and at least two hotspot code blocks of a target application during startup, wherein the at least two hotspot code blocks are obtained by segmenting multiple hotspot codes of the target application during use, and based on the target configuration file, the startup code and at least two hotspot code blocks are compiled in stages, thereby obtaining at least two hotspot code blocks by segmenting multiple hotspot codes of the application, and then generating a target configuration file based on the startup code and at least two hotspot code blocks, so as to speed up the installation speed of the application and optimize the performance of the application.
[0108] See also Figure 7 , Figure 7 The module block diagram of the hotspot code processing device 300 provided by an embodiment of the present application is shown. The hotspot code processing device 300 is applied to the above server. Figure 7 The hotspot code processing device 300 includes: a code acquisition module 310, a code segmentation module 320, a configuration file generation module 330 and a configuration file delivery module 340, wherein:
[0109] The code acquisition module 310 is used to acquire the startup code of the target application during the startup process, and acquire multiple hotspot codes of the target application during the use process.
[0110] Furthermore, the code acquisition module 310 includes: a first acquisition submodule, a first code acquisition submodule, a startup code identification extraction submodule and a startup code extraction submodule, wherein:
[0111] The first acquisition submodule is used to acquire the attribute information and current configuration file of the target application.
[0112] The first code acquisition submodule is used to extract a code record file from the installation package corresponding to the target application based on the attribute information, and acquire all codes recorded in the code record file.
[0113] The startup code identifier extraction submodule is used to extract the startup code identifier of the target application during the startup process from the current configuration file.
[0114] The startup code extraction submodule is used to extract the startup code corresponding to the startup code identifier from all the codes.
[0115] Furthermore, the code acquisition module 310 includes: a second acquisition submodule, a second code acquisition submodule, a hotspot code identification extraction submodule and a hotspot code extraction submodule, wherein:
[0116] The second acquisition submodule is used to acquire the attribute information and current configuration file of the target application.
[0117] The second code acquisition submodule is used to extract a code record file from the installation package corresponding to the target application based on the attribute information, and acquire all codes recorded in the code record file.
[0118] The hotspot code identifier extraction submodule is used to extract multiple hotspot code identifiers of the target application during use from the current configuration file.
[0119] The hotspot code extraction submodule is used to extract a plurality of hotspot codes corresponding to the plurality of hotspot code identifiers from the plurality of codes, wherein the plurality of hotspot code identifiers correspond to the plurality of hotspot codes one by one.
[0120] The code segmentation module 320 is used to segment the multiple hotspot codes according to specified conditions to obtain at least two hotspot code blocks.
[0121] Furthermore, the code segmentation module 320 includes: a quantity acquisition submodule and a first code segmentation submodule, wherein:
[0122] The quantity acquisition submodule is used to obtain the quantity of the multiple hotspot codes.
[0123] The first code segmentation submodule is used to segment the multiple hotspot codes according to the specified condition to obtain at least two hotspot code blocks when the number of the multiple hotspot codes is greater than the number threshold.
[0124] Furthermore, the code segmentation module 320 includes: a heat value acquisition submodule and a second code segmentation submodule, wherein:
[0125] The heat value acquisition submodule is used to respectively acquire the heat value corresponding to each of the multiple hotspot codes.
[0126] The second code segmentation submodule is used to segment the multiple hot code blocks based on the heat value corresponding to each hot code and multiple pre-set heat intervals to obtain at least two hot code blocks, wherein one heat interval corresponds to one hot code block.
[0127] The configuration file generating module 330 is used to generate a target configuration file based on the startup code and the at least two hotspot code blocks.
[0128] Furthermore, the configuration file generation module 330 includes: a first configuration file generation submodule, a second configuration file generation submodule and a target configuration file generation submodule, wherein:
[0129] The first configuration file generating submodule is used to generate a first target configuration file including the startup code based on the startup code.
[0130] The second configuration file generation submodule is used to generate at least two second target configuration files based on the at least two hotspot code blocks, wherein one second target configuration file includes one hotspot code block.
[0131] The target profile generating submodule is configured to jointly determine the first target profile and the at least two second target profiles as the target profile.
[0132] The configuration file sending module 340 is used to send the target configuration file to the client, and the target configuration file is used to instruct the client to compile the startup code and the at least two hot code blocks in stages.
[0133] Furthermore, the configuration file sending module 340 includes: a first configuration file sending submodule and a second configuration file sending submodule, wherein:
[0134] The first configuration file sending submodule is used to send the first target configuration file to the client, and the first target configuration file is used to instruct the client to precompile the startup code during the installation phase.
[0135] The second configuration file sending submodule is used to send the at least two second target configuration files to the client, and the second target configuration file is used to instruct the client to pre-compile the at least two hot code blocks step by step in the background idle stage according to the order of importance of the at least two second target configuration files from high to low.
[0136] See also Figure 8 , Figure 8 The module block diagram of the hotspot code processing device 400 provided by another embodiment of the present application is shown. The hotspot code processing device 400 is applied to the above electronic device. Figure 8 The hotspot code processing device 400 includes: a configuration file receiving module 410 and a code compiling module 420, wherein:
[0137] The configuration file receiving module 410 is used to receive the target configuration file sent by the server. The target configuration file is generated based on the startup code of the target application during the startup process and at least two hot code blocks. The at least two hot code blocks are obtained by segmenting multiple hot code blocks during the use of the target application.
[0138] The code compiling module 420 is used to compile the startup code and the at least two hotspot code blocks in stages based on the target configuration file.
[0139] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the above-described devices and modules can refer to the corresponding processes in the aforementioned method embodiments, and will not be repeated here.
[0140] In several embodiments provided in the present application, the coupling between modules may be electrical, mechanical or other forms of coupling.
[0141] In addition, each functional module in each embodiment of the present application can be integrated into a processing module, or each module can exist physically separately, or two or more modules can be integrated into one module. The above integrated modules can be implemented in the form of hardware or software functional modules.
[0142] See also Fig. 9, which shows a structural block diagram of a server 100 provided in an embodiment of the present application. The server 100 may be a traditional server or a cloud server, etc. 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 application programs, wherein the one or more application programs may be stored in the memory 140 and configured to be executed by one or more processors 130, and the one or more programs are configured to execute the method described in the aforementioned method embodiment.
[0143] Among them, the processor 130 may include one or more processing cores. The processor 130 uses various interfaces and lines to connect various parts within the entire server 100, and executes various functions and processes data of the server 100 by running or executing instructions, programs, code sets or instruction sets stored in the memory 140, and calling data stored in the memory 140. Optionally, the processor 130 can be implemented in at least one hardware form of digital signal processing (Digital Signal Processing, DSP), field programmable gate array (Field-Programmable Gate Array, FPGA), and programmable logic array (Programmable Logic Array, PLA). The processor 110 can integrate one or a combination of a central processing unit (Central Processing Unit, CPU), a graphics processing unit (Graphics Processing Unit, GPU) and a modem. Among them, the CPU mainly processes the operating system, user interface and application programs; the GPU is responsible for rendering and drawing the content to be displayed; and the modem is used to process wireless communications. It can be understood that the above-mentioned modem may not be integrated into the processor 130, but may be implemented separately through a communication chip.
[0144] The memory 140 may include a random access memory (RAM) or a read-only memory (ROM). The memory 140 may be used to store instructions, programs, codes, code sets or instruction sets. The memory 140 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for implementing at least one function (such as a touch function, a sound playback function, an image playback function, etc.), instructions for implementing the following various method embodiments, etc. The data storage area may also store data (such as a phone book, audio and video data, chat record data) created by the server 100 during use.
[0145] See also Fig.10, which shows a structural block diagram of an electronic device 200 provided in an embodiment of the present application. The electronic device 200 may be an electronic device capable of running applications, such as a smart phone, a tablet computer, an e-book, etc. 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 one or more processors 210, and the one or more programs are configured to execute the method described in the aforementioned method embodiment.
[0146] Among them, the processor 210 may include one or more processing cores. The processor 210 uses various interfaces and lines to connect various parts within the entire electronic device 200, and executes various functions and processes data of the electronic device 200 by running or executing instructions, programs, code sets or instruction sets stored in the memory 220, and calling data stored in the memory 220. Optionally, the processor 210 can be implemented in at least one hardware form of digital signal processing (Digital Signal Processing, DSP), field programmable gate array (Field-Programmable Gate Array, FPGA), and programmable logic array (Programmable Logic Array, PLA). The processor 210 can integrate one or a combination of a central processing unit (Central Processing Unit, CPU), a graphics processing unit (Graphics Processing Unit, GPU) and a modem. Among them, the CPU mainly processes the operating system, user interface and application programs; the GPU is responsible for rendering and drawing the content to be displayed; and the modem is used to process wireless communications. It can be understood that the above-mentioned modem may not be integrated into the processor 210, but may be implemented separately through a communication chip.
[0147] The memory 220 may include a random access memory (RAM) or a read-only memory (ROM). The memory 220 may be used to store instructions, programs, codes, code sets or instruction sets. The memory 220 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for implementing at least one function (such as a touch function, a sound playback function, an image playback function, etc.), instructions for implementing the following various method embodiments, etc. The data storage area may also store data (such as a phone book, audio and video data, chat record data) created by the electronic device 200 during use.
[0148] See also Fig.11 , which shows a structural block diagram of a computer-readable storage medium provided in an embodiment of the present application. The computer-readable medium 500 stores program codes, which can be called by a processor to execute the method described in the above method embodiment.
[0149] 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. Optionally, the computer-readable storage medium 500 includes a non-transitory computer-readable storage medium. The computer-readable storage medium 500 has storage space for program code 510 that performs any method steps in the above method. These program codes can be read from or written to one or more computer program products. The program code 510 can be compressed, for example, in an appropriate form.
[0150] In summary, the hotspot code processing method, device, server, electronic device and storage medium provided in the embodiments of the present application obtain the startup code of the target application during the startup process, and obtain multiple hotspot codes of the target application during use, and segment the multiple hotspot codes according to specified conditions to obtain at least two hotspot code blocks. Based on the startup code and the at least two hotspot code blocks, a target configuration file is generated, and the target configuration file is sent to the client. The target configuration file is used to instruct the client to compile the startup code and at least two hotspot code blocks in stages, so as to obtain at least two hotspot code blocks by segmenting the multiple hotspot codes of the application, and then generate a target configuration file based on the startup code and the at least two hotspot code blocks, so as to speed up the installation speed of the application and optimize the performance of the application.
[0151] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present application.
Claims
1. A hotspot code processing method, characterized in that: The method comprises: Obtaining a startup code of a target application during startup, and obtaining a plurality of hotspot codes of the target application during use; Segment the plurality of hotspot codes according to specified conditions to obtain at least two hotspot code blocks; Generate a target configuration file based on the startup code and the at least two hotspot code blocks; Sending the target configuration file to the client, the target configuration file is used to instruct the client to precompile the startup code during the installation phase of the target application, and to precompile the at least two hotspot code blocks step by step during the background idle phase; The step of segmenting the plurality of hotspot codes according to the specified conditions to obtain at least two hotspot code blocks includes: Respectively obtain the heat value corresponding to each of the multiple hotspot codes; Based on the heat value corresponding to each hot code and a plurality of pre-set heat intervals, the plurality of hot codes are segmented to obtain at least two hot code blocks, wherein one heat interval corresponds to one hot code block.
2. The method according to claim 1, characterized in that The step of obtaining the startup code of the target application during the startup process includes: Obtaining attribute information and current configuration file of the target application; Based on the attribute information, extract a code recording file from the installation package corresponding to the target application, and obtain all codes recorded in the code recording file; Extracting a startup code identifier of the target application during startup from the current configuration file; A startup code corresponding to the startup code identifier is extracted from all the codes.
3. The method according to claim 1, characterized in that The step of obtaining a plurality of hotspot codes of the target application during use includes: Obtaining attribute information and current configuration file of the target application; Based on the attribute information, extract a code recording file from the installation package corresponding to the target application, and obtain all codes recorded in the code recording file; Extracting multiple hotspot code identifiers of the target application during use from the current configuration file; A plurality of hotspot codes corresponding to the plurality of hotspot code identifiers are extracted from all the codes, wherein the plurality of hotspot code identifiers correspond one-to-one to the plurality of hotspot codes.
4. The method according to claim 1, characterized in that: The step of segmenting the plurality of hotspot codes according to the specified conditions to obtain at least two hotspot code blocks includes: Obtain the number of the multiple hotspot codes; When the number of the plurality of hotspot codes is greater than the number threshold, the plurality of hotspot codes are segmented according to the specified condition to obtain at least two hotspot code blocks.
5. The method according to claim 1, characterized in that The step of generating a target configuration file based on the startup code and the at least two hotspot code blocks includes: Based on the startup code, generating a first target configuration file including the startup code; Based on the at least two hotspot code blocks, generating at least two second target configuration files, wherein one second target configuration file includes one hotspot code block; The first target profile and the at least two second target profiles are jointly determined as the target profile.
6. The method according to claim 5, characterized in that The sending of the target configuration file to the client, wherein the target configuration file is used to instruct the client to compile the startup code and the at least two hotspot code blocks in stages, includes: Sending the first target configuration file to the client, wherein the first target configuration file is used to instruct the client to precompile the startup code during the installation phase; The at least two second target configuration files are sent to the client, where the second target configuration files are used to instruct the client to precompile the at least two hotspot code blocks step by step in a background idle phase according to the order of importance of the at least two second target configuration files from high to low.
7. A hotspot code processing method, characterized in that: The method comprises: Receive a target configuration file sent by a server, the target configuration file is generated based on a startup code of a target application during startup and at least two hotspot code blocks, the at least two hotspot code blocks are obtained by segmenting the multiple hotspot codes according to heat values corresponding to the multiple hotspot codes during use of the target application and multiple pre-set heat intervals, wherein one heat interval corresponds to one hotspot code block; Based on the target configuration file, the startup code is pre-compiled during the installation phase of the target application, and the at least two hotspot code blocks are gradually pre-compiled during the background idle phase.
8. A hotspot code processing device, characterized in that: The device comprises: A code acquisition module is used to acquire the startup code of the target application during the startup process, and acquire multiple hotspot codes of the target application during use; A code segmentation module, used to segment the multiple hotspot codes according to specified conditions to obtain at least two hotspot code blocks; A configuration file generating module, used for generating a target configuration file based on the startup code and the at least two hot code blocks; A configuration file sending module, used for sending the target configuration file to the client, wherein the target configuration file is used for instructing the client to precompile the startup code during the installation phase of the target application, and to precompile the at least two hotspot code blocks step by step during the background idle phase; Wherein, the code segmentation module includes: A heat value acquisition submodule, used to respectively acquire the heat value corresponding to each of the multiple hotspot codes; The second code segmentation submodule is used to segment the multiple hot code blocks based on the heat value corresponding to each hot code and multiple pre-set heat intervals to obtain at least two hot code blocks, wherein one heat interval corresponds to one hot code block.
9. A hotspot code processing device, characterized in that: The device comprises: A configuration file receiving module, used to receive a target configuration file sent by a server, wherein the target configuration file is generated based on a startup code of a target application during startup and at least two hotspot code blocks, wherein the at least two hotspot code blocks are obtained by segmenting the multiple hotspot codes according to heat values corresponding to the multiple hotspot codes during use of the target application and multiple pre-set heat intervals, wherein one heat interval corresponds to one hotspot code block; The code compiling module is used to precompile the startup code in the installation phase of the target application based on the target configuration file, and to precompile the at least two hotspot code blocks step by step in the background idle phase.
10. A server, characterized in that: The method comprises a memory and a processor, wherein the memory is coupled to the processor, and the memory stores instructions. When the instructions are executed by the processor, the processor executes the method according to any one of claims 1 to 6.
11. An electronic device, characterized in that: The method comprises a memory and a processor, wherein the memory is coupled to the processor, the memory stores instructions, and when the instructions are executed by the processor, the processor performs the method according to claim 7.
12. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores program codes, which can be called by a processor to execute the method according to any one of claims 1 to 6 or the method according to claim 7.