Pilot pattern has an important impact on the performance of channel estimation based on compressed sensing. However, due to the limitations of time and space, the traditional enumeration methods and existing heuristic methods have some limitations in practical application. This paper proposes an enhanced butterfly optimization algorithm (EBOA) to solve this problem. EBOA is based on the butterfly optimization algorithm (BOA). In view of the problems that the BOA algorithm is prone to local optimal and slow convergence speed, EBOA improves the optimization efficiency and robustness by introducing the optimization strategy of good point set, designing adaptive switching probability and t-distribution variation factor, and applies it to pilot pattern optimization. Experiments show that compared with butterfly optimization algorithm (BOA), estimation of distribution algorithm (EDA), Particle swarm optimization (PSO), salp swarm algorithm (SSA), the EBOA algorithm proposed in this paper can generate a measurement matrix with less cross-correlation, and the corresponding optimized pilot mode is better than other methods in bit error rate and mean square error.