In the process of using piezoelectric actuators and sensors to actively control the vibration of flexible structures, the controllability and spillover effect of the system are often the focus of attention, and the location of piezoelectric actuators and sensors is one of the key factors affecting controllability and spillover effect. In this paper, the residual modes are introduced into the location optimization criteria of actuators and sensors, so that the energy can drive as much as possible the eigenmodes that need to be controlled, and avoid driving the residual eigenmodes. At the same time, a modified Multi-Verse Optimizer (MVO) algorithm is used to optimize the location of piezoelectric actuators and sensors. The important results obtained in this paper are compared with the results obtained by the finite element simulation software to verify the accuracy of the relevant derivation results, and the optimization simulation of the position of piezoelectric actuator and the simulation of vibration control are carried out. The simulation results showed that, the MVO algorithm is very suitable for solving the optimization problems that these criteria are non-convex and difficult to derive, and the resulting optimized layout can effectively suppress vibration.