Abstract:[Purposes]In recent years, the pre-warehouse model that can be fully close to customers, flexible, and low in operation and maintenance costs has been favored by fresh food e-commerce companies, and has shown unique advantages especially under the surge in demand such as the epidemic.[Methods]Firstly, based on the distribution range and order processing capacity of the front warehouse, taking the profit maximization of fresh e-commerce enterprises as the objective function, the front warehouse location model under normal demand and surge demand is established, and a k-means clustering algorithm based on genetic algorithm is used to solve the two-stage location. [Findings]Different from the previous selection of the final address from the alternative address, the feasibility and effectiveness of the method were verified by directly considering the user address and demand for modeling solution.[Conclusions]Combined with the demand surge, the dynamic process of two-stage site selection under the situation of demand change is described.