Sensor task allocation plays a great role in military, environmental science, medical health, transportation and other fields. In order to make rational use of limited sensor resources, a multi-sensor multi-target task allocation method based on an improved firefly algorithm (FA) is proposed. In the algorithm, the initial position of firefly individual in firefly algorithm is optimized to speed up the search optimization procedure. In the process of constructing efficiency function, position constraints, sensor monitoring ability constraints and target threat degree constraints are considered comprehensively, leading to a more realistic multi-sensor multi-target task allocation algorithm. The analytic hierarchy process (AHP) is used to construct the target threat measure. The simulation results show that the proposed algorithm is more efficient than the standard particle swarm optimization algorithm (PSO) and the standard FA, that is, the sensor task allocation is more reasonable, and the task allocation time cost is also shorter than the other two algorithms.