With the advent of technologies such as the Internet of Things, edge computing, and 5G, a tremendous amount of structured and unstructured data is being generated from different applications in the smart city environment. In this study, the current problems to be overcome by edge computing (EC) and the basic framework of edge computing are investigated to enhance the sustainable development of the smart city. Three 4aspects of the edge computing offload technology are explored including the software-defined network (SDN) controller, offload decision, and resource allocation, and a task offloading model of an edge computing network for a smart city is designed based on data preprocessing. Moreover, the energy-saving design and analysis of passive houses are carried out with Chengdu city as an example. The results reveal that the deployment scheme is feasible. In the passive house design scheme with natural ventilation, external shading, wall heat transfer coefficient of 0.63 W/(m2 K), and water storage roof, the annual energy consumption per unit area is the lowest, 18.97 kWh/m2, and its energy-saving rate is the highest, 0.77. The findings of the study provide some research experience for increasing the efficiency of smart city edge computing and boosting the smart city’s long-term development.