The invention relates to the technical field of 1,2,4-triazole heterocyclic compounds and discloses application of a 1,2,4-triazole heterocyclic compound in the preparation of drugs to prevent or treat central system related diseases. The 1,2,4-triazole heterocyclic compound [1,2,4]-triazolo-[1,5-a]pyrimidone heterocyclic compound shown as the general formula (I) or 7-alkoxy-1,2,4-triazolo-[1,5-a]pyrimidine heterocyclic compound shown as the general formula (II). The 1,2,4-triazole heterocyclic compound disclosed herein can well inhibit, on cellular models, intracellular calcium ion oscillations and 4-AP induced epilepsy, and on animal models (mouse), has good anti-epilepsy activity and significant calming effect.