The invention belongs to the technical field of organic electrical storage materials, and discloses a terpolymer of an alkoxy group-containing triphenylamine donor group, an electrical storage device and the preparation thereof. The terpolymer has the following structure, wherein, R is an alkoxy group; R 1 is an alkyl group; m is an integer from 20 to 300; n is an integer from 20 to 300. The electrical storage device includes an organic layer, and the organic layer is the terpolymer; and also includes a substrate, a cathode and an anode. The invention also discloses the preparation method of the terpolymer and the electric storage device. The terpolymer of the invention has strong conjugation degree and hole transport ability, reduces the turn-on voltage, improves the switching current ratio, and improves the storage density, and the copolymer is easy to form a film. The prepared electrical storage device has low turn-on voltage, low energy consumption, high switching current ratio, high resolution, low misread rate, fast response, multiple cycles of reading and writing, and excellent performance.