The present invention discloses a
mass data real-time sorting and inquiring method and
system. The method comprises: a sorting step of partitioning users into n+1 levels from 0-n according to experience values, storing all id numbers at each level by using a
linked list, respectively storing user data into each node of the linked lists, and establishing experience value inked lists, wherein an
insertion sequence of the users at a current experience value level is also stored in the corresponding experience value
linked list, and each experience value
linked list uses a head pointer and a
tail pointer which respectively point at a first node and a last node; and an inquiring step of firstly, accumulating a total people number at each experience value level from the beginning of the maximum experience value, i.e. the n+1 level, then carrying out traversal inquiring in the experience value linked lists to which the users correspondingly belong so as to find rankings of the users in the users with the same experience values, and carrying out accumulation to obtain a total
ranking in the
system. According to the
mass data real-time sorting and inquiring method and
system which are disclosed by the present invention, functions of
microsecond-level inquiry, addition, deletion, real-time sorting and the like can be provided for
mass data at the level of hundred millions of users.