Configuration file push method, device, server and storage medium

By receiving the acquisition request of the terminal device on the server side, obtaining the application category and pushing the corresponding configuration file, the problem of excessive server burden in the existing technology is solved, and the effect of reducing server burden and improving application operation efficiency is achieved.

CN112948012BActive Publication Date: 2025-01-21GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN201911176848.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2019-11-26
Publication Date
2025-01-21
Estimated Expiration
2039-11-26

AI Technical Summary

Technical Problem

In the prior art, manufacturers need to collect and maintain a large amount of hot-spot code, resulting in excessive burden on the server.

Method used

By receiving an acquisition request from the terminal device, the application category to which the first target application belongs is obtained, and the configuration file of the second target application is obtained from multiple applications of the same application category. The configuration file at least includes the hotspot code, and then the configuration file is Pushed to the terminal device for pre-compiling hot code.

Benefits of technology

It reduces the number of configuration files collected and stored by the server, reduces the load on the server, and improves the efficiency of terminal devices when running applications.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112948012B_ABST
    Figure CN112948012B_ABST
Patent Text Reader

Abstract

The present application discloses a configuration file push method, device, server and storage medium. The configuration file push method is applied to the server, and the configuration file push method includes: receiving an acquisition request sent by a terminal device, the acquisition request is used to obtain the hotspot code of a first target application; responding to the acquisition request, obtaining the application category to which the first target application belongs; obtaining a configuration file corresponding to a second target application among multiple applications of the application category, the second target application is an application for which a configuration file currently exists in the multiple applications, and the configuration file at least includes the hotspot code; pushing the configuration file corresponding to the second target application to the terminal device, the configuration file is used by the terminal device to precompile the hotspot code to obtain a compiled file. This method can reduce the number of configuration files corresponding to the hotspot codes that the server needs to maintain.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and more specifically, to a configuration file push method, device, server and storage medium. Background Art

[0002] When using applications on terminal devices, frequently used methods or codes of the application are usually regarded as hot codes, and the hot codes are pre-compiled into binary machine codes. The compiled binary machine codes can be directly executed by the processor the next time the application is run, thereby improving the running speed of the application. Some manufacturers collect the hot codes of applications and push them to the user's terminal devices, but for the manufacturer's server, the amount of hot codes that need to be collected and maintained is relatively large. Summary of the invention

[0003] In view of the above problems, the present application proposes a configuration file push method, device, server and storage medium.

[0004] In the first aspect, an embodiment of the present application provides a method for pushing a configuration file, which is applied to a server, and the method includes: receiving an acquisition request sent by a terminal device, the acquisition request is used to obtain a hotspot code of a first target application; responding to the acquisition request, obtaining an application category to which the first target application belongs; obtaining a configuration file corresponding to a second target application among multiple applications of the application category, the second target application is an application for which a configuration file currently exists in the multiple applications, and the configuration file includes at least a hotspot code; pushing the configuration file corresponding to the second target application to the terminal device, the configuration file is used by the terminal device to pre-compile the hotspot code to obtain a compiled file.

[0005] In the second aspect, an embodiment of the present application provides a configuration file pushing device, which is applied to a server, and the device includes: a request receiving module, a request response module, a file acquisition module and a file pushing module, wherein the request receiving module is used to receive an acquisition request sent by a terminal device, and the acquisition request is used to obtain the hotspot code of a first target application; the request response module is used to respond to the acquisition request and obtain the application category to which the first target application belongs; the file acquisition module is used to obtain a configuration file corresponding to a second target application among multiple applications of the application category, the second target application is an application in which a configuration file currently exists in the multiple applications, and the configuration file at least includes the hotspot code; the file pushing module is used to push the configuration file corresponding to the second target application to the terminal device, and the configuration file is used by the terminal device to pre-compile the hotspot code to obtain a compiled file.

[0006] In a third aspect, an embodiment of the present application provides a server, comprising: one or more processors; a memory; one or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the one or more processors, and the one or more programs are configured to execute the configuration file push method provided in the first aspect above.

[0007] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, in which a program code is stored. The program code can be called by a processor to execute the configuration file push method provided in the first aspect above.

[0008] The solution provided by the present application receives an acquisition request sent by a terminal device, where the acquisition request is used to acquire the hotspot code of a first target application, responds to the acquisition request, acquires the application category to which the first target application belongs, and then acquires a configuration file corresponding to a second target application from multiple applications in the application category, where the second target application is an application for which a configuration file currently exists among multiple applications, and the configuration file includes at least the hotspot code. The configuration file corresponding to the second target application is then pushed to the terminal device, where the configuration file is used by the terminal device to precompile the hotspot code to obtain a compiled file, thereby making it possible to push configuration files of hotspot codes of applications belonging to the same category to the terminal device, thereby reducing the number of configuration files collected and stored by the server, and thereby reducing the burden on the server. BRIEF DESCRIPTION OF THE DRAWINGS

[0009] 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 creative work.

[0010] Figure 1 A schematic diagram showing an application scenario provided by an embodiment of the present application is shown.

[0011] Figure 2 Another schematic diagram of an application scenario provided by an embodiment of the present application is shown.

[0012] Figure 3 A flow chart of a method for pushing a configuration file according to an embodiment of the present application is shown.

[0013] Figure 4 A flow chart of a method for pushing a configuration file according to another embodiment of the present application is shown.

[0014] Figure 5 A flow chart of a method for pushing a configuration file according to yet another embodiment of the present application is shown.

[0015] Figure 6 A flow chart of a method for pushing a configuration file according to another embodiment of the present application is shown.

[0016] Figure 7 A block diagram of a configuration file push device according to an embodiment of the present application is shown.

[0017] Figure 8 It is a block diagram of a server for executing a method for pushing a configuration file according to an embodiment of the present application.

[0018] Fig. 9 It is a storage unit of an embodiment of the present application for storing or carrying a program code for implementing a method for pushing a configuration file according to an embodiment of the present application. DETAILED DESCRIPTION

[0019] 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.

[0020] Android has two virtual machine execution environments: Dalvik virtual machine and Art virtual machine. In the execution environment of Dalvik virtual machine, every time the application is run, the bytecode needs to be converted into machine code by the Just In Time compilation (JIT compiler) before it can be run by the device, which will slow down the execution efficiency of the application. In Android 4.4, the Art virtual machine began to replace the Dalvik virtual machine. In the initial Art virtual machine, when the application is installed for the first time, the system will use a tool called dex2oat to compile the dex file in the APK into an oat file containing local machine code and store it. After doing this, when the program is executed, the compiled machine code can be directly used to speed up the efficiency. This mechanism of pre-compiling machine code is called Ahead Of Time (AOT). The disadvantage of AOT is that the application optimization process after application installation and system upgrade is time-consuming (the dex bytecode needs to be recompiled into local machine code), and the optimized file will take up additional storage space.

[0021] Since the simple use of JIT and AOT will have a certain impact on performance, in order to better speed up the compilation efficiency and improve the user experience, corresponding adjustments were made later. In the Art virtual machine environment, the original AOT was changed to an interpreter (Interpreter) + JIT + AOT mixed compilation, and the PGO mechanism was introduced, as follows: During the installation of the application, the system will not perform AOT compilation on the .dex file; when the application is running, the code (cold code) that has not been identified by the hotspot will be directly executed through the JAVA parser first. During the execution process, when the virtual machine finds that a method or code block runs particularly frequently, it will be identified as a hot code (hot code), which will be 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 profile (configuration) file to record the information of the hot function; in addition to JIT compilation, when the device is idle and charging, the AOT compiler will also use the profile file to recompile the application to generate a .oat file, so that these hot codes no longer need to be JIT optimized at runtime after the next startup.

[0022] By using 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 code in the entire program. This approach can greatly improve the running performance of the program while minimizing the impact on the application installation speed and additional space occupied, and alleviate the disadvantages that may be caused by single JIT or AOT compilation.

[0023] In the solution of mixed compilation of interpreter + JIT + AOT, every time 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 a profile file that conforms to the user's usage habits, thereby optimizing the application and improving the speed. This means that the application's operating efficiency is not improved when the application is used for the first time. In addition, the application's profile file can only be optimized for the current version of the application. If the application version is upgraded, the system needs to collect the application's profile file again to optimize the program. If the application is upgraded frequently, the actual optimization time of the application will be greatly reduced. Therefore, it is difficult for this optimization mechanism to achieve an ideal level of improvement in system fluency.

[0024] Therefore, some manufacturers collect profile files of the hot code of applications from user devices and upload them to the cloud. Then they integrate the hot code of the application and generate a universal profile file. Whenever a user downloads an application from the app store, the profile file will be pushed to the user, and the application will be compiled during the installation process. With this method, users can experience the optimized application after installing the application and using it for the first time.

[0025] After research, the inventors found that in the solution for manufacturers to collect profile files of hotspot codes, it is necessary to collect profile files of hotspot codes for each application and thus for a large number of users' terminal devices, which brings a huge burden to the server.

[0026] In response to the above problems, the inventors have proposed a configuration file push method, device, server and storage medium provided in the embodiments of the present application. When receiving a request for obtaining the hotspot code of the first target application sent by the terminal device, the configuration file of the second target application belonging to the same category as the first target application, which configuration file at least includes the hotspot code, is pushed to the terminal device, so that the terminal device can precompile the hotspot code to obtain a compiled file for direct use when running the first target application, thereby reducing the number of configuration files collected and stored by the server, and further reducing the burden on the server. Among them, the specific configuration file push method is described in detail in the subsequent embodiments.

[0027] The following is an introduction to the application scenarios provided by the embodiments of the present application.

[0028] In some embodiments, see Figure 1 , Figure 1 A schematic diagram of an application scenario provided by an embodiment of the present application is shown, and the application scenario includes a configuration file push system 10, and the configuration file push system 10 includes: a terminal device 100 and a first server 200. The terminal device 100 communicates with the first server 200 through a network. The terminal device 100 can exchange data with the first server 200 to obtain an installation package, a compiled file, etc. of an application from the first server 200.

[0029] In some other embodiments, see Figure 2 , Figure 2Another schematic diagram of an application scenario provided by an embodiment of the present application is shown. The configuration file push system 10 may also include: a terminal device 100, a first server 200, and a second server 300. The terminal device 100 and the first server 200 perform data interaction, and the first server 200 and the second server 300 may also perform data interaction. The first server 200 may be used to process the request of the terminal device 100, and the second server 300 may be used to store and manage the configuration files, installation packages, and other files of the application. When the terminal device 100 obtains the application file from the first server 200, the first server 200 may obtain the application file from the second server 300 and send the application file to the terminal device 100. In addition, the first server 200 or the second server 300 may also classify the application so that the existing configuration files can be pushed for the applications of the same category.

[0030] Of course, the configuration file push system 10 may also include other servers. For example, the configuration file push system 10 may also include a third server, which may be used to collect configuration files of the application from the user's terminal device and transmit the collected configuration files to the second server 200 for sorting and storage, etc.; for another example, the configuration file push system 10 may also include a fourth server, which may be used to store and manage the installation package of the application, etc. In this case, the second server 200 may store and manage the configuration files of the application, so that the installation package of the application and the configuration files can be managed and stored separately.

[0031] In some embodiments, the terminal device 100 may be a smart phone, a tablet computer, an e-book, a smart watch or the like; the first server 200, the second server 300 and the like may be traditional servers or cloud servers, which are not limited here.

[0032] The following is a detailed introduction to the method for pushing configuration files provided in the embodiments of the present application.

[0033] See also Figure 3 , Figure 3 The following is a flow chart of a configuration file push method provided by an embodiment of the present application. The configuration file push method can be applied to the server in the configuration file push system described above. The specific process of this embodiment will be described below using the server as an example. Figure 3 The process shown is described in detail, and the method for pushing the configuration file may specifically include the following steps:

[0034] Step S110: receiving an acquisition request sent by a terminal device, wherein the acquisition request is used to acquire a hotspot code of a first target application.

[0035] In an embodiment of the present application, a request for obtaining may be generated by a terminal device, and the request for obtaining may be used to obtain a corresponding file of a first target application. In some embodiments, the request for obtaining may be used to obtain at least a hotspot code of the first target application. The application may be an application that has not been installed by the terminal device, or an application that has been installed by the terminal device but has not compiled the hotspot code, which is not limited here.

[0036] As an implementation mode, the terminal device may generate the above-mentioned acquisition request according to the user operation, and then send it to the server, so that the server receives the acquisition request. For example, the terminal device detects the acquisition operation of the hotspot code of the first target application in the interface of the software store, and then generates an acquisition request for acquiring the hotspot code of the first target application. As another implementation mode, after the first target application is installed and before it is used, the terminal device may actively generate an acquisition request for acquiring the hotspot code of the first target application, and then send it to the server, so that the server receives the acquisition request. As another implementation mode, the terminal device may generate an acquisition request for acquiring both the installation package and the hotspot code when downloading the application, and send it to the server, so that the server receives the acquisition request.

[0037] Step S120: Respond to the acquisition request and acquire the application category to which the first target application belongs.

[0038] In an embodiment of the present application, after receiving the acquisition request, the server can determine the application category to which the first target application belongs. Among them, the server can classify multiple applications in advance and classify applications with the same characteristics into the same application category. For applications in the same application category, the functional hotspot types between applications are similar, so it is possible to consider pushing the hotspot code of an application in the same application category to another application in the application category. For example, for shopping-type applications, the functional modules (such as shopping carts, order inquiries, etc.) also have many similarities, and the codes for their implementation are basically the same, so they can be pushed with the same hotspot code.

[0039] In some implementations, the server may classify multiple applications using a machine learning method, such as a K-means clustering method, a DBSCAN clustering method, etc., and the specific classification method may not be limited. The multiple applications classified by the server may be applications in a software mall or applications on the market, and the specific classification method may not be limited.

[0040] Step S130: Obtain a configuration file corresponding to a second target application among the multiple applications of the application category, where the second target application is an application for which a configuration file currently exists among the multiple applications, and the configuration file at least includes a hotspot code.

[0041] In the embodiment of the present application, after determining the application category to which the first target application belongs, the server can obtain applications with configuration files from multiple applications corresponding to the application category, and can determine any application from these applications as the second target application, and obtain the configuration file corresponding to the second target application. The configuration file includes the hotspot code of the corresponding application, that is, the profile file that records the hotspot code of the application.

[0042] In some embodiments, when the configuration file is stored in the server, the server can directly read the configuration file of the second target application locally; when the configuration file is stored in other servers, such as a cloud for storing configuration files, the configuration file of the second target application can also be obtained from other servers.

[0043] Step S140: Push a configuration file corresponding to the second target application to the terminal device, where the configuration file is used by the terminal device to precompile the hotspot code to obtain a compiled file.

[0044] In an embodiment of the present application, after the server obtains the configuration file corresponding to the second target application, it can push the configuration file corresponding to the second target application to the above-mentioned terminal device, so that the terminal device that sends the acquisition request can obtain the configuration file corresponding to the second target application. The configuration file sent by the server to the terminal device includes hotspot codes. The configuration file can instruct the terminal device to precompile the hotspot code and store the compiled file obtained by precompilation. Since the configuration file pushed to the terminal device is the configuration file of the second target application that belongs to the same application category as the first target application, the terminal device precompiles the hotspot code according to the configuration file, and the obtained compiled file can directly execute the binary machine code in the compiled file when the terminal device runs the first target application, thereby improving the efficiency of running the first target application.

[0045] The configuration file push method provided in the embodiment of the present application receives an acquisition request sent by a terminal device, where the acquisition request is used to acquire the hotspot code of a first target application, responds to the acquisition request, acquires the application category to which the first target application belongs, and then acquires the configuration file corresponding to the second target application from multiple applications in the application category, where the second target application is any application for which a configuration file currently exists in the multiple applications, and the configuration file at least includes the hotspot code, and then the configuration file corresponding to the second target application is pushed to the terminal device, where the configuration file is used by the terminal device to precompile the hotspot code to obtain a compiled file, thereby enabling the configuration file of the hotspot code of applications in the same category to be pushed to the terminal device. Therefore, for multiple applications in the same application category, the server only needs to collect and store the configuration file of one of the applications, and can push the configuration files of other applications in the application category to the user, thereby reducing the number of configuration files collected and stored by the server, and thereby reducing the burden on the server.

[0046] See also Figure 4 , Figure 4 A schematic diagram of a configuration file push method provided by another embodiment of the present application is shown. The configuration file push method can be applied to the server in the configuration file push system described above. Figure 4 The process shown is described in detail, and the method for pushing the configuration file may specifically include the following steps:

[0047] Step S210: Acquire the characteristics of each application in the plurality of applications.

[0048] In an embodiment of the present application, the server may classify multiple applications in advance. Specifically, the server may obtain the features of each application in advance so as to cluster the multiple applications according to the features of the applications. The features of the applications may include the functions, usage methods, applicable age, popularity of the applications, types of applications, etc. of the applications, and the specific features may not be used as a limitation.

[0049] Step S220: clustering the multiple applications according to the characteristics of each application to obtain multiple application categories.

[0050] In the embodiment of the present application, after obtaining the features of each application, the server can cluster multiple applications according to the features of each application, thereby obtaining one or more application categories. The method by which the server clusters multiple applications according to the features of the applications can be clustering using a neural network, or can also be clustering using a K-means clustering method, a DBSCAN clustering method, etc., and the specific clustering method may not be limited.

[0051] In some embodiments, the server clusters multiple applications according to the characteristics of each application, which may include: establishing an application profile for each application according to the characteristics of each application; clustering multiple applications according to the application profile to obtain multiple application categories. It is understandable that since the application profile is established according to the characteristics of the application, it can reflect the characteristics of the application, so the server can cluster the applications according to the application profile of the application. By establishing the application profile of the application and clustering the applications, it can facilitate the calculation and processing during clustering. For example, the application profile can be directly quantized into a vector, and then the vector can be clustered to obtain the clustering result, which reduces the difficulty of processing multiple features of each application.

[0052] Step S230: receiving an acquisition request sent by the terminal device, wherein the acquisition request is used to acquire the hotspot code of the first target application.

[0053] Step S240: Respond to the acquisition request and acquire the application category to which the first target application belongs.

[0054] Step S250: Obtain a configuration file corresponding to a second target application among the multiple applications of the application category, where the second target application is an application for which a configuration file currently exists among the multiple applications, and the configuration file at least includes a hotspot code.

[0055] Step S260: Push a configuration file corresponding to the second target application to the terminal device, where the configuration file is used by the terminal device to precompile the hotspot code to obtain a compiled file.

[0056] In the embodiment of the present application, steps S230 to S260 can refer to the contents of the aforementioned embodiment and will not be described in detail here.

[0057] Step S270: receiving a new configuration file sent by the terminal device, using the new configuration file as the first configuration file, and using the configuration file pushed to the terminal device as the second configuration file.

[0058] In some implementations, after the configuration file of the second target application is pushed to the terminal device, the terminal device compiles the hotspot code in the configuration file, and the compiled machine code is directly executed when the first target application is running. However, due to the problem of inaccurate application classification, the first target application may not be able to use or not use all of the files compiled according to the configuration file of the second target application, so a large number of new hotspot codes will be recorded. The terminal device can send the configuration file including the new hotspot code to the server, so that the server can receive the new configuration file.

[0059] Step S280: Correcting the application category to which the first target application belongs according to the first configuration file and the second configuration file.

[0060] In an embodiment of the present application, when the server receives a new configuration file (ie, the first configuration file), the application category to which the first target application belongs can be corrected according to the first configuration file and the second configuration file to correct errors in classifying multiple applications.

[0061] In some embodiments, correcting the application category to which the first target application belongs based on the first configuration file and the second configuration file may include: comparing the difference between the hotspot code in the first configuration file and the hotspot code in the second configuration file to obtain a difference result; and correcting the application category to which the first target application belongs based on the difference result.

[0062] Among them, after the server compares the hotspot codes in the first configuration file and the hotspot codes in the second configuration file, it can compare different hotspot codes and the proportions of different hotspot codes. After obtaining the difference results of the difference comparison, the server can determine whether the application category to which the first target application belongs is accurate based on the difference results. If it is inaccurate, other clustering methods can be used for clustering to overcome the problem of inaccurate clustering; it can also calculate the similarity between the first target application and the applications in other application categories based on the characteristics of the first target application, and use the application category to which the application with a similarity greater than a certain threshold belongs as the application category to which the first target application belongs; the server can also calculate the distance between the feature vector corresponding to the first target application and each cluster center, and then use the application category corresponding to the cluster center closest to it as the application category to which the first target application belongs. Of course, the specific method of correcting the clustering is not limited. Through the above correction, when other terminal devices subsequently obtain the configuration file of the first target application, they can obtain an accurate configuration file, thereby improving the accuracy of the push.

[0063] The configuration file push method provided in the embodiment of the present application obtains the characteristics of each application in a plurality of applications, classifies the plurality of applications according to the characteristics of the applications, and obtains a plurality of application categories, so that the server can push the configuration file according to the plurality of application categories. In addition, according to the new configuration file sent by the terminal device, the application classification is corrected, so that the accuracy of the push can be improved.

[0064] See also Figure 5 , Figure 5 A schematic diagram of a configuration file push method provided by another embodiment of the present application is shown. The configuration file push method can be applied to the server in the configuration file push system described above. Figure 5 The process shown is described in detail, and the method for pushing the configuration file may specifically include the following steps:

[0065] Step S310: Acquire the characteristics of each application in the plurality of applications.

[0066] Step S320: clustering the multiple applications according to the characteristics of each application to obtain multiple application categories.

[0067] Step S330: receiving an acquisition request sent by the terminal device, wherein the acquisition request is used to acquire the hotspot code of the first target application.

[0068] Step S340: Respond to the acquisition request and acquire the application category to which the first target application belongs.

[0069] Step S350: Obtain a configuration file corresponding to a second target application among the multiple applications of the application category, where the second target application is an application for which a configuration file currently exists among the multiple applications, and the configuration file at least includes a hotspot code.

[0070] In the embodiment of the present application, steps S310 to S350 can refer to the contents of the aforementioned embodiment and will not be described again here.

[0071] In an embodiment of the present application, the server may also pre-acquire a configuration file of the second target application, and the method for pushing the configuration file may also include: receiving the configuration file of the second target application sent by other terminals, and storing the configuration file. It is understandable that the server may collect the configuration file of the second target application from other terminals, and store the configuration file of the second target application, so as to push the configuration file to the device in the device for use by other applications in the application category to which the second target application belongs. The server may be a server for processing the above acquisition request, or may be another server for storing configuration files, which is not limited here.

[0072] In some implementations, since there are usually multiple applications in an application category, and the server may collect configuration files of at least two applications in the same application category, the server may also integrate the configuration files of different applications and use the integrated configuration files as the configuration files of at least two applications. The configuration files of different applications may be integrated by finding the union of the hotspot codes in the configuration files and regenerating a configuration file including the union. Of course, the specific way of integration may not be limited, and integrating the configuration files of at least two applications in the same application category may make the configuration files used for push later more comprehensive and accurate.

[0073] Step S360: Push a configuration file corresponding to the second target application to the terminal device, where the configuration file is used by the terminal device to precompile the hotspot code to obtain a compiled file.

[0074] In the embodiment of the present application, step S360 can refer to the content of the aforementioned embodiment and will not be repeated here.

[0075] Step S370: receiving a first running time sent by the terminal device, where the first running time is a running time when the terminal device runs the first target application according to the compiled file.

[0076] In an embodiment of the present application, the server can obtain the hotspot code of the first target application obtained in a traditional manner (i.e., a method of recording the hotspot code by itself for pre-compilation) as the target hotspot code. It is also possible to determine whether the classification of the application is accurate based on the running time recorded when the terminal device uses the above compiled file to run the target hotspot code of the first target application, and the terminal device pre-compiles the target hotspot code, and the running time recorded when the target hotspot code of the first target application is run according to the compiled file pre-compiled in this way. Specifically, the server can receive the first running time sent by the terminal device, and the first running time is the running time recorded when the terminal device runs the target hotspot code of the first target application according to the compiled file.

[0077] Step S380: receiving a second running time sent by other terminals, where the second running time is the running time when the other terminals precompile the hotspot code corresponding to the first target application and run the first target application according to the compiled file obtained by precompilation.

[0078] In an embodiment of the present application, the server can also obtain the second running time recorded when the above target hotspot code of the first target application is running based on the compiled file obtained by the terminal device using a hybrid compilation method of interpreter + JIT + AOT.

[0079] Step S390: comparing the first running time and the second running time, and correcting the application category to which the first target application belongs according to the comparison result.

[0080] In the embodiment of the present application, the above-mentioned second running time is the running time recorded by running the target hotspot code of the first target application according to the precompiled compilation file after the hotspot code recorded by the user when using the first target application is precompiled, so the second running time has a high reference value, that is to say, the second running time is relatively accurate. The first running time is the running time recorded by running the target hotspot code of the first target application according to the precompiled compilation file after the configuration file of the second target application is precompiled. Due to the error in the application classification, there may be a problem of insufficient optimization. Therefore, the server can compare the first running time and the second running time. If the second running time is less than the first running time, it means that the current application classification has a problem of insufficient accuracy. Therefore, other clustering methods can be used and clustering can be performed again to correct the application category to which the first target application belongs.

[0081] Among them, after clustering using other clustering methods, if the application category to which the first target application belongs changes, the configuration file of any application in the new application category to which the first target application belongs can be sent to the terminal device, and the terminal device can be precompiled according to the configuration file, and according to the compiled file obtained by precompilation, the above-mentioned target hotspot code of the first target application is run, and the third running time is recorded, and then the third running time and the second running time are compared. If the third running time is equal to the second running time, or the difference between the third running time and the second running time is less than a certain threshold, it means that the hotspot code in the configuration file of any application in the new application category is already relatively accurate. Therefore, the new application category can be used as the corrected application category for the subsequent push of the configuration file of the first target application.

[0082] The configuration file push method provided in the embodiment of the present application obtains the characteristics of each application in a plurality of applications, classifies the plurality of applications according to the characteristics of the applications, and obtains a plurality of application categories, so that the server can push the configuration file according to the plurality of application categories. In addition, according to the first running time and the second running time, the application classification to which the first target application belongs is corrected, the first running time is the running time of the first target application when it is running after pre-compilation according to the configuration file sent by the terminal device through push, and the second running time is the running time of the second target application when it is running after pre-compilation of the hotspot code recorded by itself in the way of recording the hotspot code by itself, thereby improving the accuracy of the push.

[0083] See also Figure 6 , Figure 6The following is a flow chart of a configuration file push method provided by another embodiment of the present application. The configuration file push method can be applied to the server in the configuration file push system described above. Figure 6 The process shown is described in detail, and the method for pushing the configuration file may specifically include the following steps:

[0084] Step S410: receiving an acquisition request sent by a terminal device, wherein the acquisition request is used to acquire a hotspot code of a first target application, and the acquisition request is also used to acquire an installation package of the first target application.

[0085] In an embodiment of the present application, the acquisition request sent by the terminal device can also be used to obtain the installation package of the first target application, that is, the acquisition request is used to simultaneously obtain the installation package of the first target application and the hotspot code.

[0086] Step S420: Respond to the acquisition request and acquire the application category to which the first target application belongs.

[0087] Step S430: Obtain a configuration file corresponding to a second target application among the multiple applications of the application category, where the second target application is an application for which a configuration file currently exists among the multiple applications, and the configuration file at least includes a hotspot code.

[0088] Step S440: Send the installation package of the second target application and the configuration file corresponding to the second target application to the terminal device, and the hotspot code is used to instruct the terminal device to precompile the hotspot code while installing the first target application according to the installation package, and store the compiled file obtained after precompilation.

[0089] In an embodiment of the present application, when returning a file to the terminal device, the server can simultaneously send an installation package of the second target application and a configuration file of the second target application to the terminal device. The installation package is used by the terminal device to install the first target application, and the configuration file can instruct the terminal device to compile the hotspot code while installing the first target application, and store the compiled file obtained after precompilation, thereby achieving precompilation of the hotspot code while installing the application, so that the operating efficiency of the first target application can be improved when it is run for the first time.

[0090] Step S450: Send the configuration files corresponding to the multiple application categories and at least one application in each application category to the terminal device, and the configuration files are used for precompiling the hotspot codes in the configuration files to obtain compiled files when the terminal device installs applications of the same application category.

[0091] In an embodiment of the present application, the server may also send to the terminal device a plurality of application categories after classifying a plurality of applications, and a configuration file corresponding to at least one application in each application category. In this way, when the terminal device subsequently installs a new application, it may directly determine the configuration file based on the application category to which it belongs, and precompile the hotspot code in the configuration file to obtain a compiled file. As a result, the terminal device does not need to obtain the configuration file from the server, but may directly precompile the hotspot code based on the locally stored configuration file.

[0092] The configuration file push method provided in the embodiment of the present application receives an acquisition request sent by a terminal device, where the acquisition request is used to acquire the hotspot code and installation package of a first target application, responds to the acquisition request, acquires the application category to which the first target application belongs, and then acquires the configuration file corresponding to the second target application from multiple applications in the application category, where the second target application is any application for which a configuration file currently exists in the multiple applications, and the configuration file at least includes the hotspot code, and then the configuration file and the installation package corresponding to the second target application are pushed to the terminal device at the same time, where the configuration file is used when the terminal device installs the first target application according to the installation package, and at the same time precompiles the hotspot code to obtain a compiled file, thereby enabling the configuration file of the hotspot code of applications belonging to the same category to be pushed to the terminal device, therefore, for multiple applications in the same application category, the server only needs to collect and store the configuration file of one of the applications, and can push the configuration files of other applications in the application category to the user, thereby reducing the number of configuration files collected and stored by the server, and thereby reducing the burden on the server.

[0093] See also Figure 7 , which shows a structural block diagram of a configuration file push device 400 provided in an embodiment of the present application. The configuration file push device 400 can be applied to the server in the above-mentioned configuration file push system. The configuration file push device 400 includes: a request receiving module 410, a request response module 420, a file acquisition module 430 and a file push module 440. Among them, the request receiving module 410 is used to receive an acquisition request sent by a terminal device, and the acquisition request is used to obtain the hotspot code of the first target application; the request response module 420 is used to respond to the acquisition request and obtain the application category to which the first target application belongs; the file acquisition module 430 is used to obtain a configuration file corresponding to a second target application among multiple applications of the application category, the second target application is an application in which a configuration file currently exists in the multiple applications, and the configuration file at least includes a hotspot code; the file push module 440 is used to push the configuration file corresponding to the second target application to the terminal device, and the configuration file is used by the terminal device to pre-compile the hotspot code to obtain a compiled file.

[0094] In some implementations, the configuration file push device 400 may further include: a feature acquisition module and an application clustering module. The feature acquisition module is used to acquire the features of each application in the plurality of applications before responding to the acquisition request and acquiring the application category to which the first target application belongs; the application clustering module is used to cluster the plurality of applications according to the features of each application to obtain a plurality of application categories.

[0095] In this embodiment, the application clustering module includes: a portrait acquisition unit, used to establish an application portrait of each application according to the characteristics of each application; a clustering execution unit, used to cluster the multiple applications according to the application portrait to obtain multiple application categories.

[0096] Under this embodiment, the configuration file pushing device 400 may also include: a file receiving module, used to receive a new configuration file sent by the terminal device after pushing the hotspot code corresponding to the second target application to the terminal device, and use the new configuration file as the first configuration file, and use the configuration file pushed to the terminal device as the second configuration file; a clustering correction module, used to correct the application category to which the first target application belongs according to the first configuration file and the second configuration file.

[0097] Furthermore, the cluster correction module may include: a difference comparison unit, used to compare the difference between the hotspot code in the first configuration file and the hotspot code in the second configuration file to obtain a difference result; and a correction execution unit, used to correct the application category to which the first target application belongs according to the difference result.

[0098] In some embodiments, the configuration file push device 400 may also include: a first duration receiving module, a second duration receiving module, and a correction module. The first duration receiving module is used to receive the first running duration sent by the terminal device, the first running duration being the running duration when the terminal device runs the first target application according to the compiled file; the second duration receiving module is used to receive the second running duration sent by other terminals, the second running duration being the running duration when the other terminals precompile the hotspot code corresponding to the first target application and run the first target application according to the compiled file obtained by precompilation; the correction module is used to compare the first running duration and the second running duration, and correct the application category to which the first target application belongs according to the comparison result.

[0099] In some embodiments, the configuration file push device 400 may further include: a category sending module. The category sending module is used to send the configuration files corresponding to the multiple application categories and at least one application in each application category to the terminal device, and the configuration files are used for the terminal device to precompile the hotspot codes in the configuration files when installing applications of the same application category to obtain a compiled file.

[0100] In some implementations, the configuration file push device 400 may further include: a file storage module. The file storage module is used to receive the configuration file of the second target application sent by other terminals and store the configuration file before obtaining the configuration file corresponding to the second target application from the multiple applications of the application category.

[0101] In some embodiments, the acquisition request is also used to obtain the installation package of the first target application. The configuration file push device 400 may also include: an installation package sending module. The installation package sending module is used to send the installation package of the second target application to the terminal device, and the hotspot code is used to instruct the terminal device to precompile the hotspot code while installing the first target application according to the installation package, and store the compiled file obtained after precompilation.

[0102] 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.

[0103] In several embodiments provided in the present application, the coupling between modules may be electrical, mechanical or other forms of coupling.

[0104] 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.

[0105] To summarize, the solution provided by the present application is to receive an acquisition request sent by a terminal device, where the acquisition request is used to acquire the hotspot code of a first target application, respond to the acquisition request, acquire the application category to which the first target application belongs, and then acquire the configuration file corresponding to the second target application from multiple applications of the application category, where the second target application is any application for which a configuration file currently exists in the multiple applications, and the configuration file at least includes the hotspot code, and then the configuration file corresponding to the second target application is pushed to the terminal device, where the configuration file is used by the terminal device to pre-compile the hotspot code to obtain a compiled file, thereby making it possible to push the configuration file of the hotspot code of applications of the same category to the terminal device, thereby reducing the number of configuration files collected and stored by the server, and thereby reducing the burden on the server.

[0106] Please refer to Figure 8 , which shows a structural block diagram of a server provided in an embodiment of the present application. The server 100 may be a server capable of running an application, such as a traditional server, a cloud server, etc. The server 100 in the present application may include one or more of the following components: a processor 110, a memory 120, and one or more applications, wherein the one or more applications may be stored in the memory 120 and configured to be executed by one or more processors 110, and the one or more programs are configured to execute the method described in the aforementioned method embodiment.

[0107] The processor 110 may include one or more processing cores. The processor 110 uses various interfaces and lines to connect various parts of 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 120, and calling data stored in the memory 120. Optionally, the processor 110 can be implemented in at least one hardware form of digital signal processing (DSP), field-programmable gate array (FPGA), and programmable logic array (PLA). The processor 110 can integrate one or a combination of a central processing unit (CPU), a 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 display content; 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 110, but may be implemented separately through a communication chip.

[0108] The memory 120 may include a random access memory (RAM) or a read-only memory (ROM). The memory 120 may be used to store instructions, programs, codes, code sets or instruction sets. The memory 120 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 created by the server 100 during use, etc.

[0109] Please refer to Fig. 9 , which shows a structural block diagram of a computer-readable storage medium provided in an embodiment of the present application. The computer-readable medium 800 stores program codes, which can be called by a processor to execute the method described in the above method embodiment.

[0110] The computer readable storage medium 800 may be an electronic memory such as a flash memory, an EEPROM (electrically erasable programmable read-only memory), an EPROM, a hard disk, or a ROM. Optionally, the computer readable storage medium 800 includes a non-transitory computer-readable storage medium. The computer readable storage medium 800 has storage space for program code 810 that performs any method step in the above method. These program codes can be read from or written to one or more computer program products. The program code 810 can be compressed, for example, in an appropriate form.

[0111] 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 method for pushing a configuration file, characterized in that: Applied to a server, the method comprises: Receiving an acquisition request sent by a terminal device, wherein the acquisition request is used to acquire a hotspot code of a first target application; In response to the acquisition request, acquiring the application category to which the first target application belongs; Determine an application for which a configuration file currently exists from among the multiple applications in the application category; Determine any application from the applications for which configuration files currently exist as a second target application, and obtain a configuration file corresponding to the second target application, wherein the configuration file at least includes a hotspot code; A configuration file corresponding to the second target application is pushed to the terminal device, and the configuration file is used by the terminal device to precompile the hotspot code to obtain a compiled file.

2. The method according to claim 1, characterized in that Before responding to the acquisition request and acquiring the application category to which the first target application belongs, the method further includes: Get the characteristics of each application among multiple applications; The multiple applications are clustered according to the characteristics of each application to obtain multiple application categories.

3. The method according to claim 2, characterized in that The clustering of the multiple applications according to the characteristics of each application to obtain multiple application categories includes: Creating an application profile for each application based on the characteristics of each application; The multiple applications are clustered according to the application portraits to obtain multiple application categories.

4. The method according to claim 2, characterized in that: After pushing the hotspot code corresponding to the second target application to the terminal device, the method further includes: receiving a new configuration file sent by the terminal device, using the new configuration file as a first configuration file, and using the configuration file pushed to the terminal device as a second configuration file; The application category to which the first target application belongs is corrected according to the first configuration file and the second configuration file.

5. The method according to claim 4, characterized in that The correcting the application category to which the first target application belongs according to the first configuration file and the second configuration file includes: Compare the hotspot codes in the first configuration file with the hotspot codes in the second configuration file to obtain a difference result; According to the difference result, the application category to which the first target application belongs is corrected.

6. The method according to claim 2, characterized in that The method further comprises: receiving a first running time sent by the terminal device, where the first running time is a running time when the terminal device runs the first target application according to the compiled file; receiving a second running time sent by another terminal, where the second running time is a running time when the other terminal runs the first target application according to a compiled file obtained by pre-compilation after pre-compiling the hotspot code corresponding to the first target application; The first running time and the second running time are compared, and the application category to which the first target application belongs is corrected according to the comparison result.

7. The method according to claim 2, characterized in that The method further comprises: The configuration files corresponding to the multiple application categories and at least one application in each application category are sent to the terminal device. The configuration files are used for precompiling hotspot codes in the configuration files to obtain compiled files when the terminal device installs applications of the same application category.

8. The method according to claim 1, characterized in that Before acquiring the configuration file corresponding to the second target application from the plurality of applications of the application category, the method further includes: Receive a configuration file of the second target application sent by other terminals, and store the configuration file.

9. The method according to any one of claims 1 to 8, characterized in that: The acquisition request is also used to acquire the installation package of the first target application, and the method further includes: The installation package of the second target application is sent to the terminal device, and the hotspot code is used to instruct the terminal device to precompile the hotspot code while installing the first target application according to the installation package, and store the compiled file obtained after precompilation.

10. A configuration file push device, characterized in that: Applied to a server, the device comprises: a request receiving module, a request responding module, a file acquiring module and a file pushing module, wherein: The request receiving module is used to receive an acquisition request sent by a terminal device, and the acquisition request is used to acquire a hotspot code of a first target application; The request response module is used to respond to the acquisition request and obtain the application category to which the first target application belongs; The file acquisition module is used to determine an application for which a configuration file currently exists from a plurality of applications in the application category; determine any application from the applications for which a configuration file currently exists as a second target application, and acquire a configuration file corresponding to the second target application, wherein the configuration file at least includes a hotspot code; The file push module is used to push the configuration file corresponding to the second target application to the terminal device, and the configuration file is used by the terminal device to precompile the hotspot code to obtain a compiled file.

11. A server, characterized in that: include: one or more processors; Memory; One or more application programs, wherein the one or more application programs are stored in the memory and configured to be executed by the one or more processors, and the one or more programs are configured to execute the method according to any one of claims 1-9.

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 9.

Citation Information

Patent Citations

  • Method and device for pre-encrypting program

    CN106775893A

  • An information acquisition and memory release method and device

    CN109710396A