Index construction and efficient search method facing data value

By constructing vertex and edge table indexes using native graph storage methods and a learned index model, the problem of prediction error in graph data storage is solved, enabling efficient data value updates and queries, and improving data locality and query efficiency.

CN116304206BActive Publication Date: 2026-01-02BEIJING INST OF TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310194702.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-03-03
Publication Date
2026-01-02
Estimated Expiration
2043-03-03

AI Technical Summary

Technical Problem

Existing graph data storage methods, when using learned indexes for key-value storage, result in large prediction errors because edges with the same source vertex are predicted to the same location, making it difficult to achieve efficient data value updates and queries.

Method used

We adopt a graph-native storage method, treating data value as a graph G=(V,E), which is divided into a vertex table and an edge table. We use a learned index model to build an index structure. The vertex table and edge table adopt array and index structures respectively. We use linear functions of tree structure to perform insertion, deletion and search operations, and maintain the linear relationship of leaf nodes to optimize storage and query.

Benefits of technology

It achieves efficient data value storage and retrieval, supports high-throughput data update and query operations, and improves data locality and query efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116304206B_ABST
    Figure CN116304206B_ABST
Patent Text Reader

Abstract

The application discloses a data value-oriented index construction and efficient search algorithm, which can be used for efficient storage and search of data value; the application proposes a graph native storage structure based on a learning index for data value expressed by graph data, and stores and constructs indexes for vertices and edges of data respectively; the application proposes an efficient search algorithm based on the index, which is used for supporting index updating and search; the method disclosed by the application can effectively store data value and support high-throughput data updating and search operation.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The application belongs to the technical field of design drawing data storage, and particularly relates to an index construction and efficient search method for data value. BACKGROUND

[0002] After conversion and extraction, big data can obtain data value contained therein. Full use and mining of data value is the basis of artificial intelligence technology. In order to better store and analyze data value, it is necessary to construct an index for data value and design an efficient search algorithm. Data value is usually modeled and expressed by a knowledge graph, which is an important application of graph data, with vertices representing entities and edges representing the relationship between entities. However, the data value structure represented by graph data is complex and has poor data locality, making it more difficult to store data value than traditional relational data or key-value data.

[0003] Graph data storage can be divided into graph native storage and key-value storage. Graph native storage is based on the adjacency list structure of the graph, which saves the adjacent edges of each vertex together and quickly finds the location of the vertex and its adjacent edges by constructing an index. Key-value storage treats all edges of the graph as a set of key-value pairs and uses traditional key-value storage structures such as B-tree, B+ tree, etc. for storage. Existing research shows that graph native storage has better data locality and is more conducive to data search and query. Key-value storage has higher throughput for data update operations.

[0004] Learning model is a key-value storage structure proposed in recent years that uses machine learning models to predict data locations. Learning index contains multiple layers, each layer contains multiple machine learning models, the model of the previous layer is used to predict the model needed by the next layer, and the model of the last layer is used to predict the storage location of the data. In order to ensure the efficiency of model training and prediction, the machine learning models in the learning index usually use simple linear models, which divide all data into multiple data segments that approximately conform to linear distribution to ensure the accuracy of model prediction. Learning index meets the technical requirements of graph data storage in terms of efficient data update and good data locality. However, if graph data is directly stored using learning index, the edges with the same source point will have the same key and thus be predicted to the same location by the machine learning model, resulting in a large prediction error. Therefore, how to design a data value index construction and search algorithm based on learning index to support (1) efficient data value update and search (2) efficient execution of query algorithms for data value is a problem that needs to be solved by those skilled in the art. SUMMARY

[0005] Therefore, the present application aims to provide a data value-oriented index construction and efficient search method, which can realize efficient storage and search of data value. A data value-oriented index construction and efficient search method, comprising an index construction process, a data insertion process and a data search process;

[0006] The index construction process comprises:

[0007] The data value is regarded as a graph G=(V, E), wherein V represents a vertex in the data value, and E represents an edge between the vertices;

[0008] The storage of the graph G is realized in a graph native manner, and the storage structure is divided into a vertex table and an edge table; wherein the edge table is used for saving the adjacent edges of the vertices, including an array structure edge table and an index structure edge table;

[0009] An index structure is established for the vertex table, which is used for saving the correspondence between the vertex number and the vertex block; each vertex block comprises the following attributes:

[0010] 1) the degree of the vertex, which is used for saving the number of adjacent edges of the vertex;

[0011] 2) the position of the array structure edge table;

[0012] 3) the position of the index structure edge table;

[0013] 4) the maximum use position, which records the position of the last adjacent edge saved in the array structure edge table in the structure;

[0014] 5) the length of the array structure edge table, which is used for recording the maximum number of adjacent edges that can be saved in the current array edge table;

[0015] 6) a bit map, which is used for recording whether each position in the array structure edge table is currently used or not;

[0016] The vertex table index and the index structure edge table are established using a learning index model, and the method comprises:

[0017] The index structure uses a tree structure, including intermediate nodes and leaf nodes;

[0018] The intermediate node saves its linear function in the index structure and child node pointer, and the linear function is determined by two parameters of slope and intercept;

[0019] The leaf node saves its linear function in the index structure and data, and the saved data is key-value type data; for the vertex table index, the saved key is the vertex number, and the value is the vertex block corresponding to the vertex number; for the edge table index, the saved key is the end point of the edge, and the value is empty;

[0020] Initially, only one leaf node is established, both parameters of the linear function are 0, and the array capacity is 1;

[0021] When a vertex is to be inserted into the vertex table index, starting from the root node of the vertex table index, down access is performed according to the child node pointer, when an intermediate node is accessed, the vertex number to be inserted is substituted into the linear function saved in the node as a variable, the calculated result is recorded as pos1, the pos1th child node of the intermediate node is continuously accessed, and the process is repeated until a leaf node is accessed; when the leaf node is accessed, the vertex number to be inserted is substituted into the linear function saved in the leaf node as a variable, the calculated result is recorded as pos2, and exponential search is performed from the pos2 position of the array of the leaf node, the searched position is taken as the actual insertion position of the vertex and insertion is performed;

[0022] When an edge is to be inserted into the vertex table index, starting from the root node of the edge table index, down access is performed according to the child node pointer, when an intermediate node is accessed, the end point of the edge to be inserted is substituted into the linear function saved in the node as a variable, the calculated result is recorded as pos1, the pos1th child node of the intermediate node is continuously accessed, and the process is repeated until a leaf node is accessed; when the leaf node is accessed, the end point of the edge to be inserted is substituted into the linear function saved in the leaf node as a variable, the calculated result is recorded as pos2, and exponential search is performed from the pos2 position of the array of the leaf node, the searched position is taken as the actual insertion position of the edge and insertion is performed;

[0023] In the data insertion or deletion process, the cost of the node after splitting is calculated, if the cost and the cost before splitting are greater, training is performed, otherwise node splitting is performed;

[0024] The training process of the leaf node is that all data saved in the leaf node and the positions of the data in the array are taken as a group of variables, a linear relationship of the group of variables is fitted using the least square method, a new linear function is obtained, and the linear function saved in the leaf node is updated;

[0025] The splitting process of the leaf node is that all data saved in the leaf node are divided into two nodes obtained by splitting, and the original leaf node is converted into an intermediate node;

[0026] The data insertion process includes: for an edge (u, v) to be inserted, searching for the position of the vertex u in the vertex table index, and obtaining the vertex block thereof;

[0027] If the search result is empty, a vertex block is created and inserted into the vertex table index according to the learning index model described above;

[0028] If vertex u currently uses the edge table index to store the adjacent edges, the edge e=(u, v) is inserted into the edge table index according to the learning index model described above;

[0029] If vertex u currently uses the array edge table to store the adjacent edges, and the degree of vertex u plus 1 is equal to the threshold value of constructing the edge table index, the index of the adjacent edges of vertex u is constructed, the edge table index of the adjacent edges of vertex u is established using the learning index model described above, and the edge e=(u, v) is inserted into the edge table index;

[0030] If vertex u currently uses the array edge table to store the adjacent edges, and the threshold value of constructing the index is not reached, all positions between [0, the maximum used position + 1] in the array edge table of u are traversed to find the first unused position to insert the edge e=(u, v), and if the insertion position exceeds the current array edge table length, the array edge table is expanded to twice the size and then the insertion is performed;

[0031] The data search process includes the following steps: for the edge (u, v) to be searched, the position of vertex u in the vertex table index is searched to obtain the vertex block thereof; if the search result is empty, an empty result is returned;

[0032] If vertex u uses the array structure edge table to save the adjacent edges, the edge is searched before the maximum used position of the array structure edge table of the obtained vertex block; if vertex u uses the index structure edge table to save the adjacent edges, the edge is searched in the edge table index of the obtained vertex block.

[0033] Further, the edge deletion method includes the following steps:

[0034] S1, the position of vertex u in the vertex table index is searched to obtain the vertex block thereof;

[0035] S2, if vertex u currently uses the array edge table to store the adjacent edges, the positions between [0, the maximum used position] of the array are traversed to delete the edge e=(u, v), and the bit map is updated;

[0036] S3, if vertex u currently uses the edge table index to store the adjacent edges, the edge e=(u, v) is deleted from the edge table index.

[0037] Preferably, the specific method of searching the edge in the edge table index of the obtained vertex block includes:

[0038] The root node of the edge table index starts to access downwards according to the child node pointer, when the intermediate node is accessed, the end point of the searched edge is substituted into the linear function stored in the node as a variable, the calculated result is recorded as pos1, the pos1th child node of the intermediate node is continuously accessed, and the process is repeated until the leaf node is accessed; when the leaf node is accessed, the end point of the searched edge is substituted into the linear function stored in the leaf node as a variable, the calculated result is recorded as pos2, and exponential search is performed from the array of the leaf node at the pos2 position until the actual position of the edge is searched.

[0039] Preferably, when the vertex degree is less than the set edge table index threshold, the array structure edge table is adopted.

[0040] Preferably, when the vertex degree is greater than the set edge table index threshold, the index structure is adopted to realize the edge table.

[0041] The present application has the following beneficial effects:

[0042] The present application discloses an index construction and efficient search algorithm for data value, which can be used for efficient storage and search of data value. The present application proposes a graph native storage structure based on learning index for data value expressed by graph data, and stores and constructs indexes for vertices and edges of data. The present application proposes an efficient search algorithm based on the index, which is used to support index update and search. The method disclosed by the present application can effectively store data value and support high-throughput data update and search operation. BRIEF DESCRIPTION OF DRAWINGS

[0043] Figure 1 The storage structure schematic diagram provided by the present application is shown.

[0044] Figure 2 The edge search algorithm flowchart provided by the present application is shown.

[0045] Figure 3 The edge insertion algorithm flowchart provided by the present application is shown.

[0046] Figure 4 The edge deletion algorithm flowchart provided by the present application is shown. DETAILED DESCRIPTION

[0047] The present application will be described in detail below in combination with the drawings and examples.

[0048] As shown in the figure, the index construction process includes: Figure 1 The data value is regarded as a graph G=(V,E), wherein V represents the vertex in the data value, and E represents the edge between the vertices;

[0049] The data value is regarded as a graph G=(V,E), wherein V represents the vertex in the data value, and E represents the edge between the vertices;

[0050] The storage of the graph G is realized in a graph-native way, and the storage structure is divided into a vertex table and an edge table; the edge table is used for saving the adjacent edges of the vertex, including an array structure edge table and an index structure edge table;

[0051] An index structure is established for the vertex table, which is used for saving the correspondence between the vertex number and the vertex block; each vertex block includes the following attributes:

[0052] 1) the degree of the vertex, which is used for saving the number of adjacent edges of the vertex;

[0053] 2) the position of the array structure edge table; the edge table of this structure saves the adjacent edges of the vertex by using a dynamic array; the edge table is used in the case that the degree of the vertex is less than a set edge table index threshold;

[0054] 3) the position of the index structure edge table; the edge table of this structure is used in the case that the degree of the vertex is greater than the set edge table index threshold;

[0055] 4) the maximum use position, which records the position of the last saved adjacent edge in the array structure edge table, and is used for reducing the search range in the array;

[0056] 5) the length of the array structure edge table, which is used for recording the maximum number of adjacent edges that can be saved in the current array edge table;

[0057] 6) the bit map, which is used for recording whether each position in the array structure edge table is currently used or not;

[0058] The vertex table index and the index structure edge table index use a learning index model, and the method includes:

[0059] The index uses a tree structure, including intermediate nodes and leaf nodes;

[0060] The intermediate node saves its linear function in the index structure and child node pointer, and the linear function is determined by two parameters of slope and intercept;

[0061] The leaf node saves its linear function in the index structure and data, and the saved data is key-value type data; for the vertex table index, the saved key is the vertex number, and the value is the vertex block corresponding to the vertex number; for the edge table index, the saved key is the end point of the edge, and the value is empty;

[0062] Initially, only one leaf node is established, and the two parameters of the linear function are both 0, and the array capacity is 1;

[0063] When a vertex is to be inserted into the vertex table index, start from the root node of the vertex table index and access down according to the child node pointer, when an intermediate node is accessed, then the vertex number to be inserted is substituted into the linear function saved in the node as a variable, the result of the calculation is recorded as pos1, continue to access the pos1th child node of the intermediate node, repeat this process until a leaf node is accessed; when a leaf node is accessed, the vertex number to be inserted is substituted into the linear function saved in the leaf node as a variable, the result of the calculation is recorded as pos2, and an exponential search is performed from the array pos2 position of the leaf node, the searched position is taken as the actual insertion position of the vertex and insertion is performed; the process of edge insertion into the edge table index is the same as the process of vertex insertion into the vertex index;

[0064] In the data insertion and deletion process, the density of the leaf node array is maintained, and when the density exceeds a specified threshold, the array is expanded, and when the density is less than the threshold, the array is contracted;

[0065] In the data insertion and deletion process, the cost of the leaf node is maintained, and the cost of the node after splitting is calculated, and if the cost and is greater than before splitting, training is performed, otherwise node splitting is performed;

[0066] The training process of the leaf node is that all data saved in the leaf node and the position of the data in the array are taken as a group of variables, a linear relationship of the group of variables is fitted using the least square method, a new linear function is obtained, and the linear function saved in the leaf node is updated;

[0067] The splitting process of the leaf node is that all data saved in the leaf node are evenly divided into two nodes obtained by splitting, and the original leaf node is converted into an intermediate node.

[0068] Figure 2 A flowchart of a search algorithm for data value edge e=(u,v) according to an embodiment of the present disclosure is shown. The method includes the following steps:

[0069] S1, search for the position of vertex u in the vertex table index, and obtain the vertex block thereof;

[0070] S2, if the search result of step S1 is empty, return an empty result;

[0071] S3, if the vertex u uses the array edge table to save adjacent edges, search for the edge in the array edge table of the vertex block obtained in step S1;

[0072] S4, if u uses the edge table index to save adjacent edges, search for the edge in the edge table index of the vertex block obtained in step S1.

[0073] Specifically, step S1 includes:

[0074] S11, input u into the linear model from the root node of the vertex table index, and obtain the output;

[0075] S12, if the current access node is an intermediate node, then according to the output obtained in step S11, the corresponding child pointer in the node is selected to go to the next layer, and the process is repeated until the leaf node is reached;

[0076] S13, the number of the search vertex is input as a variable into the linear model of the leaf node, and the output is obtained, and the element in the corresponding position of the array is compared with u;

[0077] S14, if the comparison result is equal, then the vertex block at this position is the searched vertex block;

[0078] S15, if the comparison result is not equal, then exponential search is performed from this position until the position where u is located is searched, and the vertex block at the position is returned.

[0079] Step S3 specifically includes:

[0080] S31, the maximum used position in the vertex block obtained in step S1 is obtained;

[0081] S32, all positions between 0 and the maximum used position in the array edge table in the vertex block are traversed, and whether the position is empty is determined by using the array edge table bit map in the vertex block;

[0082] S33, if a position is not empty, it is determined whether the element at the position is v, and if yes, the search result is returned;

[0083] S34, if the elements at the used positions are all not equal to v, then an empty result is returned.

[0084] Figure 3 A flowchart of an insertion algorithm of a data value edge e=(u,v) according to an embodiment of the present disclosure is shown, and the method includes the following steps:

[0085] S1, the position of vertex u in the vertex table index is searched, and the vertex block thereof is obtained;

[0086] S2, if the search result is empty, then a vertex block is created and inserted into the vertex table index;

[0087] S3, if the vertex u currently uses an edge table index to store adjacent edges, then the edge e=(u,v) is inserted into the edge table index;

[0088] S4, if the vertex u currently uses an array edge table to store adjacent edges, and the degree of u plus 1 is equal to the threshold value of the constructed edge table index, then an index of the adjacent edges of u is constructed, and the edge e=(u,v) is inserted into the edge table index;

[0089] S5, if the vertex u currently uses the array edge table to store the adjacent edge, and the threshold of constructing the index is not reached, then traverse all positions between [0, the maximum used position + 1] in the array edge table of u to find the first unused position to insert e = (u, v), if the insertion position exceeds the current array edge table length, then expand the array edge table to twice and then perform the insertion.

[0090] Step S2 specifically includes:

[0091] S21, create a vertex block, initialize the degree to 1, the array length to the initial length, and the maximum used position to -1;

[0092] S22, start from the root node of the vertex index table to find the storage position of the vertex u;

[0093] S23, if the storage position of u has been used, then find the nearest gap in the array from the position;

[0094] S24, if the gap is on the right side of the position, then move the elements on the right side of the position to the right by one position, and insert u and its vertex block into the position;

[0095] S25, if the gap is on the left side of the position, then move the elements on the left side of the position to the left by one position, and insert u and its vertex block into the position;

[0096] Step S5 specifically includes:

[0097] S51, obtain the maximum used position and the bitmap in the vertex block, and initialize the variable pos to -1;

[0098] S52, traverse the positions between [0, the maximum used position] in the vertex block, and use the bitmap to determine whether each position is empty, and record the first empty position in pos;

[0099] S53, if pos is not equal to -1, then insert the edge e = (u, v) into the pos position of the array edge table, and update the bitmap;

[0100] S54, if pos is equal to -1, and the maximum used position does not exceed the array length, then insert the edge e = (u, v) into the maximum used position + 1 of the array edge table;

[0101] S55, if pos is equal to -1, and the maximum used position is equal to the array length, then expand the array edge table to twice, multiply the array length by 2, and insert the edge e = (u, v) into the maximum used position + 1.

[0102] Figure 4 A flow chart of a data value edge e = (u, v) deletion algorithm according to an embodiment of the present disclosure is shown, and the method includes the following steps:

[0103] S1, search the position of vertex u in vertex table index, and obtain the vertex block of u;

[0104] S2, if vertex u currently uses array edge table to store adjacent edges, then traverse the positions between [0, maximum used position] in the array, and delete the edge e=(u, v);

[0105] S3, if vertex u currently uses edge table index to store adjacent edges, then delete the edge e=(u, v) from the edge table index.

[0106] Step S2 specifically comprises:

[0107] S21, obtain the maximum used position and position map in the vertex block;

[0108] S22, traverse the data between [0, maximum used position] in the edge table array, and determine whether each position is empty by using the bit map;

[0109] S23, for a position that is not empty, determine whether the data on the position is equal to the edge e=(u, v), if yes, modify the bit map, and set the position to be empty;

[0110] Step S3 specifically comprises:

[0111] S31, find the position pos1 in which the edge e=(u, v) is stored, starting from the root node of the edge table index;

[0112] S32, find the nearest non-empty position pos2 on the left side of the storage position of the edge e=(u, v);

[0113] S33, modify the data in the range of [pos2+1, pos1] to the data in the position pos1+1;

[0114] S34, if the array of the leaf node is empty, merge the leaf node and the left leaf node, and modify the parent node pointer.

[0115] The above embodiment is applied to a LiveJournal data set, which reflects the data value on a social website, a vertex represents a user, and an edge represents the friend relationship between two users. In the application of the application, the LiveJournal data set is executed to perform 7 operations of edge insertion, edge deletion, edge search, vertex insertion, vertex deletion, vertex search, and vertex neighbor traversal, and the storage structure described in the application has a throughput of 505KOp / s under only write load, a throughput of 734KOp / s under read-write load, and a throughput of 1MOp / s under only read load.

[0116] To sum up, the above is only the preferred embodiment of the present application, and is not used to limit the protection scope of the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.

Claims

1. A method for data value-oriented index construction and efficient search, characterized in that, The index construction process, the data insertion process, and the data search process are included; The index construction process includes: The data value is regarded as a graph G=(V, E), where V represents a vertex in the data value, and E represents an edge between the vertices; The storage of the graph G is implemented in a graph native manner, and the storage structure is divided into a vertex table and an edge table; the edge table is used to save adjacent edges of the vertices, and includes an array structure edge table and an index structure edge table; An index structure is established for the vertex table, and is used to save a correspondence between a vertex number and a vertex block; each vertex block includes the following attributes: 1) a degree of the vertex, which is used to save a number of adjacent edges of the vertex; 2) a position of the array structure edge table; 3) a position of the index structure edge table; 4) a maximum use position, which records a position of a last adjacent edge saved in the array structure edge table; 5) a length of the array structure edge table, which is used to record a maximum number of adjacent edges that can be saved in the array structure edge table; 6) a bit map, which is used to record whether each position in the array structure edge table is currently used or not; The vertex table index and the index structure edge table are established using a learning index model, and a method includes: The index structure uses a tree structure, and includes intermediate nodes and leaf nodes; The intermediate node saves a linear function in the index structure and a child node pointer, and the linear function is determined by two parameters, i.e., a slope and an intercept; The leaf node saves a linear function in the index structure and data, and the saved data is a key-value type data; for the vertex table index, the saved key is a vertex number, and the value is a vertex block corresponding to the vertex number; for the edge table index, the saved key is an end point of an edge, and the value is empty; Initially, only one leaf node is established, the two parameters of the linear function are both 0, and the array capacity is 1; When a vertex is to be inserted into the vertex table index, a root node of the vertex table index is accessed downwards according to the child node pointer; when an intermediate node is accessed, the vertex number to be inserted is substituted into the linear function saved in the node as a variable, a result of the calculation is recorded as pos1, the pos1th child node of the intermediate node is continuously accessed, and the process is repeated until a leaf node is accessed; when the leaf node is accessed, the vertex number to be inserted is substituted into the linear function saved in the leaf node as a variable, a result of the calculation is recorded as pos2, an exponential search is performed from an array pos2 position of the leaf node, a searched position is used as an actual insertion position of the vertex and is inserted; an edge insertion process of the edge table index is the same as the vertex insertion process of the vertex table index; When an edge is to be inserted into the edge table index, starting from the root node of the edge table index, access downwards according to the child node pointer, when an intermediate node is accessed, the end point of the edge to be inserted is substituted into the linear function saved in the node as a variable, the result of the calculation is recorded as pos1, the pos1th child node of the intermediate node is continuously accessed, and the process is repeated until a leaf node is accessed; when a leaf node is accessed, the end point of the edge to be inserted is substituted into the linear function saved in the leaf node as a variable, the result of the calculation is recorded as pos2, and an exponential search is performed from the array pos2 position of the leaf node, the searched position is taken as the actual insertion position of the edge and the edge is inserted; In the data insertion or deletion process, the cost of the split node is calculated, if the cost and the cost before splitting are greater than the cost before splitting, the training is performed, otherwise the node splitting is performed; The leaf node training process is that all data saved in the leaf node and the position of the data in the array are taken as a group of variables, a linear relationship of the group of variables is fitted by using the least square method, a new linear function is obtained, and the linear function saved in the leaf node is updated; The splitting process of the leaf node is that all data saved in the leaf node are evenly divided into two nodes obtained by splitting, and the original leaf node is transformed into an intermediate node; The data insertion process comprises the following steps: for an edge (u, v) to be inserted, the position of the vertex u is searched in the vertex table index, and the vertex block of the vertex u is acquired; If the search result is empty, a vertex block is created and inserted into the vertex table index according to the learning index model; If the vertex u currently uses the edge table index to store adjacent edges, the edge e=(u, v) is inserted into the edge table index according to the learning index model; If the vertex u currently uses the array edge table to store adjacent edges, and the degree of the vertex u plus 1 is equal to the threshold value of the constructed edge table index, the index of the adjacent edges of the vertex u is constructed, the edge table index of the adjacent edges of the vertex u is established by using the learning index model, and the edge e=(u, v) is inserted into the edge table index; If the vertex u currently uses the array edge table to store adjacent edges, and the threshold value of the constructed index is not reached, all positions between [0, the maximum used position + 1] in the array edge table of the vertex u are traversed, the first unused position is found to insert the edge e=(u, v), and if the insertion position exceeds the length of the current array edge table, the array edge table is expanded to twice the size and then the insertion is performed; The data search process comprises the following steps: for an edge (u, v) to be searched, the position of the vertex u is searched in the vertex table index, and the vertex block of the vertex u is acquired; if the search result is empty, an empty result is returned; If the vertex u uses the array structure edge table to save adjacent edges, the edge is searched before the maximum used position of the array structure edge table of the acquired vertex block; if the vertex u uses the index structure edge table to save adjacent edges, the edge is searched in the edge table index of the acquired vertex block.

2. The method of claim 1, wherein, Further comprising an edge deletion method, comprising the following steps: S1, searching the position of the vertex u in the vertex table index, and acquiring the vertex block of the vertex u; S2, if the vertex u currently uses the array edge table to store adjacent edges, the positions between [0, the maximum used position] of the array are traversed, the edge e=(u, v) is deleted, and the bit map is updated; S3, if vertex u currently stores adjacent edges by edge table index, delete edge e = (u, v) from the edge table index.

3. The method of claim 1, wherein, The specific method of searching for the edge in the edge table index of the acquired vertex block comprises: The root node of the edge table index starts to access downwards according to the child node pointer, when an intermediate node is accessed, the end point of the edge to be searched is substituted into the linear function saved in the node as a variable, the calculated result is recorded as pos1, the pos1th child node of the intermediate node is continuously accessed, and the process is repeated until a leaf node is accessed; when the leaf node is accessed, the end point of the edge to be searched is substituted into the linear function saved in the leaf node as a variable, the calculated result is recorded as pos2, and exponential search is performed from the array pos2 position of the leaf node until the actual position of the edge is searched.

4. The data value oriented index construction and efficient search method according to claim 1, characterized in that, When the vertex degree is less than the set edge table index threshold, an array structure edge table is adopted.

5. The method of claim 1, wherein, When the vertex degree is greater than the set edge table index threshold, the edge table is implemented by using an index structure.

Citation Information

Patent Citations

  • Distributed key value storage method and device based on isomorphic adaptive learning index

    CN114138780A

  • Verifiable index construction and verification method based on data value

    CN114911867A