A locking device, adapted for a first object and a second object, wherein the first object and the second object are movable with respect to each other, the locking device comprising: a first element movable between a locking state and an unlocking state; and a second element; wherein the second element is configured to drive the first element and thereby move the first element from the locking state to the unlocking state in response to the second object being displaced with respect to the first object from a retracted position to a predetermined position in an opening direction, wherein the locking device further comprises a locking member that is configured to drive the second element to move the first element from the locking state to the unlocking state, while the second object is being displaced with respect to the first object from the retracted position to the predetermined position in the opening direction, wherein the locking device further comprises a locking hook, wherein the locking hook has a second portion configured to work with a path of the locking member, the locking state is a state in which the path of the locking member is blocked by a second section of the first element such that the second portion of the locking hook is obstructed in the path by the second section of the first element, and the unlocking state is a state in which the path of the locking member is not blocked by the second section of the first element such that the second portion of the locking hook is not obstructed in the path, the second object therefore being allowed to be displaced with respect to the first object to an extended position in the opening direction, thereby causing the second portion of the locking hook to exit the path. a first element movable between a locking state and an unlocking state; and a second element; wherein the second element is configured to drive the first element and thereby move the first element from the locking state to the unlocking state in response to the second object being displaced with respect to the first object from a retracted position to a predetermined position in an opening direction, wherein the locking device further comprises a locking member that is configured to drive the second element to move the first element from the locking state to the unlocking state, while the second object is being displaced with respect to the first object from the retracted position to the predetermined position in the opening direction, wherein the locking device further comprises a locking hook, wherein the locking hook has a second portion configured to work with a path of the locking member, the locking state is a state in which the path of the locking member is blocked by a second section of the first element such that the second portion of the locking hook is obstructed in the path by the second section of the first element, and the unlocking state is a state in which the path of the locking member is not blocked by the second section of the first element such that the second portion of the locking hook is not obstructed in the path, the second object therefore being allowed to be displaced with respect to the first object to an extended position in the opening direction, thereby causing the second portion of the locking hook to exit the path.