Crowdsensing has attracted more and more attention in recent years, which can help companies or data demanders to collect large amounts of data efficiently and cheaply. In a crowdsensing system, the sensing tasks are divided into many small sub-tasks that can be easily accomplished by smartphone users, and the companies take advantage of the data collected by all the smartphone users to improve the quality of their services. Efficient task assignment mechanism design is very critical for crowdsensing under some realistic constraints. However, existing studies on task assignment issue are still have many limitations, such as most of them are failed to consider the time budget of smartphone users. Therefore, this work studies the optimal task assignment problem in crowdsensing systems, which can maximize the task completion rate with consideration of the time budget of users. We also prove that the optimal task assignment problem is NP-hard, thus we adopt the linear relaxation and greedy techniques to design a near-optimal crowdsensing task assignment mechanism. We also empirically evaluate our mechanism and show that the proposed task assignment mechanism is efficient.