A Jock device for a sliding door, comprising an outer handle fixed on an outside surface of the sliding door, wherein the outer handle is connected to a door lock switching mechanism provided inside the sliding door via a cable, the door lock switching mechanism is connected to a lock body via an unlocking lever/string, and the outer handle opens the lock body through the cable, the door lock switching mechanism and the unlocking lever/string sequentially; wherein a side of the outer handle that is inside the sliding door is provided with a cantilever extending in the horizontal direction, one end of the cable is fixed on the cantilever, and the other end of the cable is connected to the door lock switching mechanism provided on a bracket, the direction in which the cable is subject to force is perpendicular to the fixed end of the cable on the cantilever, and the bracket is fixed inside the sliding door; wherein the door lock switching mechanism comprises an outer switching element and a lock body switching element which rotate around a pin shaft independently, the pin shaft is provided on the bracket, one end of the outer switching element is provided with a first cantilever on which a positioning groove is disposed, and the end of the cable connected to the door lock switching mechanism is snap-fit in the positioning groove, one end of a first restoring spring is fixed on the bracket, and the other end of the first restoring spring is connected to the outer switching element to restore it, the lock body switching element is connected to the lock body by means of the unlocking lever/string disposed horizontally, the outer handle opens the lock body through the cable, the outer switching element, the lock body switching element and the unlocking lever/string sequentially; wherein the door lock switching mechanism further comprises an inner switching element which is disposed coaxially with the outer switching element and the lock body switching element, and the inner switching element is connected to an inner handle, one end of a second restoring spring is fixed on the bracket, and the other end of the second restoring spring is connected to the inner switching element to restore it, the inner handle opens the lock body through the inner switching element, the lock body switching element and the unlocking lever/string sequentially; wherein the pin shaft passes through the inner switching element, the outer switching element, the lock body switching element and the body of the bracket sequentially, the outer switching element is provided with a second cantilever, a third cantilever and a fourth cantilever, the lock body switching element is provided with a first cantilever and a second cantilever, an the inner switching element is provided with a first cantilever and a second cantilever; the first cantilever of the inner switching element forms an abutment fit with the second cantilever of the outer switching element and enables the inner switching element to drive the outer switching element to rotate in the same direction, the second cantilever of the inner switching element forms a limiting fit with a limiting hole in the bracket, the third cantilever of the outer switching element forms an abutment fit with the second cantilever of the lock body switching element and enables the outer switching element to drive the lock body switching element to rotate so as to restore it, a limiting stop is provided on the bracket for restoring the fourth cantilever of the outer switching element to original position after the rotation of the fourth cantilever, the fourth cantilever of the outer switching element is connected to the first restoring spring, the first cantilever of the lock body switching element is hinged to the unlocking lever/string, and the third cantilever forms an abutting fit with the limit stop on the bracket for limiting the stroke of the third cantilever, the limited stroke of the second cantilever of the inner switching element enables the moving stroke of the unlocking lever/string to open the lock body. the third cantilever of the outer switching element forms an abutment fit with the second cantilever of the lock body switching element and enables the outer switching element to drive the lock body switching element to rotate so as to restore it, a limiting stop is provided on the bracket for restoring the fourth cantilever of the outer switching element to original position after the rotation of the fourth cantilever, the fourth cantilever of the outer switching element is connected to the first restoring spring, the first cantilever of the lock body switching element is hinged to the unlocking lever/string, and the third cantilever forms an abutting fit with the limit stop on the bracket for limiting the stroke of the third cantilever, the limited stroke of the second cantilever of the inner switching element enables the moving stroke of the unlocking lever/string to open the lock body.