IP Library Granted Patent US 10,846,265
Granted Patent B2
US 10,846,265 · App. 15/576,637 · Granted Nov 24, 2020

Method and apparatus for accessing file, and storage system

Inventors: Guojun Shi (Beijing, CN); Zhigang Li (Shenzhen, CN); Fuzhou Xiao (Beijing, CN)
Assignee: Huawei Technologies Co., Ltd.
G06F16/13G06F3/06G06F3/064G06F3/0613G06F12/02G06F16/16G06F16/1724G06F16/182
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 10,846,265
App. No.
15/576,637
Granted
Nov 24, 2020
Kind
B2
Abstract

A method and an apparatus for accessing a file, and a storage system. The method includes: determining L first-file invoking request messages; separately adding, according to physical sector information in the L first-file invoking request messages, the L first-file invoking request messages to M first-file dispatch queues; and processing a first-file invoking request message included in each first-file dispatch queue, to obtain an invoking request message of each first-file dispatch queue, where the invoking request message is used to access a first file. By means of the method and apparatus for accessing a file and the storage system in the embodiments of the present disclosure, a corresponding dispatch queue is allocated to an invoking request message of a micro file, so that combination processing can be performed on invoking request messages of multiple micro files, and a quantity of times of invoking a micro file is reduced.

Claims (68)

1. A method for accessing a file, the method comprising:

determining L number of first file invoking request messages each for requesting to invoke a corresponding first file, wherein a size of the first file is less than or equal to a threshold, and each first-file invoking request message comprises physical sector information, the physical sector information comprising an address of a physical sector storing the first file, and L being an integer greater than 1;

separately adding, according to the physical sector information, the L number of first-file invoking request messages to M number of first-file dispatch queues corresponding to the L number of first-file invoking request messages, wherein M is a positive integer;

processing K number of first-file invoking request messages in each of the M number of first-file dispatch queues, to obtain an invoking request message of each first-file dispatch queue, the invoking request message of each first-file dispatch queue for requesting to invoke first files corresponding to the K first-file invoking request messages, and K is a positive integer; and

accessing, according to the invoking request message of each first-file dispatch queue, the first files corresponding to the K number of first-file invoking request messages.

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

determining N number of first-file storage space groups on the physical sector storing the first files, wherein is a positive integer, and wherein the method further comprises one of the following:

combining first files in at least two of the N first-file storage space groups when the at least two first-file storage space groups have available storage space;

releasing at least one of the N first-file storage space group when the at least one first-file storage space groups does not store a file; and

increasing a quantity of the N first-file storage space groups when none of the N first-file storage space groups has available storage space; and, wherein

accessing, according to the invoking request message of each first-file dispatch queue, the first files corresponding to the K first-file invoking request messages comprises:

accessing, from the N first-file storage space groups according to the invoking request message of each first-file dispatch queue, the first files corresponding to the K first-file invoking request messages.

3. The method according to claim 1 , wherein separately adding, according to the physical sector information, the L number of first-file invoking request messages to M number of first-file dispatch queues corresponding to the L first-file invoking request messages comprises:

adding at least two of the L number of first-file invoking request messages to a same first-file dispatch queue according to the physical sector information, wherein addresses of physical sectors of first files that the at least two first-file invoking request messages request to invoke are continuous.

4. The method according to claim 1 , wherein each first-file invoking request message further comprises access path information indicating a path for accessing the first file corresponding to each first file invoking request message.

5. The method according to claim 4 , wherein determining the L number of first-file invoking request messages comprises:

determining L number of first-file information nodes, each for storing the access path information of the first file that each first-file invoking request message requests to invoke; and

determining, according to each first-file information node, the access path information of the first file each first-file invoking request message requests to invoke.

6. The method according to claim 5 , wherein determining the L number of first-file information nodes comprises:

determining whether an i th first-file information node of the L number of first-file information nodes exists in an information node linked list; and, wherein the method further comprises one of the following:

creating, in the information node linked list, the i th first-file information node, and storing access path information of an i th first file in the i th first-file information node when the i th first-file information node does not exist in the information node linked list; and

determining access path information of an i th first file according to the i th first-file information node when the i th first-file information node exists in the information node linked list.

7. An apparatus for accessing a file, the apparatus comprising:

a first determining module, configured to determine L number of first file invoking request messages each for requesting to invoke a corresponding first file, wherein a size of the first file is less than or equal to a threshold, and each first-file invoking request message comprises physical sector information, the physical sector information comprising an address of a physical sector storing the first file, and L being an integer greater than 1;

an allocation module, configured to separately add, according to the physical sector information, the L number of first-file invoking request messages to M number of first-file dispatch queues corresponding to the L number of first-file invoking request messages, wherein M is a positive integer;

a processing module, configured to process K number of first-file invoking request messages in each of the M first-file dispatch queues allocated by the allocation module, to obtain an invoking request message of each first-file dispatch queue, wherein the invoking request message of each first-file dispatch queue for requesting to invoke first files corresponding to the K number of first-file invoking request messages, and K is a positive integer; and

an invoking module, configured to access, according to the invoking request message, which is obtained by the processing module, of each first-file dispatch queue, the first files corresponding to the K number of first-file invoking request messages.

8. The apparatus according to claim 7 , wherein the apparatus further comprises:

a second determining module, configured to: determine N number of first-file storage space groups on the physical sector storing the file; and to perform one of the following:

combining first files in at least two of the N number of first-file storage space groups when the at least two first-file storage space groups have available storage space;

releasing at least one of the N first-file storage space group when the at least one first-file storage space groups does not store a file; and

increasing a quantity of the N first-file storage space groups when none of the N first-file storage space groups has available storage space; and

the invoking module is further configured to:

access, from the N first-file storage space groups according to the invoking request message of each first-file dispatch queue, the first files corresponding to the K first-file invoking request messages.

9. The apparatus according to claim 7 , wherein the processing module is configured to:

add at least two of the L number of first-file invoking request messages to a same first-file dispatch queue according to the physical sector information, wherein addresses of physical sectors of first files that the at least two first-file invoking request messages request to invoke are continuous.

10. The apparatus according to claim 7 , wherein each first-file invoking request message further comprises access path information indicating a path for accessing the first file corresponding to each first file invoking request message.

11. The apparatus according to claim 10 , wherein the determining module is configured to:

determine L number of first-file information nodes each for storing the access path information of the first file that each first-file invoking request message requests to invoke; and

determine, according to each first-file information node, the access path information of the first file that each first-file invoking request message requests to invoke.

12. The apparatus according to claim 11 , wherein the determining module is configured to:

determine whether an i th first-file information node of the L number of first-file information nodes exists in an information node linked list; and to perform one of the following:

creating, in the information node linked list, the i th first-file information node, and storing access path information of an i th first file in the i th first-file information node when the i th first-file information node does not exist in the information node linked list; and

determining access path information of an i th first file according to the i th first-file information node when the i th first-file information node exists in the information node linked list.

13. A storage system, comprising:

a memory, configured to store a file and a program; and

a processor, configured to execute the program and to:

determine L number of first file invoking request messages each for requesting to invoke a corresponding first file, wherein a size of the first file is less than or equal to a threshold, and each first-file invoking request message comprises physical sector information, the physical sector information comprising an address of a physical sector storing the first file, and L being an integer greater than 1,

separately add, according to the physical sector information, the L number of first-file invoking request messages to M number of first-file dispatch queues corresponding to the L number of first-file invoking request messages, wherein M is a positive integer,

process K number of first-file invoking request messages in each of the M number of first-file dispatch queues, to obtain an invoking request message of each first-file dispatch queue, the invoking request message of each first-file dispatch queue for requesting to invoke first files corresponding to the K first-file invoking request messages, and K is a positive integer, and

access, according to the invoking request message of each first-file dispatch queue, the first files corresponding to the K first-file invoking request messages.

14. The storage system according to claim 13 , wherein the processor is further configured to:

determine N number of first-file storage space groups on the physical sector storing the file;

perform one of the following:

combining first files comprised in at least two of the N number of first-file storage space groups when the at least two first-file storage space groups have available storage space;

releasing at least one of the N first-file storage space group when the at least one first-file storage space groups does not store a file; or

increasing a quantity of the N first-file storage space groups when none of the N first-file storage space groups has available storage space; and

access, from the N first-file storage space groups according to the invoking request message of each first-file dispatch queue, the first files corresponding to the K number of first-file invoking request messages.

15. The storage system according to claim 13 , wherein the processor is configured to:

add at least two of the L number of first-file invoking request messages to a same first-file dispatch queue according to the physical sector information, wherein addresses of physical sectors of first files that the at least two first-file invoking request messages request to invoke are continuous.

16. The storage system according to claim 13 , wherein each first-file invoking request message further comprises access path information indicating a path for accessing the first file corresponding to each first file invoking request message.

17. The storage system according to claim 16 , wherein the processor is configured to:

determine L number of first-file information nodes for storing the access path information of the first file that each first-file invoking request message requests to invoke; and

determine, according to each first-file information node, the access path information of the first file that each first-file invoking request message requests to invoke.

18. The storage system according to claim 17 , wherein the processor is configured to:

determine whether an i th first-file information node of the L number of first-file information nodes exists in an information node linked list; and to perform one of:

creating, in the information node linked list, the i th first-file information node, and storing access path information of an i th first file in the i th first-file information node when the i th first-file information node does not exist in the information node linked list; and

determining access path information of an i th first file according to the i th first-file information node when the i th first-file information node exists in the information node linked list.

Assignments (2)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Apr 13, 2021
From: HUAWEI TECHNOLOGIES CO., LTD.
To: HONOR DEVICE CO., LTD.
Reel/Frame 055919/0344 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Aug 7, 2018
From: SHI, GUOJUN; LI, ZHIGANG; XIAO, FUZHOU
To: HUAWEI TECHNOLOGIES CO., LTD.
Reel/Frame 046572/0229 →
Continuity (1)
Related Publication 20180129672A1 · May 10, 2018