The invention discloses a railway train anti-collision and anti-rear collision device based on point-to-point precise distance measurement, which includes a self-check module, a first distance measurement module, a second distance measurement module, a first main control module, a second main control module, a second main control module, and a second main control module. An information display module, a second information display module, a first voice broadcast module, a second voice broadcast module, a first sound and light alarm module, a second sound and light alarm module, a first train brake control module, and a second train brake control module A control module, a communication conversion interface and a backup power supply, the output terminals of the backup power supply are respectively connected to the input terminals of the self-test module, the first main control module and the second main control module. The invention can prevent train collisions, prevent front and rear trains from tracking and rear-end collisions, protect key railway facilities, etc., and can provide real-time distance and sensor detection data for railway rolling stock operation tracking, navigation positioning, and intelligent transportation scheduling.