A lock device is disclosed, which includes: a holder which is provided with a through hole running through the holder and a slide intersecting with the through hole; a guide bar, which is provided with an outer threaded area on at least a portion of a surface and passes through the through hole, and the outer threaded area is located where the through hole intersects with the slide; a lock component received in the slide, and the end of the lock component facing toward the guide bar is provided with a lock threaded area which can engage with the outer threaded area of the guide bar; and a drive assembly which drives a lock assembly to move toward or away from the guide bar in the slide. The guide bar is locked when threads on the lock threaded area engage with outer threads on the outer threaded area.