Building a scientific and reasonable ecological network is the key for optimizing the pattern of territorial development and protection, and is of great significance for ensuring regional ecological security and promoting the virtuous cycle of ecosystems. In previous studies, nodal attack method (destruction of ecological source area) was often used in the "robustness" evaluation of ecological networks. Actually, the ecological corridor is more fragile than the source area, and thus the nodal attack method is not reasonable. In this study, taking Jiuquan City as the research area, based on the circuit model to construct the ecological network, we carried out the topology optimization of ecological network by using three strategies (random edge increase, node degree and priority edge increase with low node intermedium number) in complex network theory. We compared and analyzed the "robustness" of ecological network before and after optimization by constructing edge attack strategy, and selected the best network optimization strategy. The results showed that 65 ecological source areas were identified in Jiuquan City, with a total area of 20275.15 km2, and that grassland accounted for 89.5% of the source area. We identified 179 ecological corridors with a total length of 6387.16 km, 158 ecological barrier points with a total area of 1385.5 km2. The unused land accounted for 92.2% of the total barrier points area. We identified 63 ecological pinch points, mainly concentrated in the source edge and corridor intersection. Among them, the spatial distribution of 11 barrier points and pinch points was consistent, which was the key area to be repaired in ecological network optimization. The three optimization strategies had significantly improved the stability of ecological network in Jiuquan City. The relative size of the maximum connected subgraph and the edge connected rate of the ecological network of the optimization strategy of adding edges according to degree were all the most stable under random attack mode and deliberate attack mode, which was the best optimization scheme for ecological network in Jiuquan City.