A computer-implemented method, comprising: moving a robot (202; 300) from an initial position to a docking position, wherein the robot (202; 300) captures images of surroundings of the robot (202; 300) when generating an environment map, wherein the robot (202; 300) at the docking position faces a charging interface of a charging pile, and the docking position is determined based on a position of the charging pile identified by means of images captured by the robot (202; 300) in real time; and moving the robot (202; 300) from the docking position to a charging position along a first path such that the robot (202; 300) is docked to the charging pile at the charging position, wherein the first path is a straight-line or approximately straight-line path, and wherein, during the course of traveling along the first path, the robot (202; 300) maintains a docking pose and the charging pile is identifiable in the images captured by the robot (202; 300) in real time, wherein the docking pose of the robot is maintained by enabling a charging socket of the robot (202; 300) to face the charging interface of the charging pile; and wherein the step of moving the robot from the initial position to the docking position further comprises: moving the robot (202; 300) from the initial position to a boundary of a transit area along a second path, wherein the second path is planned by the robot (202; 300) at the initial position, wherein the transit area is preset in the environment map when the environment map is generated, and the transit area is defined as an area in which each image captured by the robot (202; 300) when generating the environment map includes the charging pile; and moving the robot (202; 300) from the boundary of the transit area to the docking position along a third path, wherein the third path is adjusted in real time based on the images captured by the robot (202; 300) in real time. moving a robot (202; 300) from an initial position to a docking position, wherein the robot (202; 300) captures images of surroundings of the robot (202; 300) when generating an environment map, wherein the robot (202; 300) at the docking position faces a charging interface of a charging pile, and the docking position is determined based on a position of the charging pile identified by means of images captured by the robot (202; 300) in real time; and moving the robot (202; 300) from the docking position to a charging position along a first path such that the robot (202; 300) is docked to the charging pile at the charging position, wherein the first path is a straight-line or approximately straight-line path, and wherein, during the course of traveling along the first path, the robot (202; 300) maintains a docking pose and the charging pile is identifiable in the images captured by the robot (202; 300) in real time, wherein the docking pose of the robot is maintained by enabling a charging socket of the robot (202; 300) to face the charging interface of the charging pile; and wherein the step of moving the robot from the initial position to the docking position further comprises: moving the robot (202; 300) from the initial position to a boundary of a transit area along a second path, wherein the second path is planned by the robot (202; 300) at the initial position, wherein the transit area is preset in the environment map when the environment map is generated, and the transit area is defined as an area in which each image captured by the robot (202; 300) when generating the environment map includes the charging pile; and moving the robot (202; 300) from the boundary of the transit area to the docking position along a third path, wherein the third path is adjusted in real time based on the images captured by the robot (202; 300) in real time. moving the robot (202; 300) from the initial position to a boundary of a transit area along a second path, wherein the second path is planned by the robot (202; 300) at the initial position, wherein the transit area is preset in the environment map when the environment map is generated, and the transit area is defined as an area in which each image captured by the robot (202; 300) when generating the environment map includes the charging pile; and moving the robot (202; 300) from the boundary of the transit area to the docking position along a third path, wherein the third path is adjusted in real time based on the images captured by the robot (202; 300) in real time.