Patent attributes
A storage fragment management method and a terminal. The method may be applied to a file system of the terminal, and the file system includes at least one segment. The method includes: first determining, by the terminal, a source segment from the file system based on an aging degree of the segment and a valid block ratio of the segment; then determining, by the terminal from the file system based on an aging degree of the source segment, a target segment whose aging degree is consistent with the aging degree of the source segment; and finally migrating, by the terminal, data of a valid block in the source segment to an idle block in the target segment. This method is used to resolve a problem that power consumption is high when data migration is performed on a storage fragment in an existing log-structured file system.