Mobile edge computing (MEC), as the key technology to improve user experience in a 5G network, can effectively reduce network transmission delay. Task migration can migrate complex tasks to remote edge servers through wireless networks, solving the problems of insufficient computing capacity and limited battery capacity of mobile terminals. Therefore, in order to solve the problem of "how to realize low-energy migration of complex dependent applications," a subtask partitioning model with minimum energy consumption is constructed based on the relationship between the subtasks. Aiming at the problem of execution time constraints, the genetic algorithm is used to find the optimal solution, and the migration decision results of each subtask are obtained. In addition, an improved algorithm based on a genetic algorithm is proposed to dynamically adjust the optimal solution obtained by genetic algorithm by determining the proportion of task energy consumption and mobile phone residual power. According to the experimental results, it can be concluded that the fine-grained task migration strategy combines the advantages of mobile edge computing, not only satisfies the smooth execution of tasks, but also reduces the energy consumption of terminal mobile devices. In addition, experiments show that the improved algorithm is more in line with users' expectations. When the residual power of mobile devices is reduced to a certain value, tasks are migrated to MEC server to prolong standby time.