Topological semimetals have aroused great research interest due to their intrinsic topological physics and potential applications in devices. A key feature for all topological materials is the so-called bulk-boundary correspondence, which means that if there is non-trivial band topology in the bulk, then we can expect unique topologically protected conducting states in the surface, i.e. the topological surface state (TSS). Previously, the studies of the surface states of topological materials mainly focused on the pristine surfaces, while the topological nodal line semimetal surface states with adsorbates are rarely systematically studied. In this paper, the topological properties of the topological semimetal AlB<sub>2</sub> are studied by first-principles calculations, and the TSS position is calculated by constructing the Al- and B-terminated slab models. Observing the topological surface state, it is found that the drumhead-like TSS connects two Dirac nodes with no energy gaps on the node line, and the TSS of the Al end-terminated slab has a smaller energy dispersion than that of the B-terminated slab. The adsorption characteristics of AlB<sub>2</sub> (010) surface are studied, and it is found that the Gibbs free energy (<inline-formula><tex-math id="M2">\begin{document}$ {\Delta }{G}_{{{\mathrm{H}}}^{*}} $\end{document}</tex-math><alternatives><graphic specific-use="online" xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="12-20240404_M2.jpg"/><graphic specific-use="print" xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="12-20240404_M2.png"/></alternatives></inline-formula>) for hydrogen adsorption on the surface of Al is only –0.031 eV, demonstrating excellent hydrogen evolution reaction (HER) performance. The changes of TSS after H, OH and H<sub>2</sub>O are adsorbed on the surface of AlB<sub>2</sub> in aqueous solution environment are observed. The TSS change is the most significant when H is adsorbed, followed by OH adsorption. And the influence of H<sub>2</sub>O on TSS due to its electrical neutrality and weak surface adsorption is very weak. Before and after adsorption, because the topology protection TSS still exists, only the energy changes, which confirms its robustness in the environment. The results of this work provide a systematic understanding of the effects of different adsorbents on the TSS of AlB<sub>2</sub>, paving the way for future theoretical and experimental research in related fields, and alsopresent theoretical support for putting the topological materials into practical applications .