The application discloses a retrieval method and related device. According to a to-be-retrieved input string, prefix matching is performed in a target dictionary tree to obtain a target leaf node. According to a remaining string of the to-be-retrieved input string, each full string in a
data file corresponding to the target leaf node is checked to obtain a checking result of each full string, the checking result being used to indicate whether the corresponding full string matches the to-be-retrieved input string. If the checking result indicates that a target full string in the
data file matches the to-be-retrieved input string, a word corresponding to the target full string is determined as a candidate of the to-be-retrieved input string. The application combines the target dictionary tree and the
data file to perform retrieval, the target dictionary tree has the characteristic of high retrieval efficiency, and meanwhile, since the remaining string is a partial string of the to-be-retrieved input string, the time for performing retrieval in the data file is also reduced. Therefore, the retrieval efficiency and retrieval performance are improved, even the response performance of the entire
input method is improved, and the input experience is improved.