A method for preparing an anti-coking nanocrystalline material based on a stainless steel surface, characterized in that the method comprises the following steps: chemically degreasing and etching with alkali a stainless steel surface using a sodium hydroxide solution and a solution containing an alkali etching additive, wherein the temperature of the above solutions is controlled at 80-85°C, the treatment is performed for 10-15 min, followed by washing cyclically with water, the washing cyclically with water is performed by using water with a temperature of 80-85°C, the time for the washing is 3-5 minutes; oxidizing the stainless steel surface treated in the step by an oxidizing solution, followed by washing with water, the oxidizing solution contains 200-300 g/L of CrO 3, at 75-90 °C, the pH of the oxidizing solution is adjusted to 0.4-1.5 by adding a H 2 SO 4 solution, the concentration of the H 2 SO 4 solution is 98%, the time for oxidizing is 15-35 minutes; immersing the stainless steel surface treated in the step as a cathode in an electrolyte to electrolyze, followed by washing with water, the electrolyte contains 100-150 g/L of CrO 3, 80-100 g/L of Na 2 SiO 3, 15-20 g/L of nano silicon nitride, 3-5 g/L of nano silicon carbide; the pH of the electrolyte is adjusted to 0.5-1.5 by adding a H 2 SO 4 solution, the temperature is controlled at 40-52°C, the stainless steel piece is taken as cathode, the current for electrolyzing is direct current; the initial current intensity is 40-42 A/m 2, and the electrolysis is performed for 10-25 min, and then the current intensity is gradually reduced to 4A/m 2 according to the formula i=3+30/t, wherein i is current intensity and t is time, after electrolyzing for 14-18 min, the final current is controlled at 4-6A/m 2; the washing is performed for 3-5 min at 25-40°C under a pH of > 3; placing the stainless steel surface treated in the step at a temperature of 50-60 °C and a humidity of 60-70%, and then placing at a temperature of 35-40 °C and a humidity of 40-50% for hardening, the performed time for hardening treatment by placing twice is respectively 3-5 hours and 48-72 hours; the anti-coking nanocrystalline material contains, expressed in percentage by weight, 0-3% of carbon, 23-38% of oxygen, 38-53% of chromium, 10-35% of iron, 0-2% of molybdenum, 0-4% of nickel, 3.5-5% of silicon, 0-1% of calcium with the balance being impurity elements. chemically degreasing and etching with alkali a stainless steel surface using a sodium hydroxide solution and a solution containing an alkali etching additive, wherein the temperature of the above solutions is controlled at 80-85°C, the treatment is performed for 10-15 min, followed by washing cyclically with water, the washing cyclically with water is performed by using water with a temperature of 80-85°C, the time for the washing is 3-5 minutes; oxidizing the stainless steel surface treated in the step by an oxidizing solution, followed by washing with water, the oxidizing solution contains 200-300 g/L of CrO 3, at 75-90 °C, the pH of the oxidizing solution is adjusted to 0.4-1.5 by adding a H 2 SO 4 solution, the concentration of the H 2 SO 4 solution is 98%, the time for oxidizing is 15-35 minutes; immersing the stainless steel surface treated in the step as a cathode in an electrolyte to electrolyze, followed by washing with water, the electrolyte contains 100-150 g/L of CrO 3, 80-100 g/L of Na 2 SiO 3, 15-20 g/L of nano silicon nitride, 3-5 g/L of nano silicon carbide; the pH of the electrolyte is adjusted to 0.5-1.5 by adding a H 2 SO 4 solution, the temperature is controlled at 40-52°C, the stainless steel piece is taken as cathode, the current for electrolyzing is direct current; the initial current intensity is 40-42 A/m 2, and the electrolysis is performed for 10-25 min, and then the current intensity is gradually reduced to 4A/m 2 according to the formula i=3+30/t, wherein i is current intensity and t is time, after electrolyzing for 14-18 min, the final current is controlled at 4-6A/m 2; the washing is performed for 3-5 min at 25-40°C under a pH of > 3; placing the stainless steel surface treated in the step at a temperature of 50-60 °C and a humidity of 60-70%, and then placing at a temperature of 35-40 °C and a humidity of 40-50% for hardening, the performed time for hardening treatment by placing twice is respectively 3-5 hours and 48-72 hours;