A method for controlling a robot, comprising: obtaining (S101) a target action of the robot; obtaining (S102) environment information of a working environment where the robot is located, wherein the environment information comprises ground material information and obstacle information of an obstacle; determining (S103) a target work area of the robot based on the environment information and the target action; and controlling (S104) the robot to move in the target work area based on the target action; characterized in that , determining the target work area of the robot comprises: determining (S201) an operable level of the working environment where the robot is located based on the ground material information, wherein the operable level is used to characterize a level that a current ground environment is suitable for robot stepping or action; determining (S202) a distance between the robot and an obstacle based on the obstacle information; in response to the target action being a moving action, determining a polyhedron corresponding to a torso body of the robot as an action area required for the target action; in response to the target action being a non-moving action, determining a space area covered when the robot performs the target action as the action area required for the target action; and determining (S204) the target work area based on the operable level, the distance, and the action area. obtaining (S101) a target action of the robot; obtaining (S102) environment information of a working environment where the robot is located, wherein the environment information comprises ground material information and obstacle information of an obstacle; determining (S103) a target work area of the robot based on the environment information and the target action; and controlling (S104) the robot to move in the target work area based on the target action; characterized in that , determining the target work area of the robot comprises: determining (S201) an operable level of the working environment where the robot is located based on the ground material information, wherein the operable level is used to characterize a level that a current ground environment is suitable for robot stepping or action; determining (S202) a distance between the robot and an obstacle based on the obstacle information; in response to the target action being a moving action, determining a polyhedron corresponding to a torso body of the robot as an action area required for the target action; in response to the target action being a non-moving action, determining a space area covered when the robot performs the target action as the action area required for the target action; and determining (S204) the target work area based on the operable level, the distance, and the action area. determining (S201) an operable level of the working environment where the robot is located based on the ground material information, wherein the operable level is used to characterize a level that a current ground environment is suitable for robot stepping or action; determining (S202) a distance between the robot and an obstacle based on the obstacle information; in response to the target action being a moving action, determining a polyhedron corresponding to a torso body of the robot as an action area required for the target action; in response to the target action being a non-moving action, determining a space area covered when the robot performs the target action as the action area required for the target action; and determining (S204) the target work area based on the operable level, the distance, and the action area. <EOS>