The embodiment of the invention provides a memory
recovery method and device,
electronic equipment and a storage medium, and relates to the technical field of data storage. Under the condition that both the
file system and the storage device support the perceptual
garbage collection function, the device state of the storage device is obtained in response to the starting of the perceptual
garbage collection function; according to the
equipment state, determining whether an execution condition for sensing a
garbage collection function is met or not; and if the execution condition of the garbage collection sensing function is met, the
file system is linked to perform memory collection on the storage device, so that the
file system can know the data blocks moved by the storage device, the file
system is prevented from moving the data blocks moved by the storage device again, and the efficiency of the file
system is improved. In addition, invalid blocks in the file
system and the storage device can be synchronized, the situation that
invalid data blocks in the file system are moved when the storage device executes memory
recovery is avoided, and therefore the service life expenditure of the storage device and the write-in amplification value of the storage device are reduced.