The promotion and popularization of public bicycles can solve the "last mile" problem effectively, and hold great practical significance to the construction of a sustainable green traffic system. Based on the features of the area within the Xi'an City Wall, the coverage requirements and location selection principles, the way to select public bicycle stations is studied. A mathematic model is built accordingly, by solving which the distribution of stations within the selected area can be achieved. By considering the number of parking spaces and the flow of people, the way to allocate bicycles to each station is studied. A linear programming model is established and the number of bicycles can be achieved by simulation.