Hotspot compilation unit determination method, device and server
By obtaining the function description information of the application, finding matching unit description information from the installation package, and directly determining the hotspot compilation unit, it solves the problem of difficulty in determining the hotspot compilation unit in a timely manner in the prior art, and improves the compilation optimization efficiency.
Patent Information
- Application Number
- CN201911087683.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-11-08
- Publication Date
- 2024-12-06
- Estimated Expiration
- 2039-11-08
AI Technical Summary
The prior art is difficult to determine the hot-spot compilation units in applications in a timely manner, resulting in low compilation optimization efficiency.
By obtaining the function description information of the application, finding matching unit description information from the installation package, directly determining that the compilation unit with the target unit description information is a hot-spot compilation unit, avoiding counting the number of calls and loops.
Improve the timeliness of hot-spot compilation units, reduce compilation optimization time, and improve application execution efficiency.
Smart Images

Figure CN112783501B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and more specifically, to a method, device and server for determining a hotspot compilation unit. Background Art
[0002] Applications usually need to be compiled by a compiler to form executable files for electronic devices to execute. The compiler can compile and optimize the application to improve the execution efficiency of the electronic device. For example, the compiler can compile hotspot compilation units with a large number of calls and loops in the application into machine code, thereby avoiding the electronic device from just-in-time compilation of the hotspot compilation units when the application is running.
[0003] However, the current compilation optimization method is difficult to determine the hot compilation units in the application in a timely manner, resulting in the inability to compile and optimize the application in a timely manner. Summary of the invention
[0004] In view of the above problems, the present application proposes a hotspot compilation unit determination method, device and server to improve the above problems.
[0005] In a first aspect, an embodiment of the present application provides a hotspot compilation unit determination method, which is applied to a server, and the method comprises: obtaining functional description information and an installation package of an application to be optimized, and obtaining unit description information of each compilation unit of the application to be optimized according to the installation package; from each unit description information, determining target unit description information that matches the functional description information, and determining the compilation unit having the target unit description information as a hotspot compilation unit.
[0006] In a second aspect, an embodiment of the present application provides a hotspot compilation unit determination device, which is applied to a server, and the device includes: an acquisition module, which is used to obtain functional description information and an installation package of an application to be optimized, and obtain unit description information of each compilation unit of the application to be optimized based on the installation package; a determination module, which is used to determine target unit description information that matches the functional description information from each unit description information, and determine the compilation unit with the target unit description information as a hotspot compilation unit.
[0007] In a third aspect, an embodiment of the present application provides a server, comprising: one or more processors; a memory; one or more programs, wherein the one or more 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 above-mentioned method.
[0008] 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.
[0009] Compared with the prior art, in the solution provided by the present application, matching unit description information is searched from the installation package according to the functional description information of the application, and the compilation unit with matching unit description information is determined as a hot compilation unit. The function indicated by the functional description information of the application is usually a function frequently used by users, and the compilation unit that implements the function will also be frequently called or looped. Therefore, the embodiment of the present application can directly determine the hot compilation unit according to the functional description information of the application, without having to spend time counting the number of calls and loops of the compilation unit during the operation of the application as the basis for determining the hot compilation unit, thereby improving the timeliness of determining the hot compilation unit.
[0010] These and other aspects of the present application will become more clearly understood in the description of the following embodiments. BRIEF DESCRIPTION OF THE DRAWINGS
[0011] 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.
[0012] Figure 1 A schematic diagram of an application scenario applicable to an embodiment of the present application is shown.
[0013] Figure 2 A schematic flow chart of a hotspot compilation unit determination method according to an embodiment of the present application is shown.
[0014] Figure 3 A schematic flow chart of a hotspot compilation unit determination method according to another embodiment of the present application is shown.
[0015] Figure 4 A schematic diagram of the interface of an application to be optimized in an embodiment of the present application is shown.
[0016] Figure 5 A training flowchart of the information extraction model of an embodiment of the present application is shown.
[0017] Figure 6 A block diagram of a server for executing the hotspot compilation unit determination method according to an embodiment of the present application is shown.
[0018] Figure 7 A block diagram of a hotspot compilation unit determination device provided in an embodiment of the present application is shown.
[0019] Figure 8A storage unit provided by an embodiment of the present application and used to store or carry program codes for implementing a hotspot compilation unit determination method according to an embodiment of the present application is shown. DETAILED DESCRIPTION
[0020] 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.
[0021] According to research, in order to optimize the compilation of an application, in some implementations, the following method is usually used to determine the hotspot compilation unit, so as to convert the program code of the hotspot compilation unit into machine code in advance. The compilation unit can be understood as a function, method or class in the source code of the application.
[0022] In the first method, the user terminal first interprets and executes the application program through a parser. During the execution process, the number of calls and loops of each compilation unit are recorded. The compilation unit with a number exceeding a threshold is identified as a hot compilation unit, and the hot compilation unit is recorded in a configuration file. The configuration file is usually a binary file, which includes identification information of the hot compilation unit, such as ID (Identity) information.
[0023] The drawback of this method is that the user terminal needs to collect statistics on the number of calls and loops of the compilation unit in the application program as a basis for determining the hot compilation unit. Usually, it takes some time to obtain enough information to more accurately determine the hot compilation unit. During this period of time, the user terminal can only execute the application program through just-in-time compilation, which is inefficient.
[0024] Method 2: For a new version of an application, multiple user terminals that download the application use the configuration file generated by method 1, and upload the generated configuration file to a server, which clusters the obtained configuration files to obtain an optimized configuration file, which includes an optimized hotspot compilation unit. In this method, most user terminals can obtain the configuration file for guiding compilation optimization in real time, but there are still some user terminals that need to use the above method 1 to determine the hotspot compilation unit, and these user terminals still have the problem of difficulty in timely determining the hotspot compilation unit.
[0025] In response to the above problems, the present application proposes a hotspot compilation unit determination method, device and server, which searches for matching unit description information based on the functional description information of the application, and then determines the hotspot compilation unit based on the matching unit description information, thereby avoiding the time spent on counting information such as the number of calls and the number of loops during the running of the application, and can determine the hotspot compilation unit very timely, thereby generating compilation optimization information in a timely manner to guide the compilation optimization of the application.
[0026] The solution proposed in this application will be described in detail below through specific embodiments.
[0027] See also Figure 1 In an application scenario of an embodiment of the present application, a server 100 is provided. The server 100 can communicate with multiple user terminals through a network. The multiple user terminals can be, for example, Figure 1 User terminals 200 and 300 are shown.
[0028] The server 100 may be a server device (e.g., an application store server) that provides an application installation package download service, or other server devices that communicate with the server device that provides the installation package download service. It is understood that the server 100 may be an independent server or one of a cluster of multiple servers that communicate with each other, and the embodiments of the present application are not limited to this.
[0029] The user terminal of the embodiment of the present application may be any electronic terminal having data processing and communication functions. For example, the user terminal may be, but is not limited to, a smart phone, a tablet computer, a laptop computer, etc.
[0030] There are many ways for a user terminal to access the server 100. For example, the user terminal can install a client provided by the server 100 and access the server 100 through the client. For another example, the user terminal can log in to the server 100 through a browser. For another example, the user terminal can log in to the server 100 through a program running in a third-party application.
[0031] A user can upload the installation package of an application to the server 100 through a user terminal for other users to download. In one example, user A uploads the installation package Y1 of application X1 to the server 100 through his user terminal 200, and user B can access the server 100 through his user terminal 300, download the installation package Y1, and install the downloaded installation package Y1 on the user terminal 300 to obtain application X1.
[0032] For ease of description, the user who uploads the installation package is referred to as a "publisher" and the user who downloads the installation package is referred to as a "downloader".
[0033] In actual applications, publishers usually add product description information to the installation package of the uploaded application, and the product description information is used to show the main functions of the application. In some cases, in order to make the downloader understand the application more clearly, the publisher will also upload the application interface of the application.
[0034] See also Figure 2 , Figure 2 A flowchart of a method for determining a hotspot compilation unit provided in an embodiment of the present application is provided. The method can be applied to Figure 1 The server 100 in the illustrated scenario. The various steps included in the method are described below.
[0035] Step S110, obtaining function description information and installation package of the application to be optimized.
[0036] Step S120: obtaining unit description information of each compilation unit of the application to be optimized according to the installation package.
[0037] In this embodiment, the function description information is information used to describe the function of the application to be optimized, and can be implemented in a variety of ways.
[0038] For example, the function description information may be product description information uploaded by the publisher for the installation package of the application to be optimized. For another example, when the installation package of the application to be optimized is the second version or later, the function description information may be user evaluation information of the application to be optimized. For another example, the function description information may be text information identified from the interface of the application to be optimized. For another example, the function description information may be a combination of at least two of the aforementioned information.
[0039] It can be understood that the above description of the function description information is only an example, and the function description information of this embodiment may also include other information.
[0040] In this embodiment, there are multiple ways to obtain the interface of the application to be optimized. In one way, the interface uploaded by the publisher to the server 100 can be directly obtained; in another way, the corresponding developer can intercept the interface of the application to be optimized and upload it to the server 100, and the server 100 can directly obtain the interface uploaded by the developer; in another way, the developer can upload the interface to other storage devices that communicate with the server 100, and the server 100 can obtain it from the storage device.
[0041] In another way, the server 100 can install the installation package of the application to be optimized, obtain the application to be optimized, and then intercept the interface of the application to be optimized. It is worth noting that in some cases, the operating system applicable to the installation package of the application to be optimized and the operating system of the server 100 may be different. In this case, the server 100 can be installed with a simulator, and the installation package of the application to be optimized can be installed through the simulator to obtain the application to be optimized, and then intercept the interface of the application to be optimized.
[0042] Step S130: Determine, from each of the unit description information, target unit description information that matches the function description information.
[0043] Step S140: determine the coding unit having the target unit description information as a hotspot coding unit.
[0044] In this embodiment, the installation package of the application to be optimized includes multiple compilation units, each compilation unit has corresponding unit description information, and the unit description information of each compilation unit is used to describe the function of the compilation unit. In this way, according to the target unit description information matching the function description information, the compilation unit determined is the compilation unit used to implement the function described by the function description information.
[0045] It can be understood that the aforementioned functional description information is usually used to describe the main functions of the application to be optimized, and the probability of the main functions being used by users is usually relatively high. Correspondingly, the number of times the compilation unit used to implement the main function is called and the number of times it is used in a loop will also increase. That is, the compilation unit with the target unit description information is used more frequently and can be regarded as a hot compilation unit.
[0046] pass Figure 2 The process shown in the figure can quickly determine the hotspot compilation unit of the application to be optimized when needed. For example, when receiving a publishing request for an installation package of any application, the server 100 can determine the application as the application to be optimized and execute Figure 2 Refer to the process shown. Figure 1 In the scenario shown, taking the server 100 as an application store server as an example, after publisher A uploads the installation package Y1 through the user terminal 200, he inputs a publishing instruction for the installation package Y1 to the user terminal 200. According to the publishing instruction, the user terminal 200 sends a publishing request to the server 100. The publishing request includes the identification information of the installation package Y1, such as the version number of the installation package Y1, the name of the application X1 corresponding to the installation package Y1, etc. The server 100 receives the publishing request, determines the application X1 corresponding to the installation package Y1 as the application to be optimized according to the identification information in the publishing request, and sends the publishing request to the server 100. Figure 2 The process shown determines the hotspot compilation unit of application X1.
[0047] It can be seen that through Figure 2 The process shown can quickly determine the hot compilation unit of the application X1, so as to timely generate the compilation optimization information for guiding the user terminal 300 to optimize the compilation of the application X1. In this process, it is not necessary to spend time to count the number of calls and loops of the compilation unit during the running of the application as the basis for determining the hot compilation unit, as in the first and second methods described above, thereby improving the timeliness of determining the hot compilation unit.
[0048] Please refer to Figure 3 , Figure 3 A flowchart of a hotspot compilation unit determination method provided in another embodiment of the present application, which can be applied to Figure 1 The server 100 in the scenario shown. The following takes the server 100 as a server device communicating with the application store server as an example. Figure 3 The process shown is described.
[0049] Step S210, obtaining the installation package of the application to be optimized.
[0050] In this embodiment, upon receiving a publishing request from a publisher for an application to be optimized, the application store server may send a trigger message to the server 100 to trigger the server 100 to obtain the installation package of the application to be optimized from the application store server in step S210.
[0051] Step S220, obtaining product description information, user evaluation information and interface of the application to be optimized, identifying text information from the interface, and using the text information and the obtained product description information and user evaluation information as functional description information of the application to be optimized.
[0052] In this embodiment, the server 100 can obtain product description information, user evaluation information and interface of the application to be optimized from the application store server. It is worth noting that if the installation package obtained in step S210 is the installation package of the first version of the application to be optimized, the server 100 cannot obtain user evaluation information. If the installation package obtained in step S210 is the installation package of the second version and later versions of the application to be optimized, the server 100 can obtain user evaluation information.
[0053] In this embodiment, the server 100 may also obtain the application to be optimized in a similar manner as described in the previous embodiment, which will not be described in detail here.
[0054] After obtaining the interface of the application to be optimized, the server 100 may recognize text information from the interface in a variety of ways, such as using optical character recognition (OCR) technology to recognize characters in the interface and converting the recognized characters into information in text format. For another example, the characters in the interface may be recognized by template matching technology, which is not limited in this embodiment.
[0055] Considering that in the interface of the application to be optimized, the information reflecting the functions of the application to be optimized is usually located in the toolbar of its interface, and the middle part of the interface is usually the application information from the server, therefore, in order to improve the efficiency of subsequent matching with the unit description information of the compilation unit, the text information in the interface can be identified in the following ways:
[0056] Cutting off the upper edge portion and the lower edge portion of the interface according to a set ratio;
[0057] The text information is recognized from the upper edge portion and the lower edge portion respectively.
[0058] Please refer to Figure 4 , which shows a schematic diagram of an interface F1 of the application to be optimized, including a toolbar F11 located at the upper edge, a toolbar F12 located at the lower edge, and a display window F13 located in the middle.
[0059] The position and size of the toolbar in the program interface are usually within a certain range, so a ratio, such as 1 / 5, can be set for the toolbar. In this case, after the server 100 obtains the interface of the application to be optimized, it can intercept 1 / 5 of the interface along the direction from the upper edge to the lower edge to obtain the upper edge portion; intercept 1 / 5 of the interface along the direction from the lower edge to the upper edge to obtain the lower edge portion. Then, the text information such as "search" and "discover" is identified from the intercepted upper edge portion, and the text information such as "message", "address book", "friend circle", and "settings" is identified from the lower edge portion.
[0060] It is understood that the aforementioned 1 / 5 is only an example, and the ratio may also be other values, such as a value within the range of 1 / 6-1 / 5. The ratios set for the toolbars at the upper edge and the lower edge may be the same or different, and this embodiment has no limitation on this.
[0061] Step S230, searching for a resource file from the installation package, wherein the resource file includes each of the compilation units of the application to be optimized and unit description information of each of the compilation units.
[0062] The installation package of an application usually contains a resource file, which includes multiple pieces of data information. Each piece of data information contains two fields. The value of the first field is the compilation unit, and the second field is the unit description information of the compilation unit. For example, the resource file of the above application X1 may contain the following two pieces of data information:
[0063] Compilation_unit1: "Click on the friend circle";
[0064] Compilation_unit2: "Share to Moments".
[0065] Among them, Compilation_unit1 and Compilation_unit2 are the values of the first field, and "Click on Moments" and "Share to Moments" are the values of the second field.
[0066] The name or format of the resource file is usually fixed. In this embodiment, the server 100 can parse the installation package, search for the resource file from the installation package of the application to be optimized according to the specific name or specific suffix, and then extract the value of the second field of each data information from the resource file to obtain the unit description information of each compilation unit of the application to be optimized.
[0067] Step S240: Acquire the unit description information of each of the compilation units from the resource file.
[0068] In this embodiment, after the server 100 obtains the unit description information of each compilation unit of the application to be optimized, it can search for the target unit description information matching the function description information from the unit description information of each compilation unit. The process will be described below.
[0069] Step S250, obtaining the first keyword extracted from the function description information and the second keyword extracted from each unit description information by the information extraction model.
[0070] In this embodiment, the information extraction model may be a named entity recognition (NER) model. Of course, it may also be a machine learning model of other structures as long as it can realize information extraction.
[0071] In this embodiment, before executing step S250, the information extraction model may be trained. Figure 5 , which exemplarily illustrates the training process of the information extraction model.
[0072] Step S510, obtaining multiple training samples and label information of each training sample, wherein the training sample is product description information of an application, user evaluation information or unit description information of a compilation unit, and the label information is a keyword indicating a function in the training sample.
[0073] In this embodiment, a web crawler can be used to crawl product description information, user evaluation information, and unit description information of compilation units of various different applications, and special symbols such as "*", "¥", "@", and other symbols that cannot indicate the function of the application can be identified from the crawled information, and then the crawled information can be split to obtain multiple statements. One or more statements can be used as a training sample, and label information can be added to each training sample. The label information includes all keywords in the training sample that can indicate the function of the application. It can be understood that the keywords described in the embodiments of the present application can be single words, words, or phrases, and there is no limitation to this.
[0074] Step S520: Obtain predicted keywords extracted from each of the training samples by the information extraction model.
[0075] During implementation, each training sample obtained in step S510 is input into the information extraction model, and a prediction result is output, which is the keyword extracted from the training sample by the information extraction model, described herein as a "predicted keyword". In this way, each training sample has label information and a predicted keyword.
[0076] Step S530, calculating the predicted keyword and the label information according to the loss function, and adjusting the model parameters of the information extraction model according to the calculation result, so that the information extraction model meets the set optimization conditions.
[0077] The loss function may be set according to actual needs, for example, it may be a function in which the function value is inversely proportional to the similarity between the predicted keyword and the label information.
[0078] In this embodiment, the set optimization condition may be that the number of iterations of the information extraction model reaches a set value during the training process, or that the function value of the loss function is less than a specific threshold. This embodiment has no limitation on this.
[0079] Through the above training, the information extraction model can extract a first keyword indicating the function of the application to be optimized from the function description information, and extract a second keyword indicating the function of the compilation unit from the unit description information.
[0080] Step S260, respectively calculating the similarity between the first keyword and each of the second keywords, determining from each of the second keywords a target second keyword whose similarity with the first keyword meets a preset condition, and determining the unit description information containing the target second keyword as the target unit description information.
[0081] In this embodiment, the information extraction model may extract one or more first keywords from the function description information, and each first keyword is processed according to step S260.
[0082] Exemplarily, the similarity between the first keyword and the second keyword can be calculated in the following manner: the first keyword and the second keyword are converted into vectors respectively, and then the Euclidean distance or cosine angle between the two converted vectors is calculated as the similarity between the first keyword and the second keyword. It can be understood that the similarity between the first keyword and the second keyword can also be calculated in other known ways in this embodiment, and this embodiment is not limited thereto.
[0083] In this embodiment, the server 100 may determine, from among the second keywords, a target second keyword whose similarity with the first keyword satisfies a preset condition by any one of the following methods:
[0084] First, a second keyword whose similarity with the first keyword is greater than a set threshold among the second keywords is determined as a target second keyword;
[0085] Second, the similarities between the second keywords and the first keyword are sorted, and a preset number of second keywords with the greatest similarities are determined as target second keywords.
[0086] The above method is only an example. This embodiment can also determine the target second keyword in other ways. For example, the similarities between each second keyword and the first keyword can be sorted first, and then the second keyword greater than the set threshold is selected as the target second keyword.
[0087] The following takes the above-mentioned application X1 as an example of an application to be optimized to explain the implementation process of step S260 in detail. Assuming that the functional description information of application X1 is "friend circle, share life with friends", the first keywords extracted by the information extraction model are: "friend circle", "share", and the second keywords extracted from the unit description information are: "click", "friend circle", "share".
[0088] For the first keyword "friend circle", the similarity between it and the second keywords "click", "friend circle", and "share" is calculated respectively, and it can be determined that the similarity between the second keyword "friend circle" and the first keyword "friend circle" meets the preset conditions. For the first keyword "share", the similarity between it and the second keywords "click", "friend circle", and "share" is calculated respectively, and it can be determined that the similarity between the second keyword "share" and the first keyword "share" meets the preset conditions. In this way, it can be determined that the target second keywords are "friend circle" and "share".
[0089] Step S270: Determine the unit description information containing the target second keyword as the target unit description information.
[0090] In this embodiment, the second keyword is a keyword extracted from each unit description information by the information extraction model. Therefore, the determined target second keyword must be included in at least one unit description information, so that the unit description information containing the target second keyword can be found based on the target second keyword.
[0091] Step S280: Determine the coding unit having the target unit description information as a hotspot coding unit.
[0092] Referring to the above example of application X1, step S270 and step S280 are further described below: Based on the target second keywords "friend circle" and "share", two unit description information "click on friend circle" and "share to friend circle" can be found in the resource file, and these two unit description information are the target unit description information. Based on the target unit description information "click on friend circle", the compilation unit Compilation_unit1 can be determined, and based on the target unit description information "share to friend circle", the compilation unit Compilation_unit2 can be determined.
[0093] Step S290: Generate compilation optimization information according to the hotspot compilation unit, wherein the compilation optimization information is used to guide compilation optimization of the application to be optimized.
[0094] In this embodiment, after determining the hotspot compilation unit, the server 100 may generate a configuration file (profile), and add the hotspot compilation unit to the profile, thereby obtaining compilation optimization information.
[0095] Through the above design, when the application to be optimized is released, its hot compilation unit can be determined and the corresponding compilation optimization information can be generated.
[0096] Step S2100, in response to a download request from a user terminal for the application to be optimized, sending the compilation optimization information and the installation package to the user terminal, so that the user terminal compiles the hotspot compilation unit into machine code according to the compilation optimization information.
[0097] In this embodiment, the application store server can receive a download request sent by the user terminal for the application to be optimized, and obtain compilation optimization information of the application to be optimized from the server 100, and send the obtained compilation optimization information and the installation package of the application to be optimized to the user terminal.
[0098] The user terminal can compile the program code corresponding to the compilation unit in the compilation optimization information into machine code during the installation of the installation package, or can compile the program code corresponding to the compilation unit in the compilation optimization information into machine code after the installation, and this embodiment has no limitation on this. In this way, the user terminal does not need to compile the hotspot compilation unit in the process of frequently calling the hotspot compilation unit in the future, thereby improving the execution efficiency.
[0099] It can be understood that if the server 100 is an application store server, upon receiving a download request for the application to be optimized, the installation package and compilation optimization information of the application to be optimized can be directly sent to the user terminal.
[0100] pass Figure 2 As shown in the process, this embodiment can quickly determine the hot compilation unit for the application according to the functional description information of the application when needed, without having to count the number of calls and loops of each compilation unit during the running of the application as the basis for determining the hot compilation unit, thereby improving the timeliness of determining the hot compilation unit, and then timely generating compilation optimization information based on the determined hot compilation unit, guiding the user terminal to compile and optimize the application, so that the user terminal can always run the application efficiently.
[0101] Please refer to Figure 6 , which shows a structural block diagram of a server 100 provided in an embodiment of the present application. The server 100 may include the following components: a processor 101, a memory 102, and one or more programs, wherein the one or more programs may be stored in the memory 102 and configured to be executed by one or more processors 101, and the one or more programs are configured to execute the method described in the foregoing method embodiment.
[0102] Understandably, Figure 6 The structure shown is only an example, and the server 100 may also include Figure 6 More, less, or entirely different configurations may be shown.
[0103] In the embodiment of the present application, the processor 110 may include one or more processing cores. The processor 101 uses various interfaces and lines to connect various parts of the entire server 100, and executes various functions of the server 100 and processes data by running or executing instructions, programs, code sets or instruction sets stored in the memory 102, and calling data stored in the memory 102.
[0104] Optionally, the processor 102 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 101 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 101, but may be implemented separately through a communication chip.
[0105] The memory 102 may include a random access memory (RAM) or a read-only memory (ROM). The memory 102 may be used to store instructions, programs, codes, code sets or instruction sets. The memory 102 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 or acquired by the server 100 during use (such as text information recognized from an application program interface), etc.
[0106] Please refer to Figure 7 , which shows a block diagram of a hotspot compilation unit determination device 700 provided in an embodiment of the present application, and the device 700 can be applied to Figure 6 In the server 100 shown, the device 700 may include an acquisition module 710 and a determination module 720 in terms of functions.
[0107] The acquisition module 710 is used to acquire the functional description information and installation package of the application to be optimized, and obtain the unit description information of each compilation unit of the application to be optimized according to the installation package.
[0108] Optionally, the acquisition module 710 may be specifically used to: acquire the interface of the application to be optimized; and identify text information in the interface, wherein the function description information includes the identified text information.
[0109] The acquisition module 710 may identify the text information in the interface by: intercepting the upper edge and the lower edge of the interface according to a set ratio; and identifying the text information from the upper edge and the lower edge respectively.
[0110] Optionally, the acquisition module 710 obtains the unit description information of each compilation unit of the application to be optimized according to the installation package in the following manner:
[0111] Searching for a resource file from the installation package, wherein the resource file includes each of the compilation units of the application to be optimized and unit description information of each of the compilation units;
[0112] The unit description information of each compilation unit is obtained from the resource file.
[0113] The determination module 720 is used to determine the target unit description information matching the function description information from each unit description information, and determine the compilation unit having the target unit description information as a hotspot compilation unit.
[0114] In this embodiment, the determination module 720 may determine the target unit description information matching the function description information from each unit description information in the following manner:
[0115] Acquire a first keyword extracted from the function description information and a second keyword extracted from each of the unit description information by an information extraction model;
[0116] respectively calculating the similarity between the first keyword and each of the second keywords;
[0117] Determine, from each of the second keywords, a target second keyword whose similarity with the first keyword satisfies a preset condition;
[0118] The unit description information including the target second keyword is determined as the target unit description information.
[0119] Optionally, the determination module 720 may determine, from the second keywords, a target second keyword whose similarity with the first keyword meets a preset condition in the following manner:
[0120] Determine the second keyword whose similarity with the first keyword is greater than a set threshold among the second keywords as the target second keyword; or,
[0121] The similarities between the second keywords and the first keyword are sorted respectively, and a preset number of second keywords with the greatest similarities are determined as the target second keywords.
[0122] Optionally, the hotspot compilation unit determination device 700 provided in the embodiment of the present application may further include a training module.
[0123] The training module can be used to: obtain multiple training samples and label information of each training sample, wherein the training samples are product description information of an application, user evaluation information or unit description information of a compilation unit, and the label information is a keyword indicating a function in the training sample; obtain predicted keywords extracted from each training sample by the information extraction model; calculate the predicted keywords and the label information according to a loss function, and adjust the model parameters of the information extraction model according to the calculation results so that the information extraction model meets the set optimization conditions.
[0124] Optionally, the hotspot compiling unit determining device 700 provided in the embodiment of the present application may further include a generating module, wherein the generating module is used to generate compiling optimization information according to the hotspot compiling unit, wherein the compiling optimization information is used to guide the compiling optimization of the application to be optimized.
[0125] Optionally, the hotspot compilation unit determination device 700 may further include a sending module, which is used to respond to a download request from a user terminal for the application to be optimized, and send the compilation optimization information and the installation package to the user terminal, so that the user terminal compiles the hotspot compilation unit into machine code according to the compilation optimization information.
[0126] 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.
[0127] In several embodiments provided in the present application, the coupling or direct coupling or communication connection between the modules shown or discussed may be an indirect coupling or communication connection through some interfaces, devices or modules, which may be electrical, mechanical or other forms.
[0128] 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.
[0129] Please refer to Figure 8 , which shows a block diagram of a computer-readable storage medium provided in an embodiment of the present application. The computer-readable medium 800 stores a program code 810, which can be called by a processor to execute the method described in the above method embodiment.
[0130] 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 of 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.
[0131] 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 compilation unit, characterized in that: Applied to a server, the method comprises: Obtain the function description information and installation package of the application to be optimized; Searching for a resource file from the installation package, wherein the resource file includes each of the compilation units of the application to be optimized and unit description information of each of the compilation units; Acquire the unit description information of each compilation unit from the resource file; Acquire a first keyword extracted from the function description information and a second keyword extracted from each of the unit description information by an information extraction model; respectively calculating the similarity between the first keyword and each of the second keywords; Determine, from each of the second keywords, a target second keyword whose similarity with the first keyword satisfies a preset condition; Determine the unit description information containing the target second keyword as the target unit description information; A coding unit having the target unit description information is determined as a hotspot coding unit.
2. The method according to claim 1, characterized in that: The obtaining of functional description information of the application to be optimized includes: Obtaining the interface of the application to be optimized; The text information in the interface is identified, and the function description information includes the identified text information.
3. The method according to claim 2, characterized in that The identifying the text message in the interface includes: Cutting off the upper edge portion and the lower edge portion of the interface according to a set ratio; The text information is recognized from the upper edge portion and the lower edge portion respectively.
4. The method according to claim 1, characterized in that: The step of determining, from among the second keywords, a target second keyword whose similarity to the first keyword satisfies a preset condition includes: Determine the second keyword whose similarity with the first keyword is greater than a set threshold among the second keywords as the target second keyword; or, The similarities between the second keywords and the first keyword are sorted respectively, and a preset number of second keywords with the greatest similarities are determined as the target second keywords.
5. The method according to claim 1, characterized in that: Before obtaining the first keyword extracted from the function description information and the second keyword extracted from each of the unit description information by the information extraction model, the method further includes: Acquire multiple training samples and label information of each training sample, wherein the training sample is product description information of an application, user evaluation information, or unit description information of a compilation unit, and the label information is a keyword indicating a function in the training sample; Obtaining predicted keywords extracted from each of the training samples by the information extraction model; The predicted keywords and the label information are calculated according to the loss function, and the model parameters of the information extraction model are adjusted according to the calculation results so that the information extraction model meets the set optimization conditions.
6. The method according to any one of claims 1 to 3, characterized in that: Also includes: Compilation optimization information is generated according to the hotspot compilation unit, and the compilation optimization information is used to guide the compilation optimization of the application to be optimized.
7. The method according to claim 6, characterized in that Also includes: In response to a download request from a user terminal for the application to be optimized, the compilation optimization information and the installation package are sent to the user terminal, so that the user terminal compiles the hotspot compilation unit into machine code according to the compilation optimization information.
8. A hotspot compilation unit determination device, characterized in that: Applied to a server, the device comprises: An acquisition module, used to acquire function description information and an installation package of the application to be optimized, and search for a resource file from the installation package, wherein the resource file includes each of the compilation units of the application to be optimized and unit description information of each of the compilation units; A determination module is used to obtain the unit description information of each compilation unit from the resource file; obtain the first keyword extracted from the function description information by the information extraction model, and the second keyword extracted from each unit description information; respectively calculate the similarity between the first keyword and each second keyword; from each second keyword, determine the target second keyword whose similarity with the first keyword meets the preset conditions; determine the unit description information containing the target second keyword as the target unit description information, and determine the compilation unit having the target unit description information as the hotspot compilation unit.
9. A server, characterized in that: include: one or more processors; Memory; One or more programs, wherein the one or more 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 to 7.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores program code, and the program code can be called by a processor to execute the method according to any one of claims 1 to 7.
