The invention relates to a preparation method of a polyelectrolyte-type crude oil-desalting demulsifier. The preparation method comprises the following specific steps: (1) performing amination modification on methoxypolyethylene glycol; (2) preparing glycidyl dimethyl alkyl ammonium chloride; (3) preparing quaternized carboxyalkyl chitosan; (4) carrying out a reaction between the modified methoxypolyethylene glycol and the quaternized carboxyalkyl chitosan to obtain a target product methoxypolyethylene glycol-grafted quaternized carboxyalkyl chitosan. The polyelectrolyte-type crude oil-desalting demulsifier takes a natural macromolecule chitosan compound as a raw material, and has the advantages of wide sources, naturalness, non-toxicity, sustainability, good product biocompatibility, biodegradability and the like. The prepared demulsifier has good demulsifying and dehydrating effects; a demulsifier molecule contains a large number of carboxyalkyl groups and quaternary ammonium groups, which have very strong capacity of bonding metal cations, negatively-charged ions such as naphthenic acid radicals, and particles with negative charges on the surfaces, so that besides the demulsifying capability, the demulsifier also has the capability of removing oil-soluble salts.