A graph representation method based on hierarchical aligned data blocks

By dividing graph data into mini, medium, and super vertices and adopting different storage methods and management strategies, the inefficiency of external storage graph processing systems on NVMe SSDs is solved, achieving efficient graph data access and management.

CN118860283BActive Publication Date: 2025-11-18ZHEJIANG UNIV +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410889205.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-04
Publication Date
2025-11-18
Estimated Expiration
2044-07-04

AI Technical Summary

Technical Problem

Existing external memory graph processing systems are inefficient on modern storage devices such as NVMe SSDs, mainly because subgraph-based iteration methods and page-centric caching methods cannot effectively utilize the characteristics of graph data, resulting in low I/O efficiency, high computational overhead, and high development costs for graph algorithms.

Method used

A graph representation method based on hierarchical aligned data blocks is adopted, which divides the vertices in the graph data into three types: mini, medium, and super. The storage methods are embedded metadata, hierarchical aligned data blocks, and big page data blocks, respectively. Combined with the management of memory region cache and block device persistent storage area, the storage and access of vertices are optimized.

Benefits of technology

It improves the I/O efficiency of graph data, reduces vertex cutting issues, lowers the overhead of redundant metadata management, and enhances graph data access efficiency and system performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118860283B_ABST
    Figure CN118860283B_ABST
Patent Text Reader

Abstract

The application provides a graph representation method based on layered alignment data blocks, and through a classified layered graph storage method, vertex data of different sizes in large-scale graph data is classified and stored in different data formats in layers, so that the memory access efficiency of a block device accessing graph data is improved. Meanwhile, the application also provides a layered alignment graph data block management method, and vertex data of different sizes is organized into layered alignment graph data blocks of different sizes, so that the I / O efficiency of small vertices is improved, and the metadata management overhead of large vertices is minimized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of graph computing and system storage in computer science, and more particularly to a graph representation method based on hierarchically aligned data blocks. Background Technology

[0002] Graph data is a data structure composed of vertices and edges. Graph computing provides the ability to analyze and discover problems from the perspective of "relationships," and can better depict the real-world forms, thus attracting widespread attention. As the scale of graph data continues to increase, it often needs to be stored on external storage. Traditional external storage graph processing systems use a subgraph-based iterative method to load and compute large graphs, effectively reducing random disk I / O. However, during execution, the entire subgraph needs to be loaded each time (even if only a small portion of the graph data needs to be accessed, such as accessing only the neighbors of a single vertex), leading to low I / O efficiency. Secondly, the subgraph-based iterative method also introduces additional computational overhead due to the synchronization between subgraphs. Furthermore, using these external graph systems leads to expensive algorithm development costs. User applications need to implement their graph algorithms based on subgraph methods and manage the data interaction between computation and I / O. Even experienced programmers, after understanding the working methods and interfaces of their respective systems, need to invest significant effort in writing new algorithms. While these costs are reasonable for slow external storage devices (such as HDDs) because random access causes a significant performance drop, they become a performance bottleneck for emerging storage devices (such as NVMe SSDs) because NVMe SSDs have similar performance for random and sequential access.

[0003] While memory-to-memory caching systems, along with operating system page caching mechanisms, offer a solution for large-scale graph processing with fine-grained I / O and simple algorithm programming, they often employ a fixed-size page-centric caching approach, ignoring the unique characteristics of graph data and thus unsuitable for graph data processing. Graph algorithms typically access graph data at the vertex level. In real-world power-law graphs, the graph data size varies greatly between different vertices. These vertex accesses are inconsistent with the granularity of managing 4KB pages. This mismatch leads to problems such as low I / O utilization for small vertices with few neighbors and excessive metadata management overhead for large vertices with many neighbors. Furthermore, even if a vertex is large enough to fit on a single page, it may encounter vertex splitting issues, where vertices smaller than the page size are placed on two adjacent pages, resulting in twice the I / O overhead for these split vertices.

[0004] Therefore, existing solutions do not fully utilize the capabilities of modern NVMe solid-state drives to facilitate efficient and easy-to-use large-scale processing. Summary of the Invention

[0005] To address the limitations of subgraph-based iterative methods and page-centric caching methods, and to achieve efficient large graph processing on modern storage devices such as NVMe SSDs, this invention proposes a graph representation method based on hierarchically aligned data blocks. This method classifies and hierarchically stores vertex data of different sizes in large-scale graph data into different data formats, thereby improving the I / O efficiency of graph data without changing the existing computation mode of memory graph systems.

[0006] This invention proposes a graph representation method based on hierarchical aligned data blocks and designs a classification-based hierarchical vertex storage method. This strategy classifies vertices into three types based on their degree and designs different storage formats for different types of vertices, improving the memory access efficiency of block devices accessing graph data. Furthermore, it introduces a hierarchical aligned graph data block management method, further organizing vertices of different sizes into multiple layers of aligned data blocks of different sizes. This meticulous organization of different vertices into aligned graph data blocks improves the I / O efficiency of small vertices and reduces redundant metadata management for large vertices. Simultaneously, it effectively alleviates the vertex slicing problem and eliminates unnecessary block I / O during graph access.

[0007] Specifically, the technical solution adopted in this invention is as follows:

[0008] This invention discloses a graph representation method based on hierarchically aligned data blocks, comprising:

[0009] Obtain graph data represented in a compressed sparse row array format, which includes index data and edge data;

[0010] Save all vertices in the graph data;

[0011] The index data is used to calculate and save the number of neighboring vertices of each vertex in the graph data, i.e., degree information; by combining the index data and edge data, the neighboring vertices of each vertex in the graph data are saved.

[0012] Based on the degree information, all vertices in the graph data are divided into three types: mini vertices, medium-degree vertices, and super vertices.

[0013] The neighboring vertices of the mini vertex are stored using embedded metadata to obtain the index storage format of the mini vertex;

[0014] The neighboring vertices of the medium-degree vertex are stored in a hierarchical aligned data block manner to obtain the block index storage format and data block storage format of the medium-degree vertex;

[0015] The neighboring vertices of the super vertex are stored using large-page data blocks, thus obtaining the large-page index storage format and large-page data block storage format of the super vertex;

[0016] The storage formats of mini vertices, medium vertices, and super vertices are divided into two regions for management: a memory region cache and a block device persistent storage area. The size of the memory region cache is managed using a block file size proportional cache size allocation strategy, ultimately resulting in the memory region cache and block device persistent storage area for the graph data.

[0017] As a further improvement, the present invention categorizes all vertices in the graph data into three types based on degree information: mini vertices, medium-degree vertices, and super vertices, specifically as follows:

[0018] Based on the degree information, all vertices in the graph data are divided into three types: vertices with a degree greater than or equal to 1 and less than or equal to 2 are classified as mini vertices, vertices with a degree greater than or equal to 3 and less than or equal to 465920 are classified as medium-degree vertices, and vertices with a degree greater than or equal to 465921 are classified as super vertices.

[0019] As a further improvement, the present invention stores the neighboring vertices of a mini-vertex using embedded metadata to obtain the index storage format of the mini-vertex, specifically as follows:

[0020] The neighboring vertices of the mini-vertex obtained from the classification are stored in 8 bytes of metadata. The first 4 bytes are used to store the first neighbor, and the last 4 bytes are used to store the second neighbor, thus obtaining the index storage format of the mini-vertex.

[0021] As a further improvement, the present invention stores the neighboring vertices of a medium-degree vertex using a hierarchical aligned data block method to obtain the block index storage format and data block storage format of the medium-degree vertex, specifically as follows:

[0022] The neighboring vertices of the medium-degree vertices obtained from the classification are stored using four different storage levels; each storage level has several data blocks of the same size, with data block sizes of 4KB, 32KB, 256KB and 2MB for each level.

[0023] As a further improvement, the medium-degree vertices described in this invention are further divided into four types according to degree information, and stored in different storage levels accordingly; vertices with a degree range greater than or equal to 3 and less than or equal to 1021 are stored in L04KB block, vertices with a degree range greater than or equal to 1022 and less than or equal to 7168 are stored in L132KB block, vertices with a degree range greater than or equal to 7169 and less than or equal to 58365 are stored in L2256KB block, and vertices with a degree range greater than or equal to 58366 and less than or equal to 465920 are stored in L32MB block;

[0024] For each medium-degree vertex, neighboring vertices are stored using data blocks at the corresponding storage level based on the degree information. If the remaining space in the current data block is insufficient to store all the neighbors of the current vertex, the current data block is not used, and the next data block is used to store all the neighbors of the current vertex. Furthermore, for each medium-degree vertex, index data is saved to locate the positions of neighboring vertices in the block. The index consists of two parts: the block number and the offset within the block. Finally, the block index storage format and data block storage format of the medium-degree vertex are obtained.

[0025] As a further improvement, the present invention stores the neighboring vertices of the super vertex using large-page data blocks to obtain the large-page index storage format and large-page data block storage format of the super vertex, specifically as follows:

[0026] The neighboring vertices of the classified supervertices are stored using large page data blocks. Large pages of 2MB are allocated in the operating system, and these large page data blocks are used to store the neighboring vertices of these supervertices. An index is saved for each supervertices to locate the position of the neighboring vertices in the large page data block. The index consists of two parts: a base address and an offset. Finally, the index storage format and the large page data block storage format of the supervertices are obtained.

[0027] As a further improvement, the present invention manages the storage formats of mini vertices, medium-dimension vertices, and super vertices separately into two regions, specifically:

[0028] Use a block device persistent storage area to store data blocks for all medium-degree vertices, as well as large page data blocks for all supervertices.

[0029] Based on the data block storage format of intermediate vertices, the total size of all data blocks in each storage level is calculated; based on the bigpage data block storage format of supervertices, the total size of bigpage data blocks for all supervertices is calculated; finally, the total data block size of each of the four storage levels for intermediate vertices, and the total size of bigpage data blocks are obtained.

[0030] The total size of the entire data block is obtained by summing the total size of the data blocks in each of the four storage levels of the medium-degree vertex and the total size of the large-page data blocks.

[0031] Memory region caches are set up for the four storage levels of medium-level vertices and the large page data blocks of supervertices, for a total of five memory region caches.

[0032] Obtain the total size of the available memory space in the operating system; based on the total size of the data blocks of the four storage levels of intermediate vertices and the proportion of the total size of the large page data blocks to the total size of the total data blocks, divide the total size of the available memory space in the operating system into five parts according to the proportion, and set them as the size of five memory region caches, which are used to cache the large page data blocks of the four storage levels of intermediate vertices and super vertices, and finally obtain the memory region cache and block device persistent storage area of ​​the graph data.

[0033] The beneficial effects of this invention are as follows:

[0034] Existing external memory graph processing systems rely on complex iterative loading and computation methods to convert large amounts of random I / O into small amounts of sequential I / O. When running on emerging NVMe SSD storage, they face challenges such as low I / O efficiency, high computational overhead, and high development costs for graph algorithms. Although memory-to-memory graph systems, in conjunction with memory-to-storage caching systems such as operating system page caching mechanisms, provide a solution for large-scale graph processing with fine-grained I / O and simple algorithm programming, they often employ a fixed-size page-centric caching approach, ignoring the specific characteristics of graph applications and resulting in low graph processing efficiency. Therefore, this invention proposes a graph representation method based on hierarchically aligned data blocks. By dividing all vertices in the graph data into three types, the storage of data blocks is made more consistent with the distribution characteristics of the graph. By storing the neighboring vertices of mini vertices through embedded metadata, the storage overhead of mini vertices is reduced and access efficiency is improved. By storing the neighboring vertices of medium-sized vertices through hierarchically aligned data blocks, the vertex splitting problem is effectively alleviated, and the access efficiency of medium-sized vertices on the block device is improved. By storing the neighboring vertices of super vertices through large-page data blocks, the TLB miss rate when reading super vertices is reduced. By using two regions—a memory region cache and a block device persistent storage area—to manage mini, medium, and super vertices, the graph data cache hit rate is improved, and the latency of missing graph data access is reduced. Ultimately, this invention carefully organizes vertices of different sizes into aligned blocks, thereby improving the I / O efficiency of small vertices, reducing the read data amplification of medium-sized vertices, reducing the redundant metadata management overhead of large vertices, and improving the overall data access efficiency of the graph system. Attached Figure Description

[0035] Figure 1 This is an overall framework diagram of the method of the present invention.

[0036] Figure 2 A schematic diagram of a categorized, hierarchical vertex storage method;

[0037] Figure 3 This is a schematic diagram of a four-layer implementation for hierarchical alignment graph data block management. Detailed Implementation

[0038] The technical solution of the present invention will be further described below with reference to the accompanying drawings and specific embodiments:

[0039] The purpose of this invention is to address the inefficiency of existing large-scale graph processing schemes based on external memory by proposing a graph representation method based on hierarchically aligned data blocks. This method classifies and stores vertex data of different sizes in large-scale graph data into different data formats, thereby improving the I / O and computation efficiency of external memory graph processing systems. Figure 1 This is an overall framework diagram of the present invention;

[0040] Step 1: Input graph data stored in compressed sparse row array format and save it to the system; the graph data includes index data and edge data; save each vertex in the graph data.

[0041] Step 2: Using the index data, calculate and save the number of neighboring vertices of each vertex in the graph data, i.e., the degree information, such as... Figure 2 As shown in step two; for example, for the i-th vertex v in the graph i Its value in the index section is H i Then v i degree d i For H i+1 -H i .

[0042] Step 3: Based on the degree information obtained in Step 2, classify all vertices in the graph data into three types: mini vertices, intermediate vertices, and super vertices, such as... Figure 2 As shown in the diagram, vertices with a degree greater than or equal to 1 and less than or equal to 2 are classified as mini vertices, vertices with a degree greater than or equal to 3 and less than or equal to 465920 are classified as medium-degree vertices, and vertices with a degree greater than or equal to 465921 are classified as super vertices.

[0043] Step 4: Based on the mini-vertices obtained from the classification in Step 3, store them using embedded metadata, such as... Figure 2 The mini-vertex shown is classified; the neighboring vertices of the mini-vertex are stored using metadata embedded in 8 bytes. The first 4 bytes are used to store the first neighbor, corresponding to... Figure 2 The ID0 of the mini-vertex; the last 4 bytes are used to store the second neighbor, corresponding to Figure 2 The ID1 of the mini-vertex is obtained; finally, the index storage format of the mini-vertex is obtained.

[0044] Step 5: Based on the medium-degree vertices obtained in Step 3, further classify them into four types according to their degree information, storing them in different storage levels; for example... Figure 2 The medium-degree vertex shown;

[0045] (5.1) The neighbor vertices of the medium-degree vertices obtained from the classification are stored using four different storage levels, defined as L0, L1, L2, and L3, respectively. Figure 3 As shown in the figure; each storage tier has several data blocks of the same size, with data block sizes of 4KB, 32KB, 256KB and 2MB for each tier;

[0046] (5.2) For medium-degree vertices, they are further divided into four types based on degree information and stored in different storage levels. Vertices with a degree range of 3 or higher and 1021 or lower are stored in L04KB block, vertices with a degree range of 1022 or higher and 7168 or lower are stored in L132KB block, vertices with a degree range of 7169 or higher and 58365 or lower are stored in L2256KB block, and vertices with a degree range of 58366 or higher and 465920 or lower are stored in L32MB block.

[0047] (5.3) For each medium-degree vertex, store neighboring vertices using data blocks at the corresponding storage level based on the degree information; if the current vertex is v, the space required to store this vertex is S. v Then the space required for each vertex can be calculated as S. v =d v *sizeof(v); if the current block is C i Current block C i The remaining space is sufficient to accommodate the current vertex v, i.e., L i ≥S v Then vertex v is stored in C i In the middle; if L i v Then store vertex v in C. i+1 middle;

[0048] (5.4) For each medium-degree vertex, save the index data to locate the position of the neighboring vertices in the block. The index consists of two parts: the block number cid and the offset coff in the block. Finally, the block index storage format and data block storage format of the medium-degree vertex are obtained.

[0049] Step Six: Based on the supervertices obtained from the classification in Step Three, store the neighboring vertices of the supervertices using large-page data blocks to obtain the large-page index storage format and large-page data block storage format of the supervertices, such as... Figure 2 ​The supervertices shown are classified. The neighboring vertices of the supervertices are stored in large page data blocks. Large pages of 2MB are allocated in the operating system. These large page data blocks are used to store the neighboring vertices of these supervertices. An index is saved for each supervertices to locate the position of the neighboring vertices in the large page data block. The index consists of two parts: base address and offset sv_foff. All supervertices share a base address base. Finally, the index storage format and large page data block storage format of the supervertices are obtained.

[0050] Step 7: Based on the storage formats of mini vertices, medium vertices, and super vertices obtained in steps 4, 5, and 6, manage them through memory region cache and block device persistent storage area, and use a block file size ratio cache size allocation strategy to manage the size of the memory region cache;

[0051] (7.1) Use the block device persistent storage area to store the data blocks of all medium-degree vertices and the large page data blocks of all supervertices;

[0052] (7.2) Based on the data block storage format of the intermediate vertex, calculate the total size of all data blocks in each storage level, which is S. L0 ,S L1 ,S L2 and S L3 ;Calculate the total size S of the large page data blocks for all supervertices based on the large page data block storage format of the supervertices. SV ;

[0053] (7.3) Sum the total size of the data blocks of the four storage levels of the medium-degree vertex and the total size of the big page data blocks to obtain the total size S of the entire data block. sum =S L0 +S L1 +S L2 +S L3 +S SV ;

[0054] (7.4) Memory region caches are set up for the four storage levels of the medium-degree vertex and the large page data blocks of the supervertex, in the following order: B L0 B L1 B L2 B L3 and B SV A total of five memory regions / cache areas;

[0055] (7.5) Obtain the total size B of the available memory space in the operating system. sumBased on the total block size of each of the four storage levels for intermediate vertices, and the proportion of the total size of large page data blocks to the total block size, the total available memory space in the operating system is divided into five parts proportionally. These parts are then set as the size of five memory region caches to cache the large page data blocks of the four storage levels for intermediate vertices and supervertices. This results in the memory region caches and persistent storage areas for the graph data. For example, for the L0 level of intermediate vertices, its memory region cache is B. L0 Then set B L0 The size is B sum *S L0 / S sum .

[0056] The above description is merely a preferred embodiment of the present invention. Although the present invention has been disclosed above with reference to preferred embodiments, it is not intended to limit the present invention. Any person skilled in the art can make many possible variations and modifications to the technical solutions of the present invention using the methods and techniques disclosed above, or modify them into equivalent embodiments with equivalent changes, without departing from the scope of the technical solutions of the present invention. Therefore, any simple modifications, equivalent changes, and modifications made to the above embodiments based on the technical essence of the present invention without departing from the content of the technical solutions of the present invention shall still fall within the protection scope of the technical solutions of the present invention.

Claims

1. A graph representation method based on hierarchically aligned data blocks, characterized in that, include: Obtain graph data represented in a compressed sparse row array format, the graph data including index data and edge data; Save all vertices in the graph data; The index data is used to calculate and save the number of neighboring vertices of each vertex in the graph data, i.e., degree information; by combining the index data and edge data, the neighboring vertices of each vertex in the graph data are saved. Based on the degree information, all vertices in the graph data are divided into three types: mini vertices, medium-degree vertices, and super vertices. The neighboring vertices of the mini vertex are stored using embedded metadata to obtain the index storage format of the mini vertex; The neighboring vertices of the medium-degree vertex are stored in a hierarchical aligned data block manner to obtain the block index storage format and data block storage format of the medium-degree vertex; The neighboring vertices of the super vertex are stored using large-page data blocks, thus obtaining the large-page index storage format and large-page data block storage format of the super vertex; The storage formats of mini vertices, medium vertices, and super vertices are divided into two regions for management: a memory region cache and a block device persistent storage area. The size of the memory region cache is managed using a block file size proportional cache size allocation strategy, ultimately resulting in the memory region cache and block device persistent storage area for the graph data.

2. The graph representation method based on hierarchically aligned data blocks according to claim 1, characterized in that, Based on the degree information, all vertices in the graph data are divided into three types: mini vertices, medium-degree vertices, and super vertices, specifically: Based on the degree information, all vertices in the graph data are divided into three types: vertices with a degree greater than or equal to 1 and less than or equal to 2 are classified as mini vertices, vertices with a degree greater than or equal to 3 and less than or equal to 465920 are classified as medium-degree vertices, and vertices with a degree greater than or equal to 465921 are classified as super vertices.

3. The graph representation method based on hierarchically aligned data blocks according to claim 1 or 2, characterized in that, The method of storing the neighboring vertices of a mini-vertex using embedded metadata to obtain the index storage format of the mini-vertex is as follows: The neighboring vertices of the mini-vertex obtained from the classification are stored in 8 bytes of metadata. The first 4 bytes are used to store the first neighbor, and the last 4 bytes are used to store the second neighbor, thus obtaining the index storage format of the mini-vertex.

4. The graph representation method based on hierarchically aligned data blocks according to claim 1 or 2, characterized in that, The method of storing neighboring vertices of a medium-degree vertex using hierarchical aligned data blocks to obtain the block index storage format and data block storage format of the medium-degree vertex is as follows: The neighboring vertices of the medium-degree vertices obtained from the classification are stored using four different storage levels; each storage level has several data blocks of the same size, with data block sizes of 4KB, 32KB, 256KB and 2MB for each level.

5. The graph representation method based on hierarchically aligned data blocks according to claim 4, characterized in that, The aforementioned medium-degree vertices are further divided into four types based on degree information, and stored in different storage levels accordingly; vertices with a degree range greater than or equal to 3 and less than or equal to 1021 are stored in L04KB block, vertices with a degree range greater than or equal to 1022 and less than or equal to 7168 are stored in L132KB block, vertices with a degree range greater than or equal to 7169 and less than or equal to 58365 are stored in L2256KB block, and vertices with a degree range greater than or equal to 58366 and less than or equal to 465920 are stored in L32MB block; For each medium-degree vertex, neighboring vertices are stored using data blocks at the corresponding storage level based on the degree information. If the remaining space in the current data block is insufficient to store all the neighbors of the current vertex, the current data block is not used, and the next data block is used to store all the neighbors of the current vertex. Furthermore, for each medium-degree vertex, index data is saved to locate the positions of neighboring vertices in the block. The index consists of two parts: the block number and the offset within the block. Finally, the block index storage format and data block storage format of the medium-degree vertex are obtained.

6. The graph representation method based on hierarchically aligned data blocks according to claim 1, 2, or 5, characterized in that, The method of storing the neighboring vertices of a super vertex using large-page data blocks to obtain the large-page index storage format and large-page data block storage format of the super vertex is as follows: The neighboring vertices of the classified supervertices are stored using large page data blocks. Large pages of 2MB are allocated in the operating system, and these large page data blocks are used to store the neighboring vertices of these supervertices. An index is saved for each supervertices to locate the position of the neighboring vertices in the large page data block. The index consists of two parts: a base address and an offset. Finally, the index storage format and the large page data block storage format of the supervertices are obtained.

7. The graph representation method based on hierarchically aligned data blocks according to claim 1, 2, or 5, characterized in that, The method of dividing the storage formats of mini vertices, medium vertices, and super vertices into two regions for management is as follows: Use a block device persistent storage area to store data blocks for all medium-degree vertices, as well as large page data blocks for all supervertices; Calculate the total size of all data blocks in each storage level based on the data block storage format of the medium-degree vertex; Based on the supervertical large-page data block storage format, calculate the total size of the large-page data blocks for all supervertical vertices; finally, obtain the total data block size of each of the four storage levels for medium-degree vertices, as well as the total size of the large-page data blocks. The total size of the entire data block is obtained by summing the total size of the data blocks in each of the four storage levels of the medium-density vertex and the total size of the large-page data blocks. A memory region cache is set up for each of the four storage levels of the medium-level vertex and the large page data block of the supervertex, for a total of five memory region caches; Obtain the total size of available memory space in the operating system; Based on the total size of the data blocks in each of the four storage levels of intermediate vertices, and the proportion of the total size of the large page data blocks to the total size of the entire data blocks, the total available memory space in the operating system is divided into five parts according to the proportion. These parts are set as the size of five memory region caches to cache the large page data blocks of the four storage levels of intermediate vertices and supervertices. Finally, the memory region cache and block device persistent storage area of ​​the graph data are obtained.

Citation Information

Patent Citations

  • Large-scale streaming graph data updating method based on NUMA framework

    CN110245135A

  • Target feature information extraction method and system based on graph representation learning

    CN117272016A