A method for clustering, the method comprising: vectorizing a plurality of readable files to obtain a plurality of file vectors each corresponding to a respective one of the readable files and having a series of numbers, each number representing a value corresponding to a characteristic of the respective one of the readable files; obtaining a total characteristic vector based on the file vectors, wherein obtaining the total characteristic vector based on the file vectors comprises, for each characteristic of the readable files, summing the respective values of the file vectors to obtain a corresponding characteristic value of the total characteristic vector; and clustering the readable files based on a ranking result of a respective similarity degree between the total characteristic vector and each of the file vectors; characterized in that the method further comprises: obtaining a representative vector for each class of a plurality of classes of the readable files according to the clustering of the readable files; constructing a new characteristic vector satisfying a preset condition; calculating a respective first similarity degree between the representative vector of each class and the new characteristic vector; performing a first ranking of each class of the readable files according to the first similarity degrees; calculating a respective second similarity degree between the representative vector of each class and a representative vector of a last class after the first ranking; performing a second ranking of the representative vectors after the first ranking according to the second similarity degrees; and re-clustering the classes of the readable files according to the representative vectors after the second ranking. vectorizing a plurality of readable files to obtain a plurality of file vectors each corresponding to a respective one of the readable files and having a series of numbers, each number representing a value corresponding to a characteristic of the respective one of the readable files; obtaining a total characteristic vector based on the file vectors, wherein obtaining the total characteristic vector based on the file vectors comprises, for each characteristic of the readable files, summing the respective values of the file vectors to obtain a corresponding characteristic value of the total characteristic vector; and clustering the readable files based on a ranking result of a respective similarity degree between the total characteristic vector and each of the file vectors; characterized in that the method further comprises: obtaining a representative vector for each class of a plurality of classes of the readable files according to the clustering of the readable files; constructing a new characteristic vector satisfying a preset condition; calculating a respective first similarity degree between the representative vector of each class and the new characteristic vector; performing a first ranking of each class of the readable files according to the first similarity degrees; calculating a respective second similarity degree between the representative vector of each class and a representative vector of a last class after the first ranking; performing a second ranking of the representative vectors after the first ranking according to the second similarity degrees; and re-clustering the classes of the readable files according to the representative vectors after the second ranking. obtaining a representative vector for each class of a plurality of classes of the readable files according to the clustering of the readable files; constructing a new characteristic vector satisfying a preset condition; calculating a respective first similarity degree between the representative vector of each class and the new characteristic vector; performing a first ranking of each class of the readable files according to the first similarity degrees; calculating a respective second similarity degree between the representative vector of each class and a representative vector of a last class after the first ranking; performing a second ranking of the representative vectors after the first ranking according to the second similarity degrees; and re-clustering the classes of the readable files according to the representative vectors after the second ranking.