A method of preparing heteroatom doped multifunctional carbon quantum dots from a precursor comprising a conjugated polymer having at least one heteroatom selected from the group consisting of O, N, S, Si, Se, P, As, Ge, Gd, B, Sb and Te with different functional groups on the surface thereof, wherein the method comprises the steps of: 1) adding to the conjugated polymer, 0-1 M aqueous solution of acids or bases with the mass of 0.01-1000 times as many as the mass of the conjugated polymer, mixing uniformly and obtaining a reaction solution; 2) heating the reaction solution up to 100 °C -500 °C, and reacting for 1-48 hours; 3) cooling after the reaction, collecting the reaction solution, separating and purifying to obtain heteroatom doped multifunctional carbon quantum dots; wherein the conjugated polymer is one or more selected from the group consisting of the conjugated polymers with following structural formula: wherein: in the structural formula of PT, m, n and k are natural numbers in range of 0-10000, while m, n and k do not represent 0 simultaneously; in the structural formulas of PPV1, PF and PPP1, n is a natural number in range of 1-10000; wherein: Ar 1 is furan, thiophene, selenophene, pyrrole, pyridine, benzene, naphthalene, anthracene, pyrene, indole, coumarin, fluorescein, carbazole, rhodamine, cyano dyes, fluorene or quinoline; wherein: Ar 2 is one of following structural formulas: wherein: X, Y, Q, E and F respectively or simultaneously independently represent O, N, S, Si, Se, P, As, Ge, Gd, B, Sb, Te, N-R 5 or Si-R 6 R 7 ; wherein: Z, G, R 1 , R 2 , R 3 , R 4 , R 5 , R 6 , R 7 , R 8 , R 9 , R 10 , R 11 , R 12 , R 13 , R 14 and R 15 respectively or simultaneously independently represent hydrogen atom, alkyl group of 1-18 carbon atoms, hydroxyl group, mercapto group, carboxyl group, amino group, amide, acid anhydride, cyano group, alkenyl, alkynyl, aryl group, ester group, ether group, quaternary ammonium salt, sulfonate, phosphate or polyethylene glycol group. 1) adding to the conjugated polymer, 0-1 M aqueous solution of acids or bases with the mass of 0.01-1000 times as many as the mass of the conjugated polymer, mixing uniformly and obtaining a reaction solution; 2) heating the reaction solution up to 100 °C -500 °C, and reacting for 1-48 hours; 3) cooling after the reaction, collecting the reaction solution, separating and purifying to obtain heteroatom doped multifunctional carbon quantum dots; in the structural formula of PT, m, n and k are natural numbers in range of 0-10000, while m, n and k do not represent 0 simultaneously; in the structural formulas of PPV1, PF and PPP1, n is a natural number in range of 1-10000; wherein: Ar 1 is furan, thiophene, selenophene, pyrrole, pyridine, benzene, naphthalene, anthracene, pyrene, indole, coumarin, fluorescein, carbazole, rhodamine, cyano dyes, fluorene or quinoline; wherein: Ar 2 is one of following structural formulas: wherein: X, Y, Q, E and F respectively or simultaneously independently represent O, N, S, Si, Se, P, As, Ge, Gd, B, Sb, Te, N-R 5 or Si-R 6 R 7 ; wherein: Z, G, R 1 , R 2 , R 3 , R 4 , R 5 , R 6 , R 7 , R 8 , R 9 , R 10 , R 11 , R 12 , R 13 , R 14 and R 15 respectively or simultaneously independently represent hydrogen atom, alkyl group of 1-18 carbon atoms, hydroxyl group, mercapto group, carboxyl group, amino group, amide, acid anhydride, cyano group, alkenyl, alkynyl, aryl group, ester group, ether group, quaternary ammonium salt, sulfonate, phosphate or polyethylene glycol group. <EOS>