Frequent subgraph-based classification method and device, storage medium and electronic equipment
By constructing a target structure graph based on frequent subgraphs and using partial order relations for financial transaction classification, the problem of low efficiency in existing technologies is solved, and more efficient transaction classification is achieved.
Patent Information
- Application Number
- CN202311257810.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-26
- Publication Date
- 2025-12-09
- Estimated Expiration
- 2043-09-26
AI Technical Summary
Existing technologies are inefficient in financial transaction classification, especially when dealing with large amounts of data. Neural network models have insufficient data processing efficiency and classification accuracy, and the large number of enumerated subgraphs leads to low classification efficiency.
By obtaining the structure graph to be classified, determining the similarity of frequent subgraphs, constructing the target structure graph, and using the partial order relationship of frequent subgraphs for classification, we avoid enumerating all subgraphs and improve efficiency by using tree search algorithm and Hasse graph construction method.
It improves the classification efficiency of financial transaction-related structure diagrams, solves the problem of low classification efficiency of transaction relationship diagrams, and achieves more efficient financial transaction classification.
Smart Images

Figure CN117274703B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of financial technology or other related technical fields, in particular, to a frequent subgraph-based classification method and device, a storage medium and an electronic device. BACKGROUND
[0002] In related technologies, in the process of classifying financial transactions, the following methods are usually used for classification:
[0003] (1) First, the neural network model is trained, and then the data in the transaction relationship graph of the financial transaction is input into the trained neural network model for classification. The classification accuracy of some financial transactions is low due to the influence of the training samples and the training effect of the neural network model. In the case of high transaction data volume, the classification efficiency of classifying financial transactions is low due to the influence of the data processing efficiency of the neural network model.
[0004] (2) Obtain the transaction relationship graph of the financial transaction, and then enumerate all subgraphs to classify the financial transaction according to the subgraphs. Due to the large number of subgraphs, the classification efficiency of the financial transaction is low.
[0005] In view of the above problems, no effective solution has been proposed so far. SUMMARY
[0006] The embodiments of the present application provide a frequent subgraph-based classification method and device, a storage medium and an electronic device to at least solve the technical problem of low classification efficiency of graphs in related technologies.
[0007] According to an aspect of an embodiment of the present application, a frequent subgraph-based classification method is provided, comprising: obtaining a structure graph to be classified, wherein the structure graph to be classified comprises: N nodes representing associated objects of a financial transaction, edges representing relationships between the N nodes, and N is a positive integer; determining the similarity between the structure graph to be classified and each frequent subgraph in a target structure graph based on the N nodes and the relationships between the nodes, obtaining M similarities, wherein the target structure graph is connected by M frequent subgraphs based on a partial order relationship, the frequent subgraph comprises: a frequent subgraph of a historical structure graph, the historical structure graph comprises: a structure graph composed of associated objects of historical financial transactions and relationships between the associated objects of the historical financial transactions, the partial order relationship comprises: a subgraph isomorphism relationship between any two frequent subgraphs, and M is a positive integer; determining the classification result of the structure graph to be classified based on the frequent subgraph associated with the maximum similarity in the M similarities, wherein the classification result at least comprises: a transaction type of the financial transaction.
[0008] Further, the historical structure graph comprises nodes representing associated objects of historical financial transactions and edges representing relationships between the associated objects of the historical financial transactions, and the target structure graph is obtained by: obtaining the historical structure graph; generating S candidate sub-graphs based on frequent edges in the historical structure graph, wherein the frequent edges comprise edges representing the same relationship in the historical structure graph and having a number of occurrences greater than a preset number threshold, and S is a positive integer greater than M; determining M frequent sub-graphs based on sub-graph isomorphism relationships existing in the S candidate sub-graphs; and constructing the target structure graph based on partial order relationships in the M frequent sub-graphs.
[0009] Further, the target structure graph is constructed based on the partial order relationships in the M frequent sub-graphs, comprising: determining a partial order set based on sub-graph isomorphism relationships in the M frequent sub-graphs, wherein the partial order set records the partial order relationships in the M frequent sub-graphs; and constructing a Hasse diagram of the M frequent sub-graphs based on the partial order set, and taking the obtained Hasse diagram as the target structure graph.
[0010] Further, the M frequent sub-graphs are determined based on the sub-graph isomorphism relationships existing in the S candidate sub-graphs, comprising: calculating a support degree of each candidate sub-graph, wherein the support degree of the candidate sub-graph represents a number of candidate sub-graphs having a sub-graph isomorphism relationship with the candidate sub-graph among the S candidate sub-graphs; and taking candidate sub-graphs having a support degree greater than a preset support degree threshold among the S candidate sub-graphs as the frequent sub-graphs to obtain the M frequent sub-graphs.
[0011] Further, the support degree of each candidate sub-graph is calculated, comprising: determining whether there is a sub-graph isomorphism relationship between any two candidate sub-graphs based on a tree search algorithm; and determining the support degree of each candidate sub-graph based on a number of candidate sub-graphs having a sub-graph isomorphism relationship with the candidate sub-graph among the S candidate sub-graphs.
[0012] Further, the similarity between each of the frequent subgraphs in the target structure graph and the structure graph to be classified is determined based on the N nodes and the relationship between the nodes, to obtain M similarities, including: determining the same structure part between each of the frequent subgraphs and the structure graph to be classified based on the N nodes and the relationship between the nodes, wherein the same structure part includes: a part subgraph with the same connection structure between the nodes in the frequent subgraph and the nodes in the structure graph to be classified; and calculating the similarity between each of the structure graphs to be classified and each of the frequent subgraphs based on the target data of the same structure part between each of the frequent subgraphs and the structure graph to be classified, to obtain M similarities, wherein the target data includes at least one of the following: the number of nodes of the same structure part, the number of edges of the same structure part, the number of nodes representing the same object in the same structure part, and the number of edges representing the same relationship in the same structure part.
[0013] Further, the classification result of the structure graph to be classified is determined based on the frequent subgraph associated with the maximum similarity in the M similarities, including: in the case that the frequent subgraph associated with the maximum similarity in the M similarities is T, searching for the upper node of the frequent subgraph associated with the maximum similarity in the target structure graph, wherein T is a positive integer greater than or equal to 2; and determining the classification result based on the transaction type of the financial transaction associated with the upper node.
[0014] According to another aspect of the embodiments of the present application, a classification device based on frequent subgraphs is also provided, including: a first acquisition unit configured to acquire a structure graph to be classified, wherein the structure graph to be classified includes: N nodes representing the associated objects of a financial transaction, and edges representing the relationship between the N nodes, and N is a positive integer; a first determination unit configured to determine the similarity between each of the frequent subgraphs in a target structure graph and the structure graph to be classified based on the N nodes and the relationship between the nodes, to obtain M similarities, wherein the target structure graph is connected based on a partial order relationship by M frequent subgraphs, the frequent subgraph includes: a frequent subgraph of a historical structure graph, the historical structure graph includes: a structure graph composed of the associated objects of historical financial transactions and the relationship between the associated objects of the historical financial transactions, the partial order relationship includes: a subgraph isomorphism relationship between any two of the frequent subgraphs, and M is a positive integer; and a second determination unit configured to determine the classification result of the structure graph to be classified based on the frequent subgraph associated with the maximum similarity in the M similarities, wherein the classification result at least includes: the transaction type of the financial transaction.
[0015] Further, the historical structure graph comprises nodes representing associated objects of historical financial transactions and edges representing relationships between the associated objects of the historical financial transactions, and the target structure graph is obtained by: a second obtaining unit configured to obtain the historical structure graph; a generating unit configured to generate S candidate sub-graphs based on frequent edges in the historical structure graph, wherein the frequent edges comprise edges whose occurrence times in the historical structure graph representing the same relationship are greater than a preset number threshold, and S is a positive integer greater than M; a third determining unit configured to determine M frequent sub-graphs based on sub-graph isomorphism relationships existing in the S candidate sub-graphs; and a constructing unit configured to construct the target structure graph based on partial order relationships in the M frequent sub-graphs.
[0016] Further, the constructing unit comprises: a first determining sub-unit configured to determine a partial order set based on sub-graph isomorphism relationships in the M frequent sub-graphs, wherein the partial order set records the partial order relationships in the M frequent sub-graphs; and a constructing sub-unit configured to construct a Hasse graph of the M frequent sub-graphs based on the partial order set, and take the obtained Hasse graph as the target structure graph.
[0017] Further, the third determining unit comprises: a first calculating sub-unit configured to calculate a support degree of each candidate sub-graph, wherein the support degree of the candidate sub-graph represents a number of candidate sub-graphs having sub-graph isomorphism relationships with the candidate sub-graph in the S candidate sub-graphs; and a processing sub-unit configured to take candidate sub-graphs whose support degrees are greater than a preset support degree threshold in the S candidate sub-graphs as the frequent sub-graphs, and obtain the M frequent sub-graphs.
[0018] Further, the calculating unit comprises: a first determining module configured to determine whether there is a sub-graph isomorphism relationship between any two candidate sub-graphs based on a tree search algorithm; and a second determining module configured to determine a support degree of each candidate sub-graph based on a number of candidate sub-graphs having sub-graph isomorphism relationships with the candidate sub-graph in the S candidate sub-graphs.
[0019] Further, the first determining unit comprises: a second determining sub-unit, configured to determine, based on the N nodes and the relationship between the nodes, a same structure part existing in each of the frequent sub-graphs and the structure diagram to be classified, wherein the same structure part comprises a part sub-graph in which the connection structure between the nodes in the frequent sub-graph and the nodes in the structure diagram to be classified is the same; and a second calculating sub-unit, configured to calculate, based on target data of the same structure part existing in each of the frequent sub-graphs and the structure diagram to be classified, a similarity between each of the structure diagrams to be classified and each of the frequent sub-graphs, to obtain M similarities, wherein the target data comprises at least one of the following: the number of nodes of the same structure part, the number of edges of the same structure part, the number of nodes of the same structure part representing the same object, and the number of edges of the same structure part representing the same relationship.
[0020] Further, the second determining unit comprises: a searching sub-unit, configured to search, in the target structure diagram, an upper node of the frequent sub-graph associated with the maximum similarity in the M similarities, in a case where the frequent sub-graph associated with the maximum similarity is T, wherein T is a positive integer greater than or equal to 2; and a third determining sub-unit, configured to determine the classification result based on a transaction type of a financial transaction associated with the upper node.
[0021] According to another aspect of the embodiments of the present application, an electronic device is also provided, comprising: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to execute the above-mentioned any one of the frequent sub-graph-based classification method via execution of the executable instructions.
[0022] According to another aspect of the embodiments of the present application, a computer readable storage medium is also provided, which stores a computer program, wherein the computer program, when executed, controls a device in which the computer readable storage medium is located to execute the above-mentioned any one of the frequent sub-graph-based classification method.
[0023] In this invention, a structure graph to be classified is obtained, comprising: N nodes representing the associated objects of financial transactions, and edges representing the relationships between the N nodes, where N is a positive integer; based on the N nodes and the relationships between them, the similarity between the structure graph to be classified and each frequent subgraph in the target structure graph is determined, resulting in M similarity scores. The target structure graph is composed of M frequent subgraphs connected by a partial order relation. The frequent subgraphs include frequent subgraphs of the historical structure graph, which consists of a structure graph composed of associated objects of historical financial transactions and the relationships between these objects. The partial order relation includes isomorphic relationships between any two frequent subgraphs, where M is a positive integer; based on the frequent subgraph with the highest similarity among the M similarity scores, the classification result of the structure graph to be classified is determined, where the classification result includes at least the transaction type of the financial transaction. This solves the technical problem of low efficiency in classifying transaction relationship graphs in related technologies. In this invention, a target structure graph is constructed based on the frequent subgraphs of historical financial transactions and the partial order relationships between the frequent subgraphs. Then, the structure graph to be classified is classified based on the target structure graph. This avoids the situation in related technologies where all subgraphs of all financial transaction relationship graphs are enumerated, which leads to low efficiency in classifying financial transactions. Thus, the technical effect of improving the graph classification efficiency of structure graphs related to financial transactions is achieved. Attached Figure Description
[0024] The accompanying drawings, which are included to provide a further understanding of the invention and form part of this application, illustrate exemplary embodiments of the invention and, together with their description, serve to explain the invention and do not constitute an undue limitation thereof. In the drawings:
[0025] Figure 1 This is a flowchart of an optional classification method based on frequent subgraphs according to an embodiment of the present invention;
[0026] Figure 2 This is a schematic diagram of an optional Hasse diagram based on inclusion relationships according to an embodiment of the present invention;
[0027] Figure 3 This is a schematic diagram of an optional classification device based on frequent subgraphs according to an embodiment of the present invention;
[0028] Figure 4 This is a schematic diagram of an electronic device according to an embodiment of the present invention. Detailed Implementation
[0029] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.
[0030] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0031] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties. Furthermore, the collection, use and processing of the relevant data must comply with the relevant laws, regulations and standards of the relevant regions, and corresponding operation portals are provided for users to choose to authorize or refuse.
[0032] For ease of description, some terms or nouns involved in the various embodiments of the present invention will be explained below.
[0033] Subgraph: If graph G ′ =(V ′ E ′ ,L ′ ) is a subgraph of graph G = (V, E, L), denoted as Three conditions must be met: (1) That is, Figure G ′ All nodes in the graph appear in the node set of graph G. (2) That is, the edge set of graph G must contain graph G. ′ Each edge in the array. (3) For each node v∈V ′ Or edge e∈E ′ They all have L ′ (v) = L(v), or L ′(e) = L(e).
[0034] Subgraph isomorphism: Suppose there are two graphs G ′ = (V ′ , E ′ , L ′ ) and G = (V, E, L). G ′ is called subgraph isomorphic to G if and only if there is a mapping f: V ′ → V, such that: (1) for all points v ∈ V ′ , L ′ (v) = L(f(v)), that is, all nodes in the small graph G ′ can be found in the large graph G and the labels are consistent. (2) for all edges (u, v) ∈ E ′ , (f(u), f(v)) ∈ E and L ′ (u, v) = L(f(u), f(v)), that is, the large graph G contains all edges in the small graph G ′ , there may be edges other than G ′ , and the corresponding labels are consistent. If a small graph can be found in another large graph which is completely the same in structure and the corresponding node and edge labels are completely consistent, then the two graphs are called subgraph isomorphic.
[0035] Embodiment one
[0036] According to the embodiment of the application, an optional method for frequent subgraph-based classification is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described herein can be executed in an order different from that shown herein.
[0037] Figure 1 is a flowchart of an optional method for frequent subgraph-based classification according to an embodiment of the application, as shown in Figure 1 , the method comprises the following steps:
[0038] In step S101, a structure graph to be classified is obtained, wherein the structure graph to be classified comprises N nodes representing associated objects of financial transactions, edges representing relationships between the N nodes, and N is a positive integer.
[0039] The to-be-classified structure diagram can include a structure diagram composed of N nodes representing associated objects of a financial transaction, and the structure diagram can include N nodes, each of which can be used to represent one of the associated objects of the financial transaction, and the associated objects of the financial transaction can include but are not limited to a transaction account, a transaction amount, a financial product involved, historical transaction information related to the transaction account, and the like. The label on the edge between two nodes can represent the relationship between the two objects.
[0040] In step S102, the similarity between the to-be-classified structure diagram and each frequent subgraph in the target structure diagram is determined based on the N nodes and the relationships between the nodes, and M similarities are obtained, wherein the target structure diagram is connected by M frequent subgraphs based on a partial order relationship, the frequent subgraph includes a frequent subgraph of a historical structure diagram, the historical structure diagram includes a structure diagram composed of associated objects of historical financial transactions and relationships between the associated objects of the historical financial transactions, the partial order relationship includes a subgraph isomorphism relationship between any two frequent subgraphs, and M is a positive integer.
[0041] The target structure diagram described above can be a structure diagram composed of relationships between associated objects of historical financial transactions, and the target structure diagram is connected by a plurality of frequent subgraphs, and the number of historical financial transactions involved in the target structure diagram can be multiple. In order to improve the classification efficiency of the financial transaction, the similarity between the to-be-classified structure diagram and each frequent subgraph in the target structure diagram is calculated to obtain M similarities, and the classification structure of the target structure diagram is determined according to the similarities, and the classification result of the financial transaction is determined.
[0042] In step S103, the classification result of the to-be-classified structure diagram is determined based on the frequent subgraph associated with the maximum similarity in the M similarities, and the classification result at least includes the transaction type of the financial transaction.
[0043] The classification result can include the transaction type of the financial transaction or the risk level of the financial transaction, and in this embodiment, the classification result of the to-be-classified structure diagram can be determined based on the transaction type of the financial transaction involved in the frequent subgraph associated with the maximum similarity.
[0044] Through the above steps, the target structure diagram is constructed based on the frequent subgraphs of the historical financial transactions and the partial order relationship between the frequent subgraphs, and then the to-be-classified structure diagram is classified based on the target structure diagram, which avoids the situation that all subgraphs of all financial transaction relationship graphs are enumerated in the related art, resulting in low classification efficiency of the financial transaction, thereby realizing the technical effect of improving the graph classification efficiency of the structure diagram related to the financial transaction. Further, the technical problem of low classification efficiency of the transaction relationship graph in the related art is solved.
[0045] Optionally, the historical structure graph comprises nodes representing associated objects of historical financial transactions, edges representing relationships between the associated objects of the historical financial transactions, and the target structure graph is obtained by: obtaining the historical structure graph; generating S candidate subgraphs based on frequent edges in the historical structure graph, wherein the frequent edges comprise edges representing the same relationship in the historical structure graph and having a number of occurrences greater than a preset number threshold, and S is a positive integer greater than M; determining M frequent subgraphs based on subgraph isomorphism relationships existing in the S candidate subgraphs; and constructing the target structure graph based on partial order relationships in the M frequent subgraphs.
[0046] The historical structure graph described above can be a structure graph constructed by taking objects associated with historical financial transactions as nodes and edges between two nodes determined based on relationships between objects associated with historical financial transactions.
[0047] In the embodiment, all candidate subgraphs can be generated by traversing a given graph dataset (corresponding to the historical structure graph), and then the support degree of each candidate subgraph is calculated to select frequent subgraphs. The support degree of each candidate subgraph can be calculated by subgraph isomorphism, for example, if two candidate subgraphs are subgraph isomorphic, the support degree of the candidate subgraph is increased by 1. The subgraph isomorphism problem can be regarded as an NP-hard problem (a problem that cannot be effectively solved in non-deterministic polynomial time). In order to reduce the cost, a state space representation method (SSR) can be used in the matching process of the candidate subgraph, and five feasibility rules can be introduced to prune the search tree.
[0048] The process of generating candidate subgraphs is described below. The candidate subgraphs can be generated by extending the edges one by one. For example, first, a single large graph (corresponding to the historical structure graph) can be traversed to generate all frequent edges (i.e., edges representing the same relationship and having a number of occurrences greater than a preset number threshold) having a number of occurrences not less than a preset threshold. Based on the anti-monotonicity, the frequent subgraphs can be constructed based on these edges. Then each frequent edge can be regarded as a frequent subgraph, and the frequent edge can be extended according to the neighbor nodes of the nodes in the frequent edge. It is worth noting that since the information amount of the nodes and edges is relatively rich, i.e., each node and each edge is attached with a vector and the vector values are different, a similarity function can be set to determine whether the nodes and edges are similar. The similarity function is as follows:
[0049]
[0050] When the value = 1, v i Each component in the attached vector is the same as v j Each component in the attached vector is the same as v i One component in the attached vector is different from v j The corresponding component in the attached vector is different.
[0051]
[0052] when value = 1, e i each component in the attached vector is the same as e j each component in the attached vector is the same as e i one component in the attached vector is different from e j the corresponding component in the attached vector is different.
[0053] If the current expanded subgraph has not been generated in the candidate subgraph set (i.e., the generated subsequent subgraph), it can be added to the candidate subgraph set to obtain S candidate subgraphs.
[0054] Frequent subgraph mining can be a constantly iterative subgraph isomorphism process, which can be generally divided into exact subgraph isomorphism and inexact subgraph isomorphism. In order not to increase the complexity of the frequent subgraph mining algorithm, the exact subgraph isomorphism can be selected in the embodiment.
[0055] After all candidate subgraphs are generated, it can also be determined whether a candidate subgraph is a frequent subgraph, that is, according to all isomorphic graph numbers accumulated in the subgraph isomorphism process of each candidate subgraph, the support degree is determined, the candidate subgraph with a support degree greater than a preset support threshold is taken as a frequent subgraph, and then M frequent subgraphs are constructed into a target structure graph according to the partial order relation in the frequent subgraph.
[0056] Optionally, the target structure graph is constructed based on the partial order relation in the M frequent subgraphs, including: determining a partial order set based on the subgraph isomorphism relation in the M frequent subgraphs, wherein the partial order set records the partial order relation in the M frequent subgraphs; and constructing a Hasse graph of the M frequent subgraphs based on the partial order set, and taking the obtained Hasse graph as the target structure graph.
[0057] In the embodiment, a classification model can be constructed based on the feature attributes and the topological structure of the frequent subgraph, so as to classify the graph pattern. Specifically, a binary relation R can be defined first, that is, all frequent subgraphs The partial order relation based on R can be formed, and a topological order can be performed according to the partial order relation to generate a topological structure T g Therefore, all frequent subgraphs can be connected based on the relation of R to obtain the target structure graph.
[0058] The partial order relation is defined differently according to different data set types. The set composed of numerical values can define the partial order relation as "≤" or other comparison operators. The partial order relation in the embodiment can be a partial order relation constructed based on a graph set, that is, in the embodiment, the binary relation can be defined as structural inclusion That is, according to the overall structure of the graph, if the graph Q topology structure has a subgraph isomorphism relationship in the graph G, there is a partial order relationship So that
[0059] In this embodiment, the graphs having a structural inclusion relationship (i.e., the copper isomorphism relationship) in the M frequent subgraphs can be determined by subgraph isomorphism. Then a Hasse diagram of the partial order relationship is drawn to obtain a topology structure T g The Hasse diagram can be a set-based partial order diagram used to clearly show the logical relationship of the partial order set, and the construction of the Hasse diagram can delete all self-loops and eliminate the edges generated by transitivity, starting from the bottom layer and drawing layer by layer upwards. The specific steps of the Hasse diagram drawing method are as follows:
[0060] Step 1: Put the elements not appearing in the value domain (<a, b>, a is the antecedent domain, and b is the value domain) in the first layer.
[0061] Step 2: Delete the relationship of the elements in the first layer. The second layer elements have two categories: one category is the elements appearing in the value domain of the first layer elements and not appearing in the remaining relationship; the other category is all elements in the antecedent domain of the elements not deleted in the relationship.
[0062] Step 3: Continue in this way until all elements have their own positions.
[0063] The following is an example: if the graph set G contains 6 graphs (corresponding to M frequent subgraphs), G = {g1, g2, g3, g4, g5, g6}, the partial order set Where is the inclusion relationship. Assuming that all partial order relationships are: <g1, g2>, <g1, g3>, <g1, g4>, <g1, g5>, <g1, g6>, <g2, g4>, <g2, g6>, <g3, g6>. First, put the elements not appearing in the value domain in the first layer, g1 meets the condition, so g1 can be put into the first layer. Delete all relationships <g1, g2>, <g1, g3>, <g1, g4>, <g1, g5>, <g1, g6> of the elements in the first layer, and the remaining relationships are <g2, g4>, <g2, g6>, <g3, g6>. The element g5 appears in the value domain {g2, g3, g4, g5, g6} of the first layer relationship and does not appear in the remaining relationship {g2, g3, g4, g6}. The elements in the antecedent domain of the elements not deleted in the relationship are {g2, g3}, so {g2, g3, g5} can be put into the second layer. Continue in this way until all elements (corresponding to frequent subgraphs) find their own positions. The Hasse diagram based on the inclusion relationship (corresponding to the target structure graph) is generated, and the positions of g1, g2, g3, g4, g5, g6 in the Hasse diagram are as follows Figure 2The figure shows (wherein, Figure 2 is a schematic diagram of an optional Hasse diagram based on the inclusion relationship according to an embodiment of the application.
[0064] Optionally, based on the subgraph isomorphism relationship existing in the S candidate subgraphs, the M frequent subgraphs are determined, including: calculating the support degree of each candidate subgraph, wherein the support degree of the candidate subgraph represents the number of candidate subgraphs in the S candidate subgraphs that have a subgraph isomorphism relationship with the candidate subgraph; and taking the candidate subgraph in the S candidate subgraphs whose support degree is greater than a preset support degree threshold as a frequent subgraph, to obtain the M frequent subgraphs.
[0065] After all candidate subgraphs are generated, it can be judged whether the occurrence number of the subgraph isomorphism relationship of the candidate subgraph is greater than a preset support degree threshold, to determine whether a candidate subgraph is a frequent subgraph, that is, all isomorphic graphs accumulated in the subgraph isomorphism process of each candidate graph can be taken as the corresponding support degree, to judge whether the support degree is greater than a preset support degree threshold, to determine whether each candidate subgraph is a frequent subgraph.
[0066] In order to avoid the drawbacks of the prior art, that is, all subgraphs need to be enumerated. In the embodiment, the entities and relationships are modeled by using the form of an undirected labeled graph, the problem is converted into the problem of finding frequently occurring subgraphs in a graph set, and in the embodiment, it can be determined based on a tree search algorithm whether two candidate subgraphs have a subgraph isomorphism relationship. Each node on the tree is a state, denoted as s, each s contains a mapping relationship of a series of nodes, which can be represented by a series of key-value pairs. The key can represent a node in a small graph Q (one of the candidate subgraphs), and the value can represent a node in a large graph G (another candidate subgraph).
[0067] Selection method of a candidate pair set (such as a pair of nodes matched (having the same node attribute) between a candidate subgraph and another candidate subgraph): the algorithm randomly selects a pair of matched nodes at the beginning, and then selects from the neighbor nodes of the matched nodes. The matching process can be matched by the following rules:
[0068] Feasibility rule: ①Based on the labels of nodes and edges. Determine by a similarity function. ②Based on the topological structure of the graph.
[0069] Consistency rule: judge whether the two subgraphs are isomorphic after a new matching pair is added. Let the newly added matching pair be (n, m), then for all neighbor nodes of n in the state s, there must be corresponding points in the neighbor nodes of m in the graph G. The reverse also needs to be true.
[0070] Pruning strategy: the number of neighbors of the neighbor node n in state s must not be greater than the number of neighbors of the neighbor node m in state s. Otherwise, it is indicated that for the new matching point n in the small graph, the number of neighbors is greater than the number of neighbor nodes of m in the large graph, and then the large graph and the small graph cannot form a consistent state during the subsequent matching process.
[0071] The support measure minimum image (MNI) with anti-monotonicity is used to effectively prune the search space, the state space representation of the matching process is used, and five feasibility rules are introduced to prune the search tree, only the minimum instance set satisfying the frequency threshold is mined, so that the efficiency of the frequent subgraph mining algorithm is greatly improved.
[0072] Optionally, the support of each candidate subgraph is calculated, including: determining whether there is a subgraph isomorphism relationship between any two candidate subgraphs based on a tree search algorithm; and determining the support of each candidate subgraph based on the number of subgraph isomorphism relationships existing in the S candidate subgraphs.
[0073] The tree search algorithm can be VF2 algorithm (a data mining algorithm for discovering association rules), and the search process can be: each node on the search tree is a state, denoted as s, each s contains a mapping relationship of a series of nodes, which can be represented by a series of key-value pairs, wherein the key can represent the node in the small graph Q (one of the candidate subgraphs), and the value can represent the node in the large graph G (another candidate subgraph other than the small graph Q). The search starts at the beginning (that is, the root node of the tree) s is empty, and as the search progresses (the height of the tree increases), the key-value pairs in s will gradually increase. If all node pairs in this state satisfy the subgraph isomorphism condition, this state is called a consistent state. In addition, by adding a set of rules (k-look-ahead Rules), the number of states generated during the process can be further reduced. If a consistent state contains all nodes in the small graph, it is determined that a substructure of the large graph is isomorphic to the small graph, that is, a subgraph isomorphism.
[0074] Suppose the number of nodes of a single large graph is N, and the number of nodes of a subgraph is n. Through analysis, it can be obtained that the time complexity of the subgraph isomorphism problem of the GRAMI algorithm in the related art is O(N n ), and the time complexity of the VF2 algorithm used in the embodiment is O(n n ) in the worst case, which is lower than the GRAMI algorithm, and realizes the technical effect of improving the processing efficiency of the subgraph isomorphism relationship.
[0075] The number of subgraph isomorphism of each candidate subgraph in the remaining candidate subgraphs is determined based on a tree search algorithm, and then the number of subgraph isomorphism of each candidate subgraph in the S candidate subgraphs can be taken as the support degree of the candidate subgraph. By calculating the support degree of each candidate subgraph, the frequent subgraph is effectively screened out, and the technical effect of improving the efficiency of frequent subgraph mining is realized.
[0076] Optionally, based on the N nodes and the relationship between the nodes, the similarity of each frequent subgraph in the target structure graph and the structure graph to be classified is determined, and M similarities are obtained, including: based on the N nodes and the relationship between the nodes, determining that there is a same structure part in each frequent subgraph and in the structure graph to be classified, wherein the same structure part includes: a part subgraph with the same connection structure between the nodes in the frequent subgraph and the nodes in the structure graph to be classified; based on the target data of the same structure part in each frequent subgraph and in the structure graph to be classified, calculating the similarity of each structure graph to be classified and each frequent subgraph, and obtaining M similarities, wherein the target data includes at least one of the following: the number of nodes of the same structure part, the number of edges of the same structure part, the number of nodes representing the same object in the same structure part, and the number of edges representing the same relationship in the same structure part.
[0077] In the embodiment, a graph similarity calculation (GSC) method can be proposed based on the idea of the VF2 algorithm (an algorithm for graph isomorphism detection, used to determine whether two graphs are isomorphic) to solve the subgraph isomorphism problem. By adding the matching graph structure G(s) and the matching number of nodes and edges weight in the node state of each layer in the search tree, the similarity calculation between graphs is realized. In order to avoid the VF2 algorithm in the related art only considering the matching node set and being unable to generate the graph structure in the matching process, and being only used to determine whether two graphs are graph isomorphic or subgraph isomorphic, and being unable to find the repeated graph structure, in the embodiment, the matching graph structure is added to show the subgraph structure of each state, and thus the edge number num dup of the similarity judgment function is calculated. By determining whether the node and edge attribute values of the newly added matching graph are consistent in each state, the similarity of the matching graph is iteratively calculated.
[0078] In the embodiment, the unknown label graph (i.e. the structure graph to be classified) and the known label graph (i.e. the target structure graph) can be compared, and the classification purpose is achieved through the similarity judgment, for example, the similarity of a given graph structure Q and another graph FreSub in the topological structure is the similarity judgment, and the similarity (corresponding to the similarity) judgment method is illustrated as follows,
[0079] The similarity is defined as follows:
[0080] F s (Q,FreSub)=|E Q ∩E f |*weight
[0081] where weight represents the number of nodes and edges in the overlap structure of the given graph structure and the frequent subgraph (E Q ∩E f ) that corresponds to the same structure part in the given graph structure and the frequent subgraph. The similarity function F v and F e satisfies the similarity function F dup The similarity can be determined by two parts, one part is the number of nodes (the number of nodes corresponding to the same structure part) and the number of edges num Q (the number of edges corresponding to the same structure part), and the other part is the number of nodes (the number of nodes corresponding to the same structure part) and the number of edges (the number of edges corresponding to the same structure part) in the overlap structure whose attribute values are consistent, which is simply referred to as weight. The product of the two parts can represent the similarity of the two graphs (i.e., the given graph structure and the frequent subgraph).
[0082] Optionally, based on the frequent subgraph associated with the maximum similarity in the M similarities, the classification result of the structure graph to be classified is determined, including: in the case that the frequent subgraph associated with the maximum similarity in the M similarities is T, searching for the upper node of the frequent subgraph associated with the maximum similarity in the target structure graph, wherein T is a positive integer greater than or equal to 2; and determining the classification result based on the transaction type of the financial transaction associated with the upper node.
[0083] For an unknown class graph structure Q=(V Q ,E Q )(corresponding to the structure graph to be classified), wherein V Q represents all nodes in the graph; each node can establish an edge with other nodes and is contained in E Q ; L Q represents a label set of nodes and edges, and each label can be represented by a set of vectors. Secondly, similarity determination can be performed between Q and all frequent subgraphs in S p , and the frequent subgraph with the maximum similarity (corresponding to the similarity) is found. Since more than one frequent subgraph can be found, the frequent subgraph with the maximum similarity can be represented as Then the ancestor of each maximum similarity frequent subgraph can be traced back, that is, the node with the maximum similarity at the top layer can be found, and the category with a larger proportion of the number of categories (i.e., the number of financial transaction types of the ancestor) is determined as the category of the unknown category graph by comparing the number of categories of the ancestor.
[0084] For example, after determining by using the similarity determination method, there can be more than one ancestor of the frequent subgraph with the maximum similarity to the structure graph to be classified. In this paper, it is defined that first, all frequent subgraphs can be found, and then all ancestors corresponding to the frequent subgraphs can be traced back in the topology T g (i.e., the target structure graph). If a single ancestor is found, the category of the ancestor can be used as the category (i.e., the classification result) of the structure graph to be classified. If multiple ancestors are found, the number of different categories in all ancestors can be counted, and the category with a larger proportion of the number can be used as the category of the test graph.
[0085] In this embodiment, the category of the ancestor can be obtained by using a probabilistic generative model. It is assumed that a labeled training set S={(G1, C1), (G2, C1), (G3, C2), …, (G n , C3)} is obtained, where G i represents the features of the i-th graph structure (corresponding to the frequent subgraph represented by the ancestor), which can represent the vector corresponding to the relationship edge between the nodes in the i-th graph structure, and C i represents the category. Based on the idea of the probabilistic generative model, the classification problem of the graph structure G i is converted into the probability size comparison problem of G i belonging to each category model.
[0086] It is assumed that the model training sample data obeys a Gaussian distribution. According to the Bayes formula, in order to obtain the value of P(C i |G i ), two probabilities of each category, P(C i ), P(G i |C i ) can be calculated. How to generate the probabilistic generative model will be specifically introduced below.
[0087] It is assumed that there is a batch of labeled training data with a quantity of N, and the number of categories is n.
[0088] Step 1: First, the proportion of the training data of each category in all training data is calculated to obtain the prior probability P(C i )(i=1…n), see formula (1).
[0089]
[0090] wherein, is the category Ci where N is the number of classes of all training data.
[0091] Step 2: It can be assumed that the training data is subject to Gaussian distribution, and then the density function of the Gaussian distribution can be obtained from each class of training data respectively. Here the density function is shown in formula (2):
[0092]
[0093] where G represents the features of the training sample, D represents the dimension of the multi-dimensional features, μ represents the mean, and ∑ represents the covariance matrix.
[0094] Then the two parameters of the distribution function, the mean μ and the covariance matrix ∑, can be fitted. The two parameters can be calculated by using maximum likelihood estimation. The likelihood function is shown in formula (3):
[0095]
[0096] The optimal solution of the parameters can be obtained by solving the formula (4) maximum likelihood estimation, which is shown in formula (5):
[0097]
[0098]
[0099]
[0100] Step 3: After obtaining the distribution function, the class of the training sample can be labeled according to the Bayes formula, which is shown in formula (6).
[0101]
[0102] At this time, P(G i |C i ) can be the probability density function f μ,Σ (G).
[0103] In the embodiment, the target structure graph is constructed based on the frequent sub-graphs of historical financial transactions and the partial order relationship between the frequent sub-graphs, and then the structure graph to be classified is classified based on the target structure graph, which avoids the situation that all sub-graphs of the financial transaction relationship graph are enumerated in the related technology, resulting in low classification efficiency of the financial transactions, thereby realizing the technical effect of improving the graph classification efficiency of the structure graph related to the financial transactions. Further, the technical problem of low classification efficiency of the transaction relationship graph in the related technology is solved.
[0104] Embodiment Two
[0105] The embodiment two of the application provides a kind of optional classification device based on frequent subgraph, each implementation unit in the classification device corresponds to each implementation step in the embodiment one.
[0106] Figure 3 It is the schematic diagram of an optional classification device based on frequent subgraph according to the embodiment of the application, as shown in Figure 3 The classification device includes: first acquisition unit 31, first determining unit 32 and second determining unit 33.
[0107] First acquisition unit 31, for obtaining structure diagram to be classified, wherein the structure diagram to be classified includes: N nodes representing the associated object of financial transaction, edge representing the relationship between N nodes, N is positive integer;
[0108] First determining unit 32, for determining the similarity of each frequent subgraph in target structure diagram based on N nodes and the relationship between nodes, obtains M similarity, wherein target structure diagram is connected by M frequent subgraph based on partial order relation, frequent subgraph includes: the frequent subgraph of historical structure diagram, historical structure diagram includes: the structure diagram composed of the associated object of historical financial transaction and the relationship between the associated object of historical financial transaction, partial order relation includes: subgraph isomorphism relation existing between any two frequent subgraphs, M is positive integer;
[0109] Second determining unit 33, for determining the classification result of structure diagram to be classified based on the frequent subgraph associated by the maximum similarity in M similarity, wherein classification result at least includes: the transaction type of financial transaction.
[0110] In the classification device based on frequent sub-graphs provided in Embodiment Two of the present application, the first obtaining unit 31 can obtain a structure graph to be classified, wherein the structure graph to be classified comprises N nodes representing associated objects of financial transactions and edges representing relationships between the N nodes, N being a positive integer. The first determining unit 32 determines the similarity between the structure graph to be classified and each frequent sub-graph in a target structure graph based on the N nodes and the relationships between the nodes, obtaining M similarities, wherein the target structure graph is connected by M frequent sub-graphs based on a partial order relationship, the frequent sub-graphs comprise frequent sub-graphs of historical structure graphs, the historical structure graphs comprise structure graphs composed of associated objects of historical financial transactions and relationships between the associated objects of the historical financial transactions, the partial order relationship comprises a sub-graph isomorphism relationship existing between any two frequent sub-graphs, M is a positive integer, and the second determining unit 33 determines a classification result of the structure graph to be classified based on a frequent sub-graph associated with the maximum similarity in the M similarities, wherein the classification result at least comprises a transaction type of the financial transactions. Thus, the technical problem of low efficiency in classifying transaction relationship graphs in the related art is solved. In this embodiment, the target structure graph is constructed based on the frequent sub-graphs of the historical financial transactions and the partial order relationship between the frequent sub-graphs, and then the structure graph to be classified is classified based on the target structure graph, thereby avoiding the situation that all sub-graphs of all financial transaction relationship graphs are enumerated in the related art, leading to low efficiency in classifying financial transactions, and thus achieving the technical effect of improving the graph classification efficiency of the structure graphs related to the financial transactions.
[0111] Optionally, in the classification device based on frequent sub-graphs provided in Embodiment Two of the present application, the historical structure graph comprises nodes representing associated objects of historical financial transactions and edges representing relationships between the associated objects of the historical financial transactions, and the target structure graph is obtained by the following units: a second obtaining unit configured to obtain the historical structure graph; a generating unit configured to generate S candidate sub-graphs based on frequent edges in the historical structure graph, wherein the frequent edges comprise edges representing the same relationship in the historical structure graph and having a number of occurrences greater than a preset number threshold, and S is a positive integer greater than M; a third determining unit configured to determine the M frequent sub-graphs based on a sub-graph isomorphism relationship existing in the S candidate sub-graphs; and a constructing unit configured to construct the target structure graph based on the partial order relationship in the M frequent sub-graphs.
[0112] Optionally, in the classification device based on frequent sub-graphs provided in Embodiment Two of the present application, the constructing unit comprises: a first determining sub-unit configured to determine a partial order set based on the sub-graph isomorphism relationship in the M frequent sub-graphs, wherein the partial order set records the partial order relationship in the M frequent sub-graphs; and a constructing sub-unit configured to construct a Hasse diagram of the M frequent sub-graphs based on the partial order set and take the obtained Hasse diagram as the target structure graph.
[0113] Optionally, in the classification device based on frequent sub-graphs provided in Embodiment Two of the present application, the third determining unit comprises: a first calculating sub-unit, configured to calculate the support degree of each candidate sub-graph, wherein the support degree of the candidate sub-graph represents the number of candidate sub-graphs in the S candidate sub-graphs that have a sub-graph isomorphism relationship with the candidate sub-graph; and a processing sub-unit, configured to take the candidate sub-graphs in the S candidate sub-graphs whose support degrees are greater than a preset support degree threshold as frequent sub-graphs, to obtain the M frequent sub-graphs.
[0114] Optionally, in the classification device based on frequent sub-graphs provided in Embodiment Two of the present application, the calculating unit comprises: a first determining module, configured to determine whether there is a sub-graph isomorphism relationship between any two candidate sub-graphs based on a tree search algorithm; and a second determining module, configured to determine the support degree of each candidate sub-graph based on the number of candidate sub-graphs in the S candidate sub-graphs that have a sub-graph isomorphism relationship with the candidate sub-graph.
[0115] Optionally, in the classification device based on frequent sub-graphs provided in Embodiment Two of the present application, the first determining unit comprises: a second determining sub-unit, configured to determine, based on the N nodes and the relationships between the nodes, the same structure part in each frequent sub-graph that exists in the structure graph to be classified, wherein the same structure part comprises a part sub-graph in which the connection structure between the nodes in the frequent sub-graph and the nodes in the structure graph to be classified is the same; and a second calculating sub-unit, configured to calculate the similarity between each structure graph to be classified and each frequent sub-graph based on the target data of the same structure part in each frequent sub-graph that exists in the structure graph to be classified, to obtain the M similarities, wherein the target data comprises at least one of the following: the number of nodes in the same structure part, the number of edges in the same structure part, the number of nodes in the same structure part representing the same object, and the number of edges in the same structure part representing the same relationship.
[0116] Optionally, in the classification device based on frequent sub-graphs provided in Embodiment Two of the present application, the second determining unit comprises: a searching sub-unit, configured to search, in the target structure graph, the upper node of the frequent sub-graph associated with the maximum similarity in the case that the frequent sub-graph associated with the maximum similarity in the M similarities is T, wherein T is a positive integer greater than or equal to 2; and a third determining sub-unit, configured to determine the classification result based on the transaction type of the financial transaction associated with the upper node.
[0117] The classification device based on frequent sub-graphs described above can further comprise a processor and a memory, and the first obtaining unit 31, the first determining unit 32, the second determining unit 33, etc. are all stored in the memory as program units, and the corresponding functions are realized by the processor executing the program units stored in the memory.
[0118] The processor includes a core, and the core calls corresponding program units in the memory. The core can be one or more, and the core parameter is adjusted to construct a target structure graph based on the frequent sub-graphs of historical financial transactions and the partial order relationship between the frequent sub-graphs, and then the target structure graph is used to classify the structure graph to be classified, thereby avoiding the situation that all sub-graphs of the financial transaction relationship graph are enumerated in the related art, resulting in low classification efficiency of the financial transaction, and thereby achieving the technical effect of improving the graph classification efficiency of the structure graph related to the financial transaction.
[0119] The memory can include a non-permanent memory in a computer readable medium, a random access memory (RAM) and / or a non-volatile memory such as a read-only memory (ROM) or a flash memory (flash RAM), and the memory includes at least one memory chip.
[0120] According to another aspect of the embodiments of the present application, an electronic device is also provided, which includes a processor and a memory for storing executable instructions of the processor, and the processor is configured to execute the frequent sub-graph based classification method according to any one of the above embodiments by executing the executable instructions.
[0121] According to another aspect of the embodiments of the present application, a computer readable storage medium is also provided, which stores a computer program, and the computer readable storage medium controls the device where the computer readable storage medium is located to execute the frequent sub-graph based classification method according to any one of the above embodiments when the computer program is running.
[0122] Figure 4 is a schematic diagram of an electronic device according to an embodiment of the present application, as Figure 4 shown, the embodiment of the present application provides an electronic device 40, which includes a processor, a memory, and a program stored in the memory and executable on the processor, and the processor implements the frequent sub-graph based classification method according to any one of the above embodiments when executing the program.
[0123] The above-mentioned serial numbers of the embodiments of the present application are only for description, and do not represent the advantages and disadvantages of the embodiments.
[0124] In the above-mentioned embodiments of the present application, the description of each embodiment has its own emphasis, and the parts not described in detail in a certain embodiment can be referred to the related description of other embodiments.
[0125] In several embodiments provided in the present application, it should be understood that the disclosed technology can be implemented by other means. Among them, the above-mentioned device embodiments are only schematic, for example, the division of the units can be a logical function division, and actual implementation can have another division mode, for example, a plurality of units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between the displayed or discussed each other can be through some interface, indirect coupling or communication connection between units or modules, which can be electrical or other forms.
[0126] The units described as separate components can or can not be physically separated, and the components shown as units can or can not be physical units, that is, they can be located in one place, or they can be distributed to multiple units. Part or all of the units can be selected according to actual needs to achieve the purpose of the embodiment.
[0127] In addition, each functional unit in each embodiment of the present application can be integrated into a processing unit, or each unit can exist physically, or two or more units can be integrated into one unit. The integrated unit can be realized in the form of hardware or in the form of a software functional unit.
[0128] The integrated unit, if realized in the form of a software functional unit and sold or used as an independent product, can be stored in a computer-readable storage medium. Based on this understanding, the technical solutions of the present application essentially or the part that contributes to the prior art or the whole or part of the technical solutions can be embodied in the form of a software product. The computer software product is stored in a storage medium, including a plurality of instructions for causing a computer device (which can be a personal computer, a server or a network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: a U disk, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), a mobile hard disk, a magnetic disk or an optical disk, and various media that can store program codes.
[0129] The above is only the preferred embodiment of the present application, and it should be pointed out that for ordinary skilled in the art, without departing from the principles of the present application, a number of improvements and refinements can be made, and these improvements and refinements should be considered as the protection scope of the present application.
Claims
1. A frequent subgraph-based classification method, characterized in that, The method comprises: obtaining a to-be-classified structure diagram, wherein the to-be-classified structure diagram comprises N nodes representing associated objects of a financial transaction and edges representing relationships between the N nodes, N being a positive integer; determining similarities between the to-be-classified structure diagram and each frequent subgraph in a target structure diagram based on the N nodes and the relationships between the nodes, obtaining M similarities, wherein the target structure diagram is composed of M frequent subgraphs connected based on a partial order relationship, the frequent subgraph comprises a frequent subgraph of a historical structure diagram, the historical structure diagram comprises a structure diagram composed of associated objects of historical financial transactions and relationships between the associated objects of the historical financial transactions, the partial order relationship comprises a subgraph isomorphism relationship existing between any two frequent subgraphs, and M is a positive integer; determining a classification result of the to-be-classified structure diagram based on a frequent subgraph associated with a maximum similarity in the M similarities, wherein the classification result at least comprises a transaction type of the financial transaction; wherein the historical structure diagram comprises nodes representing associated objects of historical financial transactions and edges representing relationships between the associated objects of the historical financial transactions, and the target structure diagram is obtained by: obtaining the historical structure diagram; generating S candidate subgraphs based on frequent edges in the historical structure diagram, wherein the frequent edges comprise edges representing the same relationship in the historical structure diagram and having an occurrence number greater than a preset number threshold, and S is a positive integer greater than M; determining M frequent subgraphs based on subgraph isomorphism relationships existing in the S candidate subgraphs; constructing the target structure diagram based on the partial order relationships in the M frequent subgraphs.
2. The classification method of claim 1, wherein, constructing the target structure diagram based on the partial order relationships in the M frequent subgraphs comprises: determining a partial order set based on the subgraph isomorphism relationships in the M frequent subgraphs, wherein the partial order set records the partial order relationships in the M frequent subgraphs; constructing a Hasse diagram of the M frequent subgraphs based on the partial order set, and taking the obtained Hasse diagram as the target structure diagram.
3. The classification method of claim 1, wherein, determining M frequent subgraphs based on the subgraph isomorphism relationships existing in the S candidate subgraphs comprises: calculating a support degree of each candidate subgraph, wherein the support degree of the candidate subgraph represents a number of candidate subgraphs having a subgraph isomorphism relationship with the candidate subgraph among the S candidate subgraphs; taking candidate subgraphs having a support degree greater than a preset support degree threshold among the S candidate subgraphs as the frequent subgraphs, and obtaining M frequent subgraphs.
4. The classification method of claim 3, wherein, calculating a support degree of each candidate subgraph comprises: determining whether a subgraph isomorphism relationship exists between any two candidate subgraphs based on a tree search algorithm; determining the support degree of each candidate subgraph based on a number of candidate subgraphs having a subgraph isomorphism relationship with the candidate subgraph among the S candidate subgraphs.
5. The classification method of claim 1, wherein, determining similarities between the to-be-classified structure diagram and each frequent subgraph in a target structure diagram based on the N nodes and the relationships between the nodes, obtaining M similarities, comprises: determine, based on the N nodes and the relationships between the nodes, a same structure part existing in each of the frequent subgraphs and the structure diagram to be classified, the same structure part including a part subgraph in which a connection structure between a node in the frequent subgraph and a node in the structure diagram to be classified is the same; calculate, based on target data of the same structure part existing in each of the frequent subgraphs and the structure diagram to be classified, a similarity between each of the structure diagrams to be classified and each of the frequent subgraphs, to obtain M similarities, the target data including at least one of a number of nodes of the same structure part, a number of edges of the same structure part, a number of nodes of the same structure part representing a same object, and a number of edges of the same structure part representing a same relationship.
6. The classification method of claim 1, wherein, determine, based on a frequent subgraph associated with a maximum similarity in the M similarities, a classification result of the structure diagram to be classified, including: in a case where the frequent subgraph associated with the maximum similarity in the M similarities is T, find an upper node of the frequent subgraph associated with the maximum similarity in the target structure diagram, where T is a positive integer greater than or equal to 2; determine, based on a transaction type of a financial transaction associated with the upper node, the classification result.
7. A classification device based on frequent subgraphs, characterized in that, including: a first obtaining unit configured to obtain a structure diagram to be classified, the structure diagram to be classified including N nodes representing associated objects of a financial transaction and edges representing relationships between the N nodes, where N is a positive integer; a first determining unit configured to determine, based on the N nodes and the relationships between the nodes, a similarity between the structure diagram to be classified and each of frequent subgraphs in a target structure diagram, to obtain M similarities, where the target structure diagram is connected based on a partial order relationship from M frequent subgraphs, the frequent subgraphs including frequent subgraphs of historical structure diagrams, the historical structure diagrams including structure diagrams composed of associated objects of historical financial transactions and relationships between the associated objects of the historical financial transactions, the partial order relationship including a subgraph isomorphism relationship existing between any two of the frequent subgraphs, and M is a positive integer; a second determining unit configured to determine, based on a frequent subgraph associated with a maximum similarity in the M similarities, a classification result of the structure diagram to be classified, where the classification result includes at least a transaction type of the financial transaction; wherein the historical structure diagrams include nodes representing associated objects of historical financial transactions and edges representing relationships between the associated objects of the historical financial transactions, and the target structure diagram is obtained by a second obtaining unit configured to obtain the historical structure diagrams, a generating unit configured to generate S candidate subgraphs based on frequent edges in the historical structure diagrams, where a frequent edge includes an edge representing a same relationship in the historical structure diagrams and appearing more than a preset number threshold, and S is a positive integer greater than M, a third determining unit configured to determine the M frequent subgraphs based on a subgraph isomorphism relationship existing in the S candidate subgraphs, and a constructing unit configured to construct the target structure diagram based on a partial order relationship in the M frequent subgraphs.
8. A computer-readable storage medium, characterized in that, The computer readable storage medium stores a computer program, wherein the computer program controls a device where the computer readable storage medium is located to perform the frequent subgraph-based classification method in any one of claims 1 to 6 when the computer program is running.
9. An electronic device, comprising: An apparatus comprising one or more processors and memory storing one or more programs, wherein the one or more programs that, when executed by the one or more processors, cause the one or more processors to perform the frequent subgraph-based classification method in any one of claims 1 to 6.
Citation Information
Patent Citations
Frequent subgraph mining method and terminal equipment
CN116150439A
Classification rule generation method, device and equipment
CN116304837A