The invention relates to the technical field of
wear leveling, and particularly discloses a
solid state disk
wear leveling algorithm based on a log structure merging tree. Comprising the following steps: S1, dividing the hierarchy of LSM-Tree, and triggering a merging operation when write-in data is increased and reaches a threshold value; s2, distinguishing cold and hot data according to the data layering characteristic of the LSM-Tree, modifying a corresponding interface to transmit layering information to an FTL of an underlying SSD, and confirming a
data placement area through the layering information transmitted by an upper layer; s3, storing the erasing times of each
flash memory block by adopting a cold and hot block table, and presetting a threshold value; s4, judging and distinguishing cold and hot blocks for the
flash memory blocks which are subjected to read-write operation and cannot be updated on site; and S5, organizing all the blocks into a double
linked list according to the number of wear times, distributing different hierarchical data storage positions according to hierarchical information of the LSM-Tree transmitted by an upper layer, and performing
data exchange. According to the method, resource waste caused by the fact that cold data occupies a low-erasure-frequency block for a long time is avoided, and the problem of unbalanced abrasion of the storage block is reduced.