Aiming at the problem of UAV sensing dynamic targets and avoiding high-speed dynamic obstacles in dynamic environments, a target detection and obstacle avoidance algorithm based on dynamic vision sensor is designed. A filtering method and motion compensation algorithm are designed to filter out background noise and hot spot noise in the event stream as well as redundant events caused by the camera's own motion. A dynamic target fusion detection algorithm that fuses event images and RGB images is designed to ensure the reliability of detection. The target motion trajectory is estimated based on the detection results, and the speed obstacle method is improved to avoid dynamic obstacles by combining the obstacle motion characteristics and UAV dynamic constraints. A large number of simulation tests, handheld tests and flight tests verify the feasibility of the proposed algorithm.