A method and device for extracting graph features

By obtaining and weighting neighboring node features and calculating the target node feature encoding, the problem of insufficient accuracy in graph feature extraction in the existing technology is solved, and the accuracy of recommendation and anti-fraud is improved.

CN112860949BActive Publication Date: 2024-09-17STATE GRID DIGITAL TECHNOLOGY HOLDING CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN201911180676.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2019-11-27
Publication Date
2024-09-17
Estimated Expiration
2039-11-27

AI Technical Summary

Technical Problem

Existing graph feature extraction methods such as EdgeConv ignore the influence of neighboring nodes' own characteristics on the nodes, resulting in the extracted graph features being inaccurate enough and affecting the accuracy of recommendation matching and anti-fraud risk assessment.

Method used

By obtaining the neighboring node features of the target node in the graph, calculate the attention coefficient, and use these coefficients to weighted summation of the feature matrix of neighboring nodes, calculate the feature encoding of the target node, avoid direct edge feature accumulation and summation, and enhance the efficiency of feature extraction. Accuracy.

Benefits of technology

It improves the accuracy of map feature extraction, and improves the accuracy of recommendation matching and anti-fraud risk assessment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112860949B
    Figure CN112860949B
Patent Text Reader

Abstract

The embodiments of the present invention provide a method and device for extracting graph features, which relate to the field of computer software technology, and can extract graph features based on neighboring nodes to improve the accuracy of graph feature extraction. The method includes: extracting the features of nodes in the graph to generate a feature set; obtaining neighboring nodes of a target node in the graph to generate a target neighbor graph; querying the features of neighboring nodes of the target node in the feature set according to the target neighbor graph to generate a feature matrix of neighboring nodes; extracting edge feature sets of the target node and neighboring nodes; normalizing the edge feature sets to generate attention coefficients of neighboring nodes; using the attention coefficients of neighboring nodes to perform weighted summation on the feature matrices of neighboring nodes to calculate the feature encoding of the target node. The embodiments of the present application are applied to extracting graph features of nodes.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] Embodiments of the present invention relate to the field of computer software technology, and in particular, to a method and device for extracting graph features. Background Art

[0002] Traditional relational data has exposed modeling defects and horizontal scaling issues, so graph data with more powerful expression capabilities has received great attention in the industry. Graph is an important data structure, which consists of nodes (vertex) and edges (edge). Graphs are generally represented as G (V, E), where nodes can also be called vertices, representing individuals; edges represent the connections between individuals. The connections of each node in the graph are different. Some nodes have three connections, and some nodes have two connections. It is an irregular data structure.

[0003] In real life, there are many data that can be represented by graph data structures, such as abstract graphs of social relationships, electronic transaction relationships, molecular structures, etc. For example, in web search, web pages can be used as nodes, and the hyperlink relationships between pages can be used as edges; in social networks, users can be used as nodes, and the relationships established between users can be used as edges. For example, WeChat's social network uses individuals and public accounts as nodes, and follows and likes as edges to form a graph; for e-commerce, the transaction network of the mall is a graph composed of nodes (individuals, products) and edges (purchases, favorites).

[0004] EdgeConv is a graph convolutional network widely used for graph feature extraction. The steps of graph feature extraction mainly include extracting the features of each edge, then accumulating and summing the features of the edges to obtain the feature encoding of the nodes, and obtaining the graph features of the nodes. The extracted graph features can be used for recommendation or anti-fraud. First, the method of extracting graph features through EdgeConv ignores the influence of the neighboring nodes' own features on the nodes; secondly, since the neighboring nodes of different categories are far away and the neighboring nodes of the same category are close, the degree of influence of each neighboring node on the central node is also different. Therefore, this method that only considers edge features, the extracted graph features are not accurate enough. Further, when applying graph features for recommendation, it will cause the recommended content and the recommended object to have a low match. When applying graph features for anti-fraud, it will cause the risk assessment to be inaccurate. Summary of the invention

[0005] Embodiments of the present invention provide a method and device for extracting graph features, which can extract graph features based on neighboring nodes and improve the accuracy of graph feature extraction.

[0006] In a first aspect, a method for extracting graph features is provided, comprising the following steps: extracting features of nodes in a graph to generate a feature set, wherein the graph comprises at least two nodes; the nodes in the graph comprise information in an e-commerce transaction process, and the graph further comprises an edge connecting two nodes, the edge being used to represent the relationship between the nodes at both ends of the edge; obtaining neighboring nodes of a target node in the graph to generate a target neighbor graph; querying features of neighboring nodes of the target node in a feature set according to the target neighbor graph to generate a feature matrix of the neighboring nodes; extracting edge feature sets of the target node and the neighboring nodes; normalizing the edge feature sets to generate attention coefficients of the neighboring nodes; and performing weighted summation of the feature matrices of the neighboring nodes using the attention coefficients of the neighboring nodes to calculate the feature encoding of the target node.

[0007] In the above scheme, the features of the nodes in the graph are extracted to generate a feature set, wherein the graph includes at least two nodes; the nodes in the graph include information in the e-commerce transaction process, and the graph also includes an edge connecting the two nodes, and the edge is used to represent the relationship between the nodes at both ends of the edge; the neighboring nodes of the target node in the graph are obtained to generate a target neighbor graph; the features of the neighboring nodes of the target node in the feature set are queried according to the target neighbor graph to generate a feature matrix of the neighboring nodes; the edge feature set of the target node and the neighboring nodes is extracted; the edge feature set is normalized to generate the attention coefficient of the neighboring nodes; the feature matrix of the neighboring nodes is weighted summed using the attention coefficient of the neighboring nodes to calculate the feature encoding of the target node. Therefore, in this application, the features of the neighboring nodes of the target node are first obtained; then the attention coefficient of each neighboring node is calculated, and finally the feature coding of the target node is calculated together with the attention coefficient of the neighboring nodes of the target node and the features of the neighboring nodes. This avoids the situation where the feature coding of the target node is calculated directly by accumulating and summing the edge features of the target node and the neighboring nodes without considering the influence of the neighboring nodes on the target node, thereby improving the accuracy of graph feature extraction. Further, when applying graph features for recommendation, the matching degree between the recommended content and the recommended object will be improved, and the accuracy of risk assessment can be improved when applying graph features for anti-fraud.

[0008] Optionally, the attention coefficients of the neighboring nodes are used to perform weighted summation on the feature matrices of the neighboring nodes, including: inputting the attention coefficients of the neighboring nodes and the feature matrices of the neighboring nodes into a graph convolutional network, and calculating the feature encoding of the target node.

[0009] Optionally, the attention coefficients of the neighboring nodes and the feature matrix of the neighboring nodes are input into the graph convolutional network to calculate the feature encoding of the target node, including: inputting the attention coefficients of the neighboring nodes and the feature matrix of the neighboring nodes into the formula Get the feature code of the target node, where p i Represents the feature encoding of the target node, represents the attention coefficient of the neighboring nodes, represents the characteristics of neighboring nodes, Represents the bias of a graph convolutional network.

[0010] Optionally, extracting features of nodes in the graph and generating a feature set includes: using a multilayer perceptron to extract features of nodes in the graph and generating a feature set.

[0011] Optionally, neighboring nodes of the target node in the graph are obtained to generate a target neighbor graph, including: obtaining neighboring nodes of the target node in the graph according to a K-nearest neighbor method to generate a target neighbor graph.

[0012] Optionally, querying the features of neighboring nodes of the target node in the feature set according to the target neighbor graph to generate a feature matrix of the neighboring nodes includes: using FIND N i The function generates a feature matrix of neighboring nodes based on the target neighbor graph query feature set, where N i represents the target neighbor graph.

[0013] Optionally, normalize the edge feature set and generate the attention coefficient of the neighboring nodes, including: according to the formula Normalize the edge feature set and generate the attention coefficient of the neighboring nodes, where represents the attention coefficient of the neighboring nodes, Represents an edge feature in an edge feature set.

[0014] In a second aspect, a device for extracting graph features is provided, including: a generation module, used to extract features of nodes in a graph and generate a feature set, wherein the graph includes at least two nodes; the nodes in the graph include information in an e-commerce transaction process, and the graph also includes an edge connecting two nodes, and the edge is used to represent the relationship between the nodes at both ends of the edge; the generation module is also used to obtain neighboring nodes of a target node in the graph and generate a target neighbor graph; a query module is used to query features of neighboring nodes of the target node in a feature set according to the target neighbor graph generated by the generation module and generate a feature matrix of the neighboring nodes; the generation module is also used to extract an edge feature set of the target node and the neighboring nodes; the generation module is also used to normalize the edge feature set and generate an attention coefficient of the neighboring nodes; a calculation module is used to perform weighted summation on the feature matrix of the neighboring nodes generated by the query module using the attention coefficient of the neighboring nodes generated by the generation module, and calculate the feature coding of the target node.

[0015] Optionally, the computing module is specifically used to input the attention coefficients of neighboring nodes and the feature matrices of neighboring nodes into the graph convolutional network to calculate the feature encoding of the target node.

[0016] Optionally, a calculation module is used to input the attention coefficient of the neighboring node and the feature matrix of the neighboring node into the formula Get the feature code of the target node, where p i Represents the feature encoding of the target node, represents the attention coefficient of the neighboring nodes, represents the characteristics of neighboring nodes, Represents the bias of a graph convolutional network.

[0017] Optionally, a generation module is specifically used to use a multi-layer perceptron to extract features of nodes in the graph and generate a feature set.

[0018] Optionally, a generation module is specifically used to obtain neighboring nodes of a target node in a graph according to a K-nearest neighbor method, and generate a target neighbor graph.

[0019] Optional, query module, specifically used to use FIND N i The function generates a feature matrix of neighboring nodes based on the target neighbor graph query feature set, where N i represents the target neighbor graph.

[0020] Optional, generate module, specifically used according to the formula Normalize the edge feature set and generate the attention coefficient of the neighboring nodes, where represents the attention coefficient of the neighboring nodes, Represents an edge feature in an edge feature set.

[0021] In a third aspect, a graph feature extraction device is provided, comprising a processor. When the graph feature extraction device is running, the processor executes computer execution instructions to enable the graph feature extraction device to perform the graph feature extraction method as described above.

[0022] In a fourth aspect, a computer storage medium is provided, comprising instructions, which, when executed on a computer, enable the computer to execute the method for extracting graph features as described above.

[0023] In a fifth aspect, a computer program product is provided, the computer program product comprising instruction codes, the instruction codes being used to execute the method for extracting graph features as described above.

[0024] It can be understood that any of the above-mentioned graph feature extraction devices, computer storage media or computer program products are used to execute the method corresponding to the first aspect provided above. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects of the method of the first aspect above and the corresponding scheme in the specific implementation manner below, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0026] Figure 1 A schematic diagram of a transaction relationship graph in an e-commerce scenario provided by an embodiment of the present invention;

[0027] Figure 2 A schematic flow chart of a method for extracting graph features provided by an embodiment of the present invention;

[0028] Figure 3 A schematic diagram of the structure of an AttentionEdgeConv module provided by an embodiment of the present invention;

[0029] Figure 4 A schematic diagram of the structure of a device for extracting graph features provided by an embodiment of the present invention;

[0030] Figure 5 A schematic diagram of the structure of a device for extracting graph features provided in accordance with another embodiment of the present invention. DETAILED DESCRIPTION

[0031] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0032] In real life, a lot of data can be represented by graph data structures, such as graphs abstracted from social relationships, electronic transaction relationships, and molecular structures. For example, in web search, web pages can be regarded as nodes, and the hyperlink relationships between pages can be regarded as edges; in social networks, users can be regarded as nodes, and the relationships established between users can be regarded as edges. For example, the social network of WeChat regards individuals and public accounts as nodes, and follows and likes as edges to form a graph; for e-commerce, the transaction network of the mall is a graph composed of nodes (individuals, products) and edges (purchases, favorites). For another example, see Figure 1As shown, the transaction relationship graph in the e-commerce scenario includes nodes such as category 11, product 12, transaction network protocol (internet protocol, IP) 13, transaction 14, registration address 15, user 16, and delivery address 17. The nodes associated with user 16 are registration address 15 and delivery address 16; the nodes associated with transaction 14 are product 12, transaction IP 13, registration address 15, user 16, and delivery address 17; the nodes associated with product 12 are category 11; among them, user 16 can also be associated with product 12 through rating, and the rating is the edge between user 16 and product 12.

[0033] From the above, we can see that, first of all, each node in the graph has its own feature information. For example, Figure 1 A risk control system is established to detect whether the registered address 15, transaction IP 13, and delivery address 16 of user 16 in the transaction relationship graph in the e-commerce scenario are consistent with the pre-stored node information associated with user 16. If these feature information do not match, the risk control system will determine that user 16 has a certain fraud risk. Secondly, each node in the graph has structural information. If a node is connected to a large number of transaction nodes over a period of time, that is, there are a large number of edges extending from the node, the risk control system will determine that the node is risky.

[0034] EdgeConv is a graph convolutional network widely used in graph feature extraction. For a graph G, its node set is v = {1, 2, ... n}, and the corresponding directed edge set is Assume that the distance node p i The nearest point p j1 ,p j2 ,…p jk The directed edge formed is<i,j1> ,<i,j2> ,… <i,j k >, the edge characteristics of the directed edge are First, EdgeConv is based on the formula Compute node p i Edge features Among them, p i represents a node in the graph, p jk -p i Represents node p i With node p jk The edge between them. Θ It can be expressed as is the hidden layer function, which is a nonlinear function composed of some learnable parameters weight and bias. Specifically, h Θ (p i , p j -p i )=w×[p i ||pj -p i ]+b, the activation function is ReLU, where the numerical expression of the ReLU activation function is f(x)=max(0,x), || is the matrix connection operation, which means that the node p i The characteristics and edge p j -p i The features of are concatenated point by point, and b is the deviation of the graph convolution network. Secondly, EdgeConv obtains the edge features Afterwards, according to the formula Perform channel-level aggregation operations on all nodes p i Associated edge features Fusion is performed and the fused features are used as node p i The feature encoding of , where the digital expression of the activation function σ is p i ′ For node p i The feature encoding, p i represents a node in the graph, p jk -p i Represents node p i With node p jk The edge between.

[0035] First, the method of extracting graph features through EdgeConv ignores the influence of the neighboring nodes’ own features on the nodes; secondly, since the neighboring nodes of different categories are far away and the neighboring nodes of the same category are close, the degree of influence of each neighboring node on the central node is also different. Therefore, this method that only considers edge features does not extract accurate graph features. Further, when applying graph features for recommendation, the match between the recommended content and the recommended object will be low, and when applying graph features for anti-fraud, risk assessment will be inaccurate.

[0036] In view of the above problems, this application provides a method for extracting graph features. Figure 2 As shown, the specific steps include:

[0037] 201. Extract the features of the nodes in the graph and generate a feature set.

[0038] First, the graph includes at least two nodes; the nodes in the graph include information in the e-commerce transaction process, and the graph also includes an edge connecting two nodes, and the edge is used to represent the relationship between the nodes at both ends of the edge, for example, see Figure 1 As shown, in the transaction relationship graph in the e-commerce scenario, user 16 can associate product 12 through a rating, and the rating connects user 16 and product 12, which is an edge between user 16 and product 12.

[0039] Secondly, the graph is input into an artificial neural network (ANN) to extract the features of the nodes in the graph and generate a feature set. Specifically, the structure of {a1, a2, ..., a n A multi-layer perceptron (MLP) is used to extract the features of nodes in the graph and generate a feature set. The MLP includes an input layer, an output layer and a hidden layer, which are used to extract the features of nodes in the graph.

[0040] Furthermore, in another optional solution of the present application, a back propagation (BP) neural network may be used to extract features of nodes in the graph.

[0041] 202. Obtain neighboring nodes of the target node in the graph and generate a target neighbor graph.

[0042] Specifically, neighboring nodes of a target node in a graph are obtained according to a K-nearest neighbor (KNN) method to generate a target neighbor graph, wherein the target neighbor graph includes the relationship between the target node and the neighboring nodes of the target node.

[0043] 203. Query the features of neighboring nodes of the target node in the feature set according to the target neighbor graph, and generate a feature matrix of the neighboring nodes.

[0044] Specifically, we first use the relationship between the target node and the neighboring nodes of the target node in the target neighbor graph to query the neighboring nodes of the target node, then obtain the features corresponding to the neighboring nodes of the target node in the feature set, and generate the feature matrix of the neighboring nodes of the target node. Specifically, we can use FIND N i The function generates a feature matrix of neighboring nodes based on the target neighbor graph query feature set, where N i represents the target neighbor graph.

[0045] 204. Extract edge feature sets between the target node and neighboring nodes.

[0046] Specifically, we can use the structure {a1, a2, ..., a n} extracts the edge feature set between the target node and the neighboring nodes in the graph. For example, in MLP, h Θ is the hidden layer function in MLP, according to the formula Extract the target node p i Edge features Among them, p i represents the target node in the graph, p jk -p i represents the target node pi The neighboring nodes p of the target node jk The edge between them. Θ It is a nonlinear function composed of some learnable parameters weight and bias. Θ (p i , p j -p i )=w×[p i ||p j -p i ]+b, the activation function is ReLU, where the digital expression of the ReLU activation function is f(x)=max(0,x), || is the matrix connection operation, which means that the target node p i The characteristics and edge p j -p i The features of are concatenated point by point, and b is the bias of the graph convolutional network.

[0047] 205. Normalize the edge feature set and generate the attention coefficient of the neighboring nodes.

[0048] Specifically, since the hidden layer function used to extract the edge feature set is a nonlinear function composed of some learnable parameters weight and bias, the features in the edge feature set of the target node and the neighboring nodes extracted by MLP indicate the importance of the neighboring nodes to the target node. Therefore, in order to make the attention coefficient easy to compare between different neighboring nodes, it can be calculated according to the formula Normalize the edge feature set and generate the attention coefficient of the neighboring nodes, where represents the attention coefficient of the neighboring nodes, Represents an edge feature in an edge feature set.

[0049] Furthermore, in another optional solution of the present application, the edge feature set between the target node and the neighboring node can also be directly used as the attention coefficient of the neighboring node.

[0050] 206. Use the attention coefficients of neighboring nodes to perform weighted summation on the feature matrices of neighboring nodes and calculate the feature encoding of the target node.

[0051] Specifically, the attention coefficients of the neighboring nodes and the feature matrix of the neighboring nodes are input into the graph convolution network to calculate the feature code of the target node, wherein the graph convolution network is used to perform weighted summation of the attention coefficients of the neighboring nodes and the feature matrix of the neighboring nodes to calculate the feature code of the target node. Furthermore, the attention coefficients of the neighboring nodes and the feature matrix of the neighboring nodes are input into the convolution formula of the graph convolution network. In the above example, we obtain the feature encoding of the target node, where p i Represents the feature encoding of the target node, represents the attention coefficient of the neighboring nodes, represents the characteristics of neighboring nodes, Represents the bias of a graph convolutional network.

[0052] Furthermore, in another optional solution of the present application, the attention coefficient of the neighboring node and the feature matrix of the neighboring node can also be input into the convolution formula of the graph convolution network: Get the feature code of the target node, where p i Represents the feature encoding of the target node, represents the attention coefficient of the neighboring nodes, Represents the characteristics of neighboring nodes.

[0053] For example, the graph feature extraction device of the present application may include an AttentionEdgeConv module, see Figure 3 As shown, the AttentionEdgeConv module includes a KNN module 31, an MLP module 32, a softmax module 33, a FIND module 34, and a weighted summation module 35, wherein the KNN module 31 is used to obtain the neighboring nodes of the target node in the graph and generate a target neighbor graph; the MLP module 32 is used to extract the features of the nodes in the graph, generate a feature set, and also to extract the edge feature set of the target node and the neighboring nodes; the softmax module 33 is used to normalize the edge feature set and generate the attention coefficient of the neighboring nodes; the FIND module 34 is used to query the features of the neighboring nodes of the target node in the feature set according to the target neighbor graph and generate a feature matrix of the neighboring nodes; the weighted summation module 35 is used to perform weighted summation on the feature matrix of the neighboring nodes using the attention coefficients of the neighboring nodes, calculate the feature encoding of the target node, and obtain the features of the target node.

[0054] In the above scheme, the features of the nodes in the graph are extracted to generate a feature set, wherein the graph includes at least two nodes; the nodes in the graph include information in the e-commerce transaction process, and the graph also includes an edge connecting the two nodes, and the edge is used to represent the relationship between the nodes at both ends of the edge; the neighboring nodes of the target node in the graph are obtained to generate a target neighbor graph; the features of the neighboring nodes of the target node in the feature set are queried according to the target neighbor graph to generate a feature matrix of the neighboring nodes; the edge feature set of the target node and the neighboring nodes is extracted; the edge feature set is normalized to generate the attention coefficient of the neighboring nodes; the feature matrix of the neighboring nodes is weighted summed using the attention coefficient of the neighboring nodes to calculate the feature encoding of the target node. Therefore, in this application, the features of the neighboring nodes of the target node are first obtained; then the attention coefficient of each neighboring node is calculated, and finally the feature coding of the target node is calculated together with the attention coefficient of the neighboring nodes of the target node and the features of the neighboring nodes. This avoids the situation where the feature coding of the target node is calculated directly by accumulating and summing the edge features of the target node and the neighboring nodes without considering the influence of the neighboring nodes on the target node, thereby improving the accuracy of graph feature extraction. Further, when applying graph features for recommendation, the matching degree between the recommended content and the recommended object will be improved, and the accuracy of risk assessment can be improved when applying graph features for anti-fraud.

[0055] The embodiment of the present invention can divide the functional modules of the graph feature extraction device according to the above-mentioned method embodiment. For example, each functional module can be divided according to each function, or two or more functions can be integrated into one processing module. The above-mentioned integrated module can be implemented in the form of hardware or in the form of software functional modules. It should be noted that the division of modules in the embodiment of the present invention is schematic and is only a logical functional division. There may be other division methods in actual implementation.

[0056] Reference Figure 4As shown, the present application provides a device for extracting graph features, including: a generation module 41, used to extract features of nodes in a graph and generate a feature set, wherein the graph includes at least two nodes; the nodes in the graph include information in an e-commerce transaction process, and the graph also includes an edge connecting two nodes, and the edge is used to represent the relationship between the nodes at both ends of the edge; the generation module 41 is also used to obtain the neighboring nodes of the target node in the graph and generate a target neighbor graph; a query module 42 is used to query the features of the neighboring nodes of the target node in the feature set according to the target neighbor graph generated by the generation module 41, and generate a feature matrix of the neighboring nodes; the generation module 41 is also used to extract an edge feature set between the target node and the neighboring nodes; the generation module 41 is also used to normalize the edge feature set and generate an attention coefficient of the neighboring nodes; a calculation module 43 is used to perform weighted summation on the feature matrix of the neighboring nodes generated by the query module 42 using the attention coefficient of the neighboring nodes generated by the generation module 41, and calculate the feature coding of the target node.

[0057] Optionally, the calculation module 43 is specifically used to input the attention coefficient of the neighboring node and the feature matrix of the neighboring node into the graph convolution network to calculate the feature code of the target node.

[0058] Optionally, the calculation module 43 is specifically used to input the attention coefficient of the neighboring node and the feature matrix of the neighboring node into the formula Get the feature code of the target node, where p i represents the characteristic code of the target node, represents the attention coefficient of the neighboring node, represents the characteristics of the neighboring nodes, Represents the bias of the graph convolutional network.

[0059] Optionally, the generating module 41 is specifically used to extract features of nodes in the graph using a multi-layer perceptron to generate a feature set.

[0060] Optionally, the generation module 41 is specifically used to obtain neighboring nodes of the target node in the graph according to the K-nearest neighbor method to generate a target neighbor graph.

[0061] Optionally, the query module 42 is specifically configured to use FIND N i The function queries the features of the neighboring nodes of the target node in the feature set according to the target neighbor graph, and generates a feature matrix of the neighboring nodes, where N i Represents the target neighbor graph.

[0062] Optionally, the generating module 41 is specifically configured to generate Normalize the edge feature set to generate the attention coefficient of the neighboring node, where: represents the attention coefficient of the neighboring node, represents an edge feature in the edge feature set.

[0063] In the case of using an integrated module, the device for extracting graph features includes: a storage unit, a processing unit, and an interface unit. The processing unit is used to control and manage the actions of the device for extracting graph features. The interface unit is responsible for information exchange between the device for extracting graph features and other devices. The storage unit is responsible for storing program codes and data of the device for extracting graph features.

[0064] Among them, the processing unit may be a processor, the storage unit may be a memory, and the interface unit may be a communication interface.

[0065] Among them, the extraction device of the spectrum feature refers to Figure 5 As shown in , it includes a processor 502, and the processor 502 is used to execute application code, so as to implement the method described in the embodiment of the present application.

[0066] The processor 502 may be a general-purpose central processing unit (CPU), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits for controlling the execution of the program of the present application.

[0067] like Figure 5 As shown, the device for extracting graph features may further include a memory 503 .

[0068] The memory 503 may be a read-only memory (ROM) or other types of static storage devices that can store static information and instructions, a random access memory (RAM) or other types of dynamic storage devices that can store information and instructions, or an electrically erasable programmable read-only memory (EEPROM), a compact disc read-only memory (CD-ROM) or other optical disc storage, optical disc storage (including compressed optical disc, laser disc, optical disc, digital versatile disc, Blu-ray disc, etc.), a magnetic disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store the desired program code in the form of an instruction or data structure and can be accessed by a computer, but is not limited thereto. The memory may exist independently and be connected to the processor via a bus. The memory may also be integrated with the processor.

[0069] The memory 503 is used to store the application code for executing the solution of the present application, and the execution is controlled by the processor 502. Figure 5 As shown, the apparatus for extracting graph features may further include a communication interface 501. The communication interface 501, the processor 502, and the memory 503 may be coupled to each other, for example, via a bus 504.

[0070] The communication interface 501 is used to exchange information with other devices, for example, to support information exchange between the graph feature extraction device and other devices, such as obtaining data from other devices or sending data to other devices.

[0071] In addition, a computer storage medium (or medium) is also provided, including instructions for performing the method for extracting the graph features in the above embodiment when executed. In addition, a computer program product is also provided, including the above computer storage medium (or medium).

[0072] Among them, all relevant contents of each step involved in the above method embodiment can be referred to the functional description of the corresponding functional module, and its role will not be repeated here.

[0073] It should be understood that in various embodiments of the present invention, the size of the serial numbers of the above-mentioned processes does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.

[0074] Those of ordinary skill in the art will appreciate that the modules, units, and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.

[0075] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0076] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not performed. Another point, the coupling or direct coupling or communication connection between each other shown or discussed can be an indirect coupling or communication connection through some interface, device or unit, which can be electrical, mechanical or other forms.

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

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

[0079] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in various embodiments of the present invention. The aforementioned storage media include: U disk, mobile hard disk, read-only memory (full name in English: read-only memory, English abbreviation: ROM), random access memory (full name in English: random access memory, English abbreviation: RAM), magnetic disk or optical disk, and other media that can store program codes.

[0080] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed by the present invention, which should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.

Claims

1. A method for extracting graph features, It is characterized in that Extract the features of the nodes in the graph and generate a feature set, wherein the graph includes at least two nodes; the nodes in the graph include information in the e-commerce transaction process, and the graph also includes an edge connecting the two nodes, and the edge is used to represent the relationship between the nodes at both ends of the edge. For e-commerce, the transaction network of the mall is a graph composed of nodes and edges, the nodes are used to represent individuals or commodities, and the edges are used to represent purchases or collections; Get the neighboring nodes of the target node in the graph and generate the target neighbor graph; Querying the features of neighboring nodes of the target node in the feature set according to the target neighbor graph to generate a feature matrix of neighboring nodes; Extracting edge feature sets between the target node and the neighboring nodes; Normalizing the edge feature set to generate an attention coefficient of the neighboring node; Using the attention coefficients of the neighboring nodes, weighted summation is performed on the feature matrices of the neighboring nodes to calculate the feature code of the target node; The feature matrix of the neighboring nodes is weightedly summed using the attention coefficient of the neighboring nodes, including: The attention coefficients of the neighboring nodes and the feature matrices of the neighboring nodes are input into a graph convolutional network to calculate the feature encoding of the target node.

2. The method for extracting graph features according to claim 1, It is characterized in that Inputting the attention coefficient of the neighboring node and the feature matrix of the neighboring node into the graph convolution network, and calculating the feature encoding of the target node, including: Input the attention coefficient of the neighboring node and the feature matrix of the neighboring node into the formula Get the feature code of the target node, where p i represents the feature code of the target node, represents the attention coefficient of the neighboring node, represents the characteristics of the neighboring nodes, Represents the bias of the graph convolutional network.

3. The method for extracting graph features according to claim 1, It is characterized in that The step of extracting features of nodes in the graph and generating a feature set includes: Multilayer perceptron is used to extract the features of nodes in the graph and generate feature sets.

4. The method for extracting graph features according to claim 1, It is characterized in that The step of obtaining neighboring nodes of a target node in the graph and generating a target neighbor graph includes: According to the K-nearest neighbor method, the neighboring nodes of the target node in the graph are obtained to generate the target neighbor graph.

5. The method for extracting graph features according to claim 1, It is characterized in that The step of querying the features of neighboring nodes of the target node in the feature set according to the target neighbor graph to generate a feature matrix of the neighboring nodes includes: USE FIND N i The function queries the features of the neighboring nodes of the target node in the feature set according to the target neighbor graph, and generates a feature matrix of the neighboring nodes, where N i Represents the target neighbor graph.

6. The method for extracting graph features according to claim 1, It is characterized in that The normalizing the edge feature set to generate the attention coefficient of the neighboring node includes: According to the formula Normalize the edge feature set to generate the attention coefficient of the neighboring node, where: represents the attention coefficient of the neighboring node, represents an edge feature in the edge feature set.

7. A device for extracting spectral features, It is characterized in that include: A generation module is used to extract features of nodes in a graph and generate a feature set, wherein the graph includes at least two nodes; the nodes in the graph include information in an e-commerce transaction process, and the graph also includes an edge connecting two nodes, wherein the edge is used to represent the relationship between the nodes at both ends of the edge. For e-commerce, the transaction network of a shopping mall is a graph consisting of nodes and edges, wherein the nodes are used to represent individuals or commodities, and the edges are used to represent purchases or collections; The generation module is further used to obtain neighboring nodes of the target node in the graph to generate a target neighbor graph; A query module, configured to query the features of the neighboring nodes of the target node in the feature set according to the target neighbor graph generated by the generation module, and generate a feature matrix of the neighboring nodes; The generation module is further used to extract edge feature sets between the target node and the neighboring nodes; The generation module is further used to normalize the edge feature set and generate the attention coefficient of the neighboring node; A calculation module, configured to perform weighted summation on the feature matrix of the neighboring nodes generated by the query module using the attention coefficient of the neighboring nodes generated by the generation module, and calculate the feature code of the target node; The calculation module is specifically used to input the attention coefficient of the neighboring node and the feature matrix of the neighboring node into the graph convolution network to calculate the feature code of the target node.

8. The device for extracting graph features according to claim 7, It is characterized in that The calculation module is specifically used to input the attention coefficient of the neighboring node and the feature matrix of the neighboring node into the formula Get the feature code of the target node, where p i represents the feature code of the target node, represents the attention coefficient of the neighboring node, represents the characteristics of the neighboring nodes, Represents the bias of the graph convolutional network.

9. The device for extracting graph features according to claim 7, It is characterized in that The generation module is specifically used to extract the features of nodes in the graph using a multi-layer perceptron to generate a feature set.

10. The device for extracting graph features according to claim 7, It is characterized in that The generation module is specifically used to obtain neighboring nodes of the target node in the graph according to the K-nearest neighbor method to generate a target neighbor graph.

11. The device for extracting graph features according to claim 7, It is characterized in that The query module is specifically used to use FIND N i The function queries the features of the neighboring nodes of the target node in the feature set according to the target neighbor graph, and generates a feature matrix of the neighboring nodes, where N i Represents the target neighbor graph.

12. The device for extracting graph features according to claim 7, It is characterized in that The generating module is specifically used to generate Normalize the edge feature set to generate the attention coefficient of the neighboring node, where: represents the attention coefficient of the neighboring node, represents an edge feature in the edge feature set.

13. A device for extracting graph features, It is characterized in that It includes a processor. When the graph feature extraction device is running, the processor executes computer execution instructions to enable the graph feature extraction device to perform the graph feature extraction method as described in any one of claims 1 to 6.

14. A computer storage medium comprising instructions, It is characterized in that When the instruction is executed on a computer, the computer is enabled to execute the method for extracting graph features as described in any one of claims 1 to 6.

15. A computer program product, It is characterized in that The computer program product includes instruction codes, and the instruction codes are used to execute the method for extracting graph features as described in any one of claims 1-6.