A stampede preventing method for a pedestrian passage in a confined space of a subway, characterized by comprising the following steps: a. arranging pedestrian flow sensors on a pedestrian passage, wherein the pedestrian flow sensors are connected to a control unit by means of data transmission lines, the control unit is connected to stampede preventing devices by means of data transmission lines, and top ends of the stampede preventing devices are connected to movable walls and handrails; b. transmitting, by the pedestrian flow sensors, a pedestrian number and crowdedness that are monitored in real time on the pedestrian passage to the control unit by means of the data transmission lines during operation; c. analyzing, by the control unit, signals of the pedestrian flow sensors according to a system program, judging the level of pedestrian crowdedness on the ground, and judging, according to the level of pedestrian crowdedness, whether crescent buffer space areas need to be opened in the passage; d. if it is determined, according to the data monitored by the pedestrian flow sensors, that it is crowded and a stampede accident possibly occurs, issuing, by the control unit, different expansion commands according to different degrees of crowdedness; and e. after receiving the commands of the control unit, controlling, by the stampede preventing devices, the movable walls and the handrails to start contracting, so that two originally parallel walls are recessed toward both sides to form the crescent buffer space areas, and then the maximum bearable pedestrian flow of the passage is instantaneously increased and stampede accidents are prevented. a. arranging pedestrian flow sensors on a pedestrian passage, wherein the pedestrian flow sensors are connected to a control unit by means of data transmission lines, the control unit is connected to stampede preventing devices by means of data transmission lines, and top ends of the stampede preventing devices are connected to movable walls and handrails; b. transmitting, by the pedestrian flow sensors, a pedestrian number and crowdedness that are monitored in real time on the pedestrian passage to the control unit by means of the data transmission lines during operation; c. analyzing, by the control unit, signals of the pedestrian flow sensors according to a system program, judging the level of pedestrian crowdedness on the ground, and judging, according to the level of pedestrian crowdedness, whether crescent buffer space areas need to be opened in the passage; d. if it is determined, according to the data monitored by the pedestrian flow sensors, that it is crowded and a stampede accident possibly occurs, issuing, by the control unit, different expansion commands according to different degrees of crowdedness; and e. after receiving the commands of the control unit, controlling, by the stampede preventing devices, the movable walls and the handrails to start contracting, so that two originally parallel walls are recessed toward both sides to form the crescent buffer space areas, and then the maximum bearable pedestrian flow of the passage is instantaneously increased and stampede accidents are prevented.