With the development of Internet technology, more and more scholars are applying computer technology to research in the medical field. In this paper, we will investigate the named entity recognition method. Under the study of BERT-CRF model, we propose a named entity recognition model based on multi-task pre-training model with adversarial learning and network sharing and apply it to entity recognition in medical field with the aim of improving the accuracy of entity recognition in medical field. The model introduces multi-task joint learning and adversarial learning modules to improve the entity boundary effect and solve the noise problem of word boundary information, while achieving the purpose of information enhancement. On the CMeEE (Chinese Medical Entity Extraction) dataset, the model showed a significant improvement in accuracy, recall, and F1 score.