Task scheduling is still an open issue for improving the performance of cloud services. Focusing on addressing the issue, we first formulate the task-scheduling problem of heterogeneous cloud computing into a binary non-linear programming. There are two optimization objectives including the number of accepted tasks and the overall resource utilizations. To solve the problem in polynomial time complexity, we provide a hybrid heuristic algorithm by combing both benefits of genetic algorithm (GA) and particle swarm optimization (PSO), named PGSAO. Specifically, PGSAO integrates the evolution strategy of GA into PSO to overcome the shortcoming of easily trapping into local optimization of PSO, and applies the self-cognition and social cognition of PSO to ensure the exploitation power. Extensive simulated experiments are conducted for evaluating the performance of PGSAO, and the results show that PGSAO has 23.0–33.2% more accepted tasks and 27.9–43.7% higher resource utilization than eight other meta-heuristic and hybrid heuristic algorithms, on average.