The work aims to propose a method of multi-object tracking to enhance contextual connection and attention to meet the requirements of ship online tracking in lock approach channel,and to ameliorate the problem of discontinuous trajecto-ries and identity changes caused by complex backgrounds,occlusion,and other factors.The multi-object tracking model named of FairMOT was improved by continuous frame images captured from the online monitoring system.Firstly,a block based on Bottleneck of FairMOT and Contextual Transformer(BoCoT),was constructed in the backbone to exploit contextual informa-tion and strengthen the representative capability.Secondly,Global Context Attention(GCA)module was embedded after the it-erative aggregation layer to assist in discriminating the object locations.The experimental results showed that,Multiple Object Tracking Accuracy(MOTA)index after context modeling was increased by 2.1%compared with the original FairMOT method,and it obtained a 3.5%increase totally after continuing to embed GCA module.The improved model also achieved the best per-formance in multiple evaluation indexes.In conclusion,the improved FairMOT not only has stronger trajectory retention ability,but it also excels in identity maintenance.