Mobile target tracking remains a significant issue in smart cities. Due to complex changes in time and space of targets, real-time tracking remains a challenging problem. As a result, this paper proposes a real-time tracking approach for moving objects by combining the advantages of YOLOv7 and SORT algorithms. First, we use the YOLOv7 algorithm for object detection, which has the characteristics of high accuracy and efficiency. Then, we apply the SORT algorithm to the target tracking stage, which estimates and updates the target state through Kalman filtering. The collaborative function of the two parts is expected to achieve high-quality tracking of moving targets. Besides, this paper also demonstrates experiments and analysis on image datasets. The experimental results show that the proposed algorithm has achieved good performance in real-time tracking of moving targets. Compared with traditional methods, it can more accurately predict the position and trajectory of targets and has better real-time performance. In addition, the proposed algorithm is equally effective for target tracking in complex scenes, such as multi-target tracking and target occlusion. Future research can further optimize the performance of algorithms to cope with more complex scenarios and problems.