A graph data semantic analysis method, device, equipment and readable storage medium

By breaking down the semantic analysis process of graph data into a combination of online and offline features, the resource consumption and real-time performance issues of graph neural networks on large-scale graph data are solved, achieving efficient semantic analysis.

CN114443911BActive Publication Date: 2026-03-24DUXIAOMAN TECH (BEIJING) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-28
Publication Date
2026-03-24

AI Technical Summary

Technical Problem

Existing graph neural networks consume huge resources for computation on large-scale graph data, making it impossible to meet real-time requirements. Existing online computing methods suffer from high resource consumption, poor real-time performance, or insufficient expressive power.

Method used

The semantic analysis process of graph data is broken down into online computation and offline feature extraction. By querying the real-time N-order neighbor graph online and combining it with the offline cached X-order historical neighbor features, the analysis results are generated, reducing the pressure of online queries and improving the depth of analysis.

Benefits of technology

While maintaining the depth of semantic analysis, it significantly reduces the consumption of computing resources, improves real-time performance and analysis accuracy, and is suitable for online computing scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114443911B_ABST
    Figure CN114443911B_ABST
Patent Text Reader

Abstract

The application discloses a kind of graph data semantic analysis methods, this method will graph data semantic analysis process be disassembled into three parts of calculating N order inner eigenvalue, N order outer neighbor feature and feature combination, the calculation of neighbor feature most consumed resource is moved to offline stage, when receiving the data analysis request initiated by user, when certain node is as the N order neighbor node of target node, take out the X order historical neighbor feature pre-cached, the whole flow of deep neighbor modeling calculation can be recovered, can be guaranteed to analyze the depth as N+X order neighbor feature, while, the query order of online graph database is reduced to N order neighbor from N+X order neighbor, greatly reduce the query pressure of online graph database, guarantee the calculation of online stage, through the light degree of data to speed up the calculation speed, reduce the consumption of computing resources.The application also discloses a kind of graph data semantic analysis device, equipment and readable storage medium, with corresponding technical effects.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of information processing, in particular to a graph data semantic analysis method, device and equipment and readable storage medium. BACKGROUND

[0002] Graph data is a kind of data widely existing in real life. The edges in the graph can well depict the connection relationship between the non-Euclidean distance of the nodes. Since the graph data has the ability to depict complex data, graph data mining has been widely applied in many fields such as recommendation system, intelligent risk control, knowledge graph and the like. Graph neural network is one of the main tools applied in graph data mining. The graph neural network fully utilizes the characteristics of the graph structure in the calculation process, aggregates the data on the nodes or edges through the connection between the nodes, and combines the powerful modeling capability of the neural network to complete the data mining work.

[0003] The excellent mining capability of the graph neural network is established on the special structure of the graph data. However, in practical applications, the scale of the graph data is often very large. For example, the scale of the graph in the social network may reach nearly one billion or hundreds of millions of edges. On such a large scale of data, the graph neural network modeling needs to consume huge storage and computing resources, especially when the deep multi-hop neighbor sampling is involved in the calculation of the graph neural network. This problem leads to the fact that the graph neural network cannot be applied to online computing scenarios with certain response time limit and real-time requirement.

[0004] The existing graph neural network online computing method is mainly realized through three schemes: 1. Direct online query for calculation. This scheme needs huge resource consumption when processing multi-order neighbor search, and the consumption increases exponentially with the increase of the order. The huge computing resource consumption leads to time-consuming and makes it difficult to meet the real-time requirement; 2. Offline modeling and online taking out. This method can only obtain the calculation result of the past historical data and cannot reflect the latest data changes in this calculation, which may lead to calculation errors; 3. Using only first-order neighbor modeling. This method has a narrow semantic feature analysis level and limited accuracy.

[0005] In summary, how to improve the real-time performance while ensuring the depth of semantic analysis is a technical problem that needs to be solved by the technical personnel in the field at present. SUMMARY

[0006] The purpose of the present application is to provide a graph data semantic analysis method, device, equipment and readable storage medium to improve the real-time performance while ensuring the depth of semantic analysis.

[0007] To solve the above technical problems, the present application provides the following technical solutions:

[0008] A graph data semantic analysis method comprises:

[0009] After receiving the user-initiated data analysis request, taking the object to be analyzed as a target node, and querying the real-time N-order neighbor graph of the target node online;

[0010] Calling a graph neural network to calculate the self-feature of the target node, the N-order neighbor feature, and the self-feature of the N-order neighbor node according to the real-time N-order neighbor graph as real-time features; wherein the graph neural network is obtained by pre-creation according to the offline graph data corresponding to the real-time N-order neighbor graph;

[0011] Finding the X-order historical neighbor feature of each N-order neighbor node in the graph database as offline features; wherein the X-order historical neighbor feature is calculated by calling the graph neural network with each node in the offline graph data as a candidate target node;

[0012] Aggregating the real-time features and the offline features to generate an analysis result.

[0013] Optionally, the graph data semantic analysis method further comprises:

[0014] If the X-order historical neighbor feature of the first node is not in the graph database, fill it with a default value; wherein the first node is an N-order neighbor node of the target node.

[0015] Optionally, after querying the real-time first-order neighbor graph of the target node online, further comprising:

[0016] Querying the offline N-order neighbor graph of the target node in the graph database;

[0017] According to the real-time N-order neighbor graph, updating and merging the data of the offline N-order neighbor graph.

[0018] Optionally, the X-order historical neighbor feature extraction method comprises:

[0019] Determine a plurality of nodes in the same batch of the offline graph data;

[0020] Taking each node as a candidate target node, simultaneously sampling X-order neighbor nodes of each candidate target node;

[0021] Calling the graph neural network to extract X-order historical neighbor features according to each candidate target node and the corresponding X-order neighbor node.

[0022] Optionally, before calling the graph neural network to extract X-order historical neighbor features according to each candidate target node and the corresponding X-order neighbor node, further comprising:

[0023] determine whether there is an edge type that does not reach a set variable type combination or no neighbor node in the X-order neighbor node;

[0024] If there is an edge type that does not reach a set variable type combination or no neighbor node in the X-order neighbor node, fill in the missing edge type and neighbor node as a default value.

[0025] A graph data semantic analysis device, comprising:

[0026] An online query unit, configured to, after receiving a data analysis request initiated by a user, take an object to be analyzed as a target node, and online query a real-time N-order neighbor graph of the target node;

[0027] An online calculation unit, configured to call a graph neural network to calculate, according to the real-time N-order neighbor graph, a self feature of the target node, an N-order neighbor feature, and a self feature of an N-order neighbor node of the target node as real-time features; wherein the graph neural network is obtained in advance according to offline graph data corresponding to the real-time N-order neighbor graph;

[0028] An offline query unit, configured to find X-order historical neighbor features of each N-order neighbor node in a graph database as offline features; wherein the X-order historical neighbor features are calculated by calling the graph neural network with each node in the offline graph data as a candidate target node;

[0029] A feature aggregation unit, configured to aggregate the real-time features and the offline features to generate an analysis result.

[0030] Optionally, the graph data semantic analysis device further comprises a default filling unit, configured to, if there is no X-order historical neighbor feature of a first node in the graph database, fill in a default value; wherein the first node is an N-order neighbor node of the target node.

[0031] Optionally, the graph data semantic analysis device further comprises an offline updating unit;

[0032] The offline updating unit is configured to, after the online query of the real-time first-order neighbor graph of the target node, query an offline N-order neighbor graph of the target node in the graph database, and perform data updating and merging on the offline N-order neighbor graph according to the real-time N-order neighbor graph.

[0033] A computer device, comprising:

[0034] A memory, configured to store a computer program;

[0035] A processor, configured to, when executing the computer program, implement the steps of the above-mentioned graph data semantic analysis method.

[0036] A readable storage medium, wherein a computer program is stored on the readable storage medium, and the computer program, when executed by a processor, implements steps of the graph data semantic analysis method.

[0037] The method provided by the embodiment of the present application divides the graph data semantic analysis process into three parts, i.e., calculating N-order intrinsic eigenvalues, N-order external neighbor characteristics, and combining characteristics, takes the calculation of neighbor characteristics which consumes the most resources as a breakthrough point, and moves the actual calculation to an offline stage. When a node is an N-order neighbor node of a target node, the X-order historical neighbor characteristics pre-stored can be taken out to restore the whole process of deep neighbor modeling calculation. The X-order historical neighbor characteristics storage can ensure the analysis of N+X-order neighbor characteristics and reduce the query order of the online graph database from N+X-order neighbor to N-order neighbor, greatly reducing the query pressure of the online graph database, ensuring the online calculation, accelerating the calculation speed through the lightness of data, and reducing the consumption of calculation resources.

[0038] Correspondingly, the embodiment of the present application also provides a graph data semantic analysis device, equipment and readable storage medium corresponding to the above-mentioned graph data semantic analysis method, which has the above-mentioned technical effects, and details are not described here. BRIEF DESCRIPTION OF DRAWINGS

[0039] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the related art, the drawings needed to be used in the embodiments or the related art description will be briefly introduced. Obviously, the drawings in the following description only some embodiments of the present application, and for those skilled in the art, other drawings can be obtained without creative labor on the basis of these drawings.

[0040] Figure 1 An implementation flowchart of a graph data semantic analysis method in the embodiment of the present application;

[0041] Figure 2 A cache schematic diagram of a first-order neighbor in the embodiment of the present application;

[0042] Figure 3 A single-point calculation consistency schematic diagram in the embodiment of the present application;

[0043] Figure 4 A schematic diagram of a graph data semantic analysis process in the embodiment of the present application;

[0044] Figure 5 A structural schematic diagram of a graph data semantic analysis device in the embodiment of the present application;

[0045] Figure 6 A structural schematic diagram of a computer device in the embodiment of the present application. Detailed Implementation

[0046] The core of this invention is to provide a semantic analysis method for graph data that can improve real-time performance while ensuring the depth of semantic analysis.

[0047] To enable those skilled in the art to better understand the present invention, the invention will be further described in detail below with reference to the accompanying drawings and specific embodiments. Obviously, the described embodiments are merely some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0048] Existing online computation methods for graph neural networks are mainly implemented through three schemes:

[0049] 1. Perform calculations directly online.

[0050] This type of method is relatively simple and direct. When an online request arrives, it directly requests the multi-hop neighbor graph data of the target node from the backend server and returns it to the online server, then calculates the result using a graph neural network.

[0051] The ideal outcome for the system is to perform direct online query computation. However, the core of enabling direct online query computation lies in the backend's ability to promptly return the required multi-hop neighbors of the target node. This requirement relies on a powerful backend database, and in practice, graph databases are generally used to accelerate queries. However, even high-performance graph databases dedicated to graph data querying require significant resource overhead when handling multi-order neighbor retrieval, and this overhead increases exponentially with the order. Online computing scenarios often have strict requirements for response speed; for example, a typical online request cannot exceed 3 seconds. Retrieving multi-hop neighbors on massive graphs with billions of nodes and tens of billions of edges often cannot meet this time requirement, making the direct query and computation method unsuitable for online deep graph neural network computation.

[0052] 2. Offline modeling, online retrieval

[0053] Since offline environments often have more abundant storage and computing resources than online environments, and there are no time constraints in offline environments, deep graph neural network modeling of arbitrary-order neighbors of nodes can be performed offline. The output of the offline modeling can then be stored in a system that meets online response time constraints (such as a database for key-value pair storage and querying). When an online query arrives, the stored offline computation results can be retrieved.

[0054] Such methods make good use of the advantages of no response time limit and abundant resources in offline environment, and can also meet the deep map neural network modeling of multi-hop neighbors, but offline modeling is a kind of prior calculation method, which at least has the following two defects: firstly, offline modeling needs to calculate the model output value of each node in advance, which makes the real-time performance of data poor, and the calculation result of using past historical data can only be obtained when online request comes, and the latest data change cannot be reflected in this calculation, which has fatal defects in some scenarios with high requirements for data real-time performance, such as risk control scenarios, where the node has no risk at the historical time point, but the data changes when the current time point request comes, and the node should have a high risk value, but the calculation result of a lower risk value will be obtained due to the use of historical data for model calculation; secondly, if the node to be queried when online request comes is a node that does not exist in the graph calculated offline, the node will return a strategy value or an error, which will greatly affect the robustness of the system.

[0055] 3. Modeling using only first-order neighbors

[0056] The idea of this scheme is to build or query the first-order neighbor data of the node for modeling only when online data arrives, and to abandon the use of multi-hop neighbor graph data and multi-layer neural network. Using first-order neighbor modeling means that only the graph data containing the first-order neighbors of the target node is used on the data, and the number of layers of the neural network is also only one layer, avoiding the calculation overhead of BFS or DFS of multi-hop neighbors in the subgraph sampling stage.

[0057] The method of using only first-order neighbor modeling can greatly relieve the query pressure of the background graph database, meet the online response speed requirement, and make the whole system achieve online calculation, and avoid the problem that offline new nodes cannot obtain calculation results in offline modeling. However, the disadvantage of first-order neighbor modeling is also very obvious, that is, the depth of the neural network is only one layer, and the expression ability is very weak. This is because in graph neural network modeling, the depth of the network, that is, the number of layers, is consistent with the neighbor hop number of the sampled subgraph. This means that if you want to build an N-layer neural network, you need to sample N-order neighbor subgraphs for aggregation calculation. In recent years, many neural network researches have shown that the higher the number of network layers, the stronger the expression ability of the model, and the better the modeling effect. Although the use of first-order neighbor modeling can guarantee the real-time performance of data and calculation results to a certain extent, the expression ability of the model is limited to one layer of neural network.

[0058] Although the above several schemes can be used for online calculation of graph neural networks, in actual applications, they have respective defects, resulting in unsatisfactory effects or inability to be practically applied.

[0059] In view of this, the present application provides a graph data semantic analysis method, which can maximize the system performance under the requirements of limited resources and online query response speed to approximate online direct query.

[0060] Please refer to Figure 1 , Figure 1 A flowchart of a graph data semantic analysis method in an embodiment of the present application, the method comprising the following steps:

[0061] S101, after receiving a data analysis request initiated by a user, taking the object to be analyzed as a target node, and online querying the real-time N-order neighbor graph of the target node;

[0062] The data analysis request is a feature analysis request for an object. In the present embodiment, the object to be analyzed is not limited, and can be a person, an object, or a virtual object. The object to be analyzed can be specified according to actual use requirements. For example, the data analysis request can be a user A loan risk scoring request, and the object to be analyzed is user A. The real-time N-order neighbor graph refers to a graph data with N-order neighbors. For example, the data analysis request can be a user A loan risk scoring request, and the real-time N-order neighbor graph can be N-order graph data generated according to the credit record of user A, wherein N can be any positive integer.

[0063] The purpose of online querying the real-time N-order neighbor graph of the target node in the present embodiment is to obtain the latest N-order data for online real-time calculation of N-order features. The value of N can be set according to the online calculation capability and the accuracy requirement, which is not limited herein.

[0064] When the data analysis request is received online, the object to be analyzed is first determined as the target node, the online graph data corresponding to the target node is parsed, the N-degree neighbor graph and the features of each point in the latest N-degree graph relationship newly queried online are organized, and the N-degree graph relationship is packaged as a parameter and sent to the graph database processing backend for real-time online feature analysis.

[0065] S102, calling a graph neural network to calculate the features of the target node, the N-order neighbor features, and the features of the N-order neighbor nodes according to the real-time N-order neighbor graph, as real-time features;

[0066] The semantic analysis process of the graph data is divided into three parts, a real-time online calculation part, a direct retrieval part of historical features, and a data fusion part, and the purpose of this step is to realize real-time online calculation. Since the features of the target node and N-order neighbors and the connection relationship of the target node and N-order neighbors can be updated at any time in the real-time online process, to improve the accuracy of semantic analysis, the features of the target node, the N-order neighbor features, and the features of the N-order neighbor nodes are calculated online according to the real-time N-order neighbor graph in this embodiment. The specific calculation process can refer to the calculation method in the related art, which will not be repeated here.

[0067] In the online calling stage, only the N-order neighbor nodes need to be queried, and the N-order neighbor subgraph of the target node can be constructed according to the data source in the online scene. At this time, the N-order neighbor graph result of the model and the model aggregation calculation are real-time, and the points that do not exist in the graph database can also be calculated, which guarantees the accuracy of the analysis process.

[0068] In order to reduce resource investment, the graph neural network called in online calculation is created in advance according to the offline graph data corresponding to the real-time N-order neighbor graph, and the graph neural network is created according to the offline graph data at that time in offline calculation. The network is directly called for calculation in online calculation, the creation process of the graph neural network is moved to the offline node, which guarantees the calculation in the online stage and accelerates the calculation speed through the lightness of the data and reduces the consumption of the calculation resources. It should be noted that the modeling depth of the offline created graph neural network, that is, the sampling neighbor order in calculation, needs to be confirmed, and then the corresponding offline model is established. The specific modeling depth can be determined according to the order of calculation in actual calling, which is not limited here.

[0069] S103、In the graph database, find the X-order historical neighbor features of each N-order neighbor node as offline features;

[0070] In graph neural network calculation, each aggregation needs to obtain the subgraph of the target node and its surrounding neighbors from the target node. When the graph structure is determined, the neighbor structure obtained from the node is fixed, and the fixity of the neighbor structure also represents the fixity of the graph neural network calculation. In view of this, in the present application, the most resource-consuming neighbor feature (neigh-hidden) calculation stage is taken as the breakthrough point, the original calculation process is disassembled into smaller calculation units, the analysis process of one semantic feature is disassembled into N-order inner feature and N-order outer neighbor feature calculation, the actual calculation of the most resource-consuming neighbor feature (neigh-hidden) calculation stage is moved to the offline stage, the neighbor features of the deep neighbor nodes are cached offline, the hidden layer vector of the candidate target node in the calculation graph is calculated in advance according to the entry edge direction, the intermediate result of the deep neighbor modeling calculation is cached in the data field of each node, and when the node is used as a neighbor node of the target node, the hidden layer vector cached in advance is taken out to restore the whole process of the deep neighbor modeling calculation. This scheme can cache any order of neighbors, such as Figure 2 As shown in the cache diagram of the first-order neighbor, the left side of the figure is the graph data, and the right side is the first-order neighbor diagram of all nodes corresponding to the cache.

[0071] In order to complete the complete deep neighbor modeling, the neighbor features calculated by taking all nodes as candidate target nodes need to be cached offline. In real-time online calculation, the X-order historical neighbor features of each neighbor node of the target node calculated offline can be directly obtained and called, and as long as the one-degree graph of online query is fused with the deep aggregation result cached offline, the deep aggregation calculation process starting from the target node can be completed. Under this configuration, the calculation units are reasonably allocated to the online or offline stage to achieve the optimal calculation overhead, which guarantees the lightweight degree of data in the online calculation and reduces the consumption of computing resources; at the same time, the calculation of the feature is expanded from N-order to N+X-order in the online calculation, the analysis depth is significantly increased, and the increase of the analysis depth can improve the accuracy of the feature analysis.

[0072] It should be noted that the execution sequence of steps S102 and S103 is not limited in the embodiment, and can be performed simultaneously or sequentially, Figure 1 In the embodiment, only the sequential execution is taken as an example, and the specific setting can be made according to the actual use needs, which will not be described here.

[0073] S104, aggregating real-time features and offline features to generate analysis results.

[0074] After obtaining the real-time features calculated online and the offline features calculated offline, the two parts of feature information are combined, and the overall feature analysis result of the analysis object is obtained. The aggregation process of the two parts of feature information can be implemented by referring to the related implementation manners, such as point multiplication or addition, and the like, and will not be described here.

[0075] Based on the above introduction, the technical scheme provided by the embodiment of the application divides the graph data semantic analysis process into three parts: calculating N-order inner eigenvalues, N-order outer neighbor features, and feature combination. The calculation of the neighbor feature, which consumes the most resources, is taken as the starting point, and the actual calculation is moved to the offline stage. When receiving a data analysis request initiated by a user, if a node is an N-order neighbor node of a target node, the X-order historical neighbor feature pre-stored in the cache is taken to restore the entire process of deep neighbor modeling calculation. The X-order historical neighbor feature cache can ensure that the analysis depth is N+X-order neighbor features, while reducing the query order of the online graph database from N+X-order neighbor to N-order neighbor, greatly reducing the query pressure of the online graph database, ensuring the calculation in the online stage, and accelerating the calculation speed through the lightness of data, and reducing the consumption of calculation resources.

[0076] It should be noted that based on the above embodiment, the embodiment of the application also provides a corresponding improvement scheme. The steps involved in the preferred / improved embodiment can be mutually referenced between the above-mentioned embodiment or corresponding steps, and the corresponding beneficial effects can also be mutually referenced. The preferred / improved embodiment in this paper will not be described one by one.

[0077] In the process of querying and calling X-order neighbor features of N-order neighbor nodes of a target node in a graph database, if the graph database does not have X-order historical neighbor features of the first node (which can be referred to as any node), the lack of data will cause the aggregation result to be uncertain, affecting the consistency of the final operation result offline and online. The processing method for this situation in the above embodiment is not limited, and the filling method with a default value can be selected.

[0078] In order to ensure the batch calculation of offline modeling and the single-point calculation of online, the aggregation result of the empty side is filled with a default value to ensure the online and offline consistency of the calculation result. For example, when N is 1, point 3 is a first-order neighbor of target node 1. If the graph database does not have X-order neighbor features calculated with point 3 as a candidate target node, the X-order neighbor features of point 3 are filled with zero vectors (or other default values). After filling, there is no lack of data, which avoids the uncertainty of the aggregation result and improves the stability and accuracy of the calculation process.

[0079] In addition, to further improve the accuracy of the historical neighbor feature calculation, after querying the real-time first-order neighbor graph of the target node, the offline N-order neighbor graph of the target node can be further queried in the graph database; and the real-time N-order neighbor graph is combined with the offline N-order neighbor graph according to the data update.

[0080] Accordingly, the overall implementation process is as follows: when an online request arrives, the online data is first parsed, and the N-degree neighbor graph and the features of each point in the latest N-degree graph relationship that are queried in real time are organized. The N-degree graph relationship is packaged as a parameter and sent to the graph database processing backend. The graph database queries the corresponding offline stored N-degree graph relationship according to the target node, and combines and updates the data. After completion, it is returned to the calling end. The calling end combines the N-degree graph relationship and the hidden layer vector saved by the point to restore the calculation state of the forward propagation to the state of the multi-layer neural network deep graph structure, and continues to calculate the output model according to the latest N-degree feature state. The calculation value is the overdue probability, which is finally returned to the interface calling party.

[0081] By updating the offline stored historical graph data with the real-time N-order neighbor graph obtained in each real-time request, the N-order neighbors centered on the target node in the offline stored graph data are the latest and most real-time neighbors. Therefore, when calculating the neighbor features according to the offline graph data, the updated neighbor nodes can be used for corresponding calculation, avoiding the influence of historical neighbor node information on the accuracy in the calculation, thereby improving the calculation accuracy.

[0082] The extraction method of the corresponding X-order historical neighbor feature calculated for each node as a candidate target node stored in the graph database is not limited in the above embodiment. In order to improve the aggregation effect and ensure the consistency of single-point calculation, an implementation step is introduced in this embodiment, which is as follows:

[0083] (1) Determine a plurality of nodes in the same batch of offline graph data.

[0084] (2) Take each node as a candidate target node, and sample X-order neighbor nodes of each candidate target node.

[0085] (3) Call the graph neural network to extract X-order historical neighbor features according to each candidate target node and the corresponding X-order neighbor nodes.

[0086] The online calculation scenario of the graph neural network is usually a single-point query, and the offline modeling is generally trained by using the batch gradient descent method. Figure 3In the off-line batch gradient descent, in order to save memory consumption, the starting nodes in a batch can be simultaneously sampled and their neighbors can be simultaneously calculated, such as points 1, 3 and 6 in the same batch.

[0087] By simultaneously sampling and calculating the nodes in the same batch during off-line modeling, the large calculation burden and time occupation caused by single node sampling and calculation can be avoided. When the nodes in the same batch are simultaneously sampled and calculated, the memory consumption caused by sampling and calculation is greatly reduced, and the response time is also shortened.

[0088] On the basis of the above steps, before calling the graph neural network to extract the X-order historical neighbor feature according to each candidate target node and the corresponding X-order neighbor node, the following steps can be further performed:

[0089] (4) Determine whether there is an edge type that does not reach the set variable type combination or no neighbor node in the X-order neighbor node.

[0090] (5) If there is an X-order neighbor node with an edge type that does not reach the set variable type combination or no neighbor node, the missing edge type and neighbor node are filled with a default value.

[0091] In the off-line batch gradient descent, in order to save memory consumption, the starting nodes in a batch can be simultaneously sampled and their neighbors can be simultaneously calculated, such as points 1, 3 and 6 in the same batch. Point 3 has only one type of incoming edge, and point 6 is an isolated point. When point 3 and 6 perform edge-based aggregation operations, they may have uncertain results due to the lack of certain types of edge relationships. When scoring a single point, only the edge type relationship connected by point 3 and 6 will be aggregated, which leads to inconsistent results between batch scoring and single point scoring for points with incomplete edge types, affecting the consistency of the final operation results between off-line and on-line. In this embodiment, for such points with incomplete edge types or isolated points, a display filling vector is used for processing, such as filling all with zero vectors to ensure the consistency of batch calculation and single point calculation.

[0092] To deepen the understanding of the overall implementation steps of the above embodiment, this embodiment introduces an overall calculation process when N=1 and X=1, as shown in Figure 4 , wherein Figure 4 The upper left of is four legends.

[0093] The process of graph data semantic analysis is divided into the following three steps:

[0094] First, since each point in the graph has a feature, the hidden layer vector of the node itself feature self-hidden can be calculated, that is, the white unshaded vector in the graph.

[0095] Specifically, taking the hidden layer vector of the computing node 1 as an example, assuming that the graph neural network is 2 layers, that is, 2-order neighbors will be used, and the entry edge direction is discussed here, in principle, the two-layer neural network of the computing node 1 needs to use the information of the 1-degree neighbor of 1, that is, the nodes 2 and 4, and the 2-degree neighbor of 1, that is, the nodes 2, 3 and 5; the aggregation process of the graph neural network is: the features of 3 are aggregated to 2, the aggregation of 2 and 5 is to 4, and then the aggregation of 2 and 4 is to 1, here, the hidden layer vector after the aggregation of 2 and 4 to 1 is stored as the 2-order neighbor vector of 1, it can be seen that the actual calculation process of this vector is from 3 and 5, and it is propagated layer by layer.

[0096] In the second step, since each node in the graph has neighbor nodes, if the node is an isolated point, the number of neighbor nodes is considered to be zero, and the aggregation result is a full zero vector, so the hidden layer vector neigh-hidden of each node after the aggregation of neighbor features can be calculated, such as the neigh-hidden of the nodes 2 and 4 in the figure after the aggregation of neighbor vectors, which is stored offline in the database;

[0097] The intermediate result cache mode can also reduce the query order of the online graph database from the high-order neighbor to the first-order neighbor, greatly reducing the query pressure of the online graph database.

[0098] In the third step, the self-hidden and the neigh-hidden are combined on each node, and the combination operation here is a general operation, which can be addition or point multiplication, and the like, which is defined by the calculation process of the graph neural network, but their characteristics are that the self-hidden and the neigh-hidden are input, and an operation result vector is output.

[0099] In order to enable the vectors cached offline to correctly participate in the calculation, the embodiment restores the online deep calculation, and by modifying the aggregation process of the graph neural network, the model can complete the data aggregation of the 2-order and above neighbors on the first-order neighbor data.

[0100] When queried online, such as querying node 1 as shown in the figure, there are total neighbor nodes 2, 4, 6 and 9, of which nodes 2 and 4 are contained in the previous offline graph, and the neigh-hidden of which has been stored in the graph database. As long as nodes 2 and 4 are queried online, the hidden layer vector of the deep neighbor modeling thereof can be obtained. This scheme can be compatible with new points, new changes, such as the neighbor number containing a new point 9, a new edge 9->1 and a new edge 6->1, of which node 6 already exists in the offline graph, but since there is no edge from node 6 to node 1, they are not connected. At this time, node 6 can also query its neigh-hidden because it has been in the offline database, and node 9 is a new point that does not exist in the offline graph, which means that it has no other neighbors to participate in the calculation, so the default value can be used to fill in its neigh-hidden. In this way, the online deep neighbor modeling calculation can be completed under the condition of querying the first-degree neighbor of node 1.

[0101] In this way, only the information of the first-degree neighbor of node 1 is used in online calculation, and nodes 3 and 5 do not need to be queried to complete the calculation of the two-order neighbor graph.

[0102] The implementation steps provided by the embodiment split the calculation process according to the calculation characteristics of the graph neural network, save the intermediate calculation result of the second-to-last hidden layer of the graph neural network to the graph database through offline calculation, and only query the first-order neighbor of the node as input graph data during online calculation. In the process of node feature aggregation, the offline hidden layer result calculated is inserted into the calculation data stream, so that the complete calculation of the deep multi-layer neural network is completed, and the calculation of the first-order neighbor is real-time data calculation. This step makes the system performance approximate to the online direct query calculation scheme under the requirements of limited resources and online query response speed as much as possible, has high implementability, avoids the poor real-time effect of offline modeling, and at the same time allows the use of deep multi-layer graph neural network calculation in online scenarios and supports new node calculation.

[0103] Corresponding to the above method embodiment, the embodiment of the application also provides a graph data semantic analysis device. The graph data semantic analysis device described below can be mutually corresponding and referred to with the graph data semantic analysis method described above.

[0104] Referring to Figure 5 As shown in the figure, the device includes the following modules:

[0105] The online query unit 110 is mainly used for receiving a data analysis request initiated by a user, taking an object to be analyzed as a target node, and querying the real-time N-order neighbor graph of the target node online;

[0106] The online computing unit 120 is mainly used to call a graph neural network to calculate the self feature of the target node, the N-order neighbor feature, and the self feature of the N-order neighbor node according to the real-time N-order neighbor graph, as a real-time feature; wherein the graph neural network is obtained by being previously created according to the offline graph data corresponding to the real-time N-order neighbor graph;

[0107] The offline querying unit 130 is mainly used to find the X-order historical neighbor feature of each N-order neighbor node in the graph database as an offline feature; wherein the X-order historical neighbor feature is obtained by calling the graph neural network with each node in the offline graph data as a candidate target node;

[0108] The feature aggregation unit 140 is mainly used to aggregate the real-time feature and the offline feature to generate an analysis result.

[0109] In one specific embodiment of the present application, the graph data semantic analysis device further comprises a default filling unit configured to fill the X-order historical neighbor feature of the first node with a default value if the X-order historical neighbor feature of the first node is not found in the graph database; wherein the first node is the N-order neighbor node of the target node.

[0110] In one specific embodiment of the present application, the graph data semantic analysis device further comprises an offline updating unit.

[0111] The offline updating unit is configured to query the offline N-order neighbor graph of the target node in the graph database after querying the real-time first-order neighbor graph of the target node, and to update and merge the offline N-order neighbor graph according to the real-time N-order neighbor graph.

[0112] Corresponding to the above method embodiment, the present application also provides a computer device, and the computer device described below can be correspondingly referred to the graph data semantic analysis method described above.

[0113] The computer device comprises:

[0114] A memory for storing a computer program;

[0115] A processor for executing the computer program to realize the steps of the graph data semantic analysis method of the above method embodiment.

[0116] Specifically, please refer to Figure 6A specific structural schematic diagram of a computer device provided for the embodiment can be quite different in configuration or performance, and can include one or more processors (central processing units, CPU) 322 (for example, one or more processors) and a memory 332 storing one or more computer applications 342 or data 344. The memory 332 can be temporary storage or persistent storage. The program stored in the memory 332 can include one or more modules (not shown in the figure), each of which can include a series of instruction operations on the data processing device. Further, the central processor 322 can be configured to communicate with the memory 332 to execute the series of instruction operations in the memory 332 on the computer device 301.

[0117] The computer device 301 can further include one or more power supplies 326, one or more wired or wireless network interfaces 350, one or more input / output interfaces 358, and / or one or more operating systems 341.

[0118] The steps in the graph data semantic analysis method described above can be implemented by the structure of the computer device.

[0119] Corresponding to the above method embodiment, the embodiment of the present application also provides a readable storage medium. The readable storage medium described below can be correspondingly referred to the graph data semantic analysis method described above.

[0120] A readable storage medium, the readable storage medium storing a computer program, the computer program being executed by a processor to implement the steps of the graph data semantic analysis method of the above method embodiment.

[0121] The readable storage medium can be a U disk, a mobile hard disk, a read-only memory (Read-Only Memory, ROM), a random access memory (Random Access Memory, RAM), a magnetic disk or an optical disk, and various readable storage media that can store program codes.

[0122] Those skilled in the art can further realize that units and algorithm steps of each example described in combination with the embodiments disclosed herein can be realized in electronic hardware, computer software or a combination of both, and the general description of each example is described in the above description in a general manner for clarity. Whether the functions are performed in hardware or software depends on specific applications and design constraints of the technical solutions. Those skilled in the art can use different methods to realize the described functions for each specific application, but such implementation should not be considered beyond the scope of the present application.

Claims

1. A semantic analysis method for graph data, characterized in that, include: Upon receiving a data analysis request initiated by a user, the object to be analyzed is taken as the target node, and the real-time N-order neighbor graph of the target node is queried online; The graph neural network is invoked to calculate the target node's own features, N-order neighbor features, and N-order neighbor node's own features based on the real-time N-order neighbor graph, as real-time features; wherein, the graph neural network is pre-created based on the offline graph data corresponding to the real-time N-order neighbor graph; The X-order historical neighbor features of each of the N-order neighbor nodes are searched in the graph database and used as offline features; wherein, the X-order historical neighbor features are calculated by calling the graph neural network with each node in the offline graph data as a candidate target node; The real-time features and the offline features are aggregated to generate analysis results.

2. The graph data semantic analysis method according to claim 1, characterized in that, Also includes: If the graph database does not have X-order historical neighbor features for the first node, it is filled with default values; wherein, the first node is the N-order neighbor node of the target node.

3. The graph data semantic analysis method according to claim 1, characterized in that, After querying the real-time first-order neighbor graph of the target node online, the method further includes: Query the offline N-order neighbor graph of the target node in the graph database; The offline N-order neighbor graph is updated and merged based on the real-time N-order neighbor graph.

4. The graph data semantic analysis method according to claim 1, characterized in that, The method for extracting the X-order historical neighbor features includes: Identify several nodes from the same batch of the offline graph data; Each of the aforementioned nodes is selected as a candidate target node, and the X-order neighbor nodes of each of the candidate target nodes are sampled simultaneously. The graph neural network is invoked to extract X-order historical neighbor features based on each candidate target node and its corresponding X-order neighbor nodes.

5. The graph data semantic analysis method according to claim 4, characterized in that, Before invoking the graph neural network to extract X-order historical neighbor features based on each candidate target node and its corresponding X-order neighbor nodes, the method further includes: Determine whether there are any edge types among the X-order neighbor nodes that do not meet the set variable type combination, or whether there are no neighbor nodes; If there are edge types that do not meet the set variable type combinations, or if there are X-order neighbor nodes that have no neighbor nodes, the missing edge types and neighbor nodes will be filled with default values.

6. A graph data semantic analysis device, characterized in that, include: The online query unit is used to receive a data analysis request initiated by a user, take the object to be analyzed as the target node, and query the real-time N-order neighbor graph of the target node online. An online computing unit is used to call a graph neural network to calculate the target node's own features, N-order neighbor features, and N-order neighbor node's own features based on the real-time N-order neighbor graph, as real-time features; wherein, the graph neural network is pre-created based on the offline graph data corresponding to the real-time N-order neighbor graph; An offline query unit is used to search for the X-order historical neighbor features of each of the N-order neighbor nodes in the graph database as offline features; wherein, the X-order historical neighbor features are calculated by calling the graph neural network with each node in the offline graph data as a candidate target node; The feature aggregation unit is used to aggregate the real-time features and the offline features to generate analysis results.

7. The graph data semantic analysis device according to claim 6, characterized in that, Also includes: A default fill unit is used to fill the graph database with a default value if the graph database does not have an X-order historical neighbor feature of the first node; wherein the first node is an N-order neighbor node of the target node.

8. The graph data semantic analysis device according to claim 6, characterized in that, Also includes: Offline update unit; The offline update unit is used to: after querying the real-time first-order neighbor graph of the target node online, query the offline N-order neighbor graph of the target node in the graph database; and update and merge the offline N-order neighbor graph according to the real-time N-order neighbor graph.

9. A computer device, characterized in that, include: Memory, used to store computer programs; A processor, configured to implement the steps of the graph data semantic analysis method as described in any one of claims 1 to 5 when executing the computer program.

10. A readable storage medium, characterized in that, The readable storage medium stores a computer program that, when executed by a processor, implements the steps of the graph data semantic analysis method as described in any one of claims 1 to 5.

Citation Information

Patent Citations

  • Big data calculation method, system and computer equipment

    CN108519914A

  • Method and device for updating relational network

    CN111291138A