Data storage method, retrieval method based on key-value database and corresponding device
CN114090575BActive Publication Date: 2026-08-28BEIJING SOGOU TECHNOLOGY DEVELOPMENT CO LTD
Patent Information
- Application Number
- CN202111258633.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-10-27
- Publication Date
- 2026-08-28
- Estimated Expiration
- 2041-10-27
AI Technical Summary
Technical Problem
当键是字符串类型时,由于字符串类型的数据长度是不确定的,并且,一般字符串类型的数据长度都会超过8个字节,若直接使用原始的字符串类型键来存储,会存在占用存储空间大的问题;并且在后续检索已存储的数据的过程中,需要对字符串类型的键进行逐个字节比对,会导致检索效率低下
Benefits of technology
[0088]本发明实施例在基于键值数据库存储数据的过程中,通过获取待存储的键值对数据,键值对数据包括原始键和值;原始键为字符串类型;采用转换规则将字符串类型的原始键转换成相应的、指定字节长度的整数类型,得到键值对数据对应的索引键;将键值对数据的值存储到键值数据库的值存储区中,并记录值在值存储区中的偏移量和值的长度;根据索引键、偏移量和长度,生成与值对应的目录项,并将目录项存储到键值数据库的键存储区中;实现了将字符串类型的原始键转换成相应的、指定字节长度的整数类型的索引键,方便规整键值数据库的键存储区,进而可以减少键存储区的占用空间。
✦ Generated by Eureka AI based on patent content.
Smart Images

Figure CN114090575B_ABST
Abstract
Embodiments of the present application provide a data storage method and retrieval method based on a key-value database and corresponding devices. The data storage method based on the key-value database comprises: obtaining key-value pair data to be stored, the key-value pair data comprising an original key and a value; the original key is of a string type; the original key of the string type is converted into an index key of an integer type of a specified byte length using a conversion rule; the value of the key-value pair data is stored in a value storage area of the key-value database, and an offset and a length of the value in the value storage area are recorded; a directory item corresponding to the value is generated according to the index key, the offset and the length, and the directory item is stored in a key storage area of the key-value database. The original key of the string type is converted into the index key of the integer type of the specified byte length, the key storage area of the key-value database is facilitated to be regular, and the occupied space of the key storage area can be reduced.
Need to check novelty before this filing date? Find Prior Art
Citation Information
Patent Citations
Design method of separate-storage type key-value storage system
CN103559027A
Data indexing method and device and electronic equipment
CN113157689A
Computer-implemented method, tool, and program product for more efficiently utilizing JAVA resource bundles
US20080065664A1