NOVELTY - Preparation of nitrogen-doped carbon aerogel includes preparing trihydroxypyridine solution, adding resorcinol, adding formaldehyde solution until the solution is clear, stirring, adding potassium carbonate solution, stirring, obtaining reaction solution, adding the reaction solution in high-pressure pulsed processing chamber, processing with high-pressure pulsed electric field under stirring condition, standing obtaining aerogel, adding acetone, standing for solution exchange, replacing acetone daily, measuring moisture content, and obtaining trihydroxypyridine-resorcinol-formaldehyde gel.    USE - Preparation of nitrogen-doped carbon aerogel (claimed) used e.g. for supercapacitor, non-metallic electrical catalyst, lithium ion battery, fuel battery and lithium sulfur battery.    ADVANTAGE - The nitrogen-doped carbon aerogel has specific surface area of 500-1000 m2/g and nitrogen content of 3.5-6%.    DETAILED DESCRIPTION - Preparation of nitrogen-doped carbon aerogel comprises at 40-60 degrees C, preparing 30-90 g/L trihydroxypyridine solution, adding resorcinol, adding 35-40 vol.% formaldehyde solution until the solution is clear, stirring for 20-50 minutes, adding 40-60% potassium carbonate solution, stirring for 10-30 minutes, obtaining reaction solution, where mol ratio of trihydroxypyridine and resorcinol is 1:1.5-10, the mol ratio of resorcinol and formaldehyde is 1:1.5-2.5, and the mol ratio of resorcinol and potassium carbonate is 1:100-500, adding the reaction solution in high-pressure pulsed processing chamber, processing with high-pressure pulsed electric field for 60-90 minutes under stirring condition at 50-100 revolutions/minute for 1-3 hours, placing in container for 3-6 days at 40-60 degrees C, obtaining aerogel, adding acetone, standing for solution exchange, replacing acetone daily, measuring moisture content at less than 4000 ppm, obtaining trihydroxypyridine-resorcinol-formaldehyde gel, adding into supercritical carbon dioxide extractor, conducting supercritical carbon dioxide drying, obtaining dry gel, adding xerogel in carbonizing kettle, vacuumizing by filling with inert gas at 5-10 degrees C/minute, raising the temperature to 400-600 degrees C, keeping the temperature for 20-50 minutes, continuously heating at 5-10 degrees C/minute, raising the temperature to 600-850 degrees C, keeping the temperature for 2-3 hours, continuously heating at 5-10 degrees C/minute, raising the temperature to 850-1000 degrees C, keeping the temperature for 1-3 hours, obtaining nitrogen-doped carbon aerogel, adding in rotary furnace, charging carbon dioxide at flow rate of 60-150 ml/minute, simultaneously heating at 400-600 degrees C at 5-10 degrees C/minute, keeping the temperature for 1-3 hours, continuously heating at 5-10 degrees C/minute, raising the temperature to 600-800 degrees C, keeping the temperature for 2-3 hours, continuously heating at 5-10 degrees C/minute, raising the temperature to 800-950 degrees C, keeping the temperature for 2-3 hours, and obtaining the product.