As the economy grows and the environment deteriorates, the renewable energy is urgently needed. The advanced energy storage technology in electronic equipment, electric vehicle, smart grid, etc. becomes more significant. For example, the rechargeable batteries, hydrogen storage media, supercapacitors, the new energy storage devices have received much attention today. The anodes of the lithium ion battery (LIB), as the main body of charging and discharging, should be most important. The ideal anode material for LIBs is required to possess a higher Li capacity and a lower volume expansion. Good reversibility and high Li capacity are balanced necessarily in the electrode material. The poor cycling performance of LIB is usually due to the severe volume expansion of anode in lithiation/delithiation process. In this paper, the Li storage performance of B and N doped graphyne is explored by using the density functional theory method. The Perdew-Burke-Ernzerhof functional of the generalized gradient approximation is chosen. The calculations indicate that the doping of B atoms can enhance the adsorption strength between the Li atom and the graphyne, which can greatly increase the Li storage capacity. The Li storage capacity of B doped graphyne can reach as high as 2061.62 mAh/g, which is 2.77 times that of pristine monolayer graphyne. Meanwhile, the B doping reduces the out-plane diffusion energy barrier of Li, but increases the in-plane diffusion energy barrier slightly by 0.1 eV. On the other hand, the doping of N atoms reduces the interaction between Li and graphyne, however, the Li capacity also increases to 1652.12 mAh/g because the number of the available Li adsorption sites increases. Moreover, the doping of N atoms greatly improves the diffusion performance of Li on graphyne. The in-plane diffusion energy barrier drops to 0.37 eV, and thus the charge-discharge performance of the N doping graphyne is well improved. Therefore, the doping of B and N atoms can remarkably improve the performance of graphyne as the LIB anodes. The remarkable performance of B and N doped graphdiyne shows that it will become a promising LIB anode in the future. The present research can provide a good theoretical basis and thus conduce to guiding the developing of good Li storage materials, and can also supply strong background for experimental researches.