1. A method for detecting an abnormal subsequence in a data sequence, the data sequence including a target subsequence to be detected and a first number of reference subsequences, the method comprising: constructing, with a processing device, a hierarchical data structure of the target subsequence, each node in a bottommost layer of the hierarchical data structure storing corresponding data of the target subsequence, and each node in a layer above the bottommost layer storing values derived based on data stored in corresponding nodes in a lower layer next to the layer above the bottommost layer; determining a second number of neighbors of the target subsequence based on the hierarchical data structure of the target subsequence and hierarchical data structures of the first number of reference subsequences constructed in advance, the second number of neighbors of the target subsequence being a second number of reference subsequences, which have minimum Euclidean distances from the target subsequence, in the first number of reference subsequences; determining a third number of neighbors of each reference subsequence in the second number of reference subsequences, the third number of neighbors being a third number of subsequences, which have minimum Euclidean distances from the each reference subsequence in the second number of reference subsequences, in the data sequence; and determining whether the target subsequence is an abnormal subsequence, according to the second number of neighbors of the target subsequence, and the third number of neighbors of a reference subsequence, which has the target subsequence as a neighbor thereof, in the second number of reference subsequences.