CN117707639A - Application start acceleration method, electronic device and storage medium - Google Patents
Application start acceleration method, electronic device and storage medium Download PDFInfo
- Publication number
- CN117707639A CN117707639A CN202311113384.3A CN202311113384A CN117707639A CN 117707639 A CN117707639 A CN 117707639A CN 202311113384 A CN202311113384 A CN 202311113384A CN 117707639 A CN117707639 A CN 117707639A
- Authority
- CN
- China
- Prior art keywords
- file
- application
- hpb
- list
- lba
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
- 238000000034 method Methods 0.000 title claims abstract description 132
- 230000001133 acceleration Effects 0.000 title claims abstract description 30
- 238000013507 mapping Methods 0.000 claims abstract description 174
- 230000008569 process Effects 0.000 claims abstract description 66
- 238000004590 computer program Methods 0.000 claims description 11
- 238000009434 installation Methods 0.000 claims description 8
- 238000005457 optimization Methods 0.000 claims description 8
- 238000012544 monitoring process Methods 0.000 claims 6
- 230000005055 memory storage Effects 0.000 claims 1
- 230000000694 effects Effects 0.000 abstract description 32
- 238000007726 management method Methods 0.000 description 193
- 239000003795 chemical substances by application Substances 0.000 description 93
- 238000010586 diagram Methods 0.000 description 27
- 230000006870 function Effects 0.000 description 18
- 238000012545 processing Methods 0.000 description 16
- 238000012005 ligant binding assay Methods 0.000 description 14
- 230000003993 interaction Effects 0.000 description 10
- 230000008859 change Effects 0.000 description 6
- 238000006243 chemical reaction Methods 0.000 description 4
- 230000007246 mechanism Effects 0.000 description 4
- 230000009286 beneficial effect Effects 0.000 description 3
- 238000004891 communication Methods 0.000 description 3
- 230000008878 coupling Effects 0.000 description 3
- 238000010168 coupling process Methods 0.000 description 3
- 238000005859 coupling reaction Methods 0.000 description 3
- 238000013461 design Methods 0.000 description 3
- 238000011161 development Methods 0.000 description 3
- 238000005516 engineering process Methods 0.000 description 3
- 238000013528 artificial neural network Methods 0.000 description 2
- 230000001413 cellular effect Effects 0.000 description 2
- 238000005314 correlation function Methods 0.000 description 2
- 238000009877 rendering Methods 0.000 description 2
- 238000013519 translation Methods 0.000 description 2
- 239000002699 waste material Substances 0.000 description 2
- 238000013459 approach Methods 0.000 description 1
- 230000006399 behavior Effects 0.000 description 1
- 230000015572 biosynthetic process Effects 0.000 description 1
- 210000000988 bone and bone Anatomy 0.000 description 1
- 239000000872 buffer Substances 0.000 description 1
- 238000004422 calculation algorithm Methods 0.000 description 1
- 238000004364 calculation method Methods 0.000 description 1
- 230000000052 comparative effect Effects 0.000 description 1
- 238000013500 data storage Methods 0.000 description 1
- 230000004927 fusion Effects 0.000 description 1
- 230000004807 localization Effects 0.000 description 1
- 238000005259 measurement Methods 0.000 description 1
- 238000010295 mobile communication Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000001537 neural effect Effects 0.000 description 1
- 230000036316 preload Effects 0.000 description 1
- 238000003825 pressing Methods 0.000 description 1
- 230000004044 response Effects 0.000 description 1
- 230000003068 static effect Effects 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
- 238000003786 synthesis reaction Methods 0.000 description 1
- 230000000007 visual effect Effects 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/445—Program loading or initiating
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/445—Program loading or initiating
- G06F9/44557—Code layout in executable memory
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The application provides an application starting acceleration method, electronic equipment and a storage medium. In the method, the L2P mapping of the file related to the application start is loaded into the host memory before the application is started, so that the file can be read from the UFS device based on the file L2P mapping cached in the host memory in the application start process, the related file L2P mapping is not required to be inquired in the UFS device, the file reading speed is improved, the effect of accelerating the application start is achieved, and excessive pressure is not increased to the host memory.
Description
Technical Field
The application relates to the technical field of intelligent terminals, in particular to an application starting acceleration method, electronic equipment and a storage medium.
Background
Electronic devices such as smartphones and tablet computers have become an important component in life of people, and users can use various application programs (hereinafter referred to as applications) provided in the electronic devices such as smartphones and tablet computers to listen to music, play games, and the like, so as to relieve the pressure brought by modern fast-paced life.
In the process of using electronic devices such as smart phones, tablet computers and the like, a user may open an application program for multiple times. Among them, the speed of starting an application is an important factor for improving the user experience. Therefore, how to increase the application start-up speed is a problem to be solved.
Disclosure of Invention
The application provides an application starting acceleration method, electronic equipment and a storage medium. In the method, before the application is started, the L2P mapping of the file related to the application start is loaded into the host memory, so that the file can be read from the UFS device based on the file L2P mapping cached in the host memory in the application starting process, the related file L2P mapping in the UFS device is not required to be inquired, the file reading speed is improved, and the effect of accelerating the application start is achieved.
In a first aspect, an embodiment of the present application provides an application start acceleration method. The method is applied to the electronic equipment, and the electronic equipment comprises a host and a UFS device, and comprises the following steps: the electronic equipment monitors that the first application is about to be started; before a first application is started, the electronic equipment acquires a first file LBA list, reads a first file L2P mapping corresponding to the first file LBA list in a UFS device, and caches the first file L2P mapping to an HPB memory area of a host memory; the first file LBA list is generated based on the first file list, and files in the first file list are application files which correspond to the first application and influence the performance of the application process; the HPB memory area is also cached with a second file L2P mapping corresponding to a second file LBA list, the second file LBA list is generated based on the second file list, and files in the second file list are system files affecting the performance of the application process; starting a first application; and in the process of starting the first application, reading the relevant file in the UFS device based on the first file L2P mapping and the second file L2P mapping cached in the HPB memory area.
By way of example, the first application may refer to a hotspot application derived based on user usage data statistics. The first file list is a list of application hotspot files corresponding to the first application.
Illustratively, the second file list refers to a system hot file list.
In this way, before the application is started, the L2P mapping of the file related to the application start is loaded into the host memory in a targeted manner, so that the file can be read from the UFS device based on the file L2P mapping cached in the host memory in the application starting process, the related file L2P mapping in the UFS device is not required to be queried, the file reading speed is improved, and the effect of accelerating the application start is achieved. Because the file L2P mapping loaded into the host memory is targeted, excessive pressure is not added to the host memory, and the probability of querying the related file PBA based on the file L2P mapping cached in the host memory is quite large in the application starting process.
According to a first aspect, the method further comprises: in the starting-up stage of the electronic equipment, the electronic equipment acquires a second file list, and generates a second file LBA list according to the second file list; and the electronic equipment reads a second file L2P mapping corresponding to the second file LBA list in the UFS device, and caches the second file L2P mapping in the HPB memory area.
In this way, in the starting-up stage of the electronic equipment, the L2P mapping of the system hot files is preloaded into the host memory, so that each application can query the related files PBA based on the system file L2P mapping cached in the host memory in the starting process, and the reading speed of the related system files is accelerated.
According to the first aspect, or any implementation manner of the first aspect, the method further includes:
the electronic equipment monitors the installation of the first application; after the first application is installed, the electronic equipment acquires a first file list corresponding to the first application; and the electronic equipment generates a first file LBA list according to the first file list.
In this way, in the installation stage of each application (or each hot application), a list of application common file LBAs corresponding to the application is generated, so that the corresponding file L2P mapping is conveniently loaded into the host memory before the application is started.
According to the first aspect, or any implementation manner of the first aspect, the method further includes:
the electronic equipment monitors the updating or compiling optimization of the first application; after updating or compiling and optimizing the first application, the electronic equipment updates a first file list corresponding to the first application; and the electronic equipment updates the first file LBA list according to the updated first file list.
In this way, when the application has updating or compiling optimization, the common file LBA list corresponding to the application is updated, so that the accuracy of loading the corresponding file L2P mapping according to the file LBA list is ensured, and the probability of inquiring the file PBA in the host memory is further improved.
According to the first aspect, or any implementation manner of the first aspect, the method further includes:
the electronic equipment acquires a third file list; the third file list is generated based on the use situation of the first application by updating the first file list; and the electronic equipment updates the first file LBA list according to the third file list.
In this way, the corresponding common file LBA list is updated according to the use situation of the application, so that the accuracy of loading the corresponding file L2P mapping according to the file LBA list is ensured, and the probability of querying the file PBA in the host memory is further improved.
According to the first aspect, or any implementation manner of the first aspect, the method further includes:
the electronic device monitors that the first application is uninstalled; after the first application is uninstalled, the electronic device deletes the first file LBA list; and if the first file L2P mapping corresponding to the first file LBA list is cached in the HPB memory area, the first file L2P mapping in the HPB memory area is cleared.
In this way, under the condition that the application is unloaded, deleting the common file LBA list corresponding to the application, and then clearing the corresponding file L2P mapping in the host memory, so that the waste of the host memory is avoided.
According to the first aspect, or any implementation manner of the first aspect, the method further includes:
the electronic equipment monitors that the second application is about to be started; before the second application is started, the electronic equipment acquires a third file LBA list, reads a third file L2P mapping corresponding to the third file LBA list in the UFS device, and caches the third file L2P mapping to an HPB memory area of the host memory; the third file LBA list is generated based on a fourth file list, and files in the fourth file list are application files which correspond to the second application and influence the performance of the application process; starting a second application; and in the process of starting the second application, reading the relevant file in the UFS device based on the third file L2P mapping and the second file L2P mapping cached in the HPB memory area.
Therefore, for any application (or hot spot application), the L2P mapping of the file related to the application starting can be loaded into the host memory in a targeted manner before the application is started, so that the file can be read from the UFS device based on the file L2P mapping cached in the host memory in the application starting process.
According to the first aspect, or any implementation manner of the first aspect, the method further includes:
after the second application is started, the electronic equipment monitors that the first application is about to be started; the electronic equipment determines that a first file L2P mapping is cached in an HPB memory area; starting a first application; and in the process of starting the first application, reading the relevant file in the UFS device based on the first file L2P mapping and the second file L2P mapping cached in the HPB memory area.
Therefore, the HPB memory area can be simultaneously cached with the application file L2P mapping corresponding to the plurality of applications respectively, even if a foreground application is switched back and forth among the plurality of applications, each application can read related files based on the file L2P mapping cached by the host when being switched and started, so that the speed of switching and starting the applications is improved. Moreover, the application file L2P mapping corresponding to each application is not too much in the host memory, and does not cause pressure to the host memory.
Considering that the more the HPB memory area occupies the host DRAM memory, the more pressure is applied to the host DRAM memory, the upper limit of the application file L2P mapping that is cached in the HPB memory area may be set in this embodiment, for example, the application file L2P mapping corresponding to n (e.g., 10) hot spot applications may be cached in the HPB memory area at the same time. When the application file L2P maps corresponding to the n hot spot applications are cached in the HPB memory area, if the user restarts another hot spot application, the electronic device may first empty the application file L2P map corresponding to a certain hot spot application that is cached in the HPB memory area based on a preset refresh policy, and then write the file L2P map corresponding to another hot spot application into the corresponding HPB memory area. For example, the electronic device can empty the application file L2P map in the HPB memory region that corresponds to one or more hotspot applications with lower file LBA query frequency. Or, the electronic device may determine the HPB memory area that can be covered based on the preset refresh policy, and write the file L2P map corresponding to another hotspot application into the HPB memory area that can be covered, so as to achieve the effect of replacing the file L2P map. For example, the electronic device may use the HPB memory area of the application file L2P map corresponding to the one or more hotspot applications with the lower file LBA query frequency as the overrideable HPB memory area.
According to the first aspect, or any implementation manner of the first aspect, after the electronic device determines that the first file L2P map is cached in the HPB memory area, the method further includes:
if the first file LBA list is updated after caching the first file L2P map, the electronic device re-acquires the first file LBA list, reads a fourth file L2P map corresponding to the first file LBA list in the UFS device, and updates the fourth file L2P map to the first file L2P map cached in the HPB memory area.
In this way, the accuracy of loading the corresponding application file L2P mapping according to the application file LBA list can be ensured, and the probability of inquiring the file PBA in the host memory is further improved.
According to the first aspect, or any implementation manner of the first aspect, the method further includes:
the electronic equipment acquires a fifth file list; the fifth file list is generated based on the updating of the second file list by the use cases of the plurality of applications; generating a fourth file LBA list according to the fifth file list; the electronic equipment reads a fifth file L2P mapping corresponding to the fourth file LBA list in the UFS device, and updates the second file L2P mapping cached in the HPB memory area according to the fifth file L2P mapping.
In this way, the system hot file LBA list is updated according to the use situation of the application, so that the accuracy of loading the corresponding system file L2P mapping according to the file LBA list is ensured, and the probability of querying the related system file PBA in the host memory is further improved.
According to the first aspect, or any implementation manner of the first aspect, the method further includes:
in the starting process of the first application, if the PBA corresponding to the first target file LBA cannot be queried according to the first file L2P mapping and the second file L2P mapping cached in the HPB memory area, the electronic equipment adds the first target file LBA to a first file LBA list and updates the first file LBA list; wherein, the file corresponding to the first target file LBA is a non-system file.
In this way, according to the result of querying the file PBA based on the file L2P mapping cached in the HPB memory area, the application hot file LBA list is updated, so that the accuracy of loading the corresponding application file L2P mapping according to the file LBA list is ensured, and the probability of querying the related application file PBA in the host memory is further improved.
According to the first aspect, or any implementation manner of the first aspect, the method further includes:
In the starting process of any application, if the PBA corresponding to the second target file LBA cannot be queried according to the second file L2P mapping cached in the HPB memory area, the electronic equipment adds the second target file LBA to a second file LBA list and updates the second file LBA list; the file corresponding to the second target file LBA is a system file.
In this way, according to the result of querying the system file PBA based on the file L2P mapping cached in the HPB memory area, the system hot file LBA list is updated, so as to ensure the accuracy of loading the corresponding system file L2P mapping according to the file LBA list, thereby improving the probability of querying the related system file PBA in the host memory.
In a second aspect, embodiments of the present application provide an electronic device. The electronic device includes: one or more processors; a memory; and one or more computer programs, wherein the one or more computer programs are stored on the memory, which when executed by the one or more processors, cause the electronic device to perform the application launch acceleration method of any one of the first aspect and the first aspect.
Any implementation manner of the second aspect and the second aspect corresponds to any implementation manner of the first aspect and the first aspect, respectively. The technical effects corresponding to the second aspect and any implementation manner of the second aspect may be referred to the technical effects corresponding to the first aspect and any implementation manner of the first aspect, which are not described herein.
In a third aspect, embodiments of the present application provide a computer-readable storage medium. The computer readable storage medium comprises a computer program which, when run on an electronic device, causes the electronic device to perform the first aspect and the application launch acceleration method of any one of the first aspects.
Any implementation manner of the third aspect and any implementation manner of the third aspect corresponds to any implementation manner of the first aspect and any implementation manner of the first aspect, respectively. The technical effects corresponding to the third aspect and any implementation manner of the third aspect may be referred to the technical effects corresponding to the first aspect and any implementation manner of the first aspect, which are not described herein.
In a fourth aspect, embodiments of the present application provide a computer program product comprising a computer program which, when executed, causes a computer to perform the application start acceleration method of any one of the first or second aspects.
Any implementation manner of the fourth aspect and any implementation manner of the fourth aspect corresponds to any implementation manner of the first aspect and any implementation manner of the first aspect, respectively. Technical effects corresponding to any implementation manner of the fourth aspect may be referred to the technical effects corresponding to any implementation manner of the first aspect, and are not described herein.
In a fifth aspect, the present application provides a chip comprising processing circuitry, a transceiver pin. Wherein the transceiver pin and the processing circuit communicate with each other via an internal connection path, the processing circuit executing the application start acceleration method as in the first aspect or any one of the first aspects to control the receiving pin to receive signals and to control the transmitting pin to transmit signals.
Any implementation manner of the fifth aspect and any implementation manner of the fifth aspect corresponds to any implementation manner of the first aspect and any implementation manner of the first aspect, respectively. Technical effects corresponding to any implementation manner of the fifth aspect may be referred to the technical effects corresponding to any implementation manner of the first aspect, and are not described herein.
Drawings
FIG. 1a is a schematic diagram of an exemplary application scenario;
FIG. 1b is a schematic diagram of an exemplary application scenario;
FIG. 2 is a schematic diagram of an exemplary HPB mechanism;
fig. 3a is a schematic diagram illustrating the reading of data in a UFS device based on an L2P map of an HPB cache;
fig. 3b is a schematic diagram illustrating the reading of data in a UFS device based on L2P mapping of the SRAM cache of the UFS device;
Fig. 3c is a schematic diagram illustrating the reading of data in a UFS device based on L2P mapping in a flash memory of the UFS device;
figure 3d is a schematic diagram illustrating a delay versus time for reading data in a UFS device based on different ways;
fig. 4 is a schematic diagram of a hardware structure of an exemplary electronic device;
FIG. 5 is a schematic diagram of a software architecture of an exemplary electronic device;
FIG. 6a is a schematic diagram of exemplary module interactions;
FIG. 6b is a diagram illustrating an exemplary cache L2P map in a host memory HPB memory region;
FIG. 6c is a schematic diagram of exemplary module interactions;
FIG. 6d is a diagram illustrating a variation of the cache L2P map in the HPB memory region of the host memory;
FIG. 6e is a schematic diagram of exemplary module interactions;
FIG. 6f is a diagram illustrating a variation of the cache L2P map in the HPB memory region of the host memory;
FIG. 6g is a schematic diagram of exemplary module interactions;
FIG. 7a is a schematic diagram of exemplary module interactions;
FIG. 7b is a diagram illustrating a variation of the cache L2P map in the HPB memory region of the host memory;
FIG. 8a is a schematic diagram of exemplary module interactions;
FIG. 8b is a diagram illustrating a variation of the cache L2P map in the HPB memory region of the host memory.
Detailed Description
The following description of the embodiments of the present application will be made clearly and fully with reference to the accompanying drawings, in which it is evident that the embodiments described are some, but not all, of the embodiments of the present application. All other embodiments, which can be made by one of ordinary skill in the art based on the embodiments herein without making any inventive effort, are intended to be within the scope of the present application.
The term "and/or" is herein merely an association relationship describing an associated object, meaning that there may be three relationships, e.g., a and/or B, may represent: a exists alone, A and B exist together, and B exists alone.
The terms first and second and the like in the description and in the claims of embodiments of the present application are used for distinguishing between different objects and not necessarily for describing a particular sequential order of objects. For example, the first target object and the second target object, etc., are used to distinguish between different target objects, and are not used to describe a particular order of target objects.
In the embodiments of the present application, words such as "exemplary" or "such as" are used to mean serving as examples, illustrations, or descriptions. Any embodiment or design described herein as "exemplary" or "for example" should not be construed as preferred or advantageous over other embodiments or designs. Rather, the use of words such as "exemplary" or "such as" is intended to present related concepts in a concrete fashion.
In the description of the embodiments of the present application, unless otherwise indicated, the meaning of "a plurality" means two or more. For example, the plurality of processing units refers to two or more processing units; the plurality of systems means two or more systems.
Along with the continuous development of science and technology, electronic technology has also been rapidly developed, and electronic products are more and more various, and people enjoy various convenience brought by technological development. People can enjoy comfortable life brought along with technological development through various types of electronic equipment. For example, electronic devices such as smartphones and tablet computers have become an important component in life of people, and users can listen to music, play games, etc. using various application programs (hereinafter referred to as applications) provided in the electronic devices such as smartphones and tablet computers, etc. to relieve the pressure brought by modern fast-paced life.
In the process of using electronic devices such as smart phones, tablet computers and the like, a user may start an application program in the electronic device for multiple times. For an application in an electronic device, its startup may include application cold startup and application hot startup.
When an application is started, the background of the electronic device does not have a process of the application, and at the moment, the system can recreate a new process to be allocated to the application, and the application starting mode is called application cold start (the background does not have the process of the application). When an Application program is cold started, because a new process is newly created by the system and allocated to the Application, an Application class is created and initialized, and then a MainActivity class (comprising a series of measurement, layout and drawing) is created and initialized, and finally displayed on an electronic device interface. For example, when a user opens an application in the electronic device for the first time, or when the user opens an application in the electronic device after clearing the current application cache data, the application is started in a cold start mode. For example, as shown in fig. 1a, in the case that the background of the electronic device has no camera application process, the user clicks an icon of the camera application, and in response to a user operation, the electronic device starts the camera application and displays an interface of the camera application. At this time, the camera application is started in a cold start mode.
When an application has been opened, but the electronic device displays a desktop or other application program interface due to the user pressing a return key, a Home key, etc., this application starting mode is called application hot start (a process of the application already exists in the background) if the user re-opens the application. When the Application program is started up, since the system starts the Application from the existing process, the system does not execute the operation corresponding to the Application class any more, but directly executes the operation corresponding to the MainActivity class. That is, when an Application is hot-started, the system only needs to create and initialize the MainActivity class, and does not need to create and initialize the Application class. For example, as shown in fig. 1b, in case the camera application in the electronic device has been started, i.e. there is a progress of the camera application in the background of the electronic device, the user may re-open the camera application to have the camera application re-run in the foreground of the electronic device. At this time, the camera application is started in a hot start mode.
Whether an application is cold or hot, the speed of application start is an important factor in improving the user experience. Most users will want to launch applications as quickly as possible. As applications provide more and more functions, more and more resources need to be loaded when starting the applications, so that the application starting speed is slower and slower. Therefore, how to increase the starting speed of the application is a problem to be solved.
In the starting process of an application program, usually after the application program starts to start, related files are read, then an application process is loaded based on the related files, and then the application process is waited for interface layout and display. The files affecting the performance of the application process (specifically, the IO block files) can be divided into two types, one type is a general system file, each application program can access the files, the other type is a file related to the application program, and only the application program a needs to access the files related to the application program a. It will be appreciated that either the general purpose system files or the files used by an application are stored on the storage device of the electronic device.
UFS (Univeral Flash Storage, universal flash memory) is becoming a main storage standard for electronic devices such as smartphones, as a storage technology for nonvolatile memory (Non Volatile Memory, NVM), replacing MMC (Multi Media Card) and eMMC (embedded Multi Media Card ). The UFS can bring higher read-write speed and more reliable stability to electronic equipment such as smart phones. In this embodiment of the present application, a storage device in an electronic device for storing file data is a UFS device (or UFS apparatus).
The HPB (Host Performance Booster ) management mechanism, which is a feature of UFS, is introduced in the UFS3.1 protocol, and is to utilize the memory (e.g. DRAM (Dynamic Random Access Memory, dynamic random access memory)) of the Host (Host) end of an electronic device (e.g. a smart phone, a tablet computer, etc.) to cache the L2P (Logical address to Physical address ) mapping table of the UFS device master (UFSDevice Controller) to improve the read performance of the UFS device, especially the random read performance of the UFS device after long-time use.
For a file, the file system allocates a number of Logical blocks (Logical blocks) to store the file data. The file data is ultimately stored on the storage device, i.e., the logical blocks corresponding to the file are written to the flash physical blocks of the storage device.
For UFS devices, since data of one LBA (Logical Block Adress, logical block address) may be stored in any physical location of the flash memory, the UFS device needs to maintain a mapping table of the logical block address to the PBA (Physical Block Adress, logical block address), i.e., an L2P mapping table (may also be simply referred to as an L2P table). The L2P mapping table is a large array: the index is LBA, and the content is PBA of the LBA in flash memory. When the storage device reads data according to a certain LBA, firstly searching the L2P mapping table to obtain the PBA corresponding to the LBA, and then reading the storage data corresponding to the LBA according to the PBA.
As shown in fig. 2, for UFS devices, generally, no DRAM is provided, and only a small-capacity SRAM (Static Random-Access Memory) is provided. Thus, the L2P mapping table is mostly stored in a flash memory device (e.g., NAND or NOR based flash memory), and UFS device firmware may also load part of the L2P mapping relationship into the SRAM of the UFS device as needed. The L2P mapping table of the UFS device is cached at multiple levels.
With continued reference to fig. 2, based on the HPB characteristics, an L2P (Logical address to Physical address ) mapping table of the UFS device may be cached in a memory (e.g., DRAM) at a host side of an electronic device (e.g., a smart phone, a tablet computer, etc.) to improve the read performance of the UFS device.
For the electronic device supporting the HPB characteristic, the host may read related data in the UFS device based on the L2P mapping table of the memory cache of the host, and when the L2P mapping table of the memory cache of the host fails to query the PBA corresponding to the LBA, continue reading related data in the UFS device based on the L2P mapping table of the SRAM cache of the UFS device, and when the L2P mapping table of the SRAM cache of the UFS device fails to query the PBA corresponding to the LBA, continue reading related data in the UFS device based on the L2P mapping table stored in the flash memory device of the UFS device.
For an electronic device supporting HPB characteristics, the host may read related data in the UFS device based on the L2P mapping table of the SRAM cache of the UFS device, and continue reading related data in the UFS device based on the L2P mapping table stored in the flash memory device of the UFS device when the PBA corresponding to the LBA is not queried by the L2P mapping table of the SRAM cache of the UFS device.
As shown in fig. 3a, when the host reads file data according to the LBA of the file, if a PBA corresponding to the LBA is queried in the L2P mapping table cached in the DRAM of the host, the PBA may be sent to the address conversion module in the UFS device storage system to perform address conversion, and then the corresponding file data may be read in the flash memory device according to the converted address.
As shown in fig. 3b, when the host reads file data according to the LBA of the file, if a PBA corresponding to the LBA is queried in the L2P mapping table cached in the SRAM in the UFS device, the PBA may be sent to the address conversion module in the UFS device storage system to perform address conversion, and then the corresponding file data may be read in the flash memory device according to the converted address.
As shown in fig. 3c, when the host reads file data according to the LBA of the file, if no PBA corresponding to the LBA is queried in the L2P mapping table cached in the SRAM in the UFS device, then query of the PBA corresponding to the LBA in the L2P mapping table stored in the flash memory device in the UFS device is continued, and after query of the PBA corresponding to the LBA, the PBA is sent to the address translation module in the UFS device storage system to perform address translation, and then the corresponding file data can be read in the flash memory device according to the translated address.
For the LBA query hit patterns shown in fig. 3a, 3b, and 3c, fig. 3d shows a comparative schematic diagram of the corresponding file read latency. As shown in fig. 3d, the delay of the host when reading the relevant data in the UFS device based on the L2P mapping table of the host memory cache (i.e., the LBA queried by the host hits in the L2P mapping table of the host memory cache) is about the same as the delay of the host when reading the relevant data in the UFS device based on the L2P mapping table of the SRAM cache of the UFS device (i.e., the LBA queried by the host hits in the L2P mapping table of the SRAM cache of the UFS device), and the delay duration is shorter, i.e., the user perceiving delay is shorter, and the delay is mainly generated by reading the data in the flash memory device of the UFS device. The host does not query PBA based on the L2P mapping table cached by the SRAM of the UFS device (i.e., the LBA queried by the host is not hit in the L2P mapping table cached by the SRAM of the UFS device), and then, when the relevant data is read in the UFS device based on the L2P mapping table stored in the flash memory device of the UFS device (i.e., the LBA queried by the host is hit in the L2P mapping table stored in the flash memory device of the UFS device), the delay increases, and the user perceives the delay is longer, and the delay is mainly due to querying the L2P mapping table in the flash memory device of the UFS device and reading the data in the flash memory device of the UFS device.
Regarding the HPB feature, there are few device manufacturers currently using the HPB feature because the HPB feature consumes a larger memory (e.g., DRAM memory) on the host side. For example, if an UFS device with a capacity of 512G buffers an L2P mapping table corresponding to half of its physical addresses to the host, it needs to occupy the memory of the host 512M. Also in this case, the theoretical probability that the host queries the PBA corresponding to the LBA based on its L2P mapping table of the memory cache is only 50%. If the host does not query the PBA corresponding to the LBA based on the L2P mapping table cached in the memory of the host, the host also needs to re-query the PBA corresponding to the LBA based on the L2P mapping table in the SRAM or flash memory device at the UFS device. In comparison with the case where the host directly re-queries the PBA corresponding to the LBA based on the L2P mapping table in the UFS device-side SRAM or the flash memory device, this situation also increases the latency caused by "the host queries but misses based on the L2P mapping table in its memory cache". As the capacity of UFS devices increases, the HPB feature consumes more memory on the host side, which can undoubtedly increase the memory pressure on the host side. Once the L2P mapping table cached in the memory of the host fails to hit the LBA queried by the host, the read performance of the UFS device is further degraded.
The embodiment of the application provides an application starting acceleration method. In the method, an HBP management mechanism facing to user experience is adopted, so that the speed of reading related files by the electronic equipment when the application is started is improved, and the beneficial effect of accelerating the application starting is achieved. The HBP management mechanism for user experience adopted in the embodiment of the present application not only occupies less host side memory (such as DRAM memory), but also reduces the probability that the relevant file LBA cannot be queried in the L2P mapping table cached in the host side memory.
Fig. 4 is a schematic structural diagram of the electronic device 100. Alternatively, the electronic device 100 may be a terminal, which may also be referred to as a terminal device, and the terminal may be a device with a camera, such as a cellular phone (cellular phone) or a tablet computer (pad), which is not limited in this application. It should be noted that the schematic structural diagram of the electronic device 100 may be applied to the smart phone in fig. 1a to 1 b. It should be understood that the electronic device 100 shown in fig. 4 is only one example of an electronic device, and that the electronic device 100 may have more or fewer components than shown in the figures, may combine two or more components, or may have different component configurations. The various components shown in fig. 4 may be implemented in hardware, software, or a combination of hardware and software, including one or more signal processing and/or application specific integrated circuits.
The electronic device 100 may include: processor 110, external memory interface 120, internal memory 121, universal serial bus (universal serial bus, USB) interface 130, charge management module 140, power management module 141, battery 142, antenna 1, antenna 2, mobile communication module 150, wireless communication module 160, audio module 170, speaker 170A, receiver 170B, microphone 170C, headset interface 170D, sensor module 180, keys 190, motor 191, indicator 192, camera 193, display 194, and subscriber identity module (subscriber identification module, SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor, a gyroscope sensor, an acceleration sensor, a temperature sensor, a motion sensor, a barometric sensor, a magnetic sensor, a distance sensor, a proximity sensor, a fingerprint sensor, a touch sensor, an ambient light sensor, a bone conduction sensor, etc.
The processor 110 may include one or more processing units, such as: the processor 110 may include an application processor (application processor, AP), a modem processor, a graphics processor (graphics processing unit, GPU), an image signal processor (image signal processor, ISP), a controller, a memory, a video codec, a digital signal processor (digital signal processor, DSP), a baseband processor, and/or a neural network processor (neural-network processing unit, NPU), etc. Wherein the different processing units may be separate devices or may be integrated in one or more processors.
The controller may be a neural hub and a command center of the electronic device 100, among others. The controller can generate operation control signals according to the instruction operation codes and the time sequence signals to finish the control of instruction fetching and instruction execution.
A memory may also be provided in the processor 110 for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory.
The electronic device 100 implements display functions through a GPU, a display screen 194, an application processor, and the like. The GPU is a microprocessor for image processing, and is connected to the display 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. Processor 110 may include one or more GPUs that execute program instructions to generate or change display information.
The display screen 194 is used to display images, videos, and the like. The display 194 includes a display panel. In some embodiments, the electronic device 100 may include 1 or N display screens 194, N being a positive integer greater than 1.
The external memory interface 120 may be used to connect an external memory card, such as a UFS memory card, to enable expansion of the memory capabilities of the electronic device 100. An external memory card (UFS memory card) communicates with the processor 110 through an external memory interface 120 to implement a data storage function. In this embodiment, the UFS memory card supports the HPB feature.
The internal memory 121 may be used to store computer executable program code including instructions. The processor 110 executes various functional applications of the electronic device 100 and data processing by executing instructions stored in the internal memory 121, for example, to cause the electronic device 100 to implement an application start acceleration method in the embodiments of the present application. The internal memory 121 may include a storage program area and a storage data area. The storage program area may store an application program (such as a sound playing function, an image playing function, etc.) required for at least one function of the operating system, etc. The storage data area may store data created during use of the electronic device 100 (e.g., audio data, phonebook, etc.), and so on. In addition, the internal memory 121 may include a high-speed random access memory, and may further include a nonvolatile memory such as at least one magnetic disk storage device, a flash memory device, a universal flash memory (universal flash storage, UFS), and the like.
The software system of the electronic device 100 may employ a layered architecture, an event driven architecture, a microkernel architecture, a microservice architecture, or a cloud architecture. In this embodiment, taking an Android system with a layered architecture as an example, a software structure of the electronic device 100 is illustrated.
Fig. 5 is a software configuration block diagram of the electronic device 100 of the embodiment of the present application.
The layered architecture of the electronic device 100 divides the software into several layers, each with a distinct role and division of labor. The layers communicate with each other through a software interface. In some embodiments, the Android system is divided into four layers, from top to bottom, an application layer, an application framework layer, an Zhuoyun row (Android run) and system libraries, and a kernel layer, respectively.
The application layer may include a series of application packages.
As shown in fig. 5, the application packages may include applications for conversations, calendars, maps, navigation, music, video, short messages, cameras, gallery, and the like.
The application framework layer provides an application programming interface (application programming interface, API) and programming framework for application programs of the application layer. The application framework layer includes a number of predefined functions.
As shown in FIG. 5, the application framework layer may include an HPB management Agent (HPB management Agent), a package manager (or package management service (Package Manager Service, PMS)), an activity manager (or activity management service (Activity Manager Service, AMS)), a window manager (or window management service (Window Manager Service, WMS)), a view system, a resource manager, a notification manager, and the like.
The HPB management Agent refers to a proxy service of the kernel layer HPB management module, and may call the HPB management module to perform an operation related to the HPB.
In the Android system, AMS, PMS and WMS are three important system services that are responsible for managing the lifecycle of applications, handling the installation and uninstallation of applications, and managing the window views of applications.
The AMS serves as an activity manager that is primarily responsible for managing and tracking the activity tasks and lifecycle of all applications. When an application is opened, the AMS initiates the application's process and allocates processor resources and memory to the application. When an application is no longer in the foreground or background, or when system memory is insufficient, the AMS may terminate or kill the application's process.
The PMS serves as a package manager mainly responsible for installing, managing and uninstalling applications on Android devices. When a new application is installed, the PMS will identify all components of the application (e.g., activity, service and Broadcast Receiver, etc.) and assign corresponding rights to those components. Meanwhile, the PMS also monitors the state of the installed application program, and ensures the integrity and safety of the application program.
WMS serves as a window manager that is primarily responsible for managing window views on Android devices and controlling the interfaces and proper display and input of applications. WMSs are responsible for managing the position, size, and layout of application windows, taking care of the switching between multitasking and applications, thus ensuring a stable, smooth, and consistent user interface.
The power management module, which may be understood as a functional module located in an application framework layer and corresponding to the power management system, may be used to detect whether the electronic device enters a shutdown procedure or not.
The view system includes visual controls, such as controls to display text, controls to display pictures, and the like. The view system may be used to build applications. The display interface may be composed of one or more views. For example, a display interface including a text message notification icon may include a view displaying text and a view displaying a picture.
The resource manager provides various resources for the application program, such as localization strings, icons, pictures, layout files, video files, and the like.
The notification manager allows the application to display notification information in a status bar, can be used to communicate notification type messages, can automatically disappear after a short dwell, and does not require user interaction. Such as notification information is used to inform that the download is complete, a message alert, etc. The notification information may also be a notification in the form of a chart or scroll bar text appearing in the system top status bar, such as a notification of a background running application, or a notification appearing on the screen in the form of a dialog window. For example, the notification information may be a text message presented in a status bar, a presentation sound emitted, vibration of an electronic device, flashing of an indicator light, or the like.
Android run time includes a core library and virtual machines. Android run is responsible for scheduling and management of the Android system.
The core library consists of two parts: one part is a function which needs to be called by java language, and the other part is a core library of android.
The application layer and the application framework layer run in a virtual machine. The virtual machine executes java files of the application program layer and the application program framework layer as binary files. The virtual machine is used for executing the functions of object life cycle management, stack management, thread management, security and exception management, garbage collection and the like.
The system library may include a plurality of functional modules. For example: surface manager (surface manager), media Libraries (Media Libraries), three-dimensional graphics processing Libraries (e.g., openGL ES), 2D graphics engines (e.g., SGL), etc.
The surface manager is used to manage the display subsystem and provides a fusion of 2D and 3D layers for multiple applications.
Media libraries support a variety of commonly used audio, video format playback and recording, still image files, and the like. The media library may support a variety of audio video encoding formats, such as: MPEG4, h.264, MP3, AAC, AMR, JPG, PNG, etc.
The three-dimensional graphic processing library is used for realizing three-dimensional graphic drawing, image rendering, synthesis, layer processing and the like.
The 2D graphics engine is a drawing engine for 2D drawing.
The kernel layer is a layer between hardware and software. As shown in fig. 5, the kernel layer at least includes an HPB management module, a UFS host driver module, a file system module, a power management module, a display driver, a sensor driver, and the like. The hardware at least comprises a processor, a display screen, a sensor, a UFS device and the like.
In this embodiment, the HPB management module may be configured to implement File list (File list) management, LBA list (list) management, and HPB memory region (region) management. The HPB memory area may be understood as a memory area (e.g. DRAM area) of the UFP device L2P map that is cached by the host based on the HPB protocol.
In this embodiment, the UFS host driver module may be configured to refresh the HPB memory area.
The file system module, which may be understood as a functional module located in a kernel layer and corresponding to a file system, may be used to implement management of files, for example, allocate a logical block to each file.
It will be appreciated that the layers and components contained in the layers in the software structure shown in fig. 5 do not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, electronic device 100 may include more or fewer layers than shown, and more or fewer components may be included in each layer, as the present application is not limited.
It may be understood that, in order to implement the application start acceleration method in the embodiments of the present application, the electronic device includes corresponding hardware and/or software modules that perform each function. The steps of an algorithm for each example described in connection with the embodiments disclosed herein may be embodied in hardware or a combination of hardware and computer software. Whether a function is implemented as hardware or computer software driven hardware depends upon the particular application and design constraints imposed on the solution. Those skilled in the art may implement the described functionality using different approaches for each particular application in conjunction with the embodiments, but such implementation is not to be considered as outside the scope of this application.
The application start acceleration method provided by the embodiment of the application can be applied to the start flow of any application program of electronic equipment (such as a smart phone and the like). Optionally, a white list may also be set in the electronic device, so that the application start acceleration method provided in the embodiment of the present application may be applied to a start flow of any application program in the white list. Illustratively, the application in the whitelist is a hotspot application.
Considering that files affecting the performance of an application process can be divided into two types, one type is a general-purpose system file, each application program can access such files, and the other type is a file related to the application program itself, and the file related to the application program A itself only needs to be accessed by the application program A. Accordingly, in the embodiment of the application, the HPB management module manages two types of file LBA lists (lists), one is a system hot-spot file LBA list, which is generated according to the system hot-spot file list in the application starting process, and the other is an application file LBA list (or called application hot-spot file LBA list), which is generated according to the application file list (or called application hot-spot file list) used in the application starting process. Wherein, different application programs correspond to different application file LBA lists.
Therefore, before a certain application is started, the HPB memory area in the host memory is pre-refreshed according to the application file LBA list corresponding to the application, namely, the file L2P mapping corresponding to the application file LBA list is refreshed to the HPB memory area, so that the delay of reading related files in the starting and subsequent use processes of the application can be reduced, and the problem of IO page missing is avoided as much as possible.
The following explains the application start acceleration method provided in the embodiment of the present application by taking several scenarios as examples.
Scene one
In this scenario, taking a hotspot application in the electronic device as an example, the user uses the hotspot application alone, relevant processing flows under the situations of application installation, application update, application compilation optimization, application startup, and electronic device startup and shutdown are explained.
Fig. 6a, 6c, 6e and 6g are schematic diagrams showing interactions of the modules. Referring to fig. 6a, a flow of an application start acceleration method provided in an embodiment of the present application specifically includes:
s201, in the initialization stage of the electronic device, the HPB management module applies for the HPB memory area in the host DRAM.
The HPB memory area is used for caching L2P mapping of files related to application starting or running.
It is understood that the electronic device initialization phase may be a power-on phase of the electronic device.
Optionally, after the HPB management module applies for the HPB memory area in the Host DRAM, if there is no system hot file LBA list currently, the UFS Host driver module may be instructed to load a portion of the L2P of the UFS device and map the portion to the HPB memory area.
S202, the HPB management Agent acquires a system hot spot file list.
The system hot file may refer to a system file with higher access frequency, which does not change with application switching.
The system hot spot file list refers to a file list composed of general system hot spot files. Exemplary system hotspot file lists include, but are not limited to, system file names, number of start pages, number of pages, etc.
The file pages used in the starting process of the application program of the specific version are basically the same, so that the file list used in the starting process of the application program can be monitored, and further a system hot spot file list in the starting process of the application program and an application common file list corresponding to each application are obtained. For a method for identifying hot files in a system and a method for identifying a list of commonly used files, reference may be made to the prior art, and details are not repeated herein.
S203, the HPB management Agent calls the HPB management module to generate a system hot spot file LBA list.
The system hot file LBA list refers to a list of LBAs consisting of LBAs of the system hot file. Exemplary system hot spot file LBA lists include, but are not limited to, system file names, logical blocks, LBAs, and the like. One system file may correspond to one or more logical blocks, one LBA for each logical block.
Illustratively, the HPB management Agent invokes the related functions provided by the HPB management module to generate a system hot file LBA list corresponding to the system hot file list via the HPB management module.
S204, the HPB management module generates a system hot spot file LBA list according to the system hot spot file list, and returns a generation result to the HPB management Agent.
For each system file in the system hot spot file list, the HPB management module queries the logical block allocated to the system file by the file system to obtain an LBA list corresponding to each system file, and then may obtain a system hot spot file LBA list corresponding to the system hot spot file list.
For example, if the system hot file list includes N1 system files, the system hot file LBA list corresponding to the system hot file list includes LBAs corresponding to the N1 system files, where one system file corresponds to one or more LBAs.
The HPB management module returns a generation result to the HPB management Agent, and the generation result is used for indicating whether the generation is performed. After the HPB management module generates the system hot file LBA list, a generation result indicating that the system hot file LBA list has been generated is returned to the HPB management Agent.
S205, the HPB management Agent calls the HPB management module to refresh the HPB memory area.
Illustratively, the HPB management Agent invokes the correlation function provided by the HPB management module to refresh the file L2P map in the HPB memory region via the HPB management module. Specifically, in this step, the HPB management Agent invokes the HPB management module to write the L2P map corresponding to the system hot file LBA list into the HPB memory area in the main memory.
S206, the HPB management module sends an HPB memory area refreshing instruction to the UFS Host driving module.
In this step, the HPB memory area refresh command is configured to instruct the UFS Host driver module to write the L2P map corresponding to the system hot file LBA list into the HPB memory area in the Host memory.
S207, the UFS Host driving module writes the file L2P mapping corresponding to the system hot file LBA list into the HPB memory area in the main memory according to the HPB memory area refreshing instruction, and returns a refreshing result to the HPB management module, which returns the refreshing result to the HPB management Agent.
For each LBA in the LBA list of the system hot file, the UFS Host driving module inquires the corresponding L2P mapping to the UFS device respectively. For example, if the system hot file LBAlist includes M1 LBAs, the file L2P map corresponding to the system hot file LBA list includes L2P maps corresponding to the M1 LBAs respectively.
S208, the packet manager monitors the installation of the application 1 and sends indication information 1 to the HPB management Agent.
The packet manager may perceive whether an application is installed at a first time through its listening interface. When the packet manager monitors that a certain application is installed, corresponding indication information is sent to the HPB management Agent so as to inform the HPB management Agent that the application is currently installed.
By way of example, the indication information may include, but is not limited to, an application package name, and an indication type. In the instruction information 1, the application package name is the package name of the application 1, and the instruction type is the application installation instruction.
S209, the HPB management Agent acquires a file list1 corresponding to the application 1 according to the instruction information 1.
The file list corresponding to the application refers to a file list composed of application common files and application hot files (non-system files) in the starting process and/or the running process of the application. Illustratively, the file list corresponding to a certain application includes, but is not limited to, a file name, a start page number, a page number, and the like.
Illustratively, when the application 1 is installed, the HPB management Agent may traverse according to the directory of the application installation package, to obtain a file list corresponding to the application 1.
The HPB management Agent determines that the application 1 is being installed according to the indication information 1, needs to acquire a file list1 corresponding to the application 1, and calls the HPB management module to generate a file LBA list1 corresponding to the application 1.
S210, the HPB management Agent calls the HPB management module to generate a file LBA list1 corresponding to the application 1.
The file LBA list corresponding to the application refers to an LBA list composed of LBAs of application common files in the application startup process and/or the running process. Exemplary file LBA lists corresponding to applications include, but are not limited to, application file names, logical blocks, LBAs, and the like. An application file may correspond to one or more logical blocks, one LBA for each logical block.
Illustratively, the HPB management Agent invokes the related functions provided by the HPB management module to generate the file LBA list1 corresponding to application 1 via the HPB management module.
S211, the HPB management module generates a file LBA list1 corresponding to the application 1 and returns a generation result to the HPB management Agent.
For example, the HPB management module queries, for each application file in the file list1 corresponding to the application 1, the logical block allocated to the application file by the file system to obtain the LBA list corresponding to each application file, and then may obtain the file LBA list1 corresponding to the file list1, that is, the file LBA list1 corresponding to the application 1.
For example, if the file list1 corresponding to the application 1 includes N2 application files, the file LBA list1 corresponding to the application 1 includes LBAs corresponding to the N2 application files, respectively, and one application file corresponds to one or more LBAs.
The HPB management module returns a generation result to the HPB management Agent, and the generation result is used for indicating whether the generation is performed. After the HPB management module generates the file LBA list1 corresponding to the application 1, a generation result indicating that the file LBA list1 corresponding to the application 1 has been generated is returned to the HPB management Agent.
S212, the activity manager monitors that the application 1 is started, and sends indication information 2 to the HPB management Agent.
The activity manager may perceive, via its listening interface, at a first time whether an application is about to be started. When the activity manager monitors that an application is about to be started, corresponding indication information is sent to the HPB management Agent so as to inform the HPB management Agent that the application is currently installed. The application start may refer to application cold start or application hot start (e.g., background operation is switched to foreground operation).
By way of example, the indication information may include, but is not limited to, an application package name, and an indication type. In the indication information 2, the application package name is the package name of the application 1, and the indication type is an application start indication.
S213, the HPB management Agent determines whether or not a file LBA list corresponding to the application 1 exists based on the instruction information 2, and if yes, S214 is executed.
When knowing that the application 1 is about to be started, the HPB management Agent determines whether a file LBA list corresponding to the application 1 exists, and if not, the starting process of the application 1 cannot be accelerated according to the method provided by the embodiment, but the starting process of the application 1 is realized according to the prior art. In this case, the HPB management Agent may retrieve the file list1 corresponding to the application 1 and call the HPB management module to generate the file LBA list1 corresponding to the application 1 (i.e., perform S209 to S211). Thus, when the application 1 is started next time, the starting process of the application 1 can be accelerated according to the method provided by the embodiment.
S214, the HPB management Agent judges whether the file L2P mapping corresponding to the application 1 is loaded into the HPB memory area, if not, S215 is executed.
If the file L2P map corresponding to application 1 is not loaded into the HPB memory region, the HPB management Agent invokes the HPB management module to refresh the HPB memory region to load the file L2P map corresponding to application 1 into the HPB memory region, otherwise, the HPB memory region is not refreshed (at this point the flow may jump to S218).
S215, the HPB management Agent calls the HPB management module to refresh the HPB memory area.
Illustratively, the HPB management Agent invokes the correlation function provided by the HPB management module to refresh the file L2P map in the HPB memory region via the HPB management module. Specifically, in this step, the HPB management Agent calls the HPB management module to write the L2P map corresponding to the application 1 file LBA list1 into the HPB memory area in the host memory.
S216, the HPB management module sends an HPB memory area refreshing instruction to the UFS Host driving module.
In this step, the HPB memory area refresh command is configured to instruct the UFS Host driver module to write the file L2P map corresponding to the application 1 file LBA list1 into the HPB memory area in the Host memory.
S217, the UFS Host driving module writes the file L2P mapping corresponding to the file LBA list1 into the HPB memory area in the main memory according to the HPB memory area refreshing instruction, and returns a refreshing result to the HPB management module, and the HPB management module returns the refreshing result to the HPB management Agent.
For each LBA in the LBA list1 corresponding to the application 1, the UFS Host driving module queries the corresponding file L2P mapping from the UFS device, and writes the file L2P mapping into the HPB memory area as the file L2P mapping corresponding to the application 1. For example, if M2 LBAs are included in the file LBA list1 corresponding to the application 1, the L2P mapping corresponding to the application 1 (i.e., corresponding to the file LBA list 1) includes L2P mappings corresponding to the M2 LBAs, respectively.
S218, starting the application 1, wherein during the starting process of the application 1, the system reads the relevant files in the UFS device based on the L2P mapping of the files cached in the HPB memory area.
Illustratively, as shown in fig. 6b, in the HPB memory area of the host DRAM, a system hot spot file L2P map cache is included, and a file L2P map cache corresponding to the application 1 is included. Therefore, when the application 1 is started, the system can read the related system hot spot file in the UFS device based on the system hot spot file L2P mapping cached in the HPB memory area, and read the commonly used application file corresponding to the application 1 in the UFS device based on the file L2P mapping cached in the HPB memory area, so that the related file L2P mapping does not need to be read from the UFS device, and the file reading speed is improved, and the effect of accelerating the starting or running of the application 1 is further achieved.
In an alternative embodiment, the electronic device may also preload the service file corresponding to application 1 before application 1 is started. When the electronic device performs file preloading, the relevant file can be read in the UFS device based on the L2P mapping of the relevant file cached in the HPB memory area, so that the file reading speed is increased, and the effect of accelerating file preloading is achieved.
With continued reference to fig. 6c, the flow of the application start acceleration method provided in the embodiment of the present application specifically further includes:
s301, the packet manager monitors update or compiling optimization of the application 1 and sends indication information 3 to the HBP management Agent.
By way of example, the indication information may include, but is not limited to, an application package name, and an indication type. In the indication information 3, the application package name is the package name of the application 1, and the indication type is the application update or the application compilation optimization.
S302, the HBP management Agent updates a file list1 corresponding to the application 1.
After the update or compilation optimization of application 1, the HBP management Agent re-acquires the file list corresponding to application 1 as file list1.
S303, the HBP management Agent calls the HBP management module to update the file LBA list1 corresponding to the application 1.
Illustratively, the HPB management Agent invokes the associated function provided by the HPB management module to update the file LBA list corresponding to the application via the HPB management module.
S304, the HBP management module updates the file LBA list1 corresponding to the application 1 according to the updated file list1, and returns an update result to the HBP management Agent.
And the HBP management module regenerates the file LBA list corresponding to the application 1 as the file LBA list1 according to the updated file list1, and returns an updating result for indicating that the updating is completed to the HBP management Agent.
S305, the activity manager monitors that the application 1 is started, and sends indication information 4 to the HBP management Agent.
By way of example, the indication information may include, but is not limited to, an application package name, and an indication type. In the instruction information 4, the application package name is the package name of the application 1, and the instruction type is the application start.
S306, the HPB management Agent determines whether or not there is a file LBA list corresponding to the application 1 based on the instruction information 4, and if yes, S307 is executed.
S307, the HPB management Agent judges whether the file L2P mapping corresponding to the application 1 is loaded into the HPB memory area, if so, S308 is executed.
S308, the HPB management Agent determines whether the file LBA list1 corresponding to the application 1 is updated, and if so, S309 is executed.
If the file LBA list1 corresponding to the application 1 is not updated after the file L2P corresponding to the file LBA list1 is mapped to the HPB memory area, the HPB management Agent does not need to call the HPB management module to refresh the HPB memory area. If the file LBA list1 corresponding to the application 1 is updated after the file L2P corresponding to the file LBA list1 is mapped to the HPB memory area, the HPB management Agent needs to call the HPB management module to refresh the HPB memory area, so as to ensure the accuracy of the L2P mapping of the file corresponding to the application 1 cached in the HPB memory area, and improve the probability that the relevant file LBA can be queried in the HPB memory area.
S309, the HPB management Agent calls the HPB management module to refresh the HPB memory area.
S310, the HPB management module sends an HPB memory area refreshing instruction to the UFS Host driving module.
In this step, the HPB memory area refresh instruction may be configured to instruct the UFS Host driver module to update the file L2P mapping corresponding to the application 1 in the HPB memory area. For example, the HPB memory region refresh command may be used to instruct the UFS Host driver module to empty the file L2P map corresponding to the application 1 in the HPB memory region, and then rewrite the file L2P map corresponding to the application 1 file LBA list1 (updated) into the HPB memory region in the Host memory. For another example, the HPB memory region refresh command may be used to instruct the UFS Host driver module to replace or overlay the file L2P map corresponding to the file LBA list before the update of application 1 in the HPB memory region with the file L2P map corresponding to the file LBA list after the update of application 1.
S311, the UFS Host driving module updates the file L2P mapping corresponding to the application 1 cached in the HPB memory area according to the HPB memory area refreshing instruction, and returns a memory refreshing result to the HPB management module, and the HPB management module returns the memory refreshing result to the HPB management Agent.
For example, the UFS Host driver module clears the file L2P map corresponding to the application 1 in the HPB memory area according to the HPB memory area refresh command, reads the file L2P map corresponding to the application 1 file LBA list1 (updated) from the UFS device, and rewrites the file L2P map as the file L2P map corresponding to the application 1 into the HPB memory area in the Host memory.
As shown in fig. 6d, before the UFS Host driver module refreshes the HPB memory area according to the HPB memory area refresh command, the HPB memory area includes a system hot spot file L2P map cache and a file L2P map cache corresponding to the file LBA list before the update of the application 1; when the UFS Host driver module refreshes the HPB memory area according to the HPB memory area refreshing instruction, the file L2P map cache corresponding to the file LBA list before the update of the application 1 is emptied, and then the file L2P map corresponding to the file LBA list after the update of the application 1 is written into the HPB memory area (or the file L2P map corresponding to the file LBA list after the update of the application 1 is written into the HPB memory area, and then the file L2P map cache corresponding to the file LBA list before the update of the application 1 is emptied). That is, after the UFS Host driver module refreshes the HPB memory area according to the HPB memory area refresh command, the HPB memory area includes a system hot file L2P map cache and a file L2P map cache corresponding to the file LBA list updated by the application 1.
Also exemplary, the UFS Host driver module uses the file L2P map corresponding to the file LBA list updated by application 1 to replace or cover the file L2P map corresponding to the file LBA list before application 1 in the HPB memory area according to the HPB memory area refresh command.
S312, application 1 is started, and during the starting process of application 1, the system reads the relevant files in the UFS device based on the L2P mapping of the files cached in the HPB memory area.
The present process is not explained in detail, and reference is made to the foregoing, and will not be repeated here.
In this way, when the application has update or compilation optimization, the file LBA list corresponding to the application is updated, and the file L2P mapping corresponding to the application in the HPB memory area is refreshed based on the updated file LBA list, so that the accuracy of the file L2P mapping corresponding to the application 1 cached in the HPB memory area is ensured, and the probability that the file LBA related to the starting or running of the application 1 can be queried in the HPB memory area is improved.
With continued reference to fig. 6e, the flow of the application start acceleration method provided in the embodiment of the present application specifically further includes:
s401, the packet manager monitors that the application 1 is unloaded, and sends indication information 5 to the HPB management Agent.
By way of example, the indication information may include, but is not limited to, an application package name, and an indication type. In the instruction information 5, the application package name is the package name of the application 1, and the instruction type is application uninstallation.
S402, the HPB management Agent deletes the file list1 corresponding to the application 1 according to the instruction information 5.
S403, the HPB management Agent calls the HPB management module to delete the file LBA list1 corresponding to the application 1.
And the HPB management Agent judges whether the file LBA list corresponding to the application 1 exists or not, and if so, the HPB management module is called to delete the file LBA list corresponding to the application 1.
Illustratively, the HPB management Agent invokes the associated function provided by the HPB management module to delete the file LBA list corresponding to the application via the HPB management module.
S404, the HPB management module deletes the file LBA list1 corresponding to the application 1 and sends the deleting result to the HPB management Agent.
S405, the HPB management Agent calls the HPB management module to refresh the HPB memory area.
S406, the HPB management module sends an HPB memory area refreshing instruction to the UFS Host driving module.
S407, the UFS Host driving module empties the L2P mapping of the file corresponding to the application 1 cached in the HPB memory area according to the refreshing instruction, and returns a memory refreshing result to the HPB management module, and the HPB management module returns the memory refreshing result to the HPB management Agent.
As shown in fig. 6f, before the UFS Host driver module refreshes the HPB memory area according to the HPB memory area refresh command (i.e., before application 1 unloads), the HPB memory area includes a system hot file L2P map cache and a file L2P map cache corresponding to the file LBA list of application 1; after the application 1 is unloaded, when the UFS Host driving module refreshes the HPB memory area according to the HPB memory area refreshing instruction, the file L2P mapping cache corresponding to the file LBA list of the application 1 in the HPB memory area is emptied.
The present process is not explained in detail, and reference is made to the foregoing, and will not be repeated here.
In this way, when the application is uninstalled, the file LBA list corresponding to the application is deleted, and then the file L2P mapping of the HPB memory area corresponding to the file LBA list is emptied, so as to avoid wasting the HPB memory space of the host DRAM.
With continued reference to fig. 6g, the flow of the application start acceleration method provided in the embodiment of the present application specifically further includes:
s501, the power management module monitors that the electronic equipment is about to be shut down and sends indication information 6 to the HPB management Agent.
The indication information 6 is used for indicating that the electronic device is about to be turned off.
S502, the HPB manages the hot spot file list of the Agent storage system and the file list corresponding to each application.
When the electronic equipment is about to be powered off, the HPB management Agent stores the system hot spot file list and the file list corresponding to each application to the UFS equipment, so that the electronic equipment can be read in the UFS equipment when the electronic equipment is powered on next time.
S503, the HPB management Agent calls the HPB management module to store the file LBA list.
Illustratively, the HPB management Agent invokes the associated function provided by the HPB management module to store the file LBA list via the HPB management module.
S504, the HPB management module stores the system hot spot file LBA list and the file LBA list corresponding to each application, and returns a storage result to the HPB management Agent.
The HPB management module stores the system hot spot file LBA list and the file LBA list corresponding to each application to the UFS equipment so that the electronic equipment can be read in the UFS equipment when the electronic equipment is started next time.
S505, the power management module monitors the startup of the electronic equipment and sends indication information 7 to the HPB management Agent.
The indication information 7 is used for indicating the electronic equipment to start.
S506, in the initialization stage of the electronic device, the HPB management module applies for the HPB memory area in the host DRAM.
S507, after receiving the indication information 7, the HPB management Agent judges whether a system hot spot file LBA list exists, if yes, S508 is executed.
If the system hot file LBA list does not exist, S202 to S207 shown in fig. 6a may be executed to generate the system hot file LBA list, and then the HPB memory area is refreshed based on the system hot file LBA list, which will not be described herein.
S508, the HPB management Agent calls the HPB management module to refresh the HPB memory area.
S509, the HPB management module sends an HPB memory area refreshing instruction to the UFS Host driving module.
In this step, the HPB memory area refresh command is configured to instruct the UFS Host driver module to write the file L2P map corresponding to the system hot file LBA list into the HPB memory area.
S510, the UFS Host driving module reads the file L2P mapping corresponding to the system hot spot file LBA list, writes the file L2P mapping into the HPB memory area, returns a refreshing result to the HPB management module, and returns the refreshing result to the HPB management Agent.
And the UFS Host driving module reads the file L2P mapping corresponding to the system hot file LBA list from the UFS device according to the HPB memory area refreshing instruction, and writes the file L2P mapping corresponding to the system hot file LBA list into the HPB memory area.
The present process is not explained in detail, and reference is made to the foregoing, and will not be repeated here.
In this way, in the process of starting the subsequent application, the system can read the related system hot spot file in the UFS device based on the system hot spot file L2P mapping cached in the HPB memory area, so as to improve the file reading speed, and further achieve the effect of accelerating the starting of the application.
After the electronic device is restarted, referring to S212 to S218 shown in fig. 6a, details of the starting situation of any hot spot application in the electronic device will not be repeated here.
Scene two
In this scenario, taking an example that a user uses a plurality of hot spot applications in an electronic device at the same time, an application start acceleration method provided in an embodiment of the present application is explained. In the following flow, explanation will be given taking an example in which a user switches a foreground application of an electronic device between application 1 and application 2.
FIG. 7a is a schematic diagram showing the interaction of the modules. Referring to fig. 7a, a flow of an application start acceleration method provided in an embodiment of the present application specifically includes:
s601, after the application 1 in the electronic device is started, the application 1 is switched to the background running or closed.
After application 1 is started, the user exits application 1 in the foreground, application 1 is switched to background operation, or the user shuts down application 1.
S602, the activity manager monitors that the application 2 is about to be started, and sends indication information 8 to the HPB management Agent.
By way of example, the indication information may include, but is not limited to, an application package name, and an indication type. In the instruction information 8, the application package name is the package name of the application 2, and the instruction type is an application start instruction.
S603, the HPB management Agent determines whether or not a file LBA list corresponding to the application 2 exists according to the instruction information 8, and if yes, S604 is executed.
The file LBA list corresponding to the application 2 may be generated when the application 2 is installed, or may be generated when the application 2 is started for a certain time, and may be stored in the UFS device when the electronic power is turned off.
S604, the HPB management Agent judges whether the file L2P mapping corresponding to the application 2 is loaded into the HPB memory area, if not, the step S605 is executed.
S605, the HPB management Agent calls the HPB management module to refresh the HPB memory area.
S606, the HPB management module sends an HPB memory area refreshing instruction to the UFS Host driving module.
In this step, the HPB memory region refresh instruction is used to instruct writing of the file L2P map corresponding to the application 2 into the HPB memory region.
S607, the UFS Host driving module writes the file L2P mapping corresponding to the file LBA list of the application 2 into the HPB memory area in the main memory according to the HPB memory area refreshing instruction, and returns a refreshing result to the HPB management module, which returns the refreshing result to the HPB management Agent.
For each LBA in the LBA list2 corresponding to the application 2, the UFS Host driving module queries the corresponding file L2P mapping from the UFS device, and writes the file L2P mapping into the HPB memory area as the file L2P mapping corresponding to the application 2.
As shown in fig. 7b, before application 2 is not started, the HPB memory area of the host DRAM includes a system hot spot file L2P map cache and a file L2P map cache corresponding to application 1. When application 2 is about to start, the HPB memory area is refreshed, and the refreshed HPB memory area comprises a system hot spot file L2P mapping cache, a file L2P mapping cache corresponding to application 1 and a file L2P mapping cache corresponding to application 2.
S608, starting the application 2, wherein during the starting process of the application 2, the system reads the relevant files in the UFS device based on the L2P mapping of the files cached in the HPB memory area.
S609, after the application 2 is switched to the background running or closed, the activity manager monitors that the application 1 is started, and sends indication information 9 to the HPB management Agent.
In the instruction information 9, the application package name is the package name of the application 1, and the instruction type is the application start instruction.
S610, the HPB management Agent determines whether or not there is a file LBA list corresponding to the application 1 according to the instruction information 9, and if yes, S611 is executed.
The file LBA list corresponding to the application 1 may be generated when the application 1 is installed, or may be generated when the application 1 is started up for a certain time, and stored in the UFS device when the electronic power is turned off.
S611, the HPB management Agent determines whether the file L2P mapping corresponding to the application 1 is loaded into the HPB memory area, and if so, S612 is executed.
S612, starting the application 1, and reading related files in the UFS device by the system based on the L2P mapping of the files cached in the HPB memory area in the process of starting the application 1.
The present process is not explained in detail, and reference is made to the foregoing, and will not be repeated here.
Because the HPB memory area includes the system hot spot file L2P mapping cache, the file L2P mapping cache corresponding to the application 1, and the file L2P mapping cache corresponding to the application 2, when the user switches between using the application 1 and the application 2, whichever application is about to be started, the file in the UFS device can be read based on the file L2P mapping cache in the HPB memory area, so that the file reading speed is improved, and further, the effect of accelerating the starting of the application is achieved.
Considering that the more the HPB memory area occupies the host DRAM memory, the more pressure is applied to the host DRAM memory, the upper limit of the application file L2P mapping that is cached in the HPB memory area may be set in this embodiment, for example, the application file L2P mapping corresponding to n (e.g., 10) hot spot applications may be cached in the HPB memory area at the same time. When the application file L2P maps corresponding to the n hot spot applications are cached in the HPB memory area, if the user restarts another hot spot application, the electronic device may first empty the application file L2P map corresponding to a certain hot spot application that is cached in the HPB memory area based on a preset refresh policy, and then write the file L2P map corresponding to another hot spot application into the corresponding HPB memory area. For example, the electronic device can empty the application file L2P map in the HPB memory region that corresponds to one or more hotspot applications with lower file LBA query frequency. Or, the electronic device may determine the HPB memory area that can be covered based on the preset refresh policy, and write the file L2P map corresponding to another hotspot application into the HPB memory area that can be covered, so as to achieve the effect of replacing the file L2P map. For example, the electronic device may cache the HPB memory area mapped by the application file L2P corresponding to the one or more hotspot applications with the lower file LBA query frequency as the overrideable HPB memory area.
Scene three
In this scenario, the electronic device dynamically updates the system hot file list and the application file list corresponding to each application, and then dynamically updates the corresponding system hot file LBA list and the application file LBA list corresponding to each application. Therefore, after the HPB memory area is refreshed according to the system hot spot file LBA list and the application file LBA list, the accuracy of the L2P mapping of the files cached in the HPB memory area can be ensured, the waste of HPB memory resources is avoided, and the probability of inquiring the related file LBA in the HPB memory area can be improved.
FIG. 8a is a schematic diagram showing the interaction of the modules. Referring to fig. 8a, a flow of an application start acceleration method provided in an embodiment of the present application specifically includes:
s701, the HPB management Agent acquires the updated system hot spot file list.
With the update of the device system or the change of the behavior habit of the user, the hot spot application may change, the hot spot file of the system may change, and the common file corresponding to each application may also change. Therefore, in the embodiment of the present application, the HPB management Agent dynamically updates the system hotspot file list and the application file list corresponding to each hotspot application.
In the embodiment of the application, statistics can be performed on system files and application files related to each application program starting and running process, and the system hot spot file list and the application file list corresponding to each application can be dynamically updated according to the statistical result. For example, a system file whose frequency of use exceeds a threshold value 1 is used as a system hot file. For another example, for each application that uses the file, if the frequency of use of the file exceeds the threshold 2, the file is used as an application hotspot file corresponding to the corresponding hotspot application.
The HPB management Agent may obtain an updated system hot spot file list at the cloud server side, may obtain an updated system hot spot file list at the related functional block side of the electronic device, and may generate an updated system hot spot file list according to the related statistics result, which is not limited in this embodiment.
S702, the HPB management Agent updates a system hot spot file list.
The HPB management Agent can replace the existing system hot spot file list by using the updated system hot spot file list, so as to achieve the effect of updating the system hot spot file list.
S703, the HPB management Agent invokes the HPB management module to update the system hot spot file LBA list.
S704, the HPB management module updates the system hot spot file LBA list according to the system hot spot file list, and returns an update result to the HPB management Agent.
And the HBP management module regenerates the system hot file LBA list according to the updated system hot file list to replace the existing system hot file LBA list, and returns an updating result for indicating that the updating is completed to the HBP management Agent.
As an alternative implementation manner, the event (or file LBA miss event) that the file LBA is not queried in the HPB memory area related to the starting and running process of each application program can be counted, and the file LBA corresponding to the LBA miss event is updated to the corresponding file LBA list. For example, in the starting process of a certain application program, when the LBA of a certain system file is queried in the HPB memory area, if the corresponding file L2P mapping is not queried, determining that a file LBA miss event occurs, adding the LBA of the system file to a system hot file LBA list, and updating the system hot file LBA list.
S705, the HPB management Agent calls the HPB management module to refresh the HPB memory area.
S706, the HPB management module sends an HPB memory area refreshing instruction to the UFS Host driving module.
In this step, the HPB memory area refresh command may be used to instruct the UFS Host driver module to update the file L2P map corresponding to the system hot file LBAlist in the HPB memory area. For example, the HPB memory region refresh command may be used to instruct the UFS Host driver module to empty the file L2P map corresponding to the system hot file LBA list in the HPB memory region, and then rewrite the file L2P map corresponding to the system hot file LBA list (updated) into the HPB memory region in the Host memory. For another example, the HPB memory region refresh command may be configured to instruct the UFS Host driver module to replace or cover the file L2P map corresponding to the system hot file LBA list before updating in the HPB memory region by using the file L2P map corresponding to the updated system hot file LBA list.
And S707, the UFS Host driving module updates the file L2P mapping corresponding to the system hot spot file LBA list cached in the HPB memory area according to the HPB memory area refreshing instruction, and returns a memory refreshing result to the HPB management module, wherein the HPB management module returns the memory refreshing result to the HPB management Agent.
The UFS Host driver module clears the L2P map of the HPB memory area corresponding to the LBA list of the system hot file according to the HPB memory area refresh command, reads the L2P map of the file corresponding to the LBA list (updated) of the system hot file from the UFS device, and rewrites the L2P map of the file as the L2P map of the file corresponding to the LBA list of the system hot file into the HPB memory area in the Host memory.
As shown in fig. 8b, before the UFS Host driver module refreshes the HPB memory area according to the HPB memory area refresh command, the HPB memory area includes a system hot file L2P map cache corresponding to the system hot file LBA list before the update; when the UFS Host driver module refreshes the HPB memory area according to the HPB memory area refreshing instruction, the system hot file L2P map cache corresponding to the system hot file LBA list before updating is emptied, and then the system hot file L2P map corresponding to the system hot file LBA list after updating is written into the HPB memory area (or the system hot file L2P map corresponding to the system hot file LBA list after updating is written into the HPB memory area, and then the system hot file L2P map cache corresponding to the system hot file LBA list before updating is emptied. That is, after the UFS Host driver module refreshes the HPB memory area according to the HPB memory area refresh command, the HPB memory area includes a system hot file L2P map cache corresponding to the updated system hot file LBA list.
Also exemplary, the UFS Host driver module uses the file L2P map corresponding to the updated system hot file LBA list to replace or cover the file L2P map corresponding to the system hot file LBA list before updating in the HPB memory area according to the HPB memory area refresh command.
In this way, the system hot spot file LBA list is dynamically updated, and the system hot spot file L2P mapping in the HPB memory area is refreshed based on the updated system hot spot file LBA list, so that the accuracy of the system hot spot file L2P mapping cached in the HPB memory area is ensured, and the probability that the system hot spot file LBA related to the starting or running of the application can be queried in the HPB memory area is improved.
S708, the HPB management Agent acquires the updated application file list corresponding to the application 3.
The HPB management Agent may obtain the updated application file list corresponding to the application 3 at the cloud server side, may obtain the updated application file list corresponding to the application 3 at the related functional block side of the electronic device, and may generate the updated application file list corresponding to the application 3 according to the related statistics result.
S709, the HPB manages the updated application file list corresponding to the application 3.
The HPB management Agent may replace the existing application file list with the updated application file list, so as to achieve the effect of updating the application file list corresponding to the application 3.
S710, the HPB management Agent calls the HBP management module to update the file LBA list corresponding to the application 3.
S711, the HBP management module updates the file LBA list corresponding to the application 3 according to the updated file list, and returns an update result to the HBP management Agent.
And the HBP management module regenerates the file LBA list corresponding to the application 3 according to the updated file list to replace the existing file LBA list corresponding to the application 3, and returns an updating result for indicating that the updating is completed to the HBP management Agent.
As an alternative implementation manner, the event (or file LBA miss event) that the file LBA is not queried in the HPB memory area related to the starting and running process of each application program can be counted, and the file LBA corresponding to the LBA miss event is updated to the corresponding file LBA list. For example, in the starting process of a certain application program, when the LBA of a certain application file is queried in the HPB memory area, if the corresponding file L2P mapping is not queried, determining that a file LBA miss event occurs, adding the LBA of the application file to the application file LBA list corresponding to the application, and updating the application file LBA list corresponding to the application.
The present process is not explained in detail, and reference is made to the foregoing, and will not be repeated here.
In this way, the file LBA list corresponding to each hot spot application is dynamically updated, and before the hot spot application is started, the application hot spot file L2P mapping in the HPB memory area is refreshed according to the current updated file LBA list, so that the accuracy of the application hot spot file L2P mapping cached in the HPB memory area is ensured, the probability that the application hot spot file LBA related to the application starting or running can be queried in the HPB memory area is improved, the file reading speed is improved, and the effect of accelerating the application starting is achieved.
The present embodiment also provides a computer storage medium having stored therein computer instructions that, when executed on an electronic device, cause the electronic device to execute the above-described related method steps to implement the application start acceleration method in the above-described embodiments.
The present embodiment also provides a computer program product which, when run on a computer, causes the computer to perform the above-described related steps to implement the application start acceleration method in the above-described embodiments.
In addition, embodiments of the present application also provide an apparatus, which may be specifically a chip, a component, or a module, and may include a processor and a memory connected to each other; the memory is used for storing computer-executed instructions, and when the device is running, the processor can execute the computer-executed instructions stored in the memory, so that the chip executes the application start acceleration method in the above method embodiments.
The electronic device (such as a mobile phone) provided in this embodiment, the computer storage medium, the computer program product or the chip are used to execute the corresponding method provided above, so that the beneficial effects thereof can be referred to the beneficial effects in the corresponding method provided above, and will not be described herein.
It will be appreciated by those skilled in the art that, for convenience and brevity of description, only the above-described division of the functional modules is illustrated, and in practical application, the above-described functional allocation may be performed by different functional modules according to needs, i.e. the internal structure of the apparatus is divided into different functional modules to perform all or part of the functions described above.
In the several embodiments provided in this application, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative, e.g., the division of modules or units is merely a logical function division, and there may be additional divisions when actually implemented, e.g., multiple units or components may be combined or integrated into another apparatus, or some features may be omitted or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be an indirect coupling or communication connection via some interfaces, devices or units, which may be in electrical, mechanical or other form.
The above embodiments are merely for illustrating the technical solution of the present application, and not for limiting the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit of the corresponding technical solutions from the scope of the technical solutions of the embodiments of the present application.
Claims (14)
1. The application starting acceleration method is characterized by being applied to electronic equipment, wherein the electronic equipment comprises a host and a universal flash memory storage (UFS) device, and the method comprises the following steps of:
monitoring that the first application is about to be started;
before the first application is started, a first file Logical Block Address (LBA) list is obtained, a mapping from a first file logical block address corresponding to the first file LBA list to a physical block address (L2P) is read in the UFS device, and the first file L2P mapping is cached to a Host Performance Booster (HPB) memory area of the host memory; the first file LBA list is generated based on a first file list, and files in the first file list are application files which correspond to the first application and influence the performance of an application process; the HPB memory area is also cached with a second file L2P mapping corresponding to a second file LBA list, the second file LBA list is generated based on the second file list, and files in the second file list are system files affecting the performance of the application process;
The first application is started; and in the process of starting the first application, reading related files in the UFS device based on the first file L2P mapping and the second file L2P mapping cached in the HPB memory area.
2. The method as recited in claim 1, further comprising:
at the starting-up stage of the electronic equipment, acquiring the second file list, and generating a second file LBA list according to the second file list;
and reading a second file L2P mapping corresponding to the second file LBA list in the UFS device, and caching the second file L2P mapping to the HPB memory area.
3. The method as recited in claim 1, further comprising:
monitoring the first application installation;
after the first application is installed, acquiring the first file list corresponding to the first application;
and generating the first file LBA list according to the first file list.
4. The method as recited in claim 1, further comprising:
monitoring the updating or compiling optimization of the first application;
updating the first file list corresponding to the first application after updating or compiling and optimizing the first application;
And updating the first file LBA list according to the updated first file list.
5. The method as recited in claim 1, further comprising:
acquiring a third file list; the third file list is generated based on the first file list update by the use case of the first application;
and updating the first file LBA list according to the third file list.
6. The method as recited in claim 1, further comprising:
monitoring that the first application is uninstalled;
deleting the first file LBA list after the first application is uninstalled;
and if the first file L2P mapping corresponding to the first file LBA list is cached in the HPB memory area, clearing the first file L2P mapping in the HPB memory area.
7. The method of any one of claims 1-6, further comprising:
monitoring that the second application is about to be started;
before the second application is started, a third file LBA list is obtained, a third file L2P mapping corresponding to the third file LBA list is read in the UFS device, and the third file L2P mapping is cached to an HPB memory area of the host memory; the third file LBA list is generated based on a fourth file list, and files in the fourth file list are application files which correspond to the second application and influence the performance of an application process;
The second application is started; and in the process of starting the second application, reading related files in the UFS device based on the third file L2P mapping and the second file L2P mapping cached in the HPB memory area.
8. The method as recited in claim 7, further comprising:
after the second application is started, monitoring that the first application is about to be started;
determining that the first file L2P mapping is cached in the HPB memory area;
the first application is started; and in the process of starting the first application, reading related files in the UFS device based on the first file L2P mapping and the second file L2P mapping cached in the HPB memory area.
9. The method of claim 8, further comprising, after determining that the first file L2P map is cached in the HPB memory region:
and if the first file LBA list is updated after the first file L2P mapping is cached, re-acquiring the first file LBA list, reading a fourth file L2P mapping corresponding to the first file LBA list in the UFS device, and updating the fourth file L2P mapping to the first file L2P mapping cached in the HPB memory area.
10. The method of any one of claims 1-6, further comprising:
acquiring a fifth file list; the fifth file list is generated based on updating the second file list based on use cases of a plurality of applications;
generating a fourth file LBA list according to the fifth file list;
and reading a fifth file L2P mapping corresponding to the fourth file LBA list in the UFS device, and updating the second file L2P mapping cached in the HPB memory area according to the fifth file L2P mapping.
11. The method of any one of claims 1-6, further comprising:
in the starting process of the first application, if the PBA corresponding to the first target file LBA is not found according to the first file L2P mapping and the second file L2P mapping cached in the HPB memory area, adding the first target file LBA to the first file LBA list, and updating the first file LBA list;
and the file corresponding to the first target file LBA is a non-system file.
12. The method of any one of claims 1-6, further comprising:
In the starting process of any application, if the PBA corresponding to the second target file LBA cannot be queried according to the second file L2P mapping cached in the HPB memory area, adding the second target file LBA into the second file LBA list, and updating the second file LBA list;
and the file corresponding to the second target file LBA is a system file.
13. An electronic device, comprising:
one or more processors;
a memory;
and one or more computer programs, wherein the one or more computer programs are stored on the memory, which when executed by the one or more processors, cause the electronic device to perform the application launch acceleration method of any one of claims 1-12.
14. A computer readable storage medium comprising a computer program, characterized in that the computer program, when run on an electronic device, causes the electronic device to perform the application start acceleration method of any one of claims 1-12.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202311113384.3A CN117707639B (en) | 2023-08-30 | 2023-08-30 | Application start acceleration method, electronic device and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202311113384.3A CN117707639B (en) | 2023-08-30 | 2023-08-30 | Application start acceleration method, electronic device and storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN117707639A true CN117707639A (en) | 2024-03-15 |
CN117707639B CN117707639B (en) | 2024-07-12 |
Family
ID=90161265
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202311113384.3A Active CN117707639B (en) | 2023-08-30 | 2023-08-30 | Application start acceleration method, electronic device and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN117707639B (en) |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109710185A (en) * | 2018-12-19 | 2019-05-03 | 麒麟合盛网络技术股份有限公司 | Data processing method and device |
US20210397370A1 (en) * | 2020-06-22 | 2021-12-23 | Silicon Motion, Inc. | Data processing method for improving access performance of memory device and data storage device utilizing the same |
US20220253388A1 (en) * | 2021-02-05 | 2022-08-11 | Samsung Electronics Co., Ltd.1 | Method of data caching and device caching data |
CN114968949A (en) * | 2022-05-23 | 2022-08-30 | 三星(中国)半导体有限公司 | Method for caching data, host device and storage system |
-
2023
- 2023-08-30 CN CN202311113384.3A patent/CN117707639B/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109710185A (en) * | 2018-12-19 | 2019-05-03 | 麒麟合盛网络技术股份有限公司 | Data processing method and device |
US20210397370A1 (en) * | 2020-06-22 | 2021-12-23 | Silicon Motion, Inc. | Data processing method for improving access performance of memory device and data storage device utilizing the same |
US20220253388A1 (en) * | 2021-02-05 | 2022-08-11 | Samsung Electronics Co., Ltd.1 | Method of data caching and device caching data |
CN114968949A (en) * | 2022-05-23 | 2022-08-30 | 三星(中国)半导体有限公司 | Method for caching data, host device and storage system |
Also Published As
Publication number | Publication date |
---|---|
CN117707639B (en) | 2024-07-12 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN111506262B (en) | Storage system, file storage and reading method and terminal equipment | |
US8099548B2 (en) | Power efficient media playback on general purpose portable devices | |
CN111966492B (en) | Memory recycling method and device, electronic equipment and computer readable storage medium | |
US20230418736A1 (en) | Virtual Memory Management Method and Electronic Device | |
CN114185491B (en) | Partition file downloading method and device, storage medium and computer equipment | |
CN114185494B (en) | Memory anonymous page processing method, electronic device and readable storage medium | |
EP4328705A1 (en) | Storage space arrangement method and electronic device | |
CN113590501A (en) | Data storage method and related equipment | |
US11467734B2 (en) | Managing swap area in memory using multiple compression algorithms | |
CN114546897A (en) | Memory access method and device, electronic equipment and storage medium | |
CN114020652A (en) | Application program management method and electronic equipment | |
EP4134829A1 (en) | Page swapping method, storage system, and electronic device | |
CN117707639B (en) | Application start acceleration method, electronic device and storage medium | |
CN115934002A (en) | Solid state disk access method, solid state disk, storage system and cloud server | |
CN116048414A (en) | Data reading method of equipment and electronic equipment | |
US11237741B2 (en) | Electronic device and control method for controlling memory | |
CN117369735B (en) | Data storage method, electronic device and storage medium | |
CN116541180B (en) | Memory allocation method, electronic equipment and storage medium | |
CN117668319B (en) | Data query method, electronic device and storage medium | |
CN112783418A (en) | Method for storing application program data and mobile terminal | |
CN116382809B (en) | Application program starting method and electronic equipment | |
CN116560587B (en) | Data management system and terminal equipment | |
CN114741205B (en) | Anonymous page recovery method and electronic device | |
US20230168822A1 (en) | Memory management method and semiconductor device adjusting size of contiguous memory allocation area | |
CN116954936A (en) | Inter-process communication method and electronic equipment |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant |