Prediction rule generation method and apparatus based on attribute graph data, device, and medium

By extracting double-star data from attribute graph data and constructing predicate combinations, calculating support and confidence, filtering and fusing target predicate combinations, the problem of difficult to efficiently discover high-quality prediction rules in the existing technology is solved, and the effect of improving the accuracy and efficiency of the recommendation model is achieved.

WO2025043792A1PCT designated stage expired Publication Date: 2025-03-06SHENZHEN INST OF COMPUTING SCI
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2023/120531
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-08-30
Filing Date
2023-09-22
Publication Date
2025-03-06

AI Technical Summary

Technical Problem

The prior art is difficult to efficiently discover high-quality prediction rules from attribute graph data, resulting in low accuracy of recommendation models and existing algorithms with scalability problems in resource and time.

Method used

By extracting double-star data from the attribute graph data, constructing predicates based on the preset recommendation model, calculating the support and confidence of candidate predicates combinations, filtering out the target predicates that meet the preset conditions, and fusing them with the recommendation model predicates to optimize the prediction rules.

Benefits of technology

It realizes efficient discovery of high-quality prediction rules, improves the accuracy of the recommendation model, reduces the number of fake positive and fake negative samples, and improves the efficiency of rule discovery.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2023120531_06032025_PF_FP_ABST
    Figure CN2023120531_06032025_PF_FP_ABST
Patent Text Reader

Abstract

The present application is applicable to the technical field of graph data analysis, and in particular to a prediction rule generation method and apparatus based on attribute graph data, a device, and a medium. The method comprises: extracting double-star data from attribute graph data, performing predicate construction on a first attribute node in each first node path and a second attribute node in each second node path in the double-star data, constructing at least one candidate predicate combination on the basis of at least one candidate logic predicate obtained by construction, constructing a recommendation model predicate on the basis of a preset recommendation model, calculating the support and confidence of the double-star data in the attribute graph data to select a target predicate combination, and fusing the target predicate combination with the recommendation model predicate to obtain a prediction rule. By analyzing the double-star data, logic predicates representing the attribute relationship between the data are obtained, the logic predicates are combined and screened on the basis of the support and confidence, and the recommendation result error is optimized using the selected predicate combination when the recommendation model is in use, improving the accuracy of the recommendation model.
Need to check novelty before this filing date? Find Prior Art

Description

Method, device, equipment and medium for generating prediction rules based on attribute graph data

[0001] This application is based on the Chinese invention application with application number 202311126211.5 filed on August 30, 2023, and entitled “Method, device, equipment and medium for generating prediction rules based on attribute graph data”, and claims its priority. Technical Field

[0002] The present application is applicable to the field of graph data analysis technology, and in particular relates to a method, device, equipment and medium for generating prediction rules based on attribute graph data. Background Art

[0003] Recommender systems have been expertly applied in various applications, including e-commerce, news, music, and video. Existing recommendation system algorithms include collaborative filtering (CF), content-based recommendations (CB), and hybrid models. Graph prediction rules can be used to improve the accuracy of recommendation system models and reduce the number of false positives (FPs) and false negatives (FNs).

[0004] Currently, many rules are manually developed by domain experts based on their experience, which is not only extremely costly but also suffers from low accuracy and poor consistency. When it comes to discovering rules from graph data, most existing work focuses on discovering rules with limited expressiveness, only able to discover rules that have graph patterns but not logical conditions. To discover graph prediction rules that combine graph patterns and logical conditions, a level-wise discovery algorithm can be used. This algorithm decomposes the discovery process into vertical expansion and horizontal expansion. The vertical expansion process generates a graph pattern with n edges by adding an edge to a graph pattern with n-1 edges. The horizontal expansion process maintains a predicate spanning tree for each graph pattern and continuously adds predicate constraints to the spanning tree to find graph prediction rules that meet the conditions. Based on this, an application-driven graph filtering strategy is employed to select relevant predicates. A sampling method is used to generate a small sample of data from the graph data, achieving a balance between accuracy and efficiency. The level-wise discovery algorithm is then used to generate rules from this sample. However, the above algorithm has low discovery efficiency and cannot discover large-scale graph prediction rules within a reasonable time. Furthermore, it requires discovering rules in a Resource Description Framework (RDF) graph, which is unsuitable for commonly used attribute graphs. Converting attribute graphs to RDF graphs results in a large number of RDF triples in their node attributes, resulting in poor scalability when discovering rules in these RDF graphs. Consequently, it is unable to effectively discover rules that can be used to improve the accuracy of machine learning recommendation models. Therefore, how to efficiently discover high-quality prediction rules to improve the accuracy of existing recommendation models has become an urgent problem to be solved.

[0005] Summary of the Invention

[0006] The embodiments of the present application provide a method, apparatus, device, and medium for generating prediction rules based on attribute graph data to solve the problem of how to efficiently discover high-quality prediction rules for improving the accuracy of existing recommendation models.

[0007] A prediction rule generation method based on attribute graph data, the prediction rule generation method comprising:

[0008] Extracting double star data from attribute graph data, the double star data including first-category nodes and at least one first node path connecting the first-category nodes, and second-category nodes and at least one second node path connecting the second-category nodes, wherein the first-category nodes and the second-category nodes are of different node categories, and nodes on any two node paths do not intersect;

[0009] Based on a preset recommendation model, a recommendation model predicate is constructed. Based on a preset predicate formula, a predicate is constructed for a first attribute node in each first node path and a second attribute node in each second node path to obtain at least one candidate logical predicate, where the first attribute node and the second attribute node have the same attribute.

[0010] constructing at least one candidate predicate combination based on the at least one candidate logical predicate, and for any candidate predicate combination, calculating the support and confidence of the candidate predicate combination in the attribute graph data in combination with the recommendation model predicate;

[0011] Determine the candidate predicate combination whose support and confidence both meet preset conditions as the target predicate combination, fuse each target predicate combination with the recommendation model predicate respectively, and obtain the fusion result as the prediction rule for optimizing the recommendation model.

[0012] A prediction rule generation device based on attribute graph data, the prediction rule generation device comprising:

[0013] a pattern data generation module, configured to extract double star data from attribute graph data, the double star data comprising first-category nodes and at least one first node path connecting the first-category nodes, and second-category nodes and at least one second node path connecting the second-category nodes, wherein the first-category nodes and the second-category nodes are of different node categories, and nodes on any two node paths do not intersect;

[0014] a predicate construction module, configured to construct a recommendation model predicate based on a preset recommendation model, and to perform predicate construction on a first attribute node in each first node path and a second attribute node in each second node path based on a preset predicate formula, to obtain at least one candidate logical predicate, wherein the first attribute node and the second attribute node have the same attribute;

[0015] an indicator calculation module, configured to construct at least one candidate predicate combination based on the at least one candidate logical predicate, and for any candidate predicate combination, calculate the support and confidence of the candidate predicate combination in the attribute graph data in combination with the recommendation model predicate;

[0016] The prediction rule determination module is used to determine the candidate predicate combinations whose support and confidence both meet preset conditions as target predicate combinations, and fuse each target predicate combination with the recommendation model predicate to obtain the fusion result as the prediction rule for optimizing the recommendation model.

[0017] A computer device includes a memory, a processor, and a readable storage medium stored in the memory and executable on the processor, wherein the processor implements the following steps when executing the readable storage medium:

[0018] Extracting double star data from attribute graph data, the double star data including first-category nodes and at least one first node path connecting the first-category nodes, and second-category nodes and at least one second node path connecting the second-category nodes, wherein the first-category nodes and the second-category nodes are of different node categories, and nodes on any two node paths do not intersect;

[0019] Based on a preset recommendation model, a recommendation model predicate is constructed. Based on a preset predicate formula, a predicate is constructed for a first attribute node in each first node path and a second attribute node in each second node path to obtain at least one candidate logical predicate, where the first attribute node and the second attribute node have the same attribute.

[0020] constructing at least one candidate predicate combination based on the at least one candidate logical predicate, and for any candidate predicate combination, calculating the support and confidence of the candidate predicate combination in the attribute graph data in combination with the recommendation model predicate;

[0021] Determine the candidate predicate combination whose support and confidence both meet preset conditions as the target predicate combination, fuse each target predicate combination with the recommendation model predicate respectively, and obtain the fusion result as the prediction rule for optimizing the recommendation model.

[0022] One or more computer-readable storage media storing computer-readable instructions, wherein the computer-readable instructions, when executed by one or more processors, cause the one or more processors to perform the following steps:

[0023] Extracting double star data from attribute graph data, the double star data including first-category nodes and at least one first node path connecting the first-category nodes, and second-category nodes and at least one second node path connecting the second-category nodes, wherein the first-category nodes and the second-category nodes are of different node categories, and nodes on any two node paths do not intersect;

[0024] Based on a preset recommendation model, a recommendation model predicate is constructed. Based on a preset predicate formula, a predicate is constructed for a first attribute node in each first node path and a second attribute node in each second node path to obtain at least one candidate logical predicate, where the first attribute node and the second attribute node have the same attribute.

[0025] constructing at least one candidate predicate combination based on the at least one candidate logical predicate, and for any candidate predicate combination, calculating the support and confidence of the candidate predicate combination in the attribute graph data in combination with the recommendation model predicate;

[0026] Determine the candidate predicate combination whose support and confidence both meet preset conditions as the target predicate combination, fuse each target predicate combination with the recommendation model predicate respectively, and obtain the fusion result as the prediction rule for optimizing the recommendation model.

[0027] The present application extracts a pair of star data from a property graph data, constructs a recommendation model predicate based on a preset recommendation model, performs predicate construction on the first attribute node in each first node path and the second attribute node in each second node path in the star data based on a preset predicate formula, obtains at least one candidate logical predicate, constructs at least one candidate predicate combination based on the at least one candidate logical predicate, calculates the support and confidence of the candidate predicate combination in the property graph data for any candidate predicate combination, and determines a candidate predicate whose support and confidence both meet the preset conditions. The combination is a target predicate combination, and each target predicate combination is fused with the recommendation model predicate respectively. The fusion result is the prediction rule for optimizing the recommendation model. By analyzing the extracted double-star data to form logical predicates that characterize the attribute relationship between the data, the association relationship between the attributes can be effectively discovered. The logical predicates are combined and screened in combination with the support and confidence to obtain the optimized predicate combination, that is, the accurate association relationship, and combined with the recommendation logic of the recommendation model to obtain high-quality prediction rules, so that the positive and negative errors of the recommendation results are optimized when the recommendation model is used, thereby improving the accuracy of the recommendation model. BRIEF DESCRIPTION OF THE DRAWINGS

[0028] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following briefly introduces the drawings required for use in the description of the embodiments of the present application. 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.

[0029] FIG1 is a schematic diagram of an application environment of a method for generating prediction rules based on attribute graph data provided in Example 1 of the present application;

[0030] FIG2 is a flow chart of a method for generating prediction rules based on attribute graph data according to a second embodiment of the present application;

[0031] FIG3 is a flow chart of a method for generating prediction rules based on attribute graph data provided in Example 3 of the present application;

[0032] FIG4 is a flow chart of a method for generating prediction rules based on attribute graph data according to a fourth embodiment of the present application;

[0033] FIG5 is a flowchart of a method for generating prediction rules based on attribute graph data provided in Example 5 of the present application;

[0034] FIG6 is a flowchart of a method for generating prediction rules based on attribute graph data provided in Example 6 of the present application;

[0035] FIG7 is a flow chart of a method for generating prediction rules based on attribute graph data according to a seventh embodiment of the present application;

[0036] FIG8 is a schematic diagram of the structure of a prediction rule generating device based on attribute graph data provided in Example 8 of the present application;

[0037] FIG9 is a schematic structural diagram of a computer device provided in Example 9 of the present application. DETAILED DESCRIPTION

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

[0039] In order to illustrate the technical solution of the present application, specific embodiments are provided below.

[0040] The first embodiment of the present application provides a prediction rule generation method based on attribute graph data, which can be applied in an application environment such as Figure 1, wherein a server communicates with a database. The server includes but is not limited to a PDA, a desktop computer, a laptop computer, an ultra-mobile personal computer (UMPC), a netbook, a cloud computing device, a personal digital assistant (PDA), and other computer devices. The database can be implemented using a standalone server or a server cluster consisting of multiple servers.

[0041] See Figure 2, which is a flow chart of a method for generating prediction rules based on attribute graph data, provided in Example 2 of this application. The above-mentioned method for generating prediction rules based on attribute graph data is applied to the server in Figure 1. The server is connected to a database to obtain attribute graph data stored in the database. In addition, the recommendation model is a model running on the server or in a server connected to the server. In this application, the server uses the recommendation logic corresponding to the recommendation model. As shown in Figure 2, the method for generating prediction rules based on attribute graph data can include the following steps:

[0042] Step S201: extracting a pair of star data from an attribute graph data.

[0043] In the present application, the double star data includes a first type of node and at least one first node path connecting the first type of node, and a second type of node and at least one second node path connecting the second type of node. The first type of node and the second type of node are different node categories, and the nodes on any two node paths do not intersect.

[0044] The double star data is a set of data generated from the attribute data graph based on the double star graph pattern. The data consists of nodes and corresponding labels, attributes and other information. The node path ρ is defined as a list of nodes (x1,…,x i ,…,x s ), x i is the i-th node on the path, (x i ,l i ,x i+1 ) is an edge with label l, so a star graph S x is a set of node paths (ρ1,…,ρ j ,…,ρ k ), each node path ρ j The starting point is node x. x In the two node paths, there is no common node except node x, that is, other nodes except node x will only appear once in a node path. In this case, define node x as a star graph S x The center point of the node is defined as the leaf node, and the node without outgoing edges (that is, the last node in the node path) is defined as the leaf node, thus forming a "star" shaped data.

[0045] Double star data includes two star graphs mentioned above, with star graph S x and star graph S y For example, where S y The center point of is node y. Nodes x and y are two different types of nodes. Therefore, the node paths belonging to the two nodes x and y do not intersect. For example, node x can be a user node, representing a user, and node y can be an item node, representing an item.

[0046] The double star diagram pattern can be defined as Among them, V Q is the set of nodes in the pattern, E Q is the set of edges in the pattern, L Q are the labels of the nodes and edges in the pattern; is a list of variables, μa will be mapped to V Q The bijective function of x and y is Two specified variables in it are the central points of two star graphs respectively. For example, x represents the user and y represents the item. By collecting the node paths and characterizing the relevant features in the double-star graph pattern, finally, it is predicted whether the user x likes the item y according to the double-star graph pattern.

[0047] To obtain the double-star data from the property graph data for the above double-star graph pattern, two stages of encoding and generation are required, and it is defined that the two stages are implemented by the corresponding map pattern generator (i.e., the GenQ module). Assume three countably infinite symbol sets, denoted as Γ, Υ, and U respectively, representing labels, attributes, and constants respectively.

[0048] In the encoding stage, each double-star graph pattern can be mapped to a sequence on Γ∪Υ∪{#, *}, where # and * are two new labels not in Γ∪Υ (i.e., they cannot be repeated with the labels in Γ∪Υ) and are used to represent the edges between nodes in the encoding and to distinguish the two star graphs in the encoding.

[0049] Using the lexicographic order to define the partial order relation of Γ∪Υ on the sequence, the double-star graph pattern is encoded as ρ1#...ρ i #...ρ s #*ξ1#...ξ i #...ξ t #* sequence, where ρ i is the encoding of the node path from node x to the leaf node, ξ i is the encoding of the node path from node y to the leaf node, and there does not exist a sequence ρ1'#...ρ i '#...ρ s '# and ξ1'#...ξ i '#...ξ t '# that satisfies ρ1#...ρ i #...ρ s # is lexicographically greater than or equal to ρ1'#...ρ i '#...ρ s '# and ξ1#...ξ i #...ξ t # is lexicographically greater than or equal to ξ1'#...ξ i '#...ξ t '#.

[0050] Among them, for ρ i or ξ i if one of the nodes is x and the label is denoted as L(x), where the node attributes are A1, A2,..., A n , then the encoding of node x is L(x)A1, A2,..., A n , for node xi The edge with label l between nodes is encoded as (x i ,l i ,x i+1 ), where x i and x i+1 All are represented by corresponding codes.

[0051] During the generation phase, the GenQ module uses a long short-term memory (LSTM) network to generate the encoding sequence until it encounters the end symbol "*." In each generation round, an upper limit α is set on the number of nodes in the binary star data. Therefore, the maximum length of the encoding sequence generated by the GenQ module is (α-2)(4+2|Y|)+2.

[0052] In order to enable LSTM to generate all possible binary star data and avoid overfitting, given binary star data Q, let p(Q) represent the probability that Q can be generated by LSTM, then, the GenQ module updates and modifies Among them, ω is the hyperparameter during LSTM training, |G| α is the upper bound of the number of binary star data Q with at most α nodes. Then, the probability that each binary star data Q is generated by the GenQ module is at least It can be guaranteed that after a sufficient number of rounds, the GenQ module can generate all binary star data that meet the given requirements with a high probability.

[0053] Step S202: construct a recommendation model predicate based on a preset recommendation model, and perform predicate construction on the first attribute node in each first node path and the second attribute node in each second node path based on a preset predicate formula to obtain at least one candidate logical predicate.

[0054] In this application, the preset recommendation module can be a model trained based on a training dataset for any recommendation scenario, used to implement target recommendations for that recommendation scenario. The training dataset for the recommendation scenario and the aforementioned attribute graph data should be of the same type, so that the discovery of prediction rules by this application can better correct the corresponding recommendation model. The recommendation model can be a CF model, a CB model, or a hybrid model, etc.

[0055] For example, if the recommendation model is to recommend items to users, the double star data generated in the above attribute graph data should be user star data and item star data, so that the rules in the attribute graph data can be discovered, thereby forming prediction rules for correcting the recommendation model.

[0056] The recommendation model predicate can refer to the predicate representation constructed based on the recommendation logic of the model. The predicate representation expresses the recommendation logic in the form of formula encoding. For example, the predicate representation of the recommendation model is as follows:

[0057] Where, For operators ≥ or <, δ∈[0,1], M(x,y) represents the return value corresponding to the probability of recommending y to x. The return value of the recommendation model is a number between [0,1]. Therefore, the recommendation model predicate can be M(x,y)≥δ, and its opposite logical predicate is M(x,y)<δ. Alternatively, the recommendation model predicate can be M(x,y)<δ, and its opposite logical predicate is M(x,y)≥δ. When the operator is other, it can be adjusted accordingly.

[0058] The preset predicate formula is a predicate expression formula set based on actual needs and the recommendation logic of the recommendation model, and can include components such as constant predicates and variable predicates. The preset predicate formula is used to express the logic between some attributes in the binary star data in the form of formula coding. Specifically, the first attribute node in each first node path and the second attribute node in each second node path are logically expressed to obtain the corresponding candidate logical predicate. The first attribute node and the second attribute node can be any node on the corresponding node path. The first attribute node and the second attribute node have the same attributes, making them comparable.

[0059] For example, the preset predicate formula is as follows:

[0060] Where, is a variable predicate, is a constant predicate, variables z1, z2, c is a constant value, and A and B are the attributes of the variable.

[0061] in addition, It can be any one of the operators =, ≠, <, ≤, >, ≥, so that the formed predicate not only supports the semantics of equality, but also supports other common comparison semantics, and has stronger expressive power.

[0062] The attribute value in the constant predicate may be a discrete value attribute or a continuous value attribute. Discrete value attributes correspond to some discrete values, while continuous value attributes are generally continuous values. Assuming that the attribute value xC of a node is a discrete value attribute, an attribute constraint is added for each different value. To the candidate, if xC is a continuous valued attribute and a0<a1<...<a t are all the values ​​of C that appear in the data, with the split point being s i =(ai-1 +a i ) / 2, then for each s i Add two constraints to the candidate: zC≤s i and zC>s i .

[0063] Among them, the variable predicate is used to compare the attribute information of different nodes and to connect two non-intersecting star graph patterns. The constant predicate is to compare the attribute value of the node with the given constant C.

[0064] Furthermore, the above variable predicates are limited Only defined in On the two leaf nodes x1 and y1, each leaf node can carry at most one variable predicate, that is, the variable predicate is only used to "link" the corresponding double star graph data to compare the attributes of the associated leaf nodes. The above limitation can achieve a balance between complexity and expressiveness.

[0065] Step S203: construct at least one candidate predicate combination based on at least one candidate logical predicate, and for any candidate predicate combination, calculate the support and confidence of the candidate predicate combination in the attribute graph data in combination with the recommendation model predicate.

[0066] In this application, for the prediction rules to be generated, there are two evaluation indicators, namely support and confidence. Therefore, it is necessary to calculate the credibility of the corresponding prediction rules for the constructed candidate predicate combination (part of the prediction rule) under the drive of the recommendation model predicate (part of the prediction rule) corresponding to the recommendation model, so as to find prediction rules with higher support and confidence, which can be used to improve the accuracy of the recommendation model.

[0067] Support can be used to measure the frequency with which a candidate predicate combination and a recommendation model predicate combination (i.e., prediction rules) can be applied in attribute graph data. Confidence can be used to measure the strength of the association between a candidate predicate combination and a recommendation model, that is, the accuracy that can be achieved when applying the candidate predicate combination and the recommendation model predicate combination for recommendation prediction.

[0068] A candidate predicate combination is a predicate combination consisting of at least one logical predicate. The purpose of this process is to facilitate the discovery of high-quality prediction rules. Recommendation model predicates can be used to find datasets in the property graph that can be processed by the recommendation model, ensuring that the candidate predicate combination can be executed in a limited direction.

[0069] Step S202 and step S203 can be executed in a predicate generator (i.e., GenX module), which is equipped with functions such as predicate construction, predicate combination, and predicate screening, and is connected to the above-mentioned GenQ module to realize the discovery of predicate combinations for constructing prediction rules.

[0070] Based on the definition in the above example, for the prediction rule (TIE), a can be expressed as:

[0071] in, It is a pair of star data in the double star diagram mode, X is A set of predicate combinations in , wherein the set of predicate combinations includes at least one logical predicate.

[0072] In one embodiment, calculating the support and confidence of a candidate predicate combination in property graph data includes:

[0073] Determine a third matching result from the attribute graph data that satisfies the candidate predicate combination and the recommendation model predicate, and determine a fourth matching result from the attribute graph data that satisfies the recommendation model predicate;

[0074] Calculate the support degree according to the intersection of the third matching result and the fourth matching result;

[0075] A fifth matching result that satisfies a logical predicate that is opposed to the recommendation model predicate is determined from the attribute graph data, and a confidence level is obtained based on the intersection of the union of the fourth matching result and the fifth matching result and the third matching result in combination with the support level.

[0076] Among them, if a And a property graph data G, with express For all (v,u) recommended in G, it is required that (v,u) in G satisfies all logical predicates and recommendation model predicates in X.

[0077] The training dataset Γ used by the recommendation model during training is the (v,u) entity pairs in G, where the positive sample is the (v,u) with interaction records in G, and the negative sample is the (v,u) without interaction records in G. Therefore, the support can be expressed as as follows:

[0078] in, is the third matching result, (v,u)|(v,likes,u)∈Γ is the fourth matching result, the support is anti-monotonic. If the prediction rule has a partial order relationship, and If Q is a subgraph of Q′, and all predicates in X are contained in X′, then

[0079] The confidence can be expressed as as follows:

[0080] Among them, (v,u)|(v,unlikes,u)∈Γ is the fifth matching result, τ is likes or unlikes, and prediction rules with high confidence help reduce FPs and FNs of the recommendation model.

[0081] Step S204 , determining candidate predicate combinations whose support and confidence satisfy preset conditions as target predicate combinations, fusing each target predicate combination with the recommendation model predicates, and obtaining the fusion results as prediction rules for the optimized recommendation model.

[0082] In this application, if both the support and confidence levels meet the preset conditions, the corresponding candidate predicate combination can be determined to be the target predicate combination ultimately discovered. The target predicate combination that meets the preset conditions may be one or more. In actual use, the number of target predicate combinations is determined based on the required settings. Furthermore, if only one target predicate combination is selected, the support and confidence levels of all target predicate combinations that meet the preset conditions can be compared, and the target predicate combination with the highest support and confidence level can be retained.

[0083] The preset condition can be a preset threshold, the support corresponds to a preset support threshold, and the confidence corresponds to a preset confidence threshold. If the support is greater than the preset support threshold, the support meets the preset condition; if the confidence is greater than the preset confidence threshold, the confidence meets the preset condition.

[0084] The target predicate combination is fused with the recommendation model predicate of the above-mentioned recommendation model, and the fusion result is the final prediction rule. The prediction rule is an optimization of the recommendation rule of the recommendation model. If the direction of the recommendation model predicate is the recommendation direction, the prediction rule after adding the target predicate combination can further limit the recommended rule to reduce the situation of misjudgment as recommendation. If the direction of the recommendation model predicate is the non-recommendation direction, the prediction rule after adding the target predicate combination can supplement the recommendation within the scope limited by the non-recommended rule to reduce the situation of misjudgment as non-recommendation.

[0085] Taking the encoding method defined above as an example, for is a preset rule, where M(x,y)≥δ is the recommendation model predicate and X is a combination of logical predicates. When the recommendation model recommends item y to user x (i.e., M(x,y)≥δ), the logical condition X is added to filter FPs (i.e., re-screening the recommendation model's recommendations to correct incorrect predictions of the original recommendations). In other words, item y will be recommended to user x only when both M(x,y)≥δ and X hold.

[0086] For example, for is a prediction rule, where M(x,y)<δ is the recommendation model predicate and X is a combination of logical predicates. When the recommendation model does not recommend item y to user x (i.e., M(x,y)<δ), but the additional logical condition X is met, item y will still be recommended to user x. This rule helps reduce the FNs of the recommendation model (i.e., supplementing the recommendation model's recommendations can correct the original erroneous prediction of not recommending).

[0087] For example, consider users and theater tickets. Users correspond to x, and theater tickets correspond to y. The GenQ module uses LSTM to discover and encode binary star data from the node paths of user nodes and item nodes (such as theater tickets) in the attribute graph data G. For example, the encoding of binary star data is expressed as "user, book, flight ticket, destination#user, buy, theater ticket, genre#*theater ticket, location, city, name#theater ticket, of, genre, name#*," where user is the central node x and theater ticket is the central node y. "book" and "buy" can be represented as edges, connecting the user node with the flight ticket node or the theater ticket node. "destination," "genre," and "name" correspond to the attribute information of the nodes, and each attribute information can be associated with an attribute value.

[0088] If the recommendation model predicate is M(x,y)≥0.7, the prediction rule is to reduce the FPs of the recommendation model. Based on the above double star data, a candidate predicate combination is constructed. First, a candidate predicate combination containing all variable predicates and constant predicates needs to be constructed, such as x1.destination=y1.name、x1.destination≠y1.name、x2.genre=y2.name、x2.genre≠y2.name、 Where LA is the attribute value of destination in G, and History is the attribute value of genre in G. Then, calculate the Gini index of all these logical predicates and select the smallest one as the first predicate to be selected. Suppose x1.destination = y1.name. Based on this, continue to add a logical predicate and calculate the Gini index. Select the one with the smallest Gini index to form the predicate combination X of x1.destination = y1.name ∧ x2.genre = y2.name. This predicate combination X satisfies support and confidence. This predicate combination X is combined with M(x, y) ≥ 0.7 to form a TIE as follows:

[0089] X:x1.destination=y1.name∧x2.genre=y2.name

[0090] The explanation for the above scenario is as follows: although user x has purchased tickets for a live theater before, if user x has booked a flight to a city different from the performance venue, or the performance does not match the user's purchase history preference information, the upcoming performance ticket y cannot be recommended to user x. The recommendation model ignores this context-aware feature and may produce incorrect recommendations with a high probability, generating FPs.

[0091] The embodiment of the present application extracts a pair of star data from an attribute graph data, constructs a recommendation model predicate based on a preset recommendation model, performs predicate construction on the first attribute node in each first node path and the second attribute node in each second node path in the double star data based on a preset predicate formula, obtains at least one candidate logical predicate, constructs at least one candidate predicate combination based on the at least one candidate logical predicate, calculates the support and confidence of the candidate predicate combination in the attribute graph data for any candidate predicate combination, and determines a candidate predicate whose support and confidence both meet the preset conditions. The word combination is the target predicate combination, and each target predicate combination is fused with the recommendation model predicate respectively, and the fusion result is the prediction rule for optimizing the recommendation model. By analyzing the extracted double-star data, logical predicates that characterize the attribute relationship between data are formed, which can effectively discover the association relationship between attributes. The logical predicates are combined and screened in combination with support and confidence to obtain the optimized predicate combination, that is, the accurate association relationship, and combined with the recommendation logic of the recommendation model to obtain high-quality prediction rules, so that the positive and negative errors of the recommendation results are optimized when the recommendation model is used, thereby improving the accuracy of the recommendation model.

[0092] See Figure 3, which is a flow chart of a method for generating prediction rules based on attribute graph data provided in Example 3 of the present application. As shown in Figure 3, further improvements to step S203 may include the following steps:

[0093] Step S301 : Calculate the Gini index of each candidate logical predicate based on the first matching result that satisfies each candidate logical predicate in the attribute graph data, and use the candidate logical predicate with the smallest Gini index as the initial predicate combination.

[0094] In this application, before constructing a candidate predicate combination, it is necessary to determine the effect that each candidate logical predicate can achieve when used as a logical constraint. The effect is determined by the Gini index, which is an effective standard for measuring the extent to which a predicate divides a set of data into different categories.

[0095] In the attribute graph data, data matching is performed based on each candidate logical predicate. The data matching is to generate corresponding double star data and determine whether the double star data satisfies the corresponding candidate logical predicate. All matching results are used to calculate the Gini index of the candidate logical predicate.

[0096] Step S302 : Taking the initial predicate combination as a candidate predicate combination, and calculating the support and confidence of the candidate predicate combination in the attribute graph data based on the candidate predicate combination and the recommendation model predicates.

[0097] In this application, during this round of screening, the candidate logical predicate with the smallest Gini index is selected. This candidate logical predicate is then combined with the recommendation model predicate to calculate the support and confidence of the candidate logical predicate in the attribute graph data. Steps S301 and S302 can be performed in the GenX module provided in step S203 above.

[0098] In the embodiment of the present application, the GenX module uses the Gini index to select logical predicates in the predicate generation stage, thereby pruning and screening candidate predicate combinations, reducing the level-wise search space, and improving the efficiency of prediction rule discovery.

[0099] See Figure 4, which is a flowchart of a method for generating prediction rules based on attribute graph data provided in Example 4 of the present application. As shown in Figure 4, after step S302 above, the prediction rule generation method further includes the following steps:

[0100] Step S401 , detecting whether both the support and the confidence meet the preset conditions. If it is detected that the support or the confidence does not meet the preset conditions, then adding another logical predicate to the initial predicate combination to obtain an updated predicate combination.

[0101] In this application, other logical predicates are any logical predicates in at least one candidate logical predicate that do not appear in the initial predicate combination, that is, if the support and confidence of the above candidate predicate combination in the attribute graph data do not meet expectations, it is necessary to seek a new candidate predicate combination.

[0102] Add other logical predicates that do not belong to the original initial predicate combination into the initial predicate combination to form a new predicate combination. If there are n other logical predicates, add them one by one to the initial predicate combination, and the number of updated predicate combinations formed is also n.

[0103] Step S402 : Calculate the Gini index of each updated predicate combination, select the updated predicate combination with the smallest Gini index from all updated predicate combinations, and use the updated predicate combination as the initial predicate combination.

[0104] In this application, the Gini index of each updated predicate combination is calculated to prune the updated predicate combination, thereby improving the efficiency of screening predicate combinations. At this time, the calculation of the Gini index for the updated predicate combination can refer to the calculation method in step S301 above. Of course, to reduce the amount of calculation and reduce resource usage, the calculation of the Gini index can be performed based on the processing results of the initial predicate combination. For details, please refer to the content of the following embodiment 5.

[0105] Step S403, returning to the step of taking the initial predicate combination as a candidate predicate combination, and calculating the support and confidence of the candidate predicate combination in the attribute graph data according to the candidate predicate combination and the recommendation model predicate, until it is detected that both the support and the confidence meet the preset conditions or the iteration reaches the preset number of times.

[0106] In the present application, candidate predicate combinations are constructed cyclically, and support and confidence are calculated, so that candidate predicate combinations can be continuously screened to obtain required candidate predicate combinations that meet certain conditions.

[0107] During the loop, more than one candidate predicate combination can be generated whose support and confidence meet the preset conditions, thereby obtaining high-quality or even higher-quality prediction rules in certain situations. For example, in the first round, a predicate combination X1 with support and confidence meeting the preset conditions was found. To obtain a higher-quality predicate combination, a second round of operations was performed, adding p1 to predicate combination X1 to form a new predicate combination X1+p1. If the support and confidence of X1+p1 meet the preset conditions, the predicate combination X2=X1+p1 was found.

[0108] This process can be used to train the GenQ module, which is based on the LSTM model. The parameters in the LSTM model require training using the corresponding training set. Specifically, after each round, the GenX module returns high-quality predicate combinations that meet preset conditions to the GenQ module. The GenQ module uses this high-quality predicate combination to continue training the LSTM model, ensuring that it generates even higher-quality predicate combinations in the next round.

[0109] The training of the above GenQ module is as follows:

[0110] Input: attribute graph data G, training dataset Γ, number of iterations I, recommendation model, preset support threshold r1, preset confidence threshold r2, number of nodes in binary star data α.

[0111] Output: At least one Requirement Req(r1,r2,α) is and There are at most α nodes in .

[0112] Using the solution of Example 4 above, iterative training is performed, with the GenQ module and the GenX module working alternately. In each round, the GenQ module first trains an LSTM model to generate binary star data Q and the important attributes of each node in Q. Then, the GenX module constructs candidate predicate combinations from the important attributes selected by the GenQ module. From these predicate combinations, it selects and generates predicate combinations X related to Q, which are combined with Q to generate sets of TIEs. At the end of each iteration, the GenX module evaluates the quality of the generated sets of TIEs using support and confidence. High-quality sets of TIEs that meet a threshold are retained and fed back to the GenQ module. The GenQ module updates the LSTM parameters for optimization, generating more high-quality sets of TIEs in subsequent rounds until the number of iterations reaches 1. Using a feedback method, the GenX module returns high-quality sets of TIEs to the GenQ module to guide its LSTM parameter adjustments, enabling it to generate more high-quality binary star data in the next round.

[0113] After a sufficient number of rounds, it is possible to find all predicate combinations that meet the given requirements with a high probability. The GenQ module can generate all possible binary star data, while the GenX module can check all predicate combinations under the condition Req(r1,r2,α). Given a graph G and a training data set Γ, when given the requirement Req(r1,r2,α) and a constant ξ∈(0,1), if there exists a set Σ that meets Req(r1,r2,α) T , then after I rounds, the GenX module has at least 1-∈ probability of finding the set ΣT Based on this, the bound of the number of iterations I can be derived based on the Chernoff bound, and the deduction formula is as follows:

[0114] Where k and ω are two hyperparameters of the GenQ module.

[0115] 5 is a flowchart of a method for generating prediction rules based on attribute graph data according to a fifth embodiment of the present application. As shown in FIG5 , the process of calculating the Gini index of each updated predicate combination in step S402 may include the following steps:

[0116] Step S501: Obtain a second matching result that satisfies the initial predicate combination in the property graph data.

[0117] In the present application, the matching result of the initial predicate combination has been executed in the previous step. For example, when the initial predicate combination is any one of the candidate logical predicates in step S301, the updated predicate combination at this time is to add other logical predicates on the basis of any one of the candidate logical predicates. When calculating the updated predicate combination, any one of the candidate logical predicates has been matched and there is a corresponding matching result. The matching result can be retained for use in subsequent processing.

[0118] Step S502 : For any updated predicate combination, determine from the second matching results the first data that satisfies the updated predicate combination and the second data that does not satisfy the updated predicate combination.

[0119] Step S503 : Calculate the Gini index of the corresponding updated predicate combination according to the second matching result, the first data, and the second data.

[0120] In the present application, the calculation of the Gini index of the updated predicate combination can be obtained based on the above-mentioned second matching result. Specifically, it is necessary to obtain the data in the second matching result that meets and does not meet the updated predicate combination, and combine it with the corresponding calculation formula to obtain the Gini index of the updated predicate combination.

[0121] For example, if we want to add a new predicate p to the existing X (i.e., the initial predicate combination), the formula for calculating the Gini index is as follows: Gini_index(X,p)=|D1|Gini(D1) / |D|+|D2|Gini(D2) / |D|

[0122] Where D is all matching results that satisfy X in the attribute graph data, D1 is all results in D that satisfy X∧p, and D2 is all results in D that do not satisfy X∧p. The classification effect after adding the p constraint to X shows that a predicate p with a smaller Gini index can better distinguish positive and negative samples.

[0123] The embodiment of the present application performs the calculation of the Gini index based on the existing matching results, thereby avoiding re-matching of all updated predicate combinations, reducing the amount of matching resources occupied, and improving the efficiency of the operation.

[0124] Based on this, each time GenX runs on the existing X, it selects the predicate p with the smallest Gini index to form a new predicate combination. This allows us to quickly find multiple predicate combinations that, combined with the pattern, form new high-quality TIEs, reducing both FPs and FNs. Furthermore, this ensures that our TIEs have as few predicates as possible, making them easier to interpret.

[0125] See Figure 6, which is a flowchart of a method for generating prediction rules based on attribute graph data according to Example 6 of this application. As shown in Figure 6, in one implementation of step S203 in Example 2, the process of determining a third matching result from the attribute graph data that satisfies the candidate predicate combination and the recommendation model predicate may include the following steps:

[0126] Step S601 : determining node pairs consisting of first-category nodes and second-category nodes that satisfy candidate predicate combinations and recommendation model predicates from the attribute graph data, and determining double-star data corresponding to each node pair.

[0127] In this application, for candidate predicate combinations and recommendation model predicates, node pairs formed by first-class nodes and second-class nodes that satisfy both can be determined in the attribute graph data. The first-class node pairs correspond to their own star data, and the second-class node pairs correspond to their own star data, thereby forming double star data corresponding to the node pairs.

[0128] In this process, the GenQ module described in the above embodiment is required to generate corresponding dual-star data. Subsequently, it is determined whether each dual-star data satisfies the above candidate predicate combination and recommended model predicate, thereby determining the satisfied dual-star data.

[0129] Step S602 : compress and represent the double star data corresponding to each node pair to obtain a compressed representation result, and determine the double star data that is not an empty set in the compressed representation result as the third matching result.

[0130] In this application, compressed representation is achieved by merging all matching results for any node in any binary star data, excluding the first and second types of nodes. If any node is an empty set, the compressed representation of the corresponding binary star data is determined to be an empty set. Using compressed representation can reduce the storage capacity of the binary star data, thereby helping to reduce resource waste. At the same time, it helps improve the efficiency of subsequent support and confidence calculations using the third matching result.

[0131] For example, for the double star data in step S201 After predicate discovery, candidate predicate combinations and recommended model predicates are obtained. The matching results in the attribute graph data G are represented as Q[v,u,X], where the match maps x to v and y to u. In addition to the central nodes x and y, there are m nodes in the system. The compressed representation of the matching result Q[v,u,X] can be in the form of m tuples, where the m tuples are (C(x1),...,C(x i ),...,C(x m )), C(x i ) is one of the elements, C(x i ) can be expressed as:

[0132] C(x i ) stores node x i All matching results, if each C(x i ) are not empty sets, then Q[v,u,X] is not an empty set. Therefore, without calculating every specific matching result, we only need to calculate Q[v,u,X] to calculate the support and confidence, and thus can calculate Q[v,u,X] within O(|Q||G|) time complexity, reducing the calculation time.

[0133] See Figure 7, which is a flowchart of a prediction rule generation method based on attribute graph data provided in Example 7 of the present application. As shown in Figure 7, when it is detected that the candidate predicate combination is obtained by adding a logical predicate to an original predicate combination (i.e., the candidate predicate combination for obtaining the third matching result is obtained by adding a logical predicate), in one implementation of step S203 in Example 2, the process of determining the third matching result from the attribute graph data that satisfies the candidate predicate combination and the recommendation model predicates may include the following steps:

[0134] Step S701: Obtain historical matching results obtained when calculating the corresponding support of the original predicate combination.

[0135] Step S702: Determine in the historical matching results that a matching result that satisfies the added logical predicate is a third matching result.

[0136] In this application, if the support is calculated for the current candidate predicate combination, the current candidate predicate combination is obtained by adding a logical predicate to an original predicate combination. For example, the logical predicate p is added to the original predicate combination X, and the new predicate combination X+p is the current candidate predicate combination.

[0137] Since the original predicate combination and the recommendation model predicates have already been matched in the previous round of calculations, that is, the original predicate combination has a corresponding historical matching result, the data that satisfies the added logical predicate in this historical matching result is the third matching result. There is no need to match the candidate predicate combination in the property graph data, thus reducing the amount of computation. Specifically, during the matching process, the matching result of the node where the added logical predicate is located is first updated. Then, the matching results of all nodes in this node path are propagated and updated along the node path. During each update, it is necessary to check whether each node meets the homomorphic semantic requirements.

[0138] The above process is a dynamic maintenance process. Due to the limitations of the star structure, the newly added node p only affects the matching results of the node path where it is located, and thus affects the matching results of the central node. Through the designed incremental algorithm, the matching results are calculated incrementally based on the historical matching results, without having to recalculate the matching results of all other nodes in the node path, reducing the computational effort.

[0139] Corresponding to the prediction rule generation method based on attribute graph data in the above embodiment, Figure 8 shows a structural block diagram of the prediction rule generation device based on attribute graph data provided in Example 8 of the present application. The above prediction rule generation device is applied to the database in Figure 1. The database can be a database connected to the financial system, wherein the database is used to support the client corresponding to the financial system to perform retrieval to provide corresponding data. The client collects the search corpus provided by the user through the corresponding functional components, and obtains the search results of the corresponding search corpus from the database based on the search corpus. For the sake of convenience, only the parts related to the embodiment of the present application are shown.

[0140] Referring to FIG8 , the prediction rule generating device includes:

[0141] The pattern data generation module 81 is configured to extract double star data from attribute graph data, wherein the double star data includes first-category nodes and at least one first node path connecting the first-category nodes, and second-category nodes and at least one second node path connecting the second-category nodes, wherein the first-category nodes and the second-category nodes are of different node categories, and nodes on any two node paths do not intersect.

[0142] A predicate construction module 82 is configured to construct a recommendation model predicate based on a preset recommendation model, and to perform predicate construction on the first attribute node in each first node path and the second attribute node in each second node path based on a preset predicate formula to obtain at least one candidate logical predicate, wherein the first attribute node and the second attribute node have the same attribute;

[0143] An indicator calculation module 83 is configured to construct at least one candidate predicate combination based on at least one candidate logical predicate, and for any candidate predicate combination, calculate the support and confidence of the candidate predicate combination in the attribute graph data in combination with the recommendation model predicate;

[0144] The prediction rule determination module 84 is used to determine candidate predicate combinations whose support and confidence meet preset conditions as target predicate combinations, and fuse each target predicate combination with the recommendation model predicate to obtain the fusion result as the prediction rule of the optimized recommendation model.

[0145] Optionally, the indicator calculation module 83 includes:

[0146] An index calculation unit, configured to calculate the Gini index of each candidate logical predicate based on the first matching result that satisfies each candidate logical predicate in the attribute graph data, and use the candidate logical predicate with the smallest Gini index as the initial predicate combination;

[0147] The indicator calculation unit is used to use the initial predicate combination as a candidate predicate combination, and calculate the support and confidence of the candidate predicate combination in the attribute graph data according to the candidate predicate combination and the recommendation model predicate.

[0148] Optionally, the prediction rule generating device further includes:

[0149] An indicator detection module is used to calculate the support and confidence of the candidate predicate combination in the attribute graph data based on the candidate predicate combination and the recommendation model predicate, and then detect whether the support and confidence meet the preset conditions. If it is detected that the support or confidence does not meet the preset conditions, then add another logical predicate to the initial predicate combination to obtain an updated predicate combination, where the other logical predicate is any logical predicate in at least one candidate logical predicate that does not appear in the initial predicate combination;

[0150] An update calculation module is used to calculate the Gini index of each updated predicate combination, select the updated predicate combination with the smallest Gini index from all updated predicate combinations, and use the updated predicate combination as the initial predicate combination;

[0151] The return execution module is used to return to the execution of the step of taking the initial predicate combination as a candidate predicate combination, and calculating the support and confidence of the candidate predicate combination in the attribute graph data according to the candidate predicate combination and the recommendation model predicate, until it is detected that the support and confidence both meet the preset conditions or the iteration reaches a preset number of times.

[0152] Optionally, update the calculation module, including:

[0153] A matching result obtaining unit, configured to obtain a second matching result satisfying the initial predicate combination in the attribute graph data;

[0154] a data extraction unit, configured to determine, for any updated predicate combination, from the second matching result, first data satisfying the updated predicate combination and second data not satisfying the updated predicate combination;

[0155] The update index calculation unit is used to calculate the Gini index of the corresponding updated predicate combination according to the second matching result, the first data and the second data.

[0156] Optionally, the indicator calculation module 83 includes:

[0157] a matching result determining unit, configured to determine, from the attribute graph data, a third matching result that satisfies the candidate predicate combination and the recommendation model predicate, and to determine, from the attribute graph data, a fourth matching result that satisfies the recommendation model predicate;

[0158] a support calculation unit, configured to calculate the support according to the intersection of the third matching result and the fourth matching result;

[0159] The confidence calculation unit is used to determine the fifth matching result that satisfies the logical predicate that is opposite to the recommendation model predicate from the attribute graph data, and obtain the confidence according to the intersection of the union of the fourth matching result and the fifth matching result and the third matching result in combination with the support.

[0160] Optionally, the matching result determination unit includes:

[0161] A data matching subunit is used to determine node pairs consisting of first-category nodes and second-category nodes that satisfy the candidate predicate combination and the recommendation model predicate from the attribute graph data, and determine the double star data corresponding to each node pair;

[0162] The matching result compression sub-unit is used to compress the corresponding double star data of each node to obtain a compressed representation result, and determine that the double star data that is not an empty set in the compressed representation result is the third matching result, wherein the compressed representation is to merge all matching results of any node in any double star data except the first type of node and the second type of node. If any node is an empty set, the compressed representation result of the corresponding double star data is determined to be an empty set.

[0163] Optionally, if it is detected that the candidate predicate combination is obtained by adding a logical predicate to an original predicate combination, the matching result determination unit includes:

[0164] A history matching acquisition subunit is used to obtain the history matching results obtained when the original predicate combination calculates the corresponding support;

[0165] The dynamic matching subunit is configured to determine, from the historical matching results, a matching result that satisfies the added logical predicate as the third matching result.

[0166] 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.

[0167] In one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as shown in FIG9 . The computer device includes a processor, a memory, a network interface, and a database connected via a system bus. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a readable storage medium, and a database. The internal memory provides an environment for the operation of the operating system and the readable storage medium in the non-volatile storage medium. The database of the computer device is used to store user original data. The network interface of the computer device is used to communicate with an external terminal via a network connection. When the readable storage medium is executed by the processor, a prediction rule generation method based on attribute graph data is implemented.

[0168] In one embodiment, a computer device is provided, comprising a memory, a processor, and a readable storage medium stored in the memory and executable on the processor. When the processor executes the readable storage medium, the steps of the method for generating prediction rules based on attribute graph data in the above-described embodiment are implemented, such as steps S201-S204 shown in FIG. 2 , or the steps shown in FIG. 3 to FIG. 7 . To avoid repetition, these steps are not described here. Alternatively, when the processor executes the readable storage medium, the functions of the modules / units in the embodiment of the user data processing device are implemented, such as the functions of the pattern data generation module 81, predicate construction module 82, indicator calculation module 83, and prediction rule determination module 84 shown in FIG. 8 . To avoid repetition, these steps are not described here.

[0169] In one embodiment, one or more readable storage media storing computer-readable instructions are provided, and the computer-readable storage media stores computer-readable instructions. When the computer-readable instructions are executed by one or more processors, the one or more processors implement the steps of the prediction rule generation method based on attribute graph data in the above-mentioned embodiment, such as steps S201-S204 shown in Figure 2, or the steps shown in Figures 3 to 7. To avoid repetition, they are not described here. Alternatively, when the processor executes the readable storage medium, the functions of each module / unit in this embodiment of the user data processing device are implemented, such as the functions of the pattern data generation module 81, predicate construction module 82, indicator calculation module 83 and prediction rule determination module 84 shown in Figure 8. To avoid repetition, they are not described here. The readable storage medium in this embodiment includes a non-volatile readable storage medium and a volatile readable storage medium.

[0170] Those skilled in the art will understand that all or part of the processes in the above-mentioned embodiment methods can be implemented by instructing related hardware through a readable storage medium, and the readable storage medium can be stored in a non-volatile computer-readable storage medium. When the readable storage medium is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application may include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), Synchronous Link DRAM (SLDRAM), Rambus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.

[0171] Those skilled in the art will clearly understand that for the sake of convenience and brevity of description, only the division of the above-mentioned functional units and modules is used as an example. 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.

[0172] The above-described 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 prediction rule generation method based on attribute graph data, wherein: The prediction rule generation method comprises: Extracting a pair of double star data from a pair of attribute graph data, the pair of double star data comprising a first type of node and at least one first node path connecting the first type of node, and a second type of node and at least one second node path connecting the second type of node, the first type of node and the second type of node being of different node categories, and nodes on any two node paths being disjoint; Based on a preset recommendation model, a recommendation model predicate is constructed, and based on a preset predicate formula, a predicate is constructed for a first attribute node in each first node path and a second attribute node in each second node path to obtain at least one candidate logical predicate, wherein the first attribute node and the second attribute node have the same attribute; According to the at least one candidate logical predicate, at least one candidate predicate combination is constructed, and for any candidate predicate combination, the support and confidence of the candidate predicate combination in the attribute graph data are calculated in combination with the recommendation model predicate; Determine the candidate predicate combination whose support and confidence both meet preset conditions as the target predicate combination, fuse each target predicate combination with the recommendation model predicate respectively, and obtain the fusion result as the prediction rule for optimizing the recommendation model.

2. The prediction rule generation method according to claim 1, wherein: The step of constructing at least one candidate predicate combination according to the at least one candidate logical predicate, and calculating the support and confidence of any candidate predicate combination in the attribute graph data in combination with the recommendation model predicate, includes: According to the first matching result satisfying each candidate logical predicate in the attribute graph data, the Gini index of the corresponding candidate logical predicate is calculated, and the candidate logical predicate with the smallest Gini index is used as the initial predicate combination; The initial predicate combination is used as a candidate predicate combination, and the support and confidence of the candidate predicate combination in the attribute graph data are calculated according to the candidate predicate combination and the recommendation model predicates.

3. The prediction rule generation method according to claim 2, wherein: After calculating the support and confidence of the candidate predicate combination in the attribute graph data according to the candidate predicate combination and the recommendation model predicate, the method further includes: Detecting whether the support and the confidence both satisfy the preset condition; if it is detected that the support or the confidence does not satisfy the preset condition, adding another logical predicate to the initial predicate combination to obtain an updated predicate combination, wherein the other logical predicate is any logical predicate in the at least one candidate logical predicate that does not appear in the initial predicate combination; Calculate the Gini index of each updated predicate combination, select the updated predicate combination with the smallest Gini index from all updated predicate combinations, and use the updated predicate combination as the initial predicate combination; Return to executing the step of taking the initial predicate combination as a candidate predicate combination, and calculating the support and confidence of the candidate predicate combination in the attribute graph data according to the candidate predicate combination and the recommendation model predicate, until it is detected that both the support and the confidence meet the preset condition or the iteration reaches a preset number of times.

4. The prediction rule generation method according to claim 3, wherein: The calculation of the Gini index of each updated predicate combination includes: Obtaining a second matching result in the property graph data that satisfies the initial predicate combination; For any updated predicate combination, determining, from the second matching result, first data satisfying the updated predicate combination and second data not satisfying the updated predicate combination; A Gini index corresponding to the updated predicate combination is calculated according to the second matching result, the first data, and the second data.

5. The prediction rule generation method according to any one of claims 1 to 4, wherein: The calculating the support and confidence of the candidate predicate combination in the property graph data includes: Determine from the attribute graph data a third matching result that satisfies the candidate predicate combination and the recommendation model predicate. determining a fourth matching result satisfying the recommendation model predicate from the attribute graph data; Calculating support according to the intersection of the third matching result and the fourth matching result; A fifth matching result satisfying a logical predicate opposing the recommendation model predicate is determined from the attribute graph data, and a confidence level is obtained based on an intersection of a union of the fourth matching result and the fifth matching result and the third matching result in combination with the support level.

6. The prediction rule generation method according to claim 5, wherein: The determining, from the property graph data, a third matching result satisfying the candidate predicate combination and the recommendation model predicate comprises: Determine from the attribute graph data node pairs consisting of first-type nodes and second-type nodes that satisfy the candidate predicate combination and the recommendation model predicate, and determine double star data corresponding to each node pair; Perform compression representation on the double star data corresponding to each node pair to obtain a compression representation result, and determine that the double star data in the compression representation result that is not an empty set is the third matching result, wherein the compression representation is to merge all matching results of any node in any double star data except the first type of node and the second type of node, and if any node is an empty set, determine that the compression representation result of the corresponding double star data is an empty set.

7. The prediction rule generation method according to claim 5, wherein: If it is detected that the candidate predicate combination is obtained by adding a logical predicate to an original predicate combination, then determining a third matching result satisfying the candidate predicate combination and the recommendation model predicate from the attribute graph data includes: Obtaining historical matching results obtained when calculating corresponding support of the original predicate combination; The matching result satisfying the added logical predicate is determined in the historical matching results as the third matching result.

8. A prediction rule generation device based on attribute graph data, wherein: The prediction rule generating device comprises: A pattern data generation module, used for extracting a pair of double star data from a property graph data, wherein the double star data includes a first type of node and at least one first node path connecting the first type of node, and a second type of node and at least one second node path connecting the second type of node, wherein the first type of node and the second type of node are different node categories, and the nodes on any two node paths do not intersect; A predicate construction module is used to construct a recommendation model predicate based on a preset recommendation model, and to perform predicate construction on a first attribute node in each first node path and a second attribute node in each second node path based on a preset predicate formula to obtain at least one candidate logical predicate, wherein the first attribute node and the second attribute node have the same attribute; An indicator calculation module, configured to construct at least one candidate predicate combination according to the at least one candidate logical predicate, and for any candidate predicate combination, calculate the support and confidence of the candidate predicate combination in the attribute graph data in combination with the recommendation model predicate; The prediction rule determination module is used to determine the candidate predicate combination whose support and confidence both meet the preset conditions as the target predicate combination, and fuse each target predicate combination with the recommendation model predicate respectively to obtain the fusion result as the prediction rule for optimizing the recommendation model.

9. A computer device comprising a memory, a processor, and a readable storage medium stored in the memory and executable on the processor, wherein: When the processor executes the readable storage medium, the following steps are implemented: Extracting a pair of double star data from a pair of attribute graph data, the pair of double star data comprising a first type of node and at least one first node path connecting the first type of node, and a second type of node and at least one second node path connecting the second type of node, the first type of node and the second type of node being of different node categories, and nodes on any two node paths being disjoint; Based on a preset recommendation model, a recommendation model predicate is constructed, and based on a preset predicate formula, a predicate is constructed for a first attribute node in each first node path and a second attribute node in each second node path to obtain at least one candidate logical predicate, wherein the first attribute node and the second attribute node have the same attribute; According to the at least one candidate logical predicate, at least one candidate predicate combination is constructed, and for any candidate predicate combination, the support and confidence of the candidate predicate combination in the attribute graph data are calculated in combination with the recommendation model predicate; Determine the candidate predicate combination whose support and confidence both meet preset conditions as the target predicate combination, fuse each target predicate combination with the recommendation model predicate respectively, and obtain the fusion result as the prediction rule for optimizing the recommendation model.

10. The computer device of claim 9, wherein: The step of constructing at least one candidate predicate combination according to the at least one candidate logical predicate, and calculating the support and confidence of any candidate predicate combination in the attribute graph data in combination with the recommendation model predicate, includes: According to the first matching result satisfying each candidate logical predicate in the attribute graph data, the Gini index of the corresponding candidate logical predicate is calculated, and the candidate logical predicate with the smallest Gini index is used as the initial predicate combination; The initial predicate combination is used as a candidate predicate combination, and the support and confidence of the candidate predicate combination in the attribute graph data are calculated according to the candidate predicate combination and the recommendation model predicates.

11. The computer device of claim 10, wherein: After calculating the support and confidence of the candidate predicate combination in the attribute graph data according to the candidate predicate combination and the recommendation model predicate, the method further includes: Detecting whether the support and the confidence both satisfy the preset condition; if it is detected that the support or the confidence does not satisfy the preset condition, adding another logical predicate to the initial predicate combination to obtain an updated predicate combination, wherein the other logical predicate is any logical predicate in the at least one candidate logical predicate that does not appear in the initial predicate combination; Calculate the Gini index of each updated predicate combination, select the updated predicate combination with the smallest Gini index from all updated predicate combinations, and use the updated predicate combination as the initial predicate combination; Return to executing the step of taking the initial predicate combination as a candidate predicate combination, and calculating the support and confidence of the candidate predicate combination in the attribute graph data according to the candidate predicate combination and the recommendation model predicate, until it is detected that both the support and the confidence meet the preset condition or the iteration reaches a preset number of times.

12. The computer device of claim 11, wherein: The calculation of the Gini index of each updated predicate combination includes: Obtaining a second matching result in the property graph data that satisfies the initial predicate combination; For any updated predicate combination, determining, from the second matching result, first data satisfying the updated predicate combination and second data not satisfying the updated predicate combination; A Gini index corresponding to the updated predicate combination is calculated according to the second matching result, the first data, and the second data.

13. The computer device according to any one of claims 9 to 12, wherein: The calculating the support and confidence of the candidate predicate combination in the property graph data includes: Determine a third matching result satisfying the candidate predicate combination and the recommendation model predicate from the property graph data, and determine a fourth matching result satisfying the recommendation model predicate from the property graph data; Calculating support according to the intersection of the third matching result and the fourth matching result; A fifth matching result satisfying a logical predicate opposing the recommendation model predicate is determined from the attribute graph data, and a confidence level is obtained based on an intersection of a union of the fourth matching result and the fifth matching result and the third matching result in combination with the support level.

14. The computer device of claim 13, wherein: The determining, from the property graph data, a third matching result satisfying the candidate predicate combination and the recommendation model predicate comprises: Determine from the attribute graph data node pairs consisting of first-type nodes and second-type nodes that satisfy the candidate predicate combination and the recommendation model predicate, and determine double star data corresponding to each node pair; Perform compression representation on the double star data corresponding to each node pair to obtain a compression representation result, and determine that the double star data in the compression representation result that is not an empty set is the third matching result, wherein the compression representation is to merge all matching results of any node in any double star data except the first type of node and the second type of node, and if any node is an empty set, determine that the compression representation result of the corresponding double star data is an empty set.

15. The computer device of claim 13, wherein: If it is detected that the candidate predicate combination is obtained by adding a logical predicate to an original predicate combination, then determining a third matching result satisfying the candidate predicate combination and the recommendation model predicate from the attribute graph data includes: Obtaining historical matching results obtained when calculating corresponding support of the original predicate combination; The matching result satisfying the added logical predicate is determined in the historical matching results as the third matching result.

16. One or more computer-readable storage media storing computer-readable instructions, wherein: When the computer readable instructions are executed by one or more processors, the one or more processors perform the following steps: Extracting a pair of double star data from a pair of attribute graph data, the pair of double star data comprising a first type of node and at least one first node path connecting the first type of node, and a second type of node and at least one second node path connecting the second type of node, the first type of node and the second type of node being of different node categories, and nodes on any two node paths being disjoint; Based on a preset recommendation model, a recommendation model predicate is constructed, and based on a preset predicate formula, a predicate is constructed for a first attribute node in each first node path and a second attribute node in each second node path to obtain at least one candidate logical predicate, wherein the first attribute node and the second attribute node have the same attribute; According to the at least one candidate logical predicate, at least one candidate predicate combination is constructed, and for any candidate predicate combination, the support and confidence of the candidate predicate combination in the attribute graph data are calculated in combination with the recommendation model predicate; Determine the candidate predicate combination whose support and confidence both meet preset conditions as the target predicate combination, fuse each target predicate combination with the recommendation model predicate respectively, and obtain the fusion result as the prediction rule for optimizing the recommendation model.

17. The readable storage medium according to claim 16, wherein: The step of constructing at least one candidate predicate combination according to the at least one candidate logical predicate, and calculating the support and confidence of any candidate predicate combination in the attribute graph data in combination with the recommendation model predicate, includes: According to the first matching result satisfying each candidate logical predicate in the attribute graph data, the Gini index of the corresponding candidate logical predicate is calculated, and the candidate logical predicate with the smallest Gini index is used as the initial predicate combination; The initial predicate combination is used as a candidate predicate combination, and the support and confidence of the candidate predicate combination in the attribute graph data are calculated according to the candidate predicate combination and the recommendation model predicates.

18. The readable storage medium according to claim 17, wherein: After calculating the support and confidence of the candidate predicate combination in the attribute graph data according to the candidate predicate combination and the recommendation model predicate, the method further includes: Detecting whether the support and the confidence both satisfy the preset condition; if it is detected that the support or the confidence does not satisfy the preset condition, adding another logical predicate to the initial predicate combination to obtain an updated predicate combination, wherein the other logical predicate is any logical predicate in the at least one candidate logical predicate that does not appear in the initial predicate combination; Calculate the Gini index of each updated predicate combination, select the updated predicate combination with the smallest Gini index from all updated predicate combinations, and use the updated predicate combination as the initial predicate combination; Return to executing the step of taking the initial predicate combination as a candidate predicate combination, and calculating the support and confidence of the candidate predicate combination in the attribute graph data according to the candidate predicate combination and the recommendation model predicate, until it is detected that both the support and the confidence meet the preset condition or the iteration reaches a preset number of times.

19. The readable storage medium according to claim 18, wherein: The calculation of the Gini index of each updated predicate combination includes: Obtaining a second matching result in the property graph data that satisfies the initial predicate combination; For any updated predicate combination, determine the first predicate combination that satisfies the updated predicate combination from the second matching results. first data, and second data that does not satisfy the updated predicate combination; A Gini index corresponding to the updated predicate combination is calculated according to the second matching result, the first data, and the second data.

20. The readable storage medium according to any one of claims 16 to 19, wherein: The calculating the support and confidence of the candidate predicate combination in the property graph data includes: Determine a third matching result satisfying the candidate predicate combination and the recommendation model predicate from the property graph data, and determine a fourth matching result satisfying the recommendation model predicate from the property graph data; Calculating support according to the intersection of the third matching result and the fourth matching result; A fifth matching result satisfying a logical predicate opposing the recommendation model predicate is determined from the attribute graph data, and a confidence level is obtained based on an intersection of a union of the fourth matching result and the fifth matching result and the third matching result in combination with the support level.

Citation Information

Patent Citations

  • Graph matching method and device, electronic equipment and storage medium

    CN113505278A

  • Parallel graph rule mining method and device based on data sampling

    CN115358397A

  • Distributed database recommendation index generation method

    CN116483831A

  • Predictive analytics using sentence data model

    US10990881B1

  • Method and apparatus for association rules with graph patterns

    US20170228448A1