The invention relates to an elastic optical network modulation format identification method based on KNN. The method comprises the specific steps of (1), constructing training data, sending the training data from a sending end, and through transmission of an OFDM (Orthogonal Frequency Division Multiplexing) transmission system, receiving signals at a receiving end; (2), carrying out FFT on received signals and carrying out channel estimation and channel balancing, thereby obtaining a series of complex data; (3), extracting real parts of the complex data, thereby obtaining a real part histogram, and preprocessing the histogram, thereby obtaining feature vectors; (4), modeling features through utilization of a KNN algorithm and obtaining a classifier; (5), for newly received data, obtainingdata features of each subcarrier, and carrying out prediction classification on the feature vectors through utilization of a KNN classifier, thereby obtaining a modulation format of the subcarrier; and (6), demapping respective carrier data through utilization of the obtained modulation format, and obtaining original data.