The electronic structure parameters (such as the structure energy, atomic binding energy of α-Mg and α-Zr phase; the interface energy of Mg/Zr; the surface energy of Mg; the interacting energy between Zr atoms or impurity atoms; the density of state and the charge variety of Mg and Zr in auoys) were calculated by recursion method. The calculated results show that: the shape of the density of states of Zr is different from Mg in the cryctal grain, but is similar to the Mg at the Mg/Zr interface, which means the electronic structure environment of the interface of Mg/Zr is similar for Zr and Mg, which provides the condition for Mg to nucleate on the surface of Zr. The structure energy and the atomic binding energy of α-Zr phase are lower than that of α-Mg, and the interface energy of Mg/Zr is lower than the surface energy of Mg. This explains from energy point of view the experiment phenomenon that Zr precipitates from Mg liquid before α-Mg solidifies, and it acts as good centers for heterogeneous nucleation to refine α-Mg grains. The interacting energy between atoms indicated that Zr atoms attracts each other, so they can form Zr atom clusters in Mg easily, and may combine with impurity atoms to form compounds, which will weaken the effect of the refinement of Mg grains. But it cleans the Mg alloys and improves the performances of Mg alloys. The charge transfer between Mg and Zr produces the ionic bond, which reduces the coefficient of diffusion of Mg. This makes the growing of α-Mg grain difficult, and leads to the refinement of α-Mg grain.