A multi-layer penetration query method and device of a graph database
By calculating the density of graph nodes offline and caching query results, and splitting the query task into subtasks, the slow response and memory overflow problems in multi-level penetration queries of graph databases are solved, and a fast and efficient query process is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-02-16
- Publication Date
- 2026-03-24
AI Technical Summary
Existing technologies suffer from slow response times and memory overflow issues in multi-level penetration queries in graph databases, especially when querying dense nodes.
The density of each node in the graph is calculated offline. The penetration query results of the dense nodes are pre-stored in the cache. When querying, the cache is checked based on the node density. If the cache is not hit, the query task is split into multiple sub-tasks for querying, and finally the results are merged.
It significantly reduces query response time and the possibility of memory overflow, thereby improving query speed and efficiency.
Smart Images

Figure CN116244479B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data access, and in particular to a multi-level penetration query method and apparatus for graph databases based on offline node density statistics. Background Technology
[0002] For statistical results, we often want to know more about the source and composition of the numbers, and even need to find out the specific details of each order. This is where drill-down queries come in. For example, clicking on a corresponding number in a statistical table will display a list of forms that make up that number, showing how many orders that number consists of. Clicking on a specific form will display the original state of that form. In this way, it's like drilling down through layers of a summary result to find the initial state of the number.
[0003] In existing technologies, when performing penetration queries on graph databases, a fixed maximum query depth is typically specified for all nodes. Figure 1 This is a flowchart illustrating an example of a penetration query method in a graph database in the prior art. For example... Figure 1 As shown, in existing graph database penetration query methods, a maximum query depth is specified based on business needs and practical experience, and then a penetration query is performed on the graph database based on a single multi-level penetration query task. The problem with this approach is that, since graph data is stored in the database as a data structure of nodes and edges, the amount of data covered by a single query at the same depth can vary greatly depending on the density of the nodes. Furthermore, since a fixed maximum query depth is specified for all nodes, specifying an excessively large query depth can lead to slow response times and graph database memory overflow when querying dense nodes. Summary of the Invention
[0004] In order to eliminate one or more of the above-mentioned problems, the present invention aims to provide a multi-level penetration query method and apparatus for graph databases that has a fast query response speed and can reduce the possibility of memory overflow during query.
[0005] A multi-level penetration query method for graph databases according to one aspect of the present invention is characterized by comprising:
[0006] The judgment step is to receive a penetration query task and determine whether the data in the cache is hit based on the density of the query nodes involved in the penetration query task. If yes, the following reading step is performed; if no, the following splitting step is performed. In the cache, the penetration query results of nodes with a specified density are stored in advance.
[0007] The reading step directly reads the penetration query results from the cache and proceeds to the following output step;
[0008] The splitting step involves dividing the penetration query task into multiple query subtasks and obtaining the query results of the multiple query subtasks;
[0009] The merging step merges the query results of the multiple query subtasks to obtain a penetration query result; and
[0010] Output the results of the penetration query.
[0011] Optionally, the following steps are included before the determination step:
[0012] Calculate the density of each node within the graph offline and store the density in the graph database; and
[0013] The results of penetration queries for nodes with a specified density are pre-written into the cache.
[0014] Optionally, the nodes with the specified density include one or more of the following:
[0015] Supernodes; and
[0016] Hotspot nodes
[0017] Specifically, the number of nodes reachable by a node at a certain depth, or the depth of the level, is defined as the node density at that depth, and nodes whose node density reaches a specified threshold are defined as supernodes.
[0018] The hotspot nodes are determined based on production experience.
[0019] Optionally, the determination step includes:
[0020] Get the node density of the queried node;
[0021] Based on the current query depth and the preset density benchmark value, determine whether the queried node is a dense point based on the node density of the queried node;
[0022] If the node is not dense, the graph database is called directly for a penetration query; if the node is dense, it is determined whether the data in the cache is hit.
[0023] Optionally, the splitting step includes:
[0024] Assuming the queried node is V0 and the query depth is x, the penetration query task is to call the penetration query of the graph database at a depth of t, then the set of leaf nodes Vt with a maximum depth of i and the set of parent paths Pti corresponding to each leaf node are obtained.
[0025] For each node Vti in the leaf node set Vt, a corresponding subquery task is created with a query depth of xt and the query rules are the same as those for the queried node V0.
[0026] Obtain the query results of multiple sub-query tasks, namely, the set of sub-paths CPti with a maximum depth of xt starting from the node Vti.
[0027] Optionally, the merging step includes:
[0028] Merge the parent path set Pti and the child path set CPti; and
[0029] Cut off loop paths and remove duplicates according to the prescribed principles.
[0030] Optionally, the specified principle is that points can be repeated but edges cannot be repeated.
[0031] A multi-level penetration query device for a graph database according to one aspect of the present invention is characterized in that it includes:
[0032] The caching module pre-stores the results of the penetration query of nodes with a specified density;
[0033] The judgment module is used to receive the penetration query task and determine whether the data in the cache is hit based on the density of the query nodes involved in the penetration query task.
[0034] The read module is used to read the penetration query results from the cache;
[0035] The splitting module is used to split the penetration query task into multiple query subtasks and obtain the query results of the multiple query subtasks;
[0036] The merging module is used to merge the query results of the multiple query subtasks to obtain a penetration query result; and
[0037] The output module is used to output the results of the penetration query.
[0038] Optionally, it further includes:
[0039] The calculation module is used to calculate the density of each node in the graph offline;
[0040] A graph database for storing the density; and
[0041] The write module is used to write the results of the penetration query of nodes with a specified density into the cache.
[0042] Optionally, the nodes with the specified density include one or more of the following:
[0043] Supernodes; and
[0044] Hotspot nodes.
[0045] Here, the number of nodes reachable by a node at a certain depth, or the depth of the level, is defined as the node density at that depth. Nodes whose node density reaches a specified threshold are defined as supernodes.
[0046] The hotspot nodes are determined based on production experience.
[0047] Optionally, the following actions are performed in the determination module:
[0048] Get the node density of the queried node;
[0049] Based on the current query depth and the pre-set density benchmark value, determine whether the queried node is a dense node based on the node density.
[0050] If the node is not dense, the graph database is called directly for a penetration query; if the node is dense, it is determined whether the data in the cache is hit.
[0051] Optionally, the splitting module performs the following actions:
[0052] Assuming the queried node is V0 and the query depth is x, the multi-level penetration query task is to call the penetration query of the graph database with a depth of t, then the set of leaf nodes Vt with a maximum depth of i and the set of parent paths Pti corresponding to each leaf node are obtained.
[0053] For each node Vti within the leaf node set Vt, a corresponding subquery task is created with a query depth of xt and the query rules are the same as those for the queried node V0; and
[0054] Obtain the query results of multiple sub-query tasks, namely, the set of sub-paths CPti with a maximum depth of xt starting from the node Vti.
[0055] Optionally, the merging module performs the following tasks:
[0056] Merge the parent path set Pti and the child path set CPti; and
[0057] Cut off loop paths and remove duplicates according to the prescribed principles.
[0058] Optionally, the specified principle is that points can be repeated but edges cannot be repeated.
[0059] The equity relationship penetration query method of this invention applies the multi-level penetration query method of the graph database.
[0060] The present invention provides a computer-readable medium having a computer program stored thereon, which, when executed by a processor, describes a multi-level penetration query method for a graph database.
[0061] A computer device according to one aspect of the present invention includes a storage module, a processor, and a computer program stored on the storage module and executable on the processor. When the processor executes the computer program, it implements the multi-level penetration query method for the graph database.
[0062] The multi-level penetration query method and apparatus for graph databases according to the present invention can significantly reduce the response time of complex queries and significantly reduce the possibility of the query process terminating due to memory overflow. Attached Figure Description
[0063] The above and other objects and advantages of this application will become more fully clear from the following detailed description taken in conjunction with the accompanying drawings, wherein the same or similar elements are denoted by the same reference numerals.
[0064] Figure 1 This is a flowchart illustrating an example of a penetration query method for graph databases in the prior art.
[0065] Figure 2 This is a summary flowchart of a multi-level penetration query method for a graph database according to an embodiment of the present invention.
[0066] Figure 3 This is a diagram illustrating an example of the queried node V0.
[0067] Figure 4 This is a schematic diagram representing an example of a leaf node with a maximum depth of i.
[0068] Figure 5 This is a schematic diagram representing an example of the queried node Vti.
[0069] Figure 6 This is a schematic diagram illustrating an example of merging the query results of various subquery tasks.
[0070] Figure 7 This is a diagram illustrating an example of truncating a loop path and removing duplicates.
[0071] Figure 8 This is a structural block diagram illustrating a multi-level penetration query device for a graph database according to one embodiment of the present invention. Detailed Implementation
[0072] The following are some embodiments of the present invention, intended to provide a basic understanding of the invention. They are not intended to identify key or decisive elements of the invention or to limit the scope of protection sought.
[0073] For purposes of brevity and illustrativeness, the principles of the invention are described herein primarily with reference to exemplary embodiments thereof. However, those skilled in the art will readily recognize that the same principles are equivalently applicable to multi-level penetration query methods and apparatuses for all types of graph databases, and that these same principles can be implemented therein, and any such variations do not depart from the true spirit and scope of this patent application.
[0074] Furthermore, reference is made in the following description to the accompanying drawings, which illustrate specific exemplary embodiments. Electrical, mechanical, logical, and structural modifications may be made to these embodiments without departing from the spirit and scope of the invention. Moreover, while features of the invention are disclosed in conjunction with only one of several embodiments, this feature may be combined with one or more other features of other embodiments if desired and / or advantageous for any given or identifiable function. Therefore, the following description should not be considered limiting in any sense, and the scope of the invention is defined by the appended claims and their equivalents.
[0075] Terms such as “possessing” and “comprising” indicate that, in addition to having units (modules) and steps that are directly and explicitly stated in the specification and claims, the technical solution of the present invention does not exclude the presence of other units (modules) and steps that are not directly or explicitly stated.
[0076] First, some technical terms that will appear in this invention will be defined and explained.
[0077] (1) Node density
[0078] In this invention, the node density of a node at a certain depth is defined as the number of nodes reachable by a node at a certain level depth divided by the level depth.
[0079] (2) Dense nodes (also referred to as super nodes in this invention):
[0080] For node density, nodes that reach a specified threshold (e.g., the top 5%) in the entire graph are defined as dense nodes at that depth.
[0081] (3) Dense point statistical method
[0082] For a node table V and a relation table E, a left join of V to E yields the reachable nodes within level 1 for each node in V. Continuing with a left join of level 1 reachable nodes to E, and after filtering loop paths and removing duplicates, level 2 reachable nodes are obtained. This process continues, allowing for the statistical determination of node density from levels 1 to 15 in table V. Based on the definition of dense nodes, the top percentage (e.g., 5%) of node density for each level is found, and nodes exceeding this percentage are labeled with their corresponding levels. Here, "left join" refers to a left connection, such as a left join of Table 1 to Table 2. "Left-major" means that Table 1 is the primary node, and the data from Table 2 is linked. The retrieved result displays all data from the left side, while the right side displays the data that intersects with the left side.
[0083] (4) Dense node (super node) path caching
[0084] Since the offline statistics process in the previous step can obtain the complete path from each node within, for example, 5 layers, and considering that the query results of the complete path are quite large, this invention tries to record only a small number of query results of commonly used query depths. For example, the complete paths of the nodes with the density in the top 1% of the 5 layers and the hot nodes obtained from daily production experience are cached. Of course, this is only a preferred example. This invention does not limit the specific number of layers and proportions, etc. Those skilled in the art can adopt appropriate number of layers and proportions based on experience.
[0085] (5) Equity penetration diagram
[0086] It uses equity structure diagrams to accurately present the multi-level equity structure of a company, helping investors quickly and efficiently understand the equity relationships of a company's investments and avoid investment risks.
[0087] The following describes a multi-level penetration query method and apparatus for graph databases according to an embodiment of the present invention.
[0088] Figure 2 This is a summary flowchart of a multi-level penetration query method for a graph database according to an embodiment of the present invention.
[0089] like Figure 2 As shown, the outline of a multi-level penetration query method for graph databases according to an embodiment of the present invention includes:
[0090] S100: Calculates the density information of each node in the graph offline (e.g., daily scheduled Spark tasks calculate the density of each node in the graph) and stores the density information in the graph database.
[0091] S200: Write the results of the penetration query of nodes with a specified density (e.g., a portion of super nodes and hot nodes) into the cache;
[0092] S300: When querying the graph database, determine whether the cached data is hit based on the node density information (i.e., determine whether it is a node with the density specified above). If yes, continue to step S400; otherwise, skip to step S500.
[0093] S400: Directly read the penetration query results in the cache and jump to step S700;
[0094] S500: Split query task, which means breaking down a query task into multiple query subtasks with finer granularity;
[0095] S600: Merges the query results of multiple query subtasks; and
[0096] S700: Output the query results.
[0097] Next, a specific example of the multi-level penetration query method for graph databases of the present invention will be described in detail.
[0098] In this specific example, the multi-level penetration query method for graph databases of the present invention includes the following steps:
[0099] Step 1: Obtain the node density information of the queried node [d1,d2,d3,d4,…,d15];
[0100] Step 2: Determine whether the current node is a dense node based on the current query depth and the density baseline value [s1,s2,s3,s4,…,s15].
[0101] Step 3: If it is not a dense point, directly call the graph database to perform a penetration query; if it is a dense point, proceed to step 4.
[0102] Step 4: Attempt to read the offline dense point path cache. If a cache exists, prune the path based on the current depth, remove duplicate paths, and return the query results. Otherwise, proceed to step 5.
[0103] Step 5: Find the previous non-dense depth of the queried node, and call the graph database at that depth to perform a penetration query;
[0104] Step 6: Based on the endpoint of Step 5, create several concurrent subqueries and set the depth of the subqueries accordingly. Repeat the query process starting from Step 1 and return the query results.
[0105] Step 7: Merge the results of each subquery, and filter and deduplicate the loop path;
[0106] Step 8: Return the final result.
[0107] Next, the specific content of these steps will be described.
[0108] Figure 3 A schematic diagram showing an example of the queried node V0.
[0109] As Figure 3 shown, the queried node is V0, the query depth is x, the node density information of the obtained node V0 is [d1, d2, d3, d4…, d15], and the benchmark values of the node densities at each level are 5% (here, 5% is taken as an example for illustration) [s1, s2, s3, s4…, s15].
[0110] Among them, if the current query depth is less than or equal to the specified value (for example, 5), and the queried node exists in the cache, then after reading the cache, it is pruned to the current query depth and returned; otherwise, according to the current query depth x, the corresponding dx and sx are obtained. If dx > sx, then the node V0 is a dense point at depth x, otherwise the node V0 is not a dense point at depth x.
[0111] In the case of a non-dense point, a direct penetration query is made to the graph database. In the case of a dense point, the level i that satisfies di < si before the x level is obtained, and a penetration query is made to the graph database at this level i.
[0112] Figure 4 A schematic diagram showing an example of a leaf node with a maximum depth of i.
[0113] As Figure 4 shown, for the queried node V0, the query depth is x, a penetration query is made to the graph database at the t-th layer, and the set of leaf nodes Vt with a maximum depth of i and the set of corresponding parent paths Pti for each leaf node are obtained.
[0114] Figure 5 A schematic diagram showing an example of the queried node Vti.
[0115] As Figure 5 shown, for each node Vti in the Vt set, a corresponding sub-query task is established, the query depth is x - t, and the query rule is the same as that of V0. Finally, the return result of the sub-task is obtained, that is, the set of sub-paths CPti with a maximum depth of x - t starting from the node Vti.
[0116] Then, the query results of each sub-query task are merged. Figure 6 A schematic diagram showing an example of merging the query results of each sub-query task. As Figure 6 shown, the set of parent paths Pti and the set of sub-paths CPti are merged.
[0117] Finally, for Figure 6 The merged path shown is truncated, loops are removed, and duplicates are eliminated, then the final result is returned. Figure 7 This is a diagram illustrating an example of truncating a loop path and removing duplicates. For example... Figure 7 As shown, according to the trail principle (i.e., the principle that vertices can be repeated but edges cannot be repeated), the subpath will be truncated during merging. Figure 7 Up to node A in the sequence.
[0118] The multi-level penetration query method for graph databases of the present invention can be applied to various fields. As an example, it can be applied to scenarios involving penetration queries of equity relationships. Here, a specific example is given to illustrate how applying the multi-level penetration query method of graph databases of the present invention can improve query speed. In this example, the multi-level penetration query method of graph databases of the present invention is applied in a penetration query of equity relationships. For example, for a securities company, performing a 6-level penetration query of equity relationships, if using the existing direct query method, the total query time is 41.19 seconds. If the multi-level penetration query method of graph databases of the present invention is used, a 1-level query is performed based on density information, taking 0.08 seconds to reach 282 leaf nodes. Then, a 5-level query is performed through the leaf nodes, using a thread pool with a maximum of 32 threads for concurrent queries. Finally, the total task time is 10.04 seconds, and the query speed improvement rate reaches more than 75% (here, for better comparability, the above process does not determine whether caching is triggered).
[0119] Next, the multi-level penetration query device for graph database of the present invention will be described.
[0120] Figure 8 This is a structural block diagram illustrating a multi-level penetration query device for a graph database according to one embodiment of the present invention.
[0121] like Figure 8 As shown, a multi-level penetration query device for a graph database according to one embodiment of the present invention includes:
[0122] The calculation module 100 is used to calculate the density of each node in the graph offline;
[0123] Graph database 200, used to store the density; and
[0124] The writing module 300 is used to write the penetration query results of nodes with a specified density into the cache module 400 below;
[0125] The cache module 400 is used to store the results of the penetration query of nodes with a specified density;
[0126] The judgment module 500 is used to receive the penetration query task and determine whether the data in the cache is hit based on the density of the query nodes involved in the penetration query task.
[0127] The reading module 600 is used to read the penetration query results in the cache;
[0128] The splitting module 700 is used to split the penetration query task into multiple query subtasks and obtain the query results of the multiple query subtasks;
[0129] The merging module 800 is used to merge the query results of the multiple query subtasks to obtain a penetration query result; and
[0130] Output module 900 is used to output the penetration query results.
[0131] The specified density of nodes includes one or more of the following: super nodes; and hotspot nodes. The node density at a given depth is defined as the number of nodes reachable by a given node or the depth of that depth. Nodes whose node density reaches a specified threshold are defined as super nodes. Hotspot nodes are determined based on production experience.
[0132] The judgment module 500 performs the following actions:
[0133] Get the node density of the queried node;
[0134] Based on the current query depth and the pre-set density benchmark value, determine whether the queried node is a dense node based on the node density.
[0135] If the node is not dense, the graph database is called directly for a penetration query; if the node is dense, it is determined whether the data in the cache is hit.
[0136] The splitting module 700 performs the following actions:
[0137] Assuming the queried node is V0 and the query depth is x, the multi-level penetration query task is to call the penetration query of the graph database with a depth of t, then the set of leaf nodes Vt with a maximum depth of i and the set of parent paths Pti corresponding to each leaf node are obtained.
[0138] For each node Vti within the leaf node set Vt, a corresponding subquery task is created with a query depth of xt and the query rules are the same as those for the queried node V0; and
[0139] Obtain the query results of multiple sub-query tasks, namely, the set of sub-paths CPti with a maximum depth of xt starting from the node Vti.
[0140] The merging module 800 performs the following tasks:
[0141] Merge the parent path set Pti and the child path set CPti; and
[0142] Cut off loop paths and remove duplicates according to the prescribed principles.
[0143] The principle stipulated here is that points can be repeated but edges cannot be repeated.
[0144] As described above, based on the multi-level penetration query method and device of graph databases, the node density information of each node in the graph is periodically statistically analyzed offline. The penetration query results of some super nodes and hot nodes are written into a cache. When querying dense nodes, if the cache is hit, the cached data is used and pruning is performed at the corresponding level; otherwise, the task is finely split based on the density information, and the results are finally merged and returned. In this way, by using periodic statistical information on node density to determine the query depth, it is more scientific and automated than production experience. Using density information to select a subset of nodes for caching further accelerates the response speed of complex node queries in extreme cases. The fine-grained task splitting, combined with concurrent calls to the graph database, significantly reduces the response latency of individual complex tasks.
[0145] The present invention also provides a computer-readable medium having a computer program stored thereon, which, when executed by a processor, implements the multi-level penetration query method for the graph database.
[0146] The present invention also provides a computer device, including a storage module, a processor, and a computer program stored on the storage module and executable on the processor, wherein the processor executes the computer program to implement the multi-level penetration query method for the graph database.
[0147] The above are merely specific embodiments of this application, but the scope of protection of this application is not limited thereto. Those skilled in the art can conceive of other feasible variations or substitutions based on the technical scope disclosed in this application, and such variations or substitutions are all covered within the scope of protection of this application. Where there is no conflict, the embodiments and features described in the embodiments of this application can also be combined with each other. The scope of protection of this application is determined by the claims.
Claims
1. A multi-level penetration query method for graph databases, characterized in that, include: The judgment step involves receiving a penetration query task and determining whether the data in the cache is hit based on the density of the query nodes involved in the penetration query task. If yes, proceed to the following reading step; otherwise, proceed to the following splitting step. The cache contains penetration query results of nodes with a specified density. The reading step directly reads the penetration query results from the cache and proceeds to the following output step; The splitting step involves dividing the penetration query task into multiple query subtasks and obtaining the query results of the multiple query subtasks; The merging step merges the query results of the multiple query subtasks to obtain a penetration query result; and Output steps: Output the results of the penetration query. The splitting step includes: Assuming the queried node is V0 and the query depth is x, the penetration query task is to call the penetration query of the graph database at a depth of t, then the set of leaf nodes Vt with a maximum depth of i and the set of parent paths Pti corresponding to each leaf node are obtained. For each node Vti in the leaf node set Vt, a corresponding subquery task is created with a query depth of xt and the query rules are the same as those for the queried node V0. Obtain the query results of multiple sub-query tasks, namely, the set of sub-paths CPti with a maximum depth of xt starting from the node Vti.
2. The multi-level penetration query method for graph databases as described in claim 1, characterized in that, The following steps are included before the determination step: Calculate the density of each node within the graph offline and store the density in the graph database; and The results of penetration queries for nodes with a specified density are pre-written into the cache.
3. The multi-level penetration query method for graph databases as described in claim 1, characterized in that, The nodes with the specified density include one or more of the following: Supernode; as well as Hotspot nodes Specifically, the number of nodes reachable by a node at a certain depth, or the depth of the level, is defined as the node density at that depth, and nodes whose node density reaches a specified threshold are defined as supernodes. The hotspot nodes are determined based on production experience.
4. The multi-level penetration query method for graph databases as described in claim 1, characterized in that, The determination steps include: Get the node density of the queried node; Based on the current query depth and the preset density benchmark value, determine whether the queried node is a dense point based on the node density of the queried node; If the node is not dense, the graph database is called directly for a penetration query; if the node is dense, it is determined whether the data in the cache is hit.
5. The multi-level penetration query method for graph databases as described in claim 1, characterized in that, The merging step includes: Merge the parent path set Pti and the child path set CPti; and Cut off loop paths and remove duplicates according to the prescribed principles.
6. The multi-level penetration query method for graph databases as described in claim 5, characterized in that, The principle stipulated is that points can be repeated, but edges cannot be repeated.
7. A multi-level penetration query device for a graph database, characterized in that, include: The caching module pre-stores the results of the penetration query of nodes with a specified density; The judgment module is used to receive the penetration query task and determine whether the data in the cache is hit based on the density of the query nodes involved in the penetration query task. The read module is used to read the penetration query results from the cache; The splitting module is used to split the penetration query task into multiple query subtasks and obtain the query results of the multiple query subtasks; The merging module is used to merge the query results of the multiple query subtasks to obtain the penetration query result; as well as The output module is used to output the results of the penetration query. The splitting module performs the following actions: Assuming the queried node is V0 and the query depth is x, the penetration query task is to call the penetration query of the graph database at a depth of t, then the set of leaf nodes Vt with a maximum depth of i and the set of parent paths Pti corresponding to each leaf node are obtained. For each node Vti in the leaf node set Vt, a corresponding subquery task is created with a query depth of xt and the query rules are the same as those for the queried node V0. as well as Obtain the query results of multiple sub-query tasks, namely, the set of sub-paths CPt with a maximum depth of xt starting from the node Vti.
8. The multi-level penetration query device for graph databases as described in claim 7, characterized in that, Further includes: The calculation module is used to calculate the density of each node in the graph offline; A graph database is used to store the density; as well as The write module is used to write the results of the penetration query of nodes with a specified density into the cache.
9. The multi-level penetration query device for a graph database as described in claim 7, characterized in that, The nodes with the specified density include one or more of the following: Supernode; as well as Hotspot nodes Here, the number of nodes reachable by a node at a certain depth, or the depth of the level, is defined as the node density at that depth. Nodes whose node density reaches a specified threshold are defined as supernodes. The hotspot nodes are determined based on production experience.
10. The multi-level penetration query device for a graph database as described in claim 7, characterized in that, The following actions are performed in the judgment module: Get the node density of the queried node; Based on the current query depth and the pre-set density benchmark value, determine whether the queried node is a dense node based on the node density. If the node is not dense, the graph database is called directly for a penetration query; if the node is dense, it is determined whether the data in the cache is hit.
11. The multi-level penetration query device for a graph database as described in claim 10, characterized in that, The merging module performs the following tasks: Merge the parent path set Pti and the child path set CPti; and Cut off loop paths and remove duplicates according to the prescribed principles.
12. The multi-level penetration query device for a graph database as described in claim 11, characterized in that, The principle stipulated is that points can be repeated, but edges cannot be repeated.
13. A method for penetrating and querying equity relationships, characterized in that, The multi-level penetration query method for graph databases according to any one of claims 1 to 6 is applied.
14. A computer-readable medium having a computer program stored thereon, characterized in that, When executed by a processor, the computer program implements the multi-level penetration query method for graph databases as described in any one of claims 1 to 6.
15. A computer device comprising a storage module, a processor, and a computer program stored on the storage module and executable on the processor, characterized in that, When the processor executes the computer program, it implements the multi-level penetration query method for the graph database as described in any one of claims 1 to 6.
Citation Information
Patent Citations
Cross-database paging querying method for multi-database table
CN104572676A