The invention discloses a preparation method of an intelligent nano-foam oil-displacing agent. By grafting a temperature-sensitive polymer onto magnetic nano particle surfaces, compound nano particleswith the temperature-sensitive property and magnetic response are prepared, and the nano particles have the property of stabilizing foam. The oil-displacing agent has the characteristics that the hydrophilia and lipophilicity of the oil-displacing agent can be adjusted and controlled; when the formation temperature is high, the nano particles show the lipophilicity, and when the foam meets crudeoil, the foam bursts, which is beneficial to peeling the crude oil off a rock stratum surface and improving the recovery ratio; when the temperature is low, the nano particles show the hydrophilia, which is beneficial to separation of oil and water, and through an applied magnetic field, recovery of the nano particles can be fast achieved; moreover, the foam-displacing liquid can respond to the magnetic field, so that through the applied magnetic field, flow of the displacing liquid can be controlled.