A storage space management method, wherein the method is applied to a non-volatile memory, NVM and comprises: obtaining an image feature of data to be written into the NVM; calculating an image feature of each of the M idle blocks in the storage space of the NVM; determining, in a feature set of storage space of the NVM, a first image feature that is most similar to the image feature of the data, wherein M image features obtained according to M idle blocks in the storage space of the NVM are comprised in the feature set, a size of each idle block in the storage space is the same as a size of the data, the idle blocks comprise an invalid data block and an area in which no data is written in the storage space of the NVM, and M is a natural number; and writing the data into an idle block having the first image feature; characterised in that the step of calculating an image feature of each of the M idle blocks in the storage space of the NVM comprises: traversing an idle block i in the storage space of the NVM by using a preset window, and obtaining a local binary pattern LBP eigenvector X i of the idle block i, wherein X i = ( LBP i 1, LBP i 2,..., LBP iN), N is determined according to a size of the idle block i and a size of the preset window, LBP in is an LBP operator corresponding to each preset window in the idle block i, LB P in = ∑ j = 0 J − 1 s j 2 j, J indicates a total quantity of bits obtained after the LBP operator is converted into binary, and S j = 0 or 1; and obtaining an image feature T i of the idle block i according to the LBP eigenvector X i of the idle block i and a ratio P i of 0 to 1 in the idle block i, wherein T i = αX i + βP i, α and β indicate weights, and α + β = 1. obtaining an image feature of data to be written into the NVM; calculating an image feature of each of the M idle blocks in the storage space of the NVM; determining, in a feature set of storage space of the NVM, a first image feature that is most similar to the image feature of the data, wherein M image features obtained according to M idle blocks in the storage space of the NVM are comprised in the feature set, a size of each idle block in the storage space is the same as a size of the data, the idle blocks comprise an invalid data block and an area in which no data is written in the storage space of the NVM, and M is a natural number; and writing the data into an idle block having the first image feature; characterised in that the step of calculating an image feature of each of the M idle blocks in the storage space of the NVM comprises: traversing an idle block i in the storage space of the NVM by using a preset window, and obtaining a local binary pattern LBP eigenvector X i of the idle block i, wherein X i = ( LBP i 1, LBP i 2,..., LBP iN), N is determined according to a size of the idle block i and a size of the preset window, LBP in is an LBP operator corresponding to each preset window in the idle block i, LB P in = ∑ j = 0 J − 1 s j 2 j, J indicates a total quantity of bits obtained after the LBP operator is converted into binary, and S j = 0 or 1; and obtaining an image feature T i of the idle block i according to the LBP eigenvector X i of the idle block i and a ratio P i of 0 to 1 in the idle block i, wherein T i = αX i + βP i, α and β indicate weights, and α + β = 1. traversing an idle block i in the storage space of the NVM by using a preset window, and obtaining a local binary pattern LBP eigenvector X i of the idle block i, wherein X i = ( LBP i 1, LBP i 2,..., LBP iN), N is determined according to a size of the idle block i and a size of the preset window, LBP in is an LBP operator corresponding to each preset window in the idle block i, LB P in = ∑ j = 0 J − 1 s j 2 j, J indicates a total quantity of bits obtained after the LBP operator is converted into binary, and S j = 0 or 1; and obtaining an image feature T i of the idle block i according to the LBP eigenvector X i of the idle block i and a ratio P i of 0 to 1 in the idle block i, wherein T i = αX i + βP i, α and β indicate weights, and α + β = 1.