Edge cloud is a cloud computing system built on edge infrastructure. Task scheduling optimization is the key technology to ensure the quality of service in edge cloud. However, the openness of the edge cloud environment challenges the load balancing and profit optimization of task scheduling. In this paper, we analyze the business process and optimization factors of task scheduling in edge cloud. First, we propose a resource constrained task scheduling profit optimization algorithm (RCTSPO), which consists of clustering preprocessing, classification, profit matrix construction and optimal scheduling strategy calculation. Clustering preprocessing gathers similar tasks into one class and perform a classification on the clustered tasks. Then construct the profit matrix for resource constrained task scheduling, and the optimal task scheduling strategy is obtained based on the constructed profit matrix. Second, Petri nets are used to construct the different components of edge cloud, such as resource, task, user request and virtual machine, thus forming the task scheduling model of edge cloud. Third, the properties of task scheduling model are verified by using the related theory and tools of Petri nets. Finally, several experiments are done to evaluate the proposed method, the simulation results show that the algorithm not only achieves the maximum profit, but also performs well in terms of time, reliability and load balancing of task scheduling.