Although the attribution explanation method based on Shapley value can quantify the interpretation results more accurately, the excessive computational complexity seriously affects the practicality of this method. In this study, we introduce the k-dimensional (KD) tree to reorganize the predicted data of the model to be explained, insert virtual nodes into the KD tree so that it meets the application conditions of the TreeSHAP algorithm, and then propose the KDSHAP method. This method lifts the restriction that the TreeSHAP algorithm can only explain tree models and broadens the efficiency of the algorithm in calculating Shapley value to the explanation of all black-box models without compromising calculation accuracy. The reliability of the KDSHAP method and its applicability in interpreting high-dimensional input models are analyzed through experimental comparisons.