The invention provides a preparation method and an application method of nitrogen-doped porous carbon based on straw hydrothermal carbonization. The preparation method comprises the following steps: 1, crushing a biomass raw material rice straw, screening, and drying in a 105 DEG C blast drying oven for 12 hours; 2, carrying out hydrothermal treatment on the crushed rice straw, naturally cooling to room temperature after the reaction is finished, carrying out suction filtration, washing with absolute ethyl alcohol and ultrapure water to remove impurities, and drying to obtain brownish black straw hydrothermal carbon; 3, mixing the straw hydrothermal carbon, an activating agent and melamine according to a certain mass ratio, and fully grinding in a mortar; and 4, putting the ground mixtureinto a tubular furnace, carrying out high-temperature activation in an inert gas atmosphere, naturally cooling to room temperature, and carrying out acid washing, water washing and drying on the obtained material to obtain the nitrogen-doped straw hydrothermal carbon-based porous carbon for the supercapacitor. The method comprises the following steps: A, a working electrode preparation method; andB, a supercapacitor preparation method.