The invention discloses a cardinality tree-based large-scale key value data storage method, which belongs to the technical field of data storage, and comprises the following steps of: designing an overall architecture of a memory
database, defining an interface and data of a core cardinality tree module, creating an empty cardinality
tree structure, inserting fixed-length bit
stream data into a cardinality tree one by one, and storing the fixed-length bit
stream data in the cardinality tree. The method optimizes the memory use efficiency of the cardinal number tree, creates
data query and deletes data, maintains the optimized state of the cardinal number tree after data addition and deletion, provides a standardized interface, solves the technical problems of optimizing the use of the memory and improving the information
multiplexing density through a storage mode of leading out compression and a representation method of bit fragments, and has the advantages of universality and high practicability. According to the method, the number of bit fragments can be reduced to the maximum extent, so that the number of comparison times of nodes on a search path from roots to leaves is reduced, the
time complexity is reduced to the minimum, the space complexity is also very low, the
data memory occupied by the nodes is also very small, and very high stability is achieved.