The invention relates to a charging pile with an anti-collision function. The charging pile comprises a body and a sun shield. The body is cylindrical, the sun shield is vertical to the body, the sunshield is fixed to the top of the body, a charging system is arranged in the body, a protection mechanism is arranged on the body, and snow removal mechanisms are arranged on the sun shield. The protection mechanism comprises a bottom plate, a ball and four protection assemblies. The protection assemblies comprise fixing pipes, sealing plates, connecting rods, extruding plates and connecting wires. The snow removal mechanisms comprise first supporting blocks, connecting blocks, magnet blocks, movable rods, second supporting blocks, first springs, second springs and friction pipes, and the connecting blocks are fixed to the ends, away from the sealing plates, of the connecting rods. According to the charging pile with the anti-collision function, the anti-collision function is achieved through the protection mechanism, more than that, the function of removing accumulated snow is achieved through the snow removal mechanisms.