In order to overcome the problem that abnormal data in optical networks affect the quality of data transmission and result in the loss of data information. In this paper, a new high-precision method for abnormal data recognition in an optical network based on data mining is proposed. The acquisition system is used to collect data in the optical network, and photoelectric conversion is carried out. The collected data are filtered and processed by a filter. A segmentation method is used to extract the sequence features of the data. A distance method is used to complete feature matching to realise the recognition of abnormal data in the optical network. The experimental results show that, compared with the three traditional methods for abnormal data recognition in optical networks, the proposed method has higher recognition accuracy and speed, which can detect abnormal data in optical networks quickly and accurately, and ensure the quality of data transmission.