Graph query method
Through the graph query method and GLogue data structure, combined with the Graph Sparsifier sampling algorithm, the efficiency problem of relational databases in multi-contact queries is solved, efficient graph pattern matching queries are realized, and real-time performance and computing efficiency are improved.
Patent Information
- Application Number
- PCT/SG2024/050212
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-04-12
- Filing Date
- 2024-04-01
- Publication Date
- 2024-10-17
AI Technical Summary
Existing relational databases are computationally expensive when processing multi-linked data queries, resulting in the inability to produce results within a reasonable time and cannot be applied to high real-time scenarios. As an NP-Complete problem, graph pattern matching has huge room for optimization. The system has design flaws and cannot be effectively applied in actual scenarios.
Provide a graph query method that parses the user's subgraph query statement, generates a subgraph structure, determines the target subgraph query execution strategy, encodes it into a data flow structure, sends it to the server, and uses distributed computing clusters to perform efficient queries. Combined with GLogue data structure and Graph Sparsifier sampling algorithm optimize graph pattern matching queries.
It realizes efficient graph pattern matching query, improves computing efficiency, lowers the development threshold, and improves the usability and efficiency of graph pattern query in actual project scenarios.
Smart Images

Figure SG2024050212_17102024_PF_FP_ABST
Abstract
Description
[0001] Graph Query Method Cross-Reference This disclosure claims priority to Chinese patent application No. 202310413647.6, filed with the China Patent Office on April 12, 2023, entitled "Graph Query Method," the entire contents of which are incorporated herein by reference. Technical Field: Embodiments of the present disclosure relate to the field of computer technology, and more particularly, to graph query methods. Background: In recent years, with the continuous development of platform-based internet, major websites have accumulated massive amounts of data. While this data growth has provided more valuable information, it has also greatly increased the difficulty of extracting information from the data. Therefore, efficiently extracting valuable information from this ever-growing mass of data has become a daunting challenge. The associations between data are extremely valuable and are widely used in recommendation systems on social networking, shopping, and other websites. Currently, major websites often use relational databases to store various types of data and their associations. However, relational databases are not designed for associations, requiring the introduction of additional tables to maintain the associations between data and the use of foreign keys to enforce constraints. This design means that when matching objects across multiple connections is required, the database must join multiple tables, which makes the computational cost extremely high. When the data volume reaches a certain scale, the relational database design cannot produce computational results within a reasonable timeframe. This makes it unsuitable for use in scenarios requiring high real-time performance. Therefore, there is an urgent need for an efficient graph query method for analyzing connections between data. In light of this, embodiments of the present disclosure provide three graph query methods. One or more embodiments of the present disclosure also involve two graph query devices, a graph query system, a computing device, a computer-readable storage medium, and a computer program to address technical deficiencies in the prior art. According to a first aspect of an embodiment of the present disclosure, a graph query method is provided, which is applied to a client and includes: parsing a subgraph query statement sent by a user for an initial property graph, and generating a subgraph structure corresponding to the subgraph query statement; determining a target subgraph query execution strategy through a preset calculation method based on subgraph statistical information and the subgraph structure, wherein the subgraph statistical information is obtained from a graph data structure constructed based on the target property graph; encoding the target subgraph query execution strategy into a data stream structure, and sending the data stream structure to a server; receiving a target subgraph returned by the server according to the data stream structure in the initial property graph, and returning the target subgraph to the user.According to a second aspect of an embodiment of the present disclosure, a graph query device is provided, which is applied to a client and includes: a graph pattern parsing node, configured to parse a subgraph query statement sent by a user for an initial attribute graph, and generate a subgraph structure corresponding to the subgraph query statement; a strategy optimization node, configured to determine a target subgraph query execution strategy through a preset calculation method based on subgraph statistical information and the subgraph structure, wherein the subgraph statistical information is obtained from a graph data structure constructed based on the target attribute graph; the strategy optimization node is further configured to encode the target subgraph query execution strategy into a data stream structure and send the data stream structure to a server; the graph pattern parsing node is further configured to receive a target subgraph returned by the server according to the data stream structure when performing a query in the initial attribute graph, and return the target subgraph to the user. According to a third aspect of an embodiment of the present disclosure, a graph query method is provided for use on a server, comprising: receiving a data stream structure sent by a client, and sending the data stream structure to a target execution node in a distributed computing cluster, wherein the data stream structure is obtained by the client processing a received subgraph query statement; decoding the data stream structure according to the target execution node, obtaining a target subgraph determined by the target execution node through a query on an initial property graph based on the decoding result, and returning the target subgraph to the client. According to a fourth aspect of an embodiment of the present disclosure, a graph query device is provided for use on a server, comprising: a distributed stream engine processing node, configured to receive a data stream structure sent by a client, and sending the data stream structure to a target execution node in a distributed computing cluster, wherein the data stream structure is obtained by the client processing a received subgraph query statement; and further configured to decode the data stream structure according to the target execution node, obtaining a target subgraph determined by the target execution node through a query on the initial property graph based on the decoding result, and returning the target subgraph to the client.According to five aspects of the embodiments of the present disclosure, a graph query method is provided, which is applied to a graph query system, wherein the graph query system includes a client and a server, wherein the method includes: the client, parsing a subgraph query statement sent by a user for an initial property graph, generating a subgraph structure corresponding to the subgraph query statement, determining a target subgraph query execution strategy through a preset calculation method based on subgraph statistical information and the subgraph structure, wherein the subgraph statistical information is obtained from a graph data structure constructed based on the target property graph, encoding the target subgraph query execution strategy into a data stream structure, and sending the data stream structure to the server; the server, receiving the data stream structure sent by the client, and sending the data stream structure to a target execution node of a distributed computing cluster, decoding the data stream structure according to the target execution node, obtaining a target subgraph determined by the target execution node through a query on the initial property graph based on the decoding result, and returning the target subgraph to the client; the client, receiving the target subgraph returned by the server, and returning the target subgraph to the user. According to six aspects of the embodiments of the present disclosure, a graph query system is provided, which includes a client and a server, wherein the client is configured to parse a subgraph query statement sent by a user for an initial attribute graph, generate a subgraph structure corresponding to the subgraph query statement, and determine a target subgraph query execution strategy through a preset calculation method based on subgraph statistical information and the subgraph structure, wherein the subgraph statistical information is obtained from a graph data structure constructed based on the target attribute graph, encode the target subgraph query execution strategy into a data stream structure, and send the data stream structure to the server; the server is configured to receive the data stream structure sent by the client, and send the data stream structure to a target execution node of a distributed computing cluster, decode the data stream structure according to the target execution node, obtain the target subgraph determined by the target execution node through a query on the initial attribute graph based on the decoding result, and return the target subgraph to the client; the client is further configured to receive the target subgraph returned by the server, and return the target subgraph to the user. According to a seventh aspect of an embodiment of the present disclosure, a computing device is provided, comprising: a memory and a processor; the memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions, which implement the steps of the above-mentioned graph query method when executed by the processor.According to an eighth aspect of an embodiment of the present disclosure, a computer-readable storage medium is provided, storing computer-executable instructions that, when executed by a processor, implement the steps of the graph query method described above. According to a ninth aspect of an embodiment of the present disclosure, a computer program is provided, wherein, when executed on a computer, the computer is caused to execute the steps of the graph query method described above. One embodiment of the present disclosure implements a graph query method, applied to a client, comprising: parsing a subgraph query statement sent by a user for an initial attribute graph, generating a subgraph structure corresponding to the subgraph query statement; determining a target subgraph query execution strategy using a preset calculation method based on subgraph statistical information and the subgraph structure, wherein the subgraph statistical information is obtained from a graph data structure constructed based on the target attribute graph; encoding the target subgraph query execution strategy into a data stream structure, and sending the data stream structure to a server; receiving a target subgraph returned by the server based on the data stream structure when performing a query on the initial attribute graph, and returning the target subgraph to the user. Specifically, the graph query method provides a method for graph pattern matching query based on subgraph statistical information, fully considering the subgraph statistical information stored in the graph data structure and the relationship between information, and combining the preset calculation method to generate a target subgraph query execution strategy with better time and space complexity, and encode the target subgraph query execution strategy into a data flow structure executable by the server, so that the subsequent server can efficiently analyze the relationship between data based on the data flow structure, and perform matching queries on graph patterns simply and quickly. Description of the drawings Figure 1 is a schematic diagram of a specific scenario of a graph query method provided by an embodiment of the present disclosure; Figure 2 is a flow chart of a graph query method applied to a client provided by an embodiment of the present disclosure; Figure 3 is a schematic diagram of a graph data structure in a graph query method provided by an embodiment of the present disclosure; Figure 4 is a flow chart of a specific processing process of a graph query method provided by an embodiment of the present disclosure; Figure 5 is a flow chart of a graph query method applied to a server provided by an embodiment of the present disclosure; Figure 6 is a flow chart of a graph query method applied to a graph query system provided by an embodiment of the present disclosure; Figure 7 is a structural schematic diagram of a graph query device applied to a client provided by an embodiment of the present disclosure; Figure 8 is a structural schematic diagram of a graph query device applied to a server provided by an embodiment of the present disclosure; Figure 9 is a structural schematic diagram of a graph query system provided by an embodiment of the present disclosure; Figure 10 is a structural block diagram of a computing device provided by an embodiment of the present disclosure. Specific implementation methods Many specific details are set forth in the following description to facilitate a full understanding of the present disclosure.However, the present disclosure can be implemented in many other ways than those described herein, and those skilled in the art can make similar generalizations without departing from the scope of the present disclosure. Therefore, the present disclosure is not limited to the specific embodiments disclosed below. The terminology used in one or more embodiments of the present disclosure is for the purpose of describing specific embodiments and is not intended to limit the present disclosure. As used in one or more embodiments of the present disclosure and the appended claims, the singular forms "a," "an," "the," and "the" are intended to include the plural forms, unless the context clearly indicates otherwise. It should also be understood that the term "and / or" used in one or more embodiments of the present disclosure refers to and encompasses any and all possible combinations of one or more of the associated listed items. It should be understood that while the terms "first," "second," and so on may be used to describe various information in one or more embodiments of the present disclosure, such information should not be limited to these terms. These terms are used to distinguish information of the same type from one another. For example, "first" could also be referred to as "second," and similarly, "second" could also be referred to as "first," without departing from the scope of one or more embodiments of the present disclosure. Depending on the context, the term "if" as used herein can be interpreted as meaning "at the time," "when," or "in response to a determination." In addition, it should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, storage, and display) involved in the embodiments of this disclosure are all information and data authorized by the user or fully authorized by all parties. The collection, use, and processing of the relevant data must comply with the relevant laws, regulations, and standards of the relevant countries and regions, and corresponding operation portals are provided for users to choose to authorize or refuse. First, the terminology involved in one or more embodiments of this disclosure is explained. Graph: An abstract data structure composed of nodes and edges. Property Graph: Nodes and edges on a graph can be assigned various labels (such as product, user, etc.) and attributes (such as name, occupation, etc.) to indicate their categories or properties. Graph Pattern: A special labeled property graph, which can also be generally understood as a subgraph of a property graph. Homomorphism Mapping: A set of mappings from a graph pattern Q to a property graph G; the two sides of a pair of mappings are both nodes or edges and have the same label. In particular, for the mapping of a pair of edges, both the starting point and the end point of the mapping must have corresponding mappings.Graph Pattern Matching: Given a property graph G and a graph pattern Q, find all homomorphic mappings from the vertex set of graph pattern Q to the vertex set of property graph G. Graph Pattern Matching Query System: A system specifically designed for graph pattern matching queries. Interactively: Provides timely feedback on user-submitted queries.
[0002] GLogue: GLogue is a graph-based data structure used to store high-dimensional statistical information within the original data graph. Traditional database systems also use table-based catalogue data structures to store high-dimensional statistical information. GLogue's innovation lies in using a graph to store this information, not only storing specific values but also the connections between them. This greatly improves the efficiency of GLogue's construction and use.
[0003] GLogS: A large-scale graph pattern matching system based on GLogue.
[0004] GLogue Manager: GLogue management module; that is, the module in GLogS responsible for creating, managing, and maintaining the GLogue graph data structure.
[0005] Graph Sparsifier: The graph sparsifier is a module in GLogS responsible for sampling the original data graph. Its purpose is to generate a sparse small graph while preserving the original data graph structure as much as possible. The GLogue Manager then performs preliminary statistics on the small graph for the information required for the GLogue. It then scales the data based on the statistical properties to generate an estimate of the high-dimensional statistics of the original data graph. This design greatly speeds up the construction of the GLogue.
[0006] NP-Complete: NP-Complete problems are a class of problems considered deterministic in computational complexity theory. NP-Complete problems are the intersection of NP and NP-Hard problems, representing the most difficult deterministic problems in NP. All NP problems can be reduced to NP-Complete problems in polynomial time. If any NP-Complete problem has a polynomial time solution, that solution can be applied to all NP problems, proving that NP problems are equivalent to P problems. In layman's terms, NP-Complete problems are computationally very complex and require significant computational resources.
[0007] Worst-Case-Optimal Join: Worst-Case Optimal Join; in graph and database queries, Worst-Case-Optimal Join is a general term for a class of Join algorithms. Compared with traditional Binary Join algorithms, these Join algorithms can provide an upper bound on the number of intermediate results during the computation process, providing a better worst-case optimization. Therefore, they often offer better performance than Binary Join.
[0008] Pattern Parser: In GLogS, user-entered patterns are often described in languages like Gremlin and Cypher. To further analyze these patterns, the patterns described in languages like Gremlin and Cypher need to be converted into the built-in data structure PatternDesc in GLogS. This process is handled by the Pattern Parser.
[0009] Plan Optimizer: Execution strategy optimizer. After obtaining PatternDesc through Pattern Parser, Plan Optimizer uses the high-dimensional statistical information stored in GLogue to perform structural analysis and decomposition of PatternDesc, and then generates the optimal execution plan (strategy). Finally, the generated execution plan is converted into DataflowDesc (data flow structure) to be sent to each Dataflow Executor (data flow executor) for execution.
[0010] Gremlin Match: A match statement in the Gremlin language, used to provide the semantics of Pattern Match.
[0011] PatternDesc: Pattern description structure, which is the data structure generated after the user-entered Pattern is converted by Pattern Parser; PatternDesc describes the Pattern from a more structured perspective to facilitate optimization by Plan Optimizer.
[0012] Cypher: Cypher is a graph query language that users can use to extract the required information from the graph.
[0013] GraphQL: GraphQL is an API (Application Programming Interface)-oriented query language and server-side runtime that can be used for graph queries.
[0014] DataflowDesc: Dataflow description structure, which is a data structure containing a series of Dataflow operators. It is used in GLogS to describe the specific execution strategy of a Pattern Match request. It is generated by the Plan Optimizer and then sent to each Dataflow Executor for specific execution.
[0015] Map: Map is a common operator in Dataflow operations. Its function is to convert each element in Dataflow into a corresponding element. Assuming that the elements in the original Dataflow are {xl,x2,x3, …, xn}, then after the map operator, the Dataflow becomes {map(x1),map(x2),map(x3),. ,,map(xn)}, JL map(xi) is an exact element.
[0016] FlatMap: FlatMap is a common operator in Dataflow operations. Its function is to convert each element in the Dataflow into corresponding 0, 1 or more elements. Assuming that the elements in the original Dataflow are (xl,x2,x3,...,xn), then after the FlatMap operator, the Dataflow becomes {flat_map(xl),flat_map(x2),flat_map(x3),...,flat_map(xn)), JL flat map(xi) is a collection, which can contain 0, 1 or more elements.
[0017] Filter: Filter is a common operator in Dataflow operations. Its function is to filter each element in the Dataflow and retain the elements that meet the requirements. Assuming that the elements in the original Dataflow are {xl, x2, x3, …, xn}, then after the filter operator, the Dataflow becomes {xi|filter (Xi) = true}.
[0018] Distributed Dataflow Engine: It is a distributed Dataflow execution engine that can distribute a Dataflow task to each node in a distributed cluster to fully utilize the computing resources on the distributed cluster to accelerate the Dataflow task.
[0019] Graph Store: Graph storage, which converts the graph into the corresponding file format for storage on disk.
[0020] Watermark for Memory Control: Memory control watermark.
[0021] Early-Stop Mechanism: Execute an early-stop mechanism. A graph can be viewed as a collection of vertices and edges, or as a collection of nodes and connections between these nodes. The structure of a graph makes it inherently suitable for representing connections between objects in both the real and virtual worlds; vertices represent objects, and edges represent connections between them. Therefore, storing various data and their connections in a graph and conducting analysis based on this structure not only provides clearer representation but also greatly improves the speed and efficiency of data analysis. The goal of graph pattern matching is to mine meaningful subgraph structures from graph data, allowing for higher-dimensional analysis of data connections and extracting more valuable information. For example, on e-commerce websites, platforms often need to understand the impact of a user following a particular store on final sales. Using subgraph pattern matching, we can easily describe this scenario using a triangular pattern between "user," "store," and "product," and then identify all subgraphs (graph patterns) matching this pattern within the e-commerce website's data graph for further analysis. This is difficult to achieve using data storage systems dominated by relational databases. As can be seen, graph pattern matching has enormous application prospects. However, graph pattern matching itself is an NP-Complete problem, leaving significant room for optimization. Existing systems that support graph pattern matching queries have significant deficiencies in at least one or more of the following: graph description language support, execution strategy optimization, distributed execution support, and support for large-scale graph data, making them unsuitable for practical application. Based on this, the present disclosure provides three graph query methods. One or more embodiments of the present disclosure simultaneously involve two graph query devices, a graph query system, a computing device, a computer-readable storage medium, and a computer program, each of which is described in detail in the following embodiments. See Figure 1, which shows a schematic diagram of a specific scenario of a graph query method provided according to one embodiment of the present disclosure. FIG1 shows a user 102, a front-end 104, and a back-end 106. The user 102 can be understood as an operator or developer of a target project (e.g., a shopping website or a social networking site). The front-end 104 and the back-end 106 can both be understood as servers, such as a physical server or a cloud server. The difference lies in the different processing tasks that the front-end 104 and the back-end 106 are responsible for. In actual applications, since the front-end 104 is user-oriented, it is also referred to as the client below.In practical applications, the front-end 104 and the back-end 106 constitute a graph query system (i.e., a graph pattern matching query system, such as GLogS). This graph query method, when applied to this graph query system, can fully connect the entire process from user input of a query statement to the final execution engine returning the query results in an end-to-end manner, making the high-frequency demand of graph pattern matching queries highly usable in actual project scenarios. For example, the large-scale graph pattern matching query capabilities provided by this graph query method can be fully applied to data mining and analysis in scenarios such as large social networks and shopping networks, greatly improving computing efficiency. The specific implementation process is as follows: User 102 submits a subgraph query statement to the front end 104, where the subgraph query statement can be understood as a graph pattern (i.e., a subgraph) expressed using a target graph description language (such as Cypher, GraphSQL, Gremlin, and other graph description languages), for example, using the match() statement in the Gremlin language: querying for graph patterns that match merchant-product-user; After receiving the subgraph query statement, the front end 104 converts the match() statement in the Gremlin language into a PatternDesc (i.e., a graph pattern structure, also called a subgraph structure), where PatternDesc is used to express a graph pattern, which is language-independent, and any graph pattern expressed in any graph description language can be converted into a PatternDesc.After receiving the PatternDesc, the front end 104 will generate a graph pattern query strategy with low computational complexity based on a pre-defined computational complexity estimation model and the subgraph statistical information stored in the pre-built graph data structure, and convert the graph pattern query strategy into a DataflowDesc (data flow structure) executable by the back end 106, and send the data flow structure to the back end 106. After receiving the data flow structure, the back end 106 parses the data flow structure according to the nodes on the distributed cluster to generate corresponding execution code and finally performs graph pattern matching query processing to obtain the graph pattern corresponding to the query statement; and returns the graph pattern corresponding to the query statement to the front end 104, which is displayed to the user 102 by the front end 104. The graph query method provided by the embodiment of the present disclosure provides complete support for the graph description language and abstracts the language-independent data level of PatternDesc, so that the graph query system retains the ability to access more languages in the future (that is, in actual project scenarios, perfect support for graph description languages is very important. Graph description languages enable developers to be intuitive and Clearly describe the graph pattern that needs to be queried, and the graph query method's support for the graph description language not only improves development efficiency, but also facilitates the maintenance of the subsequent graph query system); at the same time, a graph data structure (such as GLogue) is proposed to store high-dimensional statistical information (i.e., subgraph statistical information) in the graph to optimize the graph pattern matching query method, so that a more efficient graph pattern query strategy with lower computational complexity can be generated for subsequent graph pattern matching queries, further improving the query speed of the graph pattern matching query; and the backend also uses the parallel capabilities of the distributed cluster and fully utilizes hardware resources to perform graph pattern matching queries, greatly improving the execution efficiency of the graph pattern matching query. Referring to Figure 2, Figure 2 shows a flowchart of a graph query method applied to a client provided according to an embodiment of the present disclosure. Specifically, the method includes the following steps. Step 202: Parse the subgraph query statement sent by the user for the initial attribute graph, and generate a subgraph structure corresponding to the subgraph query statement.Among them, the client can be understood as the front end 102 of the above embodiment; the explanation of users and subgraph query statements can also refer to the detailed introduction of the above embodiment. For example, the user can be understood as a developer who will subsequently use the graph pattern of the matching query to perform data mining or data analysis, and the subgraph query statement can be understood as a graph pattern query statement edited based on any graph description language (such as Cypher, Graph SQL < Gremlin and other graph description languages); and the subgraph structure can be understood as the PatternDesc of the above embodiment, that is, a data structure used to express the graph pattern, which is independent of the graph description language and can be processed by the client. Moreover, the subgraph query statement sent by the user for the initial attribute graph can be understood as: the subgraph query statement sent by the user for the initial attribute graph of the target project, wherein the target project can be understood as an e-commerce project, a social project, etc., and the initial attribute graph of the target project can be understood as: taking the things in the target project as vertices, and the connections between things as edges, based on the set of vertices and edges; for example, if the target project is an e-commerce project, then the things in the e-commerce project can be understood as merchants, users, products, etc., and the connections between things can be understood as a user purchasing a certain product from a certain merchant. In one or more embodiments of the present disclosure, a client includes a graph pattern parsing node, a policy optimization node, and a management node. When the client includes the aforementioned three nodes, parsing a subgraph query statement sent by a user against an initial property graph and generating a subgraph structure corresponding to the subgraph query statement can be understood as follows: the graph pattern parsing node receives a subgraph query statement sent by a user against the initial property graph, parses the subgraph query statement, and generates a subgraph structure corresponding to the subgraph query statement. For example, the graph pattern parsing node receives a match statement written in the Gremlin language and sent by a user against the initial property graph of an e-commerce project, parses the match statement, and generates a PatternDesc corresponding to the match statement. Furthermore, when parsing a subgraph query statement sent by a user against the initial property graph and generating a subgraph structure corresponding to the subgraph query statement, the graph pattern parsing node evaluates the validity of the subgraph query statement received from the user during parsing to avoid receiving invalid subgraph query statements, which would result in subsequent invalid computation and waste of resources on the server.The specific implementation is as follows: parsing a subgraph query statement sent by a user for an initial attribute graph and generating a subgraph structure corresponding to the subgraph query statement includes: receiving the subgraph query statement sent by the user and parsing the subgraph query statement; generating a subgraph structure corresponding to the subgraph query statement if the parsing result satisfies a preset query condition; or returning a preset query result to the user if the parsing result does not satisfy the preset query condition. The preset query condition can be set based on actual application; for example, the preset query condition can be understood as indicating that the subgraph query statement is valid. In one or more embodiments of the present disclosure, it is possible to pre-define which connections in the initial attribute graph of the target item are reasonable and which connections are unreasonable. That is, it is pre-determined what forms of connections exist in the initial attribute graph of the target item, and then these reasonable connection forms are pre-stored on the client in a table or other manner. For example, a merchant can only establish a connection with a store, but not with a product. Then, after parsing a subgraph query statement sent by a user for the initial attribute graph of the target item, it is found that the user forcibly connects the merchant with the product in the subgraph query statement. Then, based on the pre-stored reasonable connection forms, it can be determined that the subgraph query statement is unreasonable and is an invalid query statement. Then, if the preset query condition is understood to indicate that the subgraph query statement is valid, the subgraph query statement sent by the user is received and parsed; if the parsing result satisfies the preset query condition, a subgraph structure corresponding to the subgraph query statement is generated. This can be understood as follows: the graph pattern parsing node receives the subgraph query statement sent by the user and parses the subgraph query statement. If the subgraph query statement is determined to be valid based on the parsing result, the subgraph query statement is converted into a subgraph structure, i.e., a subgraph structure corresponding to the subgraph query statement is generated. If the parsing result does not satisfy the preset query condition, the preset query result is returned to the user. This can be understood as follows: if the graph pattern parsing node determines that the subgraph query statement does not satisfy the validity of the subgraph query statement based on the parsing result, i.e., if the subgraph query statement is invalid, the preset query result is directly returned to the user, such as an empty set. The graph query method provided by the embodiment of the present disclosure is that after receiving the subgraph query statement sent by the user, the client's graph pattern parsing node can discover some invalid query statements in advance in the process of converting the subgraph query statement into the corresponding subgraph structure, and filter the invalid query statements to avoid subsequent invalid calculations on the distributed cluster of the server, thereby greatly improving the resource utilization of graph pattern matching queries.Step 204: Determine the target subgraph query execution strategy using a preset calculation method based on the subgraph statistical information and the subgraph structure. The subgraph statistical information is obtained from the graph data structure constructed based on the target property graph. Specifically, after the client's graph pattern parsing node determines that the subgraph query statement is valid and converts the subgraph query statement into the corresponding subgraph structure, it sends the subgraph structure to the client's strategy optimization node. After receiving the subgraph structure, the strategy optimization node obtains subgraph statistical information from the graph data structure constructed based on the target property graph. Then, based on the subgraph statistical information and the subgraph structure, the target subgraph query execution strategy is determined using a preset calculation method. Subgraph statistical information can be understood as high-dimensional statistical information of the target property graph (e.g., the property graph of the target item described above, i.e., the original property graph or the property graph obtained by sampling the original property graph). This high-dimensional statistical information is relative to low-dimensional statistical information. Low-dimensional statistical information in the target property graph can be understood as the number of various vertices and edges. Assume a target attribute graph with three vertices: user, store, and product, and three edges: user-follow->store, user-purchase->product, and store-provide->product. The low-dimensional statistics of this target attribute graph can be represented by the following Table 1: The high-dimensional statistical information of the target attribute graph can be understood as statistics on the number of various graph patterns based on the target attribute graph, as shown in Table 2 below: As can be seen from Table 2, subgraph statistical information can be understood as statistical information for all graph modes of the target attribute graph. The preset calculation method can be set based on the actual application, such as a shortest path algorithm. Before determining the target subgraph query execution strategy based on the subgraph statistical information and the subgraph structure using the preset calculation method, a graph data structure must be pre-constructed so that the subgraph statistical information of the target attribute graph can be subsequently obtained from the graph data structure. A specific implementation method is as follows: Before determining the target subgraph query execution strategy based on the subgraph statistical information and the subgraph structure using the preset calculation method, the method further includes: receiving the target attribute graph sent by the server and determining the subgraph statistical information in the target attribute graph; constructing a graph data structure in the form of the target attribute graph based on the subgraph statistical information, and storing the subgraph statistical information in the graph data structure. The target attribute graph can be understood as the original attribute graph of the target item in the above-mentioned embodiment, or as the attribute graph obtained by sampling the original attribute graph, depending on the specific information sent by the server. Specifically, the client's management node receives the target attribute graph sent by the server and extracts subgraph statistics from the target attribute graph. Based on the subgraph statistics, a graph data structure is constructed in the form of a target attribute graph and stored in the graph data structure. The graph data structure can be understood as the aforementioned GLogue, which uses the target attribute graph to store the extracted high-dimensional statistical information. On this attribute graph, each point representing a graph pattern, with its statistical quantity stored as a point attribute, and edges representing the transformation relationships between graph patterns. For example, an edge connects two points representing the graph patterns "user-follow->store" and "user-follow->store-provide->product," respectively. This edge indicates that the graph pattern "user-follow->store" can be transformed into the graph pattern "user-follow->store-provide->product" by adding "-provide->product." See Figure 3, which shows a schematic diagram of a graph data structure in a graph query method provided by one embodiment of the present disclosure. Figure 3 shows a graph data structure constructed by storing the extracted high-dimensional statistical information in the form of a target attribute graph. Each point in Figure 3 represents a graph pattern, such as P1-P11 respectively represents a graph pattern, and some attributes are stored on each point, such as the number of graph patterns, which will be stored as an attribute on the graph (such as the number of graph patterns in P1 is 3, the number of graph patterns in P2 is 2, the number of graph patterns in P3 is 2, etc.).The graph query method provided by the embodiments of the present disclosure provides a graph data structure to store high-dimensional statistical information of a target property graph. It also introduces a management node for the graph data structure to create, manage, and maintain the graph data structure. This allows for efficient extraction of high-dimensional statistical information from the graph data structure, generating optimal execution strategies, and enabling application in large-scale graph scenarios. Subgraph statistical information is stored in the graph data structure as a target property graph, enabling reliable storage and migration of this subgraph statistical information by reusing the server's graph storage. Specifically, the graph data structure itself stores this subgraph statistical information in the form of a target property graph, allowing it to reuse existing graph storage nodes on the server, thereby saving storage resources. After constructing the graph data structure, in actual applications, subgraph statistical information of the target property graph can be obtained from the graph data structure. This statistical information is then statistically analyzed using a predefined computational complexity estimation model. Combined with the subgraph structure, a preset calculation method is used to determine the target subgraph query execution strategy. The specific implementation is as follows: The target subgraph query execution strategy is determined by a preset calculation method based on the subgraph statistical information and the subgraph structure, including: determining the target point corresponding to the subgraph structure in the graph data structure according to the subgraph structure; determining the subgraph statistical information associated with the target point, and determining the target subgraph query execution strategy by a shortest path algorithm. Specifically, after receiving the subgraph structure, the strategy optimization node will use it to locate it in the graph data structure, that is, find the target point corresponding to this subgraph structure in the graph data structure. After locating the target point corresponding to the subgraph structure in the graph data structure, the shortest path algorithm in the graph can be used to generate the target subgraph query execution strategy corresponding to the subgraph structure. In one or more embodiments of the present disclosure, due to the limited size of the GLogue, it may not contain the statistical information of the number of all possible graph patterns. Therefore, when the GLogue is initialized (constructed) at the beginning, only the number of graph patterns with size <= k and other frequently queried graph patterns will be recorded. For example, during the GLogue creation process, the management node r (GLogue Manage) of the graph data structure will first calculate the number of small graph patterns and some frequently occurring patterns, and store the number of these patterns and the connections between the patterns in the GLogue in the form of a property graph.In this case, there may be situations where the subgraph structure being queried by the user does not have relevant high-dimensional statistical information stored in the GLogue. In such cases, the Plan Optimizer node heuristically generates an execution strategy for a subgraph query statement (Pattern Match) and records the graph patterns not included in the GLogue. Subsequently, queries submitted by users without patterns entered into the GLogue will be gradually updated into the GLogue. The graph query method provided in the disclosed embodiments transforms the problem of finding an optimal execution strategy for graph pattern matching into a classic shortest path problem in the graph domain (i.e., locating the point of the queried graph pattern on the attribute graph of the high-dimensional statistical information stored in the GLogue and finding the shortest path from this point to the first-level points). This method generates a more efficient target subgraph query execution strategy, further improving the query speed of graph pattern matching. It also significantly reduces the threshold and psychological burden for developers using graph pattern queries, promoting the promotion of graph pattern queries in real-world project scenarios. Step 206: Encode the target subgraph query execution strategy into a data flow structure and send the data flow structure to the server. Specifically, after determining the target subgraph query execution strategy, the client's policy optimization node encodes the target subgraph query execution strategy into a data flow structure that can be processed by the server and sends the data flow structure to the server. Step 208: Receive the target subgraph returned by the server after performing a query in the initial attribute graph based on the data flow structure, and return the target subgraph to the user. Specifically, after sending the data flow structure to the server, the client's policy optimization node may also receive the target subgraph returned by the server based on the data flow structure and return the target subgraph to the client's graph pattern parsing node, which then returns it to the user.After receiving PatternDesc, the Plan Optimizer uses a predefined computational complexity estimation model to analyze the high-dimensional statistical information in the graph data structure. Based on the statistical results, it then uses a shortest path algorithm to generate an execution strategy with the lowest computational complexity (i.e., the target subgraph query execution strategy). This statistical estimation model transforms the generated execution strategy with the lowest computational complexity into a shortest path problem in the graph domain. For example, for a link between a merchant, a product, and a user, there are three possible strategies for a computer query: starting with the two ends as vertices or expanding from the middle vertex to both sides. For example, in a shopping network, users are the most numerous, followed by stores, and the fewest number of merchants. Therefore, starting with users may trigger many additional queries. Using this computational complexity estimation model, it can be determined that the computational complexity of the path from merchants to stores and then to users is the lowest. When the graph pattern is large, there will be many points, resulting in a large number of execution strategies. By converting this problem into the problem of finding the shortest path on the graph, the problem can be solved more simply and intuitively, finding the execution strategy with the lowest computational complexity. For example, first, all merchants are obtained. The second intermediate process is the merchant-to-store process, and the third intermediate process is the store-to-user process. Considering the results of the first two intermediate processes as the intermediate processes, a method is needed to first count the number of graph patterns in the first two intermediate processes and determine an estimate of the number of intermediate processes. With this estimate, the distance of each transformation step can be determined. Using the shortest path algorithm on the graph, the optimal execution strategy can be found. The execution strategy is then converted into a dataflow structure (DataflowDesc). This DataflowDesc contains a series of common operators in stream processing engines, such as Map, FlatMap, and Filter. This dataflow structure containing the target operator is sent to the stream processing engine on the server for computation, and the execution results returned by the server stream processing engine are returned to the user.The specific implementation is as follows: encoding the target subgraph query execution strategy as a data stream structure and sending the data stream structure to the server includes: encoding the target subgraph query execution strategy as a data stream structure containing a target operator and sending the data stream structure to the server's data stream processing engine, wherein the target operator is an operator associated with the data stream processing engine; accordingly, receiving the target subgraph returned by the server's query in the initial attribute graph based on the data stream structure includes: receiving the target subgraph returned by the server's data stream processing engine based on the data stream structure. Specifically, the client's policy optimization node encodes the target subgraph query execution strategy as a data stream structure containing a target operator and sends the data stream structure to the server's data stream processing engine; and receives the target subgraph returned by the server's data stream processing engine after processing the data stream structure. The graph query method provided by the embodiments of the present disclosure encodes the target subgraph query execution strategy into a data stream structure containing a target operator. This allows the subsequent server-side data stream processing engine to quickly identify this data stream structure and accurately execute it based on the target operator in the data stream structure to obtain the target subgraph. Furthermore, in one or more embodiments of the present disclosure, when the client management node discovers that certain graph patterns are frequently queried by users but are never stored in the graph data structure, it triggers an update mechanism to update these graph patterns and their high-dimensional statistical information into the graph data structure. This allows subsequent users to more efficiently and accurately obtain the optimal execution strategy for matching queries against the graph pattern, thereby improving the efficiency of graph pattern matching queries. The specific implementation is as follows: After parsing a subgraph query statement sent by a user for an initial property graph and generating a subgraph structure corresponding to the subgraph query statement, the method further includes: determining the number of queries for the query subgraph corresponding to the subgraph structure; if the number of queries for the query subgraph is greater than or equal to a preset number threshold and no corresponding subgraph statistical information for the query subgraph exists in the graph data structure, sending a statistical information update request to the server; receiving an updated property graph returned by the server in response to the statistical information update request, and updating the subgraph statistical information stored in the graph data structure based on the updated property graph. The query subgraph can be understood as the graph pattern corresponding to the subgraph structure.Specifically, when the graph pattern parsing node of the client converts the subgraph query statement into the corresponding subgraph structure and sends it to the strategy optimization node of the client, the subgraph structure will be sent to the management node at the same time. The management node will determine the query count of the query subgraph corresponding to the subgraph structure based on the historical records. For example, if the query subgraph corresponding to the subgraph structure has been queried 10 times in history, then the query count this time is the 11th time. When it is determined that the query count of the query subgraph is greater than or equal to a preset threshold (such as 8 times or 9 times, etc.) and there is no corresponding subgraph statistical information for the query subgraph in the graph data structure, a statistical information update request is sent to the server to request an update of the graph data structure. When receiving the updated attribute graph returned by the server based on the statistical information update request, the subgraph statistical information stored in the graph data structure is updated according to the updated attribute graph. In the graph query method provided by an embodiment of the present disclosure, when the management node of the client determines that the graph pattern queries frequently submitted by the user have not been entered into the graph data structure, in order to improve the matching query efficiency of the graph pattern, it will trigger an update mechanism to the server to update these graph patterns and their high-dimensional statistical information into the graph data structure. Referring to Figure 4, Figure 4 shows a specific processing process flow chart of a graph query method provided by an embodiment of the present disclosure. Step 402: Receive and parse the subgraph query statement for the attribute graph of the target project sent by the user. For example, the subgraph query statement is: P=gV().match( as('vl ').out('Knows').as(' v2'), as('vr) out(" Purchases') as(. c v3'), as('v2').out('Purchases').as('v3')
[0022] Step 404: Convert the subgraph query statement into a subgraph structure. Continuing with the above example, the subgraph structure after as('v1').out('Knows').as('v2') conversion is:
[0023] [GetV(NA,'vl Person, NA),
[0024] GetE('vl','', Knows, Out),
[0025] GetV(''「v2', Person, Target),
[0026] ] as('vl').out('Purchases').as('v3') The subgraph structure after conversion is:
[0027] [GetV(NA,'vl', Person, NA), GetE('vl ' 'Purchases, Out),
[0028] GetV(' ', ' v3 ', Product, Target),
[0029] ] as( t v2 , ).out( t Purchases 5 ).asCv3 5 )The subgraph structure after conversion is:
[0030] [GetV(NA / v2 , ,Person,NA),
[0031] GetE(' v2 ,Purchases, Out),
[0032] GetV(" 5 / v2 5 , Product, Target),
[0033] Step 406: Obtain subgraph statistical information from the graph data structure constructed based on the target attribute graph. Based on the subgraph statistical information and the subgraph structure, determine the target subgraph query execution strategy using a preset calculation method. Step 408: Encode the target subgraph query execution strategy into a data flow structure containing the target operator and send the data flow structure to the server. Continuing with the above example, the data flow structure containing the target operator is as follows:
[0034] Source(GetV(NA, ' v 1 ' , Person, NA))
[0035] FlatMap( GetE(' v 1 ' , ' ' ,Knows, Out))
[0036] Map(GetV(' v2 ' ,Person, Target))
[0037] Map(GetE('v 1 '_t' ,Purchases, Out))
[0038] Map(GetE('v2 , / _t , , Purchases, Out))
[0039] FlatMap(GetE( c v3 , / _t , , Product, Other))
[0040] FlatMap(GetE('v3','_t', Product, Other)) After sending the data stream structure to the server, the target subgraph returned by the server according to the data stream structure is received, and the target subgraph is returned to the user. The graph query method provided in the embodiment of the present disclosure is applied to the client, and provides a method for matching graph patterns based on subgraph statistical information. It fully considers the subgraph statistical information stored in the graph data structure and the relationship between information, and combines the preset calculation method to generate a target subgraph query execution strategy with better time and space complexity, and encodes the target subgraph query execution strategy into a data stream structure executable by the server, so that the subsequent server can efficiently analyze the relationship between data based on the data stream structure, and perform matching queries on graph patterns simply and quickly. Referring to Figure 5, Figure 5 shows a flowchart of a graph query method applied to the server provided in accordance with an embodiment of the present disclosure. Specifically, the method includes the following steps. Step 502: Receive the data stream structure sent by the client, and send the data stream structure to the target execution node of the distributed computing cluster. The server can be understood as the backend 106 in the above-mentioned embodiment; the data flow structure can be understood as the data flow structure determined in the graph query method applied to the client. Specifically, the server includes a distributed stream engine processing node and a distributed graph storage node. In another embodiment, the server may also include a graph sparse node to support deployment on a large-scale distributed computing cluster. The distributed stream engine processing node includes a set of executors, each of which is assigned to an execution node in the distributed computing cluster. The executors on each execution node support efficient data exchange between each other to address situations where the queried graph pattern may span nodes. Based on the distributed computing cluster, the server receives the data flow structure sent by the client and sends it to the target execution node in the distributed computing cluster. This can be understood as follows: the server receives the data flow structure sent by the client and then sends it to the target execution node (e.g., each execution node or a designated execution node) in the distributed computing cluster via an RPC service. Step 504: Decode the data stream structure according to the target execution node, obtain a target subgraph determined by the target execution node through querying the initial attribute graph based on the decoding result, and return the target subgraph to the client. For an introduction to the initial attribute graph, see the detailed description of the graph query method applied to the client.Specifically, after each target execution node receives the data stream structure, the executor assigned to each target execution node decodes the data stream structure, extracts the operators (such as Map and FlatMap), generates the corresponding execution code, and ultimately performs a graph pattern matching query based on the initial property graph to obtain the target subgraph. The target subgraph is then returned to the client. The initial property graph can be understood as the initial property graph of the target project, such as the initial property graph of an e-commerce website or a social networking site. A detailed explanation of the target project and property graph can be found in the above embodiments and will not be repeated here. In one or more embodiments of the present disclosure, before receiving the data stream structure sent by the client, the initial property graph must be pre-determined and stored so that a graph pattern matching query can be performed based on it. Furthermore, based on a distributed computing cluster, if the initial property graph occupies a large amount of storage space, it can be divided into several small graphs for distributed storage, greatly improving storage efficiency and the efficiency of subsequent graph pattern matching queries. The specific implementation is as follows: The receiving method of the data stream structure sent by the client further includes: determining an initial attribute graph, splitting the initial attribute graph according to a preset splitting strategy, and storing the split initial attribute graphs on the target execution nodes of the distributed computing cluster. In specific implementation, after determining the initial attribute graph, if it is determined that the storage space occupied by the initial attribute graph is greater than or equal to the preset storage space (the preset storage space can be set according to actual application, for example, the preset storage space is 1 OOTB or 80TB, etc.), or if the storage space occupied by the initial attribute graph is greater than or equal to the preset storage space as it is updated, it will be difficult for the stand-alone mode to meet its storage and computing needs. Therefore, in the embodiment of the present disclosure, a hash partitioning strategy or other partitioning strategy can be used to split a larger initial attribute graph into multiple small graph partitions, which are stored on each execution node of the distributed computing cluster and are uniformly managed by the distributed graph storage node on the server side. That is, the distributed graph storage node on the server side determines the initial attribute graph. When it is determined that the storage space occupied by the initial attribute graph is greater than or equal to the preset storage space, the initial attribute graph is split according to the preset splitting strategy (such as the hash partitioning strategy), and the split initial attribute graphs are respectively stored in the target execution nodes of the distributed computing cluster. When the executor in the target execution node performs a target subgraph matching query according to the data flow structure, the small graph partitions stored on each target execution node can be loaded into the memory through the distributed graph storage node to form an initial attribute graph, so as to cooperate with the data flow structure to complete the target subgraph matching query and obtain the target subgraph.During implementation, during the initialization phase, the server needs to send the initial property graph to the client so that the client can construct the graph data structure based on the high-dimensional statistical information in the initial property graph. However, if the initial property graph is large or has been updated multiple times and the graph size has grown to a certain size, in order to establish a usable graph data structure within a reasonable timeframe, the graph data structure management node does not directly extract high-dimensional statistical information from the original property graph stored on the server to build the graph data structure. Research has shown that generating excellent execution strategies does not require completely accurate high-dimensional statistical information; statistical information within a reasonable deviation range is sufficient to help the Plan Optimizer generate the optimal execution strategy. Based on this, the disclosed embodiments provide a "novel graph sampling algorithm" and design a graph sparsifier to implement it. Its function is to sample the original property graph (i.e., the large graph) into a small graph. The small graph is significantly reduced in size while retaining the basic structural information of the large graph. This sampling algorithm can achieve a smaller estimation error at the same sampling rate, further improving the efficiency of GLogue construction. Therefore, during system initialization, the server's Graph Sparsifier will simultaneously start, sampling the entire large graph into a small graph. The sampled small graph will be aggregated and sent to the client's GLogue Manager. The GLogue Manager will then perform high-dimensional information statistics on the small graph and scale the data back to the large graph according to a predefined stratified function. The specific implementation method is as follows: After storing the split initial attribute graphs on the target execution nodes of the distributed computing cluster, the method also includes: determining the initial attribute graph from the target execution node of the distributed computing cluster in response to a system initialization request; sampling the initial attribute graph according to a preset sampling strategy to obtain a target attribute graph, and sending the target attribute graph to the client, where the target attribute graph is smaller than the initial attribute graph. If the client and server are considered a graph query system, the system initialization request can be understood as an initialization request for the graph query system.Specifically, the server-side graph sparse node, in response to a system initialization request, triggers the distributed graph storage node to determine an initial property graph from the target execution node of the distributed computing cluster. The distributed graph storage node then sends this initial property graph to the graph sparse node. After receiving the initial property graph, the graph sparse node samples the initial property graph according to a preset sampling strategy to obtain a target property graph. The target property graph is then sent to the client's management node, allowing the client's management node to construct a graph data structure based on the target property graph. Furthermore, in one or more embodiments of the present disclosure, since the initial property graph is split and stored on different execution nodes in the distributed computing cluster, when a target subgraph is queried from the initial property graph based on the data flow structure, the different execution nodes of the distributed computing cluster will quickly query the corresponding graph pattern in the initial property graph from their nodes. The graph patterns queried by all execution nodes then need to be aggregated to obtain the target subgraph. The specific implementation method is as follows: decoding the data flow structure according to the target execution node, and obtaining the target subgraph determined by the target execution node through querying the initial attribute graph according to the decoding result, includes: decoding the data flow structure according to the target execution node, and obtaining the target subgraph determined by the target execution node through querying the corresponding initial attribute graph after splitting according to the decoding result. Specifically, the distributed stream engine processing node on the server side decodes the data flow structure according to the executor of the target execution node allocated in the distributed computing cluster, and obtains the initial graph pattern determined by the executor of each target execution node through querying the corresponding initial attribute graph after splitting according to the decoding result, and then determines the target subgraph after summarizing the various initial graph patterns. Through this distributed query, the efficiency of graph pattern matching query is greatly improved. The graph query method applied to a server, as provided in an embodiment of the present disclosure, provides an efficient and comprehensive distributed execution engine and distributed storage. This allows the server to fully utilize the computing resources in the cluster when performing graph pattern matching queries, significantly improving the query speed of graph pattern matching. Furthermore, at the execution engine level, it supports Worst-Case-Optimal Join, providing an upper bound on the computational complexity of the execution strategy. This significantly improves the query success rate with the same hardware resources. See Figure 6, which shows a flowchart of a graph query method applied to a graph query system, as provided in an embodiment of the present disclosure. The graph query system includes a client and a server. The method specifically includes the following steps.Step 602: The client parses the subgraph query statement sent by the user for the initial property graph, generates a subgraph structure corresponding to the subgraph query statement, and determines the target subgraph query execution strategy through a preset calculation method according to the subgraph statistical information and the subgraph structure, wherein the subgraph statistical information is obtained from the graph data structure constructed according to the target property graph, encodes the target subgraph query execution strategy into a data stream structure, and sends the data stream structure to the server; Step 604: The server receives the data stream structure sent by the client, and sends the data stream structure to the target execution node of the distributed computing cluster, decodes the data stream structure according to the target execution node, obtains the target subgraph determined by the target execution node through querying the initial property graph according to the decoding result, and returns the target subgraph to the client; Step 606: The client receives the target subgraph returned by the server, and returns the target subgraph to the user. Optionally, the client includes a graph pattern parsing node and a policy optimization node. Accordingly, the graph pattern parsing node parses a subgraph query statement sent by a user for an initial attribute graph, generates a subgraph structure corresponding to the subgraph query statement, and sends the subgraph structure to the policy optimization node. The policy optimization node determines a target subgraph query execution strategy based on subgraph statistical information and the subgraph structure using a preset calculation method, wherein the subgraph statistical information is obtained from a graph data structure constructed based on the target attribute graph. The policy optimization node encodes the target subgraph query execution strategy into a data stream structure and sends the data stream structure to the server. Optionally, the client also includes a management node. Accordingly, the management node receives the target attribute graph sent by the server and determines subgraph statistical information in the target attribute graph. Based on the subgraph statistical information, the management node constructs a graph data structure in the form of the target attribute graph and stores the subgraph statistical information in the graph data structure. Optionally, the server includes a distributed stream engine processing node and a distributed graph storage node; accordingly, the distributed stream engine processing node receives the data stream structure sent by the client 602, and sends the data stream structure to the target execution node of the distributed computing cluster, wherein the data stream structure is obtained by the client processing the received subgraph query statement; the data stream structure is decoded according to the target execution node, and the target subgraph determined by the target execution node based on the decoding result and the query based on the initial attribute graph determined by the distributed storage node is obtained, and the target subgraph is returned to the client.Optionally, the server further includes a graph sparse node; the graph sparse node, in response to a system initialization request, determines the initial property graph from the target execution node of the distributed computing cluster according to the distributed storage node; samples the initial property graph according to a preset sampling strategy to obtain a target property graph, and sends the target property graph to the client, wherein the target property graph is smaller than the initial property graph. Specifically, the graph query system can be understood as the graph pattern matching query system of the above-mentioned embodiment, GLogSo. For detailed explanations of the client, server, and the graph pattern parsing node, policy optimization node, and management node included in the client, and the distributed stream engine processing node, distributed graph storage node, and graph sparse node included in the server, please refer to the detailed explanations in the above-mentioned graph query method applied to the client and the graph query method applied to the server, and will not be repeated here. The graph query method provided in the embodiments of the present disclosure is applied to GLogS, a graph query system capable of handling large-scale graph pattern queries. GLogS fully includes front-end and back-end modules, and in an end-to-end manner, comprehensively connects the entire process from user input of query statements to the final execution engine returning results, making the high-frequency demand of graph pattern matching queries highly available in real-world project scenarios. At the same time, GLogS proposes the innovative data structure "GLogue" to store high-dimensional statistical information in graphs, and introduces the "GLogue Manager" to create, manage, and maintain "GLogues". Through the coordination and linkage between multiple modules such as "GLogue", "GLogue Manager", and "Graph Sparsifier", the efficiency of extracting high-dimensional statistical information from graphs is greatly improved, enabling its application in large-scale graph scenarios, and the extracted statistical information can be reliably stored and migrated by reusing the system's graph storage. In addition, it also provides an efficient distributed execution engine and distributed storage, greatly improving the efficiency of graph pattern matching queries. Specifically, this graph query method, applied to graph query systems, comprehensively proposes a solution for extracting high-dimensional statistical information from large-scale graphs, overcoming the problems of difficult storage, slow computation, and huge memory consumption. Furthermore, it proposes a Stratified Sparsification algorithm, which effectively preserves high-dimensional information, such as the number of graph patterns, during the process of sampling a large graph into smaller ones.This significantly improves information statistics efficiency while maintaining high accuracy. We also propose GLogue, an innovative graph-native data structure, to store high-dimensional statistical information in graphs. We also introduce the GLogue Manager to create, manage, and maintain GLogues. Using graphs to store this high-dimensional statistical information not only allows us to store the information itself but, more importantly, the connections between the information. These connections not only help generate execution strategies, ensuring that the generated strategies are as optimal as possible in terms of both time and space complexity, but also greatly improve the efficiency of extracting high-dimensional statistical information from graphs. Based on the interrelationships between the high-dimensional information in the GLogue, an algorithm for efficiently extracting high-dimensional statistical information from graphs is proposed, which greatly improves the efficiency of GLogue construction. In addition, based on the structure of the GLogue attribute graph, the execution strategy generation problem of graph pattern matching can be further converted into the classic shortest path problem in the graph field and solved using the Viterbi algorithm. This not only improves the efficiency of execution strategy generation, but also makes the execution strategy generation process simpler, clearer, and more intuitive. In addition, this method uses a stream processing engine based on a directed acyclic graph (DAG) to distribute graph pattern query tasks to large-scale clusters for processing. After generating an execution strategy based on the GLogue, the Plan Optimizer in GLogS translates each step in the execution strategy into the corresponding operator in the stream processing engine and finally encodes it into a DataflowDesc structure, which is then transmitted via RPC (Remote Procedure Call, remote procedure call) service is sent to the executor of each execution node in each cluster for calculation. Such a design makes GLogS have good scalability in the calculation process. The above is a schematic scheme of a graph query method applied to a graph query system in this embodiment. It should be noted that the technical solution of the graph query method applied to the graph query system belongs to the same concept as the above-mentioned graph query method applied to the client and the technical solution of the graph query method applied to the server. For details that are not described in detail in the technical solution of the graph query method applied to the graph query system, please refer to the description of the technical solution of the graph query method applied to the client and the graph query method applied to the server. Corresponding to the above-mentioned method embodiment, the present disclosure also provides an embodiment of a graph query device applied to a client. Figure 7 shows a structural schematic diagram of a graph query device applied to a client provided by an embodiment of the present disclosure.As shown in Figure 7, the device includes: a graph pattern parsing node 702, configured to parse the subgraph query statement sent by the user for the initial attribute graph, and generate a subgraph structure corresponding to the subgraph query statement; a strategy optimization node 704, configured to determine the target subgraph query execution strategy through a preset calculation method based on the subgraph statistical information and the subgraph structure, wherein the subgraph statistical information is obtained from the graph data structure constructed according to the target attribute graph; the strategy optimization node 704 is further configured to encode the target subgraph query execution strategy into a data stream structure and send the data stream structure to the server; the graph pattern parsing node 702 is further configured to receive the target subgraph returned by the server according to the data stream structure when querying in the initial attribute graph, and return the target subgraph to the user. Optionally, the apparatus further includes: a management node configured to: receive a target attribute graph sent by the server and determine subgraph statistical information in the target attribute graph; construct a graph data structure in the form of the target attribute graph based on the subgraph statistical information, and store the subgraph statistical information in the graph data structure. Optionally, a graph pattern parsing node 702 is further configured to: receive a subgraph query statement sent by a user and parse the subgraph query statement; if the parsing result meets a preset query condition, generate a subgraph structure corresponding to the subgraph query statement; or if the parsing result does not meet the preset query condition, return a preset query result to the user. Optionally, the strategy optimization node 704 is further configured to: determine, based on the subgraph structure, a target point corresponding to the subgraph structure in the graph data structure; determine subgraph statistical information associated with the target point, and determine a target subgraph query execution strategy using a shortest path algorithm. Optionally, the strategy optimization node 704 is further configured to: encode the target subgraph query execution strategy into a data stream structure containing a target operator, and send the data stream structure to the data stream processing engine on the server side, wherein the target operator is an operator associated with the data stream processing engine; accordingly, the strategy optimization node 704 is further configured to: receive the target subgraph returned by the data stream processing engine on the server side, and query the initial attribute graph according to the data stream structure.Optionally, the management node is further configured to: determine the number of queries of the query subgraph corresponding to the subgraph structure; send a statistical information update request to the server when the number of queries of the query subgraph is greater than or equal to a preset number threshold and there is no corresponding subgraph statistical information of the query subgraph in the graph data structure; receive the updated attribute graph returned by the server according to the statistical information update request, and update the subgraph statistical information stored in the graph data structure according to the updated attribute graph. The above is a schematic scheme of a graph query device applied to a client in this embodiment. It should be noted that the technical solution of the graph query device applied to the client and the technical solution of the graph query method applied to the client above belong to the same concept. For details not described in detail in the technical solution of the graph query device applied to the client, please refer to the description of the technical solution of the graph query method applied to the client above. Corresponding to the above method embodiment, the present disclosure also provides an embodiment of a graph query device applied to a server. Figure 8 shows a structural schematic diagram of a graph query device applied to a server provided by an embodiment of the present disclosure. As shown in Figure 8, the device includes: a distributed stream engine processing node 802, configured to receive a data stream structure sent by a client, and send the data stream structure to a target execution node of a distributed computing cluster, wherein the data stream structure is obtained by the client processing a received subgraph query statement; the distributed stream engine processing node is further configured to decode the data stream structure according to the target execution node, obtain the target subgraph determined by the target execution node by querying the initial attribute graph according to the decoding result, and return the target subgraph to the client. Optionally, the device further includes: a distributed graph storage node, configured to: determine an initial attribute graph, split the initial attribute graph according to a preset splitting strategy, and store the split initial attribute graphs respectively in the target execution nodes of the distributed computing cluster. Optionally, the apparatus further includes a graph sparseness node configured to: determine the initial property graph from the target execution node of the distributed computing cluster in response to a system initialization request; sample the initial property graph according to a preset sampling strategy to obtain a target property graph; and send the target property graph to the client, wherein the target property graph is smaller than the initial property graph. The distributed stream engine processing node 804 is further configured to: decode the data stream structure according to the target execution node and obtain a target subgraph determined by querying the corresponding split initial property graph based on the decoding result. The above is a schematic scheme of a graph query apparatus applied to a server in this embodiment.It should be noted that the technical solution of the graph query device applied to the server is based on the same concept as the technical solution of the graph query method applied to the server. For details not described in detail in the technical solution of the graph query device applied to the server, please refer to the description of the technical solution of the graph query method applied to the server. Corresponding to the above-mentioned method embodiment, the present disclosure also provides a graph query system embodiment. Figure 9 shows a schematic diagram of the structure of a graph query system provided by one embodiment of the present disclosure. As shown in Figure 9, the system includes: the client 902, which is configured to parse the subgraph query statement sent by the user for the initial attribute graph, generate a subgraph structure corresponding to the subgraph query statement, determine the target subgraph query execution strategy through a preset calculation method based on the subgraph statistical information and the subgraph structure, wherein the subgraph statistical information is obtained from the graph data structure constructed according to the target attribute graph, encode the target subgraph query execution strategy into a data stream structure, and send the data stream structure to the server 904; the server 904 is configured to receive the data stream structure sent by the client 902, and send the data stream structure to the target execution node of the distributed computing cluster, decode the data stream structure according to the target execution node, obtain the target subgraph determined by the target execution node through querying the initial attribute graph according to the decoding result, and return the target subgraph to the client 902; the client 902 is further configured to receive the target subgraph returned by the server 904, and return the target subgraph to the user. Optionally, the client 902 includes a graph pattern parsing node and a strategy optimization node; accordingly, the graph pattern parsing node is configured to parse the subgraph query statement sent by the user for the initial attribute graph, generate a subgraph structure corresponding to the subgraph query statement, and send the subgraph structure to the strategy optimization node; the strategy optimization node is configured to determine the target subgraph query execution strategy through a preset calculation method based on the subgraph statistical information and the subgraph structure, wherein the subgraph statistical information is obtained from the graph data structure constructed according to the target attribute graph; the strategy optimization node is further configured to encode the target subgraph query execution strategy into a data stream structure and send the data stream structure to the server 904. Optionally, the client 902 also includes a management node; accordingly, the management node is configured to receive the target attribute graph sent by the server 904 and determine the subgraph statistical information in the target attribute graph; construct a graph data structure in the form of the target attribute graph according to the subgraph statistical information, and store the subgraph statistical information in the graph data structure.Optionally, the server 904 includes a distributed stream engine processing node and a distributed graph storage node. Accordingly, the distributed stream engine processing node is configured to receive a data stream structure sent by the client 902 and send the data stream structure to a target execution node in the distributed computing cluster, wherein the data stream structure is obtained by the client processing a received subgraph query statement. The target execution node decodes the data stream structure to obtain a target subgraph determined by the target execution node based on the decoding result and the query based on the initial attribute graph determined by the distributed storage node, and returns the target subgraph to the client 902. Optionally, the server 904 also includes a graph sparse node. The graph sparse node is configured to, in response to a system initialization request, determine the initial attribute graph from the target execution node in the distributed computing cluster based on the distributed storage node. The server 904 samples the initial attribute graph according to a preset sampling strategy to obtain a target attribute graph, and sends the target attribute graph to the client 902, wherein the target attribute graph is smaller than the initial attribute graph. Figure 9 illustrates the graph query process using the GLogS system as an example. System startup and initialization: Upon system startup, the original attribute graph is loaded into the system. Using a hash partitioning strategy, this graph is split into multiple small graph partitions, stored on each node of the distributed computing cluster and managed centrally by the distributed graph storage node (Graph Store). During system initialization, the executors of the distributed data flow engine processing nodes (Distributed DataFlow Engine) assigned to each node load the small graph partitions stored on their corresponding nodes into memory. The graph sparsifier then reads the original attribute graph from the Graph Store, performs sparse sampling, generates a sparse small graph, and provides this small graph to the graph data structure management node (GLogue Manager). Upon receiving the small graph, the GLogue Manager extracts and derives high-dimensional statistical information from it, builds the graph data structure (GLogue), and stores this high-dimensional statistical information in the GLogue as an attribute graph. After the GLogue is generated, it will be provided to the Plan Optimizer node to optimize the user's submitted queries in the future.At the same time, the pattern parser, plan optimizer, remote procedure call service (RPC service), dataflow plugin, and dataflow executors are also started to prepare for processing the upcoming graph pattern query. This concludes the system startup and initialization phase. The specific graph pattern query process is as follows:
[0041] L The user enters a Gremlin match statement, i.e., a graph query statement, into the front-end of the GLogS system;
[0042] 2' After receiving the Gremlin match statement, the front-end (ie, client 902) Pattern Parser converts the Gremlin match statement into a PatternDesc structure, ie, a graph pattern structure, and sends the PatternDesc structure to the Plan Optimizer;
[0043] 3. The front-end Plan Optimizer generates an execution strategy with the lowest computational complexity based on the pre-defined computational complexity estimation model, the PatternDesc structure, and the high-dimensional statistical information stored in GLogue.
[0044] 4. The front-end PlanOptimizer converts the execution strategy into a data flow structure (DataflowDesc) containing the target flow operator and sends the DataflowDesc to the back-end (i.e., the server 904) Distributed
[0045] Dataflow Engine;
[0046] 5. The backend Distributed Dataflow Engine i® sends the DataflowDesc to the executors distributed on each node of the distributed computing cluster via a remote procedure call service (RPC service). The executors on each node decode the DataflowDesc, extract the flow operators, and generate the corresponding execution code.
[0047] 6'Each executor executes the code matching the graph pattern query statement, generates the corresponding graph pattern query result, and returns the graph pattern query result to the Distributed DataFlow Engine for aggregation. The Distributed Dataflow Engine will finally return the aggregated graph pattern query result to the user through the front-end Pattern Paser. In addition, the management node of the graph data structure will also process the situation where the graph pattern is frequently queried but the high-dimensional statistical information corresponding to the graph pattern does not exist in the graph data structure. The specific processing method can be found in the above embodiment and will not be repeated here. The above is a schematic scheme of a graph query system of this embodiment. It should be noted that the technical solution of the graph query system and the technical solution of the graph query method applied to the graph query system mentioned above belong to the same concept. The details of the technical solution of the graph query system that are not described in detail can be found in the description of the technical solution of the graph query method applied to the graph query system mentioned above. Figure 10 shows a structural block diagram of a computing device 1000 provided according to an embodiment of the present disclosure. Components of the computing device 1000 include, but are not limited to, a memory 1010 and a processor 1020. The processor 1020 and the memory 1010 are connected via a bus 1030. A database 1050 is used to store data. The computing device 1000 also includes an access device 1040 that enables the computing device 1000 to communicate via one or more networks 1060. Examples of such networks include a public switched telephone network (PSTN), a local area network (LAN), a wide area network (WAN), a personal area network (PAN), or a combination of communication networks such as the Internet.The access device 1040 may include one or more of any type of wired or wireless network interface (e.g., a network interface card (NIC)), such as an IEEE 802.11 wireless local area network (WLAN) wireless interface, a Worldwide Interoperability for Microwave Access (Wi-MAX) interface, an Ethernet interface, a Universal Serial Bus (USB) interface, a cellular network interface, a Bluetooth interface, a Near Field Communication (NFC) interface, and the like. In one embodiment of the present disclosure, the aforementioned components of the computing device 1000 and other components not shown in FIG. 10 may also be connected to each other, for example, via a bus. It should be understood that the computing device structure block diagram shown in FIG. 10 is for illustrative purposes only and does not limit the scope of the present disclosure. Those skilled in the art may add or replace other components as needed. Computing device 1000 can be any type of stationary or mobile computing device, including a mobile computer or mobile computing device (e.g., tablet computer, personal digital assistant, laptop computer, notebook computer, netbook, etc.), a mobile phone (e.g., smartphone), a wearable computing device (e.g., smartwatch, smart glasses, etc.), or other types of mobile devices, or a stationary computing device such as a desktop computer or personal computer (PC). Computing device 1000 can also be a mobile or stationary server. Processor 1020 is configured to execute the following computer-executable instructions, which, when executed by the processor, implement the steps of the graph query method described above. The above is a schematic diagram of a computing device in this embodiment. It should be noted that the technical solution of this computing device and the technical solution of the graph query method described above are based on the same concept. For details not described in detail in the technical solution of the computing device, please refer to the description of the technical solution of the graph query method described above. One embodiment of the present disclosure also provides a computer-readable storage medium storing computer-executable instructions, which, when executed by the processor, implement the steps of the graph query method described above. The above is an illustrative solution of a computer-readable storage medium of this embodiment.It should be noted that the technical solution of this storage medium is based on the same concept as the technical solution of the graph query method described above. Any details not described in detail in the technical solution of the storage medium can be found in the description of the technical solution of the graph query method described above. One embodiment of the present disclosure also provides a computer program, wherein, when executed on a computer, the computer executes the steps of the graph query method described above. The above is a schematic diagram of a computer program of this embodiment. It should be noted that the technical solution of this computer program is based on the same concept as the technical solution of the graph query method described above. Any details not described in detail in the technical solution of the computer program can be found in the description of the technical solution of the graph query method described above. The above describes specific embodiments of the present disclosure. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims can be performed in an order different from that described in the embodiments and still achieve the desired results. In addition, the processes depicted in the accompanying drawings do not necessarily require the specific order or sequential order shown to achieve the desired results. In certain embodiments, multitasking and parallel processing are also possible or may be advantageous. The computer instructions include computer program code, which may be in source code form, object code form, executable files, or some intermediate form. The computer-readable medium may include any entity or device capable of carrying the computer program code, recording media, a USB flash drive, a removable hard drive, a magnetic disk, an optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signals, telecommunication signals, and software distribution media. It should be noted that the content of the computer-readable medium may be appropriately increased or decreased based on the requirements of legislation and patent practice within a jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media do not include electric carrier signals or telecommunication signals. It should be noted that, for ease of description, the aforementioned method embodiments are described as a series of actions. However, those skilled in the art should understand that the embodiments of the present disclosure are not limited by the order of the actions described, as certain steps may be performed in a different order or simultaneously according to the embodiments of the present disclosure. Secondly, those skilled in the art should also be aware that the embodiments described in this specification are preferred embodiments, and the actions and modules involved are not necessarily required for the embodiments of the present disclosure. In the above embodiments, the description of each embodiment has its own focus. For portions not described in detail in one embodiment, reference can be made to the relevant descriptions of other embodiments.The preferred embodiments of the present disclosure disclosed above are intended only to help illustrate the present disclosure. The optional embodiments do not describe all details in detail, nor do they limit the invention to the specific implementation methods described. Obviously, many modifications and variations are possible based on the content of the embodiments of the present disclosure. This disclosure selects and specifically describes these embodiments to better explain the principles and practical applications of the embodiments of the present disclosure, thereby enabling those skilled in the art to better understand and utilize the present disclosure. The present disclosure is limited by the claims and their full scope and equivalents. Industrial Applicability: The graph query method provided in the embodiments of the present disclosure is applied to a client and provides a method for querying graph patterns based on subgraph statistics. This method fully considers the subgraph statistics stored in the graph data structure and the connections between information. In combination with a preset calculation method, it generates a target subgraph query execution strategy with relatively optimal time and space complexity. This target subgraph query execution strategy is encoded into a data flow structure executable by the server. This allows the server to subsequently efficiently analyze the connections between data based on this data flow structure and perform graph pattern matching queries simply and quickly.
Claims
Claims 1. A graph query method, applied to a client, comprising: Parsing a subgraph query statement sent by a user for an initial property graph, and generating a subgraph structure corresponding to the subgraph query statement; Determine the target subgraph query execution strategy by a preset calculation method according to the subgraph statistical information and the subgraph structure, wherein the subgraph statistical information is obtained from the graph data structure constructed according to the target attribute graph; The target subgraph query execution strategy is encoded into a data stream structure, and the data stream structure is sent to the server; the target subgraph returned by the server through query in the initial attribute graph according to the data stream structure is received, and the target subgraph is returned to the user.
2. The graph query method according to claim 1, before determining the target subgraph query execution strategy by a preset calculation method according to the subgraph statistical information and the subgraph structure, further comprising: Receiving a target attribute graph sent by the server, and determining subgraph statistical information in the target attribute graph; Constructing a graph data structure in the form of the target attribute graph according to the subgraph statistical information, and storing the subgraph statistical information in the graph data structure.
3. According to the graph query method of claim 1, the step of parsing a subgraph query statement sent by a user for an initial attribute graph and generating a subgraph structure corresponding to the subgraph query statement comprises: Receiving a subgraph query statement sent by a user, and parsing the subgraph query statement; When the parsing result satisfies the preset query condition, generating a subgraph structure corresponding to the subgraph query statement; Or when the parsing result does not satisfy the preset query condition, a preset query result is returned to the user.
4. The graph query method according to claim 1, wherein determining the target subgraph query execution strategy by a preset calculation method based on the subgraph statistical information and the subgraph structure comprises: According to the subgraph structure, determining, in the graph data structure, a target point corresponding to the subgraph structure; Subgraph statistical information associated with the target point is determined, and a target subgraph query execution strategy is determined by a shortest path algorithm.
5. According to the graph query method of claim 1, after parsing the subgraph query statement sent by the user for the initial attribute graph and generating the subgraph structure corresponding to the subgraph query statement, the method further comprises: Determine the number of queries of the query subgraph corresponding to the subgraph structure; When the number of queries for the query subgraph is greater than or equal to a preset number threshold, and there is no corresponding subgraph statistical information for the query subgraph in the graph data structure, a statistical information update request is sent to the server; an updated property graph returned by the server according to the statistical information update request is received, and the subgraph statistical information stored in the graph data structure is updated according to the updated property graph.
6. A graph query method, applied to a server, comprising: Receive a data flow structure sent by a client, and send the data flow structure to a target execution node of a distributed computing cluster, wherein the data flow structure is obtained by the client processing a received subgraph query statement; decode the data flow structure according to the target execution node, obtain a target subgraph determined by the target execution node through querying the initial attribute graph according to the decoding result, and return the target subgraph to the client.
7. The graph query method according to claim 6, before receiving the data stream structure sent by the client, further comprising: An initial property graph is determined, the initial property graph is split according to a preset splitting strategy, and the split initial property graphs are respectively stored in target execution nodes of the distributed computing cluster. 22 8. The graph query method according to claim 7, wherein the splitting of the initial attribute graph is stored in the target execution node of the distributed computing cluster, and further comprises: In response to a system initialization request, determining the initial property graph from a target execution node of the distributed computing cluster; sampling the initial property graph according to a preset sampling strategy to obtain a target property graph, and sending the target property graph to the client, wherein the target property graph is smaller than the initial property graph.
9. According to the graph query method of claim 7, the step of decoding the data flow structure according to the target execution node to obtain a target subgraph determined by querying the initial attribute graph according to the decoding result of the target execution node comprises: The data stream structure is decoded according to the target execution node, and a target subgraph is obtained by querying the target execution node in the corresponding initial attribute graph after the splitting according to the decoding result.
10. A graph query method, applied to a graph query system, the graph query system comprising a client and a server, wherein: The method includes: the client, parsing the subgraph query statement sent by the user for the initial property graph, generating a subgraph structure corresponding to the subgraph query statement, determining the target subgraph query execution strategy through a preset calculation method according to the subgraph statistical information and the subgraph structure, wherein the subgraph statistical information is obtained from the graph data structure constructed according to the target property graph, encoding the target subgraph query execution strategy into a data stream structure, and sending the data stream structure to the server; the server, receiving the data stream structure sent by the client, and sending the data stream structure to the target execution node of the distributed computing cluster, decoding the data stream structure according to the target execution node, obtaining the target subgraph determined by the target execution node through query in the initial property graph according to the decoding result, and returning the target subgraph to the client; the client, receiving the target subgraph returned by the server, and returning the target subgraph to the user.
11. According to the graph query method of claim 10, the client comprises a graph pattern parsing node and a strategy optimization node: accordingly, the parsing user sends a subgraph query statement for the initial attribute graph, generates a subgraph structure corresponding to the subgraph query statement, and determines the target subgraph query execution strategy by a preset calculation method according to the subgraph statistical information and the subgraph structure, wherein, The subgraph statistical information is obtained from a graph data structure constructed according to a target property graph, the target subgraph query execution strategy is encoded into a data stream structure, and the data stream structure is sent to the server, including: the graph pattern parsing node, which parses the subgraph query statement sent by the user for the initial property graph, generates a subgraph structure corresponding to the subgraph query statement, and sends the subgraph structure to the strategy optimization node; the strategy optimization node, which determines the target subgraph query execution strategy through a preset calculation method according to the subgraph statistical information and the subgraph structure, wherein the subgraph statistical information is obtained from a graph data structure constructed according to the target property graph; the strategy optimization node, which encodes the target subgraph query execution strategy into a data stream structure, and sends the data stream structure to the server.
12. According to the graph query method of claim 11, the client further comprises a management node; accordingly, before determining the target subgraph query execution strategy by a preset calculation method according to the subgraph statistical information and the subgraph structure, the method further comprises: The management node receives the target attribute graph sent by the server, and determines subgraph statistical information in the target attribute graph; constructing a graph data structure in the form of the target attribute graph according to the subgraph statistical information, and storing the subgraph statistical information in the graph data structure, 13. According to the graph query method of claim 10, the server comprises a distributed stream engine processing node and a distributed graph storage node; accordingly, the receiving the data stream structure sent by the client, and sending the data stream structure to a target execution node of a distributed computing cluster, decoding the data stream structure according to the target execution node, obtaining a target subgraph determined by the target execution node through querying the initial attribute graph according to the decoding result, and returning the target subgraph to the client, comprises: The distributed stream engine processing node receives a data stream structure sent by a client, and sends the data stream structure to a target execution node of a distributed computing group, wherein the data stream structure is obtained by the client processing a received subgraph query statement; the target execution node decodes the data stream structure to obtain a target subgraph determined by the target execution node based on a decoding result and a query based on an initial attribute graph determined by the distributed storage node, and the target subgraph is returned to the client.
14. According to the graph query method of claim 13, the server further comprises a graph sparse node; the graph sparse node, in response to a system initialization request, determines the initial attribute graph from a target execution node of the distributed computing cluster according to the distributed storage node; samples the initial attribute graph according to a preset sampling strategy to obtain a target attribute graph, and sends the target attribute graph to the client, wherein, The target attribute graph is smaller than the initial attribute graph C
Citation Information
Patent Citations
Graph model data processing method and device, and terminal equipment
CN110737805A
System for handling concurrent property graph queries
CN112352234A
Community graph recognition and sampling method, electronic equipment and computer readable storage medium
CN113191428A
Frequent subgraph indexing method and device applied to frequent subgraph query
CN113722551A
Cited By
Information display method and system
CN119166661A
Efficient sub-graph matching query method of cross-database system
CN119782582A
An efficient subgraph matching query method across database systems
CN119782582B
