The rapid advancement of the Internet of Things (IoT) is leading to more and more devices joining the network to interact with information, which requires improving the performance of IoT applications to accommodate more data, faster response times, and more complex tasks. Edge computing, as a new computing paradigm, brings resource contention and load imbalance while reducing communication overhead and task latency. This paper addresses the workload distribution challenge in edge networks, aiming to optimize resource utilization and thereby enhance IoT application performance. To achieve this goal, we present the Load-aware Task Migration (LATM) algorithm. Firstly, we present a load state detection model that captures edge nodes’ workloads and dynamically classifies them according to their resource requirements. We then propose an innovative optimization problem, transforming task migration into a weighted tripartite graph matching problem. This problem leverages the Kuhn–Munkres(KM) task migration algorithm to attain the optimal matching between tasks and nodes. Finally, we assess the algorithm’s performance through experimental simulation. The experimental results underscore the algorithm’s substantial potential in reducing task response times, task execution times, load balance, and enhancing resource utilization.