IP Library Granted Patent US 12704987
Granted Patent B2
US 12704987 · App. 17/914,200 · Granted Aug 11, 2026

Storage system, file storage and reading method, and terminal device

Inventors: Enbo Gao (Shanghai, CN); Juanjuan Tong (Shanghai, CN); Xiyu Zhou (Shanghai, CN); Wei Du (Moscow, RU); Zhiwei Zhang (Shanghai, CN); Jian Yi (Shanghai, CN); Weilai Zhou (Shanghai, CN); Jiaxin Li (Shanghai, CN)
Assignee: Huawei Technologies Co., Ltd.
G06F3/0647G06F3/0622G06F3/0658G06F3/0679
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 12704987
App. No.
17/914,200
Granted
Aug 11, 2026
Kind
B2
Abstract

A storage system, a file storage and reading method, and a terminal device are provided. A storage system including a UFS is used as an example. The storage system configures different medium forms of the UFS, for example, configures persistent storage space of the UFS including SLC and TLC medium forms, to implement hybrid medium multi-disk storage. Based on the storage system, a hot file related to an application running rate is preferentially selected and stored in an SLC storage area of the UFS, and files on a mapped multi-disk are mounted on a same directory of a file system, so that files can be migrated between the SLC storage area and a TLC storage area without user perception, to improve performance of the storage system.

Claims (81)

1 . A method, wherein the method is applied to an electronic device comprising a processor and a universal flash storage (UFS), and the method comprises:

configuring a data storage form of a first logical unit in the UFS as a first storage form and a data storage form of a second logical unit in the UFS as a second storage form, wherein the first logical unit and the second logical unit are mounted on a same directory of a file system, the first storage form is different from the second storage form, and read/write performance of the second storage form is higher than read/write performance of the first storage form;

determining first information in response to a request for creating a new file in the UFS;

selecting the first logical unit or the second logical unit based on the first information;

creating the new file in a selected logical unit;

obtaining information about a quantity of applications installed by a user on the electronic device;

determining whether the quantity of applications installed by the user is less than a second threshold;

migrating, based on the quantity of applications installed by the user being determined to be less than the second threshold, a first file in the first logical unit to the second logical unit; and

arranging, based on the quantity of applications installed by the user being determined to be greater than or equal to the second threshold, the applications installed by the user in a descending order of use frequencies of the user, determining hot files of first K applications from the arranged applications based on a capacity of the second logical unit, the hot files of the first K applications having use frequencies satisfying a condition, and migrating the hot files of the first K applications to the second logical unit, wherein K is a positive integer.

2 . The method according to claim 1 , wherein

the first information comprises file type information of the new file;

the first information comprises information about a directory to which the new file belongs;

when the new file is used as a directory file, the first information comprises information about the directory file; or

the first information comprises information about an application to which the new file belongs.

3 . The method according to claim 2 , wherein the information about the application to which the new file belongs comprises an application package name corresponding to the application to which the new file belongs.

4 . The method according to claim 1 , wherein when the hot files of the first K applications in the applications installed by the user have been created in the second logical unit, and the capacity of the second logical unit is greater than or equal to a third threshold, the method further comprises:

obtaining N applications other than the first K applications in the applications installed by the user, and determining M file sets from the N applications, wherein each of the M file sets comprises at least one file of the N applications, wherein N is a positive integer;

calculating M corresponding time gains of separately creating the M file sets into the second logical unit, wherein the M corresponding time gains are relative time gains or absolute time gains, wherein M is a positive integer;

determining M impact coefficients of the M file sets based on the M file sets and the M corresponding time gains; and

arranging the M impact coefficients in a descending order, determining first S impact coefficients from the arranged M impact coefficients based on the capacity of the second logical unit and sizes of the M file sets, and creating, into the second logical unit, S file sets corresponding to the first S impact coefficients, wherein S is a positive integer.

5 . The method according to claim 1 , wherein the method further comprises:

configuring a storage form conversion mode of the second logical unit, the storage form conversion mode indicating whether the second logical unit is convertible from one form to another form.

6 . The method according to claim 5 , wherein the storage form conversion mode of the second logical unit comprises one of following:

the second logical unit is fixed in the second storage form;

when storage space of the second logical unit is less than a fifth threshold, the second logical unit is unidirectionally convertible from the second storage form to the first storage form; or

when the storage space of the second logical unit is less than the fifth threshold, the second logical unit is convertible from the second storage form to the first storage form, and when the storage space of the second logical unit is greater than or equal to the fifth threshold, the second logical unit is convertible from the first storage form to the second storage form.

7 . The method according to claim 1 , wherein

the first storage form comprises a triple-level cell (TLC), and the second storage form comprises a single-level cell (SLC);

the first storage form comprises a multi-level cell (MLC), and the second storage form comprises an SLC;

the first storage form comprises a quad-level cell (QLC), and the second storage form comprises an SLC;

the first storage form comprises a TLC, and the second storage form comprises an MLC;

the first storage form comprises a QLC, and the second storage form comprises an MLC; or

the first storage form comprises a QLC, and the second storage form comprises a TLC.

8 . The method according to claim 1 , wherein the method further comprises:

sending, by the processor, a first instruction to a controller in the UFS, wherein the first instruction comprises start addresses and end addresses of a plurality of logical units in the UFS;

determining, by the controller in the UFS, the first logical unit and the second logical unit in response to the first instruction based on the start addresses and the end addresses of the plurality of logical units in the UFS; and

sending, by the processor, a second instruction to the controller in the UFS, and configuring, by the controller in the UFS in response to the second instruction, the data storage form of the first logical unit as the first storage form and the data storage form of the second logical unit as the second storage form, wherein

the first logical unit is mapped to a common system disk, the second logical unit is mapped to a fast system disk, and files in the common system disk and the fast system disk are mounted on the same directory of the file system.

9 . An electronic device comprising:

a universal flash storage (UFS); and

a processor in communication with the UFS, and configured to:

configure a data storage form of a first logical unit in the UFS as a first storage form and a data storage form of a second logical unit in the UFS as a second storage form, wherein the first logical unit and the second logical unit are mounted on a same directory of a file system, the first storage form is different from the second storage form, and read/write performance of the second storage form is higher than read/write performance of the first storage form;

determine first information in response to a request for creating a new file in the UFS;

select the first logical unit or the second logical unit based on the first information create the new file in a selected logical unit;

obtain information about a quantity of applications installed by a user on the electronic device;

determine whether the quantity of applications installed by the user is less than a second threshold;

migrate, based on the quantity of applications installed by the user being determined to be less than the second threshold, a first file in the first logical unit to the second logical unit; and

arrange, based on the quantity of applications installed by the user being determined to be greater than or equal to the second threshold, the applications installed by the user in a descending order of use frequencies of the user, determine hot files of first K applications from the arranged applications based on a capacity of the second logical unit, the hot files of the first K applications having use frequencies satisfying a condition, and migrate the hot files of the first K applications to the second logical unit, wherein K is a positive integer.

10 . The electronic device according to claim 9 , wherein

the first information comprises file type information of the new file;

the first information comprises information about a directory to which the new file belongs;

when the new file is used as a directory file, the first information comprises information about the directory file; or

the first information comprises information about an application to which the new file belongs.

11 . The electronic device according to claim 10 , wherein the information about the application to which the new file belongs comprises an application package name corresponding to the application to which the new file belongs.

12 . The electronic device according to claim 9 , wherein

the first storage form comprises a triple-level cell (TLC), and the second storage form comprises a single-level cell (SLC);

the first storage form comprises a multi-level cell (MLC), and the second storage form comprises an SLC;

the first storage form comprises a quad-level cell (QLC), and the second storage form comprises an SLC;

the first storage form comprises a TLC, and the second storage form comprises an MLC; or

the first storage form comprises a QLC, and the second storage form comprises an MLC; or

the first storage form comprises a QLC, and the second storage form comprises a TLC.

13 . The electronic device according to claim 9 , wherein the UFS is configured to:

receive a first instruction, wherein the first instruction comprises start addresses and end addresses of a plurality of logical units in the UFS;

determine the first logical unit and the second logical unit in response to the first instruction based on the start addresses and the end addresses of the plurality of logical units in the UFS; and

receive a second instruction, and configure, in response to the second instruction, the data storage form of the first logical unit as the first storage form and the data storage form of the second logical unit as the second storage form, wherein

the first logical unit is mapped to a common system disk, the second logical unit is mapped to a fast system disk, and files in the common system disk and the fast system disk are mounted on the same directory of the file system.

14 . A non-transitory computer readable storage medium, comprising computer instructions, wherein when the computer instructions are run on an electronic apparatus, the electronic apparatus is caused to perform operations comprising:

configuring a data storage form of a first logical unit in a universal flash storage (UFS) as a first storage form and a data storage form of a second logical unit in the UFS as a second storage form, wherein the first logical unit and the second logical unit are mounted on a same directory of a file system, the first storage form is different from the second storage form, and read/write performance of the second storage form is higher than read/write performance of the first storage form;

determining first information in response to a request for creating a new file in the UFS;

selecting the first logical unit or the second logical unit based on the first information;

creating the new file in a selected logical unit;

obtaining information about a quantity of applications installed by a user on an electronic device;

determining whether the quantity of applications installed by the user is less than a second threshold;

migrating, based on the quantity of applications installed by the user being determined to be less than the second threshold, a first file in the first logical unit to the second logical unit; and

arranging, based on the quantity of applications installed by the user being determined to be greater than or equal to the second threshold, the applications installed by the user in a descending order of use frequencies of the user, determining hot files of first K applications from the arranged applications based on a capacity of the second logical unit, the hot files of the first K applications having use frequencies satisfying a condition, and migrating the hot files of the first K applications to the second logical unit, wherein K is a positive integer.

15 . The non-transitory computer readable storage medium according to claim 14 , wherein the first information comprises information about a directory to which the new file belongs.

16 . The non-transitory computer readable storage medium according to claim 14 , wherein the new file is used as a directory file, and the first information comprises information about the directory file.

17 . The non-transitory computer readable storage medium according to claim 14 , wherein the first information comprises information about an application to which the new file belongs.

18 . The non-transitory computer readable storage medium according to claim 17 , wherein the information about the application to which the new file belongs comprises an application package name corresponding to the application to which the new file belongs.

19 . The non-transitory computer readable storage medium according to claim 14 , wherein the first storage form comprises a triple-level cell (TLC), and the second storage form comprises a single-level cell (SLC).

20 . The non-transitory computer readable storage medium according to claim 14 , wherein the first storage form comprises a multi-level cell (MLC), and the second storage form comprises a single-level cell (SLC).