The KNN method is extracted from the technique of pattern recognition for the continuum structure topology optimization design with information functional materials. Original design region is taken as initial sample space, and continuum structure's units are regarded as samples. Unit stress and displacement sensitivity are utilized as feature vector to describe sample, and the feature vectors' Euclidean distance is considered as the recognition standard to classify all the samples. One FEM package is utilized to process the entire optimization. Finally, the topology optimization result is obtained. Several examples are verified under different situations. The results indicate that the KNN method is feasible.