The invention provides a ruthenium (II)-polypyridine complex. For the ruthenium (II)-polypyridine complex, bipyridyl (bpy) or phenanthroline hydrate (phen) is used as an ancillary ligand, and dipyridine[3,2-a:2',3'-c]phenazine-11,12-imidazole (dppzi) is used as a main ligand. The preparation method comprises the following steps: preparing 5,6-dinitrobenzimidazole from 5,6-nitrobenzimidazole; reducing 5,6-dinitrobenzimidazole into 5,6-diaminobenzimidazole by using hydrazine hydrate and palladium/carbon; preparing dppzi from phenanthroline hydrate-5,6-dione and 5,6-diaminobenzimidazole and preparing cis-[Ru(bpy)2Cl2].2H2O from ruthenium trichloride, bpy and lithium chloride; preparing cis-[Ru(phen)2Cl2].3H2O from ruthenium trichloride, phen and lithium chloride; carrying out a heating reflux reaction on dppzi and cis-[Ru(bpy)2Cl2].2H2O or cis-[Ru(phen)2Cl2].3H2O under the protection of argon, carrying out cooling, adding ammonium hexafluorophosphate, allowing precipitate to deposit and carrying out filtration and column chromatography so as to obtain a target product. The ruthenium (II)-polypyridine complex provided in the invention can be used as an optical switch for G-quadruplex DNA molecules.