The transportation infrastructure represented by subway has a significant impact on the location behavior of enterprises,but there is little literature to provide micro evi-dence for the location of enterprises in the city,and its agglom-eration theoretical mechanism needs to be investigated.Based on the monopoly location competition model,this article firstly con-structs an enterprise location selection model containing informa-tion externality and effective market demand,to theoretically an-alyze the location-agglomeration mechanism of service enterpri-ses.Secondly,ArcGIS is used to divide Beijing into 16571 1km × 1km homogeneous spaces,which are matched with the data of newly registered industrial and commercial enterprises in Beijing obtained by Python data mining technology.On this basis,the agglomeration effect and enterprise location mechanism of sub-way opening are empirically tested by using instrumental variable 2SLS method and PSM multi-stage did method,so as to test the theoretical hypothesis.Our results show that the opening of subway increases the agglomeration willingness of service enter-prises by 53.8%.The mechanism test results show that the sub-way promotes the agglomeration of producer services by expan-ding the information externality of innovation activities,and pro-motes the agglomeration of living services by improving the effec-tive market demand.Further research has found that the opening of new subway lines at transfer nodes and non-main urban are-as promotes more service industry enterprises to choose locations along the route,resulting in a higher agglomeration effect of service industry enterprises.