A hardware-level trusted graph data storage and verification method

By designing a hardware-level trusted graph data storage method, and combining MAT and MPT structures, the problems of insufficient graph data security and high performance overhead of Intel SGX in cloud storage services are solved. This achieves integrity protection of graph data in memory and disk areas, improving data security and query efficiency.

CN117312607BActive Publication Date: 2025-12-05EAST CHINA NORMAL UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202211736787.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-30
Publication Date
2025-12-05
Estimated Expiration
2042-12-30

AI Technical Summary

Technical Problem

Existing cloud storage services are inadequate in terms of graph data security. In particular, the high flexibility of graph data models makes it difficult to implement secure and efficient data storage solutions based on cryptography. At the same time, Intel SGX faces the problem of excessive performance overhead due to the limitation of secure memory space.

Method used

A hardware-level trusted graph data storage method is designed, including a memory storage structure and a persistent storage structure. The MAT and MPT structures are used for data verification. The secure memory protection and verifiable structure of SGX are used to achieve integrity protection of graph data in memory and disk areas.

Benefits of technology

It enables the establishment of a trusted relationship between the client and the untrusted graph data storage service, reduces the storage and network transmission overhead of user authentication information, and lowers the computational overhead of the server, providing security and flexibility for graph data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117312607B_ABST
    Figure CN117312607B_ABST
Patent Text Reader

Abstract

The application discloses a hardware-level trusted graph data storage and verification method. Firstly, the application designs and implements the memory storage structure and the persistent storage structure of graph data according to the data characteristics of the attribute graph model. Secondly, the application designs the verifiable structure MAT of graph data in the memory and the verifiable structure secondary coding MPT in the persistent storage. Based on the storage structure and the verifiable structure of graph data, the safe and efficient point and edge data integrity verification method is supported, the storage and verification of graph data in the conventional memory area and the disk area are realized, and the capacity limitation problem of the SGX secure memory is effectively solved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The application belongs to the technical field of graph database, and particularly relates to the data storage and integrity verification problems of graph database in untrusted scenarios such as cloud services, and specifically relates to a hardware-level trusted graph data storage and verification method. BACKGROUND

[0002] With the rapid development of the Internet, the association between data is becoming closer and closer, and graph data is widely used in modeling and storing the relationship between entity objects. Its superiority in model and performance makes it the preferred technology in the fields of financial engineering and knowledge engineering. At present, there are many cloud service platforms providing graph database storage services, which have become the mainstream trend due to their advantages such as convenient deployment and low operating cost. However, hosting makes users lose the physical control of data, and the security of data cannot be guaranteed.

[0003] In view of the data security problem in cloud storage services, at present, many works based on cryptography scheme realize secure data storage system, the core idea of which is to guarantee the confidentiality and integrity of data outsourcing through encryption of original data, such as IntegriDB and CryptDB. However, the graph data model is different from the relational model, and the flexibility of graph data is higher, so it is more difficult to realize a secure and efficient data storage scheme based on cryptography. Another solution is to build a trusted data storage system based on a trusted execution environment (Trusted Execution Environment, TEE). The data owner and the client both query and process data through the TEE component of the cloud storage Server. Intel SGX (Intel Software Guard Extensions) is a widely used trusted hardware product, which aims to realize mandatory protection from the hardware layer and provide a trusted execution environment for users, rather than relying on the security state of firmware and software.

[0004] Although SGX can provide data protection capabilities from the hardware layer, it still faces some limitations in actual use. First, SGX can only support a maximum of 128MB of secure memory (Enclave) space. If the code and data in the application program that need to be put into the Enclave for operation exceed this size limit, a secure memory paging operation is required. This operation has a higher overhead than ordinary memory paging, so frequent secure memory paging operations will bring a larger performance overhead. In addition, the current work has only realized a verifiable KV data storage system and a relational data storage system based on SGX, and there is no mature case of a trusted graph data storage system based on SGX. SUMMARY

[0005] This invention proposes a hardware-level trusted graph data storage and verification method. The graph data storage method includes methods for in-memory storage and persistent storage of graph data. The graph data verification method includes methods for constructing and verifying a verifiable structure MAT and a secondary encoding MPT, specifically including the following steps:

[0006] The graph data storage includes the following sub-steps:

[0007] Step 1: The system accepts the user's data write or update request;

[0008] Step 2: The system builds an adjacency list in memory to store the latest vertex and edge data;

[0009] Step 3: SGX calculates the hash value for each vertex and its associated edges in the adjacency list;

[0010] Step 4: SGX constructs MAT and stores the resulting root hash value in the Enclave;

[0011] Step 5: The system encodes the data in memory into key-value pairs and saves them to persistent storage according to the persistence strategy;

[0012] Step 6: SGX performs SHA256 encoding on the key-value pair graph data a second time;

[0013] Step 7: SGX constructs the MPT and stores the resulting root hash value in the Enclave;

[0014] The graph data verification includes the following sub-steps:

[0015] Step 8: The system accepts the user's data query request and generates a corresponding query plan;

[0016] Step 9: The system executes the query, retrieves the corresponding target data from memory or persistent storage, and generates a result set;

[0017] Step 10: The system retrieves the corresponding verification data from MAT or MPT based on the target data;

[0018] Step 11: The system matches the corresponding node information based on the encoding information of the target data, and recursively visits downwards, while recording the path nodes and hash values ​​to generate a verification path;

[0019] Step 12: The system sends the query result set and verification path to SGX for processing within the Enclave;

[0020] Step 13: SGX calculates the hash value of the target data in the result set to obtain the leaf nodes;

[0021] Step 14: Based on the verification path, SGX calculates the hash value of each node from bottom to top, and finally obtains the hash value of the root node;

[0022] Step 15: SGX compares the calculated hash value of the root node with the latest root hash value maintained internally by the Enclave;

[0023] Step 16: If the two values ​​match, it means that the data retrieved by the user's request is correct and complete; if they do not match, it means that the data has been tampered with or destroyed.

[0024] In step 2 of this invention, the vertex and edge data belong to the attribute graph model, which retains the personalized characteristics of points, edges and attributes.

[0025] In step 4 of this invention, the MAT is a verifiable structure composed of a Merkle tree and an adjacency list, and its root hash value can be regarded as the digest value of all leaf nodes; the Enclave is a fixed-size secure memory in SGX.

[0026] In step 5 of this invention, the encoding is a key-value encoding method for graph data, where the key consists of a globally unique ID, a field of its type, and corresponding attribute information.

[0027] In step 7 of this invention, the MPT is a verifiable structure composed of a Merkle tree and a prefix tree, and its root hash value can be regarded as the digest value of all leaf nodes.

[0028] In step 11 of this invention, the verification path is a data structure that includes target data, path node hash values, and verification order, which can quickly verify the integrity of the target data in the Merkle tree.

[0029] In this invention,

[0030] Graph databases are data management systems that use nodes and edges as basic storage units and are designed for efficient storage and retrieval of graph data. Graph databases typically refer to those based on attribute graph models.

[0031] TEE (Trusted Execution Environment): A trusted execution environment is a security architecture based on hardware and operating system. It constructs a secure computing environment isolated from the outside world by time-division multiplexing the CPU or dividing a portion of memory address as a secure space. It is used to deploy computing logic and process sensitive data.

[0032] Intel SGX: An instruction set extension introduced by Intel. SGX enables isolated execution of applications through instruction set extensions and access control mechanisms. SGX ensures the security and trustworthiness of the runtime environment, protecting user logic code and application data from malicious tampering or damage by attackers during isolated execution.

[0033] Merkle: The Merkle tree is a verifiable structure that offers the advantage of signing once and authenticating a large number of documents, providing a significant advantage in authentication.

[0034] MPT (Merkle Patricia Trie): A verifiable structure composed of the structural advantages of Merkle trees and prefix trees.

[0035] MAT (Merkle Adjacent Table): A graph data verification structure that combines Merkle trees and adjacency lists, used to verify data integrity.

[0036] SHA256: A hash algorithm that produces a hash value that is 256 bits long, which is equivalent to an array of 32 bytes. It is usually represented by a hexadecimal string of length 64.

[0037] This invention first proposes a method for storing attribute graph data, including an in-memory storage structure and a persistent storage structure, to realize the storage of graph data during querying, computation, and updating. This structure preserves the personalized characteristics of vertices, edges, and attributes, and offers significant flexibility even with heterogeneous data. Building upon this, based on the Merkle verification concept and the MPT organization method, this invention designs corresponding verification methods for in-memory data and persistent storage data respectively, addressing the issue that SGX protection is limited to the Enclave, and achieving integrity protection of graph data in both ordinary memory and disk areas.

[0038] This invention aims to achieve hardware-level trusted graph data storage and verification, proposing an attribute graph data storage method, including an in-memory storage structure and a persistent storage structure. Addressing the limitations of SGX secure memory, a verifiable method for graph data is designed, including a MAT structure in memory and an MPT structure for secondary encoding of persistent data.

[0039] Compared to existing technologies, this invention achieves hardware-level trusted graph data storage and verification. Through SGX's secure memory protection and verifiable data verification support, a trusted relationship is established between the client and the untrusted graph data storage service. Compared to cryptographic schemes, SGX not only reduces the user's storage of verification information and network transmission overhead, but also reduces the server's computational overhead. Attached Figure Description

[0040] Figure 1 This is a class diagram for storing attribute graph data in memory.

[0041] Figure 2 This is an example diagram of an adjacency list structure for storing attribute graph data in memory.

[0042] Figure 3 This is a schematic diagram of the persistent storage structure for attribute graph data.

[0043] Figure 4 This is a verifiable structural diagram of memory graph data.

[0044] Figure 5 A schematic diagram of a verifiable structure for persistent graph data.

[0045] Figure 6 This is a schematic diagram of a hardware-level trusted graph data storage and verification method. Detailed Implementation

[0046] The invention will be further described in detail below with reference to the specific steps, embodiments, and accompanying drawings. Except for the content specifically mentioned below, the processes, conditions, and experimental methods for implementing the invention are all common knowledge and general knowledge in the art, and the invention does not have any particular limitations.

[0047] This invention discloses a hardware-level trusted graph data storage and verification method. First, considering the data characteristics of attribute graph models, this invention designs and implements in-memory and persistent storage structures for graph data. Second, this invention designs a verifiable structure (MAT) for graph data in memory and a secondary encoding (MPT) for verifiable structures in persistent storage. Based on the storage and verifiable structures of graph data, it supports secure and efficient vertex and edge data integrity verification methods, realizing the storage and verification of graph data in both conventional memory and disk areas, effectively solving the capacity limitation problem of SGX secure memory.

[0048] like Figure 6 As shown, the MAT and MPT structures designed in this invention enable the construction of a secure and reliable data storage system on a cloud storage platform based on a TEE. Data owners and clients both perform data querying and processing through the TEE component of the cloud storage server. The root hash values ​​of MAT and MPT are maintained in the trusted memory enclave of the TEE, providing data integrity verification.

[0049] Storage and verifiable structure:

[0050] (1) Attribute graph data memory storage structure

[0051] In graph data storage systems, intermediate states during data querying, computation, and updating need to be transferred between secure memory and regular memory. Therefore, this invention designs corresponding data structures for vertices, edges, and attributes in the graph model. On the one hand, it implements their structural definitions and establishes relationships in memory; on the other hand, it implements fine-grained data management to reduce page swapping operations in secure memory, taking advantage of the characteristics of secure memory. The specific data structure design is illustrated using class diagrams, such as... Figure 1 As shown in the figure, the specific fields and methods of vertices, edges, and attribute classes are displayed.

[0052] This invention constructs a unified storage structure in memory for the edge relationships between graph vertices using an adjacency list, thereby accelerating operations such as relationship lookup and graph traversal. Figure 2 As shown in the figure. For the implementation of the adjacency list, this invention is based on a combination of array and linked list. First, a one-dimensional array is used to organize the vertex data in memory, as shown in the data field in the figure; then, the edge pointer points to the first destination vertex that has an edge relationship with the vertex, and each destination vertex also has a next pointer pointing to the next destination vertex.

[0053] (2) Persistent storage structure for attribute graph data

[0054] This invention uses a key-value pair approach to achieve persistent storage of graph data, such as... Figure 3 The diagram illustrates the storage model for vertex, outgoing edge, and incoming edge data.

[0055] In the process of persistently storing vertices in graph data, each vertex is identified by a globally unique ID, along with a field representing its type and corresponding attribute information. The type field associates the vertex with certain type values ​​and also serves as an index for subsequent conditional queries to improve query efficiency. The globally unique ID and type field alone can identify a vertex in the graph relationship, allowing us to construct the key portion of a key-value pair. The value portion stores the vertex's attribute information through extended or nested data structures.

[0056] In the process of persistently storing edge relationships in graph data, an undirected edge representing a connection between vertices is split into two directed edges. One edge is stored as the outgoing edge of the source vertex, and the other as the incoming edge of the destination vertex. The specific encoding format of the edge data is the same as that of the vertices, also based on key-value pairs: Key and Value. The Key part uniquely identifies a specific edge using the VertexID of the source vertex, the TagID of the type information, and the VertexID of the destination vertex. Then, the Value part stores the corresponding attribute information of the edge.

[0057] (3) Verifiable structure of memory graph data

[0058] This invention uses an adjacency list for unified management of data in memory. Therefore, the verification structure designed for memory data in this invention combines the verification idea of ​​Merkle trees with the structural characteristics of adjacency lists, and is called MAT (Merkle Adjacent Table). Figure 4 As shown, MAT organizes vertex and edge data based on adjacency lists, calculates the hash digest of each adjacency list node, and since an adjacency list is a combination of data and linked lists, and each array element is the head node of the corresponding linked list, the overall hash digest value of the linked list is calculated by integrating the data at each head node, which corresponds to the leaf node of the Merkle tree. Finally, as shown... Figure 4 As shown on the left, the Merkle tree root node is obtained through iterative calculation using a tree-like organization, and data integrity verification can be performed based on this root node.

[0059] (4) Verifiable structure of persistent graph data

[0060] This invention combines the persistent storage structure of graph data with the structural characteristics of MPT to construct a verifiable structure for persistent graph data. Employing SHA256 encoding, the key portion of the data is uniformly encoded during the construction and maintenance of the verifiable structure. On one hand, SHA256 possesses strong resistance to modification and collisions, further enhancing the security of the verifiable structure. On the other hand, SHA256, as an encoding method, yields results of uniform length and has a relatively fast computation speed, resulting in minimal performance overhead. Figure 5 As shown, the corresponding data is obtained by secondary encoding of persistent data and digest calculation. Then, the encoded key-value data is organized into an MPT structure for data integrity verification.

[0061] Maintenance and query methods:

[0062] (1) Verifiable structure maintenance method for memory graph data

[0063] Step 1: Accept the write data request sent by the client;

[0064] Step 2: Request space in memory to store the vertex data pointers involved;

[0065] Step 3: If the adjacency list mat is empty, create the adjacency list, insert the pointer, and obtain the root hash value rootHash of MAT, which is stored in the Enclave. Skip the remaining steps.

[0066] Step 4: Based on the edge information in the vertex, find the index position (bucket) of the vertex in the adjacency list;

[0067] Step 5: Insert the vertex pointer into its adjacency list bucket;

[0068] Step 6: Calculate the hash of the bucket and its path to obtain the root hash value of MAT, and store it in the Enclave.

[0069] (2) Memory graph data verification method

[0070] Step 1: The executor retrieves the adjacency list structure in memory, obtains the target dataset dataSet, and sends it to SGX;

[0071] Step 2: Preprocess the target dataset (dataSet) and check for anomalies;

[0072] Step 3: Obtain the index position of the target dataset in the adjacency list (bucketSet);

[0073] Step 4: Iteratively calculate the hash value of each bucket in the adjacency list;

[0074] Step 5: Obtain the verification path (path) of the target dataset in MAT;

[0075] Step 6: Based on the verification path, iteratively calculate the hash value of the path nodes from bottom to top, and finally obtain the MAT root hash value rootHash;

[0076] Step 7: Compare the obtained root hash value with the root hash value stored in the Enclave. If they match, it means that the target dataset being queried satisfies the requirements for correctness and completeness.

[0077] (3) Verifiable structure maintenance method for persistent graph data

[0078] Step 1: The system re-encodes the persistent graph data value to obtain the corresponding key;

[0079] Step 2: If the MPT is empty, create the MPT based on the key and value and return the root hash, which is stored in the Enclave. Skip the remaining steps.

[0080] Step 3: Iterate downwards from the root node of MPT until an empty node or leaf node is reached, generating the search path.

[0081] Step 4: Create or update the corresponding leaf node based on the key;

[0082] Step 5: Update the hash value of the corresponding node on the path to obtain the root hash value of MPT, rootHash, and store it in Enclave.

[0083] (4) Validation methods for persistent graph data

[0084] Step 1: The executor retrieves the data from the persistent storage, obtains the target dataset (dataSet), and sends it to SGX;

[0085] Step 2: Preprocess the target dataset (dataSet) and check for anomalies;

[0086] Step 3: Obtain the validation path (path) of the target dataset in MPT;

[0087] Step 4: Iteratively calculate the hash value of the leaf node containing each data item;

[0088] Step 5: Based on the verification path, iteratively calculate the hash value of the path nodes from bottom to top, and finally obtain the MPT root hash value rootHash;

[0089] Step 6: Compare the obtained root hash value with the root hash value stored in the Enclave. If they match, it means that the target dataset being queried satisfies the requirements for correctness and completeness.

[0090] Example 1

[0091] This embodiment provides a brief description of the storage and verification process during vertex data insertion and query. The process for edge data and attribute data is basically the same as that described in this embodiment.

[0092] (1) Inserting data

[0093] The client requests the insertion of a vertex {"id":1,"name":"Bob","age":40}, where name and age are the vertex's attribute fields.

[0094] After receiving a data update request, the system completes the corresponding syntax parsing and generates an execution plan. Then, the executor constructs the corresponding vertex objects in memory, updates the verifiable structure (MAT) of the in-memory graph data, and replaces the root node hash value maintained internally by the Enclave with the updated root node hash value. Simultaneously, the executor persists the data according to a certain strategy, re-encoding and persistently storing the data in memory into a key-value pair database, updating the verifiable structure (MPT) of the persistent graph data, and replacing the root node hash value maintained internally by the Enclave with the updated root node hash value. The maintenance process of the storage structure and verifiable structure is detailed in the specific implementation method. Finally, the successful operation result is returned to the client.

[0095] (2) Query data

[0096] The client requests information about the vertex with id 1, including the vertex and its attribute information.

[0097] After receiving a data update request, the system completes the corresponding syntax parsing and generates a query plan. The executor, based on the vertex identifiers (ids) in the plan, sequentially searches the in-memory adjacency list and the persistent key-value pair database. If the target dataset is found, data integrity verification is performed in the Enclave region within SGX. Based on the target dataset, SGX constructs a MAT (Matching Atlas) using the in-memory adjacency list or an MPT (Multi-Level Test) using the persistent key-value pair data, comparing the resulting root node hash with the internally stored root node hash. If they match, the client's query result is complete; otherwise, the queried data has been tampered with or corrupted. Finally, the target dataset and the verification result are returned to the client.

[0098] The scope of protection of this invention is not limited to the above embodiments. Any variations and advantages that can be conceived by those skilled in the art without departing from the spirit and scope of the inventive concept are included in this invention and are protected by the appended claims.

Claims

1. A hardware-level trusted graph data storage and verification method, characterized in that, The graph data storage method comprises in-memory storage and persistent storage methods of graph data; the graph data verification method comprises construction and verification methods of a verifiable structure MAT and secondary encoding MPT; wherein, The graph data storage method comprises the following sub-steps: Step 1: the system accepts a data writing or updating request of a user; Step 2: the system constructs an adjacency list in the memory to store the latest vertex and edge data; Step 3: the SGX calculates a hash value for each vertex and its associated edge data in the adjacency list; Step 4: the SGX constructs the MAT and saves the obtained root hash value in the Enclave; Step 5: the system encodes the data in the memory into key-value pairs according to a persistent strategy and saves them into the persistent storage; Step 6: the SGX performs SHA256 secondary encoding on the key-value pair graph data; Step 7: the SGX constructs the MPT and saves the obtained root hash value in the Enclave; The graph data verification method comprises the following sub-steps: Step 8: the system accepts a data query request of a user and generates a corresponding query plan; Step 9: the system performs the query, retrieves corresponding target data from the memory or the persistent storage to generate a result set; Step 10: the system retrieves corresponding verification data on the MAT or the MPT based on the target data; Step 11: the system matches corresponding node information based on the encoding information of the target data and recursively accesses downwardly while recording path nodes and hash values to generate a verification path; Step 12: the system sends the query result set and the verification path to the SGX for processing in the Enclave; Step 13: the SGX calculates a hash value of the target data in the result set to obtain a leaf node; Step 14: the SGX calculates a hash value of each node from bottom to top based on the verification path to finally obtain a hash value of a root node; Step 15: the SGX compares the calculated hash value of the root node with the latest root hash value maintained in the Enclave; Step 16: if the two values are consistent, it is proved that the data queried by the user's request is correct and complete; if the two values are inconsistent, it is proved that the data has been tampered with or destroyed.

2. The hardware-level trusted graph data storage and verification method of claim 1, wherein, In step 2, the vertex and edge data belong to an attribute graph model, and the individual characteristics of points, edges and attributes are retained.

3. The hardware-level trusted graph data storage and verification method of claim 1, wherein, In step 2, a unified storage structure is constructed for the edge relationship between graph vertices in the memory through the adjacency list to speed up the relationship query and graph traversal operation; for the implementation of the adjacency list, a combination of array and linked list is used, a one-dimensional array is used to organize the vertex data in the memory first, then an edge pointer is used to point to the first destination vertex having an edge relationship with the vertex, and a next pointer is further used to point to the next destination vertex in each destination vertex.

4. The hardware-level trusted graph data storage and verification method of claim 1, wherein, In step 4, the MAT is a verifiable structure composed of a Merkle tree and an adjacency list, and the root hash value is regarded as the digest value of all leaf nodes; the Enclave is a fixed-size secure memory of the SGX.

5. The hardware-level trusted graph data storage and verification method of claim 1, wherein, In step 5, the encoding is a key-value encoding mode of the graph data, the key is composed of a globally unique ID, a field of a type to which the key belongs and corresponding attribute information.

6. The hardware-level trusted graph data storage and verification method of claim 1, wherein, In step 5, in the process of persistently storing the vertex in the graph data, the vertex is identified by a globally unique ID, and further contains a type field of the vertex and corresponding attribute information of the vertex; the type field realizes the association of the vertex with certain type values, and also serves as index information for subsequent conditional queries to improve query efficiency; The globally unique ID and the type field construct the Key part of the key-value pair, and the Value part stores the attribute information of the vertex through an extended or nested data structure.

7. The hardware-level trusted graph data storage and verification method of claim 1, wherein, In step 7, the MPT is a verifiable structure composed of a Merkle tree and a prefix tree, and the root hash value is regarded as the digest value of all leaf nodes.

8. The hardware-level trusted graph data storage and verification method of claim 1, wherein, In step 11, the verification path is a data structure containing target data, path node hash values and verification sequence, used for quickly verifying the integrity of the target data in the Merkle tree.