Graph association rule mining method, device, equipment and medium
By introducing the decision tree training method into graph data and utilizing the feature selection mechanism of supervised learning to automatically screen the most discriminative feature combination, the problems of low efficiency and insufficient relevance in association rule mining in graph data are solved, and efficient and relevant association rule mining is achieved.
Patent Information
- Application Number
- CN202510995719.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-18
- Publication Date
- 2025-09-30
- Estimated Expiration
- 2045-07-18
AI Technical Summary
Existing technologies are inefficient in mining association rules in graph data, and the mined rules are not sufficiently relevant to the target tasks.
The decision tree training method is adopted to obtain the graph features of the target subgraph data and train the decision tree with the target attributes as training labels to obtain a reference decision tree. The association rules are extracted from it, and the feature selection mechanism of supervised learning is used to automatically screen the most discriminative feature combination.
It significantly reduces the computational complexity of graph association rule mining, improves mining efficiency, and makes the mined association rules strongly correlated with the requirements of the target task.
Smart Images

Figure CN120494056B_ABST
Abstract
Description
Technical Field
[0001] The present application is applicable to the field of graph data technology, and in particular relates to a graph association rule mining method, a graph association rule mining device, a computer device, and a computer-readable storage medium. Background Art
[0002] Please refer to Figure 1 Graph data, a data structure that uses nodes and edges to represent entities and relationships, is widely used in fields such as social networks, e-commerce, biomedicine, and finance. Association rules reflect the interdependencies between one object and other objects. If multiple objects have certain associations, then one object can be predicted through the other objects. Therefore, mining association rules from graph data has broad application value. Summary of the Invention
[0003] Embodiments of the present application provide a graph association rule mining method, a graph association rule mining apparatus, a computer device, and a computer-readable storage medium, which can improve the efficiency of mining graph association rules.
[0004] In a first aspect, an embodiment of the present application provides a graph association rule mining method, comprising:
[0005] Obtain graph data from the business system, and determine the target attributes corresponding to the target tasks and the target node labels corresponding to the target attributes;
[0006] Obtain the reference graph pattern based on the target attributes and target node labels;
[0007] Determining target subgraph data matching a reference graph pattern from the graph data;
[0008] Obtain the graph features of the target subgraph data, use the target attributes as training labels, train a decision tree based on the graph features, and obtain a reference decision tree;
[0009] Perform association rule extraction on the reference decision tree to obtain the target association rules.
[0010] In a second aspect, an embodiment of the present application provides a graph association rule mining device, comprising:
[0011] The data acquisition module is used to obtain the graph data of the business system and determine the target attributes corresponding to the target tasks and the target node labels corresponding to the target attributes;
[0012] The pattern acquisition module is used to obtain the reference graph pattern according to the target attributes and target node labels;
[0013] A sub-image matching module is used to determine target sub-image data that matches the reference image pattern from the image data;
[0014] The model training module is used to obtain the graph features of the target subgraph data, and use the target attributes as training labels to train a decision tree based on the graph features to obtain a reference decision tree;
[0015] The rule extraction module is used to extract association rules from the reference decision tree to obtain target association rules.
[0016] Optionally, in one embodiment, the rule extraction module is used to, for each leaf node in the reference decision tree, trace back from the leaf node to the root node to obtain a backtracking path, and combine the discrimination conditions corresponding to each non-leaf node in the backtracking path to obtain a predecessor of the target association rule corresponding to the leaf node, and use the target attribute value of the leaf node as the successor of the target association rule corresponding to the leaf node.
[0017] Optionally, in one embodiment, the graph association rule mining device provided by the present application also includes a task execution module, which is used to obtain real-time business data of the business system and construct real-time graph data corresponding to the real-time business data; if the real-time graph data matches the reference graph pattern and the real-time graph data satisfies the predecessor, the corresponding subsequent task operation is executed.
[0018] Optionally, in one embodiment, the pattern acquisition module is used to use the nodes in the graph data that match the target node label and target attribute as axis points; initialize the graph pattern based on the axis points to obtain an initial graph pattern; and expand the initial graph pattern to obtain a reference graph pattern.
[0019] Optionally, in one embodiment, the pattern acquisition module is configured to expand the initial graph pattern using a vertical expansion strategy to obtain an expanded graph pattern; if the support of the expanded graph pattern reaches a support threshold, the expanded graph pattern is used as a reference graph pattern.
[0020] Optionally, in one embodiment, the model training module is used to obtain at least one of the attribute features and structural features of the target subgraph data as a graph feature.
[0021] Optionally, in one embodiment, the model training module is further used to obtain a pruning strategy, and prune the reference decision tree according to the pruning strategy.
[0022] In a third aspect, the computer device provided in the embodiment of the present application includes a processor and a memory, wherein the memory stores a computer program that can be run on the processor, and when the processor runs the computer program, the graph association rule mining method provided in the embodiment of the present application is implemented.
[0023] In a fourth aspect, the computer-readable storage medium provided in the embodiment of the present application stores a computer program, which, when executed by a processor, implements the graph association rule mining method provided in the embodiment of the present application.
[0024] The graph association rule mining solution provided by the present application obtains the graph data of the business system, and determines the target attribute corresponding to the target task and the target node label corresponding to the target attribute; obtains the reference graph pattern according to the target attribute and the target node label; determines the target subgraph data that matches the reference graph pattern from the graph data; obtains the graph features of the target subgraph data, and uses the target attribute as the training label to train the decision tree according to the graph features to obtain a reference decision tree; extracts association rules from the reference decision tree to obtain the target association rules. In this way, by introducing the decision tree into the mining of graph association rules, the most discriminative feature combination is automatically screened through the feature selection mechanism of supervised learning, without enumerating all possibilities, which can significantly reduce the computational complexity and thus improve the mining efficiency of graph association rules. In addition, the training of the decision tree directly uses the label of the target task, so that the mined association rules are strongly correlated with the requirements of the target task. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for use in the embodiments or descriptions of the prior art. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0026] Figure 1 This is a schematic diagram of the structure of the graph data involved in this application;
[0027] Figure 2 This is a schematic diagram of an application environment of the graph association rule mining method provided by an embodiment of the present application;
[0028] Figure 3 This is a flow chart of a graph association rule mining method provided by an embodiment of the present application;
[0029] Figure 4 This is a schematic diagram of the structure of the graph association rule mining device provided by an embodiment of the present application;
[0030] Figure 5 It is a structural diagram of the computer device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0031] In the following description, specific details such as specific system structures and techniques are provided for purposes of illustration rather than limitation to facilitate a thorough understanding of the embodiments of the present application. However, it will be apparent to those skilled in the art that the present application may be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to avoid obscuring the description of the present application with unnecessary detail.
[0032] It should be understood that when used in the present specification and the appended claims, the term "comprising" indicates the presence of described features, integers, steps, operations, elements and / or components, but does not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or collections thereof.
[0033] It will also be understood that the term "and / or" used in this specification and the appended claims refers to and includes any and all possible combinations of one or more of the associated listed items.
[0034] As used in this specification and the appended claims, the term "if" can be interpreted as "when" or "upon" or "in response to determining" or "in response to detecting," depending on the context. Similarly, the phrase "if it is determined" or "if [described condition or event] is detected" can be interpreted as meaning "upon determination" or "in response to determining" or "upon detection of [described condition or event]" or "in response to detecting [described condition or event]," depending on the context.
[0035] In addition, in the description of the present application specification and the appended claims, the terms "first", "second", "third", etc. are only used to distinguish the descriptions and cannot be understood as indicating or implying relative importance.
[0036] References to "one embodiment" or "some embodiments" in this specification mean that a particular feature, structure, or characteristic described in conjunction with that embodiment is included in one or more embodiments of the present application. Thus, phrases such as "in one embodiment," "in some embodiments," "in other embodiments," and "in other embodiments" appearing in various places in this specification do not necessarily refer to the same embodiment, but rather mean "one or more but not all embodiments," unless otherwise specifically emphasized. The terms "including," "comprising," "having," and variations thereof all mean "including but not limited to," unless otherwise specifically emphasized.
[0037] It should be understood that the size of the serial numbers of the steps in the following embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.
[0038] In order to illustrate the technical solution of the present application, specific embodiments are provided below.
[0039] Please refer to Figure 2 , Figure 2The figure is a schematic diagram of an application environment for the graph association rule mining method provided in this application. As an embodiment, the graph association rule mining method provided in this application can be applied to a server 100, where the server 100 and the terminal device 200 are connected via a network. The network, which provides a communication link between the server 100 and the terminal device 200, can include various connection types, such as wired communication links, wireless communication links, etc., and is not limited in this embodiment of the application.
[0040] It should be noted that Figure 2 The server 100, network, and terminal device 200 are merely illustrative. Any number of servers 100 may be provided as needed. For example, the server 100 may be implemented as an independent physical server, a server cluster consisting of multiple servers, or a distributed system. The terminal device 200 may be any device, such as a mobile phone, tablet, desktop computer, or laptop computer.
[0041] In some embodiments, on the one hand, the terminal device 200 can generate a rule mining request in response to a user operation and send it to the server 100, instructing the server 100 to perform graph association rule mining through the rule mining request. On the other hand, after receiving the rule mining request from the terminal device 200, the server 100 obtains the graph data of the business system that needs to perform graph association rule mining, as well as the target attribute corresponding to the target task to which the association rule to be mined is to be applied, and the target node label of the node corresponding to the target attribute, according to the instruction of the rule mining request; then, based on the obtained target attribute and target node label, further obtains the reference graph pattern, and determines the target subgraph data that matches the reference graph pattern from the graph data; then, obtains the graph features of the target subgraph data, and uses the target attribute as the training label to train a decision tree based on the graph features to obtain a reference decision tree; finally, extracts association rules from the reference decision tree to obtain the target association rule applicable to the target task.
[0042] Please refer to Figure 3 , Figure 3 This is a flow chart of a graph association rule mining method provided by an embodiment of the present application. Figure 3 As shown in Figure 2, the process of the graph association rule mining method can be as follows:
[0043] In 110 , graph data of the business system is obtained, as well as target attributes corresponding to the target tasks and target node labels corresponding to the target attributes.
[0044] A business system refers to an information system that provides support for the specific business of an enterprise or organization, such as an e-commerce business system, financial business system, social business system, and bioinformatics business system, etc.
[0045] Graph data is used to model complex relational networks in the real world. For example, in e-commerce business systems, graph data can represent users, products (nodes), and their browsing and purchasing behaviors (edges). The core of this approach is to assign semantics to nodes / edges through labels and attributes. Graph data can be represented as G=(V,E,L).
[0046] V is the set of all nodes in the graph data, and the number of nodes is limited, representing entities in the real world (such as users, products, accounts, genes, hosts, servers, etc.). For example, the e-commerce graph data of an e-commerce business system may contain nodes (User A), Node (Commodity B), etc.; the transaction graph data of the financial business system may contain nodes (Account X), Node (Account Y), etc.
[0047] E is the set of all edges in the graph data, each edge ( ) represents a slave node To Node A directed edge of represents the relationship between nodes. For example, in the e-commerce graph data of the e-commerce business system, the edge ( ) may represent a node (User A) browsed the node (Commodity B); Edge in the transaction graph data of the financial business system ( ) may represent a node (Account X) to the node (Account Y) transfer.
[0048] L represents a function that assigns labels (a label used to identify or classify nodes / edges) to nodes and edges, and the label categories are a finite set node , L( ) Representation node For example, the user node label is "user", the product node label is "item", etc. , L( ) Indicates the label of edge e, such as the browsing edge label is "browse", the transfer edge label is "transfer", and so on.
[0049] .A represents a point The value of the A attribute on the node, such as the age of the user node, the price of the product node, etc. .A represents an edge The value of the A attribute, such as the duration of browsing behavior, the amount of transfer behavior, etc.
[0050] The target task can be any downstream task that is expected to be applied using the mined association rules. For example, it is expected to mine association rules from the e-commerce graph data of the e-commerce business system for product recommendation tasks, it is expected to mine association rules from the transaction graph data of the financial business system for fraud identification tasks, it is expected to mine association rules from the social graph data of the social business system for friend recommendation tasks, and so on.
[0051] An association rule is an implication of the form X→Y, where X is called the predecessor (left-hand-side, LHS) of the association rule and Y is called the successor (right-hand-side, RHS) of the association rule.
[0052] In an embodiment of the present application, an input rule mining request can be received, and the rule externalization request is used to indicate the graph data of the business system that needs to perform graph association rule mining, as well as the target attribute corresponding to the target task and the target node label corresponding to the target attribute. Then, according to the indication of the rule mining request, the graph data of the business system that needs to perform graph association rule mining is obtained, and the target attribute corresponding to the target task and the target node label corresponding to the target attribute are determined. There is no specific restriction on the input method of the rule mining request here. For example, a graphical mining configuration interface can be provided, which includes a request input interface, and the input rule mining request is received through the request input interface.
[0053] For example, for a product recommendation task, the target attribute can be "whether to purchase a product" and the target node label can be "user"; for a fraud detection task, the target attribute can be "whether it is fraud" and the target node label can be "account", and so on.
[0054] In 120 , a reference graph pattern is obtained according to the target attributes and the target node labels.
[0055] In the embodiment of the present application, the graph pattern is a structural template of graph data, which is represented as .
[0056] It is the set of all nodes in the graph. Each node represents an abstract entity in the graph. Its role is to define the entity position in the topological structure of the graph. For example, for e-commerce graph data, if , then the graph pattern contains two nodes and , which may correspond to the “user” node and “product” node of e-commerce graph data.
[0057] It is the set of all edges in the graph pattern. Each edge represents the relationship between two nodes in the graph pattern. Its function is to define the relationship connection in the topological structure of the template. For example, for e-commerce graph data, if , then there is a slave node in the graph pattern To Node The edges may correspond to the “browse” or “purchase” behaviors in the e-commerce graph data.
[0058] It is a function that assigns labels to nodes and edges in a graph pattern. The label values come from a finite set. (Consistent with the label category of the graph data that needs to be mined for graph association rules).
[0059] is a variable list consisting of several variables (such as x1, x2), each of which represents the "abstract identity" of an entity in the graph pattern. For a list of slave variables To node collection That is, each variable uniquely corresponds to a node in the graph pattern, and each node corresponds to exactly one variable.
[0060] In the embodiments of the present application, the reference graph pattern is a graph pattern used to define a structural template for rule mining. It is used to guide the matching of subgraph data with specific semantics and topology within graph data, providing a basis for the subsequent generation of association rules. The reference graph pattern is generated based on target attributes and target node labels according to a configured graph pattern generation strategy. The configuration of the graph pattern generation strategy is not specifically limited herein.
[0061] In 130 , target sub-image data matching the reference image pattern is determined from the image data.
[0062] It should be noted that a match of the graph pattern Q in the graph data G is defined as:
[0063] A subgraph data of graph data G , the subgraph data Isomorphic to the reference graph pattern Q, the matching result h is arrive The bijection h ensures that the reference graph pattern Q and the subgraph data The nodes of are in one-to-one correspondence, avoiding the ambiguity of structural matching. In addition, the matching result can also be expressed as a vector h( ), the vector h( ) = h( (x)), that is, each variable corresponds to a node in the specific graph data G. In other words, the essence of graph pattern matching is to find subgraph data from the graph data that is completely consistent with the graph pattern structure and labels, and to associate the abstract variables in the graph pattern with the specific nodes in the graph data through the bijection h and the variable vector h(x).
[0064] In the embodiment of the present application, after obtaining the reference image pattern, the configured sub-image matching algorithm is further used to determine sub-image data that matches the reference image pattern from the image data, and record it as the target sub-image data. The sub-image matching algorithm selected is not specifically limited herein, and includes but is not limited to the DFS algorithm, the BFS algorithm, the VF2 algorithm, the VF3 algorithm, and the like.
[0065] In 140 , graph features of the target subgraph data are obtained, and target attributes are used as training labels. Decision tree training is performed based on the graph features to obtain a reference decision tree.
[0066] As described above, after determining the target subgraph data that matches the reference graph pattern from the graph data, the graph features of the target subgraph data are further obtained (there is no specific restriction on what features of the target subgraph data are extracted as graph features, and the target attributes are used as training labels. Decision tree training is performed based on the obtained graph features, and the trained decision tree is recorded as the reference decision tree. It should be noted that, unlike node labels used to identify node categories (such as "user", "item", etc.), training labels are target variables for supervised learning (such as "whether to purchase", "whether fraud", etc.).
[0067] The goal of decision tree training is to predict training labels using graph features of the target subgraph (such as age, browsing time, and degree) and to find the most discriminative feature combination. For example, for a product recommendation task, we need to learn the pattern: "User age > 25, browsing time > 5 minutes, product viewed > 10 times → purchase similar products."
[0068] In 150 , association rules are extracted from the reference decision tree to obtain target association rules.
[0069] It should be noted that after training, each path from the root node to a leaf in the reference decision tree corresponds to a potential association rule. For example, a path might be: Age > 25 → Browsing Time > 5 Minutes → Product Views > 10 → Leaf Node (Purchase).
[0070] In the embodiment of the present application, association rules can be extracted from the trained reference decision tree according to the configured rule extraction strategy to obtain association rules applicable to the target task, which are recorded as target association rules. No specific restrictions are imposed on the configuration of the rule extraction strategy.
[0071] Optionally, in one embodiment, an optional rule extraction strategy is provided, wherein association rule extraction is performed on a reference decision tree to obtain a target association rule, including:
[0072] For each leaf node in the reference decision tree, trace back from the leaf node to the root node to obtain the backtracking path, and combine the discrimination conditions corresponding to each non-leaf node in the backtracking path to obtain the predecessor of the target association rule corresponding to the leaf node, and use the target attribute value of the leaf node as the successor of the target association rule corresponding to the leaf node.
[0073] In the embodiment of the present application, the target association rule is expressed as ,in, Represents graph mode An association rule, X represents the predecessor of the association rule, and Y represents the successor of the association rule.
[0074] For example, taking e-commerce graph data as an example, assuming that the goal is to mine the rule of "users purchase similar products after browsing a certain product", the target attribute is "whether to purchase similar products", the target node label is "user", and the reference graph pattern is obtained =({ },{( ),( ), },),in, represents a user node (node label "user"), Indicates the browsed item node (node label "item"), Represents nodes of the same type of goods (node label "item"), edges ( ) represents browsing behavior (edge label “browse”), edge ( ) indicates the same category relationship (edge label "same_category"), variable list ={ }, where x u represents the user, x p Indicates the browsed product, x sp Indicates similar products, through bijection and One-to-one correspondence. Through subgraph matching, the reference graph pattern is determined in the e-commerce graph data. All target subgraph data that matches (e.g., user browses product B, which is similar to product C). Assuming that the graph features of the acquired target subgraph data include: user age, browsing time, and the degree of browsed products, the decision tree model is trained with the target attribute "whether to purchase similar products" as the training label, so that the reference decision tree learns the following key judgment conditions:
[0075] User age>25 years old;
[0076] Browsing time > 5 minutes;
[0077] The product has been viewed more than 10 times.
[0078] A path in the reference decision tree is: User Age > 25 → Browsing Duration > 5 Minutes → Number of Viewed Items > 10 → Leaf Node (Label: Yes). For this leaf node, trace back from the leaf node to the root node to obtain a backtracking path. Combine the discriminant conditions corresponding to each non-leaf node in the backtracking path to obtain the predecessor of the target association rule corresponding to the leaf node. Use the target attribute value of the leaf node as the successor of the target association rule corresponding to the leaf node to obtain the target association rule: ;
[0079] The meaning of the target association rule above is: when there is a structure of "user-browsing-browsed product-similar product" (by the reference graph model Definition), and the following conditions are met: the user is older than 25 years old, the time spent browsing the product is more than 5 minutes, and the product has been viewed more than 10 times, it can be inferred that the user will purchase similar products of the product (Y=1, indicating yes).
[0080] Optionally, in one embodiment, after extracting association rules from the reference decision tree to obtain target association rules, the following steps are further included:
[0081] Obtain real-time business data from the business system and build real-time graph data corresponding to the real-time business data;
[0082] If the real-time graph data matches the reference graph pattern and the real-time graph data satisfies the predecessor of the target association rule, the subsequent task operation corresponding to the target association rule is executed.
[0083] In an embodiment of the present application, after extracting target association rules applicable to a target task, the extracted target association rules are also applied to the target task. This involves acquiring real-time business data from the business system, constructing real-time graph data corresponding to the real-time business data, and employing a subgraph matching algorithm to detect whether the real-time graph data matches a reference graph pattern. If the real-time graph data matches the reference graph data, further verification is performed to determine whether the real-time graph data satisfies the precursor of the target association rule. If so, the subsequent task operation corresponding to the target association rule is executed.
[0084] For example, for an e-commerce business system, a reference graph model is obtained It is expressed as (user-browsing-product), and the corresponding target association rule is expressed as The real-time business data obtained includes data related to user browsing behavior. For example, user A browses product B for 8 minutes. The real-time graph data is represented as (user A-browsing-product B). Obviously, the real-time graph data is different from the reference graph model above. For (user-browsing-product) matching, assuming that user A is 28 years old and product B has been viewed 15 times, it is clear that the real-time graph data meets the preceding target association rule. According to the subsequent target association rule, the corresponding task action is executed: recommending similar products of product B to user A, such as product C.
[0085] Optionally, in one embodiment, obtaining a reference graph mode according to target attributes and target node labels includes:
[0086] The nodes in the graph data that match the target node label and target attribute are used as axis points;
[0087] Initialize the graph pattern based on the axis point to obtain the initial graph pattern;
[0088] The initial graph pattern is expanded to obtain a reference graph pattern.
[0089] In the embodiment of the present application, first, the node in the graph data with the target node label and the target attribute is used as the axis point, and the graph pattern is initialized based on the axis point to obtain an initial graph pattern including only one axis point node. , indicating that this is a node that contains only nodes with labels The graph mode of the nodes.
[0090] After completing the initialization of the graph pattern and obtaining the initial graph pattern, the initial graph pattern is only expanded according to the configured expansion strategy to obtain a reference graph pattern. No specific restrictions are imposed on the configuration of the expansion strategy.
[0091] Optionally, in one embodiment, performing expansion processing on the initial graph pattern to obtain a reference graph pattern includes:
[0092] The initial graph pattern is expanded using a vertical expansion strategy to obtain an expanded graph pattern;
[0093] If the support of the extended graph pattern reaches the support threshold, the extended graph pattern is used as the reference graph pattern.
[0094] In the embodiment of the present application, a vertical expansion strategy is used to expand the graph pattern. The core of the vertical expansion strategy is to explore new graph patterns by gradually adding edges (connecting existing nodes with new nodes) based on the existing graph pattern. For example, the initial graph pattern is a single user node "user". After adding an edge (user→product), a new graph pattern "user-product" is obtained. Then, adding an edge (product→similar product) obtains a new extended graph pattern "user-product-similar product". In the embodiment of the present application, the new graph patterns obtained by adding edges each time are recorded as extended graph patterns.
[0095] Among them, each time a new extended graph pattern is obtained by expansion, the support of the extended graph pattern is calculated, that is, the frequency of the extended graph pattern appearing in the graph data (such as the proportion of the number of matches to the total sub-graph data). It should be noted that the embodiment of the present application is also configured with a support threshold, which is used to filter low-frequency graph patterns and can be configured by technical personnel in this field according to actual needs. For example, assuming that the support threshold is configured to 0.1, if the support of the extended graph pattern reaches 0.1, such as 0.15, the extended graph pattern is retained and used as a reference graph pattern. Due to the subsequent mining of association rules, if the support of the extended graph pattern does not reach 0.1, such as 0.05, a new edge is selected to be added to obtain a new extended pattern. This cycle is iterated to continuously expand the extended graph pattern whose support reaches the support threshold as the reference graph pattern until the cycle ends when no edge meets the requirement.
[0096] In the embodiment of the present application, each time a new reference image pattern is expanded, steps 130, 140, and 150 are executed to extract the target association rules corresponding to each reference image pattern. For how to use the reference image pattern to extract the target association rules, please refer to the relevant description in the above embodiment, which will not be repeated here.
[0097] Optionally, in one embodiment, obtaining graph features of target subgraph data includes:
[0098] At least one of an attribute feature and a structural feature of the target subgraph data is acquired as a graph feature.
[0099] The attribute characteristics of the target subgraph data include the attributes of the nodes and edges in the target subgraph data. For example, taking e-commerce graph data as an example, the attribute characteristics of the target subgraph data derived from the e-commerce graph data include the age, gender and other attributes of the user nodes, the category, price and other attributes of the product nodes, and the number of views, browsing duration and other attributes of the browsing edge (user→product).
[0100] The structural features of the target subgraph data include the topological positions and / or relationships of nodes / edges within the target subgraph data. Unlike attribute features, which are static and local, structural features are dynamic and global. For example, in social graph data, the "age" (attribute) of a user node is a local feature, while the "degree" (number of friends, a structural feature) of the user node reflects its level of social activity. In e-commerce graph data, the "price" (attribute) of a product node is a local feature, while the "number of views" (degree, a structural feature) of the product node reflects its popularity.
[0101] In an embodiment of the present application, only the attribute features of the target subgraph data can be obtained as the graph features for training the decision tree, or only the structural features of the target subgraph data can be obtained as the graph features for training the decision tree, or both the attribute features and the structural features of the target subgraph data can be obtained as the graph features for training the decision tree.
[0102] For example, for target subgraph data from a transaction graph, we extract attribute features (here, the user node's age and the browsing duration of the browsing edge) and structural features (here, the degree of the product node, indicating the number of times the product node has been viewed) of each target subgraph data (distinguished by matching sequence numbers) as graph features. The target attribute is "whether to purchase similar products." The training data table is constructed as follows:
[0103]
[0104] Accordingly, a decision tree is trained on the training data table using the target attribute as the training label to obtain a reference decision tree. The decision tree algorithm used is not specifically limited and can be selected by those skilled in the art based on actual needs. For example, based on the above training data table, a path in the trained reference decision tree is: User Age > 25 → Browsing Duration > 5 Minutes → Number of Viewed Items > 10 → Leaf Node (Label: Yes).
[0105] Optionally, in one embodiment, before extracting association rules from the reference decision tree to obtain target association rules, the process further includes:
[0106] Obtain a pruning strategy, and prune the reference decision tree according to the pruning strategy.
[0107] The pruning strategy is used to describe how to prune a decision tree. There are no specific restrictions on the pruning strategy used here. For example, in the embodiments of this application, a dynamic pruning strategy is used to prune a reference decision tree, and the pruned reference decision tree is used to extract association rules. The dynamic pruning strategy is a tree structure optimization method based on validation set feedback. Its core idea is to evaluate the prediction errors of different subtrees through the validation set and prune away subtrees with "no significant error reduction but high complexity," thereby balancing the "fitting ability" and "generalization ability" of the decision tree.
[0108] For example, after generating the training data table, 70% of the data is divided into a training set for training the reference decision tree, and 30% of the data is divided into a validation set for evaluating the pruning effect to achieve pruning of the reference decision tree.
[0109] From the above, it can be seen that the graph association rule mining solution provided by this application obtains the graph data of the business system, and determines the target attribute corresponding to the target task and the target node label corresponding to the target attribute; obtains the reference graph pattern according to the target attribute and the target node label; determines the target subgraph data that matches the reference graph pattern from the graph data; obtains the graph features of the target subgraph data, and uses the target attribute as the training label to train the decision tree according to the graph features to obtain a reference decision tree; extracts association rules from the reference decision tree to obtain the target association rules. In this way, by introducing the decision tree into the mining of graph association rules, the most discriminative feature combination is automatically screened through the feature selection mechanism of supervised learning, without enumerating all possibilities, which can significantly reduce the computational complexity and thus improve the mining efficiency of graph association rules. In addition, the training of the decision tree directly uses the label of the target task, so that the mined association rules are strongly correlated with the requirements of the target task.
[0110] To facilitate better implementation of the graph association rule mining method described above, the present application embodiment also provides a corresponding graph association rule mining device. The meanings of the terms are the same as those in the graph association rule mining method described above. For specific implementation details, please refer to the description in the above method embodiment.
[0111] Please refer to Figure 4 , Figure 4 This is a schematic diagram of the structure of a graph association rule mining device provided in an embodiment of the present application. The graph association rule mining device may include a data acquisition module 210, a pattern acquisition module 220, a subgraph matching module 230, a model training module 240, and a rule extraction module 250, wherein:
[0112] The data acquisition module 210 is used to acquire graph data of the business system and determine the target attribute corresponding to the target task and the target node label corresponding to the target attribute;
[0113] The pattern acquisition module 220 is used to acquire the reference graph pattern according to the target attributes and the target node labels;
[0114] The sub-image matching module 230 is used to determine target sub-image data that matches the reference image pattern from the image data;
[0115] The model training module 240 is used to obtain the graph features of the target subgraph data, and use the target attributes as training labels to perform decision tree training based on the graph features to obtain a reference decision tree;
[0116] The rule extraction module 250 is used to extract association rules from the reference decision tree to obtain target association rules.
[0117] Optionally, in one embodiment, the rule extraction module 250 is used to, for each leaf node in the reference decision tree, trace back from the leaf node to the root node to obtain a backtracking path, and combine the discrimination conditions corresponding to each non-leaf node in the backtracking path to obtain a predecessor of the target association rule corresponding to the leaf node, and use the target attribute value of the leaf node as the successor of the target association rule corresponding to the leaf node.
[0118] Optionally, in one embodiment, the graph association rule mining device provided by the present application also includes a task execution module, which is used to obtain real-time business data of the business system and construct real-time graph data corresponding to the real-time business data; if the real-time graph data matches the reference graph pattern and the real-time graph data satisfies the predecessor, the corresponding subsequent task operation is executed.
[0119] Optionally, in one embodiment, the pattern acquisition module 220 is used to use the nodes in the graph data that match the target node label and target attribute as axis points; initialize the graph pattern based on the axis points to obtain an initial graph pattern; and expand the initial graph pattern to obtain a reference graph pattern.
[0120] Optionally, in one embodiment, the pattern acquisition module 220 is configured to expand the initial graph pattern using a vertical expansion strategy to obtain an expanded graph pattern; if the support of the expanded graph pattern reaches a support threshold, the expanded graph pattern is used as a reference graph pattern.
[0121] Optionally, in one embodiment, the model training module 240 is configured to obtain at least one of attribute features and structural features of the target subgraph data as a graph feature.
[0122] Optionally, in one embodiment, the model training module 240 is further configured to obtain a pruning strategy, and perform pruning processing on the reference decision tree according to the pruning strategy.
[0123] It should be noted that the information interaction, execution process and other contents between the above modules are based on the same concept as the method embodiment of this application. Their specific functions and technical effects can be found in the method embodiment part and will not be repeated here.
[0124] Figure 5 This is a schematic diagram of the structure of a computer device provided in an embodiment of the present application. Figure 5 As shown, the computer device includes: at least one processor ( Figure 5 Only one is shown in the figure), a memory, and a computer program stored in the memory and executable on at least one processor. When the processor executes the computer program, the steps in the above-mentioned graph association rule mining method embodiment are implemented.
[0125] The computer device may include, but is not limited to, a processor and a memory. It will be understood by those skilled in the art that Figure 5 The above is merely an example of a computer device and does not constitute a limitation on the computer device. The computer device may include more or fewer components than shown in the figure, or a combination of certain components, or different components. For example, it may also include a network interface, a display screen, and an input device.
[0126] The processor may be a CPU, other general-purpose processors, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor.
[0127] Memory includes readable storage media, internal memory, and the like. Internal memory can be the internal memory of a computer device, providing an environment for the operation of the operating system and computer-readable instructions stored in the readable storage medium. The readable storage medium can be the computer device's hard drive. In other embodiments, it can also be an external storage device, such as a plug-in hard drive, a Smart Media Card (SMC), a Secure Digital (SD) card, or a flash memory card. Furthermore, memory can include both the computer device's internal storage unit and external storage devices. Memory is used to store the operating system, application programs, boot loaders, data, and other programs, such as the program code of computer programs. Memory can also be used to temporarily store data that has been output or is about to be output.
[0128] Those skilled in the art can clearly understand that, for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In actual applications, the above-mentioned functions can be distributed and completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated into a processing unit, or each unit can exist physically alone, or two or more units can be integrated into one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of a software functional unit. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned device can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here. If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present application implements all or part of the process steps in the above-described method embodiments by instructing the relevant hardware through a computer program. The computer program may be stored in a computer-readable storage medium. When executed by a processor, the computer program implements the steps of the above-described method embodiments. The computer program includes computer program code, which may be in source code form, object code form, executable file, or some intermediate form. Computer-readable media may include at least: any entity or device capable of carrying computer program code, recording media, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signals, telecommunications signals, and software distribution media. Examples include USB flash drives, removable hard drives, magnetic disks, or optical disks. In some jurisdictions, based on legislation and patent practice, computer-readable media cannot be electrical carrier signals or telecommunications signals.
[0129] The present application implements all or part of the processes in the above-mentioned embodiment method, and can also be completed through a computer program product. When the computer program product runs on a computer device, the computer device can implement the steps in the above-mentioned method embodiment when executing it.
[0130] In the above embodiments, the description of each embodiment has its own focus. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant description of other embodiments.
[0131] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0132] In the embodiments provided in this application, it should be understood that the disclosed apparatus / computer equipment and methods can be implemented in other ways. For example, the apparatus / computer equipment embodiments described above are merely schematic. For example, the division of modules or units is merely a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of the apparatus or unit, which can be electrical, mechanical or other forms.
[0133] Units described as separate components may or may not be physically separate, and components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected to achieve the purpose of this embodiment according to actual needs.
[0134] The above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. These modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the various embodiments of the present application, and should all be included in the scope of protection of the present application.
Claims
1. A graph association rule mining method, characterized in that: include: Obtaining graph data of a business system, and determining target attributes corresponding to a target task and target node labels corresponding to the target attributes, wherein the business system includes but is not limited to an e-commerce business system, a financial business system, a social business system, and a bioinformatics business system; Taking a node in the graph data that matches the target node label and the target attribute as an axis point; Initializing the graph pattern based on the axis point to obtain an initial graph pattern; Expanding the initial graph pattern using a vertical expansion strategy to obtain an expanded graph pattern, and using the expanded graph pattern whose support reaches a support threshold as a reference graph pattern; Determining target sub-image data matching the reference image pattern from the image data; Obtaining graph features of the target subgraph data, and using the target attributes as training labels, performing decision tree training based on the graph features to obtain a reference decision tree; For each leaf node in the reference decision tree, trace back from the leaf node to the root node to obtain a backtracking path, and combine the discrimination conditions corresponding to each non-leaf node in the backtracking path to obtain the predecessor of the target association rule corresponding to the leaf node, and use the target attribute value of the leaf node as the successor of the target association rule corresponding to the leaf node.
2. The graph association rule mining method according to claim 1, characterized in that: After taking the target attribute value of the leaf node as the successor of the target association rule corresponding to the leaf node, the method further includes: Acquire real-time business data of the business system, and construct real-time graph data corresponding to the real-time business data; If the real-time graph data matches the reference graph pattern and the real-time graph data satisfies the predecessor, a task operation corresponding to the successor is performed.
3. The graph association rule mining method according to claim 1, characterized in that: The obtaining of the graph features of the target subgraph data includes: At least one of the attribute feature and the structural feature of the target subgraph data is acquired as the graph feature.
4. The graph association rule mining method according to any one of claims 1 to 3, characterized in that: Before extracting association rules from the reference decision tree to obtain target association rules, the method further includes: Acquire a pruning strategy, and perform pruning processing on the reference decision tree according to the pruning strategy.
5. A graph association rule mining device, characterized in that: include: A data acquisition module is used to acquire graph data of business systems, and determine target attributes corresponding to target tasks and target node labels corresponding to the target attributes. The business systems include but are not limited to e-commerce business systems, financial business systems, social business systems, and bioinformatics business systems; a pattern acquisition module, configured to use a node in the graph data that matches the target node label and the target attribute as an axis point; initialize a graph pattern based on the axis point to obtain an initial graph pattern; expand the initial graph pattern using a vertical expansion strategy to obtain an expanded graph pattern, and use the expanded graph pattern whose support reaches a support threshold as a reference graph pattern; a sub-image matching module, configured to determine target sub-image data matching the reference image pattern from the image data; A model training module is used to obtain the graph features of the target subgraph data, and use the target attributes as training labels to perform decision tree training based on the graph features to obtain a reference decision tree; A rule extraction module is used to trace back from each leaf node in the reference decision tree to the root node to obtain a backtracking path, and to combine the discrimination conditions corresponding to each non-leaf node in the backtracking path to obtain a predecessor of the target association rule corresponding to the leaf node, and to use the target attribute value of the leaf node as the successor of the target association rule corresponding to the leaf node.
6. A computer device, characterized in that: The computer device includes a processor and a memory, wherein the memory stores a computer program that can be run on the processor, and when the processor runs the computer program, the graph association rule mining method according to any one of claims 1 to 4 is implemented.
7. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the graph association rule mining method according to any one of claims 1 to 4 is implemented.
Citation Information
Patent Citations
Rule presentation method, storage medium, and rule presentation apparatus
CN111915009A