With the characteristics of low cost, high availability, and scalability, cloud computing has become a high demand platform in the field of information technology. Due to the dynamic and diversity of cloud computing system, the task and resource scheduling has become a challenging issue. This paper proposes a novel task scheduling algorithm of cloud computing based on particle swarm optimization. Firstly, the resource scheduling problem in cloud computing system is modeled, and the objective function of the task execution time is formulated. Then, the modified particle swarm optimization algorithm is introduced to schedule applications' tasks and enhance load balancing. It uses Copula function to explore the relation of the random parameters random numbers and defines the local attractor to avoid the fitness function to be trapped into local optimum. The simulation results show that the proposed resource scheduling and allocation model can effectively improve the resource utilization of cloud computing and greatly reduce the completion time of tasks.