Edge computing (EC) is an efficient technology that enables end users to achieve the goal of high bandwidth and low latency by offloading computationally intensive tasks from mobile devices to edge servers. However, a major challenge arises when the processing load fluctuates continuously, leading to a performance bottleneck due to the inability to rescale edge node (EN) resources. To address this problem, the approach of task migration is introduced, and the resource constrained model, optimal communication overhead model, and optimal task migration model are built to form a theoretical foundation from which to propose a task migration based resilient framework construction method in EC. With the aid of the domino effect and the combined effect of task migration, a dynamic node-growing algorithm (DNGA) and a dynamic node-shrinking algorithm (DNSA), both based on the task migration strategy, are proposed. Specifically, the DNGA smoothly expands the EN scale when the processing load increases, while the DNSA shrinks the EN scale when the processing load decreases. The experimental results show that for standard benchmarks deployed on an elastic framework, the proposed method realizes a smooth scaling mechanism in the EC, which reduces the latency and improves the reliability of data processing.