Graph data sorting method, system and device based on node renumbering and medium

Through node renumbering technology, the storage and computing efficiency of graph data are optimized, solving the problem of low storage and computing efficiency in graph neural networks, and supporting dynamic adjustment to achieve efficient graph data indexing and fast calculation.

CN118796902APending Publication Date: 2024-10-18QINGDAO PORT INT CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410769943.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-14
Publication Date
2024-10-18

AI Technical Summary

Technical Problem

The storage and computing efficiency of graph data in graph neural networks is low. Traditional storage methods lead to low memory access hit rates. Moreover, the index structure needs to be rebuilt when the graph database is dynamically adjusted, which affects real-time performance.

Method used

A graph data sorting method based on node renumbering is adopted to optimize the node arrangement order by constructing a graph network, aggregating and dividing node tables, improving the computing speed and storage efficiency of the graph neural network, and supporting dynamic adjustment.

Benefits of technology

It improves the storage efficiency of graph data and the calculation speed of graph neural network, reduces resource consumption, supports dynamic adjustment of graph data, enhances indexing efficiency, and adapts to changes in graph structure.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118796902A_ABST
    Figure CN118796902A_ABST
Patent Text Reader

Abstract

The invention provides a graph data sorting method, system and device based on node renumbering and a medium. The method comprises the following steps: constructing a graph network; taking a certain node as an aggregation center point, finding a node having a node relationship with the aggregation center point as a connection node, and storing the connection node into a first skip list; taking each connection node as a center point, calculating nodes having a node relationship with the connection nodes, removing aggregation center points, and storing the aggregation center points in a second skip list; combining the second skip list and the first skip list into a total skip list, determining whether the connection node is stored in the first-level aggregation list or not by using the occurrence frequency of a certain connection node in the total skip list, and judging whether the division of the first-level aggregation list is completed or not; dividing the first-level aggregation table into a trunk table and a plurality of second-level aggregation tables according to node degrees; and reordering the trunk table and the secondary aggregation table in each primary aggregation table according to the node sequence number. According to the invention, the storage efficiency of the graph data and the calculation speed of the graph neural network are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of graph data technology, and more specifically to a graph data sorting method, system, device and medium based on node renumbering. Background Art

[0002] Currently, graph data structures have become an indispensable data model in many fields due to their unique advantages in representing and analyzing complex relational networks; however, with the continuous expansion of data scale, the storage and processing efficiency of graph data has become a bottleneck restricting its further application. Especially in the calculation process of graph neural networks (GNNs), due to the sparsity of graph data and the random distribution of nodes, traditional graph data storage methods lead to low memory access hit rate, which not only affects the calculation speed, but also increases the consumption of computing resources; in addition, when the graph database is dynamically adjusted, such as adding and deleting nodes, it is often necessary to rebuild the entire index structure, which is particularly inconvenient in application scenarios with high real-time requirements.

[0003] In this context, efficient storage and fast computation of graph data have become a hot topic of research. Graph neural networks, as an emerging machine learning method, have achieved remarkable results in many fields by learning node representations on graph structured data. However, the performance of GNNs is largely limited by the storage and access efficiency of graph data. In practical applications, graph data is usually stored in the form of adjacency matrices, which results in huge memory overhead and inefficient memory access patterns when processing large-scale graphs. To solve these problems, researchers have proposed a variety of graph data compression and indexing techniques, but these methods often sacrifice certain computational efficiency while maintaining graph structure information.

[0004] In addition, the dynamic nature of graph data is also a challenge that cannot be ignored. In many practical applications, graph data is constantly changing. These dynamic changes require graph databases to be able to quickly adapt to new data structures, but traditional graph data storage methods do not perform well in this regard. Whenever the graph structure changes, the existing index structure often needs to be rebuilt, which is not only time-consuming and labor-intensive, but may also cause service interruptions and affect user experience. Summary of the invention

[0005] In response to the above problems, the purpose of the present invention is to provide a graph data sorting method, system, device and medium based on node renumbering. Through the node renumbering technology, the storage and computing efficiency problems of graph data in graph neural networks are effectively solved, the storage efficiency of graph data and the computing speed of graph neural networks are improved; and dynamic adjustment of graph data is supported.

[0006] In order to achieve the above object, the present invention is implemented through the following technical solutions:

[0007] In a first aspect, the present invention discloses a graph data sorting method based on node renumbering, comprising the following steps:

[0008] S1: Construct a graph network including nodes, node relationships, and node degrees;

[0009] S2: Taking a certain node as the aggregation center point, finding the nodes that have a node relationship with the aggregation center point as the connection nodes, and storing the connection nodes in the first jump table; taking each connection node as the center point, calculating the nodes that have a node relationship with the connection node, eliminating the aggregation center point and storing them in the second jump table; merging the second jump table with the first jump table into a total jump table, using the frequency of a certain connection node in the total jump table to determine whether to store the connection node in the first-level aggregation table, and judging whether the first-level aggregation table division is completed;

[0010] S3: Split the first-level aggregation table into a main table and several second-level aggregation tables according to the node degree;

[0011] S4: Reorder the main table and the secondary aggregation table in each primary aggregation table according to the node sequence number.

[0012] Further, step S2 includes the following steps:

[0013] S21: taking a certain node as the aggregation center point, finding nodes with a connection relationship to obtain a first jump table, and removing duplicate nodes in the first jump table to obtain a first node set;

[0014] S22: Find a node connected to the node according to the node in the first node set, and obtain a second jump table after deleting the aggregation center point;

[0015] S23: merging the first hop list and the second hop list to obtain a total hop list, counting the frequency of each node appearing in the total hop list, and obtaining a first-level aggregation table;

[0016] S24: performing a merge operation on several parallel first-level aggregate tables.

[0017] Further, step S23 includes the following steps:

[0018] S231: If the occurrence frequency of any node in the total jump table is greater than the first threshold or greater than the second threshold, write the node into the first-level aggregation table;

[0019] S232: If there is no node in the total jump table whose occurrence frequency is greater than the first threshold and greater than the second threshold, the first-level aggregation table division is completed.

[0020] Further, step S24 includes the following steps:

[0021] S241: Identify the number of common nodes between any two first-level aggregation tables;

[0022] S242: If the number of common nodes between any two first-level aggregation tables is greater than the third threshold and greater than the fourth threshold, merge the corresponding two first-level aggregation tables;

[0023] S243: If, among all the first-level aggregation tables, there are no two first-level aggregation tables whose common node numbers are greater than the third threshold and greater than the fourth threshold, a new first-level aggregation table is introduced.

[0024] Further, step S243 also includes:

[0025] Determine whether there are aggregation nodes that continue to grow in the new first-level aggregation table;

[0026] If yes, the aggregation center is retained and the number of nodes in the aggregation center continues to increase;

[0027] If not, save all first-level aggregate tables.

[0028] Further, step S3 includes:

[0029] The nodes in the first-level aggregation table are sorted in descending order according to the node degree, and several nodes whose node degrees are smaller than the fifth threshold are selected as the backbone table.

[0030] Further, step S3 also includes:

[0031] The remaining nodes in the first-level aggregation table that are greater than the fifth threshold are split into the second-level aggregation table;

[0032] Find the node with the smallest node degree among the remaining nodes, find the node with the smallest node degree connected to it with this node as the center, and find the node with the smallest node degree connected to it again with any one of the two nodes as the center, and continue the cycle until there are no connected nodes or the number of nodes reaches the sixth threshold, completing a secondary aggregation table split.

[0033] In a second aspect, the present invention further discloses a graph data sorting system based on node renumbering, comprising: a graph network construction module configured to construct a graph network including nodes, node relationships, and node degrees;

[0034] The aggregation table generation module is configured to take a certain node as the aggregation center point, find the nodes that have a node relationship with the aggregation center point as the connection nodes, and store the connection nodes in the first jump table; take each connection node as the center point, calculate the nodes that have a node relationship with the connection node, remove the aggregation center point and store them in the second jump table; merge the second jump table with the first jump table into a total jump table, use the frequency of a certain connection node in the total jump table to determine whether to store the connection node in the first-level aggregation table, and judge whether the division of the first-level aggregation table is completed;

[0035] An aggregation table partitioning module configured to partition a primary aggregation table into a main table and a plurality of secondary aggregation tables according to node degrees;

[0036] The sorting module is configured to re-sort the main table and the secondary aggregation table in each primary aggregation table according to the node sequence number.

[0037] In a third aspect, the present invention further discloses a graph data sorting device based on node renumbering, comprising:

[0038] A memory, used for storing a graph data sorting program based on node renumbering;

[0039] A processor is used to implement the steps of the graph data sorting method based on node renumbering as described in any of the above items when executing the graph data sorting program based on node renumbering.

[0040] In a fourth aspect, the present invention further discloses a readable storage medium, on which is stored a graph data sorting program based on node renumbering. When the graph data sorting program based on node renumbering is executed by a processor, the steps of the graph data sorting method based on node renumbering as described in any one of the above items are implemented.

[0041] Compared with the prior art, the present invention has the following beneficial effects:

[0042] 1. The present invention effectively solves the storage and computing efficiency problems of graph data in graph neural networks through node renumbering technology, improves the storage efficiency of graph data and the computing speed of graph neural networks; and supports dynamic adjustment of graph data, which has broad application prospects.

[0043] 2. The present invention effectively organizes nodes, optimizes the node arrangement order, improves the speed of graph neural networks, and reduces resource consumption through three stages of aggregation, segmentation, and rearrangement. Through the rearrangement stage, it can also ensure that the new serial number of the node matches the actual network structure. Node renumbering adds regional indexes to graph data through continuous division, effectively increasing the efficiency of graph data indexing.

[0044] 3. While improving the storage and computing efficiency of graph data, the present invention also has flexibility and scalability; the present invention can support dynamic adjustment of graph data, whether it is the addition or deletion of nodes, it can be quickly adapted through renumbering technology, and a small number of nodes can be deleted or modified on the results after the segmentation stage is completed, without the need to repeat the entire process for all points.

[0045] 4. The method of the present invention can also be added as a graph database index. The retrieval speed can be effectively improved by the method of the present invention. When a small part of the existing graph structure changes, the node renumbering can only perform a small range of calculation on the part related to the change and complete the index reconstruction.

[0046] It can be seen that compared with the prior art, the present invention has outstanding substantive features and significant progress, and the beneficial effects of its implementation are also obvious. BRIEF DESCRIPTION OF THE DRAWINGS

[0047] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.

[0048] Figure 1 It is a method flow chart of a graph data sorting method based on node renumbering in a specific implementation manner of the present invention.

[0049] Figure 2 It is a schematic diagram of node relationship connection of a specific implementation mode of the present invention.

[0050] Figure 3 It is a schematic diagram of different aggregation center points of a specific implementation mode of the present invention.

[0051] Figure 4 It is a schematic diagram of two aggregation centers with common nodes according to a specific implementation manner of the present invention.

[0052] Figure 5 It is a schematic diagram of merging two aggregation centers according to a specific implementation mode of the present invention.

[0053] Figure 6 It is a schematic diagram of introducing a new polymerization midpoint according to a specific implementation mode of the present invention.

[0054] Figure 7 It is a schematic diagram of the first change of the aggregation center of a specific implementation mode of the present invention.

[0055] Figure 8 It is a schematic diagram of the second variation of the polymerization center according to a specific embodiment of the present invention.

[0056] Fig. 9 It is a schematic diagram of the third variation of the aggregation center of the specific implementation mode of the present invention.

[0057] Fig.10 It is a schematic diagram of the fourth variation of the polymerization center of the specific implementation mode of the present invention.

[0058] Fig.11 It is a schematic diagram of the first segmentation process of the main table and the secondary aggregation table according to a specific implementation manner of the present invention.

[0059] Fig.12It is a schematic diagram of the second splitting process of the main table and the secondary aggregation table according to a specific implementation manner of the present invention.

[0060] Fig.13 It is a schematic diagram of the third segmentation process of the main table and the secondary aggregation table according to a specific implementation manner of the present invention.

[0061] Fig.14 It is a schematic diagram of the fourth segmentation process of the main table and the secondary aggregation table according to a specific implementation manner of the present invention.

[0062] Fig.15 It is a schematic diagram of the reordering stage of a specific implementation mode of the present invention.

[0063] Fig.16 It is a system structure diagram of a graph data sorting system based on node renumbering according to a specific implementation mode of the present invention.

[0064] Fig.17 It is a structural diagram of a graph data sorting device based on node renumbering in a specific implementation manner of the present invention.

[0065] In the figure, 1. graph network construction module; 2. aggregation table generation module; 3. aggregation table partition module; 4. sorting module; 101. processor; 102. memory; 103. input interface; 104. output interface; 105. communication unit; 106. keyboard; 107. display; 108. mouse. DETAILED DESCRIPTION

[0066] In order to enable those skilled in the art to better understand the scheme of the present invention, the present invention is further described in detail below in conjunction with the accompanying drawings and specific implementation methods. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.

[0067] See also Figure 1 As shown, this embodiment provides a graph data sorting method based on node renumbering, comprising the following steps:

[0068] S1: Construct a graph network including nodes, node relationships, and node degrees.

[0069] In a specific implementation, the graph network includes a number of nodes, there is a connection relationship between the nodes, the nodes are stored in a triple format, and the triple data format is csv or text; the graph network is composed of a number of triple data.

[0070] For example, in a graph network there are 1000 nodes x1-x 1000; A node relationship table consisting of several triple data consisting of 1000 nodes, the triple data format of the node relationship table is shown in Table 1:

[0071] Table 1 Node relationship table

[0072] node Node relationship type Node Degree node <![CDATA[x1]]> 2 2 <![CDATA[x2]]>

[0073] As shown in Table 1, the node relationship type of two nodes x1 and x2 is 2; for example, the two nodes represent A and B respectively, and their relationship is teacher-student, then the node relationship type is 1; if their relationship is friends, then the node relationship type is 2, if they have no relationship, then the node relationship type is 0, and so on; the node degree is the number of node relationships, for example, if they are both teacher-student and friends, then the node degree is 2; that is, the node relationship type is determined according to a certain attribute; the attribute can also be other classification criteria, such as like or dislike.

[0074] The node relationship tables of several triples are traversed and converted into connection matrix form. Due to the sparse characteristics of the graph network, the compressed storage format of the sparse matrix is ​​used to reduce the invalid storage space consumption. At the same time, in order to make the connection matrix full rank after adding the unit matrix, there is no need to record the position of the first non-zero element of each column in the matrix, so a storage format similar to the column compression storage format (Compressed Sparse Column matrix, CSC) is used to represent it, and the node attribute table Y0 is obtained. Figure 2 Taking several nodes in as examples, the format of the node attribute table Y0 is shown in Table 2:

[0075] Table 2 Node attribute table

[0076] node Node number Node Degree Connecting Nodes Edge Weight <![CDATA[x1]]> 1 6 <![CDATA[x2、x3、x4、x5]]> 0.8、1、0.8、1、0.6、0.1 <![CDATA[x2]]> 2 3 <![CDATA[x1、x3、x5]]> 0.8、0.3、0.5 ... ... ... ... <![CDATA[x 1000 ]]> 1000 1 x100 0.2

[0077] Among them, the connection node is a node that has a connection relationship with a certain node; the node degree can be obtained by the dict function; for example, in Table 2, there are 4 nodes connected to the node x1, and the node relationship types between x1 and x2 are 3, then the node degree of node x1 is 6; the edge weight can be set by user, or the edge weight acquisition method in the document GRAPH ATTENTION NETWORKS can be used; the edge weight is the assignment of the edge relationship, for example, if node x1 and node x2 are parents, the edge weight can be set to 1; if they are friends, the edge weight can be set to 0.5; the total weight of node x1 and node x2 is the weighted calculation of the weights of node x1 and node x2, and different weighting coefficients are assigned; Figure 2 For example, the total weight of x1 and x2 = 0.8*λ1+1*λ2+0.8*λ3; λ1, λ2, λ3 are weighting coefficients.

[0078] The free node table is composed of the node sequence number column in the node attribute table Y0. The free node table is a collection of nodes that are not included in any aggregation center.

[0079] S2: Take a certain node as the aggregation center, find the nodes that have a node relationship with the aggregation center as the connection nodes, and store the connection nodes in the first jump table; take each connection node as the center, calculate the nodes that have a node relationship with the connection node, remove the aggregation center and store them in the second jump table; merge the second jump table with the first jump table into a total jump table, use the frequency of a connection node in the total jump table to determine whether to store the connection node in the first-level aggregation table, and judge whether the first-level aggregation table division is completed. Among them, the number of nodes that have a node relationship with the aggregation center is greater than 1.

[0080] In a specific implementation, the purpose of this step is to use the frequency of occurrence of the nodes to perform aggregation analysis on the nodes in the node attribute table Y0 and store them in the first-level aggregation table Y1; different first-level aggregation tables Y1 have different aggregation centers, for example, Y1 1 、Y1 2 Represents two different first-level aggregate tables.

[0081] To improve the aggregation efficiency, you can use parallelism to execute aggregation tasks simultaneously. For example, if the parallelism is set to 2, Y1 can be executed simultaneously. 1 、Y1 2 The aggregation analysis of .

[0082] Specifically, this step includes the following sub-steps:

[0083] S21: Take a certain node as the aggregation center, find all nodes that are connected to the node to form the aggregation center, and access the corresponding row in the node attribute table Y0 to obtain the corresponding node number; at the same time, search the node attribute table Y0 to find all the connected nodes of the node and store them in the one-hop table Y2 i ; Where i is the node number of the aggregation center.

[0084] As an example, Figure 3 As shown, first, the three nodes indicated by arrows are used as aggregation centers to perform aggregation tasks in parallel; the aggregation centers are selected randomly, and multiple aggregation centers can be set simultaneously in one iteration process.

[0085] like Figure 2 As shown, taking x1 as the aggregation center point as an example, the corresponding one-hop table Y2 1 It is [x2, x2, x2, x3, x4, x5]. Since there are three node relationships between x1 and x2, x2 appears 3 times; among them, x2-x5 are the connecting nodes of x1.

[0086] Finally, remove the duplicate node numbers in the one-hop table Y2, for example: 1 Repeat the node number x2 in the hop set Y'2 to form a hop set Y'2. 1 is [x2, x3, x4, x5].

[0087] S22: Determine whether the total number of nodes in the one-hop set Y'2 is 1; when the total number of nodes in the one-hop set Y'2 is greater than 1, obtain the node connected to the node through the node in the one-hop set Y'2 to obtain a temporary two-hop table Y3.

[0088] like Figure 2 As shown, the temporary two-hop table Y3 1 Contains all nodes connected to x2 to x5;

[0089] Temporary two-hop table Y3 1 It is [x1, x1, x1, x3, x5, x2, x1, x4, x1, x3, x5, x1, x2]. The first 5 are nodes connected to x2. When a node has multiple connections, multiple nodes are recorded. The 6th to 8th are nodes connected to x3, and so on.

[0090] At the same time, the free node table is searched to find out the nodes that do not contain the aggregation center point, and the nodes are stored in the list corresponding to the nodes in the one-hop set Y'2 to form a two-hop table Y'3.

[0091] like Figure 2 As shown, x1 is the aggregation center, and the two-hop table Y'3 that does not contain x1 is obtained. 1 is [x3, x5, x2, x4, x3, x5, x2], that is, from the temporary two-hop table Y3 1 The aggregation center point x1 is eliminated.

[0092] S23, merging the one-hop table Y2 and the two-hop table Y'3 to obtain the total hop table Y4, and counting the frequency of each node appearing.

[0093] For example: Total jump table Y4 1 is [x3, x5, x2, x4, x3, x5, x2, x2, x2, x3, x4, x5].

[0094] First, if there is a node in the total jump table Y4 whose frequency of occurrence is greater than the first threshold n / k1 or a node whose frequency of occurrence is greater than the second threshold k2, the node is written into the first-level aggregation table Y1, and the nodes included in the aggregation center in the free node table are removed to obtain a new free node table.

[0095] Among them, n is the number of nodes in the aggregation center, and n increases with the number of iterations. For example, in the first iteration, there is only one aggregation center point x1, then n=1; k1 and k2 are global parameters, which are only set once, for example, k1=3 and k2=4; the first threshold and the second threshold are set to ensure the growth of the aggregation center.

[0096] At this time, if there is no node whose occurrence frequency is greater than the first threshold n / k1 and there is no node whose occurrence frequency is greater than the second threshold k2, it is considered that the first-level aggregation table Y1 is divided; save the first-level aggregation table Y1 and update the value of n; remove all aggregation center nodes in the free node table.

[0097] For example, the free node table is x1 to x 1000 , all aggregation center nodes of the first-level aggregation table Y1 are x1, x2, x3, x4, x5, then the new free node table is x6 to x 1000 .

[0098] S24: Check the two parallel first-level aggregate tables Y1.

[0099] As an example:

[0100] First, if the number of common nodes of the two first-level aggregation tables Y1 is greater than the third threshold n / k3 and the number of common nodes is greater than the fourth threshold k4, the two first-level aggregation tables Y1 are merged.

[0101] like Figure 4 and 5 Merger process; Figure 4 The two half-purple and half-black nodes in the middle circle are common nodes, both in the purple and black primary aggregation tables Y1, so the two primary aggregation tables Y1 are merged; Figure 5 The purple one is the merged first-level aggregate table Y1.

[0102] Cancel the first-level aggregation center point number with a large number, add all the nodes in it to the first-level aggregation center list with a small number, update the number of nodes in the first-level aggregation center, and set the point with a small number as the aggregation center point; finally, keep these aggregation centers and return to step 1; for example, Y1 1 With Y1 3 , the superscripts 1 and 3 are the serial numbers of the two first-level aggregation centers. If the merging conditions are met, the merged first-level aggregation table is Y1 1 .

[0103] At this time, if there are no two first-level aggregation tables Y1 whose common node number is greater than the third threshold n / k3 and whose common node number is greater than the fourth threshold k4, the two first-level aggregation centers are not merged, and the following process is executed:

[0104] 1. Introduce a new first-level aggregation table Y1. If the aggregation center of the new first-level aggregation table Y1 has an aggregation node that continues to grow, retain the aggregation center and return to step 1 to continue iterating;

[0105] The existence of continued growth means that the frequency of node appearance is greater than the first threshold value n / k1 or the frequency of node appearance is greater than the second threshold value k2.

[0106] like Figure 6 The green point is the new first-level aggregation center point, corresponding to Figure 7 The number of green aggregation nodes continues to grow.

[0107] 2. Introduce a new first-level aggregation table Y1. If there is no aggregation node that continues to grow in the aggregation center point of the new first-level aggregation table Y1, then save these aggregation centers and the aggregation center iteration ends.

[0108] The absence of a continuously growing aggregation node means that there is no node whose appearance frequency is greater than the first threshold n / k1 and there is no node whose appearance frequency is greater than the second threshold k2.

[0109] pass Figure 6-10 The node change process of multiple first-level aggregation tables can be intuitively seen. Figure 6-7 As shown, the number of red nodes and purple nodes in the figure does not continue to grow, and new aggregation centers need to be introduced. Figure 6 The green in the figure is the new aggregation center point. Figure 7-9 As shown in the figure, the number of green nodes continues to grow; Figure 9-10 As shown in , if the number of green nodes in the figure does not continue to grow, then three primary aggregation tables of red, purple and green are saved; Figure 8-10 As shown, the number of dark red nodes in the graph continues to grow; Figure 8-9 As shown in , the number of black nodes in the figure continues to grow; Figure 9-10 As shown, the number of black nodes in the graph does not continue to grow; Fig.10 Medium to dark purple indicates the introduction of new cluster centers.

[0110] In addition, in the aggregation phase, a series of control parameters are first defined to guide the aggregation process, including parallelism, aggregation center growth parameters, aggregation center trunk size parameters, etc. These parameters can be adjusted according to the specific graph data characteristics and computing requirements to achieve the best aggregation effect. The aggregation process is divided into several key steps, including:

[0111] Center point selection: First, select a certain number of free points, that is, unaggregated nodes, as the center points of aggregation. The selection of these center points is based on the local characteristics of the graph data to ensure that the aggregated node set has good locality.

[0112] One-hop table construction: For each center point, the algorithm traverses its directly connected nodes and constructs a one-hop table. The purpose is to identify the set of nodes directly connected to the center point and provide a basis for subsequent aggregation.

[0113] One-hop set formation: On the basis of constructing the one-hop table, the tables are further merged to form a one-hop set. By eliminating duplicate nodes, it is ensured that the node set in the one-hop set is unique.

[0114] Aggregation center division: Nodes are assigned to different aggregation centers according to the frequency of occurrence of nodes in the one-hop set. The key to this step is to ensure that the nodes inside the aggregation center are distributed as compactly as possible in memory to improve the efficiency of subsequent calculations.

[0115] Aggregation center optimization: In the later stage of the aggregation phase, the aggregation centers will be optimized, including merging aggregation centers with highly overlapping nodes and further splitting the nodes inside the aggregation centers according to the node degree.

[0116] S3: Split the first-level aggregation table into a main table and several second-level aggregation tables according to the node degree.

[0117] In a specific implementation, the purpose of this step is to split the first-level aggregation table Y1.

[0118] The purpose of the segmentation phase is to divide the nodes within the aggregation center more finely to form smaller and more compact clusters. The segmentation strategy is based on node degree. By merging nodes with similar degrees, the layout of nodes in memory is further optimized, which not only improves the locality of memory, but also provides a finer control granularity for subsequent graph data analysis.

[0119] Select a list in which the total number of nodes in a first-level aggregation table Y1 is greater than the fifth threshold k5 / 2 for segmentation; in the first-level aggregation table Y1, the fifth threshold k5 / 2 nodes are intercepted in descending order of node degree as the backbone table, and the remaining nodes are subjected to second-level aggregation.

[0120] For example: K5 is set to 32; assuming that the first-level aggregate table Y1 1 There are 50 nodes in , 50>32 / 2, which meets the split condition; and according to the descending order of the node degree, 16 nodes are selected according to the fifth threshold k5 / 2, and the 16 nodes are used as the backbone without processing, and the backbone table is obtained.

[0121] For the remaining nodes 17-50, starting from the point with the smallest node degree, find the node with the smallest node degree among the nodes connected to it, store the two points in the secondary aggregation table, and repeat this process until there are no connected nodes or the number of nodes in the secondary aggregation table reaches the sixth threshold k6; then save the secondary aggregation table and repeat the above steps until all nodes are assigned to their respective secondary aggregation tables.

[0122] by Fig.10 Take the first-level aggregation table composed of red nodes as an example. Fig.11 As shown in the figure, let the fifth threshold be 4. There are 11 nodes in the red primary aggregation table. First, select 4 nodes from high to low according to the order of node degree, that is, Fig.11 The four nodes in the red embedded black are used as the backbone table; secondly, the remaining seven nodes are aggregated at the second level, and the sixth threshold is set to 4. First, the node with the smallest node degree among the remaining nodes is found, such as Fig.12 As shown, the red and yellow node 0 has the smallest node degree among the 7 nodes; with node 0 as the center, find node 1 with the smallest node degree connected to node 0; then with node 0 and node 1 as the center, find node 2 with the smallest node degree connected to node 0 or 1; then with nodes 0, 1, and 2 as the center, find node 3 with the smallest node degree connected to node 0 or 1 or 2; since the threshold is 4, nodes 0-3 are used as the first secondary aggregation table; among the remaining 3 nodes, find node 0' with the smallest node degree, with node 0' as the center, find node 1' with the smallest node degree connected to node 0', and then with node 0' or 1' as the center, if no node connected to it is found, the second secondary aggregation table is completed; as shown Fig.14 As shown, the remaining last node "0" is divided into the third secondary aggregation table.

[0123] That is, a first-level aggregate table Y1 is divided into a main table and several second-level aggregate tables. Fig.10 The red first-level aggregation table Y1 is divided into 1 main table and 3 second-level aggregation tables.

[0124] like Fig.15 As shown, several first-level aggregation tables Y1 are spliced ​​into a total aggregation table Y all ; That is, the first-level aggregation table 1, the first-level aggregation table 2 and the first-level aggregation table 3 are the total aggregation table Y all .

[0125] S4: Reorder the main table and the secondary aggregation table in each primary aggregation table according to the node sequence number.

[0126] In a specific implementation, the reordering phase is entered, and the total aggregation table Y all Renumber the nodes in each first-level aggregation table Y1 to ensure that the node numbers in the same aggregation center are continuous;

[0127] That is, only the main table and the secondary aggregation table in each primary aggregation table Y1 are sorted, for example Fig.15 Only the first-level aggregate table 1, first-level aggregate table 2, and first-level aggregate table 3 are sorted separately.

[0128] This step involves updating the node features to adapt to the new numbering order; the rearrangement process not only simplifies the storage structure of the graph data, but also facilitates the subsequent maintenance of the graph database.

[0129] like Fig.15 As shown in the figure, the total aggregation table is composed of 3 first-level aggregation tables. Each first-level aggregation table is divided into a backbone table and several second-level aggregation tables. The nodes of the backbone table in each first-level aggregation table and each second-level aggregation table are sorted separately, either in ascending order or in descending order.

[0130] After the aggregation stage, the original nodes are divided into several aggregation centers; after the segmentation stage, the aggregation center is divided into several blocks; all points in the same aggregation center are renumbered, and the numbers are continuous; the blocks inside all aggregation centers also renumber the nodes in the list in sequence, and finally a new node sequence is obtained; in actual use, the node features under the corresponding sequence numbers need to be updated according to the node sequence numbers before and after the change.

[0131] The experimental verification process of this method is as follows:

[0132] Use Python to implement node renumbering and set the parallelism to 5. At the same time, for a clearer and more concise description, the points not included in any aggregation center are called free points, and vice versa. The initial point selected at the beginning of each cycle is called the center point. There are 6 control parameters in total, k0 is the total number of caches, k1 and k2 are parameters for controlling the growth of the first-level aggregation center in the aggregation stage, k3 and k4 are parameters for limiting the growth of the first-level aggregation center, k5 is a parameter for controlling the size of the first-level aggregation center trunk in the segmentation stage, and k6 is a parameter for controlling the size of the second-level aggregation center in the segmentation stage.

[0133] Among them, the aggregation center after the division in the aggregation stage is called the first-level aggregation center, and the aggregation center after the division in the segmentation stage is called the second-level aggregation center.

[0134] In order to verify the effectiveness of the present invention, a series of simulation tests were designed; these tests were performed using Python, simulating the memory access process of the graph neural network in the aggregation phase, and comparing the cache hit rates of the original data, after node renumbering, and after node renumbering plus aggregation center data prefetching; the test results show that the method of the present invention performs well in improving the cache hit rate and reducing the number of memory accesses, significantly improving the computing speed of the graph neural network.

[0135] To verify the effectiveness of the method of the present invention, Python is used to simulate the cache hit rate test and count the number of memory accesses. By simulating the memory access process in the aggregation stage, since only the cache hit rate is tested, a first-level cache is set here. The cache size is an integer variable with a length of 1, which is used to store the node number. The depth is 64, and the update rule is to replace the earliest accessed row. The whole process simulates the actual aggregation order, and the node numbers are aggregated in order from small to large, and the cache is initialized to all zeros.

[0136] The simulation test process includes the following three groups:

[0137] Test 1: Raw data cache hit rate test;

[0138] Test 2: cache hit rate test after node renumbering;

[0139] Test 3: Node renumbering + aggregation center data pre-fetch cache hit rate test;

[0140] In test 3, the cache with a depth of 64 is split into two caches with a depth of 32, named cache0 and cache1 respectively; when a node marked as the start of the backbone is encountered, 32 nodes are prefetched downward from this node and saved in cache0; cache0 is only used for prefetching data for the backbone; when a starting node marked as the start of the secondary aggregation center is encountered, 32 nodes are prefetched downward from this node and saved in cache1; cache1 follows the least recently used replacement strategy.

[0141] This experiment tests the most widely used graph datasets Cora, Pubmed, and Citeseer. The test results are shown in Table 3 below:

[0142] Table 3 Comparison of cache hit rates of different test methods on different data sets

[0143] Cache hit rate Test 1 Test 2 Test 3 Cora 13.3293% 50.5202% 83.7229% Pubmed 1.33899% 24.3787% 79.0366% CiteSeer 7.4134% 54.0822% 87.7816%

[0144] It can be seen that the graph data sorting method based on node renumbering disclosed in the present invention effectively solves the problems of low cache hit rate and computing efficiency when graph data is aggregated in graph neural networks; it not only improves the storage efficiency of graph data, but also significantly improves the computing speed of graph neural networks, while supporting dynamic adjustment of graph data, and has broad application prospects; with the continuous development of graph neural networks and graph data processing technologies, the method of the present invention is expected to become an important force to promote progress in related fields.

[0145] This method effectively organizes nodes and optimizes the node arrangement order through three stages of aggregation, segmentation and rearrangement. In practical applications, it improves the speed of graph neural networks and reduces resource consumption. Through the rearrangement stage, it can also ensure that the new sequence number of the node matches the actual network structure. At the same time, node renumbering only requires the above processing of a single point when the network changes, and the changed network can be quickly calculated and rearranged. At the same time, the node renumbering algorithm can add regional indexes to graph data through continuous division, effectively increasing the efficiency of graph data indexing.

[0146] While improving the computational efficiency and storage of graph data, this method also has good flexibility and scalability; it supports dynamic adjustment of graph data, and whether it is the addition or deletion of nodes, it can be quickly adapted through renumbering technology without rebuilding the entire graph structure; this feature makes the present invention have significant advantages in application scenarios with high real-time requirements.

[0147] See also Fig.16 As shown, the present invention also discloses a graph data sorting system based on node renumbering, including: a graph network construction module 1, an aggregation table generation module 2, an aggregation table partitioning module 3 and a sorting module 4.

[0148] The graph network construction module 1 is configured to construct a graph network including nodes, node relationships, and node degrees.

[0149] The aggregation table generation module 2 is configured to take a certain node as the aggregation center point, find the nodes that have a node relationship with the aggregation center point as the connection nodes, and store the connection nodes in the first jump table; take each connection node as the center point, calculate the nodes that have a node relationship with the connection node, eliminate the aggregation center point and store them in the second jump table; merge the second jump table with the first jump table into a total jump table, use the frequency of occurrence of a certain connection node in the total jump table to determine whether to store the connection node in the first-level aggregation table, and judge whether the division of the first-level aggregation table is completed.

[0150] The aggregation table partitioning module 3 is configured to partition the first-level aggregation table into a main table and a plurality of second-level aggregation tables according to the node degree.

[0151] The sorting module 4 is configured to re-sort the main table and the secondary aggregation table in each primary aggregation table according to the node sequence number.

[0152] The specific implementation of the graph data sorting system based on node renumbering in this embodiment is basically consistent with the specific implementation of the above-mentioned graph data sorting method based on node renumbering, and will not be repeated here.

[0153] See also Fig.17As shown, the present invention also discloses a graph data sorting device based on node renumbering, comprising a processor 101 and a memory 102; wherein, when the processor 101 executes the graph data sorting program based on node renumbering stored in the memory, it implements the steps of the graph data sorting method based on node renumbering as described in any one of the above items.

[0154] The graph data sorting device based on node renumbering provided in this embodiment may include but is not limited to a smart phone, a tablet computer, a laptop computer or a desktop computer.

[0155] Among them, the processor 101 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 101 can be implemented in at least one hardware form of a digital signal processor (DSP), a field-programmable gate array (FPGA), and a programmable logic array (PLA). The processor 101 may also include a main processor and a coprocessor. The main processor is a processor for processing data in an awake state, also known as a central processing unit (CPU); the coprocessor is a low-power processor for processing data in a standby state. In some embodiments, the processor 101 may be integrated with a graphics processing unit (GPU), and the GPU is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 101 may also include an artificial intelligence (AI) processor, which is used to process computing operations related to machine learning.

[0156] The memory 102 may include one or more computer-readable storage media, which may be non-transitory. The memory 102 may also include a high-speed random access memory, and a non-volatile memory, such as one or more disk storage devices, flash memory storage devices. In this embodiment, the memory 102 is at least used to store the following computer program, wherein, after the computer program is loaded and executed by the processor 101, it can implement the relevant steps of the graph data sorting method based on node renumbering disclosed in any of the aforementioned embodiments. In addition, the resources stored in the memory 102 may also include an operating system and data, etc., and the storage method may be temporary storage or permanent storage. Among them, the operating system may include Windows, Unix, Linux, etc. The data may include but is not limited to the data involved in the above-mentioned graph data sorting method based on node renumbering, etc.

[0157] Furthermore, the graph data sorting device based on node renumbering in this embodiment may also include:

[0158] The input interface 103 is used to obtain the graph data sorting program based on node renumbering imported from the outside, and save the obtained graph data sorting program based on node renumbering to the memory 102. It can also be used to obtain various instructions and parameters transmitted by external terminal devices, and transmit them to the processor 101, so that the processor 101 can use the above various instructions and parameters to carry out corresponding processing. In this embodiment, the input interface 103 can specifically include but is not limited to a USB interface, a serial interface, a voice input interface, a fingerprint input interface, a hard disk reading interface, etc.

[0159] The output interface 104 is used to output various data generated by the processor 101 to a terminal device connected thereto, so that other terminal devices connected to the output interface can obtain various data generated by the processor 101. In this embodiment, the output interface 104 may specifically include but is not limited to a USB interface, a serial interface, and the like.

[0160] The communication unit 105 is used to establish a remote communication connection between the server operation service optimization configuration device and the external server, so that the graph data sorting device based on node renumbering can mount the image file to the external server. In this embodiment, the communication unit 105 can specifically include but is not limited to a remote communication unit based on wireless communication technology or wired communication technology.

[0161] The keyboard 106 is used to obtain various parameter data or instructions input by the user by tapping the keycaps in real time.

[0162] The display 107 is used to display relevant information of the process of running the graph data sorting based on node renumbering in real time.

[0163] The mouse 108 can be used to assist the user in inputting data and simplify the user's operation.

[0164] The present invention also discloses a readable storage medium, wherein the readable storage medium includes a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable hard disk, a CD-ROM or any other form of storage medium known in the technical field. The readable storage medium stores a graph data sorting program based on node renumbering, and when the graph data sorting program based on node renumbering is executed by a processor, the steps of the graph data sorting method based on node renumbering as described in any of the above items are implemented.

[0165] In summary, the present invention effectively solves the storage and computing efficiency problems of graph data in graph neural networks through node renumbering technology, improves the storage efficiency of graph data and the computing speed of graph neural networks; and supports dynamic adjustment of graph data.

[0166] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the method disclosed in the embodiment, since it corresponds to the system disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part.

[0167] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.

[0168] In the several embodiments provided by the present invention, it should be understood that the disclosed systems, systems and methods can be implemented in other ways. For example, the system embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of systems or units, which can be electrical, mechanical or other forms.

[0169] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0170] In addition, each functional module in each embodiment of the present invention may be integrated into one processing unit, or each module may exist physically separately, or two or more modules may be integrated into one unit.

[0171] Similarly, each processing unit in each embodiment of the present invention may be integrated into one functional module, or each processing unit may exist physically, or two or more processing units may be integrated into one functional module.

[0172] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented directly using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.

[0173] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.

[0174] The above is a detailed introduction to the graph data sorting method, system, device and readable storage medium based on node renumbering provided by the present invention. Specific examples are used herein to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea. It should be pointed out that for ordinary technicians in this technical field, without departing from the principles of the present invention, several improvements and modifications can be made to the present invention, and these improvements and modifications also fall within the scope of protection of the claims of the present invention.

Claims

1. A graph data sorting method based on node renumbering, It is characterized in that The steps include: S1: Construct a graph network including nodes, node relationships, and node degrees; S2: Taking a certain node as the aggregation center point, find the nodes that have a node relationship with the aggregation center point as the connection nodes, and store the connection nodes in the first jump table; taking each connection node as the center point, calculate the nodes that have a node relationship with the connection node, remove the aggregation center point and store them in the second jump table; The second jump table and the first jump table are combined into a total jump table, and the frequency of a connection node in the total jump table is used to determine whether to store the connection node in the first-level aggregation table, and whether the first-level aggregation table division is completed; S3: Split the first-level aggregation table into a main table and several second-level aggregation tables according to the node degree; S4: Reorder the main table and the secondary aggregation table in each primary aggregation table according to the node sequence number.

2. The graph data sorting method based on node renumbering according to claim 1, It is characterized in that The step S2 comprises the following steps: S21: taking a certain node as the aggregation center point, finding nodes with a connection relationship to obtain a first jump table, and removing duplicate nodes in the first jump table to obtain a first node set; S22: Find a node connected to the node according to the node in the first node set, and obtain a second jump table after deleting the aggregation center point; S23: merging the first hop list and the second hop list to obtain a total hop list, counting the frequency of each node appearing in the total hop list, and obtaining a first-level aggregation table; S24: performing a merge operation on several parallel first-level aggregate tables.

3. The graph data sorting method based on node renumbering according to claim 2, It is characterized in that The step S23 comprises the following steps: S231: If the occurrence frequency of any node in the total jump table is greater than the first threshold or greater than the second threshold, write the node into the first-level aggregation table; S232: If there is no node in the total jump table whose occurrence frequency is greater than the first threshold and greater than the second threshold, the first-level aggregation table division is completed.

4. The graph data sorting method based on node renumbering according to claim 2, It is characterized in that The step S24 comprises the following steps: S241: Identify the number of common nodes between any two first-level aggregation tables; S242: If the number of common nodes between any two first-level aggregation tables is greater than the third threshold and greater than the fourth threshold, merge the corresponding two first-level aggregation tables; S243: If, among all the first-level aggregation tables, there are no two first-level aggregation tables whose common node numbers are greater than the third threshold and greater than the fourth threshold, a new first-level aggregation table is introduced.

5. The graph data sorting method based on node renumbering according to claim 4, It is characterized in that The step S243 further includes: Determine whether there are aggregation nodes that continue to grow in the new first-level aggregation table; If yes, the aggregation center is retained and the number of nodes in the aggregation center continues to increase; If not, save all first-level aggregate tables.

6. The graph data sorting method based on node renumbering according to claim 1, It is characterized in that The step S3 comprises: The nodes in the first-level aggregation table are sorted in descending order according to the node degree, and several nodes whose node degrees are smaller than the fifth threshold are selected as the backbone table.

7. The graph data sorting method based on node renumbering according to claim 6, It is characterized in that The step S3 further comprises: The remaining nodes in the first-level aggregation table that are greater than the fifth threshold are split into the second-level aggregation table; Find the node with the smallest node degree among the remaining nodes, find the node with the smallest node degree connected to it with this node as the center, and find the node with the smallest node degree connected to it again with any one of the two nodes as the center, and continue the cycle until there are no connected nodes or the number of nodes reaches the sixth threshold, completing a secondary aggregation table split.

8. A graph data sorting system based on node renumbering, It is characterized in that include: A graph network construction module, configured to construct a graph network including nodes, node relationships, and node degrees; The aggregation table generation module is configured to use a certain node as an aggregation center point, find nodes that have a node relationship with the aggregation center point as connection nodes, and store the connection nodes in a first jump table; Taking each connected node as the center point, calculate the nodes that have a node relationship with the connected node, remove the aggregation center point and store it in the second jump table; The second jump table and the first jump table are combined into a total jump table, and the frequency of a connection node in the total jump table is used to determine whether to store the connection node in the first-level aggregation table, and whether the first-level aggregation table division is completed; An aggregation table partitioning module configured to partition a primary aggregation table into a main table and a plurality of secondary aggregation tables according to node degrees; The sorting module is configured to re-sort the main table and the secondary aggregation table in each primary aggregation table according to the node sequence number.

9. A graph data sorting device based on node renumbering, It is characterized in that include: A memory, used for storing a graph data sorting program based on node renumbering; A processor, configured to implement the steps of the graph data sorting method based on node renumbering as described in any one of claims 1 to 7 when executing the graph data sorting program based on node renumbering.

10. A readable storage medium, Features: The readable storage medium stores a graph data sorting program based on node renumbering, and when the graph data sorting program based on node renumbering is executed by a processor, the steps of the graph data sorting method based on node renumbering as described in any one of claims 1 to 7 are implemented.