Bean Optimization Algorithm (BOA) is a kind of swarm intelligence algorithm constructed by the principles of natural seed propagation and population distribution evolution. Its bionic significance is clear and computational efficiency is high. In order to improve the diversity of BOA global search and enhance the performance of fine search, a bean optimization algorithm based on Lévy flight (LBOA) was proposed. LBOA introduces the Lévy flight mechanism into the offspring population distribution module of the BOA, which perturbs different positions of a certain proportion of individuals. By setting a larger Lévy flight step weight in the early and middle stages of BOA evolution, the global search ability and convergence speed of BOA are improved. In the fine search stage of BOA evolution, setting a smaller Lévy flight step weight improves the fine search performance of BOA. Finally, through comparative experiments with other mainstream swarm intelligence algorithms, it is shown that LBOA has better optimization performance.