In this study, the infiltration model was established to study the early warning of pulmonary tuberculosis data in Xiamen public hospitals. Based on the gender characteristics of residents in Xiamen, a percolation model was established to analyze the transmission rates of diseases under different contact types. In addition, the calculation method of the percolation threshold is discussed, and the model is verified by a simulation experiment. The results show that the model can predict the spread of epidemic situations well. The early warning value and relevant preventive measures were obtained by simulating the spread of tuberculosis under different exposure numbers. Bond percolation analysis was used to predict the proportion of the eventually infected population, this threshold of percolation was the basic regeneration number of tuberculosis, and the tuberculosis infection situation was effectively predicted.