With the large-scale distributed energy resources (DERs) interfaced by power electronic converters connected to the power grid, the traditional synchronous generation is gradually replaced, and the inertia and primary frequency regulation capability of the power system is weakened, which seriously threatens the frequency security of the power grid. In view of the above problems, a hierarchical control strategy by coordinating the distributed wind turbine (WT) and photovoltaic (PV) is presented to improve the transient frequency (TF) and steady-state frequency (SSF). For the system control level, the optimal frequency regulation coefficients of multiple WTs and PVs clustering systems are determined by the optimal control principle with minimum frequency regulation energy, while considering the constraints of TF and SSF. For the WT/PV control level, the frequency regulation coefficients of WTs and PVs are solved by the model predictive controller (MPC) and alternating direction method of multipliers (ADMM), with the minimum control cost of WT and PV. It achieves the optimal allocation of frequency regulation power and improves the computing efficiency. Finally, the validity of the proposed method is tested in the modified IEEE 10-machine 39-bus system.