The problem of posture instability caused by a quadruped robot in the transition process of a dynamic gait on a variable stiffness ground. A real-time adjustment strategy for the active variable stiffness of the robot’s legs is proposed. This strategy is based on the robot’s body and legs after landing on the ground. The motion state estimates the coupling stiffness between the ground leg and the ground in real time, and compensates the difference in the coupling stiffness between the front and rear legs and the ground to the corresponding ground leg. This strategy can make the robot quickly adapt to the ground with different stiffness characteristics after landing, especially when the ground stiffness changes greatly, and at the same time, it can ensure that the control performance is better than the stable control method that uses the body attitude feedback alone. This posture adjustment strategy was simulated and verified by building the Simulink- SimMechanics experimental platform. The results showed that the quadruped robot can realize the pitch and roll angle of the fuselage during the transition between soft and hard ground through the real-time adjustment of the active variable stiffness of the legs. The control strategy proved to be effective.