IP Library › Granted Patent US 12,293,078
Granted Patent B2
US 12,293,078 · App. 18/552,295 · Granted May 6, 2025

Storage space organization method and electronic device

Inventors: Dachen Jin (Shenzhen, CN); Jian Dang (Shenzhen, CN)
Assignee: Honor Device Co., Ltd.
G06F3/0608G06F3/0638G06F3/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 12,293,078
App. No.
18/552,295
Granted
May 6, 2025
Kind
B2
Abstract

This application discloses a storage space organization method and an electronic device. A kernel of the electronic device includes a file system and a block layer, and the method includes: monitoring, by the electronic device, input/output ports IOs through the block layer, and determining, by the block layer when there is IO release, whether all the IOs have been released; and updating, by the electronic device when all the IOs have been released, a state of the file system to an idle state through the block layer, to trigger the electronic device to perform first garbage collection processing through the file system, where the state of the file system includes the idle state and a busy state.

Claims (43)

1. A storage space organization method, wherein the method is applied to an electronic device, a kernel of the electronic device comprises a file system and a block layer, and the method comprises:

monitoring, by the electronic device, input/output ports (IOs) through the block layer, and determining, by the block layer when there is IO release, whether all the IOs have been released, wherein when all the IOs have been released, the electronic device updates a state of the file system to an idle state through the block layer, to trigger the electronic device to perform first garbage collection processing through the file system, and the state of the file system comprises the idle state or a busy state;

when a second duration has elapsed since a last garbage collection detection, triggering, by the electronic device through the file system, garbage collection detection and determining whether a garbage collection condition is met; and performing, by the electronic device when the garbage collection condition is met, the first garbage collection processing through the file system, wherein the garbage collection condition is that the state of the file system is the idle state and all the IOs of the block layer have been released; and

updating, by the electronic device, the state of the file system to the idle state through the block layer, and triggering, by the file system after a first duration, garbage collection detection and determining whether the garbage collection condition is met; and performing, by the electronic device when the garbage collection condition is met, the first garbage collection processing through the file system, wherein

a duration between the file system triggering the garbage collection detection after the first duration and the last garbage collection detection is less than the second duration.

2. The method according to claim 1 , wherein the electronic device further comprises a storage device, and after the updating, by the electronic device, the state of the file system to the idle state through the block layer, the method further comprises:

triggering, by the electronic device through the block layer, the storage device to perform second garbage collection processing.

3. The method according to claim 1 , wherein the monitoring, by the electronic device, IOs through the block layer comprises:

monitoring, by the electronic device through the block layer, whether a task instruction is received, wherein the task instruction is a notification sent to the block layer when the file system acquires a first task and indicating execution of the first task;

determining, by the electronic device when the block layer receives the task instruction, that there is IO occupation through the block layer;

monitoring, by the electronic device through the block layer, whether a task end notification is received, wherein the task end notification is a notification sent to the block layer when a storage device of the electronic device completes execution of the first task; and

determining, by the electronic device when the block layer receives the task end notification, that there is IO release through the block layer.

4. The method according to claim 3 , wherein the electronic device further comprises an internal memory and a processor, and when the block layer receives the task instruction, the method further comprises:

controlling, by the electronic device through the block layer, the internal memory to increase a first operating frequency; and

controlling, by the electronic device through the block layer, the processor to increase a second operating frequency.

5. The method according to claim 3 , wherein the electronic device further comprises an internal memory and a processor, and when the block layer receives the task end notification, and the electronic device is in a preset state, the method further comprises:

controlling, by the electronic device through the block layer, the internal memory to decrease a first operating frequency; and

controlling, by the electronic device through the block layer, the processor to decrease a second operating frequency.

6. The method according to claim 5 , wherein the preset state is that the electronic device is in a screen-off state and the state of the file system is updated to the idle state.

7. An electronic device, comprising: one or more processors and one or more memories, wherein the one or more processors are coupled to the one or more memories, the one or more memories are configured to store computer program code, the computer program code comprises computer instructions, and when the one or more processors execute the computer instructions, the electronic device is enabled to perform:

monitoring, by the electronic device, input/output ports (IOs) through a block layer of the electronic device, and determining, by the block layer when there is IO release, whether all the IOs have been released, wherein when all the IOs have been released, the electronic device updates a state of a file system of the electronic device to an idle state through the block layer, to trigger the electronic device to perform first garbage collection processing through the file system, and the state of the file system comprises the idle state and a busy state;

when a second duration has elapsed since the last garbage collection detection, triggering, by the electronic device through the file system, garbage collection detection and determining whether a garbage collection condition is met; and performing, by the electronic device when the garbage collection condition is met, the first garbage collection processing through the file system, wherein the garbage collection condition is that the state of the file system is the idle state and all the IOs of the block layer have been released; and

updating, by the electronic device, the state of the file system to the idle state through the block layer, and triggering, by the file system after a first duration, garbage collection detection and determining whether the garbage collection condition is met; and performing, by the electronic device when the garbage collection condition is met, the first garbage collection processing through the file system, wherein

a duration between the file system triggering the garbage collection detection after the first duration and the last garbage collection detection is less than the second duration.

8. The electronic device according to claim 7 , wherein the electronic device further comprises a storage device, and when the one or more processors execute the computer instructions, the electronic device is enabled to perform:

after the updating, by the electronic device, the state of the file system to the idle state through the block layer, triggering, by the electronic device through the block layer, the storage device to perform second garbage collection processing.

9. The electronic device according to claim 7 , wherein the monitoring, by the electronic device, IOs through the block layer comprises:

monitoring, by the electronic device through the block layer, whether a task instruction is received, wherein the task instruction is a notification sent to the block layer when the file system acquires a first task and indicating execution of the first task;

determining, by the electronic device when the block layer receives the task instruction, that there is IO occupation through the block layer;

monitoring, by the electronic device through the block layer, whether a task end notification is received, wherein the task end notification is a notification sent to the block layer when a storage device of the electronic device completes execution of the first task; and

determining, by the electronic device when the block layer receives the task end notification, that there is IO release through the block layer.

10. The electronic device according to claim 9 , wherein the electronic device further comprises an internal memory, and when the one or more processors execute the computer instructions, the electronic device is enabled to perform:

when the block layer receives the task instruction, controlling, by the electronic device through the block layer, the internal memory to increase a first operating frequency; and

controlling, by the electronic device through the block layer, the processor to increase a second operating frequency.

11. The electronic device according to claim 9 , wherein the electronic device further comprises an internal memory, and when the one or more processors execute the computer instructions, the electronic device is enabled to perform:

when the block layer receives the task end notification, and the electronic device is in a preset state, controlling, by the electronic device through the block layer, the internal memory to decrease a first operating frequency; and

controlling, by the electronic device through the block layer, the processor to decrease a second operating frequency.

12. The electronic device according to claim 11 , wherein the preset state is that the electronic device is in a screen-off state and the state of the file system is updated to the idle state.

13. A non-transitory computer-readable storage medium, comprising instructions, wherein when the instructions are run on an electronic device, the electronic device is enabled to perform:

monitoring input/output ports (IOs) through a block layer of the electronic device, and determining, by the block layer when there is IO release, whether all the IOs have been released, wherein when all the IOs have been released, the electronic device updates a state of a file system to an idle state through the block layer, to trigger the electronic device to perform first garbage collection processing through the file system, and the state of the file system comprises the idle state and a busy state;

when a second duration has elapsed since the last garbage collection detection, triggering, by the electronic device through the file system, garbage collection detection and determining whether a garbage collection condition is met; and performing, by the electronic device when the garbage collection condition is met, the first garbage collection processing through the file system, wherein the garbage collection condition is that the state of the file system is the idle state and all the IOs of the block layer have been released; and

updating, by the electronic device, the state of the file system to the idle state through the block layer, and triggering, by the file system after a first duration, garbage collection detection and determining whether the garbage collection condition is met; and performing, by the electronic device when the garbage collection condition is met, the first garbage collection processing through the file system, wherein

a duration between the file system triggering the garbage collection detection after the first duration and the last garbage collection detection is less than the second duration.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Apr 29, 2024
From: JIN, DACHEN; DANG, JIAN
To: HONOR DEVICE CO., LTD.
Reel/Frame 067253/0636 →
Priority Claims (1)
CN 202210776818.7 · Jul 4, 2022 · national
Continuity (1)
Related Publication 20250085850A1 · Mar 13, 2025
References Cited (27)
US 11093453B1 · Reza et al. · 2021 [cited by applicant]
US 11126546B2 · Yu et al. · 2021 [cited by applicant]
US 20150193338A1 · Sundaram et al. · 2015 [cited by applicant]
US 20190171389A1 · Muthiah et al. · 2019 [cited by applicant]
US 20190238312A1 · Dickens, III · 2019 [cited by examiner]
US 20210278990A1 · Choi · 2021 [cited by applicant]
US 20220058118A1 · Yu et al. · 2022 [cited by applicant]
US 20220147257A1 · Bhowmik · 2022 [cited by examiner]
US 20230325103A1 · Ponnuswamy · 2023 [cited by examiner]
CN 1776568A · 2006 [cited by applicant]
CN 1822230A · 2006 [cited by applicant]
CN 101281458A · 2008 [cited by applicant]
CN 202120349U · 2012 [cited by applicant]
CN 105389266A · 2016 [cited by applicant]
CN 108874683A · 2018 [cited by applicant]
CN 109240941A · 2019 [cited by applicant]
CN 109726137A · 2019 [cited by applicant]
CN 110709810A · 2020 [cited by applicant]
CN 112559381A · 2021 [cited by applicant]
CN 113296880A · 2021 [cited by applicant]
CN 114442932A · 2022 [cited by applicant]
CN 114840450A · 2022 [cited by applicant]
EP 3680786A1 · 2020 [cited by applicant]
WO 2021162388A1 · 2021 [cited by applicant]
Liu Gang et al., “A Modular Design of IO Cache in Dual Control Storage System”, Journal of Computer Research and Development, Jan. 4, 2012; 5 pages. [cited by applicant]
Xiaobin Wu, “The Design and Implementation of small object storage system with multi read and multi write”, Dissertation for the Master Degree (with English abstract); Jan. 15, 2022; 97pages. [cited by applicant]
Juraj Selep, “Implementing garbage collection into the storage of the TezEdge node”, Feb. 4, 2021; Retrieved from the internet, URL:https://medium.com/tezedge/implementing-garbage-collection-into-the-storage-of-the-teze… [cited by applicant]