Application program running method and device, terminal, storage medium and product
By determining and storing machine codes of hotspot functions in advance when downloading applications, the problem of delay in the operation speed increase of applications in the prior art is solved, and the application can enjoy the effect of improving operation speed after downloading.
Patent Information
- Application Number
- CN202411887918.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-19
- Publication Date
- 2025-04-15
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The existing technology collects hotspot functions and compiles them after the application is running for a period of time, resulting in the terminal being unable to enjoy the improvement in running speed as soon as possible after downloading the application.
During the process of downloading the target application, the target configuration file is determined and stored in advance. The configuration file contains the machine code of the hotspot function corresponding to the hotspot operation, so that the machine code is directly called when the application performs the hotspot operation.
The compilation process of bytecode compilation of hotspot functions is saved into machine code, so that the terminal can obtain the operating speed improvement brought bytecode compilation as soon as possible after downloading the target application.
Smart Images

Figure CN119829162A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of software technology, and in particular to a method, device, terminal, storage medium and product for running an application. Background Art
[0002] In order to improve the running speed of the application, the terminal will optimize the running process of the application through the Dalvik virtual machine optimization tool (DEXOptimization, Dexopt). Among them, the terminal can optimize the running process of the application through Dexopt as follows: after the terminal runs the application for a period of time, it determines the hot function corresponding to the hot operation of the application. The hot operation refers to an operation that is executed more than a preset number of times, and the hot function corresponding to the hot operation refers to the function that handles the hot operation; then compile the bytecode of the hot function (a programming language that the terminal cannot directly execute) into machine code (a programming language that the terminal can directly execute), and store the machine code of the hot function. When the hot operation is subsequently executed in the application, the terminal will directly call the machine code of the hot function, saving the compilation process of the bytecode of the hot function, thereby improving the running speed of the application.
[0003] However, after the application has been running for a period of time, the terminal will collect hot functions and compile the bytecodes of the hot functions. After the terminal downloads the application, it cannot immediately obtain the improvement in running speed brought by the bytecode compilation. Summary of the invention
[0004] The embodiment of the present application provides a method, device, terminal, storage medium and product for running an application. The technical solution is as follows:
[0005] On the one hand, an embodiment of the present application provides a method for running an application, the method comprising:
[0006] During the process of downloading the target application, a target configuration file of the target application is determined, the target configuration file includes a machine code of a hotspot function corresponding to a hotspot operation, the hotspot operation refers to an operation that is executed more than a preset number of times, the hotspot function is used to process the hotspot operation, and the machine code of the hotspot function is compiled based on the bytecode of the hotspot function;
[0007] Storing the target configuration file in a storage space corresponding to the storage path of the target application;
[0008] When executing the hotspot operation based on the target application, obtaining the machine code of the hotspot function from the target configuration file in the storage space;
[0009] Execute the machine code of the hotspot function.
[0010] On the other hand, an embodiment of the present application provides a device for running an application, the device comprising:
[0011] A first determination module is used to determine a target configuration file of the target application during the process of downloading the target application, wherein the target configuration file includes a machine code of a hotspot function corresponding to a hotspot operation, wherein the hotspot operation refers to an operation executed more than a preset number of times, the hotspot function is used to process the hotspot operation, and the machine code of the hotspot function is compiled based on the bytecode of the hotspot function;
[0012] A storage module, used to store the target configuration file in a storage space corresponding to the storage path of the target application program;
[0013] A first acquisition module, configured to acquire the machine code of the hotspot function from the target configuration file in the storage space when the hotspot operation is performed based on the target application;
[0014] An execution module is used to execute the machine code of the hotspot function.
[0015] On the other hand, an embodiment of the present application provides a terminal, which includes a processor and a memory, wherein the memory stores at least one computer instruction, and the at least one computer instruction is loaded and executed by the processor to implement the method for running the application as described in the above aspects.
[0016] On the other hand, an embodiment of the present application provides a computer-readable storage medium, which stores at least one computer instruction, and the at least one computer instruction is used to be executed by a processor to implement the method for running the application as described in the above aspects.
[0017] On the other hand, an embodiment of the present application provides a computer program product, which includes computer instructions, and the computer instructions are stored in a computer-readable storage medium; a processor reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions to implement the method for running the application as described in the above aspects.
[0018] In an embodiment of the present application, since the target configuration file of the target application can be obtained during the process of downloading the target application, and the target configuration file includes the machine code of the hotspot function corresponding to the hotspot operation, after the first terminal downloads the target application, the machine code of the hotspot function in the target configuration file can be directly called to perform the hotspot operation, saving the compilation process of compiling the bytecode of the hotspot function into machine code, so that the first terminal can obtain the running speed improvement effect brought by bytecode compilation as soon as possible after downloading the target application. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] Figure 1 It is a schematic diagram of an implementation environment of an application program running method shown in an exemplary embodiment of the present application;
[0020] Figure 2 is a flow chart of a method for running an application program shown in an exemplary embodiment of the present application;
[0021] Figure 3 is a flow chart of a method for running an application program shown in an exemplary embodiment of the present application;
[0022] Figure 4 is a schematic diagram of an application program running system shown in an exemplary embodiment of the present application;
[0023] Figure 5 is a flowchart of a method for running an application program shown in an exemplary embodiment of the present application;
[0024] Figure 6 is a flowchart of a method for running an application program shown in an exemplary embodiment of the present application;
[0025] Figure 7 is a flow chart of a method for running an application program shown in an exemplary embodiment of the present application;
[0026] Figure 8 is a structural block diagram of an application program running device shown in an exemplary embodiment of the present application;
[0027] Fig. 9 It is a structural block diagram of a terminal shown in an exemplary embodiment of the present application. DETAILED DESCRIPTION
[0028] In order to make the objectives, technical solutions and advantages of the present application clearer, the implementation methods of the present application will be further described in detail below with reference to the accompanying drawings.
[0029] The term "multiple" as used herein refers to two or more than two. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the related objects are in an "or" relationship.
[0030] It should be noted that the information (including but not limited to user device information, user personal information, etc.), data (including but not limited to data used for analysis, stored data, displayed data, etc.) and signals involved in this application are all authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of the relevant countries and regions. For example, the configuration files and hotspot operations involved in this application are all obtained with full authorization.
[0031] Please refer to Figure 1 , which shows a schematic diagram of an implementation environment of an application running method provided by an exemplary embodiment of the present application. The implementation environment includes a first terminal 101 and a second terminal 102; the second terminal 102 is used to install multiple applications, and after the duration of running multiple applications reaches a first preset duration, multiple application configuration files are generated; different applications correspond to different configuration files, and for any application, the configuration file of the application includes the machine code of the hotspot function corresponding to the hotspot operation determined by the second terminal, and the hotspot operation refers to an operation that is used more than a preset number of times; for example, the hotspot operation can be a first click operation for starting the application, a second click operation executed in the application, or a sliding operation executed in the application. The hotspot function is used to process the hotspot operation, and the machine code of the hotspot function is compiled based on the bytecode of the hotspot function. The bytecode of the hotspot function cannot be directly executed by the terminal (including the first terminal 101 and the second terminal 102), while the machine code of the hotspot function can be directly executed by the terminal (including the first terminal 101 and the second terminal 102).
[0032] The first terminal 101 is used to obtain a configuration file of at least one application from the second terminal 102, and store the configuration file of at least one application locally, so as to store the configuration file of at least one application in the first terminal 101, thereby facilitating the subsequent improvement of the running speed of at least one application based on the configuration file of at least one application.
[0033] The first terminal 101 can be a smart phone, a tablet computer, a laptop computer, a desktop computer or a smart wearable device (such as a smart bracelet or a smart watch, etc.); similarly, the second terminal 102 can be a smart phone, a tablet computer, a laptop computer, a desktop computer or a smart wearable device, etc.
[0034] Please refer to Figure 2 , which shows a flow chart of a method for running an application provided by an exemplary embodiment of the present application. The method may include the following steps:
[0035] Step 201: During the process of downloading a target application program by a first terminal, the first terminal determines a target configuration file of the target application program.
[0036] The target configuration file includes the machine code of the hotspot function corresponding to the hotspot operation. The hotspot function is used to process the hotspot operation, and the machine code of the hotspot function is compiled based on the bytecode of the hotspot function. The machine code of the hotspot function can be directly executed by the first terminal, while the bytecode of the hotspot function cannot be directly executed by the first terminal.
[0037] The target application may be any application downloaded by the first terminal; for example, the target application may be an audio playback application, a game application, a shopping application, a short video application, a social application, etc.
[0038] In one possible implementation, the step of the first terminal determining the target configuration file of the target application may be: the first terminal obtains a first configuration file of the target application from the server, and determines the first configuration file as the target configuration file of the target application, the first configuration file is provided by the server for the target application, and the first configuration file includes the machine code of the hotspot function corresponding to the hotspot operation determined by the server.
[0039] In another possible implementation, the step of the first terminal determining the target configuration file of the target application may be: the first terminal obtains a second configuration file of the target application from the configuration file of at least one application contained in the first terminal, and determines the second configuration file as the target configuration file of the target application, the configuration file of at least one application is provided by the second terminal, the second configuration file is the configuration file of the target application in the at least one application, and the second configuration file includes the machine code of the hotspot function corresponding to the hotspot operation determined by the second terminal.
[0040] In another possible implementation, the step of the first terminal determining the target configuration file of the target application may be: the first terminal obtains a first configuration file of the target application from the server, obtains a second configuration file of the target application from a configuration file of at least one application included in the first terminal, and determines the target configuration file of the target application based on the first configuration file and the second configuration file. The specific process is described in detail in subsequent embodiments.
[0041] Step 202: The first terminal stores the target configuration file in the storage space corresponding to the storage path of the target application.
[0042] The first terminal stores the target configuration file in the storage space corresponding to the storage path of the target application program, so that the first terminal can directly call the target configuration file when running the target application program.
[0043] Step 203: When performing a hotspot operation based on the target application, the first terminal obtains the machine code of the hotspot function from the target configuration file in the storage space.
[0044] The hotspot operation can be a first click operation for launching the target application, a second click operation performed in the target application, a sliding operation performed in the target application, a double-click operation performed in the target application, or a long press operation performed in the target application. For example, if the hotspot operation is a first click operation for launching the target application, the user clicks the icon of the target application to trigger the first click operation to the first terminal, and the first terminal obtains the machine code of the hotspot function corresponding to the first click operation from the target configuration file. For another example, if the hotspot operation is a sliding operation, when the user browses the current display interface of the target application, the user slides the current display interface with his finger to trigger the sliding operation to the first terminal, and the first terminal obtains the machine code of the hotspot function corresponding to the sliding operation from the target configuration file.
[0045] Step 204: The first terminal executes the machine code of the hotspot function.
[0046] For example, if the hotspot operation is a first click operation for starting a target application, the first terminal executes the machine code of the hotspot function corresponding to the first click operation to start the target application; since the compilation process of compiling the bytecode of the hotspot function corresponding to the first click operation into machine code is saved; therefore, the startup speed of the target application is improved, that is, the loading speed of the target application is improved. For another example, if the hotspot operation is a sliding operation, the first terminal executes the machine code of the hotspot function corresponding to the sliding operation to slide the current display interface based on the sliding operation; since the compilation process of compiling the bytecode of the hotspot function corresponding to the sliding operation into machine code is saved; therefore, the sliding speed of the current display interface is improved, that is, the execution performance of the target application is improved.
[0047] In an embodiment of the present application, since the target configuration file of the target application can be obtained during the process of downloading the target application, and the target configuration file includes the machine code of the hotspot function corresponding to the hotspot operation, after the first terminal downloads the target application, the machine code of the hotspot function in the target configuration file can be directly called to perform the hotspot operation, saving the compilation process of compiling the bytecode of the hotspot function into machine code, so that the first terminal can obtain the running speed improvement effect brought by bytecode compilation as soon as possible after downloading the target application.
[0048] Please refer to Figure 3 , which shows a flow chart of an application running method provided by an exemplary embodiment of the present application. In the embodiment of the present application, the target configuration file of the target application is determined from the configuration file of the at least one application contained in the first terminal during the process of downloading the target application, by way of example. The method may include the following steps:
[0049] Step 301: The first terminal obtains a configuration file of at least one application from configuration files of multiple applications of the second terminal, and stores the configuration file of the at least one application.
[0050] The second terminal installs multiple applications, and for any application, the second terminal generates a configuration file of the application after the duration of running the application exceeds a first preset duration. Before the first terminal downloads the target application, the first terminal needs to first obtain and store the configuration file of at least one application; in a possible implementation, before the first terminal leaves the factory, the first terminal obtains and stores the configuration file of at least one application; accordingly, the step of the first terminal obtaining the configuration file of at least one application from the configuration files of multiple applications of the second terminal can be implemented by the following steps (1) to (3), including:
[0051] (1) The first terminal determines the device information of the first terminal.
[0052] The device information includes at least one of chip capability information, memory size information, and market positioning information; the chip capability information is used to indicate the chip capability of the first terminal, and the chip capability information may be a chip type, and different chip types have different chip capabilities. The memory size information is used to indicate the memory size of the first terminal; for example, the memory size information may include at least one of the running memory information and storage capacity information of the first terminal. The market positioning information is used to indicate the market group targeted by the first terminal; for example, the market positioning information is used to indicate that the market group targeted by the first terminal is business people, the elderly, young people, etc.
[0053] (2) The first terminal determines, based on the device information, at least one application matching the device information from among the plurality of applications.
[0054] Different chip capability information, memory size information and market positioning information are suitable for downloading different applications. In a possible implementation, the device information includes chip capability information; then the first terminal determines at least one application that is adapted to the chip capability indicated by the chip capability information from multiple applications based on the chip capability information.
[0055] In another possible implementation, the device information includes memory size information; then the first terminal determines, based on the memory size information, at least one application program from a plurality of applications that is adapted to the memory size indicated by the memory size information.
[0056] In another possible implementation, the device information includes market positioning information; then the first terminal determines at least one application program adapted to the market group positioned by the market positioning information from a plurality of applications based on the market positioning information.
[0057] In another possible implementation, the device information includes two or three of chip capability information, memory size information, and market positioning information; then the first terminal determines at least one application that is adapted to two or three of the chip capability information, memory size information, and market positioning information from multiple applications based on two or three of the chip capability information, memory size information, and market positioning information.
[0058] In an embodiment of the present application, the first terminal stores the configuration file of the application. In this way, even if the first terminal itself does not collect the hotspot functions, it can use the machine code of the hotspot functions in the configuration file of the application to accelerate the running speed of the application, thereby solving the pain point that the user cannot enjoy the hotspot function acceleration in the first place.
[0059] (3) The first terminal obtains a configuration file of at least one application from the second terminal.
[0060] For example, see Figure 4 The application's operating system includes a hierarchical screening profile module and a preset profile optimization module, which can be deployed in the first terminal; the hierarchical screening profile module is used to obtain a profile of at least one application from profiles of multiple applications in the second terminal; the preset profile optimization module is used to store the profile of at least one application in the first terminal.
[0061] In another possible implementation, the first terminal may add a new application configuration file after obtaining and storing the configuration file of at least one application before leaving the factory; the process may be: during the use of the first terminal, the first terminal determines the application with the highest download probability, and then obtains the configuration file of the application with the highest download probability from the configuration files of multiple applications of the second terminal.
[0062] In another possible implementation, the first terminal may delete the configuration file of the application after obtaining and storing the configuration file of at least one application before leaving the factory; the process may be: the first terminal determines the application with the lowest download probability of the first terminal based on the historical usage record, and deletes the configuration file of the application to save the storage space of the first terminal.
[0063] In the embodiment of the present application, after configuring at least one application configuration file before leaving the factory, the first terminal can also add or delete application configuration files, thereby improving the flexibility of application configuration file management.
[0064] In another possible implementation, the first terminal may also obtain and store a configuration file of at least one application after leaving the factory; accordingly, the step of the first terminal obtaining the configuration file of at least one application from the configuration files of multiple applications of the second terminal may be: the first terminal determines at least one application whose download probability exceeds a preset probability from the multiple applications, and obtains the configuration file of at least one application from the configuration files of the multiple applications of the second terminal.
[0065] In an embodiment of the present application, after the first terminal leaves the factory, during the user's use of the first terminal, the first terminal can determine the applications that the user may download based on the user's preferences, and then obtain the configuration files of the applications that the user may download from the second terminal, thereby improving the accuracy of obtaining the configuration files from the second terminal.
[0066] Before this step, the second terminal needs to generate configuration files for multiple applications. The process may be: the second terminal determines multiple applications and installs multiple applications; for any application, the second terminal generates a configuration file for the application after the running time of the application exceeds a first preset time.
[0067] The multiple applications may be the multiple most popular applications, and the popularity of an application may be the number of times the application has been downloaded or the frequency of use, etc. The number of applications may be set and changed as needed. In the embodiment of the present application, the number of applications is not specifically limited; for example, the number of applications is 300. The first preset duration may be set and changed as needed. In the embodiment of the present application, the first preset duration is not specifically limited; for example, the first preset duration may be 2 hours. In the embodiment of the present application, the number of applications is 300, the first preset duration is 2 hours, and the configuration file may be a profile file as an example for explanation. Please continue to refer to Figure 4The application running system includes a profile collection module, which can be deployed in the second terminal. The profile collection module determines 300 most popular applications, and then generates profiles of the 300 most popular applications after running the 300 most popular applications for 2 hours; and, for any application, the profile collection module performs multiple operations on the application during the running of the application; the multiple operations can be a first click operation for starting the application, a second click operation performed in the application, a sliding operation performed in the application, a long press operation performed in the application, or a double-click operation performed in the application, etc.
[0068] Step 302: During the process of downloading the target application program by the first terminal, a second configuration file of the target application program is obtained from configuration files of at least one application program included in the first terminal, and the second configuration file is determined as a target configuration file of the target application program.
[0069] The configuration file of at least one application is provided by the second terminal, the second configuration file is the configuration file of the target application in the at least one application, and the second configuration file includes the machine code of the hotspot function corresponding to the hotspot operation determined by the second terminal.
[0070] In a possible implementation, the first terminal searches for a second configuration file of the target application from configuration files of at least one application included in the first terminal, and when the second configuration file is found, determines the found second configuration file as the target configuration file of the target application.
[0071] In a possible implementation, the first terminal may obtain a target configuration file of a target application from a third terminal; accordingly, during the process of downloading the target application, the first terminal establishes a short-distance communication channel with the third terminal, the target application is installed in the third terminal, and the duration of the third terminal running the target application exceeds a second preset duration; the target configuration file of the target application is obtained from the third terminal through the short-distance communication channel. The short-distance communication channel may be a Bluetooth channel or a Wireless Fidelity (Wifi) channel, etc.
[0072] In another possible implementation, the first terminal may preferentially search for the second configuration file of the target application from configuration files of at least one application included in the first terminal, and only obtain the target configuration file of the target application from the third terminal if the second configuration file is not found.
[0073] In a possible implementation, the first terminal carries the application identifier of the target application in a broadcast message to request to establish a short-distance communication channel with the third terminal on which the target application is installed; accordingly, in the process of downloading the target application, the step of establishing the short-distance communication channel between the first terminal and the third terminal may be: in the process of downloading the target application, the first terminal broadcasts a first broadcast message, the first broadcast message carries the terminal identifier of the first terminal and the application identifier of the target application; at least one third terminal receives the first broadcast message; for any terminal, when the target application is installed on the third terminal and the duration for which the third terminal runs the target application exceeds a second preset duration, the third terminal sends a first connection request to the first terminal; the first terminal receives the first connection request, and establishes a short-distance communication channel with the third terminal based on the first connection request, thereby establishing a short-distance communication channel with the third terminal on which the target application is installed, thereby increasing the probability of obtaining the target configuration file.
[0074] In another possible implementation, the first terminal selects a third terminal on which the target application is installed from multiple third terminals that request to establish a short-distance communication channel with the first terminal; accordingly, during the process of the first terminal downloading the target application, the step of establishing a short-distance communication channel between the first terminal and the third terminal may be: during the process of downloading the target application, the first terminal broadcasts a second broadcast message, and the second broadcast message carries the terminal identifier of the first terminal; at least one third terminal receives the second broadcast message, and based on the second broadcast message, sends a second connection request to the first terminal, and the second connection request carries the application identifier of the application installed by the second terminal; the first terminal receives the second connection request from at least one third terminal, and based on the application identifier of the application carried in the second connection request, determines the third terminal from at least one third terminal, the determined third terminal is the terminal on which the target application is installed, and then establishes a short-distance communication channel based on the determined third terminal.
[0075] In another possible implementation, the number of third terminals may be one or more; when the number of third terminals is more than one, the first terminal may obtain the fourth configuration file of the target application from the multiple third terminals to obtain multiple fourth configuration files, where the fourth configuration file is the configuration file of the target application generated by the third terminal, and the fourth configuration file includes the machine code of the hotspot function corresponding to the hotspot operation determined by the third terminal; then the machine codes of the hotspot functions corresponding to the hotspot operations included in the multiple fourth configuration files are merged to obtain a fifth configuration file, and the machine codes of the hotspot functions corresponding to the hotspot operations in the fifth configuration file are deduplicated to obtain the target configuration file of the target application.
[0076] In an embodiment of the present application, when the first terminal does not include the second configuration file of the target application, the first terminal can obtain the configuration file of the target application in the surrounding third terminal through short-range communication technology, thereby improving the wide application of the present solution.
[0077] Step 303: The first terminal stores the target configuration file in the storage space corresponding to the storage path of the target application.
[0078] In some embodiments, this step is the same as step 202 and will not be repeated here.
[0079] Step 304: When performing a hotspot operation based on the target application, the first terminal obtains the machine code of the hotspot function from the target configuration file in the storage space.
[0080] In some embodiments, this step is the same as step 203 and will not be repeated here.
[0081] Step 305: The first terminal executes the machine code of the hotspot function.
[0082] In some embodiments, this step is the same as step 204 and will not be repeated here.
[0083] In an embodiment of the present application, since the target configuration file of the target application is stored in the first terminal, and the target configuration file includes the machine code of the first hotspot function corresponding to the first hotspot operation, after the first terminal downloads the target application, the machine code of the first hotspot function in the target configuration file can be directly called to execute the first hotspot operation, thereby saving the compilation process of compiling the bytecode of the first hotspot function into machine code, so that the first terminal can obtain the effect of improved running speed brought by bytecode compilation as soon as possible after downloading the target application.
[0084] Please refer to Figure 5 , which shows a flow chart of a method for running an application provided by an exemplary embodiment of the present application. In the embodiment of the present application, an example is given of preferentially determining the first configuration file provided by the server as the target configuration file of the target application. The method may include the following steps:
[0085] Step 501: During the process of downloading a target application program by a first terminal, the first terminal searches for a first configuration file of the target application program from a server.
[0086] The first configuration file is a configuration file provided by the server for the target application, and the first configuration file includes the machine code of the hotspot function corresponding to the hotspot operation determined by the server.
[0087] In an embodiment of the present application, the server may also provide a configuration file of the target application to the first terminal, and the priority of the configuration file provided by the server may be set higher than the priority of the configuration file of at least one application included in the first terminal; accordingly, during the process of the first terminal downloading the target application, the first terminal preferentially searches for the first configuration file of the target application from the server; if the first configuration file is not found in the server, the first terminal searches for the second configuration file of the target application from the configuration files of at least one application included in the first terminal.
[0088] In a possible implementation, the priority of the configuration file of at least one application included in the first terminal can also be set higher than the priority of the configuration file provided by the server; accordingly, in the process of the first terminal downloading the target application, the first terminal preferentially searches for the second configuration file of the target application from the configuration file of at least one application included in the first terminal; when the second configuration file is found, the second configuration file is determined as the target configuration file of the target application; when the second configuration file is not found, the first configuration file of the target application is searched from the server, and the second configuration file is the configuration file of the target application included in the first terminal, and the second configuration file includes the machine code of the hotspot function corresponding to the hotspot operation.
[0089] Step 502: When the first configuration file is not found in the server, the first terminal obtains a target configuration file of the target application from configuration files of at least one application included in the first terminal.
[0090] In some embodiments, the step in which the first terminal obtains the target configuration file of the target application from the configuration file of at least one application included in the first terminal is the same as the step in which the first terminal obtains the target configuration file of the target application from the configuration file of at least one application included in the first terminal in step 302, and is not repeated here.
[0091] Step 503: When the first configuration file is found in the server, the first terminal determines the first configuration file as a target configuration file of the target application.
[0092] In a possible implementation, if the first terminal does not find the first configuration file in the server and the first terminal does not include the second configuration file of the target application, the first terminal uses a default compilation mode to compile the bytecode of the target application. The default compilation mode may include at least one of a verification compilation mode, an optimization compilation mode, a full compilation mode, and a partial compilation mode.
[0093] In one possible implementation, the default compilation mode includes a verify compilation mode, and the first terminal verifies the bytecode of the target application; after the verification is passed, the bytecode of the target application is stored. In another possible implementation, the default compilation mode includes a quicken compilation mode, and the first terminal optimizes the bytecode corresponding to the instruction in the target application, and stores the optimized bytecode corresponding to the instruction in the storage space corresponding to the storage path of the target application; for example, the first terminal stores the optimized bytecode corresponding to the instruction in an executable file (odex) file in the storage space.
[0094] In another possible implementation, the default compilation mode includes speed, then the first terminal compiles the multiple bytecodes included in the application, and stores the multiple machine codes obtained by compilation in the storage space corresponding to the storage path of the target application; for example, the first terminal stores the multiple machine codes obtained by compilation in an Ahead-Of-Time Compilation (oat) file in the storage space. In another possible implementation, the default compilation mode includes the speed-profile compilation mode, then the first terminal compiles the bytecodes of the hotspot function corresponding to the hotspot operation of the application, obtains the machine code of the hotspot function, and stores the machine code of the hotspot function in the storage space corresponding to the storage path of the target application; for example, the first terminal stores the machine code of the hotspot function in the oat file of the storage space, and stores the index of the hotspot function in the index (art) file.
[0095] Step 504: The first terminal stores the target configuration file in the storage space corresponding to the storage path of the target application.
[0096] In some embodiments, this step is the same as step 202 and will not be repeated here.
[0097] Step 505: When executing a hotspot operation in the target application, the first terminal obtains the machine code of the hotspot function from the target configuration file in the storage space.
[0098] In some embodiments, this step is the same as step 203 and will not be repeated here.
[0099] Step 506: The first terminal executes the machine code of the hotspot function.
[0100] In some embodiments, this step is the same as step 204 and will not be repeated here.
[0101] In an embodiment of the present application, since the server determines the first configuration file by collecting usage records of a large number of users; therefore, when the server provides the first configuration file for the target application, the first terminal determines the first configuration file as the target configuration file, thereby improving the comprehensiveness and accuracy of the hotspot functions included in the target configuration file; however, when the server does not provide the first configuration file for the target application, the first terminal determines the target configuration file from the configuration files of at least one application included in the first terminal, thereby achieving that even if the server does not provide the first configuration file for the target application, the first terminal can obtain the effect of improved running speed brought by bytecode compilation as soon as possible after downloading the target application.
[0102] Please refer to Figure 6 , which shows a flow chart of an application running method provided by an exemplary embodiment of the present application. In the embodiment of the present application, taking the comprehensive determination of the configuration file of the target application based on the first configuration file of the target application in the server and the second configuration file of the target application included in the first terminal as an example, the method may include the following steps:
[0103] Step 601: During the process of downloading a target application program by a first terminal, the first terminal searches for a first configuration file of the target application program from a server.
[0104] In some embodiments, this step is the same as step 501 and will not be repeated here.
[0105] Step 602: when the first configuration file is not found in the server, the first terminal obtains a second configuration file of the target application from the configuration file of at least one application included in the first terminal, and determines the second configuration file as the target configuration file of the target application.
[0106] Step 603: When the first configuration file is found in the server, the first terminal obtains a second configuration file of the target application from the configuration file of at least one application included in the first terminal.
[0107] Step 604: The first terminal determines a target configuration file based on the first configuration file and the second configuration file.
[0108] Both the first configuration file and the second configuration file include machine codes of hot spot functions corresponding to hot spot operations, but the machine codes of hot spot functions included in the first configuration file and the second configuration file may not be exactly the same; therefore, in this step, the target configuration file of the target application is determined by integrating the machine codes of the hot spot functions included in the first configuration file and the second configuration file; accordingly, the first terminal can determine the target configuration file based on the first configuration file and the second configuration file as follows: the first terminal merges the machine codes of the hot spot functions corresponding to the hot spot operations included in the first configuration file and the machine codes of the hot spot functions corresponding to the hot spot operations included in the second configuration file to obtain a third configuration file; and deduplicates the hot spot functions in the third configuration file to obtain the target configuration file.
[0109] In an embodiment of the present application, by integrating the machine codes of the hotspot functions in the first configuration file and the second configuration file, the number of machine codes of the hotspot functions included in the target configuration file is increased, that is, the comprehensiveness of the machine codes of the hotspot functions included in the target configuration file is improved.
[0110] Step 605: The first terminal stores the target configuration file in the storage space corresponding to the storage path of the target application.
[0111] In some embodiments, this step is the same as step 202 and will not be repeated here.
[0112] Step 606: When performing a hotspot operation based on the target application, the first terminal obtains the machine code of the hotspot function from the target configuration file in the storage space.
[0113] In some embodiments, this step is the same as step 203 and will not be repeated here.
[0114] Step 607: The first terminal executes the machine code of the hotspot function.
[0115] In some embodiments, this step is the same as step 204 and will not be repeated here.
[0116] In an embodiment of the present application, by integrating the machine codes of the hotspot functions in the first configuration file and the second configuration file, the number of machine codes of the hotspot functions included in the target configuration file is increased, that is, the comprehensiveness of the machine codes of the hotspot functions included in the target configuration file is improved.
[0117] Please refer to Figure 7 , which shows a flow chart of a method for running an application provided by an exemplary embodiment of the present application. In the embodiment of the present application, updating a target configuration file of a target application is used as an example for explanation; the method may include the following steps:
[0118] Step 701: The first terminal determines a first update condition, where the first update condition is a condition that needs to be satisfied by the first terminal to update a target configuration file.
[0119] The first update condition includes multiple first update sub-conditions; the multiple first update sub-conditions include the charging state is charging, the screen state is off, and the time period to which the current time belongs is a preset time period. In the embodiment of the present application, multiple first update conditions are set, which can ensure that the target configuration file is updated at an appropriate update time, reducing the disturbance caused to the user by updating the target configuration file.
[0120] In a possible implementation, when the charging state of the first terminal is charging, and the screen state of the first terminal is off, and the time period to which the current time belongs is a preset time period, the first terminal determines that the first update condition is met. When the charging state of the first terminal is not charging, or the screen state of the first terminal is not off, or the time period to which the current time belongs is not a preset time period, the first terminal determines that the first update condition is not met.
[0121] For example, the first terminal registers an alarm trigger, sets the triggering time of the alarm trigger to the charging status being charging, the screen status being off, and the time period to which the current time belongs being the preset time period; when the first terminal meets the triggering time of the alarm trigger, the alarm trigger is triggered, and it is determined that the first terminal meets the first update condition.
[0122] Step 702: When the first terminal meets the first update condition, the first terminal determines a hotspot operation generated by the target application after the target configuration file was last updated.
[0123] When the first terminal updates the target configuration file for the first time, the hotspot operation is the hotspot operation generated after the target application is downloaded; accordingly, the step for the first terminal to determine the hotspot operation may be: the first terminal determines multiple first operations performed after downloading the target application, and determines the number of times the multiple first operations are used; based on the number of times the multiple first operations are used, determine from the multiple first operations a first operation whose number of uses exceeds a preset number of times, and determine the first operation whose number of uses exceeds the preset number of times as a hotspot operation.
[0124] When the first terminal does not update the target configuration file for the first time, the hotspot operation is the hotspot operation generated in the time period between two updates of the target application; accordingly, the step for the first terminal to determine the hotspot operation may be: the first terminal determines multiple second operations performed after the last update of the target configuration file, and determines the number of times the multiple second operations are used; based on the number of times the multiple second operations are used, determine from the multiple second operations a second operation whose number of uses exceeds a preset number, and determine the second operation whose number of uses exceeds the preset number as a hotspot operation.
[0125] In one possible implementation, for any hotspot function in the target configuration file, the first terminal will also periodically update the number of times the hotspot operation corresponding to the hotspot function is used; when the number of times the hotspot operation is used is less than a preset number, the machine code of the hotspot function corresponding to the hotspot operation is deleted from the target configuration file, thereby periodically updating the machine code stored in the target configuration file, so that the target configuration file stores the machine code of the hotspot function corresponding to the latest hotspot operation.
[0126] Step 703: The first terminal compiles the bytecode of the hotspot function corresponding to the hotspot operation to obtain the machine code of the hotspot function, and stores the machine code of the hotspot function in the target configuration file.
[0127] The first terminal determines whether there is a machine code for the hotspot function in the target configuration file; if there is no machine code for the hotspot function in the target configuration file, the first terminal compiles the bytecode of the hotspot function to obtain the machine code of the hotspot function, and stores the machine code of the hotspot function in the target configuration file; if there is a machine code for the hotspot function in the target configuration file, the first terminal may not compile the bytecode of the hotspot function.
[0128] Step 704: When the first terminal does not meet the first update condition within the unit time period, the first terminal determines a second update condition, and difficulty for the first terminal to meet the second update condition is lower than difficulty for the first terminal to meet the first update condition.
[0129] The unit time period can be set and changed as needed; for example, the unit time period is one day, etc. In the embodiment of the present application, since the first terminal is an ultra-fast charging terminal, it may be fully charged in 5 minutes. Therefore, it is difficult for the first terminal to meet the three conditions that the charging state is charging, the screen state is off, and the time period to which the current time belongs is a preset time period; therefore, it may happen that the first terminal does not meet the first update condition in the current unit time period (today), so the target configuration file will not be updated, resulting in the machine code of the hotspot function included in the target configuration file being not comprehensive enough; therefore, when the first terminal does not meet the first update condition within the current time period, the difficulty of meeting the first update condition is reduced, that is, the second update condition is used to trigger the update of the target configuration file, making it easier to trigger the update operation.
[0130] The second update condition includes multiple second update sub-conditions; the multiple second update sub-conditions include that the charging state is charging, and the screen state is off for a duration that reaches a third preset duration. In a possible implementation, when the charging state of the first terminal is charging, and the screen state of the first terminal switches from a bright screen to an off screen, the duration of the screen state of the first terminal being off is counted; when the duration reaches the third preset duration, it is determined that the first terminal meets the second update condition; when the charging state of the first terminal is not charging, or the duration of the screen state of the first terminal switching from a bright screen to an off screen does not reach the third preset duration, it is determined that the first terminal does not meet the second update condition.
[0131] For example, the first terminal registers a task (job) trigger, and sets the triggering time of the job trigger to when the charging status of the first terminal is charging. Then, when the charging status of the first terminal is charging and the screen-off status is switched from the screen on to the screen off, the timing duration of the job trigger is set to a third preset duration, and a countdown is started based on the third preset duration. When the screen status of the first terminal is still off at the end of the countdown for the third preset duration, it is determined that the first terminal meets the second update condition; before the countdown for the third preset duration ends, the screen status of the first terminal switches from the screen off to the screen on; or before the countdown for the third preset duration ends, when the charging status of the first terminal switches from charging to not charging, it is determined that the first terminal does not meet the second update condition. At this time, the first terminal continues to be detected until the first terminal meets the second update condition, and step 705 is executed.
[0132] For example, the third preset time is 5 minutes, the first terminal registers a job trigger and waits for the next charging of the first terminal; then a 5-minute countdown starts after the screen is turned off. If the screen of the first terminal is turned on after 5 minutes, it continues to wait for the next charging; if the screen is still off after 5 minutes, it is determined that the first terminal meets the second update condition, and the update of the target configuration file is triggered at this time.
[0133] In the embodiment of the present application, an alarm and job trigger mechanism is adopted to innovatively update the target configuration file, so that the target configuration file can be updated more frequently, so that the bytecode of the hot function of the target application is compiled more comprehensively.
[0134] Step 705: When the first terminal meets the second update condition, the first terminal determines a hotspot operation generated by the target application after the last update.
[0135] The process of the first terminal determining the hotspot operation generated after the target application was last updated is similar to the process of the first terminal determining the hotspot operation generated after the target application last updated the target configuration file in step 702, and will not be repeated here.
[0136] Step 706: The first terminal compiles the bytecode of the hotspot function corresponding to the hotspot operation to obtain the machine code of the hotspot function, and stores the machine code of the hotspot function in the target configuration file.
[0137] The first terminal determines whether there is a machine code for the hotspot function in the target configuration file; if there is no machine code for the hotspot function in the target configuration file, the first terminal compiles the bytecode of the hotspot function to obtain the machine code of the hotspot function, and stores the machine code of the hotspot function in the target configuration file; if there is a machine code for the hotspot function in the target configuration file, the first terminal may not compile the bytecode of the hotspot function.
[0138] In an embodiment of the present application, it is first determined whether the first terminal satisfies the first update condition. When the first terminal satisfies the first update condition, the update operation of the target configuration file is triggered, thereby ensuring that the target configuration file is updated at an appropriate update time, reducing the disturbance to the user caused by the update of the target configuration file; when the first terminal does not meet the first update condition, the difficulty of triggering the first update condition is reduced, that is, the second update condition is used to trigger the update operation of the target configuration file, thereby ensuring that the target configuration file can be frequently updated, so that the bytecode of the hot function of the target application is compiled more comprehensively.
[0139] Please refer to Figure 8 , which shows a structural block diagram of an application program running device provided by an exemplary embodiment of the present application. The device includes:
[0140] A first determination module 801 is used to determine a target configuration file of the target application during the process of downloading the target application, wherein the target configuration file includes a machine code of a hotspot function corresponding to a hotspot operation, wherein the hotspot operation refers to an operation executed more than a preset number of times, and the hotspot function is used to process the hotspot operation, and the machine code of the hotspot function is compiled based on the bytecode of the hotspot function;
[0141] The storage module 802 is used to store the target configuration file in the storage space corresponding to the storage path of the target application program;
[0142] A first acquisition module 803 is used to acquire the machine code of the hotspot function from the target configuration file in the storage space when the hotspot operation is performed based on the target application;
[0143] The execution module 804 is used to execute the machine code of the hotspot function.
[0144] In a possible implementation, the first determination module 801 is used to obtain a first configuration file of the target application from a server, and determine the first configuration file as a target configuration file of the target application, wherein the first configuration file is provided by the server for the target application, and the first configuration file includes a machine code of a hotspot function corresponding to a hotspot operation determined by the server; or
[0145] The first determination module 801 is used to obtain a second configuration file of the target application from a configuration file of at least one application included in the first terminal, and determine the second configuration file as the target configuration file of the target application, the configuration file of the at least one application is provided by the second terminal, the second configuration file is the configuration file of the target application in the at least one application, and the second configuration file includes the machine code of the hotspot function corresponding to the hotspot operation determined by the second terminal; or
[0146] The first determination module 801 is used to obtain a first configuration file of the target application from the server, obtain a second configuration file of the target application from a configuration file of at least one application included in the first terminal, and determine a target configuration file of the target application based on the first configuration file and the second configuration file.
[0147] In another possible implementation, the third determination module is used to merge the machine code of the hotspot function corresponding to the hotspot operation included in the first configuration file and the machine code of the hotspot function corresponding to the hotspot operation included in the second configuration file to obtain a third configuration file; and deduplicate the hotspot function in the third configuration file to obtain the target configuration file.
[0148] In another possible implementation, the device further includes:
[0149] a second acquisition module, configured to acquire a configuration file of the at least one application from configuration files of multiple applications of the second terminal, the second terminal installing the multiple applications, and for any application, the second terminal generating a configuration file of the application after the duration of running the application exceeds a first preset duration;
[0150] The storage module is used to store a configuration file of the at least one application.
[0151] In another possible implementation, the second acquisition module is used to determine device information of the first terminal, the device information including at least one of chip capability information, memory size information and market positioning information, the chip capability information is used to indicate the chip capability of the first terminal, the memory size information is used to indicate the memory size of the first terminal, and the market positioning information is used to indicate the market group targeted by the first terminal; based on the device information, determine at least one application matching the device information from the multiple applications; and obtain a configuration file of the at least one application from the second terminal.
[0152] In another possible implementation, the first determination module 801 is used to establish a short-distance communication channel with a third terminal, the target application is installed in the third terminal, and the third terminal runs the target application for a time period exceeding a second preset time period; and obtain a target configuration file of the target application from the third terminal through the short-distance communication channel.
[0153] In another possible implementation, the device further includes:
[0154] a fourth determining module, configured to determine a first update condition, where the first update condition is a condition that needs to be satisfied by the first terminal to update the target configuration file;
[0155] a fifth determining module, configured to determine, when the first terminal satisfies the first update condition, a hotspot operation generated by the target application after the target configuration file was last updated;
[0156] The first update module is used to compile the bytecode of the hotspot function corresponding to the hotspot operation to obtain the machine code of the hotspot function, and store the machine code of the hotspot function in the target configuration file.
[0157] In another possible implementation, the fifth determination module is also used to determine that the first terminal meets the first update condition when the charging status of the first terminal is charging, the screen status of the first terminal is off, and the time period to which the current time belongs is a preset time period.
[0158] In another possible implementation, the device further includes:
[0159] a sixth determining module, configured to determine a second update condition when the first terminal fails to meet the first update condition within a unit time period, wherein difficulty for the first terminal to meet the second update condition is lower than difficulty for the first terminal to meet the first update condition;
[0160] a seventh determination module, configured to determine a hotspot operation generated by the target application after the last update when the first terminal satisfies the second update condition;
[0161] The second update module is used to compile the bytecode of the hotspot function corresponding to the hotspot operation to obtain the machine code of the hotspot function, and store the machine code of the hotspot function in the target configuration file.
[0162] In another possible implementation, the seventh module is also used to count the length of time the screen of the first terminal is off when the charging status of the first terminal is charging and the screen status of the first terminal switches from on screen to off screen; when the length of time reaches a third preset length of time, it is determined that the first terminal meets the second update condition.
[0163] In an embodiment of the present application, since the target configuration file of the target application can be obtained during the process of downloading the target application, and the target configuration file includes the machine code of the hotspot function corresponding to the hotspot operation, after the first terminal downloads the target application, the machine code of the hotspot function in the target configuration file can be directly called to perform the hotspot operation, saving the compilation process of compiling the bytecode of the hotspot function into machine code, so that the first terminal can obtain the running speed improvement effect brought by bytecode compilation as soon as possible after downloading the target application.
[0164] It should be noted that the application running device provided in the above embodiment only uses the division of the above functional modules as an example when the application is running. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the terminal is divided into different functional modules to complete all or part of the functions described above. In addition, the application running device provided in the above embodiment and the application running method embodiment belong to the same concept, and the specific implementation process is detailed in the method embodiment, which will not be repeated here.
[0165] See also Fig. 9 , Fig. 9 9 is a schematic diagram of a terminal structure provided by an exemplary embodiment of the present application. The terminal may also include one or more of the following components: a processor 910 , a memory 920 , and a display screen 930 .
[0166] The processor 910 uses various interfaces and lines to connect the various parts of the entire terminal 900, and executes various functions and processes data of the terminal 900 by running or executing instructions, programs, code sets or instruction sets stored in the memory 920, and calling data stored in the memory 920. Optionally, the processor 910 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 910 can integrate one or a combination of a central processing unit (CPU), a graphics processing unit (GPU), a neural network processor (NPU), 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 on the display screen 930; the NPU is used to implement artificial intelligence (AI) functions; and the modem is used to process wireless communications. It is understandable that the above-mentioned modem may not be integrated into the processor 910, but may be implemented separately through a computer program product.
[0167] The memory 920 may include a random access memory (RAM) or a read-only memory (ROM). Optionally, the memory 920 includes a non-transitory computer-readable storage medium. The memory 920 may be used to store instructions, programs, codes, code sets, or instruction sets. The memory 920 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 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 store data (such as audio data, a phone book), etc., created according to the use of the terminal 900.
[0168] The display screen 930 is a display component for displaying a user interface. Optionally, the display screen 930 is a display screen with a touch function, through which the user can use any suitable object such as a finger, a touch pen, etc. to perform touch operations on the display screen 930.
[0169] The display screen 930 is usually arranged on the front panel of the terminal 900. The display screen 930 can be designed as a full screen, a curved screen, a special-shaped screen, a double-sided screen or a folding screen. The display screen 930 can also be designed as a combination of a full screen and a curved screen, a combination of a special-shaped screen and a curved screen, etc., which is not limited in this embodiment.
[0170] In addition, those skilled in the art can understand that the structure of the terminal 900 shown in the above drawings does not constitute a limitation on the terminal 900, and the terminal 900 may include more or fewer components than shown, or combine certain components, or arrange the components differently. For example, the terminal 900 also includes a Wifi module, an audio acquisition device, a speaker, a radio frequency circuit, an input unit, a sensor, an audio circuit, a Bluetooth module, a power supply, and other components, which will not be described in detail here.
[0171] An embodiment of the present application provides a computer-readable storage medium, which stores at least one computer instruction, and the at least one computer instruction is used to be executed by a processor to implement the method for running the application program described in the above embodiment.
[0172] On the other hand, an embodiment of the present application provides a computer program product, which includes computer instructions, and the computer instructions are stored in a computer-readable storage medium; a processor reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions to implement the method for running the application as described in the above embodiment.
[0173] Those skilled in the art should be aware that in one or more of the above examples, the functions described in the embodiments of the present application can be implemented with hardware, software, firmware, or any combination thereof. When implemented using software, these functions can be stored in a computer-readable medium or transmitted as one or more instructions or codes on a computer-readable medium. Computer-readable media include computer storage media and communication media, wherein the communication media include any media that facilitates the transmission of a computer program from one place to another. The storage medium can be any available medium that a general or special-purpose computer can access.
[0174] The above description is only an optional embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application shall be included in the protection scope of the present application.
Claims
1. A method for running an application, characterized in that: The method comprises: During the process of downloading the target application, a target configuration file of the target application is determined, the target configuration file includes a machine code of a hotspot function corresponding to a hotspot operation, the hotspot operation refers to an operation that is executed more than a preset number of times, the hotspot function is used to process the hotspot operation, and the machine code of the hotspot function is compiled based on the bytecode of the hotspot function; Storing the target configuration file in a storage space corresponding to the storage path of the target application; When executing the hotspot operation based on the target application, obtaining the machine code of the hotspot function from the target configuration file in the storage space; Execute the machine code of the hotspot function.
2. The method according to claim 1, characterized in that The determining of the target configuration file of the target application comprises at least one of the following: Obtaining a first configuration file of the target application from a server, and determining the first configuration file as a target configuration file of the target application, wherein the first configuration file is provided by the server for the target application, and the first configuration file includes a machine code of a hotspot function corresponding to a hotspot operation determined by the server; or, Obtaining a second configuration file of the target application from a configuration file of at least one application included in the first terminal, and determining the second configuration file as the target configuration file of the target application, wherein the configuration file of the at least one application is provided by the second terminal, the second configuration file is the configuration file of the target application in the at least one application, and the second configuration file includes the machine code of the hotspot function corresponding to the hotspot operation determined by the second terminal; or A first configuration file of the target application is obtained from the server, a second configuration file of the target application is obtained from a configuration file of at least one application included in the first terminal, and a target configuration file of the target application is determined based on the first configuration file and the second configuration file.
3. The method according to claim 2, characterized in that The determining the target configuration file based on the first configuration file and the second configuration file includes: Merging the machine code of the hotspot function corresponding to the hotspot operation included in the first configuration file and the machine code of the hotspot function corresponding to the hotspot operation included in the second configuration file to obtain a third configuration file; Deduplication is performed on the hotspot functions in the third configuration file to obtain the target configuration file.
4. The method according to claim 2, characterized in that: The method further comprises: Acquire the configuration file of the at least one application from configuration files of multiple applications of the second terminal, the second terminal installs the multiple applications, and for any application, the second terminal generates the configuration file of the application after the duration of running the application exceeds a first preset duration; A configuration file of the at least one application is stored.
5. The method according to claim 4, characterized in that The acquiring the configuration file of the at least one application from the configuration files of the plurality of applications of the second terminal includes: Determine device information of the first terminal, the device information including at least one of chip capability information, memory size information, and market positioning information, the chip capability information is used to indicate the chip capability of the first terminal, the memory size information is used to indicate the memory size of the first terminal, and the market positioning information is used to indicate the market group targeted by the first terminal; Based on the device information, determining at least one application matching the device information from among the plurality of applications; A configuration file of the at least one application is obtained from the second terminal.
6. The method according to claim 1, characterized in that Determining the target configuration file of the target application comprises: Establishing a short-distance communication channel with a third terminal, the target application is installed in the third terminal, and the duration for which the third terminal runs the target application exceeds a second preset duration; Obtaining a target configuration file of the target application from the third terminal via the short-distance communication channel.
7. The method according to any one of claims 1 to 6, characterized in that: The method further comprises: Determine a first update condition, where the first update condition is a condition that needs to be satisfied by the first terminal to update the target configuration file; When the first terminal satisfies the first update condition, determining a hotspot operation generated by the target application after the target configuration file was last updated; The bytecode of the hotspot function corresponding to the hotspot operation is compiled to obtain the machine code of the hotspot function, and the machine code of the hotspot function is stored in the target configuration file.
8. The method according to claim 7, characterized in that The method further comprises: When the charging status of the first terminal is charging, and the screen status of the first terminal is off, and the time period to which the current time belongs is a preset time period, it is determined that the first terminal meets the first update condition.
9. The method according to claim 7, characterized in that: The method further comprises: When the first terminal fails to meet the first update condition within a unit time period, determining a second update condition, wherein difficulty for the first terminal to meet the second update condition is lower than difficulty for the first terminal to meet the first update condition; When the first terminal meets the second update condition, determining a hotspot operation generated by the target application after the last update; The bytecode of the hotspot function corresponding to the hotspot operation is compiled to obtain the machine code of the hotspot function, and the machine code of the hotspot function is stored in the target configuration file.
10. The method according to claim 9, characterized in that The method further comprises: When the charging state of the first terminal is charging, and the screen state of the first terminal is switched from a bright screen to a dark screen, counting the duration of the dark screen state of the first terminal; When the duration reaches a third preset duration, it is determined that the first terminal meets the second update condition.
11. A device for running an application, characterized in that: The device comprises: A first determination module is used to determine a target configuration file of the target application during the process of downloading the target application, wherein the target configuration file includes a machine code of a hotspot function corresponding to a hotspot operation, wherein the hotspot operation refers to an operation executed more than a preset number of times, the hotspot function is used to process the hotspot operation, and the machine code of the hotspot function is compiled based on the bytecode of the hotspot function; A storage module, used to store the target configuration file in a storage space corresponding to the storage path of the target application program; A first acquisition module, configured to acquire the machine code of the hotspot function from the target configuration file in the storage space when the hotspot operation is performed based on the target application; An execution module is used to execute the machine code of the hotspot function.
12. A terminal, characterized in that: The terminal includes a processor and a memory, wherein the memory stores at least one computer instruction, and the at least one computer instruction is loaded and executed by the processor to implement the method for running the application according to any one of claims 1 to 10.
13. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores at least one computer instruction, and the at least one computer instruction is used to be executed by a processor to implement the method for running the application according to any one of claims 1 to 10.
14. A computer program product, characterized in that The computer program product includes computer instructions, which are stored in a computer-readable storage medium; a processor reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions to implement the method for running the application as described in any one of claims 1 to 10.
Citation Information
Cited By
Start control method and device, electronic equipment and computer readable storage medium
CN120523529A