CN116151620A - Sub-graph matching method and device, storage medium and electronic equipment - Google Patents

Sub-graph matching method and device, storage medium and electronic equipment Download PDF

Info

Publication number
CN116151620A
CN116151620A CN202310149830.XA CN202310149830A CN116151620A CN 116151620 A CN116151620 A CN 116151620A CN 202310149830 A CN202310149830 A CN 202310149830A CN 116151620 A CN116151620 A CN 116151620A
Authority
CN
China
Prior art keywords
node
graph
sub
determining
expanded
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202310149830.XA
Other languages
Chinese (zh)
Inventor
曾馨檀
刘永超
胡逸飞
王宝坤
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Alipay Hangzhou Information Technology Co Ltd
Original Assignee
Alipay Hangzhou Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Alipay Hangzhou Information Technology Co Ltd filed Critical Alipay Hangzhou Information Technology Co Ltd
Priority to CN202310149830.XA priority Critical patent/CN116151620A/en
Publication of CN116151620A publication Critical patent/CN116151620A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q10/00Administration; Management
    • G06Q10/06Resources, workflows, human or project management; Enterprise or organisation planning; Enterprise or organisation modelling
    • G06Q10/063Operations research, analysis or management
    • G06Q10/0635Risk analysis of enterprise or organisation activities
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q40/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/04Trading; Exchange, e.g. stocks, commodities, derivatives or currency exchange

Landscapes

  • Business, Economics & Management (AREA)
  • Engineering & Computer Science (AREA)
  • Human Resources & Organizations (AREA)
  • Strategic Management (AREA)
  • Economics (AREA)
  • Entrepreneurship & Innovation (AREA)
  • General Business, Economics & Management (AREA)
  • Finance (AREA)
  • Development Economics (AREA)
  • Marketing (AREA)
  • Accounting & Taxation (AREA)
  • Theoretical Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Physics & Mathematics (AREA)
  • Educational Administration (AREA)
  • Tourism & Hospitality (AREA)
  • Quality & Reliability (AREA)
  • Operations Research (AREA)
  • Game Theory and Decision Science (AREA)
  • Technology Law (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

In the sub-graph matching method provided by the specification, designated nodes are firstly determined in a topological graph, then sub-graphs corresponding to the designated nodes and characteristics of all the sub-graphs are determined, types of all the sub-graphs are determined according to the characteristics of all the sub-graphs, then representative sub-graphs are determined in the sub-graphs of each type, and finally sub-graphs matched with the representative sub-graphs are determined in other topological graphs. According to the method, the subgraphs corresponding to the designated nodes are determined in the topological graph, namely subgraph mining, the subgraphs matched with the representative subgraphs are determined in other topological graphs, namely subgraph matching is performed based on subgraph mining, and useful information can be determined in a large-scale topological graph quickly by applying the method.

Description

Sub-graph matching method and device, storage medium and electronic equipment
Technical Field
The present invention relates to the field of computers, and in particular, to a method, an apparatus, a storage medium, and an electronic device for sub-graph matching.
Background
With the continuous development of internet technology and the increasing complexity of data to be processed, the application of graph data is becoming wider.
According to the information contained in the topological graph, a lot of useful information can be obtained, for example, in the topological graph taking the merchant and the user as nodes, the transaction information between the merchant and the user and the transaction information between the user and the user are contained, and the information about whether the merchant is complained, whether the user has abnormal transaction behaviors or not and the like can be obtained. Useful information contained in the topological graph may be representative subgraphs, the representative subgraphs may be used for matching in other topological graphs, further, subgraphs matched with the representative subgraphs in other topological graphs are determined, and by using the above example, a relationship between a merchant node with risk or a user node with abnormal transaction behavior and each node may be determined in other topological graphs with merchant and user as nodes, further, matching in other topological graphs with merchant and user as nodes is performed, and a relationship between a merchant node with risk or a user node with abnormal transaction behavior and each node may be determined in other topological graphs with merchant and user as nodes. Measures such as early warning can be timely taken after risk is determined to avoid transaction risk.
In a small-scale graph (i.e. a graph with fewer nodes and edges), subgraphs taking risk merchants or abnormal transaction users as nodes can be determined quickly, and early warning is further carried out on risks, however, as the scale of graph data is larger and larger, how to determine representative subgraphs and match the subgraphs is a problem to be solved urgently.
Disclosure of Invention
The present disclosure provides a sub-graph matching method, apparatus, storage medium, and electronic device, so as to at least partially solve the foregoing problems in the prior art.
The technical scheme adopted in the specification is as follows:
the present specification provides a method of sub-graph matching, the method comprising:
determining a designated node in the topology map;
determining sub-graphs corresponding to the designated nodes in the topological graph, and the attribute of each node and the attribute of each edge in each sub-graph;
inputting the attribute of each node and the attribute of each side in each sub-graph into a pre-trained graph neural network model aiming at each sub-graph to obtain the characteristics of the sub-graph output by the graph neural network model;
determining the type of the sub-graph according to the characteristics of the sub-graph;
for each type, determining a representative subgraph from the subgraphs of the type, and storing;
When receiving a sub-graph matching request, determining a topological graph to be matched according to the sub-graph matching request;
and determining the sub-graph matched with the representative sub-graph in the topological graph to be matched according to the stored representative sub-graphs.
Optionally, determining the designated node in the topology map specifically includes:
acquiring the attribute of each node in the topological graph;
determining the attribute of the appointed dimension in the attributes;
judging whether an attribute value corresponding to the attribute of the designated dimension of each node in the topological graph falls into a preset attribute value range or not;
if yes, determining the node as the appointed node.
Optionally, determining a sub-graph corresponding to the designated node in the topological graph specifically includes:
taking the designated node as an activated node, determining the edge of the activated node and the adjacent node of the activated node aiming at each activated node, and taking the adjacent node of the activated node as a node to be expanded;
for each node to be expanded, determining a topological graph formed by the node to be expanded, the active node and edges between the node to be expanded and the active node as a sub-graph corresponding to the node to be expanded, and taking the active node as the last node to be expanded of the node to be expanded;
And re-determining nodes except the last node to be expanded in the adjacent nodes of the node to be expanded as nodes to be expanded, continuing to use a topological graph formed by the sub-graph of the last node to be expanded and the re-determined nodes to be expanded as sub-graphs corresponding to the re-determined nodes to be expanded aiming at each re-determined node to be expanded until the repetition times reach the preset times or the number of edges of the sub-graphs is larger than a preset threshold value, and taking all the sub-graphs corresponding to the determined nodes to be expanded as the sub-graphs corresponding to the appointed nodes.
Optionally, obtaining the characteristics of the subgraph output by the graph neural network model specifically includes:
obtaining a characteristic value of the subgraph output by the graph neural network model;
according to the characteristics of the subgraph, determining the type of the subgraph comprises the following specific steps:
and determining the types of the subgraphs with the same characteristic value as the same type.
Optionally, determining a representative sub-graph among the sub-graphs of the type specifically includes:
judging whether the number of the subgraphs in the type is larger than a preset threshold value according to the number of the subgraphs in the type;
if yes, a representative sub-graph is determined among the sub-graphs of the type.
Optionally, the topology graph at least includes a user relationship graph;
the nodes in the user relation graph comprise user nodes and merchant nodes;
the appointed node is a merchant node;
attributes of edges between the user node and the merchant node include complaint information.
Optionally, the topological graph to be matched is other user relation graph;
after determining the sub-graph matched with the representative sub-graph in the topology graph to be matched, the method further comprises:
and determining the merchant node contained in the sub-graph matched with the representative sub-graph as a risk node.
The present specification provides an apparatus for sub-graph matching, the apparatus comprising:
the first determining module is used for determining a designated node in the topological graph;
the second determining module is used for determining the subgraphs corresponding to the designated nodes in the topological graph, and the attribute of each node and the attribute of each side in each subgraph;
the computing module is used for inputting the attribute of each node and the attribute of each side in each sub-graph into a pre-trained graph neural network model to obtain the characteristics of the sub-graph output by the graph neural network model;
the classifying module is used for determining the type of the subgraph according to the characteristics of the subgraph;
The storage module is used for determining a representative sub-graph in the sub-graphs of each type and storing the representative sub-graph;
the receiving module is used for determining a topological graph to be matched according to the sub-graph matching request when the sub-graph matching request is received;
and the matching module is used for determining the subgraphs matched with the representative subgraphs in the topological graph to be matched according to the stored representative subgraphs.
Optionally, the first determining module is specifically configured to obtain an attribute of each node in the topology map; determining the attribute of the appointed dimension in the attributes; judging whether an attribute value corresponding to the attribute of the designated dimension of each node in the topological graph falls into a preset attribute value range or not; if yes, determining the node as the appointed node.
Optionally, the second determining module is specifically configured to use a designated node as an active node, determine, for each active node, an edge of the active node and an adjacent node of the active node, and use the adjacent node of the active node as a node to be expanded; for each node to be expanded, determining a topological graph formed by the node to be expanded, the active node and edges between the node to be expanded and the active node as a sub-graph corresponding to the node to be expanded, and taking the active node as the last node to be expanded of the node to be expanded; and re-determining nodes except the last node to be expanded in the adjacent nodes of the node to be expanded as nodes to be expanded, continuing to use a topological graph formed by the sub-graph of the last node to be expanded and the re-determined nodes to be expanded as sub-graphs corresponding to the re-determined nodes to be expanded aiming at each re-determined node to be expanded until the repetition times reach the preset times or the number of edges of the sub-graphs is larger than a preset threshold value, and taking all the sub-graphs corresponding to the determined nodes to be expanded as the sub-graphs corresponding to the appointed nodes.
Optionally, the calculating module is specifically configured to obtain a feature value of the subgraph output by the graph neural network model;
the classification module is specifically configured to determine the types to which the subgraphs with the same feature value belong as the same type.
Optionally, the storage module is specifically configured to determine, according to the number of subgraphs in the type, whether the number of subgraphs in the type is greater than a preset threshold; if yes, a representative sub-graph is determined among the sub-graphs of the type.
Optionally, the topology graph at least includes a user relationship graph;
the nodes in the user relation graph comprise user nodes and merchant nodes;
the appointed node is a merchant node;
attributes of edges between the user node and the merchant node include complaint information.
Optionally, the topological graph to be matched is other user relation graph;
the apparatus further comprises:
and the result module is used for determining the merchant node contained in the sub-graph matched with the representative sub-graph as a risk node.
The present description provides a computer-readable storage medium storing a computer program which, when executed by a processor, implements the above method.
The present specification provides an electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the above method when executing the program.
The above-mentioned at least one technical scheme that this specification adopted can reach following beneficial effect:
in the sub-graph matching method provided by the application, designated nodes are firstly determined in a topological graph, then the sub-graph corresponding to the designated nodes and the characteristics of each sub-graph are determined, the type of each sub-graph is determined according to the characteristics of each sub-graph, then a representative sub-graph is determined in each type of sub-graph, and finally the sub-graph matched with the representative sub-graph is determined in other topological graphs.
According to the method, the subgraphs corresponding to the designated nodes are determined in the topological graph, namely subgraph mining, the subgraphs matched with the representative subgraphs are determined in other topological graphs, namely subgraph matching is performed based on subgraph mining, and useful information can be determined in a large-scale topological graph quickly by applying the method.
Drawings
The accompanying drawings, which are included to provide a further understanding of the specification, illustrate and explain the exemplary embodiments of the present specification and their description, are not intended to limit the specification unduly. In the drawings:
FIG. 1 is a flow chart of a sub-graph matching method provided in the present specification;
FIG. 2 is a schematic diagram of a user relationship diagram provided in the present specification;
FIG. 3 is a schematic diagram of a sub-graph matching apparatus provided herein;
fig. 4 is a schematic view of the electronic device corresponding to fig. 1 provided in the present specification.
Detailed Description
For the purposes of making the objects, technical solutions and advantages of the present specification more apparent, the technical solutions of the present specification will be clearly and completely described below with reference to specific embodiments of the present specification and corresponding drawings. It will be apparent that the described embodiments are only some, but not all, of the embodiments of the present specification. All other embodiments, which can be made by one of ordinary skill in the art without undue burden from the present disclosure, are intended to be within the scope of the present application based on the embodiments herein.
The following describes in detail the technical solutions provided by the embodiments of the present specification with reference to the accompanying drawings.
Fig. 1 is a flow chart of a sub-graph matching method provided in the present specification, specifically including the following steps:
s100: a designated node is determined in the topology map.
The execution subject of the sub-graph matching method provided in the present specification may be any electronic device with computing capability, such as a server, a terminal, and the like.
The topology graph is a graph formed by nodes and edges between the nodes, each node has respective attributes, edges between the nodes (namely, the relationship between the nodes) also have attributes, each attribute can correspond to a plurality of attribute values, the attributes of the nodes are used for describing the properties of the nodes, the attributes of the edges between the nodes are used for describing the properties of the relationships between the nodes, for example, as shown in fig. 2, the user relationship graph is a topology graph, the graph comprises user nodes and merchant nodes, the attributes of the user nodes can comprise information such as user names, the attributes of the merchant nodes can comprise merchant names, the attributes of the edges of the user nodes and the merchant nodes can comprise transaction information, complaint information, and the like.
The topological graph contains a large amount of rich information, useful information can be determined in the topological graph, comparison can be performed in other topological graphs, and whether similar information exists or not can be determined so as to acquire more information.
Along the above example, the risky merchant information may be determined in the user relationship graph, that is, the merchant node used to represent the risky merchant information may be determined in the user relationship graph, and such merchant node may be referred to as a risk node, and the determined risk node may be compared with other user relationship graphs to determine whether there is a risk node in the other user relationship graphs, and further, measures such as supervision, assessment, and the like may be taken with respect to the determined risk node.
The above-mentioned useful information is determined in the topological graph, that is, the sub-graph for representing the useful information is determined in the topological graph, and the presence or absence of similar information is compared in other topological graphs, that is, the determined sub-graph is matched in other topological graphs, and the sub-graph containing the same or similar useful information in other topological graphs is determined.
The core idea of the method is to determine a representative sub-graph in the topology graph (i.e. containing useful information) and then match the same or similar sub-graph as the previously determined representative sub-graph in the other topology graph.
According to the core idea of the method, a representative sub-graph is first determined in a topology graph.
Specifically, a preset information type (i.e., a type to which the aforementioned useful information belongs) may be predetermined, and then the designated node is determined according to the preset information type in the topology map.
S102: and determining the subgraphs corresponding to the designated nodes in the topological graph, and the attribute of each node and the attribute of each edge in each subgraph.
After determining the designated node in the topological graph, determining the subgraph corresponding to the designated node in the topological graph, and realizing subgraph acquisition by calculating a programming mode through the graph with the vertex as the center, namely searching all subgraphs corresponding to the designated node by taking the designated node as a starting node.
After determining the subgraphs corresponding to the designated nodes in the topological graph, the attribute of each node and the attribute of each edge in each subgraph also need to be determined. Because the determined subgraphs may have subgraphs with similar topological structures and similar node attributes and side attributes, when the subgraphs are matched, the subgraphs matched with the subgraphs are determined in the topological graph to be matched according to the topological structure of each determined subgraph, the node attributes and the side attributes, so that the same or similar subgraphs are matched only once, and if the same or similar subgraphs are matched, the situation of repeated matching can occur.
Therefore, before sub-graph matching is carried out, the determined sub-graphs can be classified and screened according to the topological structure, the node attributes and the side attributes, and the situation of repeated matching during sub-graph matching is avoided as much as possible.
S104: and inputting the attribute of each node and the attribute of each side in each sub-graph into a pre-trained graph neural network model aiming at each sub-graph, and obtaining the characteristics of the sub-graph output by the graph neural network model.
The determined subgraphs are classified, the characteristics of each subgraph can be determined according to the attribute of each node and the attribute of each side in each subgraph through a pre-trained graph neural network model, and then classification is carried out. The pre-trained graph neural network model may be a graph isomorphic network (Graph Isomorphism Network, GIN) model, or may be other graph neural network models capable of determining the topology of the subgraph, the attributes of each node, and the characteristics of the attributes of each edge.
S106: and determining the type of the sub-graph according to the characteristics of the sub-graph.
After the characteristics of each sub-graph are determined, the type of each sub-graph is determined according to the characteristics of each sub-graph. Specifically, the type to which the sub-graphs having the common characteristics belong may be determined as one type, and the type to which the sub-graphs having the similar characteristics belong may be determined as one type.
S108: for each type, a representative subgraph is determined among the subgraphs of that type and stored.
Because the characteristics of the sub-images of each type are the same or similar, in each sub-image of each type, the sub-images which can represent the type are determined and stored, and the determined representative sub-images are used for matching the subsequent sub-images, so that the situation of repeated matching can be avoided.
S110: when receiving a sub-graph matching request, determining a topological graph to be matched according to the sub-graph matching request.
The sub-graph matching request may include names or other information of other topological graphs, and the other topological graphs may be determined as topological graphs to be matched according to the sub-graph matching request.
S112: and determining the sub-graph matched with the representative sub-graph in the topological graph to be matched according to the stored representative sub-graphs.
And determining the sub-graph similar to or the same as the representative sub-graph in the topological graph to be matched according to the stored representative sub-graphs, namely the sub-graph matched with the representative sub-graph.
The two sub-graphs are similar or identical, namely the topological structures of the two sub-graphs are similar or identical, and the attributes of the nodes and the attributes of the edges between the nodes are also similar or identical in the two sub-graphs.
The method can be seen from the above method, firstly, the designated node is determined in the topological graph, then the sub-graph corresponding to the designated node and the characteristics of each sub-graph are determined, the type of each sub-graph is determined according to the characteristics of each sub-graph, then the representative sub-graph is determined in each type of sub-graph, and finally the sub-graph matched with the representative sub-graph is determined in other topological graphs. The method combines the sub-graph mining and sub-graph matching, meanwhile, the method classifies the sub-graph of the designated node, then determines the representative sub-graph of each class, and then performs sub-graph matching according to the representative sub-graph, thereby improving the sub-graph matching efficiency.
Further, in order to make the method better, as described in step S100, the designated node is determined in the topology map, the attribute of each node in the topology map may be obtained first, and then the attribute of the designated dimension, that is, the attribute related to the useful information to be obtained, is determined in each attribute. And judging whether an attribute value corresponding to the attribute of the designated dimension of each node in the topological graph falls into a preset attribute value range or not, and if so, determining the node as the designated node.
For example, in the user relationship diagram, firstly, the attribute of each node in the user relationship diagram is obtained, the attribute of each node may include a user name, an age, a gender, etc., when the transaction information of the female user with the age between 18 and 25 years is required to be obtained, the attribute of the specified dimension, namely the age and the gender, is determined for each user node in the user relationship diagram, whether the attribute value corresponding to the age of the node falls into the range between 18 and 25 years, and whether the attribute value corresponding to the gender of the node is female is determined if yes, and the node is the specified node.
The number of the designated nodes may be multiple, and for each designated node, a sub-graph corresponding to the designated node in the topology graph is determined.
Specifically, determining a sub-graph corresponding to a designated node in the topological graph, wherein the designated node can be used as an active node, determining an edge of the active node and an adjacent node of the active node aiming at each active node, and taking the adjacent node of the active node as a node to be expanded. And then determining a topological graph formed by the node to be expanded, the active node and the edges between the node to be expanded and the active node as a sub-graph corresponding to the node to be expanded according to each node to be expanded, and taking the active node as the last node to be expanded of the node to be expanded. And re-determining nodes except the last node to be expanded in the adjacent nodes of the node to be expanded as nodes to be expanded, continuing to use a topological graph formed by the sub-graph of the last node to be expanded and the re-determined nodes to be expanded as sub-graphs corresponding to the re-determined nodes to be expanded aiming at each re-determined node to be expanded until the repetition number reaches the preset number or the number of edges of the sub-graphs is larger than a preset threshold, and taking all the sub-graphs corresponding to the determined nodes to be expanded as the sub-graphs corresponding to the designated node.
The preset times are the times of repeatedly determining the node to be expanded, the preset times are mainly set to give consideration to time and space efficiency, the number of edges of the control subgraph is not larger than a preset threshold value, the control subgraph is used for controlling the topological structure of the subgraph, if one subgraph is too large, information contained in the subgraph may be too much, and then subgraph matching may fail frequently, so that the number of edges of the control subgraph is not larger than the preset threshold value.
The specific method for determining the subgraph corresponding to the designated node according to the designated node is not limited in this specification.
After determining the subgraph corresponding to the designated node, the attribute of each node and the attribute of each side in the subgraph are input into the pre-trained graph neural network model as described in step S104, so as to obtain the characteristics of the subgraph output by the graph neural network model. Specifically, the graph neural network model outputs a vector which may be of a preset dimension, such as a one-dimensional vector, a two-dimensional vector and the like, and these vectors are collectively referred to as feature values, and the types of the sub-graphs with the same feature values can be determined to be the same type, and the types of the sub-graphs with different feature values can be determined to be different types.
The reason why the number of sub-graphs in the individual type is small may be that errors occur in determining sub-graphs, in order to exclude accidental situations, it may be determined whether each type may be used for subsequent sub-graph matching before determining and storing the representative sub-graphs, i.e. whether each type may be a specified type, specifically, for each type, whether the number of sub-graphs in the type may be greater than a preset threshold, if so, determining that the type is a specified type, and then determining the representative sub-graphs in the sub-graphs of the specified type.
For each specified type, when determining the representative sub-graph in the specified type, since the feature values of sub-graphs belonging to the same type are the same, it is sufficient to randomly determine one sub-graph as the representative sub-graph in each sub-graph of the specified type.
Clustering algorithms such as k-means and bi-kmmeans can be used to cluster each sub-graph according to the characteristic value of the sub-graph corresponding to the designated node, and then the sub-graph at the clustering center of each class or the sub-graph closest to the clustering center is used as the representative sub-graph of the class (cluster) sub-graph.
Optionally, the topology graph at least includes a user relationship graph, and the nodes in the user relationship graph include user nodes and merchant nodes, and the determined designated nodes may be merchant nodes. The attribute of the edge between the user node and the merchant node includes complaint information, so the specific node determined above may be specifically a complaint merchant node.
And S100-S108, determining complaint merchant nodes in the user relation graph, determining sub-graphs corresponding to the complaint merchant nodes in the user relation graph and attributes and edges of all user (or merchant) nodes in the sub-graphs corresponding to each complaint merchant node, inputting the attributes and edges of all user (or merchant) nodes in the sub-graphs into a pre-trained graph neural network model for each sub-graph, obtaining characteristics of the sub-graph output by the graph neural network model, determining the type of the sub-graph according to the characteristics of the sub-graph, determining a representative sub-graph in each sub-graph of the type according to each type, and storing.
The determined merchant nodes of the user relationship graph, which are complained, may be merchant nodes with some risk behaviors, for example, transaction information represented by merchant nodes, which are frequently complained, may include frequent non-delivery of goods, non-compliance of goods with descriptions, refusal of refund after receiving return, and the like, so when receiving a sub-graph matching request, determining that the topology graph to be matched is other user relationship graph according to the sub-graph matching request, for each representative sub-graph, after determining sub-graphs matched with the representative sub-graph in other user relationship graph, merchants represented by sub-graphs obtained by matching may also have risk behaviors, and the merchant nodes contained in the sub-graphs matched with the representative sub-graph are determined as risk nodes.
Further, measures such as early warning or monitoring can be timely made according to the determined risk nodes to reduce risks.
The present specification also provides a computer readable storage medium storing a computer program operable to perform the method of sub-graph matching provided in fig. 1 above.
The above sub-graph matching method provided for one or more embodiments of the present disclosure further provides a corresponding sub-graph matching device based on the same concept, as shown in fig. 3.
Fig. 3 is a schematic diagram of a device for matching sub-graphs provided in the present specification, which specifically includes:
a first determining module 301, configured to determine a designated node in the topology map;
a second determining module 302, configured to determine a sub-graph corresponding to the specified node in the topology map, and an attribute of each node and an attribute of each edge in each sub-graph;
the calculation module 303 is configured to input, for each sub-graph, an attribute of each node and an attribute of each edge in the sub-graph into a pre-trained graph neural network model, and obtain a feature of the sub-graph output by the graph neural network model;
a classification module 304, configured to determine, according to the characteristics of the subgraph, a type to which the subgraph belongs;
a storage module 305, configured to determine, for each type, a representative sub-graph among the sub-graphs of the type, and store the representative sub-graph;
a receiving module 306, configured to determine a topology map to be matched according to a sub-graph matching request when the sub-graph matching request is received;
the matching module 307 determines, for each stored representative sub-graph, a sub-graph that matches the representative sub-graph in the topology graph to be matched.
Optionally, the first determining module 301 is specifically configured to obtain an attribute of each node in the topology map; determining the attribute of the appointed dimension in the attributes; judging whether an attribute value corresponding to the attribute of the designated dimension of each node in the topological graph falls into a preset attribute value range or not; if yes, determining the node as the appointed node.
Optionally, the second determining module 302 is specifically configured to use a designated node as an active node, determine, for each active node, an edge of the active node and an adjacent node of the active node, and use the adjacent node of the active node as a node to be expanded; for each node to be expanded, determining a topological graph formed by the node to be expanded, the active node and edges between the node to be expanded and the active node as a sub-graph corresponding to the node to be expanded, and taking the active node as the last node to be expanded of the node to be expanded; and re-determining nodes except the last node to be expanded in the adjacent nodes of the node to be expanded as nodes to be expanded, continuing to use a topological graph formed by the sub-graph of the last node to be expanded and the re-determined nodes to be expanded as sub-graphs corresponding to the re-determined nodes to be expanded aiming at each re-determined node to be expanded until the repetition times reach the preset times or the number of edges of the sub-graphs is larger than a preset threshold value, and taking all the sub-graphs corresponding to the determined nodes to be expanded as the sub-graphs corresponding to the appointed nodes.
Optionally, the calculating module 303 is specifically configured to obtain a feature value of the sub-graph output by the graph neural network model;
The classifying module 304 is specifically configured to determine the types to which the subgraphs with the same feature value belong as the same type.
Optionally, the storage module 305 is specifically configured to determine, according to the number of subgraphs in the type, whether the number of subgraphs in the type is greater than a preset threshold; if yes, a representative sub-graph is determined among the sub-graphs of the type.
Optionally, the topology graph at least includes a user relationship graph;
the nodes in the user relation graph comprise user nodes and merchant nodes;
the appointed node is a merchant node;
attributes of edges between the user node and the merchant node include complaint information.
Optionally, the topological graph to be matched is other user relation graph;
the apparatus further comprises:
result module 308 determines the merchant node contained in the sub-graph that matches the representative sub-graph as a risk node.
The present specification also provides a schematic structural diagram of the electronic device shown in fig. 4. At the hardware level, the unmanned device includes a processor, an internal bus, a network interface, memory, and non-volatile storage, as described in fig. 4, although other hardware required by the business is possible. The processor reads the corresponding computer program from the non-volatile memory into the memory and then runs to implement the sub-graph matching method described above with respect to fig. 1. Of course, other implementations, such as logic devices or combinations of hardware and software, are not excluded from the present description, that is, the execution subject of the following processing flows is not limited to each logic unit, but may be hardware or logic devices.
In the 90 s of the 20 th century, improvements to one technology could clearly be distinguished as improvements in hardware (e.g., improvements to circuit structures such as diodes, transistors, switches, etc.) or software (improvements to the process flow). However, with the development of technology, many improvements of the current method flows can be regarded as direct improvements of hardware circuit structures. Designers almost always obtain corresponding hardware circuit structures by programming improved method flows into hardware circuits. Therefore, an improvement of a method flow cannot be said to be realized by a hardware entity module. For example, a programmable logic device (Programmable Logic Device, PLD) (e.g., field programmable gate array (Field Programmable Gate Array, FPGA)) is an integrated circuit whose logic function is determined by the programming of the device by a user. A designer programs to "integrate" a digital system onto a PLD without requiring the chip manufacturer to design and fabricate application-specific integrated circuit chips. Moreover, nowadays, instead of manually manufacturing integrated circuit chips, such programming is mostly implemented by using "logic compiler" software, which is similar to the software compiler used in program development and writing, and the original code before the compiling is also written in a specific programming language, which is called hardware description language (Hardware Description Language, HDL), but not just one of the hdds, but a plurality of kinds, such as ABEL (Advanced Boolean Expression Language), AHDL (Altera Hardware Description Language), confluence, CUPL (Cornell University Programming Language), HDCal, JHDL (Java Hardware Description Language), lava, lola, myHDL, PALASM, RHDL (Ruby Hardware Description Language), etc., VHDL (Very-High-Speed Integrated Circuit Hardware Description Language) and Verilog are currently most commonly used. It will also be apparent to those skilled in the art that a hardware circuit implementing the logic method flow can be readily obtained by merely slightly programming the method flow into an integrated circuit using several of the hardware description languages described above.
The controller may be implemented in any suitable manner, for example, the controller may take the form of, for example, a microprocessor or processor and a computer readable medium storing computer readable program code (e.g., software or firmware) executable by the (micro) processor, logic gates, switches, application specific integrated circuits (Application Specific Integrated Circuit, ASIC), programmable logic controllers, and embedded microcontrollers, examples of which include, but are not limited to, the following microcontrollers: ARC 625D, atmel AT91SAM, microchip PIC18F26K20, and Silicone Labs C8051F320, the memory controller may also be implemented as part of the control logic of the memory. Those skilled in the art will also appreciate that, in addition to implementing the controller in a pure computer readable program code, it is well possible to implement the same functionality by logically programming the method steps such that the controller is in the form of logic gates, switches, application specific integrated circuits, programmable logic controllers, embedded microcontrollers, etc. Such a controller may thus be regarded as a kind of hardware component, and means for performing various functions included therein may also be regarded as structures within the hardware component. Or even means for achieving the various functions may be regarded as either software modules implementing the methods or structures within hardware components.
The system, apparatus, module or unit set forth in the above embodiments may be implemented in particular by a computer chip or entity, or by a product having a certain function. One typical implementation is a computer. In particular, the computer may be, for example, a personal computer, a laptop computer, a cellular telephone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
For convenience of description, the above devices are described as being functionally divided into various units, respectively. Of course, the functions of each element may be implemented in one or more software and/or hardware elements when implemented in the present specification.
It will be appreciated by those skilled in the art that embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
In one typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include volatile memory in a computer-readable medium, random Access Memory (RAM) and/or nonvolatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of computer-readable media.
Computer readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of storage media for a computer include, but are not limited to, phase change memory (PRAM), static Random Access Memory (SRAM), dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), read Only Memory (ROM), electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium, which can be used to store information that can be accessed by a computing device. Computer-readable media, as defined herein, does not include transitory computer-readable media (transmission media), such as modulated data signals and carrier waves.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article or apparatus that comprises the element.
It will be appreciated by those skilled in the art that embodiments of the present description may be provided as a method, system, or computer program product. Accordingly, the present specification may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present description can take the form of a computer program product on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) having computer-usable program code embodied therein.
The description may be described in the general context of computer-executable instructions, such as program modules, being executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform particular tasks or implement particular abstract data types. The specification may also be practiced in distributed computing environments where tasks are performed by remote processing devices that are linked through a communications network. In a distributed computing environment, program modules may be located in both local and remote computer storage media including memory storage devices.
In this specification, each embodiment is described in a progressive manner, and identical and similar parts of each embodiment are all referred to each other, and each embodiment mainly describes differences from other embodiments. In particular, for system embodiments, since they are substantially similar to method embodiments, the description is relatively simple, as relevant to see a section of the description of method embodiments.
The foregoing is merely exemplary of the present disclosure and is not intended to limit the disclosure. Various modifications and alterations to this specification will become apparent to those skilled in the art. Any modifications, equivalent substitutions, improvements, or the like, which are within the spirit and principles of the present description, are intended to be included within the scope of the claims of the present application.

Claims (16)

1. A method of sub-graph matching, the method comprising:
determining a designated node in the topology map;
determining sub-graphs corresponding to the designated nodes in the topological graph, and the attribute of each node and the attribute of each edge in each sub-graph;
inputting the attribute of each node and the attribute of each side in each sub-graph into a pre-trained graph neural network model aiming at each sub-graph to obtain the characteristics of the sub-graph output by the graph neural network model;
Determining the type of the sub-graph according to the characteristics of the sub-graph;
for each type, determining a representative subgraph from the subgraphs of the type, and storing;
when receiving a sub-graph matching request, determining a topological graph to be matched according to the sub-graph matching request;
and determining the sub-graph matched with the representative sub-graph in the topological graph to be matched according to the stored representative sub-graphs.
2. The method according to claim 1, wherein determining the designated node in the topology map comprises:
acquiring the attribute of each node in the topological graph;
determining the attribute of the appointed dimension in the attributes;
judging whether an attribute value corresponding to the attribute of the designated dimension of each node in the topological graph falls into a preset attribute value range or not;
if yes, determining the node as the appointed node.
3. The method of claim 1, determining a sub-graph corresponding to the designated node in the topology map, specifically comprising:
taking the designated node as an activated node, determining the edge of the activated node and the adjacent node of the activated node aiming at each activated node, and taking the adjacent node of the activated node as a node to be expanded;
for each node to be expanded, determining a topological graph formed by the node to be expanded, the active node and edges between the node to be expanded and the active node as a sub-graph corresponding to the node to be expanded, and taking the active node as the last node to be expanded of the node to be expanded;
And re-determining nodes except the last node to be expanded in the adjacent nodes of the node to be expanded as nodes to be expanded, continuing to use a topological graph formed by the sub-graph of the last node to be expanded and the re-determined nodes to be expanded as sub-graphs corresponding to the re-determined nodes to be expanded aiming at each re-determined node to be expanded until the repetition times reach the preset times or the number of edges of the sub-graphs is larger than a preset threshold value, and taking all the sub-graphs corresponding to the determined nodes to be expanded as the sub-graphs corresponding to the appointed nodes.
4. The method of claim 1, obtaining the characteristics of the sub-graph output by the graph neural network model, specifically comprising:
obtaining a characteristic value of the subgraph output by the graph neural network model;
according to the characteristics of the subgraph, determining the type of the subgraph comprises the following specific steps:
and determining the types of the subgraphs with the same characteristic value as the same type.
5. The method according to claim 1, wherein the determining of the representative subgraph among the subgraphs of the type comprises:
judging whether the number of the subgraphs in the type is larger than a preset threshold value according to the number of the subgraphs in the type;
if yes, a representative sub-graph is determined among the sub-graphs of the type.
6. The method of claim 1, the topology map comprising at least a user relationship map;
the nodes in the user relation graph comprise user nodes and merchant nodes;
the appointed node is a merchant node;
attributes of edges between the user node and the merchant node include complaint information.
7. The method of claim 6, wherein the topology map to be matched is another user relationship map;
after determining the sub-graph matched with the representative sub-graph in the topology graph to be matched, the method further comprises:
and determining the merchant node contained in the sub-graph matched with the representative sub-graph as a risk node.
8. An apparatus for sub-graph matching, the apparatus comprising:
the first determining module is used for determining a designated node in the topological graph;
the second determining module is used for determining the subgraphs corresponding to the designated nodes in the topological graph, and the attribute of each node and the attribute of each side in each subgraph;
the computing module is used for inputting the attribute of each node and the attribute of each side in each sub-graph into a pre-trained graph neural network model to obtain the characteristics of the sub-graph output by the graph neural network model;
the classifying module is used for determining the type of the subgraph according to the characteristics of the subgraph;
The storage module is used for determining a representative sub-graph in the sub-graphs of each type and storing the representative sub-graph;
the receiving module is used for determining a topological graph to be matched according to the sub-graph matching request when the sub-graph matching request is received;
and the matching module is used for determining the subgraphs matched with the representative subgraphs in the topological graph to be matched according to the stored representative subgraphs.
9. The apparatus of claim 8, wherein the first determining module is specifically configured to obtain an attribute of each node in the topology map; determining the attribute of the appointed dimension in the attributes; judging whether an attribute value corresponding to the attribute of the designated dimension of each node in the topological graph falls into a preset attribute value range or not; if yes, determining the node as the appointed node.
10. The apparatus of claim 8, wherein the second determining module is specifically configured to use a designated node as an active node, determine, for each active node, an edge of the active node and a neighboring node of the active node, and use the neighboring node of the active node as a node to be expanded; for each node to be expanded, determining a topological graph formed by the node to be expanded, the active node and edges between the node to be expanded and the active node as a sub-graph corresponding to the node to be expanded, and taking the active node as the last node to be expanded of the node to be expanded; and re-determining nodes except the last node to be expanded in the adjacent nodes of the node to be expanded as nodes to be expanded, continuing to use a topological graph formed by the sub-graph of the last node to be expanded and the re-determined nodes to be expanded as sub-graphs corresponding to the re-determined nodes to be expanded aiming at each re-determined node to be expanded until the repetition times reach the preset times or the number of edges of the sub-graphs is larger than a preset threshold value, and taking all the sub-graphs corresponding to the determined nodes to be expanded as the sub-graphs corresponding to the appointed nodes.
11. The apparatus of claim 8, wherein the computing module is specifically configured to obtain a feature value of the subgraph output by the graph neural network model;
the classification module is specifically configured to determine the types to which the subgraphs with the same feature value belong as the same type.
12. The device of claim 8, wherein the storage module is specifically configured to determine, according to the number of sub-graphs in the type, whether the number of sub-graphs in the type is greater than a preset threshold; if yes, a representative sub-graph is determined among the sub-graphs of the type.
13. The apparatus of claim 8, the topology map comprising at least a user relationship map;
the nodes in the user relation graph comprise user nodes and merchant nodes;
the appointed node is a merchant node;
attributes of edges between the user node and the merchant node include complaint information.
14. The apparatus of claim 13, wherein the topology map to be matched is another user relationship map;
the apparatus further comprises:
and the result module is used for determining the merchant node contained in the sub-graph matched with the representative sub-graph as a risk node.
15. A computer readable storage medium storing a computer program which, when executed by a processor, implements the method of any of the preceding claims 1-7.
16. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the method of any of the preceding claims 1-7 when the program is executed.
CN202310149830.XA 2023-02-14 2023-02-14 Sub-graph matching method and device, storage medium and electronic equipment Pending CN116151620A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310149830.XA CN116151620A (en) 2023-02-14 2023-02-14 Sub-graph matching method and device, storage medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310149830.XA CN116151620A (en) 2023-02-14 2023-02-14 Sub-graph matching method and device, storage medium and electronic equipment

Publications (1)

Publication Number Publication Date
CN116151620A true CN116151620A (en) 2023-05-23

Family

ID=86361583

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310149830.XA Pending CN116151620A (en) 2023-02-14 2023-02-14 Sub-graph matching method and device, storage medium and electronic equipment

Country Status (1)

Country Link
CN (1) CN116151620A (en)

Similar Documents

Publication Publication Date Title
CN107679686B (en) Service execution method and device
TW201933232A (en) Shop information recommendation method, device and client
CN110020427B (en) Policy determination method and device
CN107622080B (en) Data processing method and equipment
CN111522968B (en) Knowledge graph fusion method and device
CN115828162B (en) Classification model training method and device, storage medium and electronic equipment
CN110516915B (en) Service node training and evaluating method and device and electronic equipment
CN116049761A (en) Data processing method, device and equipment
CN116757278B (en) Training method and device of prediction model, storage medium and electronic equipment
CN116402113B (en) Task execution method and device, storage medium and electronic equipment
CN112597255A (en) Method and device for determining abnormal data
CN115543945B (en) Model compression method and device, storage medium and electronic equipment
CN116501927A (en) Graph data processing system, method, equipment and storage medium
CN115545943A (en) Map processing method, device and equipment
CN116151620A (en) Sub-graph matching method and device, storage medium and electronic equipment
CN111191090B (en) Method, device, equipment and storage medium for determining service data presentation graph type
CN111598092A (en) Method for determining target area in image, method and device for identifying target
CN111461352B (en) Model training method, service node identification device and electronic equipment
CN117171401B (en) Query method and device for shortest path in graph data based on hierarchical pre-calculation
CN115017915B (en) Model training and task execution method and device
CN115545938B (en) Method, device, storage medium and equipment for executing risk identification service
CN117591703A (en) Graph data optimization method and device, storage medium and electronic equipment
CN117312870A (en) Business wind control method and device, storage medium and electronic equipment
CN117743863A (en) Abnormality graph mining method and device, storage medium and electronic equipment
CN117909926A (en) Risk identification method and device, storage medium and electronic equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination