Data inquiry method and device

The invention relates to a data inquiry method and a data inquiry device. The data inquiry method comprises the following steps: receiving inquiry conditions provided by a user, wherein the inquiry conditions comprise inquiry keywords, an edit distance threshold value and a sliding window width; extracting characteristic values of the inquiry keywords to form a keyword characteristic index; extracting characteristics values of basic windows in a current sliding window to form a characteristic index of the sliding window, wherein the sliding window comprises a set number of basic windows and the characteristic index of the sliding window is a queue consisting of characteristic indexes of all the basic windows in the sliding window; when a preset inquiry trigger condition is reached, triggering inquiry for the current sliding window; and according to the keyword characteristic index and the edit distance threshold value, filtering the characteristic index of the current sliding window to obtain a candidate character string set which meets the filtering lower limit. According to the data inquiry method and the data inquiry device, which are disclosed by the invention, the defect of carrying out accurate inquiry of the keywords in a data stream scene can be effectively made up; and the data inquiry method and the data inquiry device have good inquiry fault-tolerant capability.