Task scheduling and resource allocation are two core techniques in cloud computing. In order to use resource efficiently in heterogeneous environment, the paper presents a new task scheduling algorithm based on Genetic Algorithm (GA). The model considers four aspects of the task scheduling: task finished time, task expenses, bandwidth and reliability in cloud computing environment. And the optimal target of the model is to achieve min-time, min-cost, max-bandwidth and max-reliability. Besides, the new algorithm adopts rule-bound crossover and mutation operation to improve individual quality.