On the basis of a self-developed albatross imitation unmanned aerial vehicle (UAV), three different dihedral angle configurations for the wing's mid and outer sections are explored: fixed at -50 degrees, fixed at -5 degrees, and varying arbitrarily between -50 degrees and -5 degrees. By solving the optimal loitering dynamic soaring trajectory optimization problem for each configuration, the effect of dihedral angle variation on the dynamic soaring performance of the bio-inspired wings is investigated. The results indicate that under all three configurations, the UAV achieves energy-neutral flight in specific wind field environments. Compared to the fixed dihedral angle of -5 degrees, the UAV demonstrated superior dynamic soaring performance when the dihedral angle was fixed at -50 degrees. When the dihedral angle varied dynamically, the UAV outperformed both fixed configurations across all relevant parameters. Specifically, compared to the fixed dihedral angle of -5 degrees, the total energy increased by 25.43%, and the minimum required wind gradient decreased by 15.56%. Similarly, compared to the fixed dihedral angle of -50 degrees, the total energy increased by 2.52%, and the minimum required wind gradient decreased by 2.07%. These findings suggest that the use of variable dihedral angle technology in bio-inspired UAV wings can significantly enhance dynamic soaring performance and provide theoretical support for the design of morphing wings with superior dynamic soaring capabilities.