Application Loading Method, Device, Storage Medium, and Terminal
By preloading the file page information of the target application, the problem of slow application loading speed is solved and faster loading speed is achieved.
Patent Information
- Application Number
- CN202111103959.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-09-18
- Publication Date
- 2025-08-05
- Estimated Expiration
- 2041-09-18
AI Technical Summary
In the prior art, application programs are loading slowly, especially the problem of long startup time.
By pre-determining the loading information of the file during the target application loading process, pre-loading the target file page of the target preset file in advance.
Reduces the overall loading time of the application and improves the loading speed of the application.
Smart Images

Figure CN113849195B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of application technology development, and in particular to an application loading method, device, storage medium, and terminal. Background Art
[0002] With the development of science and technology, terminals are increasingly appearing in people's lives. People can load various applications to realize various functions by controlling the terminals. Therefore, the method of loading applications in terminals has become one of the research focuses of those skilled in the art. Summary of the Invention
[0003] The present application provides an application loading method, device, storage medium and terminal, which can solve the technical problem of slow application loading speed in related technologies.
[0004] In a first aspect, an embodiment of the present application provides a method for loading an application program, the method comprising:
[0005] determining preloading information of the target application according to running data of the target application when the target application is first loaded and a target preset file corresponding to the target application, wherein the preloading information is attribute information of a target file page of the target preset file during the loading process of the target application;
[0006] When the target application meets the loading condition, obtaining preloading information of the target application;
[0007] Before or during the loading of the target application, the target file page of the target preset file is preloaded according to the preloading information.
[0008] In a second aspect, an embodiment of the present application provides an application loading device, the device comprising:
[0009] a preloading information determining module, configured to determine preloading information of a target application based on running data of the target application when the target application is first loaded and a target preset file corresponding to the target application, wherein the preloading information is loading information of the target preset file during the loading process of the target application;
[0010] A preloading information acquisition module, configured to acquire preloading information of the target application when the target application meets a loading condition;
[0011] The preloading information execution module is used to preload the target file page of the target preset file according to the preloading information before or during the loading of the target application.
[0012] In a third aspect, an embodiment of the present application provides a computer storage medium, which stores a plurality of instructions, and the instructions are suitable for being loaded by a processor and executing the steps of the above method.
[0013] In a fourth aspect, an embodiment of the present application provides a terminal, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor.
[0014] The beneficial effects of the technical solutions provided by some embodiments of the present application include at least:
[0015] The present application provides an application loading method, which first determines the preloading information of the target application based on the running data of the target application when it is first loaded and the target preset file corresponding to the target application, wherein the preloading information is the attribute information of the target file page of the target preset file during the target application loading process; then, when the target application meets the loading conditions, the preloading information of the target application is obtained; finally, before or during the loading of the target application, the target file page of the target preset file is preloaded according to the preloading information. Since the loading information of the target application file during the loading process can be determined in advance, the target file page of the target preset file can be preloaded in advance before or during the loading of the target application. Then, when the target application loads the target preset file, the loading result of the loaded target preset file can be directly used, thereby reducing the overall loading time of the target application and improving the overall loading speed of the target application. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without paying any creative work.
[0017] Figure 1 An exemplary system architecture diagram of an application loading method provided in an embodiment of the present application;
[0018] Figure 2 A system interaction diagram of an application loading method provided in an embodiment of the present application;
[0019] Figure 3 A flowchart of a method for loading an application program provided in an embodiment of the present application;
[0020] Figure 4 A flowchart of an application loading method provided in another embodiment of the present application;
[0021] Figure 5 A schematic structural diagram of an application loading device provided in another embodiment of the present application;
[0022] Figure 6 A schematic diagram of the structure of a terminal is provided for an embodiment of the present application. DETAILED DESCRIPTION
[0023] To make the features and advantages of this application more obvious and easy to understand, the technical solutions in the embodiments of this application will be clearly and completely described below in conjunction with the drawings in the embodiments of this application. Obviously, the described embodiments are only part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without making creative efforts shall fall within the scope of protection of this application.
[0024] When the following description refers to the accompanying drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. Instead, they are merely examples of devices and methods consistent with certain aspects of the present application, as detailed in the appended claims.
[0025] Figure 1 An exemplary system architecture diagram of an application loading method provided in an embodiment of the present application.
[0026] like Figure 1 As shown, the system architecture may include a terminal 101, a network 102, and a server 103. The network 102 is used to provide a medium for a communication link between the terminal 101 and the server 103. The network 102 may include various types of wired communication links or wireless communication links, for example, a wired communication link may include an optical fiber, a twisted pair, or a coaxial cable, and a wireless communication link may include a Bluetooth communication link, a Wireless-Fidelity (Wi-Fi) communication link, or a microwave communication link.
[0027] The terminal 101 can interact with the server 103 through the network 102 to receive messages from the server 103 or send messages to the server 103. The terminal 101 can be hardware or software. When the terminal 101 is hardware, it can be various electronic devices, including but not limited to smart watches, smart phones, tablet computers, laptop portable computers and desktop computers. When the terminal 101 is software, it can be installed in the electronic devices listed above, which can be implemented as multiple software or software modules (for example: for providing distributed services), or can be implemented as a single software or software module, which is not specifically limited here.
[0028] The server 103 may be a business server that provides various services. It should be noted that the server 103 may be hardware or software. When the server 103 is hardware, it may be implemented as a distributed server cluster consisting of multiple servers, or it may be implemented as a single server. When the server 103 is software, it may be implemented as multiple software or software modules (for example, for providing distributed services), or it may be implemented as a single software or software module, which is not specifically limited herein.
[0029] It should be understood that Figure 1 The number of terminals, networks, and servers in the figure is only for illustration and any number of terminals, networks, and servers may be used according to implementation requirements.
[0030] See also Figure 2 , Figure 2 A system interaction diagram of an application loading method provided in an embodiment of the present application. It can be understood that in the embodiment of the present application, the execution subject can be a terminal or a processor in the terminal, or a related service for executing application loading in the terminal. For the convenience of description, the following takes the execution subject as the processor in the terminal as an example. Figure 1 and Figure 2 This paper introduces the system interaction process in an application loading method.
[0031] S201: The user triggers loading of a target application for the first time.
[0032] S202. The processor determines preloading information of the target application based on the running data when the target application is first loaded and the target preset file corresponding to the target application, wherein the preloading information is attribute information of the target file page of the target preset file during the loading process of the target application.
[0033] Optionally, before determining the preloading information of the target application based on the running data when the target application is first loaded and the target preset file corresponding to the target application, it also includes: when the scanning conditions are met, scanning all applications in the terminal; obtaining the preset file specified by each application respectively, and obtaining the node information corresponding to each preset file; wherein the preset file includes at least one file page, and the file page in the same preset file corresponds to the same node information.
[0034] Optionally, before determining the preloading information of the target application based on the running data when the target application is first loaded and the target preset file corresponding to the target application, it also includes: when the target application meets the loading conditions and it is determined that there is no preloading information of the target application, determining that the target application is loaded for the first time; obtaining the running data during the first loading process of the target application.
[0035] Optionally, the preloading information of the target application is determined based on the running data when the target application is first loaded and the target preset file corresponding to the target application, including: parsing the running data during the first loading process of the target application to obtain file page information of all file pages read from the disk to the memory during the first loading process of the target application, wherein the file page information at least includes the node information corresponding to the file to which the file page belongs; determining the target file page information of the target file page corresponding to the target application based on the file page information of each file page and the target node information corresponding to the target preset file in the target application; and determining the preloading information of the target application based on the target file page information corresponding to the target application.
[0036] Optionally, the file page information also includes the initial offset position and offset length of the file page in the file to which it belongs; based on the target file page information corresponding to the target application, the preloading information of the target application is determined, including: based on the target file page information corresponding to the target application, determining the position information of the target file page corresponding to the target application in the target preset file; obtaining the loading time identifier of the target file page corresponding to the target application, and sorting each target file page according to the loading time identifier of each target file page; using the sorting results of each target file page and the position information of each target file page as the attribute information of the target file page of the target preset file during the loading process of the target application.
[0037] S203: This is not the first time that the user triggers loading of the target application.
[0038] S204: When the target application meets the loading condition, obtain preloading information of the target application.
[0039] S205 : Before or during the loading of the target application, preload the target file page of the target preset file according to the preloading information.
[0040] Optionally, the target file pages of the target preset file are preloaded according to the preloading information, including: reading each target file page corresponding to the target preset file from the disk according to the location information of each target file page in the preloading information; and loading each target file page in parallel in the memory according to the sorting result of the target file pages, so that the target file pages of the target preset file are preloaded.
[0041] Optionally, the target application satisfies the loading conditions, including: the target application is started, and it is determined that the target application satisfies the loading conditions; before or during the loading of the target application, the target file page of the target preset file is preloaded according to the preloading information, including: during the loading of the target application, the target file page of the target preset file is preloaded according to the preloading information.
[0042] or
[0043] The target application satisfies the loading conditions, including: there is a target event indicating the target application, determining that the target application satisfies the loading conditions; before or during the loading of the target application, preloading the target file page of the target preset file according to the preloading information, including: before the target application is loaded, preloading the target file page of the target preset file according to the preloading information.
[0044] In an embodiment of the present application, first, the preloading information of the target application is determined based on the running data of the target application when it is first loaded and the target preset file corresponding to the target application, wherein the preloading information is the attribute information of the target file page of the target preset file during the loading process of the target application; then, when the target application meets the loading conditions, the preloading information of the target application is obtained; finally, before or during the loading process of the target application, the target file page of the target preset file is preloaded according to the preloading information. Since the loading information of the target application file during the loading process can be determined in advance, the target file page of the target preset file can be preloaded in advance before or during the loading process of the target application. Then, when the target application loads the target preset file, the loading result of the loaded target preset file can be directly used, thereby reducing the overall loading time of the target application and improving the overall loading speed of the target application.
[0045] See also Figure 3 , Figure 3 A flowchart of an application loading method provided in an embodiment of the present application.
[0046] like Figure 3 As shown, the application loading method includes:
[0047] S301. Determine preloading information of a target application based on running data of the target application when the target application is first loaded and a target preset file corresponding to the target application, wherein the preloading information is attribute information of a target file page of the target preset file during the loading process of the target application.
[0048] In the related art, people can load various applications through the control terminal to realize various functions. During the loading process of the application, the files corresponding to the application are generally run serially through a single thread. That is, during the loading process of the application, it is necessary to wait for the previous file to be loaded before continuing to load subsequent files to complete the loading process of the application. This will cause the application, especially the application with a long startup time (for example, game applications, which have a long startup time due to loading animations and game resources), to load slower.
[0049] In response to the above technical problems, in an embodiment of the present application, by pre-loading the specified files in the application, the loading time of the application is reduced and the loading speed of the application is improved.
[0050] Specifically, in the embodiment of the present application, the target application can be any application installed in the terminal. When the terminal is running, when it is monitored that the target application meets the loading conditions, it means that the terminal needs to load the target application. At this time, it can be determined whether the target application is loaded for the first time. If the target application is not loaded for the first time, the target application is loaded for the first time, and the running data of the target application during the first loading process is obtained, wherein the running data of the target application during the first loading process at least includes all file page information from the disk to the memory during the application loading process. Then, according to the running data of the target application during the first loading process and the target preset file corresponding to the target application, the preloading information of the target application is determined, wherein the preloading information is the attribute information of the target preset file during the target application loading process, and the target preset file can be one or more specified files during the target application loading process.
[0051] It is understandable that a file loaded in an application is composed of one or more file pages. A file page can be considered a unit that constitutes a file. For example, if a file is 100 megabytes in size and is composed of 100 file pages, then the first file page may be located at the first position or first area of the file, and its first file page size is 2 megabytes. The sum of the data sizes of all file pages is also the size of the file. The application startup process can be considered to be loading the file pages in the corresponding file in sequence. Therefore, the attribute information of the target file page of the target preset file can also be specifically the attribute information of the target file page in the target preset file. The target file page can be one or more specified file pages in the target preset file loaded by the target application. The attribute information can include information such as the loading order and storage location of the target file page.
[0052] S302: When the target application meets the loading condition, obtain preloading information of the target application.
[0053] When the target application meets the loading conditions and it is determined that the target application is not loaded for the first time, it means that the preloading information of the target application has been determined in the first loading before the target application. Then, when it is monitored that the target application meets the loading conditions, the preloading information of the target application can be directly obtained.
[0054] S303: Before or during the loading of the target application, preload the target file page of the target preset file according to the preloading information.
[0055] After the preloading information of the target application is acquired, the target preset file of the target application may be determined according to the preloading information, and the target file page of the target preset file may be preloaded.
[0056] During the process of preloading the target file page of the target preset file, the target file page of the target preset file may be preloaded in different ways according to specific loading conditions satisfied by the target application.
[0057] One feasible implementation is to determine that the target application satisfies the loading conditions after the target application is launched. The target application may be launched by a user touching an icon corresponding to the target application on a display screen of the terminal, or by a user issuing a voice command similar to the method for launching the target application. This application does not specifically limit the method for launching the target application.
[0058] Since it is detected that the target application is started, it means that the target application is already in the loading process, but the target preset file can be one or more specified files in the target application loading process. Therefore, the target application does not necessarily load the target preset file first during the loading process. Therefore, at this time, during the target application loading process, the target file page of the target preset file can be preloaded according to the preloading information, that is, during the target application loading process, the target file page of the target preset file can be loaded in advance according to the preloading information.
[0059] Another feasible implementation is to determine that the target application meets the loading condition when a target event indicating the target application exists. The target event indicating the target application can be voice, user habits, gestures, geographic location information, etc. associated with the target application. The specific target time can be determined through big data analysis or specified by the user.
[0060] Since the target application has not been started when there is a target event indicating the target application, the target file page of the target preset file can be preloaded according to the preloading information before the target application is loaded, that is, before the target application is loaded, the target file page of the target preset file can be loaded in advance according to the preloading information.
[0061] In an embodiment of the present application, first, the preloading information of the target application is determined based on the running data of the target application when it is first loaded and the target preset file corresponding to the target application, wherein the preloading information is the attribute information of the target file page of the target preset file during the loading process of the target application; then, when the target application meets the loading conditions, the preloading information of the target application is obtained; finally, before or during the loading process of the target application, the target file page of the target preset file is preloaded according to the preloading information. Since the loading information of the target application file during the loading process can be determined in advance, the target file page of the target preset file can be preloaded in advance before or during the loading process of the target application. Then, when the target application loads the target preset file, the loading result of the loaded target preset file can be directly used, thereby reducing the overall loading time of the target application and improving the overall loading speed of the target application.
[0062] See also Figure 4 , Figure 4 A flowchart of an application loading method provided in another embodiment of the present application.
[0063] like Figure 4 As shown, the method includes:
[0064] S401. When a scanning condition is met, scan all applications in the terminal.
[0065] It can be understood that the target preset file can be one or more specified files in the target application loading process, and the target preset file can also include one or more file pages, but not all file pages in the target preset file are required for the target application to load. Therefore, in the embodiment of the present application, in order to load the target preset file more accurately, the target file page required for the target application to load the target preset file can be obtained. Then, in the process of preloading the target file page of the target preset file according to the preloading information, only the target file page required in the target preset file can be pre-recorded, and there is no need to load the file pages other than the target file page in the target preset file, so as to reduce the time wasted in loading unnecessary file pages.
[0066] To determine the target file page required by the target application to load the target preset file, the target preset file in the target application can be determined first. Specifically, when a scanning condition is met in the terminal, all applications in the terminal can be scanned. The scanning condition can be met when events such as terminal power-on, any application in the terminal being updated, or any application being installed or uninstalled are detected. In this case, all applications in the terminal can be scanned to obtain data corresponding to all applications in the terminal.
[0067] S402: Obtain the preset files specified by each application respectively, and obtain the node information corresponding to each preset file.
[0068] After acquiring data corresponding to all applications in the terminal, preset files specified by each application may be acquired respectively, wherein the preset files are one or more files in the loading process of each application.
[0069] Optionally, the preset file is not all the files corresponding to the application loading process, and can be a file that takes more than a preset time threshold in the application loading process, that is, the preset file can be a file that takes a long time in the application loading process, so that when the preset file can be preloaded in advance later, the time taken by the application to load the preset file can be reduced. In addition, the preset file can also be a default file specified by the developer, for example, it can be an apk or dex file. The default preset file can be repeatedly tested by the developer in the cloud, and by configuring different loading file lists, the configuration with the best benefit can be screened out as the default preset file for the application. In addition, the preset file can also be a file that the application itself configures through an open interface. In the embodiment of the present application, the specific type of the preset file is not limited.
[0070] After determining the preset files specified by each application, the node information corresponding to the preset files can also be obtained. The node information can be considered as an identity identifier, used to identify different files, and the node information of different files is different. For example, the node information can be an inode node, where the inode node can correspond to the file name and / or file save path of the preset file.
[0071] It can be understood that since the preset file may include one or more file pages, that is, the preset file includes at least one file page, the file pages in the same preset file correspond to the same node information, and the file pages in different preset files correspond to different node information.
[0072] S403: When the target application meets the loading condition and it is determined that there is no pre-loading information of the target application, it is determined that the target application is loaded for the first time.
[0073] It can be understood that when the target application is loaded for the first time, the preloading information of the target application needs to be determined. Then, after detecting that the target application meets the loading conditions, it is determined whether the preloading information of the target application is saved in the terminal. If the preloading information of the target application is not saved in the terminal, it can be determined that the preloading information of the target application does not exist in the terminal, and it can be determined that the target application is loaded for the first time.
[0074] S404: Obtain the running data of the target application during the first loading process.
[0075] After determining that the target application is loaded for the first time, the running data of the target application during the first loading process can be monitored. A feasible implementation method is to monitor the running data of the target application during the first loading process through a certain function, a certain algorithm or a certain thread. For example, the trace information of the target application can be captured through Ftrace technology after the target application is started. The data source of the trace is configured as the page-in event in the Ftrace event. The Ftrace event records the runtime behavior of the kernel. The page-in event includes the file page information from the disk to the memory during the application loading process. The running data during the first loading process of the target application can also be considered to include at least all the file page information from the disk to the memory during the application loading process. That is, the running data during the first loading process of the target application can be obtained through Ftrace technology.
[0076] If it is determined that the target application is not loaded for the first time, it means that in the first loading of the target application before, the step of obtaining the preloading information of the target application can be directly executed.
[0077] S405 , parsing the running data during the first loading process of the target application, and obtaining file page information of all file pages read from the disk to the memory during the first loading process of the target application.
[0078] After obtaining the running data during the first loading process of the target application, the running data during the first loading process of the target application can be parsed. Since the file loaded in the application is composed of one or more file pages, all file pages read from the disk to the memory during the first loading process of the target application and the file page information corresponding to each file page can be obtained through parsing, where the file page information at least includes the node information corresponding to the file to which the file page belongs.
[0079] S406 : Determine target file page information of the target file page corresponding to the target application according to the file page information of each file page and the target node information corresponding to the target preset file in the target application.
[0080] Since the file page information at least includes the node information corresponding to the file to which the file page belongs, the node information corresponding to the file to which each file page belongs can be compared with the target node information corresponding to the target preset file in the target application. The file page with the same node information as the target node information corresponding to the target preset file in the target application can be determined as the target file page of the preset target file in the target application. Then the target file page is the file page required by the target application to load the target preset file, and the target file page information of the target file page can be obtained.
[0081] S407: Determine preloading information of the target application according to the target file page information corresponding to the target application.
[0082] The target file page is the file page required by the target application when loading the target preset file. Therefore, the preloading information of the target application is determined based on the target file page information corresponding to the target application. In the process of preloading the target preset file according to the preloading information, only the target file pages required in the target preset file can be pre-recorded, and there is no need to load file pages other than the target file page in the target preset file, so as to reduce the time wasted on unnecessary file pages.
[0083] Optionally, the file page information also includes the initial offset position and offset length of the file page in the file to which it belongs. Then, in the process of determining the preloading information of the target application based on the target file page information corresponding to the target application, the position information of the target file page corresponding to the target application in the target preset file can be determined based on the initial offset position and offset length of the target file page in the target preset file included in the target file page information corresponding to the target application.
[0084] Among them, the initial offset position and offset length of the target file page in the target preset file can be considered as the data corresponding to the target file page, the area information or storage information in the data corresponding to the target preset file. Therefore, the position information of the target file page corresponding to the target application in the target preset file can be determined based on the initial offset position and offset length of the target file page in the target preset file included in the target file page information corresponding to the target application.
[0085] Furthermore, the loading time identifier of the target file page corresponding to the target application can be obtained, and each target file page can be sorted according to the loading time identifier of each target file page. Finally, the sorting results of each target file page and the location information of each target file page can be used as the preloading information of the target application.
[0086] S408: When the target application meets the loading condition, obtain preloading information of the target application.
[0087] When it is detected that the target application meets the loading conditions and it is determined that the target application is not loaded for the first time, it means that the preloading information of the target application has been determined in the first loading before the target application. Then, when it is detected that the target application meets the loading conditions, the preloading information of the target application can be directly obtained.
[0088] S409 : Before or during the target application is loaded, read the target file pages corresponding to the target preset file from the disk according to the location information of the target file pages in the preload information.
[0089] After obtaining the preloading information of the target application, and the preloading information of the target application includes the sorting results of each target file page and the location information of each target file page, then the target file pages corresponding to the target preset file can be read from the disk according to the location information of each target file page in the preloading information.
[0090] S410 , loading the target file pages in parallel into the memory according to the sorting result of the target file pages, so as to preload the target file pages of the target preset file.
[0091] Optionally, after reading each target file page corresponding to the target preset file from disk, each target file page can be loaded in parallel in memory using at least two threads according to the sorting results of the target file pages. That is, each target file page can be loaded simultaneously, so that the target file pages of the target preset file are preloaded. For example, according to the sorting results of the target file pages, the first two target file pages in the sorting results can be loaded in parallel in memory using two threads. Compared to the prior art, serial loading of file pages using a single thread can effectively improve the loading speed of file pages.
[0092] In an embodiment of the present application, in order to load the target preset file more accurately, the target file page required by the target application to load the target preset file can be obtained. Then, in the process of preloading the target file page of the target preset file according to the preloading information, only the target file page required in the target preset file can be pre-recorded, and there is no need to load file pages other than the target file page in the target preset file, so as to reduce the time wasted on unnecessary file pages.
[0093] See also Figure 5 , Figure 5 A schematic structural diagram of an application loading device provided in another embodiment of the present application.
[0094] like Figure 5 As shown, the application loading device 500 includes:
[0095] The preloading information determination module 510 is used to determine the preloading information of the target application based on the running data when the target application is first loaded and the target preset file corresponding to the target application, wherein the preloading information is the attribute information of the target file page of the target preset file during the loading process of the target application.
[0096] Optionally, the application loading device 500 further includes:
[0097] The scanning module is used to scan all applications in the terminal when the scanning conditions are met.
[0098] The node information acquisition module is used to respectively acquire the preset files specified by each application program and acquire the node information corresponding to each preset file.
[0099] Optionally, the application loading device 500 further includes:
[0100] The first loading determination module is configured to determine that the target application is loaded for the first time when the target application meets the loading condition and it is determined that there is no preloading information of the target application.
[0101] The first loading acquisition module is used to obtain the running data of the target application during the first loading process.
[0102] The preloading information determination module 510 is also used to parse the running data during the first loading process of the target application, and obtain the file page information of all file pages read from the disk to the memory during the first loading process of the target application, wherein the file page information at least includes the node information corresponding to the file to which the file page belongs; determine the target file page information corresponding to the target application based on the file page information of each file page and the target node information corresponding to the target preset file in the target application; determine the preloading information of the target application based on the target file page information corresponding to the target application.
[0103] Among them, the file page information also includes the initial offset position and offset length of the file page in the file to which it belongs; according to the target file page information corresponding to the target application, the preloading information of the target application is determined, including: according to the target file page information corresponding to the target application, the position information of the target file page corresponding to the target application in the target preset file is determined; the loading time identifier of the target file page corresponding to the target application is obtained, and each target file page is sorted according to the loading time identifier of each target file page; the sorting result of each target file page and the position information of each target file page are used as the attribute information of the target file page of the target preset file during the loading process of the target application.
[0104] The preloading information acquisition module 520 is configured to acquire the preloading information of the target application when detecting that the target application meets the loading condition.
[0105] The preloading information execution module 530 is configured to preload the target file page of the target preset file according to the preloading information before or during the loading of the target application.
[0106] The preloading information execution module 530 is also used to preload the target file pages of the target preset file according to the preloading information, including: reading each target file page corresponding to the target preset file from the disk according to the location information of each target file page in the preloading information; loading each target file page in parallel in the memory, so as to preload the target file pages of the target preset file.
[0107] Optionally, the target application satisfies the loading condition, including: starting the target application and determining that the target application satisfies the loading condition; before or during the loading of the target application, preloading the target file page of the target preset file according to the preloading information, including: during the loading of the target application, preloading the target file page of the target preset file according to the preloading information;
[0108] or
[0109] The target application satisfies the loading conditions, including: there is a target event indicating the target application, determining that the target application satisfies the loading conditions; before or during the loading of the target application, preloading the target file page of the target preset file according to the preloading information, including: before the target application is loaded, preloading the target file page of the target preset file according to the preloading information.
[0110] In an embodiment of the present application, an application loading device includes: a preloading information determination module, configured to determine the preloading information of a target application based on the running data of the target application when the target application is first loaded and the target preset file corresponding to the target application, wherein the preloading information is the loading information of the target preset file during the loading process of the target application; a preloading information acquisition module, configured to acquire the preloading information of the target application when the target application meets the loading conditions; and a preloading information execution module, configured to preload the target file page of the target preset file based on the preloading information before or during the loading process of the target application. Since the loading information of the target application file during the loading process can be determined in advance, the target file page of the target preset file can be preloaded in advance before or during the loading process of the target application. Then, when the target application loads the target preset file, the loading result of the loaded target preset file can be directly used, thereby reducing the overall loading time of the target application and improving the overall loading speed of the target application.
[0111] An embodiment of the present application further provides a computer storage medium storing a plurality of instructions, wherein the instructions are suitable for being loaded by a processor and executing the steps of any of the methods in the above embodiments.
[0112] Further, see Figure 6 , Figure 6 A schematic diagram of the structure of a terminal is provided for an embodiment of the present application. Figure 6 As shown, the terminal 600 may include: at least one central processor 601 , at least one network interface 604 , a user interface 603 , a memory 605 , and at least one communication bus 602 .
[0113] The communication bus 602 is used to implement the connection and communication between these components.
[0114] The user interface 603 may include a display screen (Display) and a camera (Camera). Optionally, the user interface 603 may also include a standard wired interface and a wireless interface.
[0115] The network interface 604 may optionally include a standard wired interface or a wireless interface (such as a WI-FI interface).
[0116] The central processing unit 601 may include one or more processing cores. The central processing unit 601 utilizes various interfaces and circuits to connect various components within the terminal 600. It executes instructions, programs, code sets, or instruction sets stored in the memory 605, and accesses data stored in the memory 605 to perform various functions and process data for the terminal 600. Optionally, the central processing unit 601 may be implemented using at least one of the following hardware forms: a digital signal processing (DSP), a field-programmable gate array (FPGA), or a programmable logic array (PLA). The central processing unit 601 may integrate one or a combination of a central processing unit (CPU), a graphics processing unit (GPU), and a modem. The CPU primarily 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; and the modem handles wireless communications. It is understood that the modem may not be integrated into the central processing unit 601 and may be implemented as a separate chip.
[0117] Among them, the memory 605 may include a random access memory (RAM) or a read-only memory (Read-Only Memory). Optionally, the memory 605 includes a non-transitory computer-readable storage medium. The memory 605 can be used to store instructions, programs, codes, code sets or instruction sets. The memory 605 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 above-mentioned various method embodiments, etc.; the data storage area may store data involved in the above-mentioned various method embodiments, etc. The memory 605 may also be optionally at least one storage device located away from the aforementioned central processor 601. As Figure 6 As shown, the memory 605 as a computer storage medium may include an operating system, a network communication module, a user interface module, and an application loader.
[0118] exist Figure 6In the terminal 600 shown, the user interface 603 is mainly used to provide an input interface for the user and obtain data input by the user; and the central processing unit 601 can be used to call the application loading program stored in the memory 605 and perform the following operations:
[0119] Determining preloading information of the target application based on the running data of the target application when it is first loaded and the target preset file corresponding to the target application, wherein the preloading information is attribute information of the target file page of the target preset file during the loading process of the target application;
[0120] When the target application meets the loading condition, obtaining the preloading information of the target application;
[0121] Before or during the loading of the target application, the target file page of the target preset file is preloaded according to the preloading information.
[0122] Optionally, before determining the preloading information of the target application based on the running data when the target application is first loaded and the target preset file corresponding to the target application, it also includes: when the scanning conditions are met, scanning all applications in the terminal; obtaining the preset file specified by each application respectively, and obtaining the node information corresponding to each preset file; wherein the preset file includes at least one file page, and the file page in the same preset file corresponds to the same node information.
[0123] Optionally, before determining the preloading information of the target application based on the running data when the target application is first loaded and the target preset file corresponding to the target application, it also includes: when the target application meets the loading conditions and it is determined that there is no preloading information of the target application, determining that the target application is loaded for the first time; obtaining the running data during the first loading process of the target application.
[0124] Optionally, the preloading information of the target application is determined based on the running data when the target application is first loaded and the target preset file corresponding to the target application, including: parsing the running data during the first loading process of the target application to obtain file page information of all file pages read from the disk to the memory during the first loading process of the target application, wherein the file page information at least includes the node information corresponding to the file to which the file page belongs; determining the target file page information of the target file page corresponding to the target application based on the file page information of each file page and the target node information corresponding to the target preset file in the target application; and determining the preloading information of the target application based on the target file page information corresponding to the target application.
[0125] Optionally, the file page information also includes the initial offset position and offset length of the file page in the file to which it belongs; based on the target file page information corresponding to the target application, the preloading information of the target application is determined, including: based on the target file page information corresponding to the target application, determining the position information of the target file page corresponding to the target application in the target preset file; obtaining the loading time identifier of the target file page corresponding to the target application, and sorting each target file page according to the loading time identifier of each target file page; using the sorting results of each target file page and the position information of each target file page as the attribute information of the target file page of the target preset file during the loading process of the target application.
[0126] Optionally, the target file pages of the target preset file are preloaded according to the preloading information, including: reading each target file page corresponding to the target preset file from the disk according to the location information of each target file page in the preloading information; and loading each target file page in parallel in the memory, so that the target file pages of the target preset file are preloaded.
[0127] Optionally, the target application satisfies the loading condition, including: starting the target application and determining that the target application satisfies the loading condition; before or during the loading of the target application, preloading the target file page of the target preset file according to the preloading information, including: during the loading of the target application, preloading the target file page of the target preset file according to the preloading information;
[0128] or
[0129] The target application satisfies the loading conditions, including: there is a target event indicating the target application, determining that the target application satisfies the loading conditions; before or during the loading of the target application, preloading the target file page of the target preset file according to the preloading information, including: before the target application is loaded, preloading the target file page of the target preset file according to the preloading information.
[0130] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of modules is only a logical function division. In actual implementation, there may be other division methods, such as multiple modules or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or modules, which can be electrical, mechanical or other forms.
[0131] Modules described as separate components may or may not be physically separate, and components shown as modules may or may not be physical modules, that is, they may be located in one place or distributed across multiple network modules. Some or all of these modules may be selected to achieve the purpose of this embodiment based on actual needs.
[0132] In addition, the functional modules in the various embodiments of the present application may be integrated into a processing module, or each module may exist physically separately, or two or more modules may be integrated into a single module. The above-mentioned integrated modules may be implemented in the form of hardware or software functional modules.
[0133] If the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the various embodiments of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0134] It should be noted that for the aforementioned method embodiments, for ease of description, they are all expressed as a series of action combinations, but those skilled in the art should be aware that this application is not limited by the order of the actions described, because according to this application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in this specification are all preferred embodiments, and the actions and modules involved are not necessarily required by this application.
[0135] In the above embodiments, the description of each embodiment has its own focus. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant description of other embodiments.
[0136] The above is a description of an application loading method, device, storage medium, and terminal provided in this application. For those skilled in the art, based on the ideas of the embodiments of this application, there may be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on this application.
Claims
1. A method for loading an application, characterized in that: The method comprises: Determining preloading information of the target application based on running data when the target application is first loaded and a target preset file corresponding to the target application, wherein the preloading information is attribute information of a target file page of the target preset file during the loading process of the target application; wherein the target preset file includes a file that takes more than a preset time threshold during the loading process of the target application, and the target file page is a file page required for the target application to load the target preset file; determining the preloading information of the target application based on running data when the target application is first loaded and the target preset file corresponding to the target application comprises: parsing the running data to obtain file page information of all file pages read from the disk to the memory during the first loading process of the target application, the file page information including node information corresponding to the file to which the file page belongs; determining a file page having the same node information as the target node information corresponding to the target preset file as the target file page; and determining the preloading information based on the target file page information of the target file page; When the target application meets the loading condition, obtaining preloading information of the target application; Before or during the loading of the target application, the target file page of the target preset file is preloaded according to the preloading information.
2. The method according to claim 1, characterized in that Before determining the preloading information of the target application according to the running data of the target application when the target application is first loaded and the target preset file corresponding to the target application, the method further includes: When the scanning conditions are met, all applications in the terminal are scanned; Obtain the preset files specified by each application respectively, and obtain the node information corresponding to each preset file; The preset file includes at least one file page, and the file page in the same preset file corresponds to the same node information.
3. The method according to claim 2, characterized in that Before determining the preloading information of the target application according to the running data of the target application when the target application is first loaded and the target preset file corresponding to the target application, the method further includes: When the target application meets the loading condition and it is determined that there is no preloading information of the target application, it is determined that the target application is loaded for the first time; Obtaining the running data of the target application during the first loading process.
4. The method according to claim 1, wherein The file page information also includes the initial offset position and offset length of the file page in the file to which it belongs; The determining the preloading information according to the target file page information of the target file page includes: Determining, according to the target file page information, location information of the target file page in the target preset file; Obtaining a loading time identifier of each target file page, and sorting each target file page according to the loading time identifier of each target file page; The sorting results of the target file pages and the position information of the target file pages are used as the attribute information of the target file pages.
5. The method according to claim 4, characterized in that Preloading the target file page of the target preset file according to the preloading information includes: Reading the target file page from a disk according to the location information of the target file page included in the preloading information; The target file pages are loaded in parallel in the memory according to the sorting results of the target file pages, so that the target file pages are preloaded.
6. The method according to any one of claims 1 to 5, characterized in that The target application meets the loading conditions, including: The target application is started, and it is determined that the target application meets the loading condition; The preloading of the target file page of the target preset file according to the preloading information before or during the loading of the target application includes: During the target application loading process, preloading the target file page of the target preset file according to the preloading information; or The target application meets the loading conditions, including: There is a target event indicating the target application, and determining that the target application meets a loading condition; The preloading of the target file page of the target preset file according to the preloading information before or during the loading of the target application includes: Before the target application is loaded, the target file page of the target preset file is preloaded according to the preloading information.
7. An application loading device, characterized in that: The device comprises: A preloading information determination module is configured to determine the preloading information of a target application based on running data when the target application is first loaded and a target preset file corresponding to the target application, wherein the preloading information is attribute information of a target file page of the target preset file during the loading process of the target application; wherein the target preset file includes a file that takes more than a preset time threshold during the loading process of the target application, and the target file page is a file page required for the target application to load the target preset file; determining the preloading information of the target application based on the running data when the target application is first loaded and the target preset file corresponding to the target application comprises: parsing the running data to obtain file page information of all file pages read from the disk to the memory during the first loading process of the target application, the file page information including node information corresponding to the file to which the file page belongs; determining a file page having the same node information as the target node information corresponding to the target preset file as the target file page; and determining the preloading information based on the target file page information of the target file page; A preloading information acquisition module, configured to acquire preloading information of the target application when the target application meets a loading condition; The preloading information execution module is used to preload the target file page of the target preset file according to the preloading information before or during the loading of the target application.
8. A computer storage medium, characterized in that The computer storage medium stores a plurality of instructions, which are suitable for being loaded by a processor and executing the steps of the method according to any one of claims 1 to 6.
9. A terminal, characterized in that: The method comprises a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the steps of the method according to any one of claims 1 to 6 are implemented.
Citation Information
Patent Citations
Application program file preloading method, device and mobile terminal
CN112817648A