An ester polymer having a structure represented by the following formula: wherein the group T represents the backbone of the ester polymer; the group B, same as or different from each other, is each independently selected from O or S, preferably O; the group R, same as or different from each other, each independently represents C 1-10 hydrocarbylene group, preferably C 1-6 linear or branched alkylene group, more preferably C 1-4 linear or branched alkylene group, each group R being optionally substituted by a group selected from alkoxy, hydroxy, amino and mercapto; the group A, same as or different from each other, is each independently selected from O, S or NR", preferably O or S, more preferably O; the group R', same as or different from each other, each independently represents C 1-10 hydrocarbylene group, preferably C 1-6 linear or branched alkylene group, more preferably C 1-4 linear or branched alkylene group, each group R' being optionally substituted by a group selected from alkoxy, hydroxy, amino and mercapto; the group N b, same as or different from each other, is each independently selected from H or -R"'-B'H, wherein at least one of the two N b on the same nitrogen atom is -R"'-B'H, preferably the two N b are each independently -R"'-B'H; the group R", same as or different from each other, is each independently selected from H or C 1-10 hydrocarbyl group, preferably selected from H or C 1-6 linear or branched alkyl group, more preferably selected from H or C 1-4 linear or branched alkyl group, most preferably H; the group R′′′, same as or different from each other, each independently represents C 1-10 hydrocarbylene group, preferably C 1-6 linear or branched alkylene group, more preferably C 1-4 linear or branched alkylene group, each group R′′′ being optionally substituted by a group selected from alkoxy, hydroxy, amino and mercapto; the group B', same as or different from each other, is each independently selected from O or S, preferably O; each y, same as or different from each other, independently represents an integer between 1 and 6, preferably between 1 and 3, most preferably 1; and m is an integer between 1 and 10, preferably between 1 and 5, most preferably 2. the group T represents the backbone of the ester polymer; the group B, same as or different from each other, is each independently selected from O or S, preferably O; the group R, same as or different from each other, each independently represents C 1-10 hydrocarbylene group, preferably C 1-6 linear or branched alkylene group, more preferably C 1-4 linear or branched alkylene group, each group R being optionally substituted by a group selected from alkoxy, hydroxy, amino and mercapto; the group A, same as or different from each other, is each independently selected from O, S or NR", preferably O or S, more preferably O; the group R', same as or different from each other, each independently represents C 1-10 hydrocarbylene group, preferably C 1-6 linear or branched alkylene group, more preferably C 1-4 linear or branched alkylene group, each group R' being optionally substituted by a group selected from alkoxy, hydroxy, amino and mercapto; the group N b, same as or different from each other, is each independently selected from H or -R"'-B'H, wherein at least one of the two N b on the same nitrogen atom is -R"'-B'H, preferably the two N b are each independently -R"'-B'H; the group R", same as or different from each other, is each independently selected from H or C 1-10 hydrocarbyl group, preferably selected from H or C 1-6 linear or branched alkyl group, more preferably selected from H or C 1-4 linear or branched alkyl group, most preferably H; the group R′′′, same as or different from each other, each independently represents C 1-10 hydrocarbylene group, preferably C 1-6 linear or branched alkylene group, more preferably C 1-4 linear or branched alkylene group, each group R′′′ being optionally substituted by a group selected from alkoxy, hydroxy, amino and mercapto; the group B', same as or different from each other, is each independently selected from O or S, preferably O; each y, same as or different from each other, independently represents an integer between 1 and 6, preferably between 1 and 3, most preferably 1; and m is an integer between 1 and 10, preferably between 1 and 5, most preferably 2.