The study established the SPH method calculation model of smooth particle hydrodynamics for magnesium alloy die-casting filling process based on pure Lagrangian description, introduced the Monaghan boundary model to establish the boundary conditions of the cavity wall, and satisfied the boundary conditions of inflow by dividing the inflow area particles and fluid particles. On this basis, the establishment of surface tension model program, through the square droplet rounding calculations, bubble uplift case and underwater side injection square cavity simulation calculations, to verify the SPH method calculation of magnesium alloy die casting filling gas-biphasic flow simulation correctness. Findings derived from the computed data indicate that when the calculation time is at 0.37s, 0.58s and 1.65s, the outcomes show strong agreement with the experimental measurements, and the computed results align closely with the experimental data, thereby confirming the validity of the gas-liquid dual-phase flow framework of the SPH filling model. Comparing the injection outcomes against the simulation results, it is found that the pressure injection velocity exerts a notable influence on the mold-filling duration as well as cavity filling degree, and the faster the pressure injection speed is, the shorter the filling time is. The study provides theoretical basis and technical support for the deep understanding of magnesium alloy die casting filling flow mechanism and refinement of the die-casting process parameters to enhance the quality of magnesium alloy die casting products.