The invention discloses a preparation method of an N-containing graphdiyne material, wherein the preparation method comprises the steps: by using an N-containing six-membered heterocyclic compound anda metal alkyne compound as raw materials and ethanol as a solvent, carrying out ultrasonic reaction under the condition of ultrasonic frequency of 50-55 kHz, separating after the reaction is finished, washing a collected solid, and drying to obtain the N-containing graphdiyne material. The N-containing graphdiyne material is prepared by adopting an ultrasonic method, taking the N-containing six-membered heterocyclic compound and a metal alkyne compound as raw materials and taking ethanol as a solvent, nitrogen elements in the prepared N-containing graphdiyne material are distributed orderly,and the whole preparation method is simple to operate, mild in condition, green, environment-friendly and relatively low in equipment requirement; besides, experiments show that the N-containing graphdiyne material prepared by the method has excellent hydrogen evolution performance and energy storage performance, effectively promotes the application of the graphdiyne material in the fields of hydrogen evolution materials, supercapacitors, lithium ion battery negative electrode materials and the like, and has a wide industrial application prospect.