The present invention discloses a class of novel macro-heterocyclic compounds represented by the formula Ia or Ib, and their intermediates, preparation methods and the uses. The macro-heterocyclic compounds of the present invention have good inhibitory activities against hepatitis C virus (HCV), and can be used to treat HCV infection effectively by its excellent inhibition against HCV, low toxicity and side effects.