Disclosed is a preparation method of a composition containing a nitrogen heterocyclic hexapeptide precursor, composition A and B containing a nitrogen heterocyclic hexapeptide precursor of a compound having formula I and formula II obtained by the method, and an application of the composition used for preparing a compound having formula III.