The invention discloses a method for preparing a cobalt-based alloy layer on a surface of a TC4 titanium alloy and belongs to the field of titanium alloy surface processing. The method comprises that (1), a test sample is prepared; (2) the test sample is arranged on a working platform of a furnace, and a vacuum chamber is sealed; (3) a vacuum pump is opened, the inner portion of the furnace is pumped to the final vacuum, argon is filled, the inner portion of the furnace is pumped to the final vacuum again, and so repeats for 4-6 times; (4), argon is filled to 15-19Pa, cooling water is turned on, a sample power supply is switched on, and a sample is subjected to preliminary bombardment; (5), after the preliminary bombardment, the pressure is adjusted to the working air pressure, the source electrode voltage and the cathode voltage are adjusted to a preset value, and heat preservation is started; (6), after heat preservation is conducted for 1-2.5 hours, a source electrode power supply is turned off, the pressure is adjusted to 18-20Pa, the cathode voltage is reduced to 250-280V, and glow protection cooling is conducted; and (7), the air source and the cathode power supply are turned off, the inner portion of the furnace is pumped to the final vacuum again, and discharge is achieved after cooling. According to the method, a best parameter of a process when cobalt is infiltered into the surface of the titanium alloy can be determined, so that the high-temperature oxidation resistance of the titanium alloy is improved.