There are disadvantages such as low efficiency and poor precision in the mechanical parameter inversion of the dam body and foundation displacement using measured data. Through the parallel improvement of whale optimization algorithm and the introduction of weighting factor strategy, combined with the finite element calculation, a mechanical parameter inversion method based on the improved whale algorithm is proposed. This method is used to invert the elastic modulus of a concrete gravity dam body and foundation, and then the results were compared with those of the particle swarm optimization. It is found that the improved whale optimization algorithm takes less time than particle swarm optimization under the same iteration times, and the mechanical parameters obtained through the improved whale optimization algorithm are more accurate than those through the particle swarm optimization. It indicates that the computation time can be greatly reduced by using multi-core processors for parallel computation. The mechanical parameter inversion method based on the improved whale optimization algorithm has the advantages of strong searching ability, fast convergence speed and high precision, which is practical and feasible, and can be applied to the mechanical parameter inversion of concrete arch dams and other dam types.