Ecological security pattern is the bridge between ecosystem services and human society development, and it is a healthy spatial pattern of ecosystem existing in landscape. Most of the studies on corridor extraction have insufficient quantitative basis and strong subjectivity. For example, all ecological sources are directly used for the extraction of ecological corridors, or after subjectively eliminating or merging small ecological source areas, the remaining ecological source areas are used to extract ecological corridors, which is easy to cause the problems of corridor redundancy or low credibility. In addition, the research on the optimization of the ecological security pattern is not in-depth enough, which is mainly manifested in the determination of the optimized areas of the ecological security pattern without quantitative analysis of the optimization effect. This paper takes Wuhan City as an example, by analyzing ecosystem service value, ecological sensitivity, landscape connectivity and ecological needs, Wuhan land and water ecological sources were identified. And using genetic algorithm to obtain the optimal ecological source, on this basis, the minimum cumulative resistance model (MCR) was used to extract the land and water ecological corridors, respectively. The ecological source and ecological corridor are superimposed to construct the ecological security pattern of Wuhan in 2017. The results show that in 2017, the total area of ecological source in Wuhan was about 1917.342 km2, of which the land and water ecological source areas were 780.217 km2 and 1137.125 km2, respectively. The number of the optimal land and water ecological sources identified by the genetic algorithm is 65 and 32 respectively. The extracted ecological corridors have a total length of 2 305.37 km, and the length of land and water ecological corridors is 1 497.86 km and 807.51 km, respectively. The ecological security pattern in Wuhan presents the characteristics of “three horizontal, three vertical and three clusters”, and in general, the ecological security pattern can construct a circular intersecting layout of ecological sources. In addition, eight new land ecological stepping stones, 8 new water ecological stepping stones and 5 new ecological sources were added in this paper. The graph theory method was used to compare the relevant indexes before and after optimization, and it was found that a more perfect ecological security pattern could be constructed after optimization, the optimization effect is good and the optimization scheme is feasible. The construction and optimization method of ecological security pattern can provide a more scientific reference for the study of ecological security pattern in rapidly developing metropolises.