The simulation of landscape pattern optimization allocation (LPOA) to achieve ecological security is an important issue when constructing regional ecological security patterns. In this study, an LPOA model was developed by integrating a binary logistic regression model and a nonlinear programming model with a particle swarm optimization algorithm in order to consider the complexity of landscape pattern optimization in terms of the quantitative structure and spatial layout optimization, integrating the landscape suitability and factors that influence landscape patterns, and under constraints to maximize the economic, ecological, and comprehensive benefits of landscape patterns. The model was employed to simulate the LPOA in the Longquanyi District of Chengdu City, Sichuan Province, China. The model successfully obtained an appropriate combination of the landscape quantitative structure and spatial layout, as well as effectively integrating the landscape suitability and factors that influence the landscape pattern. Thus, the model addressed the problems of previous studies, such as neglecting the coupling between quantitative structure optimization and spatial layout optimization, ignoring the macrofactors that affect landscape patterns during optimization modeling, and initializing particles without considering the suitability of the landscape. Furthermore, we assessed and analyzed the accuracy and feasibility of the landscape pattern spatial layout optimization results, where the results showed that the overall accuracy of the optimization results was 84.98% with a Kappa coefficient of 0.7587, thereby indicating the good performance of the model. Moreover, the simulated optimization allocation scheme for the landscape pattern was consistent with the actual situation. Therefore, this model can provide support and a scientific basis for regional landscape pattern planning, land use planning, urban planning, and other related spatial planning processes.