The invention provides a method for welding a thin-walled cylinder with a magnet sleeved inside in a seal housing component. The welding efficiency of the aluminum alloy thin-walled seal housing component can be obviously improved through the method, quality is stable, a connector is bright, fusion is even, and continuous and compact welding beads can be formed. According to the technical scheme, the method comprises the following steps that the butt joint positions of inner and outer housing welding joints are closely attached through a clamp, and annular welding joint pulse electron beam tack welding is carried out on the circumferential seam crossing of an assembled component; a deflection distance occurring to an electron beam caused by Lorentz force is compensated by an electron beam deflection angle; the total heat input amount of the electron beam is controlled with the impulse waveform of the pulse electron beam, the impulse waveform is steep in the front and gentle in the back, and welding is carried out through heat generated when beam flow ascends and descends; under the condition that small pulse power is set and steam pressure is reduced, a pulse back edge is prolonged by 3-5s, slow reduction is carried out, the focal position of the electron beam is adjusted to be within the range 0.55mm below the surface of a workpiece, the surface of a connector to be welded is melted and integrally welded, and the continuous welding beads are formed.