With the increasing popularity of GPS modules, the development of intelligent transportation applications based on trajectory data is also accelerating, such as traffic forecasting, vehicle navigation, and travel time estimation. These urban applications all require a large number of highly sampled trajectories as a basis. However, due to energy constraints and environmental interference, a large number of trajectories are collected at low sampling rates. In order to solve the uncertainty problem brought by low sampling rate trajectories, many trajectory recovery algorithms have been proposed. Currently, many existing works are based on sequence-to-sequence networks for trajectory recovery, that is, encoders are used to encode trajectories, and decoders are used to recover missing trajectory points. However, these works do not consider road network information and only use grid numbers to recover trajectories. Therefore, we propose a BERTbased multi-task learning framework, namely BTTrajRec, for trajectory recovery. BTTrajRec incorporates road information when encoding trajectories, and captures the bidirectional relationship between trajectory points, which can better characterize trajectory data. In addition, a constraint mask matrix is used to improve the recovery accuracy. We used multiple taxi data sets in the real world to verify the validity of the proposed method.