The invention provides a clamping type safety lock with clamping groove upper pins. The clamping type safety lock with clamping groove upper pins comprises a self-locking system, a clamping locking system and a self-locking compensating system, wherein the self-locking system comprises a main lock core, ball-head lower pins and a lock body; the clamping locking system comprises clamping groove upper pins, a clamping groove plate and a clamping bolt, wherein the clamping groove upper pins and the clamping groove plate are arranged on the lock body, the clamping groove upper pins contact the ball-head lower pins, the vertical part of the clamping bolt is connected with the clamping groove plate, the tail end of the horizontal part of the clamping bolt is clamped on the lock body, the tail end of the main lock core is provided with an open groove, and the bent part of the clamping bolt is clamped in the open groove; and the self-locking compensating system comprises an auxiliary lock core with a driven gear, flat-head lower pins, flat-head upper pins and a transmission device, wherein the auxiliary lock core and the flat-head upper pins are arranged on the lock body, the transmissiondevice is fixed on the lock body, the two ends of the transmission device are respectively in contact with the clamping groove upper pins and the flat-head upper pins, the flat-head lower pins are arranged in the auxiliary lock core in a pressed manner through pin compressed springs, the flat-head upper pins and the flat-head lower pins are in contact, and the driven gear is meshed with a drivinggear. The invention has the advantage of simple structure and is applicable to locks.