At present, IED (Intelligent Electronic Device) virtual terminal connection is mainly manual connection. Due to the large number of virtual terminals and high similarity of names, the workload of IED virtual terminals is large, the efficiency is low and error-prone. Automatic connection method of virtual terminals based on firework algorithm for calculating distance weight similarity of Levinstein. This method is based on the established Levinstein distance similarity model, calculates the virtual terminal similarity, establishes a distance weight vector optimization model, uses the completed virtual connection information of other smart substations, and uses the firework algorithm to train the optimal distance weight vector. The virtual terminal of the IED to be matched is successfully connected. Simulation examples show that this method uses the completed IED virtual connection information to automatically and efficiently connect the IED virtual terminals to be matched. Can effectively improve the efficiency and reliability of smart substations.