A method for controlling a target device, applied to the target device, the method comprising: acquiring a spatial state of a designated space (101, 201) by at least one designated device; acquiring a sleep state of a user corresponding to the designated space when the spatial state of the designated space indicates presence of the user in the designated space; acquiring an operating mode of the target device corresponding to the spatial state and the sleep state; and controlling the target device to operate according to the operating mode (103, 204); wherein the spatial state comprises a first spatial state indicative of the presence of a human body in the designated space and a second spatial state indicative of the non-presence of a human body in the designated space; characterized in that, acquiring the spatial state of the designated space by at least one designated device comprises at least two of: acquiring location information of a communication device, determining a distance between the communication device and the target device according to the location information of the communication device, and taking the first spatial state as the spatial state of the designated space when the distance between the communication device and the target device is less than a preset distance; taking the first spatial state as the spatial state of the designated space when a designated connection indicator of a routing device is acquired, wherein the designated connection indicator is indicative of connection established between a communication device and the routing device; or taking the first spatial state as the spatial state of the designated space when it is detected that a home device in the designated space is on, wherein the home device comprises at least one of a smart air conditioner, a smart television, a smart washing machine, a smart air cleaner and a smart lamp. acquiring a spatial state of a designated space (101, 201) by at least one designated device; acquiring a sleep state of a user corresponding to the designated space when the spatial state of the designated space indicates presence of the user in the designated space; acquiring an operating mode of the target device corresponding to the spatial state and the sleep state; and controlling the target device to operate according to the operating mode (103, 204); wherein the spatial state comprises a first spatial state indicative of the presence of a human body in the designated space and a second spatial state indicative of the non-presence of a human body in the designated space; characterized in that, acquiring the spatial state of the designated space by at least one designated device comprises at least two of: acquiring location information of a communication device, determining a distance between the communication device and the target device according to the location information of the communication device, and taking the first spatial state as the spatial state of the designated space when the distance between the communication device and the target device is less than a preset distance; taking the first spatial state as the spatial state of the designated space when a designated connection indicator of a routing device is acquired, wherein the designated connection indicator is indicative of connection established between a communication device and the routing device; or taking the first spatial state as the spatial state of the designated space when it is detected that a home device in the designated space is on, wherein the home device comprises at least one of a smart air conditioner, a smart television, a smart washing machine, a smart air cleaner and a smart lamp. acquiring location information of a communication device, determining a distance between the communication device and the target device according to the location information of the communication device, and taking the first spatial state as the spatial state of the designated space when the distance between the communication device and the target device is less than a preset distance; taking the first spatial state as the spatial state of the designated space when a designated connection indicator of a routing device is acquired, wherein the designated connection indicator is indicative of connection established between a communication device and the routing device; or taking the first spatial state as the spatial state of the designated space when it is detected that a home device in the designated space is on, wherein the home device comprises at least one of a smart air conditioner, a smart television, a smart washing machine, a smart air cleaner and a smart lamp.