A lock device adapted for a first object and a second object movable relative to the first object, the lock device comprising: a slider; a driving module configured to drive the slider to move between a locking position and an unlocking position; a latch movably arranged on the slider; and a power module configured to provide electricity to the driving module; wherein when the second object is located at a retracted position relative to the first object, the driving module is configured to drive the slider to move to the locking position, so that the latch is able to block the second object; wherein when the driving module is not driven by the power module in a situation where there is a power failure or a damage of an electronic component, the latch is able to be driven by a movement of the second object to a predetermined position in an opening direction to move from an original state to a non-original state for driving the slider to move from the locking position to the unlocking position; wherein the driving module comprises a magnetic component configured to retain the slider at the unlocking position when the slider is located at the unlocking position; the lock device is characterized by a resilient component, such that when the slider is retained at the unlocking position in the situation where there is the power failure or the damage of the electronic component, a movement of the second object from the predetermined position in a retracted direction is able to cause the latch to move from the non-original state to the original state in response to a resilient force provided by the resilient component for allowing the second object to move to an extended position in the opening direction. a slider; a driving module configured to drive the slider to move between a locking position and an unlocking position; a latch movably arranged on the slider; and a power module configured to provide electricity to the driving module; wherein when the second object is located at a retracted position relative to the first object, the driving module is configured to drive the slider to move to the locking position, so that the latch is able to block the second object; wherein when the driving module is not driven by the power module in a situation where there is a power failure or a damage of an electronic component, the latch is able to be driven by a movement of the second object to a predetermined position in an opening direction to move from an original state to a non-original state for driving the slider to move from the locking position to the unlocking position; wherein the driving module comprises a magnetic component configured to retain the slider at the unlocking position when the slider is located at the unlocking position; the lock device is characterized by a resilient component, such that when the slider is retained at the unlocking position in the situation where there is the power failure or the damage of the electronic component, a movement of the second object from the predetermined position in a retracted direction is able to cause the latch to move from the non-original state to the original state in response to a resilient force provided by the resilient component for allowing the second object to move to an extended position in the opening direction.