Hierarchical data management method, hierarchical data management system and instant messaging system
A data management system and data management technology, applied in the field of instant messaging, can solve problems such as reducing the efficiency of MySql reading and writing, difficulty in supporting user communication, and limiting the scope of use, so as to enhance adaptability and portability, improve reading and writing efficiency, Performance-enhancing effects
- Summary
- Abstract
- Description
- Claims
- Application Information
AI Technical Summary
Problems solved by technology
Method used
Image
Examples
Embodiment 1
[0042] A hierarchical data management approach such as figure 1 shown, including:
[0043] S101. Store first-level data in a non-relational database in the form of key-value pairs, where the first-level data is tree-structured data.
[0044] In the first level of data storage and non-relational databases, non-relational databases can store data on hard disks or by combining memory and hard disks for data storage. The speed of reading and writing data is higher than that of relational databases MySql.
[0045] S102. Read the first-level data into memory, and reorganize the first-level data in the memory to generate second-level data.
[0046] The hierarchical data organized according to the organization method of the database is the first-level data, and the hierarchical data organized according to the organization method suitable for memory query is the second-level data. The second-level data is stored in memory as a cache of the first-level data. Different from the existi...
Embodiment 2
[0063] A hierarchical data management approach comprising:
[0064] S201. Store first-level data in a non-relational database in the form of key-value pairs, where the first-level data is tree-structured data.
[0065] In the non-relational database, a key-value key-value pair represents a tree, the root node of the tree is used as a key (key), and all nodes of the tree and the hierarchical relationship between the nodes are stored in the corresponding key in the form of an adjacency list. The value (value). For the hierarchical data in 2(a), the storage method of the first-level data in the non-relational database is shown in Table 2.
[0066] Table 2 Storage method of first-level data
[0067] key
value
1
[1,0][2,1][3,1][4,2][5,2][6,2][7,3][8,4][9,5][10,9]
[0068] Use the first-level data in the non-relational database as the target data for data interaction, and still need to pull the data of the entire tree where the target data is located du...
Embodiment 3
[0087] A method for querying hierarchical data, where the hierarchical data is managed by the hierarchical data management method described in Embodiment 1 or Embodiment 2, such as Figure 5 shown, including:
[0088] S301. Query the second-level data:
[0089] S302. If the query result is obtained, output the query result;
[0090] S303. If the query result is not obtained, query the first-level data:
[0091] S304. If the query result is obtained, output the query result, construct the second-level data corresponding to the query result, and update the second-level data in the cache according to the constructed result;
[0092] S305. If no query result is obtained, the query fails.
[0093] Specifically, in S304, updating the second-level data in the cache according to the construction result includes: if the cache capacity is sufficient, storing the construction result in the cache; if the cache capacity is insufficient, eliminating the least used part of the second-leve...
PUM
Login to View More Abstract
Description
Claims
Application Information
Login to View More 


