Length Extrapolation of Transformers: A Survey from the Perspective of Position Encoding