Aiming at the different fault characteristics of microgrid during grid-connected operation and independent operation and the bidirectional characteristics of microgrid power flow, a microgrid protection scheme based on improved current phase difference protection is introduced. This scheme uses the voltage at the output terminal of IIDG as the starting criterion and combines The current phase difference criterion at both ends of the bus bar ensures that the microgrid can accurately distinguish between internal and external faults and remove the faulty line in both operating states. An example simulation was carried out on PSCAD/EMTDC simulation software to verify the effectiveness and reliability of the improved current phase difference protection scheme.