Hotspot code determination method, device, server and storage medium

By generating tag mapping and determining hotspot codes based on probability, the problem of inconvenient hotspot code determination in the prior art is solved, and more efficient application performance optimization is achieved.

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

Patent Information

Application Number
CN201911174969.X
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

When determining hotspot codes, the prior art relies on the process of instant operation, which makes it difficult to achieve the determination of hotspot codes, and it is difficult to balance the running speed and power consumption, and lacks the inherent connection between different functional applications or functions and hotspot codes. Dig.

Method used

By obtaining the configuration file of the target application, including description information and code functions, a tag map is generated, and the hot code is determined based on the probability that the function function contains the tag map.

Benefits of technology

It improves the accuracy and convenience of hotspot code determination, optimizes application performance, and reduces system memory usage and device physical space usage.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112947898B_ABST
    Figure CN112947898B_ABST
Patent Text Reader

Abstract

The present application discloses a method, device, server and storage medium for determining hotspot codes, and relates to the field of computer technology. The method comprises: obtaining a configuration file corresponding to a target application, the configuration file comprising description information and code functions of the target application, generating a first number of label mappings based on the description information and the code functions, obtaining the probability that each function function among all function functions contains at least one label mapping among the first number of label mappings, and determining a second number of function functions as hotspot codes from all function functions based on the probability. The hotspot code determination method, device, server and storage medium provided in the embodiments of the present application generate label mappings through the description information and code functions of the target application, and determine the hotspot code based on the probability that all function functions contain the label mapping, so as to improve the accuracy and convenience of hotspot code determination, and achieve the purpose of optimizing application performance.
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 hotspot code determination method, device, server 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, the current method for determining hot code is fixed and depends on the real-time running process. Therefore, it is not convenient to determine the hot code. Summary of the invention

[0003] In view of the above problems, the present application proposes a hotspot code determination method, device, server and storage medium to solve the above problems.

[0004] In a first aspect, an embodiment of the present application provides a method for determining hotspot codes, the method comprising: obtaining a configuration file corresponding to a target application, the configuration file comprising description information and code functions of the target application; generating a first number of label mappings based on the description information and the code functions; obtaining a probability that each function function among all function functions contains at least one label mapping among the first number of label mappings; and based on the probability, determining a second number of function functions from all function functions as hotspot codes.

[0005] In the second aspect, an embodiment of the present application provides a hotspot code determination device, the device comprising: a configuration file acquisition module, used to obtain a configuration file corresponding to a target application, the configuration file comprising description information and code functions of the target application; a label mapping generation module, used to generate a first number of label mappings based on the description information and the code function; a probability acquisition module, used to obtain the probability that each function function among all function functions contains at least one label mapping among the first number of label mappings; a hotspot code determination module, used to determine a second number of function functions from all function functions as hotspot codes based on the probability.

[0006] In a third 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.

[0007] In a fourth 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.

[0008] The hotspot code determination method, device, server and storage medium provided in the embodiments of the present application obtain a configuration file corresponding to a target application, wherein the configuration file includes description information and code functions of the target application, generates a first number of label mappings based on the description information and the code functions, obtains the probability that each of all function functions contains at least one label mapping of the first number of label mappings, and determines a second number of function functions from all function functions as hotspot codes based on the probability, thereby generating a label mapping through the description information and the code function of the target application, and determining the hotspot code based on the probability that all function functions contain the label mapping, thereby improving the accuracy and convenience of hotspot code determination and achieving the purpose of optimizing application performance. 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 paying any creative work.

[0010] 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;

[0011] 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;

[0012] Figure 3 A schematic diagram of a hotspot code determination method provided by an embodiment of the present application is shown;

[0013] Figure 4 A schematic diagram of a hotspot code determination method provided by another embodiment of the present application is shown;

[0014] Figure 5 This application shows Figure 4 The flowchart of step S203 of the hotspot code determination method shown;

[0015] Figure 6 This application shows Figure 5 The flowchart of step S2031 of the hotspot code determination method shown;

[0016] Figure 7 A module block diagram of a hotspot code determination device provided in an embodiment of the present application is shown;

[0017] Figure 8 A block diagram of a server for executing a hotspot code determination method according to an embodiment of the present application is shown;

[0018] Fig. 9 A storage unit for storing or carrying program codes for implementing the hotspot code determination method according to an embodiment of the present application is shown. 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] In the development of Android system, the most commonly used programming language is Java. Even if it is not Java, it is JVM language. The java source files in the Android project are compiled to generate Class files, and finally packaged into dex bytecode files. The dex bytecode is then translated into machine code through the virtual machine Dalvik or Android runtime Art. Just-in-time compilation JIT and pre-compilation AOT are different compilation strategies adopted by the virtual machine to improve operating efficiency.

[0021] In the early days of the Android system, every time a program was run, Dalvik would translate dex into machine code and hand it over to the system for call, and then to the underlying system for processing, which was very inefficient. In Android 2.2, a JIT compiler was added. Whenever a new class is encountered, the JIT compiler will compile the class in real time and turn it into a streamlined native instruction code. The next time the same logic is encountered, the speed will be faster. Because the JIT compiler only compiles a part of the code, it has a smaller memory footprint and device physical space occupancy, but the efficiency is still low as it interprets and executes at the same time.

[0022] After Android 5.0, Art officially replaced Dalvik. Art uses the AOT compilation method. That is, during the installation of the application, all dex bytecodes are translated into machine codes and stored in the storage space of the electronic device. That is, the dex2oat process will be started to pre-compile dex into ELF files. The interpretation process of dex bytecode has been completed, making the application run faster and further reducing the startup time of the application. However, the bytecode translation time during installation is too long, making the installation process very long. In addition, the translated machine code also occupies a larger body storage space.

[0023] On Android 7.0, the JIT compiler is adopted again, that is, the JIT+AOT compilation mode is adopted. When the application is installed, dex will no longer be compiled. When the application is running, the dex file will be directly executed through the parser. The hot code will be identified and compiled by JIT and stored in the JIT code cache. A profile file will be generated to record the information of the hot function. When the phone enters the idle or charging state, the system will scan the profile file in the application directory and execute the AOT process for compilation. At present, most terminal manufacturers use the ART+Interpreter+JIT+AOT mixed compilation mode. In this compilation mode, the installation speed of the application is significantly improved. As the application is used for a longer time, the number of hot codes in the application will increase, and the performance of the APP will get better and better.

[0024] Therefore, both JIT and AOT used in the early days of the Android system have obvious disadvantages. JIT has no cache, so each time the application is started, it needs to be recompiled, which will cause the system to take too long to start each time the application is loaded. Such operating logic causes the Android system to consume power quickly during operation. AOT will start the dex2oat process to precompile into an ELF file during the installation of the application, that is, convert the program code into machine language, which will cause the application installation and application optimization after the system upgrade to be time-consuming. The ART+Interpreter+JIT+AOT hybrid compilation mode balances the performance of JIT and AOT to a certain extent, but there are also certain problems, that is, the performance is poor when the application is first installed, and the performance will gradually improve as the application is used more frequently, which will greatly affect the user's first-time experience.

[0025] Therefore, the several compilation technologies currently used by the mainstream generally have the following problems: it is difficult to balance the performance between running speed, power consumption and system memory, and each method has its own advantages and disadvantages in running speed and memory performance; the intrinsic connection between applications or functions with different functions and hot codes is not explored, resulting in different applications or users with different needs using the same set of compilation logic, and the differentiated optimization results are poor.

[0026] In view of the above problems, the inventor has discovered after long-term research and proposed the hotspot code determination method, device, server and storage medium provided in the embodiments of the present application, which generates a label mapping through the description information and code function of the target application, and determines the hotspot code based on the probability that all functional functions contain the label mapping, thereby improving the accuracy and convenience of hotspot code determination and achieving the purpose of optimizing application performance. Among them, the specific hotspot code determination method is described in detail in the subsequent embodiments.

[0027] The following is a description of an environment diagram that can be used for the hotspot code determination method provided in an embodiment of the present application.

[0028] See also 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: an electronic device 200 and a server 100. The electronic device 200 communicates with the server 100 through a network. The electronic device 200 can interact with the server 100 to obtain the installation file of the application, the configuration file to be pushed, etc. from the server 100, or send the configuration file to the server 100.

[0029] See also Figure 2 , Figure 2 Another schematic diagram of an application scenario provided by an embodiment of the present application is shown, and the server 100 may include a first server 110 and a second server 120. That is, the application scenario includes: an electronic device 200, a first server 110, and a second server 120. Among them, data interaction is performed between the electronic device 200 and the first server 110, and data interaction may also be performed between the first server 110 and the second server 120. The first server 110 may be used to process the request of the electronic device 200 and receive the configuration file of the electronic device 200, and the second server 120 may be used to store and manage the installation files of the application, the configuration files to be pushed, and other files. When the electronic device 200 obtains the files of the application from the first server 110, the first server 110 may obtain the files of the application from the second server 120, for example, obtain the installation files, the configuration files to be pushed, etc., and send the files of the application to the electronic device 200. When the electronic device 200 sends the uploaded configuration file, the first server 110 may receive the configuration file uploaded by the electronic device 200 and upload the configuration file to the second server 200.

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

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

[0032] See also Figure 3 , Figure 3 The flowchart of the hotspot code determination method provided by the embodiment of the present application is shown. The hotspot code determination method is used to generate a label mapping through the description information and code function of the target application, and determine the hotspot code based on the probability that all function functions contain the label mapping, so as to improve the accuracy and convenience of hotspot code determination and achieve the purpose of optimizing application performance. In a specific embodiment, the hotspot code determination method is applied to Figure 7 The hotspot method determining device 300 and the server 100 ( Figure 8 ). 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 determination method may specifically include the following steps:

[0033] Step S101: Obtain a configuration file corresponding to a target application, wherein the configuration file includes description information and code functions of the target application.

[0034] 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. In some embodiments, a configuration file (appprofile) of the target application during use may be collected and the collected configuration file may be used as the configuration file corresponding to the target application. The configuration file includes description information and code functions of the target application. In some embodiments, the description information of the target application included in the configuration file may include functional description information and product description information for the target application, and the code functions of the target application included in the configuration file may include function methods related to the application startup path of the target application, indexes of function methods for the target application, etc., which are not limited here.

[0035] In some implementations, the configuration files corresponding to the target application may be collected by the client and uploaded to the server. Accordingly, the server may obtain the configuration files corresponding to the target application uploaded by the client.

[0036] Step S102: Generate a first number of label mappings based on the description information and the code function.

[0037] In some implementations, after obtaining the configuration file corresponding to the target application, the server may analyze and process the configuration file corresponding to the target application, obtain the description information and code functions of the target application included or carried in the configuration file, and then generate a first number of label mappings based on the description information and code functions of the target application. In this embodiment, the first number may be one or more, that is, based on the description information and code functions of the target application, one or more label mappings may be generated. For example, when the first number is K, K label mappings may be generated based on the description information and code functions of the target application.

[0038] As one way, after obtaining the description information and code function of the target application, the server can match the description information and code function of the target application to generate a first number of label mappings. As another way, after obtaining the description information and code function of the target application, the server can establish a mapping relationship between the description information and the code function based on the description information and code function of the target application to generate a first number of label mappings. As another way, after obtaining the description information and code function of the target application, the server can extract keywords from the description information and extract keywords from the code function, and generate a first number of label mappings based on the keywords in the description information and the keywords in the code function.

[0039] Of course, in this embodiment, the first number of label mappings may be generated based on the description information and the code function in other ways, which will not be described in detail here.

[0040] Step S103: obtaining a probability that each of all the performance functions contains at least one of the first number of label mappings.

[0041] As a method, all functional functions may include all code functions related to the application. Specifically, if the application includes a first application, a second application, a third application, a fourth application, and a fifth application, a first code function corresponding to the first application, a second code function corresponding to the second application, a third code function corresponding to the third application, a fourth code function corresponding to the fourth application, and a fifth code function corresponding to the fifth application may be obtained, and the first code function, the second code function, the third code function, the fourth code function, and the fifth code function may be set as all code functions.

[0042] As another way, all functional functions may include all code functions pre-stored in the storage space of the server. Specifically, all code functions related to the application may be obtained, and some code functions related to the application may be selected from all code functions related to the application, and the selected code functions related to the application may be pre-stored in the storage space of the server as all functional functions, wherein some code functions related to the application may be selected from all code functions related to the application according to the importance of all code functions related to the application; some code functions related to the application may be selected from all code functions related to the application according to the calling frequency of all code functions related to the application; some code functions related to the application may be selected from all code functions related to the application according to the calling times of all code functions related to the application, etc., which are not limited here.

[0043] In some embodiments, after generating a first number of label mappings, the probability that each of all function functions contains at least one label mapping in the first number of label mappings can be obtained. For example, the probability that each of all function functions contains at least one label mapping in the first number of label mappings can be obtained in a statistical manner. Among them, the function function containing the label mapping can be understood as the function function containing the same code function as the function description indicated by the label mapping; the function function containing the label mapping can be understood as the function function containing the same code function as the code function indicated by the label mapping; the function function containing the label mapping can be understood as the function function containing the same code function as the keyword of the code function indicated by the label mapping, etc., which are not limited here.

[0044] Among them, each functional function may not include any label mapping in the first number of label mappings, may include one label mapping in the first number of label mappings, or may include multiple label mappings in the first number of label mappings. For example, when the first number of label mappings includes the first label mapping, the second label mapping, and the third label mapping, each functional function may not include any label mapping in the first label mapping, the second label mapping, and the third label mapping, may only include the first label mapping, or may include the first label mapping, the second label mapping, and the third label mapping at the same time, etc., which is not limited here.

[0045] In some embodiments, the inclusion relationship between each function in all function functions and the first number of label mappings can be obtained, and the probability that each function in all function functions contains at least one label mapping can be obtained based on the inclusion relationship. Wherein, based on the inclusion relationship between each function function and the first number of label mappings, the probability that each function function contains one label mapping, the probability that it contains two label mappings, the probability that it contains three label mappings... the probability that it contains the first number of label mappings can be obtained, so that the ranking or score of each function in all function functions can be obtained, wherein the greater the probability that the function function contains more label mappings, the higher the ranking or score corresponding to the function function can be, and the smaller the probability that the function function contains fewer label mappings, the lower the ranking or score corresponding to the function function can be. For example, when the probability that the first function function contains 3 label mappings is 80%, and the probability that the second function function contains 1 label mapping is 80% or 50%, the ranking or score of the first function function can be higher than that of the second function function.

[0046] Step S104: Based on the probability, determine a second number of function functions from all the function functions as hotspot codes.

[0047] In some embodiments, after obtaining the probability that each of all function functions contains at least one label mapping, a second number of function functions can be determined from all function functions based on the probability, and the determined second number of function functions can be used as hotspot codes. In this embodiment, the second number can be one or more, that is, based on the probability, one or more function functions can be determined from all function functions as hotspot codes.

[0048] In some embodiments, after obtaining the probability that each of all function functions contains at least one label mapping, all function functions can be sorted from high to low based on the probability, and function functions ranked before a specified ranking are selected from all function functions based on the ranking to obtain a second number of function functions, and the second number of function functions are used as hot codes. In some embodiments, after obtaining the probability that each of all function functions contains at least one label mapping, the probability that each function function contains at least one label mapping can be compared with a probability threshold, and function functions whose probabilities are greater than the probability threshold are obtained to obtain a second number of function functions, and the second number of function functions are used as hot codes.

[0049] A hotspot code determination method provided by an embodiment of the present application obtains a configuration file corresponding to a target application, the configuration file includes description information and code functions of the target application, generates a first number of label mappings based on the description information and the code functions, obtains the probability that each function function among all function functions contains at least one label mapping among the first number of label mappings, and determines a second number of function functions from all function functions as hotspot codes based on the probability, thereby generating a label mapping through the description information and code functions of the target application, and determining the hotspot code based on the probability that all function functions contain the label mapping, thereby improving the accuracy and convenience of hotspot code determination and achieving the purpose of optimizing application performance.

[0050] See also Figure 4 , Figure 4 A schematic diagram of a hotspot code determination 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 determination method may specifically include the following steps:

[0051] Step S201: Obtain a configuration file corresponding to a target application, wherein the configuration file includes description information and code functions of the target application.

[0052] For the detailed description of step S201, please refer to step S101, which will not be repeated here.

[0053] Step S202: extracting a first keyword from the description information, and extracting a second keyword from the code function.

[0054] In this embodiment, keywords can be extracted from the description information of the target application and recorded as first keywords, and keywords can be extracted from the code function of the target application and recorded as second keywords. The number of first keywords can be one or more, the number of second keywords can be one or more, and the number of first keywords can be equal to the number of second keywords, and can be unequal to the number of second keywords, which is not limited here. In some embodiments, the top-k first keywords can be extracted from the description information of the target application, and the top-k second keywords can be extracted from the code function of the target application, where the number represented by k can be equal to the first number.

[0055] In some embodiments, the first keyword can be extracted from the description information based on an unsupervised text keyword extraction technique, and the second keyword can be extracted from the code function based on an unsupervised text keyword extraction technique. Specifically, after obtaining the description information of the target application, an unsupervised text keyword extraction method with strong applicability can be used to extract keywords based on the statistical features of the text, and to extract the first keyword from the description information of the target application using the word association information (word-to-word, word-to-document)-mutual information, HIT value, dependency, TF-IDF value and other features, for example, to extract the top-k first keywords from the description information. After obtaining the code function of the target application, an unsupervised text keyword extraction method with strong applicability can be used to extract keywords based on the statistical features of the text, and to extract the second keyword from the code function of the target application using the word association information (word-to-word, word-to-document)-mutual information, HIT value, dependency, TF-IDF value and other features, for example, to extract the top-k second keywords from the code function.

[0056] Step S203: establishing a mapping relationship between the first keyword and the second keyword, and generating the first number of tag mappings.

[0057] In some implementations, after extracting the first keyword from the description information of the target application and extracting the second keyword from the code function of the target application, a mapping relationship between the first keyword and the second keyword can be established to generate a first number of label mappings. For example, if the top-k first keywords are extracted from the description information and the top-k second keywords are extracted from the code function, a mapping relationship between the top-k first keywords and the top-k second keywords can be established to generate top-k label mappings.

[0058] See also Figure 5 , Figure 5 This application shows Figure 4 The flowchart of step S203 of the hotspot code determination method shown in FIG. Figure 5 The process shown is described in detail, and the method may specifically include the following steps:

[0059] Step S2031: Calculate the similarity between the first keyword and the second keyword to obtain a similarity calculation result.

[0060] In some embodiments, after extracting the first keyword from the description information of the target application and extracting the second keyword from the code function of the target application, the similarity between the first keyword and the second keyword can be calculated to obtain a similarity calculation result. When a first keyword is extracted from the target application and a second keyword is extracted from the code function, the similarity between the first keyword and the second keyword can be directly calculated to obtain a similarity calculation result. When multiple first keywords are extracted from the target application and multiple second keywords are extracted from the code function, the similarities of the multiple first keywords and the multiple second keywords can be calculated respectively. For example, the similarity between each of the multiple first keywords and each of the multiple second keywords can be calculated to obtain a similarity calculation result.

[0061] See also Figure 6 , Figure 6 This application shows Figure 5 The flowchart of step S2031 of the hotspot code determination method is shown below. Figure 6 The process shown is described in detail, and the method may specifically include the following steps:

[0062] Step S20311: Map the first keyword to a first vector space to generate a first word frequency vector.

[0063] In some implementations, after the first keyword is extracted from the description information of the target application, the first keyword may be mapped to a first vector space to generate a first word frequency vector, for example, to generate a first word frequency vector a.

[0064] Step S20312: Map the second keyword to a second vector space to generate a second word frequency vector.

[0065] In some implementations, after the second keyword is extracted from the code function of the target application, the second keyword may be mapped to a second vector space to generate a second word frequency vector, for example, to generate a second word frequency vector b.

[0066] Step S20313: Calculate the cosine similarity between the first word frequency vector and the second word frequency vector to obtain the similarity calculation result.

[0067] In some embodiments, after obtaining the first word frequency vector and the second word frequency vector, the cosine similarity of the first word frequency vector and the second word frequency vector can be calculated to obtain the similarity calculation result of the first keyword and the second keyword. For example, if the first word frequency vector is a and the second word frequency vector is b, the cosine similarity of the first word frequency vector and the second word frequency vector can be calculated as: Thus, the similarity calculation result between the first keyword and the second keyword is obtained.

[0068] Step S2032: Based on the similarity calculation result, fuzzy matching is performed on the first keyword and the second keyword to generate the first number of tag mappings.

[0069] In some embodiments, after obtaining the similarity calculation result of the first keyword and the second keyword, the first keyword and the second keyword can be fuzzy matched based on the similarity calculation result to generate a first number of label mappings. In other words, the first keyword and the second keyword can be fuzzy matched based on the similarity calculation result to generate a first number of label mappings.

[0070] Step S204: respectively obtaining the similarity between the first keyword and the second keyword of each tag mapping in the first number of tag mappings.

[0071] In some embodiments, after obtaining a first number of tag mappings, the similarity of the first keyword and the second keyword of each tag mapping in the first number of tag mappings can be obtained respectively. For example, if the first number of tag mappings includes a first tag mapping, a second tag mapping, a third tag mapping, a fourth tag mapping, and a fifth tag mapping, the similarity of the first keyword and the second keyword in the first tag mapping can be obtained as the first similarity, the similarity of the first keyword and the second keyword in the second tag mapping can be obtained as the second similarity, the similarity of the first keyword and the second keyword in the third tag mapping can be obtained as the third similarity, the similarity of the first keyword and the second keyword in the fourth tag mapping can be obtained as the fourth similarity, and the similarity of the first keyword and the second keyword in the fifth tag mapping can be obtained as the fifth similarity.

[0072] Step S205: extracting a third number of label mappings from the first number of label mappings in descending order of similarity.

[0073] For the same function, a third number of description information keyword label mappings with the highest cosine similarity can be calculated from the first number of label mappings. For example, the top-m description information keyword label mappings with the highest cosine similarity can be calculated from the top-k label mappings, where k>m.

[0074] In some embodiments, after obtaining the similarity between the first keyword and the second keyword of each tag mapping, a third number of tag mappings can be extracted from the first number of tag mappings in order of similarity from high to low. The third number is smaller than the first number, and the third number can be one or more, that is, one or more tag mappings can be extracted from the first number of tag mappings in order of similarity from high to low to obtain the third number of tag mappings. It can be understood that the average similarity between the first keyword and the second keyword in the third number of tag mappings is greater than the average similarity between the first keyword and the second keyword in the first number of tag mappings, thereby improving the accuracy of the acquired hotspot codes.

[0075] For example, when the first similarity > the second similarity > the third similarity > the fourth similarity > the fifth similarity, the first label mapping can be extracted as the third number of label mappings, the first label mapping and the second label mapping can be extracted as the third number of label mappings, the first label mapping, the second label mapping and the third label mapping can be extracted as the third number of label mappings, the first label mapping, the second label mapping and the third label mapping can be extracted as the third number of label mappings, the first label mapping, the second label mapping, the third label mapping and the fourth label mapping can be extracted as the third number of label mappings, and the like are not limited here.

[0076] Step S206: Obtain the probability that each of the function functions in all the function functions contains the third number of label mappings.

[0077] In some embodiments, after obtaining the third number of label mappings, the probability that each of all functional functions contains the third number of label mappings can be obtained. As a way, after obtaining the third number of label mappings, the probability that each of all functional functions simultaneously contains the third number of label mappings can be obtained. It is understandable that the third number of label mappings can be used as a reference for the strength of the relationship between functional functions.

[0078] Step S207: sorting all the functional functions in descending order of probability.

[0079] In some embodiments, after obtaining the probability that each of all function functions contains at least one label mapping of a first number of label mappings, or the probability that each of all function functions contains a third number of label mappings, all function functions can be sorted in descending order based on the probability to obtain the sorting of all function functions.

[0080] Step S208: Acquire the function functions that are sorted before the specified sort, wherein the number of the function functions before the specified sort is consistent with the second number.

[0081] In some embodiments, the server pre-sets and stores a specified order, which is used as a basis for judging the order of each function function in all function functions. Therefore, in this embodiment, after obtaining the order of all function functions, the order of each function function in all function functions can be compared with the specified order to obtain function functions whose order is between the specified order. For example, when the specified order is 4, the function functions whose order is before the 4th order can be obtained based on the order of all function functions.

[0082] Step S209: determining the function that is sorted before the specified sort as the hotspot code.

[0083] In some implementations, after determining the function that is sorted before the specified sort, the function that is sorted before the specified sort can be used as profile pre-compiled hotspot code, that is, startup methods, and the remaining function functions can be used as post startup methods.

[0084] Step S210: Generate a configuration file to be pushed including the hotspot code.

[0085] In some implementations, after determining the hotspot code, a configuration file to be pushed including the hotspot code may be generated. As a method, the configuration file to be pushed may be a configuration file that records the index or identifier of the hotspot code, that is, after determining the hotspot code, an index or identifier corresponding to the hotspot code may be generated, and then based on the index or identifier corresponding to the hotspot code, a configuration file to be pushed including the index or identifier corresponding to the hotspot code may be generated.

[0086] In some implementations, after generating the configuration file to be pushed, the server may store the configuration file to be pushed in a database to record the configuration file to be pushed.

[0087] Step S211: Send the configuration file to be pushed to the client, where the configuration file to be pushed is used to instruct the client to precompile the hotspot code.

[0088] In this embodiment, after the server generates a configuration file to be pushed including a hotspot code, the server can send the configuration file to be pushed to the client to instruct the client to pre-compile the hotspot code indicated by the configuration file to be pushed. In some embodiments, after the server generates a configuration file to be pushed including an index or identifier corresponding to the hotspot code, the configuration file to be pushed and the installation file can be sent to the client together, wherein the installation file includes hotspot code and non-hotspot code, that is, the installation file can include startup methods and post startup methods, then after receiving the configuration file to be pushed and the installation file, the client can search for the hotspot code corresponding to the index or identifier from the installation file based on the index or identifier in the push configuration file, and pre-compile the hotspot code found through AOT. Thereby, the deep connection between the hotspot function code and the application description information is mined, the confidence of the hotspot code and the reusability of the same function code in different applications are improved, and multiple applications share the hotspot code to further reduce the number of codes of the server and the electronic device, provide a basis for the subsequent hotspot code information push, and further improve the performance of the application in terms of cold start time and system memory usage optimization.

[0089] In some implementations, as users continue to use the application, the usage results of different applications and different functional functions change, and the client can promptly upload the changed description information and code functions back to the server so that the server can promptly improve the configuration files to be pushed. At the same time, when a new version of the application is launched, a new round of updates to the configuration files to be pushed can be triggered, so that the configuration files to be pushed pushed to the client meet the user's usage requirements.

[0090] Another embodiment of the present application provides a method for determining hotspot codes, which obtains a configuration file corresponding to a target application, the configuration file includes description information and code functions of the target application, extracts a first keyword from the description information, and extracts a second keyword from the code function, establishes a mapping relationship between the first keyword and the second keyword, and generates a label mapping for the first data. The similarity between the first keyword and the second keyword of each label mapping in the first number of label mappings is obtained respectively, and a third number of label mappings are extracted from the first number of label mappings in order of similarity from high to low, and the probability that each of all function functions contains the third number of label mappings is obtained. All function functions are sorted in order of probability from high to low, and function functions sorted before a specified sort are obtained, and function functions sorted before a specified sort are determined as hotspot codes, and a configuration file to be pushed including hotspot codes is generated, and the configuration file to be pushed is sent to the client, and the configuration file to be pushed is used to instruct the client to pre-compile the hotspot code. Compared to Figure 3The hotspot code determination method shown in the present embodiment also extracts a first keyword from the description information and a second keyword from the code function, establishes a label mapping based on the first keyword and the second keyword to improve the accuracy of the label mapping, and in addition, the present embodiment also sorts all function functions, and determines the hotspot code from all function functions based on the sorting of all function functions to improve the accuracy and convenience of hotspot code determination, and sends the hotspot code to the client in the form of a configuration file to improve the performance of the client's application.

[0091] See also Figure 7 , Figure 7 The module block diagram of the hotspot code determination device 300 provided in the embodiment of the present application is shown. The hotspot code determination device 300 is applied to the above server. Figure 7 The block diagram shown in FIG. 1 is used to illustrate that the hotspot code determination device 300 includes: a configuration file acquisition module 310, a label mapping generation module 320, a probability acquisition module 330 and a hotspot code determination module 340, wherein:

[0092] The configuration file acquisition module 310 is used to acquire a configuration file corresponding to a target application, wherein the configuration file includes description information and code functions of the target application.

[0093] The label mapping generation module 320 is used to generate a first number of label mappings based on the description information and the code function.

[0094] Furthermore, the label mapping generation module 320 includes: a keyword extraction submodule and a label mapping establishment submodule, wherein:

[0095] The keyword extraction submodule is used to extract the first keyword from the description information and extract the second keyword from the code function.

[0096] Furthermore, the keyword extraction submodule includes: a keyword extraction unit, wherein:

[0097] A keyword extraction unit is used to extract the first keyword from the description information based on an unsupervised text keyword extraction technology, and to extract the second keyword from the code function based on an unsupervised text keyword extraction technology.

[0098] The label mapping establishment submodule is used to establish a mapping relationship between the first keyword and the second keyword, and generate the first number of label mappings.

[0099] Furthermore, the label mapping establishment submodule includes: a calculation result obtaining unit and a label mapping generating unit, wherein:

[0100] The calculation result obtaining unit is used to calculate the similarity between the first keyword and the second keyword to obtain a similarity calculation result.

[0101] Furthermore, the calculation result obtaining unit includes: a first word frequency vector generating subunit, a second word frequency vector generating subunit and a calculation result obtaining subunit, wherein:

[0102] The first word frequency vector generating subunit is used to map the first keyword to a first vector space to generate a first word frequency vector.

[0103] The second word frequency vector generating subunit is used to map the second keyword to a second vector space to generate a second word frequency vector.

[0104] The calculation result obtaining subunit is used to calculate the cosine similarity between the first word frequency vector and the second word frequency vector to obtain the similarity calculation result.

[0105] A label mapping generation unit is used to perform fuzzy matching on the first keyword and the second keyword based on the similarity calculation result to generate the first number of label mappings.

[0106] The probability acquisition module 330 is used to acquire the probability that each of all the function functions contains at least one label mapping of the first number of label mappings.

[0107] Furthermore, the probability acquisition module 330 includes: a similarity acquisition submodule, a label mapping extraction submodule and a probability acquisition submodule, wherein:

[0108] The similarity acquisition submodule is used to respectively acquire the similarity between the first keyword and the second keyword of each tag mapping in the first number of tag mappings.

[0109] The label mapping extraction submodule is used to extract a third number of label mappings from the first number of label mappings in descending order of similarity.

[0110] The probability acquisition submodule is used to obtain the probability that each function among all the function functions contains the third number of label mappings.

[0111] The hotspot code determination module 340 is configured to determine a second number of function functions from all the function functions as hotspot codes based on the probability.

[0112] Furthermore, the hot code determination module 340 includes: a function sorting submodule, a function acquisition submodule and a hot code determination submodule, wherein:

[0113] The function sorting submodule is used to sort all the function functions in descending order of the probability.

[0114] The function acquisition submodule is used to acquire the function functions that are sorted before the specified sort, wherein the number of the function functions before the specified sort is consistent with the second number.

[0115] The hot code determination submodule is used to determine the function functions that are sorted before the specified sort as the hot code.

[0116] Furthermore, the hotspot code determination device 300 further includes: a configuration file generation module and a configuration file delivery module, wherein:

[0117] The configuration file generation module is used to generate a configuration file to be pushed including the hotspot code.

[0118] The configuration file sending module is used to send the configuration file to be pushed to the client, and the configuration file to be pushed is used to instruct the client to pre-compile the hotspot code.

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

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

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

[0122] See also Figure 8 , 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.

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

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

[0125] See also 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 400 stores program codes, which can be called by a processor to execute the method described in the above method embodiment.

[0126] The computer readable storage medium 400 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 400 includes a non-transitory computer-readable storage medium. The computer readable storage medium 400 has storage space for program code 410 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 410 can be compressed, for example, in an appropriate form.

[0127] In summary, the hotspot code determination method, device, server and storage medium provided in the embodiments of the present application obtain a configuration file corresponding to the target application, which configuration file includes the description information and code function of the target application, generates a first number of label mappings based on the description information and the code function, obtains the probability that each function function among all function functions contains at least one label mapping among the first number of label mappings, and based on the probability, determines a second number of function functions from all function functions as hotspot codes, thereby generating a label mapping through the description information and code function of the target application, and determining the hotspot code based on the probability that all function functions contain the label mapping, thereby improving the accuracy and convenience of hotspot code determination and achieving the purpose of optimizing application performance.

[0128] 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 determining a hotspot code, characterized in that: The method comprises: Obtaining a configuration file corresponding to a target application, wherein the configuration file includes description information and code functions of the target application; Based on the description information and the code function, generating a first number of label mappings; Obtaining a probability that each of all the function functions contains at least one of the first number of label mappings; Based on the probabilities, a second number of function functions are determined from among all the function functions as hotspot codes.

2. The method according to claim 1, characterized in that The step of generating a first number of label mappings based on the description information and the code function includes: Extracting a first keyword from the description information, and extracting a second keyword from the code function; A mapping relationship between the first keyword and the second keyword is established to generate the first number of label mappings.

3. The method according to claim 2, characterized in that The extracting the first keyword from the description information and extracting the second keyword from the code function includes: The first keyword is extracted from the description information based on an unsupervised text keyword extraction technique, and the second keyword is extracted from the code function based on an unsupervised text keyword extraction technique.

4. The method according to claim 2, characterized in that: The establishing a mapping relationship between the first keyword and the second keyword to generate a first number of label mappings includes: Calculating the similarity between the first keyword and the second keyword to obtain a similarity calculation result; Based on the similarity calculation result, the first keyword and the second keyword are fuzzy matched to generate the first number of tag mappings.

5. The method according to claim 4, characterized in that The calculating the similarity between the first keyword and the second keyword to obtain a similarity calculation result includes: Mapping the first keyword to a first vector space to generate a first word frequency vector; Mapping the second keyword to a second vector space to generate a second word frequency vector; Calculate the cosine similarity between the first word frequency vector and the second word frequency vector to obtain the similarity calculation result.

6. The method according to claim 1, characterized in that The step of determining a second number of function functions from all the function functions as hotspot codes based on the probability comprises: Sorting all the functional functions in descending order of probability; Acquire the function functions that are sorted before the specified sort, wherein the number of the function functions that are sorted before the specified sort is consistent with the second number; The function functions sorted before the specified sort are determined as the hotspot codes.

7. The method according to any one of claims 1 to 6, characterized in that: The obtaining of the probability that each of all the function functions contains at least one of the first number of label mappings includes: Respectively obtain the similarity between the first keyword and the second keyword of each tag mapping in the first number of tag mappings; Extracting a third number of label mappings from the first number of label mappings in descending order of similarity; Obtain a probability that each of the all the function functions includes the third number of label mappings.

8. The method according to any one of claims 1 to 6, characterized in that: After determining a second number of function functions as hotspot codes from all the function functions based on the probability, the method further includes: Generate a configuration file to be pushed including the hotspot code; The configuration file to be pushed is sent to the client, and the configuration file to be pushed is used to instruct the client to pre-compile the hotspot code.

9. A hotspot code determination device, characterized in that: The device comprises: A configuration file acquisition module, used to acquire a configuration file corresponding to a target application, wherein the configuration file includes description information and code functions of the target application; a label mapping generation module, configured to generate a first number of label mappings based on the description information and the code function; A probability acquisition module, used to acquire the probability that each function among all the function functions contains at least one label mapping among the first number of label mappings; The hotspot code determination module is used to determine a second number of function functions from all the function functions as hotspot codes based on the probability.

10. A server, 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 executes the method according to any one of claims 1 to 8.

11. 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 8.

Citation Information

Patent Citations

  • Method and device for pre-encrypting program

    CN106775893A

  • Compiling optimization method and device, storage medium, intelligent terminal and server

    CN109960507A